From 7ee1b1e491608370cbd8f273e7cc8a080e5b2ca1 Mon Sep 17 00:00:00 2001 From: gracile-fr Date: Thu, 14 Jun 2012 17:19:30 +0200 Subject: [PATCH 1/3] Frank's patch https://github.com/zotero/zotero/issues/132 Menu item to swap creator first/last names (#132) --- chrome/content/zotero/bindings/itembox.xml | 43 +++++++++++++++++++++- chrome/locale/en-US/zotero/zotero.dtd | 2 + 2 files changed, 44 insertions(+), 1 deletion(-) diff --git a/chrome/content/zotero/bindings/itembox.xml b/chrome/content/zotero/bindings/itembox.xml index 66ffb0a13..92bc809da 100644 --- a/chrome/content/zotero/bindings/itembox.xml +++ b/chrome/content/zotero/bindings/itembox.xml @@ -712,6 +712,7 @@ // Name var firstlast = document.createElement("hbox"); + firstlast.setAttribute("context", "creator-transform-menu"); firstlast.className = 'creator-name-box'; firstlast.setAttribute("flex","1"); var tabindex = this._tabIndexMinCreators + (this._creatorCount * 2); @@ -2166,6 +2167,24 @@ + + + + + + @@ -2433,7 +2452,29 @@ oncommand="document.getBindingParent(this).textTransform(document.popupNode, 'sentence')"/> - + + + + + + + + diff --git a/chrome/locale/en-US/zotero/zotero.dtd b/chrome/locale/en-US/zotero/zotero.dtd index 97c1dbc32..c5a896175 100644 --- a/chrome/locale/en-US/zotero/zotero.dtd +++ b/chrome/locale/en-US/zotero/zotero.dtd @@ -104,6 +104,8 @@ + + From c6afb86ba6b7de5698a4aa3f8af6e91bb46875a4 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Tue, 5 Mar 2013 15:03:01 -0500 Subject: [PATCH 2/3] Put "Swap first/last names" in creator context menu root And remove "Transform Name Form" menu for now Discussed in #132 --- chrome/content/zotero/bindings/itembox.xml | 10 +++++----- chrome/locale/en-US/zotero/zotero.dtd | 3 +-- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/chrome/content/zotero/bindings/itembox.xml b/chrome/content/zotero/bindings/itembox.xml index 9e9b266c6..51d339909 100644 --- a/chrome/content/zotero/bindings/itembox.xml +++ b/chrome/content/zotero/bindings/itembox.xml @@ -2516,13 +2516,13 @@ } else { return true; };"> - - + - - - + + diff --git a/chrome/locale/en-US/zotero/zotero.dtd b/chrome/locale/en-US/zotero/zotero.dtd index 674e8d215..0e4fa616d 100644 --- a/chrome/locale/en-US/zotero/zotero.dtd +++ b/chrome/locale/en-US/zotero/zotero.dtd @@ -121,8 +121,7 @@ - - + From 5b367b6ac148afed897c5febb6e1886c214ef65a Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Tue, 5 Mar 2013 15:35:15 -0500 Subject: [PATCH 3/3] Tweaks to name-swapping menu - Don't show menu if item isn't editable - Make DOM access more robust - Fix whitespace --- chrome/content/zotero/bindings/itembox.xml | 71 ++++++++++------------ 1 file changed, 32 insertions(+), 39 deletions(-) diff --git a/chrome/content/zotero/bindings/itembox.xml b/chrome/content/zotero/bindings/itembox.xml index 51d339909..b462bcb11 100644 --- a/chrome/content/zotero/bindings/itembox.xml +++ b/chrome/content/zotero/bindings/itembox.xml @@ -712,7 +712,6 @@ // Name var firstlast = document.createElement("hbox"); - firstlast.setAttribute("context", "creator-transform-menu"); firstlast.className = 'creator-name-box'; firstlast.setAttribute("flex","1"); var tabindex = this._tabIndexMinCreators + (this._creatorCount * 2); @@ -742,6 +741,11 @@ if (creator.fieldMode) { firstlast.lastChild.setAttribute('hidden', true); } + + if (this.editable) { + firstlast.setAttribute('contextmenu', 'zotero-creator-transform-menu'); + } + this._tabIndexMaxCreators = Math.max(this._tabIndexMaxCreators, tabindex); hbox.appendChild(firstlast); @@ -2215,23 +2219,20 @@ - - - - - + + + @@ -2501,27 +2502,19 @@ - - - - + +