зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset 0ad328359d97 (bug 992388) for browser_bug731866.js failures.
CLOSED TREE
This commit is contained in:
Родитель
8ceae22e62
Коммит
b28ef0279a
|
@ -186,17 +186,6 @@ let gSyncPane = {
|
|||
}
|
||||
},
|
||||
|
||||
_closeSyncStatusMessageBox: function() {
|
||||
document.getElementById("syncStatusMessage").removeAttribute("message-type");
|
||||
document.getElementById("syncStatusMessageTitle").textContent = "";
|
||||
document.getElementById("syncStatusMessageDescription").textContent = "";
|
||||
let learnMoreLink = document.getElementById("learnMoreLink");
|
||||
if (learnMoreLink) {
|
||||
learnMoreLink.parentNode.removeChild(learnMoreLink);
|
||||
}
|
||||
document.getElementById("sync-migration-buttons-deck").hidden = true;
|
||||
},
|
||||
|
||||
_setupEventListeners: function() {
|
||||
function setEventListener(aId, aEventType, aCallback)
|
||||
{
|
||||
|
@ -204,9 +193,6 @@ let gSyncPane = {
|
|||
.addEventListener(aEventType, aCallback.bind(gSyncPane));
|
||||
}
|
||||
|
||||
setEventListener("syncStatusMessageClose", "command", function () {
|
||||
gSyncPane._closeSyncStatusMessageBox();
|
||||
});
|
||||
setEventListener("noAccountSetup", "click", function (aEvent) {
|
||||
aEvent.stopPropagation();
|
||||
gSyncPane.openSetup(null);
|
||||
|
@ -445,17 +431,16 @@ let gSyncPane = {
|
|||
},
|
||||
|
||||
updateMigrationState: function(subject, state) {
|
||||
this._closeSyncStatusMessageBox();
|
||||
let selIndex;
|
||||
let sb = this._accountsStringBundle;
|
||||
switch (state) {
|
||||
case fxaMigrator.STATE_USER_FXA: {
|
||||
let sb = this._accountsStringBundle;
|
||||
// There are 2 cases here - no email address means it is an offer on
|
||||
// the first device (so the user is prompted to create an account).
|
||||
// If there is an email address it is the "join the party" flow, so the
|
||||
// user is prompted to sign in with the address they previously used.
|
||||
let email = subject ? subject.QueryInterface(Components.interfaces.nsISupportsString).data : null;
|
||||
let elt = document.getElementById("syncStatusMessageDescription");
|
||||
let elt = document.getElementById("sync-migrate-upgrade-description");
|
||||
elt.textContent = email ?
|
||||
sb.formatStringFromName("signInAfterUpgradeOnOtherDevice.description",
|
||||
[email], 1) :
|
||||
|
@ -464,12 +449,11 @@ let gSyncPane = {
|
|||
// The "Learn more" link.
|
||||
if (!email) {
|
||||
let learnMoreLink = document.createElement("label");
|
||||
learnMoreLink.id = "learnMoreLink";
|
||||
learnMoreLink.className = "text-link";
|
||||
let { text, href } = fxaMigrator.learnMoreLink;
|
||||
learnMoreLink.setAttribute("value", text);
|
||||
learnMoreLink.href = href;
|
||||
elt.parentNode.insertBefore(learnMoreLink, elt.nextSibling);
|
||||
elt.appendChild(learnMoreLink);
|
||||
}
|
||||
|
||||
// The "upgrade" button.
|
||||
|
@ -497,7 +481,7 @@ let gSyncPane = {
|
|||
let sb = this._accountsStringBundle;
|
||||
let email = subject.QueryInterface(Components.interfaces.nsISupportsString).data;
|
||||
let label = sb.formatStringFromName("needVerifiedUserLong", [email], 1);
|
||||
let elt = document.getElementById("syncStatusMessageDescription");
|
||||
let elt = document.getElementById("sync-migrate-verify-label");
|
||||
elt.setAttribute("value", label);
|
||||
// The "resend" button.
|
||||
let button = document.getElementById("sync-migrate-resend");
|
||||
|
@ -517,8 +501,8 @@ let gSyncPane = {
|
|||
document.getElementById("sync-migration").hidden = true;
|
||||
return;
|
||||
}
|
||||
document.getElementById("sync-migration-buttons-deck").selectedIndex = selIndex;
|
||||
document.getElementById("syncStatusMessage").setAttribute("message-type", "migration");
|
||||
document.getElementById("sync-migration").hidden = false;
|
||||
document.getElementById("sync-migration-deck").selectedIndex = selIndex;
|
||||
},
|
||||
|
||||
// Called whenever one of the sync engine preferences is changed.
|
||||
|
@ -694,39 +678,23 @@ let gSyncPane = {
|
|||
},
|
||||
|
||||
verifyFirefoxAccount: function() {
|
||||
this._closeSyncStatusMessageBox();
|
||||
let changesyncStatusMessage = (data) => {
|
||||
let isError = !data;
|
||||
let syncStatusMessage = document.getElementById("syncStatusMessage");
|
||||
let syncStatusMessageTitle = document.getElementById("syncStatusMessageTitle");
|
||||
let syncStatusMessageDescription = document.getElementById("syncStatusMessageDescription");
|
||||
let maybeNot = isError ? "Not" : "";
|
||||
fxAccounts.resendVerificationEmail().then(() => {
|
||||
fxAccounts.getSignedInUser().then(data => {
|
||||
let sb = this._accountsStringBundle;
|
||||
let title = sb.GetStringFromName("verification" + maybeNot + "SentTitle");
|
||||
let email = !isError && data ? data.email : "";
|
||||
let description = sb.formatStringFromName("verification" + maybeNot + "SentFull", [email], 1)
|
||||
let title = sb.GetStringFromName("verificationSentTitle");
|
||||
let heading = sb.formatStringFromName("verificationSentHeading",
|
||||
[data.email], 1);
|
||||
let description = sb.GetStringFromName("verificationSentDescription");
|
||||
|
||||
syncStatusMessageTitle.textContent = title;
|
||||
syncStatusMessageDescription.textContent = description;
|
||||
let messageType = isError ? "verify-error" : "verify-success";
|
||||
syncStatusMessage.setAttribute("message-type", messageType);
|
||||
}
|
||||
let factory = Cc["@mozilla.org/prompter;1"]
|
||||
.getService(Ci.nsIPromptFactory);
|
||||
let prompt = factory.getPrompt(window, Ci.nsIPrompt);
|
||||
let bag = prompt.QueryInterface(Ci.nsIWritablePropertyBag2);
|
||||
bag.setPropertyAsBool("allowTabModal", true);
|
||||
|
||||
let onError = () => {
|
||||
changesyncStatusMessage();
|
||||
};
|
||||
|
||||
let onSuccess = data => {
|
||||
if (data) {
|
||||
changesyncStatusMessage(data);
|
||||
} else {
|
||||
onError();
|
||||
}
|
||||
};
|
||||
|
||||
fxAccounts.resendVerificationEmail()
|
||||
.then(fxAccounts.getSignedInUser, onError)
|
||||
.then(onSuccess, onError);
|
||||
prompt.alert(title, heading + "\n\n" + description);
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
openOldSyncSupportPage: function() {
|
||||
|
|
|
@ -38,27 +38,30 @@
|
|||
<label class="header-name">&paneSync.title;</label>
|
||||
</hbox>
|
||||
|
||||
<hbox id="syncStatusMessage"
|
||||
data-category="paneSync">
|
||||
<vbox id="syncStatusMessageWrapper">
|
||||
<label id="syncStatusMessageTitle"></label>
|
||||
<description id="syncStatusMessageDescription"></description>
|
||||
<deck id="sync-migration-buttons-deck">
|
||||
<hbox id="sync-migration-container"
|
||||
data-category="paneSync"
|
||||
hidden="true">
|
||||
|
||||
<vbox id="sync-migration" flex="1" hidden="true">
|
||||
|
||||
<deck id="sync-migration-deck">
|
||||
<!-- When we are in the "need FxA user" state -->
|
||||
<hbox>
|
||||
<hbox align="center">
|
||||
<description id="sync-migrate-upgrade-description" flex="1"/>
|
||||
<spacer flex="1"/>
|
||||
<button id="sync-migrate-unlink"/>
|
||||
<button id="sync-migrate-upgrade"/>
|
||||
</hbox>
|
||||
|
||||
<!-- When we are in the "need the user to be verified" state -->
|
||||
<hbox>
|
||||
<hbox align="center">
|
||||
<label id="sync-migrate-verify-label"/>
|
||||
<spacer flex="1"/>
|
||||
<button id="sync-migrate-forget"/>
|
||||
<button id="sync-migrate-resend"/>
|
||||
</hbox>
|
||||
</deck>
|
||||
</vbox>
|
||||
<vbox>
|
||||
<button id="syncStatusMessageClose" class="close-icon"/>
|
||||
</vbox>
|
||||
</hbox>
|
||||
|
||||
<deck id="weavePrefsDeck" data-category="paneSync" hidden="true">
|
||||
|
|
|
@ -43,10 +43,7 @@ verificationSentTitle = Verification Sent
|
|||
# LOCALIZATION NOTE (verificationSentHeading) - %S = Email address of user's Firefox Account
|
||||
verificationSentHeading = A verification link has been sent to %S
|
||||
verificationSentDescription = Please check your email and click the link to begin syncing.
|
||||
# LOCALIZATION NOTE (verificationSentFull) - %S = Email address of user's Firefox Account
|
||||
verificationSentFull = A verification link has been sent to %S. Please check your email and click the link to begin syncing.
|
||||
|
||||
verificationNotSentTitle = Unable to Send Verification
|
||||
verificationNotSentHeading = We are unable to send a verification mail at this time
|
||||
verificationNotSentDescription = Please try again later.
|
||||
verificationNotSentFull = We are unable to send a verification mail at this time, please try again later.
|
||||
|
|
|
@ -415,101 +415,6 @@ description > html|a {
|
|||
-moz-box-align: start;
|
||||
}
|
||||
|
||||
#syncStatusMessage {
|
||||
visibility: collapse;
|
||||
opacity: 0;
|
||||
transition: opacity 1s linear;
|
||||
padding: 14px 8px 14px 14px;
|
||||
border-radius: 2px;
|
||||
}
|
||||
|
||||
#syncStatusMessage[message-type] {
|
||||
visibility: visible;
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
#syncStatusMessage[message-type="verify-success"] {
|
||||
background-color: #74BF43;
|
||||
}
|
||||
|
||||
#syncStatusMessage[message-type="verify-error"] {
|
||||
background-color: #D74345;
|
||||
}
|
||||
|
||||
#syncStatusMessage[message-type="migration"] {
|
||||
background-color: #FF9500;
|
||||
}
|
||||
|
||||
#sync-migration-buttons-deck {
|
||||
visibility: collapse;
|
||||
}
|
||||
|
||||
#learnMoreLink {
|
||||
margin: 0;
|
||||
color: #FBFBFB;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
#syncStatusMessage[message-type="migration"] #sync-migration-buttons-deck {
|
||||
visibility: visible;
|
||||
}
|
||||
|
||||
#sync-migration-buttons-deck {
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
#sync-migration-buttons-deck button {
|
||||
margin: 0 10px 0 0;
|
||||
border: 0;
|
||||
border-radius: 2px;
|
||||
}
|
||||
|
||||
#sync-migrate-upgrade,
|
||||
#sync-migrate-resend {
|
||||
background-color: #0095DD;
|
||||
color: #FBFBFB;
|
||||
}
|
||||
|
||||
#sync-migrate-upgrade:hover,
|
||||
#sync-migrate-resend:hover {
|
||||
background-color: #008ACB;
|
||||
}
|
||||
|
||||
#sync-migrate-upgrade:hover:active,
|
||||
#sync-migrate-resend:hover:active {
|
||||
background-color: #006B9D;
|
||||
}
|
||||
|
||||
#syncStatusMessageWrapper {
|
||||
-moz-box-flex: 1;
|
||||
padding-right: 5px;
|
||||
}
|
||||
|
||||
#syncStatusMessageTitle, #syncStatusMessageDescription {
|
||||
color: #FBFBFB;
|
||||
}
|
||||
|
||||
#syncStatusMessage[message-type="migration"] #syncStatusMessageTitle {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#syncStatusMessageTitle {
|
||||
font-weight: bold !important;
|
||||
font-size: 16px;
|
||||
line-height: 157%;
|
||||
margin: 0 0 20px;
|
||||
}
|
||||
|
||||
#syncStatusMessageDescription {
|
||||
font-size: 14px;
|
||||
line-height: 158%;
|
||||
margin: 0 !important;
|
||||
}
|
||||
|
||||
#syncStatusMessageClose {
|
||||
margin: 0px;
|
||||
}
|
||||
|
||||
#fxaSyncEngines > vbox:first-child {
|
||||
margin-right: 80px;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче