Require exact 8-character, uppercase item key for quick search

This commit is contained in:
Dan Stillman 2012-08-08 03:17:14 -04:00
parent f6e7cf83fa
commit 7dad7bcd5a

View file

@ -411,8 +411,9 @@ Zotero.Search.prototype.addCondition = function(condition, operator, value, requ
for each(var part in parts) { for each(var part in parts) {
this.addCondition('blockStart'); this.addCondition('blockStart');
if (operator == 'contains' && part.text.length > 1) { // If search string is 8 characters, see if this is a item key
this.addCondition('key', 'beginsWith', part.text, false); if (operator == 'contains' && part.text.length == 8) {
this.addCondition('key', 'is', part.text, false);
} }
if (condition == 'quicksearch-titleCreatorYear') { if (condition == 'quicksearch-titleCreatorYear') {