summaryrefslogtreecommitdiffstats
path: root/application/palemoon/base/content/sync/progress.js
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@wolfbeast.com>2019-01-06 15:14:54 +0100
committerwolfbeast <mcwerewolf@wolfbeast.com>2019-01-06 15:14:54 +0100
commitcc6a935ce54b573c1efd7533aff00e7bf0a9959c (patch)
treec8ad266edb7ea1e7b93aaaaa98847cf662373668 /application/palemoon/base/content/sync/progress.js
parentd129c900c9f943adb69c1fb20ba1a029fdd95cff (diff)
parent9f4afc2552a67cc675b8b8af2ecb8ebc04a473a7 (diff)
downloadUXP-cc6a935ce54b573c1efd7533aff00e7bf0a9959c.tar
UXP-cc6a935ce54b573c1efd7533aff00e7bf0a9959c.tar.gz
UXP-cc6a935ce54b573c1efd7533aff00e7bf0a9959c.tar.lz
UXP-cc6a935ce54b573c1efd7533aff00e7bf0a9959c.tar.xz
UXP-cc6a935ce54b573c1efd7533aff00e7bf0a9959c.zip
Merge branch 'master' into Pale_Moon-release
# Conflicts: # application/palemoon/components/feeds/FeedWriter.js # application/palemoon/config/version.txt # security/manager/ssl/nsSTSPreloadList.errors # security/manager/ssl/nsSTSPreloadList.inc
Diffstat (limited to 'application/palemoon/base/content/sync/progress.js')
-rw-r--r--application/palemoon/base/content/sync/progress.js71
1 files changed, 0 insertions, 71 deletions
diff --git a/application/palemoon/base/content/sync/progress.js b/application/palemoon/base/content/sync/progress.js
deleted file mode 100644
index 101160fa8..000000000
--- a/application/palemoon/base/content/sync/progress.js
+++ /dev/null
@@ -1,71 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://services-sync/main.js");
-
-var gProgressBar;
-var gCounter = 0;
-
-function onLoad(event) {
- Services.obs.addObserver(onEngineSync, "weave:engine:sync:finish", false);
- Services.obs.addObserver(onEngineSync, "weave:engine:sync:error", false);
- Services.obs.addObserver(onServiceSync, "weave:service:sync:finish", false);
- Services.obs.addObserver(onServiceSync, "weave:service:sync:error", false);
-
- gProgressBar = document.getElementById('uploadProgressBar');
-
- if (Services.prefs.getPrefType("services.sync.firstSync") != Ci.nsIPrefBranch.PREF_INVALID) {
- gProgressBar.hidden = false;
- }
- else {
- gProgressBar.hidden = true;
- }
-}
-
-function onUnload(event) {
- cleanUpObservers();
-}
-
-function cleanUpObservers() {
- try {
- Services.obs.removeObserver(onEngineSync, "weave:engine:sync:finish");
- Services.obs.removeObserver(onEngineSync, "weave:engine:sync:error");
- Services.obs.removeObserver(onServiceSync, "weave:service:sync:finish");
- Services.obs.removeObserver(onServiceSync, "weave:service:sync:error");
- }
- catch (e) {
- // may be double called by unload & exit. Ignore.
- }
-}
-
-function onEngineSync(subject, topic, data) {
- // The Clients engine syncs first. At this point we don't necessarily know
- // yet how many engines will be enabled, so we'll ignore the Clients engine
- // and evaluate how many engines are enabled when the first "real" engine
- // syncs.
- if (data == "clients") {
- return;
- }
-
- if (!gCounter &&
- Services.prefs.getPrefType("services.sync.firstSync") != Ci.nsIPrefBranch.PREF_INVALID) {
- gProgressBar.max = Weave.Service.engineManager.getEnabled().length;
- }
-
- gCounter += 1;
- gProgressBar.setAttribute("value", gCounter);
-}
-
-function onServiceSync(subject, topic, data) {
- // To address the case where 0 engines are synced, we will fill the
- // progress bar so the user knows that the sync has finished.
- gProgressBar.setAttribute("value", gProgressBar.max);
- cleanUpObservers();
-}
-
-function closeTab() {
- window.close();
-}