commit deb77cdb083b2bc897692a4ac03a597c59d3144b
parent 9232dd5247db5f2c70e76447e1c0ea91da09525e
Author: Dan Stillman <dstillman@zotero.org>
Date: Fri, 30 Jan 2015 20:42:41 -0500
Merge pull request #603 from fbennett/icon-to-nav-bar
Use nav-bar as id of menu button container
Diffstat:
11 files changed, 16 insertions(+), 138 deletions(-)
diff --git a/chrome/content/zotero/overlay.js b/chrome/content/zotero/overlay.js
@@ -75,18 +75,18 @@ var ZoteroOverlay = new function()
.getService(Components.interfaces.nsIPrefService)
.getBranch('extensions.zotero.');
- var addonBar = document.getElementById('addon-bar');
+ var navBar = document.getElementById('nav-bar');
var iconPref = prefBranch.getIntPref('statusBarIcon');
// If this is the first run, add icon to add-on bar if not
// in the window already and not hidden by the Zotero prefs
if (!document.getElementById("zotero-toolbar-button") && iconPref != 0) {
- addonBar.insertItem("zotero-toolbar-button");
- addonBar.setAttribute("currentset", addonBar.currentSet);
- document.persist(addonBar.id, "currentset");
- addonBar.setAttribute("collapsed", false);
- document.persist(addonBar.id, "collapsed");
+ navBar.insertItem("zotero-toolbar-button");
+ navBar.setAttribute("currentset", navBar.currentSet);
+ document.persist(navBar.id, "currentset");
+ navBar.setAttribute("collapsed", false);
+ document.persist(navBar.id, "collapsed");
}
var icon = document.getElementById('zotero-toolbar-button');
@@ -108,13 +108,10 @@ var ZoteroOverlay = new function()
}
icon.setAttribute('tooltiptext', str);
- if (iconPref == 1) {
- icon.setAttribute('compact', true);
- }
// If hidden in prefs, remove from add-on bar
- else if (iconPref == 0) {
+ if (iconPref == 0) {
var toolbar = icon.parentNode;
- if (toolbar.id == 'addon-bar') {
+ if (toolbar.id == 'nav-bar') {
var palette = document.getElementById("navigator-toolbox").palette;
palette.appendChild(icon);
toolbar.setAttribute("currentset", toolbar.currentSet);
@@ -197,19 +194,16 @@ var ZoteroOverlay = new function()
function onToolbarChange(e) {
// e.target seems to be navigator-toolbox in all cases,
- // so check the addon-bar directly
- var addonBar = document.getElementById("addon-bar");
+ // so check the nav-bar directly
+ var navBar = document.getElementById("nav-bar");
var icon = document.getElementById("zotero-toolbar-button");
if (icon) {
- // If dragged to add-on bar
- if (addonBar.getElementsByAttribute("id", "zotero-toolbar-button").length) {
+ // If dragged to nav bar
+ if (navBar.getElementsByAttribute("id", "zotero-toolbar-button").length) {
var statusBarPref = Zotero.Prefs.get("statusBarIcon");
// If pref set to hide, force to full
if (statusBarPref == 0) {
- Zotero.Prefs.set("statusBarIcon", 2)
- }
- else if (statusBarPref == 1) {
- icon.setAttribute("compact", true);
+ Zotero.Prefs.set("statusBarIcon", 1)
}
return;
}
diff --git a/chrome/content/zotero/preferences/preferences_general.js b/chrome/content/zotero/preferences/preferences_general.js
@@ -35,32 +35,9 @@ Zotero_Preferences.General = {
);
}
- // Only show icon options for Firefox <29
- if (Zotero.platformMajorVersion < 29) {
- let statusBarRow = document.getElementById('zotero-prefpane-general-statusBarIcon-row');
- if (statusBarRow) {
- statusBarRow.hidden = false;
- }
- }
-
document.getElementById('noteFontSize').value = Zotero.Prefs.get('note.fontSize');
},
- /**
- * Sets "Status bar icon" to "None" if Zotero is set to load in separate tab
- */
- handleShowInPreferenceChange: function () {
- var showInSeparateTab = document.getElementById("zotero-prefpane-general-showIn-separateTab");
- var showInAppTab = document.getElementById("zotero-prefpane-general-showIn-appTab");
- if(showInAppTab.selected) {
- document.getElementById('statusBarIcon').selectedItem = document.getElementById('statusBarIcon-none');
- Zotero.Prefs.set("statusBarIcon", 0);
- } else {
- document.getElementById('statusBarIcon').selectedItem = document.getElementById('statusBarIcon-full');
- Zotero.Prefs.set("statusBarIcon", 2);
- }
- },
-
updateTranslators: function () {
Zotero.Schema.updateFromRepository(true, function (xmlhttp, updated) {
diff --git a/chrome/content/zotero/preferences/preferences_general_firefox.xul b/chrome/content/zotero/preferences/preferences_general_firefox.xul
@@ -29,7 +29,6 @@
<prefpane id="zotero-prefpane-general">
<preferences id="zotero-prefpane-general-preferences">
<preference id="pref-showIn" name="extensions.zotero.showIn" type="int"/>
- <preference id="pref-statusBarIcon" name="extensions.zotero.statusBarIcon" type="int"/>
<preference id="pref-launchNonNativeFiles" name="extensions.zotero.launchNonNativeFiles" type="bool"/>
<preference id="pref-parseEndNoteMIMETypes"
name="extensions.zotero.parseEndNoteMIMETypes"
@@ -42,22 +41,12 @@
<hbox align="center">
<label value="&zotero.preferences.showIn;" control="showAs"/>
</hbox>
- <radiogroup id="showIn" orient="horizontal" preference="pref-showIn" oncommand="Zotero_Preferences.General.handleShowInPreferenceChange()">
+ <radiogroup id="showIn" orient="horizontal" preference="pref-showIn">
<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" hidden="true">
- <hbox align="center">
- <label id="statusBarIcon-label" value="&zotero.preferences.statusBarIcon;" control="statusBarIcon"/>
- </hbox>
- <radiogroup id="statusBarIcon" orient="horizontal" preference="pref-statusBarIcon">
- <radio id="statusBarIcon-full" src="chrome://zotero/skin/zotero_status_bar.png" value="2"/>
- <radio id="statusBarIcon-compact" src="chrome://zotero/skin/zotero_status_bar_compact.png" value="1"/>
- <radio id="statusBarIcon-none" label="&zotero.preferences.statusBarIcon.none;" value="0"/>
- </radiogroup>
- </row>
</rows>
</grid>
</groupbox>
diff --git a/chrome/content/zotero/xpcom/zotero.js b/chrome/content/zotero/xpcom/zotero.js
@@ -2293,67 +2293,6 @@ Zotero.Prefs = new function(){
// Handlers for some Zotero preferences
var _handlers = [
- [ "statusBarIcon", function(val) {
- var doc = Components.classes["@mozilla.org/appshell/window-mediator;1"]
- .getService(Components.interfaces.nsIWindowMediator)
- .getMostRecentWindow("navigator:browser").document;
-
- var addonBar = doc.getElementById("addon-bar");
- var icon = doc.getElementById("zotero-toolbar-button");
- // When the customize window is open, toolbar buttons seem to
- // become wrapped in toolbarpaletteitems, which we need to remove
- // manually if we change the pref to hidden or else the customize
- // window doesn't close.
- var wrapper = doc.getElementById("wrapper-zotero-toolbar-button");
- var palette = doc.getElementById("navigator-toolbox").palette;
- var inAddonBar = false;
- if (icon) {
- // Because of the potential wrapper, don't just use .parentNode
- var toolbar = Zotero.getAncestorByTagName(icon, "toolbar");
- inAddonBar = toolbar == addonBar;
- }
-
- if (val == 0) {
- // If showing in add-on bar, hide
- if (!icon || !inAddonBar) {
- return;
- }
- palette.appendChild(icon);
- if (wrapper) {
- addonBar.removeChild(wrapper);
- }
- addonBar.setAttribute("currentset", addonBar.currentSet);
- doc.persist(addonBar.id, "currentset");
- }
- else {
- // If showing somewhere else, remove it from there
- if (icon && !inAddonBar) {
- palette.appendChild(icon);
- if (wrapper) {
- toolbar.removeChild(wrapper);
- }
- toolbar.setAttribute("currentset", toolbar.currentSet);
- doc.persist(toolbar.id, "currentset");
- }
-
- // If not showing in add-on bar, add
- if (!inAddonBar) {
- var icon = addonBar.insertItem("zotero-toolbar-button");
- addonBar.setAttribute("currentset", addonBar.currentSet);
- doc.persist(addonBar.id, "currentset");
- addonBar.setAttribute("collapsed", false);
- doc.persist(addonBar.id, "collapsed");
- }
- // And make small
- if (val == 1) {
- icon.setAttribute("compact", true);
- }
- // Or large
- else if (val == 2) {
- icon.removeAttribute("compact");
- }
- }
- }],
[ "automaticScraperUpdates", function(val) {
if (val){
Zotero.Schema.updateFromRepository();
diff --git a/chrome/locale/en-US/zotero/preferences.dtd b/chrome/locale/en-US/zotero/preferences.dtd
@@ -12,8 +12,6 @@
<!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:">
<!ENTITY zotero.preferences.fontSize.small "Small">
<!ENTITY zotero.preferences.fontSize.medium "Medium">
diff --git a/chrome/skin/default/zotero/preferences.css b/chrome/skin/default/zotero/preferences.css
@@ -73,7 +73,7 @@ grid row hbox:first-child
}
-#showIn radio, #statusBarIcon radio
+#showIn radio
{
width: 120px;
}
@@ -83,11 +83,6 @@ grid row hbox:first-child
margin-right: 20px;
}
-#statusBarIcon radio .radio-icon
-{
- margin-left: 6px;
-}
-
/*
* Sync pane
diff --git a/chrome/skin/default/zotero/zotero.css b/chrome/skin/default/zotero/zotero.css
@@ -55,20 +55,6 @@ toolbarpaletteitem[place="palette"] > #zotero-toolbar-button:active {
list-style-image: url("chrome://zotero/skin/zotero-z-16px-australis.svg") !important;
}
-#addon-bar #zotero-toolbar-button {
- list-style-image: url(chrome://zotero/skin/zotero_status_bar.png);
- height: 18px;
-}
-
-#addon-bar #zotero-toolbar-button[compact="true"] {
- width: 20px;
- list-style-image: url(chrome://zotero/skin/zotero_status_bar_compact.png);
-}
-
-#addon-bar #zotero-toolbar-button[error="true"] {
- list-style-image: url(chrome://zotero/skin/zotero_status_bar_error.png);
-}
-
/* Bindings */
textbox[multiline="true"][type="timed"]
diff --git a/chrome/skin/default/zotero/zotero_status_bar.png b/chrome/skin/default/zotero/zotero_status_bar.png
Binary files differ.
diff --git a/chrome/skin/default/zotero/zotero_status_bar_compact.png b/chrome/skin/default/zotero/zotero_status_bar_compact.png
Binary files differ.
diff --git a/chrome/skin/default/zotero/zotero_status_bar_error.png b/chrome/skin/default/zotero/zotero_status_bar_error.png
Binary files differ.
diff --git a/defaults/preferences/zotero.js b/defaults/preferences/zotero.js
@@ -26,7 +26,7 @@ pref("extensions.zotero.triggerProxyAuthentication", true);
pref("extensions.zotero.proxyAuthenticationURLs", 'http://www.acm.org,http://www.ebscohost.com,http://www.elsevier.com,http://www.ieee.org,http://www.jstor.org,http://www.ovid.com,http://www.springer.com,http://www.tandfonline.com');
pref("extensions.zotero.cacheTranslatorData",true);
pref("extensions.zotero.showIn", 1);
-pref("extensions.zotero.statusBarIcon", 2);
+pref("extensions.zotero.statusBarIcon", 1);
pref("extensions.zotero.browserContentContextMenu", true);
pref("extensions.zotero.openURL.resolver","http://worldcatlibraries.org/registry/gateway");
pref("extensions.zotero.openURL.version","1.0");