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
diff --git a/jquery.couch.js b/jquery.couch.js
index e33d36c..62d9cf2 100644
--- a/jquery.couch.js
+++ b/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();
     }
 
   });