Merge pull request #585 from aurimasv/nfc

Normalize all user and translator input to NFC
This commit is contained in:
Dan Stillman 2014-12-09 19:21:04 -05:00
commit 09638cbd2c
6 changed files with 12 additions and 6 deletions

View File

@ -107,7 +107,9 @@
<parameter name="skipRefresh"/> <parameter name="skipRefresh"/>
<body> <body>
<![CDATA[ <![CDATA[
this._search = val ? val.toLowerCase() : false; this._search = val
? val.toLowerCase().normalize()
: false;
if (!skipRefresh) { if (!skipRefresh) {
this.refresh(); this.refresh();

View File

@ -113,7 +113,7 @@ Zotero.Collection.prototype._set = function (field, val) {
return; return;
case 'name': case 'name':
val = Zotero.Utilities.trim(val); val = Zotero.Utilities.trim(val).normalize();
break; break;
} }

View File

@ -104,7 +104,7 @@ Zotero.Creator.prototype._set = function (field, val) {
case 'lastName': case 'lastName':
case 'shortName': case 'shortName':
if (val) { if (val) {
val = Zotero.Utilities.trim(val); val = Zotero.Utilities.trim(val).normalize();
} }
else { else {
val = ''; val = '';

View File

@ -691,7 +691,7 @@ Zotero.Item.prototype.inCollection = function(collectionID) {
*/ */
Zotero.Item.prototype.setField = function(field, value, loadIn) { Zotero.Item.prototype.setField = function(field, value, loadIn) {
if (typeof value == 'string') { if (typeof value == 'string') {
value = value.trim(); value = value.trim().normalize();
} }
this._disabledCheck(); this._disabledCheck();

View File

@ -98,7 +98,7 @@ Zotero.Tag.prototype._set = function (field, val) {
return; return;
case 'name': case 'name':
val = Zotero.Utilities.trim(val); val = Zotero.Utilities.trim(val).normalize();
break; break;
} }

View File

@ -114,7 +114,7 @@ Zotero.Search.prototype._set = function (field, val) {
return; return;
case 'name': case 'name':
val = Zotero.Utilities.trim(val); val = Zotero.Utilities.trim(val).normalize();
break; break;
} }
@ -481,6 +481,8 @@ Zotero.Search.prototype.addCondition = function(condition, operator, value, requ
var [condition, mode] = Zotero.SearchConditions.parseCondition(condition); var [condition, mode] = Zotero.SearchConditions.parseCondition(condition);
if (typeof value == 'string') value = value.normalize();
this._conditions[searchConditionID] = { this._conditions[searchConditionID] = {
id: searchConditionID, id: searchConditionID,
condition: condition, condition: condition,
@ -520,6 +522,8 @@ Zotero.Search.prototype.updateCondition = function(searchConditionID, condition,
var [condition, mode] = Zotero.SearchConditions.parseCondition(condition); var [condition, mode] = Zotero.SearchConditions.parseCondition(condition);
if (typeof value == 'string') value = value.normalize();
this._conditions[searchConditionID] = { this._conditions[searchConditionID] = {
id: parseInt(searchConditionID), id: parseInt(searchConditionID),
condition: condition, condition: condition,