summaryrefslogtreecommitdiff
path: root/share/www/script/jquery.couch.js
diff options
context:
space:
mode:
authorChristopher Lenz <cmlenz@apache.org>2009-07-22 09:03:40 +0000
committerChristopher Lenz <cmlenz@apache.org>2009-07-22 09:03:40 +0000
commitf6507e21f87f962c7e7731123450914aa12e227d (patch)
tree26b415f94a696d8bca9f1232ac6b058d3a6127fa /share/www/script/jquery.couch.js
parentf4aa228848f8b465ae5ea3088ef02a04051feeac (diff)
Change document creation in Futon so that it no longer prompts for a document ID, but simply opens the document page for an empty (and unsaved) document, and allows you to modify the ID.
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@796635 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'share/www/script/jquery.couch.js')
-rw-r--r--share/www/script/jquery.couch.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/share/www/script/jquery.couch.js b/share/www/script/jquery.couch.js
index 1d83a91d..0b5d4eab 100644
--- a/share/www/script/jquery.couch.js
+++ b/share/www/script/jquery.couch.js
@@ -22,6 +22,8 @@
return encodeURIComponent(docID);
}
+ uuidCache = [];
+
$.extend($.couch, {
activeTasks: function(options) {
ajax(
@@ -242,6 +244,22 @@
options,
"Replication failed"
);
+ },
+
+ newUUID: function(cacheNum) {
+ if (cacheNum === undefined) {
+ cacheNum = 1;
+ }
+ if (!uuidCache.length) {
+ ajax({url: "/_uuids", data: {count: cacheNum}, async: false}, {
+ success: function(resp) {
+ uuidCache = resp.uuids
+ }
+ },
+ "Failed to retrieve UUID batch."
+ );
+ }
+ return uuidCache.shift();
}
});