Accept two missing letters in object keys (but don't use them yet)

Also:

- 'T' doesn't come after 'X' (but does probably appear disproportionally
  in existing object keys)

This commit has been brought to you by the letters 'L' and 'Y'.
This commit is contained in:
Dan Stillman 2013-01-04 13:00:26 -05:00
parent 5e6c90d873
commit beaaf8fc6b
3 changed files with 10 additions and 4 deletions

View file

@ -536,8 +536,7 @@ Zotero.Creator.prototype._checkValue = function (field, value) {
break;
case 'key':
var re = /^[23456789ABCDEFGHIJKMNPQRSTUVWXTZ]{8}$/
if (!re.test(value)) {
if (!Zotero.ID.isValidKey(value)) {
this._invalidValueError(field, value);
}
break;

View file

@ -87,11 +87,18 @@ Zotero.ID_Tracker = function () {
function getKey() {
var baseString = "23456789ABCDEFGHIJKMNPQRSTUVWXTZ";
// TODO: add 'L' and 'Y' after 3.0.11 cut-off
var baseString = "23456789ABCDEFGHIJKMNPQRSTUVWXZ";
return Zotero.randomString(8, baseString);
}
this.isValidKey = function () {
var re = /^[23456789ABCDEFGHIJKLMNPQRSTUVWXYZ]{8}$/
return re.test(value);
}
function getBigInt(max) {
if (!max) {
max = 9007199254740991;

View file

@ -1069,7 +1069,7 @@ Zotero.Utilities = {
**/
"randomString":function(len, chars) {
if (!chars) {
chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";
chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghiklmnopqrstuvwxyz";
}
if (!len) {
len = 8;