diff --git a/chrome/content/zotero/preferences/preferences.js b/chrome/content/zotero/preferences/preferences.js
index 24a722583..abb7ddf70 100644
--- a/chrome/content/zotero/preferences/preferences.js
+++ b/chrome/content/zotero/preferences/preferences.js
@@ -1319,19 +1319,30 @@ Zotero_Preferences.Debug_Output = {
view: function () {
- var uri = "zotero://debug/";
- var features = "menubar=yes,toolbar=no,location=no,scrollbars,centerscreen,resizable";
+ 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);
- 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);
+ .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);
+ }
}
},
diff --git a/chrome/content/zotero/standalone/basicViewer.js b/chrome/content/zotero/standalone/basicViewer.js
new file mode 100644
index 000000000..dc2cdbccb
--- /dev/null
+++ b/chrome/content/zotero/standalone/basicViewer.js
@@ -0,0 +1,43 @@
+/*
+ ***** BEGIN LICENSE BLOCK *****
+
+ Copyright © 2011 Center for History and New Media
+ George Mason University, Fairfax, Virginia, USA
+ http://zotero.org
+
+ This file is part of Zotero.
+
+ Zotero is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Zotero is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Affero General Public License for more details.
+
+ You should have received a copy of the GNU Affero General Public License
+ along with Zotero. If not, see .
+
+ ***** END LICENSE BLOCK *****
+*/
+
+var browser;
+function loadURI() {
+ browser.loadURI.apply(browser, arguments);
+}
+
+window.addEventListener("load", function() {
+ browser = document.getElementById('my-browser');
+
+ // align page title with title of shown document
+ browser.addEventListener("pageshow", function() {
+ document.title = (browser.contentDocument.title
+ ? browser.contentDocument.title
+ : browser.contentDocument.location.href);
+ }, false);
+
+ // show document
+ browser.loadURI.apply(browser, window.arguments);
+}, false);
\ No newline at end of file
diff --git a/chrome/content/zotero/standalone/basicViewer.xul b/chrome/content/zotero/standalone/basicViewer.xul
new file mode 100644
index 000000000..11d9ec4ef
--- /dev/null
+++ b/chrome/content/zotero/standalone/basicViewer.xul
@@ -0,0 +1,152 @@
+
+
+
+
+
+
+
+
+
+
+ %globalDTD;
+ %charsetDTD;
+ %textcontextDTD;
+ %standaloneDTD;
+ %brandDTD;
+ %zoteroDTD;
+]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+