slightly less ugly hack for opening cite preferences

This commit is contained in:
Simon Kornblith 2010-11-07 04:36:39 +00:00
parent a1f327a97a
commit a1f52aede4
2 changed files with 2 additions and 39 deletions

View file

@ -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"));
}
}

View file

@ -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;
}