www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit a97d7ff26dfbef85fa96cf067bc0e3328ed070fb
parent ee01b2cbc394ccb4ae4e96920e5e358eea059d33
Author: Simon Kornblith <simon@simonster.com>
Date:   Thu,  4 Aug 2011 19:32:05 +0000

Add button to open about:config to advanced preferences pane. We could disable this for Zotero for Firefox, but I think it's probably a better idea to keep it so that docs can be made consistent.


Diffstat:
Mchrome/content/zotero/preferences/preferences.js | 55++++++++++++++++++++++++++++++-------------------------
Mchrome/content/zotero/preferences/preferences.xul | 5+++++
2 files changed, 35 insertions(+), 25 deletions(-)

diff --git a/chrome/content/zotero/preferences/preferences.js b/chrome/content/zotero/preferences/preferences.js @@ -1324,31 +1324,7 @@ Zotero_Preferences.Debug_Output = { view: function () { - const uri = "zotero://debug/"; - const features = "menubar=yes,toolbar=no,location=no,scrollbars,centerscreen,resizable"; - - var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"] - .getService(Components.interfaces.nsIWindowMediator); - - if(Zotero.isStandalone) { - var win = wm.getMostRecentWindow("zotero:basicViewer"); - if(win) { - win.loadURI(uri); - } else { - window.openDialog("chrome://zotero/content/standalone/basicViewer.xul", - "basicViewer", "chrome,resizable,centerscreen", uri); - } - } else { - var win = wm.getMostRecentWindow("navigator:browser"); - if(win) { - win.open(uri, null, features); - } - else { - var ww = Components.classes["@mozilla.org/embedcomp/window-watcher;1"] - .getService(Components.interfaces.nsIWindowWatcher); - var win = ww.openWindow(null, uri, null, features + ",width=775,height=575", null); - } - } + openInViewer("zotero://debug/"); }, @@ -1826,4 +1802,33 @@ function handleShowInPreferenceChange() { Zotero.Prefs.set("statusBarIcon", 2); } } +} + +/** + * Opens a URI in the basic viewer in Standalone, or a new window in Firefox + */ +function openInViewer(uri) { + var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"] + .getService(Components.interfaces.nsIWindowMediator); + const features = "menubar=yes,toolbar=no,location=no,scrollbars,centerscreen,resizable"; + + if(Zotero.isStandalone) { + var win = wm.getMostRecentWindow("zotero:basicViewer"); + if(win) { + win.loadURI(uri); + } else { + window.openDialog("chrome://zotero/content/standalone/basicViewer.xul", + "basicViewer", "chrome,resizable,centerscreen", uri); + } + } else { + var win = wm.getMostRecentWindow("navigator:browser"); + if(win) { + win.open(uri, null, features); + } + else { + var ww = Components.classes["@mozilla.org/embedcomp/window-watcher;1"] + .getService(Components.interfaces.nsIWindowWatcher); + var win = ww.openWindow(null, uri, null, features + ",width=775,height=575", null); + } + } } \ No newline at end of file diff --git a/chrome/content/zotero/preferences/preferences.xul b/chrome/content/zotero/preferences/preferences.xul @@ -800,6 +800,11 @@ To add a new preference: </hbox> </groupbox> + <groupbox> + <caption label="&zotero.preferences.miscellaneous;"/> + <button id="openAboutConfig" label="&zotero.preferences.openAboutConfig;" oncommand="openInViewer('about:config', '')"/> + </groupbox> + <separator/> </prefpane>