diff --git a/chrome/content/zotero-platform/mac/overlay.css b/chrome/content/zotero-platform/mac/overlay.css index a0818694b8..9517aa6e7c 100644 --- a/chrome/content/zotero-platform/mac/overlay.css +++ b/chrome/content/zotero-platform/mac/overlay.css @@ -396,4 +396,49 @@ #zotero-items-tree treechildren::-moz-tree-cell, #zotero-items-tree treechildren::-moz-tree-column { border-right: 1px solid #d7dad7; +} + +treechildren::-moz-tree-twisty { + -moz-appearance: none; + width: 11px; + height: 11px; + list-style-image: url("chrome://zotero/skin/mac/twisty.png"); + -moz-padding-start: 5px; + -moz-padding-end: 6px; +} + +treechildren::-moz-tree-twisty(open) { + -moz-appearance: none; + width: 11px; + height: 11px; + list-style-image: url("chrome://zotero/skin/mac/twisty-open.png"); + -moz-padding-start: 4px; + -moz-padding-end: 7px; +} + +/* How to get active twisty? +treechildren::-moz-tree-twisty(active) { + -moz-appearance: none; + list-style-image: url("chrome://zotero/skin/mac/twisty-active.png") !important; +} + +treechilren::-moz-tree-twisty(active) { + -moz-appearance: none; + list-style-image: url("chrome://zotero/skin/mac/twisty-active-open.png"); +} +*/ + +:root[active] treechildren::-moz-tree-twisty(selected) { + -moz-appearance: none; + list-style-image: url("chrome://zotero/skin/mac/twisty-selected.png"); +} + +:root[active] treechildren::-moz-tree-twisty(selected, open) { + -moz-appearance: none; + list-style-image: url("chrome://zotero/skin/mac/twisty-selected-open.png"); +} + +treechildren::-moz-tree-image { + height: 16px; + padding-bottom: 1px; } \ No newline at end of file diff --git a/chrome/content/zotero/browser.js b/chrome/content/zotero/browser.js index 814951b949..64066e5be8 100644 --- a/chrome/content/zotero/browser.js +++ b/chrome/content/zotero/browser.js @@ -104,7 +104,12 @@ var Zotero_Browser = new function() { * Initialize some variables and prepare event listeners for when chrome is done loading */ function init() { - if (!Zotero || !Zotero.initialized || Zotero.isStandalone) { + try { + var gb = gBrowser; + } catch(e) { + return; + } + if (!Zotero || !Zotero.initialized || !gb) { return; } diff --git a/chrome/content/zotero/overlay.js b/chrome/content/zotero/overlay.js index 1d4a9cb802..3e6354326c 100644 --- a/chrome/content/zotero/overlay.js +++ b/chrome/content/zotero/overlay.js @@ -90,6 +90,7 @@ var ZoteroPane = new function() var self = this; var _loaded = false; + var _isStandaloneOrTab = false; var titlebarcolorState, toolbarCollapseState, titleState; // Also needs to be changed in collectionTreeView.js @@ -100,9 +101,11 @@ var ZoteroPane = new function() */ function onLoad() { + _isStandaloneOrTab = Zotero.isStandalone || document.getElementById('zotero-tab'); + if (!Zotero) return; if (!Zotero.initialized) { - if(Zotero.isStandalone) { + if(_isStandaloneOrTab) { _loaded = true; this.toggleDisplay(); } @@ -229,7 +232,7 @@ var ZoteroPane = new function() document.getElementById('zotero-tb-actions-showDuplicates').hidden = false; } - if(Zotero.isStandalone) { + if(_isStandaloneOrTab) { this.toggleDisplay(true); this.fullScreen(true); } @@ -350,7 +353,7 @@ var ZoteroPane = new function() var isCollapsed = true; } - if (isHidden || isCollapsed || Zotero.isStandalone) { + if (isHidden || isCollapsed || _isStandaloneOrTab) { var makeVisible = true; } @@ -510,7 +513,7 @@ var ZoteroPane = new function() */ function _setFullWindowMode(set) { // hide or show navigation toolbars - if(Zotero.isStandalone) return; + if(_isStandaloneOrTab) return; var toolbox = getNavToolbox(); if(set) { diff --git a/chrome/content/zotero/overlay.xul b/chrome/content/zotero/overlay.xul index 881d62f80c..ad66f11138 100644 --- a/chrome/content/zotero/overlay.xul +++ b/chrome/content/zotero/overlay.xul @@ -478,11 +478,11 @@ Zotero.getString('errorReport.reportErrors')); } + var fx36Icon = document.getElementById('zotero-status-bar-icon'); + var addonBar = document.getElementById('addon-bar'); + // Check whether standalone is running, and return if so - var appInfo = Components.classes["@mozilla.org/xre/app-info;1"] - .getService(Components.interfaces.nsIXULAppInfo); - var isStandalone = appInfo.ID === "zotero@chnm.gmu.edu"; - if(isStandalone) return; + if(!addonBar && !fx36Icon) return; // THE FOLLOWING CODE IS NOT APPLIED IN STANDALONE // (It relates almost entirely to the Zotero icon) @@ -491,10 +491,12 @@ .getService(Components.interfaces.nsIPrefService) .getBranch('extensions.zotero.').getIntPref('statusBarIcon'); + var appInfo = Components.classes["@mozilla.org/xre/app-info;1"] + .getService(Components.interfaces.nsIXULAppInfo); var isFx36 = appInfo.platformVersion.indexOf('1.9') === 0; // Status bar in Fx3.6 if (isFx36) { - var icon = document.getElementById('zotero-status-bar-icon'); + var icon = fx36Icon; } // In >=Fx4, add to add-on bar else { @@ -502,7 +504,6 @@ icon.id = 'zotero-addon-bar-icon'; icon.setAttribute('oncommand', 'ZoteroPane.toggleDisplay()'); icon.setAttribute('hidden', true); - var addonBar = document.getElementById('addon-bar'); addonBar.appendChild(icon); if (addonBar.collapsed) { // If no Zotero or icon isn't set to hidden, show add-on bar diff --git a/chrome/content/zotero/standalone.xul b/chrome/content/zotero/standalone.xul index 58cab30e16..b5df776229 100644 --- a/chrome/content/zotero/standalone.xul +++ b/chrome/content/zotero/standalone.xul @@ -1,8 +1,11 @@ + + + diff --git a/chrome/content/zotero/tab.xul b/chrome/content/zotero/tab.xul new file mode 100644 index 0000000000..ea343bf323 --- /dev/null +++ b/chrome/content/zotero/tab.xul @@ -0,0 +1,64 @@ + + + + + + + + + +%globalDTD; + +%charsetDTD; + +%textcontextDTD; + +%standaloneDTD; + +%brandDTD; +]> + + + + + + + + + + + + + + + + + + + diff --git a/chrome/skin/default/zotero/mac/twisty-active-open.png b/chrome/skin/default/zotero/mac/twisty-active-open.png new file mode 100644 index 0000000000..c5b13ed047 Binary files /dev/null and b/chrome/skin/default/zotero/mac/twisty-active-open.png differ diff --git a/chrome/skin/default/zotero/mac/twisty-active.png b/chrome/skin/default/zotero/mac/twisty-active.png new file mode 100644 index 0000000000..daaa60fe3a Binary files /dev/null and b/chrome/skin/default/zotero/mac/twisty-active.png differ diff --git a/chrome/skin/default/zotero/mac/twisty-open.png b/chrome/skin/default/zotero/mac/twisty-open.png new file mode 100644 index 0000000000..ec9b5ef05c Binary files /dev/null and b/chrome/skin/default/zotero/mac/twisty-open.png differ diff --git a/chrome/skin/default/zotero/mac/twisty-selected-open.png b/chrome/skin/default/zotero/mac/twisty-selected-open.png new file mode 100644 index 0000000000..484aa8f625 Binary files /dev/null and b/chrome/skin/default/zotero/mac/twisty-selected-open.png differ diff --git a/chrome/skin/default/zotero/mac/twisty-selected.png b/chrome/skin/default/zotero/mac/twisty-selected.png new file mode 100644 index 0000000000..b7d58a4ee1 Binary files /dev/null and b/chrome/skin/default/zotero/mac/twisty-selected.png differ diff --git a/chrome/skin/default/zotero/mac/twisty.png b/chrome/skin/default/zotero/mac/twisty.png new file mode 100644 index 0000000000..c4af03f310 Binary files /dev/null and b/chrome/skin/default/zotero/mac/twisty.png differ