From a1f52aede43d1275c3707f38f2d222aeaf7e1f21 Mon Sep 17 00:00:00 2001 From: Simon Kornblith Date: Sun, 7 Nov 2010 04:36:39 +0000 Subject: [PATCH] slightly less ugly hack for opening cite preferences --- .../content/zotero/preferences/preferences.js | 3 +- components/zotero-protocol-handler.js | 38 ------------------- 2 files changed, 2 insertions(+), 39 deletions(-) diff --git a/chrome/content/zotero/preferences/preferences.js b/chrome/content/zotero/preferences/preferences.js index 547fc190e5..6a29148cc3 100644 --- a/chrome/content/zotero/preferences/preferences.js +++ b/chrome/content/zotero/preferences/preferences.js @@ -62,7 +62,6 @@ function init() if(window.arguments) { _io = window.arguments[0]; - if(_io.wrappedJSObject) _io = _io.wrappedJSObject; if(_io.pane) { var pane = document.getElementById(_io.pane); @@ -72,6 +71,8 @@ function init() checkPDFToolsDownloadVersion(); } } + } else if(document.location.hash == "#cite") { + document.getElementById('zotero-prefs').showPane(document.getElementById("zotero-prefpane-cite")); } } diff --git a/components/zotero-protocol-handler.js b/components/zotero-protocol-handler.js index f7b008fab4..3ad38269df 100644 --- a/components/zotero-protocol-handler.js +++ b/components/zotero-protocol-handler.js @@ -1043,41 +1043,6 @@ function ChromeExtensionHandler() { } }; - /** - * zotero://preferences - * zotero://preferences/zotero-prefpane-cite - */ - var PreferencesExtension = new function(){ - this.newChannel = newChannel; - - this.__defineGetter__('loadAsChrome', function () { return true; }); - - function newChannel(uri) { - var Zotero = Components.classes["@zotero.org/Zotero;1"] - .getService(Components.interfaces.nsISupports) - .wrappedJSObject; - - var data = {}; - var s = uri.path.split('/'); - if(s.length == 2) { - data.pane = s[1]; - } - data.wrappedJSObject = data; - - if(Zotero.isFx4 || !Zotero.isMac) { - var win = Components.classes["@mozilla.org/appshell/window-mediator;1"] - .getService(Components.interfaces.nsIWindowMediator) - .getMostRecentWindow("navigator:browser"); - win.close(); - } - - Components.classes["@mozilla.org/embedcomp/window-watcher;1"] - .getService(Components.interfaces.nsIWindowWatcher) - .openWindow(null, 'chrome://zotero/content/preferences/preferences.xul', '', - 'chrome,titlebar,toolbar', data); - } - }; - var ReportExtensionSpec = ZOTERO_SCHEME + "://report" this._extensions[ReportExtensionSpec] = ReportExtension; @@ -1098,9 +1063,6 @@ function ChromeExtensionHandler() { var ConnectorExtensionSpec = ZOTERO_SCHEME + "://connector" this._extensions[ConnectorExtensionSpec] = ConnectorExtension; - - var PreferencesExtensionSpec = ZOTERO_SCHEME + "://preferences" - this._extensions[PreferencesExtensionSpec] = PreferencesExtension; }