Bug 957425 - make landing pages for sync on about:accounts. r=markh

This commit is contained in:
Zachary Carter
2014-01-25 00:33:39 +11:00
parent ea84640643
commit e8b947404f
14 changed files with 973 additions and 1 deletions

View File

@@ -129,5 +129,53 @@ let wrapper = {
},
};
wrapper.init();
// Button onclick handlers
function handleOldSync() {
// we just want to navigate the current tab to the new location...
window.location = "https://services.mozilla.com/legacysync";
}
function getStarted() {
hide("intro");
hide("stage");
show("remote");
}
function openPrefs() {
window.openPreferences("paneSync");
}
function init() {
let signinQuery = window.location.href.match(/signin=true$/);
if (signinQuery) {
show("remote");
wrapper.init();
} else {
// Check if we have a local account
fxAccounts.getSignedInUser().then(user => {
if (user) {
show("stage");
show("manage");
} else {
show("stage");
show("intro");
// load the remote frame in the background
wrapper.init();
}
});
}
}
function show(id) {
document.getElementById(id).style.display = 'block';
}
function hide(id) {
document.getElementById(id).style.display = 'none';
}
document.addEventListener("DOMContentLoaded", function onload() {
document.removeEventListener("DOMContentLoaded", onload, true);
init();
}, true);