From 4868095820971ace907a92fc022f0e627dac1012 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Wed, 24 Jun 2015 20:01:01 -0400 Subject: [PATCH] Guidance panel for new save icon For new installations, a panel will show for the Z icon with a ">" button to go to a second panel for the save icon. For existing installations, a panel will show just for the save icon. In both cases, the panels are non-auto-hiding but are dismissed if clicked on or when a new content page is loaded. There's also a new close button, but it's not enabled currently. Might be useful for panels with embedded links where an accidental click on the panel alone shouldn't close the panel (like the Firefox customize mode wizard). --- .../content/zotero/bindings/guidancepanel.xml | 185 ++++++++++++++---- chrome/content/zotero/bindings/itembox.xml | 8 +- chrome/content/zotero/browser.js | 8 - chrome/content/zotero/icon.js | 7 +- chrome/content/zotero/overlay.xul | 9 +- chrome/locale/en-US/zotero/zotero.properties | 2 +- .../default/zotero/bindings/guidancepanel.css | 51 +++++ .../default/zotero/chevron-left_808080_32.png | Bin 0 -> 347 bytes .../zotero/chevron-right_808080_32.png | Bin 0 -> 353 bytes chrome/skin/default/zotero/overlay.css | 10 - 10 files changed, 215 insertions(+), 65 deletions(-) create mode 100644 chrome/skin/default/zotero/bindings/guidancepanel.css create mode 100644 chrome/skin/default/zotero/chevron-left_808080_32.png create mode 100644 chrome/skin/default/zotero/chevron-right_808080_32.png diff --git a/chrome/content/zotero/bindings/guidancepanel.xml b/chrome/content/zotero/bindings/guidancepanel.xml index 12f40106a6..5a925e7503 100644 --- a/chrome/content/zotero/bindings/guidancepanel.xml +++ b/chrome/content/zotero/bindings/guidancepanel.xml @@ -29,71 +29,130 @@ xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> + + + + + - - + + + + + + + + + + + + + - - - + + + + + + + + + + + diff --git a/chrome/content/zotero/bindings/itembox.xml b/chrome/content/zotero/bindings/itembox.xml index 8c91b6b989..750476f1f9 100644 --- a/chrome/content/zotero/bindings/itembox.xml +++ b/chrome/content/zotero/bindings/itembox.xml @@ -1874,10 +1874,14 @@ if(field === 'creator') { // Reset creator mode settings here so that flex attribute gets reset this.switchCreatorMode(row, (otherFields.fieldMode ? 1 : 0), true); - + Zotero.debug("HERE"); if(Zotero.ItemTypes.getName(this.item.itemTypeID) === "bookSection") { + Zotero.debug("YES"); var creatorTypeLabels = document.getAnonymousNodes(this)[0].getElementsByClassName("creator-type-label"); - document.getElementById("zotero-author-guidance").show(creatorTypeLabels[creatorTypeLabels.length-1]); + Zotero.debug(creatorTypeLabels[creatorTypeLabels.length-1] + ""); + document.getElementById("zotero-author-guidance").show({ + forEl: creatorTypeLabels[creatorTypeLabels.length-1] + }); } } diff --git a/chrome/content/zotero/browser.js b/chrome/content/zotero/browser.js index 35ee645617..594bbfcfb4 100644 --- a/chrome/content/zotero/browser.js +++ b/chrome/content/zotero/browser.js @@ -441,14 +441,6 @@ var Zotero_Browser = new function() { button.tooltipText = tooltiptext; if (state == tab.CAPTURE_STATE_TRANSLATABLE) { button.classList.add('translate'); - - // Show guidance panel if necessary - if (inToolbar) { - button.addEventListener("load", function() { - document.getElementById("zotero-status-image-guidance").show(); - }); - } - // TODO: Different guidance for web pages? } else { button.classList.remove('translate'); diff --git a/chrome/content/zotero/icon.js b/chrome/content/zotero/icon.js index de8708297f..f5f401fc1d 100644 --- a/chrome/content/zotero/icon.js +++ b/chrome/content/zotero/icon.js @@ -61,9 +61,10 @@ CustomizableUI.addListener({ var shortcut = Zotero.getString( Zotero.isMac ? "general.keys.cmdShift" : "general.keys.ctrlShift" ) + Zotero.Prefs.get("keys.openZotero"); - document.getElementById("zotero-toolbar-button-guidance").show( - null, Zotero.getString(property, shortcut) - ); + document.getElementById("zotero-main-button-guidance").show({ + text: Zotero.getString(property, shortcut) + }); + document.getElementById("zotero-save-button-guidance").show(); } else if (id == getSingleID('save')) { Zotero_Browser.updateStatus(); diff --git a/chrome/content/zotero/overlay.xul b/chrome/content/zotero/overlay.xul index 8c08dd6440..f894ecc174 100644 --- a/chrome/content/zotero/overlay.xul +++ b/chrome/content/zotero/overlay.xul @@ -50,9 +50,12 @@