commit fc5d803896bfc2836937830560554021350484f8
parent 53f4a49900572e3f63e383e28c08162827877332
Author: Simon Kornblith <simon@simonster.com>
Date: Sun, 31 Jul 2011 18:06:50 +0000
- Make "suppress author" selectable without mouse
- Move cursor to end of textbox when panel is closed
- Close carbon library after use
Diffstat:
4 files changed, 28 insertions(+), 8 deletions(-)
diff --git a/chrome/content/zotero/integration/quickFormat.js b/chrome/content/zotero/integration/quickFormat.js
@@ -29,6 +29,9 @@ var Zotero_QuickFormat = new function () {
curResizer, dragging;
const SHOWN_REFERENCES = 7;
+ /**
+ * Pre-initialization, when the dialog has loaded but has not yet appeared
+ */
this.onDOMContentLoaded = function() {
io = window.arguments[0].wrappedJSObject;
@@ -484,6 +487,19 @@ var Zotero_QuickFormat = new function () {
}
/**
+ * Move cursor to end of the textbox
+ */
+ function _moveCursorToEnd() {
+ var nodeRange = qfiDocument.createRange();
+ nodeRange.selectNode(qfe.lastChild);
+ nodeRange.collapse(false);
+
+ var selection = qfiWindow.getSelection();
+ selection.removeAllRanges();
+ selection.addRange(nodeRange);
+ }
+
+ /**
* Generates the preview and sorts citations
*/
function _previewAndSort() {
@@ -502,13 +518,7 @@ var Zotero_QuickFormat = new function () {
var lastBubble = qfe.getElementsByClassName("quick-format-bubble");
lastBubble = lastBubble[lastBubble.length-1];
- var nodeRange = qfiDocument.createRange();
- nodeRange.selectNode(lastBubble);
- nodeRange.collapse(false);
-
- var selection = qfiWindow.getSelection();
- selection.removeAllRanges();
- selection.addRange(nodeRange);
+ _moveCursorToEnd();
}
}
@@ -657,6 +667,7 @@ var Zotero_QuickFormat = new function () {
delete target.citationItem["suppress-author"];
}
target.value = _buildBubbleString(target.citationItem);
+ _moveCursorToEnd();
}
panel.addEventListener("popuphidden", closeListener, false);
}
diff --git a/chrome/content/zotero/integration/quickFormat.xul b/chrome/content/zotero/integration/quickFormat.xul
@@ -88,7 +88,10 @@
<label value="&zotero.citation.suffix.label;"/>
<textbox class="citation-textbox" id="suffix" flex="1"/>
</row>
- <checkbox id="suppress-author" label="&zotero.citation.suppressAuthor.label;"/>
+ <hbox pack="left">
+ <html:input type="checkbox" id="suppress-author"/>
+ <html:label for="suppress-author">&zotero.citation.suppressAuthor.label;</html:label>
+ </hbox>
</rows>
</grid>
</panel>
diff --git a/chrome/content/zotero/xpcom/integration.js b/chrome/content/zotero/xpcom/integration.js
@@ -346,6 +346,7 @@ Zotero.Integration = new function() {
psn.address(),
1 // kSetFrontProcessFrontWindowOnly = (1 << 0)
);
+ carbon.close();
}, false);
} else {
if(Zotero.oscpu == "PPC Mac OS X 10.4" || Zotero.oscpu == "Intel Mac OS X 10.4"
diff --git a/chrome/skin/default/zotero/integration.css b/chrome/skin/default/zotero/integration.css
@@ -248,3 +248,7 @@ richlistitem[selected="true"] {
width: 16px;
height: 16px;
}
+
+#citation-properties #suppress-author {
+ -moz-user-focus: normal;
+}
+\ No newline at end of file