From 5d02c22076b3c1350fd46b3596a839fa915033a2 Mon Sep 17 00:00:00 2001 From: "Matt A. Tobin" Date: Sun, 21 Apr 2019 12:59:20 -0400 Subject: [PHOENIX] Fix missing default from lastSync in browser-syncui.js in Pale Moon and replace the tryblock in Basilisk --- application/basilisk/base/content/browser-syncui.js | 6 +----- application/palemoon/base/content/browser-syncui.js | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) (limited to 'application') diff --git a/application/basilisk/base/content/browser-syncui.js b/application/basilisk/base/content/browser-syncui.js index d0f46247a..ee84391b3 100644 --- a/application/basilisk/base/content/browser-syncui.js +++ b/application/basilisk/base/content/browser-syncui.js @@ -281,11 +281,7 @@ var gSyncUI = { if (!syncButton) return; - let lastSync; - try { - lastSync = Services.prefs.getCharPref("services.sync.lastSync"); - } - catch (e) { }; + let lastSync = Services.prefs.getCharPref("services.sync.lastSync", ""); if (!lastSync || this._needsSetup()) { syncButton.removeAttribute("tooltiptext"); return; diff --git a/application/palemoon/base/content/browser-syncui.js b/application/palemoon/base/content/browser-syncui.js index 6fad03cdd..b9a3db2eb 100644 --- a/application/palemoon/base/content/browser-syncui.js +++ b/application/palemoon/base/content/browser-syncui.js @@ -282,7 +282,7 @@ var gSyncUI = { if (!syncButton) return; - let lastSync = Services.prefs.getCharPref("services.sync.lastSync"); + let lastSync = Services.prefs.getCharPref("services.sync.lastSync", ""); if (!lastSync || this._needsSetup()) { syncButton.removeAttribute("tooltiptext"); return; -- cgit v1.2.3 From ccd86d8c0b234ebb3d95ec3eb0222a9e555c673c Mon Sep 17 00:00:00 2001 From: "Matt A. Tobin" Date: Sun, 21 Apr 2019 13:10:31 -0400 Subject: Issue #1049 - Show sync status via label of sync-button --- application/basilisk/base/content/browser-syncui.js | 15 ++++++++++++--- application/palemoon/base/content/browser-syncui.js | 15 ++++++++++++--- 2 files changed, 24 insertions(+), 6 deletions(-) (limited to 'application') diff --git a/application/basilisk/base/content/browser-syncui.js b/application/basilisk/base/content/browser-syncui.js index ee84391b3..f57472658 100644 --- a/application/basilisk/base/content/browser-syncui.js +++ b/application/basilisk/base/content/browser-syncui.js @@ -93,17 +93,25 @@ var gSyncUI = { document.getElementById("sync-setup-state").hidden = !needsSetup; document.getElementById("sync-syncnow-state").hidden = needsSetup; - if (!gBrowser) + if (!gBrowser) { return; + } let button = document.getElementById("sync-button"); - if (!button) + if (!button) { return; + } button.removeAttribute("status"); + this._updateLastSyncTime(); - if (needsSetup) + + if (needsSetup) { button.removeAttribute("tooltiptext"); + button.setAttribute("label", this._stringBundle.GetStringFromName("setupsync.label")); + } else { + button.setAttribute("label", this._stringBundle.GetStringFromName("syncnow.label")); + } }, @@ -117,6 +125,7 @@ var gSyncUI = { return; button.setAttribute("status", "active"); + button.setAttribute("label", this._stringBundle.GetStringFromName("syncing2.label")); }, onSyncDelay: function SUI_onSyncDelay() { diff --git a/application/palemoon/base/content/browser-syncui.js b/application/palemoon/base/content/browser-syncui.js index b9a3db2eb..86f6f48f1 100644 --- a/application/palemoon/base/content/browser-syncui.js +++ b/application/palemoon/base/content/browser-syncui.js @@ -93,17 +93,25 @@ var gSyncUI = { document.getElementById("sync-setup-state").hidden = !needsSetup; document.getElementById("sync-syncnow-state").hidden = needsSetup; - if (!gBrowser) + if (!gBrowser) { return; + } let button = document.getElementById("sync-button"); - if (!button) + if (!button) { return; + } button.removeAttribute("status"); + this._updateLastSyncTime(); - if (needsSetup) + + if (needsSetup) { button.removeAttribute("tooltiptext"); + button.setAttribute("label", this._stringBundle.GetStringFromName("setupsync.label")); + } else { + button.setAttribute("label", this._stringBundle.GetStringFromName("syncnow.label")); + } }, @@ -117,6 +125,7 @@ var gSyncUI = { return; button.setAttribute("status", "active"); + button.setAttribute("label", this._stringBundle.GetStringFromName("syncing2.label")); }, onSyncDelay: function SUI_onSyncDelay() { -- cgit v1.2.3