commit af304f0834c065745ed316e307b7efa37a11a655
parent 6c7413ed7246265be8cabe2be0a07983aef96206
Author: Dan Stillman <dstillman@zotero.org>
Date: Wed, 8 Sep 2010 17:51:24 +0000
Commons:
- Align bucket name checks between UI and data layer
Diffstat:
2 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/chrome/content/zotero/overlay.js b/chrome/content/zotero/overlay.js
@@ -1562,9 +1562,10 @@ var ZoteroPane = new function()
while (true) {
if (invalid) {
// TODO: localize
- var msg = "'" + name + "' is not a valid Zotero Commons collection identifier.\n\n"
- + "Collection identifiers can contain basic Latin letters, numbers,"
- + "hyphens, and underscores. Spaces and other characters are not allowed.";
+ var msg = "'" + testName + "' is not a valid Zotero Commons collection identifier.\n\n"
+ + "Collection identifiers can contain basic Latin letters, numbers, "
+ + "hyphens, and underscores and must be no longer than 32 characters. "
+ + "Spaces and other characters are not allowed.";
prompt.alert("", msg);
invalid = false;
}
@@ -1574,9 +1575,11 @@ var ZoteroPane = new function()
"",
// TODO: localize
"Enter an identifier for the collection '" + title + "'.\n\n"
- + "The identifier will form the collection's URL on archive.org "
- + "and can contain basic Latin letters, numbers, hyphens, and underscores. "
+ + "The identifier will form the collection's URL on archive.org. "
+ + "Identifiers can contain basic Latin letters, numbers, hyphens, and underscores "
+ + "and must be no longer than 32 characters. "
+ "Spaces and other characters are not allowed.\n\n"
+ // TEMP
+ '"zc-test-' + Zotero.Commons.userNameSlug + '-" '
+ "will be automatically prepended to your entry.",
newName,
@@ -1593,7 +1596,9 @@ var ZoteroPane = new function()
return;
}
- if (!Zotero.Commons.isValidBucketName(name)) {
+ // TEMP
+ var testName = 'zc-test-' + Zotero.Commons.userNameSlug + '-' + name;
+ if (!Zotero.Commons.isValidBucketName(testName)) {
invalid = true;
continue;
}
diff --git a/chrome/content/zotero/xpcom/commons.js b/chrome/content/zotero/xpcom/commons.js
@@ -232,6 +232,7 @@ Zotero.Commons = new function() {
if (!_userName) {
throw new Exception("Username not set in Zotero.Commons.createBucket()");
}
+ // TEMP
name = "zc-test-" + this.userNameSlug + "-" + name;
var headers = {