commit 4901870c8a467b909d143fe94232944a120db853 parent 841c6f5b7b4be068e509a9f431eab3a729a05284 Author: Simon Kornblith <simon@simonster.com> Date: Wed, 3 Aug 2011 20:05:33 +0000 "Show in app tab" and "show in separate tab" are separate preferences. Thanks to voxel for the patch Diffstat:
5 files changed, 14 insertions(+), 5 deletions(-)
diff --git a/chrome/content/zotero/overlay.js b/chrome/content/zotero/overlay.js @@ -50,14 +50,14 @@ var ZoteroOverlay = new function() showInPref = Components.classes["@mozilla.org/preferences-service;1"] .getService(Components.interfaces.nsIPrefService) .getBranch('extensions.zotero.').getIntPref('showIn'); - this.isTab = showInPref === 2; + this.isTab = showInPref !== 1; if(!isFx36) { var observerService = Components.classes["@mozilla.org/observer-service;1"] .getService(Components.interfaces.nsIObserverService); var zoteroObserver = function(subject, topic, data) { if(subject != window) return; observerService.removeObserver(this, "browser-delayed-startup-finished"); - if(showInPref === 2) { + if(showInPref === 3) { var tabbar = document.getElementById("TabsToolbar"); if(tabbar && window.getComputedStyle(tabbar).display !== "none") { // load Zotero as a tab, if it isn't loading by default @@ -314,7 +314,7 @@ var ZoteroOverlay = new function() // If no existing tab, add a new tab if(!tab) tab = gBrowser.addTab(ZOTERO_TAB_URL); // Pin tab - if(!isFx36) gBrowser.pinTab(tab); + if(!isFx36 && showInPref == 3) gBrowser.pinTab(tab); // If requested, activate tab if(!background) gBrowser.selectedTab = tab; } diff --git a/chrome/content/zotero/preferences/preferences.js b/chrome/content/zotero/preferences/preferences.js @@ -73,6 +73,11 @@ function init() } else if(document.location.hash == "#cite") { document.getElementById('zotero-prefs').showPane(document.getElementById("zotero-prefpane-cite")); } + + var showInAppTab; + if(!Zotero.isFx4 && (showInAppTab = document.getElementById("zotero-prefpane-general-showIn-appTab"))) { + showInAppTab.setAttribute("hidden", "true"); + } } @@ -1791,6 +1796,7 @@ function updateProxyPrefs() { document.getElementById('zotero-proxies-autoRecognize').disabled = document.getElementById('zotero-proxies-disableByDomain-checkbox').disabled = document.getElementById('zotero-proxies-disableByDomain-textbox').disabled = !transparent; + } /** @@ -1810,8 +1816,9 @@ function updateWordProcessorInstructions() { */ function handleShowInPreferenceChange() { var showInSeparateTab = document.getElementById("zotero-prefpane-general-showIn-separateTab"); + var showInAppTab = document.getElementById("zotero-prefpane-general-showIn-appTab"); if(Zotero.isFx4) { - if(showInSeparateTab.selected) { + if(showInAppTab.selected) { document.getElementById('statusBarIcon').selectedItem = document.getElementById('statusBarIcon-none'); Zotero.Prefs.set("statusBarIcon", 0); } else if(Zotero.isFx4) { diff --git a/chrome/content/zotero/preferences/preferences_firefox.xul b/chrome/content/zotero/preferences/preferences_firefox.xul @@ -59,6 +59,7 @@ To add a new preference: <radiogroup id="showIn" orient="horizontal" preference="pref-showIn" oncommand="handleShowInPreferenceChange()"> <radio id="zotero-prefpane-general-showIn-browserPane" label="&zotero.preferences.showIn.browserPane;" value="1"/> <radio id="zotero-prefpane-general-showIn-separateTab" label="&zotero.preferences.showIn.separateTab;" value="2"/> + <radio id="zotero-prefpane-general-showIn-appTab" label="&zotero.preferences.showIn.appTab;" value="3"/> </radiogroup> </row> <row position="2" id="zotero-prefpane-general-statusBarIcon-row"> diff --git a/chrome/content/zotero/tab.js b/chrome/content/zotero/tab.js @@ -104,7 +104,7 @@ var ZoteroTab = new function() if(tabs.length > 1) { window.close(); } else { - if(Zotero.isFx4) this.containerWindow.gBrowser.unpinTab(tabs[0]); + if(Zotero.isFx4 && tabs[0].pinned) this.containerWindow.gBrowser.unpinTab(tabs[0]); document.location.replace(this.containerWindow.gHomeButton.getHomePage()); } return; diff --git a/chrome/locale/en-US/zotero/preferences.dtd b/chrome/locale/en-US/zotero/preferences.dtd @@ -10,6 +10,7 @@ <!ENTITY zotero.preferences.showIn "Load Zotero in:"> <!ENTITY zotero.preferences.showIn.browserPane "Browser pane"> <!ENTITY zotero.preferences.showIn.separateTab "Separate tab"> +<!ENTITY zotero.preferences.showIn.appTab "App tab"> <!ENTITY zotero.preferences.statusBarIcon "Status bar icon:"> <!ENTITY zotero.preferences.statusBarIcon.none "None"> <!ENTITY zotero.preferences.fontSize "Font size:">