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"/>
<body>
<![CDATA[
this._search = val ? val.toLowerCase() : false;
this._search = val
? val.toLowerCase().normalize()
: false;
if (!skipRefresh) {
this.refresh();

View File

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

View File

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

View File

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

View File

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

View File

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