Bug 957425 - make landing pages for sync on about:accounts. r=markh
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user