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.
This commit is contained in:
parent
ee01b2cbc3
commit
a97d7ff26d
2 changed files with 35 additions and 25 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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>
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue