www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit 34ea8ced85b945c7f7adc9d5db9347bf73923dd3
parent 1159de39f60f43afc38dab8233bbfb6a7e49db2c
Author: Dan Stillman <dstillman@zotero.org>
Date:   Wed, 31 Oct 2007 00:03:06 +0000

Addresses #283, Minefield compatibility
Closes #285, Hitting Esc should close tags popup

Fixes various UI issues and problems adding tags on Minefield

Still getting autocomplete self-destruction



Diffstat:
Mchrome.manifest | 2++
Mchrome/content/zotero/bindings/noteeditor.xml | 2+-
Mchrome/content/zotero/bindings/tagsbox.xml | 6+++---
Mchrome/content/zotero/itemPane.js | 19++++++++++++++-----
Mchrome/content/zotero/itemPane.xul | 1+
Mchrome/content/zotero/overlay.xul | 5++---
Mchrome/skin/default/zotero/bindings/noteeditor.css | 4++++
7 files changed, 27 insertions(+), 12 deletions(-)

diff --git a/chrome.manifest b/chrome.manifest @@ -36,6 +36,8 @@ locale zotero zh-TW chrome/locale/zh-TW/zotero/ skin zotero default chrome/skin/default/zotero/ overlay chrome://browser/content/browser.xul chrome://zotero/content/overlay.xul +overlay chrome://browser/content/browser.xul chrome://zotero/content/itemPane.xul + style chrome://browser/content/browser.xul chrome://zotero/skin/zotero.css style chrome://global/content/customizeToolbar.xul chrome://zotero/skin/zotero.css diff --git a/chrome/content/zotero/bindings/noteeditor.xml b/chrome/content/zotero/bindings/noteeditor.xml @@ -286,7 +286,7 @@ Note: Code in tagsbox.xml is dependent on the DOM path between the tagsbox and tagsLabel above, so be sure to update fixPopup() if it changes --> - <xul:popup id="tagsPopup" ignorekeys="true" width="300" + <xul:popup id="tagsPopup" ignorekeys="true" onpopupshown="if (!document.commandDispatcher.focusedElement || document.commandDispatcher.focusedElement.tagName=='xul:label'){ /* DEBUG: it would be nice to make this work -- if (this.firstChild.count==0){ this.firstChild.new(); } */ this.setAttribute('showing', 'true'); }" onpopuphidden="if (!document.commandDispatcher.focusedElement || document.commandDispatcher.focusedElement.tagName=='xul:label'){ this.setAttribute('showing', 'false'); }"> <xul:tagsbox id="tags" flex="1"/> diff --git a/chrome/content/zotero/bindings/tagsbox.xml b/chrome/content/zotero/bindings/tagsbox.xml @@ -265,8 +265,8 @@ <method name="closePopup"> <body> <![CDATA[ - if (this.parentNode.getAttribute('showing')=='true') { - this.parentNode.setAttribute('showing', false); + if (this.parentNode.hidePopup) { + this.parentNode.hidePopup() } ]]> </body> @@ -283,7 +283,7 @@ <xul:scrollbox xbl:inherits="flex" orient="vertical" style="overflow:auto"> <xul:hbox align="center"> <xul:label id="tagsNum"/> - <xul:button label="&zotero.item.add;" oncommand="this.parentNode.parentNode.parentNode.new();"/> + <xul:button label="&zotero.item.add;" oncommand="document.getBindingParent(this).new();"/> </xul:hbox> <xul:grid> <xul:columns> diff --git a/chrome/content/zotero/itemPane.js b/chrome/content/zotero/itemPane.js @@ -1006,7 +1006,7 @@ var ZoteroItemPane = new function() _dynamicFields.focus(); } - //Zotero.debug('Showing editor'); + Zotero.debug('Showing editor'); var fieldName = elem.getAttribute('fieldname'); var tabindex = elem.getAttribute('ztabindex'); @@ -1167,6 +1167,9 @@ var ZoteroItemPane = new function() switch (event.keyCode) { case event.DOM_VK_RETURN: + // Prevent blur on textbox above + event.preventDefault(); + var fieldname = target.getAttribute('fieldname'); // Use shift-enter as the save action for the larger fields if ((fieldname == 'abstractNote' || fieldname == 'extra') @@ -1220,8 +1223,15 @@ var ZoteroItemPane = new function() case event.DOM_VK_ESCAPE: // Reset field to original value target.value = target.getAttribute('value'); + + var tagsbox = Zotero.getAncestorByTagName(focused, 'tagsbox'); + focused.blur(); + if (tagsbox) { + tagsbox.closePopup(); + } + // Return focus to items pane var tree = document.getElementById('zotero-items-tree'); if (tree) { @@ -1243,12 +1253,13 @@ var ZoteroItemPane = new function() function hideEditor(t, saveChanges) { - //Zotero.debug('Hiding editor'); + Zotero.debug('Hiding editor'); var textbox = Zotero.getAncestorByTagName(t, 'textbox'); if (!textbox){ Zotero.debug('Textbox not found in hideEditor'); return; } + var fieldName = textbox.getAttribute('fieldname'); var tabindex = textbox.getAttribute('ztabindex'); @@ -1349,10 +1360,7 @@ var ZoteroItemPane = new function() if (existingTypes && existingTypes.indexOf(1) != -1) { _lastTabIndex--; } - var id = tagsbox.add(value); - - // DEBUG: why does this need to continue if added? } } @@ -1370,6 +1378,7 @@ var ZoteroItemPane = new function() } catch (e) {} tagsbox.fixPopup(); + tagsbox.closePopup(); _tabDirection = false; return; diff --git a/chrome/content/zotero/itemPane.xul b/chrome/content/zotero/itemPane.xul @@ -22,6 +22,7 @@ --> <?xml-stylesheet href="chrome://zotero/skin/itemPane.css" type="text/css"?> <?xml-stylesheet href="chrome://zotero-platform/content/itemPane.css" type="text/css"?> + <!DOCTYPE window SYSTEM "chrome://zotero/locale/zotero.dtd"> <overlay diff --git a/chrome/content/zotero/overlay.xul b/chrome/content/zotero/overlay.xul @@ -23,13 +23,12 @@ <?xml-stylesheet href="chrome://zotero/skin/overlay.css" type="text/css"?> <!DOCTYPE overlay [ - <!ENTITY % globalDTD SYSTEM "chrome://global/locale/global.dtd"> %globalDTD; - <!ENTITY % zoteroDTD SYSTEM "chrome://zotero/locale/zotero.dtd"> %zoteroDTD; + <!ENTITY % globalDTD SYSTEM "chrome://global/locale/global.dtd"> %globalDTD; + <!ENTITY % zoteroDTD SYSTEM "chrome://zotero/locale/zotero.dtd"> %zoteroDTD; ]> <overlay id="zotero" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> - <?xul-overlay href="itemPane.xul" ?> <!-- Include the global XPCOM object --> <script src="include.js"/> diff --git a/chrome/skin/default/zotero/bindings/noteeditor.css b/chrome/skin/default/zotero/bindings/noteeditor.css @@ -8,3 +8,7 @@ { cursor: pointer !important; } + +#tagsPopup { + min-width: 300px; +}