www

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

commit 49e281d3c5f06d21fc3cb40214cc816800c11640
parent 54b32ddb15483d80efbf0d08cb0572639c912e7d
Author: Simon Kornblith <simon@simonster.com>
Date:   Sun,  4 Dec 2011 13:14:58 -0500

Use quicksearch-titleCreatorYear instead of quicksearch-titlesAndCreators

Diffstat:
Mchrome/content/zotero/integration/quickFormat.js | 12+++---------
1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/chrome/content/zotero/integration/quickFormat.js b/chrome/content/zotero/integration/quickFormat.js @@ -162,7 +162,7 @@ var Zotero_QuickFormat = new function () { var str = _getEditorContent(); var haveConditions = false; - const specifiedLocatorRe = /(?:,? *(pp|p)(?:\. *| +)|:)([0-9\-]+) *$/; + const specifiedLocatorRe = /^(?:,? *(pp|p)(?:\. *| +)|:)([0-9\-]+) *$/; const yearPageLocatorRe = /,? *([0-9]+) *((B[. ]*C[. ]*|B[. ]*)|[AC][. ]*|A[. ]*D[. ]*|C[. ]*E[. ]*)?,? *(?:([0-9\-]+))?$/i; const creatorSplitRe = /(?:,| *(?:and|\&)) +/; const charRe = /[\w\u007F-\uFFFF]/; @@ -230,22 +230,16 @@ var Zotero_QuickFormat = new function () { str = str.substr(0, m.index)+str.substring(m.index+m[0].length); } + if(year) str += " "+year; var s = new Zotero.Search(); str = str.replace(" & ", " ", "g").replace(" and ", " ", "g"); if(charRe.test(str)) { Zotero.debug("QuickFormat: QuickSearch: "+str); - s.addCondition("quicksearch-titlesAndCreators", "contains", str); + s.addCondition("quicksearch-titleCreatorYear", "contains", str); s.addCondition("itemType", "isNot", "attachment"); haveConditions = true; } - - if(year) { - Zotero.debug("QuickFormat: Year: "+year); - s.addCondition("date", "isAfter", (year-1)+"-12-31 23:59:59"); - s.addCondition("date", "isBefore", (year)+"-12-31 23:59:59"); - haveConditions = true; - } } var ids = (haveConditions ? s.search() : []);