From 0a197f308e66ab3a111520a35cbd35040b6d3e67 Mon Sep 17 00:00:00 2001 From: Simon Kornblith Date: Sun, 3 Jul 2011 04:33:37 +0000 Subject: [PATCH] - Open https://www.zotero.org/start_standalone (which doesn't yet exist) in default browser on Standalone first start. This will provide a place to download connectors and create an account. - Don't copy quickstart setting during prefs migration - Register zotero-reloaded nsIObserver properly --- chrome/content/zotero/xpcom/zotero.js | 3 ++- chrome/content/zotero/zoteroPane.js | 24 ++++++++++++++---------- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/chrome/content/zotero/xpcom/zotero.js b/chrome/content/zotero/xpcom/zotero.js index ce11a43ca..6f4ee0813 100644 --- a/chrome/content/zotero/xpcom/zotero.js +++ b/chrome/content/zotero/xpcom/zotero.js @@ -395,7 +395,8 @@ if(appInfo.platformVersion[0] >= 2) { Components.utils.evalInSandbox(prefsJs, sandbox); var prefs = new XPCSafeJSObjectWrapper(sandbox.prefs); for(var key in prefs) { - if(key.substr(0, ZOTERO_CONFIG.PREF_BRANCH.length) == ZOTERO_CONFIG.PREF_BRANCH) { + if(key.substr(0, ZOTERO_CONFIG.PREF_BRANCH.length) === ZOTERO_CONFIG.PREF_BRANCH + && key !== "extensions.zotero.firstRun2") { Zotero.Prefs.set(key.substr(ZOTERO_CONFIG.PREF_BRANCH.length), prefs[key]); } } diff --git a/chrome/content/zotero/zoteroPane.js b/chrome/content/zotero/zoteroPane.js index 5049080b6..029c4a9f6 100644 --- a/chrome/content/zotero/zoteroPane.js +++ b/chrome/content/zotero/zoteroPane.js @@ -137,7 +137,7 @@ var ZoteroPane = new function() // register an observer for Zotero reload observerService = Components.classes["@mozilla.org/observer-service;1"] .getService(Components.interfaces.nsIObserverService); - observerService.addObserver(_reload, "zotero-reloaded", false); + observerService.addObserver(_reloadObserver, "zotero-reloaded", false); this.addReloadListener(_loadPane); // continue loading pane @@ -227,11 +227,10 @@ var ZoteroPane = new function() else if (Zotero.Prefs.get('firstRun2')) { if (Zotero.Schema.dbInitialized || !Zotero.Sync.Server.enabled) { setTimeout(function () { - const url = "https://www.zotero.org/start"; if(Zotero.isStandalone) { - ZoteroStandalone.openInViewer(url); + ZoteroPane_Local.loadURI("https://www.zotero.org/start_standalone"); } else { - gBrowser.selectedTab = gBrowser.addTab(url); + gBrowser.selectedTab = gBrowser.addTab("https://www.zotero.org/start"); } }, 400); } @@ -347,7 +346,7 @@ var ZoteroPane = new function() if (this.itemsView) this.itemsView.unregister(); - observerService.removeObserver(_reload, "zotero-reloaded", false); + observerService.removeObserver(_reloadObserver, "zotero-reloaded", false); } /** @@ -3714,12 +3713,17 @@ var ZoteroPane = new function() } /** - * Called when Zotero is reloaded (i.e., if it is switched into or out of connector mode) + * Implements nsIObserver for Zotero reload */ - function _reload() { - Zotero.debug("Reloading Zotero pane"); - for each(var func in _reloadFunctions) func(); - } + var _reloadObserver = { + /** + * Called when Zotero is reloaded (i.e., if it is switched into or out of connector mode) + */ + "observe":function() { + Zotero.debug("Reloading Zotero pane"); + for each(var func in _reloadFunctions) func(); + } + }; } /**