Bug 624028 - Part 2: Add "Pair a Device" link to the home page. r=mfinkle

This commit is contained in:
Philipp von Weitershausen 2011-10-26 16:21:20 -07:00
parent 642c48979b
commit 3fa95ff749
3 changed files with 24 additions and 4 deletions

View File

@ -96,6 +96,7 @@
</div>
<div id="sync-setup">
<a id="syncSetupSync" href="#" onclick="openSetupSyncWizard();">&aboutHome.setupSync;</a>
<a id="syncPairDevice" href="#" onclick="openPairDeviceWizard();">&aboutHome.syncPairDevice;</a>
</div>
</div>
</div>
@ -433,8 +434,10 @@
function initSetupSync() {
let services = getChromeWin().Services;
if (services.prefs.prefHasUserValue("services.sync.username")) {
document.getElementById("syncSetupSync").style.display = "none";
}
syncConnected();
} else {
syncDisconnected();
}
services.obs.addObserver(syncConnected, "weave:service:setup-complete", false);
services.obs.addObserver(syncDisconnected, "weave:service:start-over", false);
}
@ -447,10 +450,12 @@
function syncConnected() {
document.getElementById("syncSetupSync").style.display = "none";
document.getElementById("syncPairDevice").style.display = "inline";
}
function syncDisconnected() {
document.getElementById("syncSetupSync").style.display = "inline";
document.getElementById("syncPairDevice").style.display = "none";
}
function openSetupSyncWizard() {
@ -458,6 +463,11 @@
chromeWin.WeaveGlue.open();
}
function openPairDeviceWizard() {
let chromeWin = getChromeWin();
chromeWin.SyncPairDevice.open();
}
function initLightbox() {
let prefs = getChromeWin().Services.prefs;
let channel = prefs.getCharPref("app.update.channel");

View File

@ -19,4 +19,13 @@
(aboutHome.forAndroid): Second line of a multi-line button. Treat as a subtitle.
-->
<!ENTITY aboutHome.forAndroid "for Android">
<!ENTITY aboutHome.setupSync "Set Up Sync">
<!-- LOCALIZATION NOTE:
(aboutHome.setupSync): This string should match the desktop
equivalent, in particular concerning syncBrand.fullName.label.
-->
<!ENTITY aboutHome.setupSync "Set Up Sync">
<!-- LOCALIZATION NOTE:
(aboutHome.syncPairDevice): This string should match the desktop
equivalent, in particular concerning syncBrand.fullName.label.
-->
<!ENTITY aboutHome.syncPairDevice "Pair a Device">

View File

@ -267,7 +267,8 @@ body[dir="rtl"] {
text-align: center;
}
#syncSetupSync {
#syncSetupSync,
#syncPairDevice {
text-decoration: underline;
color: blue;
}