diff --git a/chrome/content/zotero/bindings/guidancepanel.xml b/chrome/content/zotero/bindings/guidancepanel.xml index 33b9e38ee4..aeea03b89a 100644 --- a/chrome/content/zotero/bindings/guidancepanel.xml +++ b/chrome/content/zotero/bindings/guidancepanel.xml @@ -48,7 +48,14 @@ panel = document.getAnonymousNodes(this)[0]; if(!forEl) forEl = document.getElementById(this.getAttribute("for")); - panel.lastChild.textContent = Zotero.getString("firstRunGuidance."+about); + var text = Zotero.getString("firstRunGuidance."+about).split("\n"); + var descriptionNode = panel.lastChild; + while(text.length) { + var textLine = text.shift(); + descriptionNode.appendChild(document.createTextNode(textLine)); + if(text.length) descriptionNode.appendChild(document.createElementNS( + "http://www.w3.org/1999/xhtml", "br")); + } panel.openPopup(forEl, position ? position : "after_start", x ? parseInt(x, 10) : 0, y ? parseInt(y, 10) : 0, false, false, null); @@ -56,6 +63,13 @@ ]]> + + + + + diff --git a/chrome/content/zotero/integration/quickFormat.js b/chrome/content/zotero/integration/quickFormat.js index 305a7074f4..ca66b17b1d 100644 --- a/chrome/content/zotero/integration/quickFormat.js +++ b/chrome/content/zotero/integration/quickFormat.js @@ -25,11 +25,11 @@ var Zotero_QuickFormat = new function () { const pixelRe = /^([0-9]+)px$/ - var initialized, io, qfs, qfi, qfiWindow, qfiDocument, qfe, qfb, qfbHeight, keepSorted, - showEditor, referencePanel, referenceBox, referenceHeight = 0, separatorHeight = 0, - currentLocator, currentLocatorLabel, currentSearchTime, dragging, panel, - panelPrefix, panelSuffix, panelSuppressAuthor, panelLocatorLabel, panelLocator, panelInfo, - panelRefersToBubble, panelFrameHeight = 0, accepted = false; + var initialized, io, qfs, qfi, qfiWindow, qfiDocument, qfe, qfb, qfbHeight, qfGuidance, + keepSorted, showEditor, referencePanel, referenceBox, referenceHeight = 0, + separatorHeight = 0, currentLocator, currentLocatorLabel, currentSearchTime, dragging, + panel, panelPrefix, panelSuffix, panelSuppressAuthor, panelLocatorLabel, panelLocator, + panelInfo, panelRefersToBubble, panelFrameHeight = 0, accepted = false; // A variable that contains the timeout object for the latest onKeyPress event var eventTimeout = null; @@ -98,10 +98,9 @@ var Zotero_QuickFormat = new function () { panelLocator = document.getElementById("locator"); panelInfo = document.getElementById("citation-properties-info"); - // Don't need to set noautohide dynamically on these platforms, so do it now if(Zotero.isMac || Zotero.isWin) { - tabPanel.setAttribute("noautohide", true); + referencePanel.setAttribute("noautohide", true); } } else if(event.target === qfi.contentDocument) { qfiWindow = qfi.contentWindow; @@ -129,6 +128,9 @@ var Zotero_QuickFormat = new function () { Zotero.debug("Moving window to "+targetX+", "+targetY); window.moveTo(targetX, targetY); } + qfGuidance = document.getElementById('quick-format-guidance'); + qfGuidance.show(); + _refocusQfe(); }, 0); window.focus(); @@ -961,6 +963,8 @@ var Zotero_QuickFormat = new function () { * Handle return or escape */ function _onQuickSearchKeyPress(event) { + qfGuidance.hide(); + var keyCode = event.keyCode; if(keyCode === event.DOM_VK_RETURN || keyCode === event.DOM_VK_ENTER) { event.preventDefault(); diff --git a/chrome/content/zotero/integration/quickFormat.xul b/chrome/content/zotero/integration/quickFormat.xul index 859a15959e..ab87011409 100644 --- a/chrome/content/zotero/integration/quickFormat.xul +++ b/chrome/content/zotero/integration/quickFormat.xul @@ -25,6 +25,7 @@ --> + @@ -112,4 +113,6 @@ + diff --git a/chrome/locale/en-US/zotero/zotero.properties b/chrome/locale/en-US/zotero/zotero.properties index 052f6012bb..a73988036c 100644 --- a/chrome/locale/en-US/zotero/zotero.properties +++ b/chrome/locale/en-US/zotero/zotero.properties @@ -758,4 +758,5 @@ connector.error.title = Zotero Connector Error connector.standaloneOpen = Your database cannot be accessed because Zotero Standalone is currently open. Please view your items in Zotero Standalone. firstRunGuidance.saveIcon = Zotero can recognize a reference on this page. Click this icon in the address bar to save the reference to your Zotero library. -firstRunGuidance.authorMenu = Zotero lets you specify editors and translators, too. You can turn an author into an editor or translator by selecting from this menu. \ No newline at end of file +firstRunGuidance.authorMenu = Zotero lets you specify editors and translators, too. You can turn an author into an editor or translator by selecting from this menu. +firstRunGuidance.quickFormat = Type a title or author to search for a reference. After you've made your selection, click the bubble to add page numbers, prefixes, or suffixes.\n\nIf you prefer the "classic" add citation dialog, you can revert to it in the Zotero preferences. \ No newline at end of file