You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ja...@apache.org on 2014/10/10 21:12:15 UTC

[01/37] move JS tests into safety

Repository: couchdb
Updated Branches:
  refs/heads/goodbye-futon [created] 4fa015a86


http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/www/script/test/view_conflicts.js
----------------------------------------------------------------------
diff --git a/share/www/script/test/view_conflicts.js b/share/www/script/test/view_conflicts.js
deleted file mode 100644
index 96f97d5..0000000
--- a/share/www/script/test/view_conflicts.js
+++ /dev/null
@@ -1,49 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
-couchTests.view_conflicts = function(debug) {
-  var dbA = new CouchDB("test_suite_db_a", {"X-Couch-Full-Commit":"false"});
-  dbA.deleteDb();
-  dbA.createDb();
-  var dbB = new CouchDB("test_suite_db_b", {"X-Couch-Full-Commit":"false"});
-  dbB.deleteDb();
-  dbB.createDb();
-  if (debug) debugger;
-
-  var docA = {_id: "foo", bar: 42};
-  T(dbA.save(docA).ok);
-  CouchDB.replicate(dbA.name, dbB.name);
-
-  var docB = dbB.open("foo");
-  docB.bar = 43;
-  dbB.save(docB);
-  docA.bar = 41;
-  dbA.save(docA);
-  CouchDB.replicate(dbA.name, dbB.name);
-
-  var doc = dbB.open("foo", {conflicts: true});
-  T(doc._conflicts.length == 1);
-  var conflictRev = doc._conflicts[0];
-  if (doc.bar == 41) { // A won
-    T(conflictRev == docB._rev);
-  } else { // B won
-    T(doc.bar == 43);
-    T(conflictRev == docA._rev);
-  }
-
-  var results = dbB.query(function(doc) {
-    if (doc._conflicts) {
-      emit(doc._id, doc._conflicts);
-    }
-  });
-  T(results.rows[0].value[0] == conflictRev);
-};

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/www/script/test/view_errors.js
----------------------------------------------------------------------
diff --git a/share/www/script/test/view_errors.js b/share/www/script/test/view_errors.js
deleted file mode 100644
index e8bd08e..0000000
--- a/share/www/script/test/view_errors.js
+++ /dev/null
@@ -1,189 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
-couchTests.view_errors = function(debug) {
-  var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"true"});
-  db.deleteDb();
-  db.createDb();
-  if (debug) debugger;
-
-  run_on_modified_server(
-    [{section: "couchdb",
-      key: "os_process_timeout",
-      value: "500"}],
-    function() {
-      var doc = {integer: 1, string: "1", array: [1, 2, 3]};
-      T(db.save(doc).ok);
-
-      // emitting a key value that is undefined should result in that row
-      // being included in the view results as null
-      var results = db.query(function(doc) {
-        emit(doc.undef, null);
-      });
-      T(results.total_rows == 1);
-      T(results.rows[0].key == null);
-
-      // if a view function throws an exception, its results are not included in
-      // the view index, but the view does not itself raise an error
-      var results = db.query(function(doc) {
-        doc.undef(); // throws an error
-      });
-      T(results.total_rows == 0);
-
-      // if a view function includes an undefined value in the emitted key or
-      // value, it is treated as null
-      var results = db.query(function(doc) {
-        emit([doc._id, doc.undef], null);
-      });
-      T(results.total_rows == 1);
-      T(results.rows[0].key[1] == null);
-      
-      // querying a view with invalid params should give a resonable error message
-      var xhr = CouchDB.request("POST", "/test_suite_db/_temp_view?startkey=foo", {
-        headers: {"Content-Type": "application/json"},
-        body: JSON.stringify({language: "javascript",
-          map : "function(doc){emit(doc.integer)}"
-        })
-      });
-      T(JSON.parse(xhr.responseText).error == "bad_request");
-
-      // content type must be json
-      var xhr = CouchDB.request("POST", "/test_suite_db/_temp_view", {
-        headers: {"Content-Type": "application/x-www-form-urlencoded"},
-        body: JSON.stringify({language: "javascript",
-          map : "function(doc){}"
-        })
-      });
-      T(xhr.status == 415);
-
-      var map = function (doc) {emit(doc.integer, doc.integer);};
-
-      try {
-          db.query(map, null, {group: true});
-          T(0 == 1);
-      } catch(e) {
-          T(e.error == "query_parse_error");
-      }
-
-      var designDoc = {
-        _id:"_design/test",
-        language: "javascript",
-        views: {
-          "no_reduce": {map:"function(doc) {emit(doc._id, null);}"},
-          "with_reduce": {
-            map:"function (doc) {emit(doc.integer, doc.integer)};",
-            reduce:"function (keys, values) { return sum(values); };"}
-        }
-      };
-      T(db.save(designDoc).ok);
-
-      var designDoc2 = {
-        _id:"_design/testbig",
-        language: "javascript",
-        views: {
-          "reduce_too_big"  : {
-            map:"function (doc) {emit(doc.integer, doc.integer)};",
-            reduce:"function (keys, values) { var chars = []; for (var i=0; i < 1000; i++) {chars.push('wazzap');};return chars; };"}
-        }
-      };
-      T(db.save(designDoc2).ok);
-
-      try {
-          db.view("test/no_reduce", {group: true});
-          T(0 == 1);
-      } catch(e) {
-          T(db.last_req.status == 400);
-          T(e.error == "query_parse_error");
-      }
-
-      try {
-          db.view("test/no_reduce", {group_level: 1});
-          T(0 == 1);
-      } catch(e) {
-          T(db.last_req.status == 400);
-          T(e.error == "query_parse_error");
-      }
-
-      try {
-        db.view("test/no_reduce", {reduce: true});
-        T(0 == 1);
-      } catch(e) {
-        T(db.last_req.status == 400);
-        T(e.error == "query_parse_error");
-      }
-
-      db.view("test/no_reduce", {reduce: false});
-      TEquals(200, db.last_req.status, "reduce=false for map views (without"
-                                     + " group or group_level) is allowed");
-
-      try {
-          db.view("test/with_reduce", {group: true, reduce: false});
-          T(0 == 1);
-      } catch(e) {
-          T(db.last_req.status == 400);
-          T(e.error == "query_parse_error");
-      }
-
-      try {
-          db.view("test/with_reduce", {group_level: 1, reduce: false});
-          T(0 == 1);
-      } catch(e) {
-        T(db.last_req.status == 400);
-          T(e.error == "query_parse_error");
-      }
-
-      var designDoc3 = {
-        _id:"_design/infinite",
-        language: "javascript",
-        views: {
-          "infinite_loop" :{map:"function(doc) {while(true){emit(doc,doc);}};"}
-        }
-      };
-      T(db.save(designDoc3).ok);
-
-      try {
-          db.view("infinite/infinite_loop");
-          T(0 == 1);
-      } catch(e) {
-          T(e.error == "os_process_error");
-      }
-
-      // Check error responses for invalid multi-get bodies.
-      var path = "/test_suite_db/_design/test/_view/no_reduce";
-      var xhr = CouchDB.request("POST", path, {body: "[]"});
-      T(xhr.status == 400);
-      result = JSON.parse(xhr.responseText);
-      T(result.error == "bad_request");
-      T(result.reason == "Request body must be a JSON object");
-      var data = "{\"keys\": 1}";
-      xhr = CouchDB.request("POST", path, {body:data});
-      T(xhr.status == 400);
-      result = JSON.parse(xhr.responseText);
-      T(result.error == "bad_request");
-      T(result.reason == "`keys` member must be a array.");
-
-      // if the reduce grows to fast, throw an overflow error
-      var path = "/test_suite_db/_design/testbig/_view/reduce_too_big";
-      xhr = CouchDB.request("GET", path);
-      T(xhr.status == 500);
-      result = JSON.parse(xhr.responseText);
-      T(result.error == "reduce_overflow_error");
-
-      try {
-          db.query(function() {emit(null, null)}, null, {startkey: 2, endkey:1});
-          T(0 == 1);
-      } catch(e) {
-          T(e.error == "query_parse_error");
-          T(e.reason.match(/no rows can match/i));
-      }
-    });
-};

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/www/script/test/view_include_docs.js
----------------------------------------------------------------------
diff --git a/share/www/script/test/view_include_docs.js b/share/www/script/test/view_include_docs.js
deleted file mode 100644
index dab79b8..0000000
--- a/share/www/script/test/view_include_docs.js
+++ /dev/null
@@ -1,192 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
-couchTests.view_include_docs = function(debug) {
-  var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"});
-  db.deleteDb();
-  db.createDb();
-  if (debug) debugger;
-
-  var docs = makeDocs(0, 100);
-  db.bulkSave(docs);
-
-  var designDoc = {
-    _id:"_design/test",
-    language: "javascript",
-    views: {
-      all_docs: {
-        map: "function(doc) { emit(doc.integer, doc.string) }"
-      },
-      with_prev: {
-        map: "function(doc){if(doc.prev) emit(doc._id,{'_rev':doc.prev}); else emit(doc._id,{'_rev':doc._rev});}"
-      },
-      with_id: {
-        map: "function(doc) {if(doc.link_id) { var value = {'_id':doc.link_id}; if (doc.link_rev) {value._rev = doc.link_rev}; emit(doc._id, value);}};"
-      },
-      summate: {
-        map:"function (doc) { if (typeof doc.integer === 'number') {emit(doc.integer, doc.integer)};}",
-        reduce:"function (keys, values) { return sum(values); };"
-      }
-    }
-  }
-  T(db.save(designDoc).ok);
-
-  var resp = db.view('test/all_docs', {include_docs: true, limit: 2});
-  T(resp.rows.length == 2);
-  T(resp.rows[0].id == "0");
-  T(resp.rows[0].doc._id == "0");
-  T(resp.rows[1].id == "1");
-  T(resp.rows[1].doc._id == "1");
-
-  resp = db.view('test/all_docs', {include_docs: true}, [29, 74]);
-  T(resp.rows.length == 2);
-  T(resp.rows[0].doc._id == "29");
-  T(resp.rows[1].doc.integer == 74);
-
-  resp = db.allDocs({limit: 2, skip: 1, include_docs: true});
-  T(resp.rows.length == 2);
-  T(resp.rows[0].doc.integer == 1);
-  T(resp.rows[1].doc.integer == 10);
-
-  resp = db.allDocs({include_docs: true}, ['not_a_doc']);
-  T(resp.rows.length == 1);
-  T(!resp.rows[0].doc);
-
-  resp = db.allDocs({include_docs: true}, ["1", "foo"]);
-  T(resp.rows.length == 2);
-  T(resp.rows[0].doc.integer == 1);
-  T(!resp.rows[1].doc);
-
-  resp = db.allDocs({include_docs: true, limit: 0});
-  T(resp.rows.length == 0);
-
-  // No reduce support
-  try {
-      resp = db.view('test/summate', {include_docs: true});
-      alert(JSON.stringify(resp));
-      T(0==1);
-  } catch (e) {
-      T(e.error == 'query_parse_error');
-  }
-
-  // Reduce support when reduce=false
-  resp = db.view('test/summate', {reduce: false, include_docs: true});
-  T(resp.rows.length == 100);
-
-  // Not an error with include_docs=false&reduce=true
-  resp = db.view('test/summate', {reduce: true, include_docs: false});
-  T(resp.rows.length == 1);
-  T(resp.rows[0].value == 4950);
-
-  T(db.save({
-    "_id": "link-to-10",
-    "link_id" : "10"
-  }).ok);
-  
-  // you can link to another doc from a value.
-  resp = db.view("test/with_id", {key:"link-to-10"});
-  T(resp.rows[0].key == "link-to-10");
-  T(resp.rows[0].value["_id"] == "10");
-  
-  resp = db.view("test/with_id", {key:"link-to-10",include_docs: true});
-  T(resp.rows[0].key == "link-to-10");
-  T(resp.rows[0].value["_id"] == "10");
-  T(resp.rows[0].doc._id == "10");
-
-  // Check emitted _rev controls things
-  resp = db.allDocs({include_docs: true}, ["0"]);
-  var before = resp.rows[0].doc;
-
-  var after = db.open("0");
-  after.integer = 100;
-  after.prev = after._rev;
-  resp = db.save(after)
-  T(resp.ok);
-  
-  var after = db.open("0");
-  TEquals(resp.rev, after._rev, "fails with firebug running");
-  T(after._rev != after.prev, "passes");
-  TEquals(100, after.integer, "fails with firebug running");
-
-  // should emit the previous revision
-  resp = db.view("test/with_prev", {include_docs: true}, ["0"]);
-  T(resp.rows[0].doc._id == "0");
-  T(resp.rows[0].doc._rev == before._rev);
-  T(!resp.rows[0].doc.prev);
-  T(resp.rows[0].doc.integer == 0);
-
-  var xhr = CouchDB.request("POST", "/test_suite_db/_compact");
-  T(xhr.status == 202)
-  while (db.info().compact_running) {}
-
-  resp = db.view("test/with_prev", {include_docs: true}, ["0", "23"]);
-  T(resp.rows.length == 2);
-  T(resp.rows[0].key == "0");
-  T(resp.rows[0].id == "0");
-  T(!resp.rows[0].doc);
-  T(resp.rows[0].doc == null);
-  T(resp.rows[1].doc.integer == 23);
-
-  // COUCHDB-549 - include_docs=true with conflicts=true
-
-  var dbA = new CouchDB("test_suite_db_a", {"X-Couch-Full-Commit":"false"});
-  var dbB = new CouchDB("test_suite_db_b", {"X-Couch-Full-Commit":"false"});
-
-  dbA.deleteDb();
-  dbA.createDb();
-  dbB.deleteDb();
-  dbB.createDb();
-
-  var ddoc = {
-    _id: "_design/mydesign",
-    language : "javascript",
-    views : {
-      myview : {
-        map: (function(doc) {
-          emit(doc.value, 1);
-        }).toString()
-      }
-    }
-  };
-  TEquals(true, dbA.save(ddoc).ok);
-
-  var doc1a = {_id: "foo", value: 1, str: "1"};
-  TEquals(true, dbA.save(doc1a).ok);
-
-  var doc1b = {_id: "foo", value: 1, str: "666"};
-  TEquals(true, dbB.save(doc1b).ok);
-
-  var doc2 = {_id: "bar", value: 2, str: "2"};
-  TEquals(true, dbA.save(doc2).ok);
-
-  TEquals(true, CouchDB.replicate(dbA.name, dbB.name).ok);
-
-  doc1b = dbB.open("foo", {conflicts: true});
-  TEquals(true, doc1b._conflicts instanceof Array);
-  TEquals(1, doc1b._conflicts.length);
-  var conflictRev = doc1b._conflicts[0];
-
-  doc2 = dbB.open("bar", {conflicts: true});
-  TEquals("undefined", typeof doc2._conflicts);
-
-  resp = dbB.view("mydesign/myview", {include_docs: true, conflicts: true});
-
-  TEquals(2, resp.rows.length);
-  TEquals(true, resp.rows[0].doc._conflicts instanceof Array);
-  TEquals(1, resp.rows[0].doc._conflicts.length);
-  TEquals(conflictRev, resp.rows[0].doc._conflicts[0]);
-  TEquals("undefined", typeof resp.rows[1].doc._conflicts);
-
-  // cleanup
-  dbA.deleteDb();
-  dbB.deleteDb();
-};

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/www/script/test/view_multi_key_all_docs.js
----------------------------------------------------------------------
diff --git a/share/www/script/test/view_multi_key_all_docs.js b/share/www/script/test/view_multi_key_all_docs.js
deleted file mode 100644
index 7c7f6f8..0000000
--- a/share/www/script/test/view_multi_key_all_docs.js
+++ /dev/null
@@ -1,95 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
-couchTests.view_multi_key_all_docs = function(debug) {
-  var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"});
-  db.deleteDb();
-  db.createDb();
-  if (debug) debugger;
-
-  var docs = makeDocs(0, 100);
-  db.bulkSave(docs);
-
-  var keys = ["10","15","30","37","50"];
-  var rows = db.allDocs({},keys).rows;
-  T(rows.length == keys.length);
-  for(var i=0; i<rows.length; i++)
-    T(rows[i].id == keys[i]);
-
-  // keys in GET parameters
-  rows = db.allDocs({keys:keys}, null).rows;
-  T(rows.length == keys.length);
-  for(var i=0; i<rows.length; i++)
-    T(rows[i].id == keys[i]);
-
-  rows = db.allDocs({limit: 1}, keys).rows;
-  T(rows.length == 1);
-  T(rows[0].id == keys[0]);
-
-  // keys in GET parameters
-  rows = db.allDocs({limit: 1, keys: keys}, null).rows;
-  T(rows.length == 1);
-  T(rows[0].id == keys[0]);
-
-  rows = db.allDocs({skip: 2}, keys).rows;
-  T(rows.length == 3);
-  for(var i=0; i<rows.length; i++)
-      T(rows[i].id == keys[i+2]);
-
-  // keys in GET parameters
-  rows = db.allDocs({skip: 2, keys: keys}, null).rows;
-  T(rows.length == 3);
-  for(var i=0; i<rows.length; i++)
-      T(rows[i].id == keys[i+2]);
-
-  rows = db.allDocs({descending: "true"}, keys).rows;
-  T(rows.length == keys.length);
-  for(var i=0; i<rows.length; i++)
-      T(rows[i].id == keys[keys.length-i-1]);
-
-  // keys in GET parameters
-  rows = db.allDocs({descending: "true", keys: keys}, null).rows;
-  T(rows.length == keys.length);
-  for(var i=0; i<rows.length; i++)
-      T(rows[i].id == keys[keys.length-i-1]);
-
-  rows = db.allDocs({descending: "true", skip: 3, limit:1}, keys).rows;
-  T(rows.length == 1);
-  T(rows[0].id == keys[1]);
-
-  // keys in GET parameters
-  rows = db.allDocs({descending: "true", skip: 3, limit:1, keys: keys}, null).rows;
-  T(rows.length == 1);
-  T(rows[0].id == keys[1]);
-
-  // Check we get invalid rows when the key doesn't exist
-  rows = db.allDocs({}, [1, "i_dont_exist", "0"]).rows;
-  T(rows.length == 3);
-  T(rows[0].error == "not_found");
-  T(!rows[0].id);
-  T(rows[1].error == "not_found");
-  T(!rows[1].id);
-  T(rows[2].id == rows[2].key && rows[2].key == "0");
-
-  // keys in GET parameters
-  rows = db.allDocs({keys: [1, "i_dont_exist", "0"]}, null).rows;
-  T(rows.length == 3);
-  T(rows[0].error == "not_found");
-  T(!rows[0].id);
-  T(rows[1].error == "not_found");
-  T(!rows[1].id);
-  T(rows[2].id == rows[2].key && rows[2].key == "0");
-
-  // empty keys
-  rows = db.allDocs({keys: []}, null).rows;
-  T(rows.length == 0);
-};

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/www/script/test/view_multi_key_design.js
----------------------------------------------------------------------
diff --git a/share/www/script/test/view_multi_key_design.js b/share/www/script/test/view_multi_key_design.js
deleted file mode 100644
index a84d07a..0000000
--- a/share/www/script/test/view_multi_key_design.js
+++ /dev/null
@@ -1,220 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
-couchTests.view_multi_key_design = function(debug) {
-  var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"});
-  db.deleteDb();
-  db.createDb();
-  if (debug) debugger;
-
-  var docs = makeDocs(0, 100);
-  db.bulkSave(docs);
-
-  var designDoc = {
-    _id:"_design/test",
-    language: "javascript",
-    views: {
-      all_docs: {
-        map: "function(doc) { emit(doc.integer, doc.string) }"
-      },
-      multi_emit: {
-        map: "function(doc) {for(var i = 0 ; i < 3 ; i++) { emit(i, doc.integer) ; } }"
-      },
-      summate: {
-        map:"function (doc) {emit(doc.integer, doc.integer)};",
-        reduce:"function (keys, values) { return sum(values); };"
-      }
-    }
-  };
-  T(db.save(designDoc).ok);
-
-  // Test that missing keys work too
-  var keys = [101,30,15,37,50];
-  var reduce = db.view("test/summate",{group:true},keys).rows;
-  T(reduce.length == keys.length-1); // 101 is missing
-  for(var i=0; i<reduce.length; i++) {
-    T(keys.indexOf(reduce[i].key) != -1);
-    T(reduce[i].key == reduce[i].value);
-  }
-
-  // First, the goods:
-  var keys = [10,15,30,37,50];
-  var rows = db.view("test/all_docs",{},keys).rows;
-  for(var i=0; i<rows.length; i++) {
-    T(keys.indexOf(rows[i].key) != -1);
-    T(rows[i].key == rows[i].value);
-  }
-
-  // with GET keys
-  rows = db.view("test/all_docs",{keys:keys},null).rows;
-  for(var i=0;i<rows.length; i++) {
-    T(keys.indexOf(rows[i].key) != -1);
-    T(rows[i].key == rows[i].value);
-  }
-
-  // with empty keys
-  rows = db.view("test/all_docs",{keys:[]},null).rows;
-  T(rows.length == 0);
-
-  var reduce = db.view("test/summate",{group:true},keys).rows;
-  T(reduce.length == keys.length);
-  for(var i=0; i<reduce.length; i++) {
-    T(keys.indexOf(reduce[i].key) != -1);
-    T(reduce[i].key == reduce[i].value);
-  }
-
-  // with GET keys
-  reduce = db.view("test/summate",{group:true,keys:keys},null).rows;
-  T(reduce.length == keys.length);
-  for(var i=0; i<reduce.length; i++) {
-    T(keys.indexOf(reduce[i].key) != -1);
-    T(reduce[i].key == reduce[i].value);
-  }
-
-  // Test that invalid parameter combinations get rejected
-  var badargs = [{startkey:0}, {endkey:0}, {key: 0}, {group_level: 2}];
-  var getbadargs = [{startkey:0, keys:keys}, {endkey:0, keys:keys}, 
-      {key:0, keys:keys}, {group_level: 2, keys:keys}];
-  for(var i in badargs)
-  {
-      try {
-          db.view("test/all_docs",badargs[i],keys);
-          T(0==1);
-      } catch (e) {
-          T(e.error == "query_parse_error");
-      }
-
-      try {
-          db.view("test/all_docs",getbadargs[i],null);
-          T(0==1);
-      } catch (e) {
-          T(e.error = "query_parse_error");
-      }
-  }
-
-  try {
-      db.view("test/summate",{},keys);
-      T(0==1);
-  } catch (e) {
-      T(e.error == "query_parse_error");
-  }
-
-  try {
-      db.view("test/summate",{keys:keys},null);
-      T(0==1);
-  } catch (e) {
-      T(e.error == "query_parse_error");
-  }
-
-  // Test that a map & reduce containing func support keys when reduce=false
-  var resp = db.view("test/summate", {reduce: false}, keys);
-  T(resp.rows.length == 5);
-
-  resp = db.view("test/summate", {reduce: false, keys: keys}, null);
-  T(resp.rows.length == 5);
-
-  // Check that limiting by startkey_docid and endkey_docid get applied
-  // as expected.
-  var curr = db.view("test/multi_emit", {startkey_docid: 21, endkey_docid: 23}, [0, 2]).rows;
-  var exp_key = [ 0,  0,  0,  2,  2,  2] ;
-  var exp_val = [21, 22, 23, 21, 22, 23] ;
-  T(curr.length == 6);
-  for( var i = 0 ; i < 6 ; i++)
-  {
-      T(curr[i].key == exp_key[i]);
-      T(curr[i].value == exp_val[i]);
-  }
-
-  curr = db.view("test/multi_emit", {startkey_docid: 21, endkey_docid: 23, keys: [0, 2]}, null).rows;
-  T(curr.length == 6);
-  for( var i = 0 ; i < 6 ; i++)
-  {
-      T(curr[i].key == exp_key[i]);
-      T(curr[i].value == exp_val[i]);
-  }
-
-  // Check limit works
-  curr = db.view("test/all_docs", {limit: 1}, keys).rows;
-  T(curr.length == 1);
-  T(curr[0].key == 10);
-
-  curr = db.view("test/all_docs", {limit: 1, keys: keys}, null).rows;
-  T(curr.length == 1);
-  T(curr[0].key == 10);
-
-  // Check offset works
-  curr = db.view("test/multi_emit", {skip: 1}, [0]).rows;
-  T(curr.length == 99);
-  T(curr[0].value == 1);
-
-  curr = db.view("test/multi_emit", {skip: 1, keys: [0]}, null).rows;
-  T(curr.length == 99);
-  T(curr[0].value == 1);
-
-  // Check that dir works
-  curr = db.view("test/multi_emit", {descending: "true"}, [1]).rows;
-  T(curr.length == 100);
-  T(curr[0].value == 99);
-  T(curr[99].value == 0);
-
-  curr = db.view("test/multi_emit", {descending: "true", keys: [1]}, null).rows;
-  T(curr.length == 100);
-  T(curr[0].value == 99);
-  T(curr[99].value == 0);
-
-  // Check a couple combinations
-  curr = db.view("test/multi_emit", {descending: "true", skip: 3, limit: 2}, [2]).rows;
-  T(curr.length, 2);
-  T(curr[0].value == 96);
-  T(curr[1].value == 95);
-
-  curr = db.view("test/multi_emit", {descending: "true", skip: 3, limit: 2, keys: [2]}, null).rows;
-  T(curr.length, 2);
-  T(curr[0].value == 96);
-  T(curr[1].value == 95);
-
-  curr = db.view("test/multi_emit", {skip: 2, limit: 3, startkey_docid: "13"}, [0]).rows;
-  T(curr.length == 3);
-  T(curr[0].value == 15);
-  T(curr[1].value == 16);
-  T(curr[2].value == 17);
-
-  curr = db.view("test/multi_emit", {skip: 2, limit: 3, startkey_docid: "13", keys: [0]}, null).rows;
-  T(curr.length == 3);
-  T(curr[0].value == 15);
-  T(curr[1].value == 16);
-  T(curr[2].value == 17);
-
-  curr = db.view("test/multi_emit",
-          {skip: 1, limit: 5, startkey_docid: "25", endkey_docid: "27"}, [1]).rows;
-  T(curr.length == 2);
-  T(curr[0].value == 26);
-  T(curr[1].value == 27);
-
-  curr = db.view("test/multi_emit",
-          {skip: 1, limit: 5, startkey_docid: "25", endkey_docid: "27", keys: [1]}, null).rows;
-  T(curr.length == 2);
-  T(curr[0].value == 26);
-  T(curr[1].value == 27);
-
-  curr = db.view("test/multi_emit",
-          {skip: 1, limit: 5, startkey_docid: "28", endkey_docid: "26", descending: "true"}, [1]).rows;
-  T(curr.length == 2);
-  T(curr[0].value == 27);
-  T(curr[1].value == 26);
-
-  curr = db.view("test/multi_emit",
-          {skip: 1, limit: 5, startkey_docid: "28", endkey_docid: "26", descending: "true", keys: [1]}, null).rows;
-  T(curr.length == 2);
-  T(curr[0].value == 27);
-  T(curr[1].value == 26);
-};

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/www/script/test/view_multi_key_temp.js
----------------------------------------------------------------------
diff --git a/share/www/script/test/view_multi_key_temp.js b/share/www/script/test/view_multi_key_temp.js
deleted file mode 100644
index 3c05409..0000000
--- a/share/www/script/test/view_multi_key_temp.js
+++ /dev/null
@@ -1,40 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
-couchTests.view_multi_key_temp = function(debug) {
-  var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"});
-  db.deleteDb();
-  db.createDb();
-  if (debug) debugger;
-
-  var docs = makeDocs(0, 100);
-  db.bulkSave(docs);
-
-  var queryFun = function(doc) { emit(doc.integer, doc.integer) };
-  var reduceFun = function (keys, values) { return sum(values); };
-
-  var keys = [10,15,30,37,50];
-  var rows = db.query(queryFun, null, {}, keys).rows;
-  for(var i=0; i<rows.length; i++) {
-    T(keys.indexOf(rows[i].key) != -1);
-    T(rows[i].key == rows[i].value);
-  }
-
-  var reduce = db.query(queryFun, reduceFun, {group:true}, keys).rows;
-  for(var i=0; i<reduce.length; i++) {
-    T(keys.indexOf(reduce[i].key) != -1);
-    T(reduce[i].key == reduce[i].value);
-  }
-
-  rows = db.query(queryFun, null, {}, []).rows;
-  T(rows.length == 0);
-};

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/www/script/test/view_offsets.js
----------------------------------------------------------------------
diff --git a/share/www/script/test/view_offsets.js b/share/www/script/test/view_offsets.js
deleted file mode 100644
index 464a1ae..0000000
--- a/share/www/script/test/view_offsets.js
+++ /dev/null
@@ -1,108 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
-couchTests.view_offsets = function(debug) {
-  if (debug) debugger;
-
-  var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"});
-  db.deleteDb();
-  db.createDb();
-
-  var designDoc = {
-    _id : "_design/test",
-    views : {
-      offset : {
-        map : "function(doc) { emit([doc.letter, doc.number], doc); }",
-      }
-    }
-  };
-  T(db.save(designDoc).ok);
-
-  var docs = [
-    {_id : "a1", letter : "a", number : 1, foo: "bar"},
-    {_id : "a2", letter : "a", number : 2, foo: "bar"},
-    {_id : "a3", letter : "a", number : 3, foo: "bar"},
-    {_id : "b1", letter : "b", number : 1, foo: "bar"},
-    {_id : "b2", letter : "b", number : 2, foo: "bar"},
-    {_id : "b3", letter : "b", number : 3, foo: "bar"},
-    {_id : "b4", letter : "b", number : 4, foo: "bar"},
-    {_id : "b5", letter : "b", number : 5, foo: "bar"},
-    {_id : "c1", letter : "c", number : 1, foo: "bar"},
-    {_id : "c2", letter : "c", number : 2, foo: "bar"},
-  ];
-  db.bulkSave(docs);
-
-  var check = function(startkey, offset) {
-    var opts = {startkey: startkey, descending: true};
-    T(db.view("test/offset", opts).offset == offset);
-  };
-
-  [
-      [["c", 2], 0],
-      [["c", 1], 1],
-      [["b", 5], 2],
-      [["b", 4], 3],
-      [["b", 3], 4],
-      [["b", 2], 5],
-      [["b", 1], 6],
-      [["a", 3], 7],
-      [["a", 2], 8],
-      [["a", 1], 9]
-  ].forEach(function(row){ check(row[0], row[1]);});
-
-  var runTest = function () {
-    var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"});
-    db.deleteDb();
-    db.createDb();
-
-    var designDoc = {
-      _id : "_design/test",
-      views : {
-        offset : {
-          map : "function(doc) { emit([doc.letter, doc.number], doc);}",
-        }
-      }
-    };
-    T(db.save(designDoc).ok);
-
-    var docs = [
-      {_id : "a1", letter : "a", number : 1, foo : "bar"},
-      {_id : "a2", letter : "a", number : 2, foo : "bar"},
-      {_id : "a3", letter : "a", number : 3, foo : "bar"},
-      {_id : "b1", letter : "b", number : 1, foo : "bar"},
-      {_id : "b2", letter : "b", number : 2, foo : "bar"},
-      {_id : "b3", letter : "b", number : 3, foo : "bar"},
-      {_id : "b4", letter : "b", number : 4, foo : "bar"},
-      {_id : "b5", letter : "b", number : 5, foo : "bar"},
-      {_id : "c1", letter : "c", number : 1, foo : "bar"},
-      {_id : "c2", letter : "c", number : 2, foo : "bar"}
-    ];
-    db.bulkSave(docs);
-
-    var res1 = db.view("test/offset", {
-      startkey: ["b",4], startkey_docid: "b4", endkey: ["b"],
-      limit: 2, descending: true, skip: 1
-    })
-
-    var res2 = db.view("test/offset", {startkey: ["c", 3]});
-    var res3 = db.view("test/offset", {
-        startkey: ["b", 6],
-        endkey: ["b", 7]
-    });
-
-    return res1.offset == 4 && res2.offset == docs.length && res3.offset == 8;
-
-  };
-
-  for(var i = 0; i < 15; i++) T(runTest());
-}
-

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/www/script/test/view_pagination.js
----------------------------------------------------------------------
diff --git a/share/www/script/test/view_pagination.js b/share/www/script/test/view_pagination.js
deleted file mode 100644
index ed3a7ee..0000000
--- a/share/www/script/test/view_pagination.js
+++ /dev/null
@@ -1,147 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
-couchTests.view_pagination = function(debug) {
-    var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"});
-    db.deleteDb();
-    db.createDb();
-    if (debug) debugger;
-
-    var docs = makeDocs(0, 100);
-    db.bulkSave(docs);
-
-    var queryFun = function(doc) { emit(doc.integer, null); };
-    var i;
-
-    // page through the view ascending
-    for (i = 0; i < docs.length; i += 10) {
-      var queryResults = db.query(queryFun, null, {
-        startkey: i,
-        startkey_docid: i,
-        limit: 10
-      });
-      T(queryResults.rows.length == 10);
-      T(queryResults.total_rows == docs.length);
-      T(queryResults.offset == i);
-      var j;
-      for (j = 0; j < 10;j++) {
-        T(queryResults.rows[j].key == i + j);
-      }
-
-      // test aliases start_key and start_key_doc_id
-      queryResults = db.query(queryFun, null, {
-        start_key: i,
-        start_key_doc_id: i,
-        limit: 10
-      });
-      T(queryResults.rows.length == 10);
-      T(queryResults.total_rows == docs.length);
-      T(queryResults.offset == i);
-      for (j = 0; j < 10;j++) {
-        T(queryResults.rows[j].key == i + j);
-      }
-    }
-
-    // page through the view descending
-    for (i = docs.length - 1; i >= 0; i -= 10) {
-      var queryResults = db.query(queryFun, null, {
-        startkey: i,
-        startkey_docid: i,
-        descending: true,
-        limit: 10
-      });
-      T(queryResults.rows.length == 10);
-      T(queryResults.total_rows == docs.length);
-      T(queryResults.offset == docs.length - i - 1);
-      var j;
-      for (j = 0; j < 10; j++) {
-        T(queryResults.rows[j].key == i - j);
-      }
-    }
-
-    // ignore decending=false. CouchDB should just ignore that.
-    for (i = 0; i < docs.length; i += 10) {
-      var queryResults = db.query(queryFun, null, {
-        startkey: i,
-        startkey_docid: i,
-        descending: false,
-        limit: 10
-      });
-      T(queryResults.rows.length == 10);
-      T(queryResults.total_rows == docs.length);
-      T(queryResults.offset == i);
-      var j;
-      for (j = 0; j < 10;j++) {
-        T(queryResults.rows[j].key == i + j);
-      }
-    }
-
-    function testEndkeyDocId(queryResults) {
-      T(queryResults.rows.length == 35);
-      T(queryResults.total_rows == docs.length);
-      T(queryResults.offset == 1);
-      T(queryResults.rows[0].id == "1");
-      T(queryResults.rows[1].id == "10");
-      T(queryResults.rows[2].id == "11");
-      T(queryResults.rows[3].id == "12");
-      T(queryResults.rows[4].id == "13");
-      T(queryResults.rows[5].id == "14");
-      T(queryResults.rows[6].id == "15");
-      T(queryResults.rows[7].id == "16");
-      T(queryResults.rows[8].id == "17");
-      T(queryResults.rows[9].id == "18");
-      T(queryResults.rows[10].id == "19");
-      T(queryResults.rows[11].id == "2");
-      T(queryResults.rows[12].id == "20");
-      T(queryResults.rows[13].id == "21");
-      T(queryResults.rows[14].id == "22");
-      T(queryResults.rows[15].id == "23");
-      T(queryResults.rows[16].id == "24");
-      T(queryResults.rows[17].id == "25");
-      T(queryResults.rows[18].id == "26");
-      T(queryResults.rows[19].id == "27");
-      T(queryResults.rows[20].id == "28");
-      T(queryResults.rows[21].id == "29");
-      T(queryResults.rows[22].id == "3");
-      T(queryResults.rows[23].id == "30");
-      T(queryResults.rows[24].id == "31");
-      T(queryResults.rows[25].id == "32");
-      T(queryResults.rows[26].id == "33");
-      T(queryResults.rows[27].id == "34");
-      T(queryResults.rows[28].id == "35");
-      T(queryResults.rows[29].id == "36");
-      T(queryResults.rows[30].id == "37");
-      T(queryResults.rows[31].id == "38");
-      T(queryResults.rows[32].id == "39");
-      T(queryResults.rows[33].id == "4");
-      T(queryResults.rows[34].id == "40");
-    }
-
-    // test endkey_docid
-    var queryResults = db.query(function(doc) { emit(null, null); }, null, {
-      startkey: null,
-      startkey_docid: 1,
-      endkey: null,
-      endkey_docid: 40
-    });
-    testEndkeyDocId(queryResults);
-
-    // test aliases end_key_doc_id and end_key
-    queryResults = db.query(function(doc) { emit(null, null); }, null, {
-      start_key: null,
-      start_key_doc_id: 1,
-      end_key: null,
-      end_key_doc_id: 40
-    });
-    testEndkeyDocId(queryResults);
-
-  };

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/www/script/test/view_sandboxing.js
----------------------------------------------------------------------
diff --git a/share/www/script/test/view_sandboxing.js b/share/www/script/test/view_sandboxing.js
deleted file mode 100644
index 5c73c5a..0000000
--- a/share/www/script/test/view_sandboxing.js
+++ /dev/null
@@ -1,140 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
-couchTests.view_sandboxing = function(debug) {
-  var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"});
-  db.deleteDb();
-  db.createDb();
-  if (debug) debugger;
-
-  var doc = {integer: 1, string: "1", array: [1, 2, 3]};
-  T(db.save(doc).ok);
-/*
-  // make sure that attempting to change the document throws an error
-  var results = db.query(function(doc) {
-    doc.integer = 2;
-    emit(null, doc);
-  });
-  T(results.total_rows == 0);
-
-  var results = db.query(function(doc) {
-    doc.array[0] = 0;
-    emit(null, doc);
-  });
-  T(results.total_rows == 0);
-*/
-  // make sure that a view cannot invoke interpreter internals such as the
-  // garbage collector
-  var results = db.query(function(doc) {
-    gc();
-    emit(null, doc);
-  });
-  T(results.total_rows == 0);
-
-  // make sure that a view cannot access the map_funs array defined used by
-  // the view server
-  var results = db.query(function(doc) { map_funs.push(1); emit(null, doc); });
-  T(results.total_rows == 0);
-
-  // make sure that a view cannot access the map_results array defined used by
-  // the view server
-  var results = db.query(function(doc) { map_results.push(1); emit(null, doc); });
-  T(results.total_rows == 0);
-
-  // test for COUCHDB-925
-  // altering 'doc' variable in map function affects other map functions
-  var ddoc = {
-    _id: "_design/foobar",
-    language: "javascript",
-    views: {
-      view1: {
-        map:
-          (function(doc) {
-            if (doc.values) {
-              doc.values = [666];
-            }
-            if (doc.tags) {
-              doc.tags.push("qwerty");
-            }
-            if (doc.tokens) {
-              doc.tokens["c"] = 3;
-            }
-          }).toString()
-      },
-      view2: {
-        map:
-          (function(doc) {
-            if (doc.values) {
-              emit(doc._id, doc.values);
-            }
-            if (doc.tags) {
-              emit(doc._id, doc.tags);
-            }
-            if (doc.tokens) {
-              emit(doc._id, doc.tokens);
-            }
-          }).toString()
-      }
-    }
-  };
-  var doc1 = {
-    _id: "doc1",
-    values: [1, 2, 3]
-  };
-  var doc2 = {
-    _id: "doc2",
-    tags: ["foo", "bar"],
-    tokens: {a: 1, b: 2}
-  };
-
-  db.deleteDb();
-  db.createDb();
-  T(db.save(ddoc).ok);
-  T(db.save(doc1).ok);
-  T(db.save(doc2).ok);
-
-  var view1Results = db.view(
-    "foobar/view1", {bypass_cache: Math.round(Math.random() * 1000)});
-  var view2Results = db.view(
-    "foobar/view2", {bypass_cache: Math.round(Math.random() * 1000)});
-
-  TEquals(0, view1Results.rows.length, "view1 has 0 rows");
-  TEquals(3, view2Results.rows.length, "view2 has 3 rows");
-
-  TEquals(doc1._id, view2Results.rows[0].key);
-  TEquals(doc2._id, view2Results.rows[1].key);
-  TEquals(doc2._id, view2Results.rows[2].key);
-
-  // https://bugzilla.mozilla.org/show_bug.cgi?id=449657
-  TEquals(3, view2Results.rows[0].value.length,
-    "Warning: installed SpiderMonkey version doesn't allow sealing of arrays");
-  if (view2Results.rows[0].value.length === 3) {
-    TEquals(1, view2Results.rows[0].value[0]);
-    TEquals(2, view2Results.rows[0].value[1]);
-    TEquals(3, view2Results.rows[0].value[2]);
-  }
-
-  TEquals(1, view2Results.rows[1].value["a"]);
-  TEquals(2, view2Results.rows[1].value["b"]);
-  TEquals('undefined', typeof view2Results.rows[1].value["c"],
-    "doc2.tokens object was not sealed");
-
-  TEquals(2, view2Results.rows[2].value.length,
-    "Warning: installed SpiderMonkey version doesn't allow sealing of arrays");
-  if (view2Results.rows[2].value.length === 2) {
-    TEquals("foo", view2Results.rows[2].value[0]);
-    TEquals("bar", view2Results.rows[2].value[1]);
-  }
-
-  // cleanup
-  db.deleteDb();
-};

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/www/script/test/view_update_seq.js
----------------------------------------------------------------------
diff --git a/share/www/script/test/view_update_seq.js b/share/www/script/test/view_update_seq.js
deleted file mode 100644
index df92b11..0000000
--- a/share/www/script/test/view_update_seq.js
+++ /dev/null
@@ -1,106 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
-couchTests.view_update_seq = function(debug) {
-  var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"true"});
-  db.deleteDb();
-  db.createDb();
-  if (debug) debugger;
-
-  T(db.info().update_seq == 0);
-
-  var resp = db.allDocs({update_seq:true});
-
-  T(resp.rows.length == 0);
-  T(resp.update_seq == 0);
-
-  var designDoc = {
-    _id:"_design/test",
-    language: "javascript",
-    views: {
-      all_docs: {
-        map: "function(doc) { emit(doc.integer, doc.string) }"
-      },
-      summate: {
-        map:"function (doc) { if (typeof doc.integer === 'number') { emit(doc.integer, doc.integer)}; }",
-        reduce:"function (keys, values) { return sum(values); };"
-      }
-    }
-  };
-  T(db.save(designDoc).ok);
-
-  T(db.info().update_seq == 1);
-
-  resp = db.allDocs({update_seq:true});
-
-  T(resp.rows.length == 1);
-  T(resp.update_seq == 1);
-
-  var docs = makeDocs(0, 100);
-  db.bulkSave(docs);
-
-  resp = db.allDocs({limit: 1});
-  T(resp.rows.length == 1);
-  T(!resp.update_seq, "all docs");
-
-  resp = db.allDocs({limit: 1, update_seq:true});
-  T(resp.rows.length == 1);
-  T(resp.update_seq == 101);
-
-  resp = db.view('test/all_docs', {limit: 1, update_seq:true});
-  T(resp.rows.length == 1);
-  T(resp.update_seq == 101);
-
-  resp = db.view('test/all_docs', {limit: 1, update_seq:false});
-  T(resp.rows.length == 1);
-  T(!resp.update_seq, "view");
-
-  resp = db.view('test/summate', {update_seq:true});
-  T(resp.rows.length == 1);
-  T(resp.update_seq == 101);
-
-  db.save({"id":"0", "integer": 1});
-  resp = db.view('test/all_docs', {limit: 1,stale: "ok", update_seq:true});
-  T(resp.rows.length == 1);
-  T(resp.update_seq == 101);
-
-  db.save({"id":"00", "integer": 2});
-  resp = db.view('test/all_docs',
-    {limit: 1, stale: "update_after", update_seq: true});
-  T(resp.rows.length == 1);
-  T(resp.update_seq == 101);
-
-  // wait 5 seconds for the next assertions to pass in very slow machines
-  var t0 = new Date(), t1;
-  do {
-    CouchDB.request("GET", "/");
-    t1 = new Date();
-  } while ((t1 - t0) < 5000);
-
-  resp = db.view('test/all_docs', {limit: 1, stale: "ok", update_seq: true});
-  T(resp.rows.length == 1);
-  T(resp.update_seq == 103);
-
-  resp = db.view('test/all_docs', {limit: 1, update_seq:true});
-  T(resp.rows.length == 1);
-  T(resp.update_seq == 103);
-
-  resp = db.view('test/all_docs',{update_seq:true},["0","1"]);
-  T(resp.update_seq == 103);
-
-  resp = db.view('test/all_docs',{update_seq:true},["0","1"]);
-  T(resp.update_seq == 103);
-
-  resp = db.view('test/summate',{group:true, update_seq:true},[0,1]);
-  TEquals(103, resp.update_seq);
-
-};


[05/37] move JS tests into safety

Posted by ja...@apache.org.
http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/www/script/test/purge.js
----------------------------------------------------------------------
diff --git a/share/www/script/test/purge.js b/share/www/script/test/purge.js
deleted file mode 100644
index 2968913..0000000
--- a/share/www/script/test/purge.js
+++ /dev/null
@@ -1,145 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
-couchTests.purge = function(debug) {
-  var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"});
-  db.deleteDb();
-  db.createDb();
-  if (debug) debugger;
-
-  /*
-   purge is not to be confused with a document deletion.  It removes the
-   document and all edit history from the local instance of the database.
-  */
-
-  var numDocs = 10;
-
-  var designDoc = {
-    _id:"_design/test",
-    language: "javascript",
-    views: {
-      all_docs_twice: {map: "function(doc) { emit(doc.integer, null); emit(doc.integer, null) }"},
-      single_doc: {map: "function(doc) { if (doc._id == \"1\") { emit(1, null) }}"}
-    }
-  };
-
-  T(db.save(designDoc).ok);
-
-  db.bulkSave(makeDocs(1, numDocs + 1));
-
-  // go ahead and validate the views before purging
-  var rows = db.view("test/all_docs_twice").rows;
-  for (var i = 0; i < numDocs; i++) {
-    T(rows[2*i].key == i+1);
-    T(rows[(2*i)+1].key == i+1);
-  }
-  T(db.view("test/single_doc").total_rows == 1);
-
-  var info = db.info();
-  var doc1 = db.open("1");
-  var doc2 = db.open("2");
-
-  // purge the documents
-  var xhr = CouchDB.request("POST", "/test_suite_db/_purge", {
-    body: JSON.stringify({"1":[doc1._rev], "2":[doc2._rev]})
-  });
-  T(xhr.status == 200);
-
-  var result = JSON.parse(xhr.responseText);
-  var newInfo = db.info();
-  
-  // purging increments the update sequence
-  T(info.update_seq+1 == newInfo.update_seq);
-  // and it increments the purge_seq
-  T(info.purge_seq+1 == newInfo.purge_seq);
-  T(result.purge_seq == newInfo.purge_seq);
-
-  T(result.purged["1"][0] == doc1._rev);
-  T(result.purged["2"][0] == doc2._rev);
-
-  T(db.open("1") == null);
-  T(db.open("2") == null);
-
-  var rows = db.view("test/all_docs_twice").rows;
-  for (var i = 2; i < numDocs; i++) {
-    T(rows[2*(i-2)].key == i+1);
-    T(rows[(2*(i-2))+1].key == i+1);
-  }
-  T(db.view("test/single_doc").total_rows == 0);
-
-  // purge sequences are preserved after compaction (COUCHDB-1021)
-  T(db.compact().ok);
-  T(db.last_req.status == 202);
-  // compaction isn't instantaneous, loop until done
-  while (db.info().compact_running) {};
-  var compactInfo = db.info();
-  T(compactInfo.purge_seq == newInfo.purge_seq);
-
-  // purge documents twice in a row without loading views
-  // (causes full view rebuilds)
-
-  var doc3 = db.open("3");
-  var doc4 = db.open("4");
-
-  xhr = CouchDB.request("POST", "/test_suite_db/_purge", {
-    body: JSON.stringify({"3":[doc3._rev]})
-  });
-
-  T(xhr.status == 200);
-
-  xhr = CouchDB.request("POST", "/test_suite_db/_purge", {
-    body: JSON.stringify({"4":[doc4._rev]})
-  });
-
-  T(xhr.status == 200);
-  result = JSON.parse(xhr.responseText);
-  T(result.purge_seq == db.info().purge_seq);
-
-  var rows = db.view("test/all_docs_twice").rows;
-  for (var i = 4; i < numDocs; i++) {
-    T(rows[2*(i-4)].key == i+1);
-    T(rows[(2*(i-4))+1].key == i+1);
-  }
-  T(db.view("test/single_doc").total_rows == 0);
-
-  // COUCHDB-1065
-  var dbA = new CouchDB("test_suite_db_a");
-  var dbB = new CouchDB("test_suite_db_b");
-  dbA.deleteDb();
-  dbA.createDb();
-  dbB.deleteDb();
-  dbB.createDb();
-  var docA = {_id:"test", a:1};
-  var docB = {_id:"test", a:2};
-  dbA.save(docA);
-  dbB.save(docB);
-  CouchDB.replicate(dbA.name, dbB.name);
-  var xhr = CouchDB.request("POST", "/" + dbB.name + "/_purge", {
-    body: JSON.stringify({"test":[docA._rev]})
-  });
-  TEquals(200, xhr.status, "single rev purge after replication succeeds");
-
-  var xhr = CouchDB.request("GET", "/" + dbB.name + "/test?rev=" + docA._rev);
-  TEquals(404, xhr.status, "single rev purge removes revision");
-
-  var xhr = CouchDB.request("POST", "/" + dbB.name + "/_purge", {
-    body: JSON.stringify({"test":[docB._rev]})
-  });
-  TEquals(200, xhr.status, "single rev purge after replication succeeds");
-  var xhr = CouchDB.request("GET", "/" + dbB.name + "/test?rev=" + docB._rev);
-  TEquals(404, xhr.status, "single rev purge removes revision");
-
-  var xhr = CouchDB.request("POST", "/" + dbB.name + "/_purge", {
-    body: JSON.stringify({"test":[docA._rev, docB._rev]})
-  });
-  TEquals(200, xhr.status, "all rev purge after replication succeeds");
-};

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/www/script/test/reader_acl.js
----------------------------------------------------------------------
diff --git a/share/www/script/test/reader_acl.js b/share/www/script/test/reader_acl.js
deleted file mode 100644
index ff770c7..0000000
--- a/share/www/script/test/reader_acl.js
+++ /dev/null
@@ -1,219 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License.  You may obtain a copy
-// of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
-couchTests.reader_acl = function(debug) {
-  // this tests read access control
-
-  var usersDb = new CouchDB("test_suite_users", {"X-Couch-Full-Commit":"false"});
-  var secretDb = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"});
-  function testFun() {
-    try {
-      usersDb.deleteDb();
-      try {
-        usersDb.createDb();
-      } catch(e) {
-        if(usersDb.last_req.status != 412) {
-         throw e;
-        }
-      }
-      secretDb.deleteDb();
-      secretDb.createDb();
-
-      // create a user with top-secret-clearance
-      var jchrisUserDoc = CouchDB.prepareUserDoc({
-        name: "jchris@apache.org",
-        roles : ["top-secret"]
-      }, "funnybone");
-      T(usersDb.save(jchrisUserDoc).ok);
-      usersDb.ensureFullCommit();
-
-      T(CouchDB.session().userCtx.name == null);
-
-      // set secret db to be read controlled
-      T(secretDb.save({_id:"baz",foo:"bar"}).ok);
-      T(secretDb.open("baz").foo == "bar");
-
-      T(secretDb.setSecObj({
-        "members" : {
-          roles : ["super-secret-club"],
-          names : ["joe","barb"]
-        }
-      }).ok);
-    } finally {
-      CouchDB.logout();
-    }
-  }
-  
-  // split into 2 funs so we can test restart behavior
-  function testFun2() {
-    try {
-      // can't read it as jchris b/c he's missing the needed role
-      T(CouchDB.login("jchris@apache.org", "funnybone").ok);
-      T(CouchDB.session().userCtx.name == "jchris@apache.org");
-
-      try {
-        secretDb.open("baz");
-        T(false && "can't open a doc from a secret db") ;
-      } catch(e) {
-        T(true)
-      }
-
-      CouchDB.logout();
-      
-      // make anyone with the top-secret role an admin
-      // db admins are automatically members
-      T(secretDb.setSecObj({
-        "admins" : {
-          roles : ["top-secret"],
-          names : []
-        },
-        "members" : {
-          roles : ["super-secret-club"],
-          names : ["joe","barb"]
-        }
-      }).ok);
-
-
-      T(CouchDB.login("jchris@apache.org", "funnybone").ok);
-
-      // db admin can read
-      T(secretDb.open("baz").foo == "bar");
-
-      // and run temp views
-      TEquals(secretDb.query(function(doc) {
-        emit(null, null)
-      }).total_rows, 1);
-
-      CouchDB.logout();
-      T(CouchDB.session().userCtx.roles.indexOf("_admin") != -1);
-
-      // admin now adds the top-secret role to the db's members
-      // and removes db-admins
-      T(secretDb.setSecObj({
-        "admins" : {
-          roles : [],
-          names : []
-        },
-        "members" : {
-          roles : ["super-secret-club", "top-secret"],
-          names : ["joe","barb"]
-        }
-      }).ok);
-
-      // server _admin can always read
-      T(secretDb.open("baz").foo == "bar");
-
-      // and run temp views
-      TEquals(secretDb.query(function(doc) {
-        emit(null, null)
-      }).total_rows, 1);
-
-      T(secretDb.save({
-        "_id" : "_design/foo",
-        views : {
-          bar : {
-            map : "function(doc){emit(null, null)}"
-          }
-        }
-      }).ok)
-
-      // now top-secret users can read too
-      T(CouchDB.login("jchris@apache.org", "funnybone").ok);
-      T(CouchDB.session().userCtx.roles.indexOf("_admin") == -1);
-      T(secretDb.open("baz").foo == "bar");
-      // members can query stored views
-      T(secretDb.view("foo/bar").total_rows == 1);
-      
-      // members can't do temp views
-      try {
-        var results = secretDb.query(function(doc) {
-          emit(null, null);
-        });
-        T(false && "temp view should be admin only");
-      } catch (e) {
-        T(true && "temp view is admin only");
-      }
-      
-      CouchDB.logout();
-
-      // works with readers (backwards compat with 1.0)
-      T(secretDb.setSecObj({
-        "admins" : {
-          roles : [],
-          names : []
-        },
-        "readers" : {
-          roles : ["super-secret-club", "top-secret"],
-          names : ["joe","barb"]
-        }
-      }).ok);
-
-      T(CouchDB.login("jchris@apache.org", "funnybone").ok);
-      T(CouchDB.session().userCtx.roles.indexOf("_admin") == -1);
-      T(secretDb.open("baz").foo == "bar");
-
-      // can't set non string reader names or roles
-      try {
-        secretDb.setSecObj({
-          "members" : {
-            roles : ["super-secret-club", {"top-secret":"awesome"}],
-            names : ["joe","barb"]
-          }
-        })
-        T(false && "only string roles");
-      } catch (e) {}
-
-      try {
-        secretDb.setSecObj({
-          "members" : {
-            roles : ["super-secret-club", {"top-secret":"awesome"}],
-            names : ["joe",22]
-          }
-        });
-        T(false && "only string names");
-      } catch (e) {}
-      
-      try {
-        secretDb.setSecObj({
-          "members" : {
-            roles : ["super-secret-club", {"top-secret":"awesome"}],
-            names : "joe"
-          }
-        });
-        T(false && "only lists of names");
-      } catch (e) {}
-    } finally {
-      CouchDB.logout();
-    }
-  };
-
-  run_on_modified_server(
-    [{section: "httpd",
-      key: "authentication_handlers",
-      value: "{couch_httpd_auth, cookie_authentication_handler}, {couch_httpd_auth, default_authentication_handler}"},
-     {section: "couch_httpd_auth",
-      key: "authentication_db", value: "test_suite_users"}],
-    testFun
-  );
-        
-  // security changes will always commit synchronously
-  restartServer();
-  
-  run_on_modified_server(
-    [{section: "httpd",
-      key: "authentication_handlers",
-      value: "{couch_httpd_auth, cookie_authentication_handler}, {couch_httpd_auth, default_authentication_handler}"},
-     {section: "couch_httpd_auth",
-      key: "authentication_db", value: "test_suite_users"}],
-    testFun2
-  );
-}

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/www/script/test/recreate_doc.js
----------------------------------------------------------------------
diff --git a/share/www/script/test/recreate_doc.js b/share/www/script/test/recreate_doc.js
deleted file mode 100644
index f972379..0000000
--- a/share/www/script/test/recreate_doc.js
+++ /dev/null
@@ -1,145 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
-couchTests.recreate_doc = function(debug) {
-  var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"});
-  db.deleteDb();
-  db.createDb();
-  if (debug) debugger;
-
-  // First create a new document with the ID "foo", and delete it again
-  var doc = {_id: "foo", a: "bar", b: 42};
-  var result = db.save(doc);
-  T(result.ok);
-  var firstRev = result.rev;
-  T(db.deleteDoc(doc).ok);
-
-  // Now create a new document with the same ID, save it, and then modify it
-  for (var i = 0; i < 10; i++) {
-    doc = {_id: "foo"};
-    T(db.save(doc).ok);
-    doc = db.open("foo");
-    doc.a = "baz";
-    T(db.save(doc).ok);
-    T(db.deleteDoc(doc).rev != undefined);
-  }
-
-  try {
-    // COUCHDB-292 now attempt to save the document with a prev that's since
-    // been deleted and this should generate a conflict exception
-    db.save({_id:"foo", _rev:firstRev, bar:1});
-    T("no save conflict 1" && false); // we shouldn't hit here
-  } catch (e) {
-    T(e.error == "conflict");
-  }
-  
-  var binAttDoc = {
-    _id: "foo",
-    _rev:firstRev,
-    _attachments:{
-      "foo.txt": {
-        content_type:"text/plain",
-        data: "VGhpcyBpcyBhIGJhc2U2NCBlbmNvZGVkIHRleHQ="
-      }
-    }
-  };
-  try {
-    // same as before, but with binary
-    db.save(binAttDoc);
-    T("no save conflict 2" && false); // we shouldn't hit here
-  } catch (e) {
-    T(e.error == "conflict");
-  }
-
-
-  try {
-    // random non-existant prev rev
-    db.save({_id:"foo", _rev:"1-asfafasdf", bar:1});
-    T("no save conflict 3" && false); // we shouldn't hit here
-  } catch (e) {
-    T(e.error == "conflict");
-  }
-  
-  try {
-    // random non-existant prev rev with bin
-    binAttDoc._rev = "1-aasasfasdf";
-    db.save(binAttDoc);
-    T("no save conflict 4" && false); // we shouldn't hit here
-  } catch (e) {
-    T(e.error == "conflict");
-  }
-
-  db.deleteDb();
-  db.createDb();
-
-  // Helper function to create a doc with multiple revisions
-  // that are compacted away to ?REV_MISSING.
-
-  var createDoc = function(docid) {
-    var ret = [{_id: docid, count: 0}];
-    T(db.save(ret[0]).ok);
-    for(var i = 0; i < 2; i++) {
-      ret[ret.length] = {
-        _id: docid,
-        _rev: ret[ret.length-1]._rev,
-        count: ret[ret.length-1].count+1
-      };
-      T(db.save(ret[ret.length-1]).ok);
-    }
-    db.compact();
-    while(db.info().compact_running) {}
-    return ret;
-  }
-
-  // Helper function to check that there are no duplicates
-  // in the changes feed and that it has proper update
-  // sequence ordering.
-
-  var checkChanges = function() {
-    // Assert that there are no duplicates in _changes.
-    var req = CouchDB.request("GET", "/test_suite_db/_changes");
-    var resp = JSON.parse(req.responseText);
-    var docids = {};
-    var prev_seq = -1;
-    for(var i = 0; i < resp.results.length; i++) {
-      row = resp.results[i];
-      T(row.seq > prev_seq, "Unordered _changes feed.");
-      T(docids[row.id] === undefined, "Duplicates in _changes feed.");
-      prev_seq = row.seq;
-      docids[row.id] = true;
-    }
-  };
-
-  // COUCHDB-1265 - Check that the changes feed remains proper
-  // after we try and break the update_seq tree.
-
-  // This first case is the one originally reported and "fixed"
-  // in COUCHDB-1265. Reinserting an old revision into the
-  // revision tree causes duplicates in the update_seq tree.
-
-  var revs = createDoc("a");
-  T(db.save(revs[1], {new_edits: false}).ok);
-  T(db.save(revs[revs.length-1]).ok);
-  checkChanges();
-
-  // The original fix for COUCHDB-1265 is not entirely correct
-  // as it didn't consider the possibility that a compaction
-  // might run after the original tree screw up.
-
-  revs = createDoc("b");
-  T(db.save(revs[1], {new_edits: false}).ok);
-  db.compact();
-  while(db.info().compact_running) {}
-  T(db.save(revs[revs.length-1]).ok);
-  checkChanges();
-
-};

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/www/script/test/reduce.js
----------------------------------------------------------------------
diff --git a/share/www/script/test/reduce.js b/share/www/script/test/reduce.js
deleted file mode 100644
index 36e5cb7..0000000
--- a/share/www/script/test/reduce.js
+++ /dev/null
@@ -1,414 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
-couchTests.reduce = function(debug) {
-  var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"});
-  db.deleteDb();
-  db.createDb();
-  if (debug) debugger;
-  var numDocs = 500;
-  var docs = makeDocs(1,numDocs + 1);
-  db.bulkSave(docs);
-  var summate = function(N) {return (N+1)*N/2;};
-
-  var map = function (doc) {
-      emit(doc.integer, doc.integer);
-      emit(doc.integer, doc.integer);
-  };
-  var reduce = function (keys, values) { return sum(values); };
-  var result = db.query(map, reduce);
-  T(result.rows[0].value == 2*summate(numDocs));
-
-  result = db.query(map, reduce, {startkey: 4, endkey: 4});
-  T(result.rows[0].value == 8);
-
-  result = db.query(map, reduce, {startkey: 4, endkey: 5});
-  T(result.rows[0].value == 18);
-
-  result = db.query(map, reduce, {startkey: 4, endkey: 6});
-  T(result.rows[0].value == 30);
-
-  result = db.query(map, reduce, {group:true, limit:3});
-  T(result.rows[0].value == 2);
-  T(result.rows[1].value == 4);
-  T(result.rows[2].value == 6);
-
-  for(var i=1; i<numDocs/2; i+=30) {
-    result = db.query(map, reduce, {startkey: i, endkey: numDocs - i});
-    T(result.rows[0].value == 2*(summate(numDocs-i) - summate(i-1)));
-  }
-
-  db.deleteDb();
-  db.createDb();
-
-  for(var i=1; i <= 5; i++) {
-
-    for(var j=0; j < 10; j++) {
-      // these docs are in the order of the keys collation, for clarity
-      var docs = [];
-      docs.push({keys:["a"]});
-      docs.push({keys:["a"]});
-      docs.push({keys:["a", "b"]});
-      docs.push({keys:["a", "b"]});
-      docs.push({keys:["a", "b", "c"]});
-      docs.push({keys:["a", "b", "d"]});
-      docs.push({keys:["a", "c", "d"]});
-      docs.push({keys:["d"]});
-      docs.push({keys:["d", "a"]});
-      docs.push({keys:["d", "b"]});
-      docs.push({keys:["d", "c"]});
-      db.bulkSave(docs);
-      T(db.info().doc_count == ((i - 1) * 10 * 11) + ((j + 1) * 11));
-    }
-
-    map = function (doc) { emit(doc.keys, 1); };
-    reduce = function (keys, values) { return sum(values); };
-
-    var results = db.query(map, reduce, {group:true});
-
-    //group by exact key match
-    T(equals(results.rows[0], {key:["a"],value:20*i}));
-    T(equals(results.rows[1], {key:["a","b"],value:20*i}));
-    T(equals(results.rows[2], {key:["a", "b", "c"],value:10*i}));
-    T(equals(results.rows[3], {key:["a", "b", "d"],value:10*i}));
-
-    // test to make sure group reduce and limit params provide valid json
-    var results = db.query(map, reduce, {group: true, limit: 2});
-    T(equals(results.rows[0], {key: ["a"], value: 20*i}));
-    T(equals(results.rows.length, 2));
-
-    //group by the first element in the key array
-    var results = db.query(map, reduce, {group_level:1});
-    T(equals(results.rows[0], {key:["a"],value:70*i}));
-    T(equals(results.rows[1], {key:["d"],value:40*i}));
-
-    //group by the first 2 elements in the key array
-    var results = db.query(map, reduce, {group_level:2});
-    T(equals(results.rows[0], {key:["a"],value:20*i}));
-    T(equals(results.rows[1], {key:["a","b"],value:40*i}));
-    T(equals(results.rows[2], {key:["a","c"],value:10*i}));
-    T(equals(results.rows[3], {key:["d"],value:10*i}));
-    T(equals(results.rows[4], {key:["d","a"],value:10*i}));
-    T(equals(results.rows[5], {key:["d","b"],value:10*i}));
-    T(equals(results.rows[6], {key:["d","c"],value:10*i}));
-
-    // endkey test with inclusive_end=true
-    var results = db.query(map, reduce, {group_level:2,endkey:["d"],inclusive_end:true});
-    T(equals(results.rows[0], {key:["a"],value:20*i}));
-    T(equals(results.rows[1], {key:["a","b"],value:40*i}));
-    T(equals(results.rows[2], {key:["a","c"],value:10*i}));
-    T(equals(results.rows[3], {key:["d"],value:10*i}));
-    TEquals(4, results.rows.length);
-
-    // endkey test with inclusive_end=false
-    var results = db.query(map, reduce, {group_level:2,endkey:["d"],inclusive_end:false});
-    T(equals(results.rows[0], {key:["a"],value:20*i}));
-    T(equals(results.rows[1], {key:["a","b"],value:40*i}));
-    T(equals(results.rows[2], {key:["a","c"],value:10*i}));
-    TEquals(3, results.rows.length);
-  }
-
-  // now test out more complex reductions that need to use the combine option.
-
-  db.deleteDb();
-  db.createDb();
-
-
-  var map = function (doc) { emit(doc.val, doc.val); };
-  var reduceCombine = function (keys, values, rereduce) {
-      // This computes the standard deviation of the mapped results
-      var stdDeviation=0.0;
-      var count=0;
-      var total=0.0;
-      var sqrTotal=0.0;
-
-      if (!rereduce) {
-        // This is the reduce phase, we are reducing over emitted values from
-        // the map functions.
-        for(var i in values) {
-          total = total + values[i];
-          sqrTotal = sqrTotal + (values[i] * values[i]);
-        }
-        count = values.length;
-      }
-      else {
-        // This is the rereduce phase, we are re-reducing previosuly
-        // reduced values.
-        for(var i in values) {
-          count = count + values[i].count;
-          total = total + values[i].total;
-          sqrTotal = sqrTotal + values[i].sqrTotal;
-        }
-      }
-
-      var variance =  (sqrTotal - ((total * total)/count)) / count;
-      stdDeviation = Math.sqrt(variance);
-
-      // the reduce result. It contains enough information to be rereduced
-      // with other reduce results.
-      return {"stdDeviation":stdDeviation,"count":count,
-          "total":total,"sqrTotal":sqrTotal};
-    };
-
-    // Save a bunch a docs.
-
-  for(var i=0; i < 10; i++) {
-    var docs = [];
-    docs.push({val:10});
-    docs.push({val:20});
-    docs.push({val:30});
-    docs.push({val:40});
-    docs.push({val:50});
-    docs.push({val:60});
-    docs.push({val:70});
-    docs.push({val:80});
-    docs.push({val:90});
-    docs.push({val:100});
-    db.bulkSave(docs);
-  }
-
-  var results = db.query(map, reduceCombine);
-
-  var difference = results.rows[0].value.stdDeviation - 28.722813232690143;
-  // account for floating point rounding error
-  T(Math.abs(difference) < 0.0000000001);
-
-  function testReducePagination() {
-    var ddoc = {
-      "_id": "_design/test",
-      "language": "javascript",
-      "views": {
-        "view1": {
-          "map": "function(doc) {" +
-             "emit(doc.int, doc._id);" +
-             "emit(doc.int + 1, doc._id);" +
-             "emit(doc.int + 2, doc._id);" +
-          "}",
-          "reduce": "_count"
-        }
-      }
-    };
-    var result, docs = [];
-
-    function randVal() {
-        return Math.random() * 100000000;
-    }
-
-    db.deleteDb();
-    db.createDb();
-
-    for (var i = 0; i < 1123; i++) {
-      docs.push({"_id": String(i), "int": i});
-    }
-    db.bulkSave(docs.concat([ddoc]));
-
-    // ?group=false tests
-    result = db.view('test/view1', {startkey: 400, endkey: 402, foobar: randVal()});
-    TEquals(9, result.rows[0].value);
-    result = db.view('test/view1', {startkey: 402, endkey: 400, descending: true,
-      foobar: randVal()});
-    TEquals(9, result.rows[0].value);
-
-    result = db.view('test/view1', {startkey: 400, endkey: 402, inclusive_end: false,
-      foobar: randVal()});
-    TEquals(6, result.rows[0].value);
-    result = db.view('test/view1', {startkey: 402, endkey: 400, inclusive_end: false,
-      descending: true, foobar: randVal()});
-    TEquals(6, result.rows[0].value);
-
-    result = db.view('test/view1', {startkey: 400, endkey: 402, endkey_docid: "400",
-      foobar: randVal()});
-    TEquals(7, result.rows[0].value);
-    result = db.view('test/view1', {startkey: 400, endkey: 402, endkey_docid: "400",
-      inclusive_end: false, foobar: randVal()});
-    TEquals(6, result.rows[0].value);
-
-    result = db.view('test/view1', {startkey: 400, endkey: 402, endkey_docid: "401",
-      foobar: randVal()});
-    TEquals(8, result.rows[0].value);
-    result = db.view('test/view1', {startkey: 400, endkey: 402, endkey_docid: "401",
-      inclusive_end: false, foobar: randVal()});
-    TEquals(7, result.rows[0].value);
-
-    result = db.view('test/view1', {startkey: 400, endkey: 402, endkey_docid: "402",
-      foobar: randVal()});
-    TEquals(9, result.rows[0].value);
-    result = db.view('test/view1', {startkey: 400, endkey: 402, endkey_docid: "402",
-      inclusive_end: false, foobar: randVal()});
-    TEquals(8, result.rows[0].value);
-
-    result = db.view('test/view1', {startkey: 402, endkey: 400, endkey_docid: "398",
-      descending: true, foobar: randVal()});
-    TEquals(9, result.rows[0].value);
-    result = db.view('test/view1', {startkey: 402, endkey: 400, endkey_docid: "398",
-      descending: true, inclusive_end: false, foobar: randVal()}),
-    TEquals(8, result.rows[0].value);
-
-    result = db.view('test/view1', {startkey: 402, endkey: 400, endkey_docid: "399",
-      descending: true, foobar: randVal()});
-    TEquals(8, result.rows[0].value);
-    result = db.view('test/view1', {startkey: 402, endkey: 400, endkey_docid: "399",
-      descending: true, inclusive_end: false, foobar: randVal()}),
-    TEquals(7, result.rows[0].value);
-
-    result = db.view('test/view1', {startkey: 402, endkey: 400, endkey_docid: "400",
-      descending: true, foobar: randVal()}),
-    TEquals(7, result.rows[0].value);
-    result = db.view('test/view1', {startkey: 402, endkey: 400, endkey_docid: "400",
-      descending: true, inclusive_end: false, foobar: randVal()}),
-    TEquals(6, result.rows[0].value);
-
-    result = db.view('test/view1', {startkey: 402, startkey_docid: "400", endkey: 400,
-      descending: true, foobar: randVal()});
-    TEquals(7, result.rows[0].value);
-
-    result = db.view('test/view1', {startkey: 402, startkey_docid: "401", endkey: 400,
-      descending: true, inclusive_end: false, foobar: randVal()});
-    TEquals(5, result.rows[0].value);
-
-    // ?group=true tests
-    result = db.view('test/view1', {group: true, startkey: 400, endkey: 402,
-      foobar: randVal()});
-    TEquals(3, result.rows.length);
-    TEquals(400, result.rows[0].key);
-    TEquals(3, result.rows[0].value);
-    TEquals(401, result.rows[1].key);
-    TEquals(3, result.rows[1].value);
-    TEquals(402, result.rows[2].key);
-    TEquals(3, result.rows[2].value);
-
-    result = db.view('test/view1', {group: true, startkey: 402, endkey: 400,
-      descending: true, foobar: randVal()});
-    TEquals(3, result.rows.length);
-    TEquals(402, result.rows[0].key);
-    TEquals(3, result.rows[0].value);
-    TEquals(401, result.rows[1].key);
-    TEquals(3, result.rows[1].value);
-    TEquals(400, result.rows[2].key);
-    TEquals(3, result.rows[2].value);
-
-    result = db.view('test/view1', {group: true, startkey: 400, endkey: 402,
-      inclusive_end: false, foobar: randVal()});
-    TEquals(2, result.rows.length);
-    TEquals(400, result.rows[0].key);
-    TEquals(3, result.rows[0].value);
-    TEquals(401, result.rows[1].key);
-    TEquals(3, result.rows[1].value);
-
-    result = db.view('test/view1', {group: true, startkey: 402, endkey: 400,
-      descending: true, inclusive_end: false, foobar: randVal()});
-    TEquals(2, result.rows.length);
-    TEquals(402, result.rows[0].key);
-    TEquals(3, result.rows[0].value);
-    TEquals(401, result.rows[1].key);
-    TEquals(3, result.rows[1].value);
-
-    result = db.view('test/view1', {group: true, startkey: 400, endkey: 402,
-      endkey_docid: "401", foobar: randVal()});
-    TEquals(3, result.rows.length);
-    TEquals(400, result.rows[0].key);
-    TEquals(3, result.rows[0].value);
-    TEquals(401, result.rows[1].key);
-    TEquals(3, result.rows[1].value);
-    TEquals(402, result.rows[2].key);
-    TEquals(2, result.rows[2].value);
-
-    result = db.view('test/view1', {group: true, startkey: 400, endkey: 402,
-      endkey_docid: "400", foobar: randVal()});
-    TEquals(3, result.rows.length);
-    TEquals(400, result.rows[0].key);
-    TEquals(3, result.rows[0].value);
-    TEquals(401, result.rows[1].key);
-    TEquals(3, result.rows[1].value);
-    TEquals(402, result.rows[2].key);
-    TEquals(1, result.rows[2].value);
-
-    result = db.view('test/view1', {group: true, startkey: 402, startkey_docid: "401",
-      endkey: 400, descending: true, foobar: randVal()});
-    TEquals(3, result.rows.length);
-    TEquals(402, result.rows[0].key);
-    TEquals(2, result.rows[0].value);
-    TEquals(401, result.rows[1].key);
-    TEquals(3, result.rows[1].value);
-    TEquals(400, result.rows[2].key);
-    TEquals(3, result.rows[2].value);
-
-    result = db.view('test/view1', {group: true, startkey: 402, startkey_docid: "400",
-      endkey: 400, descending: true, foobar: randVal()});
-    TEquals(3, result.rows.length);
-    TEquals(402, result.rows[0].key);
-    TEquals(1, result.rows[0].value);
-    TEquals(401, result.rows[1].key);
-    TEquals(3, result.rows[1].value);
-    TEquals(400, result.rows[2].key);
-    TEquals(3, result.rows[2].value);
-
-    result = db.view('test/view1', {group: true, startkey: 402, startkey_docid: "401",
-      endkey: 400, descending: true, inclusive_end: false, foobar: randVal()});
-    TEquals(2, result.rows.length);
-    TEquals(402, result.rows[0].key);
-    TEquals(2, result.rows[0].value);
-    TEquals(401, result.rows[1].key);
-    TEquals(3, result.rows[1].value);
-
-    result = db.view('test/view1', {group: true, startkey: 402, startkey_docid: "400",
-      endkey: 400, descending: true, inclusive_end: false, foobar: randVal()});
-    TEquals(2, result.rows.length);
-    TEquals(402, result.rows[0].key);
-    TEquals(1, result.rows[0].value);
-    TEquals(401, result.rows[1].key);
-    TEquals(3, result.rows[1].value);
-
-    result = db.view('test/view1', {group: true, startkey: 402, endkey: 400,
-      endkey_docid: "398", descending: true, inclusive_end: true, foobar: randVal()});
-    TEquals(3, result.rows.length);
-    TEquals(402, result.rows[0].key);
-    TEquals(3, result.rows[0].value);
-    TEquals(401, result.rows[1].key);
-    TEquals(3, result.rows[1].value);
-    TEquals(400, result.rows[2].key);
-    TEquals(3, result.rows[2].value);
-
-    result = db.view('test/view1', {group: true, startkey: 402, endkey: 400,
-      endkey_docid: "399", descending: true, inclusive_end: true, foobar: randVal()});
-    TEquals(3, result.rows.length);
-    TEquals(402, result.rows[0].key);
-    TEquals(3, result.rows[0].value);
-    TEquals(401, result.rows[1].key);
-    TEquals(3, result.rows[1].value);
-    TEquals(400, result.rows[2].key);
-    TEquals(2, result.rows[2].value);
-
-    result = db.view('test/view1', {group: true, startkey: 402, endkey: 400,
-      endkey_docid: "399", descending: true, inclusive_end: false, foobar: randVal()});
-    TEquals(3, result.rows.length);
-    TEquals(402, result.rows[0].key);
-    TEquals(3, result.rows[0].value);
-    TEquals(401, result.rows[1].key);
-    TEquals(3, result.rows[1].value);
-    TEquals(400, result.rows[2].key);
-    TEquals(1, result.rows[2].value);
-
-    result = db.view('test/view1', {group: true, startkey: 402, endkey: 400,
-      endkey_docid: "400", descending: true, inclusive_end: false, foobar: randVal()});
-    TEquals(2, result.rows.length);
-    TEquals(402, result.rows[0].key);
-    TEquals(3, result.rows[0].value);
-    TEquals(401, result.rows[1].key);
-    TEquals(3, result.rows[1].value);
-
-    db.deleteDb();
-  }
-
-  testReducePagination();
-
-};

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/www/script/test/reduce_builtin.js
----------------------------------------------------------------------
diff --git a/share/www/script/test/reduce_builtin.js b/share/www/script/test/reduce_builtin.js
deleted file mode 100644
index b3cc3cc..0000000
--- a/share/www/script/test/reduce_builtin.js
+++ /dev/null
@@ -1,179 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
-couchTests.reduce_builtin = function(debug) {
-  var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"});
-  db.deleteDb();
-  db.createDb();
-  if (debug) debugger;
-
-  var numDocs = 500;
-  var docs = makeDocs(1,numDocs + 1);
-  db.bulkSave(docs);
-
-  var summate = function(N) {return (N+1)*N/2;};
-
-  var sumsqr = function(N) { 
-    var acc = 0;
-    for (var i=1; i<=N; ++i) {
-      acc += i*i;
-    }
-    return acc;
-  };
-
-  // this is the same test as the reduce.js test
-  // only we'll let CouchDB run reduce in Erlang
-  var map = function (doc) {
-      emit(doc.integer, doc.integer);
-      emit(doc.integer, doc.integer);
-  };
-
-  var result = db.query(map, "_sum");
-  T(result.rows[0].value == 2*summate(numDocs));
-  result = db.query(map, "_count");
-  T(result.rows[0].value == 1000);
-  result = db.query(map, "_stats");
-  T(result.rows[0].value.sum == 2*summate(numDocs));
-  T(result.rows[0].value.count == 1000);
-  T(result.rows[0].value.min == 1);
-  T(result.rows[0].value.max == 500);
-  T(result.rows[0].value.sumsqr == 2*sumsqr(numDocs));
-
-  result = db.query(map, "_sum", {startkey: 4, endkey: 4});
-  T(result.rows[0].value == 8);
-  result = db.query(map, "_count", {startkey: 4, endkey: 4});
-  T(result.rows[0].value == 2);
-
-  result = db.query(map, "_sum", {startkey: 4, endkey: 5});
-  T(result.rows[0].value == 18);
-  result = db.query(map, "_count", {startkey: 4, endkey: 5});
-  T(result.rows[0].value == 4);
-
-  result = db.query(map, "_sum", {startkey: 4, endkey: 6});
-  T(result.rows[0].value == 30);
-  result = db.query(map, "_count", {startkey: 4, endkey: 6});
-  T(result.rows[0].value == 6);
-
-  result = db.query(map, "_sum", {group:true, limit:3});
-  T(result.rows[0].value == 2);
-  T(result.rows[1].value == 4);
-  T(result.rows[2].value == 6);
-
-  for(var i=1; i<numDocs/2; i+=30) {
-    result = db.query(map, "_sum", {startkey: i, endkey: numDocs - i});
-    T(result.rows[0].value == 2*(summate(numDocs-i) - summate(i-1)));
-  }
-
-  // test for trailing characters after builtin functions, desired behaviour
-  // is to disregard any trailing characters
-  // I think the behavior should be a prefix test, so that even "_statsorama" 
-  // or "_stats\nare\awesome" should work just as "_stats" does. - JChris
-
-  var trailing = ["\u000a", "orama", "\nare\nawesome", " ", "     \n  "];
-
-  for(var i=0; i < trailing.length; i++) {
-    result = db.query(map, "_sum" + trailing[i]);
-    T(result.rows[0].value == 2*summate(numDocs));
-    result = db.query(map, "_count" + trailing[i]);
-    T(result.rows[0].value == 1000);
-    result = db.query(map, "_stats" + trailing[i]);
-    T(result.rows[0].value.sum == 2*summate(numDocs));
-    T(result.rows[0].value.count == 1000);
-    T(result.rows[0].value.min == 1);
-    T(result.rows[0].value.max == 500);
-    T(result.rows[0].value.sumsqr == 2*sumsqr(numDocs));
-  }
-
-  db.deleteDb();
-  db.createDb();
-
-  for(var i=1; i <= 5; i++) {
-
-    for(var j=0; j < 10; j++) {
-      // these docs are in the order of the keys collation, for clarity
-      var docs = [];
-      docs.push({keys:["a"]});
-      docs.push({keys:["a"]});
-      docs.push({keys:["a", "b"]});
-      docs.push({keys:["a", "b"]});
-      docs.push({keys:["a", "b", "c"]});
-      docs.push({keys:["a", "b", "d"]});
-      docs.push({keys:["a", "c", "d"]});
-      docs.push({keys:["d"]});
-      docs.push({keys:["d", "a"]});
-      docs.push({keys:["d", "b"]});
-      docs.push({keys:["d", "c"]});
-      db.bulkSave(docs);
-      T(db.info().doc_count == ((i - 1) * 10 * 11) + ((j + 1) * 11));
-    }
-
-    map = function (doc) { emit(doc.keys, 1); };
-    // with emitted values being 1, count should be the same as sum
-    var builtins = ["_sum", "_count"];
-
-    for (var b=0; b < builtins.length; b++) {
-      var fun = builtins[b];
-      var results = db.query(map, fun, {group:true});
-
-      //group by exact key match
-      T(equals(results.rows[0], {key:["a"],value:20*i}));
-      T(equals(results.rows[1], {key:["a","b"],value:20*i}));
-      T(equals(results.rows[2], {key:["a", "b", "c"],value:10*i}));
-      T(equals(results.rows[3], {key:["a", "b", "d"],value:10*i}));
-
-      // test to make sure group reduce and limit params provide valid json
-      var results = db.query(map, fun, {group: true, limit: 2});
-      T(equals(results.rows[0], {key: ["a"], value: 20*i}));
-      T(equals(results.rows.length, 2));
-
-      //group by the first element in the key array
-      var results = db.query(map, fun, {group_level:1});
-      T(equals(results.rows[0], {key:["a"],value:70*i}));
-      T(equals(results.rows[1], {key:["d"],value:40*i}));
-
-      //group by the first 2 elements in the key array
-      var results = db.query(map, fun, {group_level:2});
-      T(equals(results.rows[0], {key:["a"],value:20*i}));
-      T(equals(results.rows[1], {key:["a","b"],value:40*i}));
-      T(equals(results.rows[2], {key:["a","c"],value:10*i}));
-      T(equals(results.rows[3], {key:["d"],value:10*i}));
-      T(equals(results.rows[4], {key:["d","a"],value:10*i}));
-      T(equals(results.rows[5], {key:["d","b"],value:10*i}));
-      T(equals(results.rows[6], {key:["d","c"],value:10*i}));
-    };
-
-    map = function (doc) { emit(doc.keys, [1, 1]); };
-
-    var results = db.query(map, "_sum", {group:true});
-    T(equals(results.rows[0], {key:["a"],value:[20*i,20*i]}));
-    T(equals(results.rows[1], {key:["a","b"],value:[20*i,20*i]}));
-    T(equals(results.rows[2], {key:["a", "b", "c"],value:[10*i,10*i]}));
-    T(equals(results.rows[3], {key:["a", "b", "d"],value:[10*i,10*i]}));
-
-    var results = db.query(map, "_sum", {group: true, limit: 2});
-    T(equals(results.rows[0], {key: ["a"], value: [20*i,20*i]}));
-    T(equals(results.rows.length, 2));
-
-    var results = db.query(map, "_sum", {group_level:1});
-    T(equals(results.rows[0], {key:["a"],value:[70*i,70*i]}));
-    T(equals(results.rows[1], {key:["d"],value:[40*i,40*i]}));
-
-    var results = db.query(map, "_sum", {group_level:2});
-    T(equals(results.rows[0], {key:["a"],value:[20*i,20*i]}));
-    T(equals(results.rows[1], {key:["a","b"],value:[40*i,40*i]}));
-    T(equals(results.rows[2], {key:["a","c"],value:[10*i,10*i]}));
-    T(equals(results.rows[3], {key:["d"],value:[10*i,10*i]}));
-    T(equals(results.rows[4], {key:["d","a"],value:[10*i,10*i]}));
-    T(equals(results.rows[5], {key:["d","b"],value:[10*i,10*i]}));
-    T(equals(results.rows[6], {key:["d","c"],value:[10*i,10*i]}));
-  }
-}

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/www/script/test/reduce_false.js
----------------------------------------------------------------------
diff --git a/share/www/script/test/reduce_false.js b/share/www/script/test/reduce_false.js
deleted file mode 100644
index 699b258..0000000
--- a/share/www/script/test/reduce_false.js
+++ /dev/null
@@ -1,44 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
-couchTests.reduce_false = function(debug) {
-  var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"});
-  db.deleteDb();
-  db.createDb();
-  if (debug) debugger;
-
-  var numDocs = 5;
-  var docs = makeDocs(1,numDocs + 1);
-  db.bulkSave(docs);
-  var summate = function(N) {return (N+1)*N/2;};
-
-  var designDoc = {
-    _id:"_design/test",
-    language: "javascript",
-    views: {
-      summate: {map:"function (doc) { emit(doc.integer, doc.integer); }",
-                reduce:"function (keys, values) { return sum(values); }"},
-    }
-  };
-  T(db.save(designDoc).ok);
-
-  // Test that the reduce works
-  var res = db.view('test/summate');
-  T(res.rows.length == 1 && res.rows[0].value == summate(5));
-
-  //Test that we get our docs back
-  res = db.view('test/summate', {reduce: false});
-  T(res.rows.length == 5);
-  for(var i=0; i<5; i++) {
-    T(res.rows[i].value == i+1);
-  }
-};

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/www/script/test/reduce_false_temp.js
----------------------------------------------------------------------
diff --git a/share/www/script/test/reduce_false_temp.js b/share/www/script/test/reduce_false_temp.js
deleted file mode 100644
index d45f05b..0000000
--- a/share/www/script/test/reduce_false_temp.js
+++ /dev/null
@@ -1,37 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
-couchTests.reduce_false_temp = function(debug) {
-  var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"});
-  db.deleteDb();
-  db.createDb();
-  if (debug) debugger;
-
-  var numDocs = 5;
-  var docs = makeDocs(1,numDocs + 1);
-  db.bulkSave(docs);
-  var summate = function(N) {return (N+1)*N/2;};
-
-  var mapFun = "function (doc) { emit(doc.integer, doc.integer); }";
-  var reduceFun = "function (keys, values) { return sum(values); }";
-
-  // Test that the reduce works
-  var res = db.query(mapFun, reduceFun);
-  T(res.rows.length == 1 && res.rows[0].value == summate(5));
-
-  //Test that we get our docs back
-  res = db.query(mapFun, reduceFun, {reduce: false});
-  T(res.rows.length == 5);
-  for(var i=0; i<5; i++) {
-    T(res.rows[i].value == i+1);
-  }
-};


[30/37] goodbye Futon, old friend <3

Posted by ja...@apache.org.
http://git-wip-us.apache.org/repos/asf/couchdb/blob/cca309f3/share/www/fauxton/js/ace/worker-javascript.js
----------------------------------------------------------------------
diff --git a/share/www/fauxton/js/ace/worker-javascript.js b/share/www/fauxton/js/ace/worker-javascript.js
deleted file mode 100644
index 5481bed..0000000
--- a/share/www/fauxton/js/ace/worker-javascript.js
+++ /dev/null
@@ -1,10088 +0,0 @@
-"no use strict";
-;(function(window) {
-if (typeof window.window != "undefined" && window.document) {
-    return;
-}
-
-window.console = function() {
-    var msgs = Array.prototype.slice.call(arguments, 0);
-    postMessage({type: "log", data: msgs});
-};
-window.console.error =
-window.console.warn = 
-window.console.log =
-window.console.trace = window.console;
-
-window.window = window;
-window.ace = window;
-
-window.normalizeModule = function(parentId, moduleName) {
-    if (moduleName.indexOf("!") !== -1) {
-        var chunks = moduleName.split("!");
-        return window.normalizeModule(parentId, chunks[0]) + "!" + window.normalizeModule(parentId, chunks[1]);
-    }
-    if (moduleName.charAt(0) == ".") {
-        var base = parentId.split("/").slice(0, -1).join("/");
-        moduleName = (base ? base + "/" : "") + moduleName;
-        
-        while(moduleName.indexOf(".") !== -1 && previous != moduleName) {
-            var previous = moduleName;
-            moduleName = moduleName.replace(/^\.\//, "").replace(/\/\.\//, "/").replace(/[^\/]+\/\.\.\//, "");
-        }
-    }
-    
-    return moduleName;
-};
-
-window.require = function(parentId, id) {
-    if (!id) {
-        id = parentId
-        parentId = null;
-    }
-    if (!id.charAt)
-        throw new Error("worker.js require() accepts only (parentId, id) as arguments");
-
-    id = window.normalizeModule(parentId, id);
-
-    var module = window.require.modules[id];
-    if (module) {
-        if (!module.initialized) {
-            module.initialized = true;
-            module.exports = module.factory().exports;
-        }
-        return module.exports;
-    }
-    
-    var chunks = id.split("/");
-    if (!window.require.tlns)
-        return console.log("unable to load " + id);
-    chunks[0] = window.require.tlns[chunks[0]] || chunks[0];
-    var path = chunks.join("/") + ".js";
-    
-    window.require.id = id;
-    importScripts(path);
-    return window.require(parentId, id);
-};
-window.require.modules = {};
-window.require.tlns = {};
-
-window.define = function(id, deps, factory) {
-    if (arguments.length == 2) {
-        factory = deps;
-        if (typeof id != "string") {
-            deps = id;
-            id = window.require.id;
-        }
-    } else if (arguments.length == 1) {
-        factory = id;
-        deps = []
-        id = window.require.id;
-    }
-
-    if (!deps.length)
-        deps = ['require', 'exports', 'module']
-
-    if (id.indexOf("text!") === 0) 
-        return;
-    
-    var req = function(childId) {
-        return window.require(id, childId);
-    };
-
-    window.require.modules[id] = {
-        exports: {},
-        factory: function() {
-            var module = this;
-            var returnExports = factory.apply(this, deps.map(function(dep) {
-              switch(dep) {
-                  case 'require': return req
-                  case 'exports': return module.exports
-                  case 'module':  return module
-                  default:        return req(dep)
-              }
-            }));
-            if (returnExports)
-                module.exports = returnExports;
-            return module;
-        }
-    };
-};
-window.define.amd = {}
-
-window.initBaseUrls  = function initBaseUrls(topLevelNamespaces) {
-    require.tlns = topLevelNamespaces;
-}
-
-window.initSender = function initSender() {
-
-    var EventEmitter = window.require("ace/lib/event_emitter").EventEmitter;
-    var oop = window.require("ace/lib/oop");
-    
-    var Sender = function() {};
-    
-    (function() {
-        
-        oop.implement(this, EventEmitter);
-                
-        this.callback = function(data, callbackId) {
-            postMessage({
-                type: "call",
-                id: callbackId,
-                data: data
-            });
-        };
-    
-        this.emit = function(name, data) {
-            postMessage({
-                type: "event",
-                name: name,
-                data: data
-            });
-        };
-        
-    }).call(Sender.prototype);
-    
-    return new Sender();
-}
-
-window.main = null;
-window.sender = null;
-
-window.onmessage = function(e) {
-    var msg = e.data;
-    if (msg.command) {
-        if (main[msg.command])
-            main[msg.command].apply(main, msg.args);
-        else
-            throw new Error("Unknown command:" + msg.command);
-    }
-    else if (msg.init) {        
-        initBaseUrls(msg.tlns);
-        require("ace/lib/es5-shim");
-        sender = initSender();
-        var clazz = require(msg.module)[msg.classname];
-        main = new clazz(sender);
-    } 
-    else if (msg.event && sender) {
-        sender._emit(msg.event, msg.data);
-    }
-};
-})(this);// https://github.com/kriskowal/es5-shim
-
-define('ace/lib/es5-shim', ['require', 'exports', 'module' ], function(require, exports, module) {
-
-function Empty() {}
-
-if (!Function.prototype.bind) {
-    Function.prototype.bind = function bind(that) { // .length is 1
-        var target = this;
-        if (typeof target != "function") {
-            throw new TypeError("Function.prototype.bind called on incompatible " + target);
-        }
-        var args = slice.call(arguments, 1); // for normal call
-        var bound = function () {
-
-            if (this instanceof bound) {
-
-                var result = target.apply(
-                    this,
-                    args.concat(slice.call(arguments))
-                );
-                if (Object(result) === result) {
-                    return result;
-                }
-                return this;
-
-            } else {
-                return target.apply(
-                    that,
-                    args.concat(slice.call(arguments))
-                );
-
-            }
-
-        };
-        if(target.prototype) {
-            Empty.prototype = target.prototype;
-            bound.prototype = new Empty();
-            Empty.prototype = null;
-        }
-        return bound;
-    };
-}
-var call = Function.prototype.call;
-var prototypeOfArray = Array.prototype;
-var prototypeOfObject = Object.prototype;
-var slice = prototypeOfArray.slice;
-var _toString = call.bind(prototypeOfObject.toString);
-var owns = call.bind(prototypeOfObject.hasOwnProperty);
-var defineGetter;
-var defineSetter;
-var lookupGetter;
-var lookupSetter;
-var supportsAccessors;
-if ((supportsAccessors = owns(prototypeOfObject, "__defineGetter__"))) {
-    defineGetter = call.bind(prototypeOfObject.__defineGetter__);
-    defineSetter = call.bind(prototypeOfObject.__defineSetter__);
-    lookupGetter = call.bind(prototypeOfObject.__lookupGetter__);
-    lookupSetter = call.bind(prototypeOfObject.__lookupSetter__);
-}
-if ([1,2].splice(0).length != 2) {
-    if(function() { // test IE < 9 to splice bug - see issue #138
-        function makeArray(l) {
-            var a = new Array(l+2);
-            a[0] = a[1] = 0;
-            return a;
-        }
-        var array = [], lengthBefore;
-        
-        array.splice.apply(array, makeArray(20));
-        array.splice.apply(array, makeArray(26));
-
-        lengthBefore = array.length; //46
-        array.splice(5, 0, "XXX"); // add one element
-
-        lengthBefore + 1 == array.length
-
-        if (lengthBefore + 1 == array.length) {
-            return true;// has right splice implementation without bugs
-        }
-    }()) {//IE 6/7
-        var array_splice = Array.prototype.splice;
-        Array.prototype.splice = function(start, deleteCount) {
-            if (!arguments.length) {
-                return [];
-            } else {
-                return array_splice.apply(this, [
-                    start === void 0 ? 0 : start,
-                    deleteCount === void 0 ? (this.length - start) : deleteCount
-                ].concat(slice.call(arguments, 2)))
-            }
-        };
-    } else {//IE8
-        Array.prototype.splice = function(pos, removeCount){
-            var length = this.length;
-            if (pos > 0) {
-                if (pos > length)
-                    pos = length;
-            } else if (pos == void 0) {
-                pos = 0;
-            } else if (pos < 0) {
-                pos = Math.max(length + pos, 0);
-            }
-
-            if (!(pos+removeCount < length))
-                removeCount = length - pos;
-
-            var removed = this.slice(pos, pos+removeCount);
-            var insert = slice.call(arguments, 2);
-            var add = insert.length;            
-            if (pos === length) {
-                if (add) {
-                    this.push.apply(this, insert);
-                }
-            } else {
-                var remove = Math.min(removeCount, length - pos);
-                var tailOldPos = pos + remove;
-                var tailNewPos = tailOldPos + add - remove;
-                var tailCount = length - tailOldPos;
-                var lengthAfterRemove = length - remove;
-
-                if (tailNewPos < tailOldPos) { // case A
-                    for (var i = 0; i < tailCount; ++i) {
-                        this[tailNewPos+i] = this[tailOldPos+i];
-                    }
-                } else if (tailNewPos > tailOldPos) { // case B
-                    for (i = tailCount; i--; ) {
-                        this[tailNewPos+i] = this[tailOldPos+i];
-                    }
-                } // else, add == remove (nothing to do)
-
-                if (add && pos === lengthAfterRemove) {
-                    this.length = lengthAfterRemove; // truncate array
-                    this.push.apply(this, insert);
-                } else {
-                    this.length = lengthAfterRemove + add; // reserves space
-                    for (i = 0; i < add; ++i) {
-                        this[pos+i] = insert[i];
-                    }
-                }
-            }
-            return removed;
-        };
-    }
-}
-if (!Array.isArray) {
-    Array.isArray = function isArray(obj) {
-        return _toString(obj) == "[object Array]";
-    };
-}
-var boxedString = Object("a"),
-    splitString = boxedString[0] != "a" || !(0 in boxedString);
-
-if (!Array.prototype.forEach) {
-    Array.prototype.forEach = function forEach(fun /*, thisp*/) {
-        var object = toObject(this),
-            self = splitString && _toString(this) == "[object String]" ?
-                this.split("") :
-                object,
-            thisp = arguments[1],
-            i = -1,
-            length = self.length >>> 0;
-        if (_toString(fun) != "[object Function]") {
-            throw new TypeError(); // TODO message
-        }
-
-        while (++i < length) {
-            if (i in self) {
-                fun.call(thisp, self[i], i, object);
-            }
-        }
-    };
-}
-if (!Array.prototype.map) {
-    Array.prototype.map = function map(fun /*, thisp*/) {
-        var object = toObject(this),
-            self = splitString && _toString(this) == "[object String]" ?
-                this.split("") :
-                object,
-            length = self.length >>> 0,
-            result = Array(length),
-            thisp = arguments[1];
-        if (_toString(fun) != "[object Function]") {
-            throw new TypeError(fun + " is not a function");
-        }
-
-        for (var i = 0; i < length; i++) {
-            if (i in self)
-                result[i] = fun.call(thisp, self[i], i, object);
-        }
-        return result;
-    };
-}
-if (!Array.prototype.filter) {
-    Array.prototype.filter = function filter(fun /*, thisp */) {
-        var object = toObject(this),
-            self = splitString && _toString(this) == "[object String]" ?
-                this.split("") :
-                    object,
-            length = self.length >>> 0,
-            result = [],
-            value,
-            thisp = arguments[1];
-        if (_toString(fun) != "[object Function]") {
-            throw new TypeError(fun + " is not a function");
-        }
-
-        for (var i = 0; i < length; i++) {
-            if (i in self) {
-                value = self[i];
-                if (fun.call(thisp, value, i, object)) {
-                    result.push(value);
-                }
-            }
-        }
-        return result;
-    };
-}
-if (!Array.prototype.every) {
-    Array.prototype.every = function every(fun /*, thisp */) {
-        var object = toObject(this),
-            self = splitString && _toString(this) == "[object String]" ?
-                this.split("") :
-                object,
-            length = self.length >>> 0,
-            thisp = arguments[1];
-        if (_toString(fun) != "[object Function]") {
-            throw new TypeError(fun + " is not a function");
-        }
-
-        for (var i = 0; i < length; i++) {
-            if (i in self && !fun.call(thisp, self[i], i, object)) {
-                return false;
-            }
-        }
-        return true;
-    };
-}
-if (!Array.prototype.some) {
-    Array.prototype.some = function some(fun /*, thisp */) {
-        var object = toObject(this),
-            self = splitString && _toString(this) == "[object String]" ?
-                this.split("") :
-                object,
-            length = self.length >>> 0,
-            thisp = arguments[1];
-        if (_toString(fun) != "[object Function]") {
-            throw new TypeError(fun + " is not a function");
-        }
-
-        for (var i = 0; i < length; i++) {
-            if (i in self && fun.call(thisp, self[i], i, object)) {
-                return true;
-            }
-        }
-        return false;
-    };
-}
-if (!Array.prototype.reduce) {
-    Array.prototype.reduce = function reduce(fun /*, initial*/) {
-        var object = toObject(this),
-            self = splitString && _toString(this) == "[object String]" ?
-                this.split("") :
-                object,
-            length = self.length >>> 0;
-        if (_toString(fun) != "[object Function]") {
-            throw new TypeError(fun + " is not a function");
-        }
-        if (!length && arguments.length == 1) {
-            throw new TypeError("reduce of empty array with no initial value");
-        }
-
-        var i = 0;
-        var result;
-        if (arguments.length >= 2) {
-            result = arguments[1];
-        } else {
-            do {
-                if (i in self) {
-                    result = self[i++];
-                    break;
-                }
-                if (++i >= length) {
-                    throw new TypeError("reduce of empty array with no initial value");
-                }
-            } while (true);
-        }
-
-        for (; i < length; i++) {
-            if (i in self) {
-                result = fun.call(void 0, result, self[i], i, object);
-            }
-        }
-
-        return result;
-    };
-}
-if (!Array.prototype.reduceRight) {
-    Array.prototype.reduceRight = function reduceRight(fun /*, initial*/) {
-        var object = toObject(this),
-            self = splitString && _toString(this) == "[object String]" ?
-                this.split("") :
-                object,
-            length = self.length >>> 0;
-        if (_toString(fun) != "[object Function]") {
-            throw new TypeError(fun + " is not a function");
-        }
-        if (!length && arguments.length == 1) {
-            throw new TypeError("reduceRight of empty array with no initial value");
-        }
-
-        var result, i = length - 1;
-        if (arguments.length >= 2) {
-            result = arguments[1];
-        } else {
-            do {
-                if (i in self) {
-                    result = self[i--];
-                    break;
-                }
-                if (--i < 0) {
-                    throw new TypeError("reduceRight of empty array with no initial value");
-                }
-            } while (true);
-        }
-
-        do {
-            if (i in this) {
-                result = fun.call(void 0, result, self[i], i, object);
-            }
-        } while (i--);
-
-        return result;
-    };
-}
-if (!Array.prototype.indexOf || ([0, 1].indexOf(1, 2) != -1)) {
-    Array.prototype.indexOf = function indexOf(sought /*, fromIndex */ ) {
-        var self = splitString && _toString(this) == "[object String]" ?
-                this.split("") :
-                toObject(this),
-            length = self.length >>> 0;
-
-        if (!length) {
-            return -1;
-        }
-
-        var i = 0;
-        if (arguments.length > 1) {
-            i = toInteger(arguments[1]);
-        }
-        i = i >= 0 ? i : Math.max(0, length + i);
-        for (; i < length; i++) {
-            if (i in self && self[i] === sought) {
-                return i;
-            }
-        }
-        return -1;
-    };
-}
-if (!Array.prototype.lastIndexOf || ([0, 1].lastIndexOf(0, -3) != -1)) {
-    Array.prototype.lastIndexOf = function lastIndexOf(sought /*, fromIndex */) {
-        var self = splitString && _toString(this) == "[object String]" ?
-                this.split("") :
-                toObject(this),
-            length = self.length >>> 0;
-
-        if (!length) {
-            return -1;
-        }
-        var i = length - 1;
-        if (arguments.length > 1) {
-            i = Math.min(i, toInteger(arguments[1]));
-        }
-        i = i >= 0 ? i : length - Math.abs(i);
-        for (; i >= 0; i--) {
-            if (i in self && sought === self[i]) {
-                return i;
-            }
-        }
-        return -1;
-    };
-}
-if (!Object.getPrototypeOf) {
-    Object.getPrototypeOf = function getPrototypeOf(object) {
-        return object.__proto__ || (
-            object.constructor ?
-            object.constructor.prototype :
-            prototypeOfObject
-        );
-    };
-}
-if (!Object.getOwnPropertyDescriptor) {
-    var ERR_NON_OBJECT = "Object.getOwnPropertyDescriptor called on a " +
-                         "non-object: ";
-    Object.getOwnPropertyDescriptor = function getOwnPropertyDescriptor(object, property) {
-        if ((typeof object != "object" && typeof object != "function") || object === null)
-            throw new TypeError(ERR_NON_OBJECT + object);
-        if (!owns(object, property))
-            return;
-
-        var descriptor, getter, setter;
-        descriptor =  { enumerable: true, configurable: true };
-        if (supportsAccessors) {
-            var prototype = object.__proto__;
-            object.__proto__ = prototypeOfObject;
-
-            var getter = lookupGetter(object, property);
-            var setter = lookupSetter(object, property);
-            object.__proto__ = prototype;
-
-            if (getter || setter) {
-                if (getter) descriptor.get = getter;
-                if (setter) descriptor.set = setter;
-                return descriptor;
-            }
-        }
-        descriptor.value = object[property];
-        return descriptor;
-    };
-}
-if (!Object.getOwnPropertyNames) {
-    Object.getOwnPropertyNames = function getOwnPropertyNames(object) {
-        return Object.keys(object);
-    };
-}
-if (!Object.create) {
-    var createEmpty;
-    if (Object.prototype.__proto__ === null) {
-        createEmpty = function () {
-            return { "__proto__": null };
-        };
-    } else {
-        createEmpty = function () {
-            var empty = {};
-            for (var i in empty)
-                empty[i] = null;
-            empty.constructor =
-            empty.hasOwnProperty =
-            empty.propertyIsEnumerable =
-            empty.isPrototypeOf =
-            empty.toLocaleString =
-            empty.toString =
-            empty.valueOf =
-            empty.__proto__ = null;
-            return empty;
-        }
-    }
-
-    Object.create = function create(prototype, properties) {
-        var object;
-        if (prototype === null) {
-            object = createEmpty();
-        } else {
-            if (typeof prototype != "object")
-                throw new TypeError("typeof prototype["+(typeof prototype)+"] != 'object'");
-            var Type = function () {};
-            Type.prototype = prototype;
-            object = new Type();
-            object.__proto__ = prototype;
-        }
-        if (properties !== void 0)
-            Object.defineProperties(object, properties);
-        return object;
-    };
-}
-
-function doesDefinePropertyWork(object) {
-    try {
-        Object.defineProperty(object, "sentinel", {});
-        return "sentinel" in object;
-    } catch (exception) {
-    }
-}
-if (Object.defineProperty) {
-    var definePropertyWorksOnObject = doesDefinePropertyWork({});
-    var definePropertyWorksOnDom = typeof document == "undefined" ||
-        doesDefinePropertyWork(document.createElement("div"));
-    if (!definePropertyWorksOnObject || !definePropertyWorksOnDom) {
-        var definePropertyFallback = Object.defineProperty;
-    }
-}
-
-if (!Object.defineProperty || definePropertyFallback) {
-    var ERR_NON_OBJECT_DESCRIPTOR = "Property description must be an object: ";
-    var ERR_NON_OBJECT_TARGET = "Object.defineProperty called on non-object: "
-    var ERR_ACCESSORS_NOT_SUPPORTED = "getters & setters can not be defined " +
-                                      "on this javascript engine";
-
-    Object.defineProperty = function defineProperty(object, property, descriptor) {
-        if ((typeof object != "object" && typeof object != "function") || object === null)
-            throw new TypeError(ERR_NON_OBJECT_TARGET + object);
-        if ((typeof descriptor != "object" && typeof descriptor != "function") || descriptor === null)
-            throw new TypeError(ERR_NON_OBJECT_DESCRIPTOR + descriptor);
-        if (definePropertyFallback) {
-            try {
-                return definePropertyFallback.call(Object, object, property, descriptor);
-            } catch (exception) {
-            }
-        }
-        if (owns(descriptor, "value")) {
-
-            if (supportsAccessors && (lookupGetter(object, property) ||
-                                      lookupSetter(object, property)))
-            {
-                var prototype = object.__proto__;
-                object.__proto__ = prototypeOfObject;
-                delete object[property];
-                object[property] = descriptor.value;
-                object.__proto__ = prototype;
-            } else {
-                object[property] = descriptor.value;
-            }
-        } else {
-            if (!supportsAccessors)
-                throw new TypeError(ERR_ACCESSORS_NOT_SUPPORTED);
-            if (owns(descriptor, "get"))
-                defineGetter(object, property, descriptor.get);
-            if (owns(descriptor, "set"))
-                defineSetter(object, property, descriptor.set);
-        }
-
-        return object;
-    };
-}
-if (!Object.defineProperties) {
-    Object.defineProperties = function defineProperties(object, properties) {
-        for (var property in properties) {
-            if (owns(properties, property))
-                Object.defineProperty(object, property, properties[property]);
-        }
-        return object;
-    };
-}
-if (!Object.seal) {
-    Object.seal = function seal(object) {
-        return object;
-    };
-}
-if (!Object.freeze) {
-    Object.freeze = function freeze(object) {
-        return object;
-    };
-}
-try {
-    Object.freeze(function () {});
-} catch (exception) {
-    Object.freeze = (function freeze(freezeObject) {
-        return function freeze(object) {
-            if (typeof object == "function") {
-                return object;
-            } else {
-                return freezeObject(object);
-            }
-        };
-    })(Object.freeze);
-}
-if (!Object.preventExtensions) {
-    Object.preventExtensions = function preventExtensions(object) {
-        return object;
-    };
-}
-if (!Object.isSealed) {
-    Object.isSealed = function isSealed(object) {
-        return false;
-    };
-}
-if (!Object.isFrozen) {
-    Object.isFrozen = function isFrozen(object) {
-        return false;
-    };
-}
-if (!Object.isExtensible) {
-    Object.isExtensible = function isExtensible(object) {
-        if (Object(object) === object) {
-            throw new TypeError(); // TODO message
-        }
-        var name = '';
-        while (owns(object, name)) {
-            name += '?';
-        }
-        object[name] = true;
-        var returnValue = owns(object, name);
-        delete object[name];
-        return returnValue;
-    };
-}
-if (!Object.keys) {
-    var hasDontEnumBug = true,
-        dontEnums = [
-            "toString",
-            "toLocaleString",
-            "valueOf",
-            "hasOwnProperty",
-            "isPrototypeOf",
-            "propertyIsEnumerable",
-            "constructor"
-        ],
-        dontEnumsLength = dontEnums.length;
-
-    for (var key in {"toString": null}) {
-        hasDontEnumBug = false;
-    }
-
-    Object.keys = function keys(object) {
-
-        if (
-            (typeof object != "object" && typeof object != "function") ||
-            object === null
-        ) {
-            throw new TypeError("Object.keys called on a non-object");
-        }
-
-        var keys = [];
-        for (var name in object) {
-            if (owns(object, name)) {
-                keys.push(name);
-            }
-        }
-
-        if (hasDontEnumBug) {
-            for (var i = 0, ii = dontEnumsLength; i < ii; i++) {
-                var dontEnum = dontEnums[i];
-                if (owns(object, dontEnum)) {
-                    keys.push(dontEnum);
-                }
-            }
-        }
-        return keys;
-    };
-
-}
-if (!Date.now) {
-    Date.now = function now() {
-        return new Date().getTime();
-    };
-}
-var ws = "\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003" +
-    "\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028" +
-    "\u2029\uFEFF";
-if (!String.prototype.trim || ws.trim()) {
-    ws = "[" + ws + "]";
-    var trimBeginRegexp = new RegExp("^" + ws + ws + "*"),
-        trimEndRegexp = new RegExp(ws + ws + "*$");
-    String.prototype.trim = function trim() {
-        return String(this).replace(trimBeginRegexp, "").replace(trimEndRegexp, "");
-    };
-}
-
-function toInteger(n) {
-    n = +n;
-    if (n !== n) { // isNaN
-        n = 0;
-    } else if (n !== 0 && n !== (1/0) && n !== -(1/0)) {
-        n = (n > 0 || -1) * Math.floor(Math.abs(n));
-    }
-    return n;
-}
-
-function isPrimitive(input) {
-    var type = typeof input;
-    return (
-        input === null ||
-        type === "undefined" ||
-        type === "boolean" ||
-        type === "number" ||
-        type === "string"
-    );
-}
-
-function toPrimitive(input) {
-    var val, valueOf, toString;
-    if (isPrimitive(input)) {
-        return input;
-    }
-    valueOf = input.valueOf;
-    if (typeof valueOf === "function") {
-        val = valueOf.call(input);
-        if (isPrimitive(val)) {
-            return val;
-        }
-    }
-    toString = input.toString;
-    if (typeof toString === "function") {
-        val = toString.call(input);
-        if (isPrimitive(val)) {
-            return val;
-        }
-    }
-    throw new TypeError();
-}
-var toObject = function (o) {
-    if (o == null) { // this matches both null and undefined
-        throw new TypeError("can't convert "+o+" to object");
-    }
-    return Object(o);
-};
-
-});
-
-define('ace/mode/javascript_worker', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/worker/mirror', 'ace/mode/javascript/jshint'], function(require, exports, module) {
-
-
-var oop = require("../lib/oop");
-var Mirror = require("../worker/mirror").Mirror;
-var lint = require("./javascript/jshint").JSHINT;
-
-function startRegex(arr) {
-    return RegExp("^(" + arr.join("|") + ")");
-}
-
-var disabledWarningsRe = startRegex([
-    "Bad for in variable '(.+)'.",
-    'Missing "use strict"'
-]);
-var errorsRe = startRegex([
-    "Unexpected",
-    "Expected ",
-    "Confusing (plus|minus)",
-    "\\{a\\} unterminated regular expression",
-    "Unclosed ",
-    "Unmatched ",
-    "Unbegun comment",
-    "Bad invocation",
-    "Missing space after",
-    "Missing operator at"
-]);
-var infoRe = startRegex([
-    "Expected an assignment",
-    "Bad escapement of EOL",
-    "Unexpected comma",
-    "Unexpected space",
-    "Missing radix parameter.",
-    "A leading decimal point can",
-    "\\['{a}'\\] is better written in dot notation.",
-    "'{a}' used out of scope"
-]);
-
-var JavaScriptWorker = exports.JavaScriptWorker = function(sender) {
-    Mirror.call(this, sender);
-    this.setTimeout(500);
-    this.setOptions();
-};
-
-oop.inherits(JavaScriptWorker, Mirror);
-
-(function() {
-    this.setOptions = function(options) {
-        this.options = options || {
-            esnext: true,
-            moz: true,
-            devel: true,
-            browser: true,
-            node: true,
-            laxcomma: true,
-            laxbreak: true,
-            lastsemic: true,
-            onevar: false,
-            passfail: false,
-            maxerr: 100,
-            expr: true,
-            multistr: true,
-            globalstrict: true
-        };
-        this.doc.getValue() && this.deferredUpdate.schedule(100);
-    };
-
-    this.changeOptions = function(newOptions) {
-        oop.mixin(this.options, newOptions);
-        this.doc.getValue() && this.deferredUpdate.schedule(100);
-    };
-
-    this.isValidJS = function(str) {
-        try {
-            eval("throw 0;" + str);
-        } catch(e) {
-            if (e === 0)
-                return true;
-        }
-        return false
-    };
-
-    this.onUpdate = function() {
-        var value = this.doc.getValue();
-        value = value.replace(/^#!.*\n/, "\n");
-        if (!value) {
-            this.sender.emit("jslint", []);
-            return;
-        }
-        var errors = [];
-        var maxErrorLevel = this.isValidJS(value) ? "warning" : "error";
-        lint(value, this.options);
-        var results = lint.errors;
-
-        var errorAdded = false
-        for (var i = 0; i < results.length; i++) {
-            var error = results[i];
-            if (!error)
-                continue;
-            var raw = error.raw;
-            var type = "warning";
-
-            if (raw == "Missing semicolon.") {
-                var str = error.evidence.substr(error.character);
-                str = str.charAt(str.search(/\S/));
-                if (maxErrorLevel == "error" && str && /[\w\d{(['"]/.test(str)) {
-                    error.reason = 'Missing ";" before statement';
-                    type = "error";
-                } else {
-                    type = "info";
-                }
-            }
-            else if (disabledWarningsRe.test(raw)) {
-                continue;
-            }
-            else if (infoRe.test(raw)) {
-                type = "info"
-            }
-            else if (errorsRe.test(raw)) {
-                errorAdded  = true;
-                type = maxErrorLevel;
-            }
-            else if (raw == "'{a}' is not defined.") {
-                type = "warning";
-            }
-            else if (raw == "'{a}' is defined but never used.") {
-                type = "info";
-            }
-
-            errors.push({
-                row: error.line-1,
-                column: error.character-1,
-                text: error.reason,
-                type: type,
-                raw: raw
-            });
-
-            if (errorAdded) {
-            }
-        }
-
-        this.sender.emit("jslint", errors);
-    };
-
-}).call(JavaScriptWorker.prototype);
-
-});
-
-define('ace/lib/oop', ['require', 'exports', 'module' ], function(require, exports, module) {
-
-
-exports.inherits = (function() {
-    var tempCtor = function() {};
-    return function(ctor, superCtor) {
-        tempCtor.prototype = superCtor.prototype;
-        ctor.super_ = superCtor.prototype;
-        ctor.prototype = new tempCtor();
-        ctor.prototype.constructor = ctor;
-    };
-}());
-
-exports.mixin = function(obj, mixin) {
-    for (var key in mixin) {
-        obj[key] = mixin[key];
-    }
-    return obj;
-};
-
-exports.implement = function(proto, mixin) {
-    exports.mixin(proto, mixin);
-};
-
-});
-define('ace/worker/mirror', ['require', 'exports', 'module' , 'ace/document', 'ace/lib/lang'], function(require, exports, module) {
-
-
-var Document = require("../document").Document;
-var lang = require("../lib/lang");
-    
-var Mirror = exports.Mirror = function(sender) {
-    this.sender = sender;
-    var doc = this.doc = new Document("");
-    
-    var deferredUpdate = this.deferredUpdate = lang.delayedCall(this.onUpdate.bind(this));
-    
-    var _self = this;
-    sender.on("change", function(e) {
-        doc.applyDeltas(e.data);
-        deferredUpdate.schedule(_self.$timeout);
-    });
-};
-
-(function() {
-    
-    this.$timeout = 500;
-    
-    this.setTimeout = function(timeout) {
-        this.$timeout = timeout;
-    };
-    
-    this.setValue = function(value) {
-        this.doc.setValue(value);
-        this.deferredUpdate.schedule(this.$timeout);
-    };
-    
-    this.getValue = function(callbackId) {
-        this.sender.callback(this.doc.getValue(), callbackId);
-    };
-    
-    this.onUpdate = function() {
-    };
-    
-}).call(Mirror.prototype);
-
-});
-
-define('ace/document', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/event_emitter', 'ace/range', 'ace/anchor'], function(require, exports, module) {
-
-
-var oop = require("./lib/oop");
-var EventEmitter = require("./lib/event_emitter").EventEmitter;
-var Range = require("./range").Range;
-var Anchor = require("./anchor").Anchor;
-
-var Document = function(text) {
-    this.$lines = [];
-    if (text.length == 0) {
-        this.$lines = [""];
-    } else if (Array.isArray(text)) {
-        this._insertLines(0, text);
-    } else {
-        this.insert({row: 0, column:0}, text);
-    }
-};
-
-(function() {
-
-    oop.implement(this, EventEmitter);
-    this.setValue = function(text) {
-        var len = this.getLength();
-        this.remove(new Range(0, 0, len, this.getLine(len-1).length));
-        this.insert({row: 0, column:0}, text);
-    };
-    this.getValue = function() {
-        return this.getAllLines().join(this.getNewLineCharacter());
-    };
-    this.createAnchor = function(row, column) {
-        return new Anchor(this, row, column);
-    };
-    if ("aaa".split(/a/).length == 0)
-        this.$split = function(text) {
-            return text.replace(/\r\n|\r/g, "\n").split("\n");
-        }
-    else
-        this.$split = function(text) {
-            return text.split(/\r\n|\r|\n/);
-        };
-
-
-    this.$detectNewLine = function(text) {
-        var match = text.match(/^.*?(\r\n|\r|\n)/m);
-        this.$autoNewLine = match ? match[1] : "\n";
-    };
-    this.getNewLineCharacter = function() {
-        switch (this.$newLineMode) {
-          case "windows":
-            return "\r\n";
-          case "unix":
-            return "\n";
-          default:
-            return this.$autoNewLine;
-        }
-    };
-
-    this.$autoNewLine = "\n";
-    this.$newLineMode = "auto";
-    this.setNewLineMode = function(newLineMode) {
-        if (this.$newLineMode === newLineMode)
-            return;
-
-        this.$newLineMode = newLineMode;
-    };
-    this.getNewLineMode = function() {
-        return this.$newLineMode;
-    };
-    this.isNewLine = function(text) {
-        return (text == "\r\n" || text == "\r" || text == "\n");
-    };
-    this.getLine = function(row) {
-        return this.$lines[row] || "";
-    };
-    this.getLines = function(firstRow, lastRow) {
-        return this.$lines.slice(firstRow, lastRow + 1);
-    };
-    this.getAllLines = function() {
-        return this.getLines(0, this.getLength());
-    };
-    this.getLength = function() {
-        return this.$lines.length;
-    };
-    this.getTextRange = function(range) {
-        if (range.start.row == range.end.row) {
-            return this.getLine(range.start.row)
-                .substring(range.start.column, range.end.column);
-        }
-        var lines = this.getLines(range.start.row, range.end.row);
-        lines[0] = (lines[0] || "").substring(range.start.column);
-        var l = lines.length - 1;
-        if (range.end.row - range.start.row == l)
-            lines[l] = lines[l].substring(0, range.end.column);
-        return lines.join(this.getNewLineCharacter());
-    };
-
-    this.$clipPosition = function(position) {
-        var length = this.getLength();
-        if (position.row >= length) {
-            position.row = Math.max(0, length - 1);
-            position.column = this.getLine(length-1).length;
-        } else if (position.row < 0)
-            position.row = 0;
-        return position;
-    };
-    this.insert = function(position, text) {
-        if (!text || text.length === 0)
-            return position;
-
-        position = this.$clipPosition(position);
-        if (this.getLength() <= 1)
-            this.$detectNewLine(text);
-
-        var lines = this.$split(text);
-        var firstLine = lines.splice(0, 1)[0];
-        var lastLine = lines.length == 0 ? null : lines.splice(lines.length - 1, 1)[0];
-
-        position = this.insertInLine(position, firstLine);
-        if (lastLine !== null) {
-            position = this.insertNewLine(position); // terminate first line
-            position = this._insertLines(position.row, lines);
-            position = this.insertInLine(position, lastLine || "");
-        }
-        return position;
-    };
-    this.insertLines = function(row, lines) {
-        if (row >= this.getLength())
-            return this.insert({row: row, column: 0}, "\n" + lines.join("\n"));
-        return this._insertLines(Math.max(row, 0), lines);
-    };
-    this._insertLines = function(row, lines) {
-        if (lines.length == 0)
-            return {row: row, column: 0};
-        if (lines.length > 0xFFFF) {
-            var end = this._insertLines(row, lines.slice(0xFFFF));
-            lines = lines.slice(0, 0xFFFF);
-        }
-
-        var args = [row, 0];
-        args.push.apply(args, lines);
-        this.$lines.splice.apply(this.$lines, args);
-
-        var range = new Range(row, 0, row + lines.length, 0);
-        var delta = {
-            action: "insertLines",
-            range: range,
-            lines: lines
-        };
-        this._emit("change", { data: delta });
-        return end || range.end;
-    };
-    this.insertNewLine = function(position) {
-        position = this.$clipPosition(position);
-        var line = this.$lines[position.row] || "";
-
-        this.$lines[position.row] = line.substring(0, position.column);
-        this.$lines.splice(position.row + 1, 0, line.substring(position.column, line.length));
-
-        var end = {
-            row : position.row + 1,
-            column : 0
-        };
-
-        var delta = {
-            action: "insertText",
-            range: Range.fromPoints(position, end),
-            text: this.getNewLineCharacter()
-        };
-        this._emit("change", { data: delta });
-
-        return end;
-    };
-    this.insertInLine = function(position, text) {
-        if (text.length == 0)
-            return position;
-
-        var line = this.$lines[position.row] || "";
-
-        this.$lines[position.row] = line.substring(0, position.column) + text
-                + line.substring(position.column);
-
-        var end = {
-            row : position.row,
-            column : position.column + text.length
-        };
-
-        var delta = {
-            action: "insertText",
-            range: Range.fromPoints(position, end),
-            text: text
-        };
-        this._emit("change", { data: delta });
-
-        return end;
-    };
-    this.remove = function(range) {
-        if (!range instanceof Range)
-            range = Range.fromPoints(range.start, range.end);
-        range.start = this.$clipPosition(range.start);
-        range.end = this.$clipPosition(range.end);
-
-        if (range.isEmpty())
-            return range.start;
-
-        var firstRow = range.start.row;
-        var lastRow = range.end.row;
-
-        if (range.isMultiLine()) {
-            var firstFullRow = range.start.column == 0 ? firstRow : firstRow + 1;
-            var lastFullRow = lastRow - 1;
-
-            if (range.end.column > 0)
-                this.removeInLine(lastRow, 0, range.end.column);
-
-            if (lastFullRow >= firstFullRow)
-                this._removeLines(firstFullRow, lastFullRow);
-
-            if (firstFullRow != firstRow) {
-                this.removeInLine(firstRow, range.start.column, this.getLine(firstRow).length);
-                this.removeNewLine(range.start.row);
-            }
-        }
-        else {
-            this.removeInLine(firstRow, range.start.column, range.end.column);
-        }
-        return range.start;
-    };
-    this.removeInLine = function(row, startColumn, endColumn) {
-        if (startColumn == endColumn)
-            return;
-
-        var range = new Range(row, startColumn, row, endColumn);
-        var line = this.getLine(row);
-        var removed = line.substring(startColumn, endColumn);
-        var newLine = line.substring(0, startColumn) + line.substring(endColumn, line.length);
-        this.$lines.splice(row, 1, newLine);
-
-        var delta = {
-            action: "removeText",
-            range: range,
-            text: removed
-        };
-        this._emit("change", { data: delta });
-        return range.start;
-    };
-    this.removeLines = function(firstRow, lastRow) {
-        if (firstRow < 0 || lastRow >= this.getLength())
-            return this.remove(new Range(firstRow, 0, lastRow + 1, 0));
-        return this._removeLines(firstRow, lastRow);
-    };
-
-    this._removeLines = function(firstRow, lastRow) {
-        var range = new Range(firstRow, 0, lastRow + 1, 0);
-        var removed = this.$lines.splice(firstRow, lastRow - firstRow + 1);
-
-        var delta = {
-            action: "removeLines",
-            range: range,
-            nl: this.getNewLineCharacter(),
-            lines: removed
-        };
-        this._emit("change", { data: delta });
-        return removed;
-    };
-    this.removeNewLine = function(row) {
-        var firstLine = this.getLine(row);
-        var secondLine = this.getLine(row+1);
-
-        var range = new Range(row, firstLine.length, row+1, 0);
-        var line = firstLine + secondLine;
-
-        this.$lines.splice(row, 2, line);
-
-        var delta = {
-            action: "removeText",
-            range: range,
-            text: this.getNewLineCharacter()
-        };
-        this._emit("change", { data: delta });
-    };
-    this.replace = function(range, text) {
-        if (!range instanceof Range)
-            range = Range.fromPoints(range.start, range.end);
-        if (text.length == 0 && range.isEmpty())
-            return range.start;
-        if (text == this.getTextRange(range))
-            return range.end;
-
-        this.remove(range);
-        if (text) {
-            var end = this.insert(range.start, text);
-        }
-        else {
-            end = range.start;
-        }
-
-        return end;
-    };
-    this.applyDeltas = function(deltas) {
-        for (var i=0; i<deltas.length; i++) {
-            var delta = deltas[i];
-            var range = Range.fromPoints(delta.range.start, delta.range.end);
-
-            if (delta.action == "insertLines")
-                this.insertLines(range.start.row, delta.lines);
-            else if (delta.action == "insertText")
-                this.insert(range.start, delta.text);
-            else if (delta.action == "removeLines")
-                this._removeLines(range.start.row, range.end.row - 1);
-            else if (delta.action == "removeText")
-                this.remove(range);
-        }
-    };
-    this.revertDeltas = function(deltas) {
-        for (var i=deltas.length-1; i>=0; i--) {
-            var delta = deltas[i];
-
-            var range = Range.fromPoints(delta.range.start, delta.range.end);
-
-            if (delta.action == "insertLines")
-                this._removeLines(range.start.row, range.end.row - 1);
-            else if (delta.action == "insertText")
-                this.remove(range);
-            else if (delta.action == "removeLines")
-                this._insertLines(range.start.row, delta.lines);
-            else if (delta.action == "removeText")
-                this.insert(range.start, delta.text);
-        }
-    };
-    this.indexToPosition = function(index, startRow) {
-        var lines = this.$lines || this.getAllLines();
-        var newlineLength = this.getNewLineCharacter().length;
-        for (var i = startRow || 0, l = lines.length; i < l; i++) {
-            index -= lines[i].length + newlineLength;
-            if (index < 0)
-                return {row: i, column: index + lines[i].length + newlineLength};
-        }
-        return {row: l-1, column: lines[l-1].length};
-    };
-    this.positionToIndex = function(pos, startRow) {
-        var lines = this.$lines || this.getAllLines();
-        var newlineLength = this.getNewLineCharacter().length;
-        var index = 0;
-        var row = Math.min(pos.row, lines.length);
-        for (var i = startRow || 0; i < row; ++i)
-            index += lines[i].length + newlineLength;
-
-        return index + pos.column;
-    };
-
-}).call(Document.prototype);
-
-exports.Document = Document;
-});
-
-define('ace/lib/event_emitter', ['require', 'exports', 'module' ], function(require, exports, module) {
-
-
-var EventEmitter = {};
-var stopPropagation = function() { this.propagationStopped = true; };
-var preventDefault = function() { this.defaultPrevented = true; };
-
-EventEmitter._emit =
-EventEmitter._dispatchEvent = function(eventName, e) {
-    this._eventRegistry || (this._eventRegistry = {});
-    this._defaultHandlers || (this._defaultHandlers = {});
-
-    var listeners = this._eventRegistry[eventName] || [];
-    var defaultHandler = this._defaultHandlers[eventName];
-    if (!listeners.length && !defaultHandler)
-        return;
-
-    if (typeof e != "object" || !e)
-        e = {};
-
-    if (!e.type)
-        e.type = eventName;
-    if (!e.stopPropagation)
-        e.stopPropagation = stopPropagation;
-    if (!e.preventDefault)
-        e.preventDefault = preventDefault;
-
-    listeners = listeners.slice();
-    for (var i=0; i<listeners.length; i++) {
-        listeners[i](e, this);
-        if (e.propagationStopped)
-            break;
-    }
-    
-    if (defaultHandler && !e.defaultPrevented)
-        return defaultHandler(e, this);
-};
-
-
-EventEmitter._signal = function(eventName, e) {
-    var listeners = (this._eventRegistry || {})[eventName];
-    if (!listeners)
-        return;
-    listeners = listeners.slice();
-    for (var i=0; i<listeners.length; i++)
-        listeners[i](e, this);
-};
-
-EventEmitter.once = function(eventName, callback) {
-    var _self = this;
-    callback && this.addEventListener(eventName, function newCallback() {
-        _self.removeEventListener(eventName, newCallback);
-        callback.apply(null, arguments);
-    });
-};
-
-
-EventEmitter.setDefaultHandler = function(eventName, callback) {
-    var handlers = this._defaultHandlers
-    if (!handlers)
-        handlers = this._defaultHandlers = {_disabled_: {}};
-    
-    if (handlers[eventName]) {
-        var old = handlers[eventName];
-        var disabled = handlers._disabled_[eventName];
-        if (!disabled)
-            handlers._disabled_[eventName] = disabled = [];
-        disabled.push(old);
-        var i = disabled.indexOf(callback);
-        if (i != -1) 
-            disabled.splice(i, 1);
-    }
-    handlers[eventName] = callback;
-};
-EventEmitter.removeDefaultHandler = function(eventName, callback) {
-    var handlers = this._defaultHandlers
-    if (!handlers)
-        return;
-    var disabled = handlers._disabled_[eventName];
-    
-    if (handlers[eventName] == callback) {
-        var old = handlers[eventName];
-        if (disabled)
-            this.setDefaultHandler(eventName, disabled.pop());
-    } else if (disabled) {
-        var i = disabled.indexOf(callback);
-        if (i != -1)
-            disabled.splice(i, 1);
-    }
-};
-
-EventEmitter.on =
-EventEmitter.addEventListener = function(eventName, callback, capturing) {
-    this._eventRegistry = this._eventRegistry || {};
-
-    var listeners = this._eventRegistry[eventName];
-    if (!listeners)
-        listeners = this._eventRegistry[eventName] = [];
-
-    if (listeners.indexOf(callback) == -1)
-        listeners[capturing ? "unshift" : "push"](callback);
-    return callback;
-};
-
-EventEmitter.off =
-EventEmitter.removeListener =
-EventEmitter.removeEventListener = function(eventName, callback) {
-    this._eventRegistry = this._eventRegistry || {};
-
-    var listeners = this._eventRegistry[eventName];
-    if (!listeners)
-        return;
-
-    var index = listeners.indexOf(callback);
-    if (index !== -1)
-        listeners.splice(index, 1);
-};
-
-EventEmitter.removeAllListeners = function(eventName) {
-    if (this._eventRegistry) this._eventRegistry[eventName] = [];
-};
-
-exports.EventEmitter = EventEmitter;
-
-});
-
-define('ace/range', ['require', 'exports', 'module' ], function(require, exports, module) {
-
-var comparePoints = function(p1, p2) {
-    return p1.row - p2.row || p1.column - p2.column;
-};
-var Range = function(startRow, startColumn, endRow, endColumn) {
-    this.start = {
-        row: startRow,
-        column: startColumn
-    };
-
-    this.end = {
-        row: endRow,
-        column: endColumn
-    };
-};
-
-(function() {
-    this.isEqual = function(range) {
-        return this.start.row === range.start.row &&
-            this.end.row === range.end.row &&
-            this.start.column === range.start.column &&
-            this.end.column === range.end.column;
-    };
-    this.toString = function() {
-        return ("Range: [" + this.start.row + "/" + this.start.column +
-            "] -> [" + this.end.row + "/" + this.end.column + "]");
-    };
-
-    this.contains = function(row, column) {
-        return this.compare(row, column) == 0;
-    };
-    this.compareRange = function(range) {
-        var cmp,
-            end = range.end,
-            start = range.start;
-
-        cmp = this.compare(end.row, end.column);
-        if (cmp == 1) {
-            cmp = this.compare(start.row, start.column);
-            if (cmp == 1) {
-                return 2;
-            } else if (cmp == 0) {
-                return 1;
-            } else {
-                return 0;
-            }
-        } else if (cmp == -1) {
-            return -2;
-        } else {
-            cmp = this.compare(start.row, start.column);
-            if (cmp == -1) {
-                return -1;
-            } else if (cmp == 1) {
-                return 42;
-            } else {
-                return 0;
-            }
-        }
-    };
-    this.comparePoint = function(p) {
-        return this.compare(p.row, p.column);
-    };
-    this.containsRange = function(range) {
-        return this.comparePoint(range.start) == 0 && this.comparePoint(range.end) == 0;
-    };
-    this.intersects = function(range) {
-        var cmp = this.compareRange(range);
-        return (cmp == -1 || cmp == 0 || cmp == 1);
-    };
-    this.isEnd = function(row, column) {
-        return this.end.row == row && this.end.column == column;
-    };
-    this.isStart = function(row, column) {
-        return this.start.row == row && this.start.column == column;
-    };
-    this.setStart = function(row, column) {
-        if (typeof row == "object") {
-            this.start.column = row.column;
-            this.start.row = row.row;
-        } else {
-            this.start.row = row;
-            this.start.column = column;
-        }
-    };
-    this.setEnd = function(row, column) {
-        if (typeof row == "object") {
-            this.end.column = row.column;
-            this.end.row = row.row;
-        } else {
-            this.end.row = row;
-            this.end.column = column;
-        }
-    };
-    this.inside = function(row, column) {
-        if (this.compare(row, column) == 0) {
-            if (this.isEnd(row, column) || this.isStart(row, column)) {
-                return false;
-            } else {
-                return true;
-            }
-        }
-        return false;
-    };
-    this.insideStart = function(row, column) {
-        if (this.compare(row, column) == 0) {
-            if (this.isEnd(row, column)) {
-                return false;
-            } else {
-                return true;
-            }
-        }
-        return false;
-    };
-    this.insideEnd = function(row, column) {
-        if (this.compare(row, column) == 0) {
-            if (this.isStart(row, column)) {
-                return false;
-            } else {
-                return true;
-            }
-        }
-        return false;
-    };
-    this.compare = function(row, column) {
-        if (!this.isMultiLine()) {
-            if (row === this.start.row) {
-                return column < this.start.column ? -1 : (column > this.end.column ? 1 : 0);
-            };
-        }
-
-        if (row < this.start.row)
-            return -1;
-
-        if (row > this.end.row)
-            return 1;
-
-        if (this.start.row === row)
-            return column >= this.start.column ? 0 : -1;
-
-        if (this.end.row === row)
-            return column <= this.end.column ? 0 : 1;
-
-        return 0;
-    };
-    this.compareStart = function(row, column) {
-        if (this.start.row == row && this.start.column == column) {
-            return -1;
-        } else {
-            return this.compare(row, column);
-        }
-    };
-    this.compareEnd = function(row, column) {
-        if (this.end.row == row && this.end.column == column) {
-            return 1;
-        } else {
-            return this.compare(row, column);
-        }
-    };
-    this.compareInside = function(row, column) {
-        if (this.end.row == row && this.end.column == column) {
-            return 1;
-        } else if (this.start.row == row && this.start.column == column) {
-            return -1;
-        } else {
-            return this.compare(row, column);
-        }
-    };
-    this.clipRows = function(firstRow, lastRow) {
-        if (this.end.row > lastRow)
-            var end = {row: lastRow + 1, column: 0};
-        else if (this.end.row < firstRow)
-            var end = {row: firstRow, column: 0};
-
-        if (this.start.row > lastRow)
-            var start = {row: lastRow + 1, column: 0};
-        else if (this.start.row < firstRow)
-            var start = {row: firstRow, column: 0};
-
-        return Range.fromPoints(start || this.start, end || this.end);
-    };
-    this.extend = function(row, column) {
-        var cmp = this.compare(row, column);
-
-        if (cmp == 0)
-            return this;
-        else if (cmp == -1)
-            var start = {row: row, column: column};
-        else
-            var end = {row: row, column: column};
-
-        return Range.fromPoints(start || this.start, end || this.end);
-    };
-
-    this.isEmpty = function() {
-        return (this.start.row === this.end.row && this.start.column === this.end.column);
-    };
-    this.isMultiLine = function() {
-        return (this.start.row !== this.end.row);
-    };
-    this.clone = function() {
-        return Range.fromPoints(this.start, this.end);
-    };
-    this.collapseRows = function() {
-        if (this.end.column == 0)
-            return new Range(this.start.row, 0, Math.max(this.start.row, this.end.row-1), 0)
-        else
-            return new Range(this.start.row, 0, this.end.row, 0)
-    };
-    this.toScreenRange = function(session) {
-        var screenPosStart = session.documentToScreenPosition(this.start);
-        var screenPosEnd = session.documentToScreenPosition(this.end);
-
-        return new Range(
-            screenPosStart.row, screenPosStart.column,
-            screenPosEnd.row, screenPosEnd.column
-        );
-    };
-    this.moveBy = function(row, column) {
-        this.start.row += row;
-        this.start.column += column;
-        this.end.row += row;
-        this.end.column += column;
-    };
-
-}).call(Range.prototype);
-Range.fromPoints = function(start, end) {
-    return new Range(start.row, start.column, end.row, end.column);
-};
-Range.comparePoints = comparePoints;
-
-Range.comparePoints = function(p1, p2) {
-    return p1.row - p2.row || p1.column - p2.column;
-};
-
-
-exports.Range = Range;
-});
-
-define('ace/anchor', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/event_emitter'], function(require, exports, module) {
-
-
-var oop = require("./lib/oop");
-var EventEmitter = require("./lib/event_emitter").EventEmitter;
-
-var Anchor = exports.Anchor = function(doc, row, column) {
-    this.$onChange = this.onChange.bind(this);
-    this.attach(doc);
-    
-    if (typeof column == "undefined")
-        this.setPosition(row.row, row.column);
-    else
-        this.setPosition(row, column);
-};
-
-(function() {
-
-    oop.implement(this, EventEmitter);
-    this.getPosition = function() {
-        return this.$clipPositionToDocument(this.row, this.column);
-    };
-    this.getDocument = function() {
-        return this.document;
-    };
-    this.$insertRight = false;
-    this.onChange = function(e) {
-        var delta = e.data;
-        var range = delta.range;
-
-        if (range.start.row == range.end.row && range.start.row != this.row)
-            return;
-
-        if (range.start.row > this.row)
-            return;
-
-        if (range.start.row == this.row && range.start.column > this.column)
-            return;
-
-        var row = this.row;
-        var column = this.column;
-        var start = range.start;
-        var end = range.end;
-
-        if (delta.action === "insertText") {
-            if (start.row === row && start.column <= column) {
-                if (start.column === column && this.$insertRight) {
-                } else if (start.row === end.row) {
-                    column += end.column - start.column;
-                } else {
-                    column -= start.column;
-                    row += end.row - start.row;
-                }
-            } else if (start.row !== end.row && start.row < row) {
-                row += end.row - start.row;
-            }
-        } else if (delta.action === "insertLines") {
-            if (start.row <= row) {
-                row += end.row - start.row;
-            }
-        } else if (delta.action === "removeText") {
-            if (start.row === row && start.column < column) {
-                if (end.column >= column)
-                    column = start.column;
-                else
-                    column = Math.max(0, column - (end.column - start.column));
-
-            } else if (start.row !== end.row && start.row < row) {
-                if (end.row === row)
-                    column = Math.max(0, column - end.column) + start.column;
-                row -= (end.row - start.row);
-            } else if (end.row === row) {
-                row -= end.row - start.row;
-                column = Math.max(0, column - end.column) + start.column;
-            }
-        } else if (delta.action == "removeLines") {
-            if (start.row <= row) {
-                if (end.row <= row)
-                    row -= end.row - start.row;
-                else {
-                    row = start.row;
-                    column = 0;
-                }
-            }
-        }
-
-        this.setPosition(row, column, true);
-    };
-    this.setPosition = function(row, column, noClip) {
-        var pos;
-        if (noClip) {
-            pos = {
-                row: row,
-                column: column
-            };
-        } else {
-            pos = this.$clipPositionToDocument(row, column);
-        }
-
-        if (this.row == pos.row && this.column == pos.column)
-            return;
-
-        var old = {
-            row: this.row,
-            column: this.column
-        };
-
-        this.row = pos.row;
-        this.column = pos.column;
-        this._emit("change", {
-            old: old,
-            value: pos
-        });
-    };
-    this.detach = function() {
-        this.document.removeEventListener("change", this.$onChange);
-    };
-    this.attach = function(doc) {
-        this.document = doc || this.document;
-        this.document.on("change", this.$onChange);
-    };
-    this.$clipPositionToDocument = function(row, column) {
-        var pos = {};
-
-        if (row >= this.document.getLength()) {
-            pos.row = Math.max(0, this.document.getLength() - 1);
-            pos.column = this.document.getLine(pos.row).length;
-        }
-        else if (row < 0) {
-            pos.row = 0;
-            pos.column = 0;
-        }
-        else {
-            pos.row = row;
-            pos.column = Math.min(this.document.getLine(pos.row).length, Math.max(0, column));
-        }
-
-        if (column < 0)
-            pos.column = 0;
-
-        return pos;
-    };
-
-}).call(Anchor.prototype);
-
-});
-
-define('ace/lib/lang', ['require', 'exports', 'module' ], function(require, exports, module) {
-
-
-exports.stringReverse = function(string) {
-    return string.split("").reverse().join("");
-};
-
-exports.stringRepeat = function (string, count) {
-    var result = '';
-    while (count > 0) {
-        if (count & 1)
-            result += string;
-
-        if (count >>= 1)
-            string += string;
-    }
-    return result;
-};
-
-var trimBeginRegexp = /^\s\s*/;
-var trimEndRegexp = /\s\s*$/;
-
-exports.stringTrimLeft = function (string) {
-    return string.replace(trimBeginRegexp, '');
-};
-
-exports.stringTrimRight = function (string) {
-    return string.replace(trimEndRegexp, '');
-};
-
-exports.copyObject = function(obj) {
-    var copy = {};
-    for (var key in obj) {
-        copy[key] = obj[key];
-    }
-    return copy;
-};
-
-exports.copyArray = function(array){
-    var copy = [];
-    for (var i=0, l=array.length; i<l; i++) {
-        if (array[i] && typeof array[i] == "object")
-            copy[i] = this.copyObject( array[i] );
-        else 
-            copy[i] = array[i];
-    }
-    return copy;
-};
-
-exports.deepCopy = function (obj) {
-    if (typeof obj != "object") {
-        return obj;
-    }
-    
-    var copy = obj.constructor();
-    for (var key in obj) {
-        if (typeof obj[key] == "object") {
-            copy[key] = this.deepCopy(obj[key]);
-        } else {
-            copy[key] = obj[key];
-        }
-    }
-    return copy;
-};
-
-exports.arrayToMap = function(arr) {
-    var map = {};
-    for (var i=0; i<arr.length; i++) {
-        map[arr[i]] = 1;
-    }
-    return map;
-
-};
-
-exports.createMap = function(props) {
-    var map = Object.create(null);
-    for (var i in props) {
-        map[i] = props[i];
-    }
-    return map;
-};
-exports.arrayRemove = function(array, value) {
-  for (var i = 0; i <= array.length; i++) {
-    if (value === array[i]) {
-      array.splice(i, 1);
-    }
-  }
-};
-
-exports.escapeRegExp = function(str) {
-    return str.replace(/([.*+?^${}()|[\]\/\\])/g, '\\$1');
-};
-
-exports.escapeHTML = function(str) {
-    return str.replace(/&/g, "&#38;").replace(/"/g, "&#34;").replace(/'/g, "&#39;").replace(/</g, "&#60;");
-};
-
-exports.getMatchOffsets = function(string, regExp) {
-    var matches = [];
-
-    string.replace(regExp, function(str) {
-        matches.push({
-            offset: arguments[arguments.length-2],
-            length: str.length
-        });
-    });
-
-    return matches;
-};
-exports.deferredCall = function(fcn) {
-
-    var timer = null;
-    var callback = function() {
-        timer = null;
-        fcn();
-    };
-
-    var deferred = function(timeout) {
-        deferred.cancel();
-        timer = setTimeout(callback, timeout || 0);
-        return deferred;
-    };
-
-    deferred.schedule = deferred;
-
-    deferred.call = function() {
-        this.cancel();
-        fcn();
-        return deferred;
-    };
-
-    deferred.cancel = function() {
-        clearTimeout(timer);
-        timer = null;
-        return deferred;
-    };
-
-    return deferred;
-};
-
-
-exports.delayedCall = function(fcn, defaultTimeout) {
-    var timer = null;
-    var callback = function() {
-        timer = null;
-        fcn();
-    };
-
-    var _self = function(timeout) {
-        timer && clearTimeout(timer);
-        timer = setTimeout(callback, timeout || defaultTimeout);
-    };
-
-    _self.delay = _self;
-    _self.schedule = function(timeout) {
-        if (timer == null)
-            timer = setTimeout(callback, timeout || 0);
-    };
-
-    _self.call = function() {
-        this.cancel();
-        fcn();
-    };
-
-    _self.cancel = function() {
-        timer && clearTimeout(timer);
-        timer = null;
-    };
-
-    _self.isPending = function() {
-        return timer;
-    };
-
-    return _self;
-};
-});
-define('ace/mode/javascript/jshint', ['require', 'exports', 'module' ], function(require, exports, module) {
-require = null;
-require=(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({
-9:[function (req,module,exports){
-        ["log", "info", "warn", "error", 
-        "time","timeEnd", "trace", "dir", "assert"
-        ].forEach(function(x) {exports[x] = nop;});
-        function nop() {}
-    },{}],
-1:[function(req,module,exports){
-
-(function() {
-  var root = this;
-  var previousUnderscore = root._;
-  var breaker = {};
-  var ArrayProto = Array.prototype, ObjProto = Object.prototype, FuncProto = Function.prototype;
-  var push             = ArrayProto.push,
-      slice            = ArrayProto.slice,
-      concat           = ArrayProto.concat,
-      toString         = ObjProto.toString,
-      hasOwnProperty   = ObjProto.hasOwnProperty;
-  var
-    nativeForEach      = ArrayProto.forEach,
-    nativeMap          = ArrayProto.map,
-    nativeReduce       = ArrayProto.reduce,
-    nativeReduceRight  = ArrayProto.reduceRight,
-    nativeFilter       = ArrayProto.filter,
-    nativeEvery        = ArrayProto.every,
-    nativeSome         = ArrayProto.some,
-    nativeIndexOf      = ArrayProto.indexOf,
-    nativeLastIndexOf  = ArrayProto.lastIndexOf,
-    nativeIsArray      = Array.isArray,
-    nativeKeys         = Object.keys,
-    nativeBind         = FuncProto.bind;
-  var _ = function(obj) {
-    if (obj instanceof _) return obj;
-    if (!(this instanceof _)) return new _(obj);
-    this._wrapped = obj;
-  };
-  if (typeof exports !== 'undefined') {
-    if (typeof module !== 'undefined' && module.exports) {
-      exports = module.exports = _;
-    }
-    exports._ = _;
-  } else {
-    root._ = _;
-  }
-  _.VERSION = '1.4.4';
-  var each = _.each = _.forEach = function(obj, iterator, context) {
-    if (obj == null) return;
-    if (nativeForEach && obj.forEach === nativeForEach) {
-      obj.forEach(iterator, context);
-    } else if (obj.length === +obj.length) {
-      for (var i = 0, l = obj.length; i < l; i++) {
-        if (iterator.call(context, obj[i], i, obj) === breaker) return;
-      }
-    } else {
-      for (var key in obj) {
-        if (_.has(obj, key)) {
-          if (iterator.call(context, obj[key], key, obj) === breaker) return;
-        }
-      }
-    }
-  };
-  _.map = _.collect = function(obj, iterator, context) {
-    var results = [];
-    if (obj == null) return results;
-    if (nativeMap && obj.map === nativeMap) return obj.map(iterator, context);
-    each(obj, function(value, index, list) {
-      results[results.length] = iterator.call(context, value, index, list);
-    });
-    return results;
-  };
-
-  var reduceError = 'Reduce of empty array with no initial value';
-  _.reduce = _.foldl = _.inject = function(obj, iterator, memo, context) {
-    var initial = arguments.length > 2;
-    if (obj == null) obj = [];
-    if (nativeReduce && obj.reduce === nativeReduce) {
-      if (context) iterator = _.bind(iterator, context);
-      return initial ? obj.reduce(iterator, memo) : obj.reduce(iterator);
-    }
-    each(obj, function(value, index, list) {
-      if (!initial) {
-        memo = value;
-        initial = true;
-      } else {
-        memo = iterator.call(context, memo, value, index, list);
-      }
-    });
-    if (!initial) throw new TypeError(reduceError);
-    return memo;
-  };
-  _.reduceRight = _.foldr = function(obj, iterator, memo, context) {
-    var initial = arguments.length > 2;
-    if (obj == null) obj = [];
-    if (nativeReduceRight && obj.reduceRight === nativeReduceRight) {
-      if (context) iterator = _.bind(iterator, context);
-      return initial ? obj.reduceRight(iterator, memo) : obj.reduceRight(iterator);
-    }
-    var length = obj.length;
-    if (length !== +length) {
-      var keys = _.keys(obj);
-      length = keys.length;
-    }
-    each(obj, function(value, index, list) {
-      index = keys ? keys[--length] : --length;
-      if (!initial) {
-        memo = obj[index];
-        initial = true;
-      } else {
-        memo = iterator.call(context, memo, obj[index], index, list);
-      }
-    });
-    if (!initial) throw new TypeError(reduceError);
-    return memo;
-  };
-  _.find = _.detect = function(obj, iterator, context) {
-    var result;
-    any(obj, function(value, index, list) {
-      if (iterator.call(context, value, index, list)) {
-        result = value;
-        return true;
-      }
-    });
-    return result;
-  };
-  _.filter = _.select = function(obj, iterator, context) {
-    var results = [];
-    if (obj == null) return results;
-    if (nativeFilter && obj.filter === nativeFilter) return obj.filter(iterator, context);
-    each(obj, function(value, index, list) {
-      if (iterator.call(context, value, index, list)) results[results.length] = value;
-    });
-    return results;
-  };
-  _.reject = function(obj, iterator, context) {
-    return _.filter(obj, function(value, index, list) {
-      return !iterator.call(context, value, index, list);
-    }, context);
-  };
-  _.every = _.all = function(obj, iterator, context) {
-    iterator || (iterator = _.identity);
-    var result = true;
-    if (obj == null) return result;
-    if (nativeEvery && obj.every === nativeEvery) return obj.every(iterator, context);
-    each(obj, function(value, index, list) {
-      if (!(result = result && iterator.call(context, value, index, list))) return breaker;
-    });
-    return !!result;
-  };
-  var any = _.some = _.any = function(obj, iterator, context) {
-    iterator || (iterator = _.identity);
-    var result = false;
-    if (obj == null) return result;
-    if (nativeSome && obj.some === nativeSome) return obj.some(iterator, context);
-    each(obj, function(value, index, list) {
-      if (result || (result = iterator.call(context, value, index, list))) return breaker;
-    });
-    return !!result;
-  };
-  _.contains = _.include = function(obj, target) {
-    if (obj == null) return false;
-    if (nativeIndexOf && obj.indexOf === nativeIndexOf) return obj.indexOf(target) != -1;
-    return any(obj, function(value) {
-      return value === target;
-    });
-  };
-  _.invoke = function(obj, method) {
-    var args = slice.call(arguments, 2);
-    var isFunc = _.isFunction(method);
-    return _.map(obj, function(value) {
-      return (isFunc ? method : value[method]).apply(value, args);
-    });
-  };
-  _.pluck = function(obj, key) {
-    return _.map(obj, function(value){ return value[key]; });
-  };
-  _.where = function(obj, attrs, first) {
-    if (_.isEmpty(attrs)) return first ? null : [];
-    return _[first ? 'find' : 'filter'](obj, function(value) {
-      for (var key in attrs) {
-        if (attrs[key] !== value[key]) return false;
-      }
-      return true;
-    });
-  };
-  _.findWhere = function(obj, attrs) {
-    return _.where(obj, attrs, true);
-  };
-  _.max = function(obj, iterator, context) {
-    if (!iterator && _.isArray(obj) && obj[0] === +obj[0] && obj.length < 65535) {
-      return Math.max.apply(Math, obj);
-    }
-    if (!iterator && _.isEmpty(obj)) return -Infinity;
-    var result = {computed : -Infinity, value: -Infinity};
-    each(obj, function(value, index, list) {
-      var computed = iterator ? iterator.call(context, value, index, list) : value;
-      computed >= result.computed && (result = {value : value, computed : computed});
-    });
-    return result.value;
-  };
-  _.min = function(obj, iterator, context) {
-    if (!iterator && _.isArray(obj) && obj[0] === +obj[0] && obj.length < 65535) {
-      return Math.min.apply(Math, obj);
-    }
-    if (!iterator && _.isEmpty(obj)) return Infinity;
-    var result = {computed : Infinity, value: Infinity};
-    each(obj, function(value, index, list) {
-      var computed = iterator ? iterator.call(context, value, index, list) : value;
-      computed < result.computed && (result = {value : value, computed : computed});
-    });
-    return result.value;
-  };
-  _.shuffle = function(obj) {
-    var rand;
-    var index = 0;
-    var shuffled = [];
-    each(obj, function(value) {
-      rand = _.random(index++);
-      shuffled[index - 1] = shuffled[rand];
-      shuffled[rand] = value;
-    });
-    return shuffled;
-  };
-  var lookupIterator = function(value) {
-    return _.isFunction(value) ? value : function(obj){ return obj[value]; };
-  };
-  _.sortBy = function(obj, value, context) {
-    var iterator = lookupIterator(value);
-    return _.pluck(_.map(obj, function(value, index, list) {
-      return {
-        value : value,
-        index : index,
-        criteria : iterator.call(context, value, index, list)
-      };
-    }).sort(function(left, right) {
-      var a = left.criteria;
-      var b = right.criteria;
-      if (a !== b) {
-        if (a > b || a === void 0) return 1;
-        if (a < b || b === void 0) return -1;
-      }
-      return left.index < right.index ? -1 : 1;
-    }), 'value');
-  };
-  var group = function(obj, value, context, behavior) {
-    var result = {};
-    var iterator = lookupIterator(value || _.identity);
-    each(obj, function(value, index) {
-      var key = iterator.call(context, value, index, obj);
-      behavior(result, key, value);
-    });
-    return result;
-  };
-  _.groupBy = function(obj, value, context) {
-    return group(obj, value, context, function(result, key, value) {
-      (_.has(result, key) ? result[key] : (result[key] = [])).push(value);
-    });
-  };
-  _.countBy = function(obj, value, context) {
-    return group(obj, value, context, function(result, key) {
-      if (!_.has(result, key)) result[key] = 0;
-      result[key]++;
-    });
-  };
-  _.sortedIndex = function(array, obj, iterator, context) {
-    iterator = iterator == null ? _.identity : lookupIterator(iterator);
-    var value = iterator.call(context, obj);
-    var low = 0, high = array.length;
-    while (low < high) {
-      var mid = (low + high) >>> 1;
-      iterator.call(context, array[mid]) < value ? low = mid + 1 : high = mid;
-    }
-    return low;
-  };
-  _.toArray = function(obj) {
-    if (!obj) return [];
-    if (_.isArray(obj)) return slice.call(obj);
-    if (obj.length === +obj.length) return _.map(obj, _.identity);
-    return _.values(obj);
-  };
-  _.size = function(obj) {
-    if (obj == null) return 0;
-    return (obj.length === +obj.length) ? obj.length : _.keys(obj).length;
-  };
-  _.first = _.head = _.take = function(array, n, guard) {
-    if (array == null) return void 0;
-    return (n != null) && !guard ? slice.call(array, 0, n) : array[0];
-  };
-  _.initial = function(array, n, guard) {
-    return slice.call(array, 0, array.length - ((n == null) || guard ? 1 : n));
-  };
-  _.last = function(array, n, guard) {
-    if (array == null) return void 0;
-    if ((n != null) && !guard) {
-      return slice.call(array, Math.max(array.length - n, 0));
-    } else {
-      return array[array.length - 1];
-    }
-  };
-  _.rest = _.tail = _.drop = function(array, n, guard) {
-    return slice.call(array, (n == null) || guard ? 1 : n);
-  };
-  _.compact = function(array) {
-    return _.filter(array, _.identity);
-  };
-  var flatten = function(input, shallow, output) {
-    each(input, function(value) {
-      if (_.isArray(value)) {
-        shallow ? push.apply(output, value) : flatten(value, shallow, output);
-      } else {
-        output.push(value);
-      }
-    });
-    return output;
-  };
-  _.flatten = function(array, shallow) {
-    return flatten(array, shallow, []);
-  };
-  _.without = function(array) {
-    return _.difference(array, slice.call(arguments, 1));
-  };
-  _.uniq = _.unique = function(array, isSorted, iterator, context) {
-    if (_.isFunction(isSorted)) {
-      context = iterator;
-      iterator = isSorted;
-      isSorted = false;
-    }
-    var initial = iterator ? _.map(array, iterator, context) : array;
-    var results = [];
-    var seen = [];
-    each(initial, function(value, index) {
-      if (isSorted ? (!index || seen[seen.length - 1] !== value) : !_.contains(seen, value)) {
-        seen.push(value);
-        results.push(array[index]);
-      }
-    });
-    return results;
-  };
-  _.union = function() {
-    return _.uniq(concat.apply(ArrayProto, arguments));
-  };
-  _.intersection = function(array) {
-    var rest = slice.call(arguments, 1);
-    return _.filter(_.uniq(array), function(item) {
-      return _.every(rest, function(other) {
-        return _.indexOf(other, item) >= 0;
-      });
-    });
-  };
-  _.difference = function(array) {
-    var rest = concat.apply(ArrayProto, slice.call(arguments, 1));
-    return _.filter(array, function(value){ return !_.contains(rest, value); });
-  };
-  _.zip = function() {
-    var args = slice.call(arguments);
-    var length = _.max(_.pluck(args, 'length'));
-    var results = new Array(length);
-    for (var i = 0; i < length; i++) {
-      results[i] = _.pluck(args, "" + i);
-    }
-    return results;
-  };
-  _.object = function(list, values) {
-    if (list == null) return {};
-    var result = {};
-    for (var i = 0, l = list.length; i < l; i++) {
-      if (values) {
-        result[list[i]] = values[i];
-      } else {
-        result[list[i][0]] = list[i][1];
-      }
-    }
-    return result;
-  };
-  _.indexOf = function(array, item, isSorted) {
-    if (array == null) return -1;
-    var i = 0, l = array.length;
-    if (isSorted) {
-      if (typeof isSorted == 'number') {
-        i = (isSorted < 0 ? Math.max(0, l + isSorted) : isSorted);
-      } else {
-        i = _.sortedIndex(array, item);
-        return array[i] === item ? i : -1;
-      }
-    }
-    if (nativeIndexOf && array.indexOf === nativeIndexOf) return array.indexOf(item, isSorted);
-    for (; i < l; i++) if (array[i] === item) return i;
-    return -1;
-  };
-  _.lastIndexOf = function(array, item, from) {
-    if (array == null) return -1;
-    var hasIndex = from != null;
-    if (nativeLastIndexOf && array.lastIndexOf === nativeLastIndexOf) {
-      return hasIndex ? array.lastIndexOf(item, from) : array.lastIndexOf(item);
-    }
-    var i = (hasIndex ? from : array.length);
-    while (i--) if (array[i] === item) return i;
-    return -1;
-  };
-  _.range = function(start, stop, step) {
-    if (arguments.length <= 1) {
-      stop = start || 0;
-      start = 0;
-    }
-    step = arguments[2] || 1;
-
-    var len = Math.max(Math.ceil((stop - start) / step), 0);
-    var idx = 0;
-    var range = new Array(len);
-
-    while(idx < len) {
-      range[idx++] = start;
-      start += step;
-    }
-
-    return range;
-  };
-  _.bind = function(func, context) {
-    if (func.bind === nativeBind && nativeBind) return nativeBind.apply(func, slice.call(arguments, 1));
-    var args = slice.call(arguments, 2);
-    return function() {
-      return func.apply(context, args.concat(slice.call(arguments)));
-    };
-  };
-  _.partial = function(func) {
-    var args = slice.call(arguments, 1);
-    return function() {
-      return func.apply(this, args.concat(slice.call(arguments)));
-    };
-  };
-  _.bindAll = function(obj) {
-    var funcs = slice.call(arguments, 1);
-    if (funcs.length === 0) funcs = _.functions(obj);
-    each(funcs, function(f) { obj[f] = _.bind(obj[f], obj); });
-    return obj;
-  };
-  _.memoize = function(func, hasher) {
-    var memo = {};
-    hasher || (hasher = _.identity);
-    return function() {
-      var key = hasher.apply(this, arguments);
-      return _.has(memo, key) ? memo[key] : (memo[key] = func.apply(this, arguments));
-    };
-  };
-  _.delay = function(func, wait) {
-    var args = slice.call(arguments, 2);
-    return setTimeout(function(){ return func.apply(null, args); }, wait);
-  };
-  _.defer = function(func) {
-    return _.delay.apply(_, [func, 1].concat(slice.call(arguments, 1)));
-  };
-  _.throttle = function(func, wait) {
-    var context, args, timeout, result;
-    var previous = 0;
-    var later = function() {
-      previous = new Date;
-      timeout = null;
-      result = func.apply(context, args);
-    };
-    return function() {
-      var now = new Date;
-      var remaining = wait - (now - previous);
-      context = this;
-      args = arguments;
-      if (remaining <= 0) {
-        clearTimeout(timeout);
-        timeout = null;
-        previous = now;
-        result = func.apply(context, args);
-      } else if (!timeout) {
-        timeout = setTimeout(later, remaining);
-      }
-      return result;
-    };
-  };
-  _.debounce = function(func, wait, immediate) {
-    var timeout, result;
-    return function() {
-      var context = this, args = arguments;
-      var later = function() {
-        timeout = null;
-        if (!immediate) result = func.apply(context, args);
-      };
-      var callNow = immediate && !timeout;
-      clearTimeout(timeout);
-      timeout = setTimeout(later, wait);
-      if (callNow) result = func.apply(context, args);
-      return result;
-    };
-  };
-  _.once = function(func) {
-    var ran = false, memo;
-    return function() {
-      if (ran) return memo;
-      ran = true;
-      memo = func.apply(this, arguments);
-      func = null;
-      return memo;
-    };
-  };
-  _.wrap = function(func, wrapper) {
-    return function() {
-      var args = [func];
-      push.apply(args, arguments);
-      return wrapper.apply(this, args);
-    };
-  };
-  _.compose = function() {
-    var funcs = arguments;
-    return function() {
-      var args = arguments;
-      for (var i = funcs.length - 1; i >= 0; i--) {
-        args = [funcs[i].apply(this, args)];
-      }
-      return args[0];
-    };
-  };
-  _.after = function(times, func) {
-    if (times <= 0) return func();
-    return function() {
-      if (--times < 1) {
-        return func.apply(this, arguments);
-      }
-    };
-  };
-  _.keys = nativeKeys || function(obj) {
-    if (obj !== Object(obj)) throw new TypeError('Invalid object');
-    var keys = [];
-    for (var key in obj) if (_.has(obj, key)) keys[keys.length] = key;
-    return keys;
-  };
-  _.values = function(obj) {
-    var values = [];
-    for (var key in obj) if (_.has(obj, key)) values.push(obj[key]);
-    return values;
-  };
-  _.pairs = function(obj) {
-    var pairs = [];
-    for (var key in obj) if (_.has(obj, key)) pairs.push([key, obj[key]]);
-    return pairs;
-  };
-  _.invert = function(obj) {
-    var result = {};
-    for (var key in obj) if (_.has(obj, key)) result[obj[key]] = key;
-    return result;
-  };
-  _.functions = _.methods = function(obj) {
-    var names = [];
-    for (var key in obj) {
-      if (_.isFunction(obj[key])) names.push(key);
-    }
-    return names.sort();
-  };
-  _.extend = function(obj) {
-    each(slice.call(arguments, 1), function(source) {
-      if (source) {
-        for (var prop in source) {
-          obj[prop] = source[prop];
-        }
-      }
-    });
-    return obj;
-  };
-  _.pick = function(obj) {
-    var copy = {};
-    var keys = concat.apply(ArrayProto, slice.call(arguments, 1));
-    each(keys, function(key) {
-      if (key in obj) copy[key] = obj[key];
-    });
-    return copy;
-  };
-  _.omit = function(obj) {
-    var copy = {};
-    var keys = concat.apply(ArrayProto, slice.call(arguments, 1));
-    for (var key in obj) {
-      if (!_.contains(keys, key)) copy[key] = obj[key];
-    }
-    return copy;
-  };
-  _.defaults = function(obj) {
-    each(slice.call(arguments, 1), function(source) {
-      if (source) {
-        for (var prop in source) {
-          if (obj[prop] == null) obj[prop] = source[prop];
-        }
-      }
-    });
-    return obj;
-  };
-  _.clone = function(obj) {
-    if (!_.isObject(obj)) return obj;
-    return _.isArray(obj) ? obj.slice() : _.extend({}, obj);
-  };
-  _.tap = function(obj, interceptor) {
-    interceptor(obj);
-    return obj;
-  };
-  var eq = function(a, b, aStack, bStack) {
-    if (a === b) return a !== 0 || 1 / a == 1 / b;
-    if (a == null || b == null) return a === b;
-    if (a instanceof _) a = a._wrapped;
-    if (b instanceof _) b = b._wrapped;
-    var className = toString.call(a);
-    if (className != toString.call(b)) return false;
-    switch (className) {
-      case '[object String]':
-        return a == String(b);
-      case '[object Number]':
-        return a != +a ? b != +b : (a == 0 ? 1 / a == 1 / b : a == +b);
-      case '[object Date]':
-      case '[object Boolean]':
-        return +a == +b;
-      case '[object RegExp]':
-        return a.source == b.source &&
-               a.global == b.global &&
-               a.multiline == b.multiline &&
-               a.ignoreCase == b.ignoreCase;
-    }
-    if (typeof a != 'object' || typeof b != 'object') return false;
-    var length = aStack.length;
-    while (length--) {
-      if (aStack[length] == a) return bStack[length] == b;
-    }
-    aStack.push(a);
-    bStack.push(b);
-    var size = 0, result = true;
-    if (className == '[object Array]') {
-      size = a.length;
-      result = size == b.length;
-      if (result) {
-        while (size--) {
-          if (!(result = eq(a[size], b[size], aStack, bStack))) break;
-        }
-      }
-    } else {
-      var aCtor = a.constructor, bCtor = b.constructor;
-      if (aCtor !== bCtor && !(_.isFunction(aCtor) && (aCtor instanceof aCtor) &&
-                               _.isFunction(bCtor) && (bCtor instanceof bCtor))) {
-        return false;
-      }
-      for (var key in a) {
-        if (_.has(a, key)) {
-          size++;
-          if (!(result = _.has(b, key) && eq(a[key], b[key], aStack, bStack))) break;
-        }
-      }
-      if (result) {
-        for (key in b) {
-          if (_.has(b, key) && !(size--)) break;
-        }
-        result = !size;
-      }
-    }
-    aStack.pop();
-    bStack.pop();
-    return result;
-  };
-  _.isEqual = function(a, b) {
-    return eq(a, b, [], []);
-  };
-  _.isEmpty = function(obj) {
-    if (obj == null) return true;
-    if (_.isArray(obj) || _.isString(obj)) return obj.length === 0;
-    for (var key in obj) if (_.has(obj, key)) return false;
-    return true;
-  };
-  _.isElement = function(obj) {
-    return !!(obj && obj.nodeType === 1);
-  };
-  _.isArray = nativeIsArray || function(obj) {
-    return toString.call(obj) == '[object Array]';
-  };
-  _.isObject = function(obj) {
-    return obj === Object(obj);
-  };
-  each(['Arguments', 'Function', 'String', 'Number', 'Date', 'RegExp'], function(name) {
-    _['is' + name] = function(obj) {
-      return toString.call(obj) == '[object ' + name + ']';
-    };
-  });
-  if (!_.isArguments(arguments)) {
-    _.isArguments = function(obj) {
-      return !!(obj && _.has(obj, 'callee'));
-    };
-  }
-  if (typeof (/./) !== 'function') {
-    _.isFunction = function(obj) {
-      return typeof obj === 'function';
-    };
-  }
-  _.isFinite = function(obj) {
-    return is

<TRUNCATED>

[06/37] move JS tests into safety

Posted by ja...@apache.org.
http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/www/script/test/lorem_b64.txt
----------------------------------------------------------------------
diff --git a/share/www/script/test/lorem_b64.txt b/share/www/script/test/lorem_b64.txt
deleted file mode 100644
index 8a21d79..0000000
--- a/share/www/script/test/lorem_b64.txt
+++ /dev/null
@@ -1 +0,0 @@
-TG9yZW0gaXBzdW0gZG9sb3Igc2l0IGFtZXQsIGNvbnNlY3RldHVyIGFkaXBpc2NpbmcgZWxpdC4gUGhhc2VsbHVzIG51bmMgc2FwaWVuLCBwb3J0YSBpZCBwZWxsZW50ZXNxdWUgYXQsIGVsZW1lbnR1bSBldCBmZWxpcy4gQ3VyYWJpdHVyIGNvbmRpbWVudHVtIGFudGUgaW4gbWV0dXMgaWFjdWxpcyBxdWlzIGNvbmd1ZSBkaWFtIGNvbW1vZG8uIERvbmVjIGVsZWlmZW5kIGFudGUgc2VkIG51bGxhIGRhcGlidXMgY29udmFsbGlzLiBVdCBjdXJzdXMgYWxpcXVhbSBuZXF1ZSwgdmVsIHBvcnR0aXRvciB0ZWxsdXMgaW50ZXJkdW0gdXQuIFNlZCBwaGFyZXRyYSBsYWNpbmlhIGFkaXBpc2NpbmcuIEluIHRyaXN0aXF1ZSB0cmlzdGlxdWUgZmVsaXMgbm9uIHRpbmNpZHVudC4gTnVsbGEgYXVjdG9yIG1hdXJpcyBhIHZlbGl0IGN1cnN1cyB1bHRyaWNpZXMuIEluIGF0IGxpYmVybyBxdWlzIGp1c3RvIGNvbnNlY3RldHVyIGxhb3JlZXQuIE51bGxhbSBpZCB1bHRyaWNlcyBudW5jLiBEb25lYyBub24gdHVycGlzIG51bGxhLCBldSBsYWNpbmlhIGFudGUuIE51bmMgZXUgb3JjaSBldCB0dXJwaXMgcHJldGl1bSB2ZW5lbmF0aXMuIE5hbSBtb2xlc3RpZSwgbGFjdXMgYXQgZGlnbmlzc2ltIGVsZW1lbnR1bSwgYW50ZSBsaWJlcm8gY29uc2VjdGV0dXIgbGliZXJvLCB1dCBsYWNpbmlhIGxhY3VzIHVybmEgZXQgcHVydXMuIE51bGxhbSBsb3JlbSBpcHN1bSwgZGFwaWJ1cyB2ZWwgdWxsYW1jb3JwZXIgYSwgbWFsZXN1YWRhIGEgb
 WV0dXMuIFNlZCBwb3J0YSBhZGlwaXNjaW5nIG1hZ25hLCBxdWlzIHB1bHZpbmFyIHB1cnVzIG1hdHRpcyBmcmluZ2lsbGEuIEludGVnZXIgcGVsbGVudGVzcXVlIHNhcGllbiBpbiBuZXF1ZSB0cmlzdGlxdWUgYWMgaWFjdWxpcyBsaWJlcm8gdWx0cmljaWVzLiBVdCBlZ2V0IHBoYXJldHJhIHB1cnVzLgoKTnVsbGEgaW4gY29udmFsbGlzIHRlbGx1cy4gUHJvaW4gdGluY2lkdW50IHN1c2NpcGl0IHZ1bHB1dGF0ZS4gU3VzcGVuZGlzc2UgcG90ZW50aS4gTnVsbGFtIHRyaXN0aXF1ZSBqdXN0byBtaSwgYSB0cmlzdGlxdWUgbGlndWxhLiBEdWlzIGNvbnZhbGxpcyBhbGlxdWFtIGlhY3VsaXMuIE51bGxhIGRpY3R1bSBmcmluZ2lsbGEgY29uZ3VlLiBTdXNwZW5kaXNzZSBhYyBsZW8gbGVjdHVzLCBhYyBhbGlxdWFtIGp1c3RvLiBVdCBwb3J0dGl0b3IgY29tbW9kbyBtaSBzZWQgbHVjdHVzLiBOdWxsYSBhdCBlbmltIGxvcmVtLiBOdW5jIGV1IGp1c3RvIHNhcGllbiwgYSBibGFuZGl0IG9kaW8uIEN1cmFiaXR1ciBmYXVjaWJ1cyBzb2xsaWNpdHVkaW4gZG9sb3IsIGlkIGxhY2luaWEgc2VtIGF1Y3RvciBpbi4gRG9uZWMgdmFyaXVzIG51bmMgYXQgbGVjdHVzIHNhZ2l0dGlzIG5lYyBsdWN0dXMgYXJjdSBwaGFyZXRyYS4gTnVuYyBzZWQgbWV0dXMganVzdG8uIENyYXMgdmVsIG1hdXJpcyBkaWFtLiBVdCBmZXVnaWF0IGZlbGlzIGVnZXQgbmVxdWUgcGhhcmV0cmEgdmVzdGlidWx1bSBjb25zZWN0ZXR1ciBtYXNzYSBmYW
 NpbGlzaXMuIFF1aXNxdWUgY29uc2VjdGV0dXIgbHVjdHVzIG5pc2kgcXVpcyB0aW5jaWR1bnQuIFZpdmFtdXMgY3Vyc3VzIGN1cnN1cyBxdWFtIG5vbiBibGFuZGl0LiBQZWxsZW50ZXNxdWUgZXQgdmVsaXQgbGFjdXMuIFBlbGxlbnRlc3F1ZSBoYWJpdGFudCBtb3JiaSB0cmlzdGlxdWUgc2VuZWN0dXMgZXQgbmV0dXMgZXQgbWFsZXN1YWRhIGZhbWVzIGFjIHR1cnBpcyBlZ2VzdGFzLgoKSW4gZXQgZG9sb3Igdml0YWUgb3JjaSBhZGlwaXNjaW5nIGNvbmd1ZS4gQWxpcXVhbSBncmF2aWRhIG5pYmggYXQgbmlzbCBncmF2aWRhIG1vbGVzdGllLiBDdXJhYml0dXIgYSBiaWJlbmR1bSBzYXBpZW4uIEFsaXF1YW0gdGluY2lkdW50LCBudWxsYSBuZWMgcHJldGl1bSBsb2JvcnRpcywgb2RpbyBhdWd1ZSB0aW5jaWR1bnQgYXJjdSwgYSBsb2JvcnRpcyBvZGlvIHNlbSB1dCBwdXJ1cy4gRG9uZWMgYWNjdW1zYW4gbWF0dGlzIG51bmMgdml0YWUgbGFjaW5pYS4gU3VzcGVuZGlzc2UgcG90ZW50aS4gSW50ZWdlciBjb21tb2RvIG5pc2wgcXVpcyBuaWJoIGludGVyZHVtIG5vbiBmcmluZ2lsbGEgZHVpIHNvZGFsZXMuIENsYXNzIGFwdGVudCB0YWNpdGkgc29jaW9zcXUgYWQgbGl0b3JhIHRvcnF1ZW50IHBlciBjb251YmlhIG5vc3RyYSwgcGVyIGluY2VwdG9zIGhpbWVuYWVvcy4gSW4gaGFjIGhhYml0YXNzZSBwbGF0ZWEgZGljdHVtc3QuIEV0aWFtIHVsbGFtY29ycGVyLCBtaSBpZCBmZXVnaWF0IGJpYmVuZHVtLCBwdXJ1cyB
 uZXF1ZSBjdXJzdXMgbWF1cmlzLCBpZCBzb2RhbGVzIHF1YW0gbmlzaSBpZCB2ZWxpdC4gU2VkIGxlY3R1cyBsZW8sIHRpbmNpZHVudCB2ZWwgcmhvbmN1cyBpbXBlcmRpZXQsIGJsYW5kaXQgaW4gbGVvLiBJbnRlZ2VyIHF1aXMgbWFnbmEgbnVsbGEuIERvbmVjIHZlbCBuaXNsIG1hZ25hLCB1dCByaG9uY3VzIGR1aS4gQWxpcXVhbSBncmF2aWRhLCBudWxsYSBuZWMgZWxlaWZlbmQgbHVjdHVzLCBuZXF1ZSBuaWJoIHBoYXJldHJhIGFudGUsIHF1aXMgZWdlc3RhcyBlbGl0IG1ldHVzIGEgbWkuIE51bmMgbmVjIGF1Z3VlIHF1YW0uIE1vcmJpIHRpbmNpZHVudCB0cmlzdGlxdWUgdmFyaXVzLiBTdXNwZW5kaXNzZSBpYWN1bGlzIGVsaXQgZmV1Z2lhdCBtYWduYSBwZWxsZW50ZXNxdWUgdWx0cmljaWVzLiBWZXN0aWJ1bHVtIGFsaXF1YW0gdG9ydG9yIG5vbiBhbnRlIHVsbGFtY29ycGVyIGZyaW5naWxsYS4gRG9uZWMgaWFjdWxpcyBtaSBxdWlzIG1hdXJpcyBvcm5hcmUgdmVzdGlidWx1bS4KCkluIGEgbWFnbmEgbmlzaSwgYSB1bHRyaWNpZXMgbWFzc2EuIERvbmVjIGVsaXQgbmVxdWUsIHZpdmVycmEgbm9uIHRlbXBvciBxdWlzLCBmcmluZ2lsbGEgaW4gbWV0dXMuIEludGVnZXIgb2RpbyBvZGlvLCBldWlzbW9kIHZpdGFlIG1vbGxpcyBzZWQsIHNvZGFsZXMgZWdldCBsaWJlcm8uIERvbmVjIG5lYyBtYXNzYSBpbiBmZWxpcyBvcm5hcmUgcGhhcmV0cmEgYXQgbmVjIHRlbGx1cy4gTnVuYyBsb3JlbSBkb2xvciwgcHJl
 dGl1bSB2ZWwgYXVjdG9yIGluLCB2b2x1dHBhdCB2aXRhZSBmZWxpcy4gTWFlY2VuYXMgcmhvbmN1cywgb3JjaSB2ZWwgYmxhbmRpdCBldWlzbW9kLCB0dXJwaXMgZXJhdCB0aW5jaWR1bnQgYW50ZSwgZWxlbWVudHVtIGFkaXBpc2NpbmcgbmlzbCB1cm5hIGluIG5pc2kuIFBoYXNlbGx1cyBzYWdpdHRpcywgZW5pbSBzZWQgYWNjdW1zYW4gY29uc2VxdWF0LCB1cm5hIGF1Z3VlIGxvYm9ydGlzIGVyYXQsIG5vbiBtYWxlc3VhZGEgcXVhbSBtZXR1cyBzb2xsaWNpdHVkaW4gYW50ZS4gSW4gbGVvIHB1cnVzLCBkaWduaXNzaW0gcXVpcyB2YXJpdXMgdmVsLCBwZWxsZW50ZXNxdWUgZXQgbmliaC4gSW4gc2VkIHRvcnRvciBpYWN1bGlzIGxpYmVybyBtb2xsaXMgcGVsbGVudGVzcXVlIGlkIHZpdGFlIGxlY3R1cy4gSW4gaGFjIGhhYml0YXNzZSBwbGF0ZWEgZGljdHVtc3QuIFBoYXNlbGx1cyBtYXVyaXMgZW5pbSwgcG9zdWVyZSBlZ2V0IGx1Y3R1cyBhYywgaWFjdWxpcyBldCBxdWFtLiBWaXZhbXVzIGV0IG5pYmggZGlhbSwgZWxlbWVudHVtIGVnZXN0YXMgdGVsbHVzLiBBZW5lYW4gdnVscHV0YXRlIG1hbGVzdWFkYSBlc3QuIFNlZCBwb3N1ZXJlIHBvcnRhIGRpYW0gYSBzb2RhbGVzLiBQcm9pbiBldSBzZW0gbm9uIHZlbGl0IGZhY2lsaXNpcyB2ZW5lbmF0aXMgc2VkIGEgdHVycGlzLgoKUGVsbGVudGVzcXVlIHNlZCByaXN1cyBhIGFudGUgdnVscHV0YXRlIGxvYm9ydGlzIHNpdCBhbWV0IGV1IG5pc2wuIFN1c3BlbmRpc
 3NlIHV0IGVyb3MgbWksIGEgcmhvbmN1cyBsYWN1cy4gQ3VyYWJpdHVyIGZlcm1lbnR1bSB2ZWhpY3VsYSB0ZWxsdXMsIGEgb3JuYXJlIG1pIGNvbmRpbWVudHVtIHZlbC4gSW50ZWdlciBtb2xlc3RpZSB2b2x1dHBhdCB2aXZlcnJhLiBJbnRlZ2VyIHBvc3VlcmUgZXVpc21vZCB2ZW5lbmF0aXMuIFByb2luIGFjIG1hdXJpcyBzZWQgbnVsbGEgcGhhcmV0cmEgcG9ydHRpdG9yLiBEdWlzIHZlbCBkdWkgaW4gcmlzdXMgc29kYWxlcyBhdWN0b3Igc2l0IGFtZXQgbm9uIGVuaW0uIE1hZWNlbmFzIG1vbGxpcyBsYWN1cyBhdCBsaWd1bGEgZmF1Y2lidXMgc29kYWxlcy4gQ3JhcyB2ZWwgbmVxdWUgYXJjdS4gU2VkIHRpbmNpZHVudCB0b3J0b3IgcHJldGl1bSBuaXNpIGludGVyZHVtIHF1aXMgZGljdHVtIGFyY3UgbGFvcmVldC4gTW9yYmkgcHJldGl1bSB1bHRyaWNlcyBmZXVnaWF0LiBNYWVjZW5hcyBjb252YWxsaXMgYXVndWUgbmVjIGZlbGlzIG1hbGVzdWFkYSBtYWxlc3VhZGEgc2NlbGVyaXNxdWUgbWF1cmlzIHBsYWNlcmF0LiBTZWQgYXQgbWFnbmEgZW5pbSwgYXQgZnJpbmdpbGxhIGRvbG9yLiBRdWlzcXVlIHV0IG1hdHRpcyBkdWkuIFByYWVzZW50IGNvbnNlY3RldHVyIGFudGUgdml2ZXJyYSBuaXNpIGJsYW5kaXQgcGhhcmV0cmEuIFF1aXNxdWUgbWV0dXMgZWxpdCwgZGlnbmlzc2ltIHZpdGFlIGZlcm1lbnR1bSBzaXQgYW1ldCwgZnJpbmdpbGxhIGltcGVyZGlldCBvZGlvLiBDcmFzIGVnZXQgcHVydXMgZWdldC
 B0ZWxsdXMgZmV1Z2lhdCBsdWN0dXMgYSBhYyBwdXJ1cy4gQ3JhcyB2aXRhZSBuaXNsIHZlbCBhdWd1ZSByaG9uY3VzIHBvcnR0aXRvciBzaXQgYW1ldCBxdWlzIGxvcmVtLiBEb25lYyBpbnRlcmR1bSBwZWxsZW50ZXNxdWUgYWRpcGlzY2luZy4gUGhhc2VsbHVzIG5lcXVlIGxpYmVybywgYWxpcXVhbSBpbiBtYXR0aXMgdml0YWUsIGNvbnNlY3RldHVyIGFkaXBpc2NpbmcgbmliaC4KCkRvbmVjIG5lYyBudWxsYSB1cm5hLCBhYyBzYWdpdHRpcyBsZWN0dXMuIFN1c3BlbmRpc3NlIG5vbiBlbGl0IHNlZCBtaSBhdWN0b3IgZmFjaWxpc2lzIHZpdGFlIGV0IGxlY3R1cy4gRnVzY2UgYWMgdnVscHV0YXRlIG1hdXJpcy4gTW9yYmkgY29uZGltZW50dW0gdWx0cmljZXMgbWV0dXMsIGV0IGFjY3Vtc2FuIHB1cnVzIG1hbGVzdWFkYSBhdC4gTWFlY2VuYXMgbG9ib3J0aXMgYW50ZSBzZWQgbWFzc2EgZGljdHVtIHZpdGFlIHZlbmVuYXRpcyBlbGl0IGNvbW1vZG8uIFByb2luIHRlbGx1cyBlcm9zLCBhZGlwaXNjaW5nIHNlZCBkaWduaXNzaW0gdml0YWUsIHRlbXBvciBlZ2V0IGFudGUuIEFlbmVhbiBpZCB0ZWxsdXMgbmVjIG1hZ25hIGN1cnN1cyBwaGFyZXRyYSB2aXRhZSB2ZWwgZW5pbS4gTW9yYmkgdmVzdGlidWx1bSBwaGFyZXRyYSBlc3QgaW4gdnVscHV0YXRlLiBBbGlxdWFtIHZpdGFlIG1ldHVzIGFyY3UsIGlkIGFsaXF1ZXQgbnVsbGEuIFBoYXNlbGx1cyBsaWd1bGEgZXN0LCBoZW5kcmVyaXQgbmVjIGlhY3VsaXMgdXQ
 sIHZvbHV0cGF0IHZlbCBlcm9zLiBTdXNwZW5kaXNzZSB2aXRhZSB1cm5hIHR1cnBpcywgcGxhY2VyYXQgYWRpcGlzY2luZyBkaWFtLiBQaGFzZWxsdXMgZmV1Z2lhdCB2ZXN0aWJ1bHVtIG5lcXVlIGV1IGRhcGlidXMuIE51bGxhIGZhY2lsaXNpLiBEdWlzIHRvcnRvciBmZWxpcywgZXVpc21vZCBzaXQgYW1ldCBhbGlxdWV0IGluLCB2b2x1dHBhdCBuZWMgdHVycGlzLiBNYXVyaXMgcmhvbmN1cyBpcHN1bSB1dCBwdXJ1cyBlbGVpZmVuZCB1dCBsb2JvcnRpcyBsZWN0dXMgZGFwaWJ1cy4gUXVpc3F1ZSBub24gZXJhdCBsb3JlbS4gVml2YW11cyBwb3N1ZXJlIGltcGVyZGlldCBpYWN1bGlzLiBVdCBsaWd1bGEgbGFjdXMsIGVsZWlmZW5kIGF0IHRlbXBvciBpZCwgYXVjdG9yIGV1IGxlby4KCkRvbmVjIG1pIGVuaW0sIGxhb3JlZXQgcHVsdmluYXIgbW9sbGlzIGV1LCBtYWxlc3VhZGEgdml2ZXJyYSBudW5jLiBJbiB2aXRhZSBtZXR1cyB2aXRhZSBuZXF1ZSB0ZW1wb3IgZGFwaWJ1cy4gTWFlY2VuYXMgdGluY2lkdW50IHB1cnVzIGEgZmVsaXMgYWxpcXVhbSBwbGFjZXJhdC4gTnVsbGEgZmFjaWxpc2kuIFN1c3BlbmRpc3NlIHBsYWNlcmF0IHBoYXJldHJhIG1hdHRpcy4gSW50ZWdlciB0ZW1wb3IgbWFsZXN1YWRhIGp1c3RvIGF0IHRlbXB1cy4gTWFlY2VuYXMgdmVoaWN1bGEgbG9yZW0gYSBzYXBpZW4gYmliZW5kdW0gdmVsIGlhY3VsaXMgcmlzdXMgZmV1Z2lhdC4gUGVsbGVudGVzcXVlIGRpYW0gZXJhdCwgZGFwaWJ1
 cyBldCBwZWxsZW50ZXNxdWUgcXVpcywgbW9sZXN0aWUgdXQgbWFzc2EuIFZpdmFtdXMgaWFjdWxpcyBpbnRlcmR1bSBtYXNzYSBpZCBiaWJlbmR1bS4gUXVpc3F1ZSB1dCBtYXVyaXMgZHVpLCBzaXQgYW1ldCB2YXJpdXMgZWxpdC4gVmVzdGlidWx1bSBlbGl0IGxvcmVtLCBydXRydW0gbm9uIGNvbnNlY3RldHVyIHV0LCBsYW9yZWV0IG5lYyBudW5jLiBEb25lYyBuZWMgbWF1cmlzIGFudGUuIEN1cmFiaXR1ciB1dCBlc3Qgc2VkIG9kaW8gcGhhcmV0cmEgbGFvcmVldC4gTG9yZW0gaXBzdW0gZG9sb3Igc2l0IGFtZXQsIGNvbnNlY3RldHVyIGFkaXBpc2NpbmcgZWxpdC4gQ3VyYWJpdHVyIHB1cnVzIHJpc3VzLCBsYW9yZWV0IHNlZCBwb3J0YSBpZCwgc2FnaXR0aXMgdmVsIGlwc3VtLiBNYWVjZW5hcyBuaWJoIGRpYW0sIGN1cnN1cyBldCB2YXJpdXMgc2l0IGFtZXQsIGZyaW5naWxsYSBzZWQgbWFnbmEuIE51bGxhbSBpZCBuZXF1ZSBldSBsZW8gZmF1Y2lidXMgbW9sbGlzLiBEdWlzIG5lYyBhZGlwaXNjaW5nIG1hdXJpcy4gU3VzcGVuZGlzc2Ugc29sbGljaXR1ZGluLCBlbmltIGV1IHB1bHZpbmFyIGNvbW1vZG8sIGVyYXQgYXVndWUgdWx0cmljZXMgbWksIGEgdHJpc3RpcXVlIG1hZ25hIHNlbSBub24gbGliZXJvLgoKU2VkIGluIG1ldHVzIG51bGxhLiBQcmFlc2VudCBuZWMgYWRpcGlzY2luZyBzYXBpZW4uIERvbmVjIGxhb3JlZXQsIHZlbGl0IG5vbiBydXRydW0gdmVzdGlidWx1bSwgbGlndWxhIG5lcXVlIGFka
 XBpc2NpbmcgdHVycGlzLCBhdCBhdWN0b3Igc2FwaWVuIGVsaXQgdXQgbWFzc2EuIE51bGxhbSBhbGlxdWFtLCBlbmltIHZlbCBwb3N1ZXJlIHJ1dHJ1bSwganVzdG8gZXJhdCBsYW9yZWV0IGVzdCwgdmVsIGZyaW5naWxsYSBsYWN1cyBuaXNpIG5vbiBsZWN0dXMuIEV0aWFtIGxlY3R1cyBudW5jLCBsYW9yZWV0IGV0IHBsYWNlcmF0IGF0LCB2ZW5lbmF0aXMgcXVpcyBsaWJlcm8uIFByYWVzZW50IGluIHBsYWNlcmF0IGVsaXQuIENsYXNzIGFwdGVudCB0YWNpdGkgc29jaW9zcXUgYWQgbGl0b3JhIHRvcnF1ZW50IHBlciBjb251YmlhIG5vc3RyYSwgcGVyIGluY2VwdG9zIGhpbWVuYWVvcy4gUGVsbGVudGVzcXVlIGZyaW5naWxsYSBhdWd1ZSBldSBuaWJoIHBsYWNlcmF0IGRpY3R1bS4gTnVuYyBwb3J0dGl0b3IgdHJpc3RpcXVlIGRpYW0sIGV1IGFsaXF1YW0gZW5pbSBhbGlxdWV0IHZlbC4gQWxpcXVhbSBsYWNpbmlhIGludGVyZHVtIGlwc3VtLCBpbiBwb3N1ZXJlIG1ldHVzIGx1Y3R1cyB2ZWwuIFZpdmFtdXMgZXQgbmlzbCBhIGVyb3Mgc2VtcGVyIGVsZW1lbnR1bS4gRG9uZWMgdmVuZW5hdGlzIG9yY2kgYXQgZGlhbSB0cmlzdGlxdWUgc29sbGljaXR1ZGluLiBJbiBldSBlcm9zIHNlZCBvZGlvIHJ1dHJ1bSBsdWN0dXMgbm9uIG5lYyB0ZWxsdXMuCgpOdWxsYSBuZWMgZmVsaXMgZWxpdC4gTnVsbGFtIGluIGlwc3VtIGluIGlwc3VtIGNvbnNlcXVhdCBmcmluZ2lsbGEgcXVpcyB2ZWwgdG9ydG9yLiBQaGFzZWxsdX
 Mgbm9uIG1hc3NhIG5pc2ksIHNpdCBhbWV0IGFsaXF1YW0gdXJuYS4gU2VkIGZlcm1lbnR1bSBuaWJoIHZpdGFlIGxhY3VzIHRpbmNpZHVudCBuZWMgdGluY2lkdW50IG1hc3NhIGJpYmVuZHVtLiBFdGlhbSBlbGl0IGR1aSwgZmFjaWxpc2lzIHNpdCBhbWV0IHZlaGljdWxhIG5lYywgaWFjdWxpcyBhdCBzYXBpZW4uIFV0IGF0IG1hc3NhIGlkIGR1aSB1bHRyaWNlcyB2b2x1dHBhdCB1dCBhYyBsaWJlcm8uIEZ1c2NlIGlwc3VtIG1pLCBiaWJlbmR1bSBhIGxhY2luaWEgZXQsIHB1bHZpbmFyIGVnZXQgbWF1cmlzLiBQcm9pbiBmYXVjaWJ1cyB1cm5hIHV0IGxvcmVtIGVsZW1lbnR1bSB2dWxwdXRhdGUuIER1aXMgcXVhbSBsZW8sIG1hbGVzdWFkYSBub24gZXVpc21vZCB1dCwgYmxhbmRpdCBmYWNpbGlzaXMgbWF1cmlzLiBTdXNwZW5kaXNzZSBzaXQgYW1ldCBtYWduYSBpZCB2ZWxpdCB0aW5jaWR1bnQgYWxpcXVldCBuZWMgZXUgZG9sb3IuIEN1cmFiaXR1ciBiaWJlbmR1bSBsb3JlbSB2ZWwgZmVsaXMgdGVtcHVzIGRhcGlidXMuIEFsaXF1YW0gZXJhdCB2b2x1dHBhdC4gQWVuZWFuIGN1cnN1cyB0b3J0b3IgbmVjIGR1aSBhbGlxdWV0IHBvcnRhLiBBZW5lYW4gY29tbW9kbyBpYWN1bGlzIHN1c2NpcGl0LiBWZXN0aWJ1bHVtIGFudGUgaXBzdW0gcHJpbWlzIGluIGZhdWNpYnVzIG9yY2kgbHVjdHVzIGV0IHVsdHJpY2VzIHBvc3VlcmUgY3ViaWxpYSBDdXJhZTsgUXVpc3F1ZSBzaXQgYW1ldCBvcm5hcmUgZWxpdC4gTmF
 tIGxpZ3VsYSByaXN1cywgdmVzdGlidWx1bSBuZWMgbWF0dGlzIGluLCBjb25kaW1lbnR1bSBhYyBhbnRlLiBEb25lYyBmcmluZ2lsbGEsIGp1c3RvIGV0IHVsdHJpY2VzIGZhdWNpYnVzLCB0ZWxsdXMgZXN0IHZvbHV0cGF0IG1hc3NhLCB2aXRhZSBjb21tb2RvIHNhcGllbiBkaWFtIG5vbiByaXN1cy4gVml2YW11cyBhdCBhcmN1IGdyYXZpZGEgcHVydXMgbW9sbGlzIGZldWdpYXQuCgpOdWxsYSBhIHR1cnBpcyBxdWlzIHNhcGllbiBjb21tb2RvIGRpZ25pc3NpbSBldSBxdWlzIGp1c3RvLiBNYWVjZW5hcyBldSBsb3JlbSBvZGlvLCB1dCBoZW5kcmVyaXQgdmVsaXQuIEN1bSBzb2NpaXMgbmF0b3F1ZSBwZW5hdGlidXMgZXQgbWFnbmlzIGRpcyBwYXJ0dXJpZW50IG1vbnRlcywgbmFzY2V0dXIgcmlkaWN1bHVzIG11cy4gUHJvaW4gZmFjaWxpc2lzIHBvcnR0aXRvciB1bGxhbWNvcnBlci4gUHJhZXNlbnQgbW9sbGlzIGRpZ25pc3NpbSBtYXNzYSwgbGFvcmVldCBhbGlxdWV0IHZlbGl0IHBlbGxlbnRlc3F1ZSBub24uIE51bmMgZmFjaWxpc2lzIGNvbnZhbGxpcyB0cmlzdGlxdWUuIE1hdXJpcyBwb3J0dGl0b3IgYW50ZSBhdCB0ZWxsdXMgY29udmFsbGlzIHBsYWNlcmF0LiBNb3JiaSBhbGlxdWV0IG5pc2kgYWMgbmlzbCBwdWx2aW5hciBpZCBkaWN0dW0gbmlzbCBtb2xsaXMuIFNlZCBvcm5hcmUgc2VtIGV0IHJpc3VzIHBsYWNlcmF0IGxvYm9ydGlzIGlkIGVnZXQgZWxpdC4gSW50ZWdlciBjb25zZXF1YXQsIG1hZ25h
 IGlkIHN1c2NpcGl0IHBoYXJldHJhLCBudWxsYSB2ZWxpdCBzdXNjaXBpdCBvcmNpLCB1dCBpbnRlcmR1bSBhdWd1ZSBhdWd1ZSBxdWlzIHF1YW0uIEZ1c2NlIHByZXRpdW0gYWxpcXVldCB2dWxwdXRhdGUuIE1hdXJpcyBibGFuZGl0IGRpY3R1bSBtb2xlc3RpZS4gUHJvaW4gbnVsbGEgbmliaCwgYmliZW5kdW0gZXUgcGxhY2VyYXQgYXQsIHRpbmNpZHVudCBhYyBuaXNsLiBOdWxsYW0gdnVscHV0YXRlIG1ldHVzIHV0IGxpYmVybyBydXRydW0gdWx0cmljaWVzLiBOdW5jIHNpdCBhbWV0IGR1aSBtYXVyaXMuIFN1c3BlbmRpc3NlIGFkaXBpc2NpbmcgbGFjdXMgaW4gYXVndWUgZWxlaWZlbmQgbW9sbGlzLgoKRHVpcyBwcmV0aXVtIHVsdHJpY2VzIG1hdHRpcy4gTmFtIGV1aXNtb2QgcmlzdXMgYSBlcmF0IGxhY2luaWEgYmliZW5kdW0uIE1vcmJpIG1hc3NhIHRvcnRvciwgY29uc2VjdGV0dXIgaWQgZWxlaWZlbmQgaWQsIHBlbGxlbnRlc3F1ZSB2ZWwgdG9ydG9yLiBQcmFlc2VudCB1cm5hIGxvcmVtLCBwb3J0dGl0b3IgYXQgY29uZGltZW50dW0gdml0YWUsIGx1Y3R1cyBlZ2V0IGVsaXQuIE1hZWNlbmFzIGZyaW5naWxsYSBxdWFtIGNvbnZhbGxpcyBlc3QgaGVuZHJlcml0IHZpdmVycmEuIEV0aWFtIHZlaGljdWxhLCBzYXBpZW4gbm9uIHB1bHZpbmFyIGFkaXBpc2NpbmcsIG5pc2kgbWFzc2EgdmVzdGlidWx1bSBlc3QsIGlkIGludGVyZHVtIG1hdXJpcyB2ZWxpdCBldSBlc3QuIFZlc3RpYnVsdW0gZXN0IGFyY3UsI
 GZhY2lsaXNpcyBhdCB1bHRyaWNpZXMgbm9uLCB2dWxwdXRhdGUgaWQgc2FwaWVuLiBWZXN0aWJ1bHVtIGlwc3VtIG1ldHVzLCBwaGFyZXRyYSBuZWMgcGVsbGVudGVzcXVlIGlkLCBmYWNpbGlzaXMgaWQgc2FwaWVuLiBEb25lYyBydXRydW0gb2RpbyBldCBsYWN1cyB1bHRyaWNpZXMgdWxsYW1jb3JwZXIuIEludGVnZXIgc2VkIGVzdCB1dCBtaSBwb3N1ZXJlIHRpbmNpZHVudCBxdWlzIG5vbiBsZW8uIE1vcmJpIHRlbGx1cyBqdXN0bywgdWx0cmljaWVzIHNpdCBhbWV0IHVsdHJpY2VzIHF1aXMsIGZhY2lsaXNpcyB2aXRhZSBtYWduYS4gRG9uZWMgbGlndWxhIG1ldHVzLCBwZWxsZW50ZXNxdWUgbm9uIHRyaXN0aXF1ZSBhYywgdmVzdGlidWx1bSBzZWQgZXJhdC4gQWxpcXVhbSBlcmF0IHZvbHV0cGF0LgoKTmFtIGRpZ25pc3NpbSwgbmlzbCBlZ2V0IGNvbnNlcXVhdCBldWlzbW9kLCBzZW0gbGVjdHVzIGF1Y3RvciBvcmNpLCB1dCBwb3J0dGl0b3IgbGFjdXMgZHVpIGFjIG5lcXVlLiBJbiBoYWMgaGFiaXRhc3NlIHBsYXRlYSBkaWN0dW1zdC4gRnVzY2UgZWdlc3RhcyBwb3J0YSBmYWNpbGlzaXMuIEluIGhhYyBoYWJpdGFzc2UgcGxhdGVhIGRpY3R1bXN0LiBNYXVyaXMgY3Vyc3VzIHJob25jdXMgcmlzdXMgYWMgZXVpc21vZC4gUXVpc3F1ZSB2aXRhZSByaXN1cyBhIHRlbGx1cyB2ZW5lbmF0aXMgY29udmFsbGlzLiBDdXJhYml0dXIgbGFvcmVldCBzYXBpZW4gZXUgcXVhbSBsdWN0dXMgbG9ib3J0aXMuIFZpdmFtdX
 Mgc29sbGljaXR1ZGluIHNvZGFsZXMgZG9sb3Igdml0YWUgc29kYWxlcy4gU3VzcGVuZGlzc2UgcGhhcmV0cmEgbGFvcmVldCBhbGlxdWV0LiBNYWVjZW5hcyB1bGxhbWNvcnBlciBvcmNpIHZlbCB0b3J0b3IgbHVjdHVzIGlhY3VsaXMgdXQgdml0YWUgbWV0dXMuIFZlc3RpYnVsdW0gdXQgYXJjdSBhYyB0ZWxsdXMgbWF0dGlzIGVsZWlmZW5kIGVnZXQgdmVoaWN1bGEgZWxpdC4KCkluIHNlZCBmZXVnaWF0IGVyb3MuIERvbmVjIGJpYmVuZHVtIHVsbGFtY29ycGVyIGRpYW0sIGV1IGZhdWNpYnVzIG1hdXJpcyBkaWN0dW0gc2VkLiBEdWlzIHRpbmNpZHVudCBqdXN0byBpbiBuZXF1ZSBhY2N1bXNhbiBkaWN0dW0uIE1hZWNlbmFzIGluIHJ1dHJ1bSBzYXBpZW4uIFV0IGlkIGZldWdpYXQgbGFjdXMuIE51bGxhIGZhY2lsaXNpLiBOdW5jIGFjIGxvcmVtIGlkIHF1YW0gdmFyaXVzIGN1cnN1cyBhIGV0IGVsaXQuIEFlbmVhbiBwb3N1ZXJlIGxpYmVybyBldSB0b3J0b3IgdmVoaWN1bGEgdXQgdWxsYW1jb3JwZXIgb2RpbyBjb25zZXF1YXQuIFNlZCBpbiBkaWduaXNzaW0gZHVpLiBDdXJhYml0dXIgaWFjdWxpcyB0ZW1wb3IgcXVhbSBuZWMgcGxhY2VyYXQuIEFsaXF1YW0gdmVuZW5hdGlzIG5pYmggZXQganVzdG8gaWFjdWxpcyBsYWNpbmlhLiBQZWxsZW50ZXNxdWUgaGFiaXRhbnQgbW9yYmkgdHJpc3RpcXVlIHNlbmVjdHVzIGV0IG5ldHVzIGV0IG1hbGVzdWFkYSBmYW1lcyBhYyB0dXJwaXMgZWdlc3Rhcy4gTG9yZW0gaXB
 zdW0gZG9sb3Igc2l0IGFtZXQsIGNvbnNlY3RldHVyIGFkaXBpc2NpbmcgZWxpdC4gUGVsbGVudGVzcXVlIHRlbXB1cyBtYWduYSBzZWQgbWkgYWxpcXVldCBlZ2V0IHZhcml1cyBvZGlvIGNvbmd1ZS4KCkludGVnZXIgc2VtIHNlbSwgc2VtcGVyIGluIHZlc3RpYnVsdW0gdml0YWUsIGxvYm9ydGlzIHF1aXMgZXJhdC4gRHVpcyBhbnRlIGxlY3R1cywgZmVybWVudHVtIHNlZCB0ZW1wb3Igc2l0IGFtZXQsIHBsYWNlcmF0IHNpdCBhbWV0IHNlbS4gTWF1cmlzIGNvbmd1ZSB0aW5jaWR1bnQgaXBzdW0uIFV0IHZpdmVycmEsIGxhY3VzIHZlbCB2YXJpdXMgcGhhcmV0cmEsIHB1cnVzIGVuaW0gcHVsdmluYXIgaXBzdW0sIG5vbiBwZWxsZW50ZXNxdWUgZW5pbSBqdXN0byBub24gZXJhdC4gRnVzY2UgaXBzdW0gb3JjaSwgdWx0cmljZXMgc2VkIHBlbGxlbnRlc3F1ZSBhdCwgaGVuZHJlcml0IGxhb3JlZXQgZW5pbS4gTnVuYyBibGFuZGl0IG1vbGxpcyBwcmV0aXVtLiBVdCBtb2xsaXMsIG51bGxhIGFsaXF1YW0gc29kYWxlcyB2ZXN0aWJ1bHVtLCBsaWJlcm8gbG9yZW0gdGVtcHVzIHRvcnRvciwgYSBwZWxsZW50ZXNxdWUgbmliaCBlbGl0IGEgaXBzdW0uIFBoYXNlbGx1cyBmZXJtZW50dW0gbGlndWxhIGF0IG5lcXVlIGFkaXBpc2Npbmcgc29sbGljaXR1ZGluLiBTdXNwZW5kaXNzZSBpZCBpcHN1bSBhcmN1LiBTZWQgdGluY2lkdW50IHBsYWNlcmF0IHZpdmVycmEuIERvbmVjIGxpYmVybyBhdWd1ZSwgcG9ydHRpdG9yIHNp
 dCBhbWV0IHZhcml1cyBlZ2V0LCBydXRydW0gbmVjIGxhY3VzLiBQcm9pbiBibGFuZGl0IG9yY2kgc2l0IGFtZXQgZGlhbSBkaWN0dW0gaWQgcG9ydHRpdG9yIHJpc3VzIGlhY3VsaXMuIEludGVnZXIgbGFjaW5pYSBmZXVnaWF0IGxlbywgdml0YWUgYXVjdG9yIHR1cnBpcyBlbGVpZmVuZCB2ZWwuIFN1c3BlbmRpc3NlIGxvcmVtIHF1YW0sIHByZXRpdW0gaWQgYmliZW5kdW0gc2VkLCB2aXZlcnJhIHZpdGFlIHRvcnRvci4gTnVsbGFtIHVsdHJpY2llcyBsaWJlcm8gZXUgcmlzdXMgY29udmFsbGlzIGVnZXQgdWxsYW1jb3JwZXIgbmlzaSBlbGVtZW50dW0uIE1hdXJpcyBudWxsYSBlbGl0LCBiaWJlbmR1bSBpZCB2dWxwdXRhdGUgdml0YWUsIGltcGVyZGlldCBydXRydW0gbG9yZW0uIEN1cmFiaXR1ciBlZ2V0IGRpZ25pc3NpbSBvcmNpLiBTZWQgc2VtcGVyIHRlbGx1cyBpcHN1bSwgYXQgYmxhbmRpdCBkdWkuIEludGVnZXIgZGFwaWJ1cyBmYWNpbGlzaXMgc29kYWxlcy4gVml2YW11cyBzb2xsaWNpdHVkaW4gdmFyaXVzIGVzdCwgcXVpcyBvcm5hcmUganVzdG8gY3Vyc3VzIGlkLgoKTnVuYyB2ZWwgdWxsYW1jb3JwZXIgbWkuIFN1c3BlbmRpc3NlIHBvdGVudGkuIE51bmMgZXQgdXJuYSBhIGF1Z3VlIHNjZWxlcmlzcXVlIHVsdHJpY2VzIG5vbiBxdWlzIG1pLiBJbiBxdWlzIHBvcnR0aXRvciBlbGl0LiBBZW5lYW4gcXVpcyBlcmF0IG51bGxhLCBhIHZlbmVuYXRpcyB0ZWxsdXMuIEZ1c2NlIHZlc3RpYnVsdW0gbmlza
 SBzZWQgbGVvIGFkaXBpc2NpbmcgZGlnbmlzc2ltLiBOdW5jIGludGVyZHVtLCBsb3JlbSBldCBsYWNpbmlhIHZlc3RpYnVsdW0sIHF1YW0gZXN0IG1hdHRpcyBtYWduYSwgc2l0IGFtZXQgdm9sdXRwYXQgZWxpdCBhdWd1ZSBhdCBsaWJlcm8uIENyYXMgZ3JhdmlkYSBkdWkgcXVpcyB2ZWxpdCBsb2JvcnRpcyBjb25kaW1lbnR1bSBldCBlbGVpZmVuZCBsaWd1bGEuIFBoYXNlbGx1cyBhYyBtZXR1cyBxdWFtLCBpZCB2ZW5lbmF0aXMgbWkuIEFsaXF1YW0gdXQgdHVycGlzIGFjIHRlbGx1cyBkYXBpYnVzIGRhcGlidXMgZXUgaW4gbWkuIFF1aXNxdWUgZWdldCBuaWJoIGVyb3MuIEZ1c2NlIGNvbnNlY3RldHVyIGxlbyB2ZWxpdC4KClZlc3RpYnVsdW0gc2VtcGVyIGVnZXN0YXMgbWF1cmlzLiBNb3JiaSB2ZXN0aWJ1bHVtIHNlbSBzZW0uIEFsaXF1YW0gdmVuZW5hdGlzLCBmZWxpcyBzZWQgZWxlaWZlbmQgcG9ydGEsIG1hdXJpcyBkaWFtIHNlbXBlciBhcmN1LCBzaXQgYW1ldCB1bHRyaWNpZXMgZXN0IHNhcGllbiBzaXQgYW1ldCBsaWJlcm8uIFZlc3RpYnVsdW0gZHVpIG9yY2ksIG9ybmFyZSBjb25kaW1lbnR1bSBtb2xsaXMgbmVjLCBtb2xlc3RpZSBhYyBlcm9zLiBQcm9pbiB2aXRhZSBtb2xsaXMgdmVsaXQuIFByYWVzZW50IGVnZXQgZmVsaXMgbWkuIE1hZWNlbmFzIGV1IHZ1bHB1dGF0ZSBuaXNpLiBWZXN0aWJ1bHVtIHZhcml1cywgYXJjdSBpbiB1bHRyaWNpZXMgdmVzdGlidWx1bSwgbmliaCBsZW8gc2FnaXR0aX
 Mgb2RpbywgdXQgYmliZW5kdW0gbmlzbCBtaSBuZWMgZGlhbS4gSW50ZWdlciBhdCBlbmltIGZldWdpYXQgbnVsbGEgc2VtcGVyIGJpYmVuZHVtIHV0IGEgdmVsaXQuIFByb2luIGF0IG5pc2kgdXQgbG9yZW0gYWxpcXVhbSB2YXJpdXMgZWdldCBxdWlzIGVsaXQuIE51bGxhbSBuZWMgb2RpbyB2ZWwgbGVjdHVzIGNvbmd1ZSBjb25zZXF1YXQgYWRpcGlzY2luZyBhYyBtaS4gRnVzY2Ugdml0YWUgbGFvcmVldCBsaWJlcm8uIEN1cmFiaXR1ciBzaXQgYW1ldCBzZW0gbmVxdWUsIG5lYyBwb3N1ZXJlIGVuaW0uIEN1cmFiaXR1ciBhdCBtYXNzYSBhIHNlbSBncmF2aWRhIGlhY3VsaXMgbmVjIGV0IG5pYmguIFNlZCB2aXRhZSBkdWkgdml0YWUgbGVvIHRpbmNpZHVudCBwcmV0aXVtIGEgYWxpcXVhbSBlcmF0LiBTdXNwZW5kaXNzZSB1bHRyaWNpZXMgb2RpbyBhdCBtZXR1cyB0ZW1wb3IgaW4gcGVsbGVudGVzcXVlIGFyY3UgdWx0cmljaWVzLgoKU2VkIGFsaXF1YW0gbWF0dGlzIHF1YW0sIGluIHZ1bHB1dGF0ZSBzYXBpZW4gdWx0cmljZXMgaW4uIFBlbGxlbnRlc3F1ZSBxdWlzIHZlbGl0IHNlZCBkdWkgaGVuZHJlcml0IGN1cnN1cy4gUGVsbGVudGVzcXVlIG5vbiBudW5jIGxhY3VzLCBhIHNlbXBlciBtZXR1cy4gRnVzY2UgZXVpc21vZCB2ZWxpdCBxdWlzIGRpYW0gc3VzY2lwaXQgY29uc2VxdWF0LiBQcmFlc2VudCBjb21tb2RvIGFjY3Vtc2FuIG5lcXVlLiBQcm9pbiB2aXZlcnJhLCBpcHN1bSBub24gdHJpc3RpcXVlIHV
 sdHJpY2VzLCB2ZWxpdCB2ZWxpdCBmYWNpbGlzaXMgbG9yZW0sIHZlbCBydXRydW0gbmVxdWUgZXJvcyBhYyBuaXNpLiBTdXNwZW5kaXNzZSBmZWxpcyBtYXNzYSwgZmF1Y2lidXMgaW4gdm9sdXRwYXQgYWMsIGRhcGlidXMgZXQgb2Rpby4gUGVsbGVudGVzcXVlIGlkIHRlbGx1cyBzaXQgYW1ldCByaXN1cyB1bHRyaWNpZXMgdWxsYW1jb3JwZXIgbm9uIG5lYyBzYXBpZW4uIE5hbSBwbGFjZXJhdCB2aXZlcnJhIHVsbGFtY29ycGVyLiBOYW0gcGxhY2VyYXQgcG9ydHRpdG9yIHNhcGllbiBuZWMgcHVsdmluYXIuIEN1cmFiaXR1ciB2ZWwgb2RpbyBzaXQgYW1ldCBvZGlvIGFjY3Vtc2FuIGFsaXF1ZXQgdml0YWUgYSBsZWN0dXMuIFBlbGxlbnRlc3F1ZSBsb2JvcnRpcyB2aXZlcnJhIGNvbnNlcXVhdC4gTWF1cmlzIGVsZW1lbnR1bSBjdXJzdXMgbnVsbGEsIHNpdCBhbWV0IGhlbmRyZXJpdCBqdXN0byBkaWN0dW0gc2VkLiBNYWVjZW5hcyBkaWFtIG9kaW8sIGZyaW5naWxsYSBhYyBjb25ndWUgcXVpcywgYWRpcGlzY2luZyB1dCBlbGl0LgoKQWxpcXVhbSBsb3JlbSBlcm9zLCBwaGFyZXRyYSBuZWMgZWdlc3RhcyB2aXRhZSwgbWF0dGlzIG5lYyByaXN1cy4gTWF1cmlzIGFyY3UgbWFzc2EsIHNvZGFsZXMgZWdldCBncmF2aWRhIHNlZCwgdml2ZXJyYSB2aXRhZSB0dXJwaXMuIFV0IGxpZ3VsYSB1cm5hLCBldWlzbW9kIGFjIHRpbmNpZHVudCBldSwgZmF1Y2lidXMgc2VkIGZlbGlzLiBQcmFlc2VudCBtb2xsaXMsIGlwc3Vt
 IHF1aXMgcmhvbmN1cyBkaWduaXNzaW0sIG9kaW8gc2VtIHZlbmVuYXRpcyBudWxsYSwgYXQgY29uc2VxdWF0IGZlbGlzIGF1Z3VlIHZlbCBlcmF0LiBOYW0gZmVybWVudHVtIGZldWdpYXQgdm9sdXRwYXQuIENsYXNzIGFwdGVudCB0YWNpdGkgc29jaW9zcXUgYWQgbGl0b3JhIHRvcnF1ZW50IHBlciBjb251YmlhIG5vc3RyYSwgcGVyIGluY2VwdG9zIGhpbWVuYWVvcy4gRXRpYW0gdml0YWUgZHVpIGluIG5pc2kgYWRpcGlzY2luZyB1bHRyaWNpZXMgbm9uIGV1IGp1c3RvLiBEb25lYyB0cmlzdGlxdWUgdWx0cmljaWVzIGFkaXBpc2NpbmcuIE51bGxhIHNvZGFsZXMsIG51bmMgYSB0cmlzdGlxdWUgZWxlbWVudHVtLCBlcmF0IG5lcXVlIGVnZXN0YXMgbmlzbCwgYXQgaGVuZHJlcml0IG9yY2kgc2FwaWVuIHNlZCBsaWJlcm8uIFZpdmFtdXMgYSBtYXVyaXMgdHVycGlzLCBxdWlzIGxhb3JlZXQgaXBzdW0uIE51bmMgbmVjIG1pIGV0IG5pc2wgcGVsbGVudGVzcXVlIHNjZWxlcmlzcXVlLiBWaXZhbXVzIHZvbHV0cGF0LCBqdXN0byB0cmlzdGlxdWUgbGFjaW5pYSBjb25kaW1lbnR1bSwgZXJhdCBqdXN0byB1bHRyaWNlcyB1cm5hLCBlbGVtZW50dW0gdml2ZXJyYSBlcm9zIGF1Z3VlIG5vbiBsaWJlcm8uIFNlZCBtb2xsaXMgbW9sbGlzIGFyY3UsIGF0IGZlcm1lbnR1bSBkaWFtIHN1c2NpcGl0IHF1aXMuCgpFdGlhbSBzaXQgYW1ldCBuaWJoIGp1c3RvLCBwb3N1ZXJlIHZvbHV0cGF0IG51bmMuIE1vcmJpIHBlbGxlbnRlc
 3F1ZSBuZXF1ZSBpbiBvcmNpIHZvbHV0cGF0IGV1IHNjZWxlcmlzcXVlIGxvcmVtIGRpY3R1bS4gTWF1cmlzIG1vbGxpcyBpYWN1bGlzIGVzdCwgbmVjIHNhZ2l0dGlzIHNhcGllbiBjb25zZXF1YXQgaWQuIE51bmMgbmVjIG1hbGVzdWFkYSBvZGlvLiBEdWlzIHF1aXMgc3VzY2lwaXQgb2Rpby4gTWF1cmlzIHB1cnVzIGR1aSwgc29kYWxlcyBpZCBtYXR0aXMgc2l0IGFtZXQsIHBvc3VlcmUgaW4gYXJjdS4gUGhhc2VsbHVzIHBvcnRhIGVsZW1lbnR1bSBjb252YWxsaXMuIE1hZWNlbmFzIGF0IG9yY2kgZXQgbWkgdnVscHV0YXRlIHNvbGxpY2l0dWRpbiBpbiBpbiB0dXJwaXMuIFBlbGxlbnRlc3F1ZSBjdXJzdXMgYWRpcGlzY2luZyBuZXF1ZSBzaXQgYW1ldCBjb21tb2RvLiBGdXNjZSB1dCBtaSBldSBsZWN0dXMgcG9ydHRpdG9yIHZvbHV0cGF0IGV0IG5lYyBmZWxpcy4KCkN1cmFiaXR1ciBzY2VsZXJpc3F1ZSBlcm9zIHF1aXMgbmlzbCB2aXZlcnJhIHZlbCB1bHRyaWNlcyB2ZWxpdCB2ZXN0aWJ1bHVtLiBTZWQgbG9ib3J0aXMgcHVsdmluYXIgc2FwaWVuIGFjIHZlbmVuYXRpcy4gU2VkIGFudGUgbmliaCwgcmhvbmN1cyBlZ2V0IGRpY3R1bSBpbiwgbW9sbGlzIHV0IG5pc2kuIFBoYXNlbGx1cyBmYWNpbGlzaXMgbWkgbm9uIGxvcmVtIHRyaXN0aXF1ZSBub24gZWxlaWZlbmQgc2VtIGZyaW5naWxsYS4gSW50ZWdlciB1dCBhdWd1ZSBlc3QuIEluIHZlbmVuYXRpcyB0aW5jaWR1bnQgc2NlbGVyaXNxdWUuIEV0aWFtIG
 FudGUgZHVpLCBwb3N1ZXJlIHF1aXMgbWFsZXN1YWRhIHZpdGFlLCBtYWxlc3VhZGEgYSBhcmN1LiBBZW5lYW4gZmF1Y2lidXMgdmVuZW5hdGlzIHNhcGllbiwgdXQgZmFjaWxpc2lzIG5pc2kgYmxhbmRpdCB2ZWwuIEFlbmVhbiBhYyBsb3JlbSBldSBzZW0gZmVybWVudHVtIHBsYWNlcmF0LiBQcm9pbiBuZXF1ZSBwdXJ1cywgYWxpcXVldCB1dCB0aW5jaWR1bnQgdXQsIGNvbnZhbGxpcyBzaXQgYW1ldCBlcm9zLiBQaGFzZWxsdXMgdmVoaWN1bGEgdWxsYW1jb3JwZXIgZW5pbSBub24gdmVoaWN1bGEuIEV0aWFtIHBvcnRhIG9kaW8gdXQgaXBzdW0gYWRpcGlzY2luZyBlZ2VzdGFzIGlkIGEgb2Rpby4gUGVsbGVudGVzcXVlIGJsYW5kaXQsIHNhcGllbiB1dCBwdWx2aW5hciBpbnRlcmR1bSwgbWkgbnVsbGEgaGVuZHJlcml0IGVsaXQsIGluIHRlbXBvciBkaWFtIGVuaW0gYSB1cm5hLiBJbiB0ZWxsdXMgb2Rpbywgb3JuYXJlIHNlZCBjb25kaW1lbnR1bSBhLCBtYXR0aXMgZXUgYXVndWUuCgpGdXNjZSBoZW5kcmVyaXQgcG9ydHRpdG9yIGV1aXNtb2QuIERvbmVjIG1hbGVzdWFkYSBlZ2VzdGFzIHR1cnBpcywgZXQgdWx0cmljaWVzIGZlbGlzIGVsZW1lbnR1bSB2aXRhZS4gTnVsbGFtIGluIHNlbSBuaWJoLiBOdWxsYW0gdWx0cmljaWVzIGhlbmRyZXJpdCBqdXN0byBzaXQgYW1ldCBsb2JvcnRpcy4gU2VkIHRpbmNpZHVudCwgbWF1cmlzIGF0IG9ybmFyZSBsYW9yZWV0LCBzYXBpZW4gcHVydXMgZWxlbWVudHVtIGVsaXQ
 sIG5lYyBwb3J0dGl0b3IgbmlzbCBwdXJ1cyBldCBlcmF0LiBEb25lYyBmZWxpcyBuaXNpLCBydXRydW0gdWxsYW1jb3JwZXIgZ3JhdmlkYSBhYywgdGluY2lkdW50IHNpdCBhbWV0IHVybmEuIFByb2luIHZlbCBqdXN0byB2aXRhZSBlcm9zIHNhZ2l0dGlzIGJpYmVuZHVtIGEgdXQgbmliaC4gUGhhc2VsbHVzIHNvZGFsZXMgbGFvcmVldCB0aW5jaWR1bnQuIE1hZWNlbmFzIG9kaW8gbWFzc2EsIGNvbmRpbWVudHVtIGlkIGFsaXF1ZXQgdXQsIHJob25jdXMgdmVsIGxlY3R1cy4gRHVpcyBwaGFyZXRyYSBjb25zZWN0ZXR1ciBzYXBpZW4uIFBoYXNlbGx1cyBwb3N1ZXJlIHVsdHJpY2llcyBtYXNzYSwgbm9uIHJob25jdXMgcmlzdXMgYWxpcXVhbSB0ZW1wdXMuCgpQcmFlc2VudCB2ZW5lbmF0aXMgbWFnbmEgaWQgc2VtIGRpY3R1bSBldSB2ZWhpY3VsYSBpcHN1bSB2dWxwdXRhdGUuIFNlZCBhIGNvbnZhbGxpcyBzYXBpZW4uIFNlZCBqdXN0byBkb2xvciwgcmhvbmN1cyB2ZWwgcnV0cnVtIG1hdHRpcywgc29sbGljaXR1ZGluIHV0IHJpc3VzLiBOdWxsYW0gc2l0IGFtZXQgY29udmFsbGlzIGVzdC4gRXRpYW0gbm9uIHRpbmNpZHVudCBsaWd1bGEuIEZ1c2NlIHN1c2NpcGl0IHByZXRpdW0gZWxpdCBhdCB1bGxhbWNvcnBlci4gUXVpc3F1ZSBzb2xsaWNpdHVkaW4sIGRpYW0gaWQgaW50ZXJkdW0gcG9ydGEsIG1ldHVzIGlwc3VtIHZvbHV0cGF0IGxpYmVybywgaWQgdmVuZW5hdGlzIGZlbGlzIG9yY2kgbm9uIHZlbGl0LiBT
 dXNwZW5kaXNzZSBwb3RlbnRpLiBNYXVyaXMgcnV0cnVtLCB0b3J0b3Igc2l0IGFtZXQgcGVsbGVudGVzcXVlIHRpbmNpZHVudCwgZXJhdCBxdWFtIHVsdHJpY2llcyBvZGlvLCBpZCBhbGlxdWFtIGVsaXQgbGVvIG5lYyBsZW8uIFBlbGxlbnRlc3F1ZSBqdXN0byBlcm9zLCBydXRydW0gYXQgZmV1Z2lhdCBuZWMsIHBvcnRhIGV0IHRlbGx1cy4gQWVuZWFuIGVnZXQgbWV0dXMgbGVjdHVzLgoKUHJhZXNlbnQgZXVpc21vZCwgdHVycGlzIHF1aXMgbGFvcmVldCBjb25zZXF1YXQsIG5lcXVlIGFudGUgaW1wZXJkaWV0IHF1YW0sIGFjIHNlbXBlciB0b3J0b3IgbmliaCBpbiBudWxsYS4gSW50ZWdlciBzY2VsZXJpc3F1ZSBlcm9zIHZlaGljdWxhIHVybmEgbGFjaW5pYSBhYyBmYWNpbGlzaXMgbWF1cmlzIGFjY3Vtc2FuLiBQaGFzZWxsdXMgYXQgbWF1cmlzIG5pYmguIEN1cmFiaXR1ciBlbmltIGFudGUsIHJ1dHJ1bSBzZWQgYWRpcGlzY2luZyBoZW5kcmVyaXQsIHBlbGxlbnRlc3F1ZSBub24gYXVndWUuIEluIGhhYyBoYWJpdGFzc2UgcGxhdGVhIGRpY3R1bXN0LiBOYW0gdGVtcHVzIGV1aXNtb2QgbWFzc2EgYSBkaWN0dW0uIERvbmVjIHNpdCBhbWV0IGp1c3RvIGFjIGRpYW0gdWx0cmljaWVzIHVsdHJpY2llcy4gU2VkIHRpbmNpZHVudCBlcmF0IHF1aXMgcXVhbSB0ZW1wdXMgdmVsIGludGVyZHVtIGVyYXQgcmhvbmN1cy4gSW4gaGFjIGhhYml0YXNzZSBwbGF0ZWEgZGljdHVtc3QuIFZlc3RpYnVsdW0gdmVoaWN1bGEgd
 mFyaXVzIHNlbSBlZ2V0IGludGVyZHVtLiBDcmFzIGJpYmVuZHVtIGxlbyBuZWMgZmVsaXMgdmVuZW5hdGlzIHNlZCBwaGFyZXRyYSBzZW0gZmV1Z2lhdC4gQ3VtIHNvY2lpcyBuYXRvcXVlIHBlbmF0aWJ1cyBldCBtYWduaXMgZGlzIHBhcnR1cmllbnQgbW9udGVzLCBuYXNjZXR1ciByaWRpY3VsdXMgbXVzLiBTZWQgcXVhbSBvcmNpLCBtb2xsaXMgZWdldCBzYWdpdHRpcyBhY2N1bXNhbiwgdnVscHV0YXRlIHNpdCBhbWV0IGR1aS4gUHJhZXNlbnQgZXUgZWxlbWVudHVtIGFyY3UuCgpMb3JlbSBpcHN1bSBkb2xvciBzaXQgYW1ldCwgY29uc2VjdGV0dXIgYWRpcGlzY2luZyBlbGl0LiBWZXN0aWJ1bHVtIG5pc2wgbWV0dXMsIGhlbmRyZXJpdCB1dCBsYW9yZWV0IHNlZCwgY29uc2VjdGV0dXIgYXQgcHVydXMuIER1aXMgaW50ZXJkdW0gY29uZ3VlIGxvYm9ydGlzLiBOdWxsYW0gc2VkIG1hc3NhIHBvcnRhIGZlbGlzIGVsZWlmZW5kIGNvbnNlcXVhdCBzaXQgYW1ldCBuZWMgbWV0dXMuIEFsaXF1YW0gcGxhY2VyYXQgZGljdHVtIGVyYXQgYXQgZWxlaWZlbmQuIFZlc3RpYnVsdW0gbGliZXJvIGFudGUsIHVsbGFtY29ycGVyIGEgcG9ydHRpdG9yIHN1c2NpcGl0LCBhY2N1bXNhbiB2ZWwgbmlzaS4gRG9uZWMgZXQgbWFnbmEgbmVxdWUuIE5hbSBlbGVtZW50dW0gdWx0cmljZXMganVzdG8sIGVnZXQgc29sbGljaXR1ZGluIHNhcGllbiBpbXBlcmRpZXQgZWdldC4gTnVsbGFtIGF1Y3RvciBkaWN0dW0gbnVuYywgYXQgZmV1Z2
 lhdCBvZGlvIHZlc3RpYnVsdW0gYS4gU2VkIGVyYXQgbnVsbGEsIHZpdmVycmEgaGVuZHJlcml0IGNvbW1vZG8gaWQsIHVsbGFtY29ycGVyIGFjIG9yY2kuIFBoYXNlbGx1cyBwZWxsZW50ZXNxdWUgZmV1Z2lhdCBzdXNjaXBpdC4gRXRpYW0gZWdlc3RhcyBmZXJtZW50dW0gZW5pbS4gRXRpYW0gZ3JhdmlkYSBpbnRlcmR1bSB0ZWxsdXMgYWMgbGFvcmVldC4gTW9yYmkgbWF0dGlzIGFsaXF1ZXQgZXJvcywgbm9uIHRlbXBvciBlcmF0IHVsbGFtY29ycGVyIGluLiBFdGlhbSBwdWx2aW5hciBpbnRlcmR1bSB0dXJwaXMgYWMgdmVoaWN1bGEuIFNlZCBxdWFtIGp1c3RvLCBhY2N1bXNhbiBpZCBjb25zZWN0ZXR1ciBhLCBhbGlxdWV0IHNlZCBsZW8uIEFlbmVhbiB2aXRhZSBibGFuZGl0IG1hdXJpcy4KCkluIHNlZCBlcm9zIGF1Z3VlLCBub24gcnV0cnVtIG9kaW8uIEV0aWFtIHZpdGFlIGR1aSBuZXF1ZSwgaW4gdHJpc3RpcXVlIG1hc3NhLiBWZXN0aWJ1bHVtIGFudGUgaXBzdW0gcHJpbWlzIGluIGZhdWNpYnVzIG9yY2kgbHVjdHVzIGV0IHVsdHJpY2VzIHBvc3VlcmUgY3ViaWxpYSBDdXJhZTsgTWFlY2VuYXMgZGljdHVtIGVsaXQgYXQgbGVjdHVzIHRlbXBvciBub24gcGhhcmV0cmEgbmlzbCBoZW5kcmVyaXQuIFNlZCBzZWQgcXVhbSBldSBsZWN0dXMgdWx0cmljZXMgbWFsZXN1YWRhIHRpbmNpZHVudCBhIGVzdC4gTmFtIHZlbCBlcm9zIHJpc3VzLiBNYWVjZW5hcyBlcm9zIGVsaXQsIGJsYW5kaXQgZmVybWVudHVtIHR
 lbXBvciBlZ2V0LCBsb2JvcnRpcyBpZCBkaWFtLiBWZXN0aWJ1bHVtIGxhY2luaWEgbGFjdXMgdml0YWUgbWFnbmEgdm9sdXRwYXQgZXUgZGlnbmlzc2ltIGVyb3MgY29udmFsbGlzLiBWaXZhbXVzIGFjIHZlbGl0IHRlbGx1cywgYSBjb25ndWUgbmVxdWUuIEludGVnZXIgbWkgbnVsbGEsIHZhcml1cyBub24gbHVjdHVzIGluLCBkaWN0dW0gc2l0IGFtZXQgc2VtLiBVdCBsYW9yZWV0LCBzYXBpZW4gc2l0IGFtZXQgc2NlbGVyaXNxdWUgcG9ydGEsIHB1cnVzIHNhcGllbiB2ZXN0aWJ1bHVtIG5pYmgsIHNlZCBsdWN0dXMgbGliZXJvIG1hc3NhIGFjIGVsaXQuIERvbmVjIGlhY3VsaXMgb2RpbyBlZ2V0IG9kaW8gc2FnaXR0aXMgbmVjIHZlbmVuYXRpcyBsb3JlbSBibGFuZGl0LgoKQWxpcXVhbSBpbXBlcmRpZXQgdGVsbHVzIHBvc3VlcmUganVzdG8gdmVoaWN1bGEgc2VkIHZlc3RpYnVsdW0gYW50ZSB0cmlzdGlxdWUuIEZ1c2NlIGZldWdpYXQgZmF1Y2lidXMgcHVydXMgbmVjIG1vbGVzdGllLiBOdWxsYSB0ZW1wb3IgbmVxdWUgaWQgbWFnbmEgaWFjdWxpcyBxdWlzIHNvbGxpY2l0dWRpbiBlcm9zIHNlbXBlci4gUHJhZXNlbnQgdml2ZXJyYSBzYWdpdHRpcyBsdWN0dXMuIE1vcmJpIHNpdCBhbWV0IG1hZ25hIHNlZCBvZGlvIGdyYXZpZGEgdmFyaXVzLiBVdCBuaXNpIGxpYmVybywgdnVscHV0YXRlIGZldWdpYXQgcHJldGl1bSB0ZW1wdXMsIGVnZXN0YXMgc2l0IGFtZXQganVzdG8uIFBlbGxlbnRlc3F1ZSBjb25zZXF1
 YXQgdGVtcG9yIG5pc2kgaW4gbG9ib3J0aXMuIFNlZCBmZXJtZW50dW0gY29udmFsbGlzIGR1aSBhYyBzb2xsaWNpdHVkaW4uIEludGVnZXIgYXVjdG9yIGF1Z3VlIGVnZXQgdGVsbHVzIHRlbXB1cyBmcmluZ2lsbGEuIFByb2luIG5lYyBkb2xvciBzYXBpZW4sIG5lYyB0cmlzdGlxdWUgbmliaC4gQWxpcXVhbSBhIHZlbGl0IGF0IG1pIG1hdHRpcyBhbGlxdWV0LgoKUGVsbGVudGVzcXVlIGhhYml0YW50IG1vcmJpIHRyaXN0aXF1ZSBzZW5lY3R1cyBldCBuZXR1cyBldCBtYWxlc3VhZGEgZmFtZXMgYWMgdHVycGlzIGVnZXN0YXMuIEFsaXF1YW0gdWx0cmljZXMgZXJhdCBub24gdHVycGlzIGF1Y3RvciBpZCBvcm5hcmUgbWF1cmlzIHNhZ2l0dGlzLiBRdWlzcXVlIHBvcnR0aXRvciwgdGVsbHVzIHV0IGNvbnZhbGxpcyBzYWdpdHRpcywgbWkgbGliZXJvIGZldWdpYXQgdGVsbHVzLCByaG9uY3VzIHBsYWNlcmF0IGlwc3VtIHRvcnRvciBpZCByaXN1cy4gRG9uZWMgdGluY2lkdW50IGZldWdpYXQgbGVvLiBDcmFzIGlkIG1pIG5lcXVlLCBldSBtYWxlc3VhZGEgZXJvcy4gVXQgbW9sZXN0aWUgbWFnbmEgcXVpcyBsaWJlcm8gcGxhY2VyYXQgbWFsZXN1YWRhLiBBbGlxdWFtIGVyYXQgdm9sdXRwYXQuIEFsaXF1YW0gbm9uIG1hdXJpcyBsb3JlbSwgaW4gYWRpcGlzY2luZyBtZXR1cy4gRG9uZWMgZWdldCBpcHN1bSBpbiBlbGl0IGNvbW1vZG8gb3JuYXJlIGJpYmVuZHVtIGEgbmliaC4gVml2YW11cyBvZGlvIGVyYXQsIHBsY
 WNlcmF0IGFjIHZlc3RpYnVsdW0gZWdldCwgbWFsZXN1YWRhIHV0IG5pc2kuIEV0aWFtIHN1c2NpcGl0IHNvbGxpY2l0dWRpbiBsZW8gc2VtcGVyIHNvbGxpY2l0dWRpbi4gU2VkIHJob25jdXMgcmlzdXMgc2l0IGFtZXQgc2VtIGVsZWlmZW5kIGRpY3R1bSBwcmV0aXVtIHNhcGllbiBlZ2VzdGFzLiBOdWxsYSBhdCB1cm5hIG51bmMsIHZlbCBhbGlxdWV0IGxlby4gUHJhZXNlbnQgdWx0cmljaWVzLCBtaSBldSBwcmV0aXVtIGxvYm9ydGlzLCBlcmF0IG5pYmggZXVpc21vZCBsZW8sIHNpdCBhbWV0IGdyYXZpZGEgc2FwaWVuIGVyb3MgZXQgdHVycGlzLiBEb25lYyBsYWNpbmlhIHZlbmVuYXRpcyBsZWN0dXMsIG5vbiBsYWNpbmlhIG1pIGhlbmRyZXJpdCBzaXQgYW1ldC4gSW50ZWdlciBzZWQgZmVsaXMgdmVsIG9yY2kgYWxpcXVhbSBwdWx2aW5hci4gUGhhc2VsbHVzIGV0IHJpc3VzIGlkIGVyYXQgZXVpc21vZCB0aW5jaWR1bnQuIFNlZCBsdWN0dXMgdGVtcG9yIG5pc2ksIG5lYyB0ZW1wb3IgaXBzdW0gZWxlbWVudHVtIGVnZXQuIEludGVnZXIgbmlzbCB0b3J0b3IsIHZpdmVycmEgaW4gZGFwaWJ1cyBhdCwgbWF0dGlzIGFjIGVyYXQuIEN1cmFiaXR1ciBuZWMgZHVpIGxlY3R1cy4KClBoYXNlbGx1cyBzdXNjaXBpdCwgdG9ydG9yIGV1IHZhcml1cyBmcmluZ2lsbGEsIHNhcGllbiBtYWduYSBlZ2VzdGFzIHJpc3VzLCB1dCBzdXNjaXBpdCBkdWkgbWF1cmlzIHF1aXMgdmVsaXQuIENyYXMgYSBzYXBpZW4gcXVpcyBzYX
 BpZW4gaGVuZHJlcml0IHRyaXN0aXF1ZSBhIHNpdCBhbWV0IGVsaXQuIFBlbGxlbnRlc3F1ZSBkdWkgYXJjdSwgbWFsZXN1YWRhIGV0IHNvZGFsZXMgc2l0IGFtZXQsIGRhcGlidXMgdmVsIHF1YW0uIFNlZCBub24gYWRpcGlzY2luZyBsaWd1bGEuIFV0IHZ1bHB1dGF0ZSBwdXJ1cyBhdCBuaXNsIHBvc3VlcmUgc29kYWxlcy4gTWFlY2VuYXMgZGlhbSB2ZWxpdCwgdGluY2lkdW50IGlkIG1hdHRpcyBldSwgYWxpcXVhbSBhYyBuaXNpLiBNYWVjZW5hcyBwcmV0aXVtLCBhdWd1ZSBhIHNhZ2l0dGlzIHN1c2NpcGl0LCBsZW8gbGlndWxhIGVsZWlmZW5kIGRvbG9yLCBtb2xsaXMgZmV1Z2lhdCBvZGlvIGF1Z3VlIG5vbiBlcm9zLiBQZWxsZW50ZXNxdWUgc2NlbGVyaXNxdWUgb3JjaSBwcmV0aXVtIHF1YW0gbW9sbGlzIGF0IGxvYm9ydGlzIGR1aSBmYWNpbGlzaXMuIE1vcmJpIGNvbmd1ZSBtZXR1cyBpZCB0b3J0b3IgcG9ydGEgZnJpbmdpbGxhLiBTZWQgbG9yZW0gbWksIG1vbGVzdGllIGZlcm1lbnR1bSBzYWdpdHRpcyBhdCwgZ3JhdmlkYSBhIG5pc2kuIERvbmVjIGV1IHZlc3RpYnVsdW0gdmVsaXQuIEluIHZpdmVycmEsIGVuaW0gZXUgZWxlbWVudHVtIHNvZGFsZXMsIGVuaW0gb2RpbyBkYXBpYnVzIHVybmEsIGVnZXQgY29tbW9kbyBuaXNsIG1hdXJpcyB1dCBvZGlvLiBDdXJhYml0dXIgbmVjIGVuaW0gbnVsbGEuIEluIG5lYyBlbGl0IGlwc3VtLiBOdW5jIGluIG1hc3NhIHN1c2NpcGl0IG1hZ25hIGVsZW1lbnR1bSB
 mYXVjaWJ1cyBpbiBuZWMgaXBzdW0uIE51bGxhbSBzdXNjaXBpdCBtYWxlc3VhZGEgZWxlbWVudHVtLiBFdGlhbSBzZWQgbWkgaW4gbmliaCB1bHRyaWNpZXMgdmVuZW5hdGlzIG5lYyBwaGFyZXRyYSBtYWduYS4gSW4gcHVydXMgYW50ZSwgcmhvbmN1cyB2ZWwgcGxhY2VyYXQgc2VkLCBmZXJtZW50dW0gc2l0IGFtZXQgZHVpLiBTZWQgYXQgc29kYWxlcyB2ZWxpdC4KCkR1aXMgc3VzY2lwaXQgcGVsbGVudGVzcXVlIHBlbGxlbnRlc3F1ZS4gUHJhZXNlbnQgcG9ydGEgbG9ib3J0aXMgY3Vyc3VzLiBRdWlzcXVlIHNhZ2l0dGlzIHZlbGl0IG5vbiB0ZWxsdXMgYmliZW5kdW0gYXQgc29sbGljaXR1ZGluIGxhY3VzIGFsaXF1ZXQuIFNlZCBuaWJoIHJpc3VzLCBibGFuZGl0IGEgYWxpcXVldCBlZ2V0LCB2ZWhpY3VsYSBldCBlc3QuIFN1c3BlbmRpc3NlIGZhY2lsaXNpcyBiaWJlbmR1bSBhbGlxdWFtLiBGdXNjZSBjb25zZWN0ZXR1ciBjb252YWxsaXMgZXJhdCwgZWdldCBtb2xsaXMgZGlhbSBmZXJtZW50dW0gc29sbGljaXR1ZGluLiBRdWlzcXVlIHRpbmNpZHVudCBwb3J0dGl0b3IgcHJldGl1bS4gTnVsbGFtIGlkIG5pc2wgZXQgdXJuYSB2dWxwdXRhdGUgZGFwaWJ1cy4gRG9uZWMgcXVpcyBsb3JlbSB1cm5hLiBRdWlzcXVlIGlkIGp1c3RvIG5lYyBudW5jIGJsYW5kaXQgY29udmFsbGlzLiBOdW5jIHZvbHV0cGF0LCBtYXNzYSBzb2xsaWNpdHVkaW4gYWRpcGlzY2luZyB2ZXN0aWJ1bHVtLCBtYXNzYSB1cm5hIGNvbmd1
 ZSBsZWN0dXMsIHNpdCBhbWV0IHVsdHJpY2llcyBhdWd1ZSBvcmNpIGNvbnZhbGxpcyB0dXJwaXMuIE51bGxhIGF0IGxvcmVtIGVsaXQuIE51bmMgdHJpc3RpcXVlLCBxdWFtIGZhY2lsaXNpcyBjb21tb2RvIHBvcnR0aXRvciwgbGFjdXMgbGlndWxhIGFjY3Vtc2FuIG5pc2ksIGV0IGxhb3JlZXQganVzdG8gYW50ZSB2aXRhZSBlcm9zLiBDdXJhYml0dXIgc2VkIGF1Z3VlIGFyY3UuIFBoYXNlbGx1cyBwb3J0dGl0b3IgdmVzdGlidWx1bSBmZWxpcywgdXQgY29uc2VjdGV0dXIgYXJjdSB0ZW1wb3Igbm9uLiBJbiBqdXN0byByaXN1cywgc2VtcGVyIGV0IHN1c2NpcGl0IGlkLCB1bGxhbWNvcnBlciBhdCB1cm5hLiBRdWlzcXVlIHRpbmNpZHVudCwgdXJuYSBuZWMgYWxpcXVhbSB0cmlzdGlxdWUsIG5pYmggb2RpbyBmYXVjaWJ1cyBhdWd1ZSwgaW4gb3JuYXJlIGVuaW0gdHVycGlzIGFjY3Vtc2FuIGRvbG9yLiBQZWxsZW50ZXNxdWUgaGFiaXRhbnQgbW9yYmkgdHJpc3RpcXVlIHNlbmVjdHVzIGV0IG5ldHVzIGV0IG1hbGVzdWFkYSBmYW1lcyBhYyB0dXJwaXMgZWdlc3Rhcy4gU3VzcGVuZGlzc2Ugc29kYWxlcyB2YXJpdXMgdHVycGlzIGV1IGZlcm1lbnR1bS4KCk1vcmJpIHVsdHJpY2llcyBkaWFtIGVnZXQgbWFzc2EgcG9zdWVyZSBsb2JvcnRpcy4gQWxpcXVhbSB2b2x1dHBhdCBwZWxsZW50ZXNxdWUgZW5pbSBldSBwb3J0dGl0b3IuIERvbmVjIGxhY3VzIGZlbGlzLCBjb25zZWN0ZXR1ciBhIHByZXRpdW0gdml0YWUsI
 GJpYmVuZHVtIG5vbiBlbmltLiBQZWxsZW50ZXNxdWUgaGFiaXRhbnQgbW9yYmkgdHJpc3RpcXVlIHNlbmVjdHVzIGV0IG5ldHVzIGV0IG1hbGVzdWFkYSBmYW1lcyBhYyB0dXJwaXMgZWdlc3Rhcy4gRXRpYW0gdXQgbmliaCBhIHF1YW0gcGVsbGVudGVzcXVlIGF1Y3RvciB1dCBpZCB2ZWxpdC4gRHVpcyBsYWNpbmlhIGp1c3RvIGVnZXQgbWkgcGxhY2VyYXQgYmliZW5kdW0uIEN1bSBzb2NpaXMgbmF0b3F1ZSBwZW5hdGlidXMgZXQgbWFnbmlzIGRpcyBwYXJ0dXJpZW50IG1vbnRlcywgbmFzY2V0dXIgcmlkaWN1bHVzIG11cy4gRG9uZWMgdmVsaXQgdG9ydG9yLCB0ZW1wdXMgbmVjIHRyaXN0aXF1ZSBpZCwgYWxpcXVldCBzaXQgYW1ldCB0dXJwaXMuIFByYWVzZW50IGV0IG5lcXVlIG5lYyBtYWduYSBwb3J0YSBmcmluZ2lsbGEuIE1vcmJpIGlkIGVnZXN0YXMgZXJvcy4gRG9uZWMgc2VtcGVyIHRpbmNpZHVudCB1bGxhbWNvcnBlci4gUGhhc2VsbHVzIHRlbXB1cyBsYWNpbmlhIGhlbmRyZXJpdC4gUXVpc3F1ZSBmYXVjaWJ1cyBwcmV0aXVtIG5lcXVlIG5vbiBjb252YWxsaXMuIE51bmMgbWFsZXN1YWRhIGFjY3Vtc2FuIHJob25jdXMuIENyYXMgbG9ib3J0aXMsIHNlbSBzZWQgZnJpbmdpbGxhIGNvbnZhbGxpcywgYXVndWUgdmVsaXQgc2VtcGVyIG5pc2wsIGNvbW1vZG8gdmFyaXVzIG5pc2kgZGlhbSBhYyBsZW8uCgpRdWlzcXVlIGludGVyZHVtIHRlbGx1cyBhYyBhbnRlIHBvc3VlcmUgdXQgY3Vyc3VzIGxvcmVtIG
 VnZXN0YXMuIE51bGxhIGZhY2lsaXNpLiBBZW5lYW4gc2VkIG1hc3NhIG5lYyBuaXNpIHNjZWxlcmlzcXVlIHZ1bHB1dGF0ZS4gRXRpYW0gY29udmFsbGlzIGNvbnNlY3RldHVyIGlhY3VsaXMuIE1hZWNlbmFzIGFjIHB1cnVzIHV0IGFudGUgZGlnbmlzc2ltIGF1Y3RvciBhYyBxdWlzIGxvcmVtLiBQZWxsZW50ZXNxdWUgc3VzY2lwaXQgdGluY2lkdW50IG9yY2kuIEZ1c2NlIGFsaXF1YW0gZGFwaWJ1cyBvcmNpLCBhdCBiaWJlbmR1bSBpcHN1bSBhZGlwaXNjaW5nIGVnZXQuIE1vcmJpIHBlbGxlbnRlc3F1ZSBoZW5kcmVyaXQgcXVhbSwgbmVjIHBsYWNlcmF0IHVybmEgdnVscHV0YXRlIHNlZC4gUXVpc3F1ZSB2ZWwgZGlhbSBsb3JlbS4gUHJhZXNlbnQgaWQgZGlhbSBxdWlzIGVuaW0gZWxlbWVudHVtIHJob25jdXMgc2FnaXR0aXMgZWdldCBwdXJ1cy4gUXVpc3F1ZSBmcmluZ2lsbGEgYmliZW5kdW0gbGVvIGluIGxhb3JlZXQuIFZlc3RpYnVsdW0gaWQgbmliaCByaXN1cywgbm9uIGVsZW1lbnR1bSBtZXR1cy4gVXQgYSBmZWxpcyBkaWFtLCBub24gbW9sbGlzIG5pc2wuIENyYXMgZWxpdCBhbnRlLCB1bGxhbWNvcnBlciBxdWlzIGlhY3VsaXMgZXUsIHNvZGFsZXMgdmVsIGVzdC4gQ3VyYWJpdHVyIHF1aXMgbG9ib3J0aXMgZG9sb3IuIEFsaXF1YW0gbWF0dGlzIGdyYXZpZGEgbWV0dXMgcGVsbGVudGVzcXVlIHZ1bHB1dGF0ZS4KClV0IGlkIGF1Z3VlIGlkIGRvbG9yIGx1Y3R1cyBldWlzbW9kIGV0IHF1aXMgdmVsaXQ
 uIE1hZWNlbmFzIGVuaW0gZG9sb3IsIHRlbXB1cyBzaXQgYW1ldCBoZW5kcmVyaXQgZXUsIGZhdWNpYnVzIHZpdGFlIG5lcXVlLiBQcm9pbiBzaXQgYW1ldCB2YXJpdXMgZWxpdC4gUHJvaW4gdmFyaXVzIGZlbGlzIHVsbGFtY29ycGVyIHB1cnVzIGRpZ25pc3NpbSBjb25zZXF1YXQuIENyYXMgY3Vyc3VzIHRlbXB1cyBlcm9zLiBOdW5jIHVsdHJpY2VzIHZlbmVuYXRpcyB1bGxhbWNvcnBlci4gQWxpcXVhbSBldCBmZXVnaWF0IHRlbGx1cy4gUGhhc2VsbHVzIHNpdCBhbWV0IHZlc3RpYnVsdW0gZWxpdC4gUGhhc2VsbHVzIGFjIHB1cnVzIGxhY3VzLCBldCBhY2N1bXNhbiBlcm9zLiBNb3JiaSB1bHRyaWNlcywgcHVydXMgYSBwb3J0YSBzb2RhbGVzLCBvZGlvIG1ldHVzIHBvc3VlcmUgbmVxdWUsIG5lYyBlbGVtZW50dW0gcmlzdXMgdHVycGlzIHNpdCBhbWV0IG1hZ25hLiBTZWQgZXN0IHF1YW0sIHVsdHJpY2llcyBhdCBjb25ndWUgYWRpcGlzY2luZywgbG9ib3J0aXMgaW4ganVzdG8uIFByb2luIGlhY3VsaXMgZGljdHVtIG51bmMsIGV1IGxhb3JlZXQgcXVhbSB2YXJpdXMgdml0YWUuIERvbmVjIHNpdCBhbWV0IGZldWdpYXQgdHVycGlzLiBNYXVyaXMgc2l0IGFtZXQgbWFnbmEgcXVhbSwgYWMgY29uc2VjdGV0dXIgZHVpLiBDdXJhYml0dXIgZWdldCBtYWduYSB0ZWxsdXMsIGV1IHBoYXJldHJhIGZlbGlzLiBEb25lYyBzaXQgYW1ldCB0b3J0b3IgbmlzbC4gQWxpcXVhbSBldCB0b3J0b3IgZmFjaWxpc2lzIGxhY3Vz
 IHRpbmNpZHVudCBjb21tb2RvLiBQZWxsZW50ZXNxdWUgaGFiaXRhbnQgbW9yYmkgdHJpc3RpcXVlIHNlbmVjdHVzIGV0IG5ldHVzIGV0IG1hbGVzdWFkYSBmYW1lcyBhYyB0dXJwaXMgZWdlc3Rhcy4gQ3VyYWJpdHVyIG51bmMgbWFnbmEsIHVsdHJpY2llcyBpZCBjb252YWxsaXMgYXQsIHVsbGFtY29ycGVyIHZpdGFlIG1hc3NhLgoKUGhhc2VsbHVzIHZpdmVycmEgaWFjdWxpcyBwbGFjZXJhdC4gTnVsbGEgY29uc2VxdWF0IGRvbG9yIHNpdCBhbWV0IGVyYXQgZGlnbmlzc2ltIHBvc3VlcmUuIE51bGxhIGxhY2luaWEgYXVndWUgdml0YWUgbWkgdGVtcG9yIGdyYXZpZGEuIFBoYXNlbGx1cyBub24gdGVtcG9yIHRlbGx1cy4gUXVpc3F1ZSBub24gZW5pbSBzZW1wZXIgdG9ydG9yIHNhZ2l0dGlzIGZhY2lsaXNpcy4gQWxpcXVhbSB1cm5hIGZlbGlzLCBlZ2VzdGFzIGF0IHBvc3VlcmUgbmVjLCBhbGlxdWV0IGV1IG5pYmguIFByYWVzZW50IHNlZCB2ZXN0aWJ1bHVtIGVuaW0uIE1hdXJpcyBpYWN1bGlzIHZlbGl0IGR1aSwgZXQgZnJpbmdpbGxhIGVuaW0uIE51bGxhIG5lYyBuaXNpIG9yY2kuIFNlZCB2b2x1dHBhdCwganVzdG8gZWdldCBmcmluZ2lsbGEgYWRpcGlzY2luZywgbmlzbCBudWxsYSBjb25kaW1lbnR1bSBsaWJlcm8sIHNlZCBzb2RhbGVzIGVzdCBlc3QgZXQgb2Rpby4gQ3JhcyBpcHN1bSBkdWksIHZhcml1cyBldSBlbGVtZW50dW0gY29uc2VxdWF0LCBmYXVjaWJ1cyBpbiBsZW8uIFBlbGxlbnRlc3F1ZSBoY
 WJpdGFudCBtb3JiaSB0cmlzdGlxdWUgc2VuZWN0dXMgZXQgbmV0dXMgZXQgbWFsZXN1YWRhIGZhbWVzIGFjIHR1cnBpcyBlZ2VzdGFzLgoKVXQgbWFsZXN1YWRhIG1vbGVzdGllIGVsZWlmZW5kLiBDdXJhYml0dXIgaWQgZW5pbSBkdWksIGV1IHRpbmNpZHVudCBuaWJoLiBNYXVyaXMgc2l0IGFtZXQgYW50ZSBsZW8uIER1aXMgdHVycGlzIGlwc3VtLCBiaWJlbmR1bSBzZWQgbWF0dGlzIHNpdCBhbWV0LCBhY2N1bXNhbiBxdWlzIGRvbG9yLiBWZXN0aWJ1bHVtIGFudGUgaXBzdW0gcHJpbWlzIGluIGZhdWNpYnVzIG9yY2kgbHVjdHVzIGV0IHVsdHJpY2VzIHBvc3VlcmUgY3ViaWxpYSBDdXJhZTsgQWVuZWFuIGEgaW1wZXJkaWV0IG1ldHVzLiBRdWlzcXVlIHNvbGxpY2l0dWRpbiBmZWxpcyBpZCBuZXF1ZSB0ZW1wb3Igc2NlbGVyaXNxdWUuIERvbmVjIGF0IG9yY2kgZmVsaXMuIFZpdmFtdXMgdGVtcHVzIGNvbnZhbGxpcyBhdWN0b3IuIERvbmVjIGludGVyZHVtIGV1aXNtb2QgbG9ib3J0aXMuIFNlZCBhdCBsYWN1cyBuZWMgb2RpbyBkaWduaXNzaW0gbW9sbGlzLiBTZWQgc2FwaWVuIG9yY2ksIHBvcnR0aXRvciB0ZW1wdXMgYWNjdW1zYW4gdmVsLCB0aW5jaWR1bnQgbmVjIGFudGUuIE51bmMgcmhvbmN1cyBlZ2VzdGFzIGRhcGlidXMuIFN1c3BlbmRpc3NlIGZlcm1lbnR1bSBkaWN0dW0gZnJpbmdpbGxhLiBOdWxsYW0gbmlzaSBqdXN0bywgZWxlaWZlbmQgYSBjb25zZWN0ZXR1ciBjb252YWxsaXMsIHBvcnR0aXRvci
 BldCB0b3J0b3IuIFByb2luIHZpdGFlIGxvcmVtIG5vbiBkb2xvciBzdXNjaXBpdCBsYWNpbmlhIGV1IGVnZXQgbnVsbGEuCgpTdXNwZW5kaXNzZSBlZ2VzdGFzLCBzYXBpZW4gc2l0IGFtZXQgYmxhbmRpdCBzY2VsZXJpc3F1ZSwgbnVsbGEgYXJjdSB0cmlzdGlxdWUgZHVpLCBhIHBvcnRhIGp1c3RvIHF1YW0gdml0YWUgYXJjdS4gSW4gbWV0dXMgbGliZXJvLCBiaWJlbmR1bSBub24gdm9sdXRwYXQgdXQsIGxhb3JlZXQgdmVsIHR1cnBpcy4gTnVuYyBmYXVjaWJ1cyB2ZWxpdCBldSBpcHN1bSBjb21tb2RvIG5lYyBpYWN1bGlzIGVyb3Mgdm9sdXRwYXQuIFZpdmFtdXMgY29uZ3VlIGF1Y3RvciBlbGl0IHNlZCBzdXNjaXBpdC4gRHVpcyBjb21tb2RvLCBsaWJlcm8gZXUgdmVzdGlidWx1bSBmZXVnaWF0LCBsZW8gbWkgZGFwaWJ1cyB0ZWxsdXMsIGluIHBsYWNlcmF0IG5pc2wgZHVpIGF0IGVzdC4gVmVzdGlidWx1bSB2aXZlcnJhIHRyaXN0aXF1ZSBsb3JlbSwgb3JuYXJlIGVnZXN0YXMgZXJhdCBydXRydW0gYS4gTnVsbGFtIGF0IGF1Z3VlIG1hc3NhLCB1dCBjb25zZWN0ZXR1ciBpcHN1bS4gUGVsbGVudGVzcXVlIG1hbGVzdWFkYSwgdmVsaXQgdXQgbG9ib3J0aXMgc2FnaXR0aXMsIG5pc2kgbWFzc2Egc2VtcGVyIG9kaW8sIG1hbGVzdWFkYSBzZW1wZXIgcHVydXMgbmlzbCB2ZWwgbGVjdHVzLiBOdW5jIGR1aSBzZW0sIG1hdHRpcyB2aXRhZSBsYW9yZWV0IHZpdGFlLCBzb2xsaWNpdHVkaW4gYWMgbGVvLiBOdWxsYSB
 2ZWwgZmVybWVudHVtIGVzdC4KClZpdmFtdXMgaW4gb2RpbyBhIG5pc2kgZGlnbmlzc2ltIHJob25jdXMgaW4gaW4gbGFjdXMuIERvbmVjIGV0IG5pc2wgdG9ydG9yLiBEb25lYyBzYWdpdHRpcyBjb25zZXF1YXQgbWksIHZlbCBwbGFjZXJhdCB0ZWxsdXMgY29udmFsbGlzIGlkLiBBbGlxdWFtIGZhY2lsaXNpcyBydXRydW0gbmlzbCBzZWQgcHJldGl1bS4gRG9uZWMgZXQgbGFjaW5pYSBuaXNsLiBBbGlxdWFtIGVyYXQgdm9sdXRwYXQuIEN1cmFiaXR1ciBhYyBwdWx2aW5hciB0ZWxsdXMuIE51bGxhbSB2YXJpdXMgbG9ib3J0aXMgcG9ydGEuIENyYXMgZGFwaWJ1cywgbGlndWxhIHV0IHBvcnRhIHVsdHJpY2llcywgbGVvIGxhY3VzIHZpdmVycmEgcHVydXMsIHF1aXMgbW9sbGlzIHVybmEgcmlzdXMgZXUgbGVvLiBOdW5jIG1hbGVzdWFkYSBjb25zZWN0ZXR1ciBwdXJ1cywgdmVsIGF1Y3RvciBsZWN0dXMgc2NlbGVyaXNxdWUgcG9zdWVyZS4gTWFlY2VuYXMgZHVpIG1hc3NhLCB2ZXN0aWJ1bHVtIGJpYmVuZHVtIGJsYW5kaXQgbm9uLCBpbnRlcmR1bSBlZ2V0IG1hdXJpcy4gUGhhc2VsbHVzIGVzdCBhbnRlLCBwdWx2aW5hciBhdCBpbXBlcmRpZXQgcXVpcywgaW1wZXJkaWV0IHZlbCB1cm5hLiBRdWlzcXVlIGVnZXQgdm9sdXRwYXQgb3JjaS4gUXVpc3F1ZSBldCBhcmN1IHB1cnVzLCB1dCBmYXVjaWJ1cyB2ZWxpdC4KClByYWVzZW50IHNlZCBpcHN1bSB1cm5hLiBQcmFlc2VudCBzYWdpdHRpcyB2YXJpdXMgbWFnbmEs
 IGlkIGNvbW1vZG8gZG9sb3IgbWFsZXN1YWRhIGFjLiBQZWxsZW50ZXNxdWUgaGFiaXRhbnQgbW9yYmkgdHJpc3RpcXVlIHNlbmVjdHVzIGV0IG5ldHVzIGV0IG1hbGVzdWFkYSBmYW1lcyBhYyB0dXJwaXMgZWdlc3Rhcy4gUXVpc3F1ZSBzaXQgYW1ldCBudW5jIGV1IHNlbSBvcm5hcmUgdGVtcG9yLiBNYXVyaXMgaWQgZG9sb3IgbmVjIGVyYXQgY29udmFsbGlzIHBvcnRhIGluIGxvYm9ydGlzIG5pc2kuIEN1cmFiaXR1ciBoZW5kcmVyaXQgcmhvbmN1cyB0b3J0b3IgZXUgaGVuZHJlcml0LiBQZWxsZW50ZXNxdWUgZXUgYW50ZSB2ZWwgZWxpdCBsdWN0dXMgZWxlaWZlbmQgcXVpcyB2aXZlcnJhIG51bGxhLiBTdXNwZW5kaXNzZSBvZGlvIGRpYW0sIGV1aXNtb2QgZXUgcG9ydHRpdG9yIG1vbGVzdGllLCBzb2xsaWNpdHVkaW4gc2l0IGFtZXQgbnVsbGEuIFNlZCBhbnRlIHVybmEsIGRpY3R1bSBiaWJlbmR1bSByaG9uY3VzIGV0LCBibGFuZGl0IG5lYyBhbnRlLiBTdXNwZW5kaXNzZSB0b3J0b3IgYXVndWUsIGFjY3Vtc2FuIHF1aXMgc3VzY2lwaXQgaWQsIGFjY3Vtc2FuIHNpdCBhbWV0IGVyYXQuIERvbmVjIHBoYXJldHJhIHZhcml1cyBsb2JvcnRpcy4gTWFlY2VuYXMgaXBzdW0gZGlhbSwgZmF1Y2lidXMgZXUgdGVtcHVzIGlkLCBjb252YWxsaXMgbmVjIGVuaW0uIER1aXMgYXJjdSB0dXJwaXMsIGZyaW5naWxsYSBuZWMgZWdlc3RhcyB1dCwgZGlnbmlzc2ltIHRyaXN0aXF1ZSBudWxsYS4gQ3VyYWJpdHVyIHN1c2Npc
 Gl0IGR1aSBub24ganVzdG8gdWx0cmljZXMgcGhhcmV0cmEuIEFsaXF1YW0gZXJhdCB2b2x1dHBhdC4gTnVsbGEgZmFjaWxpc2kuIFF1aXNxdWUgaWQgZmVsaXMgZXUgc2VtIGFsaXF1YW0gZnJpbmdpbGxhLgoKRXRpYW0gcXVpcyBhdWd1ZSBpbiB0ZWxsdXMgY29uc2VxdWF0IGVsZWlmZW5kLiBBZW5lYW4gZGlnbmlzc2ltIGNvbmd1ZSBmZWxpcyBpZCBlbGVtZW50dW0uIER1aXMgZnJpbmdpbGxhIHZhcml1cyBpcHN1bSwgbmVjIHN1c2NpcGl0IGxlbyBzZW1wZXIgdmVsLiBVdCBzb2xsaWNpdHVkaW4sIG9yY2kgYSB0aW5jaWR1bnQgYWNjdW1zYW4sIGRpYW0gbGVjdHVzIGxhb3JlZXQgbGFjdXMsIHZlbCBmZXJtZW50dW0gcXVhbSBlc3QgdmVsIGVyb3MuIEFsaXF1YW0gZnJpbmdpbGxhIHNhcGllbiBhYyBzYXBpZW4gZmF1Y2lidXMgY29udmFsbGlzLiBBbGlxdWFtIGlkIG51bmMgZXUganVzdG8gY29uc2VxdWF0IHRpbmNpZHVudC4gUXVpc3F1ZSBuZWMgbmlzbCBkdWkuIFBoYXNlbGx1cyBhdWd1ZSBsZWN0dXMsIHZhcml1cyB2aXRhZSBhdWN0b3IgdmVsLCBydXRydW0gYXQgcmlzdXMuIFZpdmFtdXMgbGFjaW5pYSBsZW8gcXVpcyBuZXF1ZSB1bHRyaWNlcyBuZWMgZWxlbWVudHVtIGZlbGlzIGZyaW5naWxsYS4gUHJvaW4gdmVsIHBvcnR0aXRvciBsZWN0dXMuCgpDdXJhYml0dXIgc2FwaWVuIGxvcmVtLCBtb2xsaXMgdXQgYWNjdW1zYW4gbm9uLCB1bHRyaWNpZXMgZXQgbWV0dXMuIEN1cmFiaXR1ciB2ZWwgbG9yZW
 0gcXVpcyBzYXBpZW4gZnJpbmdpbGxhIGxhb3JlZXQuIE1vcmJpIGlkIHVybmEgYWMgb3JjaSBlbGVtZW50dW0gYmxhbmRpdCBlZ2V0IHZvbHV0cGF0IG5lcXVlLiBQZWxsZW50ZXNxdWUgc2VtIG9kaW8sIGlhY3VsaXMgZXUgcGhhcmV0cmEgdml0YWUsIGN1cnN1cyBpbiBxdWFtLiBOdWxsYSBtb2xlc3RpZSBsaWd1bGEgaWQgbWFzc2EgbHVjdHVzIGV0IHB1bHZpbmFyIG5pc2kgcHVsdmluYXIuIE51bmMgZmVybWVudHVtIGF1Z3VlIGEgbGFjdXMgZnJpbmdpbGxhIHJob25jdXMgcG9ydHRpdG9yIGVyYXQgZGljdHVtLiBOdW5jIHNpdCBhbWV0IHRlbGx1cyBldCBkdWkgdml2ZXJyYSBhdWN0b3IgZXVpc21vZCBhdCBuaXNsLiBJbiBzZWQgY29uZ3VlIG1hZ25hLiBQcm9pbiBldCB0b3J0b3IgdXQgYXVndWUgcGxhY2VyYXQgZGlnbmlzc2ltIGEgZXUganVzdG8uIE1vcmJpIHBvcnR0aXRvciBwb3J0YSBsb2JvcnRpcy4gUGVsbGVudGVzcXVlIG5pYmggbGFjdXMsIGFkaXBpc2NpbmcgdXQgdHJpc3RpcXVlIHF1aXMsIGNvbnNlcXVhdCB2aXRhZSB2ZWxpdC4gTWFlY2VuYXMgdXQgbHVjdHVzIGxpYmVyby4gVml2YW11cyBhdWN0b3Igb2RpbyBldCBlcmF0IHNlbXBlciBzYWdpdHRpcy4gVml2YW11cyBpbnRlcmR1bSB2ZWxpdCBpbiByaXN1cyBtYXR0aXMgcXVpcyBkaWN0dW0gYW50ZSByaG9uY3VzLiBJbiBzYWdpdHRpcyBwb3J0dGl0b3IgZXJvcywgYXQgbG9ib3J0aXMgbWV0dXMgdWx0cmljZXMgdmVsLiBDdXJhYml0dXI
 gbm9uIGFsaXF1YW0gbmlzbC4gVmVzdGlidWx1bSBsdWN0dXMgZmV1Z2lhdCBzdXNjaXBpdC4gRXRpYW0gbm9uIGxhY3VzIHZlbCBudWxsYSBlZ2VzdGFzIGlhY3VsaXMgaWQgcXVpcyByaXN1cy4KCkV0aWFtIGluIGF1Y3RvciB1cm5hLiBGdXNjZSB1bHRyaWNpZXMgbW9sZXN0aWUgY29udmFsbGlzLiBJbiBoYWMgaGFiaXRhc3NlIHBsYXRlYSBkaWN0dW1zdC4gVmVzdGlidWx1bSBhbnRlIGlwc3VtIHByaW1pcyBpbiBmYXVjaWJ1cyBvcmNpIGx1Y3R1cyBldCB1bHRyaWNlcyBwb3N1ZXJlIGN1YmlsaWEgQ3VyYWU7IE1hdXJpcyBpYWN1bGlzIGxvcmVtIGZhdWNpYnVzIHB1cnVzIGdyYXZpZGEgYXQgY29udmFsbGlzIHR1cnBpcyBzb2xsaWNpdHVkaW4uIFN1c3BlbmRpc3NlIGF0IHZlbGl0IGxvcmVtLCBhIGZlcm1lbnR1bSBpcHN1bS4gRXRpYW0gY29uZGltZW50dW0sIGR1aSB2ZWwgY29uZGltZW50dW0gZWxlbWVudHVtLCBzYXBpZW4gc2VtIGJsYW5kaXQgc2FwaWVuLCBldCBwaGFyZXRyYSBsZW8gbmVxdWUgZXQgbGVjdHVzLiBOdW5jIHZpdmVycmEgdXJuYSBpYWN1bGlzIGF1Z3VlIHVsdHJpY2VzIGFjIHBvcnR0aXRvciBsYWN1cyBkaWduaXNzaW0uIEFsaXF1YW0gdXQgdHVycGlzIGR1aS4gU2VkIGVnZXQgYWxpcXVldCBmZWxpcy4gSW4gYmliZW5kdW0gbmliaCBzaXQgYW1ldCBzYXBpZW4gYWNjdW1zYW4gYWNjdW1zYW4gcGhhcmV0cmEgbWFnbmEgbW9sZXN0aWUuCgpNYXVyaXMgYWxpcXVldCB1cm5hIGVnZXQg
 bGVjdHVzIGFkaXBpc2NpbmcgYXQgY29uZ3VlIHR1cnBpcyBjb25zZXF1YXQuIFZpdmFtdXMgdGluY2lkdW50IGZlcm1lbnR1bSByaXN1cyBldCBmZXVnaWF0LiBOdWxsYSBtb2xlc3RpZSB1bGxhbWNvcnBlciBuaWJoIHNlZCBmYWNpbGlzaXMuIFBoYXNlbGx1cyBldCBjdXJzdXMgcHVydXMuIE5hbSBjdXJzdXMsIGR1aSBkaWN0dW0gdWx0cmljZXMgdml2ZXJyYSwgZXJhdCByaXN1cyB2YXJpdXMgZWxpdCwgZXUgbW9sZXN0aWUgZHVpIGVyb3MgcXVpcyBxdWFtLiBBbGlxdWFtIGV0IGFudGUgbmVxdWUsIGFjIGNvbnNlY3RldHVyIGR1aS4gRG9uZWMgY29uZGltZW50dW0gZXJhdCBpZCBlbGl0IGRpY3R1bSBzZWQgYWNjdW1zYW4gbGVvIHNhZ2l0dGlzLiBQcm9pbiBjb25zZXF1YXQgY29uZ3VlIHJpc3VzLCB2ZWwgdGluY2lkdW50IGxlbyBpbXBlcmRpZXQgZXUuIFZlc3RpYnVsdW0gbWFsZXN1YWRhIHR1cnBpcyBldSBtZXR1cyBpbXBlcmRpZXQgcHJldGl1bS4gQWxpcXVhbSBjb25kaW1lbnR1bSB1bHRyaWNlcyBuaWJoLCBldSBzZW1wZXIgZW5pbSBlbGVpZmVuZCBhLiBFdGlhbSBjb25kaW1lbnR1bSBuaXNsIHF1YW0uCgpQZWxsZW50ZXNxdWUgaWQgbW9sZXN0aWUgbmlzbC4gTWFlY2VuYXMgZXQgbGVjdHVzIGF0IGp1c3RvIG1vbGVzdGllIHZpdmVycmEgc2l0IGFtZXQgc2l0IGFtZXQgbGlndWxhLiBOdWxsYW0gbm9uIHBvcnR0aXRvciBtYWduYS4gUXVpc3F1ZSBlbGVtZW50dW0gYXJjdSBjdXJzdXMgdG9ydG9yI
 HJ1dHJ1bSBsb2JvcnRpcy4gTW9yYmkgc2l0IGFtZXQgbGVjdHVzIHZpdGFlIGVuaW0gZXVpc21vZCBkaWduaXNzaW0gZWdldCBhdCBuZXF1ZS4gVml2YW11cyBjb25zZXF1YXQgdmVoaWN1bGEgZHVpLCB2aXRhZSBhdWN0b3IgYXVndWUgZGlnbmlzc2ltIGluLiBJbiB0ZW1wdXMgc2VtIHF1aXMganVzdG8gdGluY2lkdW50IHNpdCBhbWV0IGF1Y3RvciB0dXJwaXMgbG9ib3J0aXMuIFBlbGxlbnRlc3F1ZSBub24gZXN0IG51bmMuIFZlc3RpYnVsdW0gbW9sbGlzIGZyaW5naWxsYSBpbnRlcmR1bS4gTWFlY2VuYXMgaXBzdW0gZG9sb3IsIHBoYXJldHJhIGlkIHRyaXN0aXF1ZSBtYXR0aXMsIGx1Y3R1cyB2aXRhZSB1cm5hLiBVdCB1bGxhbWNvcnBlciBhcmN1IGVnZXQgZWxpdCBjb252YWxsaXMgbW9sbGlzLiBQZWxsZW50ZXNxdWUgY29uZGltZW50dW0sIG1hc3NhIGFjIGhlbmRyZXJpdCB0ZW1wb3IsIG1hdXJpcyBwdXJ1cyBibGFuZGl0IGp1c3RvLCBldCBwaGFyZXRyYSBsZW8ganVzdG8gYSBlc3QuIER1aXMgYXJjdSBhdWd1ZSwgZmFjaWxpc2lzIHZlbCBkaWduaXNzaW0gc2VkLCBhbGlxdWFtIHF1aXMgbWFnbmEuIFF1aXNxdWUgbm9uIGNvbnNlcXVhdCBkb2xvci4gU3VzcGVuZGlzc2UgYSB1bHRyaWNlcyBsZW8uCgpEb25lYyB2aXRhZSBwcmV0aXVtIG5pYmguIE1hZWNlbmFzIGJpYmVuZHVtIGJpYmVuZHVtIGRpYW0gaW4gcGxhY2VyYXQuIFV0IGFjY3Vtc2FuLCBtaSB2aXRhZSB2ZXN0aWJ1bHVtIGV1aXNtb2QsIG
 51bmMganVzdG8gdnVscHV0YXRlIG5pc2ksIG5vbiBwbGFjZXJhdCBtaSB1cm5hIGV0IGRpYW0uIE1hZWNlbmFzIG1hbGVzdWFkYSBsb3JlbSB1dCBhcmN1IG1hdHRpcyBtb2xsaXMuIE51bGxhIGZhY2lsaXNpLiBEb25lYyBlc3QgbGVvLCBiaWJlbmR1bSBldSBwdWx2aW5hciBpbiwgY3Vyc3VzIHZlbCBtZXR1cy4gQWxpcXVhbSBlcmF0IHZvbHV0cGF0LiBOdWxsYW0gZmV1Z2lhdCBwb3J0dGl0b3IgbmVxdWUgaW4gdnVscHV0YXRlLiBRdWlzcXVlIG5lYyBtaSBldSBtYWduYSBjb25zZXF1YXQgY3Vyc3VzIG5vbiBhdCBhcmN1LiBFdGlhbSByaXN1cyBtZXR1cywgc29sbGljaXR1ZGluIGV0IHVsdHJpY2VzIGF0LCB0aW5jaWR1bnQgc2VkIG51bmMuIFNlZCBlZ2V0IHNjZWxlcmlzcXVlIGF1Z3VlLiBVdCBmcmluZ2lsbGEgdmVuZW5hdGlzIHNlbSBub24gZWxlaWZlbmQuIE51bmMgbWF0dGlzLCByaXN1cyBzaXQgYW1ldCB2dWxwdXRhdGUgdmFyaXVzLCByaXN1cyBqdXN0byBlZ2VzdGFzIG1hdXJpcywgaWQgaW50ZXJkdW0gb2RpbyBpcHN1bSBldCBuaXNsLiBMb3JlbSBpcHN1bSBkb2xvciBzaXQgYW1ldCwgY29uc2VjdGV0dXIgYWRpcGlzY2luZyBlbGl0LiBNb3JiaSBpZCBlcmF0IG9kaW8sIG5lYyBwdWx2aW5hciBlbmltLgoKQ3VyYWJpdHVyIGFjIGZlcm1lbnR1bSBxdWFtLiBNb3JiaSBldSBlcm9zIHNhcGllbiwgdml0YWUgdGVtcHVzIGRvbG9yLiBNYXVyaXMgdmVzdGlidWx1bSBibGFuZGl0IGVuaW0gdXQgdmV
 uZW5hdGlzLiBBbGlxdWFtIGVnZXN0YXMsIGVyb3MgYXQgY29uc2VjdGV0dXIgdGluY2lkdW50LCBsb3JlbSBhdWd1ZSBpYWN1bGlzIGVzdCwgbmVjIG1vbGxpcyBmZWxpcyBhcmN1IGluIG51bmMuIFNlZCBpbiBvZGlvIHNlZCBsaWJlcm8gcGVsbGVudGVzcXVlIHZvbHV0cGF0IHZpdGFlIGEgYW50ZS4gTW9yYmkgY29tbW9kbyB2b2x1dHBhdCB0ZWxsdXMsIHV0IHZpdmVycmEgcHVydXMgcGxhY2VyYXQgZmVybWVudHVtLiBJbnRlZ2VyIGlhY3VsaXMgZmFjaWxpc2lzIGFyY3UsIGF0IGdyYXZpZGEgbG9yZW0gYmliZW5kdW0gYXQuIEFlbmVhbiBpZCBlcm9zIGVnZXQgZXN0IHNhZ2l0dGlzIGNvbnZhbGxpcyBzZWQgZXQgZHVpLiBEb25lYyBldSBwdWx2aW5hciB0ZWxsdXMuIE51bmMgZGlnbmlzc2ltIHJob25jdXMgdGVsbHVzLCBhdCBwZWxsZW50ZXNxdWUgbWV0dXMgbHVjdHVzIGF0LiBTZWQgb3JuYXJlIGFsaXF1YW0gZGlhbSwgYSBwb3J0dGl0b3IgbGVvIHNvbGxpY2l0dWRpbiBzZWQuIE5hbSB2aXRhZSBsZWN0dXMgbGFjdXMuIEludGVnZXIgYWRpcGlzY2luZyBxdWFtIG5lcXVlLCBibGFuZGl0IHBvc3VlcmUgbGliZXJvLiBTZWQgbGliZXJvIG51bmMsIGVnZXN0YXMgc29kYWxlcyB0ZW1wdXMgc2VkLCBjdXJzdXMgYmxhbmRpdCB0ZWxsdXMuIFZlc3RpYnVsdW0gbWkgcHVydXMsIHVsdHJpY2llcyBxdWlzIHBsYWNlcmF0IHZlbCwgbW9sZXN0aWUgYXQgZHVpLgoKTnVsbGEgY29tbW9kbyBvZGlvIGp1c3RvLiBQ
 ZWxsZW50ZXNxdWUgbm9uIG9ybmFyZSBkaWFtLiBJbiBjb25zZWN0ZXR1ciBzYXBpZW4gYWMgbnVuYyBzYWdpdHRpcyBtYWxlc3VhZGEuIE1vcmJpIHVsbGFtY29ycGVyIHRlbXBvciBlcmF0IG5lYyBydXRydW0uIER1aXMgdXQgY29tbW9kbyBqdXN0by4gQ3JhcyBlc3Qgb3JjaSwgY29uc2VjdGV0dXIgc2VkIGludGVyZHVtIHNlZCwgc2NlbGVyaXNxdWUgc2l0IGFtZXQgbnVsbGEuIFZlc3RpYnVsdW0ganVzdG8gbnVsbGEsIHBlbGxlbnRlc3F1ZSBhIHRlbXB1cyBldCwgZGFwaWJ1cyBldCBhcmN1LiBMb3JlbSBpcHN1bSBkb2xvciBzaXQgYW1ldCwgY29uc2VjdGV0dXIgYWRpcGlzY2luZyBlbGl0LiBNb3JiaSB0cmlzdGlxdWUsIGVyb3MgbmVjIGNvbmd1ZSBhZGlwaXNjaW5nLCBsaWd1bGEgc2VtIHJob25jdXMgZmVsaXMsIGF0IG9ybmFyZSB0ZWxsdXMgbWF1cmlzIGFjIHJpc3VzLiBWZXN0aWJ1bHVtIGFudGUgaXBzdW0gcHJpbWlzIGluIGZhdWNpYnVzIG9yY2kgbHVjdHVzIGV0IHVsdHJpY2VzIHBvc3VlcmUgY3ViaWxpYSBDdXJhZTsgUHJvaW4gbWF1cmlzIGR1aSwgdGVtcG9yIGZlcm1lbnR1bSBkaWN0dW0gZXQsIGN1cnN1cyBhIGxlby4gTWFlY2VuYXMgbmVjIG5pc2wgYSB0ZWxsdXMgcGVsbGVudGVzcXVlIHJob25jdXMuIE51bGxhbSB1bHRyaWNlcyBldWlzbW9kIGR1aSBldSBjb25ndWUuCgpJbiBuZWMgdGVtcG9yIHJpc3VzLiBJbiBmYXVjaWJ1cyBuaXNpIGVnZXQgZGlhbSBkaWduaXNzaW0gY29uc2Vxd
 WF0LiBEb25lYyBwdWx2aW5hciBhbnRlIG5lYyBlbmltIG1hdHRpcyBydXRydW0uIFZlc3RpYnVsdW0gbGVvIGF1Z3VlLCBtb2xlc3RpZSBuZWMgZGFwaWJ1cyBpbiwgZGljdHVtIGF0IGVuaW0uIEludGVnZXIgYWxpcXVhbSwgbG9yZW0gZXUgdnVscHV0YXRlIGxhY2luaWEsIG1pIG9yY2kgdGVtcG9yIGVuaW0sIGVnZXQgbWF0dGlzIGxpZ3VsYSBtYWduYSBhIG1hZ25hLiBQcmFlc2VudCBzZWQgZXJhdCB1dCB0b3J0b3IgaW50ZXJkdW0gdml2ZXJyYS4gTG9yZW0gaXBzdW0gZG9sb3Igc2l0IGFtZXQsIGNvbnNlY3RldHVyIGFkaXBpc2NpbmcgZWxpdC4gTnVsbGEgZmFjaWxpc2kuIE1hZWNlbmFzIHNpdCBhbWV0IGxlY3R1cyBsYWN1cy4gTnVuYyB2aXRhZSBwdXJ1cyBpZCBsaWd1bGEgbGFvcmVldCBjb25kaW1lbnR1bS4gRHVpcyBhdWN0b3IgdG9ydG9yIHZlbCBkdWkgcHVsdmluYXIgYSBmYWNpbGlzaXMgYXJjdSBkaWduaXNzaW0uIEluIGhhYyBoYWJpdGFzc2UgcGxhdGVhIGRpY3R1bXN0LiBEb25lYyBzb2xsaWNpdHVkaW4gcGVsbGVudGVzcXVlIGVnZXN0YXMuIFNlZCBzZWQgc2VtIGp1c3RvLiBNYWVjZW5hcyBsYW9yZWV0IGhlbmRyZXJpdCBtYXVyaXMsIHV0IHBvcnR0aXRvciBsb3JlbSBpYWN1bGlzIGFjLiBRdWlzcXVlIG1vbGVzdGllIHNlbSBxdWlzIGxvcmVtIHRlbXBvciBydXRydW0uIFBoYXNlbGx1cyBuaWJoIG1hdXJpcywgcmhvbmN1cyBpbiBjb25zZWN0ZXR1ciBub24sIGFsaXF1ZXQgZXUgbWFzc2
 EuCgpDdXJhYml0dXIgdmVsaXQgYXJjdSwgcHJldGl1bSBwb3J0YSBwbGFjZXJhdCBxdWlzLCB2YXJpdXMgdXQgbWV0dXMuIFZlc3RpYnVsdW0gdnVscHV0YXRlIHRpbmNpZHVudCBqdXN0bywgdml0YWUgcG9ydHRpdG9yIGxlY3R1cyBpbXBlcmRpZXQgc2l0IGFtZXQuIFZpdmFtdXMgZW5pbSBkb2xvciwgc29sbGljaXR1ZGluIHV0IHNlbXBlciBub24sIG9ybmFyZSBvcm5hcmUgZHVpLiBBbGlxdWFtIHRlbXBvciBmZXJtZW50dW0gc2FwaWVuIGVnZXQgY29uZGltZW50dW0uIEN1cmFiaXR1ciBsYW9yZWV0IGJpYmVuZHVtIGFudGUsIGluIGV1aXNtb2QgbGFjdXMgbGFjaW5pYSBldS4gUGVsbGVudGVzcXVlIGhhYml0YW50IG1vcmJpIHRyaXN0aXF1ZSBzZW5lY3R1cyBldCBuZXR1cyBldCBtYWxlc3VhZGEgZmFtZXMgYWMgdHVycGlzIGVnZXN0YXMuIFN1c3BlbmRpc3NlIHBvdGVudGkuIFNlZCBhdCBsaWJlcm8gZXUgdG9ydG9yIHRlbXB1cyBzY2VsZXJpc3F1ZS4gTnVsbGEgZmFjaWxpc2kuIE51bGxhbSB2aXRhZSBuZXF1ZSBpZCBqdXN0byB2aXZlcnJhIHJob25jdXMgcHJldGl1bSBhdCBsaWJlcm8uIEV0aWFtIGVzdCB1cm5hLCBhbGlxdWFtIHZlbCBwdWx2aW5hciBub24sIG9ybmFyZSB2ZWwgcHVydXMuCgpOdWxsYSB2YXJpdXMsIG5pc2kgZWdldCBjb25kaW1lbnR1bSBzZW1wZXIsIG1ldHVzIGVzdCBkaWN0dW0gb2RpbywgdmVsIG1hdHRpcyByaXN1cyBlc3Qgc2VkIHZlbGl0LiBDdW0gc29jaWlzIG5hdG9xdWU
 gcGVuYXRpYnVzIGV0IG1hZ25pcyBkaXMgcGFydHVyaWVudCBtb250ZXMsIG5hc2NldHVyIHJpZGljdWx1cyBtdXMuIE51bmMgbm9uIGVzdCBuZWMgdGVsbHVzIHVsdHJpY2llcyBtYXR0aXMgdXQgZWdldCB2ZWxpdC4gSW50ZWdlciBjb25kaW1lbnR1bSBhbnRlIGlkIGxvcmVtIGJsYW5kaXQgbGFjaW5pYS4gRG9uZWMgdmVsIHRvcnRvciBhdWd1ZSwgaW4gY29uZGltZW50dW0gbmlzaS4gUGVsbGVudGVzcXVlIHBlbGxlbnRlc3F1ZSBudWxsYSB1dCBudWxsYSBwb3J0dGl0b3IgcXVpcyBzb2RhbGVzIGVuaW0gcnV0cnVtLiBTZWQgYXVndWUgcmlzdXMsIGV1aXNtb2QgYSBhbGlxdWV0IGF0LCB2dWxwdXRhdGUgbm9uIGxpYmVyby4gTnVsbGFtIG5pYmggb2RpbywgZGlnbmlzc2ltIGZlcm1lbnR1bSBwdWx2aW5hciBhYywgY29uZ3VlIGV1IG1pLiBEdWlzIHRpbmNpZHVudCwgbmliaCBpZCB2ZW5lbmF0aXMgcGxhY2VyYXQsIGRpYW0gdHVycGlzIGdyYXZpZGEgbGVvLCBzaXQgYW1ldCBtb2xsaXMgbWFzc2EgZG9sb3IgcXVpcyBtYXVyaXMuIFZpdmFtdXMgc2NlbGVyaXNxdWUgc29kYWxlcyBhcmN1IGV0IGRhcGlidXMuIFN1c3BlbmRpc3NlIHBvdGVudGkuIENyYXMgcXVpcyB0ZWxsdXMgYXJjdSwgcXVpcyBsYW9yZWV0IHNlbS4gRnVzY2UgcG9ydHRpdG9yLCBzYXBpZW4gdmVsIHRyaXN0aXF1ZSBzb2RhbGVzLCB2ZWxpdCBsZW8gcG9ydGEgYXJjdSwgcXVpcyBwZWxsZW50ZXNxdWUgbnVuYyBtZXR1cyBub24gb2Rpby4g
 TmFtIGFyY3UgbGliZXJvLCB1bGxhbWNvcnBlciB1dCBwaGFyZXRyYSBub24sIGRpZ25pc3NpbSBldCB2ZWxpdC4gUXVpc3F1ZSBkb2xvciBsb3JlbSwgdmVoaWN1bGEgc2l0IGFtZXQgc2NlbGVyaXNxdWUgaW4sIHZhcml1cyBhdCBudWxsYS4gUGVsbGVudGVzcXVlIHZpdGFlIHNlbSBlZ2V0IHRvcnRvciBpYWN1bGlzIHB1bHZpbmFyLiBTZWQgbnVuYyBqdXN0bywgZXVpc21vZCBncmF2aWRhIHB1bHZpbmFyIGVnZXQsIGdyYXZpZGEgZWdldCB0dXJwaXMuIENyYXMgdmVsIGRpY3R1bSBuaXNpLiBOdWxsYW0gbnVsbGEgbGliZXJvLCBncmF2aWRhIHNpdCBhbWV0IGFsaXF1YW0gcXVpcywgY29tbW9kbyB2aXRhZSBvZGlvLiBDcmFzIHZpdGFlIG5pYmggbmVjIGR1aSBwbGFjZXJhdCBzZW1wZXIuCgpWaXZhbXVzIGF0IGZyaW5naWxsYSBlcm9zLiBWaXZhbXVzIGF0IG5pc2wgaWQgbWFzc2EgY29tbW9kbyBmZXVnaWF0IHF1aXMgbm9uIG1hc3NhLiBNb3JiaSB0ZWxsdXMgdXJuYSwgYXVjdG9yIHNpdCBhbWV0IGVsZW1lbnR1bSBzZWQsIHJ1dHJ1bSBub24gbGVjdHVzLiBOdWxsYSBmZXVnaWF0IGR1aSBpbiBzYXBpZW4gb3JuYXJlIGV0IGltcGVyZGlldCBlc3Qgb3JuYXJlLiBQZWxsZW50ZXNxdWUgaGFiaXRhbnQgbW9yYmkgdHJpc3RpcXVlIHNlbmVjdHVzIGV0IG5ldHVzIGV0IG1hbGVzdWFkYSBmYW1lcyBhYyB0dXJwaXMgZWdlc3Rhcy4gVmVzdGlidWx1bSBzZW1wZXIgcnV0cnVtIHRlbXBvci4gU2VkIGluIGZlbGlzI
 G5pYmgsIHNlZCBhbGlxdWFtIGVuaW0uIEN1cmFiaXR1ciB1dCBxdWFtIHNjZWxlcmlzcXVlIHZlbGl0IHBsYWNlcmF0IGRpY3R1bS4gRG9uZWMgZWxlaWZlbmQgdmVoaWN1bGEgcHVydXMsIGV1IHZlc3RpYnVsdW0gc2FwaWVuIHJ1dHJ1bSBldS4gVml2YW11cyBpbiBvZGlvIHZlbCBlc3QgdnVscHV0YXRlIGlhY3VsaXMuIE51bmMgcnV0cnVtIGZldWdpYXQgcHJldGl1bS4KCk1hZWNlbmFzIGlwc3VtIG5lcXVlLCBhdWN0b3IgcXVpcyBsYWNpbmlhIHZpdGFlLCBldWlzbW9kIGFjIG9yY2kuIERvbmVjIG1vbGVzdGllIG1hc3NhIGNvbnNlcXVhdCBlc3QgcG9ydGEgYWMgcG9ydGEgcHVydXMgdGluY2lkdW50LiBOYW0gYmliZW5kdW0gbGVvIG5lYyBsYWN1cyBtb2xsaXMgbm9uIGNvbmRpbWVudHVtIGRvbG9yIHJob25jdXMuIE51bGxhIGFjIHZvbHV0cGF0IGxvcmVtLiBOdWxsYW0gZXJhdCBwdXJ1cywgY29udmFsbGlzIGVnZXQgY29tbW9kbyBpZCwgdmFyaXVzIHF1aXMgYXVndWUuIE51bGxhbSBhbGlxdWFtIGVnZXN0YXMgbWksIHZlbCBzdXNjaXBpdCBuaXNsIG1hdHRpcyBjb25zZXF1YXQuIFF1aXNxdWUgdmVsIGVnZXN0YXMgc2FwaWVuLiBOdW5jIGxvcmVtIHZlbGl0LCBjb252YWxsaXMgbmVjIGxhb3JlZXQgZXQsIGFsaXF1ZXQgZWdldCBtYXNzYS4gTmFtIGV0IG5pYmggYWMgZHVpIHZlaGljdWxhIGFsaXF1YW0gcXVpcyBldSBhdWd1ZS4gQ3JhcyB2ZWwgbWFnbmEgdXQgZWxpdCByaG9uY3VzIGludGVyZHVtIG
 lhY3VsaXMgdm9sdXRwYXQgbmlzbC4gU3VzcGVuZGlzc2UgYXJjdSBsb3JlbSwgdmFyaXVzIHJob25jdXMgdGVtcG9yIGlkLCBwdWx2aW5hciBzZWQgdG9ydG9yLiBQZWxsZW50ZXNxdWUgdWx0cmljaWVzIGxhb3JlZXQgb2RpbyBhYyBkaWduaXNzaW0uIEFsaXF1YW0gZGlhbSBhcmN1LCBwbGFjZXJhdCBxdWlzIGVnZXN0YXMgZWdldCwgZmFjaWxpc2lzIGV1IG51bmMuIE1hdXJpcyB2dWxwdXRhdGUsIG5pc2wgc2l0IGFtZXQgbW9sbGlzIGludGVyZHVtLCByaXN1cyB0b3J0b3Igb3JuYXJlIG9yY2ksIHNlZCBlZ2VzdGFzIG9yY2kgZXJvcyBub24gZGlhbS4gVmVzdGlidWx1bSBoZW5kcmVyaXQsIG1ldHVzIHF1aXMgcGxhY2VyYXQgcGVsbGVudGVzcXVlLCBlbmltIHB1cnVzIGZhdWNpYnVzIGR1aSwgc2l0IGFtZXQgdWx0cmljaWVzIGxlY3R1cyBpcHN1bSBpZCBsb3JlbS4gQ2xhc3MgYXB0ZW50IHRhY2l0aSBzb2Npb3NxdSBhZCBsaXRvcmEgdG9ycXVlbnQgcGVyIGNvbnViaWEgbm9zdHJhLCBwZXIgaW5jZXB0b3MgaGltZW5hZW9zLiBQcmFlc2VudCBlZ2V0IGRpYW0gb2RpbywgZXUgYmliZW5kdW0gZWxpdC4gSW4gdmVzdGlidWx1bSBvcmNpIGV1IGVyYXQgdGluY2lkdW50IHRyaXN0aXF1ZS4KCkNyYXMgY29uc2VjdGV0dXIgYW50ZSBldSB0dXJwaXMgcGxhY2VyYXQgc29sbGljaXR1ZGluLiBNYXVyaXMgZXQgbGFjdXMgdG9ydG9yLCBlZ2V0IHBoYXJldHJhIHZlbGl0LiBEb25lYyBhY2N1bXNhbiB1bHRyaWNlcyB
 0ZW1wb3IuIERvbmVjIGF0IG5pYmggYSBlbGl0IGNvbmRpbWVudHVtIGRhcGlidXMuIEludGVnZXIgc2l0IGFtZXQgdnVscHV0YXRlIGFudGUuIFN1c3BlbmRpc3NlIHBvdGVudGkuIEluIHNvZGFsZXMgbGFvcmVldCBtYXNzYSB2aXRhZSBsYWNpbmlhLiBNb3JiaSB2ZWwgbGFjdXMgZmV1Z2lhdCBhcmN1IHZ1bHB1dGF0ZSBtb2xlc3RpZS4gQWxpcXVhbSBtYXNzYSBtYWduYSwgdWxsYW1jb3JwZXIgYWNjdW1zYW4gZ3JhdmlkYSBxdWlzLCByaG9uY3VzIHB1bHZpbmFyIG51bGxhLiBQcmFlc2VudCBzaXQgYW1ldCBpcHN1bSBkaWFtLCBzaXQgYW1ldCBsYWNpbmlhIG5lcXVlLiBJbiBldCBzYXBpZW4gYXVndWUuIEV0aWFtIGVuaW0gZWxpdCwgdWx0cmljZXMgdmVsIHJ1dHJ1bSBpZCwgc2NlbGVyaXNxdWUgbm9uIGVuaW0uCgpQcm9pbiBldCBlZ2VzdGFzIG5lcXVlLiBQcmFlc2VudCBldCBpcHN1bSBkb2xvci4gTnVuYyBub24gdmFyaXVzIG5pc2wuIEZ1c2NlIGluIHRvcnRvciBuaXNpLiBNYWVjZW5hcyBjb252YWxsaXMgbmVxdWUgaW4gbGlndWxhIGJsYW5kaXQgcXVpcyB2ZWhpY3VsYSBsZW8gbW9sbGlzLiBQZWxsZW50ZXNxdWUgc2FnaXR0aXMgYmxhbmRpdCBsZW8sIGRhcGlidXMgcGVsbGVudGVzcXVlIGxlbyB1bHRyaWNlcyBhYy4gQ3VyYWJpdHVyIGFjIGVnZXN0YXMgbGliZXJvLiBEb25lYyBwcmV0aXVtIHBoYXJldHJhIHByZXRpdW0uIEZ1c2NlIGltcGVyZGlldCwgdHVycGlzIGV1IGFsaXF1YW0gcG9ydGEs
 IGFudGUgZWxpdCBlbGVpZmVuZCByaXN1cywgbHVjdHVzIGF1Y3RvciBhcmN1IGFudGUgdXQgbnVuYy4gVml2YW11cyBpbiBsZW8gZmVsaXMsIHZpdGFlIGVsZWlmZW5kIGxhY3VzLiBEb25lYyB0ZW1wdXMgYWxpcXVhbSBwdXJ1cyBwb3J0dGl0b3IgdHJpc3RpcXVlLiBTdXNwZW5kaXNzZSBkaWFtIG5lcXVlLCBzdXNjaXBpdCBmZXVnaWF0IGZyaW5naWxsYSBub24sIGVsZWlmZW5kIHNpdCBudWxsYW0uCg==
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/www/script/test/lots_of_docs.js
----------------------------------------------------------------------
diff --git a/share/www/script/test/lots_of_docs.js b/share/www/script/test/lots_of_docs.js
deleted file mode 100644
index 2fe702b..0000000
--- a/share/www/script/test/lots_of_docs.js
+++ /dev/null
@@ -1,55 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
-// test saving a semi-large quanitity of documents and do some view queries.
-couchTests.lots_of_docs = function(debug) {
-  var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"});
-  db.deleteDb();
-  db.createDb();
-  if (debug) debugger;
-
-  // keep number lowish for now to keep tests fasts. Crank up manually to
-  // to really test.
-  var numDocsToCreate = 500;
-
-  for(var i=0; i < numDocsToCreate; i += 100) {
-      var createNow = Math.min(numDocsToCreate - i, 100);
-      var docs = makeDocs(i, i + createNow);
-      db.bulkSave(docs);
-  }
-
-  // query all documents, and return the doc.integer member as a key.
-  results = db.query(function(doc){ emit(doc.integer, null) });
-
-  T(results.total_rows == numDocsToCreate);
-
-  // validate the keys are ordered ascending
-  for(var i=0; i<numDocsToCreate; i++) {
-    T(results.rows[i].key==i);
-  }
-
-  // do the query again, but with descending output
-  results = db.query(function(doc){ emit(doc.integer, null) }, null, {
-    descending: true
-  });
-
-  T(results.total_rows == numDocsToCreate);
-
-  // validate the keys are ordered descending
-  for(var i=0; i<numDocsToCreate; i++) {
-    T(results.rows[numDocsToCreate-1-i].key==i);
-  }
-
-  // Check _all_docs with descending=true again (now that there are many docs)
-  var desc = db.allDocs({descending:true});
-  T(desc.total_rows == desc.rows.length);
-};

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/www/script/test/method_override.js
----------------------------------------------------------------------
diff --git a/share/www/script/test/method_override.js b/share/www/script/test/method_override.js
deleted file mode 100644
index 0bb4c61..0000000
--- a/share/www/script/test/method_override.js
+++ /dev/null
@@ -1,40 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
-// Allow broken HTTP clients to fake a full method vocabulary with an X-HTTP-METHOD-OVERRIDE header
-couchTests.method_override = function(debug) {
-  var result = JSON.parse(CouchDB.request("GET", "/").responseText);
-  T(result.couchdb == "Welcome");
-
-  var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"});
-  db.deleteDb();
-
-  db.createDb();
-
-  var doc = {bob : "connie"};
-  xhr = CouchDB.request("POST", "/test_suite_db/fnord", {body: JSON.stringify(doc), headers:{"X-HTTP-Method-Override" : "PUT"}});
-  T(xhr.status == 201);
-
-  doc = db.open("fnord");
-  T(doc.bob == "connie");
-
-  xhr = CouchDB.request("POST", "/test_suite_db/fnord?rev=" + doc._rev, {headers:{"X-HTTP-Method-Override" : "DELETE"}});
-  T(xhr.status == 200);
-
-  xhr = CouchDB.request("GET", "/test_suite_db/fnord2", {body: JSON.stringify(doc), headers:{"X-HTTP-Method-Override" : "PUT"}});
-  // Method Override is ignored when original Method isn't POST
-  T(xhr.status == 404);
-
-  doc = db.open("fnord");
-  T(doc == null);  
-
-};

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/www/script/test/multiple_rows.js
----------------------------------------------------------------------
diff --git a/share/www/script/test/multiple_rows.js b/share/www/script/test/multiple_rows.js
deleted file mode 100644
index 4f6fcd3..0000000
--- a/share/www/script/test/multiple_rows.js
+++ /dev/null
@@ -1,80 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
-couchTests.multiple_rows = function(debug) {
-  var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"});
-  db.deleteDb();
-  db.createDb();
-  if (debug) debugger;
-
-  var nc = {_id:"NC", cities:["Charlotte", "Raleigh"]};
-  var ma = {_id:"MA", cities:["Boston", "Lowell", "Worcester", "Cambridge", "Springfield"]};
-  var fl = {_id:"FL", cities:["Miami", "Tampa", "Orlando", "Springfield"]};
-
-  T(db.save(nc).ok);
-  T(db.save(ma).ok);
-  T(db.save(fl).ok);
-
-  var generateListOfCitiesAndState = "function(doc) {" +
-  " for (var i = 0; i < doc.cities.length; i++)" +
-  "  emit(doc.cities[i] + \", \" + doc._id, null);" +
-  "}";
-
-  var results = db.query(generateListOfCitiesAndState);
-  var rows = results.rows;
-
-  T(rows[0].key == "Boston, MA");
-  T(rows[1].key == "Cambridge, MA");
-  T(rows[2].key == "Charlotte, NC");
-  T(rows[3].key == "Lowell, MA");
-  T(rows[4].key == "Miami, FL");
-  T(rows[5].key == "Orlando, FL");
-  T(rows[6].key == "Raleigh, NC");
-  T(rows[7].key == "Springfield, FL");
-  T(rows[8].key == "Springfield, MA");
-  T(rows[9].key == "Tampa, FL");
-  T(rows[10].key == "Worcester, MA");
-
-  // add another city to NC
-  nc.cities.push("Wilmington");
-  T(db.save(nc).ok);
-
-  var results = db.query(generateListOfCitiesAndState);
-  var rows = results.rows;
-
-  T(rows[0].key == "Boston, MA");
-  T(rows[1].key == "Cambridge, MA");
-  T(rows[2].key == "Charlotte, NC");
-  T(rows[3].key == "Lowell, MA");
-  T(rows[4].key == "Miami, FL");
-  T(rows[5].key == "Orlando, FL");
-  T(rows[6].key == "Raleigh, NC");
-  T(rows[7].key == "Springfield, FL");
-  T(rows[8].key == "Springfield, MA");
-  T(rows[9].key == "Tampa, FL");
-  T(rows[10].key == "Wilmington, NC");
-  T(rows[11].key == "Worcester, MA");
-
-  // now delete MA
-  T(db.deleteDoc(ma).ok);
-
-  var results = db.query(generateListOfCitiesAndState);
-  var rows = results.rows;
-
-  T(rows[0].key == "Charlotte, NC");
-  T(rows[1].key == "Miami, FL");
-  T(rows[2].key == "Orlando, FL");
-  T(rows[3].key == "Raleigh, NC");
-  T(rows[4].key == "Springfield, FL");
-  T(rows[5].key == "Tampa, FL");
-  T(rows[6].key == "Wilmington, NC");
-};

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/www/script/test/oauth.js
----------------------------------------------------------------------
diff --git a/share/www/script/test/oauth.js b/share/www/script/test/oauth.js
deleted file mode 100644
index 8b4e694..0000000
--- a/share/www/script/test/oauth.js
+++ /dev/null
@@ -1,294 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License.  You may obtain a copy
-// of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
-couchTests.oauth = function(debug) {
-  // This tests OAuth authentication.
-
-  var authorization_url = "/_oauth/authorize";
-
-  var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"});
-  db.deleteDb();
-  db.createDb();
-  if (debug) debugger;
-
-  var dbA = new CouchDB("test_suite_db_a", {"X-Couch-Full-Commit":"false"});
-  var dbB = new CouchDB("test_suite_db_b", {"X-Couch-Full-Commit":"false"});
-  var dbC = new CouchDB("test_suite_db_c", {"X-Couch-Full-Commit":"false"});
-  var dbD = new CouchDB("test_suite_users", {"X-Couch-Full-Commit":"false"});
-  dbA.deleteDb();
-  dbA.createDb();
-  dbB.deleteDb();
-  dbB.createDb();
-  dbC.deleteDb();
-  dbC.createDb();
-  dbD.deleteDb();
-
-  // Simple secret key generator
-  function generateSecret(length) {
-    var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
-    var secret = '';
-    for (var i=0; i<length; i++) {
-      secret += tab.charAt(Math.floor(Math.random() * 64));
-    }
-    return secret;
-  }
-
-  function oauthRequest(method, path, message, accessor) {
-    message.action = path;
-    message.method = method || 'GET';
-    OAuth.SignatureMethod.sign(message, accessor);
-    var parameters = message.parameters;
-    if (method == "POST" || method == "GET") {
-      if (method == "GET") {
-        return CouchDB.request("GET", OAuth.addToURL(path, parameters));
-      } else {
-        return CouchDB.request("POST", path, {
-          headers: {"Content-Type": "application/x-www-form-urlencoded"},
-          body: OAuth.formEncode(parameters)
-        });
-      }
-    } else {
-      return CouchDB.request(method, path, {
-        headers: {Authorization: OAuth.getAuthorizationHeader('', parameters)}
-      });
-    }
-  }
-
-  var consumerSecret = generateSecret(64);
-  var tokenSecret = generateSecret(64);
-  var admintokenSecret = generateSecret(64);
-  var testadminPassword = "ohsosecret";
-
-  var adminBasicAuthHeaderValue = function() {
-    var retval = 'Basic ' + binb2b64(str2binb("testadmin:" + testadminPassword));
-    return retval;
-  }
-
-  var host = CouchDB.host;
-  var dbPair = {
-    source: {
-      url: CouchDB.protocol + host + "/test_suite_db_a",
-      auth: {
-        oauth: {
-          consumer_key: "key",
-          consumer_secret: consumerSecret,
-          token_secret: tokenSecret,
-          token: "foo"
-        }
-      }
-    },
-    target: {
-      url: CouchDB.protocol + host + "/test_suite_db_b",
-      headers: {"Authorization": adminBasicAuthHeaderValue()}
-    }
-  };
-
-  // this function will be called on the modified server
-  var testFun = function () {
-    try {
-      CouchDB.request("PUT", CouchDB.protocol + host + "/_config/admins/testadmin", {
-        headers: {"X-Couch-Persist": "false"},
-        body: JSON.stringify(testadminPassword)
-      });
-      var i = 0;
-      waitForSuccess(function() {
-        //loop until the couch server has processed the password
-        i += 1;
-        var xhr = CouchDB.request("GET", CouchDB.protocol + host + "/_config/admins/testadmin?foo="+i,{
-            headers: {
-              "Authorization": adminBasicAuthHeaderValue()
-            }});
-        if (xhr.responseText.indexOf("\"-pbkdf2-") != 0) {
-            throw("still waiting");
-        }
-        return true;
-      }, "wait-for-admin");
-
-      CouchDB.newUuids(2); // so we have one to make the salt
-
-      CouchDB.request("PUT", CouchDB.protocol + host + "/_config/couch_httpd_auth/require_valid_user", {
-        headers: {
-          "X-Couch-Persist": "false",
-          "Authorization": adminBasicAuthHeaderValue()
-        },
-        body: JSON.stringify("true")
-      });
-
-      var usersDb = new CouchDB("test_suite_users", {
-        "X-Couch-Full-Commit":"false",
-        "Authorization": adminBasicAuthHeaderValue()
-      });
-        
-      // Create a user
-      var jasonUserDoc = CouchDB.prepareUserDoc({
-        name: "jason",
-        roles: ["test"]
-      }, "testpassword");
-      T(usersDb.save(jasonUserDoc).ok);
-
-
-      var accessor = {
-        consumerSecret: consumerSecret,
-        tokenSecret: tokenSecret
-      };
-      var adminAccessor = {
-        consumerSecret: consumerSecret,
-        tokenSecret: admintokenSecret
-      };
-
-      var signatureMethods = ["PLAINTEXT", "HMAC-SHA1"];
-      var consumerKeys = {key: 200, nonexistent_key: 400};
-      for (var i=0; i<signatureMethods.length; i++) {
-        for (var consumerKey in consumerKeys) {
-          var expectedCode = consumerKeys[consumerKey];
-          var message = {
-            parameters: {
-              oauth_signature_method: signatureMethods[i],
-              oauth_consumer_key: consumerKey,
-              oauth_token: "foo",
-              oauth_token_secret: tokenSecret,
-              oauth_version: "1.0"
-            }
-          };
-
-          // Get request token via Authorization header
-          xhr = oauthRequest("GET", CouchDB.protocol + host + "/_oauth/request_token", message, accessor);
-          T(xhr.status == expectedCode);
-
-          // GET request token via query parameters
-          xhr = oauthRequest("GET", CouchDB.protocol + host + "/_oauth/request_token", message, accessor);
-          T(xhr.status == expectedCode);
-
-          responseMessage = OAuth.decodeForm(xhr.responseText);
-
-          // Obtaining User Authorization
-          //Only needed for 3-legged OAuth
-          //xhr = CouchDB.request("GET", authorization_url + '?oauth_token=' + responseMessage.oauth_token);
-          //T(xhr.status == expectedCode);
-
-          xhr = oauthRequest("GET", CouchDB.protocol + host + "/_session", message, accessor);
-          T(xhr.status == expectedCode);
-          if (xhr.status == expectedCode == 200) {
-            data = JSON.parse(xhr.responseText);
-            T(data.name == "jason");
-            T(data.roles[0] == "test");
-          }
-
-          xhr = oauthRequest("GET", CouchDB.protocol + host + "/_session?foo=bar", message, accessor);
-          T(xhr.status == expectedCode);
-
-          // Test HEAD method
-          xhr = oauthRequest("HEAD", CouchDB.protocol + host + "/_session?foo=bar", message, accessor);
-          T(xhr.status == expectedCode);
-
-          // Replication
-          var dbA = new CouchDB("test_suite_db_a", {
-            "X-Couch-Full-Commit":"false",
-            "Authorization": adminBasicAuthHeaderValue()
-          });
-          T(dbA.save({_id:"_design/"+i+consumerKey}).ok);
-          var result = CouchDB.replicate(dbPair.source, dbPair.target, {
-            headers: {"Authorization": adminBasicAuthHeaderValue()}
-          });
-          T(result.ok);
-
-          // Test if rewriting doesn't break OAuth (c.f. COUCHDB-1321)
-          var dbC = new CouchDB("test_suite_db_c", {
-            "X-Couch-Full-Commit":"false",
-            "Authorization": adminBasicAuthHeaderValue()
-          });
-          var ddocId = "_design/"+ i + consumerKey;
-          var ddoc = {
-            _id: ddocId,
-            language: "javascript",
-            _attachments:{
-              "bar": {
-                content_type:"text/plain",
-                data: "VGhpcyBpcyBhIGJhc2U2NCBlbmNvZGVkIHRleHQ="
-              }
-            },
-            rewrites: [{"from": "foo/:a",  "to": ":a"}]
-          };
-          T(dbC.save(ddoc).ok);
-          xhr = oauthRequest("GET", CouchDB.protocol + host + "/test_suite_db_c/" + ddocId + "/_rewrite/foo/bar", message, accessor);
-          T(xhr.status == expectedCode);
-
-          // Test auth via admin user defined in .ini
-          var message = {
-            parameters: {
-              oauth_signature_method: signatureMethods[i],
-              oauth_consumer_key: consumerKey,
-              oauth_token: "bar",
-              oauth_token_secret: admintokenSecret,
-              oauth_version: "1.0"
-            }
-          };
-          xhr = oauthRequest("GET", CouchDB.protocol + host + "/_session?foo=bar", message, adminAccessor);
-          if (xhr.status == expectedCode == 200) {
-            data = JSON.parse(xhr.responseText);
-            T(data.name == "testadmin");
-            T(data.roles[0] == "_admin");
-          }
-
-          // Test when the user's token doesn't exist.
-          message.parameters.oauth_token = "not a token!";
-          xhr = oauthRequest("GET", CouchDB.protocol + host + "/_session?foo=bar",
-                  message, adminAccessor);
-          T(xhr.status == 400, "Request should be invalid.");
-        }
-      }
-    } finally {
-      var xhr = CouchDB.request("PUT", CouchDB.protocol + host + "/_config/couch_httpd_auth/require_valid_user", {
-        headers: {
-          "Authorization": adminBasicAuthHeaderValue(),
-          "X-Couch-Persist": "false"
-        },
-        body: JSON.stringify("false")
-      });
-      T(xhr.status == 200);
-
-      var xhr = CouchDB.request("DELETE", CouchDB.protocol + host + "/_config/admins/testadmin", {
-        headers: {
-          "Authorization": adminBasicAuthHeaderValue(),
-          "X-Couch-Persist": "false"
-        }
-      });
-      T(xhr.status == 200);
-    }
-  };
-
-  run_on_modified_server(
-    [
-     {section: "httpd",
-      key: "WWW-Authenticate", value: 'OAuth'},
-     {section: "couch_httpd_auth",
-      key: "secret", value: generateSecret(64)},
-     {section: "couch_httpd_auth",
-      key: "authentication_db", value: "test_suite_users"},
-     {section: "oauth_consumer_secrets",
-      key: "key", value: consumerSecret},
-     {section: "oauth_token_users",
-      key: "foo", value: "jason"},
-     {section: "oauth_token_users",
-      key: "bar", value: "testadmin"},
-     {section: "oauth_token_secrets",
-      key: "foo", value: tokenSecret},
-     {section: "oauth_token_secrets",
-      key: "bar", value: admintokenSecret},
-     {section: "couch_httpd_oauth",
-      key: "authorization_url", value: authorization_url},
-     {section: "couch_httpd_oauth",
-      key: "use_users_db", value: "false"}
-    ],
-    testFun
-  );
-};

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/www/script/test/oauth_users_db.js
----------------------------------------------------------------------
diff --git a/share/www/script/test/oauth_users_db.js b/share/www/script/test/oauth_users_db.js
deleted file mode 100644
index b98069e..0000000
--- a/share/www/script/test/oauth_users_db.js
+++ /dev/null
@@ -1,161 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License.  You may obtain a copy
-// of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
-couchTests.oauth_users_db = function(debug) {
-  // This tests OAuth authentication using the _users DB instead of the ini
-  // configuration for storing OAuth tokens and secrets.
-
-  if (debug) debugger;
-
-  var usersDb = new CouchDB("test_suite_users",{"X-Couch-Full-Commit":"false"});
-  var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"});
-  var host = CouchDB.host;
-  var authorization_url = "/_oauth/authorize";
-
-
-  // Simple secret key generator
-  function generateSecret(length) {
-    var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
-    var secret = '';
-    for (var i = 0; i < length; i++) {
-      secret += tab.charAt(Math.floor(Math.random() * 64));
-    }
-    return secret;
-  }
-
-
-  function oauthRequest(method, path, message, accessor) {
-    message.action = path;
-    message.method = method || 'GET';
-    OAuth.SignatureMethod.sign(message, accessor);
-    var parameters = message.parameters;
-    if (method == "POST" || method == "GET") {
-      if (method == "GET") {
-        return CouchDB.request("GET", OAuth.addToURL(path, parameters));
-      } else {
-        return CouchDB.request("POST", path, {
-          headers: {"Content-Type": "application/x-www-form-urlencoded"},
-          body: OAuth.formEncode(parameters)
-        });
-      }
-    } else {
-      return CouchDB.request(method, path, {
-        headers: {Authorization: OAuth.getAuthorizationHeader('', parameters)}
-      });
-    }
-  }
-
-
-  // this function will be called on the modified server
-  var testFun = function () {
-    var fdmanana = CouchDB.prepareUserDoc({
-      name: "fdmanana",
-      roles: ["dev"],
-      oauth: {
-        consumer_keys: {
-          "key_foo": "bar",
-          "key_xpto": "mars"
-        },
-        tokens: {
-          "salut": "ola",
-          "tok1": "123"
-        }
-      }
-    }, "qwerty");
-    TEquals(true, usersDb.save(fdmanana).ok);
-
-    var signatureMethods = ["PLAINTEXT", "HMAC-SHA1"];
-    var message, xhr, responseMessage, accessor, data;
-
-    for (var i = 0; i < signatureMethods.length; i++) {
-      message = {
-        parameters: {
-          oauth_signature_method: signatureMethods[i],
-          oauth_consumer_key: "key_foo",
-          oauth_token: "tok1",
-          oauth_version: "1.0"
-        }
-      };
-      accessor = {
-        consumerSecret: "bar",
-        tokenSecret: "123"
-      };
-
-      xhr = oauthRequest("GET", CouchDB.protocol + host + "/_oauth/request_token",
-        message, accessor
-      );
-      TEquals(200, xhr.status);
-
-      responseMessage = OAuth.decodeForm(xhr.responseText);
-
-      // Obtaining User Authorization
-      // Only needed for 3-legged OAuth
-      //xhr = CouchDB.request(
-      //  "GET", authorization_url + '?oauth_token=' + responseMessage.oauth_token);
-      //TEquals(200, xhr.status);
-
-      xhr = oauthRequest(
-        "GET", CouchDB.protocol + host + "/_session", message, accessor);
-      TEquals(200, xhr.status);
-      data = JSON.parse(xhr.responseText);
-      TEquals(true, data.ok);
-      TEquals("object", typeof data.userCtx);
-      TEquals("fdmanana", data.userCtx.name);
-      TEquals("dev", data.userCtx.roles[0]);
-      TEquals("oauth", data.info.authenticated);
-
-      // test invalid token
-      message.parameters.oauth_token = "not a token!";
-      xhr = oauthRequest("GET", CouchDB.protocol + host + "/_session",
-        message, accessor
-      );
-      TEquals(400, xhr.status, "Request should be invalid.");
-
-      // test invalid secret
-      message.parameters.oauth_token = "tok1";
-      accessor.tokenSecret = "badone";
-      xhr = oauthRequest("GET", CouchDB.protocol + host + "/_session",
-        message, accessor
-      );
-      data = JSON.parse(xhr.responseText);
-      TEquals(null, data.userCtx.name);
-      TEquals(1, data.userCtx.roles.length);
-      TEquals("_admin", data.userCtx.roles[0]);
-      TEquals(true, data.info.authentication_handlers.indexOf("default") >= 0);
-      TEquals("default", data.info.authenticated);
-    }
-  };
-
-
-  usersDb.deleteDb();
-
-  run_on_modified_server(
-    [
-     {section: "httpd",
-      key: "WWW-Authenticate", value: 'OAuth'},
-     {section: "couch_httpd_auth",
-      key: "secret", value: generateSecret(64)},
-     {section: "couch_httpd_auth",
-      key: "authentication_db", value: usersDb.name},
-     {section: "couch_httpd_oauth",
-      key: "use_users_db", value: "true"},
-     {section: "httpd", key: "authentication_handlers",
-      value: "{couch_httpd_oauth, oauth_authentication_handler}, " +
-        "{couch_httpd_auth, default_authentication_handler}"}
-    ],
-    testFun
-  );
-
-  // cleanup
-  usersDb.deleteDb();
-  db.deleteDb();
-};

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/www/script/test/proxyauth.js
----------------------------------------------------------------------
diff --git a/share/www/script/test/proxyauth.js b/share/www/script/test/proxyauth.js
deleted file mode 100644
index 1677a66..0000000
--- a/share/www/script/test/proxyauth.js
+++ /dev/null
@@ -1,130 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
- 
- 
- 
-couchTests.proxyauth = function(debug) {
-  // this test proxy authentification handler
-  
-  var usersDb = new CouchDB("test_suite_users", {"X-Couch-Full-Commit":"false"});
-  var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"});
-  
-  if (debug) debugger;
- 
-  usersDb.deleteDb();
-
-  // Simple secret key generator
-  function generateSecret(length) {
-    var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
-    var secret = '';
-    for (var i=0; i<length; i++) {
-      secret += tab.charAt(Math.floor(Math.random() * 64));
-    }
-    return secret;
-  }
-  
-  var secret = generateSecret(64);
-  
-  function TestFun() {
-    db.deleteDb();
-    db.createDb();
-    
-    var benoitcUserDoc = CouchDB.prepareUserDoc({
-      name: "benoitc@apache.org"
-    }, "test");
-    T(usersDb.save(benoitcUserDoc).ok);
-    
-    T(CouchDB.session().userCtx.name == null);
-
-    // test that you can use basic auth aginst the users db
-    var s = CouchDB.session({
-      headers : {
-        "Authorization" : "Basic YmVub2l0Y0BhcGFjaGUub3JnOnRlc3Q="
-      }
-    });
-    T(s.userCtx.name == "benoitc@apache.org");
-    T(s.info.authenticated == "default");
-    
-    CouchDB.logout();
-    
-    var headers = {
-      "X-Auth-CouchDB-UserName": "benoitc@apache.org",
-      "X-Auth-CouchDB-Roles": "test",
-      "X-Auth-CouchDB-Token": hex_hmac_sha1(secret, "benoitc@apache.org")
-    };
-    
-    var designDoc = {
-      _id:"_design/test",
-      language: "javascript",
-       
-      shows: {
-        "welcome": stringFun(function(doc,req) {
-          return "Welcome " + req.userCtx["name"];
-        }),
-        "role": stringFun(function(doc, req) {
-          return req.userCtx['roles'][0];
-        })
-      }
-    };
-
-    db.save(designDoc);
-    
-    var req = CouchDB.request("GET", "/test_suite_db/_design/test/_show/welcome",
-                        {headers: headers});
-    T(req.responseText == "Welcome benoitc@apache.org");
-    
-    req = CouchDB.request("GET", "/test_suite_db/_design/test/_show/role",
-                        {headers: headers});
-    T(req.responseText == "test");
-    
-    var xhr = CouchDB.request("PUT", "/_config/couch_httpd_auth/proxy_use_secret",{
-      body : JSON.stringify("true"),
-      headers: {"X-Couch-Persist": "false"}
-    });
-    T(xhr.status == 200);
-    
-    req = CouchDB.request("GET", "/test_suite_db/_design/test/_show/welcome",
-                        {headers: headers});
-    T(req.responseText == "Welcome benoitc@apache.org");
-    
-    req = CouchDB.request("GET", "/test_suite_db/_design/test/_show/role",
-                        {headers: headers});
-    T(req.responseText == "test");
-    
-  }
-  
-  run_on_modified_server(
-    [{section: "httpd",
-      key: "authentication_handlers",
-      value:"{couch_httpd_auth, proxy_authentification_handler}, {couch_httpd_auth, default_authentication_handler}"},
-      {section: "couch_httpd_auth",
-        key: "authentication_db", 
-        value: "test_suite_users"},
-      {section: "couch_httpd_auth",
-        key: "secret", 
-        value: secret},
-      {section: "couch_httpd_auth",
-        key: "x_auth_username", 
-        value: "X-Auth-CouchDB-UserName"},
-      {section: "couch_httpd_auth",
-        key: "x_auth_roles", 
-        value: "X-Auth-CouchDB-Roles"},
-      {section: "couch_httpd_auth",
-        key: "x_auth_token", 
-        value: "X-Auth-CouchDB-Token"},
-      {section: "couch_httpd_auth",
-        key: "proxy_use_secret", 
-        value: "false"}],
-    TestFun
-  );
-  
-};


[29/37] goodbye Futon, old friend <3

Posted by ja...@apache.org.
http://git-wip-us.apache.org/repos/asf/couchdb/blob/cca309f3/share/www/fauxton/js/ace/worker-json.js
----------------------------------------------------------------------
diff --git a/share/www/fauxton/js/ace/worker-json.js b/share/www/fauxton/js/ace/worker-json.js
deleted file mode 100644
index 607221f..0000000
--- a/share/www/fauxton/js/ace/worker-json.js
+++ /dev/null
@@ -1,2271 +0,0 @@
-"no use strict";
-;(function(window) {
-if (typeof window.window != "undefined" && window.document) {
-    return;
-}
-
-window.console = function() {
-    var msgs = Array.prototype.slice.call(arguments, 0);
-    postMessage({type: "log", data: msgs});
-};
-window.console.error =
-window.console.warn = 
-window.console.log =
-window.console.trace = window.console;
-
-window.window = window;
-window.ace = window;
-
-window.normalizeModule = function(parentId, moduleName) {
-    if (moduleName.indexOf("!") !== -1) {
-        var chunks = moduleName.split("!");
-        return window.normalizeModule(parentId, chunks[0]) + "!" + window.normalizeModule(parentId, chunks[1]);
-    }
-    if (moduleName.charAt(0) == ".") {
-        var base = parentId.split("/").slice(0, -1).join("/");
-        moduleName = (base ? base + "/" : "") + moduleName;
-        
-        while(moduleName.indexOf(".") !== -1 && previous != moduleName) {
-            var previous = moduleName;
-            moduleName = moduleName.replace(/^\.\//, "").replace(/\/\.\//, "/").replace(/[^\/]+\/\.\.\//, "");
-        }
-    }
-    
-    return moduleName;
-};
-
-window.require = function(parentId, id) {
-    if (!id) {
-        id = parentId
-        parentId = null;
-    }
-    if (!id.charAt)
-        throw new Error("worker.js require() accepts only (parentId, id) as arguments");
-
-    id = window.normalizeModule(parentId, id);
-
-    var module = window.require.modules[id];
-    if (module) {
-        if (!module.initialized) {
-            module.initialized = true;
-            module.exports = module.factory().exports;
-        }
-        return module.exports;
-    }
-    
-    var chunks = id.split("/");
-    if (!window.require.tlns)
-        return console.log("unable to load " + id);
-    chunks[0] = window.require.tlns[chunks[0]] || chunks[0];
-    var path = chunks.join("/") + ".js";
-    
-    window.require.id = id;
-    importScripts(path);
-    return window.require(parentId, id);
-};
-window.require.modules = {};
-window.require.tlns = {};
-
-window.define = function(id, deps, factory) {
-    if (arguments.length == 2) {
-        factory = deps;
-        if (typeof id != "string") {
-            deps = id;
-            id = window.require.id;
-        }
-    } else if (arguments.length == 1) {
-        factory = id;
-        deps = []
-        id = window.require.id;
-    }
-
-    if (!deps.length)
-        deps = ['require', 'exports', 'module']
-
-    if (id.indexOf("text!") === 0) 
-        return;
-    
-    var req = function(childId) {
-        return window.require(id, childId);
-    };
-
-    window.require.modules[id] = {
-        exports: {},
-        factory: function() {
-            var module = this;
-            var returnExports = factory.apply(this, deps.map(function(dep) {
-              switch(dep) {
-                  case 'require': return req
-                  case 'exports': return module.exports
-                  case 'module':  return module
-                  default:        return req(dep)
-              }
-            }));
-            if (returnExports)
-                module.exports = returnExports;
-            return module;
-        }
-    };
-};
-window.define.amd = {}
-
-window.initBaseUrls  = function initBaseUrls(topLevelNamespaces) {
-    require.tlns = topLevelNamespaces;
-}
-
-window.initSender = function initSender() {
-
-    var EventEmitter = window.require("ace/lib/event_emitter").EventEmitter;
-    var oop = window.require("ace/lib/oop");
-    
-    var Sender = function() {};
-    
-    (function() {
-        
-        oop.implement(this, EventEmitter);
-                
-        this.callback = function(data, callbackId) {
-            postMessage({
-                type: "call",
-                id: callbackId,
-                data: data
-            });
-        };
-    
-        this.emit = function(name, data) {
-            postMessage({
-                type: "event",
-                name: name,
-                data: data
-            });
-        };
-        
-    }).call(Sender.prototype);
-    
-    return new Sender();
-}
-
-window.main = null;
-window.sender = null;
-
-window.onmessage = function(e) {
-    var msg = e.data;
-    if (msg.command) {
-        if (main[msg.command])
-            main[msg.command].apply(main, msg.args);
-        else
-            throw new Error("Unknown command:" + msg.command);
-    }
-    else if (msg.init) {        
-        initBaseUrls(msg.tlns);
-        require("ace/lib/es5-shim");
-        sender = initSender();
-        var clazz = require(msg.module)[msg.classname];
-        main = new clazz(sender);
-    } 
-    else if (msg.event && sender) {
-        sender._emit(msg.event, msg.data);
-    }
-};
-})(this);// https://github.com/kriskowal/es5-shim
-
-define('ace/lib/es5-shim', ['require', 'exports', 'module' ], function(require, exports, module) {
-
-function Empty() {}
-
-if (!Function.prototype.bind) {
-    Function.prototype.bind = function bind(that) { // .length is 1
-        var target = this;
-        if (typeof target != "function") {
-            throw new TypeError("Function.prototype.bind called on incompatible " + target);
-        }
-        var args = slice.call(arguments, 1); // for normal call
-        var bound = function () {
-
-            if (this instanceof bound) {
-
-                var result = target.apply(
-                    this,
-                    args.concat(slice.call(arguments))
-                );
-                if (Object(result) === result) {
-                    return result;
-                }
-                return this;
-
-            } else {
-                return target.apply(
-                    that,
-                    args.concat(slice.call(arguments))
-                );
-
-            }
-
-        };
-        if(target.prototype) {
-            Empty.prototype = target.prototype;
-            bound.prototype = new Empty();
-            Empty.prototype = null;
-        }
-        return bound;
-    };
-}
-var call = Function.prototype.call;
-var prototypeOfArray = Array.prototype;
-var prototypeOfObject = Object.prototype;
-var slice = prototypeOfArray.slice;
-var _toString = call.bind(prototypeOfObject.toString);
-var owns = call.bind(prototypeOfObject.hasOwnProperty);
-var defineGetter;
-var defineSetter;
-var lookupGetter;
-var lookupSetter;
-var supportsAccessors;
-if ((supportsAccessors = owns(prototypeOfObject, "__defineGetter__"))) {
-    defineGetter = call.bind(prototypeOfObject.__defineGetter__);
-    defineSetter = call.bind(prototypeOfObject.__defineSetter__);
-    lookupGetter = call.bind(prototypeOfObject.__lookupGetter__);
-    lookupSetter = call.bind(prototypeOfObject.__lookupSetter__);
-}
-if ([1,2].splice(0).length != 2) {
-    if(function() { // test IE < 9 to splice bug - see issue #138
-        function makeArray(l) {
-            var a = new Array(l+2);
-            a[0] = a[1] = 0;
-            return a;
-        }
-        var array = [], lengthBefore;
-        
-        array.splice.apply(array, makeArray(20));
-        array.splice.apply(array, makeArray(26));
-
-        lengthBefore = array.length; //46
-        array.splice(5, 0, "XXX"); // add one element
-
-        lengthBefore + 1 == array.length
-
-        if (lengthBefore + 1 == array.length) {
-            return true;// has right splice implementation without bugs
-        }
-    }()) {//IE 6/7
-        var array_splice = Array.prototype.splice;
-        Array.prototype.splice = function(start, deleteCount) {
-            if (!arguments.length) {
-                return [];
-            } else {
-                return array_splice.apply(this, [
-                    start === void 0 ? 0 : start,
-                    deleteCount === void 0 ? (this.length - start) : deleteCount
-                ].concat(slice.call(arguments, 2)))
-            }
-        };
-    } else {//IE8
-        Array.prototype.splice = function(pos, removeCount){
-            var length = this.length;
-            if (pos > 0) {
-                if (pos > length)
-                    pos = length;
-            } else if (pos == void 0) {
-                pos = 0;
-            } else if (pos < 0) {
-                pos = Math.max(length + pos, 0);
-            }
-
-            if (!(pos+removeCount < length))
-                removeCount = length - pos;
-
-            var removed = this.slice(pos, pos+removeCount);
-            var insert = slice.call(arguments, 2);
-            var add = insert.length;            
-            if (pos === length) {
-                if (add) {
-                    this.push.apply(this, insert);
-                }
-            } else {
-                var remove = Math.min(removeCount, length - pos);
-                var tailOldPos = pos + remove;
-                var tailNewPos = tailOldPos + add - remove;
-                var tailCount = length - tailOldPos;
-                var lengthAfterRemove = length - remove;
-
-                if (tailNewPos < tailOldPos) { // case A
-                    for (var i = 0; i < tailCount; ++i) {
-                        this[tailNewPos+i] = this[tailOldPos+i];
-                    }
-                } else if (tailNewPos > tailOldPos) { // case B
-                    for (i = tailCount; i--; ) {
-                        this[tailNewPos+i] = this[tailOldPos+i];
-                    }
-                } // else, add == remove (nothing to do)
-
-                if (add && pos === lengthAfterRemove) {
-                    this.length = lengthAfterRemove; // truncate array
-                    this.push.apply(this, insert);
-                } else {
-                    this.length = lengthAfterRemove + add; // reserves space
-                    for (i = 0; i < add; ++i) {
-                        this[pos+i] = insert[i];
-                    }
-                }
-            }
-            return removed;
-        };
-    }
-}
-if (!Array.isArray) {
-    Array.isArray = function isArray(obj) {
-        return _toString(obj) == "[object Array]";
-    };
-}
-var boxedString = Object("a"),
-    splitString = boxedString[0] != "a" || !(0 in boxedString);
-
-if (!Array.prototype.forEach) {
-    Array.prototype.forEach = function forEach(fun /*, thisp*/) {
-        var object = toObject(this),
-            self = splitString && _toString(this) == "[object String]" ?
-                this.split("") :
-                object,
-            thisp = arguments[1],
-            i = -1,
-            length = self.length >>> 0;
-        if (_toString(fun) != "[object Function]") {
-            throw new TypeError(); // TODO message
-        }
-
-        while (++i < length) {
-            if (i in self) {
-                fun.call(thisp, self[i], i, object);
-            }
-        }
-    };
-}
-if (!Array.prototype.map) {
-    Array.prototype.map = function map(fun /*, thisp*/) {
-        var object = toObject(this),
-            self = splitString && _toString(this) == "[object String]" ?
-                this.split("") :
-                object,
-            length = self.length >>> 0,
-            result = Array(length),
-            thisp = arguments[1];
-        if (_toString(fun) != "[object Function]") {
-            throw new TypeError(fun + " is not a function");
-        }
-
-        for (var i = 0; i < length; i++) {
-            if (i in self)
-                result[i] = fun.call(thisp, self[i], i, object);
-        }
-        return result;
-    };
-}
-if (!Array.prototype.filter) {
-    Array.prototype.filter = function filter(fun /*, thisp */) {
-        var object = toObject(this),
-            self = splitString && _toString(this) == "[object String]" ?
-                this.split("") :
-                    object,
-            length = self.length >>> 0,
-            result = [],
-            value,
-            thisp = arguments[1];
-        if (_toString(fun) != "[object Function]") {
-            throw new TypeError(fun + " is not a function");
-        }
-
-        for (var i = 0; i < length; i++) {
-            if (i in self) {
-                value = self[i];
-                if (fun.call(thisp, value, i, object)) {
-                    result.push(value);
-                }
-            }
-        }
-        return result;
-    };
-}
-if (!Array.prototype.every) {
-    Array.prototype.every = function every(fun /*, thisp */) {
-        var object = toObject(this),
-            self = splitString && _toString(this) == "[object String]" ?
-                this.split("") :
-                object,
-            length = self.length >>> 0,
-            thisp = arguments[1];
-        if (_toString(fun) != "[object Function]") {
-            throw new TypeError(fun + " is not a function");
-        }
-
-        for (var i = 0; i < length; i++) {
-            if (i in self && !fun.call(thisp, self[i], i, object)) {
-                return false;
-            }
-        }
-        return true;
-    };
-}
-if (!Array.prototype.some) {
-    Array.prototype.some = function some(fun /*, thisp */) {
-        var object = toObject(this),
-            self = splitString && _toString(this) == "[object String]" ?
-                this.split("") :
-                object,
-            length = self.length >>> 0,
-            thisp = arguments[1];
-        if (_toString(fun) != "[object Function]") {
-            throw new TypeError(fun + " is not a function");
-        }
-
-        for (var i = 0; i < length; i++) {
-            if (i in self && fun.call(thisp, self[i], i, object)) {
-                return true;
-            }
-        }
-        return false;
-    };
-}
-if (!Array.prototype.reduce) {
-    Array.prototype.reduce = function reduce(fun /*, initial*/) {
-        var object = toObject(this),
-            self = splitString && _toString(this) == "[object String]" ?
-                this.split("") :
-                object,
-            length = self.length >>> 0;
-        if (_toString(fun) != "[object Function]") {
-            throw new TypeError(fun + " is not a function");
-        }
-        if (!length && arguments.length == 1) {
-            throw new TypeError("reduce of empty array with no initial value");
-        }
-
-        var i = 0;
-        var result;
-        if (arguments.length >= 2) {
-            result = arguments[1];
-        } else {
-            do {
-                if (i in self) {
-                    result = self[i++];
-                    break;
-                }
-                if (++i >= length) {
-                    throw new TypeError("reduce of empty array with no initial value");
-                }
-            } while (true);
-        }
-
-        for (; i < length; i++) {
-            if (i in self) {
-                result = fun.call(void 0, result, self[i], i, object);
-            }
-        }
-
-        return result;
-    };
-}
-if (!Array.prototype.reduceRight) {
-    Array.prototype.reduceRight = function reduceRight(fun /*, initial*/) {
-        var object = toObject(this),
-            self = splitString && _toString(this) == "[object String]" ?
-                this.split("") :
-                object,
-            length = self.length >>> 0;
-        if (_toString(fun) != "[object Function]") {
-            throw new TypeError(fun + " is not a function");
-        }
-        if (!length && arguments.length == 1) {
-            throw new TypeError("reduceRight of empty array with no initial value");
-        }
-
-        var result, i = length - 1;
-        if (arguments.length >= 2) {
-            result = arguments[1];
-        } else {
-            do {
-                if (i in self) {
-                    result = self[i--];
-                    break;
-                }
-                if (--i < 0) {
-                    throw new TypeError("reduceRight of empty array with no initial value");
-                }
-            } while (true);
-        }
-
-        do {
-            if (i in this) {
-                result = fun.call(void 0, result, self[i], i, object);
-            }
-        } while (i--);
-
-        return result;
-    };
-}
-if (!Array.prototype.indexOf || ([0, 1].indexOf(1, 2) != -1)) {
-    Array.prototype.indexOf = function indexOf(sought /*, fromIndex */ ) {
-        var self = splitString && _toString(this) == "[object String]" ?
-                this.split("") :
-                toObject(this),
-            length = self.length >>> 0;
-
-        if (!length) {
-            return -1;
-        }
-
-        var i = 0;
-        if (arguments.length > 1) {
-            i = toInteger(arguments[1]);
-        }
-        i = i >= 0 ? i : Math.max(0, length + i);
-        for (; i < length; i++) {
-            if (i in self && self[i] === sought) {
-                return i;
-            }
-        }
-        return -1;
-    };
-}
-if (!Array.prototype.lastIndexOf || ([0, 1].lastIndexOf(0, -3) != -1)) {
-    Array.prototype.lastIndexOf = function lastIndexOf(sought /*, fromIndex */) {
-        var self = splitString && _toString(this) == "[object String]" ?
-                this.split("") :
-                toObject(this),
-            length = self.length >>> 0;
-
-        if (!length) {
-            return -1;
-        }
-        var i = length - 1;
-        if (arguments.length > 1) {
-            i = Math.min(i, toInteger(arguments[1]));
-        }
-        i = i >= 0 ? i : length - Math.abs(i);
-        for (; i >= 0; i--) {
-            if (i in self && sought === self[i]) {
-                return i;
-            }
-        }
-        return -1;
-    };
-}
-if (!Object.getPrototypeOf) {
-    Object.getPrototypeOf = function getPrototypeOf(object) {
-        return object.__proto__ || (
-            object.constructor ?
-            object.constructor.prototype :
-            prototypeOfObject
-        );
-    };
-}
-if (!Object.getOwnPropertyDescriptor) {
-    var ERR_NON_OBJECT = "Object.getOwnPropertyDescriptor called on a " +
-                         "non-object: ";
-    Object.getOwnPropertyDescriptor = function getOwnPropertyDescriptor(object, property) {
-        if ((typeof object != "object" && typeof object != "function") || object === null)
-            throw new TypeError(ERR_NON_OBJECT + object);
-        if (!owns(object, property))
-            return;
-
-        var descriptor, getter, setter;
-        descriptor =  { enumerable: true, configurable: true };
-        if (supportsAccessors) {
-            var prototype = object.__proto__;
-            object.__proto__ = prototypeOfObject;
-
-            var getter = lookupGetter(object, property);
-            var setter = lookupSetter(object, property);
-            object.__proto__ = prototype;
-
-            if (getter || setter) {
-                if (getter) descriptor.get = getter;
-                if (setter) descriptor.set = setter;
-                return descriptor;
-            }
-        }
-        descriptor.value = object[property];
-        return descriptor;
-    };
-}
-if (!Object.getOwnPropertyNames) {
-    Object.getOwnPropertyNames = function getOwnPropertyNames(object) {
-        return Object.keys(object);
-    };
-}
-if (!Object.create) {
-    var createEmpty;
-    if (Object.prototype.__proto__ === null) {
-        createEmpty = function () {
-            return { "__proto__": null };
-        };
-    } else {
-        createEmpty = function () {
-            var empty = {};
-            for (var i in empty)
-                empty[i] = null;
-            empty.constructor =
-            empty.hasOwnProperty =
-            empty.propertyIsEnumerable =
-            empty.isPrototypeOf =
-            empty.toLocaleString =
-            empty.toString =
-            empty.valueOf =
-            empty.__proto__ = null;
-            return empty;
-        }
-    }
-
-    Object.create = function create(prototype, properties) {
-        var object;
-        if (prototype === null) {
-            object = createEmpty();
-        } else {
-            if (typeof prototype != "object")
-                throw new TypeError("typeof prototype["+(typeof prototype)+"] != 'object'");
-            var Type = function () {};
-            Type.prototype = prototype;
-            object = new Type();
-            object.__proto__ = prototype;
-        }
-        if (properties !== void 0)
-            Object.defineProperties(object, properties);
-        return object;
-    };
-}
-
-function doesDefinePropertyWork(object) {
-    try {
-        Object.defineProperty(object, "sentinel", {});
-        return "sentinel" in object;
-    } catch (exception) {
-    }
-}
-if (Object.defineProperty) {
-    var definePropertyWorksOnObject = doesDefinePropertyWork({});
-    var definePropertyWorksOnDom = typeof document == "undefined" ||
-        doesDefinePropertyWork(document.createElement("div"));
-    if (!definePropertyWorksOnObject || !definePropertyWorksOnDom) {
-        var definePropertyFallback = Object.defineProperty;
-    }
-}
-
-if (!Object.defineProperty || definePropertyFallback) {
-    var ERR_NON_OBJECT_DESCRIPTOR = "Property description must be an object: ";
-    var ERR_NON_OBJECT_TARGET = "Object.defineProperty called on non-object: "
-    var ERR_ACCESSORS_NOT_SUPPORTED = "getters & setters can not be defined " +
-                                      "on this javascript engine";
-
-    Object.defineProperty = function defineProperty(object, property, descriptor) {
-        if ((typeof object != "object" && typeof object != "function") || object === null)
-            throw new TypeError(ERR_NON_OBJECT_TARGET + object);
-        if ((typeof descriptor != "object" && typeof descriptor != "function") || descriptor === null)
-            throw new TypeError(ERR_NON_OBJECT_DESCRIPTOR + descriptor);
-        if (definePropertyFallback) {
-            try {
-                return definePropertyFallback.call(Object, object, property, descriptor);
-            } catch (exception) {
-            }
-        }
-        if (owns(descriptor, "value")) {
-
-            if (supportsAccessors && (lookupGetter(object, property) ||
-                                      lookupSetter(object, property)))
-            {
-                var prototype = object.__proto__;
-                object.__proto__ = prototypeOfObject;
-                delete object[property];
-                object[property] = descriptor.value;
-                object.__proto__ = prototype;
-            } else {
-                object[property] = descriptor.value;
-            }
-        } else {
-            if (!supportsAccessors)
-                throw new TypeError(ERR_ACCESSORS_NOT_SUPPORTED);
-            if (owns(descriptor, "get"))
-                defineGetter(object, property, descriptor.get);
-            if (owns(descriptor, "set"))
-                defineSetter(object, property, descriptor.set);
-        }
-
-        return object;
-    };
-}
-if (!Object.defineProperties) {
-    Object.defineProperties = function defineProperties(object, properties) {
-        for (var property in properties) {
-            if (owns(properties, property))
-                Object.defineProperty(object, property, properties[property]);
-        }
-        return object;
-    };
-}
-if (!Object.seal) {
-    Object.seal = function seal(object) {
-        return object;
-    };
-}
-if (!Object.freeze) {
-    Object.freeze = function freeze(object) {
-        return object;
-    };
-}
-try {
-    Object.freeze(function () {});
-} catch (exception) {
-    Object.freeze = (function freeze(freezeObject) {
-        return function freeze(object) {
-            if (typeof object == "function") {
-                return object;
-            } else {
-                return freezeObject(object);
-            }
-        };
-    })(Object.freeze);
-}
-if (!Object.preventExtensions) {
-    Object.preventExtensions = function preventExtensions(object) {
-        return object;
-    };
-}
-if (!Object.isSealed) {
-    Object.isSealed = function isSealed(object) {
-        return false;
-    };
-}
-if (!Object.isFrozen) {
-    Object.isFrozen = function isFrozen(object) {
-        return false;
-    };
-}
-if (!Object.isExtensible) {
-    Object.isExtensible = function isExtensible(object) {
-        if (Object(object) === object) {
-            throw new TypeError(); // TODO message
-        }
-        var name = '';
-        while (owns(object, name)) {
-            name += '?';
-        }
-        object[name] = true;
-        var returnValue = owns(object, name);
-        delete object[name];
-        return returnValue;
-    };
-}
-if (!Object.keys) {
-    var hasDontEnumBug = true,
-        dontEnums = [
-            "toString",
-            "toLocaleString",
-            "valueOf",
-            "hasOwnProperty",
-            "isPrototypeOf",
-            "propertyIsEnumerable",
-            "constructor"
-        ],
-        dontEnumsLength = dontEnums.length;
-
-    for (var key in {"toString": null}) {
-        hasDontEnumBug = false;
-    }
-
-    Object.keys = function keys(object) {
-
-        if (
-            (typeof object != "object" && typeof object != "function") ||
-            object === null
-        ) {
-            throw new TypeError("Object.keys called on a non-object");
-        }
-
-        var keys = [];
-        for (var name in object) {
-            if (owns(object, name)) {
-                keys.push(name);
-            }
-        }
-
-        if (hasDontEnumBug) {
-            for (var i = 0, ii = dontEnumsLength; i < ii; i++) {
-                var dontEnum = dontEnums[i];
-                if (owns(object, dontEnum)) {
-                    keys.push(dontEnum);
-                }
-            }
-        }
-        return keys;
-    };
-
-}
-if (!Date.now) {
-    Date.now = function now() {
-        return new Date().getTime();
-    };
-}
-var ws = "\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003" +
-    "\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028" +
-    "\u2029\uFEFF";
-if (!String.prototype.trim || ws.trim()) {
-    ws = "[" + ws + "]";
-    var trimBeginRegexp = new RegExp("^" + ws + ws + "*"),
-        trimEndRegexp = new RegExp(ws + ws + "*$");
-    String.prototype.trim = function trim() {
-        return String(this).replace(trimBeginRegexp, "").replace(trimEndRegexp, "");
-    };
-}
-
-function toInteger(n) {
-    n = +n;
-    if (n !== n) { // isNaN
-        n = 0;
-    } else if (n !== 0 && n !== (1/0) && n !== -(1/0)) {
-        n = (n > 0 || -1) * Math.floor(Math.abs(n));
-    }
-    return n;
-}
-
-function isPrimitive(input) {
-    var type = typeof input;
-    return (
-        input === null ||
-        type === "undefined" ||
-        type === "boolean" ||
-        type === "number" ||
-        type === "string"
-    );
-}
-
-function toPrimitive(input) {
-    var val, valueOf, toString;
-    if (isPrimitive(input)) {
-        return input;
-    }
-    valueOf = input.valueOf;
-    if (typeof valueOf === "function") {
-        val = valueOf.call(input);
-        if (isPrimitive(val)) {
-            return val;
-        }
-    }
-    toString = input.toString;
-    if (typeof toString === "function") {
-        val = toString.call(input);
-        if (isPrimitive(val)) {
-            return val;
-        }
-    }
-    throw new TypeError();
-}
-var toObject = function (o) {
-    if (o == null) { // this matches both null and undefined
-        throw new TypeError("can't convert "+o+" to object");
-    }
-    return Object(o);
-};
-
-});
-
-define('ace/mode/json_worker', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/worker/mirror', 'ace/mode/json/json_parse'], function(require, exports, module) {
-
-
-var oop = require("../lib/oop");
-var Mirror = require("../worker/mirror").Mirror;
-var parse = require("./json/json_parse");
-
-var JsonWorker = exports.JsonWorker = function(sender) {
-    Mirror.call(this, sender);
-    this.setTimeout(200);
-};
-
-oop.inherits(JsonWorker, Mirror);
-
-(function() {
-
-    this.onUpdate = function() {
-        var value = this.doc.getValue();
-
-        try {
-            var result = parse(value);
-        } catch (e) {
-            var pos = this.doc.indexToPosition(e.at-1);
-            this.sender.emit("error", {
-                row: pos.row,
-                column: pos.column,
-                text: e.message,
-                type: "error"
-            });
-            return;
-        }
-        this.sender.emit("ok");
-    };
-
-}).call(JsonWorker.prototype);
-
-});
-
-define('ace/lib/oop', ['require', 'exports', 'module' ], function(require, exports, module) {
-
-
-exports.inherits = (function() {
-    var tempCtor = function() {};
-    return function(ctor, superCtor) {
-        tempCtor.prototype = superCtor.prototype;
-        ctor.super_ = superCtor.prototype;
-        ctor.prototype = new tempCtor();
-        ctor.prototype.constructor = ctor;
-    };
-}());
-
-exports.mixin = function(obj, mixin) {
-    for (var key in mixin) {
-        obj[key] = mixin[key];
-    }
-    return obj;
-};
-
-exports.implement = function(proto, mixin) {
-    exports.mixin(proto, mixin);
-};
-
-});
-define('ace/worker/mirror', ['require', 'exports', 'module' , 'ace/document', 'ace/lib/lang'], function(require, exports, module) {
-
-
-var Document = require("../document").Document;
-var lang = require("../lib/lang");
-    
-var Mirror = exports.Mirror = function(sender) {
-    this.sender = sender;
-    var doc = this.doc = new Document("");
-    
-    var deferredUpdate = this.deferredUpdate = lang.delayedCall(this.onUpdate.bind(this));
-    
-    var _self = this;
-    sender.on("change", function(e) {
-        doc.applyDeltas(e.data);
-        deferredUpdate.schedule(_self.$timeout);
-    });
-};
-
-(function() {
-    
-    this.$timeout = 500;
-    
-    this.setTimeout = function(timeout) {
-        this.$timeout = timeout;
-    };
-    
-    this.setValue = function(value) {
-        this.doc.setValue(value);
-        this.deferredUpdate.schedule(this.$timeout);
-    };
-    
-    this.getValue = function(callbackId) {
-        this.sender.callback(this.doc.getValue(), callbackId);
-    };
-    
-    this.onUpdate = function() {
-    };
-    
-}).call(Mirror.prototype);
-
-});
-
-define('ace/document', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/event_emitter', 'ace/range', 'ace/anchor'], function(require, exports, module) {
-
-
-var oop = require("./lib/oop");
-var EventEmitter = require("./lib/event_emitter").EventEmitter;
-var Range = require("./range").Range;
-var Anchor = require("./anchor").Anchor;
-
-var Document = function(text) {
-    this.$lines = [];
-    if (text.length == 0) {
-        this.$lines = [""];
-    } else if (Array.isArray(text)) {
-        this._insertLines(0, text);
-    } else {
-        this.insert({row: 0, column:0}, text);
-    }
-};
-
-(function() {
-
-    oop.implement(this, EventEmitter);
-    this.setValue = function(text) {
-        var len = this.getLength();
-        this.remove(new Range(0, 0, len, this.getLine(len-1).length));
-        this.insert({row: 0, column:0}, text);
-    };
-    this.getValue = function() {
-        return this.getAllLines().join(this.getNewLineCharacter());
-    };
-    this.createAnchor = function(row, column) {
-        return new Anchor(this, row, column);
-    };
-    if ("aaa".split(/a/).length == 0)
-        this.$split = function(text) {
-            return text.replace(/\r\n|\r/g, "\n").split("\n");
-        }
-    else
-        this.$split = function(text) {
-            return text.split(/\r\n|\r|\n/);
-        };
-
-
-    this.$detectNewLine = function(text) {
-        var match = text.match(/^.*?(\r\n|\r|\n)/m);
-        this.$autoNewLine = match ? match[1] : "\n";
-    };
-    this.getNewLineCharacter = function() {
-        switch (this.$newLineMode) {
-          case "windows":
-            return "\r\n";
-          case "unix":
-            return "\n";
-          default:
-            return this.$autoNewLine;
-        }
-    };
-
-    this.$autoNewLine = "\n";
-    this.$newLineMode = "auto";
-    this.setNewLineMode = function(newLineMode) {
-        if (this.$newLineMode === newLineMode)
-            return;
-
-        this.$newLineMode = newLineMode;
-    };
-    this.getNewLineMode = function() {
-        return this.$newLineMode;
-    };
-    this.isNewLine = function(text) {
-        return (text == "\r\n" || text == "\r" || text == "\n");
-    };
-    this.getLine = function(row) {
-        return this.$lines[row] || "";
-    };
-    this.getLines = function(firstRow, lastRow) {
-        return this.$lines.slice(firstRow, lastRow + 1);
-    };
-    this.getAllLines = function() {
-        return this.getLines(0, this.getLength());
-    };
-    this.getLength = function() {
-        return this.$lines.length;
-    };
-    this.getTextRange = function(range) {
-        if (range.start.row == range.end.row) {
-            return this.getLine(range.start.row)
-                .substring(range.start.column, range.end.column);
-        }
-        var lines = this.getLines(range.start.row, range.end.row);
-        lines[0] = (lines[0] || "").substring(range.start.column);
-        var l = lines.length - 1;
-        if (range.end.row - range.start.row == l)
-            lines[l] = lines[l].substring(0, range.end.column);
-        return lines.join(this.getNewLineCharacter());
-    };
-
-    this.$clipPosition = function(position) {
-        var length = this.getLength();
-        if (position.row >= length) {
-            position.row = Math.max(0, length - 1);
-            position.column = this.getLine(length-1).length;
-        } else if (position.row < 0)
-            position.row = 0;
-        return position;
-    };
-    this.insert = function(position, text) {
-        if (!text || text.length === 0)
-            return position;
-
-        position = this.$clipPosition(position);
-        if (this.getLength() <= 1)
-            this.$detectNewLine(text);
-
-        var lines = this.$split(text);
-        var firstLine = lines.splice(0, 1)[0];
-        var lastLine = lines.length == 0 ? null : lines.splice(lines.length - 1, 1)[0];
-
-        position = this.insertInLine(position, firstLine);
-        if (lastLine !== null) {
-            position = this.insertNewLine(position); // terminate first line
-            position = this._insertLines(position.row, lines);
-            position = this.insertInLine(position, lastLine || "");
-        }
-        return position;
-    };
-    this.insertLines = function(row, lines) {
-        if (row >= this.getLength())
-            return this.insert({row: row, column: 0}, "\n" + lines.join("\n"));
-        return this._insertLines(Math.max(row, 0), lines);
-    };
-    this._insertLines = function(row, lines) {
-        if (lines.length == 0)
-            return {row: row, column: 0};
-        if (lines.length > 0xFFFF) {
-            var end = this._insertLines(row, lines.slice(0xFFFF));
-            lines = lines.slice(0, 0xFFFF);
-        }
-
-        var args = [row, 0];
-        args.push.apply(args, lines);
-        this.$lines.splice.apply(this.$lines, args);
-
-        var range = new Range(row, 0, row + lines.length, 0);
-        var delta = {
-            action: "insertLines",
-            range: range,
-            lines: lines
-        };
-        this._emit("change", { data: delta });
-        return end || range.end;
-    };
-    this.insertNewLine = function(position) {
-        position = this.$clipPosition(position);
-        var line = this.$lines[position.row] || "";
-
-        this.$lines[position.row] = line.substring(0, position.column);
-        this.$lines.splice(position.row + 1, 0, line.substring(position.column, line.length));
-
-        var end = {
-            row : position.row + 1,
-            column : 0
-        };
-
-        var delta = {
-            action: "insertText",
-            range: Range.fromPoints(position, end),
-            text: this.getNewLineCharacter()
-        };
-        this._emit("change", { data: delta });
-
-        return end;
-    };
-    this.insertInLine = function(position, text) {
-        if (text.length == 0)
-            return position;
-
-        var line = this.$lines[position.row] || "";
-
-        this.$lines[position.row] = line.substring(0, position.column) + text
-                + line.substring(position.column);
-
-        var end = {
-            row : position.row,
-            column : position.column + text.length
-        };
-
-        var delta = {
-            action: "insertText",
-            range: Range.fromPoints(position, end),
-            text: text
-        };
-        this._emit("change", { data: delta });
-
-        return end;
-    };
-    this.remove = function(range) {
-        if (!range instanceof Range)
-            range = Range.fromPoints(range.start, range.end);
-        range.start = this.$clipPosition(range.start);
-        range.end = this.$clipPosition(range.end);
-
-        if (range.isEmpty())
-            return range.start;
-
-        var firstRow = range.start.row;
-        var lastRow = range.end.row;
-
-        if (range.isMultiLine()) {
-            var firstFullRow = range.start.column == 0 ? firstRow : firstRow + 1;
-            var lastFullRow = lastRow - 1;
-
-            if (range.end.column > 0)
-                this.removeInLine(lastRow, 0, range.end.column);
-
-            if (lastFullRow >= firstFullRow)
-                this._removeLines(firstFullRow, lastFullRow);
-
-            if (firstFullRow != firstRow) {
-                this.removeInLine(firstRow, range.start.column, this.getLine(firstRow).length);
-                this.removeNewLine(range.start.row);
-            }
-        }
-        else {
-            this.removeInLine(firstRow, range.start.column, range.end.column);
-        }
-        return range.start;
-    };
-    this.removeInLine = function(row, startColumn, endColumn) {
-        if (startColumn == endColumn)
-            return;
-
-        var range = new Range(row, startColumn, row, endColumn);
-        var line = this.getLine(row);
-        var removed = line.substring(startColumn, endColumn);
-        var newLine = line.substring(0, startColumn) + line.substring(endColumn, line.length);
-        this.$lines.splice(row, 1, newLine);
-
-        var delta = {
-            action: "removeText",
-            range: range,
-            text: removed
-        };
-        this._emit("change", { data: delta });
-        return range.start;
-    };
-    this.removeLines = function(firstRow, lastRow) {
-        if (firstRow < 0 || lastRow >= this.getLength())
-            return this.remove(new Range(firstRow, 0, lastRow + 1, 0));
-        return this._removeLines(firstRow, lastRow);
-    };
-
-    this._removeLines = function(firstRow, lastRow) {
-        var range = new Range(firstRow, 0, lastRow + 1, 0);
-        var removed = this.$lines.splice(firstRow, lastRow - firstRow + 1);
-
-        var delta = {
-            action: "removeLines",
-            range: range,
-            nl: this.getNewLineCharacter(),
-            lines: removed
-        };
-        this._emit("change", { data: delta });
-        return removed;
-    };
-    this.removeNewLine = function(row) {
-        var firstLine = this.getLine(row);
-        var secondLine = this.getLine(row+1);
-
-        var range = new Range(row, firstLine.length, row+1, 0);
-        var line = firstLine + secondLine;
-
-        this.$lines.splice(row, 2, line);
-
-        var delta = {
-            action: "removeText",
-            range: range,
-            text: this.getNewLineCharacter()
-        };
-        this._emit("change", { data: delta });
-    };
-    this.replace = function(range, text) {
-        if (!range instanceof Range)
-            range = Range.fromPoints(range.start, range.end);
-        if (text.length == 0 && range.isEmpty())
-            return range.start;
-        if (text == this.getTextRange(range))
-            return range.end;
-
-        this.remove(range);
-        if (text) {
-            var end = this.insert(range.start, text);
-        }
-        else {
-            end = range.start;
-        }
-
-        return end;
-    };
-    this.applyDeltas = function(deltas) {
-        for (var i=0; i<deltas.length; i++) {
-            var delta = deltas[i];
-            var range = Range.fromPoints(delta.range.start, delta.range.end);
-
-            if (delta.action == "insertLines")
-                this.insertLines(range.start.row, delta.lines);
-            else if (delta.action == "insertText")
-                this.insert(range.start, delta.text);
-            else if (delta.action == "removeLines")
-                this._removeLines(range.start.row, range.end.row - 1);
-            else if (delta.action == "removeText")
-                this.remove(range);
-        }
-    };
-    this.revertDeltas = function(deltas) {
-        for (var i=deltas.length-1; i>=0; i--) {
-            var delta = deltas[i];
-
-            var range = Range.fromPoints(delta.range.start, delta.range.end);
-
-            if (delta.action == "insertLines")
-                this._removeLines(range.start.row, range.end.row - 1);
-            else if (delta.action == "insertText")
-                this.remove(range);
-            else if (delta.action == "removeLines")
-                this._insertLines(range.start.row, delta.lines);
-            else if (delta.action == "removeText")
-                this.insert(range.start, delta.text);
-        }
-    };
-    this.indexToPosition = function(index, startRow) {
-        var lines = this.$lines || this.getAllLines();
-        var newlineLength = this.getNewLineCharacter().length;
-        for (var i = startRow || 0, l = lines.length; i < l; i++) {
-            index -= lines[i].length + newlineLength;
-            if (index < 0)
-                return {row: i, column: index + lines[i].length + newlineLength};
-        }
-        return {row: l-1, column: lines[l-1].length};
-    };
-    this.positionToIndex = function(pos, startRow) {
-        var lines = this.$lines || this.getAllLines();
-        var newlineLength = this.getNewLineCharacter().length;
-        var index = 0;
-        var row = Math.min(pos.row, lines.length);
-        for (var i = startRow || 0; i < row; ++i)
-            index += lines[i].length + newlineLength;
-
-        return index + pos.column;
-    };
-
-}).call(Document.prototype);
-
-exports.Document = Document;
-});
-
-define('ace/lib/event_emitter', ['require', 'exports', 'module' ], function(require, exports, module) {
-
-
-var EventEmitter = {};
-var stopPropagation = function() { this.propagationStopped = true; };
-var preventDefault = function() { this.defaultPrevented = true; };
-
-EventEmitter._emit =
-EventEmitter._dispatchEvent = function(eventName, e) {
-    this._eventRegistry || (this._eventRegistry = {});
-    this._defaultHandlers || (this._defaultHandlers = {});
-
-    var listeners = this._eventRegistry[eventName] || [];
-    var defaultHandler = this._defaultHandlers[eventName];
-    if (!listeners.length && !defaultHandler)
-        return;
-
-    if (typeof e != "object" || !e)
-        e = {};
-
-    if (!e.type)
-        e.type = eventName;
-    if (!e.stopPropagation)
-        e.stopPropagation = stopPropagation;
-    if (!e.preventDefault)
-        e.preventDefault = preventDefault;
-
-    listeners = listeners.slice();
-    for (var i=0; i<listeners.length; i++) {
-        listeners[i](e, this);
-        if (e.propagationStopped)
-            break;
-    }
-    
-    if (defaultHandler && !e.defaultPrevented)
-        return defaultHandler(e, this);
-};
-
-
-EventEmitter._signal = function(eventName, e) {
-    var listeners = (this._eventRegistry || {})[eventName];
-    if (!listeners)
-        return;
-    listeners = listeners.slice();
-    for (var i=0; i<listeners.length; i++)
-        listeners[i](e, this);
-};
-
-EventEmitter.once = function(eventName, callback) {
-    var _self = this;
-    callback && this.addEventListener(eventName, function newCallback() {
-        _self.removeEventListener(eventName, newCallback);
-        callback.apply(null, arguments);
-    });
-};
-
-
-EventEmitter.setDefaultHandler = function(eventName, callback) {
-    var handlers = this._defaultHandlers
-    if (!handlers)
-        handlers = this._defaultHandlers = {_disabled_: {}};
-    
-    if (handlers[eventName]) {
-        var old = handlers[eventName];
-        var disabled = handlers._disabled_[eventName];
-        if (!disabled)
-            handlers._disabled_[eventName] = disabled = [];
-        disabled.push(old);
-        var i = disabled.indexOf(callback);
-        if (i != -1) 
-            disabled.splice(i, 1);
-    }
-    handlers[eventName] = callback;
-};
-EventEmitter.removeDefaultHandler = function(eventName, callback) {
-    var handlers = this._defaultHandlers
-    if (!handlers)
-        return;
-    var disabled = handlers._disabled_[eventName];
-    
-    if (handlers[eventName] == callback) {
-        var old = handlers[eventName];
-        if (disabled)
-            this.setDefaultHandler(eventName, disabled.pop());
-    } else if (disabled) {
-        var i = disabled.indexOf(callback);
-        if (i != -1)
-            disabled.splice(i, 1);
-    }
-};
-
-EventEmitter.on =
-EventEmitter.addEventListener = function(eventName, callback, capturing) {
-    this._eventRegistry = this._eventRegistry || {};
-
-    var listeners = this._eventRegistry[eventName];
-    if (!listeners)
-        listeners = this._eventRegistry[eventName] = [];
-
-    if (listeners.indexOf(callback) == -1)
-        listeners[capturing ? "unshift" : "push"](callback);
-    return callback;
-};
-
-EventEmitter.off =
-EventEmitter.removeListener =
-EventEmitter.removeEventListener = function(eventName, callback) {
-    this._eventRegistry = this._eventRegistry || {};
-
-    var listeners = this._eventRegistry[eventName];
-    if (!listeners)
-        return;
-
-    var index = listeners.indexOf(callback);
-    if (index !== -1)
-        listeners.splice(index, 1);
-};
-
-EventEmitter.removeAllListeners = function(eventName) {
-    if (this._eventRegistry) this._eventRegistry[eventName] = [];
-};
-
-exports.EventEmitter = EventEmitter;
-
-});
-
-define('ace/range', ['require', 'exports', 'module' ], function(require, exports, module) {
-
-var comparePoints = function(p1, p2) {
-    return p1.row - p2.row || p1.column - p2.column;
-};
-var Range = function(startRow, startColumn, endRow, endColumn) {
-    this.start = {
-        row: startRow,
-        column: startColumn
-    };
-
-    this.end = {
-        row: endRow,
-        column: endColumn
-    };
-};
-
-(function() {
-    this.isEqual = function(range) {
-        return this.start.row === range.start.row &&
-            this.end.row === range.end.row &&
-            this.start.column === range.start.column &&
-            this.end.column === range.end.column;
-    };
-    this.toString = function() {
-        return ("Range: [" + this.start.row + "/" + this.start.column +
-            "] -> [" + this.end.row + "/" + this.end.column + "]");
-    };
-
-    this.contains = function(row, column) {
-        return this.compare(row, column) == 0;
-    };
-    this.compareRange = function(range) {
-        var cmp,
-            end = range.end,
-            start = range.start;
-
-        cmp = this.compare(end.row, end.column);
-        if (cmp == 1) {
-            cmp = this.compare(start.row, start.column);
-            if (cmp == 1) {
-                return 2;
-            } else if (cmp == 0) {
-                return 1;
-            } else {
-                return 0;
-            }
-        } else if (cmp == -1) {
-            return -2;
-        } else {
-            cmp = this.compare(start.row, start.column);
-            if (cmp == -1) {
-                return -1;
-            } else if (cmp == 1) {
-                return 42;
-            } else {
-                return 0;
-            }
-        }
-    };
-    this.comparePoint = function(p) {
-        return this.compare(p.row, p.column);
-    };
-    this.containsRange = function(range) {
-        return this.comparePoint(range.start) == 0 && this.comparePoint(range.end) == 0;
-    };
-    this.intersects = function(range) {
-        var cmp = this.compareRange(range);
-        return (cmp == -1 || cmp == 0 || cmp == 1);
-    };
-    this.isEnd = function(row, column) {
-        return this.end.row == row && this.end.column == column;
-    };
-    this.isStart = function(row, column) {
-        return this.start.row == row && this.start.column == column;
-    };
-    this.setStart = function(row, column) {
-        if (typeof row == "object") {
-            this.start.column = row.column;
-            this.start.row = row.row;
-        } else {
-            this.start.row = row;
-            this.start.column = column;
-        }
-    };
-    this.setEnd = function(row, column) {
-        if (typeof row == "object") {
-            this.end.column = row.column;
-            this.end.row = row.row;
-        } else {
-            this.end.row = row;
-            this.end.column = column;
-        }
-    };
-    this.inside = function(row, column) {
-        if (this.compare(row, column) == 0) {
-            if (this.isEnd(row, column) || this.isStart(row, column)) {
-                return false;
-            } else {
-                return true;
-            }
-        }
-        return false;
-    };
-    this.insideStart = function(row, column) {
-        if (this.compare(row, column) == 0) {
-            if (this.isEnd(row, column)) {
-                return false;
-            } else {
-                return true;
-            }
-        }
-        return false;
-    };
-    this.insideEnd = function(row, column) {
-        if (this.compare(row, column) == 0) {
-            if (this.isStart(row, column)) {
-                return false;
-            } else {
-                return true;
-            }
-        }
-        return false;
-    };
-    this.compare = function(row, column) {
-        if (!this.isMultiLine()) {
-            if (row === this.start.row) {
-                return column < this.start.column ? -1 : (column > this.end.column ? 1 : 0);
-            };
-        }
-
-        if (row < this.start.row)
-            return -1;
-
-        if (row > this.end.row)
-            return 1;
-
-        if (this.start.row === row)
-            return column >= this.start.column ? 0 : -1;
-
-        if (this.end.row === row)
-            return column <= this.end.column ? 0 : 1;
-
-        return 0;
-    };
-    this.compareStart = function(row, column) {
-        if (this.start.row == row && this.start.column == column) {
-            return -1;
-        } else {
-            return this.compare(row, column);
-        }
-    };
-    this.compareEnd = function(row, column) {
-        if (this.end.row == row && this.end.column == column) {
-            return 1;
-        } else {
-            return this.compare(row, column);
-        }
-    };
-    this.compareInside = function(row, column) {
-        if (this.end.row == row && this.end.column == column) {
-            return 1;
-        } else if (this.start.row == row && this.start.column == column) {
-            return -1;
-        } else {
-            return this.compare(row, column);
-        }
-    };
-    this.clipRows = function(firstRow, lastRow) {
-        if (this.end.row > lastRow)
-            var end = {row: lastRow + 1, column: 0};
-        else if (this.end.row < firstRow)
-            var end = {row: firstRow, column: 0};
-
-        if (this.start.row > lastRow)
-            var start = {row: lastRow + 1, column: 0};
-        else if (this.start.row < firstRow)
-            var start = {row: firstRow, column: 0};
-
-        return Range.fromPoints(start || this.start, end || this.end);
-    };
-    this.extend = function(row, column) {
-        var cmp = this.compare(row, column);
-
-        if (cmp == 0)
-            return this;
-        else if (cmp == -1)
-            var start = {row: row, column: column};
-        else
-            var end = {row: row, column: column};
-
-        return Range.fromPoints(start || this.start, end || this.end);
-    };
-
-    this.isEmpty = function() {
-        return (this.start.row === this.end.row && this.start.column === this.end.column);
-    };
-    this.isMultiLine = function() {
-        return (this.start.row !== this.end.row);
-    };
-    this.clone = function() {
-        return Range.fromPoints(this.start, this.end);
-    };
-    this.collapseRows = function() {
-        if (this.end.column == 0)
-            return new Range(this.start.row, 0, Math.max(this.start.row, this.end.row-1), 0)
-        else
-            return new Range(this.start.row, 0, this.end.row, 0)
-    };
-    this.toScreenRange = function(session) {
-        var screenPosStart = session.documentToScreenPosition(this.start);
-        var screenPosEnd = session.documentToScreenPosition(this.end);
-
-        return new Range(
-            screenPosStart.row, screenPosStart.column,
-            screenPosEnd.row, screenPosEnd.column
-        );
-    };
-    this.moveBy = function(row, column) {
-        this.start.row += row;
-        this.start.column += column;
-        this.end.row += row;
-        this.end.column += column;
-    };
-
-}).call(Range.prototype);
-Range.fromPoints = function(start, end) {
-    return new Range(start.row, start.column, end.row, end.column);
-};
-Range.comparePoints = comparePoints;
-
-Range.comparePoints = function(p1, p2) {
-    return p1.row - p2.row || p1.column - p2.column;
-};
-
-
-exports.Range = Range;
-});
-
-define('ace/anchor', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/event_emitter'], function(require, exports, module) {
-
-
-var oop = require("./lib/oop");
-var EventEmitter = require("./lib/event_emitter").EventEmitter;
-
-var Anchor = exports.Anchor = function(doc, row, column) {
-    this.$onChange = this.onChange.bind(this);
-    this.attach(doc);
-    
-    if (typeof column == "undefined")
-        this.setPosition(row.row, row.column);
-    else
-        this.setPosition(row, column);
-};
-
-(function() {
-
-    oop.implement(this, EventEmitter);
-    this.getPosition = function() {
-        return this.$clipPositionToDocument(this.row, this.column);
-    };
-    this.getDocument = function() {
-        return this.document;
-    };
-    this.$insertRight = false;
-    this.onChange = function(e) {
-        var delta = e.data;
-        var range = delta.range;
-
-        if (range.start.row == range.end.row && range.start.row != this.row)
-            return;
-
-        if (range.start.row > this.row)
-            return;
-
-        if (range.start.row == this.row && range.start.column > this.column)
-            return;
-
-        var row = this.row;
-        var column = this.column;
-        var start = range.start;
-        var end = range.end;
-
-        if (delta.action === "insertText") {
-            if (start.row === row && start.column <= column) {
-                if (start.column === column && this.$insertRight) {
-                } else if (start.row === end.row) {
-                    column += end.column - start.column;
-                } else {
-                    column -= start.column;
-                    row += end.row - start.row;
-                }
-            } else if (start.row !== end.row && start.row < row) {
-                row += end.row - start.row;
-            }
-        } else if (delta.action === "insertLines") {
-            if (start.row <= row) {
-                row += end.row - start.row;
-            }
-        } else if (delta.action === "removeText") {
-            if (start.row === row && start.column < column) {
-                if (end.column >= column)
-                    column = start.column;
-                else
-                    column = Math.max(0, column - (end.column - start.column));
-
-            } else if (start.row !== end.row && start.row < row) {
-                if (end.row === row)
-                    column = Math.max(0, column - end.column) + start.column;
-                row -= (end.row - start.row);
-            } else if (end.row === row) {
-                row -= end.row - start.row;
-                column = Math.max(0, column - end.column) + start.column;
-            }
-        } else if (delta.action == "removeLines") {
-            if (start.row <= row) {
-                if (end.row <= row)
-                    row -= end.row - start.row;
-                else {
-                    row = start.row;
-                    column = 0;
-                }
-            }
-        }
-
-        this.setPosition(row, column, true);
-    };
-    this.setPosition = function(row, column, noClip) {
-        var pos;
-        if (noClip) {
-            pos = {
-                row: row,
-                column: column
-            };
-        } else {
-            pos = this.$clipPositionToDocument(row, column);
-        }
-
-        if (this.row == pos.row && this.column == pos.column)
-            return;
-
-        var old = {
-            row: this.row,
-            column: this.column
-        };
-
-        this.row = pos.row;
-        this.column = pos.column;
-        this._emit("change", {
-            old: old,
-            value: pos
-        });
-    };
-    this.detach = function() {
-        this.document.removeEventListener("change", this.$onChange);
-    };
-    this.attach = function(doc) {
-        this.document = doc || this.document;
-        this.document.on("change", this.$onChange);
-    };
-    this.$clipPositionToDocument = function(row, column) {
-        var pos = {};
-
-        if (row >= this.document.getLength()) {
-            pos.row = Math.max(0, this.document.getLength() - 1);
-            pos.column = this.document.getLine(pos.row).length;
-        }
-        else if (row < 0) {
-            pos.row = 0;
-            pos.column = 0;
-        }
-        else {
-            pos.row = row;
-            pos.column = Math.min(this.document.getLine(pos.row).length, Math.max(0, column));
-        }
-
-        if (column < 0)
-            pos.column = 0;
-
-        return pos;
-    };
-
-}).call(Anchor.prototype);
-
-});
-
-define('ace/lib/lang', ['require', 'exports', 'module' ], function(require, exports, module) {
-
-
-exports.stringReverse = function(string) {
-    return string.split("").reverse().join("");
-};
-
-exports.stringRepeat = function (string, count) {
-    var result = '';
-    while (count > 0) {
-        if (count & 1)
-            result += string;
-
-        if (count >>= 1)
-            string += string;
-    }
-    return result;
-};
-
-var trimBeginRegexp = /^\s\s*/;
-var trimEndRegexp = /\s\s*$/;
-
-exports.stringTrimLeft = function (string) {
-    return string.replace(trimBeginRegexp, '');
-};
-
-exports.stringTrimRight = function (string) {
-    return string.replace(trimEndRegexp, '');
-};
-
-exports.copyObject = function(obj) {
-    var copy = {};
-    for (var key in obj) {
-        copy[key] = obj[key];
-    }
-    return copy;
-};
-
-exports.copyArray = function(array){
-    var copy = [];
-    for (var i=0, l=array.length; i<l; i++) {
-        if (array[i] && typeof array[i] == "object")
-            copy[i] = this.copyObject( array[i] );
-        else 
-            copy[i] = array[i];
-    }
-    return copy;
-};
-
-exports.deepCopy = function (obj) {
-    if (typeof obj != "object") {
-        return obj;
-    }
-    
-    var copy = obj.constructor();
-    for (var key in obj) {
-        if (typeof obj[key] == "object") {
-            copy[key] = this.deepCopy(obj[key]);
-        } else {
-            copy[key] = obj[key];
-        }
-    }
-    return copy;
-};
-
-exports.arrayToMap = function(arr) {
-    var map = {};
-    for (var i=0; i<arr.length; i++) {
-        map[arr[i]] = 1;
-    }
-    return map;
-
-};
-
-exports.createMap = function(props) {
-    var map = Object.create(null);
-    for (var i in props) {
-        map[i] = props[i];
-    }
-    return map;
-};
-exports.arrayRemove = function(array, value) {
-  for (var i = 0; i <= array.length; i++) {
-    if (value === array[i]) {
-      array.splice(i, 1);
-    }
-  }
-};
-
-exports.escapeRegExp = function(str) {
-    return str.replace(/([.*+?^${}()|[\]\/\\])/g, '\\$1');
-};
-
-exports.escapeHTML = function(str) {
-    return str.replace(/&/g, "&#38;").replace(/"/g, "&#34;").replace(/'/g, "&#39;").replace(/</g, "&#60;");
-};
-
-exports.getMatchOffsets = function(string, regExp) {
-    var matches = [];
-
-    string.replace(regExp, function(str) {
-        matches.push({
-            offset: arguments[arguments.length-2],
-            length: str.length
-        });
-    });
-
-    return matches;
-};
-exports.deferredCall = function(fcn) {
-
-    var timer = null;
-    var callback = function() {
-        timer = null;
-        fcn();
-    };
-
-    var deferred = function(timeout) {
-        deferred.cancel();
-        timer = setTimeout(callback, timeout || 0);
-        return deferred;
-    };
-
-    deferred.schedule = deferred;
-
-    deferred.call = function() {
-        this.cancel();
-        fcn();
-        return deferred;
-    };
-
-    deferred.cancel = function() {
-        clearTimeout(timer);
-        timer = null;
-        return deferred;
-    };
-
-    return deferred;
-};
-
-
-exports.delayedCall = function(fcn, defaultTimeout) {
-    var timer = null;
-    var callback = function() {
-        timer = null;
-        fcn();
-    };
-
-    var _self = function(timeout) {
-        timer && clearTimeout(timer);
-        timer = setTimeout(callback, timeout || defaultTimeout);
-    };
-
-    _self.delay = _self;
-    _self.schedule = function(timeout) {
-        if (timer == null)
-            timer = setTimeout(callback, timeout || 0);
-    };
-
-    _self.call = function() {
-        this.cancel();
-        fcn();
-    };
-
-    _self.cancel = function() {
-        timer && clearTimeout(timer);
-        timer = null;
-    };
-
-    _self.isPending = function() {
-        return timer;
-    };
-
-    return _self;
-};
-});
-
-define('ace/mode/json/json_parse', ['require', 'exports', 'module' ], function(require, exports, module) {
-
-    var at,     // The index of the current character
-        ch,     // The current character
-        escapee = {
-            '"':  '"',
-            '\\': '\\',
-            '/':  '/',
-            b:    '\b',
-            f:    '\f',
-            n:    '\n',
-            r:    '\r',
-            t:    '\t'
-        },
-        text,
-
-        error = function (m) {
-
-            throw {
-                name:    'SyntaxError',
-                message: m,
-                at:      at,
-                text:    text
-            };
-        },
-
-        next = function (c) {
-
-            if (c && c !== ch) {
-                error("Expected '" + c + "' instead of '" + ch + "'");
-            }
-
-            ch = text.charAt(at);
-            at += 1;
-            return ch;
-        },
-
-        number = function () {
-
-            var number,
-                string = '';
-
-            if (ch === '-') {
-                string = '-';
-                next('-');
-            }
-            while (ch >= '0' && ch <= '9') {
-                string += ch;
-                next();
-            }
-            if (ch === '.') {
-                string += '.';
-                while (next() && ch >= '0' && ch <= '9') {
-                    string += ch;
-                }
-            }
-            if (ch === 'e' || ch === 'E') {
-                string += ch;
-                next();
-                if (ch === '-' || ch === '+') {
-                    string += ch;
-                    next();
-                }
-                while (ch >= '0' && ch <= '9') {
-                    string += ch;
-                    next();
-                }
-            }
-            number = +string;
-            if (isNaN(number)) {
-                error("Bad number");
-            } else {
-                return number;
-            }
-        },
-
-        string = function () {
-
-            var hex,
-                i,
-                string = '',
-                uffff;
-
-            if (ch === '"') {
-                while (next()) {
-                    if (ch === '"') {
-                        next();
-                        return string;
-                    } else if (ch === '\\') {
-                        next();
-                        if (ch === 'u') {
-                            uffff = 0;
-                            for (i = 0; i < 4; i += 1) {
-                                hex = parseInt(next(), 16);
-                                if (!isFinite(hex)) {
-                                    break;
-                                }
-                                uffff = uffff * 16 + hex;
-                            }
-                            string += String.fromCharCode(uffff);
-                        } else if (typeof escapee[ch] === 'string') {
-                            string += escapee[ch];
-                        } else {
-                            break;
-                        }
-                    } else {
-                        string += ch;
-                    }
-                }
-            }
-            error("Bad string");
-        },
-
-        white = function () {
-
-            while (ch && ch <= ' ') {
-                next();
-            }
-        },
-
-        word = function () {
-
-            switch (ch) {
-            case 't':
-                next('t');
-                next('r');
-                next('u');
-                next('e');
-                return true;
-            case 'f':
-                next('f');
-                next('a');
-                next('l');
-                next('s');
-                next('e');
-                return false;
-            case 'n':
-                next('n');
-                next('u');
-                next('l');
-                next('l');
-                return null;
-            }
-            error("Unexpected '" + ch + "'");
-        },
-
-        value,  // Place holder for the value function.
-
-        array = function () {
-
-            var array = [];
-
-            if (ch === '[') {
-                next('[');
-                white();
-                if (ch === ']') {
-                    next(']');
-                    return array;   // empty array
-                }
-                while (ch) {
-                    array.push(value());
-                    white();
-                    if (ch === ']') {
-                        next(']');
-                        return array;
-                    }
-                    next(',');
-                    white();
-                }
-            }
-            error("Bad array");
-        },
-
-        object = function () {
-
-            var key,
-                object = {};
-
-            if (ch === '{') {
-                next('{');
-                white();
-                if (ch === '}') {
-                    next('}');
-                    return object;   // empty object
-                }
-                while (ch) {
-                    key = string();
-                    white();
-                    next(':');
-                    if (Object.hasOwnProperty.call(object, key)) {
-                        error('Duplicate key "' + key + '"');
-                    }
-                    object[key] = value();
-                    white();
-                    if (ch === '}') {
-                        next('}');
-                        return object;
-                    }
-                    next(',');
-                    white();
-                }
-            }
-            error("Bad object");
-        };
-
-    value = function () {
-
-        white();
-        switch (ch) {
-        case '{':
-            return object();
-        case '[':
-            return array();
-        case '"':
-            return string();
-        case '-':
-            return number();
-        default:
-            return ch >= '0' && ch <= '9' ? number() : word();
-        }
-    };
-
-    return function (source, reviver) {
-        var result;
-
-        text = source;
-        at = 0;
-        ch = ' ';
-        result = value();
-        white();
-        if (ch) {
-            error("Syntax error");
-        }
-
-        return typeof reviver === 'function' ? function walk(holder, key) {
-            var k, v, value = holder[key];
-            if (value && typeof value === 'object') {
-                for (k in value) {
-                    if (Object.hasOwnProperty.call(value, k)) {
-                        v = walk(value, k);
-                        if (v !== undefined) {
-                            value[k] = v;
-                        } else {
-                            delete value[k];
-                        }
-                    }
-                }
-            }
-            return reviver.call(holder, key, value);
-        }({'': result}, '') : result;
-    };
-});


[11/37] move JS tests into safety

Posted by ja...@apache.org.
http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/test/security_validation.js
----------------------------------------------------------------------
diff --git a/share/test/security_validation.js b/share/test/security_validation.js
new file mode 100644
index 0000000..14e5d04
--- /dev/null
+++ b/share/test/security_validation.js
@@ -0,0 +1,338 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+
+couchTests.security_validation = function(debug) {
+  // This tests couchdb's security and validation features. This does
+  // not test authentication, except to use test authentication code made
+  // specifically for this testing. It is a WWW-Authenticate scheme named
+  // X-Couch-Test-Auth, and the user names and passwords are hard coded
+  // on the server-side.
+  //
+  // We could have used Basic authentication, however the XMLHttpRequest
+  // implementation for Firefox and Safari, and probably other browsers are
+  // broken (Firefox always prompts the user on 401 failures, Safari gives
+  // odd security errors when using different name/passwords, perhaps due
+  // to cross site scripting prevention). These problems essentially make Basic
+  // authentication testing in the browser impossible. But while hard to
+  // test automated in the browser, Basic auth may still useful for real
+  // world use where these bugs/behaviors don't matter.
+  //
+  // So for testing purposes we are using this custom X-Couch-Test-Auth.
+  // It's identical to Basic auth, except it doesn't even base64 encode
+  // the "username:password" string, it's sent completely plain text.
+  // Firefox and Safari both deal with this correctly (which is to say
+  // they correctly do nothing special).
+
+  var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"});
+  db.deleteDb();
+  db.createDb();
+  if (debug) debugger;
+
+  run_on_modified_server(
+    [{section: "httpd",
+      key: "authentication_handlers",
+      value: "{couch_httpd_auth, special_test_authentication_handler}"},
+     {section:"httpd",
+      key: "WWW-Authenticate",
+      value:  "X-Couch-Test-Auth"}],
+
+    function () {
+      // try saving document using the wrong credentials
+      var wrongPasswordDb = new CouchDB("test_suite_db",
+        {"WWW-Authenticate": "X-Couch-Test-Auth Damien Katz:foo"}
+      );
+
+      try {
+        wrongPasswordDb.save({foo:1,author:"Damien Katz"});
+        T(false && "Can't get here. Should have thrown an error 1");
+      } catch (e) {
+        T(e.error == "unauthorized");
+        T(wrongPasswordDb.last_req.status == 401);
+      }
+
+      // test force basic login
+      var resp = wrongPasswordDb.request("GET", "/_session?basic=true");
+      var err = JSON.parse(resp.responseText);
+      T(err.error == "unauthorized");
+      T(resp.status == 401);
+
+      // Create the design doc that will run custom validation code
+      var designDoc = {
+        _id:"_design/test",
+        language: "javascript",
+        validate_doc_update: stringFun(function (newDoc, oldDoc, userCtx, secObj) {
+          if (secObj.admin_override) {
+            if (userCtx.roles.indexOf('_admin') != -1) {
+              // user is admin, they can do anything
+              return true;
+            }
+          }
+          // docs should have an author field.
+          if (!newDoc._deleted && !newDoc.author) {
+            throw {forbidden:
+                "Documents must have an author field"};
+          }
+          if (oldDoc && oldDoc.author != userCtx.name) {
+              throw {unauthorized:
+                  "You are not the author of this document. You jerk."};
+          }
+        })
+      }
+
+      // Save a document normally
+      var userDb = new CouchDB("test_suite_db",
+        {"WWW-Authenticate": "X-Couch-Test-Auth Damien Katz:pecan pie"}
+      );
+
+      T(userDb.save({_id:"testdoc", foo:1, author:"Damien Katz"}).ok);
+
+      // Attempt to save the design as a non-admin
+      try {
+        userDb.save(designDoc);
+        T(false && "Can't get here. Should have thrown an error on design doc");
+      } catch (e) {
+        T(e.error == "unauthorized");
+        T(userDb.last_req.status == 401);
+      }
+
+      // set user as the admin
+      T(db.setSecObj({
+        admins : {names : ["Damien Katz"]}
+      }).ok);
+
+      T(userDb.save(designDoc).ok);
+
+      var user2Db = new CouchDB("test_suite_db",
+        {"WWW-Authenticate": "X-Couch-Test-Auth Jan Lehnardt:apple"}
+      );
+      // Attempt to save the design as a non-admin (in replication scenario)
+      designDoc.foo = "bar";
+      designDoc._rev = "2-642e20f96624a0aae6025b4dba0c6fb2";
+      try {
+        user2Db.save(designDoc, {new_edits : false});
+        T(false && "Can't get here. Should have thrown an error on design doc");
+      } catch (e) {
+        T(e.error == "unauthorized");
+        T(user2Db.last_req.status == 401);
+      }
+
+      // test the _session API
+      var resp = userDb.request("GET", "/_session");
+      var user = JSON.parse(resp.responseText).userCtx;
+      T(user.name == "Damien Katz");
+      // test that the roles are listed properly
+      TEquals(user.roles, []);
+
+
+      // update the document
+      var doc = userDb.open("testdoc");
+      doc.foo=2;
+      T(userDb.save(doc).ok);
+
+      // Save a document that's missing an author field (before and after compaction)
+      for (var i=0; i<2; i++) {
+          try {
+              userDb.save({foo:1});
+              T(false && "Can't get here. Should have thrown an error 2");
+          } catch (e) {
+              T(e.error == "forbidden");
+              T(userDb.last_req.status == 403);
+          }
+          // compact.
+          T(db.compact().ok);
+          T(db.last_req.status == 202);
+          // compaction isn't instantaneous, loop until done
+          while (db.info().compact_running) {};
+      }
+
+      // Now attempt to update the document as a different user, Jan
+      var doc = user2Db.open("testdoc");
+      doc.foo=3;
+      try {
+        user2Db.save(doc);
+        T(false && "Can't get here. Should have thrown an error 3");
+      } catch (e) {
+        T(e.error == "unauthorized");
+        T(user2Db.last_req.status == 401);
+      }
+
+      // Now have Damien change the author to Jan
+      doc = userDb.open("testdoc");
+      doc.author="Jan Lehnardt";
+      T(userDb.save(doc).ok);
+
+      // Now update the document as Jan
+      doc = user2Db.open("testdoc");
+      doc.foo = 3;
+      T(user2Db.save(doc).ok);
+
+      // Damien can't delete it
+      try {
+        userDb.deleteDoc(doc);
+        T(false && "Can't get here. Should have thrown an error 4");
+      } catch (e) {
+        T(e.error == "unauthorized");
+        T(userDb.last_req.status == 401);
+      }
+      
+      // admin must save with author field unless admin override
+      var resp = db.request("GET", "/_session");
+      var user = JSON.parse(resp.responseText).userCtx;
+      T(user.name == null);
+      // test that we are admin
+      TEquals(user.roles, ["_admin"]);
+      
+      // can't save the doc even though we are admin
+      var doc = db.open("testdoc");
+      doc.foo=3;
+      try {
+        db.save(doc);
+        T(false && "Can't get here. Should have thrown an error 3");
+      } catch (e) {
+        T(e.error == "unauthorized");
+        T(db.last_req.status == 401);
+      }
+
+      // now turn on admin override
+      T(db.setDbProperty("_security", {admin_override : true}).ok);
+      T(db.save(doc).ok);
+
+      // try to do something lame
+      try {
+        db.setDbProperty("_security", ["foo"]);
+        T(false && "can't do this");
+      } catch(e) {}
+
+      // go back to normal
+      T(db.setDbProperty("_security", {admin_override : false}).ok);
+
+      // Now delete document
+      T(user2Db.deleteDoc(doc).ok);
+
+      // now test bulk docs
+      var docs = [{_id:"bahbah",author:"Damien Katz",foo:"bar"},{_id:"fahfah",foo:"baz"}];
+
+      // Create the docs
+      var results = db.bulkSave(docs);
+
+      T(results[0].rev)
+      T(results[0].error == undefined)
+      T(results[1].rev === undefined)
+      T(results[1].error == "forbidden")
+
+      T(db.open("bahbah"));
+      T(db.open("fahfah") == null);
+
+
+      // now all or nothing with a failure
+      var docs = [{_id:"booboo",author:"Damien Katz",foo:"bar"},{_id:"foofoo",foo:"baz"}];
+
+      // Create the docs
+      var results = db.bulkSave(docs, {all_or_nothing:true});
+
+      T(results.errors.length == 1);
+      T(results.errors[0].error == "forbidden");
+      T(db.open("booboo") == null);
+      T(db.open("foofoo") == null);
+
+      // Now test replication
+      var AuthHeaders = {"WWW-Authenticate": "X-Couch-Test-Auth Christopher Lenz:dog food"};
+      var host = CouchDB.host;
+      var dbPairs = [
+        {source:"test_suite_db_a",
+          target:"test_suite_db_b"},
+
+        {source:"test_suite_db_a",
+          target:{url: CouchDB.protocol + host + "/test_suite_db_b",
+                  headers: AuthHeaders}},
+
+        {source:{url:CouchDB.protocol + host + "/test_suite_db_a",
+                 headers: AuthHeaders},
+          target:"test_suite_db_b"},
+
+        {source:{url:CouchDB.protocol + host + "/test_suite_db_a",
+                 headers: AuthHeaders},
+         target:{url:CouchDB.protocol + host + "/test_suite_db_b",
+                 headers: AuthHeaders}},
+      ]
+      var adminDbA = new CouchDB("test_suite_db_a", {"X-Couch-Full-Commit":"false"});
+      var adminDbB = new CouchDB("test_suite_db_b", {"X-Couch-Full-Commit":"false"});
+      var dbA = new CouchDB("test_suite_db_a",
+          {"WWW-Authenticate": "X-Couch-Test-Auth Christopher Lenz:dog food"});
+      var dbB = new CouchDB("test_suite_db_b",
+          {"WWW-Authenticate": "X-Couch-Test-Auth Christopher Lenz:dog food"});
+      var xhr;
+      for (var testPair = 0; testPair < dbPairs.length; testPair++) {
+        var A = dbPairs[testPair].source
+        var B = dbPairs[testPair].target
+
+        adminDbA.deleteDb();
+        adminDbA.createDb();
+        adminDbB.deleteDb();
+        adminDbB.createDb();
+
+        // save and replicate a documents that will and will not pass our design
+        // doc validation function.
+        dbA.save({_id:"foo1",value:"a",author:"Noah Slater"});
+        dbA.save({_id:"foo2",value:"a",author:"Christopher Lenz"});
+        dbA.save({_id:"bad1",value:"a"});
+
+        T(CouchDB.replicate(A, B, {headers:AuthHeaders}).ok);
+        T(CouchDB.replicate(B, A, {headers:AuthHeaders}).ok);
+
+        T(dbA.open("foo1"));
+        T(dbB.open("foo1"));
+        T(dbA.open("foo2"));
+        T(dbB.open("foo2"));
+
+        // save the design doc to dbA
+        delete designDoc._rev; // clear rev from previous saves
+        adminDbA.save(designDoc);
+
+        // no affect on already saved docs
+        T(dbA.open("bad1"));
+
+        // Update some docs on dbB. Since the design hasn't replicated, anything
+        // is allowed.
+
+        // this edit will fail validation on replication to dbA (no author)
+        T(dbB.save({_id:"bad2",value:"a"}).ok);
+
+        // this edit will fail security on replication to dbA (wrong author
+        //  replicating the change)
+        var foo1 = dbB.open("foo1");
+        foo1.value = "b";
+        dbB.save(foo1);
+
+        // this is a legal edit
+        var foo2 = dbB.open("foo2");
+        foo2.value = "b";
+        dbB.save(foo2);
+
+        var results = CouchDB.replicate(B, A, {headers:AuthHeaders});
+
+        T(results.ok);
+
+        T(results.history[0].docs_written == 1);
+        T(results.history[0].doc_write_failures == 2);
+
+        // bad2 should not be on dbA
+        T(dbA.open("bad2") == null);
+
+        // The edit to foo1 should not have replicated.
+        T(dbA.open("foo1").value == "a");
+
+        // The edit to foo2 should have replicated.
+        T(dbA.open("foo2").value == "b");
+      }
+    });
+};

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/test/show_documents.js
----------------------------------------------------------------------
diff --git a/share/test/show_documents.js b/share/test/show_documents.js
new file mode 100644
index 0000000..618925f
--- /dev/null
+++ b/share/test/show_documents.js
@@ -0,0 +1,420 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+
+couchTests.show_documents = function(debug) {
+  var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"});
+  db.deleteDb();
+  db.createDb();
+  if (debug) debugger;
+
+  var designDoc = {
+    _id:"_design/template",
+    language: "javascript",
+    shows: {
+      "hello" : stringFun(function(doc, req) {
+        log("hello fun");
+        if (doc) {
+          return "Hello World";
+        } else {
+          if(req.id) {
+            return "New World";
+          } else {
+            return "Empty World";
+          }
+        }
+      }),
+      "just-name" : stringFun(function(doc, req) {
+        if (doc) {
+          return {
+            body : "Just " + doc.name
+          };
+        } else {
+          return {
+            body : "No such doc",
+            code : 404
+          };
+        }
+      }),
+      "json" : stringFun(function(doc, req) {
+        return {
+          json : doc
+        }
+      }),
+      "req-info" : stringFun(function(doc, req) {
+        return {
+          json : req
+        }
+      }),
+      "show-deleted" : stringFun(function(doc, req) {
+        if(doc) {
+          return doc._id;
+        } else {
+          return "No doc " + req.id;
+        }
+      }),
+      "render-error" : stringFun(function(doc, req) {
+        return noSuchVariable;
+      }),
+      "empty" : stringFun(function(doc, req) {
+          return "";
+        }),
+      "fail" : stringFun(function(doc, req) {
+        return doc._id;
+      }),
+      "no-set-etag" : stringFun(function(doc, req) {
+        return {
+          headers : {
+            "Etag" : "skipped"
+          },
+          "body" : "something"
+        }
+      }),
+      "list-api" : stringFun(function(doc, req) {
+        start({"X-Couch-Test-Header": "Yeah"});
+        send("Hey");
+      }),
+      "list-api-provides" : stringFun(function(doc, req) {
+        provides("text", function(){
+            send("foo, ");
+            send("bar, ");
+            send("baz!");
+        })
+      }),
+      "list-api-provides-and-return" : stringFun(function(doc, req) {
+        provides("text", function(){
+            send("4, ");
+            send("5, ");
+            send("6, ");
+            return "7!";
+        })
+        send("1, ");
+        send("2, ");
+        return "3, ";
+      }),
+      "list-api-mix" : stringFun(function(doc, req) {
+        start({"X-Couch-Test-Header": "Yeah"});
+        send("Hey ");
+        return "Dude";
+      }),
+      "list-api-mix-with-header" : stringFun(function(doc, req) {
+        start({"X-Couch-Test-Header": "Yeah"});
+        send("Hey ");
+        return {
+          headers: {
+            "X-Couch-Test-Header-Awesome": "Oh Yeah!"
+          },
+          body: "Dude"
+        };
+      }),
+      "accept-switch" : stringFun(function(doc, req) {
+        if (req.headers["Accept"].match(/image/)) {
+          return {
+            // a 16x16 px version of the CouchDB logo
+            "base64" :
+["iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAsV",
+"BMVEUAAAD////////////////////////5ur3rEBn////////////////wDBL/",
+"AADuBAe9EB3IEBz/7+//X1/qBQn2AgP/f3/ilpzsDxfpChDtDhXeCA76AQH/v7",
+"/84eLyWV/uc3bJPEf/Dw/uw8bRWmP1h4zxSlD6YGHuQ0f6g4XyQkXvCA36MDH6",
+"wMH/z8/yAwX64ODeh47BHiv/Ly/20dLQLTj98PDXWmP/Pz//39/wGyJ7Iy9JAA",
+"AADHRSTlMAbw8vf08/bz+Pv19jK/W3AAAAg0lEQVR4Xp3LRQ4DQRBD0QqTm4Y5",
+"zMxw/4OleiJlHeUtv2X6RbNO1Uqj9g0RMCuQO0vBIg4vMFeOpCWIWmDOw82fZx",
+"vaND1c8OG4vrdOqD8YwgpDYDxRgkSm5rwu0nQVBJuMg++pLXZyr5jnc1BaH4GT",
+"LvEliY253nA3pVhQqdPt0f/erJkMGMB8xucAAAAASUVORK5CYII="].join(''),
+            headers : {
+              "Content-Type" : "image/png",
+              "Vary" : "Accept" // we set this for proxy caches
+            }
+          };
+        } else {
+          return {
+            "body" : "accepting text requests",
+            headers : {
+              "Content-Type" : "text/html",
+              "Vary" : "Accept"
+            }
+          };
+        }
+      }),
+      "provides" : stringFun(function(doc, req) {
+        registerType("foo", "application/foo","application/x-foo");
+
+        provides("html", function() {
+          return "Ha ha, you said \"" + doc.word + "\".";
+        });
+
+        provides("foo", function() {
+          return "foofoo";
+        });
+      }),
+      "withSlash": stringFun(function(doc, req) {
+        return { json: doc }
+      }),
+      "secObj": stringFun(function(doc, req) {
+        return { json: req.secObj };
+      })
+    }
+  };
+  T(db.save(designDoc).ok);
+
+  var doc = {"word":"plankton", "name":"Rusty"}
+  var resp = db.save(doc);
+  T(resp.ok);
+  var docid = resp.id;
+
+  // show error
+  var xhr = CouchDB.request("GET", "/test_suite_db/_design/template/_show/");
+  T(xhr.status == 404, 'Should be missing');
+  T(JSON.parse(xhr.responseText).reason == "Invalid path.");
+
+  // hello template world
+  xhr = CouchDB.request("GET", "/test_suite_db/_design/template/_show/hello/"+docid);
+  T(xhr.responseText == "Hello World", "hello");
+  T(/charset=utf-8/.test(xhr.getResponseHeader("Content-Type")));
+
+
+  // Fix for COUCHDB-379
+  T(equals(xhr.getResponseHeader("Server").substr(0,7), "CouchDB"));
+
+  // // error stacktraces
+  // xhr = CouchDB.request("GET", "/test_suite_db/_design/template/_show/render-error/"+docid);
+  // T(JSON.parse(xhr.responseText).error == "render_error");
+
+  // hello template world (no docid)
+  xhr = CouchDB.request("GET", "/test_suite_db/_design/template/_show/hello");
+  T(xhr.responseText == "Empty World");
+
+  // hello template world (no docid)
+  xhr = CouchDB.request("GET", "/test_suite_db/_design/template/_show/empty");
+  T(xhr.responseText == "");
+
+  // // hello template world (non-existing docid)
+  xhr = CouchDB.request("GET", "/test_suite_db/_design/template/_show/fail/nonExistingDoc");
+  T(xhr.status == 404);
+  var resp = JSON.parse(xhr.responseText);
+  T(resp.error == "not_found");
+  
+  // show with doc
+  xhr = CouchDB.request("GET", "/test_suite_db/_design/template/_show/just-name/"+docid);
+  T(xhr.responseText == "Just Rusty");
+
+  // show with missing doc
+  xhr = CouchDB.request("GET", "/test_suite_db/_design/template/_show/just-name/missingdoc");
+  T(xhr.status == 404);
+  TEquals("No such doc", xhr.responseText);
+
+  // show with missing func
+  xhr = CouchDB.request("GET", "/test_suite_db/_design/template/_show/missing/"+docid);
+  T(xhr.status == 404, "function is missing");
+
+  // missing design doc
+  xhr = CouchDB.request("GET", "/test_suite_db/_design/missingddoc/_show/just-name/"+docid);
+  T(xhr.status == 404);
+  var resp = JSON.parse(xhr.responseText);
+  T(resp.error == "not_found");
+
+  // query parameters
+  xhr = CouchDB.request("GET", "/test_suite_db/_design/template/_show/req-info/"+docid+"?foo=bar", {
+    headers: {
+      "Accept": "text/html;text/plain;*/*",
+      "X-Foo" : "bar"
+    }
+  });
+  var resp = JSON.parse(xhr.responseText);
+  T(equals(resp.headers["X-Foo"], "bar"));
+  T(equals(resp.query, {foo:"bar"}));
+  T(equals(resp.method, "GET"));
+  T(equals(resp.path[5], docid));
+  T(equals(resp.info.db_name, "test_suite_db"));
+
+  // accept header switching
+  // different mime has different etag
+  xhr = CouchDB.request("GET", "/test_suite_db/_design/template/_show/accept-switch/"+docid, {
+    headers: {"Accept": "text/html;text/plain;*/*"}
+  });
+  var ct = xhr.getResponseHeader("Content-Type");
+  T(/text\/html/.test(ct))
+  T("Accept" == xhr.getResponseHeader("Vary"));
+  var etag = xhr.getResponseHeader("etag");
+
+  xhr = CouchDB.request("GET", "/test_suite_db/_design/template/_show/accept-switch/"+docid, {
+    headers: {"Accept": "image/png;*/*"}
+  });
+  T(xhr.responseText.match(/PNG/))
+  T("image/png" == xhr.getResponseHeader("Content-Type"));
+  var etag2 = xhr.getResponseHeader("etag");
+  T(etag2 != etag);
+
+  // proper etags
+  // show with doc
+  xhr = CouchDB.request("GET", "/test_suite_db/_design/template/_show/just-name/"+docid);
+  // extract the ETag header values
+  etag = xhr.getResponseHeader("etag");
+  // get again with etag in request
+  xhr = CouchDB.request("GET", "/test_suite_db/_design/template/_show/just-name/"+docid, {
+    headers: {"if-none-match": etag}
+  });
+  // should be 304
+  T(xhr.status == 304);
+
+  // update the doc
+  doc.name = "Crusty";
+  resp = db.save(doc);
+  T(resp.ok);
+  // req with same etag
+  xhr = CouchDB.request("GET", "/test_suite_db/_design/template/_show/just-name/"+docid, {
+    headers: {"if-none-match": etag}
+  });
+  // status is 200
+  T(xhr.status == 200);
+
+  // get new etag and request again
+  etag = xhr.getResponseHeader("etag");
+  xhr = CouchDB.request("GET", "/test_suite_db/_design/template/_show/just-name/"+docid, {
+    headers: {"if-none-match": etag}
+  });
+  // should be 304
+  T(xhr.status == 304);
+
+  // update design doc (but not function)
+  designDoc.isChanged = true;
+  T(db.save(designDoc).ok);
+
+  xhr = CouchDB.request("GET", "/test_suite_db/_design/template/_show/just-name/"+docid, {
+    headers: {"if-none-match": etag}
+  });
+  // should not be 304 if we change the doc
+  T(xhr.status != 304, "changed ddoc");
+
+  // update design doc function
+  designDoc.shows["just-name"] = stringFun(function(doc, req) {
+   return {
+     body : "Just old " + doc.name
+   };
+  });
+  T(db.save(designDoc).ok);
+
+  xhr = CouchDB.request("GET", "/test_suite_db/_design/template/_show/just-name/"+docid, {
+    headers: {"if-none-match": etag}
+  });
+  // status is 200
+  T(xhr.status == 200);
+
+
+  // JS can't set etag
+  xhr = CouchDB.request("GET", "/test_suite_db/_design/template/_show/no-set-etag/"+docid);
+  // extract the ETag header values
+  etag = xhr.getResponseHeader("etag");
+  T(etag != "skipped")
+
+  // test the provides mime matcher
+  xhr = CouchDB.request("GET", "/test_suite_db/_design/template/_show/provides/"+docid, {
+    headers: {
+      "Accept": 'text/html,application/atom+xml; q=0.9'
+    }
+  });
+  var ct = xhr.getResponseHeader("Content-Type");
+  T(/charset=utf-8/.test(ct))
+  T(/text\/html/.test(ct))
+  T(xhr.responseText == "Ha ha, you said \"plankton\".");
+
+  // registering types works
+  xhr = CouchDB.request("GET", "/test_suite_db/_design/template/_show/provides/"+docid, {
+    headers: {
+      "Accept": "application/x-foo"
+    }
+  });
+  T(xhr.getResponseHeader("Content-Type") == "application/x-foo");
+  T(xhr.responseText.match(/foofoo/));
+
+  // test the provides mime matcher without a match
+  xhr = CouchDB.request("GET", "/test_suite_db/_design/template/_show/provides/"+docid, {
+   headers: {
+     "Accept": 'text/monkeys'
+   }
+  });
+  var rs = JSON.parse(xhr.responseText);
+  T(rs.error == "not_acceptable")
+
+
+  // test inclusion of conflict state
+  var doc1 = {_id:"foo", a:1};
+  var doc2 = {_id:"foo", a:2};
+  db.save(doc1);
+
+  // create the conflict with an all_or_nothing bulk docs request
+  var docs = [doc2];
+  db.bulkSave(docs, {all_or_nothing:true});
+
+  xhr = CouchDB.request("GET", "/test_suite_db/_design/template/_show/json/foo");
+  TEquals(1, JSON.parse(xhr.responseText)._conflicts.length);
+
+  var doc3 = {_id:"a/b/c", a:1};
+  db.save(doc3);
+  xhr = CouchDB.request("GET", "/test_suite_db/_design/template/_show/withSlash/a/b/c");
+  T(xhr.status == 200);
+
+  // hello template world (non-existing docid)
+  xhr = CouchDB.request("GET", "/test_suite_db/_design/template/_show/hello/nonExistingDoc");
+  T(xhr.responseText == "New World");
+
+  // test list() compatible API
+  xhr = CouchDB.request("GET", "/test_suite_db/_design/template/_show/list-api/foo");
+  T(xhr.responseText == "Hey");
+  TEquals("Yeah", xhr.getResponseHeader("X-Couch-Test-Header"), "header should be cool");
+
+  // test list() compatible API with provides function
+  xhr = CouchDB.request("GET", "/test_suite_db/_design/template/_show/list-api-provides/foo?format=text");
+  TEquals(xhr.responseText, "foo, bar, baz!", "should join chunks to response body");
+
+  // should keep next result order: chunks + return value + provided chunks + provided return value
+  xhr = CouchDB.request("GET", "/test_suite_db/_design/template/_show/list-api-provides-and-return/foo?format=text");
+  TEquals(xhr.responseText, "1, 2, 3, 4, 5, 6, 7!", "should not break 1..7 range");
+
+  xhr = CouchDB.request("GET", "/test_suite_db/_design/template/_show/list-api-mix/foo");
+  T(xhr.responseText == "Hey Dude");
+  TEquals("Yeah", xhr.getResponseHeader("X-Couch-Test-Header"), "header should be cool");
+
+  xhr = CouchDB.request("GET", "/test_suite_db/_design/template/_show/list-api-mix-with-header/foo");
+  T(xhr.responseText == "Hey Dude");
+  TEquals("Yeah", xhr.getResponseHeader("X-Couch-Test-Header"), "header should be cool");
+  TEquals("Oh Yeah!", xhr.getResponseHeader("X-Couch-Test-Header-Awesome"), "header should be cool");
+
+  // test deleted docs
+  var doc = {_id:"testdoc",foo:1};
+  db.save(doc);
+  var xhr = CouchDB.request("GET", "/test_suite_db/_design/template/_show/show-deleted/testdoc");
+  TEquals("testdoc", xhr.responseText, "should return 'testdoc'");
+
+  db.deleteDoc(doc);
+  var xhr = CouchDB.request("GET", "/test_suite_db/_design/template/_show/show-deleted/testdoc");
+  TEquals("No doc testdoc", xhr.responseText, "should return 'no doc testdoc'");
+
+
+  run_on_modified_server(
+    [{section: "httpd",
+      key: "authentication_handlers",
+      value: "{couch_httpd_auth, special_test_authentication_handler}"},
+     {section:"httpd",
+      key: "WWW-Authenticate",
+      value:  "X-Couch-Test-Auth"}],
+
+      function() {
+        T(db.setDbProperty("_security", {foo: true}).ok);
+        T(db.save({_id:"testdoc",foo:1}).ok);
+
+        xhr = CouchDB.request("GET", "/test_suite_db/_design/template/_show/secObj");
+        var resp = JSON.parse(xhr.responseText);
+        T(resp.foo == true);
+      }
+  );
+  
+};

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/test/stats.js
----------------------------------------------------------------------
diff --git a/share/test/stats.js b/share/test/stats.js
new file mode 100644
index 0000000..87440b3
--- /dev/null
+++ b/share/test/stats.js
@@ -0,0 +1,348 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+
+couchTests.stats = function(debug) {
+
+  function newDb(name, doSetup) {
+    var db = new CouchDB(name, {"X-Couch-Full-Commit": "false"});
+    if(doSetup) {
+      db.deleteDb();
+      db.createDb();
+    }
+    return db;
+  };
+
+  function getStat(path) {
+    var stat = CouchDB.requestStats(path, true);
+    return stat ? stat.value : null;
+  };
+
+  function doView(db) {
+    var designDoc = {
+      _id:"_design/test", // turn off couch.js id escaping?
+      language: "javascript",
+      views: {
+        all_docs: {map: "function(doc) {emit(doc.integer, null);}"}
+      }
+    };
+    db.save(designDoc);
+    db.view("test/all_docs");
+  };
+
+  function runTest(path, funcs) {
+    var db = newDb("test_suite_db", true);
+    if(funcs.setup) funcs.setup(db);
+    var before = getStat(path);
+    if(funcs.run) funcs.run(db);
+    var after = getStat(path);
+    if(funcs.test) funcs.test(before, after);
+  }
+
+  if (debug) debugger;
+
+  (function() {
+    var db = newDb("test_suite_db");
+    db.deleteDb();
+  
+    var before = getStat(["couchdb", "open_databases"]);
+    db.createDb();
+    var after = getStat(["couchdb", "open_databases"]);
+    TEquals(before+1, after, "Creating a db increments open db count.");
+  })();
+  
+  runTest(["couchdb", "open_databases"], {
+    setup: function() {restartServer();},
+    run: function(db) {db.open("123");},
+    test: function(before, after) {
+      TEquals(before+1, after, "Opening a db increments open db count.");
+    }
+  });
+  
+  runTest(["couchdb", "open_databases"], {
+    run: function(db) {db.deleteDb();},
+    test: function(before, after) {
+      TEquals(before-1, after, "Deleting a db decrements open db count.");
+    }
+  });
+  
+  (function() {
+    restartServer();
+    var max = 5;
+    
+    var testFun = function() {
+      var pre_dbs = getStat(["couchdb", "open_databases"]) || 0;
+      var pre_files = getStat(["couchdb", "open_os_files"]) || 0;
+     
+      var triggered = false;
+      var db = null;
+      for(var i = 0; i < max*2; i++) {
+        while (true) {
+            try {
+              db = newDb("test_suite_db_" + i, true);
+              break;
+            } catch(e) {
+                // all_dbs_active error!
+              triggered = true;
+            }
+        }
+
+        // Trigger a delayed commit
+        db.save({_id: "" + i, "lang": "Awesome!"});
+      }
+      T(triggered, "We managed to force a all_dbs_active error.");
+      
+      var open_dbs = getStat(["couchdb", "open_databases"]);
+      TEquals(open_dbs > 0, true, "We actually opened some dbs.");
+      TEquals(max, open_dbs, "We only have max db's open.");
+      
+      for(var i = 0; i < max * 2; i++) {
+        newDb("test_suite_db_" + i).deleteDb();
+      }
+      
+      var post_dbs = getStat(["couchdb", "open_databases"]);
+      var post_files = getStat(["couchdb", "open_os_files"]);
+      TEquals(pre_dbs, post_dbs, "We have the same number of open dbs.");
+      TEquals(pre_files, post_files, "We have the same number of open files.");
+    };
+    
+    run_on_modified_server(
+      [{section: "couchdb", key: "max_dbs_open", value: "5"}],
+      testFun
+    );
+  })();
+  
+  // Just fetching the before value is the extra +1 in test
+  runTest(["couchdb", "httpd", "requests"], {
+    run: function() {CouchDB.request("GET", "/");},
+    test: function(before, after) {
+      TEquals(before+2, after, "Request counts are incremented properly.");
+    }
+  });
+  
+  runTest(["couchdb", "database_reads"], {
+    setup: function(db) {db.save({"_id": "test"});},
+    run: function(db) {db.open("test");},
+    test: function(before, after) {
+      TEquals(before+1, after, "Reading a doc increments docs reads.");
+    }
+  });
+  
+  runTest(["couchdb", "database_reads"], {
+    setup: function(db) {db.save({"_id": "test"});},
+    run: function(db) {db.request("GET", "/");},
+    test: function(before, after) {
+      TEquals(before, after, "Only doc reads increment doc reads.");
+    }
+  });
+  
+  runTest(["couchdb", "database_reads"], {
+    setup: function(db) {db.save({"_id": "test"});},
+    run: function(db) {db.open("test", {"open_revs": "all"});},
+    test: function(before, after) {
+      TEquals(before+1, after, "Reading doc revs increments docs reads.");
+    }
+  });
+  
+  runTest(["couchdb", "database_writes"], {
+    run: function(db) {db.save({"a": "1"});},
+    test: function(before, after) {
+      TEquals(before+1, after, "Saving docs incrememnts doc writes.");
+    }
+  });
+  
+  runTest(["couchdb", "database_writes"], {
+    run: function(db) {
+      CouchDB.request("POST", "/test_suite_db", {
+        headers: {"Content-Type": "application/json"},
+        body: '{"a": "1"}'
+      });
+    },
+    test: function(before, after) {
+      TEquals(before+1, after, "POST'ing new docs increments doc writes.");
+    }
+  });
+  
+  runTest(["couchdb", "database_writes"], {
+    setup: function(db) {db.save({"_id": "test"});},
+    run: function(db) {var doc = db.open("test"); db.save(doc);},
+    test: function(before, after) {
+      TEquals(before+1, after, "Updating docs incrememnts doc writes.");
+    }
+  });
+  
+  runTest(["couchdb", "database_writes"], {
+    setup: function(db) {db.save({"_id": "test"});},
+    run: function(db) {var doc = db.open("test"); db.deleteDoc(doc);},
+    test: function(before, after) {
+      TEquals(before+1, after, "Deleting docs increments doc writes.");
+    }
+  });
+  
+  runTest(["couchdb", "database_writes"], {
+    setup: function(db) {db.save({"_id": "test"});},
+    run: function(db) {
+      CouchDB.request("COPY", "/test_suite_db/test", {
+        headers: {"Destination": "copy_of_test"}
+      });
+    },
+    test: function(before, after) {
+      TEquals(before+1, after, "Copying docs increments doc writes.");
+    }
+  });
+  
+  runTest(["couchdb", "database_writes"], {
+    run: function() {
+      CouchDB.request("PUT", "/test_suite_db/bin_doc2/foo2.txt", {
+        body: "This is no base64 encoded test",
+        headers: {"Content-Type": "text/plain;charset=utf-8"}
+      });
+    },
+    test: function(before, after) {
+      TEquals(before+1, after, "Create with attachment increments doc writes.");
+    }
+  });
+  
+  runTest(["couchdb", "database_writes"], {
+    setup: function(db) {db.save({"_id": "test"});},
+    run: function(db) {
+      var doc = db.open("test");
+      CouchDB.request("PUT", "/test_suite_db/test/foo2.txt?rev=" + doc._rev, {
+        body: "This is no base64 encoded text",
+        headers: {"Content-Type": "text/plainn;charset=utf-8"}
+      });
+    },
+    test: function(before, after) {
+      TEquals(before+1, after, "Adding attachment increments doc writes.");
+    }
+  });
+  
+  runTest(["couchdb", "httpd", "bulk_requests"], {
+    run: function(db) {db.bulkSave(makeDocs(5));},
+    test: function(before, after) {
+      TEquals(before+1, after, "The bulk_requests counter is incremented.");
+    }
+  });
+  
+  runTest(["couchdb", "httpd", "view_reads"], {
+    run: function(db) {doView(db);},
+    test: function(before, after) {
+      TEquals(before+1, after, "Reading a view increments view reads.");
+    }
+  });
+  
+  runTest(["couchdb", "httpd", "view_reads"], {
+    setup: function(db) {db.save({"_id": "test"});},
+    run: function(db) {db.open("test");},
+    test: function(before, after) {
+      TEquals(before, after, "Reading a doc doesn't increment view reads.");
+    }
+  });
+  
+  runTest(["couchdb", "httpd", "temporary_view_reads"], {
+    run: function(db) { db.query(function(doc) { emit(doc._id); }); },
+    test: function(before, after) {
+      TEquals(before+1, after, "Temporary views have their own counter.");
+    }
+  });
+  
+  runTest(["couchdb", "httpd", "temporary_view_reads"], {
+    run: function(db) {doView(db);},
+    test: function(before, after) {
+      TEquals(before, after, "Permanent views don't affect temporary views.");
+    }
+  });
+  
+  runTest(["couchdb", "httpd", "view_reads"], {
+    run: function(db) { db.query(function(doc) { emit(doc._id); }); },
+    test: function(before, after) {
+      TEquals(before, after, "Temporary views don't affect permanent views.");
+    }
+  });
+  
+  // Relies on getting the stats values being GET requests.
+  runTest(["couchdb", "httpd_request_methods", "GET"], {
+    test: function(before, after) {
+      TEquals(before+1, after, "Get requests are incremented properly.");
+    }
+  });
+  
+  runTest(["couchdb", "httpd_request_methods", "GET"], {
+    run: function() {CouchDB.request("POST", "/");},
+    test: function(before, after) {
+      TEquals(before+1, after, "POST requests don't affect GET counter.");
+    }
+  });
+  
+  runTest(["couchdb", "httpd_request_methods", "POST"], {
+    run: function() {CouchDB.request("POST", "/");},
+    test: function(before, after) {
+      TEquals(before+1, after, "POST requests are incremented properly.");
+    }
+  });
+  
+  runTest(["couchdb", "httpd_status_codes", "404"], {
+    run: function() {CouchDB.request("GET", "/nonexistant_db");},
+    test: function(before, after) {
+      TEquals(before+1, after, "Increments 404 counter on db not found.");
+    }
+  });
+  
+  runTest(["couchdb", "httpd_status_codes", "404"], {
+    run: function() {CouchDB.request("GET", "/");},
+    test: function(before, after) {
+      TEquals(before, after, "Getting DB info doesn't increment 404's");
+    }
+  });
+
+  var test_metric = function(metric, expected_fields) {
+    for (var k in metric) {
+      T(expected_fields.indexOf(k) >= 0, "Unknown property name: " + k);
+    }
+    for (var k in expected_fields) {
+      T(metric[expected_fields[k]] !== undefined, "Missing required property: " + k);
+    }
+  };
+
+  var test_histogram = function(histo) {
+    test_metric(histo, ["value", "type", "desc"]);
+    test_metric(histo.value, ["min", "max", "arithmetic_mean",
+      "geometric_mean", "harmonic_mean", "median", "variance",
+       "standard_deviation", "skewness", "kurtosis", "percentile",
+       "histogram", "n"]);
+  };
+
+  var test_counter = function(counter) {
+    test_metric(counter, ["value", "desc", "type"]);
+  };
+
+  var test_metrics = function(metrics) {
+    if (metrics.type === "counter") {
+      test_counter(metrics);
+    } else if (metrics.type === "gauge") {
+      test_counter(metrics);
+    } else if (metrics.type === "histogram") {
+      test_histogram(metrics);
+    } else if (metrics.type === undefined) {
+      for (var k in metrics) {
+        test_metrics(metrics[k]);
+      }
+    }
+  };
+
+  (function() {
+    var summary = JSON.parse(CouchDB.request("GET", "/_stats", {
+      headers: {"Accept": "application/json"}
+    }).responseText);
+    T(typeof(summary) === 'object');
+    test_metrics(summary);
+  })();
+};

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/test/update_documents.js
----------------------------------------------------------------------
diff --git a/share/test/update_documents.js b/share/test/update_documents.js
new file mode 100644
index 0000000..bdb7a99
--- /dev/null
+++ b/share/test/update_documents.js
@@ -0,0 +1,235 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License.  You may obtain a copy
+// of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+// License for the specific language governing permissions and limitations under
+// the License.
+
+
+couchTests.update_documents = function(debug) {
+  var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"});
+  db.deleteDb();
+  db.createDb();
+  if (debug) debugger;
+      
+  var designDoc = {
+    _id:"_design/update",
+    language: "javascript",
+    updates: {
+      "hello" : stringFun(function(doc, req) {
+        log(doc);
+        log(req);
+        if (!doc) {
+          if (req.id) {
+            return [
+            // Creates a new document with the PUT docid,
+            { _id : req.id,
+              reqs : [req] },
+            // and returns an HTML response to the client.
+            "<p>New World</p>"];
+          };
+          //
+          return [null, "<p>Empty World</p>"];
+        };
+        // we can update the document inline
+        doc.world = "hello";
+        // we can record aspects of the request or use them in application logic.
+        doc.reqs && doc.reqs.push(req);
+        doc.edited_by = req.userCtx;
+        return [doc, "<p>hello doc</p>"];
+      }),
+      "in-place" : stringFun(function(doc, req) {
+        var field = req.query.field;
+        var value = req.query.value;
+        var message = "set "+field+" to "+value;
+        doc[field] = value;
+        return [doc, message];
+      }),
+      "form-update" : stringFun(function(doc, req) {
+        for (var field in req.form) {
+          doc[field] = req.form[field];
+        }
+        var message = "updated doc from form";
+        return [doc, message];
+      }),
+      "bump-counter" : stringFun(function(doc, req) {
+        if (!doc.counter) doc.counter = 0;
+        doc.counter += 1;
+        var message = "<h1>bumped it!</h1>";
+        return [doc, message];
+      }),
+      "error" : stringFun(function(doc, req) {
+        superFail.badCrash;
+      }),
+       "get-uuid" : stringFun(function(doc, req) {
+         return [null, req.uuid];
+       }),
+       "code-n-bump" : stringFun(function(doc,req) {
+         if (!doc.counter) doc.counter = 0;
+         doc.counter += 1;
+         var message = "<h1>bumped it!</h1>";
+         resp = {"code": 302, "body": message}
+         return [doc, resp];
+       }),
+       "resp-code" : stringFun(function(doc,req) {
+         resp = {"code": 302}
+         return [null, resp];
+       }),
+       "resp-code-and-json" : stringFun(function(doc,req) {
+         resp = {"code": 302, "json": {"ok": true}}
+         return [{"_id": req["uuid"]}, resp];
+       }),
+       "binary" : stringFun(function(doc, req) {
+         var resp = {
+           "headers" : {
+             "Content-Type" : "application/octet-stream"
+           },
+           "base64" : "aGVsbG8gd29ybGQh" // "hello world!" encoded
+         };
+         return [doc, resp];
+       }),
+      "empty" : stringFun(function(doc, req) {
+        return [{}, 'oops'];
+      })
+    }
+  };
+  T(db.save(designDoc).ok);
+  
+  var doc = {"word":"plankton", "name":"Rusty"}
+  var resp = db.save(doc);
+  T(resp.ok);
+  var docid = resp.id;
+
+  // update error
+  var xhr = CouchDB.request("POST", "/test_suite_db/_design/update/_update/");
+  T(xhr.status == 404, 'Should be missing');
+  T(JSON.parse(xhr.responseText).reason == "Invalid path.");
+  
+  // hello update world
+  xhr = CouchDB.request("PUT", "/test_suite_db/_design/update/_update/hello/"+docid);
+  T(xhr.status == 201);
+  T(xhr.responseText == "<p>hello doc</p>");
+  T(/charset=utf-8/.test(xhr.getResponseHeader("Content-Type")));
+  T(equals(docid, xhr.getResponseHeader("X-Couch-Id")));
+
+  doc = db.open(docid);
+  T(doc.world == "hello");
+
+  // Fix for COUCHDB-379
+  T(equals(xhr.getResponseHeader("Server").substr(0,7), "CouchDB"));
+
+  // hello update world (no docid)
+  xhr = CouchDB.request("POST", "/test_suite_db/_design/update/_update/hello");
+  T(xhr.status == 200);
+  T(xhr.responseText == "<p>Empty World</p>");
+
+  // no GET allowed
+  xhr = CouchDB.request("GET", "/test_suite_db/_design/update/_update/hello");
+  // T(xhr.status == 405); // TODO allow qs to throw error code as well as error message
+  T(JSON.parse(xhr.responseText).error == "method_not_allowed");
+
+  // // hello update world (non-existing docid)
+  xhr = CouchDB.request("GET", "/test_suite_db/nonExistingDoc");
+  T(xhr.status == 404);
+  xhr = CouchDB.request("PUT", "/test_suite_db/_design/update/_update/hello/nonExistingDoc");
+  T(xhr.status == 201);
+  T(xhr.responseText == "<p>New World</p>");
+  xhr = CouchDB.request("GET", "/test_suite_db/nonExistingDoc");
+  T(xhr.status == 200);
+
+  // in place update
+  xhr = CouchDB.request("PUT", "/test_suite_db/_design/update/_update/in-place/"+docid+'?field=title&value=test');
+  T(xhr.status == 201);
+  T(xhr.responseText == "set title to test");
+  doc = db.open(docid);
+  T(doc.title == "test");
+  
+  // form update via application/x-www-form-urlencoded
+  xhr = CouchDB.request("PUT", "/test_suite_db/_design/update/_update/form-update/"+docid, {
+    headers : {"Content-Type":"application/x-www-form-urlencoded"},
+    body    : "formfoo=bar&formbar=foo"
+  });
+  TEquals(201, xhr.status);
+  TEquals("updated doc from form", xhr.responseText);
+  doc = db.open(docid);
+  TEquals("bar", doc.formfoo);
+  TEquals("foo", doc.formbar);
+  
+  // bump counter
+  xhr = CouchDB.request("PUT", "/test_suite_db/_design/update/_update/bump-counter/"+docid, {
+    headers : {"X-Couch-Full-Commit":"true"}
+  });
+  T(xhr.status == 201);
+  T(xhr.responseText == "<h1>bumped it!</h1>");
+  doc = db.open(docid);
+  T(doc.counter == 1);
+  
+  // _update honors full commit if you need it to
+  xhr = CouchDB.request("PUT", "/test_suite_db/_design/update/_update/bump-counter/"+docid, {
+    headers : {"X-Couch-Full-Commit":"true"}
+  });
+  
+  var NewRev = xhr.getResponseHeader("X-Couch-Update-NewRev");
+  doc = db.open(docid);
+  T(doc['_rev'] == NewRev);
+  
+  
+  T(doc.counter == 2);
+
+  // Server provides UUID when POSTing without an ID in the URL
+  xhr = CouchDB.request("POST", "/test_suite_db/_design/update/_update/get-uuid/");
+  T(xhr.status == 200);
+  T(xhr.responseText.length == 32);
+
+  // COUCHDB-1229 - allow slashes in doc ids for update handlers
+  // /db/_design/doc/_update/handler/doc/id
+
+  var doc = {
+      _id:"with/slash",
+      counter:1
+  };
+  db.save(doc);
+  xhr = CouchDB.request("PUT", "/test_suite_db/_design/update/_update/bump-counter/with/slash");
+  TEquals(201, xhr.status, "should return a 200 status");
+  TEquals("<h1>bumped it!</h1>", xhr.responseText, "should report bumping");
+
+  var doc = db.open("with/slash");
+  TEquals(2, doc.counter, "counter should be 2");
+
+  // COUCHDB-648 - the code in the JSON response should be honored
+
+  xhr = CouchDB.request("PUT", "/test_suite_db/_design/update/_update/code-n-bump/"+docid, {
+    headers : {"X-Couch-Full-Commit":"true"}
+  });
+  T(xhr.status == 302);
+  T(xhr.responseText == "<h1>bumped it!</h1>");
+  doc = db.open(docid);
+  T(doc.counter == 3);
+
+  xhr = CouchDB.request("POST", "/test_suite_db/_design/update/_update/resp-code/");
+  T(xhr.status == 302);
+
+  xhr = CouchDB.request("POST", "/test_suite_db/_design/update/_update/resp-code-and-json/");
+  TEquals(302, xhr.status);
+  T(JSON.parse(xhr.responseText).ok);
+
+  // base64 response
+  xhr = CouchDB.request("PUT", "/test_suite_db/_design/update/_update/binary/"+docid, {
+    headers : {"X-Couch-Full-Commit":"false"},
+    body    : 'rubbish'
+  });
+  T(xhr.status == 201);
+  T(xhr.responseText == "hello world!");
+  T(/application\/octet-stream/.test(xhr.getResponseHeader("Content-Type")));
+
+  // Insert doc with empty id
+  xhr = CouchDB.request("PUT", "/test_suite_db/_design/update/_update/empty/foo");
+  TEquals(400, xhr.status);
+  TEquals("Document id must not be empty", JSON.parse(xhr.responseText).reason);
+
+};

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/test/users_db.js
----------------------------------------------------------------------
diff --git a/share/test/users_db.js b/share/test/users_db.js
new file mode 100644
index 0000000..56dae6b
--- /dev/null
+++ b/share/test/users_db.js
@@ -0,0 +1,173 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License.  You may obtain a copy
+// of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+// License for the specific language governing permissions and limitations under
+// the License.
+
+couchTests.users_db = function(debug) {
+  // This tests the users db, especially validations
+  // this should also test that you can log into the couch
+  
+  var usersDb = new CouchDB("test_suite_users", {"X-Couch-Full-Commit":"false"});
+
+  // test that you can treat "_user" as a db-name
+  // this can complicate people who try to secure the users db with 
+  // an http proxy and fail to get both the actual db and the _user path
+  // maybe it's not the right approach...
+  // hard to know what else to do, as we don't let non-admins inspect the config
+  // to determine the actual users db name.
+
+  function testFun() {
+    // test that the validation function is installed
+    var ddoc = usersDb.open("_design/_auth");
+    T(ddoc.validate_doc_update);
+    
+    // test that you can login as a user using basic auth
+    var jchrisUserDoc = CouchDB.prepareUserDoc({
+      name: "jchris@apache.org"
+    }, "funnybone");
+    T(usersDb.save(jchrisUserDoc).ok);
+    
+    T(CouchDB.session().userCtx.name == null);
+
+    // test that you can use basic auth aginst the users db
+    var s = CouchDB.session({
+      headers : {
+        //                 base64_encode("jchris@apache.org:funnybone")
+        "Authorization" : "Basic amNocmlzQGFwYWNoZS5vcmc6ZnVubnlib25l"
+      }
+    });
+    T(s.userCtx.name == "jchris@apache.org");
+    T(s.info.authenticated == "default");
+    T(s.info.authentication_db == "test_suite_users");
+    TEquals(["oauth", "cookie", "default"], s.info.authentication_handlers);
+    var s = CouchDB.session({
+      headers : {
+        "Authorization" : "Basic Xzpf" // name and pass of _:_
+      }
+    });
+    T(s.name == null);
+    T(s.info.authenticated == "default");
+    
+    
+    // ok, now create a conflicting edit on the jchris doc, and make sure there's no login.
+    var jchrisUser2 = JSON.parse(JSON.stringify(jchrisUserDoc));
+    jchrisUser2.foo = "bar";
+    T(usersDb.save(jchrisUser2).ok);
+    try {
+      usersDb.save(jchrisUserDoc);
+      T(false && "should be an update conflict");
+    } catch(e) {
+      T(true);
+    }
+    // save as bulk with new_edits=false to force conflict save
+    var resp = usersDb.bulkSave([jchrisUserDoc],{all_or_nothing : true});
+    
+    var jchrisWithConflict = usersDb.open(jchrisUserDoc._id, {conflicts : true});
+    T(jchrisWithConflict._conflicts.length == 1);
+    
+    // no login with conflicted user doc
+    try {
+      var s = CouchDB.session({
+        headers : {
+          "Authorization" : "Basic amNocmlzQGFwYWNoZS5vcmc6ZnVubnlib25l"
+        }
+      });
+      T(false && "this will throw");
+    } catch(e) {
+      T(e.error == "unauthorized");
+      T(/conflict/.test(e.reason));
+    }
+
+    // you can delete a user doc
+    s = CouchDB.session().userCtx;
+    T(s.name == null);
+    T(s.roles.indexOf("_admin") !== -1);
+    T(usersDb.deleteDoc(jchrisWithConflict).ok);
+
+    // you can't change doc from type "user"
+    jchrisUserDoc = usersDb.open(jchrisUserDoc._id);
+    jchrisUserDoc.type = "not user";
+    try {
+      usersDb.save(jchrisUserDoc);
+      T(false && "should only allow us to save doc when type == 'user'");
+    } catch(e) {
+      T(e.reason == "doc.type must be user");
+    }
+    jchrisUserDoc.type = "user";
+
+    // "roles" must be an array
+    jchrisUserDoc.roles = "not an array";
+    try {
+      usersDb.save(jchrisUserDoc);
+      T(false && "should only allow us to save doc when roles is an array");
+    } catch(e) {
+      T(e.reason == "doc.roles must be an array");
+    }
+    jchrisUserDoc.roles = [];
+
+    // "roles" must be an array of strings
+    jchrisUserDoc.roles = [12];
+    try {
+      usersDb.save(jchrisUserDoc);
+      T(false && "should only allow us to save doc when roles is an array of strings");
+    } catch(e) {
+      TEquals(e.reason, "doc.roles can only contain strings");
+    }
+    jchrisUserDoc.roles = [];
+
+    // "roles" must exist
+    delete jchrisUserDoc.roles;
+    try {
+      usersDb.save(jchrisUserDoc);
+      T(false && "should only allow us to save doc when roles exists");
+    } catch(e) {
+      T(e.reason == "doc.roles must exist");
+    }
+    jchrisUserDoc.roles = [];
+
+    // character : is not allowed in usernames
+    var joeUserDoc = CouchDB.prepareUserDoc({
+      name: "joe:erlang"
+    }, "qwerty");
+    try {
+      usersDb.save(joeUserDoc);
+      T(false, "shouldn't allow : in usernames");
+    } catch(e) {
+      TEquals("Character `:` is not allowed in usernames.", e.reason);
+    }
+
+    // test that you can login as a user with a password starting with :
+    var doc = CouchDB.prepareUserDoc({
+      name: "foo@example.org"
+    }, ":bar");
+    T(usersDb.save(doc).ok);
+
+    T(CouchDB.session().userCtx.name == null);
+
+    // test that you can use basic auth aginst the users db
+    var s = CouchDB.session({
+      headers : {
+        //                 base64_encode("foo@example.org::bar")
+        "Authorization" : "Basic Zm9vQGV4YW1wbGUub3JnOjpiYXI="
+      }
+    });
+    T(s.userCtx.name == "foo@example.org");
+
+  };
+
+  usersDb.deleteDb();
+  run_on_modified_server(
+    [{section: "couch_httpd_auth",
+      key: "authentication_db", value: usersDb.name}],
+    testFun
+  );
+  usersDb.deleteDb(); // cleanup
+  
+}

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/test/users_db_security.js
----------------------------------------------------------------------
diff --git a/share/test/users_db_security.js b/share/test/users_db_security.js
new file mode 100644
index 0000000..f2ca8bc
--- /dev/null
+++ b/share/test/users_db_security.js
@@ -0,0 +1,423 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+
+couchTests.users_db_security = function(debug) {
+  var usersDb = new CouchDB("test_suite_users", {"X-Couch-Full-Commit":"false"});
+  if (debug) debugger;
+
+  function wait(ms) {
+    var t0 = new Date(), t1;
+    do {
+      CouchDB.request("GET", "/");
+      t1 = new Date();
+    } while ((t1 - t0) <= ms);
+  }
+
+  var loginUser = function(username) {
+    var pws = {
+      jan: "apple",
+      jchris: "mp3",
+      jchris1: "couch",
+      fdmanana: "foobar",
+      benoitc: "test"
+    };
+    var username1 = username.replace(/[0-9]$/, "");
+    var password = pws[username];
+    T(CouchDB.login(username1, pws[username]).ok);
+  };
+
+  var open_as = function(db, docId, username) {
+    loginUser(username);
+    try {
+      return db.open(docId, {"anti-cache": Math.round(Math.random() * 100000)});
+    } finally {
+      CouchDB.logout();
+    }
+  };
+
+  var view_as = function(db, viewname, username) {
+    loginUser(username);
+    try {
+      return db.view(viewname);
+    } finally {
+      CouchDB.logout();
+    }
+  };
+
+  var save_as = function(db, doc, username)
+  {
+    loginUser(username);
+    try {
+      return db.save(doc);
+    } catch (ex) {
+      return ex;
+    } finally {
+      CouchDB.logout();
+    }
+  };
+
+  var changes_as = function(db, username)
+  {
+    loginUser(username);
+    try {
+      return db.changes();
+    } catch(ex) {
+      return ex;
+    } finally {
+      CouchDB.logout();
+    }
+  };
+
+  var testFun = function()
+  {
+
+    // _users db
+    // a doc with a field 'password' should be hashed to 'derived_key'
+    //  with salt and salt stored in 'salt', 'password' is set to null.
+    //  Exising 'derived_key' and 'salt' fields are overwritten with new values
+    //  when a non-null 'password' field exists.
+    // anonymous should be able to create a user document
+    var userDoc = {
+      _id: "org.couchdb.user:jchris",
+      type: "user",
+      name: "jchris",
+      password: "mp3",
+      roles: []
+    };
+
+    // jan's gonna be admin as he's the first user
+    TEquals(true, usersDb.save(userDoc).ok, "should save document");
+    userDoc = usersDb.open("org.couchdb.user:jchris");
+    TEquals(undefined, userDoc.password, "password field should be null 1");
+    TEquals(40, userDoc.derived_key.length, "derived_key should exist");
+    TEquals(32, userDoc.salt.length, "salt should exist");
+
+    // create server admin
+    run_on_modified_server([
+        {
+          section: "couch_httpd_auth",
+          key: "iterations",
+          value: "1"
+        },
+        {
+          section: "admins",
+          key: "jan",
+          value: "apple"
+        }
+      ], function() {
+
+      // anonymous should not be able to read an existing user's user document
+      var res = usersDb.open("org.couchdb.user:jchris");
+      TEquals(null, res, "anonymous user doc read should be not found");
+
+      // anonymous should not be able to read /_users/_changes
+      try {
+        var ch = usersDb.changes();
+        T(false, "anonymous can read _changes");
+      } catch(e) {
+        TEquals("unauthorized", e.error, "anoymous can't read _changes");
+      }
+
+      // user should be able to read their own document
+      var jchrisDoc = open_as(usersDb, "org.couchdb.user:jchris", "jchris");
+      TEquals("org.couchdb.user:jchris", jchrisDoc._id);
+
+      // user should not be able to read /_users/_changes
+      var changes = changes_as(usersDb, "jchris");
+      TEquals("unauthorized", changes.error, "user can't read _changes");
+
+      // new 'password' fields should trigger new hashing routine
+      jchrisDoc.password = "couch";
+
+      TEquals(true, save_as(usersDb, jchrisDoc, "jchris").ok);
+      wait(100);
+      var jchrisDoc = open_as(usersDb, "org.couchdb.user:jchris", "jchris1");
+
+      TEquals(undefined, jchrisDoc.password, "password field should be null 2");
+      TEquals(40, jchrisDoc.derived_key.length, "derived_key should exist");
+      TEquals(32, jchrisDoc.salt.length, "salt should exist");
+
+      TEquals(true, userDoc.salt != jchrisDoc.salt, "should have new salt");
+      TEquals(true, userDoc.derived_key != jchrisDoc.derived_key,
+        "should have new derived_key");
+
+      // SHA-1 password hashes are upgraded to PBKDF2 on successful
+      // authentication
+      var rnewsonDoc = {
+        _id: "org.couchdb.user:rnewson",
+        type: "user",
+        name: "rnewson",
+        // password: "plaintext_password",
+        password_sha: "e29dc3aeed5abf43185c33e479f8998558c59474",
+        salt: "24f1e0a87c2e374212bda1073107e8ae",
+        roles: []
+      };
+
+      var password_sha = rnewsonDoc.password_sha,
+        salt = rnewsonDoc.salt,
+        derived_key,
+        iterations;
+
+      usersDb.save(rnewsonDoc);
+      rnewsonDoc = open_as(usersDb, rnewsonDoc._id, "jan");
+      T(!rnewsonDoc.password_scheme);
+      T(!rnewsonDoc.derived_key);
+      T(!rnewsonDoc.iterations);
+
+      // check that we don't upgrade when the password is wrong
+      TEquals("unauthorized", CouchDB.login("rnewson", "wrong_password").error);
+      rnewsonDoc = open_as(usersDb, rnewsonDoc._id, "jan");
+      TEquals(salt, rnewsonDoc.salt);
+      TEquals(password_sha, rnewsonDoc.password_sha);
+      T(!rnewsonDoc.password_scheme);
+      T(!rnewsonDoc.derived_key);
+      T(!rnewsonDoc.iterations);
+
+      TEquals(true, CouchDB.login("rnewson", "plaintext_password").ok);
+      rnewsonDoc = usersDb.open(rnewsonDoc._id);
+      TEquals("pbkdf2", rnewsonDoc.password_scheme);
+      T(rnewsonDoc.salt != salt);
+      T(!rnewsonDoc.password_sha);
+      T(rnewsonDoc.derived_key);
+      T(rnewsonDoc.iterations);
+
+      salt = rnewsonDoc.salt,
+      derived_key = rnewsonDoc.derived_key,
+      iterations = rnewsonDoc.iterations;
+
+      // check that authentication is still working
+      // and everything is staying the same now
+      CouchDB.logout();
+      TEquals(true, CouchDB.login("rnewson", "plaintext_password").ok);
+      rnewsonDoc = usersDb.open(rnewsonDoc._id);
+      TEquals("pbkdf2", rnewsonDoc.password_scheme);
+      TEquals(salt, rnewsonDoc.salt);
+      T(!rnewsonDoc.password_sha);
+      TEquals(derived_key, rnewsonDoc.derived_key);
+      TEquals(iterations, rnewsonDoc.iterations);
+
+      CouchDB.logout();
+
+      // user should not be able to read another user's user document
+      var fdmananaDoc = {
+        _id: "org.couchdb.user:fdmanana",
+        type: "user",
+        name: "fdmanana",
+        password: "foobar",
+        roles: []
+      };
+
+      usersDb.save(fdmananaDoc);
+
+      var fdmananaDocAsReadByjchris =
+        open_as(usersDb, "org.couchdb.user:fdmanana", "jchris1");
+      TEquals(null, fdmananaDocAsReadByjchris,
+        "should not_found opening another user's user doc");
+
+
+      // save a db admin
+      var benoitcDoc = {
+        _id: "org.couchdb.user:benoitc",
+        type: "user",
+        name: "benoitc",
+        password: "test",
+        roles: ["user_admin"]
+      };
+      save_as(usersDb, benoitcDoc, "jan");
+
+      TEquals(true, CouchDB.login("jan", "apple").ok);
+      T(usersDb.setSecObj({
+        "admins" : {
+          roles : [],
+          names : ["benoitc"]
+        }
+      }).ok);
+      CouchDB.logout();
+
+      // user should not be able to read from any view
+      var ddoc = {
+        _id: "_design/user_db_auth",
+        views: {
+          test: {
+            map: "function(doc) { emit(doc._id, null); }"
+          }
+        }
+      };
+
+      save_as(usersDb, ddoc, "jan");
+
+      try {
+        usersDb.view("user_db_auth/test");
+        T(false, "user had access to view in admin db");
+      } catch(e) {
+        TEquals("forbidden", e.error,
+        "non-admins should not be able to read a view");
+      }
+
+      // admin should be able to read from any view
+      var result = view_as(usersDb, "user_db_auth/test", "jan");
+      TEquals(4, result.total_rows, "should allow access and list four users to admin");
+
+      // db admin should be able to read from any view
+      var result = view_as(usersDb, "user_db_auth/test", "benoitc");
+      TEquals(4, result.total_rows, "should allow access and list four users to db admin");
+
+
+      // non-admins can't read design docs
+      try {
+        open_as(usersDb, "_design/user_db_auth", "jchris1");
+        T(false, "non-admin read design doc, should not happen");
+      } catch(e) {
+        TEquals("forbidden", e.error, "non-admins can't read design docs");
+      }
+
+      // admin should be able to read and edit any user doc
+      fdmananaDoc.password = "mobile";
+      var result = save_as(usersDb, fdmananaDoc, "jan");
+      TEquals(true, result.ok, "admin should be able to update any user doc");
+
+      // admin should be able to read and edit any user doc
+      fdmananaDoc.password = "mobile1";
+      var result = save_as(usersDb, fdmananaDoc, "benoitc");
+      TEquals(true, result.ok, "db admin by role should be able to update any user doc");
+
+      TEquals(true, CouchDB.login("jan", "apple").ok);
+      T(usersDb.setSecObj({
+        "admins" : {
+          roles : ["user_admin"],
+          names : []
+        }
+      }).ok);
+      CouchDB.logout();
+
+      // db admin should be able to read and edit any user doc
+      fdmananaDoc.password = "mobile2";
+      var result = save_as(usersDb, fdmananaDoc, "benoitc");
+      TEquals(true, result.ok, "db admin should be able to update any user doc");
+
+      // ensure creation of old-style docs still works
+      var robertDoc = CouchDB.prepareUserDoc({ name: "robert" }, "anchovy");
+      var result = usersDb.save(robertDoc);
+      TEquals(true, result.ok, "old-style user docs should still be accepted");
+
+      // log in one last time so run_on_modified_server can clean up the admin account
+      TEquals(true, CouchDB.login("jan", "apple").ok);
+    });
+
+    run_on_modified_server([
+        {
+          section: "couch_httpd_auth",
+          key: "iterations",
+          value: "1"
+        },
+        {
+          section: "couch_httpd_auth",
+          key: "public_fields",
+          value: "name,type"
+        },
+        {
+          section: "couch_httpd_auth",
+          key: "users_db_public",
+          value: "true"
+        },
+        {
+          section: "admins",
+          key: "jan",
+          value: "apple"
+        }
+      ], function() {
+        var res = usersDb.open("org.couchdb.user:jchris");
+        TEquals("jchris", res.name);
+        TEquals("user", res.type);
+        TEquals(undefined, res.roles);
+        TEquals(undefined, res.salt);
+        TEquals(undefined, res.password_scheme);
+        TEquals(undefined, res.derived_key);
+
+        TEquals(true, CouchDB.login("jchris", "couch").ok);
+
+        var all = usersDb.allDocs({ include_docs: true });
+        T(all.rows);
+        if (all.rows) {
+          T(all.rows.every(function(row) {
+            if (row.doc) {
+              return Object.keys(row.doc).every(function(key) {
+                return key === 'name' || key === 'type';
+              });
+            } else {
+              if(row.id[0] == "_") {
+                // ignore design docs
+                return true
+              } else {
+                return false;
+              }
+            }
+          }));
+        }
+      // log in one last time so run_on_modified_server can clean up the admin account
+      TEquals(true, CouchDB.login("jan", "apple").ok);
+    });
+
+    run_on_modified_server([
+      {
+        section: "couch_httpd_auth",
+        key: "iterations",
+        value: "1"
+      },
+      {
+        section: "couch_httpd_auth",
+        key: "public_fields",
+        value: "name"
+      },
+      {
+        section: "couch_httpd_auth",
+        key: "users_db_public",
+        value: "false"
+      },
+      {
+        section: "admins",
+        key: "jan",
+        value: "apple"
+      }
+    ], function() {
+      TEquals(true, CouchDB.login("jchris", "couch").ok);
+
+      try {
+        var all = usersDb.allDocs({ include_docs: true });
+        T(false); // should never hit
+      } catch(e) {
+        TEquals("forbidden", e.error, "should throw");
+      }
+
+      // COUCHDB-1888 make sure admins always get all fields
+      TEquals(true, CouchDB.login("jan", "apple").ok);
+      var all_admin = usersDb.allDocs({ include_docs: "true" });
+      TEquals("user", all_admin.rows[2].doc.type,
+          "should return type");
+
+
+      // log in one last time so run_on_modified_server can clean up the admin account
+      TEquals(true, CouchDB.login("jan", "apple").ok);
+    });
+  };
+
+  usersDb.deleteDb();
+  run_on_modified_server(
+    [{section: "couch_httpd_auth",
+      key: "iterations", value: "1"},
+     {section: "couch_httpd_auth",
+      key: "authentication_db", value: usersDb.name}],
+    testFun
+  );
+  usersDb.deleteDb(); // cleanup
+
+};

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/test/utf8.js
----------------------------------------------------------------------
diff --git a/share/test/utf8.js b/share/test/utf8.js
new file mode 100644
index 0000000..04f6313
--- /dev/null
+++ b/share/test/utf8.js
@@ -0,0 +1,42 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+
+couchTests.utf8 = function(debug) {
+  var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"});
+  db.deleteDb();
+  db.createDb();
+  if (debug) debugger;
+
+  var texts = [];
+
+  texts[0] = "1. Ascii: hello"
+  texts[1] = "2. Russian: На берегу пустынных волн"
+  texts[2] = "3. Math: ∮ E⋅da = Q,  n → ∞, ∑ f(i) = ∏ g(i),"
+  texts[3] = "4. Geek: STARGΛ̊TE SG-1"
+  texts[4] = "5. Braille: ⡌⠁⠧⠑ ⠼⠁⠒  ⡍⠜⠇⠑⠹⠰⠎ ⡣⠕⠌"
+  texts[5] = "6. null \u0000 byte" 
+
+  // check that we can save a reload with full fidelity
+  for (var i=0; i<texts.length; i++) {
+    T(db.save({_id:i.toString(), text:texts[i]}).ok);
+  }
+
+  for (var i=0; i<texts.length; i++) {
+    T(db.open(i.toString()).text == texts[i]);
+  }
+
+  // check that views and key collation don't blow up
+  var rows = db.query(function(doc) { emit(null, doc.text) }).rows;
+  for (var i=0; i<texts.length; i++) {
+    T(rows[i].value == texts[i]);
+  }
+};

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/test/uuids.js
----------------------------------------------------------------------
diff --git a/share/test/uuids.js b/share/test/uuids.js
new file mode 100644
index 0000000..d304c4e
--- /dev/null
+++ b/share/test/uuids.js
@@ -0,0 +1,149 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+
+couchTests.uuids = function(debug) {
+  var etags = [];
+  var testHashBustingHeaders = function(xhr) {
+    T(xhr.getResponseHeader("Cache-Control").match(/no-cache/));
+    T(xhr.getResponseHeader("Pragma") == "no-cache");
+
+    var newetag = xhr.getResponseHeader("ETag");
+    T(etags.indexOf(newetag) < 0);
+    etags[etags.length] = newetag;
+    
+    // Removing the time based tests as they break easily when
+    // running CouchDB on a remote server in regards to the browser
+    // running the Futon test suite.
+    //
+    //var currentTime = new Date();
+    //var expiresHeader = Date.parse(xhr.getResponseHeader("Expires"));
+    //var dateHeader = Date.parse(xhr.getResponseHeader("Date"));
+
+    //T(expiresHeader < currentTime);
+    //T(currentTime - dateHeader < 3000);
+  };
+
+  var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"});
+  db.deleteDb();
+  db.createDb();
+  if (debug) debugger;
+
+  // a single UUID without an explicit count
+  var xhr = CouchDB.request("GET", "/_uuids");
+  T(xhr.status == 200);
+  var result = JSON.parse(xhr.responseText);
+  T(result.uuids.length == 1);
+  var first = result.uuids[0];
+  testHashBustingHeaders(xhr);
+
+  // a single UUID with an explicit count
+  xhr = CouchDB.request("GET", "/_uuids?count=1");
+  T(xhr.status == 200);
+  result = JSON.parse(xhr.responseText);
+  T(result.uuids.length == 1);
+  var second = result.uuids[0];
+  T(first != second);
+
+  // no collisions with 1,000 UUIDs
+  xhr = CouchDB.request("GET", "/_uuids?count=1000");
+  T(xhr.status == 200);
+  result = JSON.parse(xhr.responseText);
+  T( result.uuids.length == 1000 );
+  var seen = {};
+  for(var i in result.uuids) {
+    var id = result.uuids[i];
+    T(seen[id] === undefined);
+    seen[id] = 1;
+  }
+
+  // ensure we return a 405 on POST
+  xhr = CouchDB.request("POST", "/_uuids?count=1000");
+  T(xhr.status == 405);
+
+  // Test sequential uuids
+  var seq_testfun = function() {
+    xhr = CouchDB.request("GET", "/_uuids?count=1000");
+    T(xhr.status == 200);
+    result = JSON.parse(xhr.responseText);
+    for(var i = 1; i < result.uuids.length; i++) {
+      T(result.uuids[i].length == 32);
+      T(result.uuids[i-1] < result.uuids[i], "Sequential uuids are ordered.");
+    }
+  };
+
+  // test max_uuid_count
+  var xhr = CouchDB.request("GET", "/_uuids?count=1001");
+  TEquals(403, xhr.status, "should error when count > max_count");
+
+  run_on_modified_server([{
+      "section": "uuids",
+      "key": "algorithm",
+      "value": "sequential",
+    }],
+    seq_testfun
+  );
+
+  // Test utc_random uuids
+  var utc_testfun = function() {
+    xhr = CouchDB.request("GET", "/_uuids?count=1000");
+    T(xhr.status == 200);
+    result = JSON.parse(xhr.responseText);
+    T(result.uuids[1].length == 32);
+
+    // no collisions
+    var seen = {};
+    for(var i in result.uuids) {
+      var id = result.uuids[i];
+      T(seen[id] === undefined);
+      seen[id] = 1;
+    }
+
+    // roughly ordered
+    var u1 = result.uuids[1].substr(0, 13);
+    var u2 = result.uuids[result.uuids.length-1].substr(0, 13);
+    T(u1 < u2, "UTC uuids are only roughly ordered, so this assertion may fail occasionally. Don't sweat it.");
+  };
+
+  run_on_modified_server([{
+      "section": "uuids",
+      "key": "algorithm",
+      "value": "utc_random"
+    }],
+    utc_testfun
+  );
+
+  // Test utc_id uuids
+  var utc_id_suffix = "frog";
+  var suffix_testfun = function() {
+    xhr = CouchDB.request("GET", "/_uuids?count=10");
+    T(xhr.status == 200);
+    result = JSON.parse(xhr.responseText);
+    for(var i = 1; i < result.uuids.length; i++) {
+      T(result.uuids[i].length == 14 + utc_id_suffix.length);
+      T(result.uuids[i].substring(14) == utc_id_suffix);
+      T(result.uuids[i-1] < result.uuids[i], "utc_id_suffix uuids are ordered.");
+    }
+  };
+
+  run_on_modified_server([{
+      "section": "uuids",
+      "key": "algorithm",
+      "value": "utc_id"
+    }, {
+      "section": "uuids",
+      "key": "utc_id_suffix",
+      "value": utc_id_suffix
+    }],
+    suffix_testfun
+  );
+
+ };

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/test/view_collation.js
----------------------------------------------------------------------
diff --git a/share/test/view_collation.js b/share/test/view_collation.js
new file mode 100644
index 0000000..b01a5c5
--- /dev/null
+++ b/share/test/view_collation.js
@@ -0,0 +1,116 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+
+couchTests.view_collation = function(debug) {
+  var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"});
+  db.deleteDb();
+  db.createDb();
+  if (debug) debugger;
+
+  // NOTE, the values are already in their correct sort order. Consider this
+  // a specification of collation of json types.
+
+  var values = [];
+
+  // special values sort before all other types
+  values.push(null);
+  values.push(false);
+  values.push(true);
+
+  // then numbers
+  values.push(1);
+  values.push(2);
+  values.push(3.0);
+  values.push(4);
+
+  // then text, case sensitive
+  values.push("a");
+  values.push("A");
+  values.push("aa");
+  values.push("b");
+  values.push("B");
+  values.push("ba");
+  values.push("bb");
+
+  // then arrays. compared element by element until different.
+  // Longer arrays sort after their prefixes
+  values.push(["a"]);
+  values.push(["b"]);
+  values.push(["b","c"]);
+  values.push(["b","c", "a"]);
+  values.push(["b","d"]);
+  values.push(["b","d", "e"]);
+
+  // then object, compares each key value in the list until different.
+  // larger objects sort after their subset objects.
+  values.push({a:1});
+  values.push({a:2});
+  values.push({b:1});
+  values.push({b:2});
+  values.push({b:2, a:1}); // Member order does matter for collation.
+                           // CouchDB preserves member order
+                           // but doesn't require that clients will.
+                           // (this test might fail if used with a js engine
+                           // that doesn't preserve order)
+  values.push({b:2, c:2});
+
+  for (var i=0; i<values.length; i++) {
+    db.save({_id:(i).toString(), foo:values[i]});
+  }
+
+  var queryFun = function(doc) { emit(doc.foo, null); };
+  var rows = db.query(queryFun).rows;
+  for (i=0; i<values.length; i++) {
+    T(equals(rows[i].key, values[i]));
+  }
+
+  // everything has collated correctly. Now to check the descending output
+  rows = db.query(queryFun, null, {descending: true}).rows;
+  for (i=0; i<values.length; i++) {
+    T(equals(rows[i].key, values[values.length - 1 -i]));
+  }
+
+  // now check the key query args
+  for (i=1; i<values.length; i++) {
+    var queryOptions = {key:values[i]};
+    rows = db.query(queryFun, null, queryOptions).rows;
+    T(rows.length == 1 && equals(rows[0].key, values[i]));
+  }
+
+  // test inclusive_end=true (the default)
+  // the inclusive_end=true functionality is limited to endkey currently
+  // if you need inclusive_start=false for startkey, please do implement. ;)
+  var rows = db.query(queryFun, null, {endkey : "b", inclusive_end:true}).rows;
+  T(rows[rows.length-1].key == "b");
+  // descending=true
+  var rows = db.query(queryFun, null, {endkey : "b",
+    descending:true, inclusive_end:true}).rows;
+  T(rows[rows.length-1].key == "b");
+
+  // test inclusive_end=false
+  var rows = db.query(queryFun, null, {endkey : "b", inclusive_end:false}).rows;
+  T(rows[rows.length-1].key == "aa");
+  // descending=true
+  var rows = db.query(queryFun, null, {endkey : "b",
+    descending:true, inclusive_end:false}).rows;
+  T(rows[rows.length-1].key == "B");
+  
+  var rows = db.query(queryFun, null, {
+    endkey : "b", endkey_docid: "10",
+    inclusive_end:false}).rows;
+  T(rows[rows.length-1].key == "aa");
+  
+  var rows = db.query(queryFun, null, {
+    endkey : "b", endkey_docid: "11",
+    inclusive_end:false}).rows;
+  T(rows[rows.length-1].key == "b");
+};

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/test/view_collation_raw.js
----------------------------------------------------------------------
diff --git a/share/test/view_collation_raw.js b/share/test/view_collation_raw.js
new file mode 100644
index 0000000..779f7eb
--- /dev/null
+++ b/share/test/view_collation_raw.js
@@ -0,0 +1,130 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+
+couchTests.view_collation_raw = function(debug) {
+  var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"});
+  db.deleteDb();
+  db.createDb();
+  if (debug) debugger;
+
+  // NOTE, the values are already in their correct sort order. Consider this
+  // a specification of collation of json types.
+
+  var values = [];
+
+  //  numbers
+  values.push(1);
+  values.push(2);
+  values.push(3);
+  values.push(4);
+  
+  values.push(false);
+  values.push(null);
+  values.push(true);
+  
+  // then object, compares each key value in the list until different.
+  // larger objects sort after their subset objects.
+  values.push({a:1});
+  values.push({a:2});
+  values.push({b:1});
+  values.push({b:2});
+  values.push({b:2, a:1}); // Member order does matter for collation.
+                           // CouchDB preserves member order
+                           // but doesn't require that clients will.
+                           // (this test might fail if used with a js engine
+                           // that doesn't preserve order)
+  values.push({b:2, c:2});
+
+  // then arrays. compared element by element until different.
+  // Longer arrays sort after their prefixes
+  values.push(["a"]);
+  values.push(["b"]);
+  values.push(["b","c"]);
+  values.push(["b","c", "a"]);
+  values.push(["b","d"]);
+  values.push(["b","d", "e"]);
+
+
+  // then text, case sensitive
+  values.push("A");
+  values.push("B");
+  values.push("a");
+  values.push("aa");
+  values.push("b");
+  values.push("ba");
+  values.push("bb");
+
+  for (var i=0; i<values.length; i++) {
+    db.save({_id:(i).toString(), foo:values[i]});
+  }
+
+  var designDoc = {
+    _id:"_design/test", // turn off couch.js id escaping?
+    language: "javascript",
+    views: {
+      test: {map: "function(doc) { emit(doc.foo, null); }",
+            options: {collation:"raw"}}
+    }
+  }
+  T(db.save(designDoc).ok);
+
+  // Confirm that everything collates correctly.
+  var rows = db.view("test/test").rows;
+  for (i=0; i<values.length; i++) {
+    T(equals(rows[i].key, values[i]));
+  }
+
+  // Confirm that couch allows raw semantics in key ranges.
+  rows = db.view("test/test", {startkey:"Z", endkey:"a"}).rows;
+  TEquals(1, rows.length);
+  TEquals("a", rows[0].key);
+
+  // Check the descending output.
+  rows = db.view("test/test", {descending: true}).rows;
+  for (i=0; i<values.length; i++) {
+    T(equals(rows[i].key, values[values.length - 1 -i]));
+  }
+
+  // now check the key query args
+  for (i=1; i<values.length; i++) {
+    rows = db.view("test/test", {key:values[i]}).rows;
+    T(rows.length == 1 && equals(rows[0].key, values[i]));
+  }
+
+  // test inclusive_end=true (the default)
+  // the inclusive_end=true functionality is limited to endkey currently
+  // if you need inclusive_start=false for startkey, please do implement. ;)
+  var rows = db.view("test/test", {endkey : "b", inclusive_end:true}).rows;
+  T(rows[rows.length-1].key == "b");
+  // descending=true
+  var rows = db.view("test/test", {endkey : "b",
+    descending:true, inclusive_end:true}).rows;
+  T(rows[rows.length-1].key == "b");
+
+  // test inclusive_end=false
+  var rows = db.view("test/test", {endkey : "b", inclusive_end:false}).rows;
+  T(rows[rows.length-1].key == "aa");
+  // descending=true
+  var rows = db.view("test/test", {endkey : "b",
+    descending:true, inclusive_end:false}).rows;
+  T(rows[rows.length-1].key == "ba");
+  
+  var rows = db.view("test/test", {
+    endkey : "b", endkey_docid: "10",
+    inclusive_end:false}).rows;
+  T(rows[rows.length-1].key == "aa");
+  
+  var rows = db.view("test/test", {
+    endkey : "b", endkey_docid: "11",
+    inclusive_end:false}).rows;
+  T(rows[rows.length-1].key == "aa");
+};

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/test/view_compaction.js
----------------------------------------------------------------------
diff --git a/share/test/view_compaction.js b/share/test/view_compaction.js
new file mode 100644
index 0000000..35d6276
--- /dev/null
+++ b/share/test/view_compaction.js
@@ -0,0 +1,110 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+
+couchTests.view_compaction = function(debug) {
+
+  if (debug) debugger;
+
+  var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit": "true"});
+
+  db.deleteDb();
+  db.createDb();
+
+  var ddoc = {
+    _id: "_design/foo",
+    language: "javascript",
+    views: {
+      view1: {
+        map: "function(doc) { emit(doc._id, doc.value) }"
+      },
+      view2: {
+        map: "function(doc) { if (typeof(doc.integer) === 'number') {emit(doc._id, doc.integer);} }",
+        reduce: "function(keys, values, rereduce) { return sum(values); }"
+      }
+    }
+  };
+  T(db.save(ddoc).ok);
+
+  var docs = makeDocs(0, 10000);
+  db.bulkSave(docs);
+
+  var resp = db.view('foo/view1', {});
+  TEquals(10000, resp.rows.length);
+
+  resp = db.view('foo/view2', {});
+  TEquals(1, resp.rows.length);
+
+  resp = db.designInfo("_design/foo");
+  TEquals(10001, resp.view_index.update_seq);
+
+
+  // update docs
+  for (var i = 0; i < docs.length; i++) {
+    docs[i].integer = docs[i].integer + 1;
+  }
+  db.bulkSave(docs);
+
+
+  resp = db.view('foo/view1', {});
+  TEquals(10000, resp.rows.length);
+
+  resp = db.view('foo/view2', {});
+  TEquals(1, resp.rows.length);
+
+  resp = db.designInfo("_design/foo");
+  TEquals(20001, resp.view_index.update_seq);
+
+
+  // update docs again...
+  for (var i = 0; i < docs.length; i++) {
+    docs[i].integer = docs[i].integer + 2;
+  }
+  db.bulkSave(docs);
+
+
+  resp = db.view('foo/view1', {});
+  TEquals(10000, resp.rows.length);
+
+  resp = db.view('foo/view2', {});
+  TEquals(1, resp.rows.length);
+
+  resp = db.designInfo("_design/foo");
+  TEquals(30001, resp.view_index.update_seq);
+
+  var disk_size_before_compact = resp.view_index.disk_size;
+  var data_size_before_compact = resp.view_index.data_size;
+
+  TEquals("number", typeof data_size_before_compact, "data size is a number");
+  T(data_size_before_compact < disk_size_before_compact, "data size < file size");
+
+  // compact view group
+  var xhr = CouchDB.request("POST", "/" + db.name + "/_design/foo/_compact");
+  T(JSON.parse(xhr.responseText).ok === true);
+
+  resp = db.designInfo("_design/foo");
+  while (resp.view_index.compact_running === true) {
+    resp = db.designInfo("_design/foo");
+  }
+
+
+  resp = db.view('foo/view1', {});
+  TEquals(10000, resp.rows.length);
+
+  resp = db.view('foo/view2', {});
+  TEquals(1, resp.rows.length);
+
+  resp = db.designInfo("_design/foo");
+  TEquals(30001, resp.view_index.update_seq);
+  T(resp.view_index.disk_size < disk_size_before_compact);
+  TEquals("number", typeof resp.view_index.data_size, "data size is a number");
+  T(resp.view_index.data_size < resp.view_index.disk_size, "data size < file size");
+};
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/test/view_conflicts.js
----------------------------------------------------------------------
diff --git a/share/test/view_conflicts.js b/share/test/view_conflicts.js
new file mode 100644
index 0000000..96f97d5
--- /dev/null
+++ b/share/test/view_conflicts.js
@@ -0,0 +1,49 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+
+couchTests.view_conflicts = function(debug) {
+  var dbA = new CouchDB("test_suite_db_a", {"X-Couch-Full-Commit":"false"});
+  dbA.deleteDb();
+  dbA.createDb();
+  var dbB = new CouchDB("test_suite_db_b", {"X-Couch-Full-Commit":"false"});
+  dbB.deleteDb();
+  dbB.createDb();
+  if (debug) debugger;
+
+  var docA = {_id: "foo", bar: 42};
+  T(dbA.save(docA).ok);
+  CouchDB.replicate(dbA.name, dbB.name);
+
+  var docB = dbB.open("foo");
+  docB.bar = 43;
+  dbB.save(docB);
+  docA.bar = 41;
+  dbA.save(docA);
+  CouchDB.replicate(dbA.name, dbB.name);
+
+  var doc = dbB.open("foo", {conflicts: true});
+  T(doc._conflicts.length == 1);
+  var conflictRev = doc._conflicts[0];
+  if (doc.bar == 41) { // A won
+    T(conflictRev == docB._rev);
+  } else { // B won
+    T(doc.bar == 43);
+    T(conflictRev == docA._rev);
+  }
+
+  var results = dbB.query(function(doc) {
+    if (doc._conflicts) {
+      emit(doc._id, doc._conflicts);
+    }
+  });
+  T(results.rows[0].value[0] == conflictRev);
+};


[02/37] move JS tests into safety

Posted by ja...@apache.org.
http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/www/script/test/security_validation.js
----------------------------------------------------------------------
diff --git a/share/www/script/test/security_validation.js b/share/www/script/test/security_validation.js
deleted file mode 100644
index 14e5d04..0000000
--- a/share/www/script/test/security_validation.js
+++ /dev/null
@@ -1,338 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
-couchTests.security_validation = function(debug) {
-  // This tests couchdb's security and validation features. This does
-  // not test authentication, except to use test authentication code made
-  // specifically for this testing. It is a WWW-Authenticate scheme named
-  // X-Couch-Test-Auth, and the user names and passwords are hard coded
-  // on the server-side.
-  //
-  // We could have used Basic authentication, however the XMLHttpRequest
-  // implementation for Firefox and Safari, and probably other browsers are
-  // broken (Firefox always prompts the user on 401 failures, Safari gives
-  // odd security errors when using different name/passwords, perhaps due
-  // to cross site scripting prevention). These problems essentially make Basic
-  // authentication testing in the browser impossible. But while hard to
-  // test automated in the browser, Basic auth may still useful for real
-  // world use where these bugs/behaviors don't matter.
-  //
-  // So for testing purposes we are using this custom X-Couch-Test-Auth.
-  // It's identical to Basic auth, except it doesn't even base64 encode
-  // the "username:password" string, it's sent completely plain text.
-  // Firefox and Safari both deal with this correctly (which is to say
-  // they correctly do nothing special).
-
-  var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"});
-  db.deleteDb();
-  db.createDb();
-  if (debug) debugger;
-
-  run_on_modified_server(
-    [{section: "httpd",
-      key: "authentication_handlers",
-      value: "{couch_httpd_auth, special_test_authentication_handler}"},
-     {section:"httpd",
-      key: "WWW-Authenticate",
-      value:  "X-Couch-Test-Auth"}],
-
-    function () {
-      // try saving document using the wrong credentials
-      var wrongPasswordDb = new CouchDB("test_suite_db",
-        {"WWW-Authenticate": "X-Couch-Test-Auth Damien Katz:foo"}
-      );
-
-      try {
-        wrongPasswordDb.save({foo:1,author:"Damien Katz"});
-        T(false && "Can't get here. Should have thrown an error 1");
-      } catch (e) {
-        T(e.error == "unauthorized");
-        T(wrongPasswordDb.last_req.status == 401);
-      }
-
-      // test force basic login
-      var resp = wrongPasswordDb.request("GET", "/_session?basic=true");
-      var err = JSON.parse(resp.responseText);
-      T(err.error == "unauthorized");
-      T(resp.status == 401);
-
-      // Create the design doc that will run custom validation code
-      var designDoc = {
-        _id:"_design/test",
-        language: "javascript",
-        validate_doc_update: stringFun(function (newDoc, oldDoc, userCtx, secObj) {
-          if (secObj.admin_override) {
-            if (userCtx.roles.indexOf('_admin') != -1) {
-              // user is admin, they can do anything
-              return true;
-            }
-          }
-          // docs should have an author field.
-          if (!newDoc._deleted && !newDoc.author) {
-            throw {forbidden:
-                "Documents must have an author field"};
-          }
-          if (oldDoc && oldDoc.author != userCtx.name) {
-              throw {unauthorized:
-                  "You are not the author of this document. You jerk."};
-          }
-        })
-      }
-
-      // Save a document normally
-      var userDb = new CouchDB("test_suite_db",
-        {"WWW-Authenticate": "X-Couch-Test-Auth Damien Katz:pecan pie"}
-      );
-
-      T(userDb.save({_id:"testdoc", foo:1, author:"Damien Katz"}).ok);
-
-      // Attempt to save the design as a non-admin
-      try {
-        userDb.save(designDoc);
-        T(false && "Can't get here. Should have thrown an error on design doc");
-      } catch (e) {
-        T(e.error == "unauthorized");
-        T(userDb.last_req.status == 401);
-      }
-
-      // set user as the admin
-      T(db.setSecObj({
-        admins : {names : ["Damien Katz"]}
-      }).ok);
-
-      T(userDb.save(designDoc).ok);
-
-      var user2Db = new CouchDB("test_suite_db",
-        {"WWW-Authenticate": "X-Couch-Test-Auth Jan Lehnardt:apple"}
-      );
-      // Attempt to save the design as a non-admin (in replication scenario)
-      designDoc.foo = "bar";
-      designDoc._rev = "2-642e20f96624a0aae6025b4dba0c6fb2";
-      try {
-        user2Db.save(designDoc, {new_edits : false});
-        T(false && "Can't get here. Should have thrown an error on design doc");
-      } catch (e) {
-        T(e.error == "unauthorized");
-        T(user2Db.last_req.status == 401);
-      }
-
-      // test the _session API
-      var resp = userDb.request("GET", "/_session");
-      var user = JSON.parse(resp.responseText).userCtx;
-      T(user.name == "Damien Katz");
-      // test that the roles are listed properly
-      TEquals(user.roles, []);
-
-
-      // update the document
-      var doc = userDb.open("testdoc");
-      doc.foo=2;
-      T(userDb.save(doc).ok);
-
-      // Save a document that's missing an author field (before and after compaction)
-      for (var i=0; i<2; i++) {
-          try {
-              userDb.save({foo:1});
-              T(false && "Can't get here. Should have thrown an error 2");
-          } catch (e) {
-              T(e.error == "forbidden");
-              T(userDb.last_req.status == 403);
-          }
-          // compact.
-          T(db.compact().ok);
-          T(db.last_req.status == 202);
-          // compaction isn't instantaneous, loop until done
-          while (db.info().compact_running) {};
-      }
-
-      // Now attempt to update the document as a different user, Jan
-      var doc = user2Db.open("testdoc");
-      doc.foo=3;
-      try {
-        user2Db.save(doc);
-        T(false && "Can't get here. Should have thrown an error 3");
-      } catch (e) {
-        T(e.error == "unauthorized");
-        T(user2Db.last_req.status == 401);
-      }
-
-      // Now have Damien change the author to Jan
-      doc = userDb.open("testdoc");
-      doc.author="Jan Lehnardt";
-      T(userDb.save(doc).ok);
-
-      // Now update the document as Jan
-      doc = user2Db.open("testdoc");
-      doc.foo = 3;
-      T(user2Db.save(doc).ok);
-
-      // Damien can't delete it
-      try {
-        userDb.deleteDoc(doc);
-        T(false && "Can't get here. Should have thrown an error 4");
-      } catch (e) {
-        T(e.error == "unauthorized");
-        T(userDb.last_req.status == 401);
-      }
-      
-      // admin must save with author field unless admin override
-      var resp = db.request("GET", "/_session");
-      var user = JSON.parse(resp.responseText).userCtx;
-      T(user.name == null);
-      // test that we are admin
-      TEquals(user.roles, ["_admin"]);
-      
-      // can't save the doc even though we are admin
-      var doc = db.open("testdoc");
-      doc.foo=3;
-      try {
-        db.save(doc);
-        T(false && "Can't get here. Should have thrown an error 3");
-      } catch (e) {
-        T(e.error == "unauthorized");
-        T(db.last_req.status == 401);
-      }
-
-      // now turn on admin override
-      T(db.setDbProperty("_security", {admin_override : true}).ok);
-      T(db.save(doc).ok);
-
-      // try to do something lame
-      try {
-        db.setDbProperty("_security", ["foo"]);
-        T(false && "can't do this");
-      } catch(e) {}
-
-      // go back to normal
-      T(db.setDbProperty("_security", {admin_override : false}).ok);
-
-      // Now delete document
-      T(user2Db.deleteDoc(doc).ok);
-
-      // now test bulk docs
-      var docs = [{_id:"bahbah",author:"Damien Katz",foo:"bar"},{_id:"fahfah",foo:"baz"}];
-
-      // Create the docs
-      var results = db.bulkSave(docs);
-
-      T(results[0].rev)
-      T(results[0].error == undefined)
-      T(results[1].rev === undefined)
-      T(results[1].error == "forbidden")
-
-      T(db.open("bahbah"));
-      T(db.open("fahfah") == null);
-
-
-      // now all or nothing with a failure
-      var docs = [{_id:"booboo",author:"Damien Katz",foo:"bar"},{_id:"foofoo",foo:"baz"}];
-
-      // Create the docs
-      var results = db.bulkSave(docs, {all_or_nothing:true});
-
-      T(results.errors.length == 1);
-      T(results.errors[0].error == "forbidden");
-      T(db.open("booboo") == null);
-      T(db.open("foofoo") == null);
-
-      // Now test replication
-      var AuthHeaders = {"WWW-Authenticate": "X-Couch-Test-Auth Christopher Lenz:dog food"};
-      var host = CouchDB.host;
-      var dbPairs = [
-        {source:"test_suite_db_a",
-          target:"test_suite_db_b"},
-
-        {source:"test_suite_db_a",
-          target:{url: CouchDB.protocol + host + "/test_suite_db_b",
-                  headers: AuthHeaders}},
-
-        {source:{url:CouchDB.protocol + host + "/test_suite_db_a",
-                 headers: AuthHeaders},
-          target:"test_suite_db_b"},
-
-        {source:{url:CouchDB.protocol + host + "/test_suite_db_a",
-                 headers: AuthHeaders},
-         target:{url:CouchDB.protocol + host + "/test_suite_db_b",
-                 headers: AuthHeaders}},
-      ]
-      var adminDbA = new CouchDB("test_suite_db_a", {"X-Couch-Full-Commit":"false"});
-      var adminDbB = new CouchDB("test_suite_db_b", {"X-Couch-Full-Commit":"false"});
-      var dbA = new CouchDB("test_suite_db_a",
-          {"WWW-Authenticate": "X-Couch-Test-Auth Christopher Lenz:dog food"});
-      var dbB = new CouchDB("test_suite_db_b",
-          {"WWW-Authenticate": "X-Couch-Test-Auth Christopher Lenz:dog food"});
-      var xhr;
-      for (var testPair = 0; testPair < dbPairs.length; testPair++) {
-        var A = dbPairs[testPair].source
-        var B = dbPairs[testPair].target
-
-        adminDbA.deleteDb();
-        adminDbA.createDb();
-        adminDbB.deleteDb();
-        adminDbB.createDb();
-
-        // save and replicate a documents that will and will not pass our design
-        // doc validation function.
-        dbA.save({_id:"foo1",value:"a",author:"Noah Slater"});
-        dbA.save({_id:"foo2",value:"a",author:"Christopher Lenz"});
-        dbA.save({_id:"bad1",value:"a"});
-
-        T(CouchDB.replicate(A, B, {headers:AuthHeaders}).ok);
-        T(CouchDB.replicate(B, A, {headers:AuthHeaders}).ok);
-
-        T(dbA.open("foo1"));
-        T(dbB.open("foo1"));
-        T(dbA.open("foo2"));
-        T(dbB.open("foo2"));
-
-        // save the design doc to dbA
-        delete designDoc._rev; // clear rev from previous saves
-        adminDbA.save(designDoc);
-
-        // no affect on already saved docs
-        T(dbA.open("bad1"));
-
-        // Update some docs on dbB. Since the design hasn't replicated, anything
-        // is allowed.
-
-        // this edit will fail validation on replication to dbA (no author)
-        T(dbB.save({_id:"bad2",value:"a"}).ok);
-
-        // this edit will fail security on replication to dbA (wrong author
-        //  replicating the change)
-        var foo1 = dbB.open("foo1");
-        foo1.value = "b";
-        dbB.save(foo1);
-
-        // this is a legal edit
-        var foo2 = dbB.open("foo2");
-        foo2.value = "b";
-        dbB.save(foo2);
-
-        var results = CouchDB.replicate(B, A, {headers:AuthHeaders});
-
-        T(results.ok);
-
-        T(results.history[0].docs_written == 1);
-        T(results.history[0].doc_write_failures == 2);
-
-        // bad2 should not be on dbA
-        T(dbA.open("bad2") == null);
-
-        // The edit to foo1 should not have replicated.
-        T(dbA.open("foo1").value == "a");
-
-        // The edit to foo2 should have replicated.
-        T(dbA.open("foo2").value == "b");
-      }
-    });
-};

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/www/script/test/show_documents.js
----------------------------------------------------------------------
diff --git a/share/www/script/test/show_documents.js b/share/www/script/test/show_documents.js
deleted file mode 100644
index 618925f..0000000
--- a/share/www/script/test/show_documents.js
+++ /dev/null
@@ -1,420 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
-couchTests.show_documents = function(debug) {
-  var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"});
-  db.deleteDb();
-  db.createDb();
-  if (debug) debugger;
-
-  var designDoc = {
-    _id:"_design/template",
-    language: "javascript",
-    shows: {
-      "hello" : stringFun(function(doc, req) {
-        log("hello fun");
-        if (doc) {
-          return "Hello World";
-        } else {
-          if(req.id) {
-            return "New World";
-          } else {
-            return "Empty World";
-          }
-        }
-      }),
-      "just-name" : stringFun(function(doc, req) {
-        if (doc) {
-          return {
-            body : "Just " + doc.name
-          };
-        } else {
-          return {
-            body : "No such doc",
-            code : 404
-          };
-        }
-      }),
-      "json" : stringFun(function(doc, req) {
-        return {
-          json : doc
-        }
-      }),
-      "req-info" : stringFun(function(doc, req) {
-        return {
-          json : req
-        }
-      }),
-      "show-deleted" : stringFun(function(doc, req) {
-        if(doc) {
-          return doc._id;
-        } else {
-          return "No doc " + req.id;
-        }
-      }),
-      "render-error" : stringFun(function(doc, req) {
-        return noSuchVariable;
-      }),
-      "empty" : stringFun(function(doc, req) {
-          return "";
-        }),
-      "fail" : stringFun(function(doc, req) {
-        return doc._id;
-      }),
-      "no-set-etag" : stringFun(function(doc, req) {
-        return {
-          headers : {
-            "Etag" : "skipped"
-          },
-          "body" : "something"
-        }
-      }),
-      "list-api" : stringFun(function(doc, req) {
-        start({"X-Couch-Test-Header": "Yeah"});
-        send("Hey");
-      }),
-      "list-api-provides" : stringFun(function(doc, req) {
-        provides("text", function(){
-            send("foo, ");
-            send("bar, ");
-            send("baz!");
-        })
-      }),
-      "list-api-provides-and-return" : stringFun(function(doc, req) {
-        provides("text", function(){
-            send("4, ");
-            send("5, ");
-            send("6, ");
-            return "7!";
-        })
-        send("1, ");
-        send("2, ");
-        return "3, ";
-      }),
-      "list-api-mix" : stringFun(function(doc, req) {
-        start({"X-Couch-Test-Header": "Yeah"});
-        send("Hey ");
-        return "Dude";
-      }),
-      "list-api-mix-with-header" : stringFun(function(doc, req) {
-        start({"X-Couch-Test-Header": "Yeah"});
-        send("Hey ");
-        return {
-          headers: {
-            "X-Couch-Test-Header-Awesome": "Oh Yeah!"
-          },
-          body: "Dude"
-        };
-      }),
-      "accept-switch" : stringFun(function(doc, req) {
-        if (req.headers["Accept"].match(/image/)) {
-          return {
-            // a 16x16 px version of the CouchDB logo
-            "base64" :
-["iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAsV",
-"BMVEUAAAD////////////////////////5ur3rEBn////////////////wDBL/",
-"AADuBAe9EB3IEBz/7+//X1/qBQn2AgP/f3/ilpzsDxfpChDtDhXeCA76AQH/v7",
-"/84eLyWV/uc3bJPEf/Dw/uw8bRWmP1h4zxSlD6YGHuQ0f6g4XyQkXvCA36MDH6",
-"wMH/z8/yAwX64ODeh47BHiv/Ly/20dLQLTj98PDXWmP/Pz//39/wGyJ7Iy9JAA",
-"AADHRSTlMAbw8vf08/bz+Pv19jK/W3AAAAg0lEQVR4Xp3LRQ4DQRBD0QqTm4Y5",
-"zMxw/4OleiJlHeUtv2X6RbNO1Uqj9g0RMCuQO0vBIg4vMFeOpCWIWmDOw82fZx",
-"vaND1c8OG4vrdOqD8YwgpDYDxRgkSm5rwu0nQVBJuMg++pLXZyr5jnc1BaH4GT",
-"LvEliY253nA3pVhQqdPt0f/erJkMGMB8xucAAAAASUVORK5CYII="].join(''),
-            headers : {
-              "Content-Type" : "image/png",
-              "Vary" : "Accept" // we set this for proxy caches
-            }
-          };
-        } else {
-          return {
-            "body" : "accepting text requests",
-            headers : {
-              "Content-Type" : "text/html",
-              "Vary" : "Accept"
-            }
-          };
-        }
-      }),
-      "provides" : stringFun(function(doc, req) {
-        registerType("foo", "application/foo","application/x-foo");
-
-        provides("html", function() {
-          return "Ha ha, you said \"" + doc.word + "\".";
-        });
-
-        provides("foo", function() {
-          return "foofoo";
-        });
-      }),
-      "withSlash": stringFun(function(doc, req) {
-        return { json: doc }
-      }),
-      "secObj": stringFun(function(doc, req) {
-        return { json: req.secObj };
-      })
-    }
-  };
-  T(db.save(designDoc).ok);
-
-  var doc = {"word":"plankton", "name":"Rusty"}
-  var resp = db.save(doc);
-  T(resp.ok);
-  var docid = resp.id;
-
-  // show error
-  var xhr = CouchDB.request("GET", "/test_suite_db/_design/template/_show/");
-  T(xhr.status == 404, 'Should be missing');
-  T(JSON.parse(xhr.responseText).reason == "Invalid path.");
-
-  // hello template world
-  xhr = CouchDB.request("GET", "/test_suite_db/_design/template/_show/hello/"+docid);
-  T(xhr.responseText == "Hello World", "hello");
-  T(/charset=utf-8/.test(xhr.getResponseHeader("Content-Type")));
-
-
-  // Fix for COUCHDB-379
-  T(equals(xhr.getResponseHeader("Server").substr(0,7), "CouchDB"));
-
-  // // error stacktraces
-  // xhr = CouchDB.request("GET", "/test_suite_db/_design/template/_show/render-error/"+docid);
-  // T(JSON.parse(xhr.responseText).error == "render_error");
-
-  // hello template world (no docid)
-  xhr = CouchDB.request("GET", "/test_suite_db/_design/template/_show/hello");
-  T(xhr.responseText == "Empty World");
-
-  // hello template world (no docid)
-  xhr = CouchDB.request("GET", "/test_suite_db/_design/template/_show/empty");
-  T(xhr.responseText == "");
-
-  // // hello template world (non-existing docid)
-  xhr = CouchDB.request("GET", "/test_suite_db/_design/template/_show/fail/nonExistingDoc");
-  T(xhr.status == 404);
-  var resp = JSON.parse(xhr.responseText);
-  T(resp.error == "not_found");
-  
-  // show with doc
-  xhr = CouchDB.request("GET", "/test_suite_db/_design/template/_show/just-name/"+docid);
-  T(xhr.responseText == "Just Rusty");
-
-  // show with missing doc
-  xhr = CouchDB.request("GET", "/test_suite_db/_design/template/_show/just-name/missingdoc");
-  T(xhr.status == 404);
-  TEquals("No such doc", xhr.responseText);
-
-  // show with missing func
-  xhr = CouchDB.request("GET", "/test_suite_db/_design/template/_show/missing/"+docid);
-  T(xhr.status == 404, "function is missing");
-
-  // missing design doc
-  xhr = CouchDB.request("GET", "/test_suite_db/_design/missingddoc/_show/just-name/"+docid);
-  T(xhr.status == 404);
-  var resp = JSON.parse(xhr.responseText);
-  T(resp.error == "not_found");
-
-  // query parameters
-  xhr = CouchDB.request("GET", "/test_suite_db/_design/template/_show/req-info/"+docid+"?foo=bar", {
-    headers: {
-      "Accept": "text/html;text/plain;*/*",
-      "X-Foo" : "bar"
-    }
-  });
-  var resp = JSON.parse(xhr.responseText);
-  T(equals(resp.headers["X-Foo"], "bar"));
-  T(equals(resp.query, {foo:"bar"}));
-  T(equals(resp.method, "GET"));
-  T(equals(resp.path[5], docid));
-  T(equals(resp.info.db_name, "test_suite_db"));
-
-  // accept header switching
-  // different mime has different etag
-  xhr = CouchDB.request("GET", "/test_suite_db/_design/template/_show/accept-switch/"+docid, {
-    headers: {"Accept": "text/html;text/plain;*/*"}
-  });
-  var ct = xhr.getResponseHeader("Content-Type");
-  T(/text\/html/.test(ct))
-  T("Accept" == xhr.getResponseHeader("Vary"));
-  var etag = xhr.getResponseHeader("etag");
-
-  xhr = CouchDB.request("GET", "/test_suite_db/_design/template/_show/accept-switch/"+docid, {
-    headers: {"Accept": "image/png;*/*"}
-  });
-  T(xhr.responseText.match(/PNG/))
-  T("image/png" == xhr.getResponseHeader("Content-Type"));
-  var etag2 = xhr.getResponseHeader("etag");
-  T(etag2 != etag);
-
-  // proper etags
-  // show with doc
-  xhr = CouchDB.request("GET", "/test_suite_db/_design/template/_show/just-name/"+docid);
-  // extract the ETag header values
-  etag = xhr.getResponseHeader("etag");
-  // get again with etag in request
-  xhr = CouchDB.request("GET", "/test_suite_db/_design/template/_show/just-name/"+docid, {
-    headers: {"if-none-match": etag}
-  });
-  // should be 304
-  T(xhr.status == 304);
-
-  // update the doc
-  doc.name = "Crusty";
-  resp = db.save(doc);
-  T(resp.ok);
-  // req with same etag
-  xhr = CouchDB.request("GET", "/test_suite_db/_design/template/_show/just-name/"+docid, {
-    headers: {"if-none-match": etag}
-  });
-  // status is 200
-  T(xhr.status == 200);
-
-  // get new etag and request again
-  etag = xhr.getResponseHeader("etag");
-  xhr = CouchDB.request("GET", "/test_suite_db/_design/template/_show/just-name/"+docid, {
-    headers: {"if-none-match": etag}
-  });
-  // should be 304
-  T(xhr.status == 304);
-
-  // update design doc (but not function)
-  designDoc.isChanged = true;
-  T(db.save(designDoc).ok);
-
-  xhr = CouchDB.request("GET", "/test_suite_db/_design/template/_show/just-name/"+docid, {
-    headers: {"if-none-match": etag}
-  });
-  // should not be 304 if we change the doc
-  T(xhr.status != 304, "changed ddoc");
-
-  // update design doc function
-  designDoc.shows["just-name"] = stringFun(function(doc, req) {
-   return {
-     body : "Just old " + doc.name
-   };
-  });
-  T(db.save(designDoc).ok);
-
-  xhr = CouchDB.request("GET", "/test_suite_db/_design/template/_show/just-name/"+docid, {
-    headers: {"if-none-match": etag}
-  });
-  // status is 200
-  T(xhr.status == 200);
-
-
-  // JS can't set etag
-  xhr = CouchDB.request("GET", "/test_suite_db/_design/template/_show/no-set-etag/"+docid);
-  // extract the ETag header values
-  etag = xhr.getResponseHeader("etag");
-  T(etag != "skipped")
-
-  // test the provides mime matcher
-  xhr = CouchDB.request("GET", "/test_suite_db/_design/template/_show/provides/"+docid, {
-    headers: {
-      "Accept": 'text/html,application/atom+xml; q=0.9'
-    }
-  });
-  var ct = xhr.getResponseHeader("Content-Type");
-  T(/charset=utf-8/.test(ct))
-  T(/text\/html/.test(ct))
-  T(xhr.responseText == "Ha ha, you said \"plankton\".");
-
-  // registering types works
-  xhr = CouchDB.request("GET", "/test_suite_db/_design/template/_show/provides/"+docid, {
-    headers: {
-      "Accept": "application/x-foo"
-    }
-  });
-  T(xhr.getResponseHeader("Content-Type") == "application/x-foo");
-  T(xhr.responseText.match(/foofoo/));
-
-  // test the provides mime matcher without a match
-  xhr = CouchDB.request("GET", "/test_suite_db/_design/template/_show/provides/"+docid, {
-   headers: {
-     "Accept": 'text/monkeys'
-   }
-  });
-  var rs = JSON.parse(xhr.responseText);
-  T(rs.error == "not_acceptable")
-
-
-  // test inclusion of conflict state
-  var doc1 = {_id:"foo", a:1};
-  var doc2 = {_id:"foo", a:2};
-  db.save(doc1);
-
-  // create the conflict with an all_or_nothing bulk docs request
-  var docs = [doc2];
-  db.bulkSave(docs, {all_or_nothing:true});
-
-  xhr = CouchDB.request("GET", "/test_suite_db/_design/template/_show/json/foo");
-  TEquals(1, JSON.parse(xhr.responseText)._conflicts.length);
-
-  var doc3 = {_id:"a/b/c", a:1};
-  db.save(doc3);
-  xhr = CouchDB.request("GET", "/test_suite_db/_design/template/_show/withSlash/a/b/c");
-  T(xhr.status == 200);
-
-  // hello template world (non-existing docid)
-  xhr = CouchDB.request("GET", "/test_suite_db/_design/template/_show/hello/nonExistingDoc");
-  T(xhr.responseText == "New World");
-
-  // test list() compatible API
-  xhr = CouchDB.request("GET", "/test_suite_db/_design/template/_show/list-api/foo");
-  T(xhr.responseText == "Hey");
-  TEquals("Yeah", xhr.getResponseHeader("X-Couch-Test-Header"), "header should be cool");
-
-  // test list() compatible API with provides function
-  xhr = CouchDB.request("GET", "/test_suite_db/_design/template/_show/list-api-provides/foo?format=text");
-  TEquals(xhr.responseText, "foo, bar, baz!", "should join chunks to response body");
-
-  // should keep next result order: chunks + return value + provided chunks + provided return value
-  xhr = CouchDB.request("GET", "/test_suite_db/_design/template/_show/list-api-provides-and-return/foo?format=text");
-  TEquals(xhr.responseText, "1, 2, 3, 4, 5, 6, 7!", "should not break 1..7 range");
-
-  xhr = CouchDB.request("GET", "/test_suite_db/_design/template/_show/list-api-mix/foo");
-  T(xhr.responseText == "Hey Dude");
-  TEquals("Yeah", xhr.getResponseHeader("X-Couch-Test-Header"), "header should be cool");
-
-  xhr = CouchDB.request("GET", "/test_suite_db/_design/template/_show/list-api-mix-with-header/foo");
-  T(xhr.responseText == "Hey Dude");
-  TEquals("Yeah", xhr.getResponseHeader("X-Couch-Test-Header"), "header should be cool");
-  TEquals("Oh Yeah!", xhr.getResponseHeader("X-Couch-Test-Header-Awesome"), "header should be cool");
-
-  // test deleted docs
-  var doc = {_id:"testdoc",foo:1};
-  db.save(doc);
-  var xhr = CouchDB.request("GET", "/test_suite_db/_design/template/_show/show-deleted/testdoc");
-  TEquals("testdoc", xhr.responseText, "should return 'testdoc'");
-
-  db.deleteDoc(doc);
-  var xhr = CouchDB.request("GET", "/test_suite_db/_design/template/_show/show-deleted/testdoc");
-  TEquals("No doc testdoc", xhr.responseText, "should return 'no doc testdoc'");
-
-
-  run_on_modified_server(
-    [{section: "httpd",
-      key: "authentication_handlers",
-      value: "{couch_httpd_auth, special_test_authentication_handler}"},
-     {section:"httpd",
-      key: "WWW-Authenticate",
-      value:  "X-Couch-Test-Auth"}],
-
-      function() {
-        T(db.setDbProperty("_security", {foo: true}).ok);
-        T(db.save({_id:"testdoc",foo:1}).ok);
-
-        xhr = CouchDB.request("GET", "/test_suite_db/_design/template/_show/secObj");
-        var resp = JSON.parse(xhr.responseText);
-        T(resp.foo == true);
-      }
-  );
-  
-};

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/www/script/test/stats.js
----------------------------------------------------------------------
diff --git a/share/www/script/test/stats.js b/share/www/script/test/stats.js
deleted file mode 100644
index 87440b3..0000000
--- a/share/www/script/test/stats.js
+++ /dev/null
@@ -1,348 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
-couchTests.stats = function(debug) {
-
-  function newDb(name, doSetup) {
-    var db = new CouchDB(name, {"X-Couch-Full-Commit": "false"});
-    if(doSetup) {
-      db.deleteDb();
-      db.createDb();
-    }
-    return db;
-  };
-
-  function getStat(path) {
-    var stat = CouchDB.requestStats(path, true);
-    return stat ? stat.value : null;
-  };
-
-  function doView(db) {
-    var designDoc = {
-      _id:"_design/test", // turn off couch.js id escaping?
-      language: "javascript",
-      views: {
-        all_docs: {map: "function(doc) {emit(doc.integer, null);}"}
-      }
-    };
-    db.save(designDoc);
-    db.view("test/all_docs");
-  };
-
-  function runTest(path, funcs) {
-    var db = newDb("test_suite_db", true);
-    if(funcs.setup) funcs.setup(db);
-    var before = getStat(path);
-    if(funcs.run) funcs.run(db);
-    var after = getStat(path);
-    if(funcs.test) funcs.test(before, after);
-  }
-
-  if (debug) debugger;
-
-  (function() {
-    var db = newDb("test_suite_db");
-    db.deleteDb();
-  
-    var before = getStat(["couchdb", "open_databases"]);
-    db.createDb();
-    var after = getStat(["couchdb", "open_databases"]);
-    TEquals(before+1, after, "Creating a db increments open db count.");
-  })();
-  
-  runTest(["couchdb", "open_databases"], {
-    setup: function() {restartServer();},
-    run: function(db) {db.open("123");},
-    test: function(before, after) {
-      TEquals(before+1, after, "Opening a db increments open db count.");
-    }
-  });
-  
-  runTest(["couchdb", "open_databases"], {
-    run: function(db) {db.deleteDb();},
-    test: function(before, after) {
-      TEquals(before-1, after, "Deleting a db decrements open db count.");
-    }
-  });
-  
-  (function() {
-    restartServer();
-    var max = 5;
-    
-    var testFun = function() {
-      var pre_dbs = getStat(["couchdb", "open_databases"]) || 0;
-      var pre_files = getStat(["couchdb", "open_os_files"]) || 0;
-     
-      var triggered = false;
-      var db = null;
-      for(var i = 0; i < max*2; i++) {
-        while (true) {
-            try {
-              db = newDb("test_suite_db_" + i, true);
-              break;
-            } catch(e) {
-                // all_dbs_active error!
-              triggered = true;
-            }
-        }
-
-        // Trigger a delayed commit
-        db.save({_id: "" + i, "lang": "Awesome!"});
-      }
-      T(triggered, "We managed to force a all_dbs_active error.");
-      
-      var open_dbs = getStat(["couchdb", "open_databases"]);
-      TEquals(open_dbs > 0, true, "We actually opened some dbs.");
-      TEquals(max, open_dbs, "We only have max db's open.");
-      
-      for(var i = 0; i < max * 2; i++) {
-        newDb("test_suite_db_" + i).deleteDb();
-      }
-      
-      var post_dbs = getStat(["couchdb", "open_databases"]);
-      var post_files = getStat(["couchdb", "open_os_files"]);
-      TEquals(pre_dbs, post_dbs, "We have the same number of open dbs.");
-      TEquals(pre_files, post_files, "We have the same number of open files.");
-    };
-    
-    run_on_modified_server(
-      [{section: "couchdb", key: "max_dbs_open", value: "5"}],
-      testFun
-    );
-  })();
-  
-  // Just fetching the before value is the extra +1 in test
-  runTest(["couchdb", "httpd", "requests"], {
-    run: function() {CouchDB.request("GET", "/");},
-    test: function(before, after) {
-      TEquals(before+2, after, "Request counts are incremented properly.");
-    }
-  });
-  
-  runTest(["couchdb", "database_reads"], {
-    setup: function(db) {db.save({"_id": "test"});},
-    run: function(db) {db.open("test");},
-    test: function(before, after) {
-      TEquals(before+1, after, "Reading a doc increments docs reads.");
-    }
-  });
-  
-  runTest(["couchdb", "database_reads"], {
-    setup: function(db) {db.save({"_id": "test"});},
-    run: function(db) {db.request("GET", "/");},
-    test: function(before, after) {
-      TEquals(before, after, "Only doc reads increment doc reads.");
-    }
-  });
-  
-  runTest(["couchdb", "database_reads"], {
-    setup: function(db) {db.save({"_id": "test"});},
-    run: function(db) {db.open("test", {"open_revs": "all"});},
-    test: function(before, after) {
-      TEquals(before+1, after, "Reading doc revs increments docs reads.");
-    }
-  });
-  
-  runTest(["couchdb", "database_writes"], {
-    run: function(db) {db.save({"a": "1"});},
-    test: function(before, after) {
-      TEquals(before+1, after, "Saving docs incrememnts doc writes.");
-    }
-  });
-  
-  runTest(["couchdb", "database_writes"], {
-    run: function(db) {
-      CouchDB.request("POST", "/test_suite_db", {
-        headers: {"Content-Type": "application/json"},
-        body: '{"a": "1"}'
-      });
-    },
-    test: function(before, after) {
-      TEquals(before+1, after, "POST'ing new docs increments doc writes.");
-    }
-  });
-  
-  runTest(["couchdb", "database_writes"], {
-    setup: function(db) {db.save({"_id": "test"});},
-    run: function(db) {var doc = db.open("test"); db.save(doc);},
-    test: function(before, after) {
-      TEquals(before+1, after, "Updating docs incrememnts doc writes.");
-    }
-  });
-  
-  runTest(["couchdb", "database_writes"], {
-    setup: function(db) {db.save({"_id": "test"});},
-    run: function(db) {var doc = db.open("test"); db.deleteDoc(doc);},
-    test: function(before, after) {
-      TEquals(before+1, after, "Deleting docs increments doc writes.");
-    }
-  });
-  
-  runTest(["couchdb", "database_writes"], {
-    setup: function(db) {db.save({"_id": "test"});},
-    run: function(db) {
-      CouchDB.request("COPY", "/test_suite_db/test", {
-        headers: {"Destination": "copy_of_test"}
-      });
-    },
-    test: function(before, after) {
-      TEquals(before+1, after, "Copying docs increments doc writes.");
-    }
-  });
-  
-  runTest(["couchdb", "database_writes"], {
-    run: function() {
-      CouchDB.request("PUT", "/test_suite_db/bin_doc2/foo2.txt", {
-        body: "This is no base64 encoded test",
-        headers: {"Content-Type": "text/plain;charset=utf-8"}
-      });
-    },
-    test: function(before, after) {
-      TEquals(before+1, after, "Create with attachment increments doc writes.");
-    }
-  });
-  
-  runTest(["couchdb", "database_writes"], {
-    setup: function(db) {db.save({"_id": "test"});},
-    run: function(db) {
-      var doc = db.open("test");
-      CouchDB.request("PUT", "/test_suite_db/test/foo2.txt?rev=" + doc._rev, {
-        body: "This is no base64 encoded text",
-        headers: {"Content-Type": "text/plainn;charset=utf-8"}
-      });
-    },
-    test: function(before, after) {
-      TEquals(before+1, after, "Adding attachment increments doc writes.");
-    }
-  });
-  
-  runTest(["couchdb", "httpd", "bulk_requests"], {
-    run: function(db) {db.bulkSave(makeDocs(5));},
-    test: function(before, after) {
-      TEquals(before+1, after, "The bulk_requests counter is incremented.");
-    }
-  });
-  
-  runTest(["couchdb", "httpd", "view_reads"], {
-    run: function(db) {doView(db);},
-    test: function(before, after) {
-      TEquals(before+1, after, "Reading a view increments view reads.");
-    }
-  });
-  
-  runTest(["couchdb", "httpd", "view_reads"], {
-    setup: function(db) {db.save({"_id": "test"});},
-    run: function(db) {db.open("test");},
-    test: function(before, after) {
-      TEquals(before, after, "Reading a doc doesn't increment view reads.");
-    }
-  });
-  
-  runTest(["couchdb", "httpd", "temporary_view_reads"], {
-    run: function(db) { db.query(function(doc) { emit(doc._id); }); },
-    test: function(before, after) {
-      TEquals(before+1, after, "Temporary views have their own counter.");
-    }
-  });
-  
-  runTest(["couchdb", "httpd", "temporary_view_reads"], {
-    run: function(db) {doView(db);},
-    test: function(before, after) {
-      TEquals(before, after, "Permanent views don't affect temporary views.");
-    }
-  });
-  
-  runTest(["couchdb", "httpd", "view_reads"], {
-    run: function(db) { db.query(function(doc) { emit(doc._id); }); },
-    test: function(before, after) {
-      TEquals(before, after, "Temporary views don't affect permanent views.");
-    }
-  });
-  
-  // Relies on getting the stats values being GET requests.
-  runTest(["couchdb", "httpd_request_methods", "GET"], {
-    test: function(before, after) {
-      TEquals(before+1, after, "Get requests are incremented properly.");
-    }
-  });
-  
-  runTest(["couchdb", "httpd_request_methods", "GET"], {
-    run: function() {CouchDB.request("POST", "/");},
-    test: function(before, after) {
-      TEquals(before+1, after, "POST requests don't affect GET counter.");
-    }
-  });
-  
-  runTest(["couchdb", "httpd_request_methods", "POST"], {
-    run: function() {CouchDB.request("POST", "/");},
-    test: function(before, after) {
-      TEquals(before+1, after, "POST requests are incremented properly.");
-    }
-  });
-  
-  runTest(["couchdb", "httpd_status_codes", "404"], {
-    run: function() {CouchDB.request("GET", "/nonexistant_db");},
-    test: function(before, after) {
-      TEquals(before+1, after, "Increments 404 counter on db not found.");
-    }
-  });
-  
-  runTest(["couchdb", "httpd_status_codes", "404"], {
-    run: function() {CouchDB.request("GET", "/");},
-    test: function(before, after) {
-      TEquals(before, after, "Getting DB info doesn't increment 404's");
-    }
-  });
-
-  var test_metric = function(metric, expected_fields) {
-    for (var k in metric) {
-      T(expected_fields.indexOf(k) >= 0, "Unknown property name: " + k);
-    }
-    for (var k in expected_fields) {
-      T(metric[expected_fields[k]] !== undefined, "Missing required property: " + k);
-    }
-  };
-
-  var test_histogram = function(histo) {
-    test_metric(histo, ["value", "type", "desc"]);
-    test_metric(histo.value, ["min", "max", "arithmetic_mean",
-      "geometric_mean", "harmonic_mean", "median", "variance",
-       "standard_deviation", "skewness", "kurtosis", "percentile",
-       "histogram", "n"]);
-  };
-
-  var test_counter = function(counter) {
-    test_metric(counter, ["value", "desc", "type"]);
-  };
-
-  var test_metrics = function(metrics) {
-    if (metrics.type === "counter") {
-      test_counter(metrics);
-    } else if (metrics.type === "gauge") {
-      test_counter(metrics);
-    } else if (metrics.type === "histogram") {
-      test_histogram(metrics);
-    } else if (metrics.type === undefined) {
-      for (var k in metrics) {
-        test_metrics(metrics[k]);
-      }
-    }
-  };
-
-  (function() {
-    var summary = JSON.parse(CouchDB.request("GET", "/_stats", {
-      headers: {"Accept": "application/json"}
-    }).responseText);
-    T(typeof(summary) === 'object');
-    test_metrics(summary);
-  })();
-};

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/www/script/test/update_documents.js
----------------------------------------------------------------------
diff --git a/share/www/script/test/update_documents.js b/share/www/script/test/update_documents.js
deleted file mode 100644
index bdb7a99..0000000
--- a/share/www/script/test/update_documents.js
+++ /dev/null
@@ -1,235 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License.  You may obtain a copy
-// of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
-
-couchTests.update_documents = function(debug) {
-  var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"});
-  db.deleteDb();
-  db.createDb();
-  if (debug) debugger;
-      
-  var designDoc = {
-    _id:"_design/update",
-    language: "javascript",
-    updates: {
-      "hello" : stringFun(function(doc, req) {
-        log(doc);
-        log(req);
-        if (!doc) {
-          if (req.id) {
-            return [
-            // Creates a new document with the PUT docid,
-            { _id : req.id,
-              reqs : [req] },
-            // and returns an HTML response to the client.
-            "<p>New World</p>"];
-          };
-          //
-          return [null, "<p>Empty World</p>"];
-        };
-        // we can update the document inline
-        doc.world = "hello";
-        // we can record aspects of the request or use them in application logic.
-        doc.reqs && doc.reqs.push(req);
-        doc.edited_by = req.userCtx;
-        return [doc, "<p>hello doc</p>"];
-      }),
-      "in-place" : stringFun(function(doc, req) {
-        var field = req.query.field;
-        var value = req.query.value;
-        var message = "set "+field+" to "+value;
-        doc[field] = value;
-        return [doc, message];
-      }),
-      "form-update" : stringFun(function(doc, req) {
-        for (var field in req.form) {
-          doc[field] = req.form[field];
-        }
-        var message = "updated doc from form";
-        return [doc, message];
-      }),
-      "bump-counter" : stringFun(function(doc, req) {
-        if (!doc.counter) doc.counter = 0;
-        doc.counter += 1;
-        var message = "<h1>bumped it!</h1>";
-        return [doc, message];
-      }),
-      "error" : stringFun(function(doc, req) {
-        superFail.badCrash;
-      }),
-       "get-uuid" : stringFun(function(doc, req) {
-         return [null, req.uuid];
-       }),
-       "code-n-bump" : stringFun(function(doc,req) {
-         if (!doc.counter) doc.counter = 0;
-         doc.counter += 1;
-         var message = "<h1>bumped it!</h1>";
-         resp = {"code": 302, "body": message}
-         return [doc, resp];
-       }),
-       "resp-code" : stringFun(function(doc,req) {
-         resp = {"code": 302}
-         return [null, resp];
-       }),
-       "resp-code-and-json" : stringFun(function(doc,req) {
-         resp = {"code": 302, "json": {"ok": true}}
-         return [{"_id": req["uuid"]}, resp];
-       }),
-       "binary" : stringFun(function(doc, req) {
-         var resp = {
-           "headers" : {
-             "Content-Type" : "application/octet-stream"
-           },
-           "base64" : "aGVsbG8gd29ybGQh" // "hello world!" encoded
-         };
-         return [doc, resp];
-       }),
-      "empty" : stringFun(function(doc, req) {
-        return [{}, 'oops'];
-      })
-    }
-  };
-  T(db.save(designDoc).ok);
-  
-  var doc = {"word":"plankton", "name":"Rusty"}
-  var resp = db.save(doc);
-  T(resp.ok);
-  var docid = resp.id;
-
-  // update error
-  var xhr = CouchDB.request("POST", "/test_suite_db/_design/update/_update/");
-  T(xhr.status == 404, 'Should be missing');
-  T(JSON.parse(xhr.responseText).reason == "Invalid path.");
-  
-  // hello update world
-  xhr = CouchDB.request("PUT", "/test_suite_db/_design/update/_update/hello/"+docid);
-  T(xhr.status == 201);
-  T(xhr.responseText == "<p>hello doc</p>");
-  T(/charset=utf-8/.test(xhr.getResponseHeader("Content-Type")));
-  T(equals(docid, xhr.getResponseHeader("X-Couch-Id")));
-
-  doc = db.open(docid);
-  T(doc.world == "hello");
-
-  // Fix for COUCHDB-379
-  T(equals(xhr.getResponseHeader("Server").substr(0,7), "CouchDB"));
-
-  // hello update world (no docid)
-  xhr = CouchDB.request("POST", "/test_suite_db/_design/update/_update/hello");
-  T(xhr.status == 200);
-  T(xhr.responseText == "<p>Empty World</p>");
-
-  // no GET allowed
-  xhr = CouchDB.request("GET", "/test_suite_db/_design/update/_update/hello");
-  // T(xhr.status == 405); // TODO allow qs to throw error code as well as error message
-  T(JSON.parse(xhr.responseText).error == "method_not_allowed");
-
-  // // hello update world (non-existing docid)
-  xhr = CouchDB.request("GET", "/test_suite_db/nonExistingDoc");
-  T(xhr.status == 404);
-  xhr = CouchDB.request("PUT", "/test_suite_db/_design/update/_update/hello/nonExistingDoc");
-  T(xhr.status == 201);
-  T(xhr.responseText == "<p>New World</p>");
-  xhr = CouchDB.request("GET", "/test_suite_db/nonExistingDoc");
-  T(xhr.status == 200);
-
-  // in place update
-  xhr = CouchDB.request("PUT", "/test_suite_db/_design/update/_update/in-place/"+docid+'?field=title&value=test');
-  T(xhr.status == 201);
-  T(xhr.responseText == "set title to test");
-  doc = db.open(docid);
-  T(doc.title == "test");
-  
-  // form update via application/x-www-form-urlencoded
-  xhr = CouchDB.request("PUT", "/test_suite_db/_design/update/_update/form-update/"+docid, {
-    headers : {"Content-Type":"application/x-www-form-urlencoded"},
-    body    : "formfoo=bar&formbar=foo"
-  });
-  TEquals(201, xhr.status);
-  TEquals("updated doc from form", xhr.responseText);
-  doc = db.open(docid);
-  TEquals("bar", doc.formfoo);
-  TEquals("foo", doc.formbar);
-  
-  // bump counter
-  xhr = CouchDB.request("PUT", "/test_suite_db/_design/update/_update/bump-counter/"+docid, {
-    headers : {"X-Couch-Full-Commit":"true"}
-  });
-  T(xhr.status == 201);
-  T(xhr.responseText == "<h1>bumped it!</h1>");
-  doc = db.open(docid);
-  T(doc.counter == 1);
-  
-  // _update honors full commit if you need it to
-  xhr = CouchDB.request("PUT", "/test_suite_db/_design/update/_update/bump-counter/"+docid, {
-    headers : {"X-Couch-Full-Commit":"true"}
-  });
-  
-  var NewRev = xhr.getResponseHeader("X-Couch-Update-NewRev");
-  doc = db.open(docid);
-  T(doc['_rev'] == NewRev);
-  
-  
-  T(doc.counter == 2);
-
-  // Server provides UUID when POSTing without an ID in the URL
-  xhr = CouchDB.request("POST", "/test_suite_db/_design/update/_update/get-uuid/");
-  T(xhr.status == 200);
-  T(xhr.responseText.length == 32);
-
-  // COUCHDB-1229 - allow slashes in doc ids for update handlers
-  // /db/_design/doc/_update/handler/doc/id
-
-  var doc = {
-      _id:"with/slash",
-      counter:1
-  };
-  db.save(doc);
-  xhr = CouchDB.request("PUT", "/test_suite_db/_design/update/_update/bump-counter/with/slash");
-  TEquals(201, xhr.status, "should return a 200 status");
-  TEquals("<h1>bumped it!</h1>", xhr.responseText, "should report bumping");
-
-  var doc = db.open("with/slash");
-  TEquals(2, doc.counter, "counter should be 2");
-
-  // COUCHDB-648 - the code in the JSON response should be honored
-
-  xhr = CouchDB.request("PUT", "/test_suite_db/_design/update/_update/code-n-bump/"+docid, {
-    headers : {"X-Couch-Full-Commit":"true"}
-  });
-  T(xhr.status == 302);
-  T(xhr.responseText == "<h1>bumped it!</h1>");
-  doc = db.open(docid);
-  T(doc.counter == 3);
-
-  xhr = CouchDB.request("POST", "/test_suite_db/_design/update/_update/resp-code/");
-  T(xhr.status == 302);
-
-  xhr = CouchDB.request("POST", "/test_suite_db/_design/update/_update/resp-code-and-json/");
-  TEquals(302, xhr.status);
-  T(JSON.parse(xhr.responseText).ok);
-
-  // base64 response
-  xhr = CouchDB.request("PUT", "/test_suite_db/_design/update/_update/binary/"+docid, {
-    headers : {"X-Couch-Full-Commit":"false"},
-    body    : 'rubbish'
-  });
-  T(xhr.status == 201);
-  T(xhr.responseText == "hello world!");
-  T(/application\/octet-stream/.test(xhr.getResponseHeader("Content-Type")));
-
-  // Insert doc with empty id
-  xhr = CouchDB.request("PUT", "/test_suite_db/_design/update/_update/empty/foo");
-  TEquals(400, xhr.status);
-  TEquals("Document id must not be empty", JSON.parse(xhr.responseText).reason);
-
-};

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/www/script/test/users_db.js
----------------------------------------------------------------------
diff --git a/share/www/script/test/users_db.js b/share/www/script/test/users_db.js
deleted file mode 100644
index 56dae6b..0000000
--- a/share/www/script/test/users_db.js
+++ /dev/null
@@ -1,173 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License.  You may obtain a copy
-// of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
-couchTests.users_db = function(debug) {
-  // This tests the users db, especially validations
-  // this should also test that you can log into the couch
-  
-  var usersDb = new CouchDB("test_suite_users", {"X-Couch-Full-Commit":"false"});
-
-  // test that you can treat "_user" as a db-name
-  // this can complicate people who try to secure the users db with 
-  // an http proxy and fail to get both the actual db and the _user path
-  // maybe it's not the right approach...
-  // hard to know what else to do, as we don't let non-admins inspect the config
-  // to determine the actual users db name.
-
-  function testFun() {
-    // test that the validation function is installed
-    var ddoc = usersDb.open("_design/_auth");
-    T(ddoc.validate_doc_update);
-    
-    // test that you can login as a user using basic auth
-    var jchrisUserDoc = CouchDB.prepareUserDoc({
-      name: "jchris@apache.org"
-    }, "funnybone");
-    T(usersDb.save(jchrisUserDoc).ok);
-    
-    T(CouchDB.session().userCtx.name == null);
-
-    // test that you can use basic auth aginst the users db
-    var s = CouchDB.session({
-      headers : {
-        //                 base64_encode("jchris@apache.org:funnybone")
-        "Authorization" : "Basic amNocmlzQGFwYWNoZS5vcmc6ZnVubnlib25l"
-      }
-    });
-    T(s.userCtx.name == "jchris@apache.org");
-    T(s.info.authenticated == "default");
-    T(s.info.authentication_db == "test_suite_users");
-    TEquals(["oauth", "cookie", "default"], s.info.authentication_handlers);
-    var s = CouchDB.session({
-      headers : {
-        "Authorization" : "Basic Xzpf" // name and pass of _:_
-      }
-    });
-    T(s.name == null);
-    T(s.info.authenticated == "default");
-    
-    
-    // ok, now create a conflicting edit on the jchris doc, and make sure there's no login.
-    var jchrisUser2 = JSON.parse(JSON.stringify(jchrisUserDoc));
-    jchrisUser2.foo = "bar";
-    T(usersDb.save(jchrisUser2).ok);
-    try {
-      usersDb.save(jchrisUserDoc);
-      T(false && "should be an update conflict");
-    } catch(e) {
-      T(true);
-    }
-    // save as bulk with new_edits=false to force conflict save
-    var resp = usersDb.bulkSave([jchrisUserDoc],{all_or_nothing : true});
-    
-    var jchrisWithConflict = usersDb.open(jchrisUserDoc._id, {conflicts : true});
-    T(jchrisWithConflict._conflicts.length == 1);
-    
-    // no login with conflicted user doc
-    try {
-      var s = CouchDB.session({
-        headers : {
-          "Authorization" : "Basic amNocmlzQGFwYWNoZS5vcmc6ZnVubnlib25l"
-        }
-      });
-      T(false && "this will throw");
-    } catch(e) {
-      T(e.error == "unauthorized");
-      T(/conflict/.test(e.reason));
-    }
-
-    // you can delete a user doc
-    s = CouchDB.session().userCtx;
-    T(s.name == null);
-    T(s.roles.indexOf("_admin") !== -1);
-    T(usersDb.deleteDoc(jchrisWithConflict).ok);
-
-    // you can't change doc from type "user"
-    jchrisUserDoc = usersDb.open(jchrisUserDoc._id);
-    jchrisUserDoc.type = "not user";
-    try {
-      usersDb.save(jchrisUserDoc);
-      T(false && "should only allow us to save doc when type == 'user'");
-    } catch(e) {
-      T(e.reason == "doc.type must be user");
-    }
-    jchrisUserDoc.type = "user";
-
-    // "roles" must be an array
-    jchrisUserDoc.roles = "not an array";
-    try {
-      usersDb.save(jchrisUserDoc);
-      T(false && "should only allow us to save doc when roles is an array");
-    } catch(e) {
-      T(e.reason == "doc.roles must be an array");
-    }
-    jchrisUserDoc.roles = [];
-
-    // "roles" must be an array of strings
-    jchrisUserDoc.roles = [12];
-    try {
-      usersDb.save(jchrisUserDoc);
-      T(false && "should only allow us to save doc when roles is an array of strings");
-    } catch(e) {
-      TEquals(e.reason, "doc.roles can only contain strings");
-    }
-    jchrisUserDoc.roles = [];
-
-    // "roles" must exist
-    delete jchrisUserDoc.roles;
-    try {
-      usersDb.save(jchrisUserDoc);
-      T(false && "should only allow us to save doc when roles exists");
-    } catch(e) {
-      T(e.reason == "doc.roles must exist");
-    }
-    jchrisUserDoc.roles = [];
-
-    // character : is not allowed in usernames
-    var joeUserDoc = CouchDB.prepareUserDoc({
-      name: "joe:erlang"
-    }, "qwerty");
-    try {
-      usersDb.save(joeUserDoc);
-      T(false, "shouldn't allow : in usernames");
-    } catch(e) {
-      TEquals("Character `:` is not allowed in usernames.", e.reason);
-    }
-
-    // test that you can login as a user with a password starting with :
-    var doc = CouchDB.prepareUserDoc({
-      name: "foo@example.org"
-    }, ":bar");
-    T(usersDb.save(doc).ok);
-
-    T(CouchDB.session().userCtx.name == null);
-
-    // test that you can use basic auth aginst the users db
-    var s = CouchDB.session({
-      headers : {
-        //                 base64_encode("foo@example.org::bar")
-        "Authorization" : "Basic Zm9vQGV4YW1wbGUub3JnOjpiYXI="
-      }
-    });
-    T(s.userCtx.name == "foo@example.org");
-
-  };
-
-  usersDb.deleteDb();
-  run_on_modified_server(
-    [{section: "couch_httpd_auth",
-      key: "authentication_db", value: usersDb.name}],
-    testFun
-  );
-  usersDb.deleteDb(); // cleanup
-  
-}

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/www/script/test/users_db_security.js
----------------------------------------------------------------------
diff --git a/share/www/script/test/users_db_security.js b/share/www/script/test/users_db_security.js
deleted file mode 100644
index f2ca8bc..0000000
--- a/share/www/script/test/users_db_security.js
+++ /dev/null
@@ -1,423 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
-couchTests.users_db_security = function(debug) {
-  var usersDb = new CouchDB("test_suite_users", {"X-Couch-Full-Commit":"false"});
-  if (debug) debugger;
-
-  function wait(ms) {
-    var t0 = new Date(), t1;
-    do {
-      CouchDB.request("GET", "/");
-      t1 = new Date();
-    } while ((t1 - t0) <= ms);
-  }
-
-  var loginUser = function(username) {
-    var pws = {
-      jan: "apple",
-      jchris: "mp3",
-      jchris1: "couch",
-      fdmanana: "foobar",
-      benoitc: "test"
-    };
-    var username1 = username.replace(/[0-9]$/, "");
-    var password = pws[username];
-    T(CouchDB.login(username1, pws[username]).ok);
-  };
-
-  var open_as = function(db, docId, username) {
-    loginUser(username);
-    try {
-      return db.open(docId, {"anti-cache": Math.round(Math.random() * 100000)});
-    } finally {
-      CouchDB.logout();
-    }
-  };
-
-  var view_as = function(db, viewname, username) {
-    loginUser(username);
-    try {
-      return db.view(viewname);
-    } finally {
-      CouchDB.logout();
-    }
-  };
-
-  var save_as = function(db, doc, username)
-  {
-    loginUser(username);
-    try {
-      return db.save(doc);
-    } catch (ex) {
-      return ex;
-    } finally {
-      CouchDB.logout();
-    }
-  };
-
-  var changes_as = function(db, username)
-  {
-    loginUser(username);
-    try {
-      return db.changes();
-    } catch(ex) {
-      return ex;
-    } finally {
-      CouchDB.logout();
-    }
-  };
-
-  var testFun = function()
-  {
-
-    // _users db
-    // a doc with a field 'password' should be hashed to 'derived_key'
-    //  with salt and salt stored in 'salt', 'password' is set to null.
-    //  Exising 'derived_key' and 'salt' fields are overwritten with new values
-    //  when a non-null 'password' field exists.
-    // anonymous should be able to create a user document
-    var userDoc = {
-      _id: "org.couchdb.user:jchris",
-      type: "user",
-      name: "jchris",
-      password: "mp3",
-      roles: []
-    };
-
-    // jan's gonna be admin as he's the first user
-    TEquals(true, usersDb.save(userDoc).ok, "should save document");
-    userDoc = usersDb.open("org.couchdb.user:jchris");
-    TEquals(undefined, userDoc.password, "password field should be null 1");
-    TEquals(40, userDoc.derived_key.length, "derived_key should exist");
-    TEquals(32, userDoc.salt.length, "salt should exist");
-
-    // create server admin
-    run_on_modified_server([
-        {
-          section: "couch_httpd_auth",
-          key: "iterations",
-          value: "1"
-        },
-        {
-          section: "admins",
-          key: "jan",
-          value: "apple"
-        }
-      ], function() {
-
-      // anonymous should not be able to read an existing user's user document
-      var res = usersDb.open("org.couchdb.user:jchris");
-      TEquals(null, res, "anonymous user doc read should be not found");
-
-      // anonymous should not be able to read /_users/_changes
-      try {
-        var ch = usersDb.changes();
-        T(false, "anonymous can read _changes");
-      } catch(e) {
-        TEquals("unauthorized", e.error, "anoymous can't read _changes");
-      }
-
-      // user should be able to read their own document
-      var jchrisDoc = open_as(usersDb, "org.couchdb.user:jchris", "jchris");
-      TEquals("org.couchdb.user:jchris", jchrisDoc._id);
-
-      // user should not be able to read /_users/_changes
-      var changes = changes_as(usersDb, "jchris");
-      TEquals("unauthorized", changes.error, "user can't read _changes");
-
-      // new 'password' fields should trigger new hashing routine
-      jchrisDoc.password = "couch";
-
-      TEquals(true, save_as(usersDb, jchrisDoc, "jchris").ok);
-      wait(100);
-      var jchrisDoc = open_as(usersDb, "org.couchdb.user:jchris", "jchris1");
-
-      TEquals(undefined, jchrisDoc.password, "password field should be null 2");
-      TEquals(40, jchrisDoc.derived_key.length, "derived_key should exist");
-      TEquals(32, jchrisDoc.salt.length, "salt should exist");
-
-      TEquals(true, userDoc.salt != jchrisDoc.salt, "should have new salt");
-      TEquals(true, userDoc.derived_key != jchrisDoc.derived_key,
-        "should have new derived_key");
-
-      // SHA-1 password hashes are upgraded to PBKDF2 on successful
-      // authentication
-      var rnewsonDoc = {
-        _id: "org.couchdb.user:rnewson",
-        type: "user",
-        name: "rnewson",
-        // password: "plaintext_password",
-        password_sha: "e29dc3aeed5abf43185c33e479f8998558c59474",
-        salt: "24f1e0a87c2e374212bda1073107e8ae",
-        roles: []
-      };
-
-      var password_sha = rnewsonDoc.password_sha,
-        salt = rnewsonDoc.salt,
-        derived_key,
-        iterations;
-
-      usersDb.save(rnewsonDoc);
-      rnewsonDoc = open_as(usersDb, rnewsonDoc._id, "jan");
-      T(!rnewsonDoc.password_scheme);
-      T(!rnewsonDoc.derived_key);
-      T(!rnewsonDoc.iterations);
-
-      // check that we don't upgrade when the password is wrong
-      TEquals("unauthorized", CouchDB.login("rnewson", "wrong_password").error);
-      rnewsonDoc = open_as(usersDb, rnewsonDoc._id, "jan");
-      TEquals(salt, rnewsonDoc.salt);
-      TEquals(password_sha, rnewsonDoc.password_sha);
-      T(!rnewsonDoc.password_scheme);
-      T(!rnewsonDoc.derived_key);
-      T(!rnewsonDoc.iterations);
-
-      TEquals(true, CouchDB.login("rnewson", "plaintext_password").ok);
-      rnewsonDoc = usersDb.open(rnewsonDoc._id);
-      TEquals("pbkdf2", rnewsonDoc.password_scheme);
-      T(rnewsonDoc.salt != salt);
-      T(!rnewsonDoc.password_sha);
-      T(rnewsonDoc.derived_key);
-      T(rnewsonDoc.iterations);
-
-      salt = rnewsonDoc.salt,
-      derived_key = rnewsonDoc.derived_key,
-      iterations = rnewsonDoc.iterations;
-
-      // check that authentication is still working
-      // and everything is staying the same now
-      CouchDB.logout();
-      TEquals(true, CouchDB.login("rnewson", "plaintext_password").ok);
-      rnewsonDoc = usersDb.open(rnewsonDoc._id);
-      TEquals("pbkdf2", rnewsonDoc.password_scheme);
-      TEquals(salt, rnewsonDoc.salt);
-      T(!rnewsonDoc.password_sha);
-      TEquals(derived_key, rnewsonDoc.derived_key);
-      TEquals(iterations, rnewsonDoc.iterations);
-
-      CouchDB.logout();
-
-      // user should not be able to read another user's user document
-      var fdmananaDoc = {
-        _id: "org.couchdb.user:fdmanana",
-        type: "user",
-        name: "fdmanana",
-        password: "foobar",
-        roles: []
-      };
-
-      usersDb.save(fdmananaDoc);
-
-      var fdmananaDocAsReadByjchris =
-        open_as(usersDb, "org.couchdb.user:fdmanana", "jchris1");
-      TEquals(null, fdmananaDocAsReadByjchris,
-        "should not_found opening another user's user doc");
-
-
-      // save a db admin
-      var benoitcDoc = {
-        _id: "org.couchdb.user:benoitc",
-        type: "user",
-        name: "benoitc",
-        password: "test",
-        roles: ["user_admin"]
-      };
-      save_as(usersDb, benoitcDoc, "jan");
-
-      TEquals(true, CouchDB.login("jan", "apple").ok);
-      T(usersDb.setSecObj({
-        "admins" : {
-          roles : [],
-          names : ["benoitc"]
-        }
-      }).ok);
-      CouchDB.logout();
-
-      // user should not be able to read from any view
-      var ddoc = {
-        _id: "_design/user_db_auth",
-        views: {
-          test: {
-            map: "function(doc) { emit(doc._id, null); }"
-          }
-        }
-      };
-
-      save_as(usersDb, ddoc, "jan");
-
-      try {
-        usersDb.view("user_db_auth/test");
-        T(false, "user had access to view in admin db");
-      } catch(e) {
-        TEquals("forbidden", e.error,
-        "non-admins should not be able to read a view");
-      }
-
-      // admin should be able to read from any view
-      var result = view_as(usersDb, "user_db_auth/test", "jan");
-      TEquals(4, result.total_rows, "should allow access and list four users to admin");
-
-      // db admin should be able to read from any view
-      var result = view_as(usersDb, "user_db_auth/test", "benoitc");
-      TEquals(4, result.total_rows, "should allow access and list four users to db admin");
-
-
-      // non-admins can't read design docs
-      try {
-        open_as(usersDb, "_design/user_db_auth", "jchris1");
-        T(false, "non-admin read design doc, should not happen");
-      } catch(e) {
-        TEquals("forbidden", e.error, "non-admins can't read design docs");
-      }
-
-      // admin should be able to read and edit any user doc
-      fdmananaDoc.password = "mobile";
-      var result = save_as(usersDb, fdmananaDoc, "jan");
-      TEquals(true, result.ok, "admin should be able to update any user doc");
-
-      // admin should be able to read and edit any user doc
-      fdmananaDoc.password = "mobile1";
-      var result = save_as(usersDb, fdmananaDoc, "benoitc");
-      TEquals(true, result.ok, "db admin by role should be able to update any user doc");
-
-      TEquals(true, CouchDB.login("jan", "apple").ok);
-      T(usersDb.setSecObj({
-        "admins" : {
-          roles : ["user_admin"],
-          names : []
-        }
-      }).ok);
-      CouchDB.logout();
-
-      // db admin should be able to read and edit any user doc
-      fdmananaDoc.password = "mobile2";
-      var result = save_as(usersDb, fdmananaDoc, "benoitc");
-      TEquals(true, result.ok, "db admin should be able to update any user doc");
-
-      // ensure creation of old-style docs still works
-      var robertDoc = CouchDB.prepareUserDoc({ name: "robert" }, "anchovy");
-      var result = usersDb.save(robertDoc);
-      TEquals(true, result.ok, "old-style user docs should still be accepted");
-
-      // log in one last time so run_on_modified_server can clean up the admin account
-      TEquals(true, CouchDB.login("jan", "apple").ok);
-    });
-
-    run_on_modified_server([
-        {
-          section: "couch_httpd_auth",
-          key: "iterations",
-          value: "1"
-        },
-        {
-          section: "couch_httpd_auth",
-          key: "public_fields",
-          value: "name,type"
-        },
-        {
-          section: "couch_httpd_auth",
-          key: "users_db_public",
-          value: "true"
-        },
-        {
-          section: "admins",
-          key: "jan",
-          value: "apple"
-        }
-      ], function() {
-        var res = usersDb.open("org.couchdb.user:jchris");
-        TEquals("jchris", res.name);
-        TEquals("user", res.type);
-        TEquals(undefined, res.roles);
-        TEquals(undefined, res.salt);
-        TEquals(undefined, res.password_scheme);
-        TEquals(undefined, res.derived_key);
-
-        TEquals(true, CouchDB.login("jchris", "couch").ok);
-
-        var all = usersDb.allDocs({ include_docs: true });
-        T(all.rows);
-        if (all.rows) {
-          T(all.rows.every(function(row) {
-            if (row.doc) {
-              return Object.keys(row.doc).every(function(key) {
-                return key === 'name' || key === 'type';
-              });
-            } else {
-              if(row.id[0] == "_") {
-                // ignore design docs
-                return true
-              } else {
-                return false;
-              }
-            }
-          }));
-        }
-      // log in one last time so run_on_modified_server can clean up the admin account
-      TEquals(true, CouchDB.login("jan", "apple").ok);
-    });
-
-    run_on_modified_server([
-      {
-        section: "couch_httpd_auth",
-        key: "iterations",
-        value: "1"
-      },
-      {
-        section: "couch_httpd_auth",
-        key: "public_fields",
-        value: "name"
-      },
-      {
-        section: "couch_httpd_auth",
-        key: "users_db_public",
-        value: "false"
-      },
-      {
-        section: "admins",
-        key: "jan",
-        value: "apple"
-      }
-    ], function() {
-      TEquals(true, CouchDB.login("jchris", "couch").ok);
-
-      try {
-        var all = usersDb.allDocs({ include_docs: true });
-        T(false); // should never hit
-      } catch(e) {
-        TEquals("forbidden", e.error, "should throw");
-      }
-
-      // COUCHDB-1888 make sure admins always get all fields
-      TEquals(true, CouchDB.login("jan", "apple").ok);
-      var all_admin = usersDb.allDocs({ include_docs: "true" });
-      TEquals("user", all_admin.rows[2].doc.type,
-          "should return type");
-
-
-      // log in one last time so run_on_modified_server can clean up the admin account
-      TEquals(true, CouchDB.login("jan", "apple").ok);
-    });
-  };
-
-  usersDb.deleteDb();
-  run_on_modified_server(
-    [{section: "couch_httpd_auth",
-      key: "iterations", value: "1"},
-     {section: "couch_httpd_auth",
-      key: "authentication_db", value: usersDb.name}],
-    testFun
-  );
-  usersDb.deleteDb(); // cleanup
-
-};

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/www/script/test/utf8.js
----------------------------------------------------------------------
diff --git a/share/www/script/test/utf8.js b/share/www/script/test/utf8.js
deleted file mode 100644
index 04f6313..0000000
--- a/share/www/script/test/utf8.js
+++ /dev/null
@@ -1,42 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
-couchTests.utf8 = function(debug) {
-  var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"});
-  db.deleteDb();
-  db.createDb();
-  if (debug) debugger;
-
-  var texts = [];
-
-  texts[0] = "1. Ascii: hello"
-  texts[1] = "2. Russian: На берегу пустынных волн"
-  texts[2] = "3. Math: ∮ E⋅da = Q,  n → ∞, ∑ f(i) = ∏ g(i),"
-  texts[3] = "4. Geek: STARGΛ̊TE SG-1"
-  texts[4] = "5. Braille: ⡌⠁⠧⠑ ⠼⠁⠒  ⡍⠜⠇⠑⠹⠰⠎ ⡣⠕⠌"
-  texts[5] = "6. null \u0000 byte" 
-
-  // check that we can save a reload with full fidelity
-  for (var i=0; i<texts.length; i++) {
-    T(db.save({_id:i.toString(), text:texts[i]}).ok);
-  }
-
-  for (var i=0; i<texts.length; i++) {
-    T(db.open(i.toString()).text == texts[i]);
-  }
-
-  // check that views and key collation don't blow up
-  var rows = db.query(function(doc) { emit(null, doc.text) }).rows;
-  for (var i=0; i<texts.length; i++) {
-    T(rows[i].value == texts[i]);
-  }
-};

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/www/script/test/uuids.js
----------------------------------------------------------------------
diff --git a/share/www/script/test/uuids.js b/share/www/script/test/uuids.js
deleted file mode 100644
index d304c4e..0000000
--- a/share/www/script/test/uuids.js
+++ /dev/null
@@ -1,149 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
-couchTests.uuids = function(debug) {
-  var etags = [];
-  var testHashBustingHeaders = function(xhr) {
-    T(xhr.getResponseHeader("Cache-Control").match(/no-cache/));
-    T(xhr.getResponseHeader("Pragma") == "no-cache");
-
-    var newetag = xhr.getResponseHeader("ETag");
-    T(etags.indexOf(newetag) < 0);
-    etags[etags.length] = newetag;
-    
-    // Removing the time based tests as they break easily when
-    // running CouchDB on a remote server in regards to the browser
-    // running the Futon test suite.
-    //
-    //var currentTime = new Date();
-    //var expiresHeader = Date.parse(xhr.getResponseHeader("Expires"));
-    //var dateHeader = Date.parse(xhr.getResponseHeader("Date"));
-
-    //T(expiresHeader < currentTime);
-    //T(currentTime - dateHeader < 3000);
-  };
-
-  var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"});
-  db.deleteDb();
-  db.createDb();
-  if (debug) debugger;
-
-  // a single UUID without an explicit count
-  var xhr = CouchDB.request("GET", "/_uuids");
-  T(xhr.status == 200);
-  var result = JSON.parse(xhr.responseText);
-  T(result.uuids.length == 1);
-  var first = result.uuids[0];
-  testHashBustingHeaders(xhr);
-
-  // a single UUID with an explicit count
-  xhr = CouchDB.request("GET", "/_uuids?count=1");
-  T(xhr.status == 200);
-  result = JSON.parse(xhr.responseText);
-  T(result.uuids.length == 1);
-  var second = result.uuids[0];
-  T(first != second);
-
-  // no collisions with 1,000 UUIDs
-  xhr = CouchDB.request("GET", "/_uuids?count=1000");
-  T(xhr.status == 200);
-  result = JSON.parse(xhr.responseText);
-  T( result.uuids.length == 1000 );
-  var seen = {};
-  for(var i in result.uuids) {
-    var id = result.uuids[i];
-    T(seen[id] === undefined);
-    seen[id] = 1;
-  }
-
-  // ensure we return a 405 on POST
-  xhr = CouchDB.request("POST", "/_uuids?count=1000");
-  T(xhr.status == 405);
-
-  // Test sequential uuids
-  var seq_testfun = function() {
-    xhr = CouchDB.request("GET", "/_uuids?count=1000");
-    T(xhr.status == 200);
-    result = JSON.parse(xhr.responseText);
-    for(var i = 1; i < result.uuids.length; i++) {
-      T(result.uuids[i].length == 32);
-      T(result.uuids[i-1] < result.uuids[i], "Sequential uuids are ordered.");
-    }
-  };
-
-  // test max_uuid_count
-  var xhr = CouchDB.request("GET", "/_uuids?count=1001");
-  TEquals(403, xhr.status, "should error when count > max_count");
-
-  run_on_modified_server([{
-      "section": "uuids",
-      "key": "algorithm",
-      "value": "sequential",
-    }],
-    seq_testfun
-  );
-
-  // Test utc_random uuids
-  var utc_testfun = function() {
-    xhr = CouchDB.request("GET", "/_uuids?count=1000");
-    T(xhr.status == 200);
-    result = JSON.parse(xhr.responseText);
-    T(result.uuids[1].length == 32);
-
-    // no collisions
-    var seen = {};
-    for(var i in result.uuids) {
-      var id = result.uuids[i];
-      T(seen[id] === undefined);
-      seen[id] = 1;
-    }
-
-    // roughly ordered
-    var u1 = result.uuids[1].substr(0, 13);
-    var u2 = result.uuids[result.uuids.length-1].substr(0, 13);
-    T(u1 < u2, "UTC uuids are only roughly ordered, so this assertion may fail occasionally. Don't sweat it.");
-  };
-
-  run_on_modified_server([{
-      "section": "uuids",
-      "key": "algorithm",
-      "value": "utc_random"
-    }],
-    utc_testfun
-  );
-
-  // Test utc_id uuids
-  var utc_id_suffix = "frog";
-  var suffix_testfun = function() {
-    xhr = CouchDB.request("GET", "/_uuids?count=10");
-    T(xhr.status == 200);
-    result = JSON.parse(xhr.responseText);
-    for(var i = 1; i < result.uuids.length; i++) {
-      T(result.uuids[i].length == 14 + utc_id_suffix.length);
-      T(result.uuids[i].substring(14) == utc_id_suffix);
-      T(result.uuids[i-1] < result.uuids[i], "utc_id_suffix uuids are ordered.");
-    }
-  };
-
-  run_on_modified_server([{
-      "section": "uuids",
-      "key": "algorithm",
-      "value": "utc_id"
-    }, {
-      "section": "uuids",
-      "key": "utc_id_suffix",
-      "value": utc_id_suffix
-    }],
-    suffix_testfun
-  );
-
- };

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/www/script/test/view_collation.js
----------------------------------------------------------------------
diff --git a/share/www/script/test/view_collation.js b/share/www/script/test/view_collation.js
deleted file mode 100644
index b01a5c5..0000000
--- a/share/www/script/test/view_collation.js
+++ /dev/null
@@ -1,116 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
-couchTests.view_collation = function(debug) {
-  var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"});
-  db.deleteDb();
-  db.createDb();
-  if (debug) debugger;
-
-  // NOTE, the values are already in their correct sort order. Consider this
-  // a specification of collation of json types.
-
-  var values = [];
-
-  // special values sort before all other types
-  values.push(null);
-  values.push(false);
-  values.push(true);
-
-  // then numbers
-  values.push(1);
-  values.push(2);
-  values.push(3.0);
-  values.push(4);
-
-  // then text, case sensitive
-  values.push("a");
-  values.push("A");
-  values.push("aa");
-  values.push("b");
-  values.push("B");
-  values.push("ba");
-  values.push("bb");
-
-  // then arrays. compared element by element until different.
-  // Longer arrays sort after their prefixes
-  values.push(["a"]);
-  values.push(["b"]);
-  values.push(["b","c"]);
-  values.push(["b","c", "a"]);
-  values.push(["b","d"]);
-  values.push(["b","d", "e"]);
-
-  // then object, compares each key value in the list until different.
-  // larger objects sort after their subset objects.
-  values.push({a:1});
-  values.push({a:2});
-  values.push({b:1});
-  values.push({b:2});
-  values.push({b:2, a:1}); // Member order does matter for collation.
-                           // CouchDB preserves member order
-                           // but doesn't require that clients will.
-                           // (this test might fail if used with a js engine
-                           // that doesn't preserve order)
-  values.push({b:2, c:2});
-
-  for (var i=0; i<values.length; i++) {
-    db.save({_id:(i).toString(), foo:values[i]});
-  }
-
-  var queryFun = function(doc) { emit(doc.foo, null); };
-  var rows = db.query(queryFun).rows;
-  for (i=0; i<values.length; i++) {
-    T(equals(rows[i].key, values[i]));
-  }
-
-  // everything has collated correctly. Now to check the descending output
-  rows = db.query(queryFun, null, {descending: true}).rows;
-  for (i=0; i<values.length; i++) {
-    T(equals(rows[i].key, values[values.length - 1 -i]));
-  }
-
-  // now check the key query args
-  for (i=1; i<values.length; i++) {
-    var queryOptions = {key:values[i]};
-    rows = db.query(queryFun, null, queryOptions).rows;
-    T(rows.length == 1 && equals(rows[0].key, values[i]));
-  }
-
-  // test inclusive_end=true (the default)
-  // the inclusive_end=true functionality is limited to endkey currently
-  // if you need inclusive_start=false for startkey, please do implement. ;)
-  var rows = db.query(queryFun, null, {endkey : "b", inclusive_end:true}).rows;
-  T(rows[rows.length-1].key == "b");
-  // descending=true
-  var rows = db.query(queryFun, null, {endkey : "b",
-    descending:true, inclusive_end:true}).rows;
-  T(rows[rows.length-1].key == "b");
-
-  // test inclusive_end=false
-  var rows = db.query(queryFun, null, {endkey : "b", inclusive_end:false}).rows;
-  T(rows[rows.length-1].key == "aa");
-  // descending=true
-  var rows = db.query(queryFun, null, {endkey : "b",
-    descending:true, inclusive_end:false}).rows;
-  T(rows[rows.length-1].key == "B");
-  
-  var rows = db.query(queryFun, null, {
-    endkey : "b", endkey_docid: "10",
-    inclusive_end:false}).rows;
-  T(rows[rows.length-1].key == "aa");
-  
-  var rows = db.query(queryFun, null, {
-    endkey : "b", endkey_docid: "11",
-    inclusive_end:false}).rows;
-  T(rows[rows.length-1].key == "b");
-};

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/www/script/test/view_collation_raw.js
----------------------------------------------------------------------
diff --git a/share/www/script/test/view_collation_raw.js b/share/www/script/test/view_collation_raw.js
deleted file mode 100644
index 779f7eb..0000000
--- a/share/www/script/test/view_collation_raw.js
+++ /dev/null
@@ -1,130 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
-couchTests.view_collation_raw = function(debug) {
-  var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"});
-  db.deleteDb();
-  db.createDb();
-  if (debug) debugger;
-
-  // NOTE, the values are already in their correct sort order. Consider this
-  // a specification of collation of json types.
-
-  var values = [];
-
-  //  numbers
-  values.push(1);
-  values.push(2);
-  values.push(3);
-  values.push(4);
-  
-  values.push(false);
-  values.push(null);
-  values.push(true);
-  
-  // then object, compares each key value in the list until different.
-  // larger objects sort after their subset objects.
-  values.push({a:1});
-  values.push({a:2});
-  values.push({b:1});
-  values.push({b:2});
-  values.push({b:2, a:1}); // Member order does matter for collation.
-                           // CouchDB preserves member order
-                           // but doesn't require that clients will.
-                           // (this test might fail if used with a js engine
-                           // that doesn't preserve order)
-  values.push({b:2, c:2});
-
-  // then arrays. compared element by element until different.
-  // Longer arrays sort after their prefixes
-  values.push(["a"]);
-  values.push(["b"]);
-  values.push(["b","c"]);
-  values.push(["b","c", "a"]);
-  values.push(["b","d"]);
-  values.push(["b","d", "e"]);
-
-
-  // then text, case sensitive
-  values.push("A");
-  values.push("B");
-  values.push("a");
-  values.push("aa");
-  values.push("b");
-  values.push("ba");
-  values.push("bb");
-
-  for (var i=0; i<values.length; i++) {
-    db.save({_id:(i).toString(), foo:values[i]});
-  }
-
-  var designDoc = {
-    _id:"_design/test", // turn off couch.js id escaping?
-    language: "javascript",
-    views: {
-      test: {map: "function(doc) { emit(doc.foo, null); }",
-            options: {collation:"raw"}}
-    }
-  }
-  T(db.save(designDoc).ok);
-
-  // Confirm that everything collates correctly.
-  var rows = db.view("test/test").rows;
-  for (i=0; i<values.length; i++) {
-    T(equals(rows[i].key, values[i]));
-  }
-
-  // Confirm that couch allows raw semantics in key ranges.
-  rows = db.view("test/test", {startkey:"Z", endkey:"a"}).rows;
-  TEquals(1, rows.length);
-  TEquals("a", rows[0].key);
-
-  // Check the descending output.
-  rows = db.view("test/test", {descending: true}).rows;
-  for (i=0; i<values.length; i++) {
-    T(equals(rows[i].key, values[values.length - 1 -i]));
-  }
-
-  // now check the key query args
-  for (i=1; i<values.length; i++) {
-    rows = db.view("test/test", {key:values[i]}).rows;
-    T(rows.length == 1 && equals(rows[0].key, values[i]));
-  }
-
-  // test inclusive_end=true (the default)
-  // the inclusive_end=true functionality is limited to endkey currently
-  // if you need inclusive_start=false for startkey, please do implement. ;)
-  var rows = db.view("test/test", {endkey : "b", inclusive_end:true}).rows;
-  T(rows[rows.length-1].key == "b");
-  // descending=true
-  var rows = db.view("test/test", {endkey : "b",
-    descending:true, inclusive_end:true}).rows;
-  T(rows[rows.length-1].key == "b");
-
-  // test inclusive_end=false
-  var rows = db.view("test/test", {endkey : "b", inclusive_end:false}).rows;
-  T(rows[rows.length-1].key == "aa");
-  // descending=true
-  var rows = db.view("test/test", {endkey : "b",
-    descending:true, inclusive_end:false}).rows;
-  T(rows[rows.length-1].key == "ba");
-  
-  var rows = db.view("test/test", {
-    endkey : "b", endkey_docid: "10",
-    inclusive_end:false}).rows;
-  T(rows[rows.length-1].key == "aa");
-  
-  var rows = db.view("test/test", {
-    endkey : "b", endkey_docid: "11",
-    inclusive_end:false}).rows;
-  T(rows[rows.length-1].key == "aa");
-};

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/www/script/test/view_compaction.js
----------------------------------------------------------------------
diff --git a/share/www/script/test/view_compaction.js b/share/www/script/test/view_compaction.js
deleted file mode 100644
index 35d6276..0000000
--- a/share/www/script/test/view_compaction.js
+++ /dev/null
@@ -1,110 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
-couchTests.view_compaction = function(debug) {
-
-  if (debug) debugger;
-
-  var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit": "true"});
-
-  db.deleteDb();
-  db.createDb();
-
-  var ddoc = {
-    _id: "_design/foo",
-    language: "javascript",
-    views: {
-      view1: {
-        map: "function(doc) { emit(doc._id, doc.value) }"
-      },
-      view2: {
-        map: "function(doc) { if (typeof(doc.integer) === 'number') {emit(doc._id, doc.integer);} }",
-        reduce: "function(keys, values, rereduce) { return sum(values); }"
-      }
-    }
-  };
-  T(db.save(ddoc).ok);
-
-  var docs = makeDocs(0, 10000);
-  db.bulkSave(docs);
-
-  var resp = db.view('foo/view1', {});
-  TEquals(10000, resp.rows.length);
-
-  resp = db.view('foo/view2', {});
-  TEquals(1, resp.rows.length);
-
-  resp = db.designInfo("_design/foo");
-  TEquals(10001, resp.view_index.update_seq);
-
-
-  // update docs
-  for (var i = 0; i < docs.length; i++) {
-    docs[i].integer = docs[i].integer + 1;
-  }
-  db.bulkSave(docs);
-
-
-  resp = db.view('foo/view1', {});
-  TEquals(10000, resp.rows.length);
-
-  resp = db.view('foo/view2', {});
-  TEquals(1, resp.rows.length);
-
-  resp = db.designInfo("_design/foo");
-  TEquals(20001, resp.view_index.update_seq);
-
-
-  // update docs again...
-  for (var i = 0; i < docs.length; i++) {
-    docs[i].integer = docs[i].integer + 2;
-  }
-  db.bulkSave(docs);
-
-
-  resp = db.view('foo/view1', {});
-  TEquals(10000, resp.rows.length);
-
-  resp = db.view('foo/view2', {});
-  TEquals(1, resp.rows.length);
-
-  resp = db.designInfo("_design/foo");
-  TEquals(30001, resp.view_index.update_seq);
-
-  var disk_size_before_compact = resp.view_index.disk_size;
-  var data_size_before_compact = resp.view_index.data_size;
-
-  TEquals("number", typeof data_size_before_compact, "data size is a number");
-  T(data_size_before_compact < disk_size_before_compact, "data size < file size");
-
-  // compact view group
-  var xhr = CouchDB.request("POST", "/" + db.name + "/_design/foo/_compact");
-  T(JSON.parse(xhr.responseText).ok === true);
-
-  resp = db.designInfo("_design/foo");
-  while (resp.view_index.compact_running === true) {
-    resp = db.designInfo("_design/foo");
-  }
-
-
-  resp = db.view('foo/view1', {});
-  TEquals(10000, resp.rows.length);
-
-  resp = db.view('foo/view2', {});
-  TEquals(1, resp.rows.length);
-
-  resp = db.designInfo("_design/foo");
-  TEquals(30001, resp.view_index.update_seq);
-  T(resp.view_index.disk_size < disk_size_before_compact);
-  TEquals("number", typeof resp.view_index.data_size, "data size is a number");
-  T(resp.view_index.data_size < resp.view_index.disk_size, "data size < file size");
-};
\ No newline at end of file


[14/37] move JS tests into safety

Posted by ja...@apache.org.
http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/test/purge.js
----------------------------------------------------------------------
diff --git a/share/test/purge.js b/share/test/purge.js
new file mode 100644
index 0000000..2968913
--- /dev/null
+++ b/share/test/purge.js
@@ -0,0 +1,145 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+
+couchTests.purge = function(debug) {
+  var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"});
+  db.deleteDb();
+  db.createDb();
+  if (debug) debugger;
+
+  /*
+   purge is not to be confused with a document deletion.  It removes the
+   document and all edit history from the local instance of the database.
+  */
+
+  var numDocs = 10;
+
+  var designDoc = {
+    _id:"_design/test",
+    language: "javascript",
+    views: {
+      all_docs_twice: {map: "function(doc) { emit(doc.integer, null); emit(doc.integer, null) }"},
+      single_doc: {map: "function(doc) { if (doc._id == \"1\") { emit(1, null) }}"}
+    }
+  };
+
+  T(db.save(designDoc).ok);
+
+  db.bulkSave(makeDocs(1, numDocs + 1));
+
+  // go ahead and validate the views before purging
+  var rows = db.view("test/all_docs_twice").rows;
+  for (var i = 0; i < numDocs; i++) {
+    T(rows[2*i].key == i+1);
+    T(rows[(2*i)+1].key == i+1);
+  }
+  T(db.view("test/single_doc").total_rows == 1);
+
+  var info = db.info();
+  var doc1 = db.open("1");
+  var doc2 = db.open("2");
+
+  // purge the documents
+  var xhr = CouchDB.request("POST", "/test_suite_db/_purge", {
+    body: JSON.stringify({"1":[doc1._rev], "2":[doc2._rev]})
+  });
+  T(xhr.status == 200);
+
+  var result = JSON.parse(xhr.responseText);
+  var newInfo = db.info();
+  
+  // purging increments the update sequence
+  T(info.update_seq+1 == newInfo.update_seq);
+  // and it increments the purge_seq
+  T(info.purge_seq+1 == newInfo.purge_seq);
+  T(result.purge_seq == newInfo.purge_seq);
+
+  T(result.purged["1"][0] == doc1._rev);
+  T(result.purged["2"][0] == doc2._rev);
+
+  T(db.open("1") == null);
+  T(db.open("2") == null);
+
+  var rows = db.view("test/all_docs_twice").rows;
+  for (var i = 2; i < numDocs; i++) {
+    T(rows[2*(i-2)].key == i+1);
+    T(rows[(2*(i-2))+1].key == i+1);
+  }
+  T(db.view("test/single_doc").total_rows == 0);
+
+  // purge sequences are preserved after compaction (COUCHDB-1021)
+  T(db.compact().ok);
+  T(db.last_req.status == 202);
+  // compaction isn't instantaneous, loop until done
+  while (db.info().compact_running) {};
+  var compactInfo = db.info();
+  T(compactInfo.purge_seq == newInfo.purge_seq);
+
+  // purge documents twice in a row without loading views
+  // (causes full view rebuilds)
+
+  var doc3 = db.open("3");
+  var doc4 = db.open("4");
+
+  xhr = CouchDB.request("POST", "/test_suite_db/_purge", {
+    body: JSON.stringify({"3":[doc3._rev]})
+  });
+
+  T(xhr.status == 200);
+
+  xhr = CouchDB.request("POST", "/test_suite_db/_purge", {
+    body: JSON.stringify({"4":[doc4._rev]})
+  });
+
+  T(xhr.status == 200);
+  result = JSON.parse(xhr.responseText);
+  T(result.purge_seq == db.info().purge_seq);
+
+  var rows = db.view("test/all_docs_twice").rows;
+  for (var i = 4; i < numDocs; i++) {
+    T(rows[2*(i-4)].key == i+1);
+    T(rows[(2*(i-4))+1].key == i+1);
+  }
+  T(db.view("test/single_doc").total_rows == 0);
+
+  // COUCHDB-1065
+  var dbA = new CouchDB("test_suite_db_a");
+  var dbB = new CouchDB("test_suite_db_b");
+  dbA.deleteDb();
+  dbA.createDb();
+  dbB.deleteDb();
+  dbB.createDb();
+  var docA = {_id:"test", a:1};
+  var docB = {_id:"test", a:2};
+  dbA.save(docA);
+  dbB.save(docB);
+  CouchDB.replicate(dbA.name, dbB.name);
+  var xhr = CouchDB.request("POST", "/" + dbB.name + "/_purge", {
+    body: JSON.stringify({"test":[docA._rev]})
+  });
+  TEquals(200, xhr.status, "single rev purge after replication succeeds");
+
+  var xhr = CouchDB.request("GET", "/" + dbB.name + "/test?rev=" + docA._rev);
+  TEquals(404, xhr.status, "single rev purge removes revision");
+
+  var xhr = CouchDB.request("POST", "/" + dbB.name + "/_purge", {
+    body: JSON.stringify({"test":[docB._rev]})
+  });
+  TEquals(200, xhr.status, "single rev purge after replication succeeds");
+  var xhr = CouchDB.request("GET", "/" + dbB.name + "/test?rev=" + docB._rev);
+  TEquals(404, xhr.status, "single rev purge removes revision");
+
+  var xhr = CouchDB.request("POST", "/" + dbB.name + "/_purge", {
+    body: JSON.stringify({"test":[docA._rev, docB._rev]})
+  });
+  TEquals(200, xhr.status, "all rev purge after replication succeeds");
+};

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/test/reader_acl.js
----------------------------------------------------------------------
diff --git a/share/test/reader_acl.js b/share/test/reader_acl.js
new file mode 100644
index 0000000..ff770c7
--- /dev/null
+++ b/share/test/reader_acl.js
@@ -0,0 +1,219 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License.  You may obtain a copy
+// of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+// License for the specific language governing permissions and limitations under
+// the License.
+
+couchTests.reader_acl = function(debug) {
+  // this tests read access control
+
+  var usersDb = new CouchDB("test_suite_users", {"X-Couch-Full-Commit":"false"});
+  var secretDb = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"});
+  function testFun() {
+    try {
+      usersDb.deleteDb();
+      try {
+        usersDb.createDb();
+      } catch(e) {
+        if(usersDb.last_req.status != 412) {
+         throw e;
+        }
+      }
+      secretDb.deleteDb();
+      secretDb.createDb();
+
+      // create a user with top-secret-clearance
+      var jchrisUserDoc = CouchDB.prepareUserDoc({
+        name: "jchris@apache.org",
+        roles : ["top-secret"]
+      }, "funnybone");
+      T(usersDb.save(jchrisUserDoc).ok);
+      usersDb.ensureFullCommit();
+
+      T(CouchDB.session().userCtx.name == null);
+
+      // set secret db to be read controlled
+      T(secretDb.save({_id:"baz",foo:"bar"}).ok);
+      T(secretDb.open("baz").foo == "bar");
+
+      T(secretDb.setSecObj({
+        "members" : {
+          roles : ["super-secret-club"],
+          names : ["joe","barb"]
+        }
+      }).ok);
+    } finally {
+      CouchDB.logout();
+    }
+  }
+  
+  // split into 2 funs so we can test restart behavior
+  function testFun2() {
+    try {
+      // can't read it as jchris b/c he's missing the needed role
+      T(CouchDB.login("jchris@apache.org", "funnybone").ok);
+      T(CouchDB.session().userCtx.name == "jchris@apache.org");
+
+      try {
+        secretDb.open("baz");
+        T(false && "can't open a doc from a secret db") ;
+      } catch(e) {
+        T(true)
+      }
+
+      CouchDB.logout();
+      
+      // make anyone with the top-secret role an admin
+      // db admins are automatically members
+      T(secretDb.setSecObj({
+        "admins" : {
+          roles : ["top-secret"],
+          names : []
+        },
+        "members" : {
+          roles : ["super-secret-club"],
+          names : ["joe","barb"]
+        }
+      }).ok);
+
+
+      T(CouchDB.login("jchris@apache.org", "funnybone").ok);
+
+      // db admin can read
+      T(secretDb.open("baz").foo == "bar");
+
+      // and run temp views
+      TEquals(secretDb.query(function(doc) {
+        emit(null, null)
+      }).total_rows, 1);
+
+      CouchDB.logout();
+      T(CouchDB.session().userCtx.roles.indexOf("_admin") != -1);
+
+      // admin now adds the top-secret role to the db's members
+      // and removes db-admins
+      T(secretDb.setSecObj({
+        "admins" : {
+          roles : [],
+          names : []
+        },
+        "members" : {
+          roles : ["super-secret-club", "top-secret"],
+          names : ["joe","barb"]
+        }
+      }).ok);
+
+      // server _admin can always read
+      T(secretDb.open("baz").foo == "bar");
+
+      // and run temp views
+      TEquals(secretDb.query(function(doc) {
+        emit(null, null)
+      }).total_rows, 1);
+
+      T(secretDb.save({
+        "_id" : "_design/foo",
+        views : {
+          bar : {
+            map : "function(doc){emit(null, null)}"
+          }
+        }
+      }).ok)
+
+      // now top-secret users can read too
+      T(CouchDB.login("jchris@apache.org", "funnybone").ok);
+      T(CouchDB.session().userCtx.roles.indexOf("_admin") == -1);
+      T(secretDb.open("baz").foo == "bar");
+      // members can query stored views
+      T(secretDb.view("foo/bar").total_rows == 1);
+      
+      // members can't do temp views
+      try {
+        var results = secretDb.query(function(doc) {
+          emit(null, null);
+        });
+        T(false && "temp view should be admin only");
+      } catch (e) {
+        T(true && "temp view is admin only");
+      }
+      
+      CouchDB.logout();
+
+      // works with readers (backwards compat with 1.0)
+      T(secretDb.setSecObj({
+        "admins" : {
+          roles : [],
+          names : []
+        },
+        "readers" : {
+          roles : ["super-secret-club", "top-secret"],
+          names : ["joe","barb"]
+        }
+      }).ok);
+
+      T(CouchDB.login("jchris@apache.org", "funnybone").ok);
+      T(CouchDB.session().userCtx.roles.indexOf("_admin") == -1);
+      T(secretDb.open("baz").foo == "bar");
+
+      // can't set non string reader names or roles
+      try {
+        secretDb.setSecObj({
+          "members" : {
+            roles : ["super-secret-club", {"top-secret":"awesome"}],
+            names : ["joe","barb"]
+          }
+        })
+        T(false && "only string roles");
+      } catch (e) {}
+
+      try {
+        secretDb.setSecObj({
+          "members" : {
+            roles : ["super-secret-club", {"top-secret":"awesome"}],
+            names : ["joe",22]
+          }
+        });
+        T(false && "only string names");
+      } catch (e) {}
+      
+      try {
+        secretDb.setSecObj({
+          "members" : {
+            roles : ["super-secret-club", {"top-secret":"awesome"}],
+            names : "joe"
+          }
+        });
+        T(false && "only lists of names");
+      } catch (e) {}
+    } finally {
+      CouchDB.logout();
+    }
+  };
+
+  run_on_modified_server(
+    [{section: "httpd",
+      key: "authentication_handlers",
+      value: "{couch_httpd_auth, cookie_authentication_handler}, {couch_httpd_auth, default_authentication_handler}"},
+     {section: "couch_httpd_auth",
+      key: "authentication_db", value: "test_suite_users"}],
+    testFun
+  );
+        
+  // security changes will always commit synchronously
+  restartServer();
+  
+  run_on_modified_server(
+    [{section: "httpd",
+      key: "authentication_handlers",
+      value: "{couch_httpd_auth, cookie_authentication_handler}, {couch_httpd_auth, default_authentication_handler}"},
+     {section: "couch_httpd_auth",
+      key: "authentication_db", value: "test_suite_users"}],
+    testFun2
+  );
+}

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/test/recreate_doc.js
----------------------------------------------------------------------
diff --git a/share/test/recreate_doc.js b/share/test/recreate_doc.js
new file mode 100644
index 0000000..f972379
--- /dev/null
+++ b/share/test/recreate_doc.js
@@ -0,0 +1,145 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+
+couchTests.recreate_doc = function(debug) {
+  var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"});
+  db.deleteDb();
+  db.createDb();
+  if (debug) debugger;
+
+  // First create a new document with the ID "foo", and delete it again
+  var doc = {_id: "foo", a: "bar", b: 42};
+  var result = db.save(doc);
+  T(result.ok);
+  var firstRev = result.rev;
+  T(db.deleteDoc(doc).ok);
+
+  // Now create a new document with the same ID, save it, and then modify it
+  for (var i = 0; i < 10; i++) {
+    doc = {_id: "foo"};
+    T(db.save(doc).ok);
+    doc = db.open("foo");
+    doc.a = "baz";
+    T(db.save(doc).ok);
+    T(db.deleteDoc(doc).rev != undefined);
+  }
+
+  try {
+    // COUCHDB-292 now attempt to save the document with a prev that's since
+    // been deleted and this should generate a conflict exception
+    db.save({_id:"foo", _rev:firstRev, bar:1});
+    T("no save conflict 1" && false); // we shouldn't hit here
+  } catch (e) {
+    T(e.error == "conflict");
+  }
+  
+  var binAttDoc = {
+    _id: "foo",
+    _rev:firstRev,
+    _attachments:{
+      "foo.txt": {
+        content_type:"text/plain",
+        data: "VGhpcyBpcyBhIGJhc2U2NCBlbmNvZGVkIHRleHQ="
+      }
+    }
+  };
+  try {
+    // same as before, but with binary
+    db.save(binAttDoc);
+    T("no save conflict 2" && false); // we shouldn't hit here
+  } catch (e) {
+    T(e.error == "conflict");
+  }
+
+
+  try {
+    // random non-existant prev rev
+    db.save({_id:"foo", _rev:"1-asfafasdf", bar:1});
+    T("no save conflict 3" && false); // we shouldn't hit here
+  } catch (e) {
+    T(e.error == "conflict");
+  }
+  
+  try {
+    // random non-existant prev rev with bin
+    binAttDoc._rev = "1-aasasfasdf";
+    db.save(binAttDoc);
+    T("no save conflict 4" && false); // we shouldn't hit here
+  } catch (e) {
+    T(e.error == "conflict");
+  }
+
+  db.deleteDb();
+  db.createDb();
+
+  // Helper function to create a doc with multiple revisions
+  // that are compacted away to ?REV_MISSING.
+
+  var createDoc = function(docid) {
+    var ret = [{_id: docid, count: 0}];
+    T(db.save(ret[0]).ok);
+    for(var i = 0; i < 2; i++) {
+      ret[ret.length] = {
+        _id: docid,
+        _rev: ret[ret.length-1]._rev,
+        count: ret[ret.length-1].count+1
+      };
+      T(db.save(ret[ret.length-1]).ok);
+    }
+    db.compact();
+    while(db.info().compact_running) {}
+    return ret;
+  }
+
+  // Helper function to check that there are no duplicates
+  // in the changes feed and that it has proper update
+  // sequence ordering.
+
+  var checkChanges = function() {
+    // Assert that there are no duplicates in _changes.
+    var req = CouchDB.request("GET", "/test_suite_db/_changes");
+    var resp = JSON.parse(req.responseText);
+    var docids = {};
+    var prev_seq = -1;
+    for(var i = 0; i < resp.results.length; i++) {
+      row = resp.results[i];
+      T(row.seq > prev_seq, "Unordered _changes feed.");
+      T(docids[row.id] === undefined, "Duplicates in _changes feed.");
+      prev_seq = row.seq;
+      docids[row.id] = true;
+    }
+  };
+
+  // COUCHDB-1265 - Check that the changes feed remains proper
+  // after we try and break the update_seq tree.
+
+  // This first case is the one originally reported and "fixed"
+  // in COUCHDB-1265. Reinserting an old revision into the
+  // revision tree causes duplicates in the update_seq tree.
+
+  var revs = createDoc("a");
+  T(db.save(revs[1], {new_edits: false}).ok);
+  T(db.save(revs[revs.length-1]).ok);
+  checkChanges();
+
+  // The original fix for COUCHDB-1265 is not entirely correct
+  // as it didn't consider the possibility that a compaction
+  // might run after the original tree screw up.
+
+  revs = createDoc("b");
+  T(db.save(revs[1], {new_edits: false}).ok);
+  db.compact();
+  while(db.info().compact_running) {}
+  T(db.save(revs[revs.length-1]).ok);
+  checkChanges();
+
+};

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/test/reduce.js
----------------------------------------------------------------------
diff --git a/share/test/reduce.js b/share/test/reduce.js
new file mode 100644
index 0000000..36e5cb7
--- /dev/null
+++ b/share/test/reduce.js
@@ -0,0 +1,414 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+
+couchTests.reduce = function(debug) {
+  var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"});
+  db.deleteDb();
+  db.createDb();
+  if (debug) debugger;
+  var numDocs = 500;
+  var docs = makeDocs(1,numDocs + 1);
+  db.bulkSave(docs);
+  var summate = function(N) {return (N+1)*N/2;};
+
+  var map = function (doc) {
+      emit(doc.integer, doc.integer);
+      emit(doc.integer, doc.integer);
+  };
+  var reduce = function (keys, values) { return sum(values); };
+  var result = db.query(map, reduce);
+  T(result.rows[0].value == 2*summate(numDocs));
+
+  result = db.query(map, reduce, {startkey: 4, endkey: 4});
+  T(result.rows[0].value == 8);
+
+  result = db.query(map, reduce, {startkey: 4, endkey: 5});
+  T(result.rows[0].value == 18);
+
+  result = db.query(map, reduce, {startkey: 4, endkey: 6});
+  T(result.rows[0].value == 30);
+
+  result = db.query(map, reduce, {group:true, limit:3});
+  T(result.rows[0].value == 2);
+  T(result.rows[1].value == 4);
+  T(result.rows[2].value == 6);
+
+  for(var i=1; i<numDocs/2; i+=30) {
+    result = db.query(map, reduce, {startkey: i, endkey: numDocs - i});
+    T(result.rows[0].value == 2*(summate(numDocs-i) - summate(i-1)));
+  }
+
+  db.deleteDb();
+  db.createDb();
+
+  for(var i=1; i <= 5; i++) {
+
+    for(var j=0; j < 10; j++) {
+      // these docs are in the order of the keys collation, for clarity
+      var docs = [];
+      docs.push({keys:["a"]});
+      docs.push({keys:["a"]});
+      docs.push({keys:["a", "b"]});
+      docs.push({keys:["a", "b"]});
+      docs.push({keys:["a", "b", "c"]});
+      docs.push({keys:["a", "b", "d"]});
+      docs.push({keys:["a", "c", "d"]});
+      docs.push({keys:["d"]});
+      docs.push({keys:["d", "a"]});
+      docs.push({keys:["d", "b"]});
+      docs.push({keys:["d", "c"]});
+      db.bulkSave(docs);
+      T(db.info().doc_count == ((i - 1) * 10 * 11) + ((j + 1) * 11));
+    }
+
+    map = function (doc) { emit(doc.keys, 1); };
+    reduce = function (keys, values) { return sum(values); };
+
+    var results = db.query(map, reduce, {group:true});
+
+    //group by exact key match
+    T(equals(results.rows[0], {key:["a"],value:20*i}));
+    T(equals(results.rows[1], {key:["a","b"],value:20*i}));
+    T(equals(results.rows[2], {key:["a", "b", "c"],value:10*i}));
+    T(equals(results.rows[3], {key:["a", "b", "d"],value:10*i}));
+
+    // test to make sure group reduce and limit params provide valid json
+    var results = db.query(map, reduce, {group: true, limit: 2});
+    T(equals(results.rows[0], {key: ["a"], value: 20*i}));
+    T(equals(results.rows.length, 2));
+
+    //group by the first element in the key array
+    var results = db.query(map, reduce, {group_level:1});
+    T(equals(results.rows[0], {key:["a"],value:70*i}));
+    T(equals(results.rows[1], {key:["d"],value:40*i}));
+
+    //group by the first 2 elements in the key array
+    var results = db.query(map, reduce, {group_level:2});
+    T(equals(results.rows[0], {key:["a"],value:20*i}));
+    T(equals(results.rows[1], {key:["a","b"],value:40*i}));
+    T(equals(results.rows[2], {key:["a","c"],value:10*i}));
+    T(equals(results.rows[3], {key:["d"],value:10*i}));
+    T(equals(results.rows[4], {key:["d","a"],value:10*i}));
+    T(equals(results.rows[5], {key:["d","b"],value:10*i}));
+    T(equals(results.rows[6], {key:["d","c"],value:10*i}));
+
+    // endkey test with inclusive_end=true
+    var results = db.query(map, reduce, {group_level:2,endkey:["d"],inclusive_end:true});
+    T(equals(results.rows[0], {key:["a"],value:20*i}));
+    T(equals(results.rows[1], {key:["a","b"],value:40*i}));
+    T(equals(results.rows[2], {key:["a","c"],value:10*i}));
+    T(equals(results.rows[3], {key:["d"],value:10*i}));
+    TEquals(4, results.rows.length);
+
+    // endkey test with inclusive_end=false
+    var results = db.query(map, reduce, {group_level:2,endkey:["d"],inclusive_end:false});
+    T(equals(results.rows[0], {key:["a"],value:20*i}));
+    T(equals(results.rows[1], {key:["a","b"],value:40*i}));
+    T(equals(results.rows[2], {key:["a","c"],value:10*i}));
+    TEquals(3, results.rows.length);
+  }
+
+  // now test out more complex reductions that need to use the combine option.
+
+  db.deleteDb();
+  db.createDb();
+
+
+  var map = function (doc) { emit(doc.val, doc.val); };
+  var reduceCombine = function (keys, values, rereduce) {
+      // This computes the standard deviation of the mapped results
+      var stdDeviation=0.0;
+      var count=0;
+      var total=0.0;
+      var sqrTotal=0.0;
+
+      if (!rereduce) {
+        // This is the reduce phase, we are reducing over emitted values from
+        // the map functions.
+        for(var i in values) {
+          total = total + values[i];
+          sqrTotal = sqrTotal + (values[i] * values[i]);
+        }
+        count = values.length;
+      }
+      else {
+        // This is the rereduce phase, we are re-reducing previosuly
+        // reduced values.
+        for(var i in values) {
+          count = count + values[i].count;
+          total = total + values[i].total;
+          sqrTotal = sqrTotal + values[i].sqrTotal;
+        }
+      }
+
+      var variance =  (sqrTotal - ((total * total)/count)) / count;
+      stdDeviation = Math.sqrt(variance);
+
+      // the reduce result. It contains enough information to be rereduced
+      // with other reduce results.
+      return {"stdDeviation":stdDeviation,"count":count,
+          "total":total,"sqrTotal":sqrTotal};
+    };
+
+    // Save a bunch a docs.
+
+  for(var i=0; i < 10; i++) {
+    var docs = [];
+    docs.push({val:10});
+    docs.push({val:20});
+    docs.push({val:30});
+    docs.push({val:40});
+    docs.push({val:50});
+    docs.push({val:60});
+    docs.push({val:70});
+    docs.push({val:80});
+    docs.push({val:90});
+    docs.push({val:100});
+    db.bulkSave(docs);
+  }
+
+  var results = db.query(map, reduceCombine);
+
+  var difference = results.rows[0].value.stdDeviation - 28.722813232690143;
+  // account for floating point rounding error
+  T(Math.abs(difference) < 0.0000000001);
+
+  function testReducePagination() {
+    var ddoc = {
+      "_id": "_design/test",
+      "language": "javascript",
+      "views": {
+        "view1": {
+          "map": "function(doc) {" +
+             "emit(doc.int, doc._id);" +
+             "emit(doc.int + 1, doc._id);" +
+             "emit(doc.int + 2, doc._id);" +
+          "}",
+          "reduce": "_count"
+        }
+      }
+    };
+    var result, docs = [];
+
+    function randVal() {
+        return Math.random() * 100000000;
+    }
+
+    db.deleteDb();
+    db.createDb();
+
+    for (var i = 0; i < 1123; i++) {
+      docs.push({"_id": String(i), "int": i});
+    }
+    db.bulkSave(docs.concat([ddoc]));
+
+    // ?group=false tests
+    result = db.view('test/view1', {startkey: 400, endkey: 402, foobar: randVal()});
+    TEquals(9, result.rows[0].value);
+    result = db.view('test/view1', {startkey: 402, endkey: 400, descending: true,
+      foobar: randVal()});
+    TEquals(9, result.rows[0].value);
+
+    result = db.view('test/view1', {startkey: 400, endkey: 402, inclusive_end: false,
+      foobar: randVal()});
+    TEquals(6, result.rows[0].value);
+    result = db.view('test/view1', {startkey: 402, endkey: 400, inclusive_end: false,
+      descending: true, foobar: randVal()});
+    TEquals(6, result.rows[0].value);
+
+    result = db.view('test/view1', {startkey: 400, endkey: 402, endkey_docid: "400",
+      foobar: randVal()});
+    TEquals(7, result.rows[0].value);
+    result = db.view('test/view1', {startkey: 400, endkey: 402, endkey_docid: "400",
+      inclusive_end: false, foobar: randVal()});
+    TEquals(6, result.rows[0].value);
+
+    result = db.view('test/view1', {startkey: 400, endkey: 402, endkey_docid: "401",
+      foobar: randVal()});
+    TEquals(8, result.rows[0].value);
+    result = db.view('test/view1', {startkey: 400, endkey: 402, endkey_docid: "401",
+      inclusive_end: false, foobar: randVal()});
+    TEquals(7, result.rows[0].value);
+
+    result = db.view('test/view1', {startkey: 400, endkey: 402, endkey_docid: "402",
+      foobar: randVal()});
+    TEquals(9, result.rows[0].value);
+    result = db.view('test/view1', {startkey: 400, endkey: 402, endkey_docid: "402",
+      inclusive_end: false, foobar: randVal()});
+    TEquals(8, result.rows[0].value);
+
+    result = db.view('test/view1', {startkey: 402, endkey: 400, endkey_docid: "398",
+      descending: true, foobar: randVal()});
+    TEquals(9, result.rows[0].value);
+    result = db.view('test/view1', {startkey: 402, endkey: 400, endkey_docid: "398",
+      descending: true, inclusive_end: false, foobar: randVal()}),
+    TEquals(8, result.rows[0].value);
+
+    result = db.view('test/view1', {startkey: 402, endkey: 400, endkey_docid: "399",
+      descending: true, foobar: randVal()});
+    TEquals(8, result.rows[0].value);
+    result = db.view('test/view1', {startkey: 402, endkey: 400, endkey_docid: "399",
+      descending: true, inclusive_end: false, foobar: randVal()}),
+    TEquals(7, result.rows[0].value);
+
+    result = db.view('test/view1', {startkey: 402, endkey: 400, endkey_docid: "400",
+      descending: true, foobar: randVal()}),
+    TEquals(7, result.rows[0].value);
+    result = db.view('test/view1', {startkey: 402, endkey: 400, endkey_docid: "400",
+      descending: true, inclusive_end: false, foobar: randVal()}),
+    TEquals(6, result.rows[0].value);
+
+    result = db.view('test/view1', {startkey: 402, startkey_docid: "400", endkey: 400,
+      descending: true, foobar: randVal()});
+    TEquals(7, result.rows[0].value);
+
+    result = db.view('test/view1', {startkey: 402, startkey_docid: "401", endkey: 400,
+      descending: true, inclusive_end: false, foobar: randVal()});
+    TEquals(5, result.rows[0].value);
+
+    // ?group=true tests
+    result = db.view('test/view1', {group: true, startkey: 400, endkey: 402,
+      foobar: randVal()});
+    TEquals(3, result.rows.length);
+    TEquals(400, result.rows[0].key);
+    TEquals(3, result.rows[0].value);
+    TEquals(401, result.rows[1].key);
+    TEquals(3, result.rows[1].value);
+    TEquals(402, result.rows[2].key);
+    TEquals(3, result.rows[2].value);
+
+    result = db.view('test/view1', {group: true, startkey: 402, endkey: 400,
+      descending: true, foobar: randVal()});
+    TEquals(3, result.rows.length);
+    TEquals(402, result.rows[0].key);
+    TEquals(3, result.rows[0].value);
+    TEquals(401, result.rows[1].key);
+    TEquals(3, result.rows[1].value);
+    TEquals(400, result.rows[2].key);
+    TEquals(3, result.rows[2].value);
+
+    result = db.view('test/view1', {group: true, startkey: 400, endkey: 402,
+      inclusive_end: false, foobar: randVal()});
+    TEquals(2, result.rows.length);
+    TEquals(400, result.rows[0].key);
+    TEquals(3, result.rows[0].value);
+    TEquals(401, result.rows[1].key);
+    TEquals(3, result.rows[1].value);
+
+    result = db.view('test/view1', {group: true, startkey: 402, endkey: 400,
+      descending: true, inclusive_end: false, foobar: randVal()});
+    TEquals(2, result.rows.length);
+    TEquals(402, result.rows[0].key);
+    TEquals(3, result.rows[0].value);
+    TEquals(401, result.rows[1].key);
+    TEquals(3, result.rows[1].value);
+
+    result = db.view('test/view1', {group: true, startkey: 400, endkey: 402,
+      endkey_docid: "401", foobar: randVal()});
+    TEquals(3, result.rows.length);
+    TEquals(400, result.rows[0].key);
+    TEquals(3, result.rows[0].value);
+    TEquals(401, result.rows[1].key);
+    TEquals(3, result.rows[1].value);
+    TEquals(402, result.rows[2].key);
+    TEquals(2, result.rows[2].value);
+
+    result = db.view('test/view1', {group: true, startkey: 400, endkey: 402,
+      endkey_docid: "400", foobar: randVal()});
+    TEquals(3, result.rows.length);
+    TEquals(400, result.rows[0].key);
+    TEquals(3, result.rows[0].value);
+    TEquals(401, result.rows[1].key);
+    TEquals(3, result.rows[1].value);
+    TEquals(402, result.rows[2].key);
+    TEquals(1, result.rows[2].value);
+
+    result = db.view('test/view1', {group: true, startkey: 402, startkey_docid: "401",
+      endkey: 400, descending: true, foobar: randVal()});
+    TEquals(3, result.rows.length);
+    TEquals(402, result.rows[0].key);
+    TEquals(2, result.rows[0].value);
+    TEquals(401, result.rows[1].key);
+    TEquals(3, result.rows[1].value);
+    TEquals(400, result.rows[2].key);
+    TEquals(3, result.rows[2].value);
+
+    result = db.view('test/view1', {group: true, startkey: 402, startkey_docid: "400",
+      endkey: 400, descending: true, foobar: randVal()});
+    TEquals(3, result.rows.length);
+    TEquals(402, result.rows[0].key);
+    TEquals(1, result.rows[0].value);
+    TEquals(401, result.rows[1].key);
+    TEquals(3, result.rows[1].value);
+    TEquals(400, result.rows[2].key);
+    TEquals(3, result.rows[2].value);
+
+    result = db.view('test/view1', {group: true, startkey: 402, startkey_docid: "401",
+      endkey: 400, descending: true, inclusive_end: false, foobar: randVal()});
+    TEquals(2, result.rows.length);
+    TEquals(402, result.rows[0].key);
+    TEquals(2, result.rows[0].value);
+    TEquals(401, result.rows[1].key);
+    TEquals(3, result.rows[1].value);
+
+    result = db.view('test/view1', {group: true, startkey: 402, startkey_docid: "400",
+      endkey: 400, descending: true, inclusive_end: false, foobar: randVal()});
+    TEquals(2, result.rows.length);
+    TEquals(402, result.rows[0].key);
+    TEquals(1, result.rows[0].value);
+    TEquals(401, result.rows[1].key);
+    TEquals(3, result.rows[1].value);
+
+    result = db.view('test/view1', {group: true, startkey: 402, endkey: 400,
+      endkey_docid: "398", descending: true, inclusive_end: true, foobar: randVal()});
+    TEquals(3, result.rows.length);
+    TEquals(402, result.rows[0].key);
+    TEquals(3, result.rows[0].value);
+    TEquals(401, result.rows[1].key);
+    TEquals(3, result.rows[1].value);
+    TEquals(400, result.rows[2].key);
+    TEquals(3, result.rows[2].value);
+
+    result = db.view('test/view1', {group: true, startkey: 402, endkey: 400,
+      endkey_docid: "399", descending: true, inclusive_end: true, foobar: randVal()});
+    TEquals(3, result.rows.length);
+    TEquals(402, result.rows[0].key);
+    TEquals(3, result.rows[0].value);
+    TEquals(401, result.rows[1].key);
+    TEquals(3, result.rows[1].value);
+    TEquals(400, result.rows[2].key);
+    TEquals(2, result.rows[2].value);
+
+    result = db.view('test/view1', {group: true, startkey: 402, endkey: 400,
+      endkey_docid: "399", descending: true, inclusive_end: false, foobar: randVal()});
+    TEquals(3, result.rows.length);
+    TEquals(402, result.rows[0].key);
+    TEquals(3, result.rows[0].value);
+    TEquals(401, result.rows[1].key);
+    TEquals(3, result.rows[1].value);
+    TEquals(400, result.rows[2].key);
+    TEquals(1, result.rows[2].value);
+
+    result = db.view('test/view1', {group: true, startkey: 402, endkey: 400,
+      endkey_docid: "400", descending: true, inclusive_end: false, foobar: randVal()});
+    TEquals(2, result.rows.length);
+    TEquals(402, result.rows[0].key);
+    TEquals(3, result.rows[0].value);
+    TEquals(401, result.rows[1].key);
+    TEquals(3, result.rows[1].value);
+
+    db.deleteDb();
+  }
+
+  testReducePagination();
+
+};

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/test/reduce_builtin.js
----------------------------------------------------------------------
diff --git a/share/test/reduce_builtin.js b/share/test/reduce_builtin.js
new file mode 100644
index 0000000..b3cc3cc
--- /dev/null
+++ b/share/test/reduce_builtin.js
@@ -0,0 +1,179 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+
+couchTests.reduce_builtin = function(debug) {
+  var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"});
+  db.deleteDb();
+  db.createDb();
+  if (debug) debugger;
+
+  var numDocs = 500;
+  var docs = makeDocs(1,numDocs + 1);
+  db.bulkSave(docs);
+
+  var summate = function(N) {return (N+1)*N/2;};
+
+  var sumsqr = function(N) { 
+    var acc = 0;
+    for (var i=1; i<=N; ++i) {
+      acc += i*i;
+    }
+    return acc;
+  };
+
+  // this is the same test as the reduce.js test
+  // only we'll let CouchDB run reduce in Erlang
+  var map = function (doc) {
+      emit(doc.integer, doc.integer);
+      emit(doc.integer, doc.integer);
+  };
+
+  var result = db.query(map, "_sum");
+  T(result.rows[0].value == 2*summate(numDocs));
+  result = db.query(map, "_count");
+  T(result.rows[0].value == 1000);
+  result = db.query(map, "_stats");
+  T(result.rows[0].value.sum == 2*summate(numDocs));
+  T(result.rows[0].value.count == 1000);
+  T(result.rows[0].value.min == 1);
+  T(result.rows[0].value.max == 500);
+  T(result.rows[0].value.sumsqr == 2*sumsqr(numDocs));
+
+  result = db.query(map, "_sum", {startkey: 4, endkey: 4});
+  T(result.rows[0].value == 8);
+  result = db.query(map, "_count", {startkey: 4, endkey: 4});
+  T(result.rows[0].value == 2);
+
+  result = db.query(map, "_sum", {startkey: 4, endkey: 5});
+  T(result.rows[0].value == 18);
+  result = db.query(map, "_count", {startkey: 4, endkey: 5});
+  T(result.rows[0].value == 4);
+
+  result = db.query(map, "_sum", {startkey: 4, endkey: 6});
+  T(result.rows[0].value == 30);
+  result = db.query(map, "_count", {startkey: 4, endkey: 6});
+  T(result.rows[0].value == 6);
+
+  result = db.query(map, "_sum", {group:true, limit:3});
+  T(result.rows[0].value == 2);
+  T(result.rows[1].value == 4);
+  T(result.rows[2].value == 6);
+
+  for(var i=1; i<numDocs/2; i+=30) {
+    result = db.query(map, "_sum", {startkey: i, endkey: numDocs - i});
+    T(result.rows[0].value == 2*(summate(numDocs-i) - summate(i-1)));
+  }
+
+  // test for trailing characters after builtin functions, desired behaviour
+  // is to disregard any trailing characters
+  // I think the behavior should be a prefix test, so that even "_statsorama" 
+  // or "_stats\nare\awesome" should work just as "_stats" does. - JChris
+
+  var trailing = ["\u000a", "orama", "\nare\nawesome", " ", "     \n  "];
+
+  for(var i=0; i < trailing.length; i++) {
+    result = db.query(map, "_sum" + trailing[i]);
+    T(result.rows[0].value == 2*summate(numDocs));
+    result = db.query(map, "_count" + trailing[i]);
+    T(result.rows[0].value == 1000);
+    result = db.query(map, "_stats" + trailing[i]);
+    T(result.rows[0].value.sum == 2*summate(numDocs));
+    T(result.rows[0].value.count == 1000);
+    T(result.rows[0].value.min == 1);
+    T(result.rows[0].value.max == 500);
+    T(result.rows[0].value.sumsqr == 2*sumsqr(numDocs));
+  }
+
+  db.deleteDb();
+  db.createDb();
+
+  for(var i=1; i <= 5; i++) {
+
+    for(var j=0; j < 10; j++) {
+      // these docs are in the order of the keys collation, for clarity
+      var docs = [];
+      docs.push({keys:["a"]});
+      docs.push({keys:["a"]});
+      docs.push({keys:["a", "b"]});
+      docs.push({keys:["a", "b"]});
+      docs.push({keys:["a", "b", "c"]});
+      docs.push({keys:["a", "b", "d"]});
+      docs.push({keys:["a", "c", "d"]});
+      docs.push({keys:["d"]});
+      docs.push({keys:["d", "a"]});
+      docs.push({keys:["d", "b"]});
+      docs.push({keys:["d", "c"]});
+      db.bulkSave(docs);
+      T(db.info().doc_count == ((i - 1) * 10 * 11) + ((j + 1) * 11));
+    }
+
+    map = function (doc) { emit(doc.keys, 1); };
+    // with emitted values being 1, count should be the same as sum
+    var builtins = ["_sum", "_count"];
+
+    for (var b=0; b < builtins.length; b++) {
+      var fun = builtins[b];
+      var results = db.query(map, fun, {group:true});
+
+      //group by exact key match
+      T(equals(results.rows[0], {key:["a"],value:20*i}));
+      T(equals(results.rows[1], {key:["a","b"],value:20*i}));
+      T(equals(results.rows[2], {key:["a", "b", "c"],value:10*i}));
+      T(equals(results.rows[3], {key:["a", "b", "d"],value:10*i}));
+
+      // test to make sure group reduce and limit params provide valid json
+      var results = db.query(map, fun, {group: true, limit: 2});
+      T(equals(results.rows[0], {key: ["a"], value: 20*i}));
+      T(equals(results.rows.length, 2));
+
+      //group by the first element in the key array
+      var results = db.query(map, fun, {group_level:1});
+      T(equals(results.rows[0], {key:["a"],value:70*i}));
+      T(equals(results.rows[1], {key:["d"],value:40*i}));
+
+      //group by the first 2 elements in the key array
+      var results = db.query(map, fun, {group_level:2});
+      T(equals(results.rows[0], {key:["a"],value:20*i}));
+      T(equals(results.rows[1], {key:["a","b"],value:40*i}));
+      T(equals(results.rows[2], {key:["a","c"],value:10*i}));
+      T(equals(results.rows[3], {key:["d"],value:10*i}));
+      T(equals(results.rows[4], {key:["d","a"],value:10*i}));
+      T(equals(results.rows[5], {key:["d","b"],value:10*i}));
+      T(equals(results.rows[6], {key:["d","c"],value:10*i}));
+    };
+
+    map = function (doc) { emit(doc.keys, [1, 1]); };
+
+    var results = db.query(map, "_sum", {group:true});
+    T(equals(results.rows[0], {key:["a"],value:[20*i,20*i]}));
+    T(equals(results.rows[1], {key:["a","b"],value:[20*i,20*i]}));
+    T(equals(results.rows[2], {key:["a", "b", "c"],value:[10*i,10*i]}));
+    T(equals(results.rows[3], {key:["a", "b", "d"],value:[10*i,10*i]}));
+
+    var results = db.query(map, "_sum", {group: true, limit: 2});
+    T(equals(results.rows[0], {key: ["a"], value: [20*i,20*i]}));
+    T(equals(results.rows.length, 2));
+
+    var results = db.query(map, "_sum", {group_level:1});
+    T(equals(results.rows[0], {key:["a"],value:[70*i,70*i]}));
+    T(equals(results.rows[1], {key:["d"],value:[40*i,40*i]}));
+
+    var results = db.query(map, "_sum", {group_level:2});
+    T(equals(results.rows[0], {key:["a"],value:[20*i,20*i]}));
+    T(equals(results.rows[1], {key:["a","b"],value:[40*i,40*i]}));
+    T(equals(results.rows[2], {key:["a","c"],value:[10*i,10*i]}));
+    T(equals(results.rows[3], {key:["d"],value:[10*i,10*i]}));
+    T(equals(results.rows[4], {key:["d","a"],value:[10*i,10*i]}));
+    T(equals(results.rows[5], {key:["d","b"],value:[10*i,10*i]}));
+    T(equals(results.rows[6], {key:["d","c"],value:[10*i,10*i]}));
+  }
+}

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/test/reduce_false.js
----------------------------------------------------------------------
diff --git a/share/test/reduce_false.js b/share/test/reduce_false.js
new file mode 100644
index 0000000..699b258
--- /dev/null
+++ b/share/test/reduce_false.js
@@ -0,0 +1,44 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+
+couchTests.reduce_false = function(debug) {
+  var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"});
+  db.deleteDb();
+  db.createDb();
+  if (debug) debugger;
+
+  var numDocs = 5;
+  var docs = makeDocs(1,numDocs + 1);
+  db.bulkSave(docs);
+  var summate = function(N) {return (N+1)*N/2;};
+
+  var designDoc = {
+    _id:"_design/test",
+    language: "javascript",
+    views: {
+      summate: {map:"function (doc) { emit(doc.integer, doc.integer); }",
+                reduce:"function (keys, values) { return sum(values); }"},
+    }
+  };
+  T(db.save(designDoc).ok);
+
+  // Test that the reduce works
+  var res = db.view('test/summate');
+  T(res.rows.length == 1 && res.rows[0].value == summate(5));
+
+  //Test that we get our docs back
+  res = db.view('test/summate', {reduce: false});
+  T(res.rows.length == 5);
+  for(var i=0; i<5; i++) {
+    T(res.rows[i].value == i+1);
+  }
+};

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/test/reduce_false_temp.js
----------------------------------------------------------------------
diff --git a/share/test/reduce_false_temp.js b/share/test/reduce_false_temp.js
new file mode 100644
index 0000000..d45f05b
--- /dev/null
+++ b/share/test/reduce_false_temp.js
@@ -0,0 +1,37 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+
+couchTests.reduce_false_temp = function(debug) {
+  var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"});
+  db.deleteDb();
+  db.createDb();
+  if (debug) debugger;
+
+  var numDocs = 5;
+  var docs = makeDocs(1,numDocs + 1);
+  db.bulkSave(docs);
+  var summate = function(N) {return (N+1)*N/2;};
+
+  var mapFun = "function (doc) { emit(doc.integer, doc.integer); }";
+  var reduceFun = "function (keys, values) { return sum(values); }";
+
+  // Test that the reduce works
+  var res = db.query(mapFun, reduceFun);
+  T(res.rows.length == 1 && res.rows[0].value == summate(5));
+
+  //Test that we get our docs back
+  res = db.query(mapFun, reduceFun, {reduce: false});
+  T(res.rows.length == 5);
+  for(var i=0; i<5; i++) {
+    T(res.rows[i].value == i+1);
+  }
+};


[18/37] couchdb commit: updated refs/heads/goodbye-futon to 4fa015a

Posted by ja...@apache.org.
move JS tests into safety


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/3ba4fc0b
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/3ba4fc0b
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/3ba4fc0b

Branch: refs/heads/goodbye-futon
Commit: 3ba4fc0b487657d339fb7d3961dfc71e84a3a731
Parents: d309436
Author: Jan Lehnardt <ja...@apache.org>
Authored: Fri Oct 10 20:46:08 2014 +0200
Committer: Jan Lehnardt <ja...@apache.org>
Committed: Fri Oct 10 20:46:08 2014 +0200

----------------------------------------------------------------------
 share/test/all_docs.js                          |  142 ++
 share/test/attachment_names.js                  |   96 +
 share/test/attachment_paths.js                  |  153 ++
 share/test/attachment_ranges.js                 |  160 ++
 share/test/attachment_views.js                  |  140 ++
 share/test/attachments.js                       |  328 ++++
 share/test/attachments_multipart.js             |  416 ++++
 share/test/auth_cache.js                        |  269 +++
 share/test/basics.js                            |  290 +++
 share/test/batch_save.js                        |   48 +
 share/test/bulk_docs.js                         |  124 ++
 share/test/changes.js                           |  738 +++++++
 share/test/coffee.js                            |   67 +
 share/test/compact.js                           |   65 +
 share/test/config.js                            |  211 ++
 share/test/conflicts.js                         |  119 ++
 share/test/content_negotiation.js               |   39 +
 share/test/cookie_auth.js                       |  288 +++
 share/test/copy_doc.js                          |   65 +
 share/test/delayed_commits.js                   |  154 ++
 share/test/design_docs.js                       |  466 +++++
 share/test/design_options.js                    |   74 +
 share/test/design_paths.js                      |   72 +
 share/test/erlang_views.js                      |  136 ++
 share/test/etags_head.js                        |   78 +
 share/test/etags_views.js                       |  220 +++
 share/test/form_submit.js                       |   25 +
 share/test/http.js                              |   54 +
 share/test/invalid_docids.js                    |   77 +
 share/test/jsonp.js                             |   84 +
 share/test/large_docs.js                        |   33 +
 share/test/list_views.js                        |  492 +++++
 share/test/lorem.txt                            |  103 +
 share/test/lorem_b64.txt                        |    1 +
 share/test/lots_of_docs.js                      |   55 +
 share/test/method_override.js                   |   40 +
 share/test/multiple_rows.js                     |   80 +
 share/test/oauth.js                             |  294 +++
 share/test/oauth_users_db.js                    |  161 ++
 share/test/proxyauth.js                         |  130 ++
 share/test/purge.js                             |  145 ++
 share/test/reader_acl.js                        |  219 +++
 share/test/recreate_doc.js                      |  145 ++
 share/test/reduce.js                            |  414 ++++
 share/test/reduce_builtin.js                    |  179 ++
 share/test/reduce_false.js                      |   44 +
 share/test/reduce_false_temp.js                 |   37 +
 share/test/replication.js                       | 1795 ++++++++++++++++++
 share/test/replicator_db_bad_rep_id.js          |   77 +
 share/test/replicator_db_by_doc_id.js           |   99 +
 share/test/replicator_db_compact_rep_db.js      |  119 ++
 share/test/replicator_db_continuous.js          |  137 ++
 .../test/replicator_db_credential_delegation.js |  149 ++
 share/test/replicator_db_field_validation.js    |  178 ++
 share/test/replicator_db_filtered.js            |  105 +
 share/test/replicator_db_identical.js           |   87 +
 .../test/replicator_db_identical_continuous.js  |  139 ++
 share/test/replicator_db_invalid_filter.js      |  119 ++
 share/test/replicator_db_security.js            |  399 ++++
 share/test/replicator_db_simple.js              |  114 ++
 share/test/replicator_db_successive.js          |  127 ++
 share/test/replicator_db_survives.js            |  126 ++
 share/test/replicator_db_swap_rep_db.js         |  170 ++
 share/test/replicator_db_update_security.js     |   92 +
 share/test/replicator_db_user_ctx.js            |  272 +++
 share/test/replicator_db_write_auth.js          |  102 +
 share/test/rev_stemming.js                      |  110 ++
 share/test/rewrite.js                           |  505 +++++
 share/test/security_validation.js               |  338 ++++
 share/test/show_documents.js                    |  420 ++++
 share/test/stats.js                             |  348 ++++
 share/test/update_documents.js                  |  235 +++
 share/test/users_db.js                          |  173 ++
 share/test/users_db_security.js                 |  423 +++++
 share/test/utf8.js                              |   42 +
 share/test/uuids.js                             |  149 ++
 share/test/view_collation.js                    |  116 ++
 share/test/view_collation_raw.js                |  130 ++
 share/test/view_compaction.js                   |  110 ++
 share/test/view_conflicts.js                    |   49 +
 share/test/view_errors.js                       |  189 ++
 share/test/view_include_docs.js                 |  192 ++
 share/test/view_multi_key_all_docs.js           |   95 +
 share/test/view_multi_key_design.js             |  220 +++
 share/test/view_multi_key_temp.js               |   40 +
 share/test/view_offsets.js                      |  108 ++
 share/test/view_pagination.js                   |  147 ++
 share/test/view_sandboxing.js                   |  140 ++
 share/test/view_update_seq.js                   |  106 ++
 share/www/script/test/all_docs.js               |  142 --
 share/www/script/test/attachment_names.js       |   96 -
 share/www/script/test/attachment_paths.js       |  153 --
 share/www/script/test/attachment_ranges.js      |  160 --
 share/www/script/test/attachment_views.js       |  140 --
 share/www/script/test/attachments.js            |  328 ----
 share/www/script/test/attachments_multipart.js  |  416 ----
 share/www/script/test/auth_cache.js             |  269 ---
 share/www/script/test/basics.js                 |  290 ---
 share/www/script/test/batch_save.js             |   48 -
 share/www/script/test/bulk_docs.js              |  124 --
 share/www/script/test/changes.js                |  738 -------
 share/www/script/test/coffee.js                 |   67 -
 share/www/script/test/compact.js                |   65 -
 share/www/script/test/config.js                 |  211 --
 share/www/script/test/conflicts.js              |  119 --
 share/www/script/test/content_negotiation.js    |   39 -
 share/www/script/test/cookie_auth.js            |  288 ---
 share/www/script/test/copy_doc.js               |   65 -
 share/www/script/test/delayed_commits.js        |  154 --
 share/www/script/test/design_docs.js            |  466 -----
 share/www/script/test/design_options.js         |   74 -
 share/www/script/test/design_paths.js           |   72 -
 share/www/script/test/erlang_views.js           |  136 --
 share/www/script/test/etags_head.js             |   78 -
 share/www/script/test/etags_views.js            |  220 ---
 share/www/script/test/form_submit.js            |   25 -
 share/www/script/test/http.js                   |   54 -
 share/www/script/test/invalid_docids.js         |   77 -
 share/www/script/test/jsonp.js                  |   84 -
 share/www/script/test/large_docs.js             |   33 -
 share/www/script/test/list_views.js             |  492 -----
 share/www/script/test/lorem.txt                 |  103 -
 share/www/script/test/lorem_b64.txt             |    1 -
 share/www/script/test/lots_of_docs.js           |   55 -
 share/www/script/test/method_override.js        |   40 -
 share/www/script/test/multiple_rows.js          |   80 -
 share/www/script/test/oauth.js                  |  294 ---
 share/www/script/test/oauth_users_db.js         |  161 --
 share/www/script/test/proxyauth.js              |  130 --
 share/www/script/test/purge.js                  |  145 --
 share/www/script/test/reader_acl.js             |  219 ---
 share/www/script/test/recreate_doc.js           |  145 --
 share/www/script/test/reduce.js                 |  414 ----
 share/www/script/test/reduce_builtin.js         |  179 --
 share/www/script/test/reduce_false.js           |   44 -
 share/www/script/test/reduce_false_temp.js      |   37 -
 share/www/script/test/replication.js            | 1795 ------------------
 .../www/script/test/replicator_db_bad_rep_id.js |   77 -
 .../www/script/test/replicator_db_by_doc_id.js  |   99 -
 .../script/test/replicator_db_compact_rep_db.js |  119 --
 .../www/script/test/replicator_db_continuous.js |  137 --
 .../test/replicator_db_credential_delegation.js |  149 --
 .../test/replicator_db_field_validation.js      |  178 --
 share/www/script/test/replicator_db_filtered.js |  105 -
 .../www/script/test/replicator_db_identical.js  |   87 -
 .../test/replicator_db_identical_continuous.js  |  139 --
 .../script/test/replicator_db_invalid_filter.js |  119 --
 share/www/script/test/replicator_db_security.js |  399 ----
 share/www/script/test/replicator_db_simple.js   |  114 --
 .../www/script/test/replicator_db_successive.js |  127 --
 share/www/script/test/replicator_db_survives.js |  126 --
 .../script/test/replicator_db_swap_rep_db.js    |  170 --
 .../test/replicator_db_update_security.js       |   92 -
 share/www/script/test/replicator_db_user_ctx.js |  272 ---
 .../www/script/test/replicator_db_write_auth.js |  102 -
 share/www/script/test/rev_stemming.js           |  110 --
 share/www/script/test/rewrite.js                |  505 -----
 share/www/script/test/security_validation.js    |  338 ----
 share/www/script/test/show_documents.js         |  420 ----
 share/www/script/test/stats.js                  |  348 ----
 share/www/script/test/update_documents.js       |  235 ---
 share/www/script/test/users_db.js               |  173 --
 share/www/script/test/users_db_security.js      |  423 -----
 share/www/script/test/utf8.js                   |   42 -
 share/www/script/test/uuids.js                  |  149 --
 share/www/script/test/view_collation.js         |  116 --
 share/www/script/test/view_collation_raw.js     |  130 --
 share/www/script/test/view_compaction.js        |  110 --
 share/www/script/test/view_conflicts.js         |   49 -
 share/www/script/test/view_errors.js            |  189 --
 share/www/script/test/view_include_docs.js      |  192 --
 .../www/script/test/view_multi_key_all_docs.js  |   95 -
 share/www/script/test/view_multi_key_design.js  |  220 ---
 share/www/script/test/view_multi_key_temp.js    |   40 -
 share/www/script/test/view_offsets.js           |  108 --
 share/www/script/test/view_pagination.js        |  147 --
 share/www/script/test/view_sandboxing.js        |  140 --
 share/www/script/test/view_update_seq.js        |  106 --
 178 files changed, 16561 insertions(+), 16561 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/test/all_docs.js
----------------------------------------------------------------------
diff --git a/share/test/all_docs.js b/share/test/all_docs.js
new file mode 100644
index 0000000..66ad880
--- /dev/null
+++ b/share/test/all_docs.js
@@ -0,0 +1,142 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+
+couchTests.all_docs = function(debug) {
+  var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"});
+  db.deleteDb();
+  db.createDb();
+  if (debug) debugger;
+
+  // Create some more documents.
+  // Notice the use of the ok member on the return result.
+  T(db.save({_id:"0",a:1,b:1}).ok);
+  T(db.save({_id:"3",a:4,b:16}).ok);
+  T(db.save({_id:"1",a:2,b:4}).ok);
+  T(db.save({_id:"2",a:3,b:9}).ok);
+
+  // Check the all docs
+  var results = db.allDocs();
+  var rows = results.rows;
+
+  T(results.total_rows == results.rows.length);
+
+  for(var i=0; i < rows.length; i++) {
+    T(rows[i].id >= "0" && rows[i].id <= "4");
+  }
+
+  // Check _all_docs with descending=true
+  var desc = db.allDocs({descending:true});
+  T(desc.total_rows == desc.rows.length);
+
+  // Check _all_docs offset
+  var all = db.allDocs({startkey:"2"});
+  T(all.offset == 2);
+
+  // Confirm that queries may assume raw collation.
+  var raw = db.allDocs({ startkey: "org.couchdb.user:",
+                         endkey  : "org.couchdb.user;"
+                       });
+  TEquals(0, raw.rows.length);
+
+  // check that the docs show up in the seq view in the order they were created
+  var changes = db.changes();
+  var ids = ["0","3","1","2"];
+  for (var i=0; i < changes.results.length; i++) {
+    var row = changes.results[i];
+    T(row.id == ids[i], "seq order");
+  };
+
+  // it should work in reverse as well
+  changes = db.changes({descending:true});
+  ids = ["2","1","3","0"];
+  for (var i=0; i < changes.results.length; i++) {
+    var row = changes.results[i];
+    T(row.id == ids[i], "descending=true");
+  };
+
+  // check that deletions also show up right
+  var doc1 = db.open("1");
+  var deleted = db.deleteDoc(doc1);
+  T(deleted.ok);
+  changes = db.changes();
+  // the deletion should make doc id 1 have the last seq num
+  T(changes.results.length == 4);
+  T(changes.results[3].id == "1");
+  T(changes.results[3].deleted);
+
+  // do an update
+  var doc2 = db.open("3");
+  doc2.updated = "totally";
+  db.save(doc2);
+  changes = db.changes();
+
+  // the update should make doc id 3 have the last seq num
+  T(changes.results.length == 4);
+  T(changes.results[3].id == "3");
+
+  // ok now lets see what happens with include docs
+  changes = db.changes({include_docs: true});
+  T(changes.results.length == 4);
+  T(changes.results[3].id == "3");
+  T(changes.results[3].doc.updated == "totally");
+
+  T(changes.results[2].doc);
+  T(changes.results[2].doc._deleted);
+
+  rows = db.allDocs({include_docs: true}, ["1"]).rows;
+  TEquals(1, rows.length);
+  TEquals("1", rows[0].key);
+  TEquals("1", rows[0].id);
+  TEquals(true, rows[0].value.deleted);
+  TEquals(null, rows[0].doc);
+
+  // add conflicts
+  var conflictDoc1 = {
+    _id: "3", _rev: "2-aa01552213fafa022e6167113ed01087", value: "X"
+  };
+  var conflictDoc2 = {
+    _id: "3", _rev: "2-ff01552213fafa022e6167113ed01087", value: "Z"
+  };
+  T(db.save(conflictDoc1, {new_edits: false}));
+  T(db.save(conflictDoc2, {new_edits: false}));
+
+  var winRev = db.open("3");
+
+  changes = db.changes({include_docs: true, conflicts: true, style: "all_docs"});
+  TEquals("3", changes.results[3].id);
+  TEquals(3, changes.results[3].changes.length);
+  TEquals(winRev._rev, changes.results[3].changes[0].rev);
+  TEquals("3", changes.results[3].doc._id);
+  TEquals(winRev._rev, changes.results[3].doc._rev);
+  TEquals(true, changes.results[3].doc._conflicts instanceof Array);
+  TEquals(2, changes.results[3].doc._conflicts.length);
+
+  rows = db.allDocs({include_docs: true, conflicts: true}).rows;
+  TEquals(3, rows.length);
+  TEquals("3", rows[2].key);
+  TEquals("3", rows[2].id);
+  TEquals(winRev._rev, rows[2].value.rev);
+  TEquals(winRev._rev, rows[2].doc._rev);
+  TEquals("3", rows[2].doc._id);
+  TEquals(true, rows[2].doc._conflicts instanceof Array);
+  TEquals(2, rows[2].doc._conflicts.length);
+
+  // test the all docs collates sanely
+  db.save({_id: "Z", foo: "Z"});
+  db.save({_id: "a", foo: "a"});
+
+  var rows = db.allDocs({startkey: "Z", endkey: "Z"}).rows;
+  T(rows.length == 1);
+
+  // cleanup
+  db.deleteDb();
+};

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/test/attachment_names.js
----------------------------------------------------------------------
diff --git a/share/test/attachment_names.js b/share/test/attachment_names.js
new file mode 100644
index 0000000..c9a5fcc
--- /dev/null
+++ b/share/test/attachment_names.js
@@ -0,0 +1,96 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+
+couchTests.attachment_names = function(debug) {
+  var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"});
+  db.deleteDb();
+  db.createDb();
+  if (debug) debugger;
+
+  var goodDoc = {
+    _id: "good_doc",
+    _attachments: {
+      "Колян.txt": {
+       content_type:"application/octet-stream",
+       data: "VGhpcyBpcyBhIGJhc2U2NCBlbmNvZGVkIHRleHQ="
+      }
+    }
+  };
+
+  var save_response = db.save(goodDoc);
+  T(save_response.ok);
+
+  var xhr = CouchDB.request("GET", "/test_suite_db/good_doc/Колян.txt");
+  T(xhr.responseText == "This is a base64 encoded text");
+  T(xhr.getResponseHeader("Content-Type") == "application/octet-stream");
+  TEquals("\"aEI7pOYCRBLTRQvvqYrrJQ==\"", xhr.getResponseHeader("Etag"));
+
+  var binAttDoc = {
+    _id: "bin_doc",
+    _attachments:{
+      "foo\x80txt": {
+        content_type:"text/plain",
+        data: "VGhpcyBpcyBhIGJhc2U2NCBlbmNvZGVkIHRleHQ="
+      }
+    }
+  };
+
+  // inline attachments
+  resp = db.save(binAttDoc);
+  TEquals(true, resp.ok, "attachment_name: inline attachment");
+
+
+  // standalone docs
+  var bin_data = "JHAPDO*AU£PN ){(3u[d 93DQ9¡€])}    ææøo'∂ƒæ≤çæππ•¥∫¶®#†π¶®¥π€ª®˙π8np";
+
+
+  var xhr = (CouchDB.request("PUT", "/test_suite_db/bin_doc3/attachment\x80txt", {
+    headers:{"Content-Type":"text/plain;charset=utf-8"},
+    body:bin_data
+  }));
+
+  var resp = JSON.parse(xhr.responseText);
+  TEquals(201, xhr.status, "attachment_name: standalone API");
+  TEquals(true, resp.ok, "attachment_name: standalone API");
+
+  // bulk docs
+  var docs = { docs: [binAttDoc] };
+
+  var xhr = CouchDB.request("POST", "/test_suite_db/_bulk_docs", {
+    body: JSON.stringify(docs)
+  });
+
+  TEquals(201, xhr.status, "attachment_name: bulk docs");
+
+
+  // leading underscores
+  var binAttDoc = {
+    _id: "bin_doc2",
+    _attachments:{
+      "_foo.txt": {
+        content_type:"text/plain",
+        data: "VGhpcyBpcyBhIGJhc2U2NCBlbmNvZGVkIHRleHQ="
+      }
+    }
+  };
+
+  try {
+    db.save(binAttDoc);
+    TEquals(1, 2, "Attachment name with leading underscore saved. Should never show!");
+  } catch (e) {
+    TEquals("bad_request", e.error, "attachment_name: leading underscore");
+    TEquals("Attachment name can't start with '_'", e.reason, "attachment_name: leading underscore");
+  }
+
+  // todo: form uploads, waiting for cmlenz' test case for form uploads
+
+};

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/test/attachment_paths.js
----------------------------------------------------------------------
diff --git a/share/test/attachment_paths.js b/share/test/attachment_paths.js
new file mode 100644
index 0000000..3f6ffb7
--- /dev/null
+++ b/share/test/attachment_paths.js
@@ -0,0 +1,153 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+
+couchTests.attachment_paths = function(debug) {
+  if (debug) debugger;
+  var dbNames = ["test_suite_db", "test_suite_db/with_slashes"];
+  for (var i=0; i < dbNames.length; i++) {
+    var db = new CouchDB(dbNames[i]);
+    var dbName = encodeURIComponent(dbNames[i]);
+    db.deleteDb();
+    db.createDb();
+
+    // first just save a regular doc with an attachment that has a slash in the url.
+    // (also gonna run an encoding check case)
+    var binAttDoc = {
+      _id: "bin_doc",
+      _attachments:{
+        "foo/bar.txt": {
+          content_type:"text/plain",
+          data: "VGhpcyBpcyBhIGJhc2U2NCBlbmNvZGVkIHRleHQ="
+        },
+        "foo%2Fbaz.txt": {
+          content_type:"text/plain",
+          data: "V2UgbGlrZSBwZXJjZW50IHR3byBGLg=="
+        }
+      }
+    };
+
+    T(db.save(binAttDoc).ok);
+
+    var xhr = CouchDB.request("GET", "/"+dbName+"/bin_doc/foo/bar.txt");
+    T(xhr.responseText == "This is a base64 encoded text");
+    T(xhr.getResponseHeader("Content-Type") == "text/plain");
+
+    // lets try it with an escaped attachment id...
+    // weird that it's at two urls
+    var xhr = CouchDB.request("GET", "/"+dbName+"/bin_doc/foo%2Fbar.txt");
+    T(xhr.status == 200);
+    // xhr.responseText == "This is a base64 encoded text"
+
+    var xhr = CouchDB.request("GET", "/"+dbName+"/bin_doc/foo/baz.txt");
+    T(xhr.status == 404);
+
+    var xhr = CouchDB.request("GET", "/"+dbName+"/bin_doc/foo%252Fbaz.txt");
+    T(xhr.status == 200);
+    T(xhr.responseText == "We like percent two F.");
+
+    // require a _rev to PUT
+    var xhr = CouchDB.request("PUT", "/"+dbName+"/bin_doc/foo/attachment.txt", {
+      headers:{"Content-Type":"text/plain;charset=utf-8"},
+      body:"Just some text"
+    });
+    T(xhr.status == 409);
+
+    var xhr = CouchDB.request("PUT", "/"+dbName+"/bin_doc/foo/bar2.txt?rev=" + binAttDoc._rev, {
+      body:"This is no base64 encoded text",
+      headers:{"Content-Type": "text/plain;charset=utf-8"}
+    });
+    T(xhr.status == 201);
+    var rev = JSON.parse(xhr.responseText).rev;
+
+    binAttDoc = db.open("bin_doc");
+
+    T(binAttDoc._attachments["foo/bar.txt"] !== undefined);
+    T(binAttDoc._attachments["foo%2Fbaz.txt"] !== undefined);
+    T(binAttDoc._attachments["foo/bar2.txt"] !== undefined);
+    TEquals("text/plain;charset=utf-8",                   // thank you Safari
+      binAttDoc._attachments["foo/bar2.txt"].content_type.toLowerCase(),
+      "correct content-type"
+    );
+    T(binAttDoc._attachments["foo/bar2.txt"].length == 30);
+
+    //// now repeat the while thing with a design doc
+
+    // first just save a regular doc with an attachment that has a slash in the url.
+    // (also gonna run an encoding check case)
+    var binAttDoc = {
+      _id: "_design/bin_doc",
+      _attachments:{
+        "foo/bar.txt": {
+          content_type:"text/plain",
+          data: "VGhpcyBpcyBhIGJhc2U2NCBlbmNvZGVkIHRleHQ="
+        },
+        "foo%2Fbaz.txt": {
+          content_type:"text/plain",
+          data: "V2UgbGlrZSBwZXJjZW50IHR3byBGLg=="
+        }
+      }
+    };
+
+    T(db.save(binAttDoc).ok);
+
+    var xhr = CouchDB.request("GET", "/"+dbName+"/_design%2Fbin_doc/foo/bar.txt");
+    T(xhr.responseText == "This is a base64 encoded text");
+    T(xhr.getResponseHeader("Content-Type") == "text/plain");
+
+    // lets try it with an escaped attachment id...
+    // weird that it's at two urls
+    var xhr = CouchDB.request("GET", "/"+dbName+"/_design%2Fbin_doc/foo%2Fbar.txt");
+    T(xhr.responseText == "This is a base64 encoded text");
+    T(xhr.status == 200);
+
+    // err, 3 urls
+    var xhr = CouchDB.request("GET", "/"+dbName+"/_design/bin_doc/foo%2Fbar.txt");
+    T(xhr.responseText == "This is a base64 encoded text");
+    T(xhr.status == 200);
+
+    // I mean um, 4 urls
+    var xhr = CouchDB.request("GET", "/"+dbName+"/_design/bin_doc/foo/bar.txt");
+    T(xhr.responseText == "This is a base64 encoded text");
+    T(xhr.status == 200);
+
+    var xhr = CouchDB.request("GET", "/"+dbName+"/_design%2Fbin_doc/foo/baz.txt");
+    T(xhr.status == 404);
+
+    var xhr = CouchDB.request("GET", "/"+dbName+"/_design%2Fbin_doc/foo%252Fbaz.txt");
+    T(xhr.status == 200);
+    T(xhr.responseText == "We like percent two F.");
+
+    // require a _rev to PUT
+    var xhr = CouchDB.request("PUT", "/"+dbName+"/_design%2Fbin_doc/foo/attachment.txt", {
+      headers:{"Content-Type":"text/plain;charset=utf-8"},
+      body:"Just some text"
+    });
+    T(xhr.status == 409);
+
+    var xhr = CouchDB.request("PUT", "/"+dbName+"/_design%2Fbin_doc/foo/bar2.txt?rev=" + binAttDoc._rev, {
+      body:"This is no base64 encoded text",
+      headers:{"Content-Type": "text/plain;charset=utf-8"}
+    });
+    T(xhr.status == 201);
+    var rev = JSON.parse(xhr.responseText).rev;
+
+    binAttDoc = db.open("_design/bin_doc");
+
+    T(binAttDoc._attachments["foo/bar.txt"] !== undefined);
+    T(binAttDoc._attachments["foo/bar2.txt"] !== undefined);
+    TEquals("text/plain;charset=utf-8",                   // thank you Safari
+      binAttDoc._attachments["foo/bar2.txt"].content_type.toLowerCase(),
+      "correct content-type"
+    );
+    T(binAttDoc._attachments["foo/bar2.txt"].length == 30);
+  }
+};

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/test/attachment_ranges.js
----------------------------------------------------------------------
diff --git a/share/test/attachment_ranges.js b/share/test/attachment_ranges.js
new file mode 100644
index 0000000..7d9afb5
--- /dev/null
+++ b/share/test/attachment_ranges.js
@@ -0,0 +1,160 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+
+function cacheBust() {
+    return "?anti-cache=" + String(Math.round(Math.random() * 1000000));
+};
+
+couchTests.attachment_ranges = function(debug) {
+    var db = new CouchDB("test_suite_db", {
+        "X-Couch-Full-Commit": "false"
+    });
+    db.deleteDb();
+    db.createDb();
+
+    if (debug) debugger;
+
+    if((typeof window != "undefined") && window.navigator.userAgent.match(/Chrome/)) {
+        // Chrome is broken.
+        return;
+    }
+
+    var binAttDoc = {
+        _id: "bin_doc",
+        _attachments: {
+            "foo.txt": {
+                content_type: "application/octet-stream",
+                data: "VGhpcyBpcyBhIGJhc2U2NCBlbmNvZGVkIHRleHQ="
+            }
+        }
+    };
+
+    var save_response = db.save(binAttDoc);
+    T(save_response.ok);
+
+    // Fetching the whole entity is a 206.
+    var xhr = CouchDB.request("GET", "/test_suite_db/bin_doc/foo.txt" + cacheBust(), {
+        headers: {
+            "Range": "bytes=0-28"
+        }
+    });
+    TEquals(206, xhr.status, "fetch 0-28");
+    TEquals("This is a base64 encoded text", xhr.responseText);
+    TEquals("bytes 0-28/29", xhr.getResponseHeader("Content-Range"));
+    TEquals("29", xhr.getResponseHeader("Content-Length"));
+
+    // Fetch the whole entity without an end offset is a 200.
+    var xhr = CouchDB.request("GET", "/test_suite_db/bin_doc/foo.txt" + cacheBust(), {
+        headers: {
+            "Range": "bytes=0-"
+        }
+    });
+    TEquals(200, xhr.status, "fetch 0-");
+    TEquals("This is a base64 encoded text", xhr.responseText);
+    TEquals(null, xhr.getResponseHeader("Content-Range"));
+    TEquals("29", xhr.getResponseHeader("Content-Length"));
+
+    // Even if you ask multiple times.
+    var xhr = CouchDB.request("GET", "/test_suite_db/bin_doc/foo.txt" + cacheBust(), {
+        headers: {
+            "Range": "bytes=0-,0-,0-"
+        }
+    });
+    TEquals(200, xhr.status, "multiple 0-'s");
+
+    // Badly formed range header is a 200.
+    var xhr = CouchDB.request("GET", "/test_suite_db/bin_doc/foo.txt" + cacheBust(), {
+        headers: {
+            "Range": "bytes:0-"
+        }
+    });
+    TEquals(200, xhr.status, "fetch with bad range header");
+
+    // Fetch the end of an entity without an end offset is a 206.
+    var xhr = CouchDB.request("GET", "/test_suite_db/bin_doc/foo.txt"  + cacheBust(), {
+        headers: {
+            "Range": "bytes=2-"
+        }
+    });
+    TEquals(206, xhr.status, "fetch 2-");
+    TEquals("is is a base64 encoded text", xhr.responseText);
+    TEquals("bytes 2-28/29", xhr.getResponseHeader("Content-Range"));
+    TEquals("27", xhr.getResponseHeader("Content-Length"));
+
+    // Fetch past the end of the entity is a 206
+    var xhr = CouchDB.request("GET", "/test_suite_db/bin_doc/foo.txt"  + cacheBust(), {
+        headers: {
+            "Range": "bytes=0-29"
+        }
+    });
+    TEquals(206, xhr.status, "fetch 0-29");
+    TEquals("bytes 0-28/29", xhr.getResponseHeader("Content-Range"));
+    TEquals("29", xhr.getResponseHeader("Content-Length"));
+
+    // Fetch first part of entity is a 206
+    var xhr = CouchDB.request("GET", "/test_suite_db/bin_doc/foo.txt" + cacheBust(), {
+        headers: {
+            "Range": "bytes=0-3"
+        }
+    });
+    TEquals(206, xhr.status, "fetch 0-3");
+    TEquals("This", xhr.responseText);
+    TEquals("4", xhr.getResponseHeader("Content-Length"));
+    TEquals("bytes 0-3/29", xhr.getResponseHeader("Content-Range"));
+
+    // Fetch middle of entity is also a 206
+    var xhr = CouchDB.request("GET", "/test_suite_db/bin_doc/foo.txt" + cacheBust(), {
+        headers: {
+            "Range": "bytes=10-15"
+        }
+    });
+    TEquals(206, xhr.status, "fetch 10-15");
+    TEquals("base64", xhr.responseText);
+    TEquals("6", xhr.getResponseHeader("Content-Length"));
+    TEquals("bytes 10-15/29", xhr.getResponseHeader("Content-Range"));
+
+    // Fetch end of entity is also a 206
+    var xhr = CouchDB.request("GET", "/test_suite_db/bin_doc/foo.txt" + cacheBust(), {
+        headers: {
+            "Range": "bytes=-3"
+        }
+    });
+    TEquals(206, xhr.status, "fetch -3");
+    TEquals("ext", xhr.responseText);
+    TEquals("3", xhr.getResponseHeader("Content-Length"));
+    TEquals("bytes 26-28/29", xhr.getResponseHeader("Content-Range"));
+    
+    // backward range is 416
+    var xhr = CouchDB.request("GET", "/test_suite_db/bin_doc/foo.txt" + cacheBust(), {
+       headers: {
+           "Range": "bytes=5-3"
+       }
+    });
+    TEquals(416, xhr.status, "fetch 5-3");
+
+    // range completely outside of entity is 416
+    var xhr = CouchDB.request("GET", "/test_suite_db/bin_doc/foo.txt" + cacheBust(), {
+        headers: {
+            "Range": "bytes=300-310"
+        }
+    });
+    TEquals(416, xhr.status, "fetch 300-310");
+
+    // We ignore a Range header with too many ranges
+    var xhr = CouchDB.request("GET", "/test_suite_db/bin_doc/foo.txt" + cacheBust(), {
+        headers: {
+            "Range": "bytes=0-1,0-1,0-1,0-1,0-1,0-1,0-1,0-1,0-1,0-1"
+        }
+    });
+    TEquals(200, xhr.status, "too many ranges");
+
+};

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/test/attachment_views.js
----------------------------------------------------------------------
diff --git a/share/test/attachment_views.js b/share/test/attachment_views.js
new file mode 100644
index 0000000..b55aabe
--- /dev/null
+++ b/share/test/attachment_views.js
@@ -0,0 +1,140 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+
+couchTests.attachment_views= function(debug) {
+
+  var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"});
+  db.deleteDb();
+  db.createDb();
+  if (debug) debugger;
+
+  // count attachments in a view
+
+  var attachmentData = "VGhpcyBpcyBhIGJhc2U2NCBlbmNvZGVkIHRleHQ=";
+
+  db.bulkSave(makeDocs(0, 10));
+
+  db.bulkSave(makeDocs(10, 20, {
+    _attachments:{
+      "foo.txt": {
+        content_type:"text/plain",
+        data: attachmentData
+      }
+    }
+  }));
+
+  db.bulkSave(makeDocs(20, 30, {
+    _attachments:{
+      "foo.txt": {
+        content_type:"text/plain",
+        data: attachmentData
+      },
+      "bar.txt": {
+        content_type:"text/plain",
+        data: attachmentData
+      }
+    }
+  }));
+
+  db.bulkSave(makeDocs(30, 40, {
+    _attachments:{
+      "foo.txt": {
+        content_type:"text/plain",
+        data: attachmentData
+      },
+      "bar.txt": {
+        content_type:"text/plain",
+        data: attachmentData
+      },
+      "baz.txt": {
+        content_type:"text/plain",
+        data: attachmentData
+      }
+    }
+  }));
+
+  var mapFunction = function(doc) {
+    var count = 0;
+
+    for(var idx in doc._attachments) {
+      count = count + 1;
+    }
+
+    emit(parseInt(doc._id), count);
+  };
+
+  var reduceFunction = function(key, values) {
+    return sum(values);
+  };
+
+  var result = db.query(mapFunction, reduceFunction);
+
+  T(result.rows.length == 1);
+  T(result.rows[0].value == 60);
+
+  var result = db.query(mapFunction, reduceFunction, {
+    startkey:10,
+    endkey:19
+  });
+
+  T(result.rows.length == 1);
+  T(result.rows[0].value == 10);
+
+  var result = db.query(mapFunction, reduceFunction, {
+    startkey:20,
+    endkey:29
+  });
+
+  T(result.rows.length == 1);
+  T(result.rows[0].value == 20);
+
+  var result = db.query(mapFunction, null, {
+    startkey: 30,
+    endkey: 39,
+    include_docs: true
+  });
+
+  T(result.rows.length == 10);
+  T(result.rows[0].value == 3);
+  T(result.rows[0].doc._attachments['baz.txt'].stub === true);
+  T(result.rows[0].doc._attachments['baz.txt'].data === undefined);
+  T(result.rows[0].doc._attachments['baz.txt'].encoding === undefined);
+  T(result.rows[0].doc._attachments['baz.txt'].encoded_length === undefined);
+
+  var result = db.query(mapFunction, null, {
+    startkey: 30,
+    endkey: 39,
+    include_docs: true,
+    attachments: true
+  });
+
+  T(result.rows.length == 10);
+  T(result.rows[0].value == 3);
+  T(result.rows[0].doc._attachments['baz.txt'].data === attachmentData);
+  T(result.rows[0].doc._attachments['baz.txt'].stub === undefined);
+  T(result.rows[0].doc._attachments['baz.txt'].encoding === undefined);
+  T(result.rows[0].doc._attachments['baz.txt'].encoded_length === undefined);
+
+  var result = db.query(mapFunction, null, {
+    startkey: 30,
+    endkey: 39,
+    include_docs: true,
+    att_encoding_info: true
+  });
+
+  T(result.rows.length == 10);
+  T(result.rows[0].value == 3);
+  T(result.rows[0].doc._attachments['baz.txt'].data === undefined);
+  T(result.rows[0].doc._attachments['baz.txt'].stub === true);
+  T(result.rows[0].doc._attachments['baz.txt'].encoding === "gzip");
+  T(result.rows[0].doc._attachments['baz.txt'].encoded_length === 47);
+};

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/test/attachments.js
----------------------------------------------------------------------
diff --git a/share/test/attachments.js b/share/test/attachments.js
new file mode 100644
index 0000000..2fa08ee
--- /dev/null
+++ b/share/test/attachments.js
@@ -0,0 +1,328 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+
+couchTests.attachments= function(debug) {
+  var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"});
+  db.deleteDb();
+  db.createDb();
+  if (debug) debugger;
+
+
+  // MD5 Digests of compressible attachments and therefore Etags
+  // will vary depending on platform gzip implementation.
+  // These MIME types are defined in [attachments] compressible_types
+  var binAttDoc = {
+    _id: "bin_doc",
+    _attachments:{
+      "foo.txt": {
+        content_type:"application/octet-stream",
+        data: "VGhpcyBpcyBhIGJhc2U2NCBlbmNvZGVkIHRleHQ="
+      }
+    }
+  };
+
+  var save_response = db.save(binAttDoc);
+  T(save_response.ok);
+
+  var xhr = CouchDB.request("GET", "/test_suite_db/bin_doc/foo.txt");
+  T(xhr.responseText == "This is a base64 encoded text");
+  T(xhr.getResponseHeader("Content-Type") == "application/octet-stream");
+  TEquals("\"aEI7pOYCRBLTRQvvqYrrJQ==\"", xhr.getResponseHeader("Etag"));
+
+  // empty attachment
+  var binAttDoc2 = {
+    _id: "bin_doc2",
+    _attachments:{
+      "foo.txt": {
+        content_type:"text/plain",
+        data: ""
+      }
+    }
+  }
+
+  T(db.save(binAttDoc2).ok);
+
+  var xhr = CouchDB.request("GET", "/test_suite_db/bin_doc2/foo.txt");
+  T(xhr.responseText.length == 0);
+  T(xhr.getResponseHeader("Content-Type") == "text/plain");
+
+  // test RESTful doc API
+
+  var xhr = CouchDB.request("PUT", "/test_suite_db/bin_doc2/foo2.txt?rev=" + binAttDoc2._rev, {
+    body:"This is no base64 encoded text",
+    headers:{"Content-Type": "text/plain;charset=utf-8"}
+  });
+  T(xhr.status == 201);
+  TEquals("/bin_doc2/foo2.txt",
+    xhr.getResponseHeader("Location").substr(-18),
+    "should return Location header to newly created or updated attachment");
+
+  var rev = JSON.parse(xhr.responseText).rev;
+
+  binAttDoc2 = db.open("bin_doc2");
+
+  T(binAttDoc2._attachments["foo.txt"] !== undefined);
+  T(binAttDoc2._attachments["foo2.txt"] !== undefined);
+  TEqualsIgnoreCase("text/plain;charset=utf-8", binAttDoc2._attachments["foo2.txt"].content_type);
+  T(binAttDoc2._attachments["foo2.txt"].length == 30);
+
+  var xhr = CouchDB.request("GET", "/test_suite_db/bin_doc2/foo2.txt");
+  T(xhr.responseText == "This is no base64 encoded text");
+  TEqualsIgnoreCase("text/plain;charset=utf-8", xhr.getResponseHeader("Content-Type"));
+
+  // test without rev, should fail
+  var xhr = CouchDB.request("DELETE", "/test_suite_db/bin_doc2/foo2.txt");
+  T(xhr.status == 409);
+
+  // test with rev, should not fail
+  var xhr = CouchDB.request("DELETE", "/test_suite_db/bin_doc2/foo2.txt?rev=" + rev);
+  T(xhr.status == 200);
+  TEquals(null, xhr.getResponseHeader("Location"),
+    "should not return Location header on DELETE request");
+
+  // test binary data
+  var bin_data = "JHAPDO*AU£PN ){(3u[d 93DQ9¡€])}    ææøo'∂ƒæ≤çæππ•¥∫¶®#†π¶®¥π€ª®˙π8np";
+  var xhr = CouchDB.request("PUT", "/test_suite_db/bin_doc3/attachment.txt", {
+    headers:{"Content-Type":"text/plain;charset=utf-8"},
+    body:bin_data
+  });
+  T(xhr.status == 201);
+  var rev = JSON.parse(xhr.responseText).rev;
+  TEquals('"' + rev + '"', xhr.getResponseHeader("Etag"));
+
+  var xhr = CouchDB.request("GET", "/test_suite_db/bin_doc3/attachment.txt");
+  T(xhr.responseText == bin_data);
+  TEqualsIgnoreCase("text/plain;charset=utf-8", xhr.getResponseHeader("Content-Type"));
+
+  // without rev
+  var xhr = CouchDB.request("PUT", "/test_suite_db/bin_doc3/attachment.txt", {
+    headers:{"Content-Type":"text/plain;charset=utf-8"},
+    body:bin_data
+  });
+  T(xhr.status == 409);
+
+  // with nonexistent rev
+  var xhr = CouchDB.request("PUT", "/test_suite_db/bin_doc3/attachment.txt"  + "?rev=1-adae8575ecea588919bd08eb020c708e", {
+    headers:{"Content-Type":"text/plain;charset=utf-8"},
+    body:bin_data
+  });
+  T(xhr.status == 409);
+
+  // with current rev
+  var xhr = CouchDB.request("PUT", "/test_suite_db/bin_doc3/attachment.txt?rev=" + rev, {
+    headers:{"Content-Type":"text/plain;charset=utf-8"},
+    body:bin_data
+  });
+  T(xhr.status == 201);
+  var rev = JSON.parse(xhr.responseText).rev;
+  TEquals('"' + rev + '"', xhr.getResponseHeader("Etag"));
+
+  var xhr = CouchDB.request("GET", "/test_suite_db/bin_doc3/attachment.txt");
+  T(xhr.responseText == bin_data);
+  TEqualsIgnoreCase("text/plain;charset=utf-8", xhr.getResponseHeader("Content-Type"));
+
+  var xhr = CouchDB.request("GET", "/test_suite_db/bin_doc3/attachment.txt?rev=" + rev);
+  T(xhr.responseText == bin_data);
+  TEqualsIgnoreCase("text/plain;charset=utf-8", xhr.getResponseHeader("Content-Type"));
+
+  var xhr = CouchDB.request("DELETE", "/test_suite_db/bin_doc3/attachment.txt?rev=" + rev);
+  T(xhr.status == 200);
+
+  var xhr = CouchDB.request("GET", "/test_suite_db/bin_doc3/attachment.txt");
+  T(xhr.status == 404);
+
+  // deleted attachment is still accessible with revision
+  var xhr = CouchDB.request("GET", "/test_suite_db/bin_doc3/attachment.txt?rev=" + rev);
+  T(xhr.status == 200);
+  T(xhr.responseText == bin_data);
+  TEqualsIgnoreCase("text/plain;charset=utf-8", xhr.getResponseHeader("Content-Type"));
+
+  // empty attachments
+  var xhr = CouchDB.request("PUT", "/test_suite_db/bin_doc4/attachment.txt", {
+    headers:{"Content-Type":"text/plain;charset=utf-8"},
+    body:""
+  });
+  T(xhr.status == 201);
+  var rev = JSON.parse(xhr.responseText).rev;
+
+  var xhr = CouchDB.request("GET", "/test_suite_db/bin_doc4/attachment.txt");
+  T(xhr.status == 200);
+  T(xhr.responseText.length == 0);
+
+  // overwrite previsously empty attachment
+  var xhr = CouchDB.request("PUT", "/test_suite_db/bin_doc4/attachment.txt?rev=" + rev, {
+    headers:{"Content-Type":"text/plain;charset=utf-8"},
+    body:"This is a string"
+  });
+  T(xhr.status == 201);
+
+  var xhr = CouchDB.request("GET", "/test_suite_db/bin_doc4/attachment.txt");
+  T(xhr.status == 200);
+  T(xhr.responseText == "This is a string");
+
+  // Attachment sparseness COUCHDB-220
+
+  var docs = [];
+  for (var i = 0; i < 5; i++) {
+    var doc = {
+      _id: (i).toString(),
+      _attachments:{
+        "foo.txt": {
+          content_type:"text/plain",
+          data: "VGhpcyBpcyBhIGJhc2U2NCBlbmNvZGVkIHRleHQ="
+        }
+      }
+    };
+    docs.push(doc);
+  }
+
+  var saved = db.bulkSave(docs);
+  // now delete the docs, and while we are looping over them, remove the
+  // '_rev' field so we can re-create after deletion.
+  var to_up = [];
+  for (i=0;i<saved.length;i++) {
+    to_up.push({'_id': saved[i]['id'], '_rev': saved[i]['rev'], '_deleted': true});
+    delete docs[i]._rev;
+  }
+  // delete them.
+  var saved2 = db.bulkSave(to_up);
+  // re-create them
+  var saved3 = db.bulkSave(docs);
+
+  var before = db.info().disk_size;
+
+  // Compact it.
+  T(db.compact().ok);
+  T(db.last_req.status == 202);
+  // compaction isn't instantaneous, loop until done
+  while (db.info().compact_running) {};
+
+  var after = db.info().disk_size;
+
+  // Compaction should reduce the database slightly, but not
+  // orders of magnitude (unless attachments introduce sparseness)
+  T(after > before * 0.1, "before: " + before + " after: " + after);
+
+
+  // test large attachments - COUCHDB-366
+  var lorem = CouchDB.request("GET", "/_utils/script/test/lorem.txt").responseText;
+
+  var xhr = CouchDB.request("PUT", "/test_suite_db/bin_doc5/lorem.txt", {
+    headers:{"Content-Type":"text/plain;charset=utf-8"},
+    body:lorem
+  });
+  T(xhr.status == 201);
+  var rev = JSON.parse(xhr.responseText).rev;
+
+  var xhr = CouchDB.request("GET", "/test_suite_db/bin_doc5/lorem.txt");
+  T(xhr.responseText == lorem);
+  TEqualsIgnoreCase("text/plain;charset=utf-8", xhr.getResponseHeader("Content-Type"));
+
+  // test large inline attachment too
+  var lorem_b64 = CouchDB.request("GET", "/_utils/script/test/lorem_b64.txt").responseText;
+  var doc = db.open("bin_doc5", {attachments:true});
+  T(doc._attachments["lorem.txt"].data == lorem_b64);
+
+  // test etags for attachments.
+  var xhr = CouchDB.request("GET", "/test_suite_db/bin_doc5/lorem.txt");
+  T(xhr.status == 200);
+  var etag = xhr.getResponseHeader("etag");
+  xhr = CouchDB.request("GET", "/test_suite_db/bin_doc5/lorem.txt", {
+    headers: {"if-none-match": etag}
+  });
+  T(xhr.status == 304);
+
+  // test COUCHDB-497 - empty attachments
+  var xhr = CouchDB.request("PUT", "/test_suite_db/bin_doc5/empty.txt?rev="+rev, {
+    headers:{"Content-Type":"text/plain;charset=utf-8", "Content-Length": "0"},
+    body:""
+  });
+  TEquals(201, xhr.status, "should send 201 Accepted");
+  var rev = JSON.parse(xhr.responseText).rev;
+  var xhr = CouchDB.request("PUT", "/test_suite_db/bin_doc5/empty.txt?rev="+rev, {
+    headers:{"Content-Type":"text/plain;charset=utf-8"}
+  });
+  TEquals(201, xhr.status, "should send 201 Accepted");
+
+  // implicit doc creation allows creating docs with a reserved id. COUCHDB-565
+  var xhr = CouchDB.request("PUT", "/test_suite_db/_nonexistant/attachment.txt", {
+    headers: {"Content-Type":"text/plain;charset=utf-8"},
+    body: "THIS IS AN ATTACHMENT. BOOYA!"
+  });
+  TEquals(400, xhr.status, "should return error code 400 Bad Request");
+
+  // test COUCHDB-809 - stubs should only require the 'stub' field
+  var bin_doc6 = {
+    _id: "bin_doc6",
+    _attachments:{
+      "foo.txt": {
+        content_type:"text/plain",
+        data: "VGhpcyBpcyBhIGJhc2U2NCBlbmNvZGVkIHRleHQ="
+      }
+    }
+  };
+  T(db.save(bin_doc6).ok);
+  // stub out the attachment
+  bin_doc6._attachments["foo.txt"] = { stub: true };
+  T(db.save(bin_doc6).ok == true);
+
+  // wrong rev pos specified
+  
+  // stub out the attachment with the wrong revpos
+  bin_doc6._attachments["foo.txt"] = { stub: true, revpos: 10};
+  try {
+      T(db.save(bin_doc6).ok == true);
+      T(false && "Shouldn't get here!");
+  } catch (e) {
+      T(e.error == "missing_stub");
+  }
+
+  // test MD5 header
+  var bin_data = "foo bar"
+  var xhr = CouchDB.request("PUT", "/test_suite_db/bin_doc7/attachment.txt", {
+    headers:{"Content-Type":"application/octet-stream",
+             "Content-MD5":"MntvB0NYESObxH4VRDUycw=="},
+    body:bin_data
+  });
+  TEquals(201, xhr.status);
+
+  var xhr = CouchDB.request("GET", "/test_suite_db/bin_doc7/attachment.txt");
+  TEquals('MntvB0NYESObxH4VRDUycw==', xhr.getResponseHeader("Content-MD5"));
+
+  // test attachment via multipart/form-data
+  var bin_doc8 = {
+    _id: "bin_doc8"
+  };
+  T(db.save(bin_doc8).ok);
+  var doc = db.open("bin_doc8");
+  var body = "------TF\r\n" +
+    "Content-Disposition: form-data; name=\"_rev\"\r\n\r\n" +
+    doc._rev + "\r\n" +
+    "------TF\r\n" +
+    "Content-Disposition: form-data; name=\"_attachments\"; filename=\"file.txt\"\r\n" +
+    "Content-Type: text/plain\r\n\r\n" +
+    "contents of file.txt\r\n\r\n" +
+    "------TF--"
+  xhr = CouchDB.request("POST", "/test_suite_db/bin_doc8", {
+    headers: {
+      "Content-Type": "multipart/form-data; boundary=----TF",
+      "Content-Length": body.length
+    },
+    body: body
+  });
+  TEquals(201, xhr.status);
+  TEquals(true, JSON.parse(xhr.responseText).ok);
+  var doc = db.open("bin_doc8");
+  T(doc._attachments);
+  T(doc._attachments['file.txt']);
+
+};

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/test/attachments_multipart.js
----------------------------------------------------------------------
diff --git a/share/test/attachments_multipart.js b/share/test/attachments_multipart.js
new file mode 100644
index 0000000..6f924a7
--- /dev/null
+++ b/share/test/attachments_multipart.js
@@ -0,0 +1,416 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+
+couchTests.attachments_multipart= function(debug) {
+  var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"});
+  db.deleteDb();
+  db.createDb();
+  if (debug) debugger;
+  
+  // mime multipart
+            
+  var xhr = CouchDB.request("PUT", "/test_suite_db/multipart", {
+    headers: {"Content-Type": "multipart/related;boundary=\"abc123\""},
+    body:
+      "--abc123\r\n" +
+      "content-type: application/json\r\n" +
+      "\r\n" +
+      JSON.stringify({
+        "body":"This is a body.",
+        "_attachments":{
+          "foo.txt": {
+            "follows":true,
+            "content_type":"application/test",
+            "length":21
+            },
+          "bar.txt": {
+            "follows":true,
+            "content_type":"application/test",
+            "length":20
+            },
+          "baz.txt": {
+            "follows":true,
+            "content_type":"text/plain",
+            "length":19
+            }
+          }
+        }) +
+      "\r\n--abc123\r\n" +
+      "\r\n" +
+      "this is 21 chars long" +
+      "\r\n--abc123\r\n" +
+      "\r\n" +
+      "this is 20 chars lon" +
+      "\r\n--abc123\r\n" +
+      "\r\n" +
+      "this is 19 chars lo" +
+      "\r\n--abc123--epilogue"
+    });
+    
+  var result = JSON.parse(xhr.responseText);
+  
+  T(result.ok);
+  
+  
+    
+  TEquals(201, xhr.status, "should send 201 Accepted");
+  
+  xhr = CouchDB.request("GET", "/test_suite_db/multipart/foo.txt");
+  
+  T(xhr.responseText == "this is 21 chars long");
+  
+  xhr = CouchDB.request("GET", "/test_suite_db/multipart/bar.txt");
+  
+  T(xhr.responseText == "this is 20 chars lon");
+  
+  xhr = CouchDB.request("GET", "/test_suite_db/multipart/baz.txt");
+  
+  T(xhr.responseText == "this is 19 chars lo");
+  
+  // now edit an attachment
+  
+  var doc = db.open("multipart", {att_encoding_info: true});
+  var firstrev = doc._rev;
+  
+  T(doc._attachments["foo.txt"].stub == true);
+  T(doc._attachments["bar.txt"].stub == true);
+  T(doc._attachments["baz.txt"].stub == true);
+  TEquals("undefined", typeof doc._attachments["foo.txt"].encoding);
+  TEquals("undefined", typeof doc._attachments["bar.txt"].encoding);
+  TEquals("gzip", doc._attachments["baz.txt"].encoding);
+  
+  //lets change attachment bar
+  delete doc._attachments["bar.txt"].stub; // remove stub member (or could set to false)
+  delete doc._attachments["bar.txt"].digest; // remove the digest (it's for the gzip form)
+  doc._attachments["bar.txt"].length = 18;
+  doc._attachments["bar.txt"].follows = true;
+  //lets delete attachment baz:
+  delete doc._attachments["baz.txt"];
+  
+  var xhr = CouchDB.request("PUT", "/test_suite_db/multipart", {
+    headers: {"Content-Type": "multipart/related;boundary=\"abc123\""},
+    body:
+      "--abc123\r\n" +
+      "content-type: application/json\r\n" +
+      "\r\n" +
+      JSON.stringify(doc) +
+      "\r\n--abc123\r\n" +
+      "\r\n" +
+      "this is 18 chars l" +
+      "\r\n--abc123--"
+    });
+  TEquals(201, xhr.status);
+  
+  xhr = CouchDB.request("GET", "/test_suite_db/multipart/bar.txt");
+  
+  T(xhr.responseText == "this is 18 chars l");
+  
+  xhr = CouchDB.request("GET", "/test_suite_db/multipart/baz.txt");
+  T(xhr.status == 404);
+  
+  // now test receiving multipart docs
+  
+  function getBoundary(xhr) {
+    var ctype = CouchDB.xhrheader(xhr, "Content-Type");
+    var ctypeArgs = ctype.split("; ").slice(1);
+    var boundary = null;
+    for(var i=0; i<ctypeArgs.length; i++) {
+      if (ctypeArgs[i].indexOf("boundary=") == 0) {
+        boundary = ctypeArgs[i].split("=")[1];
+        if (boundary.charAt(0) == '"') {
+          // stringified boundary, parse as json 
+          // (will maybe not if there are escape quotes)
+          boundary = JSON.parse(boundary);
+        }
+      }
+    }
+    return boundary;
+  }
+  
+  function parseMultipart(xhr) {
+    var boundary = getBoundary(xhr);
+    var mimetext = CouchDB.xhrbody(xhr);
+    // strip off leading boundary
+    var leading = "--" + boundary + "\r\n";
+    var last = "\r\n--" + boundary + "--";
+    
+    // strip off leading and trailing boundary
+    var leadingIdx = mimetext.indexOf(leading) + leading.length;
+    var trailingIdx = mimetext.indexOf(last);
+    mimetext = mimetext.slice(leadingIdx, trailingIdx);
+    
+    // now split the sections
+    var sections = mimetext.split(new RegExp("\\r\\n--" + boundary));
+    
+    // spilt out the headers for each section
+    for(var i=0; i < sections.length; i++) {
+      var section = sections[i];
+      var headerEndIdx = section.indexOf("\r\n\r\n");
+      var headersraw = section.slice(0, headerEndIdx).split(/\r\n/);
+      var body = section.slice(headerEndIdx + 4);
+      var headers = {};
+      for(var j=0; j<headersraw.length; j++) {
+        var tmp = headersraw[j].split(": ");
+        headers[tmp[0]] = tmp[1]; 
+      }
+      sections[i] = {"headers":headers, "body":body};
+    }
+    
+    return sections;
+  }
+  
+  
+  xhr = CouchDB.request("GET", "/test_suite_db/multipart?attachments=true",
+    {headers:{"accept": "multipart/related,*/*;"}});
+  
+  T(xhr.status == 200);
+  
+  // parse out the multipart
+  var sections = parseMultipart(xhr);
+  TEquals("790", xhr.getResponseHeader("Content-Length"),
+    "Content-Length should be correct");
+  T(sections.length == 3);
+  // The first section is the json doc. Check it's content-type.
+  // Each part carries their own meta data.
+  TEquals("application/json", sections[0].headers['Content-Type'],
+    "Content-Type should be application/json for section[0]");
+  TEquals("application/test", sections[1].headers['Content-Type'],
+    "Content-Type should be application/test for section[1]");
+  TEquals("application/test", sections[2].headers['Content-Type'],
+    "Content-Type should be application/test for section[2]");
+
+  TEquals("21", sections[1].headers['Content-Length'],
+    "Content-Length should be 21 section[1]");
+  TEquals("18", sections[2].headers['Content-Length'],
+    "Content-Length should be 18 section[2]");
+
+  TEquals('attachment; filename="foo.txt"', sections[1].headers['Content-Disposition'],
+    "Content-Disposition should be foo.txt section[1]");
+  TEquals('attachment; filename="bar.txt"', sections[2].headers['Content-Disposition'],
+    "Content-Disposition should be bar.txt section[2]");
+
+  var doc = JSON.parse(sections[0].body);
+  
+  T(doc._attachments['foo.txt'].follows == true);
+  T(doc._attachments['bar.txt'].follows == true);
+  
+  T(sections[1].body == "this is 21 chars long");
+  TEquals("this is 18 chars l", sections[2].body, "should be 18 chars long");
+  
+  // now get attachments incrementally (only the attachments changes since
+  // a certain rev).
+  
+  xhr = CouchDB.request("GET", "/test_suite_db/multipart?atts_since=[\"" + firstrev + "\"]",
+    {headers:{"accept": "multipart/related, */*"}});
+  
+  T(xhr.status == 200);
+  
+  var sections = parseMultipart(xhr);
+  
+  T(sections.length == 2);
+  
+  var doc = JSON.parse(sections[0].body);
+  
+  T(doc._attachments['foo.txt'].stub == true);
+  T(doc._attachments['bar.txt'].follows == true);
+  
+  TEquals("this is 18 chars l", sections[1].body, "should be 18 chars long 2");
+
+  // try the atts_since parameter together with the open_revs parameter
+  xhr = CouchDB.request(
+    "GET",
+    '/test_suite_db/multipart?open_revs=["' +
+      doc._rev + '"]&atts_since=["' + firstrev + '"]',
+    {headers: {"accept": "multipart/mixed"}}
+  );
+
+  T(xhr.status === 200);
+
+  sections = parseMultipart(xhr);
+  // 1 section, with a multipart/related Content-Type
+  T(sections.length === 1);
+  T(sections[0].headers['Content-Type'].indexOf('multipart/related;') === 0);
+
+  var innerSections = parseMultipart(sections[0]);
+  // 2 inner sections: a document body section plus an attachment data section
+  T(innerSections.length === 2);
+  T(innerSections[0].headers['Content-Type'] === 'application/json');
+
+  doc = JSON.parse(innerSections[0].body);
+
+  T(doc._attachments['foo.txt'].stub === true);
+  T(doc._attachments['bar.txt'].follows === true);
+
+  T(innerSections[1].body === "this is 18 chars l");
+
+  // try it with a rev that doesn't exist (should get all attachments)
+  
+  xhr = CouchDB.request("GET", "/test_suite_db/multipart?atts_since=[\"1-2897589\"]",
+    {headers:{"accept": "multipart/related,*/*;"}});
+  
+  T(xhr.status == 200);
+  
+  var sections = parseMultipart(xhr);
+  
+  T(sections.length == 3);
+  
+  var doc = JSON.parse(sections[0].body);
+  
+  T(doc._attachments['foo.txt'].follows == true);
+  T(doc._attachments['bar.txt'].follows == true);
+  
+  T(sections[1].body == "this is 21 chars long");
+  TEquals("this is 18 chars l", sections[2].body, "should be 18 chars long 3");
+  // try it with a rev that doesn't exist, and one that does
+  
+  xhr = CouchDB.request("GET", "/test_suite_db/multipart?atts_since=[\"1-2897589\",\"" + firstrev + "\"]",
+    {headers:{"accept": "multipart/related,*/*;"}});
+  
+  T(xhr.status == 200);
+  
+  var sections = parseMultipart(xhr);
+  
+  T(sections.length == 2);
+  
+  var doc = JSON.parse(sections[0].body);
+  
+  T(doc._attachments['foo.txt'].stub == true);
+  T(doc._attachments['bar.txt'].follows == true);
+  
+  TEquals("this is 18 chars l", sections[1].body, "should be 18 chars long 4");
+
+  // check that with the document multipart/mixed API it's possible to receive
+  // attachments in compressed form (if they're stored in compressed form)
+
+  var server_config = [
+    {
+      section: "attachments",
+      key: "compression_level",
+      value: "8"
+    },
+    {
+      section: "attachments",
+      key: "compressible_types",
+      value: "text/plain"
+    }
+  ];
+
+  function testMultipartAttCompression() {
+    var doc = { _id: "foobar" };
+    var lorem =
+      CouchDB.request("GET", "/_utils/script/test/lorem.txt").responseText;
+    var helloData = "hello world";
+
+    TEquals(true, db.save(doc).ok);
+
+    var firstRev = doc._rev;
+    var xhr = CouchDB.request(
+      "PUT",
+      "/" + db.name + "/" + doc._id + "/data.bin?rev=" + firstRev,
+      {
+        body: helloData,
+        headers: {"Content-Type": "application/binary"}
+      }
+    );
+    TEquals(201, xhr.status);
+
+    var secondRev = db.open(doc._id)._rev;
+    xhr = CouchDB.request(
+      "PUT",
+      "/" + db.name + "/" + doc._id + "/lorem.txt?rev=" + secondRev,
+      {
+        body: lorem,
+        headers: {"Content-Type": "text/plain"}
+      }
+    );
+    TEquals(201, xhr.status);
+
+    var thirdRev = db.open(doc._id)._rev;
+
+    xhr = CouchDB.request(
+      "GET",
+      '/' + db.name + '/' + doc._id + '?open_revs=["' + thirdRev + '"]',
+      {
+        headers: {
+          "Accept": "multipart/mixed",
+          "X-CouchDB-Send-Encoded-Atts": "true"
+        }
+      }
+    );
+    TEquals(200, xhr.status);
+
+    var sections = parseMultipart(xhr);
+    // 1 section, with a multipart/related Content-Type
+    TEquals(1, sections.length);
+    TEquals(0,
+      sections[0].headers['Content-Type'].indexOf('multipart/related;'));
+
+    var innerSections = parseMultipart(sections[0]);
+    // 3 inner sections: a document body section plus 2 attachment data sections
+    TEquals(3, innerSections.length);
+    TEquals('application/json', innerSections[0].headers['Content-Type']);
+
+    doc = JSON.parse(innerSections[0].body);
+
+    TEquals(true, doc._attachments['lorem.txt'].follows);
+    TEquals("gzip", doc._attachments['lorem.txt'].encoding);
+    TEquals(true, doc._attachments['data.bin'].follows);
+    T(doc._attachments['data.bin'] !== "gzip");
+
+    if (innerSections[1].body === helloData) {
+      T(innerSections[2].body !== lorem);
+    } else if (innerSections[2].body === helloData) {
+      T(innerSections[1].body !== lorem);
+    } else {
+      T(false, "Could not found data.bin attachment data");
+    }
+
+    // now test that it works together with the atts_since parameter
+
+    xhr = CouchDB.request(
+      "GET",
+      '/' + db.name + '/' + doc._id + '?open_revs=["' + thirdRev + '"]' +
+        '&atts_since=["' + secondRev + '"]',
+      {
+        headers: {
+          "Accept": "multipart/mixed",
+          "X-CouchDB-Send-Encoded-Atts": "true"
+        }
+      }
+    );
+    TEquals(200, xhr.status);
+
+    sections = parseMultipart(xhr);
+    // 1 section, with a multipart/related Content-Type
+    TEquals(1, sections.length);
+    TEquals(0,
+      sections[0].headers['Content-Type'].indexOf('multipart/related;'));
+
+    innerSections = parseMultipart(sections[0]);
+    // 2 inner sections: a document body section plus 1 attachment data section
+    TEquals(2, innerSections.length);
+    TEquals('application/json', innerSections[0].headers['Content-Type']);
+
+    doc = JSON.parse(innerSections[0].body);
+
+    TEquals(true, doc._attachments['lorem.txt'].follows);
+    TEquals("gzip", doc._attachments['lorem.txt'].encoding);
+    TEquals("undefined", typeof doc._attachments['data.bin'].follows);
+    TEquals(true, doc._attachments['data.bin'].stub);
+    T(innerSections[1].body !== lorem);
+  }
+
+  run_on_modified_server(server_config, testMultipartAttCompression);
+
+  // cleanup
+  db.deleteDb();
+};

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/test/auth_cache.js
----------------------------------------------------------------------
diff --git a/share/test/auth_cache.js b/share/test/auth_cache.js
new file mode 100644
index 0000000..39b9887
--- /dev/null
+++ b/share/test/auth_cache.js
@@ -0,0 +1,269 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License.  You may obtain a copy
+// of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+// License for the specific language governing permissions and limitations under
+// the License.
+
+couchTests.auth_cache = function(debug) {
+
+  if (debug) debugger;
+
+  // Simple secret key generator
+  function generateSecret(length) {
+    var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" +
+              "0123456789+/";
+    var secret = '';
+    for (var i = 0; i < length; i++) {
+      secret += tab.charAt(Math.floor(Math.random() * 64));
+    }
+    return secret;
+  }
+
+  var authDb = new CouchDB("test_suite_users", {"X-Couch-Full-Commit":"false"});
+  var server_config = [
+    {
+      section: "couch_httpd_auth",
+      key: "authentication_db",
+      value: authDb.name
+    },
+    {
+      section: "couch_httpd_auth",
+      key: "auth_cache_size",
+      value: "3"
+    },
+    {
+      section: "httpd",
+      key: "authentication_handlers",
+      value: "{couch_httpd_auth, default_authentication_handler}"
+    },
+    {
+      section: "couch_httpd_auth",
+      key: "secret",
+      value: generateSecret(64)
+    }
+  ];
+
+
+  function hits() {
+    var hits = CouchDB.requestStats(["couchdb", "auth_cache_hits"], true);
+    return hits.value || 0;
+  }
+
+
+  function misses() {
+    var misses = CouchDB.requestStats(["couchdb", "auth_cache_misses"], true);
+    return misses.value || 0;
+  }
+
+
+  function testFun() {
+    var hits_before,
+        misses_before,
+        hits_after,
+        misses_after;
+
+    var fdmanana = CouchDB.prepareUserDoc({
+      name: "fdmanana",
+      roles: ["dev"]
+    }, "qwerty");
+
+    T(authDb.save(fdmanana).ok);
+
+    var chris = CouchDB.prepareUserDoc({
+      name: "chris",
+      roles: ["dev", "mafia", "white_costume"]
+    }, "the_god_father");
+
+    T(authDb.save(chris).ok);
+
+    var joe = CouchDB.prepareUserDoc({
+      name: "joe",
+      roles: ["erlnager"]
+    }, "functional");
+
+    T(authDb.save(joe).ok);
+
+    var johndoe = CouchDB.prepareUserDoc({
+      name: "johndoe",
+      roles: ["user"]
+    }, "123456");
+
+    T(authDb.save(johndoe).ok);
+
+    hits_before = hits();
+    misses_before = misses();
+
+    T(CouchDB.login("fdmanana", "qwerty").ok);
+    T(CouchDB.logout().ok);
+
+    hits_after = hits();
+    misses_after = misses();
+
+    T(misses_after === (misses_before + 1));
+    T(hits_after === hits_before);
+
+    hits_before = hits_after;
+    misses_before = misses_after;
+
+    T(CouchDB.login("fdmanana", "qwerty").ok);
+    T(CouchDB.logout().ok);
+
+    hits_after = hits();
+    misses_after = misses();
+
+    T(misses_after === misses_before);
+    T(hits_after === (hits_before + 1));
+
+    hits_before = hits_after;
+    misses_before = misses_after;
+
+    T(CouchDB.login("chris", "the_god_father").ok);
+    T(CouchDB.logout().ok);
+
+    hits_after = hits();
+    misses_after = misses();
+
+    T(misses_after === (misses_before + 1));
+    T(hits_after === hits_before);
+
+    hits_before = hits_after;
+    misses_before = misses_after;
+
+    T(CouchDB.login("joe", "functional").ok);
+    T(CouchDB.logout().ok);
+
+    hits_after = hits();
+    misses_after = misses();
+
+    T(misses_after === (misses_before + 1));
+    T(hits_after === hits_before);
+
+    hits_before = hits_after;
+    misses_before = misses_after;
+
+    T(CouchDB.login("johndoe", "123456").ok);
+    T(CouchDB.logout().ok);
+
+    hits_after = hits();
+    misses_after = misses();
+
+    T(misses_after === (misses_before + 1));
+    T(hits_after === hits_before);
+
+    hits_before = hits_after;
+    misses_before = misses_after;
+
+    T(CouchDB.login("joe", "functional").ok);
+    T(CouchDB.logout().ok);
+
+    hits_after = hits();
+    misses_after = misses();
+
+    // it's an MRU cache, joe was removed from cache to add johndoe
+    T(misses_after === (misses_before + 1));
+    T(hits_after === hits_before);
+
+    hits_before = hits_after;
+    misses_before = misses_after;
+
+    T(CouchDB.login("fdmanana", "qwerty").ok);
+    T(CouchDB.logout().ok);
+
+    hits_after = hits();
+    misses_after = misses();
+
+    T(misses_after === misses_before);
+    T(hits_after === (hits_before + 1));
+
+    hits_before = hits_after;
+    misses_before = misses_after;
+
+    fdmanana.password = "foobar";
+    T(authDb.save(fdmanana).ok);
+
+    // cache was refreshed
+    T(CouchDB.login("fdmanana", "qwerty").error === "unauthorized");
+    T(CouchDB.login("fdmanana", "foobar").ok);
+    T(CouchDB.logout().ok);
+
+    hits_after = hits();
+    misses_after = misses();
+
+    T(misses_after === misses_before);
+    T(hits_after === (hits_before + 2));
+
+    hits_before = hits_after;
+    misses_before = misses_after;
+
+    // and yet another update
+    fdmanana.password = "javascript";
+    T(authDb.save(fdmanana).ok);
+
+    // cache was refreshed
+    T(CouchDB.login("fdmanana", "foobar").error === "unauthorized");
+    T(CouchDB.login("fdmanana", "javascript").ok);
+    T(CouchDB.logout().ok);
+
+    hits_after = hits();
+    misses_after = misses();
+
+    T(misses_after === misses_before);
+    T(hits_after === (hits_before + 2));
+
+    T(authDb.deleteDoc(fdmanana).ok);
+
+    hits_before = hits_after;
+    misses_before = misses_after;
+
+    T(CouchDB.login("fdmanana", "javascript").error === "unauthorized");
+
+    hits_after = hits();
+    misses_after = misses();
+
+    T(misses_after === misses_before);
+    T(hits_after === (hits_before + 1));
+
+    // login, compact authentication DB, login again and verify that
+    // there was a cache hit
+    hits_before = hits_after;
+    misses_before = misses_after;
+
+    T(CouchDB.login("johndoe", "123456").ok);
+    T(CouchDB.logout().ok);
+
+    hits_after = hits();
+    misses_after = misses();
+
+    T(misses_after === (misses_before + 1));
+    T(hits_after === hits_before);
+
+    T(authDb.compact().ok);
+
+    while (authDb.info().compact_running);
+
+    hits_before = hits_after;
+    misses_before = misses_after;
+
+    T(CouchDB.login("johndoe", "123456").ok);
+    T(CouchDB.logout().ok);
+
+    hits_after = hits();
+    misses_after = misses();
+
+    T(misses_after === misses_before);
+    T(hits_after === (hits_before + 1));
+  }
+
+
+  authDb.deleteDb();
+  run_on_modified_server(server_config, testFun);
+
+  // cleanup
+  authDb.deleteDb();
+}

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/test/basics.js
----------------------------------------------------------------------
diff --git a/share/test/basics.js b/share/test/basics.js
new file mode 100644
index 0000000..993456c
--- /dev/null
+++ b/share/test/basics.js
@@ -0,0 +1,290 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+
+// Do some basic tests.
+couchTests.basics = function(debug) {
+  var result = JSON.parse(CouchDB.request("GET", "/").responseText);
+  T(result.couchdb == "Welcome");
+
+  var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"});
+  db.deleteDb();
+
+  // bug COUCHDB-100: DELETE on non-existent DB returns 500 instead of 404
+  db.deleteDb();
+
+  db.createDb();
+
+  // PUT on existing DB should return 412 instead of 500
+  xhr = CouchDB.request("PUT", "/test_suite_db/");
+  T(xhr.status == 412);
+  if (debug) debugger;
+
+  // creating a new DB should return Location header
+  // and it should work for dbs with slashes (COUCHDB-411)
+  var dbnames = ["test_suite_db", "test_suite_db%2Fwith_slashes"];
+  dbnames.forEach(function(dbname) {
+    xhr = CouchDB.request("DELETE", "/" + dbname);
+    xhr = CouchDB.request("PUT", "/" + dbname);
+    TEquals(dbname,
+      xhr.getResponseHeader("Location").substr(-dbname.length),
+      "should return Location header to newly created document");
+    TEquals(CouchDB.protocol,
+      xhr.getResponseHeader("Location").substr(0, CouchDB.protocol.length),
+      "should return absolute Location header to newly created document");
+  });
+
+  // Get the database info, check the db_name
+  T(db.info().db_name == "test_suite_db");
+  T(CouchDB.allDbs().indexOf("test_suite_db") != -1);
+
+  // Get the database info, check the doc_count
+  T(db.info().doc_count == 0);
+
+  // create a document and save it to the database
+  var doc = {_id:"0",a:1,b:1};
+  var result = db.save(doc);
+
+  T(result.ok==true); // return object has an ok member with a value true
+  T(result.id); // the _id of the document is set.
+  T(result.rev); // the revision id of the document is set.
+
+  // Verify the input doc is now set with the doc id and rev
+  // (for caller convenience).
+  T(doc._id == result.id && doc._rev == result.rev);
+
+  var id = result.id; // save off the id for later
+
+  // make sure the revs_info status is good
+  var doc = db.open(id, {revs_info:true});
+  T(doc._revs_info[0].status == "available");
+
+  // make sure you can do a seq=true option
+  var doc = db.open(id, {local_seq:true});
+  T(doc._local_seq == 1);
+
+
+  // Create some more documents.
+  // Notice the use of the ok member on the return result.
+  T(db.save({_id:"1",a:2,b:4}).ok);
+  T(db.save({_id:"2",a:3,b:9}).ok);
+  T(db.save({_id:"3",a:4,b:16}).ok);
+
+  // Check the database doc count
+  T(db.info().doc_count == 4);
+
+  // COUCHDB-954
+  var oldRev = db.save({_id:"COUCHDB-954", a:1}).rev;
+  var newRev = db.save({_id:"COUCHDB-954", _rev:oldRev}).rev;
+
+  // test behavior of open_revs with explicit revision list
+  var result = db.open("COUCHDB-954", {open_revs:[oldRev,newRev]});
+  T(result.length == 2, "should get two revisions back");
+  T(result[0].ok);
+  T(result[1].ok);
+
+  // latest=true suppresses non-leaf revisions
+  var result = db.open("COUCHDB-954", {open_revs:[oldRev,newRev], latest:true});
+  T(result.length == 1, "should only get the child revision with latest=true");
+  T(result[0].ok._rev == newRev, "should get the child and not the parent");
+
+  // latest=true returns a child when you ask for a parent
+  var result = db.open("COUCHDB-954", {open_revs:[oldRev], latest:true});
+  T(result[0].ok._rev == newRev, "should get child when we requested parent");
+
+  // clean up after ourselves
+  db.save({_id:"COUCHDB-954", _rev:newRev, _deleted:true});
+
+  // Test a simple map functions
+
+  // create a map function that selects all documents whose "a" member
+  // has a value of 4, and then returns the document's b value.
+  var mapFunction = function(doc){
+    if (doc.a==4)
+      emit(null, doc.b);
+  };
+
+  var results = db.query(mapFunction);
+
+  // verify only one document found and the result value (doc.b).
+  T(results.total_rows == 1 && results.rows[0].value == 16);
+
+  // reopen document we saved earlier
+  var existingDoc = db.open(id);
+
+  T(existingDoc.a==1);
+
+  //modify and save
+  existingDoc.a=4;
+  db.save(existingDoc);
+
+  // redo the map query
+  results = db.query(mapFunction);
+
+  // the modified document should now be in the results.
+  T(results.total_rows == 2);
+
+  // write 2 more documents
+  T(db.save({a:3,b:9}).ok);
+  T(db.save({a:4,b:16}).ok);
+
+  results = db.query(mapFunction);
+
+  // 1 more document should now be in the result.
+  T(results.total_rows == 3);
+  T(db.info().doc_count == 6);
+
+  var reduceFunction = function(keys, values){
+    return sum(values);
+  };
+
+  results = db.query(mapFunction, reduceFunction);
+
+  T(results.rows[0].value == 33);
+
+  // delete a document
+  T(db.deleteDoc(existingDoc).ok);
+
+  // make sure we can't open the doc
+  T(db.open(existingDoc._id) == null);
+
+  results = db.query(mapFunction);
+
+  // 1 less document should now be in the results.
+  T(results.total_rows == 2);
+  T(db.info().doc_count == 5);
+
+  // make sure we can still open the old rev of the deleted doc
+  T(db.open(existingDoc._id, {rev: existingDoc._rev}) != null);
+  // make sure restart works
+  T(db.ensureFullCommit().ok);
+  restartServer();
+
+  // make sure we can still open
+  T(db.open(existingDoc._id, {rev: existingDoc._rev}) != null);
+
+  // test that the POST response has a Location header
+  var xhr = CouchDB.request("POST", "/test_suite_db", {
+    body: JSON.stringify({"foo":"bar"}),
+    headers: {"Content-Type": "application/json"}
+  });
+  var resp = JSON.parse(xhr.responseText);
+  T(resp.ok);
+  var loc = xhr.getResponseHeader("Location");
+  T(loc, "should have a Location header");
+  var locs = loc.split('/');
+  T(locs[locs.length-1] == resp.id);
+  T(locs[locs.length-2] == "test_suite_db");
+
+  // test that that POST's with an _id aren't overriden with a UUID.
+  var xhr = CouchDB.request("POST", "/test_suite_db", {
+    headers: {"Content-Type": "application/json"},
+    body: JSON.stringify({"_id": "oppossum", "yar": "matey"})
+  });
+  var resp = JSON.parse(xhr.responseText);
+  T(resp.ok);
+  T(resp.id == "oppossum");
+  var doc = db.open("oppossum");
+  T(doc.yar == "matey");
+
+  // document put's should return a Location header
+  var xhr = CouchDB.request("PUT", "/test_suite_db/newdoc", {
+    body: JSON.stringify({"a":1})
+  });
+  TEquals("/test_suite_db/newdoc",
+    xhr.getResponseHeader("Location").substr(-21),
+    "should return Location header to newly created document");
+  TEquals(CouchDB.protocol,
+    xhr.getResponseHeader("Location").substr(0, CouchDB.protocol.length),
+    "should return absolute Location header to newly created document");
+
+  // deleting a non-existent doc should be 404
+  xhr = CouchDB.request("DELETE", "/test_suite_db/doc-does-not-exist");
+  T(xhr.status == 404);
+
+  // Check for invalid document members
+  var bad_docs = [
+    ["goldfish", {"_zing": 4}],
+    ["zebrafish", {"_zoom": "hello"}],
+    ["mudfish", {"zane": "goldfish", "_fan": "something smells delicious"}],
+    ["tastyfish", {"_bing": {"wha?": "soda can"}}]
+  ];
+  var test_doc = function(info) {
+  var data = JSON.stringify(info[1]);
+    xhr = CouchDB.request("PUT", "/test_suite_db/" + info[0], {body: data});
+    T(xhr.status == 500);
+    result = JSON.parse(xhr.responseText);
+    T(result.error == "doc_validation");
+
+    xhr = CouchDB.request("POST", "/test_suite_db/", {
+      headers: {"Content-Type": "application/json"},
+      body: data
+    });
+    T(xhr.status == 500);
+    result = JSON.parse(xhr.responseText);
+    T(result.error == "doc_validation");
+  };
+  bad_docs.forEach(test_doc);
+
+  // Check some common error responses.
+  // PUT body not an object
+  xhr = CouchDB.request("PUT", "/test_suite_db/bar", {body: "[]"});
+  T(xhr.status == 400);
+  result = JSON.parse(xhr.responseText);
+  T(result.error == "bad_request");
+  T(result.reason == "Document must be a JSON object");
+
+  // Body of a _bulk_docs is not an object
+  xhr = CouchDB.request("POST", "/test_suite_db/_bulk_docs", {body: "[]"});
+  T(xhr.status == 400);
+  result = JSON.parse(xhr.responseText);
+  T(result.error == "bad_request");
+  T(result.reason == "Request body must be a JSON object");
+
+  // Body of an _all_docs  multi-get is not a {"key": [...]} structure.
+  xhr = CouchDB.request("POST", "/test_suite_db/_all_docs", {body: "[]"});
+  T(xhr.status == 400);
+  result = JSON.parse(xhr.responseText);
+  T(result.error == "bad_request");
+  T(result.reason == "Request body must be a JSON object");
+  var data = "{\"keys\": 1}";
+  xhr = CouchDB.request("POST", "/test_suite_db/_all_docs", {body:data});
+  T(xhr.status == 400);
+  result = JSON.parse(xhr.responseText);
+  T(result.error == "bad_request");
+  T(result.reason == "`keys` member must be a array.");
+
+  // oops, the doc id got lost in code nirwana
+  xhr = CouchDB.request("DELETE", "/test_suite_db/?rev=foobarbaz");
+  TEquals(400, xhr.status, "should return a bad request");
+  result = JSON.parse(xhr.responseText);
+  TEquals("bad_request", result.error);
+  TEquals("You tried to DELETE a database with a ?rev= parameter. Did you mean to DELETE a document instead?", result.reason);
+
+  // On restart, a request for creating a database that already exists can
+  // not override the existing database file
+  db = new CouchDB("test_suite_foobar");
+  db.deleteDb();
+  xhr = CouchDB.request("PUT", "/" + db.name);
+  TEquals(201, xhr.status);
+
+  TEquals(true, db.save({"_id": "doc1"}).ok);
+  TEquals(true, db.ensureFullCommit().ok);
+
+  TEquals(1, db.info().doc_count);
+
+  restartServer();
+
+  xhr = CouchDB.request("PUT", "/" + db.name);
+  TEquals(412, xhr.status);
+
+  TEquals(1, db.info().doc_count);
+};

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/test/batch_save.js
----------------------------------------------------------------------
diff --git a/share/test/batch_save.js b/share/test/batch_save.js
new file mode 100644
index 0000000..a1b0019
--- /dev/null
+++ b/share/test/batch_save.js
@@ -0,0 +1,48 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+
+couchTests.batch_save = function(debug) {
+  var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"});
+  db.deleteDb();
+  db.createDb();
+  if (debug) debugger;
+
+  var i
+  for(i=0; i < 100; i++) {
+    T(db.save({_id:i.toString(),a:i,b:i},  {batch : "ok"}).ok);
+    
+    // test that response is 202 Accepted
+    T(db.last_req.status == 202);
+  }
+  
+  for(i=0; i < 100; i++) {
+    // attempt to save the same document a bunch of times
+    T(db.save({_id:"foo",a:i,b:i},  {batch : "ok"}).ok);
+    
+    // test that response is 202 Accepted
+    T(db.last_req.status == 202);
+  }
+  
+  while(db.allDocs().total_rows != 101){};
+
+  // repeat the tests for POST
+  for(i=0; i < 100; i++) {
+    var resp = db.request("POST", db.uri + "?batch=ok", {
+      headers: {"Content-Type": "application/json"},
+      body: JSON.stringify({a:1})
+    });
+    T(JSON.parse(resp.responseText).ok);
+  }
+  
+  while(db.allDocs().total_rows != 201){};
+
+};

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/test/bulk_docs.js
----------------------------------------------------------------------
diff --git a/share/test/bulk_docs.js b/share/test/bulk_docs.js
new file mode 100644
index 0000000..27a97c8
--- /dev/null
+++ b/share/test/bulk_docs.js
@@ -0,0 +1,124 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+
+couchTests.bulk_docs = function(debug) {
+  var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"});
+  db.deleteDb();
+  db.createDb();
+  if (debug) debugger;
+
+  var docs = makeDocs(5);
+
+  // Create the docs
+  var results = db.bulkSave(docs);
+
+  T(results.length == 5);
+  for (var i = 0; i < 5; i++) {
+    T(results[i].id == docs[i]._id);
+    T(results[i].rev);
+    // Update the doc
+    docs[i].string = docs[i].string + ".00";
+  }
+
+  // Save the docs
+  results = db.bulkSave(docs);
+  T(results.length == 5);
+  for (i = 0; i < 5; i++) {
+    T(results[i].id == i.toString());
+
+    // set the delete flag to delete the docs in the next step
+    docs[i]._deleted = true;
+  }
+
+  // now test a bulk update with a conflict
+  // open and save
+  var doc = db.open("0");
+  db.save(doc);
+
+  // Now bulk delete the docs
+  results = db.bulkSave(docs);
+
+  // doc "0" should be a conflict
+  T(results.length == 5);
+  T(results[0].id == "0");
+  T(results[0].error == "conflict");
+  T(typeof results[0].rev === "undefined"); // no rev member when a conflict
+
+  // but the rest are not
+  for (i = 1; i < 5; i++) {
+    T(results[i].id == i.toString());
+    T(results[i].rev);
+    T(db.open(docs[i]._id) == null);
+  }
+
+  // now force a conflict to to save
+
+  // save doc 0, this will cause a conflict when we save docs[0]
+  var doc = db.open("0");
+  docs[0] = db.open("0");
+  db.save(doc);
+
+  docs[0].shooby = "dooby";
+
+  // Now save the bulk docs, When we use all_or_nothing, we don't get conflict
+  // checking, all docs are saved regardless of conflict status, or none are
+  // saved.
+  results = db.bulkSave(docs,{all_or_nothing:true});
+  T(results.error === undefined);
+
+  var doc = db.open("0", {conflicts:true});
+  var docConflict = db.open("0", {rev:doc._conflicts[0]});
+
+  T(doc.shooby == "dooby" || docConflict.shooby == "dooby");
+
+  // verify creating a document with no id returns a new id
+  var req = CouchDB.request("POST", "/test_suite_db/_bulk_docs", {
+    body: JSON.stringify({"docs": [{"foo":"bar"}]})
+  });
+  results = JSON.parse(req.responseText);
+
+  T(results[0].id != "");
+  T(results[0].rev != "");
+
+
+  // Regression test for failure on update/delete
+  var newdoc = {"_id": "foobar", "body": "baz"};
+  T(db.save(newdoc).ok);
+  var update = {"_id": newdoc._id, "_rev": newdoc._rev, "body": "blam"};
+  var torem = {"_id": newdoc._id, "_rev": newdoc._rev, "_deleted": true};
+  results = db.bulkSave([update, torem]);
+  T(results[0].error == "conflict" || results[1].error == "conflict");
+
+
+  // verify that sending a request with no docs causes error thrown
+  var req = CouchDB.request("POST", "/test_suite_db/_bulk_docs", {
+    body: JSON.stringify({"doc": [{"foo":"bar"}]})
+  });
+
+  T(req.status == 400 );
+  result = JSON.parse(req.responseText);
+  T(result.error == "bad_request");
+  T(result.reason == "Missing JSON list of 'docs'");
+
+  // jira-911
+  db.deleteDb();
+  db.createDb();
+  docs = [];
+  docs.push({"_id":"0", "a" : 0});
+  docs.push({"_id":"1", "a" : 1});
+  docs.push({"_id":"1", "a" : 2});
+  docs.push({"_id":"3", "a" : 3});
+  results = db.bulkSave(docs);
+  T(results[1].id == "1");
+  T(results[1].error == undefined);
+  T(results[2].error == "conflict");
+};


[27/37] goodbye Futon, old friend <3

Posted by ja...@apache.org.
http://git-wip-us.apache.org/repos/asf/couchdb/blob/cca309f3/share/www/image/add.png
----------------------------------------------------------------------
diff --git a/share/www/image/add.png b/share/www/image/add.png
deleted file mode 100644
index 34e8c7d..0000000
Binary files a/share/www/image/add.png and /dev/null differ

http://git-wip-us.apache.org/repos/asf/couchdb/blob/cca309f3/share/www/image/apply.gif
----------------------------------------------------------------------
diff --git a/share/www/image/apply.gif b/share/www/image/apply.gif
deleted file mode 100644
index 63de0d5..0000000
Binary files a/share/www/image/apply.gif and /dev/null differ

http://git-wip-us.apache.org/repos/asf/couchdb/blob/cca309f3/share/www/image/bg.png
----------------------------------------------------------------------
diff --git a/share/www/image/bg.png b/share/www/image/bg.png
deleted file mode 100644
index ec81524..0000000
Binary files a/share/www/image/bg.png and /dev/null differ

http://git-wip-us.apache.org/repos/asf/couchdb/blob/cca309f3/share/www/image/cancel.gif
----------------------------------------------------------------------
diff --git a/share/www/image/cancel.gif b/share/www/image/cancel.gif
deleted file mode 100644
index 4329076..0000000
Binary files a/share/www/image/cancel.gif and /dev/null differ

http://git-wip-us.apache.org/repos/asf/couchdb/blob/cca309f3/share/www/image/compact.png
----------------------------------------------------------------------
diff --git a/share/www/image/compact.png b/share/www/image/compact.png
deleted file mode 100644
index ea8985d..0000000
Binary files a/share/www/image/compact.png and /dev/null differ

http://git-wip-us.apache.org/repos/asf/couchdb/blob/cca309f3/share/www/image/delete-mini.png
----------------------------------------------------------------------
diff --git a/share/www/image/delete-mini.png b/share/www/image/delete-mini.png
deleted file mode 100644
index ad5588d..0000000
Binary files a/share/www/image/delete-mini.png and /dev/null differ

http://git-wip-us.apache.org/repos/asf/couchdb/blob/cca309f3/share/www/image/delete.png
----------------------------------------------------------------------
diff --git a/share/www/image/delete.png b/share/www/image/delete.png
deleted file mode 100644
index e838401..0000000
Binary files a/share/www/image/delete.png and /dev/null differ

http://git-wip-us.apache.org/repos/asf/couchdb/blob/cca309f3/share/www/image/grippie.gif
----------------------------------------------------------------------
diff --git a/share/www/image/grippie.gif b/share/www/image/grippie.gif
deleted file mode 100644
index a880789..0000000
Binary files a/share/www/image/grippie.gif and /dev/null differ

http://git-wip-us.apache.org/repos/asf/couchdb/blob/cca309f3/share/www/image/hgrad.gif
----------------------------------------------------------------------
diff --git a/share/www/image/hgrad.gif b/share/www/image/hgrad.gif
deleted file mode 100644
index 08aa80c..0000000
Binary files a/share/www/image/hgrad.gif and /dev/null differ

http://git-wip-us.apache.org/repos/asf/couchdb/blob/cca309f3/share/www/image/key.png
----------------------------------------------------------------------
diff --git a/share/www/image/key.png b/share/www/image/key.png
deleted file mode 100644
index e04ed10..0000000
Binary files a/share/www/image/key.png and /dev/null differ

http://git-wip-us.apache.org/repos/asf/couchdb/blob/cca309f3/share/www/image/load.png
----------------------------------------------------------------------
diff --git a/share/www/image/load.png b/share/www/image/load.png
deleted file mode 100644
index 07b4f79..0000000
Binary files a/share/www/image/load.png and /dev/null differ

http://git-wip-us.apache.org/repos/asf/couchdb/blob/cca309f3/share/www/image/logo.png
----------------------------------------------------------------------
diff --git a/share/www/image/logo.png b/share/www/image/logo.png
deleted file mode 100644
index d21ac02..0000000
Binary files a/share/www/image/logo.png and /dev/null differ

http://git-wip-us.apache.org/repos/asf/couchdb/blob/cca309f3/share/www/image/order-asc.gif
----------------------------------------------------------------------
diff --git a/share/www/image/order-asc.gif b/share/www/image/order-asc.gif
deleted file mode 100644
index d2a237a..0000000
Binary files a/share/www/image/order-asc.gif and /dev/null differ

http://git-wip-us.apache.org/repos/asf/couchdb/blob/cca309f3/share/www/image/order-desc.gif
----------------------------------------------------------------------
diff --git a/share/www/image/order-desc.gif b/share/www/image/order-desc.gif
deleted file mode 100644
index 1043b49..0000000
Binary files a/share/www/image/order-desc.gif and /dev/null differ

http://git-wip-us.apache.org/repos/asf/couchdb/blob/cca309f3/share/www/image/path.gif
----------------------------------------------------------------------
diff --git a/share/www/image/path.gif b/share/www/image/path.gif
deleted file mode 100644
index 01ec717..0000000
Binary files a/share/www/image/path.gif and /dev/null differ

http://git-wip-us.apache.org/repos/asf/couchdb/blob/cca309f3/share/www/image/progress.gif
----------------------------------------------------------------------
diff --git a/share/www/image/progress.gif b/share/www/image/progress.gif
deleted file mode 100644
index d84f653..0000000
Binary files a/share/www/image/progress.gif and /dev/null differ

http://git-wip-us.apache.org/repos/asf/couchdb/blob/cca309f3/share/www/image/rarrow.png
----------------------------------------------------------------------
diff --git a/share/www/image/rarrow.png b/share/www/image/rarrow.png
deleted file mode 100644
index 507e87e..0000000
Binary files a/share/www/image/rarrow.png and /dev/null differ

http://git-wip-us.apache.org/repos/asf/couchdb/blob/cca309f3/share/www/image/run-mini.png
----------------------------------------------------------------------
diff --git a/share/www/image/run-mini.png b/share/www/image/run-mini.png
deleted file mode 100644
index b2fcbd8..0000000
Binary files a/share/www/image/run-mini.png and /dev/null differ

http://git-wip-us.apache.org/repos/asf/couchdb/blob/cca309f3/share/www/image/run.png
----------------------------------------------------------------------
diff --git a/share/www/image/run.png b/share/www/image/run.png
deleted file mode 100644
index a1d79f6..0000000
Binary files a/share/www/image/run.png and /dev/null differ

http://git-wip-us.apache.org/repos/asf/couchdb/blob/cca309f3/share/www/image/running.png
----------------------------------------------------------------------
diff --git a/share/www/image/running.png b/share/www/image/running.png
deleted file mode 100644
index 9b50cd6..0000000
Binary files a/share/www/image/running.png and /dev/null differ

http://git-wip-us.apache.org/repos/asf/couchdb/blob/cca309f3/share/www/image/save.png
----------------------------------------------------------------------
diff --git a/share/www/image/save.png b/share/www/image/save.png
deleted file mode 100644
index a04e4bc..0000000
Binary files a/share/www/image/save.png and /dev/null differ

http://git-wip-us.apache.org/repos/asf/couchdb/blob/cca309f3/share/www/image/sidebar-toggle.png
----------------------------------------------------------------------
diff --git a/share/www/image/sidebar-toggle.png b/share/www/image/sidebar-toggle.png
deleted file mode 100644
index 3ea32ff..0000000
Binary files a/share/www/image/sidebar-toggle.png and /dev/null differ

http://git-wip-us.apache.org/repos/asf/couchdb/blob/cca309f3/share/www/image/spinner.gif
----------------------------------------------------------------------
diff --git a/share/www/image/spinner.gif b/share/www/image/spinner.gif
deleted file mode 100644
index 6239655..0000000
Binary files a/share/www/image/spinner.gif and /dev/null differ

http://git-wip-us.apache.org/repos/asf/couchdb/blob/cca309f3/share/www/image/spinner_33.gif
----------------------------------------------------------------------
diff --git a/share/www/image/spinner_33.gif b/share/www/image/spinner_33.gif
deleted file mode 100644
index 5ad5192..0000000
Binary files a/share/www/image/spinner_33.gif and /dev/null differ

http://git-wip-us.apache.org/repos/asf/couchdb/blob/cca309f3/share/www/image/spinner_6b.gif
----------------------------------------------------------------------
diff --git a/share/www/image/spinner_6b.gif b/share/www/image/spinner_6b.gif
deleted file mode 100644
index 4e3d972..0000000
Binary files a/share/www/image/spinner_6b.gif and /dev/null differ

http://git-wip-us.apache.org/repos/asf/couchdb/blob/cca309f3/share/www/image/test_failure.gif
----------------------------------------------------------------------
diff --git a/share/www/image/test_failure.gif b/share/www/image/test_failure.gif
deleted file mode 100644
index 2a873b2..0000000
Binary files a/share/www/image/test_failure.gif and /dev/null differ

http://git-wip-us.apache.org/repos/asf/couchdb/blob/cca309f3/share/www/image/test_success.gif
----------------------------------------------------------------------
diff --git a/share/www/image/test_success.gif b/share/www/image/test_success.gif
deleted file mode 100644
index 6df8bae..0000000
Binary files a/share/www/image/test_success.gif and /dev/null differ

http://git-wip-us.apache.org/repos/asf/couchdb/blob/cca309f3/share/www/image/thead-key.gif
----------------------------------------------------------------------
diff --git a/share/www/image/thead-key.gif b/share/www/image/thead-key.gif
deleted file mode 100644
index 42a43b5..0000000
Binary files a/share/www/image/thead-key.gif and /dev/null differ

http://git-wip-us.apache.org/repos/asf/couchdb/blob/cca309f3/share/www/image/thead.gif
----------------------------------------------------------------------
diff --git a/share/www/image/thead.gif b/share/www/image/thead.gif
deleted file mode 100644
index 1587b1f..0000000
Binary files a/share/www/image/thead.gif and /dev/null differ

http://git-wip-us.apache.org/repos/asf/couchdb/blob/cca309f3/share/www/image/toggle-collapse.gif
----------------------------------------------------------------------
diff --git a/share/www/image/toggle-collapse.gif b/share/www/image/toggle-collapse.gif
deleted file mode 100644
index f097930..0000000
Binary files a/share/www/image/toggle-collapse.gif and /dev/null differ

http://git-wip-us.apache.org/repos/asf/couchdb/blob/cca309f3/share/www/image/toggle-expand.gif
----------------------------------------------------------------------
diff --git a/share/www/image/toggle-expand.gif b/share/www/image/toggle-expand.gif
deleted file mode 100644
index 03fa836..0000000
Binary files a/share/www/image/toggle-expand.gif and /dev/null differ

http://git-wip-us.apache.org/repos/asf/couchdb/blob/cca309f3/share/www/image/twisty.gif
----------------------------------------------------------------------
diff --git a/share/www/image/twisty.gif b/share/www/image/twisty.gif
deleted file mode 100644
index 5ba57a1..0000000
Binary files a/share/www/image/twisty.gif and /dev/null differ

http://git-wip-us.apache.org/repos/asf/couchdb/blob/cca309f3/share/www/index.html
----------------------------------------------------------------------
diff --git a/share/www/index.html b/share/www/index.html
deleted file mode 100644
index ecbe8dd..0000000
--- a/share/www/index.html
+++ /dev/null
@@ -1,94 +0,0 @@
-<!DOCTYPE html>
-<!--
-
-Licensed under the Apache License, Version 2.0 (the "License"); you may not use
-this file except in compliance with the License. You may obtain a copy of the
-License at
-
-   http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software distributed
-under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
-CONDITIONS OF ANY KIND, either express or implied. See the License for the
-specific language governing permissions and limitations under the License.
-
--->
-<html lang="en">
-  <head>
-    <title>Overview</title>
-    <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
-    <link rel="stylesheet" href="style/layout.css?0.11.0" type="text/css">
-    <script src="script/json2.js"></script>
-    <script src="script/sha1.js"></script>
-    <script src="script/jquery.js"></script>
-    <script src="script/jquery.couch.js"></script>
-    <script src="script/jquery.dialog.js"></script>
-    <script src="script/futon.js"></script>
-    <script src="script/futon.browse.js"></script>
-    <script src="script/futon.format.js"></script>
-    <script>
-      var page = new $.futon.CouchIndexPage();
-      $(document).ready(function() {
-        if (!/index\.html$/.test(location.pathname)) {
-          $.futon.navigation.ready(function() {
-            this.updateSelection(location.pathname + "index.html");
-          });
-        }
-        var dbsPerPage = parseInt($.futon.storage.get("per_page"));
-        if (dbsPerPage) $("#perpage").val(dbsPerPage);
-        $("#perpage").change(function() {
-          page.updateDatabaseListing();
-          $.futon.storage.set("per_page", this.value);
-        });
-
-        page.updateDatabaseListing();
-
-        $("#toolbar button.add").click(function() {
-          page.addDatabase();
-        });
-      });
-    </script>
-  </head>
-  <body>
-    <div id="wrap">
-      <h1><strong>Overview</strong></h1>
-      <div id="content">
-        <ul id="toolbar">
-          <li><button class="add">Create Database …</button></li>
-        </ul>
-
-        <table class="listing" id="databases" cellspacing="0">
-          <caption>Databases</caption>
-          <thead>
-            <tr>
-              <th>Name</th>
-              <th class="size">Size</th>
-              <th class="count">Number of Documents</th>
-              <th class="seq">Update Seq</th>
-            </tr>
-          </thead>
-          <tbody class="content">
-          </tbody>
-          <tbody class="footer">
-            <tr>
-              <td colspan="5">
-                <div id="paging">
-                  <a class="prev">← Previous Page</a> |
-                  <label>Rows per page: <select id="perpage">
-                    <option selected>10</option>
-                    <option>25</option>
-                    <option>50</option>
-                    <option>100</option>
-                  </select></label> |
-                  <a class="next">Next Page →</a>
-                </div>
-                <span></span>
-              </td>
-            </tr>
-          </tbody>
-        </table>
-      </div>
-
-    </div>
-  </body>
-</html>

http://git-wip-us.apache.org/repos/asf/couchdb/blob/cca309f3/share/www/plugins.html
----------------------------------------------------------------------
diff --git a/share/www/plugins.html b/share/www/plugins.html
deleted file mode 100644
index 7f8da53..0000000
--- a/share/www/plugins.html
+++ /dev/null
@@ -1,121 +0,0 @@
-<!DOCTYPE html>
-<!--
-
-Licensed under the Apache License, Version 2.0 (the "License"); you may not use
-this file except in compliance with the License. You may obtain a copy of the
-License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software distributed
-under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
-CONDITIONS OF ANY KIND, either express or implied. See the License for the
-specific language governing permissions and limitations under the License.
-
--->
-<html lang="en">
-  <head>
-    <title>Plugins</title>
-    <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
-    <link rel="stylesheet" href="style/layout.css?0.11.0" type="text/css">
-    <script src="script/json2.js"></script>
-    <script src="script/sha1.js"></script>
-    <script src="script/jquery.js"></script>
-    <script src="script/jquery.couch.js"></script>
-    <script src="script/jquery.dialog.js"></script>
-    <script src="script/futon.js"></script>
-  </head>
-  <body><div id="wrap">
-    <h1>
-      <a href="index.html">Overview</a>
-      <strong>Plugins</strong>
-    </h1>
-    <div id="content">
-      <div class="row">
-        <h2>GeoCouch</h2>
-        <p>Version: <strong>couchdb1.2.x_v0.3.0-11-g66e6219</strong></p>
-        <p>Author: Volker Mische</p>
-        <p>
-          Available Erlang Versions:
-          <ul>
-            <li>CouchDB 1.4.0-XXX R15B01</li>
-          </ul>
-        </p>
-        <p>
-          <button href="#" class="install-plugin" data-url="http://people.apache.org/~jan" data-checksums='{"1.4.0": {"R15B03":"D5QPhrJTAifM42DXqAj4RxzfEtI="}}' data-name="geocouch" data-version="couchdb1.2.x_v0.3.0-16-g66e6219">Install GeoCouch Now</button>
-        </p>
-      </div>
-      <div class="row">
-        <h2>CouchPerUser</h2>
-        <p>Version: <strong>1.0.0</strong></p>
-        <p>Author: Bob Ippolito</p>
-        <p>
-          Available Erlang Versions:
-          <ul>
-            <li>CouchDB 1.4.0-XXX R15B01</li>
-          </ul>
-        </p>
-        <p>
-          <button href="#" class="install-plugin" data-url="http://people.apache.org/~jan" data-checksums='{"1.4.0": {"R15B03":"Aj3mjC6M75NA62q5/xkP0tl8Hws="}}' data-name="couchperuser" data-version="1.0.0">Install CouchPerUser Now</button>
-        </p>
-      </div>
-    </div>
-  </div></body>
-  <script>
-    $('.install-plugin').each(function() {
-      var button = $(this);
-      var name = button.data('name');
-      var version = button.data('version');
-      $.get("/_config/plugins/" + name + "/", function(body, textStatus) {
-        body = JSON.parse(body);
-        if(body == version) {
-          button.html('Already Installed. Click to Uninstall');
-          button.data('delete', true);
-        } else {
-          button.html('Other Version Installed: ' + body);
-          button.attr('disabled', true);
-        }
-      });
-    });
-
-    $('.install-plugin').click(function(event) {
-      var button = $(this);
-      var delete_plugin = button.data('delete') || false;
-      var plugin_spec = JSON.stringify({
-        name: button.data('name'),
-        url: button.data('url'),
-        version: button.data('version'),
-        checksums: button.data('checksums'),
-        "delete": delete_plugin
-      });
-      var url = '/_plugins'
-      $.ajax({
-        url: url,
-        type: 'POST',
-        data: plugin_spec,
-        contentType: 'application/json', // what we send to the server
-        dataType: 'json', // expected from the server
-        processData: false, // keep our precious JSON
-        success: function(data, textStatus, jqXhr) {
-          if(textStatus == "success") {
-            var action = delete_plugin ? 'Uninstalled' : 'Installed';
-            button.html('Sucessfully ' + action);
-            button.attr('disabled', true);
-          } else {
-            button.html(textStatus);
-          }
-        },
-        beforeSend: function(xhr) {
-          xhr.setRequestHeader('Accept', 'application/json');
-        },
-      });
-    });
-  </script>
-  <style type="text/css">
-  .row {
-    background-color: #EEE;
-    padding:1em;
-    margin-bottom:1em;
-  }
-  </style>
-</html>

http://git-wip-us.apache.org/repos/asf/couchdb/blob/cca309f3/share/www/replicator.html
----------------------------------------------------------------------
diff --git a/share/www/replicator.html b/share/www/replicator.html
deleted file mode 100644
index eb6ecc0..0000000
--- a/share/www/replicator.html
+++ /dev/null
@@ -1,184 +0,0 @@
-<!DOCTYPE html>
-<!--
-
-Licensed under the Apache License, Version 2.0 (the "License"); you may not use
-this file except in compliance with the License. You may obtain a copy of the
-License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software distributed
-under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
-CONDITIONS OF ANY KIND, either express or implied. See the License for the
-specific language governing permissions and limitations under the License.
-
--->
-<html lang="en">
-  <head>
-    <title>Replicator</title>
-    <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
-    <link rel="stylesheet" href="style/layout.css?0.11.0" type="text/css">
-    <link rel="stylesheet" href="style/jquery-ui-1.8.11.custom.css" type="text/css">
-    <script src="script/json2.js"></script>
-    <script src="script/sha1.js"></script>
-    <script src="script/jquery.js"></script>
-    <script src="script/jquery.couch.js"></script>
-    <script src="script/jquery.dialog.js"></script>
-    <script src="script/futon.js"></script>
-    <script src="script/jquery-ui-1.8.11.custom.min.js"></script>
-    <script>
-      $(document).ready(function() {
-        var allDatabases;
-
-        $("fieldset input[type=radio]").click(function() {
-          var radio = this;
-          var fieldset = $(this).parents("fieldset").get(0);
-          $("input[type=text]", fieldset).each(function() {
-            this.disabled = radio.value == "local";
-            if (!this.disabled) this.focus();
-          });
-          $('.local', fieldset).each(function() {
-            this.disabled = radio.value == "remote";
-            if (!this.disabled) this.focus();
-          });
-        });
-
-        var getDatabases = function() {
-          $.couch.allDbs({
-            success: function(dbs) {
-              allDatabases = dbs.sort();
-
-              $("fieldset select").each(function() {
-                var select = this;
-                $.each(dbs, function(idx, dbName) {
-                  $("<option></option>").text(dbName).appendTo(select);
-                });
-                select.selectedIndex = 0;
-              });
-
-              $('#to_name').autocomplete({ source: dbs });
-            }
-          });
-        };
-        getDatabases();
-
-        $("button#swap").click(function() {
-          var fromName = $("#source select").val();
-          $("#source select").val($("#target select").val());
-          $("#target select").val(fromName);
-
-          var fromUrl = $("#source input[type=text]").val();
-          $("#source input[type=text]").val($("#target input[type=text]").val());
-          $("#target input[type=text]").val(fromUrl);
-
-          var fromType = $("#source input[type=radio]").filter(function() {
-            return this.checked;
-          }).val();
-          var toType = $("#target input[type=radio]").filter(function() {
-            return this.checked;
-          }).val();
-          $("#source input[value=" + toType + "]").click();
-          $("#target input[value=" + fromType + "]").click();
-
-          $("#replicate").get(0).focus();
-          return false;
-        });
-
-        $("button#replicate").click(function() {
-          $("#records tbody.content").empty();
-          var targetIsLocal = $('#to_local:checked').length > 0;
-          var source = $("#from_local")[0].checked ? $("#from_name").val() : $("#from_url").val();
-          var target = targetIsLocal ? $("#to_name").val() : $("#to_url").val();
-          var repOpts = {};
-
-          if (targetIsLocal && $.inArray(target, allDatabases) < 0) {
-            if(!confirm('This will create a database named '+target+'. Ok?')) {
-              return;
-            }
-            else {
-              repOpts.create_target = true;
-            }
-          }
-
-          if ($("#continuous")[0].checked) {
-            repOpts.continuous = true;
-          }
-          $.couch.replicate(source, target, {
-            success: function(resp) {
-              if (resp._local_id) {
-                $("<tr><th></th></tr>")
-                  .find("th").text(JSON.stringify(resp)).end()
-                  .appendTo("#records tbody.content");
-                $("#records tbody tr").removeClass("odd").filter(":odd").addClass("odd");
-              } else {
-                $.each(resp.history, function(idx, record) {
-                  $("<tr><th></th></tr>")
-                    .find("th").text(JSON.stringify(record)).end()
-                    .appendTo("#records tbody.content");
-                });
-                $("#records tbody tr").removeClass("odd").filter(":odd").addClass("odd");
-                $("#records tbody.footer td").text("Replication session " + resp.session_id);
-
-                if (repOpts.create_target) {
-                  getDatabases();
-                }
-              }
-            }
-          }, repOpts);
-        });
-      });
-    </script>
-  </head>
-  <body><div id="wrap">
-    <h1>
-      <a href="index.html">Overview</a>
-      <strong>Replicator</strong>
-    </h1>
-    <div id="content">
-
-      <form id="replicator">
-        <fieldset id="source">
-          <legend>Replicate changes from:</legend>
-          <p>
-            <input type="radio" id="from_local" name="from_type" value="local" checked> 
-            <label for="from_local">Local Database: </label>
-            <select id="from_name" name="from_name" class="local"></select>
-          </p><p>
-            <input type="radio" id="from_to_remote" name="from_type" value="remote"> 
-            <label for="from_to_remote">Remote database: </label>
-            <input type="text" id="from_url" name="from_url" size="30" value="http://" disabled>
-          </p>
-        </fieldset>
-        <p class="swap"><button id="swap" tabindex="99">⇄</button></p>
-        <fieldset id="target">
-          <legend>to:</legend>
-          <p>
-            <input type="radio" id="to_local" name="to_type" value="local" checked> 
-            <label for="to_local">Local database: </label>
-            <input type="text" id="to_name" name="to_name" class="local"></select>
-          </p><p>
-            <input type="radio" id="to_remote" name="to_type" value="remote"> 
-            <label for="to_remote">Remote database: </label>
-            <input type="text" id="to_url" name="to_url" size="30" value="http://" disabled>
-          </p>
-        </fieldset>
-        <p class="actions">
-          <label><input type="checkbox" name="continuous" value="continuous" id="continuous"> Continuous</label>
-          <button id="replicate" type="button">Replicate</button>
-        </p>
-      </form>
-
-      <table id="records" class="listing" cellspacing="0">
-        <caption>Replication History</caption>
-        <thead><tr>
-          <th>Event</th>
-        </tr></thead>
-        <tbody class="content"></tbody>
-        <tbody class="footer"><tr>
-          <td colspan="4">No replication</td>
-        </tr></tbody>
-      </table>
-
-    </div>
-  </div></body>
-</html>

http://git-wip-us.apache.org/repos/asf/couchdb/blob/cca309f3/share/www/script/base64.js
----------------------------------------------------------------------
diff --git a/share/www/script/base64.js b/share/www/script/base64.js
deleted file mode 100644
index e0aab30..0000000
--- a/share/www/script/base64.js
+++ /dev/null
@@ -1,124 +0,0 @@
-/* Copyright (C) 1999 Masanao Izumo <iz...@onicos.co.jp>
- * Version: 1.0
- * LastModified: Dec 25 1999
- * This library is free.  You can redistribute it and/or modify it.
- */
- /* Modified by Chris Anderson to not use CommonJS */
- /* Modified by Dan Webb not to require Narwhal's binary library */
-
-var Base64 = {};
-(function(exports) {
-  
-  var encodeChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
-  var decodeChars = [
-      -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-      -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-      -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 63,
-      52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -1, -1, -1,
-      -1,  0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14,
-      15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1,
-      -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
-      41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1
-  ];
-
-  exports.encode = function (str) {
-      var out, i, length;
-      var c1, c2, c3;
-
-      length = len(str);
-      i = 0;
-      out = [];
-      while(i < length) {
-          c1 = str.charCodeAt(i++) & 0xff;
-          if(i == length)
-          {
-              out.push(encodeChars.charCodeAt(c1 >> 2));
-              out.push(encodeChars.charCodeAt((c1 & 0x3) << 4));
-              out.push("=".charCodeAt(0));
-              out.push("=".charCodeAt(0));
-              break;
-          }
-          c2 = str.charCodeAt(i++);
-          if(i == length)
-          {
-              out.push(encodeChars.charCodeAt(c1 >> 2));
-              out.push(encodeChars.charCodeAt(((c1 & 0x3)<< 4) | ((c2 & 0xF0) >> 4)));
-              out.push(encodeChars.charCodeAt((c2 & 0xF) << 2));
-              out.push("=".charCodeAt(0));
-              break;
-          }
-          c3 = str.charCodeAt(i++);
-          out.push(encodeChars.charCodeAt(c1 >> 2));
-          out.push(encodeChars.charCodeAt(((c1 & 0x3)<< 4) | ((c2 & 0xF0) >> 4)));
-          out.push(encodeChars.charCodeAt(((c2 & 0xF) << 2) | ((c3 & 0xC0) >>6)));
-          out.push(encodeChars.charCodeAt(c3 & 0x3F));
-      }
-
-      var str = ""; 
-      out.forEach(function(chr) { str += String.fromCharCode(chr) });
-      return str;
-  };
-
-  exports.decode = function (str) {
-      var c1, c2, c3, c4;
-      var i, length, out;
-
-      length = len(str);
-      i = 0;
-      out = [];
-      while(i < length) {
-          /* c1 */
-          do {
-              c1 = decodeChars[str.charCodeAt(i++) & 0xff];
-          } while(i < length && c1 == -1);
-          if(c1 == -1)
-              break;
-
-          /* c2 */
-          do {
-              c2 = decodeChars[str.charCodeAt(i++) & 0xff];
-          } while(i < length && c2 == -1);
-          if(c2 == -1)
-              break;
-
-          out.push(String.fromCharCode((c1 << 2) | ((c2 & 0x30) >> 4)));
-
-          /* c3 */
-          do {
-              c3 = str.charCodeAt(i++) & 0xff;
-              if(c3 == 61)
-                  return out.join('');
-              c3 = decodeChars[c3];
-          } while(i < length && c3 == -1);
-          if(c3 == -1)
-              break;
-
-          out.push(String.fromCharCode(((c2 & 0xF) << 4) | ((c3 & 0x3C) >> 2)));
-
-          /* c4 */
-          do {
-              c4 = str.charCodeAt(i++) & 0xff;
-              if(c4 == 61)
-                  return out.join('');
-              c4 = decodeChars[c4];
-          } while(i < length && c4 == -1);
-
-          if(c4 == -1)
-              break;
-
-          out.push(String.fromCharCode(((c3 & 0x03) << 6) | c4));
-      }
-
-      return out.join('');
-  };
-
-  var len = function (object) {
-      if (object.length !== undefined) {
-          return object.length;
-      } else if (object.getLength !== undefined) {
-          return object.getLength();
-      } else {
-          return undefined;
-      }
-  };
-})(Base64);

http://git-wip-us.apache.org/repos/asf/couchdb/blob/cca309f3/share/www/script/couch.js
----------------------------------------------------------------------
diff --git a/share/www/script/couch.js b/share/www/script/couch.js
deleted file mode 100644
index 7e4eeed..0000000
--- a/share/www/script/couch.js
+++ /dev/null
@@ -1,520 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
-// A simple class to represent a database. Uses XMLHttpRequest to interface with
-// the CouchDB server.
-
-function CouchDB(name, httpHeaders) {
-  this.name = name;
-  this.uri = "/" + encodeURIComponent(name) + "/";
-
-  // The XMLHttpRequest object from the most recent request. Callers can
-  // use this to check result http status and headers.
-  this.last_req = null;
-
-  this.request = function(method, uri, requestOptions) {
-    requestOptions = requestOptions || {};
-    requestOptions.headers = combine(requestOptions.headers, httpHeaders);
-    return CouchDB.request(method, uri, requestOptions);
-  };
-
-  // Creates the database on the server
-  this.createDb = function() {
-    this.last_req = this.request("PUT", this.uri);
-    CouchDB.maybeThrowError(this.last_req);
-    return JSON.parse(this.last_req.responseText);
-  };
-
-  // Deletes the database on the server
-  this.deleteDb = function() {
-    this.last_req = this.request("DELETE", this.uri + "?sync=true");
-    if (this.last_req.status == 404) {
-      return false;
-    }
-    CouchDB.maybeThrowError(this.last_req);
-    return JSON.parse(this.last_req.responseText);
-  };
-
-  // Save a document to the database
-  this.save = function(doc, options, http_headers) {
-    if (doc._id == undefined) {
-      doc._id = CouchDB.newUuids(1)[0];
-    }
-    http_headers = http_headers || {};
-    this.last_req = this.request("PUT", this.uri  +
-        encodeURIComponent(doc._id) + encodeOptions(options),
-        {body: JSON.stringify(doc), headers: http_headers});
-    CouchDB.maybeThrowError(this.last_req);
-    var result = JSON.parse(this.last_req.responseText);
-    doc._rev = result.rev;
-    return result;
-  };
-
-  // Open a document from the database
-  this.open = function(docId, url_params, http_headers) {
-    this.last_req = this.request("GET", this.uri + encodeURIComponent(docId)
-      + encodeOptions(url_params), {headers:http_headers});
-    if (this.last_req.status == 404) {
-      return null;
-    }
-    CouchDB.maybeThrowError(this.last_req);
-    return JSON.parse(this.last_req.responseText);
-  };
-
-  // Deletes a document from the database
-  this.deleteDoc = function(doc) {
-    this.last_req = this.request("DELETE", this.uri + encodeURIComponent(doc._id)
-      + "?rev=" + doc._rev);
-    CouchDB.maybeThrowError(this.last_req);
-    var result = JSON.parse(this.last_req.responseText);
-    doc._rev = result.rev; //record rev in input document
-    doc._deleted = true;
-    return result;
-  };
-
-  // Deletes an attachment from a document
-  this.deleteDocAttachment = function(doc, attachment_name) {
-    this.last_req = this.request("DELETE", this.uri + encodeURIComponent(doc._id)
-      + "/" + attachment_name + "?rev=" + doc._rev);
-    CouchDB.maybeThrowError(this.last_req);
-    var result = JSON.parse(this.last_req.responseText);
-    doc._rev = result.rev; //record rev in input document
-    return result;
-  };
-
-  this.bulkSave = function(docs, options) {
-    // first prepoulate the UUIDs for new documents
-    var newCount = 0;
-    for (var i=0; i<docs.length; i++) {
-      if (docs[i]._id == undefined) {
-        newCount++;
-      }
-    }
-    var newUuids = CouchDB.newUuids(newCount);
-    var newCount = 0;
-    for (var i=0; i<docs.length; i++) {
-      if (docs[i]._id == undefined) {
-        docs[i]._id = newUuids.pop();
-      }
-    }
-    var json = {"docs": docs};
-    // put any options in the json
-    for (var option in options) {
-      json[option] = options[option];
-    }
-    this.last_req = this.request("POST", this.uri + "_bulk_docs", {
-      body: JSON.stringify(json)
-    });
-    if (this.last_req.status == 417) {
-      return {errors: JSON.parse(this.last_req.responseText)};
-    }
-    else {
-      CouchDB.maybeThrowError(this.last_req);
-      var results = JSON.parse(this.last_req.responseText);
-      for (var i = 0; i < docs.length; i++) {
-        if(results[i] && results[i].rev && results[i].ok) {
-          docs[i]._rev = results[i].rev;
-        }
-      }
-      return results;
-    }
-  };
-
-  this.ensureFullCommit = function() {
-    this.last_req = this.request("POST", this.uri + "_ensure_full_commit");
-    CouchDB.maybeThrowError(this.last_req);
-    return JSON.parse(this.last_req.responseText);
-  };
-
-  // Applies the map function to the contents of database and returns the results.
-  this.query = function(mapFun, reduceFun, options, keys, language) {
-    var body = {language: language || "javascript"};
-    if(keys) {
-      body.keys = keys ;
-    }
-    if (typeof(mapFun) != "string") {
-      mapFun = mapFun.toSource ? mapFun.toSource() : "(" + mapFun.toString() + ")";
-    }
-    body.map = mapFun;
-    if (reduceFun != null) {
-      if (typeof(reduceFun) != "string") {
-        reduceFun = reduceFun.toSource ?
-          reduceFun.toSource() : "(" + reduceFun.toString() + ")";
-      }
-      body.reduce = reduceFun;
-    }
-    if (options && options.options != undefined) {
-        body.options = options.options;
-        delete options.options;
-    }
-    this.last_req = this.request("POST", this.uri + "_temp_view"
-      + encodeOptions(options), {
-      headers: {"Content-Type": "application/json"},
-      body: JSON.stringify(body)
-    });
-    CouchDB.maybeThrowError(this.last_req);
-    return JSON.parse(this.last_req.responseText);
-  };
-
-  this.view = function(viewname, options, keys) {
-    var viewParts = viewname.split('/');
-    var viewPath = this.uri + "_design/" + viewParts[0] + "/_view/"
-        + viewParts[1] + encodeOptions(options);
-    if(!keys) {
-      this.last_req = this.request("GET", viewPath);
-    } else {
-      this.last_req = this.request("POST", viewPath, {
-        headers: {"Content-Type": "application/json"},
-        body: JSON.stringify({keys:keys})
-      });
-    }
-    if (this.last_req.status == 404) {
-      return null;
-    }
-    CouchDB.maybeThrowError(this.last_req);
-    return JSON.parse(this.last_req.responseText);
-  };
-
-  // gets information about the database
-  this.info = function() {
-    this.last_req = this.request("GET", this.uri);
-    CouchDB.maybeThrowError(this.last_req);
-    return JSON.parse(this.last_req.responseText);
-  };
-
-  // gets information about a design doc
-  this.designInfo = function(docid) {
-    this.last_req = this.request("GET", this.uri + docid + "/_info");
-    CouchDB.maybeThrowError(this.last_req);
-    return JSON.parse(this.last_req.responseText);
-  };
-
-  this.allDocs = function(options,keys) {
-    if(!keys) {
-      this.last_req = this.request("GET", this.uri + "_all_docs"
-        + encodeOptions(options));
-    } else {
-      this.last_req = this.request("POST", this.uri + "_all_docs"
-        + encodeOptions(options), {
-        headers: {"Content-Type": "application/json"},
-        body: JSON.stringify({keys:keys})
-      });
-    }
-    CouchDB.maybeThrowError(this.last_req);
-    return JSON.parse(this.last_req.responseText);
-  };
-
-  this.designDocs = function() {
-    return this.allDocs({startkey:"_design", endkey:"_design0"});
-  };
-
-  this.changes = function(options) {
-    this.last_req = this.request("GET", this.uri + "_changes"
-      + encodeOptions(options));
-    CouchDB.maybeThrowError(this.last_req);
-    return JSON.parse(this.last_req.responseText);
-  };
-
-  this.compact = function() {
-    this.last_req = this.request("POST", this.uri + "_compact");
-    CouchDB.maybeThrowError(this.last_req);
-    return JSON.parse(this.last_req.responseText);
-  };
-
-  this.viewCleanup = function() {
-    this.last_req = this.request("POST", this.uri + "_view_cleanup");
-    CouchDB.maybeThrowError(this.last_req);
-    return JSON.parse(this.last_req.responseText);
-  };
-
-  this.setDbProperty = function(propId, propValue) {
-    this.last_req = this.request("PUT", this.uri + propId,{
-      body:JSON.stringify(propValue)
-    });
-    CouchDB.maybeThrowError(this.last_req);
-    return JSON.parse(this.last_req.responseText);
-  };
-
-  this.getDbProperty = function(propId) {
-    this.last_req = this.request("GET", this.uri + propId);
-    CouchDB.maybeThrowError(this.last_req);
-    return JSON.parse(this.last_req.responseText);
-  };
-
-  this.setSecObj = function(secObj) {
-    this.last_req = this.request("PUT", this.uri + "_security",{
-      body:JSON.stringify(secObj)
-    });
-    CouchDB.maybeThrowError(this.last_req);
-    return JSON.parse(this.last_req.responseText);
-  };
-
-  this.getSecObj = function() {
-    this.last_req = this.request("GET", this.uri + "_security");
-    CouchDB.maybeThrowError(this.last_req);
-    return JSON.parse(this.last_req.responseText);
-  };
-
-  // Convert a options object to an url query string.
-  // ex: {key:'value',key2:'value2'} becomes '?key="value"&key2="value2"'
-  function encodeOptions(options) {
-    var buf = [];
-    if (typeof(options) == "object" && options !== null) {
-      for (var name in options) {
-        if (!options.hasOwnProperty(name)) { continue; };
-        var value = options[name];
-        if (name == "key" || name == "keys" || name == "startkey" || name == "endkey" || (name == "open_revs" && value !== "all")) {
-          value = toJSON(value);
-        }
-        buf.push(encodeURIComponent(name) + "=" + encodeURIComponent(value));
-      }
-    }
-    if (!buf.length) {
-      return "";
-    }
-    return "?" + buf.join("&");
-  }
-
-  function toJSON(obj) {
-    return obj !== null ? JSON.stringify(obj) : null;
-  }
-
-  function combine(object1, object2) {
-    if (!object2) {
-      return object1;
-    }
-    if (!object1) {
-      return object2;
-    }
-
-    for (var name in object2) {
-      object1[name] = object2[name];
-    }
-    return object1;
-  }
-
-}
-
-// this is the XMLHttpRequest object from last request made by the following
-// CouchDB.* functions (except for calls to request itself).
-// Use this from callers to check HTTP status or header values of requests.
-CouchDB.last_req = null;
-CouchDB.urlPrefix = '';
-
-CouchDB.login = function(name, password) {
-  CouchDB.last_req = CouchDB.request("POST", "/_session", {
-    headers: {"Content-Type": "application/x-www-form-urlencoded",
-      "X-CouchDB-WWW-Authenticate": "Cookie"},
-    body: "name=" + encodeURIComponent(name) + "&password="
-      + encodeURIComponent(password)
-  });
-  return JSON.parse(CouchDB.last_req.responseText);
-}
-
-CouchDB.logout = function() {
-  CouchDB.last_req = CouchDB.request("DELETE", "/_session", {
-    headers: {"Content-Type": "application/x-www-form-urlencoded",
-      "X-CouchDB-WWW-Authenticate": "Cookie"}
-  });
-  return JSON.parse(CouchDB.last_req.responseText);
-};
-
-CouchDB.session = function(options) {
-  options = options || {};
-  CouchDB.last_req = CouchDB.request("GET", "/_session", options);
-  CouchDB.maybeThrowError(CouchDB.last_req);
-  return JSON.parse(CouchDB.last_req.responseText);
-};
-
-CouchDB.allDbs = function() {
-  CouchDB.last_req = CouchDB.request("GET", "/_all_dbs");
-  CouchDB.maybeThrowError(CouchDB.last_req);
-  return JSON.parse(CouchDB.last_req.responseText);
-};
-
-CouchDB.allDesignDocs = function() {
-  var ddocs = {}, dbs = CouchDB.allDbs();
-  for (var i=0; i < dbs.length; i++) {
-    var db = new CouchDB(dbs[i]);
-    ddocs[dbs[i]] = db.designDocs();
-  };
-  return ddocs;
-};
-
-CouchDB.getVersion = function() {
-  CouchDB.last_req = CouchDB.request("GET", "/");
-  CouchDB.maybeThrowError(CouchDB.last_req);
-  return JSON.parse(CouchDB.last_req.responseText).version;
-};
-
-CouchDB.reloadConfig = function() {
-  CouchDB.last_req = CouchDB.request("POST", "/_config/_reload");
-  CouchDB.maybeThrowError(CouchDB.last_req);
-  return JSON.parse(CouchDB.last_req.responseText);
-};
-
-CouchDB.replicate = function(source, target, rep_options) {
-  rep_options = rep_options || {};
-  var headers = rep_options.headers || {};
-  var body = rep_options.body || {};
-  body.source = source;
-  body.target = target;
-  CouchDB.last_req = CouchDB.request("POST", "/_replicate", {
-    headers: headers,
-    body: JSON.stringify(body)
-  });
-  CouchDB.maybeThrowError(CouchDB.last_req);
-  return JSON.parse(CouchDB.last_req.responseText);
-};
-
-CouchDB.newXhr = function() {
-  if (typeof(XMLHttpRequest) != "undefined") {
-    return new XMLHttpRequest();
-  } else if (typeof(ActiveXObject) != "undefined") {
-    return new ActiveXObject("Microsoft.XMLHTTP");
-  } else {
-    throw new Error("No XMLHTTPRequest support detected");
-  }
-};
-
-CouchDB.xhrbody = function(xhr) {
-  if (xhr.responseText) {
-    return xhr.responseText;
-  } else if (xhr.body) {
-    return xhr.body
-  } else {
-    throw new Error("No XMLHTTPRequest support detected");
-  }
-}
-
-CouchDB.xhrheader = function(xhr, header) {
-  if(xhr.getResponseHeader) {
-    return xhr.getResponseHeader(header);
-  } else if(xhr.headers) {
-    return xhr.headers[header] || null;
-  } else {
-    throw new Error("No XMLHTTPRequest support detected");
-  }
-}
-
-CouchDB.proxyUrl = function(uri) {
-  if(uri.substr(0, CouchDB.protocol.length) != CouchDB.protocol) {
-    uri = CouchDB.urlPrefix + uri;
-  }
-  return uri;
-}
-
-CouchDB.request = function(method, uri, options) {
-  options = typeof(options) == 'object' ? options : {};
-  options.headers = typeof(options.headers) == 'object' ? options.headers : {};
-  options.headers["Content-Type"] = options.headers["Content-Type"] || options.headers["content-type"] || "application/json";
-  options.headers["Accept"] = options.headers["Accept"] || options.headers["accept"] || "application/json";
-  var req = CouchDB.newXhr();
-  uri = CouchDB.proxyUrl(uri);
-  req.open(method, uri, false);
-  if (options.headers) {
-    var headers = options.headers;
-    for (var headerName in headers) {
-      if (!headers.hasOwnProperty(headerName)) { continue; }
-      req.setRequestHeader(headerName, headers[headerName]);
-    }
-  }
-  req.send(options.body || "");
-  return req;
-};
-
-CouchDB.requestStats = function(path, test) {
-  var query_arg = "";
-  if(test !== null) {
-    query_arg = "?flush=true";
-  }
-
-  var url = "/_stats/" + path.join("/") + query_arg;
-  var stat = CouchDB.request("GET", url).responseText;
-  return JSON.parse(stat);
-};
-
-CouchDB.uuids_cache = [];
-
-CouchDB.newUuids = function(n, buf) {
-  buf = buf || 100;
-  if (CouchDB.uuids_cache.length >= n) {
-    var uuids = CouchDB.uuids_cache.slice(CouchDB.uuids_cache.length - n);
-    if(CouchDB.uuids_cache.length - n == 0) {
-      CouchDB.uuids_cache = [];
-    } else {
-      CouchDB.uuids_cache =
-          CouchDB.uuids_cache.slice(0, CouchDB.uuids_cache.length - n);
-    }
-    return uuids;
-  } else {
-    CouchDB.last_req = CouchDB.request("GET", "/_uuids?count=" + (buf + n));
-    CouchDB.maybeThrowError(CouchDB.last_req);
-    var result = JSON.parse(CouchDB.last_req.responseText);
-    CouchDB.uuids_cache =
-        CouchDB.uuids_cache.concat(result.uuids.slice(0, buf));
-    return result.uuids.slice(buf);
-  }
-};
-
-CouchDB.maybeThrowError = function(req) {
-  if (req.status >= 400) {
-    try {
-      var result = JSON.parse(req.responseText);
-    } catch (ParseError) {
-      var result = {error:"unknown", reason:req.responseText};
-    }
-
-    throw (new CouchError(result));
-  }
-}
-
-CouchDB.params = function(options) {
-  options = options || {};
-  var returnArray = [];
-  for(var key in options) {
-    var value = options[key];
-    returnArray.push(key + "=" + value);
-  }
-  return returnArray.join("&");
-};
-// Used by replication test
-if (typeof window == 'undefined' || !window) {
-  var hostRE = RegExp("https?://([^\/]+)");
-  var getter = function () {
-    return (new CouchHTTP).base_url.match(hostRE)[1];
-  };
-  if(Object.defineProperty) {
-    Object.defineProperty(CouchDB, "host", {
-      get : getter,
-      enumerable : true
-    });
-  } else {
-    CouchDB.__defineGetter__("host", getter);
-  }
-  CouchDB.protocol = "http://";
-  CouchDB.inBrowser = false;
-} else {
-  CouchDB.host = window.location.host;
-  CouchDB.inBrowser = true;
-  CouchDB.protocol = window.location.protocol + "//";
-}
-
-// Turns an {error: ..., reason: ...} response into an Error instance
-function CouchError(error) {
-  var inst = new Error(error.reason);
-  inst.name = 'CouchError';
-  inst.error = error.error;
-  inst.reason = error.reason;
-  return inst;
-}
-CouchError.prototype.constructor = CouchError;

http://git-wip-us.apache.org/repos/asf/couchdb/blob/cca309f3/share/www/script/couch_test_runner.js
----------------------------------------------------------------------
diff --git a/share/www/script/couch_test_runner.js b/share/www/script/couch_test_runner.js
deleted file mode 100644
index efc4dc2..0000000
--- a/share/www/script/couch_test_runner.js
+++ /dev/null
@@ -1,465 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
-// *********************** Test Framework of Sorts ************************* //
-
-
-function loadScript(url) {
-  // disallow loading remote URLs
-  var re = /^[a-z0-9_]+(\/[a-z0-9_]+)*\.js#?$/;
-  if (!re.test(url)) {
-      throw "Not loading remote test scripts";
-  }
-  if (typeof document != "undefined") document.write('<script src="'+url+'"></script>');
-};
-
-function patchTest(fun) {
-  var source = fun.toString();
-  var output = "";
-  var i = 0;
-  var testMarker = "T(";
-  while (i < source.length) {
-    var testStart = source.indexOf(testMarker, i);
-    if (testStart == -1) {
-      output = output + source.substring(i, source.length);
-      break;
-    }
-    var testEnd = source.indexOf(");", testStart);
-    var testCode = source.substring(testStart + testMarker.length, testEnd);
-    output += source.substring(i, testStart) + "T(" + testCode + "," + JSON.stringify(testCode);
-    i = testEnd;
-  }
-  try {
-    return eval("(" + output + ")");
-  } catch (e) {
-    return null;
-  }
-}
-
-function runAllTests() {
-  var rows = $("#tests tbody.content tr");
-  $("td", rows).text("");
-  $("td.status", rows).removeClass("error").removeClass("failure").removeClass("success").text("not run");
-  var offset = 0;
-  function runNext() {
-    if (offset < rows.length) {
-      var row = rows.get(offset);
-      runTest($("th button", row).get(0), function() {
-        offset += 1;
-        setTimeout(runNext, 100);
-      }, false, true);
-    } else {
-      saveTestReport();
-    }
-  }
-  runNext();
-}
-
-var numFailures = 0;
-var currentRow = null;
-
-function runTest(button, callback, debug, noSave) {
-
-  // offer to save admins
-  if (currentRow != null) {
-    alert("Can not run multiple tests simultaneously.");
-    return;
-  }
-  var row = currentRow = $(button).parents("tr").get(0);
-  $("td.status", row).removeClass("error").removeClass("failure").removeClass("success");
-  $("td", row).text("");
-  $("#toolbar li.current").text("Running: "+row.id);
-  var testFun = couchTests[row.id];
-  function run() {
-    numFailures = 0;
-    var start = new Date().getTime();
-    try {
-      if (debug == undefined || !debug) {
-        testFun = patchTest(testFun) || testFun;
-      }
-      testFun(debug);
-      var status = numFailures > 0 ? "failure" : "success";
-    } catch (e) {
-      var status = "error";
-      if ($("td.details ol", row).length == 0) {
-        $("<ol></ol>").appendTo($("td.details", row));
-      }
-      $("<li><b>Exception raised:</b> <code class='error'></code></li>")
-        .find("code").text(JSON.stringify(e)).end()
-        .appendTo($("td.details ol", row));
-      if (debug) {
-        currentRow = null;
-        throw e;
-      }
-    }
-    if ($("td.details ol", row).length) {
-      $("<a href='#'>Run with debugger</a>").click(function() {
-        runTest(this, undefined, true);
-      }).prependTo($("td.details ol", row));
-    }
-    var duration = new Date().getTime() - start;
-    $("td.status", row).removeClass("running").addClass(status).text(status);
-    $("td.duration", row).text(duration + "ms");
-    $("#toolbar li.current").text("Finished: "+row.id);
-    updateTestsFooter();
-    currentRow = null;
-    if (callback) callback();
-    if (!noSave) saveTestReport();
-  }
-  $("td.status", row).addClass("running").text("running…");
-  setTimeout(run, 100);
-}
-
-function showSource(cell) {
-  var name = $(cell).text();
-  var win = window.open("", name, "width=700,height=500,resizable=yes,scrollbars=yes");
-  win.document.location = "script/test/" + name + ".js";
-}
-
-var readyToRun;
-function setupAdminParty(fun) {
-  if (readyToRun) {
-    fun();
-  } else {
-    function removeAdmins(confs, doneFun) {
-      // iterate through the config and remove current user last
-      // current user is at front of list
-      var remove = confs.pop();
-      if (remove) {
-        $.couch.config({
-          success : function() {
-            removeAdmins(confs, doneFun);
-          }
-        }, "admins", remove[0], null);
-      } else {
-        doneFun();
-      }
-    };
-    $.couch.session({
-      success : function(resp) {
-        var userCtx = resp.userCtx;
-        if (userCtx.name && userCtx.roles.indexOf("_admin") != -1) {
-          // admin but not admin party. dialog offering to make admin party
-          $.showDialog("dialog/_admin_party.html", {
-            submit: function(data, callback) {
-              $.couch.config({
-                success : function(conf) {
-                  var meAdmin, adminConfs = [];
-                  for (var name in conf) {
-                    if (name == userCtx.name) {
-                      meAdmin = [name, conf[name]];
-                    } else {
-                      adminConfs.push([name, conf[name]]);
-                    }
-                  }
-                  adminConfs.unshift(meAdmin);
-                  removeAdmins(adminConfs, function() {
-                    callback();
-                    $.futon.session.sidebar();
-                    readyToRun = true;
-                    setTimeout(fun, 500);
-                  });
-                }
-              }, "admins");
-            }
-          });
-        } else if (userCtx.roles.indexOf("_admin") != -1) {
-          // admin party!
-          readyToRun = true;
-          fun();
-        } else {
-          // not an admin
-          alert("Error: You need to be an admin to run the tests.");
-        };
-      }
-    });
-  }
-};
-
-function updateTestsListing() {
-  for (var name in couchTests) {
-    var testFunction = couchTests[name];
-    var row = $("<tr><th></th><td></td><td></td><td></td></tr>")
-      .find("th").text(name).attr("title", "Show source").click(function() {
-        showSource(this);
-      }).end()
-      .find("td:nth(0)").addClass("status").text("not run").end()
-      .find("td:nth(1)").addClass("duration").end()
-      .find("td:nth(2)").addClass("details").end();
-    $("<button type='button' class='run' title='Run test'></button>").click(function() {
-      this.blur();
-      var self = this;
-      // check for admin party
-      setupAdminParty(function() {
-        runTest(self);
-      });
-      return false;
-    }).prependTo(row.find("th"));
-    row.attr("id", name).appendTo("#tests tbody.content");
-  }
-  $("#tests tr").removeClass("odd").filter(":odd").addClass("odd");
-  updateTestsFooter();
-}
-
-function updateTestsFooter() {
-  var tests = $("#tests tbody.content tr td.status");
-  var testsRun = tests.filter(".success, .error, .failure");
-  var testsFailed = testsRun.not(".success");
-  var totalDuration = 0;
-  $("#tests tbody.content tr td.duration:contains('ms')").each(function() {
-    var text = $(this).text();
-    totalDuration += parseInt(text.substr(0, text.length - 2), 10);
-  });
-  $("#tests tbody.footer td").html("<span>"+testsRun.length + " of " + tests.length +
-    " test(s) run, " + testsFailed.length + " failures (" +
-    totalDuration + " ms)</span> ");
-}
-
-// make report and save to local db
-// display how many reports need replicating to the mothership
-// have button to replicate them
-
-function saveTestReport(report) {
-  var report = makeTestReport();
-  if (report) {
-    var db = $.couch.db("test_suite_reports");
-    var saveReport = function(db_info) {
-      report.db = db_info;
-      $.couch.info({success : function(node_info) {
-        report.node = node_info;
-        db.saveDoc(report);
-      }});
-    };
-    var createDb = function() {
-      db.create({success: function() {
-        db.info({success:saveReport});
-      }});
-    };
-    db.info({error: createDb, success:saveReport});
-  }
-};
-
-function makeTestReport() {
-  var report = {};
-  report.summary = $("#tests tbody.footer td").text();
-  report.platform = testPlatform();
-  var date = new Date();
-  report.timestamp = date.getTime();
-  report.timezone = date.getTimezoneOffset();
-  report.tests = [];
-  $("#tests tbody.content tr").each(function() {
-    var status = $("td.status", this).text();
-    if (status != "not run") {
-      var test = {};
-      test.name = this.id;
-      test.status = status;
-      test.duration = parseInt($("td.duration", this).text());
-      test.details = [];
-      $("td.details li", this).each(function() {
-        test.details.push($(this).text());
-      });
-      if (test.details.length == 0) {
-        delete test.details;
-      }
-      report.tests.push(test);
-    }
-  });
-  if (report.tests.length > 0) return report;
-};
-
-function testPlatform() {
-  var b = $.browser;
-  var bs = ["mozilla", "msie", "opera", "safari"];
-  for (var i=0; i < bs.length; i++) {
-    if (b[bs[i]]) {
-      return {"browser" : bs[i], "version" : b.version};
-    }
-  };
-  return {"browser" : "undetected"};
-}
-
-
-function reportTests() {
-  // replicate the database to couchdb.couchdb.org
-}
-
-// Use T to perform a test that returns false on failure and if the test fails,
-// display the line that failed.
-// Example:
-// T(MyValue==1);
-function T(arg1, arg2, testName) {
-  if (!arg1) {
-    if (currentRow) {
-      if ($("td.details ol", currentRow).length == 0) {
-        $("<ol></ol>").appendTo($("td.details", currentRow));
-      }
-      var message = (arg2 != null ? arg2 : arg1).toString();
-      $("<li><b>Assertion " + (testName ? "'" + testName + "'" : "") + " failed:</b> <code class='failure'></code></li>")
-        .find("code").text(message).end()
-        .appendTo($("td.details ol", currentRow));
-    }
-    numFailures += 1;
-  }
-}
-
-function TIsnull(actual, testName) {
-  T(actual === null, "expected 'null', got '"
-    + repr(actual) + "'", testName);
-}
-
-function TEquals(expected, actual, testName) {
-  T(equals(expected, actual), "expected '" + repr(expected) +
-    "', got '" + repr(actual) + "'", testName);
-}
-
-function TEqualsIgnoreCase(expected, actual, testName) {
-  T(equals(expected.toUpperCase(), actual.toUpperCase()), "expected '" + repr(expected) +
-    "', got '" + repr(actual) + "'", testName);
-}
-
-function equals(a,b) {
-  if (a === b) return true;
-  try {
-    return repr(a) === repr(b);
-  } catch (e) {
-    return false;
-  }
-}
-
-function repr(val) {
-  if (val === undefined) {
-    return null;
-  } else if (val === null) {
-    return "null";
-  } else {
-    return JSON.stringify(val);
-  }
-}
-
-function makeDocs(start, end, templateDoc) {
-  var templateDocSrc = templateDoc ? JSON.stringify(templateDoc) : "{}";
-  if (end === undefined) {
-    end = start;
-    start = 0;
-  }
-  var docs = [];
-  for (var i = start; i < end; i++) {
-    var newDoc = eval("(" + templateDocSrc + ")");
-    newDoc._id = (i).toString();
-    newDoc.integer = i;
-    newDoc.string = (i).toString();
-    docs.push(newDoc);
-  }
-  return docs;
-}
-
-function run_on_modified_server(settings, fun) {
-  try {
-    // set the settings
-    for(var i=0; i < settings.length; i++) {
-      var s = settings[i];
-      var xhr = CouchDB.request("PUT", "/_config/" + s.section + "/" + s.key, {
-        body: JSON.stringify(s.value),
-        headers: {"X-Couch-Persist": "false"}
-      });
-      CouchDB.maybeThrowError(xhr);
-      s.oldValue = xhr.responseText;
-    }
-    // run the thing
-    fun();
-  } finally {
-    // unset the settings
-    for(var j=0; j < i; j++) {
-      var s = settings[j];
-      if(s.oldValue == "\"\"\n") { // unset value
-        CouchDB.request("DELETE", "/_config/" + s.section + "/" + s.key, {
-          headers: {"X-Couch-Persist": "false"}
-        });
-      } else {
-        CouchDB.request("PUT", "/_config/" + s.section + "/" + s.key, {
-          body: s.oldValue,
-          headers: {"X-Couch-Persist": "false"}
-        });
-      }
-    }
-  }
-}
-
-function stringFun(fun) {
-  var string = fun.toSource ? fun.toSource() : "(" + fun.toString() + ")";
-  return string;
-}
-
-function waitForSuccess(fun, tag) {
-  var start = new Date();
-  while(true) {
-    if (new Date() - start > 5000) {
-      throw("timeout: "+tag);
-    } else {
-      try {
-        fun();
-        break;
-      } catch (e) {}
-      // sync http req allow async req to happen
-      try {
-        CouchDB.request("GET", "/test_suite_db/?tag="+encodeURIComponent(tag));
-      } catch (e) {}
-    }
-  }
-}
-
-function getCurrentToken() {
-  var xhr = CouchDB.request("GET", "/_restart/token");
-  return JSON.parse(xhr.responseText).token;
-};
-
-
-function restartServer() {
-  var token = getCurrentToken();
-  var token_changed = false;
-  var tDelta = 5000;
-  var t0 = new Date();
-  var t1;
-
-  CouchDB.request("POST", "/_restart");
-
-  do {
-    try {
-      if(token != getCurrentToken()) {
-        token_changed = true;
-      }
-    } catch (e) {
-      // Ignore errors while the server restarts
-    }
-    t1 = new Date();
-  } while(((t1 - t0) <= tDelta) && !token_changed);
-
-  if(!token_changed) {
-    throw("Server restart failed");
-  }
-}
-
-// legacy functions for CouchDB < 1.2.0
-// we keep them to make sure we keep BC
-CouchDB.user_prefix = "org.couchdb.user:";
-
-CouchDB.prepareUserDoc = function(user_doc, new_password) {
-  user_doc._id = user_doc._id || CouchDB.user_prefix + user_doc.name;
-  if (new_password) {
-    user_doc.password = new_password;
-  }
-  user_doc.type = "user";
-  if (!user_doc.roles) {
-    user_doc.roles = [];
-  }
-  return user_doc;
-};

http://git-wip-us.apache.org/repos/asf/couchdb/blob/cca309f3/share/www/script/couch_tests.js
----------------------------------------------------------------------
diff --git a/share/www/script/couch_tests.js b/share/www/script/couch_tests.js
deleted file mode 100644
index 62443f7..0000000
--- a/share/www/script/couch_tests.js
+++ /dev/null
@@ -1,114 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
-
-CouchDB.urlPrefix = "..";
-var couchTests = {};
-
-function loadTest(file) {
-  loadScript("script/test/"+file);
-};
-// keep first
-loadTest("basics.js");
-
-// keep sorted
-loadTest("all_docs.js");
-loadTest("attachments.js");
-loadTest("attachments_multipart.js");
-loadTest("attachment_names.js");
-loadTest("attachment_paths.js");
-loadTest("attachment_ranges.js");
-loadTest("attachment_views.js");
-loadTest("auth_cache.js");
-loadTest("batch_save.js");
-loadTest("bulk_docs.js");
-loadTest("changes.js");
-loadTest("coffee.js");
-loadTest("compact.js");
-loadTest("config.js");
-loadTest("conflicts.js");
-loadTest("content_negotiation.js");
-loadTest("cookie_auth.js");
-loadTest("copy_doc.js");
-loadTest("delayed_commits.js");
-loadTest("design_docs.js");
-loadTest("design_options.js");
-loadTest("design_paths.js");
-loadTest("erlang_views.js");
-loadTest("etags_head.js");
-loadTest("etags_views.js");
-loadTest("form_submit.js");
-loadTest("http.js");
-loadTest("invalid_docids.js");
-loadTest("jsonp.js");
-loadTest("large_docs.js");
-loadTest("list_views.js");
-loadTest("lots_of_docs.js");
-loadTest("method_override.js");
-loadTest("multiple_rows.js");
-loadScript("script/oauth.js");
-loadScript("script/sha1.js");
-loadTest("oauth.js");
-loadTest("oauth_users_db.js");
-loadTest("proxyauth.js");
-loadTest("purge.js");
-loadTest("reader_acl.js");
-loadTest("recreate_doc.js");
-loadTest("reduce.js");
-loadTest("reduce_builtin.js");
-loadTest("reduce_false.js");
-loadTest("reduce_false_temp.js");
-loadTest("replication.js");
-loadScript("script/replicator_db_inc.js");
-loadTest("replicator_db_bad_rep_id.js");
-loadTest("replicator_db_by_doc_id.js");
-loadTest("replicator_db_compact_rep_db.js");
-loadTest("replicator_db_continuous.js");
-loadTest("replicator_db_credential_delegation.js");
-loadTest("replicator_db_field_validation.js");
-loadTest("replicator_db_filtered.js");
-loadTest("replicator_db_identical.js");
-loadTest("replicator_db_identical_continuous.js");
-loadTest("replicator_db_invalid_filter.js");
-loadTest("replicator_db_simple.js");
-loadTest("replicator_db_successive.js");
-loadTest("replicator_db_survives.js");
-loadTest("replicator_db_swap_rep_db.js");
-loadTest("replicator_db_update_security.js");
-loadTest("replicator_db_user_ctx.js");
-loadTest("replicator_db_write_auth.js");
-loadTest("replicator_db_security.js");
-loadTest("rev_stemming.js");
-loadTest("rewrite.js");
-loadTest("security_validation.js");
-loadTest("show_documents.js");
-loadTest("stats.js");
-loadTest("update_documents.js");
-loadTest("users_db.js");
-loadTest("users_db_security.js");
-loadTest("utf8.js");
-loadTest("uuids.js");
-loadTest("view_collation.js");
-loadTest("view_collation_raw.js");
-loadTest("view_conflicts.js");
-loadTest("view_compaction.js");
-loadTest("view_errors.js");
-loadTest("view_include_docs.js");
-loadTest("view_multi_key_all_docs.js");
-loadTest("view_multi_key_design.js");
-loadTest("view_multi_key_temp.js");
-loadTest("view_offsets.js");
-loadTest("view_pagination.js");
-loadTest("view_sandboxing.js");
-loadTest("view_update_seq.js");
-// keep sorted
-


[09/37] move JS tests into safety

Posted by ja...@apache.org.
http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/www/script/test/attachments_multipart.js
----------------------------------------------------------------------
diff --git a/share/www/script/test/attachments_multipart.js b/share/www/script/test/attachments_multipart.js
deleted file mode 100644
index 6f924a7..0000000
--- a/share/www/script/test/attachments_multipart.js
+++ /dev/null
@@ -1,416 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
-couchTests.attachments_multipart= function(debug) {
-  var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"});
-  db.deleteDb();
-  db.createDb();
-  if (debug) debugger;
-  
-  // mime multipart
-            
-  var xhr = CouchDB.request("PUT", "/test_suite_db/multipart", {
-    headers: {"Content-Type": "multipart/related;boundary=\"abc123\""},
-    body:
-      "--abc123\r\n" +
-      "content-type: application/json\r\n" +
-      "\r\n" +
-      JSON.stringify({
-        "body":"This is a body.",
-        "_attachments":{
-          "foo.txt": {
-            "follows":true,
-            "content_type":"application/test",
-            "length":21
-            },
-          "bar.txt": {
-            "follows":true,
-            "content_type":"application/test",
-            "length":20
-            },
-          "baz.txt": {
-            "follows":true,
-            "content_type":"text/plain",
-            "length":19
-            }
-          }
-        }) +
-      "\r\n--abc123\r\n" +
-      "\r\n" +
-      "this is 21 chars long" +
-      "\r\n--abc123\r\n" +
-      "\r\n" +
-      "this is 20 chars lon" +
-      "\r\n--abc123\r\n" +
-      "\r\n" +
-      "this is 19 chars lo" +
-      "\r\n--abc123--epilogue"
-    });
-    
-  var result = JSON.parse(xhr.responseText);
-  
-  T(result.ok);
-  
-  
-    
-  TEquals(201, xhr.status, "should send 201 Accepted");
-  
-  xhr = CouchDB.request("GET", "/test_suite_db/multipart/foo.txt");
-  
-  T(xhr.responseText == "this is 21 chars long");
-  
-  xhr = CouchDB.request("GET", "/test_suite_db/multipart/bar.txt");
-  
-  T(xhr.responseText == "this is 20 chars lon");
-  
-  xhr = CouchDB.request("GET", "/test_suite_db/multipart/baz.txt");
-  
-  T(xhr.responseText == "this is 19 chars lo");
-  
-  // now edit an attachment
-  
-  var doc = db.open("multipart", {att_encoding_info: true});
-  var firstrev = doc._rev;
-  
-  T(doc._attachments["foo.txt"].stub == true);
-  T(doc._attachments["bar.txt"].stub == true);
-  T(doc._attachments["baz.txt"].stub == true);
-  TEquals("undefined", typeof doc._attachments["foo.txt"].encoding);
-  TEquals("undefined", typeof doc._attachments["bar.txt"].encoding);
-  TEquals("gzip", doc._attachments["baz.txt"].encoding);
-  
-  //lets change attachment bar
-  delete doc._attachments["bar.txt"].stub; // remove stub member (or could set to false)
-  delete doc._attachments["bar.txt"].digest; // remove the digest (it's for the gzip form)
-  doc._attachments["bar.txt"].length = 18;
-  doc._attachments["bar.txt"].follows = true;
-  //lets delete attachment baz:
-  delete doc._attachments["baz.txt"];
-  
-  var xhr = CouchDB.request("PUT", "/test_suite_db/multipart", {
-    headers: {"Content-Type": "multipart/related;boundary=\"abc123\""},
-    body:
-      "--abc123\r\n" +
-      "content-type: application/json\r\n" +
-      "\r\n" +
-      JSON.stringify(doc) +
-      "\r\n--abc123\r\n" +
-      "\r\n" +
-      "this is 18 chars l" +
-      "\r\n--abc123--"
-    });
-  TEquals(201, xhr.status);
-  
-  xhr = CouchDB.request("GET", "/test_suite_db/multipart/bar.txt");
-  
-  T(xhr.responseText == "this is 18 chars l");
-  
-  xhr = CouchDB.request("GET", "/test_suite_db/multipart/baz.txt");
-  T(xhr.status == 404);
-  
-  // now test receiving multipart docs
-  
-  function getBoundary(xhr) {
-    var ctype = CouchDB.xhrheader(xhr, "Content-Type");
-    var ctypeArgs = ctype.split("; ").slice(1);
-    var boundary = null;
-    for(var i=0; i<ctypeArgs.length; i++) {
-      if (ctypeArgs[i].indexOf("boundary=") == 0) {
-        boundary = ctypeArgs[i].split("=")[1];
-        if (boundary.charAt(0) == '"') {
-          // stringified boundary, parse as json 
-          // (will maybe not if there are escape quotes)
-          boundary = JSON.parse(boundary);
-        }
-      }
-    }
-    return boundary;
-  }
-  
-  function parseMultipart(xhr) {
-    var boundary = getBoundary(xhr);
-    var mimetext = CouchDB.xhrbody(xhr);
-    // strip off leading boundary
-    var leading = "--" + boundary + "\r\n";
-    var last = "\r\n--" + boundary + "--";
-    
-    // strip off leading and trailing boundary
-    var leadingIdx = mimetext.indexOf(leading) + leading.length;
-    var trailingIdx = mimetext.indexOf(last);
-    mimetext = mimetext.slice(leadingIdx, trailingIdx);
-    
-    // now split the sections
-    var sections = mimetext.split(new RegExp("\\r\\n--" + boundary));
-    
-    // spilt out the headers for each section
-    for(var i=0; i < sections.length; i++) {
-      var section = sections[i];
-      var headerEndIdx = section.indexOf("\r\n\r\n");
-      var headersraw = section.slice(0, headerEndIdx).split(/\r\n/);
-      var body = section.slice(headerEndIdx + 4);
-      var headers = {};
-      for(var j=0; j<headersraw.length; j++) {
-        var tmp = headersraw[j].split(": ");
-        headers[tmp[0]] = tmp[1]; 
-      }
-      sections[i] = {"headers":headers, "body":body};
-    }
-    
-    return sections;
-  }
-  
-  
-  xhr = CouchDB.request("GET", "/test_suite_db/multipart?attachments=true",
-    {headers:{"accept": "multipart/related,*/*;"}});
-  
-  T(xhr.status == 200);
-  
-  // parse out the multipart
-  var sections = parseMultipart(xhr);
-  TEquals("790", xhr.getResponseHeader("Content-Length"),
-    "Content-Length should be correct");
-  T(sections.length == 3);
-  // The first section is the json doc. Check it's content-type.
-  // Each part carries their own meta data.
-  TEquals("application/json", sections[0].headers['Content-Type'],
-    "Content-Type should be application/json for section[0]");
-  TEquals("application/test", sections[1].headers['Content-Type'],
-    "Content-Type should be application/test for section[1]");
-  TEquals("application/test", sections[2].headers['Content-Type'],
-    "Content-Type should be application/test for section[2]");
-
-  TEquals("21", sections[1].headers['Content-Length'],
-    "Content-Length should be 21 section[1]");
-  TEquals("18", sections[2].headers['Content-Length'],
-    "Content-Length should be 18 section[2]");
-
-  TEquals('attachment; filename="foo.txt"', sections[1].headers['Content-Disposition'],
-    "Content-Disposition should be foo.txt section[1]");
-  TEquals('attachment; filename="bar.txt"', sections[2].headers['Content-Disposition'],
-    "Content-Disposition should be bar.txt section[2]");
-
-  var doc = JSON.parse(sections[0].body);
-  
-  T(doc._attachments['foo.txt'].follows == true);
-  T(doc._attachments['bar.txt'].follows == true);
-  
-  T(sections[1].body == "this is 21 chars long");
-  TEquals("this is 18 chars l", sections[2].body, "should be 18 chars long");
-  
-  // now get attachments incrementally (only the attachments changes since
-  // a certain rev).
-  
-  xhr = CouchDB.request("GET", "/test_suite_db/multipart?atts_since=[\"" + firstrev + "\"]",
-    {headers:{"accept": "multipart/related, */*"}});
-  
-  T(xhr.status == 200);
-  
-  var sections = parseMultipart(xhr);
-  
-  T(sections.length == 2);
-  
-  var doc = JSON.parse(sections[0].body);
-  
-  T(doc._attachments['foo.txt'].stub == true);
-  T(doc._attachments['bar.txt'].follows == true);
-  
-  TEquals("this is 18 chars l", sections[1].body, "should be 18 chars long 2");
-
-  // try the atts_since parameter together with the open_revs parameter
-  xhr = CouchDB.request(
-    "GET",
-    '/test_suite_db/multipart?open_revs=["' +
-      doc._rev + '"]&atts_since=["' + firstrev + '"]',
-    {headers: {"accept": "multipart/mixed"}}
-  );
-
-  T(xhr.status === 200);
-
-  sections = parseMultipart(xhr);
-  // 1 section, with a multipart/related Content-Type
-  T(sections.length === 1);
-  T(sections[0].headers['Content-Type'].indexOf('multipart/related;') === 0);
-
-  var innerSections = parseMultipart(sections[0]);
-  // 2 inner sections: a document body section plus an attachment data section
-  T(innerSections.length === 2);
-  T(innerSections[0].headers['Content-Type'] === 'application/json');
-
-  doc = JSON.parse(innerSections[0].body);
-
-  T(doc._attachments['foo.txt'].stub === true);
-  T(doc._attachments['bar.txt'].follows === true);
-
-  T(innerSections[1].body === "this is 18 chars l");
-
-  // try it with a rev that doesn't exist (should get all attachments)
-  
-  xhr = CouchDB.request("GET", "/test_suite_db/multipart?atts_since=[\"1-2897589\"]",
-    {headers:{"accept": "multipart/related,*/*;"}});
-  
-  T(xhr.status == 200);
-  
-  var sections = parseMultipart(xhr);
-  
-  T(sections.length == 3);
-  
-  var doc = JSON.parse(sections[0].body);
-  
-  T(doc._attachments['foo.txt'].follows == true);
-  T(doc._attachments['bar.txt'].follows == true);
-  
-  T(sections[1].body == "this is 21 chars long");
-  TEquals("this is 18 chars l", sections[2].body, "should be 18 chars long 3");
-  // try it with a rev that doesn't exist, and one that does
-  
-  xhr = CouchDB.request("GET", "/test_suite_db/multipart?atts_since=[\"1-2897589\",\"" + firstrev + "\"]",
-    {headers:{"accept": "multipart/related,*/*;"}});
-  
-  T(xhr.status == 200);
-  
-  var sections = parseMultipart(xhr);
-  
-  T(sections.length == 2);
-  
-  var doc = JSON.parse(sections[0].body);
-  
-  T(doc._attachments['foo.txt'].stub == true);
-  T(doc._attachments['bar.txt'].follows == true);
-  
-  TEquals("this is 18 chars l", sections[1].body, "should be 18 chars long 4");
-
-  // check that with the document multipart/mixed API it's possible to receive
-  // attachments in compressed form (if they're stored in compressed form)
-
-  var server_config = [
-    {
-      section: "attachments",
-      key: "compression_level",
-      value: "8"
-    },
-    {
-      section: "attachments",
-      key: "compressible_types",
-      value: "text/plain"
-    }
-  ];
-
-  function testMultipartAttCompression() {
-    var doc = { _id: "foobar" };
-    var lorem =
-      CouchDB.request("GET", "/_utils/script/test/lorem.txt").responseText;
-    var helloData = "hello world";
-
-    TEquals(true, db.save(doc).ok);
-
-    var firstRev = doc._rev;
-    var xhr = CouchDB.request(
-      "PUT",
-      "/" + db.name + "/" + doc._id + "/data.bin?rev=" + firstRev,
-      {
-        body: helloData,
-        headers: {"Content-Type": "application/binary"}
-      }
-    );
-    TEquals(201, xhr.status);
-
-    var secondRev = db.open(doc._id)._rev;
-    xhr = CouchDB.request(
-      "PUT",
-      "/" + db.name + "/" + doc._id + "/lorem.txt?rev=" + secondRev,
-      {
-        body: lorem,
-        headers: {"Content-Type": "text/plain"}
-      }
-    );
-    TEquals(201, xhr.status);
-
-    var thirdRev = db.open(doc._id)._rev;
-
-    xhr = CouchDB.request(
-      "GET",
-      '/' + db.name + '/' + doc._id + '?open_revs=["' + thirdRev + '"]',
-      {
-        headers: {
-          "Accept": "multipart/mixed",
-          "X-CouchDB-Send-Encoded-Atts": "true"
-        }
-      }
-    );
-    TEquals(200, xhr.status);
-
-    var sections = parseMultipart(xhr);
-    // 1 section, with a multipart/related Content-Type
-    TEquals(1, sections.length);
-    TEquals(0,
-      sections[0].headers['Content-Type'].indexOf('multipart/related;'));
-
-    var innerSections = parseMultipart(sections[0]);
-    // 3 inner sections: a document body section plus 2 attachment data sections
-    TEquals(3, innerSections.length);
-    TEquals('application/json', innerSections[0].headers['Content-Type']);
-
-    doc = JSON.parse(innerSections[0].body);
-
-    TEquals(true, doc._attachments['lorem.txt'].follows);
-    TEquals("gzip", doc._attachments['lorem.txt'].encoding);
-    TEquals(true, doc._attachments['data.bin'].follows);
-    T(doc._attachments['data.bin'] !== "gzip");
-
-    if (innerSections[1].body === helloData) {
-      T(innerSections[2].body !== lorem);
-    } else if (innerSections[2].body === helloData) {
-      T(innerSections[1].body !== lorem);
-    } else {
-      T(false, "Could not found data.bin attachment data");
-    }
-
-    // now test that it works together with the atts_since parameter
-
-    xhr = CouchDB.request(
-      "GET",
-      '/' + db.name + '/' + doc._id + '?open_revs=["' + thirdRev + '"]' +
-        '&atts_since=["' + secondRev + '"]',
-      {
-        headers: {
-          "Accept": "multipart/mixed",
-          "X-CouchDB-Send-Encoded-Atts": "true"
-        }
-      }
-    );
-    TEquals(200, xhr.status);
-
-    sections = parseMultipart(xhr);
-    // 1 section, with a multipart/related Content-Type
-    TEquals(1, sections.length);
-    TEquals(0,
-      sections[0].headers['Content-Type'].indexOf('multipart/related;'));
-
-    innerSections = parseMultipart(sections[0]);
-    // 2 inner sections: a document body section plus 1 attachment data section
-    TEquals(2, innerSections.length);
-    TEquals('application/json', innerSections[0].headers['Content-Type']);
-
-    doc = JSON.parse(innerSections[0].body);
-
-    TEquals(true, doc._attachments['lorem.txt'].follows);
-    TEquals("gzip", doc._attachments['lorem.txt'].encoding);
-    TEquals("undefined", typeof doc._attachments['data.bin'].follows);
-    TEquals(true, doc._attachments['data.bin'].stub);
-    T(innerSections[1].body !== lorem);
-  }
-
-  run_on_modified_server(server_config, testMultipartAttCompression);
-
-  // cleanup
-  db.deleteDb();
-};

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/www/script/test/auth_cache.js
----------------------------------------------------------------------
diff --git a/share/www/script/test/auth_cache.js b/share/www/script/test/auth_cache.js
deleted file mode 100644
index 39b9887..0000000
--- a/share/www/script/test/auth_cache.js
+++ /dev/null
@@ -1,269 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License.  You may obtain a copy
-// of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
-couchTests.auth_cache = function(debug) {
-
-  if (debug) debugger;
-
-  // Simple secret key generator
-  function generateSecret(length) {
-    var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" +
-              "0123456789+/";
-    var secret = '';
-    for (var i = 0; i < length; i++) {
-      secret += tab.charAt(Math.floor(Math.random() * 64));
-    }
-    return secret;
-  }
-
-  var authDb = new CouchDB("test_suite_users", {"X-Couch-Full-Commit":"false"});
-  var server_config = [
-    {
-      section: "couch_httpd_auth",
-      key: "authentication_db",
-      value: authDb.name
-    },
-    {
-      section: "couch_httpd_auth",
-      key: "auth_cache_size",
-      value: "3"
-    },
-    {
-      section: "httpd",
-      key: "authentication_handlers",
-      value: "{couch_httpd_auth, default_authentication_handler}"
-    },
-    {
-      section: "couch_httpd_auth",
-      key: "secret",
-      value: generateSecret(64)
-    }
-  ];
-
-
-  function hits() {
-    var hits = CouchDB.requestStats(["couchdb", "auth_cache_hits"], true);
-    return hits.value || 0;
-  }
-
-
-  function misses() {
-    var misses = CouchDB.requestStats(["couchdb", "auth_cache_misses"], true);
-    return misses.value || 0;
-  }
-
-
-  function testFun() {
-    var hits_before,
-        misses_before,
-        hits_after,
-        misses_after;
-
-    var fdmanana = CouchDB.prepareUserDoc({
-      name: "fdmanana",
-      roles: ["dev"]
-    }, "qwerty");
-
-    T(authDb.save(fdmanana).ok);
-
-    var chris = CouchDB.prepareUserDoc({
-      name: "chris",
-      roles: ["dev", "mafia", "white_costume"]
-    }, "the_god_father");
-
-    T(authDb.save(chris).ok);
-
-    var joe = CouchDB.prepareUserDoc({
-      name: "joe",
-      roles: ["erlnager"]
-    }, "functional");
-
-    T(authDb.save(joe).ok);
-
-    var johndoe = CouchDB.prepareUserDoc({
-      name: "johndoe",
-      roles: ["user"]
-    }, "123456");
-
-    T(authDb.save(johndoe).ok);
-
-    hits_before = hits();
-    misses_before = misses();
-
-    T(CouchDB.login("fdmanana", "qwerty").ok);
-    T(CouchDB.logout().ok);
-
-    hits_after = hits();
-    misses_after = misses();
-
-    T(misses_after === (misses_before + 1));
-    T(hits_after === hits_before);
-
-    hits_before = hits_after;
-    misses_before = misses_after;
-
-    T(CouchDB.login("fdmanana", "qwerty").ok);
-    T(CouchDB.logout().ok);
-
-    hits_after = hits();
-    misses_after = misses();
-
-    T(misses_after === misses_before);
-    T(hits_after === (hits_before + 1));
-
-    hits_before = hits_after;
-    misses_before = misses_after;
-
-    T(CouchDB.login("chris", "the_god_father").ok);
-    T(CouchDB.logout().ok);
-
-    hits_after = hits();
-    misses_after = misses();
-
-    T(misses_after === (misses_before + 1));
-    T(hits_after === hits_before);
-
-    hits_before = hits_after;
-    misses_before = misses_after;
-
-    T(CouchDB.login("joe", "functional").ok);
-    T(CouchDB.logout().ok);
-
-    hits_after = hits();
-    misses_after = misses();
-
-    T(misses_after === (misses_before + 1));
-    T(hits_after === hits_before);
-
-    hits_before = hits_after;
-    misses_before = misses_after;
-
-    T(CouchDB.login("johndoe", "123456").ok);
-    T(CouchDB.logout().ok);
-
-    hits_after = hits();
-    misses_after = misses();
-
-    T(misses_after === (misses_before + 1));
-    T(hits_after === hits_before);
-
-    hits_before = hits_after;
-    misses_before = misses_after;
-
-    T(CouchDB.login("joe", "functional").ok);
-    T(CouchDB.logout().ok);
-
-    hits_after = hits();
-    misses_after = misses();
-
-    // it's an MRU cache, joe was removed from cache to add johndoe
-    T(misses_after === (misses_before + 1));
-    T(hits_after === hits_before);
-
-    hits_before = hits_after;
-    misses_before = misses_after;
-
-    T(CouchDB.login("fdmanana", "qwerty").ok);
-    T(CouchDB.logout().ok);
-
-    hits_after = hits();
-    misses_after = misses();
-
-    T(misses_after === misses_before);
-    T(hits_after === (hits_before + 1));
-
-    hits_before = hits_after;
-    misses_before = misses_after;
-
-    fdmanana.password = "foobar";
-    T(authDb.save(fdmanana).ok);
-
-    // cache was refreshed
-    T(CouchDB.login("fdmanana", "qwerty").error === "unauthorized");
-    T(CouchDB.login("fdmanana", "foobar").ok);
-    T(CouchDB.logout().ok);
-
-    hits_after = hits();
-    misses_after = misses();
-
-    T(misses_after === misses_before);
-    T(hits_after === (hits_before + 2));
-
-    hits_before = hits_after;
-    misses_before = misses_after;
-
-    // and yet another update
-    fdmanana.password = "javascript";
-    T(authDb.save(fdmanana).ok);
-
-    // cache was refreshed
-    T(CouchDB.login("fdmanana", "foobar").error === "unauthorized");
-    T(CouchDB.login("fdmanana", "javascript").ok);
-    T(CouchDB.logout().ok);
-
-    hits_after = hits();
-    misses_after = misses();
-
-    T(misses_after === misses_before);
-    T(hits_after === (hits_before + 2));
-
-    T(authDb.deleteDoc(fdmanana).ok);
-
-    hits_before = hits_after;
-    misses_before = misses_after;
-
-    T(CouchDB.login("fdmanana", "javascript").error === "unauthorized");
-
-    hits_after = hits();
-    misses_after = misses();
-
-    T(misses_after === misses_before);
-    T(hits_after === (hits_before + 1));
-
-    // login, compact authentication DB, login again and verify that
-    // there was a cache hit
-    hits_before = hits_after;
-    misses_before = misses_after;
-
-    T(CouchDB.login("johndoe", "123456").ok);
-    T(CouchDB.logout().ok);
-
-    hits_after = hits();
-    misses_after = misses();
-
-    T(misses_after === (misses_before + 1));
-    T(hits_after === hits_before);
-
-    T(authDb.compact().ok);
-
-    while (authDb.info().compact_running);
-
-    hits_before = hits_after;
-    misses_before = misses_after;
-
-    T(CouchDB.login("johndoe", "123456").ok);
-    T(CouchDB.logout().ok);
-
-    hits_after = hits();
-    misses_after = misses();
-
-    T(misses_after === misses_before);
-    T(hits_after === (hits_before + 1));
-  }
-
-
-  authDb.deleteDb();
-  run_on_modified_server(server_config, testFun);
-
-  // cleanup
-  authDb.deleteDb();
-}

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/www/script/test/basics.js
----------------------------------------------------------------------
diff --git a/share/www/script/test/basics.js b/share/www/script/test/basics.js
deleted file mode 100644
index 993456c..0000000
--- a/share/www/script/test/basics.js
+++ /dev/null
@@ -1,290 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
-// Do some basic tests.
-couchTests.basics = function(debug) {
-  var result = JSON.parse(CouchDB.request("GET", "/").responseText);
-  T(result.couchdb == "Welcome");
-
-  var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"});
-  db.deleteDb();
-
-  // bug COUCHDB-100: DELETE on non-existent DB returns 500 instead of 404
-  db.deleteDb();
-
-  db.createDb();
-
-  // PUT on existing DB should return 412 instead of 500
-  xhr = CouchDB.request("PUT", "/test_suite_db/");
-  T(xhr.status == 412);
-  if (debug) debugger;
-
-  // creating a new DB should return Location header
-  // and it should work for dbs with slashes (COUCHDB-411)
-  var dbnames = ["test_suite_db", "test_suite_db%2Fwith_slashes"];
-  dbnames.forEach(function(dbname) {
-    xhr = CouchDB.request("DELETE", "/" + dbname);
-    xhr = CouchDB.request("PUT", "/" + dbname);
-    TEquals(dbname,
-      xhr.getResponseHeader("Location").substr(-dbname.length),
-      "should return Location header to newly created document");
-    TEquals(CouchDB.protocol,
-      xhr.getResponseHeader("Location").substr(0, CouchDB.protocol.length),
-      "should return absolute Location header to newly created document");
-  });
-
-  // Get the database info, check the db_name
-  T(db.info().db_name == "test_suite_db");
-  T(CouchDB.allDbs().indexOf("test_suite_db") != -1);
-
-  // Get the database info, check the doc_count
-  T(db.info().doc_count == 0);
-
-  // create a document and save it to the database
-  var doc = {_id:"0",a:1,b:1};
-  var result = db.save(doc);
-
-  T(result.ok==true); // return object has an ok member with a value true
-  T(result.id); // the _id of the document is set.
-  T(result.rev); // the revision id of the document is set.
-
-  // Verify the input doc is now set with the doc id and rev
-  // (for caller convenience).
-  T(doc._id == result.id && doc._rev == result.rev);
-
-  var id = result.id; // save off the id for later
-
-  // make sure the revs_info status is good
-  var doc = db.open(id, {revs_info:true});
-  T(doc._revs_info[0].status == "available");
-
-  // make sure you can do a seq=true option
-  var doc = db.open(id, {local_seq:true});
-  T(doc._local_seq == 1);
-
-
-  // Create some more documents.
-  // Notice the use of the ok member on the return result.
-  T(db.save({_id:"1",a:2,b:4}).ok);
-  T(db.save({_id:"2",a:3,b:9}).ok);
-  T(db.save({_id:"3",a:4,b:16}).ok);
-
-  // Check the database doc count
-  T(db.info().doc_count == 4);
-
-  // COUCHDB-954
-  var oldRev = db.save({_id:"COUCHDB-954", a:1}).rev;
-  var newRev = db.save({_id:"COUCHDB-954", _rev:oldRev}).rev;
-
-  // test behavior of open_revs with explicit revision list
-  var result = db.open("COUCHDB-954", {open_revs:[oldRev,newRev]});
-  T(result.length == 2, "should get two revisions back");
-  T(result[0].ok);
-  T(result[1].ok);
-
-  // latest=true suppresses non-leaf revisions
-  var result = db.open("COUCHDB-954", {open_revs:[oldRev,newRev], latest:true});
-  T(result.length == 1, "should only get the child revision with latest=true");
-  T(result[0].ok._rev == newRev, "should get the child and not the parent");
-
-  // latest=true returns a child when you ask for a parent
-  var result = db.open("COUCHDB-954", {open_revs:[oldRev], latest:true});
-  T(result[0].ok._rev == newRev, "should get child when we requested parent");
-
-  // clean up after ourselves
-  db.save({_id:"COUCHDB-954", _rev:newRev, _deleted:true});
-
-  // Test a simple map functions
-
-  // create a map function that selects all documents whose "a" member
-  // has a value of 4, and then returns the document's b value.
-  var mapFunction = function(doc){
-    if (doc.a==4)
-      emit(null, doc.b);
-  };
-
-  var results = db.query(mapFunction);
-
-  // verify only one document found and the result value (doc.b).
-  T(results.total_rows == 1 && results.rows[0].value == 16);
-
-  // reopen document we saved earlier
-  var existingDoc = db.open(id);
-
-  T(existingDoc.a==1);
-
-  //modify and save
-  existingDoc.a=4;
-  db.save(existingDoc);
-
-  // redo the map query
-  results = db.query(mapFunction);
-
-  // the modified document should now be in the results.
-  T(results.total_rows == 2);
-
-  // write 2 more documents
-  T(db.save({a:3,b:9}).ok);
-  T(db.save({a:4,b:16}).ok);
-
-  results = db.query(mapFunction);
-
-  // 1 more document should now be in the result.
-  T(results.total_rows == 3);
-  T(db.info().doc_count == 6);
-
-  var reduceFunction = function(keys, values){
-    return sum(values);
-  };
-
-  results = db.query(mapFunction, reduceFunction);
-
-  T(results.rows[0].value == 33);
-
-  // delete a document
-  T(db.deleteDoc(existingDoc).ok);
-
-  // make sure we can't open the doc
-  T(db.open(existingDoc._id) == null);
-
-  results = db.query(mapFunction);
-
-  // 1 less document should now be in the results.
-  T(results.total_rows == 2);
-  T(db.info().doc_count == 5);
-
-  // make sure we can still open the old rev of the deleted doc
-  T(db.open(existingDoc._id, {rev: existingDoc._rev}) != null);
-  // make sure restart works
-  T(db.ensureFullCommit().ok);
-  restartServer();
-
-  // make sure we can still open
-  T(db.open(existingDoc._id, {rev: existingDoc._rev}) != null);
-
-  // test that the POST response has a Location header
-  var xhr = CouchDB.request("POST", "/test_suite_db", {
-    body: JSON.stringify({"foo":"bar"}),
-    headers: {"Content-Type": "application/json"}
-  });
-  var resp = JSON.parse(xhr.responseText);
-  T(resp.ok);
-  var loc = xhr.getResponseHeader("Location");
-  T(loc, "should have a Location header");
-  var locs = loc.split('/');
-  T(locs[locs.length-1] == resp.id);
-  T(locs[locs.length-2] == "test_suite_db");
-
-  // test that that POST's with an _id aren't overriden with a UUID.
-  var xhr = CouchDB.request("POST", "/test_suite_db", {
-    headers: {"Content-Type": "application/json"},
-    body: JSON.stringify({"_id": "oppossum", "yar": "matey"})
-  });
-  var resp = JSON.parse(xhr.responseText);
-  T(resp.ok);
-  T(resp.id == "oppossum");
-  var doc = db.open("oppossum");
-  T(doc.yar == "matey");
-
-  // document put's should return a Location header
-  var xhr = CouchDB.request("PUT", "/test_suite_db/newdoc", {
-    body: JSON.stringify({"a":1})
-  });
-  TEquals("/test_suite_db/newdoc",
-    xhr.getResponseHeader("Location").substr(-21),
-    "should return Location header to newly created document");
-  TEquals(CouchDB.protocol,
-    xhr.getResponseHeader("Location").substr(0, CouchDB.protocol.length),
-    "should return absolute Location header to newly created document");
-
-  // deleting a non-existent doc should be 404
-  xhr = CouchDB.request("DELETE", "/test_suite_db/doc-does-not-exist");
-  T(xhr.status == 404);
-
-  // Check for invalid document members
-  var bad_docs = [
-    ["goldfish", {"_zing": 4}],
-    ["zebrafish", {"_zoom": "hello"}],
-    ["mudfish", {"zane": "goldfish", "_fan": "something smells delicious"}],
-    ["tastyfish", {"_bing": {"wha?": "soda can"}}]
-  ];
-  var test_doc = function(info) {
-  var data = JSON.stringify(info[1]);
-    xhr = CouchDB.request("PUT", "/test_suite_db/" + info[0], {body: data});
-    T(xhr.status == 500);
-    result = JSON.parse(xhr.responseText);
-    T(result.error == "doc_validation");
-
-    xhr = CouchDB.request("POST", "/test_suite_db/", {
-      headers: {"Content-Type": "application/json"},
-      body: data
-    });
-    T(xhr.status == 500);
-    result = JSON.parse(xhr.responseText);
-    T(result.error == "doc_validation");
-  };
-  bad_docs.forEach(test_doc);
-
-  // Check some common error responses.
-  // PUT body not an object
-  xhr = CouchDB.request("PUT", "/test_suite_db/bar", {body: "[]"});
-  T(xhr.status == 400);
-  result = JSON.parse(xhr.responseText);
-  T(result.error == "bad_request");
-  T(result.reason == "Document must be a JSON object");
-
-  // Body of a _bulk_docs is not an object
-  xhr = CouchDB.request("POST", "/test_suite_db/_bulk_docs", {body: "[]"});
-  T(xhr.status == 400);
-  result = JSON.parse(xhr.responseText);
-  T(result.error == "bad_request");
-  T(result.reason == "Request body must be a JSON object");
-
-  // Body of an _all_docs  multi-get is not a {"key": [...]} structure.
-  xhr = CouchDB.request("POST", "/test_suite_db/_all_docs", {body: "[]"});
-  T(xhr.status == 400);
-  result = JSON.parse(xhr.responseText);
-  T(result.error == "bad_request");
-  T(result.reason == "Request body must be a JSON object");
-  var data = "{\"keys\": 1}";
-  xhr = CouchDB.request("POST", "/test_suite_db/_all_docs", {body:data});
-  T(xhr.status == 400);
-  result = JSON.parse(xhr.responseText);
-  T(result.error == "bad_request");
-  T(result.reason == "`keys` member must be a array.");
-
-  // oops, the doc id got lost in code nirwana
-  xhr = CouchDB.request("DELETE", "/test_suite_db/?rev=foobarbaz");
-  TEquals(400, xhr.status, "should return a bad request");
-  result = JSON.parse(xhr.responseText);
-  TEquals("bad_request", result.error);
-  TEquals("You tried to DELETE a database with a ?rev= parameter. Did you mean to DELETE a document instead?", result.reason);
-
-  // On restart, a request for creating a database that already exists can
-  // not override the existing database file
-  db = new CouchDB("test_suite_foobar");
-  db.deleteDb();
-  xhr = CouchDB.request("PUT", "/" + db.name);
-  TEquals(201, xhr.status);
-
-  TEquals(true, db.save({"_id": "doc1"}).ok);
-  TEquals(true, db.ensureFullCommit().ok);
-
-  TEquals(1, db.info().doc_count);
-
-  restartServer();
-
-  xhr = CouchDB.request("PUT", "/" + db.name);
-  TEquals(412, xhr.status);
-
-  TEquals(1, db.info().doc_count);
-};

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/www/script/test/batch_save.js
----------------------------------------------------------------------
diff --git a/share/www/script/test/batch_save.js b/share/www/script/test/batch_save.js
deleted file mode 100644
index a1b0019..0000000
--- a/share/www/script/test/batch_save.js
+++ /dev/null
@@ -1,48 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
-couchTests.batch_save = function(debug) {
-  var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"});
-  db.deleteDb();
-  db.createDb();
-  if (debug) debugger;
-
-  var i
-  for(i=0; i < 100; i++) {
-    T(db.save({_id:i.toString(),a:i,b:i},  {batch : "ok"}).ok);
-    
-    // test that response is 202 Accepted
-    T(db.last_req.status == 202);
-  }
-  
-  for(i=0; i < 100; i++) {
-    // attempt to save the same document a bunch of times
-    T(db.save({_id:"foo",a:i,b:i},  {batch : "ok"}).ok);
-    
-    // test that response is 202 Accepted
-    T(db.last_req.status == 202);
-  }
-  
-  while(db.allDocs().total_rows != 101){};
-
-  // repeat the tests for POST
-  for(i=0; i < 100; i++) {
-    var resp = db.request("POST", db.uri + "?batch=ok", {
-      headers: {"Content-Type": "application/json"},
-      body: JSON.stringify({a:1})
-    });
-    T(JSON.parse(resp.responseText).ok);
-  }
-  
-  while(db.allDocs().total_rows != 201){};
-
-};

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/www/script/test/bulk_docs.js
----------------------------------------------------------------------
diff --git a/share/www/script/test/bulk_docs.js b/share/www/script/test/bulk_docs.js
deleted file mode 100644
index 27a97c8..0000000
--- a/share/www/script/test/bulk_docs.js
+++ /dev/null
@@ -1,124 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
-couchTests.bulk_docs = function(debug) {
-  var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"});
-  db.deleteDb();
-  db.createDb();
-  if (debug) debugger;
-
-  var docs = makeDocs(5);
-
-  // Create the docs
-  var results = db.bulkSave(docs);
-
-  T(results.length == 5);
-  for (var i = 0; i < 5; i++) {
-    T(results[i].id == docs[i]._id);
-    T(results[i].rev);
-    // Update the doc
-    docs[i].string = docs[i].string + ".00";
-  }
-
-  // Save the docs
-  results = db.bulkSave(docs);
-  T(results.length == 5);
-  for (i = 0; i < 5; i++) {
-    T(results[i].id == i.toString());
-
-    // set the delete flag to delete the docs in the next step
-    docs[i]._deleted = true;
-  }
-
-  // now test a bulk update with a conflict
-  // open and save
-  var doc = db.open("0");
-  db.save(doc);
-
-  // Now bulk delete the docs
-  results = db.bulkSave(docs);
-
-  // doc "0" should be a conflict
-  T(results.length == 5);
-  T(results[0].id == "0");
-  T(results[0].error == "conflict");
-  T(typeof results[0].rev === "undefined"); // no rev member when a conflict
-
-  // but the rest are not
-  for (i = 1; i < 5; i++) {
-    T(results[i].id == i.toString());
-    T(results[i].rev);
-    T(db.open(docs[i]._id) == null);
-  }
-
-  // now force a conflict to to save
-
-  // save doc 0, this will cause a conflict when we save docs[0]
-  var doc = db.open("0");
-  docs[0] = db.open("0");
-  db.save(doc);
-
-  docs[0].shooby = "dooby";
-
-  // Now save the bulk docs, When we use all_or_nothing, we don't get conflict
-  // checking, all docs are saved regardless of conflict status, or none are
-  // saved.
-  results = db.bulkSave(docs,{all_or_nothing:true});
-  T(results.error === undefined);
-
-  var doc = db.open("0", {conflicts:true});
-  var docConflict = db.open("0", {rev:doc._conflicts[0]});
-
-  T(doc.shooby == "dooby" || docConflict.shooby == "dooby");
-
-  // verify creating a document with no id returns a new id
-  var req = CouchDB.request("POST", "/test_suite_db/_bulk_docs", {
-    body: JSON.stringify({"docs": [{"foo":"bar"}]})
-  });
-  results = JSON.parse(req.responseText);
-
-  T(results[0].id != "");
-  T(results[0].rev != "");
-
-
-  // Regression test for failure on update/delete
-  var newdoc = {"_id": "foobar", "body": "baz"};
-  T(db.save(newdoc).ok);
-  var update = {"_id": newdoc._id, "_rev": newdoc._rev, "body": "blam"};
-  var torem = {"_id": newdoc._id, "_rev": newdoc._rev, "_deleted": true};
-  results = db.bulkSave([update, torem]);
-  T(results[0].error == "conflict" || results[1].error == "conflict");
-
-
-  // verify that sending a request with no docs causes error thrown
-  var req = CouchDB.request("POST", "/test_suite_db/_bulk_docs", {
-    body: JSON.stringify({"doc": [{"foo":"bar"}]})
-  });
-
-  T(req.status == 400 );
-  result = JSON.parse(req.responseText);
-  T(result.error == "bad_request");
-  T(result.reason == "Missing JSON list of 'docs'");
-
-  // jira-911
-  db.deleteDb();
-  db.createDb();
-  docs = [];
-  docs.push({"_id":"0", "a" : 0});
-  docs.push({"_id":"1", "a" : 1});
-  docs.push({"_id":"1", "a" : 2});
-  docs.push({"_id":"3", "a" : 3});
-  results = db.bulkSave(docs);
-  T(results[1].id == "1");
-  T(results[1].error == undefined);
-  T(results[2].error == "conflict");
-};

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/www/script/test/changes.js
----------------------------------------------------------------------
diff --git a/share/www/script/test/changes.js b/share/www/script/test/changes.js
deleted file mode 100644
index d5a4236..0000000
--- a/share/www/script/test/changes.js
+++ /dev/null
@@ -1,738 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
-function jsonp(obj) {
-  T(jsonp_flag == 0);
-  T(obj.results.length == 1 && obj.last_seq == 1, "jsonp");
-  jsonp_flag = 1;
-}
-
-couchTests.changes = function(debug) {
-  var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"true"});
-  db.deleteDb();
-  db.createDb();
-  if (debug) debugger;
-
-  var req = CouchDB.request("GET", "/test_suite_db/_changes");
-  var resp = JSON.parse(req.responseText);
-
-  T(resp.results.length == 0 && resp.last_seq == 0, "empty db");
-  var docFoo = {_id:"foo", bar:1};
-  T(db.save(docFoo).ok);
-  T(db.ensureFullCommit().ok);
-  T(db.open(docFoo._id)._id == docFoo._id);
-
-  req = CouchDB.request("GET", "/test_suite_db/_changes");
-  var resp = JSON.parse(req.responseText);
-
-  T(resp.last_seq == 1);
-  T(resp.results.length == 1, "one doc db");
-  T(resp.results[0].changes[0].rev == docFoo._rev);
-
-  // test with callback
-
-  run_on_modified_server(
-    [{section: "httpd",
-      key: "allow_jsonp",
-      value: "true"}],
-  function() {
-    var xhr = CouchDB.request("GET", "/test_suite_db/_changes?callback=jsonp");
-    T(xhr.status == 200);
-    jsonp_flag = 0;
-    eval(xhr.responseText);
-    T(jsonp_flag == 1);
-  });
-
-  req = CouchDB.request("GET", "/test_suite_db/_changes?feed=continuous&timeout=10");
-  var lines = req.responseText.split("\n");
-  T(JSON.parse(lines[0]).changes[0].rev == docFoo._rev);
-  T(JSON.parse(lines[1]).last_seq == 1);
-
-  var xhr;
-
-  try {
-    xhr = CouchDB.newXhr();
-  } catch (err) {
-  }
-
-  // poor man's browser detection
-  var is_safari = false;
-  if(typeof(navigator) == "undefined") {
-    is_safari = true; // For CouchHTTP based runners
-  } else if(navigator.userAgent.match(/AppleWebKit/)) {
-    is_safari = true;
-  };
-  if (!is_safari && xhr) {
-    // Only test the continuous stuff if we have a real XHR object
-    // with real async support.
-
-    // WebKit (last checked on nightly #47686) does fail on processing
-    // the async-request properly while javascript is executed.
-
-    xhr.open("GET", CouchDB.proxyUrl("/test_suite_db/_changes?feed=continuous&timeout=500"), true);
-    xhr.send("");
-
-    var docBar = {_id:"bar", bar:1};
-    db.save(docBar);
-
-    var lines, change1, change2;
-    waitForSuccess(function() {
-      lines = xhr.responseText.split("\n");
-      change1 = JSON.parse(lines[0]);
-      change2 = JSON.parse(lines[1]);
-      if (change2.seq != 2) {
-          throw "bad seq, try again";
-      }
-      return true;
-    }, "bar-only");
-
-    T(change1.seq == 1);
-    T(change1.id == "foo");
-
-    T(change2.seq == 2);
-    T(change2.id == "bar");
-    T(change2.changes[0].rev == docBar._rev);
-
-
-    var docBaz = {_id:"baz", baz:1};
-    db.save(docBaz);
-
-    var change3;
-    waitForSuccess(function() {
-      lines = xhr.responseText.split("\n");
-      change3 = JSON.parse(lines[2]);
-      if (change3.seq != 3) {
-        throw "bad seq, try again";
-      }
-      return true;
-    });
-
-    T(change3.seq == 3);
-    T(change3.id == "baz");
-    T(change3.changes[0].rev == docBaz._rev);
-
-
-    xhr = CouchDB.newXhr();
-
-    //verify the heartbeat newlines are sent
-    xhr.open("GET", CouchDB.proxyUrl("/test_suite_db/_changes?feed=continuous&heartbeat=10&timeout=500"), true);
-    xhr.send("");
-
-    var str;
-    waitForSuccess(function() {
-      str = xhr.responseText;
-      if (str.charAt(str.length - 1) != "\n" || str.charAt(str.length - 2) != "\n") {
-        throw("keep waiting");
-      }
-      return true;
-    }, "heartbeat");
-
-    T(str.charAt(str.length - 1) == "\n");
-    T(str.charAt(str.length - 2) == "\n");
-
-    // otherwise we'll continue to receive heartbeats forever
-    xhr.abort();
-
-    // test Server Sent Event (eventsource)
-    if (!!window.EventSource) {
-      var source = new EventSource(
-              "/test_suite_db/_changes?feed=eventsource");
-      var results = [];
-      var sourceListener = function(e) {
-        var data = JSON.parse(e.data);
-        results.push(data);
-      };
-
-      source.addEventListener('message', sourceListener , false);
-
-      waitForSuccess(function() {
-        if (results.length != 3) {
-          throw "bad seq, try again";
-        }
-        return true;
-      });
-
-      source.removeEventListener('message', sourceListener, false);
-
-      T(results[0].seq == 1);
-      T(results[0].id == "foo");
-
-      T(results[1].seq == 2);
-      T(results[1].id == "bar");
-      T(results[1].changes[0].rev == docBar._rev);
-    }
-
-    // test that we receive EventSource heartbeat events
-    if (!!window.EventSource) {
-      var source = new EventSource(
-              "/test_suite_db/_changes?feed=eventsource&heartbeat=10");
-
-      var count_heartbeats = 0;
-      source.addEventListener('heartbeat', function () { count_heartbeats = count_heartbeats + 1; } , false);
-
-      waitForSuccess(function() {
-        if (count_heartbeats < 3) {
-          throw "keep waiting";
-        }
-        return true;
-      }, "eventsource-heartbeat");
-
-      T(count_heartbeats >= 3);
-      source.close();
-    }
-
-    // test longpolling
-    xhr = CouchDB.newXhr();
-
-    xhr.open("GET", CouchDB.proxyUrl("/test_suite_db/_changes?feed=longpoll"), true);
-    xhr.send("");
-
-    waitForSuccess(function() {
-      lines = xhr.responseText.split("\n");
-      if (lines[5] != '"last_seq":3}') {
-        throw("still waiting");
-      }
-      return true;
-    }, "last_seq");
-
-    xhr = CouchDB.newXhr();
-
-    xhr.open("GET", CouchDB.proxyUrl("/test_suite_db/_changes?feed=longpoll&since=3"), true);
-    xhr.send("");
-
-    var docBarz = {_id:"barz", bar:1};
-    db.save(docBarz);
-
-    var parse_changes_line = function(line) {
-      if (line.charAt(line.length-1) == ",") {
-        var linetrimmed = line.substring(0, line.length-1);
-      } else {
-        var linetrimmed = line;
-      }
-      return JSON.parse(linetrimmed);
-    };
-
-    waitForSuccess(function() {
-      lines = xhr.responseText.split("\n");
-      if (lines[3] != '"last_seq":4}') {
-        throw("still waiting");
-      }
-      return true;
-    }, "change_lines");
-
-    var change = parse_changes_line(lines[1]);
-    T(change.seq == 4);
-    T(change.id == "barz");
-    T(change.changes[0].rev == docBarz._rev);
-    T(lines[3]=='"last_seq":4}');
-
-
-    // test since=now
-    xhr = CouchDB.newXhr();
-
-    xhr.open("GET", "/test_suite_db/_changes?feed=longpoll&since=now", true);
-    xhr.send("");
-
-    var docBarz = {_id:"barzzzz", bar:1};
-    db.save(docBarz);
-
-    var parse_changes_line = function(line) {
-      if (line.charAt(line.length-1) == ",") {
-        var linetrimmed = line.substring(0, line.length-1);
-      } else {
-        var linetrimmed = line;
-      }
-      return JSON.parse(linetrimmed);
-    };
-
-    waitForSuccess(function() {
-      lines = xhr.responseText.split("\n");
-      if (lines[3] != '"last_seq":5}') {
-        throw("still waiting");
-      }
-      return true;
-    }, "change_lines");
-
-    var change = parse_changes_line(lines[1]);
-    T(change.seq == 5);
-    T(change.id == "barzzzz");
-    T(change.changes[0].rev == docBarz._rev);
-    T(lines[3]=='"last_seq":5}');
-
-
-  }
-
-  // test the filtered changes
-  var ddoc = {
-    _id : "_design/changes_filter",
-    "filters" : {
-      "bop" : "function(doc, req) { return (doc.bop);}",
-      "dynamic" : stringFun(function(doc, req) {
-        var field = req.query.field;
-        return doc[field];
-      }),
-      "userCtx" : stringFun(function(doc, req) {
-        return doc.user && (doc.user == req.userCtx.name);
-      }),
-      "conflicted" : "function(doc, req) { return (doc._conflicts);}"
-    },
-    options : {
-      local_seq : true
-    },
-    views : {
-      local_seq : {
-        map : "function(doc) {emit(doc._local_seq, null)}"
-      },
-      blah: {
-        map : 'function(doc) {' +
-              '  if (doc._id == "blah") {' +
-              '    emit(null, null);' +
-              '  }' +
-              '}'
-      }
-    }
-  };
-
-  db.save(ddoc);
-
-  var req = CouchDB.request("GET", "/test_suite_db/_changes?filter=changes_filter/bop");
-  var resp = JSON.parse(req.responseText);
-  T(resp.results.length == 0);
-
-  db.save({"bop" : "foom"});
-  db.save({"bop" : false});
-
-  var req = CouchDB.request("GET", "/test_suite_db/_changes?filter=changes_filter/bop");
-  var resp = JSON.parse(req.responseText);
-  T(resp.results.length == 1, "filtered/bop");
-
-  req = CouchDB.request("GET", "/test_suite_db/_changes?filter=changes_filter/dynamic&field=woox");
-  resp = JSON.parse(req.responseText);
-  T(resp.results.length == 0);
-
-  req = CouchDB.request("GET", "/test_suite_db/_changes?filter=changes_filter/dynamic&field=bop");
-  resp = JSON.parse(req.responseText);
-  T(resp.results.length == 1, "changes_filter/dynamic&field=bop");
-
-  if (!is_safari && xhr) { // full test requires parallel connections
-    // filter with longpoll
-    // longpoll filters full history when run without a since seq
-    xhr = CouchDB.newXhr();
-    xhr.open("GET", CouchDB.proxyUrl("/test_suite_db/_changes?feed=longpoll&filter=changes_filter/bop"), false);
-    xhr.send("");
-    var resp = JSON.parse(xhr.responseText);
-    T(resp.last_seq == 8);
-    // longpoll waits until a matching change before returning
-    xhr = CouchDB.newXhr();
-    xhr.open("GET", CouchDB.proxyUrl("/test_suite_db/_changes?feed=longpoll&since=7&filter=changes_filter/bop"), true);
-    xhr.send("");
-    db.save({"_id":"falsy", "bop" : ""}); // empty string is falsy
-    db.save({"_id":"bingo","bop" : "bingo"});
-
-    waitForSuccess(function() {
-      resp = JSON.parse(xhr.responseText);
-      return true;
-    }, "longpoll-since");
-
-    T(resp.last_seq == 10);
-    T(resp.results && resp.results.length > 0 && resp.results[0]["id"] == "bingo", "filter the correct update");
-    xhr.abort();
-
-    var timeout = 500;
-    var last_seq = 11;
-    while (true) {
-
-      // filter with continuous
-      xhr = CouchDB.newXhr();
-      xhr.open("GET", CouchDB.proxyUrl("/test_suite_db/_changes?feed=continuous&filter=changes_filter/bop&timeout="+timeout), true);
-      xhr.send("");
-
-      db.save({"_id":"rusty", "bop" : "plankton"});
-      T(xhr.readyState != 4, "test client too slow");
-      var rusty = db.open("rusty", {cache_bust : new Date()});
-      T(rusty._id == "rusty");
-
-      waitForSuccess(function() { // throws an error after 5 seconds
-        if (xhr.readyState != 4) {
-          throw("still waiting");
-        }
-        return true;
-      }, "continuous-rusty");
-      lines = xhr.responseText.split("\n");
-      var good = false;
-      try {
-        JSON.parse(lines[3]);
-        good = true;
-      } catch(e) {
-      }
-      if (good) {
-        T(JSON.parse(lines[1]).id == "bingo", lines[1]);
-        T(JSON.parse(lines[2]).id == "rusty", lines[2]);
-        T(JSON.parse(lines[3]).last_seq == last_seq, lines[3]);
-        break;
-      } else {
-        xhr.abort();
-        db.deleteDoc(rusty);
-        timeout = timeout * 2;
-        last_seq = last_seq + 2;
-      }
-    }
-  }
-  // error conditions
-
-  // non-existing design doc
-  var req = CouchDB.request("GET",
-    "/test_suite_db/_changes?filter=nothingtosee/bop");
-  TEquals(404, req.status, "should return 404 for non existant design doc");
-
-  // non-existing filter
-  var req = CouchDB.request("GET",
-    "/test_suite_db/_changes?filter=changes_filter/movealong");
-  TEquals(404, req.status, "should return 404 for non existant filter fun");
-
-  // both
-  var req = CouchDB.request("GET",
-    "/test_suite_db/_changes?filter=nothingtosee/movealong");
-  TEquals(404, req.status,
-    "should return 404 for non existant design doc and filter fun");
-
-  // changes get all_docs style with deleted docs
-  var doc = {a:1};
-  db.save(doc);
-  db.deleteDoc(doc);
-  var req = CouchDB.request("GET",
-    "/test_suite_db/_changes?filter=changes_filter/bop&style=all_docs");
-  var resp = JSON.parse(req.responseText);
-  var expect = (!is_safari && xhr) ? 3: 1;
-  TEquals(expect, resp.results.length, "should return matching rows");
-
-  // test filter on view function (map)
-  //
-  T(db.save({"_id":"blah", "bop" : "plankton"}).ok);
-  var req = CouchDB.request("GET", "/test_suite_db/_changes?filter=_view&view=changes_filter/blah");
-  var resp = JSON.parse(req.responseText);
-  T(resp.results.length === 1);
-  T(resp.results[0].id === "blah");
-
-
-  // test for userCtx
-  run_on_modified_server(
-    [{section: "httpd",
-      key: "authentication_handlers",
-      value: "{couch_httpd_auth, special_test_authentication_handler}"},
-     {section:"httpd",
-      key: "WWW-Authenticate",
-      value:  "X-Couch-Test-Auth"}],
-
-    function() {
-      var authOpts = {"headers":{"WWW-Authenticate": "X-Couch-Test-Auth Chris Anderson:mp3"}};
-
-      var req = CouchDB.request("GET", "/_session", authOpts);
-      var resp = JSON.parse(req.responseText);
-
-      T(db.save({"user" : "Noah Slater"}).ok);
-      var req = CouchDB.request("GET", "/test_suite_db/_changes?filter=changes_filter/userCtx", authOpts);
-      var resp = JSON.parse(req.responseText);
-      T(resp.results.length == 0);
-
-      var docResp = db.save({"user" : "Chris Anderson"});
-      T(docResp.ok);
-      T(db.ensureFullCommit().ok);
-      req = CouchDB.request("GET", "/test_suite_db/_changes?filter=changes_filter/userCtx", authOpts);
-      resp = JSON.parse(req.responseText);
-      T(resp.results.length == 1, "userCtx");
-      T(resp.results[0].id == docResp.id);
-    }
-  );
-
-  req = CouchDB.request("GET", "/test_suite_db/_changes?limit=1");
-  resp = JSON.parse(req.responseText);
-  TEquals(1, resp.results.length);
-
-  //filter includes _conflicts
-  var id = db.save({'food' : 'pizza'}).id;
-  db.bulkSave([{_id: id, 'food' : 'pasta'}], {all_or_nothing:true});
-
-  req = CouchDB.request("GET", "/test_suite_db/_changes?filter=changes_filter/conflicted");
-  resp = JSON.parse(req.responseText);
-  T(resp.results.length == 1, "filter=changes_filter/conflicted");
-
-  // test with erlang filter function
-  run_on_modified_server([{
-    section: "native_query_servers",
-    key: "erlang",
-    value: "{couch_native_process, start_link, []}"
-  }], function() {
-    var erl_ddoc = {
-      _id: "_design/erlang",
-      language: "erlang",
-      filters: {
-        foo:
-          'fun({Doc}, Req) -> ' +
-          '  case couch_util:get_value(<<"value">>, Doc) of' +
-          '  undefined -> false;' +
-          '  Value -> (Value rem 2) =:= 0;' +
-          '  _ -> false' +
-          '  end ' +
-          'end.'
-      }
-    };
-
-    db.deleteDb();
-    db.createDb();
-    T(db.save(erl_ddoc).ok);
-
-    var req = CouchDB.request("GET", "/test_suite_db/_changes?filter=erlang/foo");
-    var resp = JSON.parse(req.responseText);
-    T(resp.results.length === 0);
-
-    T(db.save({_id: "doc1", value : 1}).ok);
-    T(db.save({_id: "doc2", value : 2}).ok);
-    T(db.save({_id: "doc3", value : 3}).ok);
-    T(db.save({_id: "doc4", value : 4}).ok);
-
-    var req = CouchDB.request("GET", "/test_suite_db/_changes?filter=erlang/foo");
-    var resp = JSON.parse(req.responseText);
-    T(resp.results.length === 2);
-    T(resp.results[0].id === "doc2");
-    T(resp.results[1].id === "doc4");
-
-    // test filtering on docids
-    //
-
-    var options = {
-        headers: {"Content-Type": "application/json"},
-        body: JSON.stringify({"doc_ids": ["something", "anotherthing", "andmore"]})
-    };
-
-    var req = CouchDB.request("POST", "/test_suite_db/_changes?filter=_doc_ids", options);
-    var resp = JSON.parse(req.responseText);
-    T(resp.results.length === 0);
-
-    T(db.save({"_id":"something", "bop" : "plankton"}).ok);
-    var req = CouchDB.request("POST", "/test_suite_db/_changes?filter=_doc_ids", options);
-    var resp = JSON.parse(req.responseText);
-    T(resp.results.length === 1);
-    T(resp.results[0].id === "something");
-
-    T(db.save({"_id":"anotherthing", "bop" : "plankton"}).ok);
-    var req = CouchDB.request("POST", "/test_suite_db/_changes?filter=_doc_ids", options);
-    var resp = JSON.parse(req.responseText);
-    T(resp.results.length === 2);
-    T(resp.results[0].id === "something");
-    T(resp.results[1].id === "anotherthing");
-
-    var docids = JSON.stringify(["something", "anotherthing", "andmore"]),
-        req = CouchDB.request("GET", "/test_suite_db/_changes?filter=_doc_ids&doc_ids="+docids, options);
-    var resp = JSON.parse(req.responseText);
-    T(resp.results.length === 2);
-    T(resp.results[0].id === "something");
-    T(resp.results[1].id === "anotherthing");
-
-    var req = CouchDB.request("GET", "/test_suite_db/_changes?filter=_design");
-    var resp = JSON.parse(req.responseText);
-    T(resp.results.length === 1);
-    T(resp.results[0].id === "_design/erlang");
-
-
-    if (!is_safari && xhr) {
-        // filter docids with continuous
-        xhr = CouchDB.newXhr();
-        xhr.open("POST", CouchDB.proxyUrl("/test_suite_db/_changes?feed=continuous&timeout=500&since=7&filter=_doc_ids"), true);
-        xhr.setRequestHeader("Content-Type", "application/json");
-
-        xhr.send(options.body);
-
-        T(db.save({"_id":"andmore", "bop" : "plankton"}).ok);
-
-        waitForSuccess(function() {
-            if (xhr.readyState != 4) {
-              throw("still waiting");
-            }
-            return true;
-        }, "andmore-only");
-
-        var line = JSON.parse(xhr.responseText.split("\n")[0]);
-        T(line.seq == 8);
-        T(line.id == "andmore");
-    }
-  });
-
-  // COUCHDB-1037 - empty result for ?limit=1&filter=foo/bar in some cases
-  T(db.deleteDb());
-  T(db.createDb());
-
-  ddoc = {
-    _id: "_design/testdocs",
-    filters: {
-      testdocsonly: (function(doc, req) {
-        return (typeof doc.integer === "number");
-      }).toString()
-    }
-  };
-  T(db.save(ddoc));
-
-  ddoc = {
-    _id: "_design/foobar",
-    foo: "bar"
-  };
-  T(db.save(ddoc));
-
-  db.bulkSave(makeDocs(0, 5));
-
-  req = CouchDB.request("GET", "/" + db.name + "/_changes");
-  resp = JSON.parse(req.responseText);
-  TEquals(7, resp.last_seq);
-  TEquals(7, resp.results.length);
-
-  req = CouchDB.request(
-    "GET", "/"+ db.name + "/_changes?limit=1&filter=testdocs/testdocsonly");
-  resp = JSON.parse(req.responseText);
-  TEquals(3, resp.last_seq);
-  TEquals(1, resp.results.length);
-  TEquals("0", resp.results[0].id);
-
-  req = CouchDB.request(
-    "GET", "/" + db.name + "/_changes?limit=2&filter=testdocs/testdocsonly");
-  resp = JSON.parse(req.responseText);
-  TEquals(4, resp.last_seq);
-  TEquals(2, resp.results.length);
-  TEquals("0", resp.results[0].id);
-  TEquals("1", resp.results[1].id);
-
-  TEquals(0, CouchDB.requestStats(['couchdb', 'httpd', 'clients_requesting_changes'], true).value);
-  CouchDB.request("GET", "/" + db.name + "/_changes");
-  TEquals(0, CouchDB.requestStats(['couchdb', 'httpd', 'clients_requesting_changes'], true).value);
-
-  // COUCHDB-1256
-  T(db.deleteDb());
-  T(db.createDb());
-
-  T(db.save({"_id":"foo", "a" : 123}).ok);
-  T(db.save({"_id":"bar", "a" : 456}).ok);
-
-  options = {
-      headers: {"Content-Type": "application/json"},
-      body: JSON.stringify({"_rev":"1-cc609831f0ca66e8cd3d4c1e0d98108a", "a":456})
-  };
-  req = CouchDB.request("PUT", "/" + db.name + "/foo?new_edits=false", options);
-
-  req = CouchDB.request("GET", "/" + db.name + "/_changes?style=all_docs");
-  resp = JSON.parse(req.responseText);
-
-  TEquals(3, resp.last_seq);
-  TEquals(2, resp.results.length);
-
-  req = CouchDB.request("GET", "/" + db.name + "/_changes?style=all_docs&since=2");
-  resp = JSON.parse(req.responseText);
-
-  TEquals(3, resp.last_seq);
-  TEquals(1, resp.results.length);
-  TEquals(2, resp.results[0].changes.length);
-
-  // COUCHDB-1852
-  T(db.deleteDb());
-  T(db.createDb());
-
-  // create 4 documents... this assumes the update sequnce will start from 0 and get to 4
-  db.save({"bop" : "foom"});
-  db.save({"bop" : "foom"});
-  db.save({"bop" : "foom"});
-  db.save({"bop" : "foom"});
-
-  // simulate an EventSource request with a Last-Event-ID header
-  req = CouchDB.request("GET", "/test_suite_db/_changes?feed=eventsource&timeout=0&since=0",
-        {"headers": {"Accept": "text/event-stream", "Last-Event-ID": "2"}});
-
-  // "parse" the eventsource response and collect only the "id: ..." lines
-  var changes = req.responseText.split('\n')
-     .map(function (el) {
-        return el.split(":").map(function (el) { return el.trim()});
-     })
-     .filter(function (el) { return (el[0] === "id"); })
-
-  // make sure we only got 2 changes, and they are update_seq=3 and update_seq=4
-  T(changes.length === 2);
-  T(changes[0][1] === "3");
-  T(changes[1][1] === "4");
-
-  // COUCHDB-1923
-  T(db.deleteDb());
-  T(db.createDb());
-
-  var attachmentData = "VGhpcyBpcyBhIGJhc2U2NCBlbmNvZGVkIHRleHQ=";
-
-  db.bulkSave(makeDocs(20, 30, {
-    _attachments:{
-      "foo.txt": {
-        content_type:"text/plain",
-        data: attachmentData
-      },
-      "bar.txt": {
-        content_type:"text/plain",
-        data: attachmentData
-      }
-    }
-  }));
-
-  var mapFunction = function(doc) {
-    var count = 0;
-
-    for(var idx in doc._attachments) {
-      count = count + 1;
-    }
-
-    emit(parseInt(doc._id), count);
-  };
-
-  var req = CouchDB.request("GET", "/test_suite_db/_changes?include_docs=true");
-  var resp = JSON.parse(req.responseText);
-
-  T(resp.results.length == 10);
-  T(resp.results[0].doc._attachments['foo.txt'].stub === true);
-  T(resp.results[0].doc._attachments['foo.txt'].data === undefined);
-  T(resp.results[0].doc._attachments['foo.txt'].encoding === undefined);
-  T(resp.results[0].doc._attachments['foo.txt'].encoded_length === undefined);
-  T(resp.results[0].doc._attachments['bar.txt'].stub === true);
-  T(resp.results[0].doc._attachments['bar.txt'].data === undefined);
-  T(resp.results[0].doc._attachments['bar.txt'].encoding === undefined);
-  T(resp.results[0].doc._attachments['bar.txt'].encoded_length === undefined);
-
-  var req = CouchDB.request("GET", "/test_suite_db/_changes?include_docs=true&attachments=true");
-  var resp = JSON.parse(req.responseText);
-
-  T(resp.results.length == 10);
-  T(resp.results[0].doc._attachments['foo.txt'].stub === undefined);
-  T(resp.results[0].doc._attachments['foo.txt'].data === attachmentData);
-  T(resp.results[0].doc._attachments['foo.txt'].encoding === undefined);
-  T(resp.results[0].doc._attachments['foo.txt'].encoded_length === undefined);
-  T(resp.results[0].doc._attachments['bar.txt'].stub === undefined);
-  T(resp.results[0].doc._attachments['bar.txt'].data == attachmentData);
-  T(resp.results[0].doc._attachments['bar.txt'].encoding === undefined);
-  T(resp.results[0].doc._attachments['bar.txt'].encoded_length === undefined);
-
-  var req = CouchDB.request("GET", "/test_suite_db/_changes?include_docs=true&att_encoding_info=true");
-  var resp = JSON.parse(req.responseText);
-
-  T(resp.results.length == 10);
-  T(resp.results[0].doc._attachments['foo.txt'].stub === true);
-  T(resp.results[0].doc._attachments['foo.txt'].data === undefined);
-  T(resp.results[0].doc._attachments['foo.txt'].encoding === "gzip");
-  T(resp.results[0].doc._attachments['foo.txt'].encoded_length === 47);
-  T(resp.results[0].doc._attachments['bar.txt'].stub === true);
-  T(resp.results[0].doc._attachments['bar.txt'].data === undefined);
-  T(resp.results[0].doc._attachments['bar.txt'].encoding === "gzip");
-  T(resp.results[0].doc._attachments['bar.txt'].encoded_length === 47);
-
-  // cleanup
-  db.deleteDb();
-};

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/www/script/test/coffee.js
----------------------------------------------------------------------
diff --git a/share/www/script/test/coffee.js b/share/www/script/test/coffee.js
deleted file mode 100644
index 9306124..0000000
--- a/share/www/script/test/coffee.js
+++ /dev/null
@@ -1,67 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
-// test basic coffeescript functionality
-couchTests.coffee = function(debug) {
-  var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"});
-  db.deleteDb();
-  db.createDb();
-  if (debug) debugger;
-
-  var ddoc = {
-    _id: "_design/coffee",
-    language: "coffeescript",
-    views: {
-      myview: {
-        map: '(doc) -> if doc.foo\n  emit(doc.foo, 1)',
-        reduce: '(keys, values, rereduce) ->\n  sum = 0\n  for x in values\n    sum = sum + x\n  sum'
-      }
-    },
-    shows: {
-      myshow: '(doc) ->\n  "Foo #{doc.foo}"'
-    },
-    lists: {
-      mylist: '(head, req) ->\n  while row = getRow()\n    send("Foo #{row.value}")\n  return "Foo"'
-    },
-    filters: {
-      filter: "(doc) ->\n  doc.foo"
-    }
-  };
-
-  db.save(ddoc);
-
-  var docs = [
-    {_id:"a", foo: 100},
-    {foo:1},
-    {foo:1},
-    {foo:2},
-    {foo:2},
-    {bar:1},
-    {bar:1},
-    {bar:2},
-    {bar:2}
-  ];
-
-  db.bulkSave(docs);
-
-  var res = db.view("coffee/myview");
-  TEquals(5, res.rows[0].value, "should sum up values");
-
-  var res = CouchDB.request("GET", "/" + db.name + "/_design/coffee/_show/myshow/a");
-  TEquals("Foo 100", res.responseText, "should show 100");
-
-  var res = CouchDB.request("GET", "/" + db.name + "/_design/coffee/_list/mylist/myview");
-  TEquals("Foo 5Foo", res.responseText, "should list");
-
-  var changes = db.changes({filter: "coffee/filter"});
-  TEquals(5, changes.results.length, "should have changes");
-};

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/www/script/test/compact.js
----------------------------------------------------------------------
diff --git a/share/www/script/test/compact.js b/share/www/script/test/compact.js
deleted file mode 100644
index 68c83b3..0000000
--- a/share/www/script/test/compact.js
+++ /dev/null
@@ -1,65 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
-couchTests.compact = function(debug) {
-  var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"});
-  db.deleteDb();
-  db.createDb();
-  if (debug) debugger;
-  var docs = makeDocs(0, 20);
-  db.bulkSave(docs);
-
-  var binAttDoc = {
-    _id: "bin_doc",
-    _attachments:{
-      "foo.txt": {
-        content_type:"text/plain",
-        data: "VGhpcyBpcyBhIGJhc2U2NCBlbmNvZGVkIHRleHQ="
-      }
-    }
-  };
-
-  T(db.save(binAttDoc).ok);
-
-  var originalsize = db.info().disk_size;
-  var originaldatasize = db.info().data_size;
-  var start_time = db.info().instance_start_time;
-
-  TEquals("number", typeof originaldatasize, "data_size is a number");
-  T(originaldatasize < originalsize, "data size is < then db file size");
-
-  for(var i in docs) {
-      db.deleteDoc(docs[i]);
-  }
-  T(db.ensureFullCommit().ok);
-  var deletesize = db.info().disk_size;
-  T(deletesize > originalsize);
-  T(db.setDbProperty("_revs_limit", 666).ok);
-
-  T(db.compact().ok);
-  T(db.last_req.status == 202);
-  // compaction isn't instantaneous, loop until done
-  while (db.info().compact_running) {};
-  T(db.info().instance_start_time == start_time);
-  T(db.getDbProperty("_revs_limit") === 666);
-
-  T(db.ensureFullCommit().ok);
-  restartServer();
-  var xhr = CouchDB.request("GET", "/test_suite_db/bin_doc/foo.txt");
-  T(xhr.responseText == "This is a base64 encoded text");
-  T(xhr.getResponseHeader("Content-Type") == "text/plain");
-  T(db.info().doc_count == 1);
-  T(db.info().disk_size < deletesize);
-  TEquals("number", typeof db.info().data_size, "data_size is a number");
-  T(db.info().data_size < db.info().disk_size, "data size is < then db file size");
-
-};

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/www/script/test/config.js
----------------------------------------------------------------------
diff --git a/share/www/script/test/config.js b/share/www/script/test/config.js
deleted file mode 100644
index 37b339b..0000000
--- a/share/www/script/test/config.js
+++ /dev/null
@@ -1,211 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
-couchTests.config = function(debug) {
-  var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"});
-  db.deleteDb();
-  db.createDb();
-  if (debug) debugger;
-
-  // test that /_config returns all the settings
-  var xhr = CouchDB.request("GET", "/_config");
-  var config = JSON.parse(xhr.responseText);
-
-  /*
-    if we run on standard ports, we can't extract
-    the number from the URL. Instead we try to guess
-    from the protocol what port we are running on.
-    If we can't guess, we don't test for the port.
-    Overengineering FTW.
-  */
-  var server_port = CouchDB.host.split(':');
-  if(server_port.length == 1 && CouchDB.inBrowser) {
-    if(CouchDB.protocol == "http://") {
-      port = "80";
-    }
-    if(CouchDB.protocol == "https://") {
-      port = "443";
-    }
-  } else {
-    port = server_port.pop();
-  }
-
-  if(CouchDB.protocol == "http://") {
-    config_port = config.httpd.port;
-  }
-  if(CouchDB.protocol == "https://") {
-    config_port = config.ssl.port;
-  }
-
-  if(port && config_port != "0") {
-    TEquals(config_port, port, "ports should match");
-  }
-
-  T(config.couchdb.database_dir);
-  T(config.daemons.httpd);
-  T(config.httpd_global_handlers._config);
-  // T(config.log.level);
-  T(config.query_servers.javascript);
-
-  // test that settings can be altered, and that an undefined whitelist allows any change
-  TEquals(undefined, config.httpd.config_whitelist, "Default whitelist is empty");
-  xhr = CouchDB.request("PUT", "/_config/test/foo",{
-    body : JSON.stringify("bar"),
-    headers: {"X-Couch-Persist": "false"}
-  });
-  T(xhr.status == 200);
-  xhr = CouchDB.request("GET", "/_config/test");
-  config = JSON.parse(xhr.responseText);
-  T(config.foo == "bar");
-
-  // you can get a single key
-  xhr = CouchDB.request("GET", "/_config/test/foo");
-  config = JSON.parse(xhr.responseText);
-  T(config == "bar");
-
-  // Server-side password hashing, and raw updates disabling that.
-  var password_plain = 's3cret';
-  var password_hashed = null;
-
-  xhr = CouchDB.request("PUT", "/_config/admins/administrator",{
-    body : JSON.stringify(password_plain),
-    headers: {"X-Couch-Persist": "false"}
-  });
-  TEquals(200, xhr.status, "Create an admin in the config");
-
-  T(CouchDB.login("administrator", password_plain).ok);
-
-  xhr = CouchDB.request("GET", "/_config/admins/administrator");
-  password_hashed = JSON.parse(xhr.responseText);
-  T(password_hashed.match(/^-pbkdf2-/) || password_hashed.match(/^-hashed-/),
-    "Admin password is hashed");
-
-  xhr = CouchDB.request("PUT", "/_config/admins/administrator?raw=nothanks",{
-    body : JSON.stringify(password_hashed),
-    headers: {"X-Couch-Persist": "false"}
-  });
-  TEquals(400, xhr.status, "CouchDB rejects an invalid 'raw' option");
-
-  xhr = CouchDB.request("PUT", "/_config/admins/administrator?raw=true",{
-    body : JSON.stringify(password_hashed),
-    headers: {"X-Couch-Persist": "false"}
-  });
-  TEquals(200, xhr.status, "Set an raw, pre-hashed admin password");
-
-  xhr = CouchDB.request("PUT", "/_config/admins/administrator?raw=false",{
-    body : JSON.stringify(password_hashed),
-    headers: {"X-Couch-Persist": "false"}
-  });
-  TEquals(200, xhr.status, "Set an admin password with raw=false");
-
-  // The password is literally the string "-pbkdf2-abcd...".
-  T(CouchDB.login("administrator", password_hashed).ok);
-
-  xhr = CouchDB.request("GET", "/_config/admins/administrator");
-  T(password_hashed != JSON.parse(xhr.responseText),
-    "Hashed password was not stored as a raw string");
-
-  xhr = CouchDB.request("DELETE", "/_config/admins/administrator",{
-    headers: {"X-Couch-Persist": "false"}
-  });
-  TEquals(200, xhr.status, "Delete an admin from the config");
-  T(CouchDB.logout().ok);
-
-  // Non-term whitelist values allow further modification of the whitelist.
-  xhr = CouchDB.request("PUT", "/_config/httpd/config_whitelist",{
-    body : JSON.stringify("!This is an invalid Erlang term!"),
-    headers: {"X-Couch-Persist": "false"}
-  });
-  TEquals(200, xhr.status, "Set config whitelist to an invalid Erlang term");
-  xhr = CouchDB.request("DELETE", "/_config/httpd/config_whitelist",{
-    headers: {"X-Couch-Persist": "false"}
-  });
-  TEquals(200, xhr.status, "Modify whitelist despite it being invalid syntax");
-
-  // Non-list whitelist values allow further modification of the whitelist.
-  xhr = CouchDB.request("PUT", "/_config/httpd/config_whitelist",{
-    body : JSON.stringify("{[yes, a_valid_erlang_term, but_unfortunately, not_a_list]}"),
-    headers: {"X-Couch-Persist": "false"}
-  });
-  TEquals(200, xhr.status, "Set config whitelist to an non-list term");
-  xhr = CouchDB.request("DELETE", "/_config/httpd/config_whitelist",{
-    headers: {"X-Couch-Persist": "false"}
-  });
-  TEquals(200, xhr.status, "Modify whitelist despite it not being a list");
-
-  // Keys not in the whitelist may not be modified.
-  xhr = CouchDB.request("PUT", "/_config/httpd/config_whitelist",{
-    body : JSON.stringify("[{httpd,config_whitelist}, {test,foo}]"),
-    headers: {"X-Couch-Persist": "false"}
-  });
-  TEquals(200, xhr.status, "Set config whitelist to something valid");
-
-  ["PUT", "DELETE"].forEach(function(method) {
-    ["test/not_foo", "not_test/foo", "neither_test/nor_foo"].forEach(function(pair) {
-      var path = "/_config/" + pair;
-      var test_name = method + " to " + path + " disallowed: not whitelisted";
-
-      xhr = CouchDB.request(method, path, {
-        body : JSON.stringify("Bummer! " + test_name),
-        headers: {"X-Couch-Persist": "false"}
-      });
-      TEquals(400, xhr.status, test_name);
-    });
-  });
-
-  // Keys in the whitelist may be modified.
-  ["PUT", "DELETE"].forEach(function(method) {
-    xhr = CouchDB.request(method, "/_config/test/foo",{
-      body : JSON.stringify(method + " to whitelisted config variable"),
-      headers: {"X-Couch-Persist": "false"}
-    });
-    TEquals(200, xhr.status, "Keys in the whitelist may be modified");
-  });
-
-  // Non-2-tuples in the whitelist are ignored
-  xhr = CouchDB.request("PUT", "/_config/httpd/config_whitelist",{
-    body : JSON.stringify("[{httpd,config_whitelist}, these, {are}, {nOt, 2, tuples}," +
-                          " [so], [they, will], [all, become, noops], {test,foo}]"),
-    headers: {"X-Couch-Persist": "false"}
-  });
-  TEquals(200, xhr.status, "Set config whitelist with some inert values");
-  ["PUT", "DELETE"].forEach(function(method) {
-    xhr = CouchDB.request(method, "/_config/test/foo",{
-      body : JSON.stringify(method + " to whitelisted config variable"),
-      headers: {"X-Couch-Persist": "false"}
-    });
-    TEquals(200, xhr.status, "Update whitelisted variable despite invalid entries");
-  });
-
-  // Atoms, binaries, and strings suffice as whitelist sections and keys.
-  ["{test,foo}", '{"test","foo"}', '{<<"test">>,<<"foo">>}'].forEach(function(pair) {
-    xhr = CouchDB.request("PUT", "/_config/httpd/config_whitelist",{
-      body : JSON.stringify("[{httpd,config_whitelist}, " + pair + "]"),
-      headers: {"X-Couch-Persist": "false"}
-    });
-    TEquals(200, xhr.status, "Set config whitelist to include " + pair);
-
-    var pair_format = {"t":"tuple", '"':"string", "<":"binary"}[pair[1]];
-    ["PUT", "DELETE"].forEach(function(method) {
-      xhr = CouchDB.request(method, "/_config/test/foo",{
-        body : JSON.stringify(method + " with " + pair_format),
-        headers: {"X-Couch-Persist": "false"}
-      });
-      TEquals(200, xhr.status, "Whitelist works with " + pair_format);
-    });
-  });
-
-  xhr = CouchDB.request("DELETE", "/_config/httpd/config_whitelist",{
-    headers: {"X-Couch-Persist": "false"}
-  });
-  TEquals(200, xhr.status, "Reset config whitelist to undefined");
-};

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/www/script/test/conflicts.js
----------------------------------------------------------------------
diff --git a/share/www/script/test/conflicts.js b/share/www/script/test/conflicts.js
deleted file mode 100644
index 79266ab..0000000
--- a/share/www/script/test/conflicts.js
+++ /dev/null
@@ -1,119 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
-// Do some edit conflict detection tests
-couchTests.conflicts = function(debug) {
-  var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"});
-  db.deleteDb();
-  db.createDb();
-  if (debug) debugger;
-
-  // create a doc and save
-  var doc = {_id:"foo",a:1,b:1};
-  T(db.save(doc).ok);
-
-  // reopen
-  var doc2 = db.open(doc._id);
-
-  // ensure the revisions are the same
-  T(doc._id == doc2._id && doc._rev == doc2._rev);
-
-  // edit the documents.
-  doc.a = 2;
-  doc2.a = 3;
-
-  // save one document
-  T(db.save(doc).ok);
-
-  // save the other document
-  try {
-    db.save(doc2);  // this should generate a conflict exception
-    T("no save conflict 1" && false); // we shouldn't hit here
-  } catch (e) {
-    T(e.error == "conflict");
-  }
-
-  var changes = db.changes();
-
-  T(changes.results.length == 1);
-
-  // Now clear out the _rev member and save. This indicates this document is
-  // new, not based on an existing revision.
-  doc2._rev = undefined;
-  try {
-    db.save(doc2); // this should generate a conflict exception
-    T("no save conflict 2" && false); // we shouldn't hit here
-  } catch (e) {
-    T(e.error == "conflict");
-  }
-
-  // Make a few bad requests, specifying conflicting revs
-  // ?rev doesn't match body
-  var xhr = CouchDB.request("PUT", "/test_suite_db/foo?rev=1-foobar", {
-    body : JSON.stringify(doc)
-  });
-  T(xhr.status == 400);
-
-  // If-Match doesn't match body
-  xhr = CouchDB.request("PUT", "/test_suite_db/foo", {
-    headers: {"If-Match": "1-foobar"},
-    body: JSON.stringify(doc)
-  });
-  T(xhr.status == 400);
-
-  // ?rev= doesn't match If-Match
-  xhr = CouchDB.request("PUT", "/test_suite_db/foo?rev=1-boobaz", {
-    headers: {"If-Match": "1-foobar"},
-    body: JSON.stringify(doc2)
-  });
-  T(xhr.status == 400);
-
-  // Now update the document using ?rev=
-  xhr = CouchDB.request("PUT", "/test_suite_db/foo?rev=" + doc._rev, {
-    body: JSON.stringify(doc)
-  });
-  T(xhr.status == 201);
-
-  // reopen
-  var doc = db.open(doc._id);
-
-  // Now delete the document from the database
-  T(db.deleteDoc(doc).ok);
-
-  T(db.save(doc2).ok);  // we can save a new document over a deletion without
-                        // knowing the deletion rev.
-
-  // Verify COUCHDB-1178
-  var r1 = {"_id":"doc","foo":"bar"};
-  var r2 = {"_id":"doc","foo":"baz","_rev":"1-4c6114c65e295552ab1019e2b046b10e"};
-  var r3 = {"_id":"doc","foo":"bam","_rev":"2-cfcd6781f13994bde69a1c3320bfdadb"};
-  var r4 = {"_id":"doc","foo":"bat","_rev":"3-cc2f3210d779aef595cd4738be0ef8ff"};
-
-  T(db.save({"_id":"_design/couchdb-1178","validate_doc_update":"function(){}"}).ok);
-  T(db.save(r1).ok);
-  T(db.save(r2).ok);
-  T(db.save(r3).ok);
-
-  T(db.compact().ok);
-  while (db.info().compact_running) {};
-
-  TEquals({"_id":"doc",
-        "_rev":"3-cc2f3210d779aef595cd4738be0ef8ff",
-        "foo":"bam",
-        "_revisions":{"start":3,
-          "ids":["cc2f3210d779aef595cd4738be0ef8ff",
-                 "cfcd6781f13994bde69a1c3320bfdadb",
-                                      "4c6114c65e295552ab1019e2b046b10e"]}},
-    db.open("doc", {"revs": true}));
-  TEquals([], db.bulkSave([r4, r3, r2], {"new_edits":false}), "no failures");
-
-};

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/www/script/test/content_negotiation.js
----------------------------------------------------------------------
diff --git a/share/www/script/test/content_negotiation.js b/share/www/script/test/content_negotiation.js
deleted file mode 100644
index 36e7dfb..0000000
--- a/share/www/script/test/content_negotiation.js
+++ /dev/null
@@ -1,39 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
-couchTests.content_negotiation = function(debug) {
-  var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"});
-  db.deleteDb();
-  db.createDb();
-  if (debug) debugger;
-  var xhr;
-
-  // with no accept header
-  var req = CouchDB.newXhr();
-  req.open("GET", CouchDB.proxyUrl("/test_suite_db/"), false);
-  req.send("");
-  TEquals("text/plain; charset=utf-8", req.getResponseHeader("Content-Type"));
-
-  // make sure JSON responses end in a newline
-  var text = req.responseText;
-  TEquals("\n", text[text.length-1]);
-
-  xhr = CouchDB.request("GET", "/test_suite_db/", {
-    headers: {"Accept": "text/html; text/plain;*/*"}
-  });
-  TEquals("text/plain; charset=utf-8", xhr.getResponseHeader("Content-Type"));
-
-  xhr = CouchDB.request("GET", "/test_suite_db/", {
-    headers: {"Accept": "application/json"}
-  });
-  TEquals("application/json", xhr.getResponseHeader("Content-Type"));
-};


[28/37] goodbye Futon, old friend <3

Posted by ja...@apache.org.
http://git-wip-us.apache.org/repos/asf/couchdb/blob/cca309f3/share/www/fauxton/js/require.js
----------------------------------------------------------------------
diff --git a/share/www/fauxton/js/require.js b/share/www/fauxton/js/require.js
deleted file mode 100644
index b3552a8..0000000
--- a/share/www/fauxton/js/require.js
+++ /dev/null
@@ -1,35 +0,0 @@
-var requirejs,require,define;!function(global){function isFunction(a){return"[object Function]"===ostring.call(a)}function isArray(a){return"[object Array]"===ostring.call(a)}function each(a,b){if(a){var c;for(c=0;c<a.length&&(!a[c]||!b(a[c],c,a));c+=1);}}function eachReverse(a,b){if(a){var c;for(c=a.length-1;c>-1&&(!a[c]||!b(a[c],c,a));c-=1);}}function hasProp(a,b){return hasOwn.call(a,b)}function getOwn(a,b){return hasProp(a,b)&&a[b]}function eachProp(a,b){var c;for(c in a)if(hasProp(a,c)&&b(a[c],c))break}function mixin(a,b,c,d){return b&&eachProp(b,function(b,e){(c||!hasProp(a,e))&&(d&&"string"!=typeof b?(a[e]||(a[e]={}),mixin(a[e],b,c,d)):a[e]=b)}),a}function bind(a,b){return function(){return b.apply(a,arguments)}}function scripts(){return document.getElementsByTagName("script")}function defaultOnError(a){throw a}function getGlobal(a){if(!a)return a;var b=global;return each(a.split("."),function(a){b=b[a]}),b}function makeError(a,b,c,d){var e=new Error(b+"\nhttp://requirejs.org
 /docs/errors.html#"+a);return e.requireType=a,e.requireModules=d,c&&(e.originalError=c),e}function newContext(a){function b(a){var b,c;for(b=0;a[b];b+=1)if(c=a[b],"."===c)a.splice(b,1),b-=1;else if(".."===c){if(1===b&&(".."===a[2]||".."===a[0]))break;b>0&&(a.splice(b-1,2),b-=2)}}function c(a,c,d){var e,f,g,h,i,j,k,l,m,n,o,p=c&&c.split("/"),q=p,r=x.map,s=r&&r["*"];if(a&&"."===a.charAt(0)&&(c?(q=getOwn(x.pkgs,c)?p=[c]:p.slice(0,p.length-1),a=q.concat(a.split("/")),b(a),f=getOwn(x.pkgs,e=a[0]),a=a.join("/"),f&&a===e+"/"+f.main&&(a=e)):0===a.indexOf("./")&&(a=a.substring(2))),d&&r&&(p||s)){for(h=a.split("/"),i=h.length;i>0;i-=1){if(k=h.slice(0,i).join("/"),p)for(j=p.length;j>0;j-=1)if(g=getOwn(r,p.slice(0,j).join("/")),g&&(g=getOwn(g,k))){l=g,m=i;break}if(l)break;!n&&s&&getOwn(s,k)&&(n=getOwn(s,k),o=i)}!l&&n&&(l=n,m=o),l&&(h.splice(0,m,l),a=h.join("/"))}return a}function d(a){isBrowser&&each(scripts(),function(b){return b.getAttribute("data-requiremodule")===a&&b.getAttribute("data-requ
 irecontext")===u.contextName?(b.parentNode.removeChild(b),!0):void 0})}function e(a){var b=getOwn(x.paths,a);return b&&isArray(b)&&b.length>1?(d(a),b.shift(),u.require.undef(a),u.require([a]),!0):void 0}function f(a){var b,c=a?a.indexOf("!"):-1;return c>-1&&(b=a.substring(0,c),a=a.substring(c+1,a.length)),[b,a]}function g(a,b,d,e){var g,h,i,j,k=null,l=b?b.name:null,m=a,n=!0,o="";return a||(n=!1,a="_@r"+(E+=1)),j=f(a),k=j[0],a=j[1],k&&(k=c(k,l,e),h=getOwn(C,k)),a&&(k?o=h&&h.normalize?h.normalize(a,function(a){return c(a,l,e)}):c(a,l,e):(o=c(a,l,e),j=f(o),k=j[0],o=j[1],d=!0,g=u.nameToUrl(o))),i=!k||h||d?"":"_unnormalized"+(F+=1),{prefix:k,name:o,parentMap:b,unnormalized:!!i,url:g,originalName:m,isDefine:n,id:(k?k+"!"+o:o)+i}}function h(a){var b=a.id,c=getOwn(y,b);return c||(c=y[b]=new u.Module(a)),c}function i(a,b,c){var d=a.id,e=getOwn(y,d);!hasProp(C,d)||e&&!e.defineEmitComplete?(e=h(a),e.error&&"error"===b?c(e.error):e.on(b,c)):"defined"===b&&c(C[d])}function j(a,b){var c=a.require
 Modules,d=!1;b?b(a):(each(c,function(b){var c=getOwn(y,b);c&&(c.error=a,c.events.error&&(d=!0,c.emit("error",a)))}),d||req.onError(a))}function k(){globalDefQueue.length&&(apsp.apply(B,[B.length-1,0].concat(globalDefQueue)),globalDefQueue=[])}function l(a){delete y[a],delete z[a]}function m(a,b,c){var d=a.map.id;a.error?a.emit("error",a.error):(b[d]=!0,each(a.depMaps,function(d,e){var f=d.id,g=getOwn(y,f);!g||a.depMatched[e]||c[f]||(getOwn(b,f)?(a.defineDep(e,C[f]),a.check()):m(g,b,c))}),c[d]=!0)}function n(){var a,b,c,f,g=1e3*x.waitSeconds,h=g&&u.startTime+g<(new Date).getTime(),i=[],k=[],l=!1,o=!0;if(!s){if(s=!0,eachProp(z,function(c){if(a=c.map,b=a.id,c.enabled&&(a.isDefine||k.push(c),!c.error))if(!c.inited&&h)e(b)?(f=!0,l=!0):(i.push(b),d(b));else if(!c.inited&&c.fetched&&a.isDefine&&(l=!0,!a.prefix))return o=!1}),h&&i.length)return c=makeError("timeout","Load timeout for modules: "+i,null,i),c.contextName=u.contextName,j(c);o&&each(k,function(a){m(a,{},{})}),h&&!f||!l||!isBrows
 er&&!isWebWorker||w||(w=setTimeout(function(){w=0,n()},50)),s=!1}}function o(a){hasProp(C,a[0])||h(g(a[0],null,!0)).init(a[1],a[2])}function p(a,b,c,d){a.detachEvent&&!isOpera?d&&a.detachEvent(d,b):a.removeEventListener(c,b,!1)}function q(a){var b=a.currentTarget||a.srcElement;return p(b,u.onScriptLoad,"load","onreadystatechange"),p(b,u.onScriptError,"error"),{node:b,id:b&&b.getAttribute("data-requiremodule")}}function r(){var a;for(k();B.length;){if(a=B.shift(),null===a[0])return j(makeError("mismatch","Mismatched anonymous define() module: "+a[a.length-1]));o(a)}}var s,t,u,v,w,x={waitSeconds:7,baseUrl:"./",paths:{},pkgs:{},shim:{},config:{}},y={},z={},A={},B=[],C={},D={},E=1,F=1;return v={require:function(a){return a.require?a.require:a.require=u.makeRequire(a.map)},exports:function(a){return a.usingExports=!0,a.map.isDefine?a.exports?a.exports:a.exports=C[a.map.id]={}:void 0},module:function(a){return a.module?a.module:a.module={id:a.map.id,uri:a.map.url,config:function(){var b,c
 =getOwn(x.pkgs,a.map.id);return b=c?getOwn(x.config,a.map.id+"/"+c.main):getOwn(x.config,a.map.id),b||{}},exports:C[a.map.id]}}},t=function(a){this.events=getOwn(A,a.id)||{},this.map=a,this.shim=getOwn(x.shim,a.id),this.depExports=[],this.depMaps=[],this.depMatched=[],this.pluginMaps={},this.depCount=0},t.prototype={init:function(a,b,c,d){d=d||{},this.inited||(this.factory=b,c?this.on("error",c):this.events.error&&(c=bind(this,function(a){this.emit("error",a)})),this.depMaps=a&&a.slice(0),this.errback=c,this.inited=!0,this.ignore=d.ignore,d.enabled||this.enabled?this.enable():this.check())},defineDep:function(a,b){this.depMatched[a]||(this.depMatched[a]=!0,this.depCount-=1,this.depExports[a]=b)},fetch:function(){if(!this.fetched){this.fetched=!0,u.startTime=(new Date).getTime();var a=this.map;return this.shim?(u.makeRequire(this.map,{enableBuildCallback:!0})(this.shim.deps||[],bind(this,function(){return a.prefix?this.callPlugin():this.load()})),void 0):a.prefix?this.callPlugin():th
 is.load()}},load:function(){var a=this.map.url;D[a]||(D[a]=!0,u.load(this.map.id,a))},check:function(){if(this.enabled&&!this.enabling){var a,b,c=this.map.id,d=this.depExports,e=this.exports,f=this.factory;if(this.inited){if(this.error)this.emit("error",this.error);else if(!this.defining){if(this.defining=!0,this.depCount<1&&!this.defined){if(isFunction(f)){if(this.events.error&&this.map.isDefine||req.onError!==defaultOnError)try{e=u.execCb(c,f,d,e)}catch(g){a=g}else e=u.execCb(c,f,d,e);if(this.map.isDefine&&(b=this.module,b&&void 0!==b.exports&&b.exports!==this.exports?e=b.exports:void 0===e&&this.usingExports&&(e=this.exports)),a)return a.requireMap=this.map,a.requireModules=this.map.isDefine?[this.map.id]:null,a.requireType=this.map.isDefine?"define":"require",j(this.error=a)}else e=f;this.exports=e,this.map.isDefine&&!this.ignore&&(C[c]=e,req.onResourceLoad&&req.onResourceLoad(u,this.map,this.depMaps)),l(c),this.defined=!0}this.defining=!1,this.defined&&!this.defineEmitted&&(thi
 s.defineEmitted=!0,this.emit("defined",this.exports),this.defineEmitComplete=!0)}}else this.fetch()}},callPlugin:function(){var a=this.map,b=a.id,d=g(a.prefix);this.depMaps.push(d),i(d,"defined",bind(this,function(d){var e,f,k,m=this.map.name,n=this.map.parentMap?this.map.parentMap.name:null,o=u.makeRequire(a.parentMap,{enableBuildCallback:!0});return this.map.unnormalized?(d.normalize&&(m=d.normalize(m,function(a){return c(a,n,!0)})||""),f=g(a.prefix+"!"+m,this.map.parentMap),i(f,"defined",bind(this,function(a){this.init([],function(){return a},null,{enabled:!0,ignore:!0})})),k=getOwn(y,f.id),k&&(this.depMaps.push(f),this.events.error&&k.on("error",bind(this,function(a){this.emit("error",a)})),k.enable()),void 0):(e=bind(this,function(a){this.init([],function(){return a},null,{enabled:!0})}),e.error=bind(this,function(a){this.inited=!0,this.error=a,a.requireModules=[b],eachProp(y,function(a){0===a.map.id.indexOf(b+"_unnormalized")&&l(a.map.id)}),j(a)}),e.fromText=bind(this,function
 (c,d){var f=a.name,i=g(f),k=useInteractive;d&&(c=d),k&&(useInteractive=!1),h(i),hasProp(x.config,b)&&(x.config[f]=x.config[b]);try{req.exec(c)}catch(l){return j(makeError("fromtexteval","fromText eval for "+b+" failed: "+l,l,[b]))}k&&(useInteractive=!0),this.depMaps.push(i),u.completeLoad(f),o([f],e)}),d.load(a.name,o,e,x),void 0)})),u.enable(d,this),this.pluginMaps[d.id]=d},enable:function(){z[this.map.id]=this,this.enabled=!0,this.enabling=!0,each(this.depMaps,bind(this,function(a,b){var c,d,e;if("string"==typeof a){if(a=g(a,this.map.isDefine?this.map:this.map.parentMap,!1,!this.skipMap),this.depMaps[b]=a,e=getOwn(v,a.id))return this.depExports[b]=e(this),void 0;this.depCount+=1,i(a,"defined",bind(this,function(a){this.defineDep(b,a),this.check()})),this.errback&&i(a,"error",bind(this,this.errback))}c=a.id,d=y[c],hasProp(v,c)||!d||d.enabled||u.enable(a,this)})),eachProp(this.pluginMaps,bind(this,function(a){var b=getOwn(y,a.id);b&&!b.enabled&&u.enable(a,this)})),this.enabling=!1,t
 his.check()},on:function(a,b){var c=this.events[a];c||(c=this.events[a]=[]),c.push(b)},emit:function(a,b){each(this.events[a],function(a){a(b)}),"error"===a&&delete this.events[a]}},u={config:x,contextName:a,registry:y,defined:C,urlFetched:D,defQueue:B,Module:t,makeModuleMap:g,nextTick:req.nextTick,onError:j,configure:function(a){a.baseUrl&&"/"!==a.baseUrl.charAt(a.baseUrl.length-1)&&(a.baseUrl+="/");var b=x.pkgs,c=x.shim,d={paths:!0,config:!0,map:!0};eachProp(a,function(a,b){d[b]?"map"===b?(x.map||(x.map={}),mixin(x[b],a,!0,!0)):mixin(x[b],a,!0):x[b]=a}),a.shim&&(eachProp(a.shim,function(a,b){isArray(a)&&(a={deps:a}),!a.exports&&!a.init||a.exportsFn||(a.exportsFn=u.makeShimExports(a)),c[b]=a}),x.shim=c),a.packages&&(each(a.packages,function(a){var c;a="string"==typeof a?{name:a}:a,c=a.location,b[a.name]={name:a.name,location:c||a.name,main:(a.main||"main").replace(currDirRegExp,"").replace(jsSuffixRegExp,"")}}),x.pkgs=b),eachProp(y,function(a,b){a.inited||a.map.unnormalized||(a.map
 =g(b))}),(a.deps||a.callback)&&u.require(a.deps||[],a.callback)},makeShimExports:function(a){function b(){var b;return a.init&&(b=a.init.apply(global,arguments)),b||a.exports&&getGlobal(a.exports)}return b},makeRequire:function(b,d){function e(c,f,i){var k,l,m;return d.enableBuildCallback&&f&&isFunction(f)&&(f.__requireJsBuild=!0),"string"==typeof c?isFunction(f)?j(makeError("requireargs","Invalid require call"),i):b&&hasProp(v,c)?v[c](y[b.id]):req.get?req.get(u,c,b,e):(l=g(c,b,!1,!0),k=l.id,hasProp(C,k)?C[k]:j(makeError("notloaded",'Module name "'+k+'" has not been loaded yet for context: '+a+(b?"":". Use require([])")))):(r(),u.nextTick(function(){r(),m=h(g(null,b)),m.skipMap=d.skipMap,m.init(c,f,i,{enabled:!0}),n()}),e)}return d=d||{},mixin(e,{isBrowser:isBrowser,toUrl:function(a){var d,e=a.lastIndexOf("."),f=a.split("/")[0],g="."===f||".."===f;return-1!==e&&(!g||e>1)&&(d=a.substring(e,a.length),a=a.substring(0,e)),u.nameToUrl(c(a,b&&b.id,!0),d,!0)},defined:function(a){return has
 Prop(C,g(a,b,!1,!0).id)},specified:function(a){return a=g(a,b,!1,!0).id,hasProp(C,a)||hasProp(y,a)}}),b||(e.undef=function(a){k();var c=g(a,b,!0),d=getOwn(y,a);delete C[a],delete D[c.url],delete A[a],d&&(d.events.defined&&(A[a]=d.events),l(a))}),e},enable:function(a){var b=getOwn(y,a.id);b&&h(a).enable()},completeLoad:function(a){var b,c,d,f=getOwn(x.shim,a)||{},g=f.exports;for(k();B.length;){if(c=B.shift(),null===c[0]){if(c[0]=a,b)break;b=!0}else c[0]===a&&(b=!0);o(c)}if(d=getOwn(y,a),!b&&!hasProp(C,a)&&d&&!d.inited){if(!(!x.enforceDefine||g&&getGlobal(g)))return e(a)?void 0:j(makeError("nodefine","No define call for "+a,null,[a]));o([a,f.deps||[],f.exportsFn])}n()},nameToUrl:function(a,b,c){var d,e,f,g,h,i,j,k,l;if(req.jsExtRegExp.test(a))k=a+(b||"");else{for(d=x.paths,e=x.pkgs,h=a.split("/"),i=h.length;i>0;i-=1){if(j=h.slice(0,i).join("/"),f=getOwn(e,j),l=getOwn(d,j)){isArray(l)&&(l=l[0]),h.splice(0,i,l);break}if(f){g=a===f.name?f.location+"/"+f.main:f.location,h.splice(0,i,g);br
 eak}}k=h.join("/"),k+=b||(/\?/.test(k)||c?"":".js"),k=("/"===k.charAt(0)||k.match(/^[\w\+\.\-]+:/)?"":x.baseUrl)+k}return x.urlArgs?k+((-1===k.indexOf("?")?"?":"&")+x.urlArgs):k},load:function(a,b){req.load(u,a,b)},execCb:function(a,b,c,d){return b.apply(d,c)},onScriptLoad:function(a){if("load"===a.type||readyRegExp.test((a.currentTarget||a.srcElement).readyState)){interactiveScript=null;var b=q(a);u.completeLoad(b.id)}},onScriptError:function(a){var b=q(a);return e(b.id)?void 0:j(makeError("scripterror","Script error for: "+b.id,a,[b.id]))}},u.require=u.makeRequire(),u}function getInteractiveScript(){return interactiveScript&&"interactive"===interactiveScript.readyState?interactiveScript:(eachReverse(scripts(),function(a){return"interactive"===a.readyState?interactiveScript=a:void 0}),interactiveScript)}var req,s,head,baseElement,dataMain,src,interactiveScript,currentlyAddingScript,mainScript,subPath,version="2.1.6",commentRegExp=/(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/gm,cjsRequir
 eRegExp=/[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g,jsSuffixRegExp=/\.js$/,currDirRegExp=/^\.\//,op=Object.prototype,ostring=op.toString,hasOwn=op.hasOwnProperty,ap=Array.prototype,apsp=ap.splice,isBrowser=!("undefined"==typeof window||!navigator||!window.document),isWebWorker=!isBrowser&&"undefined"!=typeof importScripts,readyRegExp=isBrowser&&"PLAYSTATION 3"===navigator.platform?/^complete$/:/^(complete|loaded)$/,defContextName="_",isOpera="undefined"!=typeof opera&&"[object Opera]"===opera.toString(),contexts={},cfg={},globalDefQueue=[],useInteractive=!1;if("undefined"==typeof define){if("undefined"!=typeof requirejs){if(isFunction(requirejs))return;cfg=requirejs,requirejs=void 0}"undefined"==typeof require||isFunction(require)||(cfg=require,require=void 0),req=requirejs=function(a,b,c,d){var e,f,g=defContextName;return isArray(a)||"string"==typeof a||(f=a,isArray(b)?(a=b,b=c,c=d):a=[]),f&&f.context&&(g=f.context),e=getOwn(contexts,g),e||(e=contexts[g]=req.s.newContext(g)),f
 &&e.configure(f),e.require(a,b,c)},req.config=function(a){return req(a)},req.nextTick="undefined"!=typeof setTimeout?function(a){setTimeout(a,4)}:function(a){a()},require||(require=req),req.version=version,req.jsExtRegExp=/^\/|:|\?|\.js$/,req.isBrowser=isBrowser,s=req.s={contexts:contexts,newContext:newContext},req({}),each(["toUrl","undef","defined","specified"],function(a){req[a]=function(){var b=contexts[defContextName];return b.require[a].apply(b,arguments)}}),isBrowser&&(head=s.head=document.getElementsByTagName("head")[0],baseElement=document.getElementsByTagName("base")[0],baseElement&&(head=s.head=baseElement.parentNode)),req.onError=defaultOnError,req.load=function(a,b,c){var d,e=a&&a.config||{};if(isBrowser)return d=e.xhtml?document.createElementNS("http://www.w3.org/1999/xhtml","html:script"):document.createElement("script"),d.type=e.scriptType||"text/javascript",d.charset="utf-8",d.async=!0,d.setAttribute("data-requirecontext",a.contextName),d.setAttribute("data-requirem
 odule",b),!d.attachEvent||d.attachEvent.toString&&d.attachEvent.toString().indexOf("[native code")<0||isOpera?(d.addEventListener("load",a.onScriptLoad,!1),d.addEventListener("error",a.onScriptError,!1)):(useInteractive=!0,d.attachEvent("onreadystatechange",a.onScriptLoad)),d.src=c,currentlyAddingScript=d,baseElement?head.insertBefore(d,baseElement):head.appendChild(d),currentlyAddingScript=null,d;if(isWebWorker)try{importScripts(c),a.completeLoad(b)}catch(f){a.onError(makeError("importscripts","importScripts failed for "+b+" at "+c,f,[b]))}},isBrowser&&eachReverse(scripts(),function(a){return head||(head=a.parentNode),dataMain=a.getAttribute("data-main"),dataMain?(mainScript=dataMain,cfg.baseUrl||(src=mainScript.split("/"),mainScript=src.pop(),subPath=src.length?src.join("/")+"/":"./",cfg.baseUrl=subPath),mainScript=mainScript.replace(jsSuffixRegExp,""),req.jsExtRegExp.test(mainScript)&&(mainScript=dataMain),cfg.deps=cfg.deps?cfg.deps.concat(mainScript):[mainScript],!0):void 0}),de
 fine=function(a,b,c){var d,e;"string"!=typeof a&&(c=b,b=a,a=null),isArray(b)||(c=b,b=null),!b&&isFunction(c)&&(b=[],c.length&&(c.toString().replace(commentRegExp,"").replace(cjsRequireRegExp,function(a,c){b.push(c)}),b=(1===c.length?["require"]:["require","exports","module"]).concat(b))),useInteractive&&(d=currentlyAddingScript||getInteractiveScript(),d&&(a||(a=d.getAttribute("data-requiremodule")),e=contexts[d.getAttribute("data-requirecontext")])),(e?e.defQueue:globalDefQueue).push([a,b,c])},define.amd={jQuery:!0},req.exec=function(text){return eval(text)},req(cfg)}}(this),this.JST=this.JST||{},this.JST["app/templates/databases/item.html"]=function(obj){obj||(obj={});{var __t,__p="";_.escape}with(obj)__p+='<!--\nLicensed under the Apache License, Version 2.0 (the "License"); you may not\nuse this file except in compliance with the License. You may obtain a copy of\nthe License at\n\n  http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in w
 riting, software\ndistributed under the License is distributed on an "AS IS" BASIS, WITHOUT\nWARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\nLicense for the specific language governing permissions and limitations under\nthe License.\n-->\n\n<td>\n  <a href="#/database/'+(null==(__t=encoded)?"":__t)+"/_all_docs?limit="+(null==(__t=docLimit)?"":__t)+'">'+(null==(__t=database.get("name"))?"":__t)+"</a>\n</td>\n<td>"+(null==(__t=database.status.humanSize())?"":__t)+"</td>\n<td>"+(null==(__t=database.status.numDocs())?"":__t)+"</td>\n<td>"+(null==(__t=database.status.updateSeq())?"":__t)+'</td>\n<td>\n  <a class="db-actions btn fonticon-replicate set-replication-start" title="Replicate '+(null==(__t=database.get("name"))?"":__t)+'" href="#/replication/new/'+(null==(__t=encoded)?"":__t)+'"></a>\n  <a class="db-actions btn icon-lock set-permissions" title="Set permissions for '+(null==(__t=database.get("name"))?"":__t)+'" href="#/database/'+(null==(__t=encoded)?""
 :__t)+'/permissions"></a>\n</td>\n';return __p},this.JST["app/templates/databases/list.html"]=function(obj){obj||(obj={});{var __p="";_.escape}with(obj)__p+='<!--\nLicensed under the Apache License, Version 2.0 (the "License"); you may not\nuse this file except in compliance with the License. You may obtain a copy of\nthe License at\n\n  http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an "AS IS" BASIS, WITHOUT\nWARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\nLicense for the specific language governing permissions and limitations under\nthe License.\n-->\n\n<div class="result-tools" style="">\n  <div id="newButton" class="pull-left"></div>\n  <form id="jump-to-db" class="navbar-form pull-right input-append database-search">\n    <input type="text" class="search-autocomplete" name="search-query" placeholder="Database name"></input>\n    <button c
 lass="fonticon-search btn button red " type="submit"></button>\n  </form>\n\n\n</div>\n<table class="databases table table-striped">\n  <thead>\n    <th>Name</th>\n    <th>Size</th>\n    <th># of Docs</th>\n    <th>Update Seq</th>\n    <th>Actions</th>\n  </thead>\n  <tbody>\n  </tbody>\n</table>\n<div id="database-pagination"></div>\n';return __p},this.JST["app/templates/databases/newdatabase.html"]=function(obj){obj||(obj={});{var __p="";_.escape}with(obj)__p+='<!--\nLicensed under the Apache License, Version 2.0 (the "License"); you may not\nuse this file except in compliance with the License. You may obtain a copy of\nthe License at\n\n  http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an "AS IS" BASIS, WITHOUT\nWARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\nLicense for the specific language governing permissions and limitations under\nthe 
 License.\n-->\n\n<a class="button new" id="new"><i class="icon fonticon-new-database"></i>Add New Database</a>\n\n\n';return __p},this.JST["app/templates/databases/sidebar.html"]=function(obj){obj||(obj={});{var __p="";_.escape}with(obj)__p+='<!--\nLicensed under the Apache License, Version 2.0 (the "License"); you may not\nuse this file except in compliance with the License. You may obtain a copy of\nthe License at\n\n  http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an "AS IS" BASIS, WITHOUT\nWARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\nLicense for the specific language governing permissions and limitations under\nthe License.\n-->\n\n<div class="row-fluid">\n  <a href="http://couchdb.org" target="_blank"><img src="img/couchdblogo.png"/></a>\n  <br/>\n</div>\n<hr>\n<ul class="nav nav-list">\n  <!-- <li class="nav-header">Database types</li
 > -->\n  <li class="active"><a class="toggle-view" id="owned">Your databases</a></li>\n  <li><a class="btn new" id="new"><i class="icon-plus"></i> New database</a></li>\n</ul>\n<hr>\n\n<div>\n  <a class="twitter-timeline" data-dnt="true" href="https://twitter.com/CouchDB" data-widget-id="314360971646869505">Tweets by @CouchDB</a>\n<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>\n\n</div>\n';return __p},this.JST["app/templates/documents/advanced_options.html"]=function(obj){obj||(obj={});{var __p="";_.escape,Array.prototype.join}with(obj)__p+='<!--\nLicensed under the Apache License, Version 2.0 (the "License"); you may not\nuse this file except in compliance with the License. You may obtain a copy of\nthe License at\n\n  http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by a
 pplicable law or agreed to in writing, software\ndistributed under the License is distributed on an "AS IS" BASIS, WITHOUT\nWARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\nLicense for the specific language governing permissions and limitations under\nthe License.\n-->\n<div class="errors-container"></div>\n<form class="view-query-update custom-inputs">\n  <div class="controls-group">\n    <div class="row-fluid">\n      <div class="controls controls-row">\n        <input name="key" class="span6" type="text" placeholder="Key">\n        <input name="keys" class="span6" type="text" placeholder="Keys">\n      </div>\n    </div>\n    <div class="row-fluid">\n      <div class="controls controls-row">\n        <input name="startkey" class="span6" type="text" placeholder="Start Key">\n        <input name="endkey" class="span6" type="text" placeholder="End Key">\n      </div>\n    </div>\n  </div>\n  <div class="controls-group">\n    <div class="row-fluid">\n      <d
 iv class="controls controls-row">\n        <div class="checkbox inline">  \n          <input id="check1" type="checkbox" name="include_docs" value="true">  \n          <label name="include_docs" for="check1">Include Docs</label>  \n          ',__p+=hasReduce?'\n          <input id="check2" name="reduce" type="checkbox" value="true">\n          <label for="check2">Reduce</label>  \n        </div> \n        <label id="select1" class="drop-down inline">\n          Group Level:\n          <select id="select1" disabled name="group_level" class="input-small">\n            <option value="0">None</option>\n            <option value="1">1</option>\n            <option value="2">2</option>\n            <option value="3">3</option>\n            <option value="4">4</option>\n            <option value="5">5</option>\n            <option value="6">6</option>\n            <option value="7">7</option>\n            <option value="8">8</option>\n            <option value="9">9</option>\n            <
 option value="999" selected="selected">exact</option>\n          </select>\n        </label>\n        ':"\n        </div>\n        ",__p+='\n\n        <div class="checkbox inline">  \n          <input id="check3" name="stale" type="checkbox" value="ok">\n          <label for="check3">Stale</label>\n          <input id="check4" name="descending" type="checkbox" value="true">  \n          <label for="check4">Descending</label>  \n        </div> \n        <label class="drop-down inline">\n          Limit:\n          <select name="limit" class="input-small">\n            <option>5</option>\n            <option selected="selected">10</option>\n            <option>25</option>\n            <option>50</option>\n            <option>100</option>\n          </select>\n        </label>\n        <div class="checkbox inline">  \n          <input id="check5" name="inclusive_end" type="checkbox" value="false">\n          <label for="check5">Disable Inclusive End</label>\n          <input id="check6
 " name="update_seq" type="checkbox" value="true">  \n          <label for="check6">Update Sequence</label>  \n        </div>\n      </div>\n    </div>\n  </div>\n  <div class="controls-group">\n    <div class="row-fluid">\n      <div id="button-options" class="controls controls-row">\n        <button type="submit" class="button green">Query</button>\n        ',showPreview&&(__p+='\n        <button class="button btn-info preview">Browser Preview</button>\n        '),__p+="\n      </div>\n    </div>\n  </div>\n</form>\n</div>\n\n";return __p},this.JST["app/templates/documents/all_docs_item.html"]=function(obj){obj||(obj={});{var __t,__p="",__e=_.escape;Array.prototype.join}with(obj)__p+='<!--\nLicensed under the Apache License, Version 2.0 (the "License"); you may not\nuse this file except in compliance with the License. You may obtain a copy of\nthe License at\n\n  http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistr
 ibuted under the License is distributed on an "AS IS" BASIS, WITHOUT\nWARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\nLicense for the specific language governing permissions and limitations under\nthe License.\n-->\n\n<td class="select"><input type="checkbox" class="row-select"></td>\n<td>\n  <div>\n    <pre class="prettyprint">'+__e(doc.prettyJSON())+"</pre>\n    ",doc.isEditable()&&(__p+='\n      <div class="btn-group">\n        <a href="#'+(null==(__t=doc.url("web-index"))?"":__t)+'" class="btn btn-small edits">Edit '+(null==(__t=doc.docType())?"":__t)+'</a>\n        <button href="#" class="btn btn-small btn-danger delete" title="Delete this document."><i class="icon icon-trash"></i></button>\n      </div>\n    '),__p+="\n  </div>\n</td>\n";return __p},this.JST["app/templates/documents/all_docs_layout.html"]=function(obj){obj||(obj={});{var __p="";_.escape}with(obj)__p+='<!--\nLicensed under the Apache License, Version 2.0 (the "License"); you may not\nu
 se this file except in compliance with the License. You may obtain a copy of\nthe License at\n\n  http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an "AS IS" BASIS, WITHOUT\nWARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\nLicense for the specific language governing permissions and limitations under\nthe License.\n-->\n<ul class="nav nav-tabs window-resizeable" id="db-views-tabs-nav">\n  <li><a id="toggle-query" class="fonticon-plus fonticon" href="#query" data-toggle="tab">Query Options</a></li>\n</ul>\n<div class="tab-content">\n  <div class="tab-pane" id="query">\n  </div>\n</div>\n';return __p},this.JST["app/templates/documents/all_docs_list.html"]=function(obj){obj||(obj={});{var __t,__p="";_.escape,Array.prototype.join}with(obj)__p+='<!--\nLicensed under the Apache License, Version 2.0 (the "License"); you may not\nuse this file except in c
 ompliance with the License. You may obtain a copy of\nthe License at\n\n  http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an "AS IS" BASIS, WITHOUT\nWARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\nLicense for the specific language governing permissions and limitations under\nthe License.\n-->\n\n<div class="view show">\n  ',viewList||(__p+='\n    <div class="row">\n      <div class="btn-toolbar span6">\n        <button type="button" class="btn all" data-toggle="button">✓ All</button>\n        <button class="btn btn-small disabled bulk-delete"><i class="icon-trash"></i></button>\n        ',__p+=expandDocs?'\n        <button id="collapse" class="btn"><i class="icon-minus"></i> Collapse</button>\n        ':'\n        <button id="collapse" class="btn"><i class="icon-plus"></i> Expand</button>\n        ',__p+="\n      </div>\n    </div>\n  "),__p+
 ='\n  <p>\n\n  <div id="item-numbers"> </div>\n\n  ',requestDuration&&(__p+='\n    <span class="view-request-duration">\n    View request duration: <strong> '+(null==(__t=requestDuration)?"":__t)+" </strong> \n    </span>\n  "),__p+='\n  </p>\n  <table class="all-docs table table-striped table-condensed">\n    <tbody></tbody>\n  </table>\n  <div id="documents-pagination"></div>\n</div>\n';return __p},this.JST["app/templates/documents/all_docs_number.html"]=function(obj){obj||(obj={});{var __t,__p="";_.escape,Array.prototype.join}with(obj)__p+='<!--\nLicensed under the Apache License, Version 2.0 (the "License"); you may not\nuse this file except in compliance with the License. You may obtain a copy of\nthe License at\n\n  http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an "AS IS" BASIS, WITHOUT\nWARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\nL
 icense for the specific language governing permissions and limitations under\nthe License.\n-->\n',__p+="unknown"===totalRows?'\n  Showing 0 documents. <a href="#/database/'+(null==(__t=database)?"":__t)+'/new"> Create your first document.</a>\n':"\n  Showing "+(null==(__t=offset)?"":__t)+" - "+(null==(__t=numModels)?"":__t)+" of "+(null==(__t=totalRows)?"":__t)+" rows\n",__p+="\n",updateSeq&&(__p+="\n  -- Update Sequence: "+(null==(__t=updateSeq)?"":__t)+"\n"),__p+="\n";return __p},this.JST["app/templates/documents/changes.html"]=function(obj){obj||(obj={});{var __t,__p="",__e=_.escape;Array.prototype.join}with(obj)__p+='<!--\nLicensed under the Apache License, Version 2.0 (the "License"); you may not\nuse this file except in compliance with the License. You may obtain a copy of\nthe License at\n\n  http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an "AS IS" BASIS, WITH
 OUT\nWARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\nLicense for the specific language governing permissions and limitations under\nthe License.\n-->\n\n<table id="changes-table" class="table">\n  <thead>\n    <th id="seq"> seq </th>\n    <th> id </th>\n    <th id="changes"> changes </th>\n    <th id="deleted"> deleted? </th>\n  </thead>\n  <tbody>\n  ',_.each(changes,function(a){__p+="\n    <tr>\n      <td> "+(null==(__t=a.seq)?"":__t)+" </td>\n      ",__p+=a.deleted?"\n        <td> "+(null==(__t=a.id)?"":__t)+" </td>\n      ":'\n        <td> <a href="#'+(null==(__t=database.url("app"))?"":__t)+"/"+(null==(__t=a.id)?"":__t)+'">'+(null==(__t=a.id)?"":__t)+"</a> </td>\n      ",__p+='\n        <td> \n          <pre class="prettyprint">  '+__e(JSON.stringify({changes:a.changes,doc:a.doc},null," "))+" </pre>\n      </td>\n      <td>"+(null==(__t=a.deleted?"true":"false")?"":__t)+"</td>\n    </tr>\n  "}),__p+="\n  </tbody>\n</table>\n";return __p},this.JST["app/
 templates/documents/ddoc_info.html"]=function(obj){obj||(obj={});{var __t,__p="";_.escape,Array.prototype.join
-}with(obj)__p+='<!--\nLicensed under the Apache License, Version 2.0 (the "License"); you may not\nuse this file except in compliance with the License. You may obtain a copy of\nthe License at\n\n  http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an "AS IS" BASIS, WITHOUT\nWARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\nLicense for the specific language governing permissions and limitations under\nthe License.\n-->\n<div>\n  <h2> Design Doc MetaData </h2>\n  <div class="row-fluid">\n	',i=0,_.map(view_index,function(a,b){__p+="\n		",i%2==0&&(__p+='\n			<div class="row-fluid">\n		'),__p+='\n	    <div class="span6 well-item"><strong> '+(null==(__t=b)?"":__t)+"</strong> : "+(null==(__t=a)?"":__t)+"  </div>\n	    ",i%2==1&&(__p+="\n			</div>\n		"),__p+="\n	  	",++i}),__p+="\n  </div>\n</div>\n";return __p},this.JST["app/templates/documents/design_doc
 _selector.html"]=function(obj){obj||(obj={});{var __t,__p="";_.escape,Array.prototype.join}with(obj)__p+='<!--\nLicensed under the Apache License, Version 2.0 (the "License"); you may not\nuse this file except in compliance with the License. You may obtain a copy of\nthe License at\n\n  http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an "AS IS" BASIS, WITHOUT\nWARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\nLicense for the specific language governing permissions and limitations under\nthe License.\n-->\n<div class="span3">\n  <label for="ddoc">Save to Design Document <a href="'+(null==(__t=getDocUrl("design_doc"))?"":__t)+'" target="_blank"><i class="icon-question-sign"></i></a></label>\n  <select id="ddoc">\n    <optgroup label="Select a document">\n      <option value="new-doc">New document</option>\n      ',ddocs.each(function(a){__p+="\n   
    ",__p+=a.id===ddocName?'\n      <option selected="selected" value="'+(null==(__t=a.id)?"":__t)+'">'+(null==(__t=a.id)?"":__t)+"</option>\n      ":'\n      <option value="'+(null==(__t=a.id)?"":__t)+'">'+(null==(__t=a.id)?"":__t)+"</option>\n      ",__p+="\n      "}),__p+='\n    </optgroup>\n  </select>\n</div>\n\n<div id="new-ddoc-section" class="span5" style="display:none">\n  <label class="control-label" for="new-ddoc"> _design/ </label>\n  <div class="controls">\n    <input type="text" id="new-ddoc" placeholder="newDesignDoc">\n  </div>\n</div>\n';return __p},this.JST["app/templates/documents/doc.html"]=function(obj){obj||(obj={});{var __t,__p="",__e=_.escape;Array.prototype.join}with(obj)__p+='<!--\nLicensed under the Apache License, Version 2.0 (the "License"); you may not\nuse this file except in compliance with the License. You may obtain a copy of\nthe License at\n\n  http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, 
 software\ndistributed under the License is distributed on an "AS IS" BASIS, WITHOUT\nWARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\nLicense for the specific language governing permissions and limitations under\nthe License.\n-->\n\n<div id="doc">\n  <div class="errors-container"></div>\n   \n<div class="row doc-editor-buttons"> \n  <div class="span3">\n    <button class="save-doc button green btn-medium save fonticon-circle-check" type="button">Save</button>\n    <button class="button cancel-button gray btn-medium">Back to _all_docs</button>\n  </div>\n\n  <div class="span7">\n    ',attachments&&(__p+='\n    <div class="btn-group">\n      <a class="button gray btn-medium dropdown-toggle btn" data-bypass="true" data-toggle="dropdown" href="#">\n        View Attachments\n        <span class="caret"></span>\n      </a>\n      <ul class="dropdown-menu">\n        ',_.each(attachments,function(a){__p+='\n        <li>\n        <a href="'+(null==(__t=a.url)?"":__t
 )+'" target="_blank"> <strong> '+(null==(__t=a.fileName)?"":__t)+" </strong> -\n          <span> "+(null==(__t=a.contentType)?"":__t)+", "+(null==(__t=formatSize(a.size))?"":__t)+" </span>\n        </a>\n        </li>\n        "}),__p+="\n      </ul>\n    </div>\n    "),__p+=' \n    <button class="button gray btn-medium  upload"><i class="icon-circle-arrow-up"></i> Upload Attachment</button>\n    <button class="button gray btn-medium duplicate"><i class="icon-repeat"></i> Duplicate document</button>\n  </div>\n\n  <button class="button red btn-medium delete"><i class="icon-trash"></i></button>\n  </ul>\n\n<div id="upload-modal"> </div>\n<div id="duplicate-modal"> </div> \n</div>\n\n  <div id="editor-container" class="doc-code">'+__e(JSON.stringify(doc.attributes,null,"  "))+"</div>\n\n</div>\n";return __p},this.JST["app/templates/documents/doc_field_editor.html"]=function(obj){obj||(obj={});{var __t,__p="";_.escape,Array.prototype.join}with(obj)__p+='<!--\nLicensed under the Apache 
 License, Version 2.0 (the "License"); you may not\nuse this file except in compliance with the License. You may obtain a copy of\nthe License at\n\n  http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an "AS IS" BASIS, WITHOUT\nWARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\nLicense for the specific language governing permissions and limitations under\nthe License.\n-->\n\n<div id="doc-field-editor">\n  <div class="tools">\n\n    <div class="btn-toolbar pull-left">\n      <button class="btn btn-small all">&#x2713; All</button>\n      <button class="btn btn-small disabled delete"><i class="icon-trash"></i> Delete field</button>\n      <button class="btn btn-small new" style="margin-left: 64px"><i class="icon-plus"></i> New field</button>\n    </div>\n    <div class="btn-toolbar pull-right">\n      <button class="btn btn-small cancel button cancel-b
 utton outlineGray fonticon-circle-x">Cancel</button>\n      <button class="btn btn-small save button green fonticon-circle-check">Save</button>\n    </div>\n  </div>\n\n  <div class="clearfix"></div>\n  <!-- <hr style="margin-top: 0"/> -->\n\n  <table class="table table-striped  table-condensed">\n    <thead>\n      <tr>\n        <th class="select">\n        </th>\n        <th>Key</th>\n        <th>Value</th>\n      </tr>\n    </thead>\n    <tbody>\n      <tr style="display:none">\n        <td class="select"><input type="checkbox" /></td>\n        <td class="key"><input type="text" class="input-large" value=\'\' /></td>\n        <td class="value"><input type="text" class="input-xxlarge" value=\'\' /></td>\n      </tr>\n      ',_.each(doc,function(a,b){__p+='\n        <tr>\n          <td class="select"><input type="checkbox" /></td>\n          <td class="key">\n            <input type="text" class="input-large" name="doc['+(null==(__t=b)?"":__t)+']" value="'+(null==(__t=b)?"":__t)+'"
  />\n          </td>\n          <td class="value"><input type="text" class="input-xxlarge" value=\''+(null==(__t=JSON.stringify(a))?"":__t)+"' /></td>\n        </tr>\n      "}),__p+='\n        <tr>\n          <th colspan="3">\n            Attachments\n          </th>\n        </tr>\n      ',_.each(attachments,function(a){__p+='\n        <tr>\n          <td class="select"><input type="checkbox" /></td>\n          <td colspan="2">\n            <a href="'+(null==(__t=a.url)?"":__t)+'" target="_blank"> '+(null==(__t=a.fileName)?"":__t)+" </a>\n            <span> "+(null==(__t=a.contentType)?"":__t)+", "+(null==(__t=formatSize(a.size))?"":__t)+" </span>\n          </td>\n        </tr>\n      "}),__p+='\n    </tbody>\n  </table>\n  <a class="btn btn-small new" style="margin-left: 64px"><i class="icon-plus"></i> New field</a>\n\n</div>\n';return __p},this.JST["app/templates/documents/doc_field_editor_tabs.html"]=function(obj){obj||(obj={});{var __t,__p="";_.escape}with(obj)__p+='<!--\nLice
 nsed under the Apache License, Version 2.0 (the "License"); you may not\nuse this file except in compliance with the License. You may obtain a copy of\nthe License at\n\n  http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an "AS IS" BASIS, WITHOUT\nWARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\nLicense for the specific language governing permissions and limitations under\nthe License.\n-->\n\n<!--<ul class="nav nav-tabs">\n  <li id="field_editor" class="'+(null==(__t=isSelectedClass("field_editor"))?"":__t)+'"><a href="#'+(null==(__t=doc.url("app"))?"":__t)+'/field_editor">Doc fields</a></li>\n  <li id="code_editor" class="'+(null==(__t=isSelectedClass("code_editor"))?"":__t)+'"><a href="#'+(null==(__t=doc.url("app"))?"":__t)+'/code_editor"><i class="icon-pencil"> </i> Code editor</a>\n  </li>\n</ul>-->\n';return __p},this.JST["app/templates/doc
 uments/duplicate_doc_modal.html"]=function(obj){obj||(obj={});{var __p="";_.escape}with(obj)__p+='<!--\nLicensed under the Apache License, Version 2.0 (the "License"); you may not\nuse this file except in compliance with the License. You may obtain a copy of\nthe License at\n\n  http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an "AS IS" BASIS, WITHOUT\nWARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\nLicense for the specific language governing permissions and limitations under\nthe License.\n-->\n\n<div class="modal hide fade">\n  <div class="modal-header">\n    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>\n    <h3>Duplicate Document</h3>\n  </div>\n  <div class="modal-body">\n    <div id="modal-error" class="hide alert alert-error"/>\n    <form id="file-upload" class="form" method="post">\n      <
 p class="help-block">\n      Set new documents ID:\n      </p>\n      <input id="dup-id" type="text" class="input-xlarge">\n    </form>\n\n  </div>\n  <div class="modal-footer">\n    <a href="#" data-dismiss="modal" class="btn button cancel-button outlineGray fonticon-circle-x">Cancel</a>\n    <a href="#" id="duplicate-btn" class="btn btn-primary button green save fonticon-circle-check">Duplicate</a>\n  </div>\n</div>\n\n\n';return __p},this.JST["app/templates/documents/edit_tools.html"]=function(obj){obj||(obj={});{var __t,__p="";_.escape,Array.prototype.join}with(obj)__p+='<!--\nLicensed under the Apache License, Version 2.0 (the "License"); you may not\nuse this file except in compliance with the License. You may obtain a copy of\nthe License at\n\n  http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an "AS IS" BASIS, WITHOUT\nWARRANTIES OR CONDITIONS OF ANY KIND, eithe
 r express or implied. See the\nLicense for the specific language governing permissions and limitations under\nthe License.\n-->\n\n<div class="view show">\n  <p>\n    Showing 1-'+(null==(__t=numModels)?"":__t)+" of "+(null==(__t=totalRows)?"":__t)+" rows\n    ",updateSeq&&(__p+="\n      -- Update Sequence: "+(null==(__t=updateSeq)?"":__t)+"\n    "),__p+="\n    ",requestDuration&&(__p+='\n  <span class="view-request-duration">\n    View request duration: <strong> '+(null==(__t=requestDuration)?"":__t)+" </strong> \n   </span>\n   "),__p+='\n  </p>\n  <table class="all-docs table table-striped table-condensed">\n    <tbody></tbody>\n  </table>\n  <!--\n  <div class="pagination pagination-centered">\n    <ul>\n      <li class="disabled"><a href="#">&laquo;</a></li>\n      <li class="active"><a href="#">1</a></li>\n      <li><a href="#">2</a></li>\n      <li><a href="#">3</a></li>\n      <li><a href="#">4</a></li>\n      <li><a href="#">5</a></li>\n      <li><a href="#">&raquo;</a></li>
 \n    </ul>\n  </div>\n  -->\n\n</div>\n';return __p},this.JST["app/templates/documents/index_menu_item.html"]=function(obj){obj||(obj={});{var __t,__p="";_.escape}with(obj)__p+='<!--\nLicensed under the Apache License, Version 2.0 (the "License"); you may not\nuse this file except in compliance with the License. You may obtain a copy of\nthe License at\n\n  http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an "AS IS" BASIS, WITHOUT\nWARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\nLicense for the specific language governing permissions and limitations under\nthe License.\n-->\n\n<a id="'+(null==(__t=ddoc_clean)?"":__t)+"_"+(null==(__t=index_clean)?"":__t)+'" href="#database/'+(null==(__t=database_encoded)?"":__t)+"/_design/"+(null==(__t=ddoc_encoded)?"":__t)+"/_view/"+(null==(__t=index_encoded)?"":__t)+'" class="toggle-view">\n  '+(null==(__t=ddo
 c)?"":__t)+'<span class="divider">/</span>'+(null==(__t=index)?"":__t)+"\n</a>\n";return __p},this.JST["app/templates/documents/index_row_docular.html"]=function(obj){obj||(obj={});{var __t,__p="",__e=_.escape;Array.prototype.join}with(obj)__p+='<!--\nLicensed under the Apache License, Version 2.0 (the "License"); you may not\nuse this file except in compliance with the License. You may obtain a copy of\nthe License at\n\n  http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an "AS IS" BASIS, WITHOUT\nWARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\nLicense for the specific language governing permissions and limitations under\nthe License.\n-->\n\n<td class="select"><input type="checkbox"></td>\n<td>\n  <div>\n    <pre class="prettyprint">'+__e(doc.prettyJSON())+"</pre>\n    ",doc.isEditable()&&(__p+='\n      <div class="btn-group">\n        <a href
 ="#'+(null==(__t=doc.url("app"))?"":__t)+'" class="btn btn-small edits">Edit '+(null==(__t=doc.docType())?"":__t)+'</a>\n        <button href="#" class="btn btn-small btn-danger delete" title="Delete this document."><i class="icon icon-trash"></i></button>\n      </div>\n    '),__p+="\n  </div>\n</td>\n";return __p},this.JST["app/templates/documents/index_row_tabular.html"]=function(obj){obj||(obj={});var __p="",__e=_.escape;with(obj)__p+='<!--\nLicensed under the Apache License, Version 2.0 (the "License"); you may not\nuse this file except in compliance with the License. You may obtain a copy of\nthe License at\n\n  http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an "AS IS" BASIS, WITHOUT\nWARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\nLicense for the specific language governing permissions and limitations under\nthe License.\n-->\n\n<td cla
 ss="select"><input type="checkbox"></td>\n<td>\n  <div>\n    <pre class="prettyprint">'+__e(JSON.stringify(doc.get("key")))+'</pre>\n  </div>\n</td>\n<td>\n  <div>\n    <pre class="prettyprint">'+__e(JSON.stringify(doc.get("value")))+"</pre>\n  </div>\n</td>\n";return __p},this.JST["app/templates/documents/jumpdoc.html"]=function(obj){obj||(obj={});{var __p="";_.escape}with(obj)__p+='<!--\nLicensed under the Apache License, Version 2.0 (the "License"); you may not\nuse this file except in compliance with the License. You may obtain a copy of\nthe License at\n\n  http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an "AS IS" BASIS, WITHOUT\nWARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\nLicense for the specific language governing permissions and limitations under\nthe License.\n-->\n\n<form id="jump-to-doc" class="form-inline input-append" >\n  <in
 put type="text" id="jump-to-doc-id" class="input-large" placeholder="Document ID"></input>\n\n  <button class="fonticon-search btn button red " type="submit"></button>\n</form>\n';return __p},this.JST["app/templates/documents/search.html"]=function(obj){obj||(obj={});{var __p="";_.escape}with(obj)__p+='<!--\nLicensed under the Apache License, Version 2.0 (the "License"); you may not\nuse this file except in compliance with the License. You may obtain a copy of\nthe License at\n\n  http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an "AS IS" BASIS, WITHOUT\nWARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\nLicense for the specific language governing permissions and limitations under\nthe License.\n-->\n\n<input id="searchbox" type="text" class="span12" placeholder="Search by doc id, view key or search index">';return __p},this.JST["app/templates/doc
 uments/sidebar.html"]=function(obj){obj||(obj={});{var __t,__p="";_.escape,Array.prototype.join}with(obj)__p+='<!--\nLicensed under the Apache License, Version 2.0 (the "License"); you may not\nuse this file except in compliance with the License. You may obtain a copy of\nthe License at\n\n  http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an "AS IS" BASIS, WITHOUT\nWARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\nLicense for the specific language governing permissions and limitations under\nthe License.\n-->\n\n<div id="sidenav">\n  <header class="row-fluid">\n    <div class="span12">\n      <div class="btn-group">\n        <button class="btn dropdown-toggle dropdown-toggle-btn" data-toggle="dropdown">\n          Docs\n          <span class="caret"></span>\n        </button>\n        <ul class="dropdown-menu">\n          <!-- dropdown menu links
  -->\n          <li><a class="icon-file" href="'+(null==(__t=db_url)?"":__t)+'">Docs</a></li>\n          <li><a class="icon-lock" href="'+(null==(__t=permissions_url)?"":__t)+'">Permissions</a></li>\n          <li><a class="icon-forward" href="'+(null==(__t=changes_url)?"":__t)+'">Changes</a></li>\n          ',_.each(docLinks,function(a){__p+='\n          <li><a class="'+(null==(__t=a.icon)?"":__t)+'" href="'+(null==(__t=database_url+"/"+a.url)?"":__t)+'">'+(null==(__t=a.title)?"":__t)+"</a></li>\n          "}),__p+='\n        </ul>\n      </div>\n\n      <div class="btn-group">\n        <button class="btn dropdown-toggle dropdown-toggle-btn" data-toggle="dropdown">\n          New\n          <span class="caret"></span>\n        </button>\n        <ul class="dropdown-menu">\n          <!-- dropdown menu links -->\n          <li>\n          <a id="doc" href="#'+(null==(__t=database.url("app"))?"":__t)+'/new">Document</a>\n          </li>\n          <li>\n          <a href="#'+(null==(
 __t=database.url("app"))?"":__t)+'/new_view">Secondary Index</a>\n           ',_.each(newLinks,function(a){__p+='\n           <a href="#'+(null==(__t=database.url("app"))?"":__t)+"/"+(null==(__t=a.url)?"":__t)+'"> '+(null==(__t=a.name)?"":__t)+"</a>\n           "}),__p+='\n          </li>\n        </ul>\n      </div>\n        <button id="delete-database" class="btn"><i class="icon-trash"></i> Database</button>\n    </div>\n  </header>\n\n  <nav>\n    <ul class="nav nav-list">\n      <li class="active"><a id="all-docs" href="#'+(null==(__t=database.url("index"))?"":__t)+"?limit="+(null==(__t=docLimit)?"":__t)+'" class="toggle-view"> All documents</a></li>\n      <li><a id="design-docs" href=\'#'+(null==(__t=database.url("index"))?"":__t)+"?limit="+(null==(__t=docLimit)?"":__t)+'&startkey="_design"&endkey="_e"\'  class="toggle-view"> All design docs</a></li>\n    </ul>\n    <ul class="nav nav-list views">\n      <li class="nav-header">Secondary Indexes</li>\n      <li><a id="new-view"
  href="#'+(null==(__t=database.url("app"))?"":__t)+'/new_view" class="new"><i class="icon-plus"></i> New</a></li>\n    </ul>\n    <div id="extension-navs"></div>\n  </nav>\n</div>\n';return __p},this.JST["app/templates/documents/tabs.html"]=function(obj){obj||(obj={});{var __t,__p="";_.escape}with(obj)__p+='<!--\nLicensed under the Apache License, Version 2.0 (the "License"); you may not\nuse this file except in compliance with the License. You may obtain a copy of\nthe License at\n\n  http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an "AS IS" BASIS, WITHOUT\nWARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\nLicense for the specific language governing permissions and limitations under\nthe License.\n-->\n\n<ul class="nav nav-tabs">\n  <li class="active"><a href="'+(null==(__t=db_url)?"":__t)+'">Docs</a></li>\n  <li id="changes"><a  href="'+(null=
 =(__t=changes_url)?"":__t)+'">Changes</a></li>\n</ul>\n';return __p},this.JST["app/templates/documents/upload_modal.html"]=function(obj){obj||(obj={});{var __p="";_.escape}with(obj)__p+='<!--\nLicensed under the Apache License, Version 2.0 (the "License"); you may not\nuse this file except in compliance with the License. You may obtain a copy of\nthe License at\n\n  http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an "AS IS" BASIS, WITHOUT\nWARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\nLicense for the specific language governing permissions and limitations under\nthe License.\n-->\n\n<div class="modal hide fade">\n  <div class="modal-header">\n    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>\n    <h3>Upload an Attachment</h3>\n  </div>\n  <div class="modal-body">\n    <div id="modal-error" class=
 "alert alert-error hide" style="font-size: 16px;"> </div>\n    <form id="file-upload" class="form" method="post">\n      <p class="help-block">\n      Please select the file you want to upload as an attachment to this document. \n      Please note that this will result in the immediate creation of a new revision of the document, \n      so it\'s not necessary to save the document after the upload.\n      </p>\n      <input id="_attachments" type="file" name="_attachments">\n      <input id="_rev" type="hidden" name="_rev" value="" >\n      <br/>\n    </form>\n\n    <div class="progress progress-info">\n      <div class="bar" style="width: 0%"></div>\n    </div>\n  </div>\n  <div class="modal-footer">\n    <a href="#" data-dismiss="modal" data-bypass="true" class="btn button cancel-button outlineGray fonticon-circle-x">Cancel</a>\n    <a href="#" id="upload-btn" data-bypass="true" class="btn btn-primary button green save fonticon-circle-check">Upload</a>\n  </div>\n</div>\n\n';return
  __p},this.JST["app/templates/documents/view_editor.html"]=function(obj){obj||(obj={});{var __t,__p="";_.escape,Array.prototype.join}with(obj)__p+='<!--\nLicensed under the Apache License, Version 2.0 (the "License"); you may not\nuse this file except in compliance with the License. You may obtain a copy of\nthe License at\n\n  http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an "AS IS" BASIS, WITHOUT\nWARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\nLicense for the specific language governing permissions and limitations under\nthe License.\n-->\n<div class="row">\n  <ul class="nav nav-tabs window-resizeable" id="db-views-tabs-nav">\n    <li class="active"> <a data-bypass="true" id="index-nav" class="fonticon-wrench fonticon" data-toggle="tab" href="#index">',__p+=newView?"Create Index ":"Edit Index ",__p+="</a></li>\n    ",newView||(__p+='\n    
 <li><a data-bypass="true" id="query-nav" class="fonticon-plus fonticon" href="#query" data-toggle="tab">Query Options</a></li>\n    <li><a data-bypass="true" id="meta-nav" href="#metadata" data-toggle="tab">Design Doc Metadata</a></li>\n    '),__p+='\n  </ul>\n  <div class="all-docs-list errors-container"></div>\n  <div class="tab-content">\n    <div class="tab-pane active" id="index">\n      <div id="define-view" class="ddoc-alert well">\n        <div class="errors-container"></div>\n        <form class="form-horizontal view-query-save">\n\n          <div class="control-group design-doc-group">\n          </div>\n\n          <div class="control-group">\n            <label for="index-name">Index name <a href="'+(null==(__t=getDocUrl("view_functions"))?"":__t)+'" target="_blank"><i class="icon-question-sign"></i></a></label>\n            <input type="text" id="index-name" value="'+(null==(__t=viewName)?"":__t)+'" placeholder="Index name" />\n          </div>\n\n\n          <div class
 ="control-group">\n            <label for="map-function">Map function <a href="'+(null==(__t=getDocUrl("map_functions"))?"":__t)+'" target="_blank"><i class="icon-question-sign"></i></a></label>\n            ',__p+=newView?'\n            <div class="js-editor" id="map-function">'+(null==(__t=langTemplates.map)?"":__t)+"</div>\n            ":'\n            <div class="js-editor" id="map-function">'+(null==(__t=ddoc.get("views")[viewName].map)?"":__t)+"</div>\n            ",__p+='\n          </div>\n\n\n          <div class="control-group">\n            <label for="reduce-function-selector">Reduce (optional) <a href="'+(null==(__t=getDocUrl("reduce_functions"))?"":__t)+'" target="_blank"><i class="icon-question-sign"></i></a></label>\n\n            <select id="reduce-function-selector">\n              <option value="" '+(null==(__t=reduceFunStr?"":'selected="selected"')?"":__t)+">None</option>\n              ",_.each(["_sum","_count","_stats"],function(a){__p+='\n              <option
  value="'+(null==(__t=a)?"":__t)+'" ',a==reduceFunStr&&(__p+="selected"),__p+=">"+(null==(__t=a)?"":__t)+"</option>\n              "}),__p+='\n              <option value="CUSTOM" ',isCustomReduce&&(__p+="selected"),__p+='>Custom Reduce function</option>\n            </select>\n          </div>\n\n          <div class="control-group reduce-function">\n            <label for="reduce-function">Custom Reduce function</label>\n            ',__p+=newView?'\n            <div class="js-editor" id="reduce-function">'+(null==(__t=langTemplates.reduce)?"":__t)+"</div>\n            ":'\n            <div class="js-editor" id="reduce-function">'+(null==(__t=ddoc.get("views")[viewName].reduce)?"":__t)+"</div>\n            ",__p+='\n          </div>\n\n          <div class="control-group">\n            <button class="button green save fonticon-circle-check">Save &amp; Build Index</button>\n            <button class="button btn-info preview">Preview</button>\n            ',newView||(__p+='\n       
      <button class="button delete outlineGray fonticon-circle-x">Delete</button>\n            '),__p+='\n          </div>\n          <div class="clearfix"></div>\n        </form>\n      </div>\n    </div>\n    <div class="tab-pane" id="metadata">\n      <div id="ddoc-info" class="well"> </div>\n    </div>\n    <div class="tab-pane" id="query">\n    </div>\n  </div>\n</div>\n\n';return __p},this.JST["app/templates/fauxton/api_bar.html"]=function(obj){obj||(obj={});{var __t,__p="";_.escape}with(obj)__p+='<!--\nLicensed under the Apache License, Version 2.0 (the "License"); you may not\nuse this file except in compliance with the License. You may obtain a copy of\nthe License at\n\n  http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an "AS IS" BASIS, WITHOUT\nWARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\nLicense for the specific language governing
  permissions and limitations under\nthe License.\n-->\n\n<button class="button api-url-btn">\n  API URL \n  <span class="fonticon-plus icon"></span>\n</button>\n<div class="api-navbar" style="display: none">\n    <div class="input-prepend input-append">\n      <span class="add-on">\n        API reference\n        <a href="'+(null==(__t=getDocUrl(documentation))?"":__t)+'" target="_blank">\n          <i class="icon-question-sign"></i>\n        </a>\n      </span>\n      <input type="text" class="input-xxlarge" value="'+(null==(__t=endpoint)?"":__t)+'">\n      <a href="'+(null==(__t=endpoint)?"":__t)+'" target="_blank" class="btn">Show me</a>\n    </div>\n</div>\n';return __p},this.JST["app/templates/fauxton/breadcrumbs.html"]=function(obj){obj||(obj={});{var __t,__p="";_.escape,Array.prototype.join}with(obj){__p+='<!--\nLicensed under the Apache License, Version 2.0 (the "License"); you may not\nuse this file except in compliance with the License. You may obtain a copy of\nthe Licens
 e at\n\n  http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an "AS IS" BASIS, WITHOUT\nWARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\nLicense for the specific language governing permissions and limitations under\nthe License.\n-->\n\n<ul class="breadcrumb">\n  ',_.each(_.initial(crumbs),function(a){__p+='\n    <li>\n      <a href="#'+(null==(__t=a.link)?"":__t)+'">'+(null==(__t=a.name)?"":__t)+'</a>\n      <span class="divider fonticon fonticon-carrot"> </span>\n    </li>\n  '}),__p+="\n  ";var last=_.last(crumbs)||{name:""};__p+='\n  <li class="active">'+(null==(__t=last.name)?"":__t)+"</li>\n</ul>\n"}return __p},this.JST["app/templates/fauxton/footer.html"]=function(obj){obj||(obj={});{var __t,__p="";_.escape}with(obj)__p+='<!--\nLicensed under the Apache License, Version 2.0 (the "License"); you may not\nuse this file except in compliance wit
 h the License. You may obtain a copy of\nthe License at\n\n  http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an "AS IS" BASIS, WITHOUT\nWARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\nLicense for the specific language governing permissions and limitations under\nthe License.\n-->\n\n<p>Fauxton on <a href="http://couchdb.apache.org/">Apache CouchDB</a> '+(null==(__t=version)?"":__t)+"</p>\n";return __p},this.JST["app/templates/fauxton/index_pagination.html"]=function(obj){obj||(obj={});{var __p="";_.escape,Array.prototype.join}with(obj)__p+='<!--\nLicensed under the Apache License, Version 2.0 (the "License"); you may not\nuse this file except in compliance with the License. You may obtain a copy of\nthe License at\n\n  http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed 
 under the License is distributed on an "AS IS" BASIS, WITHOUT\nWARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\nLicense for the specific language governing permissions and limitations under\nthe License.\n-->\n\n<div class="pagination pagination-centered">\n  <ul>\n    <li ',canShowPreviousfn()||(__p+=' class="disabled" '),__p+='>\n       <a id="previous" href="#"> Previous </a>\n     </li>\n     <li ',canShowNextfn()||(__p+=' class="disabled" '),__p+='>\n       <a id="next" href="#"> Next </a></li>\n  </ul>\n</div>\n\n';return __p},this.JST["app/templates/fauxton/nav_bar.html"]=function(obj){obj||(obj={});{var __t,__p="";_.escape,Array.prototype.join}with(obj)__p+='<!--\nLicensed under the Apache License, Version 2.0 (the "License"); you may not\nuse this file except in compliance with the License. You may obtain a copy of\nthe License at\n\n  http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\n
 distributed under the License is distributed on an "AS IS" BASIS, WITHOUT\nWARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\nLicense for the specific language governing permissions and limitations under\nthe License.\n-->\n\n<div class="brand">\n  <div class="burger">\n    <div><!-- * --></div>\n    <div><!-- * --></div>\n    <div><!-- * --></div>\n  </div>\n  <div class="icon">Apache Fauxton</div>\n</div>\n\n<nav id="main_navigation">\n  <ul id="nav-links" class="nav pull-right">\n    ',_.each(navLinks,function(a){__p+="\n    ",a.view||(__p+='\n        <li data-nav-name= "'+(null==(__t=a.title)?"":__t)+'" >\n          <a href="'+(null==(__t=a.href)?"":__t)+'">\n            <span class="'+(null==(__t=a.icon)?"":__t)+' fonticon"></span>\n            '+(null==(__t=a.title)?"":__t)+"\n          </a>\n        </li>\n    ")
-}),__p+='\n  </ul>\n\n  <div id="footer-links">\n\n    <ul id="bottom-nav-links" class="nav">\n        <li data-nav-name= "Documentation">\n            <a href="'+(null==(__t=getDocUrl("docs"))?"":__t)+'" target="_blank">\n              <span class="fonticon-bookmark fonticon"></span>\n                Documentation\n            </a>\n        </li>\n\n\n      ',_.each(bottomNavLinks,function(a){__p+="\n      ",a.view||(__p+='\n        <li data-nav-name= "'+(null==(__t=a.title)?"":__t)+'">\n            <a href="'+(null==(__t=a.href)?"":__t)+'">\n              <span class="'+(null==(__t=a.icon)?"":__t)+' fonticon"></span>\n              '+(null==(__t=a.title)?"":__t)+"\n            </a>\n        </li>\n      ")}),__p+='\n    </ul>\n\n    <ul id="footer-nav-links" class="nav">\n      ',_.each(footerNavLinks,function(a){__p+="\n      ",a.view||(__p+='\n        <li data-nav-name= "'+(null==(__t=a.title)?"":__t)+'">\n            <a href="'+(null==(__t=a.href)?"":__t)+'">\n              <sp
 an class="'+(null==(__t=a.icon)?"":__t)+' fonticon"></span>\n              '+(null==(__t=a.title)?"":__t)+"\n            </a>\n        </li>\n      ")}),__p+="\n    </ul>\n\n  </div>\n</nav>\n\n\n\n";return __p},this.JST["app/templates/fauxton/notification.html"]=function(obj){obj||(obj={});{var __t,__p="";_.escape}with(obj)__p+='<!--\nLicensed under the Apache License, Version 2.0 (the "License"); you may not\nuse this file except in compliance with the License. You may obtain a copy of\nthe License at\n\n  http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an "AS IS" BASIS, WITHOUT\nWARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\nLicense for the specific language governing permissions and limitations under\nthe License.\n-->\n\n<div class="alert alert-'+(null==(__t=type)?"":__t)+'">\n  <button type="button" class="close" data-dismiss="alert">×<
 /button>\n  '+(null==(__t=msg)?"":__t)+"\n</div>\n";return __p},this.JST["app/templates/fauxton/pagination.html"]=function(obj){obj||(obj={});{var __t,__p="";_.escape,Array.prototype.join}with(obj)__p+='<!--\nLicensed under the Apache License, Version 2.0 (the "License"); you may not\nuse this file except in compliance with the License. You may obtain a copy of\nthe License at\n\n  http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an "AS IS" BASIS, WITHOUT\nWARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\nLicense for the specific language governing permissions and limitations under\nthe License.\n-->\n\n<div class="pagination pagination-centered">\n  <ul>\n    ',__p+=page>1?'\n    <li> <a href="'+(null==(__t=urlFun(page-1))?"":__t)+'">&laquo;</a></li>\n    ':'\n      <li class="disabled"> <a href="'+(null==(__t=urlFun(page))?"":__t)+'">&laquo;</a>
 </li>\n    ',__p+="\n    ",_.each(_.range(1,totalPages+1),function(a){__p+="\n      <li ",page==a&&(__p+='class="active"'),__p+='> <a href="'+(null==(__t=urlFun(a))?"":__t)+'">'+(null==(__t=a)?"":__t)+"</a></li>\n    "}),__p+="\n    ",__p+=totalPages>page?'\n      <li><a href="'+(null==(__t=urlFun(page+1))?"":__t)+'">&raquo;</a></li>\n    ':'\n      <li class="disabled"> <a href="'+(null==(__t=urlFun(page))?"":__t)+'">&raquo;</a></li>\n    ',__p+="\n  </ul>\n</div>\n";return __p},this.JST["app/templates/layouts/one_pane.html"]=function(obj){obj||(obj={});{var __p="";_.escape}with(obj)__p+='<!--\nLicensed under the Apache License, Version 2.0 (the "License"); you may not\nuse this file except in compliance with the License. You may obtain a copy of\nthe License at\n\n  http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an "AS IS" BASIS, WITHOUT\nWARRANTIES OR CONDITIONS OF 
 ANY KIND, either express or implied. See the\nLicense for the specific language governing permissions and limitations under\nthe License.\n-->\n\n<div id="primary-navbar"></div>\n<div id="dashboard" class="container-fluid one-pane">\n  <div class="fixed-header">\n    <div id="breadcrumbs"></div>\n    <div id="api-navbar"></div>\n  </div>\n\n\n  <div class="row-fluid content-area">\n  	<div id="tabs" class="row"></div>\n    <div id="dashboard-content" class="window-resizeable"></div>\n  </div>\n</div>\n\n';return __p},this.JST["app/templates/layouts/one_pane_notabs.html"]=function(obj){obj||(obj={});{var __p="";_.escape}with(obj)__p+='<!--\nLicensed under the Apache License, Version 2.0 (the "License"); you may not\nuse this file except in compliance with the License. You may obtain a copy of\nthe License at\n\n  http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an "AS IS"
  BASIS, WITHOUT\nWARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\nLicense for the specific language governing permissions and limitations under\nthe License.\n-->\n\n<div id="primary-navbar"></div>\n<div id="dashboard" class="container-fluid one-pane">\n  <div class="fixed-header">\n    <div id="breadcrumbs"></div>\n    <div id="api-navbar"></div>\n  </div>\n\n\n  <div class="row-fluid content-area">\n    <div id="dashboard-content" class="window-resizeable"></div>\n  </div>\n</div>\n\n';return __p},this.JST["app/templates/layouts/two_pane.html"]=function(obj){obj||(obj={});{var __p="";_.escape}with(obj)__p+='<!--\nLicensed under the Apache License, Version 2.0 (the "License"); you may not\nuse this file except in compliance with the License. You may obtain a copy of\nthe License at\n\n  http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an "AS IS"
  BASIS, WITHOUT\nWARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\nLicense for the specific language governing permissions and limitations under\nthe License.\n-->\n\n\n<div id="primary-navbar"></div>\n<div id="dashboard" class="container-fluid">\n  <div class="fixed-header">\n    <div id="breadcrumbs"></div>\n    <div id="api-navbar"></div>\n  </div>\n\n\n  <div class="row-fluid content-area">\n  	<div id="tabs" class="row"></div>\n    <div id="left-content" class="span6"></div>\n    <div id="right-content" class="span6"></div>\n  </div>\n</div>\n\n';return __p},this.JST["app/templates/layouts/with_right_sidebar.html"]=function(obj){obj||(obj={});{var __p="";_.escape}with(obj)__p+='<!--\nLicensed under the Apache License, Version 2.0 (the "License"); you may not\nuse this file except in compliance with the License. You may obtain a copy of\nthe License at\n\n  http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in wri
 ting, software\ndistributed under the License is distributed on an "AS IS" BASIS, WITHOUT\nWARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\nLicense for the specific language governing permissions and limitations under\nthe License.\n-->\n\n<div id="primary-navbar"></div>\n<div id="dashboard" class="container-fluid">\n  <div class="fixed-header">\n    <div id="breadcrumbs"></div>\n    <div id="api-navbar"></div>\n  </div>\n  <div class="with-sidebar-right content-area">\n    <div id="dashboard-content" class="list"></div>\n    <div id="sidebar-content" class="sidebar pull-right window-resizeable"></div>\n  </div>\n</div>\n\n';return __p},this.JST["app/templates/layouts/with_sidebar.html"]=function(obj){obj||(obj={});{var __p="";_.escape}with(obj)__p+='<!--\nLicensed under the Apache License, Version 2.0 (the "License"); you may not\nuse this file except in compliance with the License. You may obtain a copy of\nthe License at\n\n  http://www.apache.org/license
 s/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an "AS IS" BASIS, WITHOUT\nWARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\nLicense for the specific language governing permissions and limitations under\nthe License.\n-->\n\n\n<div id="primary-navbar"></div>\n<div id="dashboard" class="container-fluid">\n<header class="fixed-header">\n  <div id="breadcrumbs"></div>\n  <div id="api-navbar"></div>\n</header>\n  <div class="with-sidebar content-area">\n    <div id="sidebar-content" class="sidebar"></div>\n    <div id="dashboard-content" class="list window-resizeable"></div>\n  </div>\n</div>\n\n';return __p},this.JST["app/templates/layouts/with_tabs.html"]=function(obj){obj||(obj={});{var __p="";_.escape}with(obj)__p+='<!--\nLicensed under the Apache License, Version 2.0 (the "License"); you may not\nuse this file except in compliance with the License. You may obtain a copy of\
 nthe License at\n\n  http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an "AS IS" BASIS, WITHOUT\nWARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\nLicense for the specific language governing permissions and limitations under\nthe License.\n-->\n\n<div id="primary-navbar"></div>\n<div id="dashboard" class="container-fluid">\n\n<div class="fixed-header">\n  <div id="breadcrumbs"></div>\n  <div id="api-navbar"></div>\n</div>\n\n  <div class="row-fluid content-area">\n  	<div id="tabs" class="row-fluid"></div>\n    <div id="dashboard-content" class="list span12 window-resizeable"></div>\n  </div>\n\n\n';return __p},this.JST["app/templates/layouts/with_tabs_sidebar.html"]=function(obj){obj||(obj={});{var __p="";_.escape}with(obj)__p+='<!--\nLicensed under the Apache License, Version 2.0 (the "License"); you may not\nuse this file except in compliance w
 ith the License. You may obtain a copy of\nthe License at\n\n  http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an "AS IS" BASIS, WITHOUT\nWARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\nLicense for the specific language governing permissions and limitations under\nthe License.\n-->\n\n<div id="primary-navbar"></div>\n<div id="dashboard" class="container-fluid">\n\n<header class="fixed-header">\n  <div id="breadcrumbs"></div>\n  <div id="api-navbar"></div>\n</header>\n\n\n  <div class="with-sidebar content-area">\n\n    <div id="tabs" class="row-fluid"></div>\n\n    <aside id="sidebar-content" class="sidebar"></aside>\n\n    <section id="dashboard-content" class="list pull-right window-resizeable">\n      <div class="inner">\n        <div id="dashboard-upper-menu" class="window-resizeable"></div>\n        <div id="dashboard-upper-content"></div>
 \n\n        <div id="dashboard-lower-content"></div>\n      </div>\n    </section>\n\n  </div>\n\n\n';return __p},this.JST["app/addons/account/templates/accountactivity.html"]=function(obj){obj||(obj={});{var __t,__p="";_.escape,Array.prototype.join}with(obj)__p+="<header>\n	",user.noHistory()?__p+="\n	  <h2>Here's your usage so far this month.</h2>\n	":(__p+='\n	    <p class="lead usage-links ',past&&(__p+=" past-active "),__p+='">Your usage: \n	    <!-- <a class="current-month" href="#">So far this month</a> | <a class="last-month" href="#/history/2013/'+(null==(__t=month)?"":__t)+'">Last month</a> -->\n	    <div class="btn-group usage-links-toggle" data-toggle="buttons-radio">\n	      <button type="button" class="button active" value="current-month" data-url="#/account/usage" >So far this month</button>\n	      <button type="button" class="button" value"last-month" data-url="#/account/usage/'+(null==(__t=year)?"":__t)+"/"+(null==(__t=month)?"":__t)+'">Last month</button>\n	    </
 div>\n	    </p>\n	'),__p+='\n	<div id="messaging"></div>\n</header>\n\n<section id="summary" class="row activity-pane">\n	<div id="tabs-container">\n		<div id="bill" class="row-fluid"></div>\n		<div id="usage" class=""></div>\n	</div>\n</section>\n';return __p},this.JST["app/addons/account/templates/accountdashboard.html"]=function(obj){obj||(obj={});{var __p="";_.escape}with(obj)__p+='<div id="primary-navbar"></div>\n<div id="dashboard" class="container-fluid accountDash">\n  <div class="with-sidebar content-area">\n    <div id="sidebar-content" class="sidebar"></div>\n    <div id="dashboard-content" class="list window-resizeable"></div>\n  </div>\n</div>\n';return __p},this.JST["app/addons/account/templates/accountinfo.html"]=function(obj){obj||(obj={});{var __t,__p="";_.escape}with(obj)__p+='<header>\n  <h2>Account information</h2>\n</header>\n<form id="accountinfoForm">\n  <div class="controls controls-row">\n    <label for="firstname">First name</label>\n    <input type="text" 
 id="firstname" name="first_name" tabindex="1" placeholder="name here" value="'+(null==(__t=first)?"":__t)+'">\n  </div>\n\n  <div class="controls controls-row">\n    <label for="lastname">Last Name</label>\n    <input type="text" id="lastname" name="last_name" tabindex="2" placeholder="Last name" value="'+(null==(__t=last)?"":__t)+'">\n  </div>\n\n  <div class="controls controls-row">\n    <label for="company">Company</label>\n    <input type="text" id="company" name="company" tabindex="3" placeholder="your company" value="'+(null==(__t=company)?"":__t)+'">\n  </div>\n\n  <div class="controls controls-row">\n    <label for="email">Email</label>\n    <input type="text" id="email" name="email" tabindex="4" placeholder="info@cloudant.com" value="'+(null==(__t=email)?"":__t)+'">\n  </div>\n\n  <div class="form-actions">\n   <input class="button green" type="submit" tabindex="5" value="Save Changes"/>\n  </div>\n</form>\n\n';return __p},this.JST["app/addons/account/templates/activitytabs
 .html"]=function(obj){obj||(obj={});{var __p="";_.escape}with(obj)__p+='<div id="bill" class="row-fluid"></div>\n<div id="usage" class=""></div>\n';return __p},this.JST["app/addons/account/templates/announcements.html"]=function(obj){obj||(obj={});{var __p="";_.escape}with(obj)__p+='\n<header>\n    <h2>Welcome to the new Cloudant Dashboard</h2>\n    <p>December 18, 2013</p>\n    <p>\n    Before we get to what’s new, a little business: if for some reason you need to use it, the <a href="https://cloudant.com/dashboard" target="_blank">old Cloudant dashboard</a> will remain online until March 2014. (For security reasons, you\'ll need to sign in again.)\n    </p>\n</header>\n    <div class="activity-pane">\n        <h4>\n            Behold!\n        </h4>\n        <p>\n            Now, on to the new features we’re thrilled to share with you...\n        </p>\n\n        <hr />\n\n        <h4>\n            Support\n        </h4>\n        <p>\n            New to the Cloudant customer ex
 perience is <a href="#/support">a bona fide support portal</a>, where you can create and reply to support cases.\n        </p>\n        <p>\n            <img src="/dashboard.assets/img/Screenshot-support.png"; alt="Active and closed cases in the Cloudant support portal." style="border: 1px solid #ccc" />\n        </p>\n\n        <hr />\n\n        <h4>\n            Replication\n        </h4>\n        <p>\n            <a href="#/replication">Replication</a> has never been this easy. Just pick source and target databases with the handy autocomplete fields, click Replicate, and authenticate with your Cloudant password. That’s it.\n        </p>\n        <p>\n            <img src="/dashboard.assets/img/Screenshot-replication.png"; alt="Autocomplete fields for source and target databases make replication easy at Cloudant." style="border: 1px solid #ccc" />\n        </p>\n\n        <hr />\n\n        <h4>\n            Code Editors\n        </h4>\n        <p>\n            The fields for edi
 ting JavaScript are now feature-rich code editors with syntax checking. This measure, along with the tooling in secondary indexes, help prevent MapReduce mistakes and JSON formatting no-nos.\n        </p>\n        <p>\n            <img src="/dashboard.assets/img/Screenshot-code-editors.png"; alt="JavaScript code editors in the Databases section of the Cloudant dashboard." style="border: 1px solid #ccc" />\n        </p>\n\n        <hr />\n\n        <h4>\n            Secondary Indexes\n        </h4>\n        <p>\n            The secondary indexes inside your Cloudant databases are now preview-able. Just click “Preview” to view a temporary result in your browser. When what you see is what you want, kick off the indexing job on the server with the “Save &amp; Build Index” button.\n        </p>\n        <p>\n            <img src="/dashboard.assets/img/Screenshot-preview.png"; alt="Preview secondary indexes before saving them to save time." style="border: 1px solid #ccc" />\n     
    </p>\n\n        <hr />\n\n        <h4>\n            Search Indexes\n        </h4>\n        <p>\n            The new search index interface brings the power of Lucene full-text search to the dashboard. \n        </p>\n        <p>\n            <img src="/dashboard.assets/img/Screenshot-search.png"; alt="Query your Cloudant search indexes right from the dashboard." style="border: 1px solid #ccc" />\n        </p>\n        <p>\n            If you haven’t tried Cloudant Search yet, run through the <a href="https://cloudant.com/for-developers/search/"; target="_blank">Search API demo</a> in For Developers first, and come back here to check it out.\n        </p>\n        <hr />\n        <p>\n            We hope you enjoy the new dashboard, and all of the new features. When you have feedback, please share it. <a href="#/support">The Support portal</a> is the perfect place for that.\n        </p>\n\n        <p>\n            Happy dashboarding!\n        </p>\n    </div>\n';return __p},thi
 s.JST["app/addons/account/templates/bill.html"]=function(obj){obj||(obj={});{var __t,__p="";_.escape}with(obj)__p+='\n  <li class="span3 active" style="margin-left: 0" data-tab="#heavy-tab">\n    <div class="indicator-wrapper"> \n      <div class="indicator"> \n    </div>\n    <div class="content">\n      <p>Heavy HTTP</p>\n      <span class="cost"><span class="super">$</span>'+(null==(__t=writes.cost)?"":__t)+'</span>\n      <div class="operator">+</div>\n    </div>  \n    </div>\n  </li>\n  <li class="span3" data-tab="#light-tab">\n    <div class="indicator-wrapper"> \n      <div class="indicator"> \n    </div>\n    <div class="content">\n      <p>Light HTTP</p>\n      <span class="cost"><span class="super">$</span>'+(null==(__t=reads.cost)?"":__t)+'</span>\n      <div class="operator">+</div>\n    </div>  \n    </div>\n  </li>\n  <li class="span3" data-tab="#data-tab">\n    <div class="indicator-wrapper"> \n      <div class="indicator"> \n    </div>\n    <div class="content">\n  
     <p>Data Volume</p>\n      <span class="cost"><span class="super">$</span>'+(null==(__t=data_vol.cost)?"":__t)+'</span>\n      <div class="operator">=</div>\n    </div> \n    </div>\n  </li>\n  <!-- TOTAL -->\n  <div class="span3 total">\n      <div id="bill-summary"></div>\n      <div id="bill-message"></div>\n      <div class="learn-more">\n        <a href="https://cloudant.com/pricing/">Learn about Cloudant pricing</a>\n      </div>\n  </div>\n  \n';return __p},this.JST["app/addons/account/templates/billbreakdown.html"]=function(obj){obj||(obj={});{var __t,__p="";_.escape}with(obj)__p+="<p>\n	"+(null==(__t=count)?"":__t)+" "+(null==(__t=label)?"":__t)+" so far this month @\n	"+(null==(__t=costString)?"":__t)+" = $"+(null==(__t=cost)?"":__t)+"\n</p>\n";return __p},this.JST["app/addons/account/templates/billmessage.html"]=function(obj){obj||(obj={});{var __t,__p="";_.escape,Array.prototype.join}with(obj)user.underThirty()?__p+='\n<div class="alert alert-info">\n	<p>Lucky you! Yo
 ur first 30 days are free. We won\'t start charging you for usage until '+(null==(__t=endDate)?"":__t)+'. <a href="#account/payment">Add a credit card.</a></p> \n</div>\n':freeUsage?__p+='\n<div class="alert alert-info">\n		We\'ll not charge you for this month if your usage remains below\n		$'+(null==(__t=chargingThreshold)?"":__t)+".\n</div>\n":(__p+='\n	<div class="alert">\n		Your usage this month has exceeded $5. At the end of this billing period (end of the month), we will charge you for your usage. 	',onFile||(__p+='<a href="#account/payment">Add a credit card.</a>'),__p+=" \n	</div>\n"),__p+="\n";return __p},this.JST["app/addons/account/templates/billsummary.html"]=function(obj){obj||(obj={});{var __t,__p="";_.escape}with(obj)__p+="<div>\nFor period ending <strong>"+(null==(__t=bill_date)?"":__t)+'</strong>\n  <span class="cost green"><span class="super">$</span>'+(null==(__t=total)?"":__t)+"</span>\n</div>\n";return __p},this.JST["app/addons/account/templates/forgotpassword.h
 tml"]=function(obj){obj||(obj={});{var __p="";_.escape}with(obj)__p+='<header>\n  <h2>Forgot Password</h2>\n</header>\n<form class="form-horizontal" id="passwordForm">\n  <div class="control-group">\n    <label for="username" class="control-label">Username</label>\n    <div class="controls">\n      <input type="username" id="username" tabindex="1" name="username">\n    </div>\n  </div>\n  <div class="form-actions">\n    <button class="button green">Send me my password</button>\n  </div>\n</form>\n\n\n';return __p},this.JST["app/addons/account/templates/locationinfo.html"]=function(obj){obj||(obj={});{var __t,__p="";_.escape,Array.prototype.join}with(obj)__p+='<header>\n  <h2>Choose a location of your data</h2>\n  <p>Select a new location for your data, and click submit. Note that data moves are asynchronous—you won\'t experience any downtime, but it may take some time for changes to propagate. We will email you when the operation is complete.</p>\n</header>\n<form class="form-hori
 zontal" id="locationForm">\n  <div class="control-group">\n    <h4>US East</h4>\n    ',_.each(east,function(a){__p+='\n      <label class="radio">\n        <input type="radio" name="cluster" value="'+(null==(__t=a.get("id"))?"":__t)+'" ',location===a.get("id")&&(__p+=' checked="" '),__p+=" >\n        <strong>"+(null==(__t=a.get("cluster"))?"":__t)+"</strong>—"+(null==(__t=a.get("host"))?"":__t)+"\n      </label> \n    "}),__p+="\n\n    <h4>US Midwest</h4>\n    ",_.each(midwest,function(a){__p+='\n      <label class="radio">\n        <input type="radio" name="cluster" value="'+(null==(__t=a.get("id"))?"":__t)+'" ',location===a.get("id")&&(__p+=' checked="" '),__p+=" >\n        <strong>"+(null==(__t=a.get("cluster"))?"":__t)+"</strong>—"+(null==(__t=a.get("host"))?"":__t)+"\n      </label> \n    "}),__p+="\n\n    <h4>US West</h4>\n    ",_.each(west,function(a){__p+='\n      <label class="radio">\n        <input type="radio" name="cluster" value="'+(null==(__t=a.get("id"))?"":__t)+
 '" ',location===a.get("id")&&(__p+=' checked="" '),__p+=" >\n        <strong>"+(null==(__t=a.get("cluster"))?"":__t)+"</strong>—"+(null==(__t=a.get("host"))?"":__t)+"\n      </label> \n    "}),__p+="\n\n    <h4>Europe</h4>\n    ",_.each(europe,function(a){__p+='\n      <label class="radio">\n        <input type="radio" name="cluster" value="'+(null==(__t=a.get("id"))?"":__t)+'" ',location===a.get("id")&&(__p+=' checked="" '),__p+=" >\n        <strong>"+(null==(__t=a.get("cluster"))?"":__t)+"</strong>—"+(null==(__t=a.get("host"))?"":__t)+"\n      </label> \n    "}),__p+="\n\n    <h4>Southeast Asia</h4>\n    ",_.each(asia,function(a){__p+='\n      <label class="radio">\n        <input type="radio" name="cluster" value="'+(null==(__t=a.get("id"))?"":__t)+'" ',location===a.get("id")&&(__p+=' checked="" '),__p+=" >\n        <strong>"+(null==(__t=a.get("cluster"))?"":__t)+"</strong>—"+(null==(__t=a.get("host"))?"":__t)+"\n      </label> \n    "}),__p+='\n  </div>\n  <div class="form
 -actions">\n    <button class="button green">Save changes</button>\n  </div>\n</form>\n';return __p},this.JST["app/addons/account/templates/newuser.html"]=function(obj){obj||(obj={});{var __t,__p="";_.escape}with(obj)__p+='\n<div class="alert alert-block">\n<p class="new-user">Hi '+(null==(__t=user.get("username"))?"":__t)+", we haven't yet taken a snapshot of your usage, so we don't yet have usage to report to you. We'll be able to show you your usa

<TRUNCATED>
http://git-wip-us.apache.org/repos/asf/couchdb/blob/cca309f3/share/www/favicon.ico
----------------------------------------------------------------------
diff --git a/share/www/favicon.ico b/share/www/favicon.ico
deleted file mode 100644
index ed3f7aa..0000000
Binary files a/share/www/favicon.ico and /dev/null differ


[07/37] move JS tests into safety

Posted by ja...@apache.org.
http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/www/script/test/lorem.txt
----------------------------------------------------------------------
diff --git a/share/www/script/test/lorem.txt b/share/www/script/test/lorem.txt
deleted file mode 100644
index 0ef85ba..0000000
--- a/share/www/script/test/lorem.txt
+++ /dev/null
@@ -1,103 +0,0 @@
-Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus nunc sapien, porta id pellentesque at, elementum et felis. Curabitur condimentum ante in metus iaculis quis congue diam commodo. Donec eleifend ante sed nulla dapibus convallis. Ut cursus aliquam neque, vel porttitor tellus interdum ut. Sed pharetra lacinia adipiscing. In tristique tristique felis non tincidunt. Nulla auctor mauris a velit cursus ultricies. In at libero quis justo consectetur laoreet. Nullam id ultrices nunc. Donec non turpis nulla, eu lacinia ante. Nunc eu orci et turpis pretium venenatis. Nam molestie, lacus at dignissim elementum, ante libero consectetur libero, ut lacinia lacus urna et purus. Nullam lorem ipsum, dapibus vel ullamcorper a, malesuada a metus. Sed porta adipiscing magna, quis pulvinar purus mattis fringilla. Integer pellentesque sapien in neque tristique ac iaculis libero ultricies. Ut eget pharetra purus.
-
-Nulla in convallis tellus. Proin tincidunt suscipit vulputate. Suspendisse potenti. Nullam tristique justo mi, a tristique ligula. Duis convallis aliquam iaculis. Nulla dictum fringilla congue. Suspendisse ac leo lectus, ac aliquam justo. Ut porttitor commodo mi sed luctus. Nulla at enim lorem. Nunc eu justo sapien, a blandit odio. Curabitur faucibus sollicitudin dolor, id lacinia sem auctor in. Donec varius nunc at lectus sagittis nec luctus arcu pharetra. Nunc sed metus justo. Cras vel mauris diam. Ut feugiat felis eget neque pharetra vestibulum consectetur massa facilisis. Quisque consectetur luctus nisi quis tincidunt. Vivamus cursus cursus quam non blandit. Pellentesque et velit lacus. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.
-
-In et dolor vitae orci adipiscing congue. Aliquam gravida nibh at nisl gravida molestie. Curabitur a bibendum sapien. Aliquam tincidunt, nulla nec pretium lobortis, odio augue tincidunt arcu, a lobortis odio sem ut purus. Donec accumsan mattis nunc vitae lacinia. Suspendisse potenti. Integer commodo nisl quis nibh interdum non fringilla dui sodales. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. In hac habitasse platea dictumst. Etiam ullamcorper, mi id feugiat bibendum, purus neque cursus mauris, id sodales quam nisi id velit. Sed lectus leo, tincidunt vel rhoncus imperdiet, blandit in leo. Integer quis magna nulla. Donec vel nisl magna, ut rhoncus dui. Aliquam gravida, nulla nec eleifend luctus, neque nibh pharetra ante, quis egestas elit metus a mi. Nunc nec augue quam. Morbi tincidunt tristique varius. Suspendisse iaculis elit feugiat magna pellentesque ultricies. Vestibulum aliquam tortor non ante ullamcorper fringilla. Donec iaculis
  mi quis mauris ornare vestibulum.
-
-In a magna nisi, a ultricies massa. Donec elit neque, viverra non tempor quis, fringilla in metus. Integer odio odio, euismod vitae mollis sed, sodales eget libero. Donec nec massa in felis ornare pharetra at nec tellus. Nunc lorem dolor, pretium vel auctor in, volutpat vitae felis. Maecenas rhoncus, orci vel blandit euismod, turpis erat tincidunt ante, elementum adipiscing nisl urna in nisi. Phasellus sagittis, enim sed accumsan consequat, urna augue lobortis erat, non malesuada quam metus sollicitudin ante. In leo purus, dignissim quis varius vel, pellentesque et nibh. In sed tortor iaculis libero mollis pellentesque id vitae lectus. In hac habitasse platea dictumst. Phasellus mauris enim, posuere eget luctus ac, iaculis et quam. Vivamus et nibh diam, elementum egestas tellus. Aenean vulputate malesuada est. Sed posuere porta diam a sodales. Proin eu sem non velit facilisis venenatis sed a turpis.
-
-Pellentesque sed risus a ante vulputate lobortis sit amet eu nisl. Suspendisse ut eros mi, a rhoncus lacus. Curabitur fermentum vehicula tellus, a ornare mi condimentum vel. Integer molestie volutpat viverra. Integer posuere euismod venenatis. Proin ac mauris sed nulla pharetra porttitor. Duis vel dui in risus sodales auctor sit amet non enim. Maecenas mollis lacus at ligula faucibus sodales. Cras vel neque arcu. Sed tincidunt tortor pretium nisi interdum quis dictum arcu laoreet. Morbi pretium ultrices feugiat. Maecenas convallis augue nec felis malesuada malesuada scelerisque mauris placerat. Sed at magna enim, at fringilla dolor. Quisque ut mattis dui. Praesent consectetur ante viverra nisi blandit pharetra. Quisque metus elit, dignissim vitae fermentum sit amet, fringilla imperdiet odio. Cras eget purus eget tellus feugiat luctus a ac purus. Cras vitae nisl vel augue rhoncus porttitor sit amet quis lorem. Donec interdum pellentesque adipiscing. Phasellus neque libero, aliquam in
  mattis vitae, consectetur adipiscing nibh.
-
-Donec nec nulla urna, ac sagittis lectus. Suspendisse non elit sed mi auctor facilisis vitae et lectus. Fusce ac vulputate mauris. Morbi condimentum ultrices metus, et accumsan purus malesuada at. Maecenas lobortis ante sed massa dictum vitae venenatis elit commodo. Proin tellus eros, adipiscing sed dignissim vitae, tempor eget ante. Aenean id tellus nec magna cursus pharetra vitae vel enim. Morbi vestibulum pharetra est in vulputate. Aliquam vitae metus arcu, id aliquet nulla. Phasellus ligula est, hendrerit nec iaculis ut, volutpat vel eros. Suspendisse vitae urna turpis, placerat adipiscing diam. Phasellus feugiat vestibulum neque eu dapibus. Nulla facilisi. Duis tortor felis, euismod sit amet aliquet in, volutpat nec turpis. Mauris rhoncus ipsum ut purus eleifend ut lobortis lectus dapibus. Quisque non erat lorem. Vivamus posuere imperdiet iaculis. Ut ligula lacus, eleifend at tempor id, auctor eu leo.
-
-Donec mi enim, laoreet pulvinar mollis eu, malesuada viverra nunc. In vitae metus vitae neque tempor dapibus. Maecenas tincidunt purus a felis aliquam placerat. Nulla facilisi. Suspendisse placerat pharetra mattis. Integer tempor malesuada justo at tempus. Maecenas vehicula lorem a sapien bibendum vel iaculis risus feugiat. Pellentesque diam erat, dapibus et pellentesque quis, molestie ut massa. Vivamus iaculis interdum massa id bibendum. Quisque ut mauris dui, sit amet varius elit. Vestibulum elit lorem, rutrum non consectetur ut, laoreet nec nunc. Donec nec mauris ante. Curabitur ut est sed odio pharetra laoreet. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur purus risus, laoreet sed porta id, sagittis vel ipsum. Maecenas nibh diam, cursus et varius sit amet, fringilla sed magna. Nullam id neque eu leo faucibus mollis. Duis nec adipiscing mauris. Suspendisse sollicitudin, enim eu pulvinar commodo, erat augue ultrices mi, a tristique magna sem non libero.
-
-Sed in metus nulla. Praesent nec adipiscing sapien. Donec laoreet, velit non rutrum vestibulum, ligula neque adipiscing turpis, at auctor sapien elit ut massa. Nullam aliquam, enim vel posuere rutrum, justo erat laoreet est, vel fringilla lacus nisi non lectus. Etiam lectus nunc, laoreet et placerat at, venenatis quis libero. Praesent in placerat elit. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Pellentesque fringilla augue eu nibh placerat dictum. Nunc porttitor tristique diam, eu aliquam enim aliquet vel. Aliquam lacinia interdum ipsum, in posuere metus luctus vel. Vivamus et nisl a eros semper elementum. Donec venenatis orci at diam tristique sollicitudin. In eu eros sed odio rutrum luctus non nec tellus.
-
-Nulla nec felis elit. Nullam in ipsum in ipsum consequat fringilla quis vel tortor. Phasellus non massa nisi, sit amet aliquam urna. Sed fermentum nibh vitae lacus tincidunt nec tincidunt massa bibendum. Etiam elit dui, facilisis sit amet vehicula nec, iaculis at sapien. Ut at massa id dui ultrices volutpat ut ac libero. Fusce ipsum mi, bibendum a lacinia et, pulvinar eget mauris. Proin faucibus urna ut lorem elementum vulputate. Duis quam leo, malesuada non euismod ut, blandit facilisis mauris. Suspendisse sit amet magna id velit tincidunt aliquet nec eu dolor. Curabitur bibendum lorem vel felis tempus dapibus. Aliquam erat volutpat. Aenean cursus tortor nec dui aliquet porta. Aenean commodo iaculis suscipit. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Quisque sit amet ornare elit. Nam ligula risus, vestibulum nec mattis in, condimentum ac ante. Donec fringilla, justo et ultrices faucibus, tellus est volutpat massa, vitae commodo sapien d
 iam non risus. Vivamus at arcu gravida purus mollis feugiat.
-
-Nulla a turpis quis sapien commodo dignissim eu quis justo. Maecenas eu lorem odio, ut hendrerit velit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Proin facilisis porttitor ullamcorper. Praesent mollis dignissim massa, laoreet aliquet velit pellentesque non. Nunc facilisis convallis tristique. Mauris porttitor ante at tellus convallis placerat. Morbi aliquet nisi ac nisl pulvinar id dictum nisl mollis. Sed ornare sem et risus placerat lobortis id eget elit. Integer consequat, magna id suscipit pharetra, nulla velit suscipit orci, ut interdum augue augue quis quam. Fusce pretium aliquet vulputate. Mauris blandit dictum molestie. Proin nulla nibh, bibendum eu placerat at, tincidunt ac nisl. Nullam vulputate metus ut libero rutrum ultricies. Nunc sit amet dui mauris. Suspendisse adipiscing lacus in augue eleifend mollis.
-
-Duis pretium ultrices mattis. Nam euismod risus a erat lacinia bibendum. Morbi massa tortor, consectetur id eleifend id, pellentesque vel tortor. Praesent urna lorem, porttitor at condimentum vitae, luctus eget elit. Maecenas fringilla quam convallis est hendrerit viverra. Etiam vehicula, sapien non pulvinar adipiscing, nisi massa vestibulum est, id interdum mauris velit eu est. Vestibulum est arcu, facilisis at ultricies non, vulputate id sapien. Vestibulum ipsum metus, pharetra nec pellentesque id, facilisis id sapien. Donec rutrum odio et lacus ultricies ullamcorper. Integer sed est ut mi posuere tincidunt quis non leo. Morbi tellus justo, ultricies sit amet ultrices quis, facilisis vitae magna. Donec ligula metus, pellentesque non tristique ac, vestibulum sed erat. Aliquam erat volutpat.
-
-Nam dignissim, nisl eget consequat euismod, sem lectus auctor orci, ut porttitor lacus dui ac neque. In hac habitasse platea dictumst. Fusce egestas porta facilisis. In hac habitasse platea dictumst. Mauris cursus rhoncus risus ac euismod. Quisque vitae risus a tellus venenatis convallis. Curabitur laoreet sapien eu quam luctus lobortis. Vivamus sollicitudin sodales dolor vitae sodales. Suspendisse pharetra laoreet aliquet. Maecenas ullamcorper orci vel tortor luctus iaculis ut vitae metus. Vestibulum ut arcu ac tellus mattis eleifend eget vehicula elit.
-
-In sed feugiat eros. Donec bibendum ullamcorper diam, eu faucibus mauris dictum sed. Duis tincidunt justo in neque accumsan dictum. Maecenas in rutrum sapien. Ut id feugiat lacus. Nulla facilisi. Nunc ac lorem id quam varius cursus a et elit. Aenean posuere libero eu tortor vehicula ut ullamcorper odio consequat. Sed in dignissim dui. Curabitur iaculis tempor quam nec placerat. Aliquam venenatis nibh et justo iaculis lacinia. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque tempus magna sed mi aliquet eget varius odio congue.
-
-Integer sem sem, semper in vestibulum vitae, lobortis quis erat. Duis ante lectus, fermentum sed tempor sit amet, placerat sit amet sem. Mauris congue tincidunt ipsum. Ut viverra, lacus vel varius pharetra, purus enim pulvinar ipsum, non pellentesque enim justo non erat. Fusce ipsum orci, ultrices sed pellentesque at, hendrerit laoreet enim. Nunc blandit mollis pretium. Ut mollis, nulla aliquam sodales vestibulum, libero lorem tempus tortor, a pellentesque nibh elit a ipsum. Phasellus fermentum ligula at neque adipiscing sollicitudin. Suspendisse id ipsum arcu. Sed tincidunt placerat viverra. Donec libero augue, porttitor sit amet varius eget, rutrum nec lacus. Proin blandit orci sit amet diam dictum id porttitor risus iaculis. Integer lacinia feugiat leo, vitae auctor turpis eleifend vel. Suspendisse lorem quam, pretium id bibendum sed, viverra vitae tortor. Nullam ultricies libero eu risus convallis eget ullamcorper nisi elementum. Mauris nulla elit, bibendum id vulputate vitae, i
 mperdiet rutrum lorem. Curabitur eget dignissim orci. Sed semper tellus ipsum, at blandit dui. Integer dapibus facilisis sodales. Vivamus sollicitudin varius est, quis ornare justo cursus id.
-
-Nunc vel ullamcorper mi. Suspendisse potenti. Nunc et urna a augue scelerisque ultrices non quis mi. In quis porttitor elit. Aenean quis erat nulla, a venenatis tellus. Fusce vestibulum nisi sed leo adipiscing dignissim. Nunc interdum, lorem et lacinia vestibulum, quam est mattis magna, sit amet volutpat elit augue at libero. Cras gravida dui quis velit lobortis condimentum et eleifend ligula. Phasellus ac metus quam, id venenatis mi. Aliquam ut turpis ac tellus dapibus dapibus eu in mi. Quisque eget nibh eros. Fusce consectetur leo velit.
-
-Vestibulum semper egestas mauris. Morbi vestibulum sem sem. Aliquam venenatis, felis sed eleifend porta, mauris diam semper arcu, sit amet ultricies est sapien sit amet libero. Vestibulum dui orci, ornare condimentum mollis nec, molestie ac eros. Proin vitae mollis velit. Praesent eget felis mi. Maecenas eu vulputate nisi. Vestibulum varius, arcu in ultricies vestibulum, nibh leo sagittis odio, ut bibendum nisl mi nec diam. Integer at enim feugiat nulla semper bibendum ut a velit. Proin at nisi ut lorem aliquam varius eget quis elit. Nullam nec odio vel lectus congue consequat adipiscing ac mi. Fusce vitae laoreet libero. Curabitur sit amet sem neque, nec posuere enim. Curabitur at massa a sem gravida iaculis nec et nibh. Sed vitae dui vitae leo tincidunt pretium a aliquam erat. Suspendisse ultricies odio at metus tempor in pellentesque arcu ultricies.
-
-Sed aliquam mattis quam, in vulputate sapien ultrices in. Pellentesque quis velit sed dui hendrerit cursus. Pellentesque non nunc lacus, a semper metus. Fusce euismod velit quis diam suscipit consequat. Praesent commodo accumsan neque. Proin viverra, ipsum non tristique ultrices, velit velit facilisis lorem, vel rutrum neque eros ac nisi. Suspendisse felis massa, faucibus in volutpat ac, dapibus et odio. Pellentesque id tellus sit amet risus ultricies ullamcorper non nec sapien. Nam placerat viverra ullamcorper. Nam placerat porttitor sapien nec pulvinar. Curabitur vel odio sit amet odio accumsan aliquet vitae a lectus. Pellentesque lobortis viverra consequat. Mauris elementum cursus nulla, sit amet hendrerit justo dictum sed. Maecenas diam odio, fringilla ac congue quis, adipiscing ut elit.
-
-Aliquam lorem eros, pharetra nec egestas vitae, mattis nec risus. Mauris arcu massa, sodales eget gravida sed, viverra vitae turpis. Ut ligula urna, euismod ac tincidunt eu, faucibus sed felis. Praesent mollis, ipsum quis rhoncus dignissim, odio sem venenatis nulla, at consequat felis augue vel erat. Nam fermentum feugiat volutpat. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Etiam vitae dui in nisi adipiscing ultricies non eu justo. Donec tristique ultricies adipiscing. Nulla sodales, nunc a tristique elementum, erat neque egestas nisl, at hendrerit orci sapien sed libero. Vivamus a mauris turpis, quis laoreet ipsum. Nunc nec mi et nisl pellentesque scelerisque. Vivamus volutpat, justo tristique lacinia condimentum, erat justo ultrices urna, elementum viverra eros augue non libero. Sed mollis mollis arcu, at fermentum diam suscipit quis.
-
-Etiam sit amet nibh justo, posuere volutpat nunc. Morbi pellentesque neque in orci volutpat eu scelerisque lorem dictum. Mauris mollis iaculis est, nec sagittis sapien consequat id. Nunc nec malesuada odio. Duis quis suscipit odio. Mauris purus dui, sodales id mattis sit amet, posuere in arcu. Phasellus porta elementum convallis. Maecenas at orci et mi vulputate sollicitudin in in turpis. Pellentesque cursus adipiscing neque sit amet commodo. Fusce ut mi eu lectus porttitor volutpat et nec felis.
-
-Curabitur scelerisque eros quis nisl viverra vel ultrices velit vestibulum. Sed lobortis pulvinar sapien ac venenatis. Sed ante nibh, rhoncus eget dictum in, mollis ut nisi. Phasellus facilisis mi non lorem tristique non eleifend sem fringilla. Integer ut augue est. In venenatis tincidunt scelerisque. Etiam ante dui, posuere quis malesuada vitae, malesuada a arcu. Aenean faucibus venenatis sapien, ut facilisis nisi blandit vel. Aenean ac lorem eu sem fermentum placerat. Proin neque purus, aliquet ut tincidunt ut, convallis sit amet eros. Phasellus vehicula ullamcorper enim non vehicula. Etiam porta odio ut ipsum adipiscing egestas id a odio. Pellentesque blandit, sapien ut pulvinar interdum, mi nulla hendrerit elit, in tempor diam enim a urna. In tellus odio, ornare sed condimentum a, mattis eu augue.
-
-Fusce hendrerit porttitor euismod. Donec malesuada egestas turpis, et ultricies felis elementum vitae. Nullam in sem nibh. Nullam ultricies hendrerit justo sit amet lobortis. Sed tincidunt, mauris at ornare laoreet, sapien purus elementum elit, nec porttitor nisl purus et erat. Donec felis nisi, rutrum ullamcorper gravida ac, tincidunt sit amet urna. Proin vel justo vitae eros sagittis bibendum a ut nibh. Phasellus sodales laoreet tincidunt. Maecenas odio massa, condimentum id aliquet ut, rhoncus vel lectus. Duis pharetra consectetur sapien. Phasellus posuere ultricies massa, non rhoncus risus aliquam tempus.
-
-Praesent venenatis magna id sem dictum eu vehicula ipsum vulputate. Sed a convallis sapien. Sed justo dolor, rhoncus vel rutrum mattis, sollicitudin ut risus. Nullam sit amet convallis est. Etiam non tincidunt ligula. Fusce suscipit pretium elit at ullamcorper. Quisque sollicitudin, diam id interdum porta, metus ipsum volutpat libero, id venenatis felis orci non velit. Suspendisse potenti. Mauris rutrum, tortor sit amet pellentesque tincidunt, erat quam ultricies odio, id aliquam elit leo nec leo. Pellentesque justo eros, rutrum at feugiat nec, porta et tellus. Aenean eget metus lectus.
-
-Praesent euismod, turpis quis laoreet consequat, neque ante imperdiet quam, ac semper tortor nibh in nulla. Integer scelerisque eros vehicula urna lacinia ac facilisis mauris accumsan. Phasellus at mauris nibh. Curabitur enim ante, rutrum sed adipiscing hendrerit, pellentesque non augue. In hac habitasse platea dictumst. Nam tempus euismod massa a dictum. Donec sit amet justo ac diam ultricies ultricies. Sed tincidunt erat quis quam tempus vel interdum erat rhoncus. In hac habitasse platea dictumst. Vestibulum vehicula varius sem eget interdum. Cras bibendum leo nec felis venenatis sed pharetra sem feugiat. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Sed quam orci, mollis eget sagittis accumsan, vulputate sit amet dui. Praesent eu elementum arcu.
-
-Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum nisl metus, hendrerit ut laoreet sed, consectetur at purus. Duis interdum congue lobortis. Nullam sed massa porta felis eleifend consequat sit amet nec metus. Aliquam placerat dictum erat at eleifend. Vestibulum libero ante, ullamcorper a porttitor suscipit, accumsan vel nisi. Donec et magna neque. Nam elementum ultrices justo, eget sollicitudin sapien imperdiet eget. Nullam auctor dictum nunc, at feugiat odio vestibulum a. Sed erat nulla, viverra hendrerit commodo id, ullamcorper ac orci. Phasellus pellentesque feugiat suscipit. Etiam egestas fermentum enim. Etiam gravida interdum tellus ac laoreet. Morbi mattis aliquet eros, non tempor erat ullamcorper in. Etiam pulvinar interdum turpis ac vehicula. Sed quam justo, accumsan id consectetur a, aliquet sed leo. Aenean vitae blandit mauris.
-
-In sed eros augue, non rutrum odio. Etiam vitae dui neque, in tristique massa. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Maecenas dictum elit at lectus tempor non pharetra nisl hendrerit. Sed sed quam eu lectus ultrices malesuada tincidunt a est. Nam vel eros risus. Maecenas eros elit, blandit fermentum tempor eget, lobortis id diam. Vestibulum lacinia lacus vitae magna volutpat eu dignissim eros convallis. Vivamus ac velit tellus, a congue neque. Integer mi nulla, varius non luctus in, dictum sit amet sem. Ut laoreet, sapien sit amet scelerisque porta, purus sapien vestibulum nibh, sed luctus libero massa ac elit. Donec iaculis odio eget odio sagittis nec venenatis lorem blandit.
-
-Aliquam imperdiet tellus posuere justo vehicula sed vestibulum ante tristique. Fusce feugiat faucibus purus nec molestie. Nulla tempor neque id magna iaculis quis sollicitudin eros semper. Praesent viverra sagittis luctus. Morbi sit amet magna sed odio gravida varius. Ut nisi libero, vulputate feugiat pretium tempus, egestas sit amet justo. Pellentesque consequat tempor nisi in lobortis. Sed fermentum convallis dui ac sollicitudin. Integer auctor augue eget tellus tempus fringilla. Proin nec dolor sapien, nec tristique nibh. Aliquam a velit at mi mattis aliquet.
-
-Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Aliquam ultrices erat non turpis auctor id ornare mauris sagittis. Quisque porttitor, tellus ut convallis sagittis, mi libero feugiat tellus, rhoncus placerat ipsum tortor id risus. Donec tincidunt feugiat leo. Cras id mi neque, eu malesuada eros. Ut molestie magna quis libero placerat malesuada. Aliquam erat volutpat. Aliquam non mauris lorem, in adipiscing metus. Donec eget ipsum in elit commodo ornare bibendum a nibh. Vivamus odio erat, placerat ac vestibulum eget, malesuada ut nisi. Etiam suscipit sollicitudin leo semper sollicitudin. Sed rhoncus risus sit amet sem eleifend dictum pretium sapien egestas. Nulla at urna nunc, vel aliquet leo. Praesent ultricies, mi eu pretium lobortis, erat nibh euismod leo, sit amet gravida sapien eros et turpis. Donec lacinia venenatis lectus, non lacinia mi hendrerit sit amet. Integer sed felis vel orci aliquam pulvinar. Phasellus et risus id erat euis
 mod tincidunt. Sed luctus tempor nisi, nec tempor ipsum elementum eget. Integer nisl tortor, viverra in dapibus at, mattis ac erat. Curabitur nec dui lectus.
-
-Phasellus suscipit, tortor eu varius fringilla, sapien magna egestas risus, ut suscipit dui mauris quis velit. Cras a sapien quis sapien hendrerit tristique a sit amet elit. Pellentesque dui arcu, malesuada et sodales sit amet, dapibus vel quam. Sed non adipiscing ligula. Ut vulputate purus at nisl posuere sodales. Maecenas diam velit, tincidunt id mattis eu, aliquam ac nisi. Maecenas pretium, augue a sagittis suscipit, leo ligula eleifend dolor, mollis feugiat odio augue non eros. Pellentesque scelerisque orci pretium quam mollis at lobortis dui facilisis. Morbi congue metus id tortor porta fringilla. Sed lorem mi, molestie fermentum sagittis at, gravida a nisi. Donec eu vestibulum velit. In viverra, enim eu elementum sodales, enim odio dapibus urna, eget commodo nisl mauris ut odio. Curabitur nec enim nulla. In nec elit ipsum. Nunc in massa suscipit magna elementum faucibus in nec ipsum. Nullam suscipit malesuada elementum. Etiam sed mi in nibh ultricies venenatis nec pharetra mag
 na. In purus ante, rhoncus vel placerat sed, fermentum sit amet dui. Sed at sodales velit.
-
-Duis suscipit pellentesque pellentesque. Praesent porta lobortis cursus. Quisque sagittis velit non tellus bibendum at sollicitudin lacus aliquet. Sed nibh risus, blandit a aliquet eget, vehicula et est. Suspendisse facilisis bibendum aliquam. Fusce consectetur convallis erat, eget mollis diam fermentum sollicitudin. Quisque tincidunt porttitor pretium. Nullam id nisl et urna vulputate dapibus. Donec quis lorem urna. Quisque id justo nec nunc blandit convallis. Nunc volutpat, massa sollicitudin adipiscing vestibulum, massa urna congue lectus, sit amet ultricies augue orci convallis turpis. Nulla at lorem elit. Nunc tristique, quam facilisis commodo porttitor, lacus ligula accumsan nisi, et laoreet justo ante vitae eros. Curabitur sed augue arcu. Phasellus porttitor vestibulum felis, ut consectetur arcu tempor non. In justo risus, semper et suscipit id, ullamcorper at urna. Quisque tincidunt, urna nec aliquam tristique, nibh odio faucibus augue, in ornare enim turpis accumsan dolor. 
 Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Suspendisse sodales varius turpis eu fermentum.
-
-Morbi ultricies diam eget massa posuere lobortis. Aliquam volutpat pellentesque enim eu porttitor. Donec lacus felis, consectetur a pretium vitae, bibendum non enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Etiam ut nibh a quam pellentesque auctor ut id velit. Duis lacinia justo eget mi placerat bibendum. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec velit tortor, tempus nec tristique id, aliquet sit amet turpis. Praesent et neque nec magna porta fringilla. Morbi id egestas eros. Donec semper tincidunt ullamcorper. Phasellus tempus lacinia hendrerit. Quisque faucibus pretium neque non convallis. Nunc malesuada accumsan rhoncus. Cras lobortis, sem sed fringilla convallis, augue velit semper nisl, commodo varius nisi diam ac leo.
-
-Quisque interdum tellus ac ante posuere ut cursus lorem egestas. Nulla facilisi. Aenean sed massa nec nisi scelerisque vulputate. Etiam convallis consectetur iaculis. Maecenas ac purus ut ante dignissim auctor ac quis lorem. Pellentesque suscipit tincidunt orci. Fusce aliquam dapibus orci, at bibendum ipsum adipiscing eget. Morbi pellentesque hendrerit quam, nec placerat urna vulputate sed. Quisque vel diam lorem. Praesent id diam quis enim elementum rhoncus sagittis eget purus. Quisque fringilla bibendum leo in laoreet. Vestibulum id nibh risus, non elementum metus. Ut a felis diam, non mollis nisl. Cras elit ante, ullamcorper quis iaculis eu, sodales vel est. Curabitur quis lobortis dolor. Aliquam mattis gravida metus pellentesque vulputate.
-
-Ut id augue id dolor luctus euismod et quis velit. Maecenas enim dolor, tempus sit amet hendrerit eu, faucibus vitae neque. Proin sit amet varius elit. Proin varius felis ullamcorper purus dignissim consequat. Cras cursus tempus eros. Nunc ultrices venenatis ullamcorper. Aliquam et feugiat tellus. Phasellus sit amet vestibulum elit. Phasellus ac purus lacus, et accumsan eros. Morbi ultrices, purus a porta sodales, odio metus posuere neque, nec elementum risus turpis sit amet magna. Sed est quam, ultricies at congue adipiscing, lobortis in justo. Proin iaculis dictum nunc, eu laoreet quam varius vitae. Donec sit amet feugiat turpis. Mauris sit amet magna quam, ac consectetur dui. Curabitur eget magna tellus, eu pharetra felis. Donec sit amet tortor nisl. Aliquam et tortor facilisis lacus tincidunt commodo. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Curabitur nunc magna, ultricies id convallis at, ullamcorper vitae massa.
-
-Phasellus viverra iaculis placerat. Nulla consequat dolor sit amet erat dignissim posuere. Nulla lacinia augue vitae mi tempor gravida. Phasellus non tempor tellus. Quisque non enim semper tortor sagittis facilisis. Aliquam urna felis, egestas at posuere nec, aliquet eu nibh. Praesent sed vestibulum enim. Mauris iaculis velit dui, et fringilla enim. Nulla nec nisi orci. Sed volutpat, justo eget fringilla adipiscing, nisl nulla condimentum libero, sed sodales est est et odio. Cras ipsum dui, varius eu elementum consequat, faucibus in leo. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.
-
-Ut malesuada molestie eleifend. Curabitur id enim dui, eu tincidunt nibh. Mauris sit amet ante leo. Duis turpis ipsum, bibendum sed mattis sit amet, accumsan quis dolor. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Aenean a imperdiet metus. Quisque sollicitudin felis id neque tempor scelerisque. Donec at orci felis. Vivamus tempus convallis auctor. Donec interdum euismod lobortis. Sed at lacus nec odio dignissim mollis. Sed sapien orci, porttitor tempus accumsan vel, tincidunt nec ante. Nunc rhoncus egestas dapibus. Suspendisse fermentum dictum fringilla. Nullam nisi justo, eleifend a consectetur convallis, porttitor et tortor. Proin vitae lorem non dolor suscipit lacinia eu eget nulla.
-
-Suspendisse egestas, sapien sit amet blandit scelerisque, nulla arcu tristique dui, a porta justo quam vitae arcu. In metus libero, bibendum non volutpat ut, laoreet vel turpis. Nunc faucibus velit eu ipsum commodo nec iaculis eros volutpat. Vivamus congue auctor elit sed suscipit. Duis commodo, libero eu vestibulum feugiat, leo mi dapibus tellus, in placerat nisl dui at est. Vestibulum viverra tristique lorem, ornare egestas erat rutrum a. Nullam at augue massa, ut consectetur ipsum. Pellentesque malesuada, velit ut lobortis sagittis, nisi massa semper odio, malesuada semper purus nisl vel lectus. Nunc dui sem, mattis vitae laoreet vitae, sollicitudin ac leo. Nulla vel fermentum est.
-
-Vivamus in odio a nisi dignissim rhoncus in in lacus. Donec et nisl tortor. Donec sagittis consequat mi, vel placerat tellus convallis id. Aliquam facilisis rutrum nisl sed pretium. Donec et lacinia nisl. Aliquam erat volutpat. Curabitur ac pulvinar tellus. Nullam varius lobortis porta. Cras dapibus, ligula ut porta ultricies, leo lacus viverra purus, quis mollis urna risus eu leo. Nunc malesuada consectetur purus, vel auctor lectus scelerisque posuere. Maecenas dui massa, vestibulum bibendum blandit non, interdum eget mauris. Phasellus est ante, pulvinar at imperdiet quis, imperdiet vel urna. Quisque eget volutpat orci. Quisque et arcu purus, ut faucibus velit.
-
-Praesent sed ipsum urna. Praesent sagittis varius magna, id commodo dolor malesuada ac. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Quisque sit amet nunc eu sem ornare tempor. Mauris id dolor nec erat convallis porta in lobortis nisi. Curabitur hendrerit rhoncus tortor eu hendrerit. Pellentesque eu ante vel elit luctus eleifend quis viverra nulla. Suspendisse odio diam, euismod eu porttitor molestie, sollicitudin sit amet nulla. Sed ante urna, dictum bibendum rhoncus et, blandit nec ante. Suspendisse tortor augue, accumsan quis suscipit id, accumsan sit amet erat. Donec pharetra varius lobortis. Maecenas ipsum diam, faucibus eu tempus id, convallis nec enim. Duis arcu turpis, fringilla nec egestas ut, dignissim tristique nulla. Curabitur suscipit dui non justo ultrices pharetra. Aliquam erat volutpat. Nulla facilisi. Quisque id felis eu sem aliquam fringilla.
-
-Etiam quis augue in tellus consequat eleifend. Aenean dignissim congue felis id elementum. Duis fringilla varius ipsum, nec suscipit leo semper vel. Ut sollicitudin, orci a tincidunt accumsan, diam lectus laoreet lacus, vel fermentum quam est vel eros. Aliquam fringilla sapien ac sapien faucibus convallis. Aliquam id nunc eu justo consequat tincidunt. Quisque nec nisl dui. Phasellus augue lectus, varius vitae auctor vel, rutrum at risus. Vivamus lacinia leo quis neque ultrices nec elementum felis fringilla. Proin vel porttitor lectus.
-
-Curabitur sapien lorem, mollis ut accumsan non, ultricies et metus. Curabitur vel lorem quis sapien fringilla laoreet. Morbi id urna ac orci elementum blandit eget volutpat neque. Pellentesque sem odio, iaculis eu pharetra vitae, cursus in quam. Nulla molestie ligula id massa luctus et pulvinar nisi pulvinar. Nunc fermentum augue a lacus fringilla rhoncus porttitor erat dictum. Nunc sit amet tellus et dui viverra auctor euismod at nisl. In sed congue magna. Proin et tortor ut augue placerat dignissim a eu justo. Morbi porttitor porta lobortis. Pellentesque nibh lacus, adipiscing ut tristique quis, consequat vitae velit. Maecenas ut luctus libero. Vivamus auctor odio et erat semper sagittis. Vivamus interdum velit in risus mattis quis dictum ante rhoncus. In sagittis porttitor eros, at lobortis metus ultrices vel. Curabitur non aliquam nisl. Vestibulum luctus feugiat suscipit. Etiam non lacus vel nulla egestas iaculis id quis risus.
-
-Etiam in auctor urna. Fusce ultricies molestie convallis. In hac habitasse platea dictumst. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Mauris iaculis lorem faucibus purus gravida at convallis turpis sollicitudin. Suspendisse at velit lorem, a fermentum ipsum. Etiam condimentum, dui vel condimentum elementum, sapien sem blandit sapien, et pharetra leo neque et lectus. Nunc viverra urna iaculis augue ultrices ac porttitor lacus dignissim. Aliquam ut turpis dui. Sed eget aliquet felis. In bibendum nibh sit amet sapien accumsan accumsan pharetra magna molestie.
-
-Mauris aliquet urna eget lectus adipiscing at congue turpis consequat. Vivamus tincidunt fermentum risus et feugiat. Nulla molestie ullamcorper nibh sed facilisis. Phasellus et cursus purus. Nam cursus, dui dictum ultrices viverra, erat risus varius elit, eu molestie dui eros quis quam. Aliquam et ante neque, ac consectetur dui. Donec condimentum erat id elit dictum sed accumsan leo sagittis. Proin consequat congue risus, vel tincidunt leo imperdiet eu. Vestibulum malesuada turpis eu metus imperdiet pretium. Aliquam condimentum ultrices nibh, eu semper enim eleifend a. Etiam condimentum nisl quam.
-
-Pellentesque id molestie nisl. Maecenas et lectus at justo molestie viverra sit amet sit amet ligula. Nullam non porttitor magna. Quisque elementum arcu cursus tortor rutrum lobortis. Morbi sit amet lectus vitae enim euismod dignissim eget at neque. Vivamus consequat vehicula dui, vitae auctor augue dignissim in. In tempus sem quis justo tincidunt sit amet auctor turpis lobortis. Pellentesque non est nunc. Vestibulum mollis fringilla interdum. Maecenas ipsum dolor, pharetra id tristique mattis, luctus vitae urna. Ut ullamcorper arcu eget elit convallis mollis. Pellentesque condimentum, massa ac hendrerit tempor, mauris purus blandit justo, et pharetra leo justo a est. Duis arcu augue, facilisis vel dignissim sed, aliquam quis magna. Quisque non consequat dolor. Suspendisse a ultrices leo.
-
-Donec vitae pretium nibh. Maecenas bibendum bibendum diam in placerat. Ut accumsan, mi vitae vestibulum euismod, nunc justo vulputate nisi, non placerat mi urna et diam. Maecenas malesuada lorem ut arcu mattis mollis. Nulla facilisi. Donec est leo, bibendum eu pulvinar in, cursus vel metus. Aliquam erat volutpat. Nullam feugiat porttitor neque in vulputate. Quisque nec mi eu magna consequat cursus non at arcu. Etiam risus metus, sollicitudin et ultrices at, tincidunt sed nunc. Sed eget scelerisque augue. Ut fringilla venenatis sem non eleifend. Nunc mattis, risus sit amet vulputate varius, risus justo egestas mauris, id interdum odio ipsum et nisl. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi id erat odio, nec pulvinar enim.
-
-Curabitur ac fermentum quam. Morbi eu eros sapien, vitae tempus dolor. Mauris vestibulum blandit enim ut venenatis. Aliquam egestas, eros at consectetur tincidunt, lorem augue iaculis est, nec mollis felis arcu in nunc. Sed in odio sed libero pellentesque volutpat vitae a ante. Morbi commodo volutpat tellus, ut viverra purus placerat fermentum. Integer iaculis facilisis arcu, at gravida lorem bibendum at. Aenean id eros eget est sagittis convallis sed et dui. Donec eu pulvinar tellus. Nunc dignissim rhoncus tellus, at pellentesque metus luctus at. Sed ornare aliquam diam, a porttitor leo sollicitudin sed. Nam vitae lectus lacus. Integer adipiscing quam neque, blandit posuere libero. Sed libero nunc, egestas sodales tempus sed, cursus blandit tellus. Vestibulum mi purus, ultricies quis placerat vel, molestie at dui.
-
-Nulla commodo odio justo. Pellentesque non ornare diam. In consectetur sapien ac nunc sagittis malesuada. Morbi ullamcorper tempor erat nec rutrum. Duis ut commodo justo. Cras est orci, consectetur sed interdum sed, scelerisque sit amet nulla. Vestibulum justo nulla, pellentesque a tempus et, dapibus et arcu. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi tristique, eros nec congue adipiscing, ligula sem rhoncus felis, at ornare tellus mauris ac risus. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Proin mauris dui, tempor fermentum dictum et, cursus a leo. Maecenas nec nisl a tellus pellentesque rhoncus. Nullam ultrices euismod dui eu congue.
-
-In nec tempor risus. In faucibus nisi eget diam dignissim consequat. Donec pulvinar ante nec enim mattis rutrum. Vestibulum leo augue, molestie nec dapibus in, dictum at enim. Integer aliquam, lorem eu vulputate lacinia, mi orci tempor enim, eget mattis ligula magna a magna. Praesent sed erat ut tortor interdum viverra. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla facilisi. Maecenas sit amet lectus lacus. Nunc vitae purus id ligula laoreet condimentum. Duis auctor tortor vel dui pulvinar a facilisis arcu dignissim. In hac habitasse platea dictumst. Donec sollicitudin pellentesque egestas. Sed sed sem justo. Maecenas laoreet hendrerit mauris, ut porttitor lorem iaculis ac. Quisque molestie sem quis lorem tempor rutrum. Phasellus nibh mauris, rhoncus in consectetur non, aliquet eu massa.
-
-Curabitur velit arcu, pretium porta placerat quis, varius ut metus. Vestibulum vulputate tincidunt justo, vitae porttitor lectus imperdiet sit amet. Vivamus enim dolor, sollicitudin ut semper non, ornare ornare dui. Aliquam tempor fermentum sapien eget condimentum. Curabitur laoreet bibendum ante, in euismod lacus lacinia eu. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Suspendisse potenti. Sed at libero eu tortor tempus scelerisque. Nulla facilisi. Nullam vitae neque id justo viverra rhoncus pretium at libero. Etiam est urna, aliquam vel pulvinar non, ornare vel purus.
-
-Nulla varius, nisi eget condimentum semper, metus est dictum odio, vel mattis risus est sed velit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nunc non est nec tellus ultricies mattis ut eget velit. Integer condimentum ante id lorem blandit lacinia. Donec vel tortor augue, in condimentum nisi. Pellentesque pellentesque nulla ut nulla porttitor quis sodales enim rutrum. Sed augue risus, euismod a aliquet at, vulputate non libero. Nullam nibh odio, dignissim fermentum pulvinar ac, congue eu mi. Duis tincidunt, nibh id venenatis placerat, diam turpis gravida leo, sit amet mollis massa dolor quis mauris. Vivamus scelerisque sodales arcu et dapibus. Suspendisse potenti. Cras quis tellus arcu, quis laoreet sem. Fusce porttitor, sapien vel tristique sodales, velit leo porta arcu, quis pellentesque nunc metus non odio. Nam arcu libero, ullamcorper ut pharetra non, dignissim et velit. Quisque dolor lorem, vehicula sit amet scelerisque in, varius at n
 ulla. Pellentesque vitae sem eget tortor iaculis pulvinar. Sed nunc justo, euismod gravida pulvinar eget, gravida eget turpis. Cras vel dictum nisi. Nullam nulla libero, gravida sit amet aliquam quis, commodo vitae odio. Cras vitae nibh nec dui placerat semper.
-
-Vivamus at fringilla eros. Vivamus at nisl id massa commodo feugiat quis non massa. Morbi tellus urna, auctor sit amet elementum sed, rutrum non lectus. Nulla feugiat dui in sapien ornare et imperdiet est ornare. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum semper rutrum tempor. Sed in felis nibh, sed aliquam enim. Curabitur ut quam scelerisque velit placerat dictum. Donec eleifend vehicula purus, eu vestibulum sapien rutrum eu. Vivamus in odio vel est vulputate iaculis. Nunc rutrum feugiat pretium.
-
-Maecenas ipsum neque, auctor quis lacinia vitae, euismod ac orci. Donec molestie massa consequat est porta ac porta purus tincidunt. Nam bibendum leo nec lacus mollis non condimentum dolor rhoncus. Nulla ac volutpat lorem. Nullam erat purus, convallis eget commodo id, varius quis augue. Nullam aliquam egestas mi, vel suscipit nisl mattis consequat. Quisque vel egestas sapien. Nunc lorem velit, convallis nec laoreet et, aliquet eget massa. Nam et nibh ac dui vehicula aliquam quis eu augue. Cras vel magna ut elit rhoncus interdum iaculis volutpat nisl. Suspendisse arcu lorem, varius rhoncus tempor id, pulvinar sed tortor. Pellentesque ultricies laoreet odio ac dignissim. Aliquam diam arcu, placerat quis egestas eget, facilisis eu nunc. Mauris vulputate, nisl sit amet mollis interdum, risus tortor ornare orci, sed egestas orci eros non diam. Vestibulum hendrerit, metus quis placerat pellentesque, enim purus faucibus dui, sit amet ultricies lectus ipsum id lorem. Class aptent taciti soc
 iosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Praesent eget diam odio, eu bibendum elit. In vestibulum orci eu erat tincidunt tristique.
-
-Cras consectetur ante eu turpis placerat sollicitudin. Mauris et lacus tortor, eget pharetra velit. Donec accumsan ultrices tempor. Donec at nibh a elit condimentum dapibus. Integer sit amet vulputate ante. Suspendisse potenti. In sodales laoreet massa vitae lacinia. Morbi vel lacus feugiat arcu vulputate molestie. Aliquam massa magna, ullamcorper accumsan gravida quis, rhoncus pulvinar nulla. Praesent sit amet ipsum diam, sit amet lacinia neque. In et sapien augue. Etiam enim elit, ultrices vel rutrum id, scelerisque non enim.
-
-Proin et egestas neque. Praesent et ipsum dolor. Nunc non varius nisl. Fusce in tortor nisi. Maecenas convallis neque in ligula blandit quis vehicula leo mollis. Pellentesque sagittis blandit leo, dapibus pellentesque leo ultrices ac. Curabitur ac egestas libero. Donec pretium pharetra pretium. Fusce imperdiet, turpis eu aliquam porta, ante elit eleifend risus, luctus auctor arcu ante ut nunc. Vivamus in leo felis, vitae eleifend lacus. Donec tempus aliquam purus porttitor tristique. Suspendisse diam neque, suscipit feugiat fringilla non, eleifend sit nullam.


[10/37] move JS tests into safety

Posted by ja...@apache.org.
http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/test/view_errors.js
----------------------------------------------------------------------
diff --git a/share/test/view_errors.js b/share/test/view_errors.js
new file mode 100644
index 0000000..e8bd08e
--- /dev/null
+++ b/share/test/view_errors.js
@@ -0,0 +1,189 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+
+couchTests.view_errors = function(debug) {
+  var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"true"});
+  db.deleteDb();
+  db.createDb();
+  if (debug) debugger;
+
+  run_on_modified_server(
+    [{section: "couchdb",
+      key: "os_process_timeout",
+      value: "500"}],
+    function() {
+      var doc = {integer: 1, string: "1", array: [1, 2, 3]};
+      T(db.save(doc).ok);
+
+      // emitting a key value that is undefined should result in that row
+      // being included in the view results as null
+      var results = db.query(function(doc) {
+        emit(doc.undef, null);
+      });
+      T(results.total_rows == 1);
+      T(results.rows[0].key == null);
+
+      // if a view function throws an exception, its results are not included in
+      // the view index, but the view does not itself raise an error
+      var results = db.query(function(doc) {
+        doc.undef(); // throws an error
+      });
+      T(results.total_rows == 0);
+
+      // if a view function includes an undefined value in the emitted key or
+      // value, it is treated as null
+      var results = db.query(function(doc) {
+        emit([doc._id, doc.undef], null);
+      });
+      T(results.total_rows == 1);
+      T(results.rows[0].key[1] == null);
+      
+      // querying a view with invalid params should give a resonable error message
+      var xhr = CouchDB.request("POST", "/test_suite_db/_temp_view?startkey=foo", {
+        headers: {"Content-Type": "application/json"},
+        body: JSON.stringify({language: "javascript",
+          map : "function(doc){emit(doc.integer)}"
+        })
+      });
+      T(JSON.parse(xhr.responseText).error == "bad_request");
+
+      // content type must be json
+      var xhr = CouchDB.request("POST", "/test_suite_db/_temp_view", {
+        headers: {"Content-Type": "application/x-www-form-urlencoded"},
+        body: JSON.stringify({language: "javascript",
+          map : "function(doc){}"
+        })
+      });
+      T(xhr.status == 415);
+
+      var map = function (doc) {emit(doc.integer, doc.integer);};
+
+      try {
+          db.query(map, null, {group: true});
+          T(0 == 1);
+      } catch(e) {
+          T(e.error == "query_parse_error");
+      }
+
+      var designDoc = {
+        _id:"_design/test",
+        language: "javascript",
+        views: {
+          "no_reduce": {map:"function(doc) {emit(doc._id, null);}"},
+          "with_reduce": {
+            map:"function (doc) {emit(doc.integer, doc.integer)};",
+            reduce:"function (keys, values) { return sum(values); };"}
+        }
+      };
+      T(db.save(designDoc).ok);
+
+      var designDoc2 = {
+        _id:"_design/testbig",
+        language: "javascript",
+        views: {
+          "reduce_too_big"  : {
+            map:"function (doc) {emit(doc.integer, doc.integer)};",
+            reduce:"function (keys, values) { var chars = []; for (var i=0; i < 1000; i++) {chars.push('wazzap');};return chars; };"}
+        }
+      };
+      T(db.save(designDoc2).ok);
+
+      try {
+          db.view("test/no_reduce", {group: true});
+          T(0 == 1);
+      } catch(e) {
+          T(db.last_req.status == 400);
+          T(e.error == "query_parse_error");
+      }
+
+      try {
+          db.view("test/no_reduce", {group_level: 1});
+          T(0 == 1);
+      } catch(e) {
+          T(db.last_req.status == 400);
+          T(e.error == "query_parse_error");
+      }
+
+      try {
+        db.view("test/no_reduce", {reduce: true});
+        T(0 == 1);
+      } catch(e) {
+        T(db.last_req.status == 400);
+        T(e.error == "query_parse_error");
+      }
+
+      db.view("test/no_reduce", {reduce: false});
+      TEquals(200, db.last_req.status, "reduce=false for map views (without"
+                                     + " group or group_level) is allowed");
+
+      try {
+          db.view("test/with_reduce", {group: true, reduce: false});
+          T(0 == 1);
+      } catch(e) {
+          T(db.last_req.status == 400);
+          T(e.error == "query_parse_error");
+      }
+
+      try {
+          db.view("test/with_reduce", {group_level: 1, reduce: false});
+          T(0 == 1);
+      } catch(e) {
+        T(db.last_req.status == 400);
+          T(e.error == "query_parse_error");
+      }
+
+      var designDoc3 = {
+        _id:"_design/infinite",
+        language: "javascript",
+        views: {
+          "infinite_loop" :{map:"function(doc) {while(true){emit(doc,doc);}};"}
+        }
+      };
+      T(db.save(designDoc3).ok);
+
+      try {
+          db.view("infinite/infinite_loop");
+          T(0 == 1);
+      } catch(e) {
+          T(e.error == "os_process_error");
+      }
+
+      // Check error responses for invalid multi-get bodies.
+      var path = "/test_suite_db/_design/test/_view/no_reduce";
+      var xhr = CouchDB.request("POST", path, {body: "[]"});
+      T(xhr.status == 400);
+      result = JSON.parse(xhr.responseText);
+      T(result.error == "bad_request");
+      T(result.reason == "Request body must be a JSON object");
+      var data = "{\"keys\": 1}";
+      xhr = CouchDB.request("POST", path, {body:data});
+      T(xhr.status == 400);
+      result = JSON.parse(xhr.responseText);
+      T(result.error == "bad_request");
+      T(result.reason == "`keys` member must be a array.");
+
+      // if the reduce grows to fast, throw an overflow error
+      var path = "/test_suite_db/_design/testbig/_view/reduce_too_big";
+      xhr = CouchDB.request("GET", path);
+      T(xhr.status == 500);
+      result = JSON.parse(xhr.responseText);
+      T(result.error == "reduce_overflow_error");
+
+      try {
+          db.query(function() {emit(null, null)}, null, {startkey: 2, endkey:1});
+          T(0 == 1);
+      } catch(e) {
+          T(e.error == "query_parse_error");
+          T(e.reason.match(/no rows can match/i));
+      }
+    });
+};

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/test/view_include_docs.js
----------------------------------------------------------------------
diff --git a/share/test/view_include_docs.js b/share/test/view_include_docs.js
new file mode 100644
index 0000000..dab79b8
--- /dev/null
+++ b/share/test/view_include_docs.js
@@ -0,0 +1,192 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+
+couchTests.view_include_docs = function(debug) {
+  var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"});
+  db.deleteDb();
+  db.createDb();
+  if (debug) debugger;
+
+  var docs = makeDocs(0, 100);
+  db.bulkSave(docs);
+
+  var designDoc = {
+    _id:"_design/test",
+    language: "javascript",
+    views: {
+      all_docs: {
+        map: "function(doc) { emit(doc.integer, doc.string) }"
+      },
+      with_prev: {
+        map: "function(doc){if(doc.prev) emit(doc._id,{'_rev':doc.prev}); else emit(doc._id,{'_rev':doc._rev});}"
+      },
+      with_id: {
+        map: "function(doc) {if(doc.link_id) { var value = {'_id':doc.link_id}; if (doc.link_rev) {value._rev = doc.link_rev}; emit(doc._id, value);}};"
+      },
+      summate: {
+        map:"function (doc) { if (typeof doc.integer === 'number') {emit(doc.integer, doc.integer)};}",
+        reduce:"function (keys, values) { return sum(values); };"
+      }
+    }
+  }
+  T(db.save(designDoc).ok);
+
+  var resp = db.view('test/all_docs', {include_docs: true, limit: 2});
+  T(resp.rows.length == 2);
+  T(resp.rows[0].id == "0");
+  T(resp.rows[0].doc._id == "0");
+  T(resp.rows[1].id == "1");
+  T(resp.rows[1].doc._id == "1");
+
+  resp = db.view('test/all_docs', {include_docs: true}, [29, 74]);
+  T(resp.rows.length == 2);
+  T(resp.rows[0].doc._id == "29");
+  T(resp.rows[1].doc.integer == 74);
+
+  resp = db.allDocs({limit: 2, skip: 1, include_docs: true});
+  T(resp.rows.length == 2);
+  T(resp.rows[0].doc.integer == 1);
+  T(resp.rows[1].doc.integer == 10);
+
+  resp = db.allDocs({include_docs: true}, ['not_a_doc']);
+  T(resp.rows.length == 1);
+  T(!resp.rows[0].doc);
+
+  resp = db.allDocs({include_docs: true}, ["1", "foo"]);
+  T(resp.rows.length == 2);
+  T(resp.rows[0].doc.integer == 1);
+  T(!resp.rows[1].doc);
+
+  resp = db.allDocs({include_docs: true, limit: 0});
+  T(resp.rows.length == 0);
+
+  // No reduce support
+  try {
+      resp = db.view('test/summate', {include_docs: true});
+      alert(JSON.stringify(resp));
+      T(0==1);
+  } catch (e) {
+      T(e.error == 'query_parse_error');
+  }
+
+  // Reduce support when reduce=false
+  resp = db.view('test/summate', {reduce: false, include_docs: true});
+  T(resp.rows.length == 100);
+
+  // Not an error with include_docs=false&reduce=true
+  resp = db.view('test/summate', {reduce: true, include_docs: false});
+  T(resp.rows.length == 1);
+  T(resp.rows[0].value == 4950);
+
+  T(db.save({
+    "_id": "link-to-10",
+    "link_id" : "10"
+  }).ok);
+  
+  // you can link to another doc from a value.
+  resp = db.view("test/with_id", {key:"link-to-10"});
+  T(resp.rows[0].key == "link-to-10");
+  T(resp.rows[0].value["_id"] == "10");
+  
+  resp = db.view("test/with_id", {key:"link-to-10",include_docs: true});
+  T(resp.rows[0].key == "link-to-10");
+  T(resp.rows[0].value["_id"] == "10");
+  T(resp.rows[0].doc._id == "10");
+
+  // Check emitted _rev controls things
+  resp = db.allDocs({include_docs: true}, ["0"]);
+  var before = resp.rows[0].doc;
+
+  var after = db.open("0");
+  after.integer = 100;
+  after.prev = after._rev;
+  resp = db.save(after)
+  T(resp.ok);
+  
+  var after = db.open("0");
+  TEquals(resp.rev, after._rev, "fails with firebug running");
+  T(after._rev != after.prev, "passes");
+  TEquals(100, after.integer, "fails with firebug running");
+
+  // should emit the previous revision
+  resp = db.view("test/with_prev", {include_docs: true}, ["0"]);
+  T(resp.rows[0].doc._id == "0");
+  T(resp.rows[0].doc._rev == before._rev);
+  T(!resp.rows[0].doc.prev);
+  T(resp.rows[0].doc.integer == 0);
+
+  var xhr = CouchDB.request("POST", "/test_suite_db/_compact");
+  T(xhr.status == 202)
+  while (db.info().compact_running) {}
+
+  resp = db.view("test/with_prev", {include_docs: true}, ["0", "23"]);
+  T(resp.rows.length == 2);
+  T(resp.rows[0].key == "0");
+  T(resp.rows[0].id == "0");
+  T(!resp.rows[0].doc);
+  T(resp.rows[0].doc == null);
+  T(resp.rows[1].doc.integer == 23);
+
+  // COUCHDB-549 - include_docs=true with conflicts=true
+
+  var dbA = new CouchDB("test_suite_db_a", {"X-Couch-Full-Commit":"false"});
+  var dbB = new CouchDB("test_suite_db_b", {"X-Couch-Full-Commit":"false"});
+
+  dbA.deleteDb();
+  dbA.createDb();
+  dbB.deleteDb();
+  dbB.createDb();
+
+  var ddoc = {
+    _id: "_design/mydesign",
+    language : "javascript",
+    views : {
+      myview : {
+        map: (function(doc) {
+          emit(doc.value, 1);
+        }).toString()
+      }
+    }
+  };
+  TEquals(true, dbA.save(ddoc).ok);
+
+  var doc1a = {_id: "foo", value: 1, str: "1"};
+  TEquals(true, dbA.save(doc1a).ok);
+
+  var doc1b = {_id: "foo", value: 1, str: "666"};
+  TEquals(true, dbB.save(doc1b).ok);
+
+  var doc2 = {_id: "bar", value: 2, str: "2"};
+  TEquals(true, dbA.save(doc2).ok);
+
+  TEquals(true, CouchDB.replicate(dbA.name, dbB.name).ok);
+
+  doc1b = dbB.open("foo", {conflicts: true});
+  TEquals(true, doc1b._conflicts instanceof Array);
+  TEquals(1, doc1b._conflicts.length);
+  var conflictRev = doc1b._conflicts[0];
+
+  doc2 = dbB.open("bar", {conflicts: true});
+  TEquals("undefined", typeof doc2._conflicts);
+
+  resp = dbB.view("mydesign/myview", {include_docs: true, conflicts: true});
+
+  TEquals(2, resp.rows.length);
+  TEquals(true, resp.rows[0].doc._conflicts instanceof Array);
+  TEquals(1, resp.rows[0].doc._conflicts.length);
+  TEquals(conflictRev, resp.rows[0].doc._conflicts[0]);
+  TEquals("undefined", typeof resp.rows[1].doc._conflicts);
+
+  // cleanup
+  dbA.deleteDb();
+  dbB.deleteDb();
+};

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/test/view_multi_key_all_docs.js
----------------------------------------------------------------------
diff --git a/share/test/view_multi_key_all_docs.js b/share/test/view_multi_key_all_docs.js
new file mode 100644
index 0000000..7c7f6f8
--- /dev/null
+++ b/share/test/view_multi_key_all_docs.js
@@ -0,0 +1,95 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+
+couchTests.view_multi_key_all_docs = function(debug) {
+  var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"});
+  db.deleteDb();
+  db.createDb();
+  if (debug) debugger;
+
+  var docs = makeDocs(0, 100);
+  db.bulkSave(docs);
+
+  var keys = ["10","15","30","37","50"];
+  var rows = db.allDocs({},keys).rows;
+  T(rows.length == keys.length);
+  for(var i=0; i<rows.length; i++)
+    T(rows[i].id == keys[i]);
+
+  // keys in GET parameters
+  rows = db.allDocs({keys:keys}, null).rows;
+  T(rows.length == keys.length);
+  for(var i=0; i<rows.length; i++)
+    T(rows[i].id == keys[i]);
+
+  rows = db.allDocs({limit: 1}, keys).rows;
+  T(rows.length == 1);
+  T(rows[0].id == keys[0]);
+
+  // keys in GET parameters
+  rows = db.allDocs({limit: 1, keys: keys}, null).rows;
+  T(rows.length == 1);
+  T(rows[0].id == keys[0]);
+
+  rows = db.allDocs({skip: 2}, keys).rows;
+  T(rows.length == 3);
+  for(var i=0; i<rows.length; i++)
+      T(rows[i].id == keys[i+2]);
+
+  // keys in GET parameters
+  rows = db.allDocs({skip: 2, keys: keys}, null).rows;
+  T(rows.length == 3);
+  for(var i=0; i<rows.length; i++)
+      T(rows[i].id == keys[i+2]);
+
+  rows = db.allDocs({descending: "true"}, keys).rows;
+  T(rows.length == keys.length);
+  for(var i=0; i<rows.length; i++)
+      T(rows[i].id == keys[keys.length-i-1]);
+
+  // keys in GET parameters
+  rows = db.allDocs({descending: "true", keys: keys}, null).rows;
+  T(rows.length == keys.length);
+  for(var i=0; i<rows.length; i++)
+      T(rows[i].id == keys[keys.length-i-1]);
+
+  rows = db.allDocs({descending: "true", skip: 3, limit:1}, keys).rows;
+  T(rows.length == 1);
+  T(rows[0].id == keys[1]);
+
+  // keys in GET parameters
+  rows = db.allDocs({descending: "true", skip: 3, limit:1, keys: keys}, null).rows;
+  T(rows.length == 1);
+  T(rows[0].id == keys[1]);
+
+  // Check we get invalid rows when the key doesn't exist
+  rows = db.allDocs({}, [1, "i_dont_exist", "0"]).rows;
+  T(rows.length == 3);
+  T(rows[0].error == "not_found");
+  T(!rows[0].id);
+  T(rows[1].error == "not_found");
+  T(!rows[1].id);
+  T(rows[2].id == rows[2].key && rows[2].key == "0");
+
+  // keys in GET parameters
+  rows = db.allDocs({keys: [1, "i_dont_exist", "0"]}, null).rows;
+  T(rows.length == 3);
+  T(rows[0].error == "not_found");
+  T(!rows[0].id);
+  T(rows[1].error == "not_found");
+  T(!rows[1].id);
+  T(rows[2].id == rows[2].key && rows[2].key == "0");
+
+  // empty keys
+  rows = db.allDocs({keys: []}, null).rows;
+  T(rows.length == 0);
+};

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/test/view_multi_key_design.js
----------------------------------------------------------------------
diff --git a/share/test/view_multi_key_design.js b/share/test/view_multi_key_design.js
new file mode 100644
index 0000000..a84d07a
--- /dev/null
+++ b/share/test/view_multi_key_design.js
@@ -0,0 +1,220 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+
+couchTests.view_multi_key_design = function(debug) {
+  var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"});
+  db.deleteDb();
+  db.createDb();
+  if (debug) debugger;
+
+  var docs = makeDocs(0, 100);
+  db.bulkSave(docs);
+
+  var designDoc = {
+    _id:"_design/test",
+    language: "javascript",
+    views: {
+      all_docs: {
+        map: "function(doc) { emit(doc.integer, doc.string) }"
+      },
+      multi_emit: {
+        map: "function(doc) {for(var i = 0 ; i < 3 ; i++) { emit(i, doc.integer) ; } }"
+      },
+      summate: {
+        map:"function (doc) {emit(doc.integer, doc.integer)};",
+        reduce:"function (keys, values) { return sum(values); };"
+      }
+    }
+  };
+  T(db.save(designDoc).ok);
+
+  // Test that missing keys work too
+  var keys = [101,30,15,37,50];
+  var reduce = db.view("test/summate",{group:true},keys).rows;
+  T(reduce.length == keys.length-1); // 101 is missing
+  for(var i=0; i<reduce.length; i++) {
+    T(keys.indexOf(reduce[i].key) != -1);
+    T(reduce[i].key == reduce[i].value);
+  }
+
+  // First, the goods:
+  var keys = [10,15,30,37,50];
+  var rows = db.view("test/all_docs",{},keys).rows;
+  for(var i=0; i<rows.length; i++) {
+    T(keys.indexOf(rows[i].key) != -1);
+    T(rows[i].key == rows[i].value);
+  }
+
+  // with GET keys
+  rows = db.view("test/all_docs",{keys:keys},null).rows;
+  for(var i=0;i<rows.length; i++) {
+    T(keys.indexOf(rows[i].key) != -1);
+    T(rows[i].key == rows[i].value);
+  }
+
+  // with empty keys
+  rows = db.view("test/all_docs",{keys:[]},null).rows;
+  T(rows.length == 0);
+
+  var reduce = db.view("test/summate",{group:true},keys).rows;
+  T(reduce.length == keys.length);
+  for(var i=0; i<reduce.length; i++) {
+    T(keys.indexOf(reduce[i].key) != -1);
+    T(reduce[i].key == reduce[i].value);
+  }
+
+  // with GET keys
+  reduce = db.view("test/summate",{group:true,keys:keys},null).rows;
+  T(reduce.length == keys.length);
+  for(var i=0; i<reduce.length; i++) {
+    T(keys.indexOf(reduce[i].key) != -1);
+    T(reduce[i].key == reduce[i].value);
+  }
+
+  // Test that invalid parameter combinations get rejected
+  var badargs = [{startkey:0}, {endkey:0}, {key: 0}, {group_level: 2}];
+  var getbadargs = [{startkey:0, keys:keys}, {endkey:0, keys:keys}, 
+      {key:0, keys:keys}, {group_level: 2, keys:keys}];
+  for(var i in badargs)
+  {
+      try {
+          db.view("test/all_docs",badargs[i],keys);
+          T(0==1);
+      } catch (e) {
+          T(e.error == "query_parse_error");
+      }
+
+      try {
+          db.view("test/all_docs",getbadargs[i],null);
+          T(0==1);
+      } catch (e) {
+          T(e.error = "query_parse_error");
+      }
+  }
+
+  try {
+      db.view("test/summate",{},keys);
+      T(0==1);
+  } catch (e) {
+      T(e.error == "query_parse_error");
+  }
+
+  try {
+      db.view("test/summate",{keys:keys},null);
+      T(0==1);
+  } catch (e) {
+      T(e.error == "query_parse_error");
+  }
+
+  // Test that a map & reduce containing func support keys when reduce=false
+  var resp = db.view("test/summate", {reduce: false}, keys);
+  T(resp.rows.length == 5);
+
+  resp = db.view("test/summate", {reduce: false, keys: keys}, null);
+  T(resp.rows.length == 5);
+
+  // Check that limiting by startkey_docid and endkey_docid get applied
+  // as expected.
+  var curr = db.view("test/multi_emit", {startkey_docid: 21, endkey_docid: 23}, [0, 2]).rows;
+  var exp_key = [ 0,  0,  0,  2,  2,  2] ;
+  var exp_val = [21, 22, 23, 21, 22, 23] ;
+  T(curr.length == 6);
+  for( var i = 0 ; i < 6 ; i++)
+  {
+      T(curr[i].key == exp_key[i]);
+      T(curr[i].value == exp_val[i]);
+  }
+
+  curr = db.view("test/multi_emit", {startkey_docid: 21, endkey_docid: 23, keys: [0, 2]}, null).rows;
+  T(curr.length == 6);
+  for( var i = 0 ; i < 6 ; i++)
+  {
+      T(curr[i].key == exp_key[i]);
+      T(curr[i].value == exp_val[i]);
+  }
+
+  // Check limit works
+  curr = db.view("test/all_docs", {limit: 1}, keys).rows;
+  T(curr.length == 1);
+  T(curr[0].key == 10);
+
+  curr = db.view("test/all_docs", {limit: 1, keys: keys}, null).rows;
+  T(curr.length == 1);
+  T(curr[0].key == 10);
+
+  // Check offset works
+  curr = db.view("test/multi_emit", {skip: 1}, [0]).rows;
+  T(curr.length == 99);
+  T(curr[0].value == 1);
+
+  curr = db.view("test/multi_emit", {skip: 1, keys: [0]}, null).rows;
+  T(curr.length == 99);
+  T(curr[0].value == 1);
+
+  // Check that dir works
+  curr = db.view("test/multi_emit", {descending: "true"}, [1]).rows;
+  T(curr.length == 100);
+  T(curr[0].value == 99);
+  T(curr[99].value == 0);
+
+  curr = db.view("test/multi_emit", {descending: "true", keys: [1]}, null).rows;
+  T(curr.length == 100);
+  T(curr[0].value == 99);
+  T(curr[99].value == 0);
+
+  // Check a couple combinations
+  curr = db.view("test/multi_emit", {descending: "true", skip: 3, limit: 2}, [2]).rows;
+  T(curr.length, 2);
+  T(curr[0].value == 96);
+  T(curr[1].value == 95);
+
+  curr = db.view("test/multi_emit", {descending: "true", skip: 3, limit: 2, keys: [2]}, null).rows;
+  T(curr.length, 2);
+  T(curr[0].value == 96);
+  T(curr[1].value == 95);
+
+  curr = db.view("test/multi_emit", {skip: 2, limit: 3, startkey_docid: "13"}, [0]).rows;
+  T(curr.length == 3);
+  T(curr[0].value == 15);
+  T(curr[1].value == 16);
+  T(curr[2].value == 17);
+
+  curr = db.view("test/multi_emit", {skip: 2, limit: 3, startkey_docid: "13", keys: [0]}, null).rows;
+  T(curr.length == 3);
+  T(curr[0].value == 15);
+  T(curr[1].value == 16);
+  T(curr[2].value == 17);
+
+  curr = db.view("test/multi_emit",
+          {skip: 1, limit: 5, startkey_docid: "25", endkey_docid: "27"}, [1]).rows;
+  T(curr.length == 2);
+  T(curr[0].value == 26);
+  T(curr[1].value == 27);
+
+  curr = db.view("test/multi_emit",
+          {skip: 1, limit: 5, startkey_docid: "25", endkey_docid: "27", keys: [1]}, null).rows;
+  T(curr.length == 2);
+  T(curr[0].value == 26);
+  T(curr[1].value == 27);
+
+  curr = db.view("test/multi_emit",
+          {skip: 1, limit: 5, startkey_docid: "28", endkey_docid: "26", descending: "true"}, [1]).rows;
+  T(curr.length == 2);
+  T(curr[0].value == 27);
+  T(curr[1].value == 26);
+
+  curr = db.view("test/multi_emit",
+          {skip: 1, limit: 5, startkey_docid: "28", endkey_docid: "26", descending: "true", keys: [1]}, null).rows;
+  T(curr.length == 2);
+  T(curr[0].value == 27);
+  T(curr[1].value == 26);
+};

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/test/view_multi_key_temp.js
----------------------------------------------------------------------
diff --git a/share/test/view_multi_key_temp.js b/share/test/view_multi_key_temp.js
new file mode 100644
index 0000000..3c05409
--- /dev/null
+++ b/share/test/view_multi_key_temp.js
@@ -0,0 +1,40 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+
+couchTests.view_multi_key_temp = function(debug) {
+  var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"});
+  db.deleteDb();
+  db.createDb();
+  if (debug) debugger;
+
+  var docs = makeDocs(0, 100);
+  db.bulkSave(docs);
+
+  var queryFun = function(doc) { emit(doc.integer, doc.integer) };
+  var reduceFun = function (keys, values) { return sum(values); };
+
+  var keys = [10,15,30,37,50];
+  var rows = db.query(queryFun, null, {}, keys).rows;
+  for(var i=0; i<rows.length; i++) {
+    T(keys.indexOf(rows[i].key) != -1);
+    T(rows[i].key == rows[i].value);
+  }
+
+  var reduce = db.query(queryFun, reduceFun, {group:true}, keys).rows;
+  for(var i=0; i<reduce.length; i++) {
+    T(keys.indexOf(reduce[i].key) != -1);
+    T(reduce[i].key == reduce[i].value);
+  }
+
+  rows = db.query(queryFun, null, {}, []).rows;
+  T(rows.length == 0);
+};

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/test/view_offsets.js
----------------------------------------------------------------------
diff --git a/share/test/view_offsets.js b/share/test/view_offsets.js
new file mode 100644
index 0000000..464a1ae
--- /dev/null
+++ b/share/test/view_offsets.js
@@ -0,0 +1,108 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+
+couchTests.view_offsets = function(debug) {
+  if (debug) debugger;
+
+  var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"});
+  db.deleteDb();
+  db.createDb();
+
+  var designDoc = {
+    _id : "_design/test",
+    views : {
+      offset : {
+        map : "function(doc) { emit([doc.letter, doc.number], doc); }",
+      }
+    }
+  };
+  T(db.save(designDoc).ok);
+
+  var docs = [
+    {_id : "a1", letter : "a", number : 1, foo: "bar"},
+    {_id : "a2", letter : "a", number : 2, foo: "bar"},
+    {_id : "a3", letter : "a", number : 3, foo: "bar"},
+    {_id : "b1", letter : "b", number : 1, foo: "bar"},
+    {_id : "b2", letter : "b", number : 2, foo: "bar"},
+    {_id : "b3", letter : "b", number : 3, foo: "bar"},
+    {_id : "b4", letter : "b", number : 4, foo: "bar"},
+    {_id : "b5", letter : "b", number : 5, foo: "bar"},
+    {_id : "c1", letter : "c", number : 1, foo: "bar"},
+    {_id : "c2", letter : "c", number : 2, foo: "bar"},
+  ];
+  db.bulkSave(docs);
+
+  var check = function(startkey, offset) {
+    var opts = {startkey: startkey, descending: true};
+    T(db.view("test/offset", opts).offset == offset);
+  };
+
+  [
+      [["c", 2], 0],
+      [["c", 1], 1],
+      [["b", 5], 2],
+      [["b", 4], 3],
+      [["b", 3], 4],
+      [["b", 2], 5],
+      [["b", 1], 6],
+      [["a", 3], 7],
+      [["a", 2], 8],
+      [["a", 1], 9]
+  ].forEach(function(row){ check(row[0], row[1]);});
+
+  var runTest = function () {
+    var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"});
+    db.deleteDb();
+    db.createDb();
+
+    var designDoc = {
+      _id : "_design/test",
+      views : {
+        offset : {
+          map : "function(doc) { emit([doc.letter, doc.number], doc);}",
+        }
+      }
+    };
+    T(db.save(designDoc).ok);
+
+    var docs = [
+      {_id : "a1", letter : "a", number : 1, foo : "bar"},
+      {_id : "a2", letter : "a", number : 2, foo : "bar"},
+      {_id : "a3", letter : "a", number : 3, foo : "bar"},
+      {_id : "b1", letter : "b", number : 1, foo : "bar"},
+      {_id : "b2", letter : "b", number : 2, foo : "bar"},
+      {_id : "b3", letter : "b", number : 3, foo : "bar"},
+      {_id : "b4", letter : "b", number : 4, foo : "bar"},
+      {_id : "b5", letter : "b", number : 5, foo : "bar"},
+      {_id : "c1", letter : "c", number : 1, foo : "bar"},
+      {_id : "c2", letter : "c", number : 2, foo : "bar"}
+    ];
+    db.bulkSave(docs);
+
+    var res1 = db.view("test/offset", {
+      startkey: ["b",4], startkey_docid: "b4", endkey: ["b"],
+      limit: 2, descending: true, skip: 1
+    })
+
+    var res2 = db.view("test/offset", {startkey: ["c", 3]});
+    var res3 = db.view("test/offset", {
+        startkey: ["b", 6],
+        endkey: ["b", 7]
+    });
+
+    return res1.offset == 4 && res2.offset == docs.length && res3.offset == 8;
+
+  };
+
+  for(var i = 0; i < 15; i++) T(runTest());
+}
+

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/test/view_pagination.js
----------------------------------------------------------------------
diff --git a/share/test/view_pagination.js b/share/test/view_pagination.js
new file mode 100644
index 0000000..ed3a7ee
--- /dev/null
+++ b/share/test/view_pagination.js
@@ -0,0 +1,147 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+
+couchTests.view_pagination = function(debug) {
+    var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"});
+    db.deleteDb();
+    db.createDb();
+    if (debug) debugger;
+
+    var docs = makeDocs(0, 100);
+    db.bulkSave(docs);
+
+    var queryFun = function(doc) { emit(doc.integer, null); };
+    var i;
+
+    // page through the view ascending
+    for (i = 0; i < docs.length; i += 10) {
+      var queryResults = db.query(queryFun, null, {
+        startkey: i,
+        startkey_docid: i,
+        limit: 10
+      });
+      T(queryResults.rows.length == 10);
+      T(queryResults.total_rows == docs.length);
+      T(queryResults.offset == i);
+      var j;
+      for (j = 0; j < 10;j++) {
+        T(queryResults.rows[j].key == i + j);
+      }
+
+      // test aliases start_key and start_key_doc_id
+      queryResults = db.query(queryFun, null, {
+        start_key: i,
+        start_key_doc_id: i,
+        limit: 10
+      });
+      T(queryResults.rows.length == 10);
+      T(queryResults.total_rows == docs.length);
+      T(queryResults.offset == i);
+      for (j = 0; j < 10;j++) {
+        T(queryResults.rows[j].key == i + j);
+      }
+    }
+
+    // page through the view descending
+    for (i = docs.length - 1; i >= 0; i -= 10) {
+      var queryResults = db.query(queryFun, null, {
+        startkey: i,
+        startkey_docid: i,
+        descending: true,
+        limit: 10
+      });
+      T(queryResults.rows.length == 10);
+      T(queryResults.total_rows == docs.length);
+      T(queryResults.offset == docs.length - i - 1);
+      var j;
+      for (j = 0; j < 10; j++) {
+        T(queryResults.rows[j].key == i - j);
+      }
+    }
+
+    // ignore decending=false. CouchDB should just ignore that.
+    for (i = 0; i < docs.length; i += 10) {
+      var queryResults = db.query(queryFun, null, {
+        startkey: i,
+        startkey_docid: i,
+        descending: false,
+        limit: 10
+      });
+      T(queryResults.rows.length == 10);
+      T(queryResults.total_rows == docs.length);
+      T(queryResults.offset == i);
+      var j;
+      for (j = 0; j < 10;j++) {
+        T(queryResults.rows[j].key == i + j);
+      }
+    }
+
+    function testEndkeyDocId(queryResults) {
+      T(queryResults.rows.length == 35);
+      T(queryResults.total_rows == docs.length);
+      T(queryResults.offset == 1);
+      T(queryResults.rows[0].id == "1");
+      T(queryResults.rows[1].id == "10");
+      T(queryResults.rows[2].id == "11");
+      T(queryResults.rows[3].id == "12");
+      T(queryResults.rows[4].id == "13");
+      T(queryResults.rows[5].id == "14");
+      T(queryResults.rows[6].id == "15");
+      T(queryResults.rows[7].id == "16");
+      T(queryResults.rows[8].id == "17");
+      T(queryResults.rows[9].id == "18");
+      T(queryResults.rows[10].id == "19");
+      T(queryResults.rows[11].id == "2");
+      T(queryResults.rows[12].id == "20");
+      T(queryResults.rows[13].id == "21");
+      T(queryResults.rows[14].id == "22");
+      T(queryResults.rows[15].id == "23");
+      T(queryResults.rows[16].id == "24");
+      T(queryResults.rows[17].id == "25");
+      T(queryResults.rows[18].id == "26");
+      T(queryResults.rows[19].id == "27");
+      T(queryResults.rows[20].id == "28");
+      T(queryResults.rows[21].id == "29");
+      T(queryResults.rows[22].id == "3");
+      T(queryResults.rows[23].id == "30");
+      T(queryResults.rows[24].id == "31");
+      T(queryResults.rows[25].id == "32");
+      T(queryResults.rows[26].id == "33");
+      T(queryResults.rows[27].id == "34");
+      T(queryResults.rows[28].id == "35");
+      T(queryResults.rows[29].id == "36");
+      T(queryResults.rows[30].id == "37");
+      T(queryResults.rows[31].id == "38");
+      T(queryResults.rows[32].id == "39");
+      T(queryResults.rows[33].id == "4");
+      T(queryResults.rows[34].id == "40");
+    }
+
+    // test endkey_docid
+    var queryResults = db.query(function(doc) { emit(null, null); }, null, {
+      startkey: null,
+      startkey_docid: 1,
+      endkey: null,
+      endkey_docid: 40
+    });
+    testEndkeyDocId(queryResults);
+
+    // test aliases end_key_doc_id and end_key
+    queryResults = db.query(function(doc) { emit(null, null); }, null, {
+      start_key: null,
+      start_key_doc_id: 1,
+      end_key: null,
+      end_key_doc_id: 40
+    });
+    testEndkeyDocId(queryResults);
+
+  };

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/test/view_sandboxing.js
----------------------------------------------------------------------
diff --git a/share/test/view_sandboxing.js b/share/test/view_sandboxing.js
new file mode 100644
index 0000000..5c73c5a
--- /dev/null
+++ b/share/test/view_sandboxing.js
@@ -0,0 +1,140 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+
+couchTests.view_sandboxing = function(debug) {
+  var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"});
+  db.deleteDb();
+  db.createDb();
+  if (debug) debugger;
+
+  var doc = {integer: 1, string: "1", array: [1, 2, 3]};
+  T(db.save(doc).ok);
+/*
+  // make sure that attempting to change the document throws an error
+  var results = db.query(function(doc) {
+    doc.integer = 2;
+    emit(null, doc);
+  });
+  T(results.total_rows == 0);
+
+  var results = db.query(function(doc) {
+    doc.array[0] = 0;
+    emit(null, doc);
+  });
+  T(results.total_rows == 0);
+*/
+  // make sure that a view cannot invoke interpreter internals such as the
+  // garbage collector
+  var results = db.query(function(doc) {
+    gc();
+    emit(null, doc);
+  });
+  T(results.total_rows == 0);
+
+  // make sure that a view cannot access the map_funs array defined used by
+  // the view server
+  var results = db.query(function(doc) { map_funs.push(1); emit(null, doc); });
+  T(results.total_rows == 0);
+
+  // make sure that a view cannot access the map_results array defined used by
+  // the view server
+  var results = db.query(function(doc) { map_results.push(1); emit(null, doc); });
+  T(results.total_rows == 0);
+
+  // test for COUCHDB-925
+  // altering 'doc' variable in map function affects other map functions
+  var ddoc = {
+    _id: "_design/foobar",
+    language: "javascript",
+    views: {
+      view1: {
+        map:
+          (function(doc) {
+            if (doc.values) {
+              doc.values = [666];
+            }
+            if (doc.tags) {
+              doc.tags.push("qwerty");
+            }
+            if (doc.tokens) {
+              doc.tokens["c"] = 3;
+            }
+          }).toString()
+      },
+      view2: {
+        map:
+          (function(doc) {
+            if (doc.values) {
+              emit(doc._id, doc.values);
+            }
+            if (doc.tags) {
+              emit(doc._id, doc.tags);
+            }
+            if (doc.tokens) {
+              emit(doc._id, doc.tokens);
+            }
+          }).toString()
+      }
+    }
+  };
+  var doc1 = {
+    _id: "doc1",
+    values: [1, 2, 3]
+  };
+  var doc2 = {
+    _id: "doc2",
+    tags: ["foo", "bar"],
+    tokens: {a: 1, b: 2}
+  };
+
+  db.deleteDb();
+  db.createDb();
+  T(db.save(ddoc).ok);
+  T(db.save(doc1).ok);
+  T(db.save(doc2).ok);
+
+  var view1Results = db.view(
+    "foobar/view1", {bypass_cache: Math.round(Math.random() * 1000)});
+  var view2Results = db.view(
+    "foobar/view2", {bypass_cache: Math.round(Math.random() * 1000)});
+
+  TEquals(0, view1Results.rows.length, "view1 has 0 rows");
+  TEquals(3, view2Results.rows.length, "view2 has 3 rows");
+
+  TEquals(doc1._id, view2Results.rows[0].key);
+  TEquals(doc2._id, view2Results.rows[1].key);
+  TEquals(doc2._id, view2Results.rows[2].key);
+
+  // https://bugzilla.mozilla.org/show_bug.cgi?id=449657
+  TEquals(3, view2Results.rows[0].value.length,
+    "Warning: installed SpiderMonkey version doesn't allow sealing of arrays");
+  if (view2Results.rows[0].value.length === 3) {
+    TEquals(1, view2Results.rows[0].value[0]);
+    TEquals(2, view2Results.rows[0].value[1]);
+    TEquals(3, view2Results.rows[0].value[2]);
+  }
+
+  TEquals(1, view2Results.rows[1].value["a"]);
+  TEquals(2, view2Results.rows[1].value["b"]);
+  TEquals('undefined', typeof view2Results.rows[1].value["c"],
+    "doc2.tokens object was not sealed");
+
+  TEquals(2, view2Results.rows[2].value.length,
+    "Warning: installed SpiderMonkey version doesn't allow sealing of arrays");
+  if (view2Results.rows[2].value.length === 2) {
+    TEquals("foo", view2Results.rows[2].value[0]);
+    TEquals("bar", view2Results.rows[2].value[1]);
+  }
+
+  // cleanup
+  db.deleteDb();
+};

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/test/view_update_seq.js
----------------------------------------------------------------------
diff --git a/share/test/view_update_seq.js b/share/test/view_update_seq.js
new file mode 100644
index 0000000..df92b11
--- /dev/null
+++ b/share/test/view_update_seq.js
@@ -0,0 +1,106 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+
+couchTests.view_update_seq = function(debug) {
+  var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"true"});
+  db.deleteDb();
+  db.createDb();
+  if (debug) debugger;
+
+  T(db.info().update_seq == 0);
+
+  var resp = db.allDocs({update_seq:true});
+
+  T(resp.rows.length == 0);
+  T(resp.update_seq == 0);
+
+  var designDoc = {
+    _id:"_design/test",
+    language: "javascript",
+    views: {
+      all_docs: {
+        map: "function(doc) { emit(doc.integer, doc.string) }"
+      },
+      summate: {
+        map:"function (doc) { if (typeof doc.integer === 'number') { emit(doc.integer, doc.integer)}; }",
+        reduce:"function (keys, values) { return sum(values); };"
+      }
+    }
+  };
+  T(db.save(designDoc).ok);
+
+  T(db.info().update_seq == 1);
+
+  resp = db.allDocs({update_seq:true});
+
+  T(resp.rows.length == 1);
+  T(resp.update_seq == 1);
+
+  var docs = makeDocs(0, 100);
+  db.bulkSave(docs);
+
+  resp = db.allDocs({limit: 1});
+  T(resp.rows.length == 1);
+  T(!resp.update_seq, "all docs");
+
+  resp = db.allDocs({limit: 1, update_seq:true});
+  T(resp.rows.length == 1);
+  T(resp.update_seq == 101);
+
+  resp = db.view('test/all_docs', {limit: 1, update_seq:true});
+  T(resp.rows.length == 1);
+  T(resp.update_seq == 101);
+
+  resp = db.view('test/all_docs', {limit: 1, update_seq:false});
+  T(resp.rows.length == 1);
+  T(!resp.update_seq, "view");
+
+  resp = db.view('test/summate', {update_seq:true});
+  T(resp.rows.length == 1);
+  T(resp.update_seq == 101);
+
+  db.save({"id":"0", "integer": 1});
+  resp = db.view('test/all_docs', {limit: 1,stale: "ok", update_seq:true});
+  T(resp.rows.length == 1);
+  T(resp.update_seq == 101);
+
+  db.save({"id":"00", "integer": 2});
+  resp = db.view('test/all_docs',
+    {limit: 1, stale: "update_after", update_seq: true});
+  T(resp.rows.length == 1);
+  T(resp.update_seq == 101);
+
+  // wait 5 seconds for the next assertions to pass in very slow machines
+  var t0 = new Date(), t1;
+  do {
+    CouchDB.request("GET", "/");
+    t1 = new Date();
+  } while ((t1 - t0) < 5000);
+
+  resp = db.view('test/all_docs', {limit: 1, stale: "ok", update_seq: true});
+  T(resp.rows.length == 1);
+  T(resp.update_seq == 103);
+
+  resp = db.view('test/all_docs', {limit: 1, update_seq:true});
+  T(resp.rows.length == 1);
+  T(resp.update_seq == 103);
+
+  resp = db.view('test/all_docs',{update_seq:true},["0","1"]);
+  T(resp.update_seq == 103);
+
+  resp = db.view('test/all_docs',{update_seq:true},["0","1"]);
+  T(resp.update_seq == 103);
+
+  resp = db.view('test/summate',{group:true, update_seq:true},[0,1]);
+  TEquals(103, resp.update_seq);
+
+};

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/www/script/test/all_docs.js
----------------------------------------------------------------------
diff --git a/share/www/script/test/all_docs.js b/share/www/script/test/all_docs.js
deleted file mode 100644
index 66ad880..0000000
--- a/share/www/script/test/all_docs.js
+++ /dev/null
@@ -1,142 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
-couchTests.all_docs = function(debug) {
-  var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"});
-  db.deleteDb();
-  db.createDb();
-  if (debug) debugger;
-
-  // Create some more documents.
-  // Notice the use of the ok member on the return result.
-  T(db.save({_id:"0",a:1,b:1}).ok);
-  T(db.save({_id:"3",a:4,b:16}).ok);
-  T(db.save({_id:"1",a:2,b:4}).ok);
-  T(db.save({_id:"2",a:3,b:9}).ok);
-
-  // Check the all docs
-  var results = db.allDocs();
-  var rows = results.rows;
-
-  T(results.total_rows == results.rows.length);
-
-  for(var i=0; i < rows.length; i++) {
-    T(rows[i].id >= "0" && rows[i].id <= "4");
-  }
-
-  // Check _all_docs with descending=true
-  var desc = db.allDocs({descending:true});
-  T(desc.total_rows == desc.rows.length);
-
-  // Check _all_docs offset
-  var all = db.allDocs({startkey:"2"});
-  T(all.offset == 2);
-
-  // Confirm that queries may assume raw collation.
-  var raw = db.allDocs({ startkey: "org.couchdb.user:",
-                         endkey  : "org.couchdb.user;"
-                       });
-  TEquals(0, raw.rows.length);
-
-  // check that the docs show up in the seq view in the order they were created
-  var changes = db.changes();
-  var ids = ["0","3","1","2"];
-  for (var i=0; i < changes.results.length; i++) {
-    var row = changes.results[i];
-    T(row.id == ids[i], "seq order");
-  };
-
-  // it should work in reverse as well
-  changes = db.changes({descending:true});
-  ids = ["2","1","3","0"];
-  for (var i=0; i < changes.results.length; i++) {
-    var row = changes.results[i];
-    T(row.id == ids[i], "descending=true");
-  };
-
-  // check that deletions also show up right
-  var doc1 = db.open("1");
-  var deleted = db.deleteDoc(doc1);
-  T(deleted.ok);
-  changes = db.changes();
-  // the deletion should make doc id 1 have the last seq num
-  T(changes.results.length == 4);
-  T(changes.results[3].id == "1");
-  T(changes.results[3].deleted);
-
-  // do an update
-  var doc2 = db.open("3");
-  doc2.updated = "totally";
-  db.save(doc2);
-  changes = db.changes();
-
-  // the update should make doc id 3 have the last seq num
-  T(changes.results.length == 4);
-  T(changes.results[3].id == "3");
-
-  // ok now lets see what happens with include docs
-  changes = db.changes({include_docs: true});
-  T(changes.results.length == 4);
-  T(changes.results[3].id == "3");
-  T(changes.results[3].doc.updated == "totally");
-
-  T(changes.results[2].doc);
-  T(changes.results[2].doc._deleted);
-
-  rows = db.allDocs({include_docs: true}, ["1"]).rows;
-  TEquals(1, rows.length);
-  TEquals("1", rows[0].key);
-  TEquals("1", rows[0].id);
-  TEquals(true, rows[0].value.deleted);
-  TEquals(null, rows[0].doc);
-
-  // add conflicts
-  var conflictDoc1 = {
-    _id: "3", _rev: "2-aa01552213fafa022e6167113ed01087", value: "X"
-  };
-  var conflictDoc2 = {
-    _id: "3", _rev: "2-ff01552213fafa022e6167113ed01087", value: "Z"
-  };
-  T(db.save(conflictDoc1, {new_edits: false}));
-  T(db.save(conflictDoc2, {new_edits: false}));
-
-  var winRev = db.open("3");
-
-  changes = db.changes({include_docs: true, conflicts: true, style: "all_docs"});
-  TEquals("3", changes.results[3].id);
-  TEquals(3, changes.results[3].changes.length);
-  TEquals(winRev._rev, changes.results[3].changes[0].rev);
-  TEquals("3", changes.results[3].doc._id);
-  TEquals(winRev._rev, changes.results[3].doc._rev);
-  TEquals(true, changes.results[3].doc._conflicts instanceof Array);
-  TEquals(2, changes.results[3].doc._conflicts.length);
-
-  rows = db.allDocs({include_docs: true, conflicts: true}).rows;
-  TEquals(3, rows.length);
-  TEquals("3", rows[2].key);
-  TEquals("3", rows[2].id);
-  TEquals(winRev._rev, rows[2].value.rev);
-  TEquals(winRev._rev, rows[2].doc._rev);
-  TEquals("3", rows[2].doc._id);
-  TEquals(true, rows[2].doc._conflicts instanceof Array);
-  TEquals(2, rows[2].doc._conflicts.length);
-
-  // test the all docs collates sanely
-  db.save({_id: "Z", foo: "Z"});
-  db.save({_id: "a", foo: "a"});
-
-  var rows = db.allDocs({startkey: "Z", endkey: "Z"}).rows;
-  T(rows.length == 1);
-
-  // cleanup
-  db.deleteDb();
-};

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/www/script/test/attachment_names.js
----------------------------------------------------------------------
diff --git a/share/www/script/test/attachment_names.js b/share/www/script/test/attachment_names.js
deleted file mode 100644
index c9a5fcc..0000000
--- a/share/www/script/test/attachment_names.js
+++ /dev/null
@@ -1,96 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
-couchTests.attachment_names = function(debug) {
-  var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"});
-  db.deleteDb();
-  db.createDb();
-  if (debug) debugger;
-
-  var goodDoc = {
-    _id: "good_doc",
-    _attachments: {
-      "Колян.txt": {
-       content_type:"application/octet-stream",
-       data: "VGhpcyBpcyBhIGJhc2U2NCBlbmNvZGVkIHRleHQ="
-      }
-    }
-  };
-
-  var save_response = db.save(goodDoc);
-  T(save_response.ok);
-
-  var xhr = CouchDB.request("GET", "/test_suite_db/good_doc/Колян.txt");
-  T(xhr.responseText == "This is a base64 encoded text");
-  T(xhr.getResponseHeader("Content-Type") == "application/octet-stream");
-  TEquals("\"aEI7pOYCRBLTRQvvqYrrJQ==\"", xhr.getResponseHeader("Etag"));
-
-  var binAttDoc = {
-    _id: "bin_doc",
-    _attachments:{
-      "foo\x80txt": {
-        content_type:"text/plain",
-        data: "VGhpcyBpcyBhIGJhc2U2NCBlbmNvZGVkIHRleHQ="
-      }
-    }
-  };
-
-  // inline attachments
-  resp = db.save(binAttDoc);
-  TEquals(true, resp.ok, "attachment_name: inline attachment");
-
-
-  // standalone docs
-  var bin_data = "JHAPDO*AU£PN ){(3u[d 93DQ9¡€])}    ææøo'∂ƒæ≤çæππ•¥∫¶®#†π¶®¥π€ª®˙π8np";
-
-
-  var xhr = (CouchDB.request("PUT", "/test_suite_db/bin_doc3/attachment\x80txt", {
-    headers:{"Content-Type":"text/plain;charset=utf-8"},
-    body:bin_data
-  }));
-
-  var resp = JSON.parse(xhr.responseText);
-  TEquals(201, xhr.status, "attachment_name: standalone API");
-  TEquals(true, resp.ok, "attachment_name: standalone API");
-
-  // bulk docs
-  var docs = { docs: [binAttDoc] };
-
-  var xhr = CouchDB.request("POST", "/test_suite_db/_bulk_docs", {
-    body: JSON.stringify(docs)
-  });
-
-  TEquals(201, xhr.status, "attachment_name: bulk docs");
-
-
-  // leading underscores
-  var binAttDoc = {
-    _id: "bin_doc2",
-    _attachments:{
-      "_foo.txt": {
-        content_type:"text/plain",
-        data: "VGhpcyBpcyBhIGJhc2U2NCBlbmNvZGVkIHRleHQ="
-      }
-    }
-  };
-
-  try {
-    db.save(binAttDoc);
-    TEquals(1, 2, "Attachment name with leading underscore saved. Should never show!");
-  } catch (e) {
-    TEquals("bad_request", e.error, "attachment_name: leading underscore");
-    TEquals("Attachment name can't start with '_'", e.reason, "attachment_name: leading underscore");
-  }
-
-  // todo: form uploads, waiting for cmlenz' test case for form uploads
-
-};

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/www/script/test/attachment_paths.js
----------------------------------------------------------------------
diff --git a/share/www/script/test/attachment_paths.js b/share/www/script/test/attachment_paths.js
deleted file mode 100644
index 3f6ffb7..0000000
--- a/share/www/script/test/attachment_paths.js
+++ /dev/null
@@ -1,153 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
-couchTests.attachment_paths = function(debug) {
-  if (debug) debugger;
-  var dbNames = ["test_suite_db", "test_suite_db/with_slashes"];
-  for (var i=0; i < dbNames.length; i++) {
-    var db = new CouchDB(dbNames[i]);
-    var dbName = encodeURIComponent(dbNames[i]);
-    db.deleteDb();
-    db.createDb();
-
-    // first just save a regular doc with an attachment that has a slash in the url.
-    // (also gonna run an encoding check case)
-    var binAttDoc = {
-      _id: "bin_doc",
-      _attachments:{
-        "foo/bar.txt": {
-          content_type:"text/plain",
-          data: "VGhpcyBpcyBhIGJhc2U2NCBlbmNvZGVkIHRleHQ="
-        },
-        "foo%2Fbaz.txt": {
-          content_type:"text/plain",
-          data: "V2UgbGlrZSBwZXJjZW50IHR3byBGLg=="
-        }
-      }
-    };
-
-    T(db.save(binAttDoc).ok);
-
-    var xhr = CouchDB.request("GET", "/"+dbName+"/bin_doc/foo/bar.txt");
-    T(xhr.responseText == "This is a base64 encoded text");
-    T(xhr.getResponseHeader("Content-Type") == "text/plain");
-
-    // lets try it with an escaped attachment id...
-    // weird that it's at two urls
-    var xhr = CouchDB.request("GET", "/"+dbName+"/bin_doc/foo%2Fbar.txt");
-    T(xhr.status == 200);
-    // xhr.responseText == "This is a base64 encoded text"
-
-    var xhr = CouchDB.request("GET", "/"+dbName+"/bin_doc/foo/baz.txt");
-    T(xhr.status == 404);
-
-    var xhr = CouchDB.request("GET", "/"+dbName+"/bin_doc/foo%252Fbaz.txt");
-    T(xhr.status == 200);
-    T(xhr.responseText == "We like percent two F.");
-
-    // require a _rev to PUT
-    var xhr = CouchDB.request("PUT", "/"+dbName+"/bin_doc/foo/attachment.txt", {
-      headers:{"Content-Type":"text/plain;charset=utf-8"},
-      body:"Just some text"
-    });
-    T(xhr.status == 409);
-
-    var xhr = CouchDB.request("PUT", "/"+dbName+"/bin_doc/foo/bar2.txt?rev=" + binAttDoc._rev, {
-      body:"This is no base64 encoded text",
-      headers:{"Content-Type": "text/plain;charset=utf-8"}
-    });
-    T(xhr.status == 201);
-    var rev = JSON.parse(xhr.responseText).rev;
-
-    binAttDoc = db.open("bin_doc");
-
-    T(binAttDoc._attachments["foo/bar.txt"] !== undefined);
-    T(binAttDoc._attachments["foo%2Fbaz.txt"] !== undefined);
-    T(binAttDoc._attachments["foo/bar2.txt"] !== undefined);
-    TEquals("text/plain;charset=utf-8",                   // thank you Safari
-      binAttDoc._attachments["foo/bar2.txt"].content_type.toLowerCase(),
-      "correct content-type"
-    );
-    T(binAttDoc._attachments["foo/bar2.txt"].length == 30);
-
-    //// now repeat the while thing with a design doc
-
-    // first just save a regular doc with an attachment that has a slash in the url.
-    // (also gonna run an encoding check case)
-    var binAttDoc = {
-      _id: "_design/bin_doc",
-      _attachments:{
-        "foo/bar.txt": {
-          content_type:"text/plain",
-          data: "VGhpcyBpcyBhIGJhc2U2NCBlbmNvZGVkIHRleHQ="
-        },
-        "foo%2Fbaz.txt": {
-          content_type:"text/plain",
-          data: "V2UgbGlrZSBwZXJjZW50IHR3byBGLg=="
-        }
-      }
-    };
-
-    T(db.save(binAttDoc).ok);
-
-    var xhr = CouchDB.request("GET", "/"+dbName+"/_design%2Fbin_doc/foo/bar.txt");
-    T(xhr.responseText == "This is a base64 encoded text");
-    T(xhr.getResponseHeader("Content-Type") == "text/plain");
-
-    // lets try it with an escaped attachment id...
-    // weird that it's at two urls
-    var xhr = CouchDB.request("GET", "/"+dbName+"/_design%2Fbin_doc/foo%2Fbar.txt");
-    T(xhr.responseText == "This is a base64 encoded text");
-    T(xhr.status == 200);
-
-    // err, 3 urls
-    var xhr = CouchDB.request("GET", "/"+dbName+"/_design/bin_doc/foo%2Fbar.txt");
-    T(xhr.responseText == "This is a base64 encoded text");
-    T(xhr.status == 200);
-
-    // I mean um, 4 urls
-    var xhr = CouchDB.request("GET", "/"+dbName+"/_design/bin_doc/foo/bar.txt");
-    T(xhr.responseText == "This is a base64 encoded text");
-    T(xhr.status == 200);
-
-    var xhr = CouchDB.request("GET", "/"+dbName+"/_design%2Fbin_doc/foo/baz.txt");
-    T(xhr.status == 404);
-
-    var xhr = CouchDB.request("GET", "/"+dbName+"/_design%2Fbin_doc/foo%252Fbaz.txt");
-    T(xhr.status == 200);
-    T(xhr.responseText == "We like percent two F.");
-
-    // require a _rev to PUT
-    var xhr = CouchDB.request("PUT", "/"+dbName+"/_design%2Fbin_doc/foo/attachment.txt", {
-      headers:{"Content-Type":"text/plain;charset=utf-8"},
-      body:"Just some text"
-    });
-    T(xhr.status == 409);
-
-    var xhr = CouchDB.request("PUT", "/"+dbName+"/_design%2Fbin_doc/foo/bar2.txt?rev=" + binAttDoc._rev, {
-      body:"This is no base64 encoded text",
-      headers:{"Content-Type": "text/plain;charset=utf-8"}
-    });
-    T(xhr.status == 201);
-    var rev = JSON.parse(xhr.responseText).rev;
-
-    binAttDoc = db.open("_design/bin_doc");
-
-    T(binAttDoc._attachments["foo/bar.txt"] !== undefined);
-    T(binAttDoc._attachments["foo/bar2.txt"] !== undefined);
-    TEquals("text/plain;charset=utf-8",                   // thank you Safari
-      binAttDoc._attachments["foo/bar2.txt"].content_type.toLowerCase(),
-      "correct content-type"
-    );
-    T(binAttDoc._attachments["foo/bar2.txt"].length == 30);
-  }
-};

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/www/script/test/attachment_ranges.js
----------------------------------------------------------------------
diff --git a/share/www/script/test/attachment_ranges.js b/share/www/script/test/attachment_ranges.js
deleted file mode 100644
index 7d9afb5..0000000
--- a/share/www/script/test/attachment_ranges.js
+++ /dev/null
@@ -1,160 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
-function cacheBust() {
-    return "?anti-cache=" + String(Math.round(Math.random() * 1000000));
-};
-
-couchTests.attachment_ranges = function(debug) {
-    var db = new CouchDB("test_suite_db", {
-        "X-Couch-Full-Commit": "false"
-    });
-    db.deleteDb();
-    db.createDb();
-
-    if (debug) debugger;
-
-    if((typeof window != "undefined") && window.navigator.userAgent.match(/Chrome/)) {
-        // Chrome is broken.
-        return;
-    }
-
-    var binAttDoc = {
-        _id: "bin_doc",
-        _attachments: {
-            "foo.txt": {
-                content_type: "application/octet-stream",
-                data: "VGhpcyBpcyBhIGJhc2U2NCBlbmNvZGVkIHRleHQ="
-            }
-        }
-    };
-
-    var save_response = db.save(binAttDoc);
-    T(save_response.ok);
-
-    // Fetching the whole entity is a 206.
-    var xhr = CouchDB.request("GET", "/test_suite_db/bin_doc/foo.txt" + cacheBust(), {
-        headers: {
-            "Range": "bytes=0-28"
-        }
-    });
-    TEquals(206, xhr.status, "fetch 0-28");
-    TEquals("This is a base64 encoded text", xhr.responseText);
-    TEquals("bytes 0-28/29", xhr.getResponseHeader("Content-Range"));
-    TEquals("29", xhr.getResponseHeader("Content-Length"));
-
-    // Fetch the whole entity without an end offset is a 200.
-    var xhr = CouchDB.request("GET", "/test_suite_db/bin_doc/foo.txt" + cacheBust(), {
-        headers: {
-            "Range": "bytes=0-"
-        }
-    });
-    TEquals(200, xhr.status, "fetch 0-");
-    TEquals("This is a base64 encoded text", xhr.responseText);
-    TEquals(null, xhr.getResponseHeader("Content-Range"));
-    TEquals("29", xhr.getResponseHeader("Content-Length"));
-
-    // Even if you ask multiple times.
-    var xhr = CouchDB.request("GET", "/test_suite_db/bin_doc/foo.txt" + cacheBust(), {
-        headers: {
-            "Range": "bytes=0-,0-,0-"
-        }
-    });
-    TEquals(200, xhr.status, "multiple 0-'s");
-
-    // Badly formed range header is a 200.
-    var xhr = CouchDB.request("GET", "/test_suite_db/bin_doc/foo.txt" + cacheBust(), {
-        headers: {
-            "Range": "bytes:0-"
-        }
-    });
-    TEquals(200, xhr.status, "fetch with bad range header");
-
-    // Fetch the end of an entity without an end offset is a 206.
-    var xhr = CouchDB.request("GET", "/test_suite_db/bin_doc/foo.txt"  + cacheBust(), {
-        headers: {
-            "Range": "bytes=2-"
-        }
-    });
-    TEquals(206, xhr.status, "fetch 2-");
-    TEquals("is is a base64 encoded text", xhr.responseText);
-    TEquals("bytes 2-28/29", xhr.getResponseHeader("Content-Range"));
-    TEquals("27", xhr.getResponseHeader("Content-Length"));
-
-    // Fetch past the end of the entity is a 206
-    var xhr = CouchDB.request("GET", "/test_suite_db/bin_doc/foo.txt"  + cacheBust(), {
-        headers: {
-            "Range": "bytes=0-29"
-        }
-    });
-    TEquals(206, xhr.status, "fetch 0-29");
-    TEquals("bytes 0-28/29", xhr.getResponseHeader("Content-Range"));
-    TEquals("29", xhr.getResponseHeader("Content-Length"));
-
-    // Fetch first part of entity is a 206
-    var xhr = CouchDB.request("GET", "/test_suite_db/bin_doc/foo.txt" + cacheBust(), {
-        headers: {
-            "Range": "bytes=0-3"
-        }
-    });
-    TEquals(206, xhr.status, "fetch 0-3");
-    TEquals("This", xhr.responseText);
-    TEquals("4", xhr.getResponseHeader("Content-Length"));
-    TEquals("bytes 0-3/29", xhr.getResponseHeader("Content-Range"));
-
-    // Fetch middle of entity is also a 206
-    var xhr = CouchDB.request("GET", "/test_suite_db/bin_doc/foo.txt" + cacheBust(), {
-        headers: {
-            "Range": "bytes=10-15"
-        }
-    });
-    TEquals(206, xhr.status, "fetch 10-15");
-    TEquals("base64", xhr.responseText);
-    TEquals("6", xhr.getResponseHeader("Content-Length"));
-    TEquals("bytes 10-15/29", xhr.getResponseHeader("Content-Range"));
-
-    // Fetch end of entity is also a 206
-    var xhr = CouchDB.request("GET", "/test_suite_db/bin_doc/foo.txt" + cacheBust(), {
-        headers: {
-            "Range": "bytes=-3"
-        }
-    });
-    TEquals(206, xhr.status, "fetch -3");
-    TEquals("ext", xhr.responseText);
-    TEquals("3", xhr.getResponseHeader("Content-Length"));
-    TEquals("bytes 26-28/29", xhr.getResponseHeader("Content-Range"));
-    
-    // backward range is 416
-    var xhr = CouchDB.request("GET", "/test_suite_db/bin_doc/foo.txt" + cacheBust(), {
-       headers: {
-           "Range": "bytes=5-3"
-       }
-    });
-    TEquals(416, xhr.status, "fetch 5-3");
-
-    // range completely outside of entity is 416
-    var xhr = CouchDB.request("GET", "/test_suite_db/bin_doc/foo.txt" + cacheBust(), {
-        headers: {
-            "Range": "bytes=300-310"
-        }
-    });
-    TEquals(416, xhr.status, "fetch 300-310");
-
-    // We ignore a Range header with too many ranges
-    var xhr = CouchDB.request("GET", "/test_suite_db/bin_doc/foo.txt" + cacheBust(), {
-        headers: {
-            "Range": "bytes=0-1,0-1,0-1,0-1,0-1,0-1,0-1,0-1,0-1,0-1"
-        }
-    });
-    TEquals(200, xhr.status, "too many ranges");
-
-};

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/www/script/test/attachment_views.js
----------------------------------------------------------------------
diff --git a/share/www/script/test/attachment_views.js b/share/www/script/test/attachment_views.js
deleted file mode 100644
index b55aabe..0000000
--- a/share/www/script/test/attachment_views.js
+++ /dev/null
@@ -1,140 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
-couchTests.attachment_views= function(debug) {
-
-  var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"});
-  db.deleteDb();
-  db.createDb();
-  if (debug) debugger;
-
-  // count attachments in a view
-
-  var attachmentData = "VGhpcyBpcyBhIGJhc2U2NCBlbmNvZGVkIHRleHQ=";
-
-  db.bulkSave(makeDocs(0, 10));
-
-  db.bulkSave(makeDocs(10, 20, {
-    _attachments:{
-      "foo.txt": {
-        content_type:"text/plain",
-        data: attachmentData
-      }
-    }
-  }));
-
-  db.bulkSave(makeDocs(20, 30, {
-    _attachments:{
-      "foo.txt": {
-        content_type:"text/plain",
-        data: attachmentData
-      },
-      "bar.txt": {
-        content_type:"text/plain",
-        data: attachmentData
-      }
-    }
-  }));
-
-  db.bulkSave(makeDocs(30, 40, {
-    _attachments:{
-      "foo.txt": {
-        content_type:"text/plain",
-        data: attachmentData
-      },
-      "bar.txt": {
-        content_type:"text/plain",
-        data: attachmentData
-      },
-      "baz.txt": {
-        content_type:"text/plain",
-        data: attachmentData
-      }
-    }
-  }));
-
-  var mapFunction = function(doc) {
-    var count = 0;
-
-    for(var idx in doc._attachments) {
-      count = count + 1;
-    }
-
-    emit(parseInt(doc._id), count);
-  };
-
-  var reduceFunction = function(key, values) {
-    return sum(values);
-  };
-
-  var result = db.query(mapFunction, reduceFunction);
-
-  T(result.rows.length == 1);
-  T(result.rows[0].value == 60);
-
-  var result = db.query(mapFunction, reduceFunction, {
-    startkey:10,
-    endkey:19
-  });
-
-  T(result.rows.length == 1);
-  T(result.rows[0].value == 10);
-
-  var result = db.query(mapFunction, reduceFunction, {
-    startkey:20,
-    endkey:29
-  });
-
-  T(result.rows.length == 1);
-  T(result.rows[0].value == 20);
-
-  var result = db.query(mapFunction, null, {
-    startkey: 30,
-    endkey: 39,
-    include_docs: true
-  });
-
-  T(result.rows.length == 10);
-  T(result.rows[0].value == 3);
-  T(result.rows[0].doc._attachments['baz.txt'].stub === true);
-  T(result.rows[0].doc._attachments['baz.txt'].data === undefined);
-  T(result.rows[0].doc._attachments['baz.txt'].encoding === undefined);
-  T(result.rows[0].doc._attachments['baz.txt'].encoded_length === undefined);
-
-  var result = db.query(mapFunction, null, {
-    startkey: 30,
-    endkey: 39,
-    include_docs: true,
-    attachments: true
-  });
-
-  T(result.rows.length == 10);
-  T(result.rows[0].value == 3);
-  T(result.rows[0].doc._attachments['baz.txt'].data === attachmentData);
-  T(result.rows[0].doc._attachments['baz.txt'].stub === undefined);
-  T(result.rows[0].doc._attachments['baz.txt'].encoding === undefined);
-  T(result.rows[0].doc._attachments['baz.txt'].encoded_length === undefined);
-
-  var result = db.query(mapFunction, null, {
-    startkey: 30,
-    endkey: 39,
-    include_docs: true,
-    att_encoding_info: true
-  });
-
-  T(result.rows.length == 10);
-  T(result.rows[0].value == 3);
-  T(result.rows[0].doc._attachments['baz.txt'].data === undefined);
-  T(result.rows[0].doc._attachments['baz.txt'].stub === true);
-  T(result.rows[0].doc._attachments['baz.txt'].encoding === "gzip");
-  T(result.rows[0].doc._attachments['baz.txt'].encoded_length === 47);
-};

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/www/script/test/attachments.js
----------------------------------------------------------------------
diff --git a/share/www/script/test/attachments.js b/share/www/script/test/attachments.js
deleted file mode 100644
index 2fa08ee..0000000
--- a/share/www/script/test/attachments.js
+++ /dev/null
@@ -1,328 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
-couchTests.attachments= function(debug) {
-  var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"});
-  db.deleteDb();
-  db.createDb();
-  if (debug) debugger;
-
-
-  // MD5 Digests of compressible attachments and therefore Etags
-  // will vary depending on platform gzip implementation.
-  // These MIME types are defined in [attachments] compressible_types
-  var binAttDoc = {
-    _id: "bin_doc",
-    _attachments:{
-      "foo.txt": {
-        content_type:"application/octet-stream",
-        data: "VGhpcyBpcyBhIGJhc2U2NCBlbmNvZGVkIHRleHQ="
-      }
-    }
-  };
-
-  var save_response = db.save(binAttDoc);
-  T(save_response.ok);
-
-  var xhr = CouchDB.request("GET", "/test_suite_db/bin_doc/foo.txt");
-  T(xhr.responseText == "This is a base64 encoded text");
-  T(xhr.getResponseHeader("Content-Type") == "application/octet-stream");
-  TEquals("\"aEI7pOYCRBLTRQvvqYrrJQ==\"", xhr.getResponseHeader("Etag"));
-
-  // empty attachment
-  var binAttDoc2 = {
-    _id: "bin_doc2",
-    _attachments:{
-      "foo.txt": {
-        content_type:"text/plain",
-        data: ""
-      }
-    }
-  }
-
-  T(db.save(binAttDoc2).ok);
-
-  var xhr = CouchDB.request("GET", "/test_suite_db/bin_doc2/foo.txt");
-  T(xhr.responseText.length == 0);
-  T(xhr.getResponseHeader("Content-Type") == "text/plain");
-
-  // test RESTful doc API
-
-  var xhr = CouchDB.request("PUT", "/test_suite_db/bin_doc2/foo2.txt?rev=" + binAttDoc2._rev, {
-    body:"This is no base64 encoded text",
-    headers:{"Content-Type": "text/plain;charset=utf-8"}
-  });
-  T(xhr.status == 201);
-  TEquals("/bin_doc2/foo2.txt",
-    xhr.getResponseHeader("Location").substr(-18),
-    "should return Location header to newly created or updated attachment");
-
-  var rev = JSON.parse(xhr.responseText).rev;
-
-  binAttDoc2 = db.open("bin_doc2");
-
-  T(binAttDoc2._attachments["foo.txt"] !== undefined);
-  T(binAttDoc2._attachments["foo2.txt"] !== undefined);
-  TEqualsIgnoreCase("text/plain;charset=utf-8", binAttDoc2._attachments["foo2.txt"].content_type);
-  T(binAttDoc2._attachments["foo2.txt"].length == 30);
-
-  var xhr = CouchDB.request("GET", "/test_suite_db/bin_doc2/foo2.txt");
-  T(xhr.responseText == "This is no base64 encoded text");
-  TEqualsIgnoreCase("text/plain;charset=utf-8", xhr.getResponseHeader("Content-Type"));
-
-  // test without rev, should fail
-  var xhr = CouchDB.request("DELETE", "/test_suite_db/bin_doc2/foo2.txt");
-  T(xhr.status == 409);
-
-  // test with rev, should not fail
-  var xhr = CouchDB.request("DELETE", "/test_suite_db/bin_doc2/foo2.txt?rev=" + rev);
-  T(xhr.status == 200);
-  TEquals(null, xhr.getResponseHeader("Location"),
-    "should not return Location header on DELETE request");
-
-  // test binary data
-  var bin_data = "JHAPDO*AU£PN ){(3u[d 93DQ9¡€])}    ææøo'∂ƒæ≤çæππ•¥∫¶®#†π¶®¥π€ª®˙π8np";
-  var xhr = CouchDB.request("PUT", "/test_suite_db/bin_doc3/attachment.txt", {
-    headers:{"Content-Type":"text/plain;charset=utf-8"},
-    body:bin_data
-  });
-  T(xhr.status == 201);
-  var rev = JSON.parse(xhr.responseText).rev;
-  TEquals('"' + rev + '"', xhr.getResponseHeader("Etag"));
-
-  var xhr = CouchDB.request("GET", "/test_suite_db/bin_doc3/attachment.txt");
-  T(xhr.responseText == bin_data);
-  TEqualsIgnoreCase("text/plain;charset=utf-8", xhr.getResponseHeader("Content-Type"));
-
-  // without rev
-  var xhr = CouchDB.request("PUT", "/test_suite_db/bin_doc3/attachment.txt", {
-    headers:{"Content-Type":"text/plain;charset=utf-8"},
-    body:bin_data
-  });
-  T(xhr.status == 409);
-
-  // with nonexistent rev
-  var xhr = CouchDB.request("PUT", "/test_suite_db/bin_doc3/attachment.txt"  + "?rev=1-adae8575ecea588919bd08eb020c708e", {
-    headers:{"Content-Type":"text/plain;charset=utf-8"},
-    body:bin_data
-  });
-  T(xhr.status == 409);
-
-  // with current rev
-  var xhr = CouchDB.request("PUT", "/test_suite_db/bin_doc3/attachment.txt?rev=" + rev, {
-    headers:{"Content-Type":"text/plain;charset=utf-8"},
-    body:bin_data
-  });
-  T(xhr.status == 201);
-  var rev = JSON.parse(xhr.responseText).rev;
-  TEquals('"' + rev + '"', xhr.getResponseHeader("Etag"));
-
-  var xhr = CouchDB.request("GET", "/test_suite_db/bin_doc3/attachment.txt");
-  T(xhr.responseText == bin_data);
-  TEqualsIgnoreCase("text/plain;charset=utf-8", xhr.getResponseHeader("Content-Type"));
-
-  var xhr = CouchDB.request("GET", "/test_suite_db/bin_doc3/attachment.txt?rev=" + rev);
-  T(xhr.responseText == bin_data);
-  TEqualsIgnoreCase("text/plain;charset=utf-8", xhr.getResponseHeader("Content-Type"));
-
-  var xhr = CouchDB.request("DELETE", "/test_suite_db/bin_doc3/attachment.txt?rev=" + rev);
-  T(xhr.status == 200);
-
-  var xhr = CouchDB.request("GET", "/test_suite_db/bin_doc3/attachment.txt");
-  T(xhr.status == 404);
-
-  // deleted attachment is still accessible with revision
-  var xhr = CouchDB.request("GET", "/test_suite_db/bin_doc3/attachment.txt?rev=" + rev);
-  T(xhr.status == 200);
-  T(xhr.responseText == bin_data);
-  TEqualsIgnoreCase("text/plain;charset=utf-8", xhr.getResponseHeader("Content-Type"));
-
-  // empty attachments
-  var xhr = CouchDB.request("PUT", "/test_suite_db/bin_doc4/attachment.txt", {
-    headers:{"Content-Type":"text/plain;charset=utf-8"},
-    body:""
-  });
-  T(xhr.status == 201);
-  var rev = JSON.parse(xhr.responseText).rev;
-
-  var xhr = CouchDB.request("GET", "/test_suite_db/bin_doc4/attachment.txt");
-  T(xhr.status == 200);
-  T(xhr.responseText.length == 0);
-
-  // overwrite previsously empty attachment
-  var xhr = CouchDB.request("PUT", "/test_suite_db/bin_doc4/attachment.txt?rev=" + rev, {
-    headers:{"Content-Type":"text/plain;charset=utf-8"},
-    body:"This is a string"
-  });
-  T(xhr.status == 201);
-
-  var xhr = CouchDB.request("GET", "/test_suite_db/bin_doc4/attachment.txt");
-  T(xhr.status == 200);
-  T(xhr.responseText == "This is a string");
-
-  // Attachment sparseness COUCHDB-220
-
-  var docs = [];
-  for (var i = 0; i < 5; i++) {
-    var doc = {
-      _id: (i).toString(),
-      _attachments:{
-        "foo.txt": {
-          content_type:"text/plain",
-          data: "VGhpcyBpcyBhIGJhc2U2NCBlbmNvZGVkIHRleHQ="
-        }
-      }
-    };
-    docs.push(doc);
-  }
-
-  var saved = db.bulkSave(docs);
-  // now delete the docs, and while we are looping over them, remove the
-  // '_rev' field so we can re-create after deletion.
-  var to_up = [];
-  for (i=0;i<saved.length;i++) {
-    to_up.push({'_id': saved[i]['id'], '_rev': saved[i]['rev'], '_deleted': true});
-    delete docs[i]._rev;
-  }
-  // delete them.
-  var saved2 = db.bulkSave(to_up);
-  // re-create them
-  var saved3 = db.bulkSave(docs);
-
-  var before = db.info().disk_size;
-
-  // Compact it.
-  T(db.compact().ok);
-  T(db.last_req.status == 202);
-  // compaction isn't instantaneous, loop until done
-  while (db.info().compact_running) {};
-
-  var after = db.info().disk_size;
-
-  // Compaction should reduce the database slightly, but not
-  // orders of magnitude (unless attachments introduce sparseness)
-  T(after > before * 0.1, "before: " + before + " after: " + after);
-
-
-  // test large attachments - COUCHDB-366
-  var lorem = CouchDB.request("GET", "/_utils/script/test/lorem.txt").responseText;
-
-  var xhr = CouchDB.request("PUT", "/test_suite_db/bin_doc5/lorem.txt", {
-    headers:{"Content-Type":"text/plain;charset=utf-8"},
-    body:lorem
-  });
-  T(xhr.status == 201);
-  var rev = JSON.parse(xhr.responseText).rev;
-
-  var xhr = CouchDB.request("GET", "/test_suite_db/bin_doc5/lorem.txt");
-  T(xhr.responseText == lorem);
-  TEqualsIgnoreCase("text/plain;charset=utf-8", xhr.getResponseHeader("Content-Type"));
-
-  // test large inline attachment too
-  var lorem_b64 = CouchDB.request("GET", "/_utils/script/test/lorem_b64.txt").responseText;
-  var doc = db.open("bin_doc5", {attachments:true});
-  T(doc._attachments["lorem.txt"].data == lorem_b64);
-
-  // test etags for attachments.
-  var xhr = CouchDB.request("GET", "/test_suite_db/bin_doc5/lorem.txt");
-  T(xhr.status == 200);
-  var etag = xhr.getResponseHeader("etag");
-  xhr = CouchDB.request("GET", "/test_suite_db/bin_doc5/lorem.txt", {
-    headers: {"if-none-match": etag}
-  });
-  T(xhr.status == 304);
-
-  // test COUCHDB-497 - empty attachments
-  var xhr = CouchDB.request("PUT", "/test_suite_db/bin_doc5/empty.txt?rev="+rev, {
-    headers:{"Content-Type":"text/plain;charset=utf-8", "Content-Length": "0"},
-    body:""
-  });
-  TEquals(201, xhr.status, "should send 201 Accepted");
-  var rev = JSON.parse(xhr.responseText).rev;
-  var xhr = CouchDB.request("PUT", "/test_suite_db/bin_doc5/empty.txt?rev="+rev, {
-    headers:{"Content-Type":"text/plain;charset=utf-8"}
-  });
-  TEquals(201, xhr.status, "should send 201 Accepted");
-
-  // implicit doc creation allows creating docs with a reserved id. COUCHDB-565
-  var xhr = CouchDB.request("PUT", "/test_suite_db/_nonexistant/attachment.txt", {
-    headers: {"Content-Type":"text/plain;charset=utf-8"},
-    body: "THIS IS AN ATTACHMENT. BOOYA!"
-  });
-  TEquals(400, xhr.status, "should return error code 400 Bad Request");
-
-  // test COUCHDB-809 - stubs should only require the 'stub' field
-  var bin_doc6 = {
-    _id: "bin_doc6",
-    _attachments:{
-      "foo.txt": {
-        content_type:"text/plain",
-        data: "VGhpcyBpcyBhIGJhc2U2NCBlbmNvZGVkIHRleHQ="
-      }
-    }
-  };
-  T(db.save(bin_doc6).ok);
-  // stub out the attachment
-  bin_doc6._attachments["foo.txt"] = { stub: true };
-  T(db.save(bin_doc6).ok == true);
-
-  // wrong rev pos specified
-  
-  // stub out the attachment with the wrong revpos
-  bin_doc6._attachments["foo.txt"] = { stub: true, revpos: 10};
-  try {
-      T(db.save(bin_doc6).ok == true);
-      T(false && "Shouldn't get here!");
-  } catch (e) {
-      T(e.error == "missing_stub");
-  }
-
-  // test MD5 header
-  var bin_data = "foo bar"
-  var xhr = CouchDB.request("PUT", "/test_suite_db/bin_doc7/attachment.txt", {
-    headers:{"Content-Type":"application/octet-stream",
-             "Content-MD5":"MntvB0NYESObxH4VRDUycw=="},
-    body:bin_data
-  });
-  TEquals(201, xhr.status);
-
-  var xhr = CouchDB.request("GET", "/test_suite_db/bin_doc7/attachment.txt");
-  TEquals('MntvB0NYESObxH4VRDUycw==', xhr.getResponseHeader("Content-MD5"));
-
-  // test attachment via multipart/form-data
-  var bin_doc8 = {
-    _id: "bin_doc8"
-  };
-  T(db.save(bin_doc8).ok);
-  var doc = db.open("bin_doc8");
-  var body = "------TF\r\n" +
-    "Content-Disposition: form-data; name=\"_rev\"\r\n\r\n" +
-    doc._rev + "\r\n" +
-    "------TF\r\n" +
-    "Content-Disposition: form-data; name=\"_attachments\"; filename=\"file.txt\"\r\n" +
-    "Content-Type: text/plain\r\n\r\n" +
-    "contents of file.txt\r\n\r\n" +
-    "------TF--"
-  xhr = CouchDB.request("POST", "/test_suite_db/bin_doc8", {
-    headers: {
-      "Content-Type": "multipart/form-data; boundary=----TF",
-      "Content-Length": body.length
-    },
-    body: body
-  });
-  TEquals(201, xhr.status);
-  TEquals(true, JSON.parse(xhr.responseText).ok);
-  var doc = db.open("bin_doc8");
-  T(doc._attachments);
-  T(doc._attachments['file.txt']);
-
-};


[26/37] goodbye Futon, old friend <3

Posted by ja...@apache.org.
http://git-wip-us.apache.org/repos/asf/couchdb/blob/cca309f3/share/www/script/futon.browse.js
----------------------------------------------------------------------
diff --git a/share/www/script/futon.browse.js b/share/www/script/futon.browse.js
deleted file mode 100644
index df4e3d8..0000000
--- a/share/www/script/futon.browse.js
+++ /dev/null
@@ -1,1344 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
-(function($) {
-
-  $.toTimeString = function(milliseconds) {
-    var ms, sec, min, h, timeString;
-
-    sec = Math.floor(milliseconds / 1000.0);
-    min = Math.floor(sec / 60.0);
-    sec = (sec % 60.0).toString();
-    if (sec.length < 2) {
-       sec = "0" + sec;
-    }
-
-    h = (Math.floor(min / 60.0)).toString();
-    if (h.length < 2) {
-      h = "0" + h;
-    }
-
-    min = (min % 60.0).toString();
-    if (min.length < 2) {
-      min = "0" + min;
-    }
-
-    timeString = h + ":" + min + ":" + sec;
-
-    ms = (milliseconds % 1000.0).toString();
-    while (ms.length < 3) {
-      ms = "0" + ms;
-    }
-    timeString += "." + ms;
-
-    return timeString;
-  };
-
-  $.futon = $.futon || {};
-  $.extend($.futon, {
-
-    // Page class for browse/index.html
-    CouchIndexPage: function() {
-      page = this;
-
-      $.futon.storage.declare("per_page", {defaultValue: 10});
-
-      this.addDatabase = function() {
-        $.showDialog("dialog/_create_database.html", {
-          submit: function(data, callback) {
-            if (!data.name || data.name.length == 0) {
-              callback({name: "Please enter a name."});
-              return;
-            }
-            $.couch.db(data.name).create({
-              error: function(status, id, reason) { callback({name: reason}) },
-              success: function(resp) {
-                location.href = "database.html?" + encodeURIComponent(data.name);
-                callback();
-              }
-            });
-          }
-        });
-        return false;
-      }
-
-      this.updateDatabaseListing = function(offset) {
-        offset |= 0;
-        var maxPerPage = parseInt($("#perpage").val(), 10);
-
-        $.couch.allDbs({
-          success: function(dbs) {
-            $("#paging a").unbind();
-            $("#databases tbody.content").empty();
-
-            var dbsOnPage = dbs.slice(offset, offset + maxPerPage);
-
-            $.each(dbsOnPage, function(idx, dbName) {
-              $("#databases tbody.content").append("<tr>" +
-                "<th><a href='database.html?" + encodeURIComponent(dbName) + "'>" +
-                  dbName + "</a></th>" +
-                "<td class='size'></td><td class='count'></td>" +
-                "<td class='seq'></td></tr>");
-              $.couch.db(dbName).info({
-                success: function(info) {
-                  $("#databases tbody.content tr:eq(" + idx + ")")
-                    .find("td.size").text($.futon.formatSize(info.disk_size)).end()
-                    .find("td.count").text(info.doc_count).end()
-                    .find("td.seq").text(info.update_seq.split("-")[0]);
-                },
-                error : function() {}
-              });
-            });
-            $("#databases tbody tr:odd").addClass("odd");
-
-            if (offset > 0) {
-              $("#paging a.prev").attr("href", "#" + (offset - maxPerPage)).click(function() {
-                page.updateDatabaseListing(offset - maxPerPage);
-              });
-            } else {
-              $("#paging a.prev").removeAttr("href");
-            }
-            if (offset + maxPerPage < dbs.length) {
-              $("#paging a.next").attr("href", "#" + (offset + maxPerPage)).click(function() {
-                page.updateDatabaseListing(offset + maxPerPage);
-              });
-            } else {
-              $("#paging a.next").removeAttr("href");
-            }
-
-            var firstNum = offset + 1;
-            var lastNum = firstNum + dbsOnPage.length - 1;
-            $("#databases tbody.footer tr td span").text(
-              "Showing " + firstNum + "-" + lastNum + " of " + dbs.length +
-              " databases");
-          }
-        });
-      }
-
-    },
-
-    // Page class for browse/database.html
-    CouchDatabasePage: function() {
-      var urlParts = location.search.substr(1).split("/");
-      var dbName = decodeURIComponent(urlParts.shift())
-
-      var dbNameRegExp = new RegExp("[^a-z0-9.\_\$\(\)\+\/\-]", "g");
-      dbName = dbName.replace(dbNameRegExp, "");
-
-      $.futon.storage.declareWithPrefix(dbName + ".", {
-        desc: {},
-        language: {defaultValue: "javascript"},
-        map_fun: {defaultValue: ""},
-        reduce_fun: {defaultValue: ""},
-        reduce: {},
-        group_level: {defaultValue: 100},
-        per_page: {defaultValue: 10},
-        view: {defaultValue: ""},
-        stale: {defaultValue: false}
-      });
-
-      var viewName = (urlParts.length > 0) ? urlParts.join("/") : null;
-      if (viewName) {
-        $.futon.storage.set("view", decodeURIComponent(viewName));
-      } else {
-        viewName = $.futon.storage.get("view");
-        if (viewName) {
-          this.redirecting = true;
-          location.href = "database.html?" + encodeURIComponent(dbName) +
-            "/" + encodeURIComponent(viewName);
-        }
-      }
-      var db = $.couch.db(dbName);
-
-      this.dbName = dbName;
-      viewName = decodeURIComponent(viewName);
-      this.viewName = viewName;
-      this.viewLanguage = "javascript";
-      this.db = db;
-      this.isDirty = false;
-      this.isTempView = viewName == "_temp_view";
-      page = this;
-
-      var templates = {
-        javascript: "function(doc) {\n  emit(null, doc);\n}",
-        python: "def fun(doc):\n  yield None, doc",
-        ruby: "lambda {|doc|\n  emit(nil, doc);\n}"
-      }
-
-      this.newDocument = function() {
-        location.href = "document.html?" + encodeURIComponent(db.name);
-      }
-
-      this.compactAndCleanup = function() {
-        $.showDialog("dialog/_compact_cleanup.html", {
-          submit: function(data, callback) {
-            switch (data.action) {
-              case "compact_database":
-                db.compact({success: function(resp) { callback() }});
-                break;
-              case "compact_views":
-                var idx = page.viewName.indexOf("/_view");
-                if (idx == -1) {
-                    alert("Compact Views requires focus on a view!");
-                } else {
-                    var groupname = page.viewName.substring(8, idx);
-                    db.compactView(groupname, {success: function(resp) { callback() }});
-                }
-                break;
-              case "view_cleanup":
-                db.viewCleanup({success: function(resp) { callback() }});
-                break;
-            }
-          }
-        });
-      }
-
-      this.deleteDatabase = function() {
-        $.showDialog("dialog/_delete_database.html", {
-          submit: function(data, callback) {
-            db.drop({
-              success: function(resp) {
-                callback();
-                location.href = "index.html";
-                if (window !== null) {
-                  $("#dbs li").filter(function(index) {
-                    return $("a", this).text() == dbName;
-                  }).remove();
-                  $.futon.navigation.removeDatabase(dbName);
-                }
-              }
-            });
-          }
-        });
-      }
-
-      this.databaseSecurity = function() {
-        function namesAndRoles(r, key) {
-          var names = [];
-          var roles = [];
-          if (r && typeof r[key + "s"] === "object") {
-            if ($.isArray(r[key + "s"]["names"])) {
-              names = r[key + "s"]["names"];
-            }
-            if ($.isArray(r[key + "s"]["roles"])) {
-              roles = r[key + "s"]["roles"];
-            }
-          }
-          return {names : names, roles: roles};
-        };
-
-        $.showDialog("dialog/_database_security.html", {
-          load : function(d) {
-            db.getDbProperty("_security", {
-              success: function(r) {
-                var admins = namesAndRoles(r, "admin")
-                  , members = namesAndRoles(r, "member");
-                if (members.names.length + members.roles.length == 0) {
-                  // backwards compatibility with readers for 1.x
-                  members = namesAndRoles(r, "reader");
-                }
-                $("input[name=admin_names]", d).val(JSON.stringify(admins.names));
-                $("input[name=admin_roles]", d).val(JSON.stringify(admins.roles));
-                $("input[name=member_names]", d).val(JSON.stringify(members.names));
-                $("input[name=member_roles]", d).val(JSON.stringify(members.roles));
-              }
-            });
-          },
-          // maybe this should be 2 forms
-          submit: function(data, callback) {
-            var errors = {};
-            var secObj = {
-              admins: {
-                names: [],
-                roles: []
-              },
-              members: {
-                names: [],
-                roles: []
-              }
-            };
-
-            ["admin", "member"].forEach(function(key) {
-              var names, roles;
-
-              try {
-                names = JSON.parse(data[key + "_names"]);
-              } catch(e) { }
-              try {
-                roles = JSON.parse(data[key + "_roles"]);
-              } catch(e) { }
-
-              if ($.isArray(names)) {
-                secObj[key + "s"]["names"] = names;
-              } else {
-                errors[key + "_names"] = "The " + key +
-                  " names must be an array of strings";
-              }
-              if ($.isArray(roles)) {
-                secObj[key + "s"]["roles"] = roles;
-              } else {
-                errors[key + "_roles"] = "The " + key +
-                  " roles must be an array of strings";
-              }
-            });
-
-            if ($.isEmptyObject(errors)) {
-              db.setDbProperty("_security", secObj);
-            }
-            callback(errors);
-          }
-        });
-      }
-
-      this.populateViewEditor = function() {
-        if (viewName.match(/^_design\//)) {
-          page.revertViewChanges(function() {
-            var dirtyTimeout = null;
-            function updateDirtyState() {
-              clearTimeout(dirtyTimeout);
-              dirtyTimeout = setTimeout(function() {
-                var buttons = $("#viewcode button.save, #viewcode button.revert");
-                var viewCode = {
-                  map: $("#viewcode_map").val(),
-                  reduce: $("#viewcode_reduce").val()
-                };
-                $("#reduce, #grouplevel").toggle(!!viewCode.reduce);
-                page.isDirty = (viewCode.map != page.storedViewCode.map)
-                  || (viewCode.reduce != (page.storedViewCode.reduce || ""))
-                  || page.viewLanguage != page.storedViewLanguage;
-                if (page.isDirty) {
-                  buttons.removeAttr("disabled");
-                } else {
-                  buttons.attr("disabled", "disabled");
-                }
-              }, 100);
-            }
-            $("#viewcode textarea").enableTabInsertion()
-              .bind("input", updateDirtyState);
-            if ($.browser.msie || $.browser.safari) {
-              $("#viewcode textarea").bind("paste", updateDirtyState)
-                                     .bind("change", updateDirtyState)
-                                     .bind("keydown", updateDirtyState)
-                                     .bind("keypress", updateDirtyState)
-                                     .bind("keyup", updateDirtyState)
-                                     .bind("textInput", updateDirtyState);
-            }
-            $("#language").change(updateDirtyState);
-            page.updateDocumentListing();
-          });
-        } else if (viewName == "_temp_view") {
-          $("#viewcode textarea").enableTabInsertion();
-          page.viewLanguage = $.futon.storage.get("language");
-          page.updateViewEditor(
-            $.futon.storage.get("map_fun", templates[page.viewLanguage]),
-            $.futon.storage.get("reduce_fun")
-          );
-        } else {
-          $("#grouplevel, #reduce").hide();
-          page.updateDocumentListing();
-        }
-        page.populateLanguagesMenu();
-        if (this.isTempView) {
-          $("#tempwarn").show();
-        }
-      }
-
-      // Populate the languages dropdown, and listen to selection changes
-      this.populateLanguagesMenu = function() {
-        var all_langs = {};
-        fill_language = function() {
-          var select = $("#language");
-          for (var language in all_langs) {
-            var option = $(document.createElement("option"))
-              .attr("value", language).text(language)
-              .appendTo(select);
-          }
-          if (select[0].options.length == 1) {
-            select[0].disabled = true;
-          } else {
-            select[0].disabled = false;
-            select.val(page.viewLanguage);
-            select.change(function() {
-              var language = $("#language").val();
-              if (language != page.viewLanguage) {
-                var mapFun = $("#viewcode_map").val();
-                if (mapFun == "" || mapFun == templates[page.viewLanguage]) {
-                  // no edits made, so change to the new default
-                  $("#viewcode_map").val(templates[language]);
-                }
-                page.viewLanguage = language;
-                $("#viewcode_map")[0].focus();
-              }
-              return false;
-            });
-          }
-        }
-        $.couch.config({
-          success: function(resp) {
-            for (var language in resp) {
-              all_langs[language] = resp[language];
-            }
-
-            $.couch.config({
-              success: function(resp) {
-                for (var language in resp) {
-                  all_langs[language] = resp[language];
-                }
-                fill_language();
-              }
-            }, "native_query_servers");
-          },
-          error : function() {}
-        }, "query_servers");
-      }
-
-      this.populateViewsMenu = function() {
-        var select = $("#switch select");
-        db.allDocs({startkey: "_design/", endkey: "_design0",
-          include_docs: true,
-          success: function(resp) {
-            select[0].options.length = 3;
-            for (var i = 0; i < resp.rows.length; i++) {
-              var doc = resp.rows[i].doc;
-              var optGroup = $(document.createElement("optgroup"))
-                .attr("label", doc._id.substr(8)).appendTo(select);
-              var viewNames = [];
-              for (var name in doc.views) {
-                viewNames.push(name);
-              }
-              viewNames.sort();
-              for (var j = 0; j < viewNames.length; j++) {
-                var path = $.couch.encodeDocId(doc._id) + "/_view/" +
-                  encodeURIComponent(viewNames[j]);
-                var option = $(document.createElement("option"))
-                  .attr("value", path).text(encodeURIComponent(viewNames[j]))
-                  .appendTo(optGroup);
-                if (path == viewName) {
-                  option[0].selected = true;
-                }
-              }
-            }
-          }
-        });
-        if (!viewName.match(/^_design\//)) {
-          $.each(["_all_docs", "_design_docs", "_temp_view"], function(idx, name) {
-            if (viewName == name) {
-              select[0].options[idx].selected = true;
-            }
-          });
-        }
-      }
-
-      this.revertViewChanges = function(callback) {
-        if (!page.storedViewCode) {
-          var viewNameParts = viewName.split("/");
-          var designDocId = decodeURIComponent(viewNameParts[1]);
-          var localViewName = decodeURIComponent(viewNameParts[3]);
-          db.openDoc("_design/" + designDocId, {
-            error: function(status, error, reason) {
-              if (status == 404) {
-                $.futon.storage.del("view");
-                location.href = "database.html?" + encodeURIComponent(db.name);
-              }
-            },
-            success: function(resp) {
-              if(!resp.views || !resp.views[localViewName]) {
-                $.futon.storage.del("view");
-                location.href = "database.html?" + encodeURIComponent(db.name);
-              }
-              var viewCode = resp.views[localViewName];
-              page.viewLanguage = resp.language || "javascript";
-              $("#language").val(encodeURIComponent(page.viewLanguage));
-              page.updateViewEditor(viewCode.map, viewCode.reduce || "");
-              $("#viewcode button.revert, #viewcode button.save").attr("disabled", "disabled");
-              page.storedViewCode = viewCode;
-              page.storedViewLanguage = page.viewLanguage;
-              if (callback) callback();
-            }
-          }, {async: false});
-        } else {
-          page.updateViewEditor(page.storedViewCode.map,
-            page.storedViewCode.reduce || "");
-          page.viewLanguage = page.storedViewLanguage;
-          $("#language").val(encodeURIComponent(page.viewLanguage));
-          $("#viewcode button.revert, #viewcode button.save").attr("disabled", "disabled");
-          page.isDirty = false;
-          if (callback) callback();
-        }
-      }
-
-      this.updateViewEditor = function(mapFun, reduceFun) {
-        if (!mapFun) return;
-        $("#viewcode_map").val(mapFun);
-        $("#viewcode_reduce").val(reduceFun);
-        var lines = Math.max(
-          mapFun.split("\n").length,
-          reduceFun.split("\n").length
-        );
-        $("#reduce, #grouplevel").toggle(!!reduceFun);
-        $("#viewcode textarea").attr("rows", Math.min(15, Math.max(3, lines)));
-      }
-
-      this.saveViewAs = function() {
-        if (viewName && /^_design/.test(viewName)) {
-          var viewNameParts = viewName.split("/");
-          var designDocId = decodeURIComponent(viewNameParts[1]);
-          var localViewName = decodeURIComponent(viewNameParts[3]);
-        } else {
-          var designDocId = "", localViewName = "";
-        }
-        $.showDialog("dialog/_save_view_as.html", {
-          load: function(elem) {
-            $("#input_docid", elem).val(designDocId).suggest(function(text, callback) {
-              db.allDocs({
-                limit: 10, startkey: "_design/" + text, endkey: "_design0",
-                success: function(docs) {
-                  var matches = [];
-                  for (var i = 0; i < docs.rows.length; i++) {
-                    var docName = docs.rows[i].id.substr(8);
-                    if (docName.indexOf(text) == 0) {
-                      matches[i] = docName;
-                    }
-                  }
-                  callback(matches);
-                }
-              });
-            });
-            $("#input_name", elem).val(localViewName).suggest(function(text, callback) {
-              db.openDoc("_design/" + $("#input_docid").val(), {
-                error: function() {}, // ignore
-                success: function(doc) {
-                  var matches = [];
-                  if (!doc.views) return;
-                  for (var viewName in doc.views) {
-                    if (viewName.indexOf(text) == 0) {
-                      matches.push(viewName);
-                    }
-                  }
-                  callback(matches);
-                }
-              });
-            });
-          },
-          submit: function(data, callback) {
-            if (!data.docid || !data.name) {
-              var errors = {};
-              if (!data.docid) errors.docid = "Please enter a document ID";
-              if (!data.name) errors.name = "Please enter a view name";
-              callback(errors);
-            } else {
-              var viewCode = {
-                map: $("#viewcode_map").val(),
-                reduce: $("#viewcode_reduce").val() || undefined
-              };
-              var docId = ["_design", data.docid].join("/");
-              function save(doc) {
-                if (!doc) {
-                  doc = {_id: docId, language: page.viewLanguage};
-                } else {
-                  var numViews = 0;
-                  for (var viewName in (doc.views || {})) {
-                    if (viewName != data.name) numViews++;
-                  }
-                  if (numViews > 0 && page.viewLanguage != doc.language) {
-                    callback({
-                      docid: "Cannot save to " + data.docid +
-                             " because its language is \"" + doc.language +
-                             "\", not \"" +
-                             encodeURIComponent(page.viewLanguage) + "\"."
-                    });
-                    return;
-                  }
-                  doc.language = page.viewLanguage;
-                }
-                if (doc.views === undefined) doc.views = {};
-                doc.views[data.name] = viewCode;
-                db.saveDoc(doc, {
-                  success: function(resp) {
-                    callback();
-                    page.isDirty = false;
-                    location.href = "database.html?" + encodeURIComponent(dbName) +
-                      "/" + $.couch.encodeDocId(doc._id) +
-                      "/_view/" + encodeURIComponent(data.name);
-                  },
-                  error: function(status, error, reason) {
-                    alert("Error: " + error + "\n\n" + reason);
-                  }
-                });
-              }
-              db.openDoc(docId, {
-                error: function(status, error, reason) {
-                  if (status == 404) save(null);
-                  else alert("Error: " + error + "\n\n" + reason);
-                },
-                success: function(doc) {
-                  save(doc);
-                }
-              });
-            }
-          }
-        });
-      }
-
-      this.saveViewChanges = function() {
-        var viewNameParts = viewName.split("/");
-        var designDocId = decodeURIComponent(viewNameParts[1]);
-        var localViewName = decodeURIComponent(viewNameParts[3]);
-        db.openDoc("_design/" + designDocId, {
-          success: function(doc) {
-            var numViews = 0;
-            for (var viewName in (doc.views || {})) {
-              if (viewName != localViewName) numViews++;
-            }
-            if (numViews > 0 && page.viewLanguage != doc.language) {
-              alert("Cannot save view because the design document language " +
-                    "is \"" + doc.language + "\", not \"" +
-                    page.viewLanguage + "\".");
-              return;
-            }
-            doc.language = page.viewLanguage;
-            var viewDef = doc.views[localViewName];
-            viewDef.map = $("#viewcode_map").val();
-            viewDef.reduce = $("#viewcode_reduce").val() || undefined;
-            db.saveDoc(doc, {
-              success: function(resp) {
-                page.isDirty = false;
-                page.storedViewCode = viewDef;
-                $("#viewcode button.revert, #viewcode button.save")
-                  .attr("disabled", "disabled");
-              },
-              error: function(status, error, reason) {
-                alert("Error: " + error + "\n\n" + reason);
-              }
-            });
-          }
-        });
-      }
-
-      this.updateDesignDocLink = function() {
-        if (viewName && /^_design/.test(viewName)) {
-          var docId = "_design/" + encodeURIComponent(decodeURIComponent(viewName).split("/")[1]);
-          $("#designdoc-link").attr("href", "document.html?" +
-            encodeURIComponent(dbName) + "/" + $.couch.encodeDocId(docId)).text(docId);
-        } else {
-          $("#designdoc-link").removeAttr("href").text("");
-        }
-      }
-
-      this.jumpToDocument = function(docId) {
-        if (docId != "") {
-          location.href = 'document.html?' + encodeURIComponent(db.name)
-            + "/" + $.couch.encodeDocId(docId);
-        }
-      }
-
-      this.updateDocumentListing = function(options) {
-        if (options === undefined) options = {};
-        if (options.limit === undefined) {
-          var perPage = parseInt($("#perpage").val(), 10)
-          // Fetch an extra row so we know when we're on the last page for
-          // reduce views
-          options.limit = perPage + 1;
-        } else {
-          perPage = options.limit - 1;
-        }
-        if ($("#documents thead th.key").is(".desc")) {
-          if (typeof options.descending == 'undefined') options.descending = true;
-          var descend = true;
-          $.futon.storage.set("desc", "1");
-        } else {
-          var descend = false;
-          $.futon.storage.del("desc");
-        }
-        $("#paging a").unbind();
-        $("#documents").find("tbody.content").empty().end().show();
-        page.updateDesignDocLink();
-
-        options.success = function(resp, requestDuration) {
-          if (resp.offset === undefined) {
-            resp.offset = 0;
-          }
-          var descending_reverse = ((options.descending && !descend) || (descend && (options.descending === false)));
-          var has_reduce_prev = resp.total_rows === undefined && (descending_reverse ? resp.rows.length > perPage : options.startkey !== undefined);
-          if (descending_reverse && resp.rows) {
-            resp.rows = resp.rows.reverse();
-            if (resp.rows.length > perPage) {
-              resp.rows.push(resp.rows.shift());
-            }
-          }
-          if (resp.rows !== null && (has_reduce_prev || (descending_reverse ?
-            (resp.total_rows - resp.offset > perPage) :
-            (resp.offset > 0)))) {
-            $("#paging a.prev").attr("href", "#" + (resp.offset - perPage)).click(function() {
-              var opt = {
-                descending: !descend,
-                limit: options.limit
-              };
-              if (resp.rows.length > 0) {
-                var firstDoc = resp.rows[0];
-                opt.startkey = firstDoc.key !== undefined ? firstDoc.key : null;
-                if (firstDoc.id !== undefined) {
-                  opt.startkey_docid = firstDoc.id;
-                }
-                opt.skip = 1;
-              }
-              page.updateDocumentListing(opt);
-              return false;
-            });
-          } else {
-            $("#paging a.prev").removeAttr("href");
-          }
-          var has_reduce_next = resp.total_rows === undefined && (descending_reverse ? options.startkey !== undefined : resp.rows.length > perPage);
-          if (resp.rows !== null && (has_reduce_next || (descending_reverse ?
-            (resp.offset - resp.total_rows < perPage) :
-            (resp.total_rows - resp.offset > perPage)))) {
-            $("#paging a.next").attr("href", "#" + (resp.offset + perPage)).click(function() {
-              var opt = {
-                descending: descend,
-                limit: options.limit
-              };
-              if (resp.rows.length > 0) {
-                var lastDoc = resp.rows[Math.min(perPage, resp.rows.length) - 1];
-                opt.startkey = lastDoc.key !== undefined ? lastDoc.key : null;
-                if (lastDoc.id !== undefined) {
-                  opt.startkey_docid = lastDoc.id;
-                }
-                opt.skip = 1;
-              }
-              page.updateDocumentListing(opt);
-              return false;
-            });
-          } else {
-            $("#paging a.next").removeAttr("href");
-          }
-
-          for (var i = 0; i < Math.min(perPage, resp.rows.length); i++) {
-            var row = resp.rows[i];
-            var tr = $("<tr></tr>");
-            var key = "null";
-            if (row.key !== null) {
-              key = $.futon.formatJSON(row.key, {indent: 0, linesep: ""});
-            }
-            if (row.id) {
-              key = key.replace(/\\"/, '"');
-              var rowlink = encodeURIComponent(db.name) +
-                "/" + $.couch.encodeDocId(row.id);
-              $("<td class='key'><a href=\"document.html?" + rowlink + "\"><strong>"
-                 + $.futon.escape(key) + "</strong><br>"
-                 + "<span class='docid'>ID:&nbsp;" + $.futon.escape(row.id) + "</span></a></td>")
-                .appendTo(tr);
-            } else {
-              $("<td class='key'><strong></strong></td>")
-                .find("strong").text(key).end()
-                .appendTo(tr);
-            }
-            var value = "null";
-            if (row.value !== null) {
-              value = $.futon.formatJSON(row.value, {
-                html: true, indent: 0, linesep: "", quoteKeys: false
-              });
-            }
-            $("<td class='value'><div></div></td>").find("div").html(value).end()
-              .appendTo(tr).dblclick(function() {
-                location.href = this.previousSibling.firstChild.href;
-              });
-            tr.appendTo("#documents tbody.content");
-          }
-          var firstNum = 1;
-          var lastNum = totalNum = Math.min(perPage, resp.rows.length);
-          if (resp.total_rows != null) {
-            if (descending_reverse) {
-              lastNum = Math.min(resp.total_rows, resp.total_rows - resp.offset);
-              firstNum = lastNum - totalNum + 1;
-            } else {
-              firstNum = Math.min(resp.total_rows, resp.offset + 1);
-              lastNum = firstNum + totalNum - 1;
-            }
-            totalNum = resp.total_rows;
-          } else {
-            totalNum = "unknown";
-          }
-          $("#paging").show();
-
-          $("#documents tbody.footer td span").text(
-            "Showing " + firstNum + "-" + lastNum + " of " + totalNum +
-            " row" + (firstNum != lastNum || totalNum == "unknown" ? "s" : ""));
-          $("#documents tbody tr:odd").addClass("odd");
-
-          if (viewName && viewName !== "_all_docs" && viewName !== "_design_docs") {
-            $("#viewrequestduration").show();
-            $("#viewrequestduration .timestamp").text($.toTimeString(requestDuration));
-          }
-        }
-        options.error = function(status, error, reason) {
-          alert("Error: " + error + "\n\n" + reason);
-        }
-
-        if (!viewName || viewName == "_all_docs") {
-          $("#switch select")[0].selectedIndex = 0;
-          db.allDocs(options);
-        } else {
-          if (viewName == "_temp_view") {
-            $("#viewcode").show().removeClass("collapsed");
-            var mapFun = $("#viewcode_map").val();
-            $.futon.storage.set("map_fun", mapFun);
-            var reduceFun = $.trim($("#viewcode_reduce").val()) || null;
-            if (reduceFun) {
-              $.futon.storage.set("reduce_fun", reduceFun);
-              if ($("#reduce :checked").length) {
-                var level = parseInt($("#grouplevel select").val(), 10);
-                options.group = level > 0;
-                if (options.group && level < 100) {
-                  options.group_level = level;
-                }
-              } else {
-                options.reduce = false;
-              }
-            }
-            $.futon.storage.set("language", page.viewLanguage);
-            db.query(mapFun, reduceFun, page.viewLanguage, options);
-          } else if (viewName == "_design_docs") {
-            options.startkey = options.descending ? "_design0" : "_design";
-            options.endkey = options.descending ? "_design" : "_design0";
-            db.allDocs(options);
-          } else {
-            $("button.compactview").show();
-            $("#viewcode").show();
-            var currentMapCode = $("#viewcode_map").val();
-            var currentReduceCode = $.trim($("#viewcode_reduce").val()) || null;
-            if (currentReduceCode) {
-              if ($("#reduce :checked").length) {
-                var level = parseInt($("#grouplevel select").val(), 10);
-                options.group = level > 0;
-                if (options.group && level < 100) {
-                  options.group_level = level;
-                }
-              } else {
-                options.reduce = false;
-              }
-            }
-            if (page.isDirty) {
-              db.query(currentMapCode, currentReduceCode, page.viewLanguage, options);
-            } else {
-              var viewParts = decodeURIComponent(viewName).split('/');
-              if ($.futon.storage.get("stale")) {
-                 options.stale = "ok";
-              }
-
-              db.view(viewParts[1] + "/" + viewParts[3], options);
-            }
-          }
-        }
-      }
-
-      window.onbeforeunload = function() {
-        $("#switch select").val(viewName);
-        if (page.isDirty) {
-          return "You've made changes to the view code that have not been " +
-                 "saved yet.";
-        }
-      }
-
-    },
-
-    // Page class for browse/document.html
-    CouchDocumentPage: function() {
-      var urlParts = location.search.substr(1).split("/");
-      var dbName = decodeURIComponent(urlParts.shift());
-      if (urlParts.length) {
-        var idParts = urlParts.join("/").split("@", 2);
-        var docId = decodeURIComponent(idParts[0]);
-        var docRev = (idParts.length > 1) ? idParts[1] : null;
-        this.isNew = false;
-      } else {
-        var docId = $.couch.newUUID();
-        var docRev = null;
-        this.isNew = true;
-      }
-      var db = $.couch.db(dbName);
-
-      $.futon.storage.declare("tab", {defaultValue: "tabular", scope: "cookie"});
-
-      this.dbName = dbName;
-      this.db = db;
-      this.docId = docId;
-      this.doc = null;
-      this.isDirty = this.isNew;
-      page = this;
-
-      this.activateTabularView = function() {
-        if ($("#fields tbody.source textarea").length > 0)
-          return;
-
-        $.futon.storage.set("tab", "tabular");
-        $("#tabs li").removeClass("active").filter(".tabular").addClass("active");
-        $("#fields thead th:first").text("Field").attr("colspan", 1).next().show();
-        $("#fields tbody.content").show();
-        $("#fields tbody.source").hide();
-        return false;
-      }
-
-      this.activateSourceView = function() {
-        $.futon.storage.set("tab", "source");
-        $("#tabs li").removeClass("active").filter(".source").addClass("active");
-        $("#fields thead th:first").text("Source").attr("colspan", 2).next().hide();
-        $("#fields tbody.content").hide();
-        $("#fields tbody.source").find("td").each(function() {
-          $(this).html($("<pre></pre>").html($.futon.formatJSON(page.doc, {html: true})))
-            .makeEditable({allowEmpty: false,
-              createInput: function(value) {
-                var rows = value.split("\n").length;
-                return $("<textarea rows='" + rows + "' cols='80' spellcheck='false'></textarea>").enableTabInsertion();
-              },
-              prepareInput: function(input) {
-                $(input).makeResizable({vertical: true});
-              },
-              end: function() {
-                $(this).html($("<pre></pre>").html($.futon.formatJSON(page.doc, {html: true})));
-              },
-              accept: function(newValue) {
-                page.doc = JSON.parse(newValue);
-                page.isDirty = true;
-                page.updateFieldListing(true);
-              },
-              populate: function(value) {
-                return $.futon.formatJSON(page.doc);
-              },
-              validate: function(value) {
-                try {
-                  var doc = JSON.parse(value);
-                  if (typeof doc != "object")
-                    throw new SyntaxError("Please enter a valid JSON document (for example, {}).");
-                  return true;
-                } catch (err) {
-                  var msg = err.message;
-                  if (msg == "parseJSON" || msg == "JSON.parse") {
-                    msg = "There is a syntax error in the document.";
-                  }
-                  $("<div class='error'></div>").text(msg).appendTo(this);
-                  return false;
-                }
-              }
-            });
-        }).end().show();
-        return false;
-      }
-
-      this.addField = function() {
-        if (!$("#fields tbody.content:visible").length) {
-          location.hash = "#tabular";
-          page.activateTabularView();
-        }
-        var fieldName = "unnamed";
-        var fieldIdx = 1;
-        while (page.doc.hasOwnProperty(fieldName)) {
-          fieldName = "unnamed " + fieldIdx++;
-        }
-        page.doc[fieldName] = null;
-        var row = _addRowForField(page.doc, fieldName);
-        page.isDirty = true;
-        row.find("th b").dblclick();
-      }
-
-      var _sortFields = function(a, b) {
-        var a0 = a.charAt(0), b0 = b.charAt(0);
-        if (a0 == "_" && b0 != "_") {
-          return -1;
-        } else if (a0 != "_" && b0 == "_") {
-          return 1;
-        } else if (a == "_attachments" || b == "_attachments") {
-          return a0 == "_attachments" ? 1 : -1;
-        } else {
-          return a < b ? -1 : a != b ? 1 : 0;
-        }
-      }
-
-      this.updateFieldListing = function(noReload) {
-        $("#fields tbody.content").empty();
-
-        function handleResult(doc, revs) {
-          page.doc = doc;
-          var propNames = [];
-          for (var prop in doc) {
-            propNames.push(prop);
-          }
-          // Order properties alphabetically, but put internal fields first
-          propNames.sort(_sortFields);
-          for (var pi = 0; pi < propNames.length; pi++) {
-            _addRowForField(doc, propNames[pi]);
-          }
-          if (revs.length > 1) {
-            var currentIndex = 0;
-            for (var i = 0; i < revs.length; i++) {
-              if (revs[i].rev == doc._rev) {
-                currentIndex = i;
-                break;
-              }
-            }
-            if (currentIndex < revs.length - 1) {
-              var prevRev = revs[currentIndex + 1].rev;
-              $("#paging a.prev").attr("href", "?" + encodeURIComponent(dbName) +
-                "/" + $.couch.encodeDocId(docId) + "@" + prevRev);
-            }
-            if (currentIndex > 0) {
-              var nextRev = revs[currentIndex - 1].rev;
-              $("#paging a.next").attr("href", "?" + encodeURIComponent(dbName) +
-                "/" + $.couch.encodeDocId(docId) + "@" + nextRev);
-            }
-            $("#fields tbody.footer td span").text("Showing revision " +
-              (revs.length - currentIndex) + " of " + revs.length);
-          }
-          if ($.futon.storage.get("tab") == "source") {
-            page.activateSourceView();
-          }
-        }
-
-        if (noReload) {
-          handleResult(page.doc, []);
-          return;
-        }
-
-        if (!page.isNew) {
-          db.openDoc(docId, {revs_info: true,
-            error: function(status, error, reason) {
-              alert("Error: " + error + "\n\n" + reason);
-            },
-            success: function(doc) {
-              var revs = doc._revs_info || [];
-              delete doc._revs_info;
-              if (docRev != null) {
-                db.openDoc(docId, {rev: docRev,
-                  error: function(status, error, reason) {
-                    alert("The requested revision was not found. You will " +
-                          "be redirected back to the latest revision.");
-                    location.href = "?" + encodeURIComponent(dbName) +
-                      "/" + $.couch.encodeDocId(docId);
-                  },
-                  success: function(doc) {
-                    handleResult(doc, revs);
-                  }
-                });
-              } else {
-                handleResult(doc, revs);
-              }
-            }
-          });
-        } else {
-          handleResult({_id: docId}, []);
-          $("#fields tbody td").dblclick();
-        }
-      }
-
-      this.deleteDocument = function() {
-        $.showDialog("dialog/_delete_document.html", {
-          submit: function(data, callback) {
-            db.removeDoc(page.doc, {
-              success: function(resp) {
-                callback();
-                location.href = "database.html?" + encodeURIComponent(dbName);
-              }
-            });
-          }
-        });
-      }
-
-      this.saveDocument = function() {
-        db.saveDoc(page.doc, {
-          error: function(status, error, reason) {
-            alert("Error: " + error + "\n\n" + reason);
-          },
-          success: function(resp) {
-            page.isDirty = false;
-            location.href = "?" + encodeURIComponent(dbName) +
-              "/" + $.couch.encodeDocId(resp.id);
-          }
-        });
-      }
-
-      this.uploadAttachment = function() {
-        if (page.isDirty) {
-          alert("You need to save or revert any changes you have made to the " +
-                "document before you can attach a new file.");
-          return false;
-        }
-        $.showDialog("dialog/_upload_attachment.html", {
-          load: function(elem) {
-            $("input[name='_rev']", elem).val(page.doc._rev);
-          },
-          submit: function(data, callback) {
-            if (!data._attachments || data._attachments.length == 0) {
-              callback({_attachments: "Please select a file to upload."});
-              return;
-            }
-            var form = $("#upload-form");
-            form.find("#progress").css("visibility", "visible");
-            form.ajaxSubmit({
-              url: db.uri + $.couch.encodeDocId(page.docId),
-              success: function(resp) {
-                form.find("#progress").css("visibility", "hidden");
-                page.isDirty = false;
-                location.href = "?" + encodeURIComponent(dbName) +
-                  "/" + $.couch.encodeDocId(page.docId);
-              }
-            });
-          }
-        });
-      }
-
-      window.onbeforeunload = function() {
-        if (page.isDirty) {
-          return "You've made changes to this document that have not been " +
-                 "saved yet.";
-        }
-      }
-
-      function _addRowForField(doc, fieldName) {
-        var row = $("<tr><th></th><td></td></tr>")
-          .find("th").append($("<b></b>").text(fieldName)).end()
-          .appendTo("#fields tbody.content");
-        if (fieldName == "_attachments") {
-          row.find("td").append(_renderAttachmentList(doc[fieldName]));
-        } else {
-          row.find("td").append(_renderValue(doc[fieldName]));
-          _initKey(doc, row, fieldName);
-          _initValue(doc, row, fieldName);
-        }
-        $("#fields tbody.content tr").removeClass("odd").filter(":odd").addClass("odd");
-        row.data("name", fieldName);
-        return row;
-      }
-
-      function _initKey(doc, row, fieldName) {
-        if (fieldName == "_id" || fieldName == "_rev") {
-          return;
-        }
-
-        var cell = row.find("th");
-
-        $("<button type='button' class='delete' title='Delete field'></button>").click(function() {
-          delete doc[fieldName];
-          row.remove();
-          page.isDirty = true;
-          $("#fields tbody.content tr").removeClass("odd").filter(":odd").addClass("odd");
-        }).prependTo(cell);
-
-        cell.find("b").makeEditable({allowEmpty: false,
-          accept: function(newName, oldName) {
-            doc[newName] = doc[oldName];
-            delete doc[oldName];
-            row.data("name", newName);
-            $(this).text(newName);
-            page.isDirty = true;
-          },
-          begin: function() {
-            row.find("th button.delete").hide();
-            return true;
-          },
-          end: function(keyCode) {
-            row.find("th button.delete").show();
-            if (keyCode == 9) { // tab, move to editing the value
-              row.find("td").dblclick();
-            }
-          },
-          validate: function(newName, oldName) {
-            $("div.error", this).remove();
-            if (newName != oldName && doc[newName] !== undefined) {
-              $("<div class='error'>Already have field with that name.</div>")
-                .appendTo(this);
-              return false;
-            }
-            return true;
-          }
-        });
-      }
-
-      function _initValue(doc, row, fieldName) {
-        if ((fieldName == "_id" && !page.isNew) || fieldName == "_rev") {
-          return;
-        }
-
-        row.find("td").makeEditable({acceptOnBlur: false, allowEmpty: true,
-          createInput: function(value) {
-            value = doc[row.data("name")];
-            var elem = $(this);
-            if (elem.find("dl").length > 0 ||
-                elem.find("code").is(".array, .object") ||
-                typeof(value) == "string" && (value.length > 60 || value.match(/\n/))) {
-              return $("<textarea rows='1' cols='40' spellcheck='false'></textarea>");
-            }
-            return $("<input type='text' spellcheck='false'>");
-          },
-          end: function() {
-            $(this).children().remove();
-            $(this).append(_renderValue(doc[row.data("name")]));
-          },
-          prepareInput: function(input) {
-            if ($(input).is("textarea")) {
-              var height = Math.min(input.scrollHeight, document.body.clientHeight - 100);
-              $(input).height(height).makeResizable({vertical: true}).enableTabInsertion();
-            }
-          },
-          accept: function(newValue) {
-            var fieldName = row.data("name");
-            try {
-              doc[fieldName] = JSON.parse(newValue);
-            } catch (err) {
-              doc[fieldName] = newValue;
-            }
-            page.isDirty = true;
-            if (fieldName == "_id") {
-              page.docId = page.doc._id = doc[fieldName];
-              $("h1 strong").text(page.docId);
-            }
-          },
-          populate: function(value) {
-            value = doc[row.data("name")];
-            if (typeof(value) == "string") {
-              return value;
-            }
-            return $.futon.formatJSON(value);
-          },
-          validate: function(value) {
-            $("div.error", this).remove();
-            try {
-              var parsed = JSON.parse(value);
-              if (row.data("name") == "_id" && typeof(parsed) != "string") {
-                $("<div class='error'>The document ID must be a string.</div>")
-                  .appendTo(this);
-                return false;
-              }
-              return true;
-            } catch (err) {
-              return true;
-            }
-          }
-        });
-      }
-
-      function _renderValue(value) {
-        function isNullOrEmpty(val) {
-          if (val == null) return true;
-          for (var i in val) return false;
-          return true;
-        }
-        function render(val) {
-          var type = typeof(val);
-          if (type == "object" && !isNullOrEmpty(val)) {
-            var list = $("<dl></dl>");
-            for (var i in val) {
-              $("<dt></dt>").text(i).appendTo(list);
-              $("<dd></dd>").append(render(val[i])).appendTo(list);
-            }
-            return list;
-          } else {
-            var html = $.futon.formatJSON(val, {
-              html: true,
-              escapeStrings: false
-            });
-            var n = $(html);
-            if (n.text().length > 140) {
-              // This code reduces a long string in to a summarized string with a link to expand it.
-              // Someone, somewhere, is doing something nasty with the event after it leaves these handlers.
-              // At this time I can't track down the offender, it might actually be a jQuery propogation issue.
-              var fulltext = n.text();
-              var mintext = n.text().slice(0, 140);
-              var e = $('<a href="#expand">...</a>');
-              var m = $('<a href="#min">X</a>');
-              var expand = function (evt) {
-                n.empty();
-                n.text(fulltext);
-                n.append(m);
-                evt.stopPropagation();
-                evt.stopImmediatePropagation();
-                evt.preventDefault();
-              }
-              var minimize = function (evt) {
-                n.empty();
-                n.text(mintext);
-                // For some reason the old element's handler won't fire after removed and added again.
-                e = $('<a href="#expand">...</a>');
-                e.click(expand);
-                n.append(e);
-                evt.stopPropagation();
-                evt.stopImmediatePropagation();
-                evt.preventDefault();
-              }
-              e.click(expand);
-              n.click(minimize);
-              n.text(mintext);
-              n.append(e)
-            }
-            return n;
-          }
-        }
-        var elem = render(value);
-
-        elem.find("dd:has(dl)").hide().prev("dt").addClass("collapsed");
-        elem.find("dd:not(:has(dl))").addClass("inline").prev().addClass("inline");
-        elem.find("dt.collapsed").click(function() {
-          $(this).toggleClass("collapsed").next().toggle();
-        });
-
-        return elem;
-      }
-
-      function _renderAttachmentList(attachments) {
-        var ul = $("<ul></ul>").addClass("attachments");
-        $.each(attachments, function(idx, attachment) {
-          _renderAttachmentItem(idx, attachment).appendTo(ul);
-        });
-        return ul;
-      }
-
-      function _renderAttachmentItem(name, attachment) {
-        var attachmentHref = db.uri + $.couch.encodeDocId(page.docId)
-          + "/" + encodeAttachment(name);
-        var li = $("<li></li>");
-        $("<a href='' title='Download file' target='_top'></a>").text(name)
-          .attr("href", attachmentHref)
-          .wrapInner("<tt></tt>").appendTo(li);
-        $("<span>()</span>").text("" + $.futon.formatSize(attachment.length) +
-          ", " + attachment.content_type).addClass("info").appendTo(li);
-        if (name == "tests.js") {
-          li.find('span.info').append(', <a href="/_utils/couch_tests.html?'
-            + attachmentHref + '">open in test runner</a>');
-        }
-        _initAttachmentItem(name, attachment, li);
-        return li;
-      }
-
-      function _initAttachmentItem(name, attachment, li) {
-        $("<button type='button' class='delete' title='Delete attachment'></button>").click(function() {
-          if (!li.siblings("li").length) {
-            delete page.doc._attachments;
-            li.parents("tr").remove();
-            $("#fields tbody.content tr").removeClass("odd").filter(":odd").addClass("odd");
-          } else {
-            delete page.doc._attachments[name];
-            li.remove();
-          }
-          page.isDirty = true;
-          return false;
-        }).prependTo($("a", li));
-      }
-    }
-  });
-
-  function encodeAttachment(name) {
-    var encoded = [], parts = name.split('/');
-    for (var i=0; i < parts.length; i++) {
-      encoded.push(encodeURIComponent(parts[i]));
-    };
-    return encoded.join('%2f');
-  }
-
-})(jQuery);

http://git-wip-us.apache.org/repos/asf/couchdb/blob/cca309f3/share/www/script/futon.format.js
----------------------------------------------------------------------
diff --git a/share/www/script/futon.format.js b/share/www/script/futon.format.js
deleted file mode 100644
index 0eb9b10..0000000
--- a/share/www/script/futon.format.js
+++ /dev/null
@@ -1,146 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
-(function($) {
-  $.futon = $.futon || {};
-  $.extend($.futon, {
-    escape: function(string) {
-      return string.replace(/&/g, "&amp;")
-                   .replace(/</g, "&lt;")
-                   .replace(/>/g, "&gt;")
-                   .replace(/"/g, "&quot;")
-                   .replace(/'/g, "&#39;")
-                   ;
-    },
-
-    // JSON pretty printing
-    formatJSON: function(val, options) {
-      options = $.extend({
-        escapeStrings: true,
-        indent: 4,
-        linesep: "\n",
-        quoteKeys: true
-      }, options || {});
-      var itemsep = options.linesep.length ? "," + options.linesep : ", ";
-
-      function format(val, depth) {
-        var tab = [];
-        for (var i = 0; i < options.indent * depth; i++) tab.push("");
-        tab = tab.join(" ");
-
-        var type = typeof val;
-        switch (type) {
-          case "boolean":
-          case "number":
-          case "string":
-            var retval = val;
-            if (type == "string" && !options.escapeStrings) {
-              retval = indentLines(retval.replace(/\r\n/g, "\n"), tab.substr(options.indent));
-            } else {
-              if (options.html) {
-                retval = $.futon.escape(JSON.stringify(val));
-              } else {
-                retval = JSON.stringify(val);
-              }
-            }
-            if (options.html) {
-              retval = "<code class='" + type + "'>" + retval + "</code>";
-            }
-            return retval;
-
-          case "object": {
-            if (val === null) {
-              if (options.html) {
-                return "<code class='null'>null</code>";
-              }
-              return "null";
-            }
-            if (val.constructor == Date) {
-              return JSON.stringify(val);
-            }
-
-            var buf = [];
-
-            if (val.constructor == Array) {
-              buf.push("[");
-              for (var index = 0; index < val.length; index++) {
-                buf.push(index > 0 ? itemsep : options.linesep);
-                buf.push(tab, format(val[index], depth + 1));
-              }
-              if (index >= 0) {
-                buf.push(options.linesep, tab.substr(options.indent));
-              }
-              buf.push("]");
-              if (options.html) {
-                return "<code class='array'>" + buf.join("") + "</code>";
-              }
-
-            } else {
-              buf.push("{");
-              var index = 0;
-              for (var key in val) {
-                buf.push(index > 0 ? itemsep : options.linesep);
-                var keyDisplay = options.quoteKeys ? JSON.stringify(key) : key;
-                if (options.html) {
-                  if (options.quoteKeys) {
-                    keyDisplay = keyDisplay.substr(1, keyDisplay.length - 2);
-                  }
-                  keyDisplay = "<code class='key'>" + $.futon.escape(keyDisplay) + "</code>";
-                  if (options.quoteKeys) {
-                    keyDisplay = '"' + keyDisplay + '"';
-                  }
-                }
-                buf.push(tab, keyDisplay,
-                  ": ", format(val[key], depth + 1));
-                index++;
-              }
-              if (index >= 0) {
-                buf.push(options.linesep, tab.substr(options.indent));
-              }
-              buf.push("}");
-              if (options.html) {
-                return "<code class='object'>" + buf.join("") + "</code>";
-              }
-            }
-
-            return buf.join("");
-          }
-        }
-      }
-
-      function indentLines(text, tab) {
-        var lines = text.split("\n");
-        for (var i in lines) {
-          lines[i] = (i > 0 ? tab : "") + $.futon.escape(lines[i]);
-        }
-        return lines.join("<br>");
-      }
-
-      return format(val, 1);
-    },
-
-    // File size pretty printing
-    formatSize: function(size) {
-      var jump = 512;
-      if (size < jump) return size + " bytes";
-      var units = ["KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"];
-      var i = 0;
-      while (size >= jump && i < units.length) {
-        i += 1;
-        size /= 1024
-      }
-      return size.toFixed(1) + ' ' + units[i - 1];
-    }
-
-  });
-
-})(jQuery);

http://git-wip-us.apache.org/repos/asf/couchdb/blob/cca309f3/share/www/script/futon.js
----------------------------------------------------------------------
diff --git a/share/www/script/futon.js b/share/www/script/futon.js
deleted file mode 100644
index 409becc..0000000
--- a/share/www/script/futon.js
+++ /dev/null
@@ -1,597 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
-// $$ inspired by @wycats: http://yehudakatz.com/2009/04/20/evented-programming-with-jquery/
-function $$(node) {
-  var data = $(node).data("$$");
-  if (data) {
-    return data;
-  } else {
-    data = {};
-    $(node).data("$$", data);
-    return data;
-  }
-};
-
-(function($) {
-
-  function Session() {
-
-    function doLogin(name, password, callback) {
-      $.couch.login({
-        name : name,
-        password : password,
-        success : function() {
-          $.futon.session.sidebar();
-          callback();
-        },
-        error : function(code, error, reason) {
-          $.futon.session.sidebar();
-          callback({name : "Error logging in: "+reason});
-        }
-      });
-    };
-
-    function doSignup(name, password, callback, runLogin) {
-      $.couch.signup({
-        name : name
-      }, password, {
-        success : function() {
-          if (runLogin) {
-            doLogin(name, password, callback);
-          } else {
-            callback();
-          }
-        },
-        error : function(status, error, reason) {
-          $.futon.session.sidebar();
-          if (error == "conflict") {
-            callback({name : "Name '"+name+"' is taken"});
-          } else {
-            callback({name : "Signup error:  "+reason});
-          }
-        }
-      });
-    };
-
-    function validateUsernameAndPassword(data, callback) {
-      if (!data.name || data.name.length == 0) {
-        callback({name: "Please enter a name."});
-        return false;
-      };
-      return validatePassword(data, callback);
-    };
-
-    function validatePassword(data, callback) {
-      if (!data.password || data.password.length == 0) {
-        callback({password: "Please enter a password."});
-        return false;
-      };
-      return true;
-    };
-
-    function createAdmin() {
-      $.showDialog("dialog/_create_admin.html", {
-        submit: function(data, callback) {
-          if (!validateUsernameAndPassword(data, callback)) return;
-          $.couch.config({
-            success : function() {
-              setTimeout(function() {
-                doLogin(data.name, data.password, function(errors) {
-                  if(!$.isEmptyObject(errors)) {
-                    callback(errors);
-                    return;
-                  }
-                  doSignup(data.name, null, function(errors) {
-                    if (errors && errors.name && errors.name.indexOf && errors.name.indexOf("taken") == -1) {
-                      callback(errors);
-                    } else {
-                      callback();
-                    }
-                    }, false);
-                  });
-              }, 200);
-            }
-          }, "admins", data.name, data.password);
-        }
-      });
-      return false;
-    };
-
-    function login() {
-      $.showDialog("dialog/_login.html", {
-        submit: function(data, callback) {
-          if (!validateUsernameAndPassword(data, callback)) return;
-          doLogin(data.name, data.password, callback);
-        }
-      });
-      return false;
-    };
-
-    function logout() {
-      $.couch.logout({
-        success : function(resp) {
-          $.futon.session.sidebar();
-        },
-        error: function(status, e, reason) {
-          alert('An error occurred logging out: ' + reason);
-        }
-      })
-    };
-
-    function signup() {
-      $.showDialog("dialog/_signup.html", {
-        submit: function(data, callback) {
-          if (!validateUsernameAndPassword(data, callback)) return;
-          doSignup(data.name, data.password, callback, true);
-        }
-      });
-      return false;
-    };
-
-    function changePassword () {
-      var updateUserDoc = function(resp, data) {
-        // regular users get their _users doc updated
-        $.couch.db(resp.info.authentication_db).openDoc("org.couchdb.user:"+resp.userCtx.name, {
-          error: function () {
-            // ignore 404
-            location.reload();
-          },
-          success: function (user) {
-            user.password = data.password;
-            $.couch.db(resp.info.authentication_db).saveDoc(user, {
-              success: function() {
-                doLogin(user.name, user.password, function(errors) {
-                    if(!$.isEmptyObject(errors)) {
-                      callback(errors);
-                      return;
-                    } else {
-                      location.reload();
-                    }
-                  });
-                }
-              });
-            }
-        });
-      }
-
-      $.showDialog("dialog/_change_password.html", {
-        submit: function(data, callback) {
-          if (validatePassword(data, callback)) {
-            if (data.password != data.verify_password) {
-              callback({verify_password: "Passwords don't match."});
-              return false;
-            }
-          } else {
-            return false;
-          }
-          $.couch.session({
-            error: function(status, e, reason) {
-              alert('Could not get your session info: ' + reason);
-            },
-            success: function (resp) {
-              // admin users may have a config entry, change the password
-              // there first. Update their user doc later, if it exists
-              if (resp.userCtx.roles.indexOf("_admin") > -1) { // user is admin
-                // check whether we have a config entry
-                $.couch.config({
-                  success : function (response) { // er do have a config entry
-                    $.couch.config({
-                      success : function () {
-                        window.setTimeout(function() {
-                          doLogin(resp.userCtx.name, data.password, function(errors) {
-                            if(!$.isEmptyObject(errors)) {
-                              callback(errors);
-                              return;
-                            } else {
-                              location.reload();
-                            }
-                          });
-                        }, 1000);
-                      },
-                      error: function(status, e, reason) {
-                        callback('Could not persist the new password: ' + reason);
-                      }
-                    }, "admins", resp.userCtx.name, data.password);
-                  }
-                }, "admins", resp.userCtx.name);
-              } else { // non-admin users, update their user doc
-                updateUserDoc(resp, data);
-              }
-            }
-          });
-        }
-      });
-      return false;
-    };
-
-    this.setupSidebar = function() {
-      $("#userCtx .login").click(login);
-      $("#userCtx .logout").click(logout);
-      $("#userCtx .signup").click(signup);
-      $("#userCtx .createadmin").click(createAdmin);
-      $("#userCtx .changepass").click(changePassword);
-    };
-
-    this.sidebar = function() {
-      // get users db info?
-      $("#userCtx span").hide();
-      $(".serverAdmin").attr('disabled', 'disabled');
-
-      $.couch.session({
-        success : function(r) {
-          var userCtx = r.userCtx;
-
-          var urlParts = location.search.substr(1).split("/");
-          var dbName = decodeURIComponent(urlParts.shift());
-          var dbNameRegExp = new RegExp("[^a-z0-9\_\$\(\)\+\/\-]", "g");
-          dbName = dbName.replace(dbNameRegExp, "");
-
-          $$("#userCtx").userCtx = userCtx;
-          if (userCtx.name) {
-            $("#userCtx .name").text(userCtx.name).attr({href : $.couch.urlPrefix + "/_utils/document.html?"+encodeURIComponent(r.info.authentication_db)+"/org.couchdb.user%3A"+encodeURIComponent(userCtx.name)});
-
-            if ($.inArray("_admin", userCtx.roles) != -1) {
-              $("#userCtx .loggedin").show();
-              $("#userCtx .loggedinadmin").show();
-              $(".serverAdmin").removeAttr('disabled'); // user is a server admin
-            } else {
-              $("#userCtx .loggedin").show();
-
-              if (dbName != "") {
-                $.couch.db(dbName).getDbProperty("_security", { // check security roles for user admins
-                  success: function(resp) {
-                    var adminRoles = resp.admins.roles;
-
-                    if ($.inArray(userCtx.name, resp.admins.names)>=0) { // user is admin
-                      $(".userAdmin").removeAttr('disabled');
-                    }
-                    else {
-                      for (var i=0; i<userCtx.roles.length; i++) { 
-                        if ($.inArray(userCtx.roles[i], resp.admins.roles)>=0) { // user has role that is an admin
-                          $(".userAdmin").removeAttr('disabled');
-                        }
-                      }
-                    }
-                  } 
-                }); 
-              }
-            }
-          } else if ($.inArray("_admin", userCtx.roles) != -1) {
-            $("#userCtx .adminparty").show();
-            $(".serverAdmin").removeAttr('disabled');
-          } else {
-            $("#userCtx .loggedout").show();
-          };
-        }
-      })
-    };
-  };
-
-  function Navigation() {
-    var nav = this;
-    this.loaded = false;
-    this.eventHandlers = {
-      load: []
-    };
-
-    this.ready = function(callback) {
-      if (callback) {
-        if (this.loaded) {
-          callback.apply(this);
-        }
-        this.eventHandlers["load"].push(callback);
-      } else {
-        this.loaded = true;
-        callbacks = this.eventHandlers["load"];
-        for (var i = 0; i < callbacks.length; i++) {
-          callbacks[i].apply(this);
-        }
-      }
-    }
-
-    this.addDatabase = function(name) {
-      var current = $.futon.storage.get("recent", "");
-      var recentDbs = current ? current.split(",") : [];
-      if ($.inArray(name, recentDbs) == -1) {
-        recentDbs.unshift(name);
-        if (recentDbs.length > 10) recentDbs.length = 10;
-        $.futon.storage.set("recent", recentDbs.join(","));
-        this.updateDatabases();
-      }
-    }
-
-    this.removeDatabase = function(name) {
-      // remove database from recent databases list
-      var current = $.futon.storage.get("recent", "");
-      var recentDbs = current ? current.split(",") : [];
-      var recentIdx = $.inArray(name, recentDbs);
-      if (recentIdx >= 0) {
-        recentDbs.splice(recentIdx, 1);
-        $.futon.storage.set("recent", recentDbs.join(","));
-        this.updateDatabases();
-      }
-    }
-
-    this.updateDatabases = function() {
-      var selection = null;
-      $("#dbs .selected a").each(function() {
-        selection = [this.pathname, this.search];
-      });
-      $("#dbs").empty();
-      var recentDbs = $.futon.storage.get("recent").split(",");
-      recentDbs.sort();
-      $.each(recentDbs, function(idx, name) {
-        if (name) {
-          name = encodeURIComponent(name);
-          $("#dbs").append("<li>" +
-            "<button class='remove' title='Remove from list' value='" + name + "'></button>" +
-            "<a href='database.html?" + name + "' title='" + name + "'>" + name +
-            "</a></li>");
-        }
-      });
-      if (selection) {
-        this.updateSelection(selection[0], selection[1]);
-      }
-      $("#dbs button.remove").click(function() {
-        nav.removeDatabase(this.value);
-        return false;
-      });
-    }
-
-    this.updateSelection = function(path, queryString) {
-      function fixupPath(path) { // hack for IE/Win
-        return (path.charAt(0) != "/") ? ("/" + path) : path;
-      }
-      if (!path) {
-        path = location.pathname;
-        if (!queryString) {
-          queryString = location.search;
-        }
-      } else if (!queryString) {
-        queryString = "";
-      }
-      var href = fixupPath(path + queryString);
-      $("#nav li").removeClass("selected");
-      $("#nav li a").each(function() {
-        if (fixupPath(this.pathname) + this.search != href) return;
-        $(this).parent("li").addClass("selected").parents("li").addClass("selected");
-      });
-    }
-
-    this.toggle = function(speed) {
-      if (speed === undefined) {
-        speed = 500;
-      }
-      var sidebar = $("#sidebar").stop(true, true);
-      var hidden = !$(sidebar).is(".hidden");
-
-      $("#wrap").animate({
-        marginRight: hidden ? 0 : 210
-      }, speed, function() {
-        $(document.body).toggleClass("fullwidth", hidden);
-      });
-      sidebar.toggleClass("hidden").animate({
-        width: hidden ? 26 : 210,
-        height: hidden ? $("h1").outerHeight() - 1 : "100%",
-        right: hidden ? 0 : -210
-      }, speed).children(":not(#sidebar-toggle)").animate({
-        opacity: "toggle"
-      }, speed);
-      $("h1").animate({marginRight: hidden ? 26 : 0}, speed);
-
-      $("#sidebar-toggle")
-        .attr("title", hidden ? "Show Sidebar" : "Hide Sidebar");
-      $.futon.storage.set("sidebar", hidden ? "hidden" : "show");
-    };
-  }
-
-  function Storage() {
-    var storage = this;
-    this.decls = {};
-
-    this.declare = function(name, options) {
-      this.decls[name] = $.extend({}, {
-        scope: "window",
-        defaultValue: null,
-        prefix: ""
-      }, options || {});
-    }
-
-    this.declareWithPrefix = function(prefix, decls) {
-      for (var name in decls) {
-        var options = decls[name];
-        options.prefix = prefix;
-        storage.declare(name, options);
-      }
-    }
-
-    this.del = function(name) {
-      lookup(name, function(decl) {
-        handlers[decl.scope].del(decl.prefix + name);
-      });
-    }
-
-    this.get = function(name, defaultValue) {
-      return lookup(name, function(decl) {
-        var value = handlers[decl.scope].get(decl.prefix + name);
-        if (value !== undefined) {
-          return value;
-        }
-        if (defaultValue !== undefined) {
-          return defaultValue;
-        }
-        return decl.defaultValue;
-      });
-    }
-
-    this.set = function(name, value) {
-      lookup(name, function(decl) {
-        if (value == decl.defaultValue) {
-          handlers[decl.scope].del(decl.prefix + name);
-        } else {
-          handlers[decl.scope].set(decl.prefix + name, value);
-        }
-      });
-    }
-
-    function lookup(name, callback) {
-      var decl = storage.decls[name];
-      if (decl === undefined) {
-        return decl;
-      }
-      return callback(decl);
-    }
-
-    function windowName() {
-      try {
-        return JSON.parse(window.name || "{}");
-      } catch (e) {
-        return {};
-      }
-    }
-
-    // add suffix to cookie names to be able to separate between ports
-    var cookiePrefix = location.port + "_";
-
-    var handlers = {
-
-      "cookie": {
-        get: function(name) {
-          var nameEq = cookiePrefix + name + "=";
-          var parts = document.cookie.split(';');
-          for (var i = 0; i < parts.length; i++) {
-            var part = parts[i].replace(/^\s+/, "");
-            if (part.indexOf(nameEq) == 0) {
-              return unescape(part.substring(nameEq.length, part.length));
-            }
-          }
-        },
-        set: function(name, value) {
-          var date = new Date();
-          date.setTime(date.getTime() + 14*24*60*60*1000); // two weeks
-          document.cookie = cookiePrefix + name + "=" + escape(value) +
-            "; expires=" + date.toGMTString();
-        },
-        del: function(name) {
-          var date = new Date();
-          date.setTime(date.getTime() - 24*60*60*1000); // yesterday
-          document.cookie = cookiePrefix + name + "=" +
-            "; expires=" + date.toGMTString();
-        }
-      },
-
-      "window": {
-        get: function(name) {
-          return windowName()[name];
-        },
-        set: function(name, value) {
-          var obj = windowName();
-          obj[name] = value || null;
-          window.name = JSON.stringify(obj);
-        },
-        del: function(name) {
-          var obj = windowName();
-          delete obj[name];
-          window.name = JSON.stringify(obj);
-        }
-      }
-
-    };
-
-  }
-
-  $.couch.urlPrefix = "..";
-  $.futon = $.futon || {};
-  $.extend($.futon, {
-    navigation: new Navigation(),
-    session : new Session(),
-    storage: new Storage()
-  });
-
-  $.fn.addPlaceholder = function() {
-    if (this[0] && "placeholder" in document.createElement("input")) {
-      return; // found native placeholder support
-    }
-    return this.live('focusin', function() {
-      var input = $(this);
-      if (input.val() === input.attr("placeholder")) {
-        input.removeClass("placeholder").val("");
-      }
-    }).live("focusout", function() {
-      var input = $(this);
-      if (input.val() === "") {
-        input.val(input.attr("placeholder")).addClass("placeholder");
-      }
-    }).trigger("focusout");
-  }
-
-  $.fn.enableTabInsertion = function(chars) {
-    chars = chars || "\t";
-    var width = chars.length;
-    return this.keydown(function(evt) {
-      if (evt.keyCode == 9) {
-        var v = this.value;
-        var start = this.selectionStart;
-        var scrollTop = this.scrollTop;
-        if (start !== undefined) {
-          this.value = v.slice(0, start) + chars + v.slice(start);
-          this.selectionStart = this.selectionEnd = start + width;
-        } else {
-          document.selection.createRange().text = chars;
-          this.caretPos += width;
-        }
-        return false;
-      }
-    });
-  }
-
-  $(document)
-    .ajaxStart(function() { $(this.body).addClass("loading"); })
-    .ajaxStop(function() { $(this.body).removeClass("loading"); });
-
-  $.futon.storage.declare("sidebar", {scope: "cookie", defaultValue: "show"});
-  $.futon.storage.declare("recent", {scope: "cookie", defaultValue: ""});
-
-  $(function() {
-    document.title = "Apache CouchDB - Futon: " + document.title;
-    if ($.futon.storage.get("sidebar") == "hidden") {
-      // doing this as early as possible prevents flickering
-      $(document.body).addClass("fullwidth");
-    }
-    $("input[placeholder]").addPlaceholder();
-
-    $.get("_sidebar.html", function(resp) {
-      $("#wrap").append(resp)
-        .find("#sidebar-toggle").click(function(e) {
-            $.futon.navigation.toggle(e.shiftKey ? 2500 : 500);
-            return false;
-          });
-      if ($.futon.storage.get("sidebar") == "hidden") {
-        $.futon.navigation.toggle(0);
-      }
-
-      $.futon.navigation.updateDatabases();
-      $.futon.navigation.updateSelection();
-      $.futon.navigation.ready();
-      $.futon.session.setupSidebar();
-      $.futon.session.sidebar();
-
-      $.couch.info({
-        success: function(info, status) {
-          $("#version").text(info.version);
-        }
-      });
-    });
-  });
-
-})(jQuery);


[03/37] move JS tests into safety

Posted by ja...@apache.org.
http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/www/script/test/replicator_db_identical_continuous.js
----------------------------------------------------------------------
diff --git a/share/www/script/test/replicator_db_identical_continuous.js b/share/www/script/test/replicator_db_identical_continuous.js
deleted file mode 100644
index 240c531..0000000
--- a/share/www/script/test/replicator_db_identical_continuous.js
+++ /dev/null
@@ -1,139 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
-couchTests.replicator_db_identical_continuous = function(debug) {
-
-  if (debug) debugger;
-
-  var populate_db = replicator_db.populate_db;
-  var docs1 = replicator_db.docs1;
-  var dbA = replicator_db.dbA;
-  var dbB = replicator_db.dbB;
-  var repDb = replicator_db.repDb;
-  var wait = replicator_db.wait;
-  var waitForRep = replicator_db.waitForRep;
-  var waitForSeq = replicator_db.waitForSeq;
-  var wait_rep_doc = replicator_db.wait_rep_doc;
-
-  // test the case where multiple replication docs (different IDs)
-  // describe in fact the same continuous replication (source, target, etc)
-  function identical_continuous_rep_docs() {
-    populate_db(dbA, docs1);
-    populate_db(dbB, []);
-
-    var repDoc1 = {
-      _id: "foo_dup_cont_rep_doc_1",
-      source: "http://" + CouchDB.host + "/" + dbA.name,
-      target: dbB.name,
-      continuous: true
-    };
-    var repDoc2 = {
-      _id: "foo_dup_cont_rep_doc_2",
-      source: "http://" + CouchDB.host + "/" + dbA.name,
-      target: dbB.name,
-      continuous: true
-    };
-
-    T(repDb.save(repDoc1).ok);
-    T(repDb.save(repDoc2).ok);
-
-    waitForSeq(dbA, dbB);
-    for (var i = 0; i < docs1.length; i++) {
-      var doc = docs1[i];
-      var copy = dbB.open(doc._id);
-      T(copy !== null);
-      T(copy.value === doc.value);
-    }
-
-    // Rather than a timeout we're just waiting to hear the
-    // fourth change to the database. Changes 1 and 2 were
-    // us storing repDoc1 and repDoc2. Changes 3 and 4 are
-    // the replicator manager updating each document. This
-    // just waits until the fourth change before continuing.
-    repDb.changes({"feed":"longpoll", "since":3});
-
-    repDoc1 = repDb.open("foo_dup_cont_rep_doc_1");
-    T(repDoc1 !== null);
-    T(repDoc1._replication_state === "triggered");
-    T(typeof repDoc1._replication_state_time === "string");
-    T(typeof repDoc1._replication_id  === "string");
-
-    repDoc2 = repDb.open("foo_dup_cont_rep_doc_2");
-    T(repDoc2 !== null);
-    T(typeof repDoc2._replication_state === "undefined");
-    T(typeof repDoc2._replication_state_time === "undefined");
-    T(repDoc2._replication_id === repDoc1._replication_id);
-
-    var newDoc = {
-      _id: "foo666",
-      value: 999
-    };
-    T(dbA.save(newDoc).ok);
-
-    waitForSeq(dbA, dbB);
-    var copy = dbB.open("foo666");
-    T(copy !== null);
-    T(copy.value === 999);
-
-    // deleting second replication doc, doesn't affect the 1st one and
-    // neither it stops the replication
-    T(repDb.deleteDoc(repDoc2).ok);
-    repDoc1 = repDb.open("foo_dup_cont_rep_doc_1");
-    T(repDoc1 !== null);
-    T(repDoc1._replication_state === "triggered");
-    T(typeof repDoc1._replication_state_time === "string");
-
-    var newDoc2 = {
-        _id: "foo5000",
-        value: 5000
-    };
-    T(dbA.save(newDoc2).ok);
-
-    waitForSeq(dbA, dbB);
-    var copy = dbB.open("foo5000");
-    T(copy !== null);
-    T(copy.value === 5000);
-
-    // deleting the 1st replication document stops the replication
-    T(repDb.deleteDoc(repDoc1).ok);
-    var newDoc3 = {
-        _id: "foo1983",
-        value: 1983
-    };
-    T(dbA.save(newDoc3).ok);
-
-    wait(wait_rep_doc); //how to remove wait?
-    var copy = dbB.open("foo1983");
-    T(copy === null);
-  }
-
-  var server_config = [
-    {
-      section: "couch_httpd_auth",
-      key: "iterations",
-      value: "1"
-    },
-    {
-      section: "replicator",
-      key: "db",
-      value: repDb.name
-    }
-  ];
-
-  repDb.deleteDb();
-  run_on_modified_server(server_config, identical_continuous_rep_docs);
-
-  // cleanup
-  repDb.deleteDb();
-  dbA.deleteDb();
-  dbB.deleteDb();
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/www/script/test/replicator_db_invalid_filter.js
----------------------------------------------------------------------
diff --git a/share/www/script/test/replicator_db_invalid_filter.js b/share/www/script/test/replicator_db_invalid_filter.js
deleted file mode 100644
index 7b6df82..0000000
--- a/share/www/script/test/replicator_db_invalid_filter.js
+++ /dev/null
@@ -1,119 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
-couchTests.replicator_db_invalid_filter = function(debug) {
-
-  if (debug) debugger;
-
-  var populate_db = replicator_db.populate_db;
-  var docs1 = replicator_db.docs1;
-  var dbA = replicator_db.dbA;
-  var dbB = replicator_db.dbB;
-  var repDb = replicator_db.repDb;
-  var usersDb = replicator_db.usersDb;
-  var wait = replicator_db.wait;
-  var waitForRep = replicator_db.waitForRep;
-  var waitForSeq = replicator_db.waitForSeq;
-  var wait_rep_doc = replicator_db.wait_rep_doc;
-
-  function test_invalid_filter() {
-    // COUCHDB-1199 - replication document with a filter field that was invalid
-    // crashed the CouchDB server.
-    var repDoc1 = {
-       _id: "rep1",
-       source: "couch_foo_test_db",
-       target: "couch_bar_test_db",
-       filter: "test/foofilter"
-    };
-
-    TEquals(true, repDb.save(repDoc1).ok);
-
-    waitForRep(repDb, repDoc1, "error");
-    repDoc1 = repDb.open(repDoc1._id);
-    TEquals("undefined", typeof repDoc1._replication_id);
-    TEquals("error", repDoc1._replication_state);
-    TEquals("Could not open source database `couch_foo_test_db`: {db_not_found,<<\"couch_foo_test_db\">>}",
-            repDoc1._replication_state_reason);
-
-    populate_db(dbA, docs1);
-    populate_db(dbB, []);
-
-    var repDoc2 = {
-       _id: "rep2",
-       source: dbA.name,
-       target: dbB.name,
-       filter: "test/foofilter"
-    };
-
-    TEquals(true, repDb.save(repDoc2).ok);
-
-    waitForRep(repDb, repDoc2, "error");
-    repDoc2 = repDb.open(repDoc2._id);
-    TEquals("undefined", typeof repDoc2._replication_id);
-    TEquals("error", repDoc2._replication_state);
-    TEquals("Couldn't open document `_design/test` from source database `test_suite_rep_db_a`: {error,<<\"not_found\">>}",
-            repDoc2._replication_state_reason);
-
-    var ddoc = {
-      _id: "_design/mydesign",
-      language : "javascript",
-      filters : {
-        myfilter : (function(doc, req) {
-          return true;
-        }).toString()
-      }
-    };
-
-    TEquals(true, dbA.save(ddoc).ok);
-
-    var repDoc3 = {
-       _id: "rep3",
-       source: dbA.name,
-       target: dbB.name,
-       filter: "mydesign/myfilter"
-    };
-
-    TEquals(true, repDb.save(repDoc3).ok);
-
-    waitForRep(repDb, repDoc3, "completed");
-    repDoc3 = repDb.open(repDoc3._id);
-    TEquals("string", typeof repDoc3._replication_id);
-    TEquals("completed", repDoc3._replication_state);
-  }
-
-  var server_config = [
-    {
-      section: "couch_httpd_auth",
-      key: "iterations",
-      value: "1"
-    },
-    {
-      section: "replicator",
-      key: "db",
-      value: repDb.name
-    },
-    {
-      section: "couch_httpd_auth",
-      key: "authentication_db",
-      value: usersDb.name
-    }
-  ];
-
-  repDb.deleteDb();
-  run_on_modified_server(server_config, test_invalid_filter);
-
-  // cleanup
-  repDb.deleteDb();
-  dbA.deleteDb();
-  dbB.deleteDb();
-  usersDb.deleteDb();
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/www/script/test/replicator_db_security.js
----------------------------------------------------------------------
diff --git a/share/www/script/test/replicator_db_security.js b/share/www/script/test/replicator_db_security.js
deleted file mode 100644
index 7a2bfd1..0000000
--- a/share/www/script/test/replicator_db_security.js
+++ /dev/null
@@ -1,399 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
-couchTests.replicator_db_security = function(debug) {
-
-  var reset_dbs = function(dbs) {
-    dbs.forEach(function(db) {
-      db.deleteDb();
-      try { db.createDb() } catch (e) {};
-    });
-  };
-
-  var dbs = ["couch_test_rep_db", "couch_test_users_db",
-    "test_suite_db_a", "test_suite_db_b", "test_suite_db_c"]
-    .map(function(db_name) {
-      return new CouchDB(db_name, {"X-Couch-Full-Commit":"false"});
-    });
-
-  var repDb = dbs[0];
-  var usersDb = dbs[1];
-  var dbA = dbs[2];
-  var dbB = dbs[3];
-  var dbC = dbs[4];
-
-  if (debug) debugger;
-
-  var loginUser = function(username) {
-    var pws = {
-      jan: "apple",
-      jchris: "mp3",
-      fdmanana: "foobar",
-      benoitc: "test"
-    };
-    T(CouchDB.login(username, pws[username]).ok);
-  };
-
-  var repChanges = function(username) {
-    var pws = {
-      jan: "apple",
-      jchris: "mp3",
-      fdmanana: "foobar",
-      benoitc: "test"
-    };
-    T(CouchDB.login(username, pws[username]).ok);
-    var changes = CouchDB.request(
-      "GET",
-       "/" + repDb.name + "/_changes?include_docs=true" +
-         "&anti-cache=" + String(Math.round(Math.random() * 100000)));
-    return changes = JSON.parse(changes.responseText);
-  };
-
-  var save_as = function(db, doc, username)
-  {
-    loginUser(username);
-    try {
-      return db.save(doc);
-    } catch (ex) {
-      return ex;
-    } finally {
-      CouchDB.logout();
-    }
-  };
-
-  var open_as = function(db, docId, username) {
-    loginUser(username);
-    try {
-      return db.open(docId);
-    } finally {
-      CouchDB.logout();
-    }
-  };
-
-  // from test replicator_db.js
-  function waitForDocPos(db, docId, pos) {
-    var doc, curPos, t0, t1,
-        maxWait = 3000;
-
-    doc = db.open(docId);
-    curPos = Number(doc._rev.split("-", 1));
-    t0 = t1 = new Date();
-
-    while ((curPos < pos) && ((t1 - t0) <= maxWait)) {
-       doc = db.open(docId);
-       curPos = Number(doc._rev.split("-", 1));
-       t1 = new Date();
-    }
-
-    return doc;
-  }
-
-  var testFun = function()
-  {
-    reset_dbs(dbs);
-
-    // _replicator db
-    // in admin party mode, anonymous should be able to create a replication
-    var repDoc = {
-      _id: "null-owner-rep",
-      source: dbA.name,
-      target: dbB.name
-    };
-    var result = repDb.save(repDoc);
-    TEquals(true, result.ok, "should allow anonymous replication docs in admin party");
-    // new docs should get an owner field enforced. In admin party mode owner is null
-    repDoc = repDb.open(repDoc._id);
-    TIsnull(repDoc.owner, "owner should be null in admin party");
-
-// Uncomment when _users database security changes are implemented.
-//
-//     var jchrisDoc = {
-//       _id: "org.couchdb.user:jchris",
-//       type: "user",
-//       name: "jchris",
-//       password: "mp3",
-//       roles: []
-//     };
-    var jchrisDoc = CouchDB.prepareUserDoc({
-      name: "jchris",
-      roles: []
-    }, "mp3");
-    usersDb.save(jchrisDoc); // set up a non-admin user
-
-// Uncomment when _users database security changes are implemented.
-//
-//     var jchrisDoc = {
-//       _id: "org.couchdb.user:fdmanana",
-//       type: "user",
-//       name: "fdmanana",
-//       password: "foobar",
-//       roles: []
-//     };
-    var fdmananaDoc = CouchDB.prepareUserDoc({
-      name: "fdmanana",
-      roles: []
-    }, "foobar");
-    usersDb.save(fdmananaDoc); // set up a non-admin user
-
-// Uncomment when _users database security changes are implemented.
-//
-//     var benoitcDoc = {
-//       _id: "org.couchdb.user:fdmanana",
-//       type: "user",
-//       name: "fdmanana",
-//       password: "foobar",
-//       roles: []
-//     };
-    var benoitcDoc = CouchDB.prepareUserDoc({
-      name: "benoitc",
-      roles: []
-    }, "test");
-    usersDb.save(benoitcDoc); // set up a non-admin user
-
-    T(repDb.setSecObj({
-      "admins" : {
-        roles : [],
-        names : ["benoitc"]
-      }
-    }).ok);
-    
-    run_on_modified_server([
-        {
-          section: "admins",
-          key: "jan",
-          value: "apple"
-        }
-      ], function() {
-        // replication docs from admin-party mode in non-admin party mode can not
-        //   be edited by non-admins (non-server admins)
-        repDoc = repDb.open(repDoc._id);
-        repDoc.target = dbC.name;
-        var result = save_as(repDb, repDoc, "jchris");
-        TEquals("forbidden", result.error, "should forbid editing null-owner docs");
-
-        // replication docs from admin-party mode in non-admin party mode can only
-        //   be edited by admins (server admins)
-        repDoc = waitForDocPos(repDb, repDoc._id, 3);
-        repDoc.target = dbC.name;
-        var result = save_as(repDb, repDoc, "jan");
-        repDoc = open_as(repDb, repDoc._id, "jchris");
-        TEquals(true, result.ok, "should allow editing null-owner docs to admins");
-        TEquals("jan", repDoc.owner, "owner should be the admin now");
-
-        // user can update their own replication docs (repDoc.owner)
-        var jchrisRepDoc = {
-          _id: "jchris-rep-doc",
-          source: dbC.name,
-          target: dbA.name,
-          user_ctx: { name: "jchris", roles: [] }
-        };
-
-        var result = save_as(repDb, jchrisRepDoc, "jchris");
-        TEquals(true, result.ok, "should create rep doc");
-        jchrisRepDoc = repDb.open(jchrisRepDoc._id);
-        TEquals("jchris", jchrisRepDoc.owner, "should assign correct owner");
-        jchrisRepDoc = waitForDocPos(repDb, jchrisRepDoc._id, 3);
-        jchrisRepDoc = open_as(repDb, jchrisRepDoc._id, "jchris");
-        jchrisRepDoc.target = dbB.name;
-        var result = save_as(repDb, jchrisRepDoc, "jchris");
-        TEquals(true, result.ok, "should allow update of rep doc");
-
-        // user should not be able to read from any view
-        var ddoc = {
-          _id: "_design/reps",
-          views: {
-            test: {
-            map: "function(doc) {" +
-              "if (doc._replication_state) { " +
-                "emit(doc._id, doc._replication_state);" +
-              "}" +
-            "}"
-            }
-          }
-        };
-
-        save_as(repDb, ddoc, "jan");
-
-        try {
-          repDb.view("reps/test");
-          T(false, "non-admin had view read access");
-        } catch (ex) {
-          TEquals("forbidden", ex.error,
-            "non-admins should not be able to read a view");
-        }
-
-        // admin should be able to read from any view
-        TEquals(true, CouchDB.login("jan", "apple").ok);
-        var result = repDb.view("reps/test");
-        CouchDB.logout();
-        TEquals(2, result.total_rows, "should allow access and list two users");
-
-        // test _all_docs, only available for _admins
-        try {
-          repDb.allDocs({include_docs: true});
-          T(false, "non-admin had _all_docs access");
-        } catch (ex) {
-          TEquals("forbidden", ex.error,
-            "non-admins should not be able to access _all_docs");
-        }
-
-        TEquals(true, CouchDB.login("jan", "apple").ok);
-        try {
-          repDb.allDocs({include_docs: true});
-        } catch (ex) {
-          T(false, "admin couldn't access _all_docs");
-        }
-        CouchDB.logout();
-
-        try {
-          repDb.view("reps/test");
-          T(false, "non-admin had view read access");
-        } catch (ex) {
-          TEquals("forbidden", ex.error,
-            "non-admins should not be able to read a view");
-        }
-
-        // admin should be able to read from any view
-        TEquals(true, CouchDB.login("benoitc", "test").ok);
-        var result = repDb.view("reps/test");
-        CouchDB.logout();
-        TEquals(2, result.total_rows, "should allow access and list two users");
-
-        // test _all_docs, only available for _admins
-        try {
-          repDb.allDocs({include_docs: true});
-          T(false, "non-admin had _all_docs access");
-        } catch (ex) {
-          TEquals("forbidden", ex.error,
-            "non-admins should not be able to access _all_docs");
-        }
-
-        TEquals(true, CouchDB.login("benoitc", "test").ok);
-        try {
-          repDb.allDocs({include_docs: true});
-        } catch (ex) {
-          T(false, "admin couldn't access _all_docs");
-        }
-        CouchDB.logout();
-
-        // Verify that users can't access credentials in the "source" and
-        // "target" fields of replication documents owned by other users.
-        var fdmananaRepDoc = {
-          _id: "fdmanana-rep-doc",
-          source: "http://fdmanana:foobar@" + CouchDB.host + "/" + dbC.name,
-          target: dbA.name,
-          user_ctx: { name: "fdmanana", roles: [] }
-        };
-
-        var result = save_as(repDb, fdmananaRepDoc, "fdmanana");
-        TEquals(true, result.ok, "should create rep doc");
-        waitForDocPos(repDb, fdmananaRepDoc._id, 3);
-        fdmananaRepDoc = open_as(repDb, fdmananaRepDoc._id, "fdmanana");
-        TEquals("fdmanana", fdmananaRepDoc.owner, "should assign correct owner");
-        TEquals("http://fdmanana:foobar@" + CouchDB.host + "/" + dbC.name,
-           fdmananaRepDoc.source, "source field has credentials");
-
-        fdmananaRepDoc = open_as(repDb, fdmananaRepDoc._id, "jchris");
-        TEquals("fdmanana", fdmananaRepDoc.owner, "should assign correct owner");
-        TEquals("http://" + CouchDB.host + "/" + dbC.name,
-           fdmananaRepDoc.source, "source field doesn't contain credentials");
-
-        // _changes?include_docs=true, users shouldn't be able to see credentials
-        // in documents owned by other users.
-        var changes = repChanges("jchris");
-        var doc = changes.results[changes.results.length - 1].doc;
-        TEquals(fdmananaRepDoc._id, doc._id, "Got the right doc from _changes");
-        TEquals("http://" + CouchDB.host + "/" + dbC.name,
-           doc.source, "source field doesn't contain credentials (doc from _changes)");
-        CouchDB.logout();
-
-        // _changes?include_docs=true, user should be able to see credentials
-        // in documents they own.
-        var changes = repChanges("fdmanana");
-        var doc = changes.results[changes.results.length - 1].doc;
-        TEquals(fdmananaRepDoc._id, doc._id, "Got the right doc from _changes");
-        TEquals("http://fdmanana:foobar@" + CouchDB.host + "/" + dbC.name,
-           doc.source, "source field contains credentials (doc from _changes)");
-        CouchDB.logout();
-
-        // _changes?include_docs=true, admins should be able to see credentials
-        // from all documents.
-        var changes = repChanges("jan");
-        var doc = changes.results[changes.results.length - 1].doc;
-        TEquals(fdmananaRepDoc._id, doc._id, "Got the right doc from _changes");
-        TEquals("http://fdmanana:foobar@" + CouchDB.host + "/" + dbC.name,
-           doc.source, "source field contains credentials (doc from _changes)");
-        CouchDB.logout();
-
-        // _changes?include_docs=true, db admins should be able to see credentials
-        // from all documents.
-        var changes = repChanges("benoitc");
-        var doc = changes.results[changes.results.length - 1].doc;
-        TEquals(fdmananaRepDoc._id, doc._id, "Got the right doc from _changes");
-        TEquals("http://fdmanana:foobar@" + CouchDB.host + "/" + dbC.name,
-           doc.source, "source field contains credentials (doc from _changes)");
-        CouchDB.logout();
-
-        var fdmananaRepDocOAuth = {
-          _id: "fdmanana-rep-doc-oauth",
-          source: dbC.name,
-          target: {
-            url: "http://" + CouchDB.host + "/" + dbA.name,
-            oauth: {
-              token: "abc",
-              token_secret: "foo",
-              consumer_key: "123",
-              consumer_secret: "321"
-            }
-          },
-          user_ctx: { name: "fdmanana", roles: [] }
-        };
-
-        var result = save_as(repDb, fdmananaRepDocOAuth, "fdmanana");
-        TEquals(true, result.ok, "should create rep doc");
-        waitForDocPos(repDb, fdmananaRepDocOAuth._id, 3);
-        fdmananaRepDocOAuth = open_as(repDb, fdmananaRepDocOAuth._id, "fdmanana");
-        TEquals("fdmanana", fdmananaRepDocOAuth.owner, "should assign correct owner");
-        TEquals("object", typeof fdmananaRepDocOAuth.target.oauth,
-          "target field has oauth credentials");
-
-        fdmananaRepDocOAuth = open_as(repDb, fdmananaRepDocOAuth._id, "jchris");
-        TEquals("fdmanana", fdmananaRepDocOAuth.owner, "should assign correct owner");
-        TEquals("undefined", typeof fdmananaRepDocOAuth.target.oauth,
-          "target field doesn't have oauth credentials");
-
-        // ensure "old" replicator docs still work
-        // done in replicator_db.js?
-
-        // Login as admin so run_on_modified_server can do its cleanup.
-        TEquals(true, CouchDB.login("jan", "apple").ok);
-      });
-  };
-
-  run_on_modified_server([
-    {
-      section: "couch_httpd_auth",
-      key: "authentication_db",
-      value: usersDb.name
-    },
-    {
-      section: "replicator",
-      key: "db",
-      value: repDb.name
-    }],
-    testFun
-  );
-
-  // cleanup
-  usersDb.deleteDb();
-  repDb.deleteDb();
-};

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/www/script/test/replicator_db_simple.js
----------------------------------------------------------------------
diff --git a/share/www/script/test/replicator_db_simple.js b/share/www/script/test/replicator_db_simple.js
deleted file mode 100644
index f7acedb..0000000
--- a/share/www/script/test/replicator_db_simple.js
+++ /dev/null
@@ -1,114 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
-couchTests.replicator_db_simple = function(debug) {
-
-  if (debug) debugger;
-
-  var populate_db = replicator_db.populate_db;
-  var docs1 = replicator_db.docs1;
-  var dbA = replicator_db.dbA;
-  var dbB = replicator_db.dbB;
-  var repDb = replicator_db.repDb;
-  var waitForRep = replicator_db.waitForRep;
-
-  function simple_replication() {
-    populate_db(dbA, docs1);
-    populate_db(dbB, []);
-
-    var repDoc = {
-      _id: "foo_simple_rep",
-      source: dbA.name,
-      target: dbB.name
-    };
-    T(repDb.save(repDoc).ok);
-
-    waitForRep(repDb, repDoc, "completed");
-    for (var i = 0; i < docs1.length; i++) {
-      var doc = docs1[i];
-      var copy = dbB.open(doc._id);
-      T(copy !== null);
-      T(copy.value === doc.value);
-    }
-
-    var repDoc1 = repDb.open(repDoc._id);
-    T(repDoc1 !== null);
-    T(repDoc1.source === repDoc.source);
-    T(repDoc1.target === repDoc.target);
-    T(repDoc1._replication_state === "completed", "simple");
-    T(typeof repDoc1._replication_state_time === "string");
-    T(typeof repDoc1._replication_id  === "string");
-    T(typeof repDoc1._replication_stats === "object", "doc has stats");
-    var stats = repDoc1._replication_stats;
-    TEquals(docs1.length, stats.revisions_checked,
-       "right # of revisions_checked");
-    TEquals(docs1.length, stats.missing_revisions_found,
-      "right # of missing_revisions_found");
-    TEquals(docs1.length, stats.docs_read, "right # of docs_read");
-    TEquals(docs1.length, stats.docs_written, "right # of docs_written");
-    TEquals(0, stats.doc_write_failures, "right # of doc_write_failures");
-    TEquals(dbA.info().update_seq, stats.checkpointed_source_seq,
-      "right checkpointed_source_seq");
-  }
-
-  var server_config = [
-    {
-      section: "couch_httpd_auth",
-      key: "iterations",
-      value: "1"
-    },
-    {
-      section: "replicator",
-      key: "db",
-      value: repDb.name
-    }
-  ];
-
-  repDb.deleteDb();
-  run_on_modified_server(server_config, simple_replication);
-
-/*
- * Disabled, since error state would be set on the document only after
- * the exponential backoff retry done by the replicator database listener
- * terminates, which takes too much time for a unit test.
- */
- /*
-   function error_state_replication() {
-    populate_db(dbA, docs1);
-
-    var repDoc = {
-      _id: "foo_error_rep",
-      source: dbA.name,
-      target: "nonexistent_test_db"
-    };
-    T(repDb.save(repDoc).ok);
-
-    waitForRep(repDb, repDoc, "error");
-    var repDoc1 = repDb.open(repDoc._id);
-    T(repDoc1 !== null);
-    T(repDoc1._replication_state === "error");
-    T(typeof repDoc1._replication_state_time === "string");
-    T(typeof repDoc1._replication_id  === "string");
-  }
- */
-/*
- * repDb.deleteDb();
- * restartServer();
- * run_on_modified_server(server_config, error_state_replication);
- */
-
-
-  // cleanup
-  repDb.deleteDb();
-  dbA.deleteDb();
-  dbB.deleteDb();
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/www/script/test/replicator_db_successive.js
----------------------------------------------------------------------
diff --git a/share/www/script/test/replicator_db_successive.js b/share/www/script/test/replicator_db_successive.js
deleted file mode 100644
index 4898c33..0000000
--- a/share/www/script/test/replicator_db_successive.js
+++ /dev/null
@@ -1,127 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
-couchTests.replicator_db_successive = function(debug) {
-
-  if (debug) debugger;
-
-  var populate_db = replicator_db.populate_db;
-  var docs1 = replicator_db.docs1;
-  var dbA = replicator_db.dbA;
-  var dbB = replicator_db.dbB;
-  var repDb = replicator_db.repDb;
-  var wait = replicator_db.wait;
-  var waitForRep = replicator_db.waitForRep;
-  var waitForSeq = replicator_db.waitForSeq;
-
-  function successive_identical_replications() {
-    populate_db(dbA, docs1);
-    populate_db(dbB, []);
-
-    var repDoc1 = {
-      _id: "foo_ident_rep_1",
-      source: dbA.name,
-      target: dbB.name
-    };
-    T(repDb.save(repDoc1).ok);
-
-    waitForRep(repDb, repDoc1, "completed");
-    for (var i = 0; i < docs1.length; i++) {
-      var doc = docs1[i];
-      var copy = dbB.open(doc._id);
-      T(copy !== null);
-      T(copy.value === doc.value);
-    }
-
-    var repDoc1_copy = repDb.open(repDoc1._id);
-    T(repDoc1_copy !== null);
-    T(repDoc1_copy.source === repDoc1.source);
-    T(repDoc1_copy.target === repDoc1.target);
-    T(repDoc1_copy._replication_state === "completed");
-    T(typeof repDoc1_copy._replication_state_time === "string");
-    T(typeof repDoc1_copy._replication_id  === "string");
-    T(typeof repDoc1_copy._replication_stats === "object", "doc has stats");
-    var stats = repDoc1_copy._replication_stats;
-    TEquals(docs1.length, stats.revisions_checked,
-      "right # of revisions_checked");
-    TEquals(docs1.length, stats.missing_revisions_found,
-      "right # of missing_revisions_found");
-    TEquals(docs1.length, stats.docs_read, "right # of docs_read");
-    TEquals(docs1.length, stats.docs_written, "right # of docs_written");
-    TEquals(0, stats.doc_write_failures, "right # of doc_write_failures");
-    TEquals(dbA.info().update_seq, stats.checkpointed_source_seq,
-      "right checkpointed_source_seq");
-
-    var newDoc = {
-      _id: "doc666",
-      value: 666
-    };
-    T(dbA.save(newDoc).ok);
-
-    wait(200);
-    var newDoc_copy = dbB.open(newDoc._id);
-    // not replicated because first replication is complete (not continuous)
-    T(newDoc_copy === null);
-
-    var repDoc2 = {
-      _id: "foo_ident_rep_2",
-      source: dbA.name,
-      target: dbB.name
-    };
-    T(repDb.save(repDoc2).ok);
-
-    waitForRep(repDb, repDoc2, "completed");
-    var newDoc_copy = dbB.open(newDoc._id);
-    T(newDoc_copy !== null);
-    T(newDoc_copy.value === newDoc.value);
-
-    var repDoc2_copy = repDb.open(repDoc2._id);
-    T(repDoc2_copy !== null);
-    T(repDoc2_copy.source === repDoc1.source);
-    T(repDoc2_copy.target === repDoc1.target);
-    T(repDoc2_copy._replication_state === "completed");
-    T(typeof repDoc2_copy._replication_state_time === "string");
-    T(typeof repDoc2_copy._replication_id === "string");
-    T(repDoc2_copy._replication_id === repDoc1_copy._replication_id);
-    T(typeof repDoc2_copy._replication_stats === "object", "doc has stats");
-    stats = repDoc2_copy._replication_stats;
-    TEquals(1, stats.revisions_checked, "right # of revisions_checked");
-    TEquals(1, stats.missing_revisions_found,
-      "right # of missing_revisions_found");
-    TEquals(1, stats.docs_read, "right # of docs_read");
-    TEquals(1, stats.docs_written, "right # of docs_written");
-    TEquals(0, stats.doc_write_failures, "right # of doc_write_failures");
-    TEquals(dbA.info().update_seq, stats.checkpointed_source_seq,
-      "right checkpointed_source_seq");
-  }
-
-  var server_config = [
-    {
-      section: "couch_httpd_auth",
-      key: "iterations",
-      value: "1"
-    },
-    {
-      section: "replicator",
-      key: "db",
-      value: repDb.name
-    }
-  ];
-
-  repDb.deleteDb();
-  run_on_modified_server(server_config, successive_identical_replications);
-
-  // cleanup
-  repDb.deleteDb();
-  dbA.deleteDb();
-  dbB.deleteDb();
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/www/script/test/replicator_db_survives.js
----------------------------------------------------------------------
diff --git a/share/www/script/test/replicator_db_survives.js b/share/www/script/test/replicator_db_survives.js
deleted file mode 100644
index 38273ca..0000000
--- a/share/www/script/test/replicator_db_survives.js
+++ /dev/null
@@ -1,126 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
-couchTests.replicator_db_survives = function(debug) {
-
-  if (debug) debugger;
-
-  var populate_db = replicator_db.populate_db;
-  var docs1 = replicator_db.docs1;
-  var dbA = replicator_db.dbA;
-  var dbB = replicator_db.dbB;
-  var repDb = replicator_db.repDb;
-  var usersDb = replicator_db.usersDb;
-  var wait = replicator_db.wait;
-  var waitForRep = replicator_db.waitForRep;
-  var waitForSeq = replicator_db.waitForSeq;
-  var waitForDocPos = replicator_db.waitForDocPos;
-  var wait_rep_doc = replicator_db.wait_rep_doc;
-
-  function continuous_replication_survives_restart() {
-    var origRepDbName = CouchDB.request(
-      "GET", "/_config/replicator/db").responseText;
-
-    repDb.deleteDb();
-
-    var xhr = CouchDB.request("PUT", "/_config/replicator/db", {
-      body : JSON.stringify(repDb.name),
-      headers: {"X-Couch-Persist": "false"}
-    });
-    T(xhr.status === 200);
-
-    populate_db(dbA, docs1);
-    populate_db(dbB, []);
-
-    var repDoc = {
-      _id: "foo_cont_rep_survives_doc",
-      source: dbA.name,
-      target: dbB.name,
-      continuous: true
-    };
-
-    T(repDb.save(repDoc).ok);
-
-    waitForSeq(dbA, dbB);
-    for (var i = 0; i < docs1.length; i++) {
-      var doc = docs1[i];
-      var copy = dbB.open(doc._id);
-      T(copy !== null);
-      T(copy.value === doc.value);
-    }
-
-    repDb.ensureFullCommit();
-    dbA.ensureFullCommit();
-
-    restartServer();
-
-    xhr = CouchDB.request("PUT", "/_config/replicator/db", {
-      body : JSON.stringify(repDb.name),
-      headers: {"X-Couch-Persist": "false"}
-    });
-
-    T(xhr.status === 200);
-
-    // add another doc to source, it will be replicated to target
-    var docX = {
-      _id: "foo1000",
-      value: 1001
-    };
-
-    T(dbA.save(docX).ok);
-
-    waitForSeq(dbA, dbB);
-    var copy = dbB.open("foo1000");
-    T(copy !== null);
-    T(copy.value === 1001);
-
-    repDoc = waitForDocPos(repDb, "foo_cont_rep_survives_doc", 3);
-    T(repDoc !== null);
-    T(repDoc.continuous === true);
-
-    // stop replication
-    T(repDb.deleteDoc(repDoc).ok);
-
-    xhr = CouchDB.request("PUT", "/_config/replicator/db", {
-      body : origRepDbName,
-      headers: {"X-Couch-Persist": "false"}
-    });
-    T(xhr.status === 200);
-  }
-
-  var server_config = [
-    {
-      section: "couch_httpd_auth",
-      key: "iterations",
-      value: "1"
-    },
-    {
-      section: "replicator",
-      key: "db",
-      value: repDb.name
-    },
-    {
-      section: "couch_httpd_auth",
-      key: "authentication_db",
-      value: usersDb.name
-    }
-  ];
-
-  repDb.deleteDb();
-  run_on_modified_server(server_config, continuous_replication_survives_restart);
-
-  // cleanup
-  repDb.deleteDb();
-  dbA.deleteDb();
-  dbB.deleteDb();
-  usersDb.deleteDb();
-}

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/www/script/test/replicator_db_swap_rep_db.js
----------------------------------------------------------------------
diff --git a/share/www/script/test/replicator_db_swap_rep_db.js b/share/www/script/test/replicator_db_swap_rep_db.js
deleted file mode 100644
index 04f4e9f..0000000
--- a/share/www/script/test/replicator_db_swap_rep_db.js
+++ /dev/null
@@ -1,170 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
-couchTests.replicator_db_swap_rep_db = function(debug) {
-
-  if (debug) debugger;
-
-  var populate_db = replicator_db.populate_db;
-  var docs1 = replicator_db.docs1;
-  var dbA = replicator_db.dbA;
-  var dbB = replicator_db.dbB;
-  var repDb = replicator_db.repDb;
-  var usersDb = replicator_db.usersDb;
-  var wait = replicator_db.wait;
-  var waitForRep = replicator_db.waitForRep;
-  var waitForSeq = replicator_db.waitForSeq;
-  var wait_rep_doc = replicator_db.wait_rep_doc;
-
-  function swap_rep_db() {
-    var repDb2 = new CouchDB("test_suite_rep_db_2");
-    var dbA = new CouchDB("test_suite_rep_db_a");
-    var dbA_copy = new CouchDB("test_suite_rep_db_a_copy");
-    var dbB = new CouchDB("test_suite_rep_db_b");
-    var dbB_copy = new CouchDB("test_suite_rep_db_b_copy");
-    var dbC = new CouchDB("test_suite_rep_db_c");
-    var dbC_copy = new CouchDB("test_suite_rep_db_c_copy");
-    var repDoc1, repDoc2, repDoc3;
-    var xhr, i, doc, copy, new_doc;
-
-    populate_db(dbA, docs1);
-    populate_db(dbB, docs1);
-    populate_db(dbC, docs1);
-    populate_db(dbA_copy, []);
-    populate_db(dbB_copy, []);
-    populate_db(dbC_copy, []);
-    populate_db(repDb2, []);
-
-    repDoc1 = {
-      _id: "rep1",
-      source: CouchDB.protocol + CouchDB.host + "/" + dbA.name,
-      target: dbA_copy.name,
-      continuous: true
-    };
-    repDoc2 = {
-      _id: "rep2",
-      source: CouchDB.protocol + CouchDB.host + "/" + dbB.name,
-      target: dbB_copy.name,
-      continuous: true
-    };
-    repDoc3 = {
-      _id: "rep3",
-      source: CouchDB.protocol + CouchDB.host + "/" + dbC.name,
-      target: dbC_copy.name,
-      continuous: true
-    };
-
-    TEquals(true, repDb.save(repDoc1).ok);
-    TEquals(true, repDb.save(repDoc2).ok);
-
-    waitForSeq(dbA, dbA_copy);
-    waitForSeq(dbB, dbB_copy);
-
-    xhr = CouchDB.request("PUT", "/_config/replicator/db",{
-      body : JSON.stringify(repDb2.name),
-      headers: {"X-Couch-Persist": "false"}
-    });
-    TEquals(200, xhr.status);
-
-    // Temporary band-aid, give the replicator db some
-    // time to make the switch
-    wait(500);
-
-    new_doc = {
-      _id: "foo666",
-      value: 666
-    };
-
-    TEquals(true, dbA.save(new_doc).ok);
-    TEquals(true, dbB.save(new_doc).ok);
-    waitForSeq(dbA, dbA_copy);
-    waitForSeq(dbB, dbB_copy);
-
-    TEquals(true, repDb2.save(repDoc3).ok);
-    waitForSeq(dbC, dbC_copy);
-
-    for (i = 0; i < docs1.length; i++) {
-      doc = docs1[i];
-      copy = dbA_copy.open(doc._id);
-      T(copy !== null);
-      TEquals(doc.value, copy.value);
-      copy = dbB_copy.open(doc._id);
-      T(copy !== null);
-      TEquals(doc.value, copy.value);
-      copy = dbC_copy.open(doc._id);
-      T(copy !== null);
-      TEquals(doc.value, copy.value);
-    }
-
-    // replications rep1 and rep2 should have been stopped when the replicator
-    // database was swapped
-    copy = dbA_copy.open(new_doc._id);
-    TEquals(null, copy);
-    copy = dbB_copy.open(new_doc._id);
-    TEquals(null, copy);
-
-    xhr = CouchDB.request("PUT", "/_config/replicator/db",{
-      body : JSON.stringify(repDb.name),
-      headers: {"X-Couch-Persist": "false"}
-    });
-    TEquals(200, xhr.status);
-
-    // after setting the replicator database to the former, replications rep1
-    // and rep2 should have been resumed, while rep3 was stopped
-    TEquals(true, dbC.save(new_doc).ok);
-    wait(1000);
-
-    waitForSeq(dbA, dbA_copy);
-    waitForSeq(dbB, dbB_copy);
-
-    copy = dbA_copy.open(new_doc._id);
-    T(copy !== null);
-    TEquals(new_doc.value, copy.value);
-    copy = dbB_copy.open(new_doc._id);
-    T(copy !== null);
-    TEquals(new_doc.value, copy.value);
-    copy = dbC_copy.open(new_doc._id);
-    TEquals(null, copy);
-  }
-  var server_config = [
-    {
-      section: "couch_httpd_auth",
-      key: "iterations",
-      value: "1"
-    },
-    {
-      section: "replicator",
-      key: "db",
-      value: repDb.name
-    },
-    {
-      section: "couch_httpd_auth",
-      key: "authentication_db",
-      value: usersDb.name
-    }
-  ];
-
-  repDb.deleteDb();
-  run_on_modified_server(server_config, swap_rep_db);
-
-  // cleanup
-  repDb.deleteDb();
-  dbA.deleteDb();
-  dbB.deleteDb();
-  usersDb.deleteDb();
-  (new CouchDB("test_suite_rep_db_2")).deleteDb();
-  (new CouchDB("test_suite_rep_db_c")).deleteDb();
-  (new CouchDB("test_suite_rep_db_a_copy")).deleteDb();
-  (new CouchDB("test_suite_rep_db_b_copy")).deleteDb();
-  (new CouchDB("test_suite_rep_db_c_copy")).deleteDb();
-
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/www/script/test/replicator_db_update_security.js
----------------------------------------------------------------------
diff --git a/share/www/script/test/replicator_db_update_security.js b/share/www/script/test/replicator_db_update_security.js
deleted file mode 100644
index 4651514..0000000
--- a/share/www/script/test/replicator_db_update_security.js
+++ /dev/null
@@ -1,92 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
-couchTests.replicator_db_update_security = function(debug) {
-
-  if (debug) debugger;
-
-  var populate_db = replicator_db.populate_db;
-  var docs1 = replicator_db.docs1;
-  var dbA = replicator_db.dbA;
-  var dbB = replicator_db.dbB;
-  var repDb = replicator_db.repDb;
-  var usersDb = replicator_db.usersDb;
-  var wait = replicator_db.wait;
-  var waitForRep = replicator_db.waitForRep;
-  var waitForSeq = replicator_db.waitForSeq;
-  var wait_rep_doc = replicator_db.wait_rep_doc;
-
-  function test_rep_db_update_security() {
-    var dbA_copy = new CouchDB("test_suite_rep_db_a_copy");
-    var dbB_copy = new CouchDB("test_suite_rep_db_b_copy");
-    var repDoc1, repDoc2;
-    var xhr, i, doc, copy, new_doc;
-    var docs = makeDocs(1, 3);
-
-    populate_db(dbA, docs);
-    populate_db(dbB, docs);
-    populate_db(dbA_copy, []);
-    populate_db(dbB_copy, []);
-
-    repDoc1 = {
-      _id: "rep1",
-      source: CouchDB.protocol + CouchDB.host + "/" + dbA.name,
-      target: dbA_copy.name
-    };
-    repDoc2 = {
-      _id: "rep2",
-      source: CouchDB.protocol + CouchDB.host + "/" + dbB.name,
-      target: dbB_copy.name
-    };
-
-    TEquals(true, repDb.save(repDoc1).ok);
-    waitForRep(repDb, repDoc1, "completed");
-
-    T(repDb.setSecObj({
-      readers: {
-        names: ["joe"]
-      }
-    }).ok);
-
-    TEquals(true, repDb.save(repDoc2).ok);
-    waitForRep(repDb, repDoc2, "completed");
-  }
-
-  var server_config = [
-    {
-      section: "couch_httpd_auth",
-      key: "iterations",
-      value: "1"
-    },
-    {
-      section: "replicator",
-      key: "db",
-      value: repDb.name
-    },
-    {
-      section: "couch_httpd_auth",
-      key: "authentication_db",
-      value: usersDb.name
-    }
-  ];
-
-  repDb.deleteDb();
-  run_on_modified_server(server_config, test_rep_db_update_security);
-
-  // cleanup
-  repDb.deleteDb();
-  dbA.deleteDb();
-  dbB.deleteDb();
-  usersDb.deleteDb();
-  (new CouchDB("test_suite_rep_db_a_copy")).deleteDb();
-  (new CouchDB("test_suite_rep_db_b_copy")).deleteDb();
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/www/script/test/replicator_db_user_ctx.js
----------------------------------------------------------------------
diff --git a/share/www/script/test/replicator_db_user_ctx.js b/share/www/script/test/replicator_db_user_ctx.js
deleted file mode 100644
index 570fc7d..0000000
--- a/share/www/script/test/replicator_db_user_ctx.js
+++ /dev/null
@@ -1,272 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
-couchTests.replicator_db_user_ctx = function(debug) {
-
-  if (debug) debugger;
-
-  var populate_db = replicator_db.populate_db;
-  var docs1 = replicator_db.docs1;
-  var dbA = replicator_db.dbA;
-  var dbB = replicator_db.dbB;
-  var repDb = replicator_db.repDb;
-  var usersDb = replicator_db.usersDb;
-  var wait = replicator_db.wait;
-  var waitForRep = replicator_db.waitForRep;
-  var waitForSeq = replicator_db.waitForSeq;
-  var wait_rep_doc = replicator_db.wait_rep_doc;
-
- function test_user_ctx_validation() {
-    populate_db(dbA, docs1);
-    populate_db(dbB, []);
-    populate_db(usersDb, []);
-
-    var joeUserDoc = CouchDB.prepareUserDoc({
-      name: "joe",
-      roles: ["erlanger", "bar"]
-    }, "erly");
-    var fdmananaUserDoc = CouchDB.prepareUserDoc({
-      name: "fdmanana",
-      roles: ["a", "b", "c"]
-    }, "qwerty");
-
-    TEquals(true, usersDb.save(joeUserDoc).ok);
-    TEquals(true, usersDb.save(fdmananaUserDoc).ok);
-
-    T(dbB.setSecObj({
-      admins: {
-        names: [],
-        roles: ["god"]
-      },
-      readers: {
-        names: [],
-        roles: ["foo"]
-      }
-    }).ok);
-
-    TEquals(true, CouchDB.login("joe", "erly").ok);
-    TEquals("joe", CouchDB.session().userCtx.name);
-    TEquals(-1, CouchDB.session().userCtx.roles.indexOf("_admin"));
-
-    var repDoc = {
-      _id: "foo_rep",
-      source: CouchDB.protocol + CouchDB.host + "/" + dbA.name,
-      target: dbB.name
-    };
-
-    try {
-      repDb.save(repDoc);
-      T(false, "Should have failed, user_ctx missing.");
-    } catch (x) {
-      TEquals("forbidden", x.error);
-    }
-
-    repDoc.user_ctx = {
-      name: "john",
-      roles: ["erlanger"]
-    };
-
-    try {
-      repDb.save(repDoc);
-      T(false, "Should have failed, wrong user_ctx.name.");
-    } catch (x) {
-      TEquals("forbidden", x.error);
-    }
-
-    repDoc.user_ctx = {
-      name: "joe",
-      roles: ["bar", "god", "erlanger"]
-    };
-
-    try {
-      repDb.save(repDoc);
-      T(false, "Should have failed, a bad role in user_ctx.roles.");
-    } catch (x) {
-      TEquals("forbidden", x.error);
-    }
-
-    // user_ctx.roles might contain only a subset of the user's roles
-    repDoc.user_ctx = {
-      name: "joe",
-      roles: ["erlanger"]
-    };
-
-    TEquals(true, repDb.save(repDoc).ok);
-    CouchDB.logout();
-
-    waitForRep(repDb, repDoc, "error");
-    var repDoc1 = repDb.open(repDoc._id);
-    T(repDoc1 !== null);
-    TEquals(repDoc.source, repDoc1.source);
-    TEquals(repDoc.target, repDoc1.target);
-    TEquals("error", repDoc1._replication_state);
-    TEquals("string", typeof repDoc1._replication_id);
-    TEquals("string", typeof repDoc1._replication_state_time);
-
-    TEquals(true, CouchDB.login("fdmanana", "qwerty").ok);
-    TEquals("fdmanana", CouchDB.session().userCtx.name);
-    TEquals(-1, CouchDB.session().userCtx.roles.indexOf("_admin"));
-
-    try {
-      T(repDb.deleteDoc(repDoc1).ok);
-      T(false, "Shouldn't be able to delete replication document.");
-    } catch (x) {
-      TEquals("forbidden", x.error);
-    }
-
-    CouchDB.logout();
-    TEquals(true, CouchDB.login("joe", "erly").ok);
-    TEquals("joe", CouchDB.session().userCtx.name);
-    TEquals(-1, CouchDB.session().userCtx.roles.indexOf("_admin"));
-
-    T(repDb.deleteDoc(repDoc1).ok);
-    CouchDB.logout();
-
-    for (var i = 0; i < docs1.length; i++) {
-      var doc = docs1[i];
-      var copy = dbB.open(doc._id);
-
-      TEquals(null, copy);
-    }
-
-    T(dbB.setSecObj({
-      admins: {
-        names: [],
-        roles: ["god", "erlanger"]
-      },
-      readers: {
-        names: [],
-        roles: ["foo"]
-      }
-    }).ok);
-
-    TEquals(true, CouchDB.login("joe", "erly").ok);
-    TEquals("joe", CouchDB.session().userCtx.name);
-    TEquals(-1, CouchDB.session().userCtx.roles.indexOf("_admin"));
-
-    repDoc = {
-      _id: "foo_rep_2",
-      source: CouchDB.protocol + CouchDB.host + "/" + dbA.name,
-      target: dbB.name,
-      user_ctx: {
-        name: "joe",
-        roles: ["erlanger"]
-      }
-    };
-
-    TEquals(true, repDb.save(repDoc).ok);
-    CouchDB.logout();
-
-    waitForRep(repDb, repDoc, "complete");
-    repDoc1 = repDb.open(repDoc._id);
-    T(repDoc1 !== null);
-    TEquals(repDoc.source, repDoc1.source);
-    TEquals(repDoc.target, repDoc1.target);
-    TEquals("completed", repDoc1._replication_state);
-    TEquals("string", typeof repDoc1._replication_id);
-    TEquals("string", typeof repDoc1._replication_state_time);
-
-    for (var i = 0; i < docs1.length; i++) {
-      var doc = docs1[i];
-      var copy = dbB.open(doc._id);
-
-      T(copy !== null);
-      TEquals(doc.value, copy.value);
-    }
-
-    // Admins don't need to supply a user_ctx property in replication docs.
-    // If they do not, the implicit user_ctx "user_ctx": {name: null, roles: []}
-    // is used, meaning that design documents will not be replicated into
-    // local targets
-    T(dbB.setSecObj({
-      admins: {
-        names: [],
-        roles: []
-      },
-      readers: {
-        names: [],
-        roles: []
-      }
-    }).ok);
-
-    var ddoc = { _id: "_design/foo" };
-    TEquals(true, dbA.save(ddoc).ok);
-
-    repDoc = {
-      _id: "foo_rep_3",
-      source: CouchDB.protocol + CouchDB.host + "/" + dbA.name,
-      target: dbB.name
-    };
-
-    TEquals(true, repDb.save(repDoc).ok);
-    waitForRep(repDb, repDoc, "complete");
-    repDoc1 = repDb.open(repDoc._id);
-    T(repDoc1 !== null);
-    TEquals(repDoc.source, repDoc1.source);
-    TEquals(repDoc.target, repDoc1.target);
-    TEquals("completed", repDoc1._replication_state);
-    TEquals("string", typeof repDoc1._replication_id);
-    TEquals("string", typeof repDoc1._replication_state_time);
-
-    var ddoc_copy = dbB.open(ddoc._id);
-    T(ddoc_copy === null);
-
-    repDoc = {
-      _id: "foo_rep_4",
-      source: CouchDB.protocol + CouchDB.host + "/" + dbA.name,
-      target: dbB.name,
-      user_ctx: {
-        roles: ["_admin"]
-      }
-    };
-
-    TEquals(true, repDb.save(repDoc).ok);
-    waitForRep(repDb, repDoc, "complete");
-    repDoc1 = repDb.open(repDoc._id);
-    T(repDoc1 !== null);
-    TEquals(repDoc.source, repDoc1.source);
-    TEquals(repDoc.target, repDoc1.target);
-    TEquals("completed", repDoc1._replication_state);
-    TEquals("string", typeof repDoc1._replication_id);
-    TEquals("string", typeof repDoc1._replication_state_time);
-
-    ddoc_copy = dbB.open(ddoc._id);
-    T(ddoc_copy !== null);
-  }
-
-  var server_config = [
-    {
-      section: "couch_httpd_auth",
-      key: "iterations",
-      value: "1"
-    },
-    {
-      section: "replicator",
-      key: "db",
-      value: repDb.name
-    },
-    {
-      section: "couch_httpd_auth",
-      key: "authentication_db",
-      value: usersDb.name
-    }
-  ];
-
-  repDb.deleteDb();
-  run_on_modified_server(server_config, test_user_ctx_validation);
-
-  // cleanup
-  repDb.deleteDb();
-  dbA.deleteDb();
-  dbB.deleteDb();
-  usersDb.deleteDb();
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/www/script/test/replicator_db_write_auth.js
----------------------------------------------------------------------
diff --git a/share/www/script/test/replicator_db_write_auth.js b/share/www/script/test/replicator_db_write_auth.js
deleted file mode 100644
index 697abf3..0000000
--- a/share/www/script/test/replicator_db_write_auth.js
+++ /dev/null
@@ -1,102 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
-couchTests.replicator_db_survives = function(debug) {
-
-  if (debug) debugger;
-
-  var populate_db = replicator_db.populate_db;
-  var docs1 = replicator_db.docs1;
-  var dbA = replicator_db.dbA;
-  var dbB = replicator_db.dbB;
-  var repDb = replicator_db.repDb;
-  var usersDb = replicator_db.usersDb;
-  var wait = replicator_db.wait;
-  var waitForRep = replicator_db.waitForRep;
-  var waitForSeq = replicator_db.waitForSeq;
-  var waitForDocPos = replicator_db.waitForDocPos;
-  var wait_rep_doc = replicator_db.wait_rep_doc;
-
-  function rep_db_write_authorization() {
-    populate_db(dbA, docs1);
-    populate_db(dbB, []);
-
-    var server_admins_config = [
-      {
-        section: "admins",
-        key: "fdmanana",
-        value: "qwerty"
-      }
-    ];
-
-    run_on_modified_server(server_admins_config, function() {
-      var repDoc = {
-        _id: "foo_rep_doc",
-        source: dbA.name,
-        target: dbB.name,
-        continuous: true
-      };
-
-      T(CouchDB.login("fdmanana", "qwerty").ok);
-      T(CouchDB.session().userCtx.name === "fdmanana");
-      T(CouchDB.session().userCtx.roles.indexOf("_admin") !== -1);
-
-      T(repDb.save(repDoc).ok);
-
-      waitForRep(repDb, repDoc, "completed");
-
-      for (var i = 0; i < docs1.length; i++) {
-        var doc = docs1[i];
-        var copy = dbB.open(doc._id);
-
-        T(copy !== null);
-        T(copy.value === doc.value);
-      }
-
-      repDoc = repDb.open("foo_rep_doc");
-      T(repDoc !== null);
-      repDoc.target = "test_suite_foo_db";
-      repDoc.create_target = true;
-
-      // Only the replicator can update replication documents.
-      // Admins can only add and delete replication documents.
-      try {
-        repDb.save(repDoc);
-        T(false && "Should have thrown an exception");
-      } catch (x) {
-        T(x["error"] === "forbidden");
-      }
-    });
-  }
-
-  var server_config = [
-    {
-      section: "couch_httpd_auth",
-      key: "iterations",
-      value: "1"
-    },
-    {
-      section: "replicator",
-      key: "db",
-      value: repDb.name
-    }
-  ];
-
-  repDb.deleteDb();
-  run_on_modified_server(server_config, rep_db_write_authorization);
-
-  // cleanup
-  repDb.deleteDb();
-  dbA.deleteDb();
-  dbB.deleteDb();
-  usersDb.deleteDb();
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/www/script/test/rev_stemming.js
----------------------------------------------------------------------
diff --git a/share/www/script/test/rev_stemming.js b/share/www/script/test/rev_stemming.js
deleted file mode 100644
index 954da79..0000000
--- a/share/www/script/test/rev_stemming.js
+++ /dev/null
@@ -1,110 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
-couchTests.rev_stemming = function(debug) {
-  var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"});
-  db.deleteDb();
-  db.createDb();
-  var db = new CouchDB("test_suite_db_a", {"X-Couch-Full-Commit":"false"});
-  db.deleteDb();
-  db.createDb();
-  var dbB = new CouchDB("test_suite_db_b", {"X-Couch-Full-Commit":"false"});
-  dbB.deleteDb();
-  dbB.createDb();
-  if (debug) debugger;
-
-  var newLimit = 5;
-
-  T(db.getDbProperty("_revs_limit") == 1000);
-
-  // Make an invalid request to _revs_limit
-  // Should return 400
-  var xhr = CouchDB.request("PUT", "/test_suite_db/_revs_limit", {body:"\"foo\""});
-  T(xhr.status == 400);
-  var result = JSON.parse(xhr.responseText);
-  T(result.error == "bad_request");
-  T(result.reason == "Rev limit has to be an integer");
-
-  var doc = {_id:"foo",foo:0}
-  for( var i=0; i < newLimit + 1; i++) {
-    doc.foo++;
-    T(db.save(doc).ok);
-  }
-  var doc0 = db.open("foo", {revs:true});
-  T(doc0._revisions.ids.length == newLimit + 1);
-
-  var docBar = {_id:"bar",foo:0}
-  for( var i=0; i < newLimit + 1; i++) {
-    docBar.foo++;
-    T(db.save(docBar).ok);
-  }
-  T(db.open("bar", {revs:true})._revisions.ids.length == newLimit + 1);
-
-  T(db.setDbProperty("_revs_limit", newLimit).ok);
-
-  for( var i=0; i < newLimit + 1; i++) {
-    doc.foo++;
-    T(db.save(doc).ok);
-  }
-  doc0 = db.open("foo", {revs:true});
-  T(doc0._revisions.ids.length == newLimit);
-
-
-  // If you replicate after you make more edits than the limit, you'll
-  // cause a spurious edit conflict.
-  CouchDB.replicate("test_suite_db_a", "test_suite_db_b");
-  var docB1 = dbB.open("foo",{conflicts:true})
-  T(docB1._conflicts == null);
-
-  for( var i=0; i < newLimit - 1; i++) {
-    doc.foo++;
-    T(db.save(doc).ok);
-  }
-
-  // one less edit than limit, no conflict
-  CouchDB.replicate("test_suite_db_a", "test_suite_db_b");
-  var docB1 = dbB.open("foo",{conflicts:true})
-  T(docB1._conflicts == null);
-
-  //now we hit the limit
-  for( var i=0; i < newLimit; i++) {
-    doc.foo++;
-    T(db.save(doc).ok);
-  }
-
-  CouchDB.replicate("test_suite_db_a", "test_suite_db_b");
-
-  var docB2 = dbB.open("foo",{conflicts:true});
-
-  // we have a conflict, but the previous replicated rev is always the losing
-  // conflict
-  T(docB2._conflicts[0] == docB1._rev)
-
-  // We having already updated bar before setting the limit, so it's still got
-  // a long rev history. compact to stem the revs.
-
-  T(db.open("bar", {revs:true})._revisions.ids.length == newLimit + 1);
-
-  T(db.compact().ok);
-
-  // compaction isn't instantaneous, loop until done
-  while (db.info().compact_running) {};
-
-  // force reload because ETags don't honour compaction
-  var req = db.request("GET", "/test_suite_db_a/bar?revs=true", {
-    headers:{"if-none-match":"pommes"}
-  });
-
-  var finalDoc = JSON.parse(req.responseText);
-  TEquals(newLimit, finalDoc._revisions.ids.length,
-    "should return a truncated revision list");
-};

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/www/script/test/rewrite.js
----------------------------------------------------------------------
diff --git a/share/www/script/test/rewrite.js b/share/www/script/test/rewrite.js
deleted file mode 100644
index 5c56fa5..0000000
--- a/share/www/script/test/rewrite.js
+++ /dev/null
@@ -1,505 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
- 
- 
- 
-couchTests.rewrite = function(debug) {
-  if (debug) debugger;
-  var dbNames = ["test_suite_db", "test_suite_db/with_slashes"];
-  for (var i=0; i < dbNames.length; i++) {
-    var db = new CouchDB(dbNames[i]);
-    var dbName = encodeURIComponent(dbNames[i]);
-    db.deleteDb();
-    db.createDb();
-  
-    
-    run_on_modified_server(
-      [{section: "httpd",
-        key: "authentication_handlers",
-        value: "{couch_httpd_auth, special_test_authentication_handler}"},
-       {section:"httpd",
-        key: "WWW-Authenticate",
-        value: "X-Couch-Test-Auth"}],
-      
-      function(){
-        var designDoc = {
-          _id:"_design/test",
-          language: "javascript",
-          _attachments:{
-            "foo.txt": {
-              content_type:"text/plain",
-              data: "VGhpcyBpcyBhIGJhc2U2NCBlbmNvZGVkIHRleHQ="
-            }
-          },
-          rewrites: [
-            {
-              "from": "foo",
-              "to": "foo.txt"
-            },
-            {
-              "from": "foo2",
-              "to": "foo.txt",
-              "method": "GET"
-            },
-            {
-              "from": "hello/:id",
-              "to": "_update/hello/:id",
-              "method": "PUT"
-            },
-            {
-              "from": "/welcome",
-              "to": "_show/welcome"
-            },
-            {
-              "from": "/welcome/:name",
-              "to": "_show/welcome",
-              "query": {
-                "name": ":name"
-              }
-            },
-            {
-              "from": "/welcome2",
-              "to": "_show/welcome",
-              "query": {
-                "name": "user"
-              }
-            },
-            {
-              "from": "/welcome3/:name",
-              "to": "_update/welcome2/:name",
-              "method": "PUT"
-            },
-            {
-              "from": "/welcome3/:name",
-              "to": "_show/welcome2/:name",
-              "method": "GET"
-            },
-            {
-              "from": "/welcome4/*",
-              "to" : "_show/welcome3",
-              "query": {
-                "name": "*"
-              }
-            },
-            {
-              "from": "/welcome5/*",
-              "to" : "_show/*",
-              "query": {
-                "name": "*"
-              }
-            },
-            {
-              "from": "basicView",
-              "to": "_view/basicView",
-            },
-            {
-              "from": "simpleForm/basicView",
-              "to": "_list/simpleForm/basicView",
-            },
-            {
-              "from": "simpleForm/basicViewFixed",
-              "to": "_list/simpleForm/basicView",
-              "query": {
-                "startkey": 3,
-                "endkey": 8
-              }
-            },
-            {
-              "from": "simpleForm/basicViewPath/:start/:end",
-              "to": "_list/simpleForm/basicView",
-              "query": {
-                "startkey": ":start",
-                "endkey": ":end"
-              },
-              "formats": {
-                "start": "int",
-                "end": "int"
-              }
-            },
-            {
-              "from": "simpleForm/complexView",
-              "to": "_list/simpleForm/complexView",
-              "query": {
-                "key": [1, 2]
-              }
-            },
-            {
-              "from": "simpleForm/complexView2",
-              "to": "_list/simpleForm/complexView",
-              "query": {
-                "key": ["test", {}]
-              }
-            },
-            {
-              "from": "simpleForm/complexView3",
-              "to": "_list/simpleForm/complexView",
-              "query": {
-                "key": ["test", ["test", "essai"]]
-              }
-            },
-            {
-              "from": "simpleForm/complexView4",
-              "to": "_list/simpleForm/complexView2",
-              "query": {
-                "key": {"c": 1}
-              }
-            },
-            {
-              "from": "simpleForm/complexView5/:a/:b",
-              "to": "_list/simpleForm/complexView3",
-              "query": {
-                "key": [":a", ":b"]
-              }
-            },
-            {
-              "from": "simpleForm/complexView6",
-              "to": "_list/simpleForm/complexView3",
-              "query": {
-                "key": [":a", ":b"]
-              }
-            },
-            {
-              "from": "simpleForm/complexView7/:a/:b",
-              "to": "_view/complexView3",
-              "query": {
-                "key": [":a", ":b"],
-                "include_docs": ":doc"
-              },
-              "format": {
-                "doc": "bool"
-              }
-
-            },
-            {
-              "from": "/",
-              "to": "_view/basicView",
-            },
-            {
-              "from": "/db/*",
-              "to": "../../*"
-            }
-          ],
-          lists: {
-            simpleForm: stringFun(function(head, req) {
-              log("simpleForm");
-              send('<ul>');
-              var row, row_number = 0, prevKey, firstKey = null;
-              while (row = getRow()) {
-                row_number += 1;
-                if (!firstKey) firstKey = row.key;
-                prevKey = row.key;
-                send('\n<li>Key: '+row.key
-                     +' Value: '+row.value
-                     +' LineNo: '+row_number+'</li>');
-              }
-              return '</ul><p>FirstKey: '+ firstKey + ' LastKey: '+ prevKey+'</p>';
-            }),
-          },
-          shows: {
-            "welcome": stringFun(function(doc,req) {
-              return "Welcome " + req.query["name"];
-            }),
-            "welcome2": stringFun(function(doc, req) {
-              return "Welcome " + doc.name;
-            }),
-            "welcome3": stringFun(function(doc,req) {
-              return "Welcome " + req.query["name"];
-            })
-          },
-          updates: {
-            "hello" : stringFun(function(doc, req) {
-              if (!doc) {
-                if (req.id) {
-                  return [{
-                    _id : req.id
-                  }, "New World"]
-                }
-                return [null, "Empty World"];
-              }
-              doc.world = "hello";
-              doc.edited_by = req.userCtx;
-              return [doc, "hello doc"];
-            }),
-            "welcome2": stringFun(function(doc, req) {
-              if (!doc) {
-                if (req.id) {
-                  return [{
-                    _id: req.id,
-                    name: req.id
-                  }, "New World"]
-                }
-                return [null, "Empty World"];
-              }
-              return [doc, "hello doc"];
-            })
-          },
-          views : {
-            basicView : {
-              map : stringFun(function(doc) {
-                if (doc.integer) {
-                  emit(doc.integer, doc.string);
-                }
-                
-              })
-            },
-            complexView: {
-              map: stringFun(function(doc) {
-                if (doc.type == "complex") {
-                  emit([doc.a, doc.b], doc.string);
-                }
-              })
-            },
-            complexView2: {
-              map: stringFun(function(doc) {
-                if (doc.type == "complex") {
-                  emit(doc.a, doc.string);
-                }
-              })
-            },
-            complexView3: {
-              map: stringFun(function(doc) {
-                if (doc.type == "complex") {
-                  emit(doc.b, doc.string);
-                }
-              })
-            }
-          }
-        }
-        
-        db.save(designDoc);
-        
-        var docs = makeDocs(0, 10);
-        db.bulkSave(docs);
-
-        var docs2 = [
-          {"a": 1, "b": 1, "string": "doc 1", "type": "complex"},
-          {"a": 1, "b": 2, "string": "doc 2", "type": "complex"},
-          {"a": "test", "b": {}, "string": "doc 3", "type": "complex"},
-          {"a": "test", "b": ["test", "essai"], "string": "doc 4", "type": "complex"},
-          {"a": {"c": 1}, "b": "", "string": "doc 5", "type": "complex"}
-        ];
-
-        db.bulkSave(docs2);
-
-        // test simple rewriting
-        
-        req = CouchDB.request("GET", "/"+dbName+"/_design/test/_rewrite/foo");
-        T(req.responseText == "This is a base64 encoded text");
-        T(req.getResponseHeader("Content-Type") == "text/plain");
-        
-        req = CouchDB.request("GET", "/"+dbName+"/_design/test/_rewrite/foo2");
-        T(req.responseText == "This is a base64 encoded text");
-        T(req.getResponseHeader("Content-Type") == "text/plain");
-        
-        
-        // test POST
-        // hello update world
-        
-        var doc = {"word":"plankton", "name":"Rusty"}
-        var resp = db.save(doc);
-        T(resp.ok);
-        var docid = resp.id;
-        
-        xhr = CouchDB.request("PUT", "/"+dbName+"/_design/test/_rewrite/hello/"+docid);
-        T(xhr.status == 201);
-        T(xhr.responseText == "hello doc");
-        T(/charset=utf-8/.test(xhr.getResponseHeader("Content-Type")))
-        
-        doc = db.open(docid);
-        T(doc.world == "hello");
-        
-        req = CouchDB.request("GET", "/"+dbName+"/_design/test/_rewrite/welcome?name=user");
-        T(req.responseText == "Welcome user");
-        
-        req = CouchDB.request("GET", "/"+dbName+"/_design/test/_rewrite/welcome/user");
-        T(req.responseText == "Welcome user");
-        
-        req = CouchDB.request("GET", "/"+dbName+"/_design/test/_rewrite/welcome2");
-        T(req.responseText == "Welcome user");
-        
-        xhr = CouchDB.request("PUT", "/"+dbName+"/_design/test/_rewrite/welcome3/test");
-        T(xhr.status == 201);
-        T(xhr.responseText == "New World");
-        T(/charset=utf-8/.test(xhr.getResponseHeader("Content-Type")));
-        
-        xhr = CouchDB.request("GET", "/"+dbName+"/_design/test/_rewrite/welcome3/test");
-        T(xhr.responseText == "Welcome test");
-
-        req = CouchDB.request("GET", "/"+dbName+"/_design/test/_rewrite/welcome4/user");
-        T(req.responseText == "Welcome user");
-
-        req = CouchDB.request("GET", "/"+dbName+"/_design/test/_rewrite/welcome5/welcome3");
-        T(req.responseText == "Welcome welcome3");
-        
-        xhr = CouchDB.request("GET", "/"+dbName+"/_design/test/_rewrite/basicView");
-        T(xhr.status == 200, "view call");
-        T(/{"total_rows":9/.test(xhr.responseText)); 
-
-        xhr = CouchDB.request("GET", "/"+dbName+"/_design/test/_rewrite/");
-        T(xhr.status == 200, "view call");
-        T(/{"total_rows":9/.test(xhr.responseText)); 
-
-        
-        // get with query params
-        xhr = CouchDB.request("GET", "/"+dbName+"/_design/test/_rewrite/simpleForm/basicView?startkey=3&endkey=8");
-        T(xhr.status == 200, "with query params");
-        T(!(/Key: 1/.test(xhr.responseText)));
-        T(/FirstKey: 3/.test(xhr.responseText));
-        T(/LastKey: 8/.test(xhr.responseText));
-        
-        xhr = CouchDB.request("GET", "/"+dbName+"/_design/test/_rewrite/simpleForm/basicViewFixed");
-        T(xhr.status == 200, "with query params");
-        T(!(/Key: 1/.test(xhr.responseText)));
-        T(/FirstKey: 3/.test(xhr.responseText));
-        T(/LastKey: 8/.test(xhr.responseText));
-        
-        // get with query params
-        xhr = CouchDB.request("GET", "/"+dbName+"/_design/test/_rewrite/simpleForm/basicViewFixed?startkey=4");
-        T(xhr.status == 200, "with query params");
-        T(!(/Key: 1/.test(xhr.responseText)));
-        T(/FirstKey: 3/.test(xhr.responseText));
-        T(/LastKey: 8/.test(xhr.responseText));
-        
-        // get with query params
-        xhr = CouchDB.request("GET", "/"+dbName+"/_design/test/_rewrite/simpleForm/basicViewPath/3/8");
-        T(xhr.status == 200, "with query params");
-        T(!(/Key: 1/.test(xhr.responseText)));
-        T(/FirstKey: 3/.test(xhr.responseText));
-        T(/LastKey: 8/.test(xhr.responseText));
-
-        // get with query params        
-        xhr = CouchDB.request("GET", "/"+dbName+"/_design/test/_rewrite/simpleForm/complexView");
-        T(xhr.status == 200, "with query params");
-        T(/FirstKey: [1, 2]/.test(xhr.responseText));
-        
-        xhr = CouchDB.request("GET", "/"+dbName+"/_design/test/_rewrite/simpleForm/complexView2");
-        T(xhr.status == 200, "with query params");
-        T(/Value: doc 3/.test(xhr.responseText));
-        
-        xhr = CouchDB.request("GET", "/"+dbName+"/_design/test/_rewrite/simpleForm/complexView3");
-        T(xhr.status == 200, "with query params");
-        T(/Value: doc 4/.test(xhr.responseText));
-        
-        xhr = CouchDB.request("GET", "/"+dbName+"/_design/test/_rewrite/simpleForm/complexView4");
-        T(xhr.status == 200, "with query params");
-        T(/Value: doc 5/.test(xhr.responseText));
-        
-        xhr = CouchDB.request("GET", "/"+dbName+"/_design/test/_rewrite/simpleForm/complexView5/test/essai");
-        T(xhr.status == 200, "with query params");
-        T(/Value: doc 4/.test(xhr.responseText));
-        
-        xhr = CouchDB.request("GET", "/"+dbName+"/_design/test/_rewrite/simpleForm/complexView6?a=test&b=essai");
-        T(xhr.status == 200, "with query params");
-        T(/Value: doc 4/.test(xhr.responseText));
-
-        xhr = CouchDB.request("GET", "/"+dbName+"/_design/test/_rewrite/simpleForm/complexView7/test/essai?doc=true");
-        T(xhr.status == 200, "with query params");
-        var result = JSON.parse(xhr.responseText);
-        T(typeof(result.rows[0].doc) === "object");
-        
-        // COUCHDB-2031 - path normalization versus qs params
-        xhr = CouchDB.request("GET", "/"+dbName+"/_design/test/_rewrite/db/_design/test?meta=true");
-        T(xhr.status == 200, "path normalization works with qs params");
-        var result = JSON.parse(xhr.responseText);
-        T(result['_id'] == "_design/test");
-        T(typeof(result['_revs_info']) === "object");
-
-        // test path relative to server
-        designDoc.rewrites.push({
-          "from": "uuids",
-          "to": "../../../_uuids"
-        });
-        T(db.save(designDoc).ok);
-        
-        var xhr = CouchDB.request("GET", "/"+dbName+"/_design/test/_rewrite/uuids");
-        T(xhr.status == 500);
-        var result = JSON.parse(xhr.responseText);
-        T(result.error == "insecure_rewrite_rule");
-
-        run_on_modified_server(
-          [{section: "httpd",
-            key: "secure_rewrites",
-            value: "false"}],
-          function() {
-            var xhr = CouchDB.request("GET", "/"+dbName+"/_design/test/_rewrite/uuids?cache=bust");
-            T(xhr.status == 200);
-            var result = JSON.parse(xhr.responseText);
-            T(result.uuids.length == 1);
-            var first = result.uuids[0];
-          });
-      });
-
-    // test invalid rewrites
-    // string
-    var ddoc = {
-      _id: "_design/invalid",
-      rewrites: "[{\"from\":\"foo\",\"to\":\"bar\"}]"
-    }
-    db.save(ddoc);
-    var res = CouchDB.request("GET", "/"+dbName+"/_design/invalid/_rewrite/foo");
-    TEquals(400, res.status, "should return 400");
-
-    var ddoc_requested_path = {
-      _id: "_design/requested_path",
-      rewrites:[
-        {"from": "show", "to": "_show/origin/0"},
-        {"from": "show_rewritten", "to": "_rewrite/show"}
-      ],
-      shows: {
-        origin: stringFun(function(doc, req) {
-          return req.headers["x-couchdb-requested-path"];
-        })}
-    };
-
-    db.save(ddoc_requested_path);
-    var url = "/"+dbName+"/_design/requested_path/_rewrite/show";
-    var res = CouchDB.request("GET", url);
-    TEquals(url, res.responseText, "should return the original url");
-
-    var url = "/"+dbName+"/_design/requested_path/_rewrite/show_rewritten";
-    var res = CouchDB.request("GET", url);
-    TEquals(url, res.responseText, "returned the original url");
-
-    var ddoc_loop = {
-      _id: "_design/loop",
-      rewrites: [{ "from": "loop",  "to": "_rewrite/loop"}]
-    };
-    db.save(ddoc_loop);
-
-    // Assert loop detection
-    run_on_modified_server(
-      [{section: "httpd",
-        key: "rewrite_limit",
-        value: "2"}],
-      function(){
-        var url = "/"+dbName+"/_design/loop/_rewrite/loop";
-        var xhr = CouchDB.request("GET", url);
-        TEquals(400, xhr.status);
-      });
-
-    // Assert serial execution is not spuriously counted as loop
-    run_on_modified_server(
-      [{section: "httpd",
-        key: "rewrite_limit",
-        value: "2"},
-       {section: "httpd",
-        key: "secure_rewrites",
-        value: "false"}],
-      function(){
-        var url = "/"+dbName+"/_design/test/_rewrite/foo";
-        for (var i=0; i < 5; i++) {
-            var xhr = CouchDB.request("GET", url);
-            TEquals(200, xhr.status);
-        }
-      });
-  }
-}


[19/37] goodbye Futon, old friend <3

Posted by ja...@apache.org.
http://git-wip-us.apache.org/repos/asf/couchdb/blob/cca309f3/share/www/style/layout.css
----------------------------------------------------------------------
diff --git a/share/www/style/layout.css b/share/www/style/layout.css
deleted file mode 100644
index 54a183a..0000000
--- a/share/www/style/layout.css
+++ /dev/null
@@ -1,626 +0,0 @@
-/*
-
-Licensed under the Apache License, Version 2.0 (the "License"); you may not use
-this file except in compliance with the License. You may obtain a copy of the
-License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software distributed
-under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
-CONDITIONS OF ANY KIND, either express or implied. See the License for the
-specific language governing permissions and limitations under the License.
-
-*/
-
-/* General styles */
-
-html, body { color: #000; font: normal 90% Arial,Helvetica,sans-serif;
-  height: 100%; margin: 0; padding: 0; overflow: hidden;
-}
-:link, :visited { color: #ba1e16; text-decoration: none; }
-:link img, :visited img { border: none; }
-
-h1 { background: #333; border-right: 2px solid #111;
-  border-bottom: 1px solid #333; color: #999;
-  font: normal 125% Arial,Helvetica,sans-serif; height: 32px;
-  line-height: 32px; margin: 0; padding: 0 0 0 .5em; position: relative;
-}
-h1 :link, h1 :visited, h1 strong { padding: .4em .5em; }
-h1 :link, h1 :visited {
-  background: url(../image/path.gif) 100% 50% no-repeat;
-  color: #bbb; cursor: pointer; padding-right: 2.2em;
-  text-shadow: #333 2px 2px 1px;
-}
-h1 strong { color: #fff; font-weight: normal; padding-right: 25px; }
-h1 strong a {color:#fff !important;background:none !important;}
-h1 :link.raw, h1 :visited.raw {
-  background: url(../image/rarrow.png) 100% 50% no-repeat; position: absolute;
-  right: 20px; width: 35px; height: 100%; padding: 0; margin: 0;
-}
-body.loading h1 strong {
-  background: url(../image/spinner_33.gif) right center no-repeat;
-}
-
-hr { border: 1px solid #999; border-width: 1px 0 0; }
-dl dt { font-weight: bold; }
-code, tt, pre {
-  font-family: "DejaVu Sans Mono",Menlo,Courier,monospace;
-}
-code.key { color: #333; font-weight: bold; }
-code.string { color: #393; }
-code.number, code.boolean { color: #339; }
-code.null { color: #666; }
-
-button { font-size: 100%; -webkit-appearance: square-button; }
-button[disabled] { color: #999; }
-input, select, textarea { background: #fff; border: 1px solid;
-  border-color: #999 #ddd #ddd #999; color: #000; margin: 0; padding: 1px;
-}
-input.placeholder { color: #999; }
-textarea {
-  font-family: "DejaVu Sans Mono",Menlo,Courier,monospace;
-  font-size: 100%;
-}
-fieldset { border: none; font-size: 95%; margin: 0; padding: .2em 0 0; }
-fieldset legend { color: #666; font-weight: bold; padding: 0; }
-fieldset input, fieldset select { font-size: 95%; }
-fieldset p { margin: .4em; }
-
-p.help { color: #999; font-size: 90%; margin: 0 2em 1em; }
-
-/* Tabular listings */
-
-table.listing { border-collapse: separate; border-spacing: 0;
-  border: 1px solid #a7a7a7; clear: both; width: 100%;
-}
-table.listing caption { display: none; }
-table.listing th, table.listing td { padding: .2em .5em; }
-table.listing thead th { background: #dadada url(../image/thead.gif) repeat-x;
-  border: 1px solid #a7a7a7; border-width: 0 0 1px 1px; color: #333;
-  font-size: 95%; font-weight: normal; text-align: left;
-  text-shadow: #999 2px 1px 2px; white-space: nowrap;
-}
-table.listing thead th:first-child { border-left: none; }
-table.listing thead th.key {
-  background: #a7afb6 url(../image/thead-key.gif) 0 0 repeat-x;
-  padding-top: 2px;
-}
-table.listing thead th.key span {
-  background: url(../image/order-asc.gif) 100% 3px no-repeat; cursor: pointer;
-  padding-right: 20px;
-}
-table.listing thead th.desc span {
-  background-image: url(../image/order-desc.gif);
-}
-table.listing tbody tr th, table.listing tbody tr td { background: #feffea; }
-table.listing tbody tr.odd th, table.listing tbody tr.odd td,
-table.listing tbody.odd tr th, table.listing tbody.odd tr td {
-  background: #fff;
-}
-table.listing tbody th, table.listing tbody td {
-  border-left: 1px solid #d9d9d9; padding: .4em .5em; vertical-align: top;
-}
-table.listing tbody th:first-child, table.listing tbody td:first-child {
-  border-left: none;
-}
-table.listing tbody th { text-align: left; }
-table.listing tbody th :link, table.listing tbody th :visited {
-  display: block;
-}
-table.listing tbody.footer tr td { background: #e9e9e9;
-  border-top: 1px solid #a7a7a7; color: #999; font-size: 90%;
-  line-height: 1.8em;
-}
-table.listing tbody.footer #paging { float: right; }
-table.listing tbody.footer #paging a,
-table.listing tbody.footer #paging label {
-  padding: 0 .5em;
-}
-table.listing tbody.footer #paging label { color: #666; }
-table.listing tbody.footer #paging select { font-size: 90%; padding: 0; }
-
-/* Inline editing */
-
-span.editinline-tools { margin: 2px 2px 0; float: right; margin-right: -45px; }
-span.editinline-tools button { background: transparent 0 0 no-repeat;
-  border: none; cursor: pointer; display: block; float: left; margin: 0 .2em;
-  width: 11px; height: 11px;
-}
-span.editinline-tools button:hover { background-position: 0 -22px; }
-span.editinline-tools button:active { background-position: 0 -44px; }
-span.editinline-tools button.apply {
-  background-image: url(../image/apply.gif);
-}
-span.editinline-tools button.cancel {
-  background-image: url(../image/cancel.gif);
-}
-
-/* Resizer grippies */
-
-div.grippie { background: #e9e9e9 url(../image/grippie.gif) 50% 50% no-repeat;
-  border: 1px solid #aaa; border-top: none; min-height: 10px;
-}
-
-/* Suggest results */
-
-ul.suggest-dropdown { border: 1px solid #999; background-color: #eee;
-  padding: 0; margin: 0; list-style: none; opacity: .85;
-  -moz-box-shadow: 2px 2px 10px #333; -webkit-box-shadow: 2px 2px 10px #333;
-}
-ul.suggest-dropdown li { padding: 2px 5px; white-space: nowrap; color: #101010;
-  text-align: left;
-}
-ul.suggest-dropdown li.selected { cursor: pointer; background: Highlight;
-  color: HighlightText;
-}
-
-/* Logo & Navigation */
-
-#sidebar { background: #fff; position: absolute; top: 0; right: -210px;
-  width: 210px; height: 100%;
-}
-body.fullwidth #sidebar { border-bottom: 1px solid #333; right: 0;
-  width: 26px;
-}
-#sidebar-toggle { background: url(../image/sidebar-toggle.png) 0 0 no-repeat;
-  color: #999; cursor: pointer; display: block; position: absolute; right: 0;
-  top: 0; font-size: 110%; width: 26px; height: 32px; text-indent: -9999px;
-}
-#sidebar-toggle:hover { background-position: -26px 0; }
-#sidebar-toggle:focus { outline: none; }
-#sidebar.hidden #sidebar-toggle { background-position: 0 -32px; }
-#sidebar.hidden #sidebar-toggle:hover { background-position: -26px -32px; }
-
-#logo { margin: 30px 0 0; padding: 0 18px 10px; }
-
-#nav { color: #333; font-size: 110%; font-weight: bold; list-style: none;
-  margin: 0; overflow: auto; overflow-x: hidden; padding: 0; width: 210px;
-}
-#nav ul { list-style: none; margin: 0; padding: 0; }
-#nav li { color: #999; margin: 5px 0 0; padding: 3px 0; }
-#nav li span { padding: 0 20px; }
-#nav li.selected { background: #e9e9e9; }
-#nav li li { font-size: 90%; font-weight: normal; margin: 0;
-  padding: 2px 20px 2px 40px;
-}
-#nav li li:hover { background: #e4e4e4; }
-#nav li.selected li:hover { background: #d7d7d7; }
-#nav li li :link, #nav li li :visited { color: #333; display: block;
-  overflow: hidden; text-decoration: none; text-overflow: ellipsis;
-}
-#nav li li :link:hover, #nav li li :visited:hover { color: #000; }
-#nav li li :link:focus, #nav li li :visited:focus { outline: none; }
-#nav li li.selected { background: #aaa !important; border-top: 1px solid #999;
-  color: #fff; padding-top: 1px;
-}
-#nav li li.selected :link, #nav li li.selected :visited { color: #fff; }
-#nav li li.selected :link:hover, #nav li li.selected :visited:hover {
-  color: #fff;
-}
-#nav li button { background: transparent 0 0 no-repeat; border: none;
-  cursor: pointer; width: 15px; height: 15px; margin-left: -20px;
-  position: absolute; vertical-align: top;
-}
-#nav li li:hover button.remove {
-  background-image: url(../image/delete-mini.png);
-}
-#nav li button.remove:hover { background-position: -15px 0; }
-
-#footer { background: #ddd; border-top: 1px solid #bbb; color: #000;
-  font-size: 80%; opacity: .7; padding: 5px 10px; position: absolute; right: 0;
-  bottom: 0; min-height: 1.3em; width: 190px; text-align: right;
-}
-#footer .couch :link, #footer .couch :visited { color: #000; }
-
-#userCtx span { display:none; }
-
-#wrap { background: #fff url(../image/bg.png) 100% 0 repeat-y;
-  height: 100%; margin-right: 210px; position: relative;
-}
-body.fullwidth #wrap { margin-right: 0; }
-#content { padding: 1em 16px 3em 10px; overflow: auto; overflow-y: scroll;
-  position: absolute; top: 33px; bottom: 0; left: 0; right: 0;
-}
-
-/* Toolbar */
-
-#toolbar { font-size: 90%; line-height: 16px; list-style: none;
-  margin: 0 0 .5em; padding: 5px 5px 5px 3px;
-}
-#toolbar li { display: inline; }
-#toolbar li.current {float:right;}
-#toolbar button { background: transparent 2px 2px no-repeat; border: none;
-  color: #666; margin: 0; padding: 2px 1em 2px 22px; cursor: pointer;
-  font-size: 95%; line-height: 16px;
-}
-#toolbar button[disabled] { opacity: .50; }
-#toolbar button[disabled]:hover { background-position: 2px 2px; cursor: default; color: #666 }
-#toolbar button:hover { background-position: 2px -30px; color: #000; }
-#toolbar button:active { background-position: 2px -62px; color: #000; }
-#toolbar button.add { background-image: url(../image/add.png); }
-#toolbar button.security { background-image: url(../image/key.png); }
-#toolbar button.compact { background-image: url(../image/compact.png); }
-#toolbar button.delete { background-image: url(../image/delete.png); }
-#toolbar button.load { background-image: url(../image/load.png); }
-#toolbar button.run { background-image: url(../image/run.png); }
-#toolbar button.save { background-image: url(../image/save.png); }
-#toolbar button.share { background-image: url(../image/compact.png); }
-
-/* Dialogs */
-
-#overlay { background: #bbb; cursor: wait; position: fixed; width: 100%;
-  height: 100%; top: 0; left: 0;
-}
-*html #overlay { position: absolute;
-  width: expression(document.body.clientWidth + 'px');
-  height: expression(document.body.clientHeight + 'px');
-}
-#dialog { background: #333 url(../image/progress.gif) 50% 50% no-repeat;
-  color: #f4f4f4; overflow: hidden; opacity: .95; max-width: 33em;
-  padding: 1em 1em 0; -moz-border-radius: 7px;
-  -moz-box-shadow: 4px 4px 6px #333; -webkit-border-radius: 7px;
-  -webkit-box-shadow: 4px 4px 6px #333;
-}
-*html #dialog { width: 33em; }
-#dialog.loading { width: 220px; height: 80px; }
-#dialog.loaded { background-image: none; }
-#dialog h2 { background: #666 98% 50% no-repeat;
-  border-top: 1px solid #555; border-bottom: 1px solid #777; color: #ccc;
-  font-size: 110%; font-weight: bold; margin: 0 -1em; padding: .35em 1em;
-}
-body.loading #dialog h2 {
-  background-image: url(../image/spinner_6b.gif);
-}
-#dialog h3 { color: #ccc; font-size: 100%; font-weight: bold; margin: 0 -2em;
-  padding: .35em 2em 0;
-}
-#dialog fieldset { background: #222; border-top: 1px solid #111;
-  margin: 0 0 1em; padding: .5em 1em 1em;
-  -moz-border-radius-bottomleft: 7px; -moz-border-radius-bottomright: 7px;
-  -webkit-border-bottom-left-radius: 7px;
-  -webkit-border-bottom-right-radius: 7px;
-}
-#dialog p.help { color: #bbb; font-size: 95%; margin: 0 0 1em; }
-#dialog fieldset table { margin-top: 1em; }
-#dialog fieldset th, #dialog fieldset td { padding: .5em;
-  vertical-align: top;
-}
-#dialog fieldset th { color: #999; font-weight: bold;
-  text-align: right;
-}
-#dialog fieldset input { background-color: #e9e9e9; vertical-align: middle; }
-#dialog fieldset input.error { background-color: #f9e4e4; }
-#dialog fieldset div.error { padding-top: .3em; color: #b33; }
-#dialog fieldset.radiogroup { padding-top: 1em; }
-#dialog fieldset.radiogroup label { position: relative; padding-left: 25px; }
-#dialog fieldset.radiogroup input { position: absolute; left: 5px; top: 2px; }
-#dialog fieldset.radiogroup p.help { margin-top: .5em; margin-left: 25px; }
-#dialog fieldset.radiogroup hr { border-color: #333; margin-left: 25px; }
-#dialog .buttons { padding: 0 .5em .5em; text-align: right; }
-#dialog .buttons button { background: #444; border: 1px solid #aaa;
-  color: #ddd; cursor: pointer; font-size: 90%; font-weight: normal;
-  margin: 0 0 0 5px; padding: .2em 2em; -moz-border-radius: 10px;
-  -webkit-border-radius: 10px;
-}
-#dialog .buttons button[type=submit] { font-weight: bold; }
-#dialog .buttons button:hover { background: #555; }
-#dialog .buttons button:active { background: #333; color: #fff; }
-
-#dialog fieldset td#progress {
-  background: url(../image/progress.gif) 50% 50% no-repeat;
-  visibility: hidden;
-}
-
-/* Document quick jump */
-
-#jumpto { float: right; padding: 5px 10px 5px 5px; line-height: 16px;
-  font-weight: bold; color: #666; font-size: 90%; }
-
-#jumpto input { font-size: 90%; }
-
-/* View selector */
-
-#switch { color: #666; float: right; font-size: 90%; font-weight: bold;
-  line-height: 16px; padding: 5px;
-}
-#switch select { font-size: 90%; }
-
-/* Stale views checkbox */
-
-#staleviews {
-  color: #666; float: right; font-size: 90%;
-  font-weight: bold; line-height: 16px; padding: 5px;
-}
-
-/* View function editing */
-
-#viewcode { background: #fff; border: 1px solid;
-  border-color: #999 #ddd #ddd #999; margin: 0 0 1em; overflow: hidden;
-}
-#viewcode .top, #viewcode .bottom { background-color: #e9e9e9;
-  border: 1px solid; border-color: #ddd #ddd #e9e9e9 #ddd; color: #333;
-  padding: 0 .5em 2px;
-}
-#viewcode .top { border-bottom: 1px solid #ddd; color: #aaa; font-size: 95%; }
-#viewcode .top span { border: none; color: #666; cursor: pointer;
-  display: block; font-size: 90%; margin: 0; padding: 2px 0 0;
-}
-#viewcode .top span#view-toggle {
-  background: url(../image/twisty.gif) 0 -96px no-repeat; padding-left: 15px;
-}
-#viewcode.collapsed .top span#view-toggle { background-position: 0 4px; }
-#viewcode .top a { float: right; font-size: 90%; line-height: 1.4em;
-  padding: 2px 2px 0 0;
-}
-#viewcode .top a:link, #viewcode .top a:visited { color: #999; }
-#viewcode table { border: none; border-collapse: separate; border-spacing: 0;
-  margin: 0; table-layout: fixed; width: 100%; max-width: 100%;
-}
-#viewcode table td { border: none; padding: 0; }
-#viewcode table td.splitter { background: #e9e9e9; width: 4px; }
-#viewcode table td.map { border-right: 1px solid #ccc; }
-#viewcode table td.reduce { border-left: 1px solid #ccc; }
-#viewcode .code label { font-size: 90%; color: #999; padding: 0 .5em;
-  white-space: nowrap;
-}
-#viewcode .code textarea { border: none; border-top: 1px solid #ccc;
-  color: #333; font-size: 11px; margin: 0; min-height: 50px; overflow: auto;
-  padding: .4em 0 0; resize: none; width: 100%;
-}
-#viewcode .code textarea:focus { background: #e9f4ff; }
-#viewcode .bottom { border-bottom: none; clear: left; padding: 1px 3px; }
-#viewcode .bottom button { font-size: 90%; margin: 0 1em 0 0;
-  padding-left: 2em; padding-right: 2em;
-}
-*html #viewcode .bottom button { padding: 0 .5em; }
-*+html #viewcode .bottom button { padding: 0 .5em; }
-#viewcode .bottom button.revert, #viewcode .bottom button.save,
-#viewcode .bottom button.saveas {
-  float: right; margin: 0 0 0 1em;
-}
-#viewcode .bottom button.save { font-weight: bold; }
-#viewcode .bottom label { color: #666; font-size: 90%; }
-#viewcode .grippie { background-position: 50% 50%; }
-#viewcode.collapsed { background: #e9e9e9; }
-#viewcode.collapsed .top { border-bottom: none; }
-#viewcode.collapsed .top span { background-position: 0 3px; }
-#viewcode.collapsed table, #viewcode.collapsed .bottom { display: none; }
-
-#tempwarn { display: none; font-size: 90%; margin: 0 2em 1.5em; }
-#grouptruenotice { display: none; font-size: 90%; margin: 1ex 2em 1.5em; }
-#viewrequestduration { display: none; font-size: 90%; margin: 1ex 2em 1.5em; }
-#viewrequestduration .timestamp { margin-left: 0.25em; }
-
-/* Database table */
-
-#databases thead th.size, #databases thead th.count, #databases thead th.seq,
-#databases tbody td.size, #databases tbody td.count, #databases tbody td.seq {
-  text-align: right;
-}
-
-/* Documents table */
-
-#documents thead th { line-height: 150%; width: 50%; }
-#documents thead th label { color: #333; float: right; font-size: 90%;
-  text-shadow: none;
-}
-#documents thead th label.disabled { color: #777; }
-#documents thead th label input { vertical-align: middle; }
-#documents thead th label input[type=range] { width: 7em; }
-#documents thead th label output { width: 4em; display: inline-block; }
-#documents tbody.content td { color: #999;
-  font: normal 11px "DejaVu Sans Mono",Menlo,Courier,monospace;
-}
-#documents tbody.content td.key { color: #333; }
-#documents tbody.content td.key a { display: block; }
-#documents tbody.content td.key a strong { font-weight: normal; }
-#documents tbody.content td.key span.docid { color: #999;
-  font: normal 10px Arial,Helvetica,sans-serif;
-}
-#documents tbody.content td.value { font-size: 10px; }
-
-/* Document display tabs */
-
-#tabs { float: right; list-style: none; margin: -1.4em 0 0; }
-#tabs li { display: inline; font-size: 95%; padding: 0; }
-#tabs li.active { font-weight: bold; }
-#tabs :link, #tabs :visited { background: #dadada; color: #666;
-  border: 1px solid #a7a7a7; float: left; margin: 0 0 0 .5em;
-  padding: .5em 2em .3em; position: relative; top: 1px;
-}
-#tabs .active :link, #tabs .active :visited { background: #e9e9e9;
-  border-bottom-color: #e9e9e9; color: #333;
-}
-#tabs :link:focus, #tabs :visited:focus { outline: none; }
-
-/* Document fields table */
-
-#fields { clear: right; table-layout: fixed; }
-#fields col.field { width: 33%; }
-#fields tbody.content th { padding-left: 25px; padding-right: 48px; }
-#fields tbody.content th button.delete {
-  background: url(../image/delete-mini.png) no-repeat; border: none;
-  cursor: pointer; float: left; margin: .2em 5px 0 -20px; padding: 0;
-  width: 15px; height: 15px;
-}
-#fields tbody.content th button.delete:hover { background-position: -15px 0; }
-#fields tbody.content th b { display: block; padding: 2px 2px 2px 3px; }
-#fields tbody.content th b.editinline-container { padding: 0; }
-#fields tbody.content td { color: #999; padding-left: 14px;
-  padding-right: 48px;
-}
-#fields tbody.content td code { display: block; font-size: 11px;
-  padding: 2px 2px 2px 3px; position: relative;
-}
-#fields tbody.content td code.string { white-space: pre-wrap; }
-#fields tbody.content td code.string:before { color: #ccc; content: "“";
-  position: absolute; left: -4px;
-}
-#fields tbody.content td code.string:after { color: #ccc; content: "”"; }
-
-#fields tbody.content td dl { margin: 0; padding: 0; }
-#fields tbody.content td dt {
-  background: transparent url(../image/toggle-collapse.gif) 0 3px no-repeat;
-  clear: left; color: #333; cursor: pointer; line-height: 1em;
-  margin-left: -12px; padding-left: 14px;
-}
-#fields tbody.content td dd { line-height: 1em; margin: 0;
-  padding: 0 0 0 1em;
-}
-#fields tbody.content td dt.collapsed {
-  background-image: url(../image/toggle-expand.gif);
-}
-#fields tbody.content td dt.inline { background-image: none; cursor: default;
-  float: left; margin-left: 0; padding-left: 2px; padding-right: .5em;
-  padding-top: 2px;
-}
-#fields tbody.content td dd code.string { left: 4px; text-indent: -6px; }
-#fields tbody.content td dd code.string:before { position: static; }
-#fields tbody.content input, #fields tbody.content textarea,
-#fields tbody.source textarea {
-  background: #fff; border: 1px solid; border-color: #999 #ddd #ddd #999;
-  margin: 0; padding: 1px; width: 100%;
-}
-#fields tbody.content th input { font-family: inherit; font-size: inherit;
-  font-weight: bold;
-}
-#fields tbody.content td input, #fields tbody.content td textarea,
-#fields tbody.source textarea {
-  font: normal 11px "DejaVu Sans Mono",Menlo,Courier,monospace;
-}
-#fields tbody.content input.invalid,
-#fields tbody.content textarea.invalid,
-#fields tbody.source textarea.invalid {
-  background: #f9f4f4; border-color: #b66 #ebb #ebb #b66;
-}
-#fields tbody.content div.grippie, #fields tbody.source div.grippie {
-  padding: 0 1px; width: 100%;
-}
-#fields tbody.content div.error, #fields tbody.source div.error {
-  color: #d33;
-}
-
-#fields tbody.content td ul.attachments { list-style: none; margin: 0;
-  padding: 0;
-}
-#fields tbody.content td ul.attachments li {
-  margin-bottom: .3em; min-height: 20px; padding-left: 20px;
-}
-#fields tbody.content td ul.attachments tt { font-size: 11px; }
-#fields tbody.content td ul.attachments li span.info { color: #666;
-  display: block; font-size: 95%;
-}
-#fields tbody.content td ul.attachments li button {
-  background: transparent no-repeat; border: none; cursor: pointer;
-  float: left; margin: 0 2px 0 -20px; padding: 0; width: 15px; height: 15px;
-  vertical-align: middle;
-}
-#fields tbody.content td ul.attachments li button:hover {
-  background-position: -15px 0;
-}
-#fields tbody.content td ul.attachments li button.delete {
-  background-image: url(../image/delete-mini.png);
-}
-#fields tbody.source td pre { color: #999; font-size: 11px; line-height: 1.6em;
-  margin: 0; overflow: auto; white-space: pre-wrap; width: 100%;
-}
-#fields tbody.source td.editinline-container { padding-left: 14px; padding-right: 48px; }
-
-/* Test suite */
-
-#tests { table-layout: fixed; }
-#tests thead th.name { width: 20%; }
-#tests thead th.status { padding-left: 20px; width: 10em; }
-#tests thead th.duration { text-align: right; width: 7em; }
-#tests tbody.content th { cursor: help; padding-left: 25px;
-  white-space: nowrap;
-}
-#tests tbody.content th button.run {
-  background: url(../image/run-mini.png) no-repeat; border: none;
-  cursor: pointer; float: left; margin: .2em 5px 0 -20px; padding: 0;
-  width: 15px; height: 15px;
-}
-#tests tbody.content th button.run:hover { background-position: -15px 0; }
-#tests tbody.content td.duration { text-align: right; width: 6em; }
-#tests tbody.content td.status { background-position: 5px 8px;
-  background-repeat: no-repeat; color: #999; padding-left: 20px;
-}
-#tests tbody.content td.details { width: 50%; }
-#tests tbody.content td.details a { border-bottom: 1px dashed #ccc;
-  color: #999; float: right; font-size: 85%;
-}
-#tests tbody.content td.details ol { color: #999; margin: 0;
-  padding: 0 0 0 1.5em;
-}
-#tests tbody.content td.details ol b { color: #333; font-weight: normal; }
-#tests tbody.content td.details ol code { color: #c00; font-size: 100%; }
-#tests tbody.content td.details ol code.error { white-space: pre; }
-#tests tbody.content td.running {
-  background-image: url(../image/running.png); color: #333;
-}
-#tests tbody.content td.success, span.success {
-  background-image: url(../image/test_success.gif) no-repeat; color: #060;
-}
-#tests tbody.content td.error, #tests tbody.content td.failure, span.failure {
-  background-image: url(../image/test_failure.gif) no-repeat; color: #c00;
-}
-
-#result {
-  color: #060;
-}
-
-/* Configuration */
-
-#config tbody th { background: #e6e6e6; border-right: none;
-  border-top: 1px solid #d9d9d9;
-}
-#config tbody td.name { border-left: 1px solid #d9d9d9; color: #333;
-  font-weight: bold;
-}
-#config tbody td.value { padding: 1px 48px 1px 1px; }
-#config tbody td.value code { display: block; font-size: 11px;
-  padding: 2px 2px 2px 3px;
-}
-#config tbody td.value code.editinline-container { padding: 0; }
-#config tbody td input {
-  background: #fff; border: 1px solid; border-color: #999 #ddd #ddd #999;
-  font: normal 11px "DejaVu Sans Mono",Menlo,Courier,monospace;
-  margin: 0; padding: 1px; width: 100%;
-}
-
-/* Replication */
-
-form#replicator { background: #f4f4f4; border: 1px solid;
-  border-color: #999 #ccc #ccc #999; margin: .5em 1em 1.5em; padding: .5em;
-  -moz-border-radius: 7px; -webkit-border-radius: 7px;
-}
-form#replicator fieldset { float: left; padding: 1px; }
-form#replicator p.swap { float: left; margin: 2em 0 0; padding: 1px 1em; }
-form#replicator p.swap button { background: transparent; border: none;
-  color: #666; cursor: pointer; font-size: 150%;
-}
-form#replicator p.swap button:hover { color: #000; }
-form#replicator p.actions { padding: 1px; clear: left; margin: 0;
-  text-align: right;
-}
-
-/* Active tasks */
-
-#interval { color: #666; float: right; font-size: 90%; font-weight: bold;
-  line-height: 16px; padding: 5px;
-}
-#interval input { vertical-align: top; }
-#interval .secs { display: inline-block; width: 2em; text-align: right; }
-
-#status tr.none th { color: #666; font-weight: normal; }
-#status td.object, #status td.pid {
-  font-family: "DejaVu Sans Mono",Menlo,Courier,monospace;
-  font-size: 11px;
-}
-
-
-/* Session */
-#loginSignup {
-  font-size:200%;
-}

http://git-wip-us.apache.org/repos/asf/couchdb/blob/cca309f3/share/www/verify_install.html
----------------------------------------------------------------------
diff --git a/share/www/verify_install.html b/share/www/verify_install.html
deleted file mode 100644
index 7e3a7a7..0000000
--- a/share/www/verify_install.html
+++ /dev/null
@@ -1,119 +0,0 @@
-<!DOCTYPE html>
-<!--
-
-Licensed under the Apache License, Version 2.0 (the "License"); you may not use
-this file except in compliance with the License. You may obtain a copy of the
-License at
-
-   http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software distributed
-under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
-CONDITIONS OF ANY KIND, either express or implied. See the License for the
-specific language governing permissions and limitations under the License.
-
--->
-<html lang="en">
-  <head>
-    <title>Test Suite</title>
-    <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
-    <link rel="stylesheet" href="style/layout.css?0.11.0" type="text/css">
-    <script src="script/json2.js"></script>
-    <script src="script/sha1.js"></script>
-    <script src="script/jquery.js"></script>
-    <script src="script/jquery.couch.js"></script>
-    <script src="script/jquery.dialog.js"></script>
-    <script src="script/futon.js"></script>
-    <script src="script/couch.js"></script>
-    <script src="script/couch_test_runner.js"></script>
-    <script>
-    $(function($) {
-      $("#result").html("");
-      $("#run").click(verify_install);
-    });
-
-    function T(arg, desc) {
-      if(!arg) {
-        mesg = "Assertion failed" + (desc ? ": " + desc : "");
-        throw new Error(mesg);
-      }
-    }
-
-    function TEquals(expect, found, descr) {
-      var mesg = "expected '" + expect + "', got '" + found + "' " + descr;
-      T(expect === found, mesg);
-    }
-
-    function tests() {
-      CouchDB.urlPrefix = "..";
-      var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"});
-
-      // cleanup, ignore the 404
-      try {db.deleteDb();} catch(e) {};
-      // create db
-      db.createDb();
-
-      // create document
-      var doc = {a:1};
-      var resp = db.save(doc);
-      TEquals(true, resp.ok, "save document");
-      // update document
-      doc.b = 2;
-      resp = db.save(doc);
-      TEquals(true, resp.ok, "update document");
-      TEquals(2, doc.b, "update document verified");
-      // delete document
-      resp = db.deleteDoc(doc);
-      TEquals(true, resp.ok, "delete document");
-      var doc2 = db.open(doc.id);
-      TEquals(doc2, null, "delete document verified");
-
-      // excercise query server
-      db.save({a:1});
-      db.save({a:2});
-      db.save({a:3});
-
-      //  temporary view
-      var resp = db.query(function(doc) {
-        if(doc.a) {
-          emit(doc.a, doc.a);
-        }
-      });
-      TEquals(3, resp.total_rows, "temp view query");
-
-      // replication
-      //   create second db
-      var db2 = new CouchDB("test_suite_db2", {"X-Couch-Full-Commit":"false"});
-      try {db2.deleteDb();} catch (e) {};
-      db2.createDb();
-      //   do replicate
-      CouchDB.replicate("test_suite_db", "test_suite_db2");
-      //   compare results
-      TEquals(db.info().doc_count, db2.info().doc_count, "databases are equal");
-    }
-
-    function verify_install() {
-      try {
-        var result = $("#result");
-        result.html("Running…");
-        tests();
-        result.html("Your installation looks fine. Time to Relax.");
-      } catch(e) {
-        console.log(e);
-        result.html("X: " + e);
-      }
-    }
-    </script>
-  </head>
-  <body><div id="wrap">
-    <h1>
-      <a href="index.html">Overview</a>
-      <strong>Verify Install</strong>
-    </h1>
-    <div id="content">
-      <ul id="toolbar">
-        <li><button class="run" id="run">Verify Your Installation.</button><span id="result"></span></li>
-      </ul>
-    </div>
-  </div></body>
-</html>


[12/37] move JS tests into safety

Posted by ja...@apache.org.
http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/test/replicator_db_identical_continuous.js
----------------------------------------------------------------------
diff --git a/share/test/replicator_db_identical_continuous.js b/share/test/replicator_db_identical_continuous.js
new file mode 100644
index 0000000..240c531
--- /dev/null
+++ b/share/test/replicator_db_identical_continuous.js
@@ -0,0 +1,139 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+
+couchTests.replicator_db_identical_continuous = function(debug) {
+
+  if (debug) debugger;
+
+  var populate_db = replicator_db.populate_db;
+  var docs1 = replicator_db.docs1;
+  var dbA = replicator_db.dbA;
+  var dbB = replicator_db.dbB;
+  var repDb = replicator_db.repDb;
+  var wait = replicator_db.wait;
+  var waitForRep = replicator_db.waitForRep;
+  var waitForSeq = replicator_db.waitForSeq;
+  var wait_rep_doc = replicator_db.wait_rep_doc;
+
+  // test the case where multiple replication docs (different IDs)
+  // describe in fact the same continuous replication (source, target, etc)
+  function identical_continuous_rep_docs() {
+    populate_db(dbA, docs1);
+    populate_db(dbB, []);
+
+    var repDoc1 = {
+      _id: "foo_dup_cont_rep_doc_1",
+      source: "http://" + CouchDB.host + "/" + dbA.name,
+      target: dbB.name,
+      continuous: true
+    };
+    var repDoc2 = {
+      _id: "foo_dup_cont_rep_doc_2",
+      source: "http://" + CouchDB.host + "/" + dbA.name,
+      target: dbB.name,
+      continuous: true
+    };
+
+    T(repDb.save(repDoc1).ok);
+    T(repDb.save(repDoc2).ok);
+
+    waitForSeq(dbA, dbB);
+    for (var i = 0; i < docs1.length; i++) {
+      var doc = docs1[i];
+      var copy = dbB.open(doc._id);
+      T(copy !== null);
+      T(copy.value === doc.value);
+    }
+
+    // Rather than a timeout we're just waiting to hear the
+    // fourth change to the database. Changes 1 and 2 were
+    // us storing repDoc1 and repDoc2. Changes 3 and 4 are
+    // the replicator manager updating each document. This
+    // just waits until the fourth change before continuing.
+    repDb.changes({"feed":"longpoll", "since":3});
+
+    repDoc1 = repDb.open("foo_dup_cont_rep_doc_1");
+    T(repDoc1 !== null);
+    T(repDoc1._replication_state === "triggered");
+    T(typeof repDoc1._replication_state_time === "string");
+    T(typeof repDoc1._replication_id  === "string");
+
+    repDoc2 = repDb.open("foo_dup_cont_rep_doc_2");
+    T(repDoc2 !== null);
+    T(typeof repDoc2._replication_state === "undefined");
+    T(typeof repDoc2._replication_state_time === "undefined");
+    T(repDoc2._replication_id === repDoc1._replication_id);
+
+    var newDoc = {
+      _id: "foo666",
+      value: 999
+    };
+    T(dbA.save(newDoc).ok);
+
+    waitForSeq(dbA, dbB);
+    var copy = dbB.open("foo666");
+    T(copy !== null);
+    T(copy.value === 999);
+
+    // deleting second replication doc, doesn't affect the 1st one and
+    // neither it stops the replication
+    T(repDb.deleteDoc(repDoc2).ok);
+    repDoc1 = repDb.open("foo_dup_cont_rep_doc_1");
+    T(repDoc1 !== null);
+    T(repDoc1._replication_state === "triggered");
+    T(typeof repDoc1._replication_state_time === "string");
+
+    var newDoc2 = {
+        _id: "foo5000",
+        value: 5000
+    };
+    T(dbA.save(newDoc2).ok);
+
+    waitForSeq(dbA, dbB);
+    var copy = dbB.open("foo5000");
+    T(copy !== null);
+    T(copy.value === 5000);
+
+    // deleting the 1st replication document stops the replication
+    T(repDb.deleteDoc(repDoc1).ok);
+    var newDoc3 = {
+        _id: "foo1983",
+        value: 1983
+    };
+    T(dbA.save(newDoc3).ok);
+
+    wait(wait_rep_doc); //how to remove wait?
+    var copy = dbB.open("foo1983");
+    T(copy === null);
+  }
+
+  var server_config = [
+    {
+      section: "couch_httpd_auth",
+      key: "iterations",
+      value: "1"
+    },
+    {
+      section: "replicator",
+      key: "db",
+      value: repDb.name
+    }
+  ];
+
+  repDb.deleteDb();
+  run_on_modified_server(server_config, identical_continuous_rep_docs);
+
+  // cleanup
+  repDb.deleteDb();
+  dbA.deleteDb();
+  dbB.deleteDb();
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/test/replicator_db_invalid_filter.js
----------------------------------------------------------------------
diff --git a/share/test/replicator_db_invalid_filter.js b/share/test/replicator_db_invalid_filter.js
new file mode 100644
index 0000000..7b6df82
--- /dev/null
+++ b/share/test/replicator_db_invalid_filter.js
@@ -0,0 +1,119 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+
+couchTests.replicator_db_invalid_filter = function(debug) {
+
+  if (debug) debugger;
+
+  var populate_db = replicator_db.populate_db;
+  var docs1 = replicator_db.docs1;
+  var dbA = replicator_db.dbA;
+  var dbB = replicator_db.dbB;
+  var repDb = replicator_db.repDb;
+  var usersDb = replicator_db.usersDb;
+  var wait = replicator_db.wait;
+  var waitForRep = replicator_db.waitForRep;
+  var waitForSeq = replicator_db.waitForSeq;
+  var wait_rep_doc = replicator_db.wait_rep_doc;
+
+  function test_invalid_filter() {
+    // COUCHDB-1199 - replication document with a filter field that was invalid
+    // crashed the CouchDB server.
+    var repDoc1 = {
+       _id: "rep1",
+       source: "couch_foo_test_db",
+       target: "couch_bar_test_db",
+       filter: "test/foofilter"
+    };
+
+    TEquals(true, repDb.save(repDoc1).ok);
+
+    waitForRep(repDb, repDoc1, "error");
+    repDoc1 = repDb.open(repDoc1._id);
+    TEquals("undefined", typeof repDoc1._replication_id);
+    TEquals("error", repDoc1._replication_state);
+    TEquals("Could not open source database `couch_foo_test_db`: {db_not_found,<<\"couch_foo_test_db\">>}",
+            repDoc1._replication_state_reason);
+
+    populate_db(dbA, docs1);
+    populate_db(dbB, []);
+
+    var repDoc2 = {
+       _id: "rep2",
+       source: dbA.name,
+       target: dbB.name,
+       filter: "test/foofilter"
+    };
+
+    TEquals(true, repDb.save(repDoc2).ok);
+
+    waitForRep(repDb, repDoc2, "error");
+    repDoc2 = repDb.open(repDoc2._id);
+    TEquals("undefined", typeof repDoc2._replication_id);
+    TEquals("error", repDoc2._replication_state);
+    TEquals("Couldn't open document `_design/test` from source database `test_suite_rep_db_a`: {error,<<\"not_found\">>}",
+            repDoc2._replication_state_reason);
+
+    var ddoc = {
+      _id: "_design/mydesign",
+      language : "javascript",
+      filters : {
+        myfilter : (function(doc, req) {
+          return true;
+        }).toString()
+      }
+    };
+
+    TEquals(true, dbA.save(ddoc).ok);
+
+    var repDoc3 = {
+       _id: "rep3",
+       source: dbA.name,
+       target: dbB.name,
+       filter: "mydesign/myfilter"
+    };
+
+    TEquals(true, repDb.save(repDoc3).ok);
+
+    waitForRep(repDb, repDoc3, "completed");
+    repDoc3 = repDb.open(repDoc3._id);
+    TEquals("string", typeof repDoc3._replication_id);
+    TEquals("completed", repDoc3._replication_state);
+  }
+
+  var server_config = [
+    {
+      section: "couch_httpd_auth",
+      key: "iterations",
+      value: "1"
+    },
+    {
+      section: "replicator",
+      key: "db",
+      value: repDb.name
+    },
+    {
+      section: "couch_httpd_auth",
+      key: "authentication_db",
+      value: usersDb.name
+    }
+  ];
+
+  repDb.deleteDb();
+  run_on_modified_server(server_config, test_invalid_filter);
+
+  // cleanup
+  repDb.deleteDb();
+  dbA.deleteDb();
+  dbB.deleteDb();
+  usersDb.deleteDb();
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/test/replicator_db_security.js
----------------------------------------------------------------------
diff --git a/share/test/replicator_db_security.js b/share/test/replicator_db_security.js
new file mode 100644
index 0000000..7a2bfd1
--- /dev/null
+++ b/share/test/replicator_db_security.js
@@ -0,0 +1,399 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+
+couchTests.replicator_db_security = function(debug) {
+
+  var reset_dbs = function(dbs) {
+    dbs.forEach(function(db) {
+      db.deleteDb();
+      try { db.createDb() } catch (e) {};
+    });
+  };
+
+  var dbs = ["couch_test_rep_db", "couch_test_users_db",
+    "test_suite_db_a", "test_suite_db_b", "test_suite_db_c"]
+    .map(function(db_name) {
+      return new CouchDB(db_name, {"X-Couch-Full-Commit":"false"});
+    });
+
+  var repDb = dbs[0];
+  var usersDb = dbs[1];
+  var dbA = dbs[2];
+  var dbB = dbs[3];
+  var dbC = dbs[4];
+
+  if (debug) debugger;
+
+  var loginUser = function(username) {
+    var pws = {
+      jan: "apple",
+      jchris: "mp3",
+      fdmanana: "foobar",
+      benoitc: "test"
+    };
+    T(CouchDB.login(username, pws[username]).ok);
+  };
+
+  var repChanges = function(username) {
+    var pws = {
+      jan: "apple",
+      jchris: "mp3",
+      fdmanana: "foobar",
+      benoitc: "test"
+    };
+    T(CouchDB.login(username, pws[username]).ok);
+    var changes = CouchDB.request(
+      "GET",
+       "/" + repDb.name + "/_changes?include_docs=true" +
+         "&anti-cache=" + String(Math.round(Math.random() * 100000)));
+    return changes = JSON.parse(changes.responseText);
+  };
+
+  var save_as = function(db, doc, username)
+  {
+    loginUser(username);
+    try {
+      return db.save(doc);
+    } catch (ex) {
+      return ex;
+    } finally {
+      CouchDB.logout();
+    }
+  };
+
+  var open_as = function(db, docId, username) {
+    loginUser(username);
+    try {
+      return db.open(docId);
+    } finally {
+      CouchDB.logout();
+    }
+  };
+
+  // from test replicator_db.js
+  function waitForDocPos(db, docId, pos) {
+    var doc, curPos, t0, t1,
+        maxWait = 3000;
+
+    doc = db.open(docId);
+    curPos = Number(doc._rev.split("-", 1));
+    t0 = t1 = new Date();
+
+    while ((curPos < pos) && ((t1 - t0) <= maxWait)) {
+       doc = db.open(docId);
+       curPos = Number(doc._rev.split("-", 1));
+       t1 = new Date();
+    }
+
+    return doc;
+  }
+
+  var testFun = function()
+  {
+    reset_dbs(dbs);
+
+    // _replicator db
+    // in admin party mode, anonymous should be able to create a replication
+    var repDoc = {
+      _id: "null-owner-rep",
+      source: dbA.name,
+      target: dbB.name
+    };
+    var result = repDb.save(repDoc);
+    TEquals(true, result.ok, "should allow anonymous replication docs in admin party");
+    // new docs should get an owner field enforced. In admin party mode owner is null
+    repDoc = repDb.open(repDoc._id);
+    TIsnull(repDoc.owner, "owner should be null in admin party");
+
+// Uncomment when _users database security changes are implemented.
+//
+//     var jchrisDoc = {
+//       _id: "org.couchdb.user:jchris",
+//       type: "user",
+//       name: "jchris",
+//       password: "mp3",
+//       roles: []
+//     };
+    var jchrisDoc = CouchDB.prepareUserDoc({
+      name: "jchris",
+      roles: []
+    }, "mp3");
+    usersDb.save(jchrisDoc); // set up a non-admin user
+
+// Uncomment when _users database security changes are implemented.
+//
+//     var jchrisDoc = {
+//       _id: "org.couchdb.user:fdmanana",
+//       type: "user",
+//       name: "fdmanana",
+//       password: "foobar",
+//       roles: []
+//     };
+    var fdmananaDoc = CouchDB.prepareUserDoc({
+      name: "fdmanana",
+      roles: []
+    }, "foobar");
+    usersDb.save(fdmananaDoc); // set up a non-admin user
+
+// Uncomment when _users database security changes are implemented.
+//
+//     var benoitcDoc = {
+//       _id: "org.couchdb.user:fdmanana",
+//       type: "user",
+//       name: "fdmanana",
+//       password: "foobar",
+//       roles: []
+//     };
+    var benoitcDoc = CouchDB.prepareUserDoc({
+      name: "benoitc",
+      roles: []
+    }, "test");
+    usersDb.save(benoitcDoc); // set up a non-admin user
+
+    T(repDb.setSecObj({
+      "admins" : {
+        roles : [],
+        names : ["benoitc"]
+      }
+    }).ok);
+    
+    run_on_modified_server([
+        {
+          section: "admins",
+          key: "jan",
+          value: "apple"
+        }
+      ], function() {
+        // replication docs from admin-party mode in non-admin party mode can not
+        //   be edited by non-admins (non-server admins)
+        repDoc = repDb.open(repDoc._id);
+        repDoc.target = dbC.name;
+        var result = save_as(repDb, repDoc, "jchris");
+        TEquals("forbidden", result.error, "should forbid editing null-owner docs");
+
+        // replication docs from admin-party mode in non-admin party mode can only
+        //   be edited by admins (server admins)
+        repDoc = waitForDocPos(repDb, repDoc._id, 3);
+        repDoc.target = dbC.name;
+        var result = save_as(repDb, repDoc, "jan");
+        repDoc = open_as(repDb, repDoc._id, "jchris");
+        TEquals(true, result.ok, "should allow editing null-owner docs to admins");
+        TEquals("jan", repDoc.owner, "owner should be the admin now");
+
+        // user can update their own replication docs (repDoc.owner)
+        var jchrisRepDoc = {
+          _id: "jchris-rep-doc",
+          source: dbC.name,
+          target: dbA.name,
+          user_ctx: { name: "jchris", roles: [] }
+        };
+
+        var result = save_as(repDb, jchrisRepDoc, "jchris");
+        TEquals(true, result.ok, "should create rep doc");
+        jchrisRepDoc = repDb.open(jchrisRepDoc._id);
+        TEquals("jchris", jchrisRepDoc.owner, "should assign correct owner");
+        jchrisRepDoc = waitForDocPos(repDb, jchrisRepDoc._id, 3);
+        jchrisRepDoc = open_as(repDb, jchrisRepDoc._id, "jchris");
+        jchrisRepDoc.target = dbB.name;
+        var result = save_as(repDb, jchrisRepDoc, "jchris");
+        TEquals(true, result.ok, "should allow update of rep doc");
+
+        // user should not be able to read from any view
+        var ddoc = {
+          _id: "_design/reps",
+          views: {
+            test: {
+            map: "function(doc) {" +
+              "if (doc._replication_state) { " +
+                "emit(doc._id, doc._replication_state);" +
+              "}" +
+            "}"
+            }
+          }
+        };
+
+        save_as(repDb, ddoc, "jan");
+
+        try {
+          repDb.view("reps/test");
+          T(false, "non-admin had view read access");
+        } catch (ex) {
+          TEquals("forbidden", ex.error,
+            "non-admins should not be able to read a view");
+        }
+
+        // admin should be able to read from any view
+        TEquals(true, CouchDB.login("jan", "apple").ok);
+        var result = repDb.view("reps/test");
+        CouchDB.logout();
+        TEquals(2, result.total_rows, "should allow access and list two users");
+
+        // test _all_docs, only available for _admins
+        try {
+          repDb.allDocs({include_docs: true});
+          T(false, "non-admin had _all_docs access");
+        } catch (ex) {
+          TEquals("forbidden", ex.error,
+            "non-admins should not be able to access _all_docs");
+        }
+
+        TEquals(true, CouchDB.login("jan", "apple").ok);
+        try {
+          repDb.allDocs({include_docs: true});
+        } catch (ex) {
+          T(false, "admin couldn't access _all_docs");
+        }
+        CouchDB.logout();
+
+        try {
+          repDb.view("reps/test");
+          T(false, "non-admin had view read access");
+        } catch (ex) {
+          TEquals("forbidden", ex.error,
+            "non-admins should not be able to read a view");
+        }
+
+        // admin should be able to read from any view
+        TEquals(true, CouchDB.login("benoitc", "test").ok);
+        var result = repDb.view("reps/test");
+        CouchDB.logout();
+        TEquals(2, result.total_rows, "should allow access and list two users");
+
+        // test _all_docs, only available for _admins
+        try {
+          repDb.allDocs({include_docs: true});
+          T(false, "non-admin had _all_docs access");
+        } catch (ex) {
+          TEquals("forbidden", ex.error,
+            "non-admins should not be able to access _all_docs");
+        }
+
+        TEquals(true, CouchDB.login("benoitc", "test").ok);
+        try {
+          repDb.allDocs({include_docs: true});
+        } catch (ex) {
+          T(false, "admin couldn't access _all_docs");
+        }
+        CouchDB.logout();
+
+        // Verify that users can't access credentials in the "source" and
+        // "target" fields of replication documents owned by other users.
+        var fdmananaRepDoc = {
+          _id: "fdmanana-rep-doc",
+          source: "http://fdmanana:foobar@" + CouchDB.host + "/" + dbC.name,
+          target: dbA.name,
+          user_ctx: { name: "fdmanana", roles: [] }
+        };
+
+        var result = save_as(repDb, fdmananaRepDoc, "fdmanana");
+        TEquals(true, result.ok, "should create rep doc");
+        waitForDocPos(repDb, fdmananaRepDoc._id, 3);
+        fdmananaRepDoc = open_as(repDb, fdmananaRepDoc._id, "fdmanana");
+        TEquals("fdmanana", fdmananaRepDoc.owner, "should assign correct owner");
+        TEquals("http://fdmanana:foobar@" + CouchDB.host + "/" + dbC.name,
+           fdmananaRepDoc.source, "source field has credentials");
+
+        fdmananaRepDoc = open_as(repDb, fdmananaRepDoc._id, "jchris");
+        TEquals("fdmanana", fdmananaRepDoc.owner, "should assign correct owner");
+        TEquals("http://" + CouchDB.host + "/" + dbC.name,
+           fdmananaRepDoc.source, "source field doesn't contain credentials");
+
+        // _changes?include_docs=true, users shouldn't be able to see credentials
+        // in documents owned by other users.
+        var changes = repChanges("jchris");
+        var doc = changes.results[changes.results.length - 1].doc;
+        TEquals(fdmananaRepDoc._id, doc._id, "Got the right doc from _changes");
+        TEquals("http://" + CouchDB.host + "/" + dbC.name,
+           doc.source, "source field doesn't contain credentials (doc from _changes)");
+        CouchDB.logout();
+
+        // _changes?include_docs=true, user should be able to see credentials
+        // in documents they own.
+        var changes = repChanges("fdmanana");
+        var doc = changes.results[changes.results.length - 1].doc;
+        TEquals(fdmananaRepDoc._id, doc._id, "Got the right doc from _changes");
+        TEquals("http://fdmanana:foobar@" + CouchDB.host + "/" + dbC.name,
+           doc.source, "source field contains credentials (doc from _changes)");
+        CouchDB.logout();
+
+        // _changes?include_docs=true, admins should be able to see credentials
+        // from all documents.
+        var changes = repChanges("jan");
+        var doc = changes.results[changes.results.length - 1].doc;
+        TEquals(fdmananaRepDoc._id, doc._id, "Got the right doc from _changes");
+        TEquals("http://fdmanana:foobar@" + CouchDB.host + "/" + dbC.name,
+           doc.source, "source field contains credentials (doc from _changes)");
+        CouchDB.logout();
+
+        // _changes?include_docs=true, db admins should be able to see credentials
+        // from all documents.
+        var changes = repChanges("benoitc");
+        var doc = changes.results[changes.results.length - 1].doc;
+        TEquals(fdmananaRepDoc._id, doc._id, "Got the right doc from _changes");
+        TEquals("http://fdmanana:foobar@" + CouchDB.host + "/" + dbC.name,
+           doc.source, "source field contains credentials (doc from _changes)");
+        CouchDB.logout();
+
+        var fdmananaRepDocOAuth = {
+          _id: "fdmanana-rep-doc-oauth",
+          source: dbC.name,
+          target: {
+            url: "http://" + CouchDB.host + "/" + dbA.name,
+            oauth: {
+              token: "abc",
+              token_secret: "foo",
+              consumer_key: "123",
+              consumer_secret: "321"
+            }
+          },
+          user_ctx: { name: "fdmanana", roles: [] }
+        };
+
+        var result = save_as(repDb, fdmananaRepDocOAuth, "fdmanana");
+        TEquals(true, result.ok, "should create rep doc");
+        waitForDocPos(repDb, fdmananaRepDocOAuth._id, 3);
+        fdmananaRepDocOAuth = open_as(repDb, fdmananaRepDocOAuth._id, "fdmanana");
+        TEquals("fdmanana", fdmananaRepDocOAuth.owner, "should assign correct owner");
+        TEquals("object", typeof fdmananaRepDocOAuth.target.oauth,
+          "target field has oauth credentials");
+
+        fdmananaRepDocOAuth = open_as(repDb, fdmananaRepDocOAuth._id, "jchris");
+        TEquals("fdmanana", fdmananaRepDocOAuth.owner, "should assign correct owner");
+        TEquals("undefined", typeof fdmananaRepDocOAuth.target.oauth,
+          "target field doesn't have oauth credentials");
+
+        // ensure "old" replicator docs still work
+        // done in replicator_db.js?
+
+        // Login as admin so run_on_modified_server can do its cleanup.
+        TEquals(true, CouchDB.login("jan", "apple").ok);
+      });
+  };
+
+  run_on_modified_server([
+    {
+      section: "couch_httpd_auth",
+      key: "authentication_db",
+      value: usersDb.name
+    },
+    {
+      section: "replicator",
+      key: "db",
+      value: repDb.name
+    }],
+    testFun
+  );
+
+  // cleanup
+  usersDb.deleteDb();
+  repDb.deleteDb();
+};

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/test/replicator_db_simple.js
----------------------------------------------------------------------
diff --git a/share/test/replicator_db_simple.js b/share/test/replicator_db_simple.js
new file mode 100644
index 0000000..f7acedb
--- /dev/null
+++ b/share/test/replicator_db_simple.js
@@ -0,0 +1,114 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+
+couchTests.replicator_db_simple = function(debug) {
+
+  if (debug) debugger;
+
+  var populate_db = replicator_db.populate_db;
+  var docs1 = replicator_db.docs1;
+  var dbA = replicator_db.dbA;
+  var dbB = replicator_db.dbB;
+  var repDb = replicator_db.repDb;
+  var waitForRep = replicator_db.waitForRep;
+
+  function simple_replication() {
+    populate_db(dbA, docs1);
+    populate_db(dbB, []);
+
+    var repDoc = {
+      _id: "foo_simple_rep",
+      source: dbA.name,
+      target: dbB.name
+    };
+    T(repDb.save(repDoc).ok);
+
+    waitForRep(repDb, repDoc, "completed");
+    for (var i = 0; i < docs1.length; i++) {
+      var doc = docs1[i];
+      var copy = dbB.open(doc._id);
+      T(copy !== null);
+      T(copy.value === doc.value);
+    }
+
+    var repDoc1 = repDb.open(repDoc._id);
+    T(repDoc1 !== null);
+    T(repDoc1.source === repDoc.source);
+    T(repDoc1.target === repDoc.target);
+    T(repDoc1._replication_state === "completed", "simple");
+    T(typeof repDoc1._replication_state_time === "string");
+    T(typeof repDoc1._replication_id  === "string");
+    T(typeof repDoc1._replication_stats === "object", "doc has stats");
+    var stats = repDoc1._replication_stats;
+    TEquals(docs1.length, stats.revisions_checked,
+       "right # of revisions_checked");
+    TEquals(docs1.length, stats.missing_revisions_found,
+      "right # of missing_revisions_found");
+    TEquals(docs1.length, stats.docs_read, "right # of docs_read");
+    TEquals(docs1.length, stats.docs_written, "right # of docs_written");
+    TEquals(0, stats.doc_write_failures, "right # of doc_write_failures");
+    TEquals(dbA.info().update_seq, stats.checkpointed_source_seq,
+      "right checkpointed_source_seq");
+  }
+
+  var server_config = [
+    {
+      section: "couch_httpd_auth",
+      key: "iterations",
+      value: "1"
+    },
+    {
+      section: "replicator",
+      key: "db",
+      value: repDb.name
+    }
+  ];
+
+  repDb.deleteDb();
+  run_on_modified_server(server_config, simple_replication);
+
+/*
+ * Disabled, since error state would be set on the document only after
+ * the exponential backoff retry done by the replicator database listener
+ * terminates, which takes too much time for a unit test.
+ */
+ /*
+   function error_state_replication() {
+    populate_db(dbA, docs1);
+
+    var repDoc = {
+      _id: "foo_error_rep",
+      source: dbA.name,
+      target: "nonexistent_test_db"
+    };
+    T(repDb.save(repDoc).ok);
+
+    waitForRep(repDb, repDoc, "error");
+    var repDoc1 = repDb.open(repDoc._id);
+    T(repDoc1 !== null);
+    T(repDoc1._replication_state === "error");
+    T(typeof repDoc1._replication_state_time === "string");
+    T(typeof repDoc1._replication_id  === "string");
+  }
+ */
+/*
+ * repDb.deleteDb();
+ * restartServer();
+ * run_on_modified_server(server_config, error_state_replication);
+ */
+
+
+  // cleanup
+  repDb.deleteDb();
+  dbA.deleteDb();
+  dbB.deleteDb();
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/test/replicator_db_successive.js
----------------------------------------------------------------------
diff --git a/share/test/replicator_db_successive.js b/share/test/replicator_db_successive.js
new file mode 100644
index 0000000..4898c33
--- /dev/null
+++ b/share/test/replicator_db_successive.js
@@ -0,0 +1,127 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+
+couchTests.replicator_db_successive = function(debug) {
+
+  if (debug) debugger;
+
+  var populate_db = replicator_db.populate_db;
+  var docs1 = replicator_db.docs1;
+  var dbA = replicator_db.dbA;
+  var dbB = replicator_db.dbB;
+  var repDb = replicator_db.repDb;
+  var wait = replicator_db.wait;
+  var waitForRep = replicator_db.waitForRep;
+  var waitForSeq = replicator_db.waitForSeq;
+
+  function successive_identical_replications() {
+    populate_db(dbA, docs1);
+    populate_db(dbB, []);
+
+    var repDoc1 = {
+      _id: "foo_ident_rep_1",
+      source: dbA.name,
+      target: dbB.name
+    };
+    T(repDb.save(repDoc1).ok);
+
+    waitForRep(repDb, repDoc1, "completed");
+    for (var i = 0; i < docs1.length; i++) {
+      var doc = docs1[i];
+      var copy = dbB.open(doc._id);
+      T(copy !== null);
+      T(copy.value === doc.value);
+    }
+
+    var repDoc1_copy = repDb.open(repDoc1._id);
+    T(repDoc1_copy !== null);
+    T(repDoc1_copy.source === repDoc1.source);
+    T(repDoc1_copy.target === repDoc1.target);
+    T(repDoc1_copy._replication_state === "completed");
+    T(typeof repDoc1_copy._replication_state_time === "string");
+    T(typeof repDoc1_copy._replication_id  === "string");
+    T(typeof repDoc1_copy._replication_stats === "object", "doc has stats");
+    var stats = repDoc1_copy._replication_stats;
+    TEquals(docs1.length, stats.revisions_checked,
+      "right # of revisions_checked");
+    TEquals(docs1.length, stats.missing_revisions_found,
+      "right # of missing_revisions_found");
+    TEquals(docs1.length, stats.docs_read, "right # of docs_read");
+    TEquals(docs1.length, stats.docs_written, "right # of docs_written");
+    TEquals(0, stats.doc_write_failures, "right # of doc_write_failures");
+    TEquals(dbA.info().update_seq, stats.checkpointed_source_seq,
+      "right checkpointed_source_seq");
+
+    var newDoc = {
+      _id: "doc666",
+      value: 666
+    };
+    T(dbA.save(newDoc).ok);
+
+    wait(200);
+    var newDoc_copy = dbB.open(newDoc._id);
+    // not replicated because first replication is complete (not continuous)
+    T(newDoc_copy === null);
+
+    var repDoc2 = {
+      _id: "foo_ident_rep_2",
+      source: dbA.name,
+      target: dbB.name
+    };
+    T(repDb.save(repDoc2).ok);
+
+    waitForRep(repDb, repDoc2, "completed");
+    var newDoc_copy = dbB.open(newDoc._id);
+    T(newDoc_copy !== null);
+    T(newDoc_copy.value === newDoc.value);
+
+    var repDoc2_copy = repDb.open(repDoc2._id);
+    T(repDoc2_copy !== null);
+    T(repDoc2_copy.source === repDoc1.source);
+    T(repDoc2_copy.target === repDoc1.target);
+    T(repDoc2_copy._replication_state === "completed");
+    T(typeof repDoc2_copy._replication_state_time === "string");
+    T(typeof repDoc2_copy._replication_id === "string");
+    T(repDoc2_copy._replication_id === repDoc1_copy._replication_id);
+    T(typeof repDoc2_copy._replication_stats === "object", "doc has stats");
+    stats = repDoc2_copy._replication_stats;
+    TEquals(1, stats.revisions_checked, "right # of revisions_checked");
+    TEquals(1, stats.missing_revisions_found,
+      "right # of missing_revisions_found");
+    TEquals(1, stats.docs_read, "right # of docs_read");
+    TEquals(1, stats.docs_written, "right # of docs_written");
+    TEquals(0, stats.doc_write_failures, "right # of doc_write_failures");
+    TEquals(dbA.info().update_seq, stats.checkpointed_source_seq,
+      "right checkpointed_source_seq");
+  }
+
+  var server_config = [
+    {
+      section: "couch_httpd_auth",
+      key: "iterations",
+      value: "1"
+    },
+    {
+      section: "replicator",
+      key: "db",
+      value: repDb.name
+    }
+  ];
+
+  repDb.deleteDb();
+  run_on_modified_server(server_config, successive_identical_replications);
+
+  // cleanup
+  repDb.deleteDb();
+  dbA.deleteDb();
+  dbB.deleteDb();
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/test/replicator_db_survives.js
----------------------------------------------------------------------
diff --git a/share/test/replicator_db_survives.js b/share/test/replicator_db_survives.js
new file mode 100644
index 0000000..38273ca
--- /dev/null
+++ b/share/test/replicator_db_survives.js
@@ -0,0 +1,126 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+
+couchTests.replicator_db_survives = function(debug) {
+
+  if (debug) debugger;
+
+  var populate_db = replicator_db.populate_db;
+  var docs1 = replicator_db.docs1;
+  var dbA = replicator_db.dbA;
+  var dbB = replicator_db.dbB;
+  var repDb = replicator_db.repDb;
+  var usersDb = replicator_db.usersDb;
+  var wait = replicator_db.wait;
+  var waitForRep = replicator_db.waitForRep;
+  var waitForSeq = replicator_db.waitForSeq;
+  var waitForDocPos = replicator_db.waitForDocPos;
+  var wait_rep_doc = replicator_db.wait_rep_doc;
+
+  function continuous_replication_survives_restart() {
+    var origRepDbName = CouchDB.request(
+      "GET", "/_config/replicator/db").responseText;
+
+    repDb.deleteDb();
+
+    var xhr = CouchDB.request("PUT", "/_config/replicator/db", {
+      body : JSON.stringify(repDb.name),
+      headers: {"X-Couch-Persist": "false"}
+    });
+    T(xhr.status === 200);
+
+    populate_db(dbA, docs1);
+    populate_db(dbB, []);
+
+    var repDoc = {
+      _id: "foo_cont_rep_survives_doc",
+      source: dbA.name,
+      target: dbB.name,
+      continuous: true
+    };
+
+    T(repDb.save(repDoc).ok);
+
+    waitForSeq(dbA, dbB);
+    for (var i = 0; i < docs1.length; i++) {
+      var doc = docs1[i];
+      var copy = dbB.open(doc._id);
+      T(copy !== null);
+      T(copy.value === doc.value);
+    }
+
+    repDb.ensureFullCommit();
+    dbA.ensureFullCommit();
+
+    restartServer();
+
+    xhr = CouchDB.request("PUT", "/_config/replicator/db", {
+      body : JSON.stringify(repDb.name),
+      headers: {"X-Couch-Persist": "false"}
+    });
+
+    T(xhr.status === 200);
+
+    // add another doc to source, it will be replicated to target
+    var docX = {
+      _id: "foo1000",
+      value: 1001
+    };
+
+    T(dbA.save(docX).ok);
+
+    waitForSeq(dbA, dbB);
+    var copy = dbB.open("foo1000");
+    T(copy !== null);
+    T(copy.value === 1001);
+
+    repDoc = waitForDocPos(repDb, "foo_cont_rep_survives_doc", 3);
+    T(repDoc !== null);
+    T(repDoc.continuous === true);
+
+    // stop replication
+    T(repDb.deleteDoc(repDoc).ok);
+
+    xhr = CouchDB.request("PUT", "/_config/replicator/db", {
+      body : origRepDbName,
+      headers: {"X-Couch-Persist": "false"}
+    });
+    T(xhr.status === 200);
+  }
+
+  var server_config = [
+    {
+      section: "couch_httpd_auth",
+      key: "iterations",
+      value: "1"
+    },
+    {
+      section: "replicator",
+      key: "db",
+      value: repDb.name
+    },
+    {
+      section: "couch_httpd_auth",
+      key: "authentication_db",
+      value: usersDb.name
+    }
+  ];
+
+  repDb.deleteDb();
+  run_on_modified_server(server_config, continuous_replication_survives_restart);
+
+  // cleanup
+  repDb.deleteDb();
+  dbA.deleteDb();
+  dbB.deleteDb();
+  usersDb.deleteDb();
+}

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/test/replicator_db_swap_rep_db.js
----------------------------------------------------------------------
diff --git a/share/test/replicator_db_swap_rep_db.js b/share/test/replicator_db_swap_rep_db.js
new file mode 100644
index 0000000..04f4e9f
--- /dev/null
+++ b/share/test/replicator_db_swap_rep_db.js
@@ -0,0 +1,170 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+
+couchTests.replicator_db_swap_rep_db = function(debug) {
+
+  if (debug) debugger;
+
+  var populate_db = replicator_db.populate_db;
+  var docs1 = replicator_db.docs1;
+  var dbA = replicator_db.dbA;
+  var dbB = replicator_db.dbB;
+  var repDb = replicator_db.repDb;
+  var usersDb = replicator_db.usersDb;
+  var wait = replicator_db.wait;
+  var waitForRep = replicator_db.waitForRep;
+  var waitForSeq = replicator_db.waitForSeq;
+  var wait_rep_doc = replicator_db.wait_rep_doc;
+
+  function swap_rep_db() {
+    var repDb2 = new CouchDB("test_suite_rep_db_2");
+    var dbA = new CouchDB("test_suite_rep_db_a");
+    var dbA_copy = new CouchDB("test_suite_rep_db_a_copy");
+    var dbB = new CouchDB("test_suite_rep_db_b");
+    var dbB_copy = new CouchDB("test_suite_rep_db_b_copy");
+    var dbC = new CouchDB("test_suite_rep_db_c");
+    var dbC_copy = new CouchDB("test_suite_rep_db_c_copy");
+    var repDoc1, repDoc2, repDoc3;
+    var xhr, i, doc, copy, new_doc;
+
+    populate_db(dbA, docs1);
+    populate_db(dbB, docs1);
+    populate_db(dbC, docs1);
+    populate_db(dbA_copy, []);
+    populate_db(dbB_copy, []);
+    populate_db(dbC_copy, []);
+    populate_db(repDb2, []);
+
+    repDoc1 = {
+      _id: "rep1",
+      source: CouchDB.protocol + CouchDB.host + "/" + dbA.name,
+      target: dbA_copy.name,
+      continuous: true
+    };
+    repDoc2 = {
+      _id: "rep2",
+      source: CouchDB.protocol + CouchDB.host + "/" + dbB.name,
+      target: dbB_copy.name,
+      continuous: true
+    };
+    repDoc3 = {
+      _id: "rep3",
+      source: CouchDB.protocol + CouchDB.host + "/" + dbC.name,
+      target: dbC_copy.name,
+      continuous: true
+    };
+
+    TEquals(true, repDb.save(repDoc1).ok);
+    TEquals(true, repDb.save(repDoc2).ok);
+
+    waitForSeq(dbA, dbA_copy);
+    waitForSeq(dbB, dbB_copy);
+
+    xhr = CouchDB.request("PUT", "/_config/replicator/db",{
+      body : JSON.stringify(repDb2.name),
+      headers: {"X-Couch-Persist": "false"}
+    });
+    TEquals(200, xhr.status);
+
+    // Temporary band-aid, give the replicator db some
+    // time to make the switch
+    wait(500);
+
+    new_doc = {
+      _id: "foo666",
+      value: 666
+    };
+
+    TEquals(true, dbA.save(new_doc).ok);
+    TEquals(true, dbB.save(new_doc).ok);
+    waitForSeq(dbA, dbA_copy);
+    waitForSeq(dbB, dbB_copy);
+
+    TEquals(true, repDb2.save(repDoc3).ok);
+    waitForSeq(dbC, dbC_copy);
+
+    for (i = 0; i < docs1.length; i++) {
+      doc = docs1[i];
+      copy = dbA_copy.open(doc._id);
+      T(copy !== null);
+      TEquals(doc.value, copy.value);
+      copy = dbB_copy.open(doc._id);
+      T(copy !== null);
+      TEquals(doc.value, copy.value);
+      copy = dbC_copy.open(doc._id);
+      T(copy !== null);
+      TEquals(doc.value, copy.value);
+    }
+
+    // replications rep1 and rep2 should have been stopped when the replicator
+    // database was swapped
+    copy = dbA_copy.open(new_doc._id);
+    TEquals(null, copy);
+    copy = dbB_copy.open(new_doc._id);
+    TEquals(null, copy);
+
+    xhr = CouchDB.request("PUT", "/_config/replicator/db",{
+      body : JSON.stringify(repDb.name),
+      headers: {"X-Couch-Persist": "false"}
+    });
+    TEquals(200, xhr.status);
+
+    // after setting the replicator database to the former, replications rep1
+    // and rep2 should have been resumed, while rep3 was stopped
+    TEquals(true, dbC.save(new_doc).ok);
+    wait(1000);
+
+    waitForSeq(dbA, dbA_copy);
+    waitForSeq(dbB, dbB_copy);
+
+    copy = dbA_copy.open(new_doc._id);
+    T(copy !== null);
+    TEquals(new_doc.value, copy.value);
+    copy = dbB_copy.open(new_doc._id);
+    T(copy !== null);
+    TEquals(new_doc.value, copy.value);
+    copy = dbC_copy.open(new_doc._id);
+    TEquals(null, copy);
+  }
+  var server_config = [
+    {
+      section: "couch_httpd_auth",
+      key: "iterations",
+      value: "1"
+    },
+    {
+      section: "replicator",
+      key: "db",
+      value: repDb.name
+    },
+    {
+      section: "couch_httpd_auth",
+      key: "authentication_db",
+      value: usersDb.name
+    }
+  ];
+
+  repDb.deleteDb();
+  run_on_modified_server(server_config, swap_rep_db);
+
+  // cleanup
+  repDb.deleteDb();
+  dbA.deleteDb();
+  dbB.deleteDb();
+  usersDb.deleteDb();
+  (new CouchDB("test_suite_rep_db_2")).deleteDb();
+  (new CouchDB("test_suite_rep_db_c")).deleteDb();
+  (new CouchDB("test_suite_rep_db_a_copy")).deleteDb();
+  (new CouchDB("test_suite_rep_db_b_copy")).deleteDb();
+  (new CouchDB("test_suite_rep_db_c_copy")).deleteDb();
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/test/replicator_db_update_security.js
----------------------------------------------------------------------
diff --git a/share/test/replicator_db_update_security.js b/share/test/replicator_db_update_security.js
new file mode 100644
index 0000000..4651514
--- /dev/null
+++ b/share/test/replicator_db_update_security.js
@@ -0,0 +1,92 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+
+couchTests.replicator_db_update_security = function(debug) {
+
+  if (debug) debugger;
+
+  var populate_db = replicator_db.populate_db;
+  var docs1 = replicator_db.docs1;
+  var dbA = replicator_db.dbA;
+  var dbB = replicator_db.dbB;
+  var repDb = replicator_db.repDb;
+  var usersDb = replicator_db.usersDb;
+  var wait = replicator_db.wait;
+  var waitForRep = replicator_db.waitForRep;
+  var waitForSeq = replicator_db.waitForSeq;
+  var wait_rep_doc = replicator_db.wait_rep_doc;
+
+  function test_rep_db_update_security() {
+    var dbA_copy = new CouchDB("test_suite_rep_db_a_copy");
+    var dbB_copy = new CouchDB("test_suite_rep_db_b_copy");
+    var repDoc1, repDoc2;
+    var xhr, i, doc, copy, new_doc;
+    var docs = makeDocs(1, 3);
+
+    populate_db(dbA, docs);
+    populate_db(dbB, docs);
+    populate_db(dbA_copy, []);
+    populate_db(dbB_copy, []);
+
+    repDoc1 = {
+      _id: "rep1",
+      source: CouchDB.protocol + CouchDB.host + "/" + dbA.name,
+      target: dbA_copy.name
+    };
+    repDoc2 = {
+      _id: "rep2",
+      source: CouchDB.protocol + CouchDB.host + "/" + dbB.name,
+      target: dbB_copy.name
+    };
+
+    TEquals(true, repDb.save(repDoc1).ok);
+    waitForRep(repDb, repDoc1, "completed");
+
+    T(repDb.setSecObj({
+      readers: {
+        names: ["joe"]
+      }
+    }).ok);
+
+    TEquals(true, repDb.save(repDoc2).ok);
+    waitForRep(repDb, repDoc2, "completed");
+  }
+
+  var server_config = [
+    {
+      section: "couch_httpd_auth",
+      key: "iterations",
+      value: "1"
+    },
+    {
+      section: "replicator",
+      key: "db",
+      value: repDb.name
+    },
+    {
+      section: "couch_httpd_auth",
+      key: "authentication_db",
+      value: usersDb.name
+    }
+  ];
+
+  repDb.deleteDb();
+  run_on_modified_server(server_config, test_rep_db_update_security);
+
+  // cleanup
+  repDb.deleteDb();
+  dbA.deleteDb();
+  dbB.deleteDb();
+  usersDb.deleteDb();
+  (new CouchDB("test_suite_rep_db_a_copy")).deleteDb();
+  (new CouchDB("test_suite_rep_db_b_copy")).deleteDb();
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/test/replicator_db_user_ctx.js
----------------------------------------------------------------------
diff --git a/share/test/replicator_db_user_ctx.js b/share/test/replicator_db_user_ctx.js
new file mode 100644
index 0000000..570fc7d
--- /dev/null
+++ b/share/test/replicator_db_user_ctx.js
@@ -0,0 +1,272 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+
+couchTests.replicator_db_user_ctx = function(debug) {
+
+  if (debug) debugger;
+
+  var populate_db = replicator_db.populate_db;
+  var docs1 = replicator_db.docs1;
+  var dbA = replicator_db.dbA;
+  var dbB = replicator_db.dbB;
+  var repDb = replicator_db.repDb;
+  var usersDb = replicator_db.usersDb;
+  var wait = replicator_db.wait;
+  var waitForRep = replicator_db.waitForRep;
+  var waitForSeq = replicator_db.waitForSeq;
+  var wait_rep_doc = replicator_db.wait_rep_doc;
+
+ function test_user_ctx_validation() {
+    populate_db(dbA, docs1);
+    populate_db(dbB, []);
+    populate_db(usersDb, []);
+
+    var joeUserDoc = CouchDB.prepareUserDoc({
+      name: "joe",
+      roles: ["erlanger", "bar"]
+    }, "erly");
+    var fdmananaUserDoc = CouchDB.prepareUserDoc({
+      name: "fdmanana",
+      roles: ["a", "b", "c"]
+    }, "qwerty");
+
+    TEquals(true, usersDb.save(joeUserDoc).ok);
+    TEquals(true, usersDb.save(fdmananaUserDoc).ok);
+
+    T(dbB.setSecObj({
+      admins: {
+        names: [],
+        roles: ["god"]
+      },
+      readers: {
+        names: [],
+        roles: ["foo"]
+      }
+    }).ok);
+
+    TEquals(true, CouchDB.login("joe", "erly").ok);
+    TEquals("joe", CouchDB.session().userCtx.name);
+    TEquals(-1, CouchDB.session().userCtx.roles.indexOf("_admin"));
+
+    var repDoc = {
+      _id: "foo_rep",
+      source: CouchDB.protocol + CouchDB.host + "/" + dbA.name,
+      target: dbB.name
+    };
+
+    try {
+      repDb.save(repDoc);
+      T(false, "Should have failed, user_ctx missing.");
+    } catch (x) {
+      TEquals("forbidden", x.error);
+    }
+
+    repDoc.user_ctx = {
+      name: "john",
+      roles: ["erlanger"]
+    };
+
+    try {
+      repDb.save(repDoc);
+      T(false, "Should have failed, wrong user_ctx.name.");
+    } catch (x) {
+      TEquals("forbidden", x.error);
+    }
+
+    repDoc.user_ctx = {
+      name: "joe",
+      roles: ["bar", "god", "erlanger"]
+    };
+
+    try {
+      repDb.save(repDoc);
+      T(false, "Should have failed, a bad role in user_ctx.roles.");
+    } catch (x) {
+      TEquals("forbidden", x.error);
+    }
+
+    // user_ctx.roles might contain only a subset of the user's roles
+    repDoc.user_ctx = {
+      name: "joe",
+      roles: ["erlanger"]
+    };
+
+    TEquals(true, repDb.save(repDoc).ok);
+    CouchDB.logout();
+
+    waitForRep(repDb, repDoc, "error");
+    var repDoc1 = repDb.open(repDoc._id);
+    T(repDoc1 !== null);
+    TEquals(repDoc.source, repDoc1.source);
+    TEquals(repDoc.target, repDoc1.target);
+    TEquals("error", repDoc1._replication_state);
+    TEquals("string", typeof repDoc1._replication_id);
+    TEquals("string", typeof repDoc1._replication_state_time);
+
+    TEquals(true, CouchDB.login("fdmanana", "qwerty").ok);
+    TEquals("fdmanana", CouchDB.session().userCtx.name);
+    TEquals(-1, CouchDB.session().userCtx.roles.indexOf("_admin"));
+
+    try {
+      T(repDb.deleteDoc(repDoc1).ok);
+      T(false, "Shouldn't be able to delete replication document.");
+    } catch (x) {
+      TEquals("forbidden", x.error);
+    }
+
+    CouchDB.logout();
+    TEquals(true, CouchDB.login("joe", "erly").ok);
+    TEquals("joe", CouchDB.session().userCtx.name);
+    TEquals(-1, CouchDB.session().userCtx.roles.indexOf("_admin"));
+
+    T(repDb.deleteDoc(repDoc1).ok);
+    CouchDB.logout();
+
+    for (var i = 0; i < docs1.length; i++) {
+      var doc = docs1[i];
+      var copy = dbB.open(doc._id);
+
+      TEquals(null, copy);
+    }
+
+    T(dbB.setSecObj({
+      admins: {
+        names: [],
+        roles: ["god", "erlanger"]
+      },
+      readers: {
+        names: [],
+        roles: ["foo"]
+      }
+    }).ok);
+
+    TEquals(true, CouchDB.login("joe", "erly").ok);
+    TEquals("joe", CouchDB.session().userCtx.name);
+    TEquals(-1, CouchDB.session().userCtx.roles.indexOf("_admin"));
+
+    repDoc = {
+      _id: "foo_rep_2",
+      source: CouchDB.protocol + CouchDB.host + "/" + dbA.name,
+      target: dbB.name,
+      user_ctx: {
+        name: "joe",
+        roles: ["erlanger"]
+      }
+    };
+
+    TEquals(true, repDb.save(repDoc).ok);
+    CouchDB.logout();
+
+    waitForRep(repDb, repDoc, "complete");
+    repDoc1 = repDb.open(repDoc._id);
+    T(repDoc1 !== null);
+    TEquals(repDoc.source, repDoc1.source);
+    TEquals(repDoc.target, repDoc1.target);
+    TEquals("completed", repDoc1._replication_state);
+    TEquals("string", typeof repDoc1._replication_id);
+    TEquals("string", typeof repDoc1._replication_state_time);
+
+    for (var i = 0; i < docs1.length; i++) {
+      var doc = docs1[i];
+      var copy = dbB.open(doc._id);
+
+      T(copy !== null);
+      TEquals(doc.value, copy.value);
+    }
+
+    // Admins don't need to supply a user_ctx property in replication docs.
+    // If they do not, the implicit user_ctx "user_ctx": {name: null, roles: []}
+    // is used, meaning that design documents will not be replicated into
+    // local targets
+    T(dbB.setSecObj({
+      admins: {
+        names: [],
+        roles: []
+      },
+      readers: {
+        names: [],
+        roles: []
+      }
+    }).ok);
+
+    var ddoc = { _id: "_design/foo" };
+    TEquals(true, dbA.save(ddoc).ok);
+
+    repDoc = {
+      _id: "foo_rep_3",
+      source: CouchDB.protocol + CouchDB.host + "/" + dbA.name,
+      target: dbB.name
+    };
+
+    TEquals(true, repDb.save(repDoc).ok);
+    waitForRep(repDb, repDoc, "complete");
+    repDoc1 = repDb.open(repDoc._id);
+    T(repDoc1 !== null);
+    TEquals(repDoc.source, repDoc1.source);
+    TEquals(repDoc.target, repDoc1.target);
+    TEquals("completed", repDoc1._replication_state);
+    TEquals("string", typeof repDoc1._replication_id);
+    TEquals("string", typeof repDoc1._replication_state_time);
+
+    var ddoc_copy = dbB.open(ddoc._id);
+    T(ddoc_copy === null);
+
+    repDoc = {
+      _id: "foo_rep_4",
+      source: CouchDB.protocol + CouchDB.host + "/" + dbA.name,
+      target: dbB.name,
+      user_ctx: {
+        roles: ["_admin"]
+      }
+    };
+
+    TEquals(true, repDb.save(repDoc).ok);
+    waitForRep(repDb, repDoc, "complete");
+    repDoc1 = repDb.open(repDoc._id);
+    T(repDoc1 !== null);
+    TEquals(repDoc.source, repDoc1.source);
+    TEquals(repDoc.target, repDoc1.target);
+    TEquals("completed", repDoc1._replication_state);
+    TEquals("string", typeof repDoc1._replication_id);
+    TEquals("string", typeof repDoc1._replication_state_time);
+
+    ddoc_copy = dbB.open(ddoc._id);
+    T(ddoc_copy !== null);
+  }
+
+  var server_config = [
+    {
+      section: "couch_httpd_auth",
+      key: "iterations",
+      value: "1"
+    },
+    {
+      section: "replicator",
+      key: "db",
+      value: repDb.name
+    },
+    {
+      section: "couch_httpd_auth",
+      key: "authentication_db",
+      value: usersDb.name
+    }
+  ];
+
+  repDb.deleteDb();
+  run_on_modified_server(server_config, test_user_ctx_validation);
+
+  // cleanup
+  repDb.deleteDb();
+  dbA.deleteDb();
+  dbB.deleteDb();
+  usersDb.deleteDb();
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/test/replicator_db_write_auth.js
----------------------------------------------------------------------
diff --git a/share/test/replicator_db_write_auth.js b/share/test/replicator_db_write_auth.js
new file mode 100644
index 0000000..697abf3
--- /dev/null
+++ b/share/test/replicator_db_write_auth.js
@@ -0,0 +1,102 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+
+couchTests.replicator_db_survives = function(debug) {
+
+  if (debug) debugger;
+
+  var populate_db = replicator_db.populate_db;
+  var docs1 = replicator_db.docs1;
+  var dbA = replicator_db.dbA;
+  var dbB = replicator_db.dbB;
+  var repDb = replicator_db.repDb;
+  var usersDb = replicator_db.usersDb;
+  var wait = replicator_db.wait;
+  var waitForRep = replicator_db.waitForRep;
+  var waitForSeq = replicator_db.waitForSeq;
+  var waitForDocPos = replicator_db.waitForDocPos;
+  var wait_rep_doc = replicator_db.wait_rep_doc;
+
+  function rep_db_write_authorization() {
+    populate_db(dbA, docs1);
+    populate_db(dbB, []);
+
+    var server_admins_config = [
+      {
+        section: "admins",
+        key: "fdmanana",
+        value: "qwerty"
+      }
+    ];
+
+    run_on_modified_server(server_admins_config, function() {
+      var repDoc = {
+        _id: "foo_rep_doc",
+        source: dbA.name,
+        target: dbB.name,
+        continuous: true
+      };
+
+      T(CouchDB.login("fdmanana", "qwerty").ok);
+      T(CouchDB.session().userCtx.name === "fdmanana");
+      T(CouchDB.session().userCtx.roles.indexOf("_admin") !== -1);
+
+      T(repDb.save(repDoc).ok);
+
+      waitForRep(repDb, repDoc, "completed");
+
+      for (var i = 0; i < docs1.length; i++) {
+        var doc = docs1[i];
+        var copy = dbB.open(doc._id);
+
+        T(copy !== null);
+        T(copy.value === doc.value);
+      }
+
+      repDoc = repDb.open("foo_rep_doc");
+      T(repDoc !== null);
+      repDoc.target = "test_suite_foo_db";
+      repDoc.create_target = true;
+
+      // Only the replicator can update replication documents.
+      // Admins can only add and delete replication documents.
+      try {
+        repDb.save(repDoc);
+        T(false && "Should have thrown an exception");
+      } catch (x) {
+        T(x["error"] === "forbidden");
+      }
+    });
+  }
+
+  var server_config = [
+    {
+      section: "couch_httpd_auth",
+      key: "iterations",
+      value: "1"
+    },
+    {
+      section: "replicator",
+      key: "db",
+      value: repDb.name
+    }
+  ];
+
+  repDb.deleteDb();
+  run_on_modified_server(server_config, rep_db_write_authorization);
+
+  // cleanup
+  repDb.deleteDb();
+  dbA.deleteDb();
+  dbB.deleteDb();
+  usersDb.deleteDb();
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/test/rev_stemming.js
----------------------------------------------------------------------
diff --git a/share/test/rev_stemming.js b/share/test/rev_stemming.js
new file mode 100644
index 0000000..954da79
--- /dev/null
+++ b/share/test/rev_stemming.js
@@ -0,0 +1,110 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+
+couchTests.rev_stemming = function(debug) {
+  var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"});
+  db.deleteDb();
+  db.createDb();
+  var db = new CouchDB("test_suite_db_a", {"X-Couch-Full-Commit":"false"});
+  db.deleteDb();
+  db.createDb();
+  var dbB = new CouchDB("test_suite_db_b", {"X-Couch-Full-Commit":"false"});
+  dbB.deleteDb();
+  dbB.createDb();
+  if (debug) debugger;
+
+  var newLimit = 5;
+
+  T(db.getDbProperty("_revs_limit") == 1000);
+
+  // Make an invalid request to _revs_limit
+  // Should return 400
+  var xhr = CouchDB.request("PUT", "/test_suite_db/_revs_limit", {body:"\"foo\""});
+  T(xhr.status == 400);
+  var result = JSON.parse(xhr.responseText);
+  T(result.error == "bad_request");
+  T(result.reason == "Rev limit has to be an integer");
+
+  var doc = {_id:"foo",foo:0}
+  for( var i=0; i < newLimit + 1; i++) {
+    doc.foo++;
+    T(db.save(doc).ok);
+  }
+  var doc0 = db.open("foo", {revs:true});
+  T(doc0._revisions.ids.length == newLimit + 1);
+
+  var docBar = {_id:"bar",foo:0}
+  for( var i=0; i < newLimit + 1; i++) {
+    docBar.foo++;
+    T(db.save(docBar).ok);
+  }
+  T(db.open("bar", {revs:true})._revisions.ids.length == newLimit + 1);
+
+  T(db.setDbProperty("_revs_limit", newLimit).ok);
+
+  for( var i=0; i < newLimit + 1; i++) {
+    doc.foo++;
+    T(db.save(doc).ok);
+  }
+  doc0 = db.open("foo", {revs:true});
+  T(doc0._revisions.ids.length == newLimit);
+
+
+  // If you replicate after you make more edits than the limit, you'll
+  // cause a spurious edit conflict.
+  CouchDB.replicate("test_suite_db_a", "test_suite_db_b");
+  var docB1 = dbB.open("foo",{conflicts:true})
+  T(docB1._conflicts == null);
+
+  for( var i=0; i < newLimit - 1; i++) {
+    doc.foo++;
+    T(db.save(doc).ok);
+  }
+
+  // one less edit than limit, no conflict
+  CouchDB.replicate("test_suite_db_a", "test_suite_db_b");
+  var docB1 = dbB.open("foo",{conflicts:true})
+  T(docB1._conflicts == null);
+
+  //now we hit the limit
+  for( var i=0; i < newLimit; i++) {
+    doc.foo++;
+    T(db.save(doc).ok);
+  }
+
+  CouchDB.replicate("test_suite_db_a", "test_suite_db_b");
+
+  var docB2 = dbB.open("foo",{conflicts:true});
+
+  // we have a conflict, but the previous replicated rev is always the losing
+  // conflict
+  T(docB2._conflicts[0] == docB1._rev)
+
+  // We having already updated bar before setting the limit, so it's still got
+  // a long rev history. compact to stem the revs.
+
+  T(db.open("bar", {revs:true})._revisions.ids.length == newLimit + 1);
+
+  T(db.compact().ok);
+
+  // compaction isn't instantaneous, loop until done
+  while (db.info().compact_running) {};
+
+  // force reload because ETags don't honour compaction
+  var req = db.request("GET", "/test_suite_db_a/bar?revs=true", {
+    headers:{"if-none-match":"pommes"}
+  });
+
+  var finalDoc = JSON.parse(req.responseText);
+  TEquals(newLimit, finalDoc._revisions.ids.length,
+    "should return a truncated revision list");
+};

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/test/rewrite.js
----------------------------------------------------------------------
diff --git a/share/test/rewrite.js b/share/test/rewrite.js
new file mode 100644
index 0000000..5c56fa5
--- /dev/null
+++ b/share/test/rewrite.js
@@ -0,0 +1,505 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+ 
+ 
+ 
+couchTests.rewrite = function(debug) {
+  if (debug) debugger;
+  var dbNames = ["test_suite_db", "test_suite_db/with_slashes"];
+  for (var i=0; i < dbNames.length; i++) {
+    var db = new CouchDB(dbNames[i]);
+    var dbName = encodeURIComponent(dbNames[i]);
+    db.deleteDb();
+    db.createDb();
+  
+    
+    run_on_modified_server(
+      [{section: "httpd",
+        key: "authentication_handlers",
+        value: "{couch_httpd_auth, special_test_authentication_handler}"},
+       {section:"httpd",
+        key: "WWW-Authenticate",
+        value: "X-Couch-Test-Auth"}],
+      
+      function(){
+        var designDoc = {
+          _id:"_design/test",
+          language: "javascript",
+          _attachments:{
+            "foo.txt": {
+              content_type:"text/plain",
+              data: "VGhpcyBpcyBhIGJhc2U2NCBlbmNvZGVkIHRleHQ="
+            }
+          },
+          rewrites: [
+            {
+              "from": "foo",
+              "to": "foo.txt"
+            },
+            {
+              "from": "foo2",
+              "to": "foo.txt",
+              "method": "GET"
+            },
+            {
+              "from": "hello/:id",
+              "to": "_update/hello/:id",
+              "method": "PUT"
+            },
+            {
+              "from": "/welcome",
+              "to": "_show/welcome"
+            },
+            {
+              "from": "/welcome/:name",
+              "to": "_show/welcome",
+              "query": {
+                "name": ":name"
+              }
+            },
+            {
+              "from": "/welcome2",
+              "to": "_show/welcome",
+              "query": {
+                "name": "user"
+              }
+            },
+            {
+              "from": "/welcome3/:name",
+              "to": "_update/welcome2/:name",
+              "method": "PUT"
+            },
+            {
+              "from": "/welcome3/:name",
+              "to": "_show/welcome2/:name",
+              "method": "GET"
+            },
+            {
+              "from": "/welcome4/*",
+              "to" : "_show/welcome3",
+              "query": {
+                "name": "*"
+              }
+            },
+            {
+              "from": "/welcome5/*",
+              "to" : "_show/*",
+              "query": {
+                "name": "*"
+              }
+            },
+            {
+              "from": "basicView",
+              "to": "_view/basicView",
+            },
+            {
+              "from": "simpleForm/basicView",
+              "to": "_list/simpleForm/basicView",
+            },
+            {
+              "from": "simpleForm/basicViewFixed",
+              "to": "_list/simpleForm/basicView",
+              "query": {
+                "startkey": 3,
+                "endkey": 8
+              }
+            },
+            {
+              "from": "simpleForm/basicViewPath/:start/:end",
+              "to": "_list/simpleForm/basicView",
+              "query": {
+                "startkey": ":start",
+                "endkey": ":end"
+              },
+              "formats": {
+                "start": "int",
+                "end": "int"
+              }
+            },
+            {
+              "from": "simpleForm/complexView",
+              "to": "_list/simpleForm/complexView",
+              "query": {
+                "key": [1, 2]
+              }
+            },
+            {
+              "from": "simpleForm/complexView2",
+              "to": "_list/simpleForm/complexView",
+              "query": {
+                "key": ["test", {}]
+              }
+            },
+            {
+              "from": "simpleForm/complexView3",
+              "to": "_list/simpleForm/complexView",
+              "query": {
+                "key": ["test", ["test", "essai"]]
+              }
+            },
+            {
+              "from": "simpleForm/complexView4",
+              "to": "_list/simpleForm/complexView2",
+              "query": {
+                "key": {"c": 1}
+              }
+            },
+            {
+              "from": "simpleForm/complexView5/:a/:b",
+              "to": "_list/simpleForm/complexView3",
+              "query": {
+                "key": [":a", ":b"]
+              }
+            },
+            {
+              "from": "simpleForm/complexView6",
+              "to": "_list/simpleForm/complexView3",
+              "query": {
+                "key": [":a", ":b"]
+              }
+            },
+            {
+              "from": "simpleForm/complexView7/:a/:b",
+              "to": "_view/complexView3",
+              "query": {
+                "key": [":a", ":b"],
+                "include_docs": ":doc"
+              },
+              "format": {
+                "doc": "bool"
+              }
+
+            },
+            {
+              "from": "/",
+              "to": "_view/basicView",
+            },
+            {
+              "from": "/db/*",
+              "to": "../../*"
+            }
+          ],
+          lists: {
+            simpleForm: stringFun(function(head, req) {
+              log("simpleForm");
+              send('<ul>');
+              var row, row_number = 0, prevKey, firstKey = null;
+              while (row = getRow()) {
+                row_number += 1;
+                if (!firstKey) firstKey = row.key;
+                prevKey = row.key;
+                send('\n<li>Key: '+row.key
+                     +' Value: '+row.value
+                     +' LineNo: '+row_number+'</li>');
+              }
+              return '</ul><p>FirstKey: '+ firstKey + ' LastKey: '+ prevKey+'</p>';
+            }),
+          },
+          shows: {
+            "welcome": stringFun(function(doc,req) {
+              return "Welcome " + req.query["name"];
+            }),
+            "welcome2": stringFun(function(doc, req) {
+              return "Welcome " + doc.name;
+            }),
+            "welcome3": stringFun(function(doc,req) {
+              return "Welcome " + req.query["name"];
+            })
+          },
+          updates: {
+            "hello" : stringFun(function(doc, req) {
+              if (!doc) {
+                if (req.id) {
+                  return [{
+                    _id : req.id
+                  }, "New World"]
+                }
+                return [null, "Empty World"];
+              }
+              doc.world = "hello";
+              doc.edited_by = req.userCtx;
+              return [doc, "hello doc"];
+            }),
+            "welcome2": stringFun(function(doc, req) {
+              if (!doc) {
+                if (req.id) {
+                  return [{
+                    _id: req.id,
+                    name: req.id
+                  }, "New World"]
+                }
+                return [null, "Empty World"];
+              }
+              return [doc, "hello doc"];
+            })
+          },
+          views : {
+            basicView : {
+              map : stringFun(function(doc) {
+                if (doc.integer) {
+                  emit(doc.integer, doc.string);
+                }
+                
+              })
+            },
+            complexView: {
+              map: stringFun(function(doc) {
+                if (doc.type == "complex") {
+                  emit([doc.a, doc.b], doc.string);
+                }
+              })
+            },
+            complexView2: {
+              map: stringFun(function(doc) {
+                if (doc.type == "complex") {
+                  emit(doc.a, doc.string);
+                }
+              })
+            },
+            complexView3: {
+              map: stringFun(function(doc) {
+                if (doc.type == "complex") {
+                  emit(doc.b, doc.string);
+                }
+              })
+            }
+          }
+        }
+        
+        db.save(designDoc);
+        
+        var docs = makeDocs(0, 10);
+        db.bulkSave(docs);
+
+        var docs2 = [
+          {"a": 1, "b": 1, "string": "doc 1", "type": "complex"},
+          {"a": 1, "b": 2, "string": "doc 2", "type": "complex"},
+          {"a": "test", "b": {}, "string": "doc 3", "type": "complex"},
+          {"a": "test", "b": ["test", "essai"], "string": "doc 4", "type": "complex"},
+          {"a": {"c": 1}, "b": "", "string": "doc 5", "type": "complex"}
+        ];
+
+        db.bulkSave(docs2);
+
+        // test simple rewriting
+        
+        req = CouchDB.request("GET", "/"+dbName+"/_design/test/_rewrite/foo");
+        T(req.responseText == "This is a base64 encoded text");
+        T(req.getResponseHeader("Content-Type") == "text/plain");
+        
+        req = CouchDB.request("GET", "/"+dbName+"/_design/test/_rewrite/foo2");
+        T(req.responseText == "This is a base64 encoded text");
+        T(req.getResponseHeader("Content-Type") == "text/plain");
+        
+        
+        // test POST
+        // hello update world
+        
+        var doc = {"word":"plankton", "name":"Rusty"}
+        var resp = db.save(doc);
+        T(resp.ok);
+        var docid = resp.id;
+        
+        xhr = CouchDB.request("PUT", "/"+dbName+"/_design/test/_rewrite/hello/"+docid);
+        T(xhr.status == 201);
+        T(xhr.responseText == "hello doc");
+        T(/charset=utf-8/.test(xhr.getResponseHeader("Content-Type")))
+        
+        doc = db.open(docid);
+        T(doc.world == "hello");
+        
+        req = CouchDB.request("GET", "/"+dbName+"/_design/test/_rewrite/welcome?name=user");
+        T(req.responseText == "Welcome user");
+        
+        req = CouchDB.request("GET", "/"+dbName+"/_design/test/_rewrite/welcome/user");
+        T(req.responseText == "Welcome user");
+        
+        req = CouchDB.request("GET", "/"+dbName+"/_design/test/_rewrite/welcome2");
+        T(req.responseText == "Welcome user");
+        
+        xhr = CouchDB.request("PUT", "/"+dbName+"/_design/test/_rewrite/welcome3/test");
+        T(xhr.status == 201);
+        T(xhr.responseText == "New World");
+        T(/charset=utf-8/.test(xhr.getResponseHeader("Content-Type")));
+        
+        xhr = CouchDB.request("GET", "/"+dbName+"/_design/test/_rewrite/welcome3/test");
+        T(xhr.responseText == "Welcome test");
+
+        req = CouchDB.request("GET", "/"+dbName+"/_design/test/_rewrite/welcome4/user");
+        T(req.responseText == "Welcome user");
+
+        req = CouchDB.request("GET", "/"+dbName+"/_design/test/_rewrite/welcome5/welcome3");
+        T(req.responseText == "Welcome welcome3");
+        
+        xhr = CouchDB.request("GET", "/"+dbName+"/_design/test/_rewrite/basicView");
+        T(xhr.status == 200, "view call");
+        T(/{"total_rows":9/.test(xhr.responseText)); 
+
+        xhr = CouchDB.request("GET", "/"+dbName+"/_design/test/_rewrite/");
+        T(xhr.status == 200, "view call");
+        T(/{"total_rows":9/.test(xhr.responseText)); 
+
+        
+        // get with query params
+        xhr = CouchDB.request("GET", "/"+dbName+"/_design/test/_rewrite/simpleForm/basicView?startkey=3&endkey=8");
+        T(xhr.status == 200, "with query params");
+        T(!(/Key: 1/.test(xhr.responseText)));
+        T(/FirstKey: 3/.test(xhr.responseText));
+        T(/LastKey: 8/.test(xhr.responseText));
+        
+        xhr = CouchDB.request("GET", "/"+dbName+"/_design/test/_rewrite/simpleForm/basicViewFixed");
+        T(xhr.status == 200, "with query params");
+        T(!(/Key: 1/.test(xhr.responseText)));
+        T(/FirstKey: 3/.test(xhr.responseText));
+        T(/LastKey: 8/.test(xhr.responseText));
+        
+        // get with query params
+        xhr = CouchDB.request("GET", "/"+dbName+"/_design/test/_rewrite/simpleForm/basicViewFixed?startkey=4");
+        T(xhr.status == 200, "with query params");
+        T(!(/Key: 1/.test(xhr.responseText)));
+        T(/FirstKey: 3/.test(xhr.responseText));
+        T(/LastKey: 8/.test(xhr.responseText));
+        
+        // get with query params
+        xhr = CouchDB.request("GET", "/"+dbName+"/_design/test/_rewrite/simpleForm/basicViewPath/3/8");
+        T(xhr.status == 200, "with query params");
+        T(!(/Key: 1/.test(xhr.responseText)));
+        T(/FirstKey: 3/.test(xhr.responseText));
+        T(/LastKey: 8/.test(xhr.responseText));
+
+        // get with query params        
+        xhr = CouchDB.request("GET", "/"+dbName+"/_design/test/_rewrite/simpleForm/complexView");
+        T(xhr.status == 200, "with query params");
+        T(/FirstKey: [1, 2]/.test(xhr.responseText));
+        
+        xhr = CouchDB.request("GET", "/"+dbName+"/_design/test/_rewrite/simpleForm/complexView2");
+        T(xhr.status == 200, "with query params");
+        T(/Value: doc 3/.test(xhr.responseText));
+        
+        xhr = CouchDB.request("GET", "/"+dbName+"/_design/test/_rewrite/simpleForm/complexView3");
+        T(xhr.status == 200, "with query params");
+        T(/Value: doc 4/.test(xhr.responseText));
+        
+        xhr = CouchDB.request("GET", "/"+dbName+"/_design/test/_rewrite/simpleForm/complexView4");
+        T(xhr.status == 200, "with query params");
+        T(/Value: doc 5/.test(xhr.responseText));
+        
+        xhr = CouchDB.request("GET", "/"+dbName+"/_design/test/_rewrite/simpleForm/complexView5/test/essai");
+        T(xhr.status == 200, "with query params");
+        T(/Value: doc 4/.test(xhr.responseText));
+        
+        xhr = CouchDB.request("GET", "/"+dbName+"/_design/test/_rewrite/simpleForm/complexView6?a=test&b=essai");
+        T(xhr.status == 200, "with query params");
+        T(/Value: doc 4/.test(xhr.responseText));
+
+        xhr = CouchDB.request("GET", "/"+dbName+"/_design/test/_rewrite/simpleForm/complexView7/test/essai?doc=true");
+        T(xhr.status == 200, "with query params");
+        var result = JSON.parse(xhr.responseText);
+        T(typeof(result.rows[0].doc) === "object");
+        
+        // COUCHDB-2031 - path normalization versus qs params
+        xhr = CouchDB.request("GET", "/"+dbName+"/_design/test/_rewrite/db/_design/test?meta=true");
+        T(xhr.status == 200, "path normalization works with qs params");
+        var result = JSON.parse(xhr.responseText);
+        T(result['_id'] == "_design/test");
+        T(typeof(result['_revs_info']) === "object");
+
+        // test path relative to server
+        designDoc.rewrites.push({
+          "from": "uuids",
+          "to": "../../../_uuids"
+        });
+        T(db.save(designDoc).ok);
+        
+        var xhr = CouchDB.request("GET", "/"+dbName+"/_design/test/_rewrite/uuids");
+        T(xhr.status == 500);
+        var result = JSON.parse(xhr.responseText);
+        T(result.error == "insecure_rewrite_rule");
+
+        run_on_modified_server(
+          [{section: "httpd",
+            key: "secure_rewrites",
+            value: "false"}],
+          function() {
+            var xhr = CouchDB.request("GET", "/"+dbName+"/_design/test/_rewrite/uuids?cache=bust");
+            T(xhr.status == 200);
+            var result = JSON.parse(xhr.responseText);
+            T(result.uuids.length == 1);
+            var first = result.uuids[0];
+          });
+      });
+
+    // test invalid rewrites
+    // string
+    var ddoc = {
+      _id: "_design/invalid",
+      rewrites: "[{\"from\":\"foo\",\"to\":\"bar\"}]"
+    }
+    db.save(ddoc);
+    var res = CouchDB.request("GET", "/"+dbName+"/_design/invalid/_rewrite/foo");
+    TEquals(400, res.status, "should return 400");
+
+    var ddoc_requested_path = {
+      _id: "_design/requested_path",
+      rewrites:[
+        {"from": "show", "to": "_show/origin/0"},
+        {"from": "show_rewritten", "to": "_rewrite/show"}
+      ],
+      shows: {
+        origin: stringFun(function(doc, req) {
+          return req.headers["x-couchdb-requested-path"];
+        })}
+    };
+
+    db.save(ddoc_requested_path);
+    var url = "/"+dbName+"/_design/requested_path/_rewrite/show";
+    var res = CouchDB.request("GET", url);
+    TEquals(url, res.responseText, "should return the original url");
+
+    var url = "/"+dbName+"/_design/requested_path/_rewrite/show_rewritten";
+    var res = CouchDB.request("GET", url);
+    TEquals(url, res.responseText, "returned the original url");
+
+    var ddoc_loop = {
+      _id: "_design/loop",
+      rewrites: [{ "from": "loop",  "to": "_rewrite/loop"}]
+    };
+    db.save(ddoc_loop);
+
+    // Assert loop detection
+    run_on_modified_server(
+      [{section: "httpd",
+        key: "rewrite_limit",
+        value: "2"}],
+      function(){
+        var url = "/"+dbName+"/_design/loop/_rewrite/loop";
+        var xhr = CouchDB.request("GET", url);
+        TEquals(400, xhr.status);
+      });
+
+    // Assert serial execution is not spuriously counted as loop
+    run_on_modified_server(
+      [{section: "httpd",
+        key: "rewrite_limit",
+        value: "2"},
+       {section: "httpd",
+        key: "secure_rewrites",
+        value: "false"}],
+      function(){
+        var url = "/"+dbName+"/_design/test/_rewrite/foo";
+        for (var i=0; i < 5; i++) {
+            var xhr = CouchDB.request("GET", url);
+            TEquals(200, xhr.status);
+        }
+      });
+  }
+}


[20/37] goodbye Futon, old friend <3

Posted by ja...@apache.org.
http://git-wip-us.apache.org/repos/asf/couchdb/blob/cca309f3/share/www/spec/jquery_couch_js_class_methods_spec.js
----------------------------------------------------------------------
diff --git a/share/www/spec/jquery_couch_js_class_methods_spec.js b/share/www/spec/jquery_couch_js_class_methods_spec.js
deleted file mode 100644
index f2df81b..0000000
--- a/share/www/spec/jquery_couch_js_class_methods_spec.js
+++ /dev/null
@@ -1,523 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
-// Specs for jquery_couch.js lines 48-156 and 415-448
-
-describe 'jQuery couchdb'
-  before
-    stubAlert();
-  end
-  
-  after
-    destubAlert();
-  end
-  
-  describe 'activeTasks'
-    before_each
-      db = $.couch.db("spec_db");
-      db.create();
-    end
-    
-    after_each
-      db.drop();
-    end
-    
-    it 'should return an empty array when there are no active tasks'
-      $.couch.activeTasks({
-        success: function(resp){
-          resp.should.eql []
-        },
-        error: function(status, error, reason){errorCallback(status, error, reason)}
-      });
-    end
-    
-    it 'should return an active task'
-      // doing a bit of stuff here so compaction has something to do and takes a while
-      var battlestar, civillian;
-      db.saveDoc({"type":"Battlestar", "name":"Galactica"}, {
-        success: function(resp){
-          db.openDoc(resp.id, {
-            success: function(resp2){
-              battlestar = resp2;
-            },
-            error: function(status, error, reason){errorCallback(status, error, reason)}
-          });
-        },
-        error: function(status, error, reason){errorCallback(status, error, reason)}
-      });
-      battlestar.name = "Pegasus";
-      db.saveDoc(battlestar);
-      
-      db.saveDoc({"type":"Civillian", "name":"Cloud 9"}, {
-        success: function(resp){
-          db.openDoc(resp.id, {
-            success: function(resp2){
-              civillian = resp2;
-            },
-            error: function(status, error, reason){errorCallback(status, error, reason)}
-          });
-        },
-        error: function(status, error, reason){errorCallback(status, error, reason)}
-      });
-      civillian.name = "Olympic Carrier";
-      db.saveDoc(civillian);
-      db.removeDoc(civillian);
-      
-      db.compact({
-        ajaxStart: function(resp){
-          $.couch.activeTasks({
-            success: function(resp2){
-              resp2[0].type.should.eql "Database Compaction"
-              resp2[0].task.should.eql "spec_db"
-              resp2[0].should.have_prop "status"
-              resp2[0].should.include "pid"
-            },
-            error: function(status, error, reason){errorCallback(status, error, reason)}
-          });
-        }
-      });
-    end
-  end
-  
-  describe 'allDbs'
-    it 'should return an array that includes a created database'
-      temp_db = new CouchDB("temp_spec_db", {"X-Couch-Full-Commit":"false"});
-      temp_db.createDb();
-      $.couch.allDbs({
-        success: function(resp){
-          resp.should.include "temp_spec_db"
-        },
-        error: function(status, error, reason){errorCallback(status, error, reason)}
-      });
-      temp_db.deleteDb();
-    end
-    
-    it 'should return an array that does not include a database that does not exist'
-      $.couch.allDbs({
-        success: function(resp){
-          resp.should.not.include("not_existing_temp_spec_db");
-        },
-        error: function(status, error, reason){errorCallback(status, error, reason)}
-      });
-    end
-  end
-  
-  describe 'config'
-    it 'should get the config settings'
-      $.couch.config({
-        success: function(resp){
-          resp.httpd.port.should.eql window.location.port
-          resp.stats.samples.should.match /\[.*\]/
-          resp.native_query_servers.should.have_prop "erlang"
-        },
-        error: function(status, error, reason){errorCallback(status, error, reason)}
-      });
-    end
-    
-    it 'should get a specific config setting'
-      $.couch.config({
-        success: function(resp){
-          parseInt(resp.max_document_size).should.be_a Number
-          resp.delayed_commits.should.be_a String
-          resp.database_dir.should.be_a String
-        },
-        error: function(status, error, reason){errorCallback(status, error, reason)}
-      }, "couchdb");
-    end
-    
-    it 'should update a config setting'
-      $.couch.config({
-        success: function(resp){
-          resp.should.eql ""
-        },
-        error: function(status, error, reason){errorCallback(status, error, reason)}
-      }, "test", "colony", "Caprica");
-      
-      $.couch.config({
-        success: function(resp){
-          resp.colony.should.eql "Caprica"
-        },
-        error: function(status, error, reason){errorCallback(status, error, reason)}
-      }, "test");
-      
-      $.couch.config({}, "test", "colony", null);
-    end
-    
-    it 'should delete a config setting'
-      $.couch.config({}, "test", "colony", "Caprica");
-      
-      $.couch.config({
-        success: function(resp){
-          resp.should.eql "Caprica"
-        },
-        error: function(status, error, reason){errorCallback(status, error, reason)}
-      }, "test", "colony", null);
-      
-      $.couch.config({
-        success: function(resp){
-          resp.should.eql {}
-        },
-        error: function(status, error, reason){errorCallback(status, error, reason)}
-      }, "test");
-    end
-  
-    it 'should alert with an error message prefix'
-      $.couch.config("asdf", "asdf", "asdf");
-      alert_msg.should.match /An error occurred retrieving\/updating the server configuration/
-    end
-  end
-  
-  describe 'session'
-    it 'should return information about the session'
-      $.couch.session({
-        success: function(resp){
-          resp.info.should.have_prop 'authentication_db'
-          resp.userCtx.should.include 'name'
-          resp.userCtx.roles.should.be_an Array
-        },
-        error: function(status, error, reason){errorCallback(status, error, reason)}
-      });
-    end
-  end
-  
-  describe 'userDb'
-    it 'should return the userDb'
-      var authentication_db;
-      $.couch.session({
-        success: function(resp){
-          authentication_db = resp.info.authentication_db;
-        },
-        error: function(status, error, reason){errorCallback(status, error, reason)}
-      });
-      
-      $.couch.userDb(function(resp){
-        resp.name.should.eql authentication_db
-      });
-    end
-    
-    it 'should return a db instance'
-      $.couch.userDb(function(resp){
-        resp.should.respond_to 'allDocs'
-        resp.should.respond_to 'bulkSave'
-      });
-    end
-  end
-  
-  describe 'user_db stuff'
-    before
-      useTestUserDb();
-    end
-  
-    after
-      useOldUserDb();
-    end
-    
-    describe 'signup'
-      it 'should return a saved user'
-        $.couch.signup(
-          {name: "Tom Zarek"}, "secretpass", {
-          success: function(resp){
-            resp.id.should.eql "org.couchdb.user:Tom Zarek"
-            resp.rev.length.should.be_at_least 30
-            resp.ok.should.be_true
-            users_db.deleteDoc({_id : resp.id, _rev : resp.rev})
-          },
-          error: function(status, error, reason){errorCallback(status, error, reason)}
-        });
-      end
-    
-      it 'should create a userDoc in the user db'
-        $.couch.signup(
-          {name: "Tom Zarek"}, "secretpass", {
-          success: function(resp){
-            var user = users_db.open(resp.id);
-            user.name.should.eql "Tom Zarek"
-            user._id.should.eql "org.couchdb.user:Tom Zarek"
-            user.roles.should.eql []
-            user.password_sha.length.should.be_at_least 30
-            user.password_sha.should.be_a String
-            users_db.deleteDoc({_id : resp.id, _rev : resp.rev})
-          },
-          error: function(status, error, reason){errorCallback(status, error, reason)}
-        });
-      end
-    
-      it 'should create a userDoc with roles when specified'
-        $.couch.signup(
-          {name: "Tom Zarek", roles: ["vice_president", "activist"]}, "secretpass", {
-          success: function(resp){
-            var user = users_db.open(resp.id);
-            user.roles.should.eql ["vice_president", "activist"]
-            users_db.deleteDoc({_id : resp.id, _rev : resp.rev})
-          },
-          error: function(status, error, reason){errorCallback(status, error, reason)}
-        });
-      end
-    end
-    
-    describe 'login'
-      before_each
-        user = {};
-        $.couch.signup({name: "Tom Zarek", roles: ["vice_president", "activist"]}, "secretpass", {
-          success: function(resp){
-            user.id  = resp.id;
-            user.rev = resp.rev;
-          },
-          error: function(status, error, reason){errorCallback(status, error, reason)}
-        });
-      end
-      
-      after_each
-        users_db.deleteDoc({_id : user.id, _rev : user.rev})
-      end
-      
-      it 'should return the logged in user'
-        $.couch.login({
-          name: "Tom Zarek",
-          password: "secretpass",
-          success: function(resp){
-            resp.name.should.eql "Tom Zarek"
-            resp.ok.should.be_true
-            resp.roles.should.eql ["vice_president", "activist"]
-          },
-          error: function(status, error, reason){errorCallback(status, error, reason)}
-        });
-      end
-      
-      it 'should result in a session for the logged in user'
-        $.couch.login({
-          name: "Tom Zarek",
-          password: "secretpass"
-        });
-        $.couch.session({
-          success: function(resp){
-            resp.info.authentication_db.should.eql "spec_users_db"
-            resp.userCtx.name.should.eql "Tom Zarek"
-            resp.userCtx.roles.should.eql ["vice_president", "activist"]
-          },
-          error: function(status, error, reason){errorCallback(status, error, reason)}
-        });
-      end
-      
-      it 'should return a 404 when password is wrong'
-        $.couch.login({
-          name: "Tom Zarek",
-          password: "wrongpass",
-          error: function(status, error, reason){
-            status.should.eql 401
-            error.should.eql "unauthorized"
-            reason.should.eql "Name or password is incorrect."
-          },
-          success: function(resp){successCallback(resp)}
-        });
-      end
-      
-      it 'should return a 404 when the user doesnt exist in the users db'
-        $.couch.login({
-          name: "Number Three",
-          password: "secretpass",
-          error: function(status, error, reason){
-            status.should.eql 401
-            error.should.eql "unauthorized"
-            reason.should.eql "Name or password is incorrect."
-          },
-          success: function(resp){successCallback(resp)}
-        });
-      end
-  
-      it 'should alert with an error message prefix'
-        $.couch.login("asdf");
-        alert_msg.should.match /An error occurred logging in/
-      end
-    end
-  
-    describe 'logout'
-      before_each
-        user = {};
-        $.couch.signup({name: "Tom Zarek", roles: ["vice_president", "activist"]}, "secretpass", {
-          success: function(resp){
-            user.id  = resp.id;
-            user.rev = resp.rev;
-          },
-          error: function(status, error, reason){errorCallback(status, error, reason)}
-        });
-        $.couch.login({name: "Tom Zarek", password: "secretpass"});
-      end
-      
-      after_each
-        users_db.deleteDoc({_id : user.id, _rev : user.rev})
-      end
-      
-      it 'should return ok true'
-        $.couch.logout({
-          success: function(resp){
-            resp.ok.should.be_true
-          },
-          error: function(status, error, reason){errorCallback(status, error, reason)}
-        });
-      end
-      
-      it 'should result in an empty session'
-        $.couch.logout();
-        $.couch.session({
-          success: function(resp){
-            resp.userCtx.name.should.be_null
-            resp.userCtx.roles.should.not.include ["vice_president"]
-          },
-          error: function(status, error, reason){errorCallback(status, error, reason)}
-        });
-      end
-    end
-  end
-  
-  describe 'encodeDocId'
-    it 'should return the encoded docID when it is not a design document'
-      $.couch.encodeDocId("viper").should.eql(encodeURIComponent("viper"))
-    end
-    
-    it 'should encode only the name of the design document'
-      $.couch.encodeDocId("_design/raptor").should.eql("_design/" + encodeURIComponent("raptor"))
-    end
-    
-    it 'should also work when the name of the des'
-      $.couch.encodeDocId("_design/battlestar/_view/crew").should.eql("_design/" + encodeURIComponent("battlestar/_view/crew"))
-    end
-  end
-    
-  describe 'info'
-    it 'should return the CouchDB version'
-      $.couch.info({
-        success: function(resp){
-          resp.couchdb.should.eql "Welcome"
-          resp.version.should_match /^\d\d?\.\d\d?\.\d\d?.*/
-        },
-        error: function(status, error, reason){errorCallback(status, error, reason)}
-      });
-    end
-  end
-  
-  describe 'replicate'
-    before_each
-      db = $.couch.db("spec_db");
-      db.create();
-      db2 = $.couch.db("spec_db_2");
-      db2.create();
-      host = window.location.protocol + "//" + window.location.host ;
-    end
-    
-    after_each
-      db.drop();
-      db2.drop();
-    end
-  
-    it 'should return no_changes true when there are no changes between the dbs'
-      $.couch.replicate(host + db.uri, host + db2.uri, {
-        success: function(resp){
-          resp.ok.should.be_true
-          resp.no_changes.should.be_true
-        },
-        error: function(status, error, reason){errorCallback(status, error, reason)}
-      });
-    end
-    
-    it 'should return the session ID'
-      db.saveDoc({'type':'battlestar', 'name':'galactica'});
-      $.couch.replicate(host + db.uri, host + db2.uri, {
-        success: function(resp){
-          resp.session_id.length.should.be_at_least 30
-        },
-        error: function(status, error, reason){errorCallback(status, error, reason)}
-      });
-    end
-    
-    it 'should return source_last_seq'
-      db.saveDoc({'type':'battlestar', 'name':'galactica'});
-      db.saveDoc({'type':'battlestar', 'name':'pegasus'});
-      
-      $.couch.replicate(host + db.uri, host + db2.uri, {
-        success: function(resp){
-          resp.source_last_seq.should.eql 2
-        },
-        error: function(status, error, reason){errorCallback(status, error, reason)}
-      });
-    end
-    
-    it 'should return the replication history'
-      db.saveDoc({'type':'battlestar', 'name':'galactica'});
-      db.saveDoc({'type':'battlestar', 'name':'pegasus'});
-      
-      $.couch.replicate(host + db.uri, host + db2.uri, {
-        success: function(resp){
-          resp.history[0].docs_written.should.eql 2
-          resp.history[0].start_last_seq.should.eql 0
-        },
-        error: function(status, error, reason){errorCallback(status, error, reason)}
-      });
-    end
-    
-    it 'should pass through replication options'
-      db.saveDoc({'type':'battlestar', 'name':'galactica'});
-      db2.drop();
-      $.couch.replicate(host + db.uri, host + db2.uri, {
-        error: function(status, error, reason){
-          status.should.eql 500
-          reason.should.match /db_not_found/
-        },
-        success: function(resp){successCallback(resp)}
-      });
-      
-      $.couch.replicate(host + db.uri, host + db2.uri, {
-        success: function(resp){
-          resp.ok.should.eql true
-          resp.history[0].docs_written.should.eql 1
-        },
-        error: function(status, error, reason){errorCallback(status, error, reason)}
-      }, {
-        "create_target":true
-      });
-      
-      db2.info({
-        success: function(resp){
-          resp.db_name.should.eql "spec_db_2"
-        },
-        error: function(status, error, reason){errorCallback(status, error, reason)}
-      });
-    end
-    
-    it 'should alert with an error message prefix'
-      $.couch.replicate("asdf");
-      alert_msg.should.match /Replication failed/
-    end
-  end
-  
-  describe 'newUUID'
-    it 'should return a new UUID'
-      var new_uuid = $.couch.newUUID(1);
-      new_uuid.should.be_a String
-      new_uuid.should.have_length 32
-    end
-    
-    it 'should fill the uuidCache with the specified number minus 1'
-      // we can't reach the uuidCache from here, so we mock the next request
-      // to test that the next uuid is not coming from the request, but from the cache.
-      $.couch.newUUID(2);
-      mock_request().and_return({'uuids':['a_sample_uuid']})
-      $.couch.newUUID(1).should.not.eql 'a_sample_uuid'
-      $.couch.newUUID(1).should.eql 'a_sample_uuid'
-    end
-    
-    it 'should alert with an error message prefix'
-      $.couch.newUUID("asdf");
-      alert_msg.should.match /Failed to retrieve UUID batch/
-    end
-  end
-end
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/couchdb/blob/cca309f3/share/www/spec/jquery_couch_js_instance_methods_1_spec.js
----------------------------------------------------------------------
diff --git a/share/www/spec/jquery_couch_js_instance_methods_1_spec.js b/share/www/spec/jquery_couch_js_instance_methods_1_spec.js
deleted file mode 100644
index 8538c85..0000000
--- a/share/www/spec/jquery_couch_js_instance_methods_1_spec.js
+++ /dev/null
@@ -1,202 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
-// Specs for jquery_couch.js lines 163-209
-
-describe 'jQuery couchdb db'
-  before
-    stubAlert();
-  end
-  
-  after
-    destubAlert();
-  end
-  
-  before_each
-    db = $.couch.db('spec_db');
-  end
-
-  describe 'constructor'
-    it 'should set the name'
-      db.name.should.eql 'spec_db'
-    end
-    
-    it 'should set the uri'
-      db.uri.should.eql '/spec_db/'
-    end
-  end
-  
-  describe 'triggering db functions'
-    before_each
-      db.create();
-    end
-
-    after_each
-      db.drop();
-    end
-    
-    describe 'compact'
-      it 'should return ok true'
-        db.compact({
-          success: function(resp) {
-            resp.ok.should.be_true
-          },
-          error: function(status, error, reason){errorCallback(status, error, reason)}
-        });
-      end
-    
-      it 'should trigger _compact'
-        db.compact({
-          success: function(resp, obj) {
-            obj.url.should.eql "/spec_db/_compact"
-          },
-          error: function(status, error, reason){errorCallback(status, error, reason)}
-        });
-      end
-    end
-    
-    describe 'viewCleanup'
-       it 'should return ok true'
-         db.viewCleanup({
-           success: function(resp) {
-             resp.ok.should.be_true
-           },
-           error: function(status, error, reason){errorCallback(status, error, reason)}
-         });
-       end
-   
-       it 'should trigger _view_cleanup'
-         db.viewCleanup({
-           success: function(resp, obj) {
-             obj.url.should.eql "/spec_db/_view_cleanup"
-           },
-           error: function(status, error, reason){errorCallback(status, error, reason)}
-         });
-       end
-     end
-   
-    describe 'compactView'
-      before_each
-        var designDoc = {
-          "views" : {
-            "people" : {
-              "map" : "function(doc) { emit(doc._id, doc); }"
-            }
-          },
-          "_id" : "_design/myview"
-        };
-        db.saveDoc(designDoc);
-        db.saveDoc({"Name" : "Felix Gaeta", "_id" : "123"});
-      end
-      
-      it 'should return ok true'
-        db.compactView("myview", {
-          success: function(resp) {
-            resp.ok.should.be_true
-          },
-          error: function(status, error, reason){errorCallback(status, error, reason)}
-        });
-      end
-  
-      it 'should trigger _compact_view with the groupname'
-        db.compactView("myview", {
-          success: function(resp, obj) {
-            obj.url.should.eql "/spec_db/_compact/myview"
-          },
-          error: function(status, error, reason){errorCallback(status, error, reason)}
-        });
-      end
-      
-      it 'should return raise a 404 error when the design name doesnt exist'
-        db.compactView("non_existing_design_name", {
-          error: function(status, error, reason){
-            status.should.eql 404
-            error.should.eql "not_found"
-            reason.should.eql "missing"
-          },
-          success: function(resp){successCallback(resp)}
-        });
-      end
-      
-      it 'should alert with an error message prefix'
-        db.compactView("asdf");
-        alert_msg.should.match /The view could not be compacted/
-      end
-    end
-  end
-   
-  describe 'create'
-    after_each
-      db.drop();
-    end
-  
-    it 'should return ok true'
-      db.create({
-        success: function(resp) {
-          resp.ok.should.be_true
-        },
-        error: function(status, error, reason){errorCallback(status, error, reason)}
-      });
-    end
-    
-    it 'should result in a created db'
-      db.create();
-      db.create({
-        error: function(status, error, reason){
-          status.should.eql 412
-          error.should.eql "file_exists"
-          reason.should.eql "The database could not be created, the file already exists."
-        },
-        success: function(resp){successCallback(resp)}
-      });
-    end
-    
-    it 'should alert with an error message prefix'
-      db.create();
-      db.create();
-      alert_msg.should.match /The database could not be created/
-    end
-  end
-  
-  describe 'drop'
-    before_each
-      db.create();
-    end
-    
-    it 'should return ok true'
-      db.drop({
-        success: function(resp) {
-          resp.ok.should.be_true
-        },
-        error: function(status, error, reason){errorCallback(status, error, reason)}
-      });
-    end
-    
-    it 'should result in a deleted db'
-      db.drop();
-      db.drop({
-        error: function(status, error, reason){
-          status.should.eql 404
-          error.should.eql "not_found"
-          reason.should.eql "missing"
-        },
-        success: function(resp){successCallback(resp)}
-      });
-    end
-    
-    it 'should alert with an error message prefix'
-      db.drop();
-      db.drop();
-      alert_msg.should.match /The database could not be deleted/
-    end
-  end
-end
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/couchdb/blob/cca309f3/share/www/spec/jquery_couch_js_instance_methods_2_spec.js
----------------------------------------------------------------------
diff --git a/share/www/spec/jquery_couch_js_instance_methods_2_spec.js b/share/www/spec/jquery_couch_js_instance_methods_2_spec.js
deleted file mode 100644
index 8f35aff..0000000
--- a/share/www/spec/jquery_couch_js_instance_methods_2_spec.js
+++ /dev/null
@@ -1,433 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
-// Specs for jquery_couch.js lines 210-299
-
-describe 'jQuery couchdb db'
-  before
-    stubAlert();
-  end
-  
-  after
-    destubAlert();
-  end
-  
-  before_each
-    db = $.couch.db('spec_db');
-    db.create();
-  end
-
-  after_each
-    db.drop();
-  end
-
-  describe 'info'
-    before_each
-      result = {};
-      db.info({
-        success: function(resp) { result = resp; },
-        error: function(status, error, reason){errorCallback(status, error, reason)}
-      });
-    end
-    
-    it 'should return the name of the database'
-      result.db_name.should.eql "spec_db"
-    end
-    
-    it 'should return the number of documents'
-      result.doc_count.should.eql 0
-    end
-    
-    it 'should return the start time of the db instance'
-      result.instance_start_time.should.have_length 16
-    end
-  end
-  
-  describe 'allDocs'
-    it 'should return no docs when there arent any'
-      db.allDocs({
-        success: function(resp) {
-          resp.total_rows.should.eql 0
-          resp.rows.should.eql []
-        },
-        error: function(status, error, reason){errorCallback(status, error, reason)}
-      });
-    end
-    
-    describe 'with docs'
-      before_each
-        db.saveDoc({"Name" : "Felix Gaeta",      "_id" : "123"});
-        db.saveDoc({"Name" : "Samuel T. Anders", "_id" : "456"});
-      end
-    
-      it 'should return all docs'
-        db.allDocs({
-          success: function(resp) {
-            resp.total_rows.should.eql 2
-            resp.rows.should.have_length 2
-            resp.rows[0].id.should.eql "123"
-            resp.rows[0].key.should.eql "123"
-            resp.rows[0].value.rev.length.should.be_at_least 30
-            resp.rows[1].id.should.eql "456"
-          },
-          error: function(status, error, reason){errorCallback(status, error, reason)}
-        });
-      end
-    
-      it 'should pass through the options'
-        db.allDocs({
-          "startkey": "123",
-          "limit": "1",
-          success: function(resp) {
-            resp.rows.should.have_length 1
-            resp.rows[0].id.should.eql "123"
-          },
-          error: function(status, error, reason){errorCallback(status, error, reason)}
-        });
-      end
-    end
-  end
-  
-  describe 'allDesignDocs'
-    it 'should return nothing when there arent any design docs'
-      db.saveDoc({"Name" : "Felix Gaeta", "_id" : "123"});
-      db.allDesignDocs({
-        success: function(resp) {
-          resp.rows.should.eql []
-        },
-        error: function(status, error, reason){errorCallback(status, error, reason)}
-      });
-    end
-    
-    it 'should return all design docs'
-      var designDoc = {
-        "views" : {
-          "people" : {
-            "map" : "function(doc) { emit(doc._id, doc); }"
-          }
-        },
-        "_id" : "_design/spec_db"
-      };
-      db.saveDoc(designDoc);
-      db.saveDoc({"Name" : "Felix Gaeta", "_id" : "123"});
-      
-      db.allDesignDocs({
-        success: function(resp) {
-          resp.total_rows.should.eql 2
-          resp.rows.should.have_length 1
-          resp.rows[0].id.should.eql "_design/spec_db"
-          resp.rows[0].key.should.eql "_design/spec_db"
-          resp.rows[0].value.rev.length.should.be_at_least 30
-        },
-        error: function(status, error, reason){errorCallback(status, error, reason)}
-      });
-    end
-  end
-  
-  describe 'allApps'
-    it 'should provide a custom function with appName, appPath and design document when there is an attachment with index.html'
-      var designDoc = {"_id" : "_design/with_attachments"};
-    
-      designDoc._attachments = {
-        "index.html" : {
-          "content_type": "text\/html",
-          // this is "<html><p>Hi, here is index!</p></html>", base64 encoded
-          "data": "PGh0bWw+PHA+SGksIGhlcmUgaXMgaW5kZXghPC9wPjwvaHRtbD4="
-        }
-      };
-      db.saveDoc(designDoc);
-      
-      db.allApps({
-        eachApp: function(appName, appPath, ddoc) {
-          appName.should.eql "with_attachments"
-          appPath.should.eql "/spec_db/_design/with_attachments/index.html"
-          ddoc._id.should.eql "_design/with_attachments"
-          ddoc._attachments["index.html"].content_type.should.eql "text/html"
-          ddoc._attachments["index.html"].length.should.eql "<html><p>Hi, here is index!</p></html>".length
-        },
-        error: function(status, error, reason){errorCallback(status, error, reason)}
-      });
-    end
-    
-    it 'should provide a custom function with appName, appPath and design document when there is a couchapp with index file'
-      var designDoc = {"_id" : "_design/with_index"};
-      designDoc.couchapp = {
-        "index" : "cylon"
-      };
-      db.saveDoc(designDoc);
-      
-      db.allApps({
-        eachApp: function(appName, appPath, ddoc) {
-          appName.should.eql "with_index"
-          appPath.should.eql "/spec_db/_design/with_index/cylon"
-          ddoc._id.should.eql "_design/with_index"
-          ddoc.couchapp.index.should.eql "cylon"
-        },
-        error: function(status, error, reason){errorCallback(status, error, reason)}
-      });
-    end
-    
-    it 'should not call the eachApp function when there is neither index.html in _attachments nor a couchapp index file'
-      var designDoc = {"_id" : "_design/nothing"};
-      db.saveDoc(designDoc);
-      
-      var eachApp_called = false;
-      db.allApps({
-        eachApp: function(appName, appPath, ddoc) {
-          eachApp_called = true;
-        },
-        error: function(status, error, reason){errorCallback(status, error, reason)}
-      });
-      
-      eachApp_called.should.be_false
-    end
-    
-    it 'should alert with an error message prefix'
-      db.allApps();
-      alert_msg.should.match /Please provide an eachApp function for allApps()/
-    end
-  end
-  
-  describe 'openDoc'
-    before_each
-      doc = {"Name" : "Louanne Katraine", "Callsign" : "Kat", "_id" : "123"};
-      db.saveDoc(doc);
-    end
-     
-    it 'should open the document'
-      db.openDoc("123", {
-        success: function(resp){
-          resp.should.eql doc
-        },
-        error: function(status, error, reason){errorCallback(status, error, reason)}
-      });
-    end
-    
-    it 'should raise a 404 error when there is no document with the given ID'
-      db.openDoc("non_existing", {
-        error: function(status, error, reason){
-          status.should.eql 404
-          error.should.eql "not_found"
-          reason.should.eql "missing"
-        },
-        success: function(resp){successCallback(resp)}
-      });
-    end
-   
-    it 'should pass through the options'
-      doc.Name = "Sasha";
-      db.saveDoc(doc);
-      db.openDoc("123", {
-        revs: true,
-        success: function(resp){
-          resp._revisions.start.should.eql 2
-          resp._revisions.ids.should.have_length 2
-        },
-        error: function(status, error, reason){errorCallback(status, error, reason)}
-      });
-    end
-  
-    it 'should alert with an error message prefix'
-      db.openDoc("asdf");
-      alert_msg.should.match /The document could not be retrieved/
-    end
-  end
-   
-  describe 'saveDoc'
-    before_each
-      doc = {"Name" : "Kara Thrace", "Callsign" : "Starbuck"};
-    end
-     
-    it 'should save the document'
-      db.saveDoc(doc, {
-        success: function(resp, status){
-          status.should.eql 201
-        },
-        error: function(status, error, reason){errorCallback(status, error, reason)}
-      });
-    end
-      
-    it 'should return ok true'
-      db.saveDoc(doc, {
-        success: function(resp, status){
-          resp.ok.should.be_true
-        },
-        error: function(status, error, reason){errorCallback(status, error, reason)}
-      });
-    end
-    
-    it 'should return ID and revision of the document'
-      db.saveDoc(doc, {
-        success: function(resp, status){
-          resp.id.should.be_a String
-          resp.id.should.have_length 32
-          resp.rev.should.be_a String
-          resp.rev.length.should.be_at_least 30
-        },
-        error: function(status, error, reason){errorCallback(status, error, reason)}
-      });
-    end
-    
-    it 'should result in a saved document with generated ID'
-      db.saveDoc(doc, {
-        success: function(resp, status){
-          db.openDoc(resp.id, {
-            success: function(resp2){
-              resp2.Name.should.eql "Kara Thrace"
-              resp2.Callsign.should.eql "Starbuck"
-            },
-            error: function(status, error, reason){errorCallback(status, error, reason)}
-          });
-        },
-        error: function(status, error, reason){errorCallback(status, error, reason)}
-      });
-    end
-    
-    it 'should save the document with the specified ID'
-      doc._id = "123";
-      db.saveDoc(doc, {
-        success: function(resp, status){
-          resp.id.should.eql "123"
-        },
-        error: function(status, error, reason){errorCallback(status, error, reason)}
-      });
-    end
-    
-    it 'should pass through the options'
-      db.saveDoc(doc, {
-        "batch" : "ok",
-        success: function(resp, status){
-          // when using batch ok, couch sends a 202 status immediately
-          status.should.eql 202
-        },
-        error: function(status, error, reason){errorCallback(status, error, reason)}
-      });
-    end
-    
-    it 'should alert with an error message prefix'
-      db.saveDoc("asdf");
-      alert_msg.should.match /The document could not be saved/
-    end
-  end
-   
-  describe 'bulkSave'
-    before_each
-      doc  = {"Name" : "Kara Thrace", "Callsign" : "Starbuck"};
-      doc2 = {"Name" : "Karl C. Agathon", "Callsign" : "Helo"};
-      doc3 = {"Name" : "Sharon Valerii", "Callsign" : "Boomer"};
-      docs = [doc, doc2, doc3];
-    end
-    
-    it 'should save all documents'
-      db.bulkSave({"docs": docs});
-      db.allDocs({
-        success: function(resp) {
-          resp.total_rows.should.eql 3
-        },
-        error: function(status, error, reason){errorCallback(status, error, reason)}
-      });
-    end
-    
-    it 'should result in saved documents'
-      doc3._id = "789";
-      db.bulkSave({"docs": [doc3]});
-      
-      db.openDoc("789", {
-        success: function(resp){
-          resp.Name.should.eql "Sharon Valerii"
-          resp.Callsign.should.eql "Boomer"
-        },
-        error: function(status, error, reason){errorCallback(status, error, reason)}
-      });
-    end
-    
-    it 'should return ID and revision of the documents'
-      db.bulkSave({"docs": docs},{
-        success: function(resp){
-          resp[0].id.should.be_a String
-          resp[0].id.should.have_length 32
-          resp[0].rev.should.be_a String
-          resp[0].rev.length.should.be_at_least 30
-          resp[1].id.should.be_a String
-          resp[1].id.should.have_length 32
-          resp[1].rev.should.be_a String
-          resp[1].rev.length.should.be_at_least 30
-          resp[2].id.should.be_a String
-          resp[2].id.should.have_length 32
-          resp[2].rev.should.be_a String
-          resp[2].rev.length.should.be_at_least 30
-        },
-        error: function(status, error, reason){errorCallback(status, error, reason)}
-      });
-    end
-      
-    it 'should save the document with specified IDs'
-      doc._id  = "123";
-      doc2._id = "456";
-      docs = [doc, doc2, doc3];
-      
-      db.bulkSave({"docs": docs},{
-        success: function(resp){
-          resp[0].id.should.eql "123"
-          resp[1].id.should.eql "456"
-          resp[2].id.should.have_length 32
-        },
-        error: function(status, error, reason){errorCallback(status, error, reason)}
-      });
-    end
-    
-    it 'should pass through the options'
-      // a lengthy way to test that a conflict can't be created with the
-      // all_or_nothing option set to false, but can be when it's true.
-    
-      var old_doc = {"Name" : "Louanne Katraine", "Callsign" : "Kat", "_id" : "123"};
-      db.saveDoc(old_doc, {
-        success: function(resp){
-          old_doc._rev = resp.rev;
-        },
-        error: function(status, error, reason){errorCallback(status, error, reason)}
-      });
-      
-      var new_doc = {"Name" : "Sasha", "Callsign" : "Kat", "_id" : "123"};
-      
-      db.bulkSave({"docs": [new_doc], "all_or_nothing": false}, {
-        success: function(resp){
-          resp[0].id.should.eql "123"
-          resp[0].error.should.eql "conflict"
-          resp[0].reason.should.eql "Document update conflict."
-        },
-        error: function(status, error, reason){errorCallback(status, error, reason)}
-      });
-      
-      db.bulkSave({"docs": [new_doc], "all_or_nothing": true}, {
-        success: function(resp){
-          resp[0].id.should.eql "123"
-          resp[0].rev.should.not.eql old_doc._rev
-        },
-        error: function(status, error, reason){errorCallback(status, error, reason)}
-      });
-      
-      db.openDoc("123", {
-        "conflicts": true,
-        success: function(resp){
-          resp._conflicts[0].should.eql old_doc._rev
-        },
-        error: function(status, error, reason){errorCallback(status, error, reason)}
-      });
-    end
-     
-    it 'should alert with an error message prefix'
-      db.bulkSave("asdf");
-      alert_msg.should.match /The documents could not be saved/
-    end
-  end
-end
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/couchdb/blob/cca309f3/share/www/spec/jquery_couch_js_instance_methods_3_spec.js
----------------------------------------------------------------------
diff --git a/share/www/spec/jquery_couch_js_instance_methods_3_spec.js b/share/www/spec/jquery_couch_js_instance_methods_3_spec.js
deleted file mode 100644
index 5d27d81..0000000
--- a/share/www/spec/jquery_couch_js_instance_methods_3_spec.js
+++ /dev/null
@@ -1,540 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
-// Specs for jquery_couch.js lines 300-411
-
-describe 'jQuery couchdb db'
-  before
-    stubAlert();
-  end
-  
-  after
-    destubAlert();
-  end
-  
-  before_each
-    db = $.couch.db('spec_db');
-    db.create();
-  end
-  
-  after_each
-    db.drop();
-  end
-
-  describe 'removeDoc'
-    before_each
-      doc = {"Name" : "Louanne Katraine", "Callsign" : "Kat", "_id" : "345"};
-      saved_doc = {};
-      db.saveDoc(doc, {
-        success: function(resp){
-          saved_doc = resp;
-        },
-        error: function(status, error, reason){errorCallback(status, error, reason)}
-      });
-    end
-    
-    it 'should result in a deleted document'
-      db.removeDoc({_id : "345", _rev : saved_doc.rev}, {
-        success: function(resp){
-          db.openDoc("345", {
-            error: function(status, error, reason){
-              status.should.eql 404
-              error.should.eql "not_found"
-              reason.should.eql "deleted"
-            },
-            success: function(resp){successCallback(resp)}
-          });
-        },
-        error: function(status, error, reason){errorCallback(status, error, reason)}
-      });
-    end
-  
-    it 'should return ok true, the ID and the revision of the deleted document'
-      db.removeDoc({_id : "345", _rev : saved_doc.rev}, {
-        success: function(resp){
-          resp.ok.should.be_true
-          resp.id.should.eql "345"
-          resp.rev.should.be_a String
-          resp.rev.length.should.be_at_least 30
-        },
-        error: function(status, error, reason){errorCallback(status, error, reason)}
-      });
-    end
-      
-    it 'should record the revision in the deleted document'
-      db.removeDoc({_id : "345", _rev : saved_doc.rev}, {
-        success: function(resp){
-          db.openDoc("345", {
-            rev: resp.rev,
-            success: function(resp2){
-              resp2._rev.should.eql resp.rev
-              resp2._id.should.eql resp.id
-              resp2._deleted.should.be_true
-            },
-            error: function(status, error, reason){errorCallback(status, error, reason)}
-          });
-        },
-        error: function(status, error, reason){errorCallback(status, error, reason)}
-      });
-    end
-    
-    it 'should alert with an error message prefix'
-      db.removeDoc({_id: "asdf"});
-      alert_msg.should.match /The document could not be deleted/
-    end
-  end
-  
-  describe 'bulkRemove'
-    before_each
-      doc  = {"Name" : "Kara Thrace", "Callsign" : "Starbuck", "_id" : "123"};
-      doc2 = {"Name" : "Karl C. Agathon", "Callsign" : "Helo", "_id" : "456"};
-      doc3 = {"Name" : "Sharon Valerii", "Callsign" : "Boomer", "_id" : "789"};
-      docs = [doc, doc2, doc3];
-      
-      db.bulkSave({"docs": docs}, {
-        success: function(resp){
-          for (var i = 0; i < docs.length; i++) {
-            docs[i]._rev = resp[i].rev;
-          }
-        },
-        error: function(status, error, reason){errorCallback(status, error, reason)}
-      });
-    end
-    
-    it 'should remove all documents specified'
-      db.bulkRemove({"docs": docs});
-      db.allDocs({
-        success: function(resp) {
-          resp.total_rows.should.eql 0
-        },
-        error: function(status, error, reason){errorCallback(status, error, reason)}
-      });
-    end
-    
-    it 'should not remove documents that should not have been deleted'
-      db.bulkRemove({"docs": [doc3]});
-      db.allDocs({
-        success: function(resp) {
-          resp.total_rows.should.eql 2
-        },
-        error: function(status, error, reason){errorCallback(status, error, reason)}
-      });
-    end
-    
-    it 'should result in deleted documents'
-      db.bulkRemove({"docs": docs}, {
-        success: function(resp){
-          db.openDoc("123", {
-            error: function(status, error, reason){
-              status.should.eql 404
-              error.should.eql "not_found"
-              reason.should.eql "deleted"
-            },
-            success: function(resp){successCallback(resp)}
-          });
-        },
-        error: function(status, error, reason){errorCallback(status, error, reason)}
-      });
-    end
-  
-    it 'should return the ID and the revision of the deleted documents'
-      db.bulkRemove({"docs": docs}, {
-        success: function(resp){
-          resp[0].id.should.eql "123"
-          resp[0].rev.should.be_a String
-          resp[0].rev.length.should.be_at_least 30
-          resp[1].id.should.eql "456"
-          resp[1].rev.should.be_a String
-          resp[1].rev.length.should.be_at_least 30
-          resp[2].id.should.eql "789"
-          resp[2].rev.should.be_a String
-          resp[2].rev.length.should.be_at_least 30
-        },
-        error: function(status, error, reason){errorCallback(status, error, reason)}
-      });
-    end
-  
-    it 'should record the revision in the deleted documents'
-      db.bulkRemove({"docs": docs}, {
-        success: function(resp){
-          db.openDoc("123", {
-            rev: resp[0].rev,
-            success: function(resp2){
-              resp2._rev.should.eql resp[0].rev
-              resp2._id.should.eql resp[0].id
-              resp2._deleted.should.be_true
-            },
-            error: function(status, error, reason){errorCallback(status, error, reason)}
-          });
-        },
-        error: function(status, error, reason){errorCallback(status, error, reason)}
-      });
-    end
-    
-    it 'should alert with an error message prefix'
-      db.bulkRemove({docs: ["asdf"]});
-      alert_msg.should.match /The documents could not be deleted/
-    end
-  end
-  
-  describe 'copyDoc'
-    before_each
-      doc = {"Name" : "Sharon Agathon", "Callsign" : "Athena", "_id" : "123"};
-      db.saveDoc(doc);
-    end
-    
-    it 'should result in another document with same data and new id'
-      db.copyDoc("123", {
-        success: function(resp){
-          resp.id.should.eql "456"
-          resp.rev.length.should.be_at_least 30
-        },
-        error: function(status, error, reason){errorCallback(status, error, reason)}
-      }, {
-        headers: {"Destination":"456"}
-      });
-      
-      db.openDoc("456", {
-        success: function(resp){
-          resp.Name.should.eql "Sharon Agathon"
-          resp.Callsign.should.eql "Athena"
-        },
-        error: function(status, error, reason){errorCallback(status, error, reason)}
-      });
-    end
-    
-    it 'should throw an error when trying to overwrite a document without providing a revision'
-      doc2 = {"Name" : "Louanne Katraine", "Callsign" : "Kat", "_id" : "456"};
-      db.saveDoc(doc2);
-      
-      db.copyDoc("123", {
-        error: function(status, error, reason){
-          status.should.eql 409
-          error.should.eql "conflict"
-          reason.should.eql "Document update conflict."
-        },
-        success: function(resp){successCallback(resp)}
-      }, {
-        headers: {"Destination":"456"}
-      });
-    end
-    
-    it 'should overwrite a document with the correct revision'
-      doc2 = {"Name" : "Louanne Katraine", "Callsign" : "Kat", "_id" : "456"};
-      var doc2_rev;
-      db.saveDoc(doc2, {
-        success: function(resp){
-          doc2_rev = resp.rev;
-        }
-      });
-      
-      db.copyDoc("123", {
-        success: function(resp){
-          resp.id.should.eql "456"
-          resp.rev.length.should.be_at_least 30
-        },
-        error: function(status, error, reason){errorCallback(status, error, reason)}
-      }, {
-        headers: {"Destination":"456?rev=" + doc2_rev}
-      });
-      
-      db.openDoc("456", {
-        success: function(resp){
-          resp.Name.should.eql "Sharon Agathon"
-          resp.Callsign.should.eql "Athena"
-        },
-        error: function(status, error, reason){errorCallback(status, error, reason)}
-      });
-    end
-    
-    it 'should alert with an error message prefix'
-      db.copyDoc("asdf", {}, {});
-      alert_msg.should.match /The document could not be copied/
-    end
-  end
-  
-  describe 'query'
-    before_each
-      db.saveDoc({"Name" : "Cally Tyrol",      "job" : "deckhand", "_id" : "789"});
-      db.saveDoc({"Name" : "Felix Gaeta",      "job" : "officer",  "_id" : "123"});
-      db.saveDoc({"Name" : "Samuel T. Anders", "job" : "pilot",    "_id" : "456"});
-      map_function    = "function(doc) { emit(doc._id, 1); }";
-      reduce_function = "function(key, values, rereduce) { return sum(values); }";
-    end
-    
-    it 'should apply the map function'
-      db.query(map_function, null, null, {
-        success: function(resp){
-          resp.rows.should.have_length 3
-          resp.rows[0].id.should.eql "123"
-          resp.rows[0].key.should.eql "123"
-          resp.rows[0].value.should.eql 1
-          resp.rows[1].id.should.eql "456"
-          resp.rows[1].key.should.eql "456"
-          resp.rows[1].value.should.eql 1
-          resp.rows[2].id.should.eql "789"
-          resp.rows[2].key.should.eql "789"
-          resp.rows[2].value.should.eql 1
-        },
-        error: function(status, error, reason){errorCallback(status, error, reason)}
-      });
-    end
-    
-    it 'should apply the reduce function'
-      db.query(map_function, reduce_function, null, {
-        success: function(resp){
-          resp.rows.should.have_length 1
-          resp.rows[0].key.should.be_null
-          resp.rows[0].value.should_eql 3
-        },
-        error: function(status, error, reason){errorCallback(status, error, reason)}
-      });
-    end
-    
-    it 'should pass through the options'
-      db.query(map_function, null, null, {
-        "startkey": "456",
-        success: function(resp){
-          resp.rows.should.have_length 2
-          resp.rows[0].id.should.eql "456"
-          resp.rows[0].key.should.eql "456"
-          resp.rows[0].value.should.eql 1
-          resp.rows[1].id.should.eql "789"
-          resp.rows[1].key.should.eql "789"
-          resp.rows[1].value.should.eql 1
-        },
-        error: function(status, error, reason){errorCallback(status, error, reason)}
-      });
-    end
-    
-    it 'should pass through the keys'
-      //shouldn't this better work? TODO: implement in jquery.couch.js
-      console.log("shouldn't this better work? TODO: implement in jquery.couch.js")
-      db.query(map_function, null, null, {
-        "keys": ["456", "123"],
-        success: function(resp){
-          resp.rows.should.have_length 2
-          resp.rows[0].id.should.eql "456"
-          resp.rows[0].key.should.eql "456"
-          resp.rows[0].value.should.eql 1
-          resp.rows[1].id.should.eql "123"
-          resp.rows[1].key.should.eql "123"
-          resp.rows[1].value.should.eql 1
-        },
-        error: function(status, error, reason){errorCallback(status, error, reason)}
-      });
-    end
-      
-    it 'should pass through the options and the keys'
-      //shouldn't this better work? TODO: implement in jquery.couch.js
-      console.log("shouldn't this better work? TODO: implement in jquery.couch.js")
-      db.query(map_function, null, null, {
-        "include_docs":"true",
-        "keys": ["456"],
-        success: function(resp){
-          resp.rows.should.have_length 1
-          resp.rows[0].id.should.eql "456"
-          resp.rows[0].key.should.eql "456"
-          resp.rows[0].value.should.eql 1
-          resp.rows[0].doc["job"].should.eql "pilot"
-          resp.rows[0].doc["_rev"].length.should.be_at_least 30
-        },
-        error: function(status, error, reason){errorCallback(status, error, reason)}
-      });
-    end
-      
-    it 'should apply a query in erlang also'
-      // when this test fails, read this: http://wiki.apache.org/couchdb/EnableErlangViews
-      var erlang_map = 'fun({Doc}) -> ' +
-                       'ID = proplists:get_value(<<"_id">>, Doc, null), ' +
-                       'Emit(ID, 1) ' +
-                       'end.';
-      db.query(erlang_map, null, "erlang", {
-        success: function(resp){
-          resp.rows.should.have_length 3
-          resp.rows[0].id.should.eql "123"
-          resp.rows[0].key.should.eql "123"
-          resp.rows[0].value.should.eql 1
-          resp.rows[1].id.should.eql "456"
-          resp.rows[1].key.should.eql "456"
-          resp.rows[1].value.should.eql 1
-          resp.rows[2].id.should.eql "789"
-          resp.rows[2].key.should.eql "789"
-          resp.rows[2].value.should.eql 1
-        },
-        error: function(status, error, reason){errorCallback(status, error, reason)}
-      });
-    end
-    
-    it 'should alert with an error message prefix'
-      db.query("asdf");
-      alert_msg.should.match /An error occurred querying the database/
-    end
-  end
-  
-  describe 'view'
-    before_each
-      db.saveDoc({"Name" : "Cally Tyrol",      "job" : "deckhand", "_id" : "789"});
-      db.saveDoc({"Name" : "Felix Gaeta",      "job" : "officer",  "_id" : "123"});
-      db.saveDoc({"Name" : "Samuel T. Anders", "job" : "pilot",    "_id" : "456"});
-      view = {
-        "views" : {
-          "people" : {
-            "map" : "function(doc) { emit(doc._id, doc.Name); }"
-          }
-        },
-        "_id" : "_design/spec_db"
-      };
-      db.saveDoc(view);
-    end
-    
-    it 'should apply the view'
-      db.view('spec_db/people', {
-        success: function(resp){
-          resp.rows.should.have_length 3
-          resp.rows[0].id.should.eql "123"
-          resp.rows[0].key.should.eql "123"
-          resp.rows[0].value.should.eql "Felix Gaeta"
-          resp.rows[1].id.should.eql "456"
-          resp.rows[1].key.should.eql "456"
-          resp.rows[1].value.should.eql "Samuel T. Anders"
-          resp.rows[2].id.should.eql "789"
-          resp.rows[2].key.should.eql "789"
-          resp.rows[2].value.should.eql "Cally Tyrol"
-        },
-        error: function(status, error, reason){errorCallback(status, error, reason)}
-      });
-    end
-    
-    it 'should pass through the options'
-      db.view('spec_db/people', {
-        "skip":"2",
-        success: function(resp){
-          resp.rows.should.have_length 1
-          resp.rows[0].id.should.eql "789"
-          resp.rows[0].key.should.eql "789"
-          resp.rows[0].value.should.eql "Cally Tyrol"
-        },
-        error: function(status, error, reason){errorCallback(status, error, reason)}
-      });
-    end
-    
-    it 'should pass through the keys'
-      db.view('spec_db/people', {
-        "keys":["456", "123"],
-        success: function(resp){
-          resp.rows.should.have_length 2
-          resp.rows[0].id.should.eql "456"
-          resp.rows[0].key.should.eql "456"
-          resp.rows[0].value.should.eql "Samuel T. Anders"
-          resp.rows[1].id.should.eql "123"
-          resp.rows[1].key.should.eql "123"
-          resp.rows[1].value.should.eql "Felix Gaeta"
-        },
-        error: function(status, error, reason){errorCallback(status, error, reason)}
-      });
-    end
-    
-    it 'should pass through the options and the keys'
-      db.view('spec_db/people', {
-        "include_docs":"true",
-        "keys":["456"],
-        success: function(resp){
-          resp.rows.should.have_length 1
-          resp.rows[0].id.should.eql "456"
-          resp.rows[0].key.should.eql "456"
-          resp.rows[0].value.should.eql "Samuel T. Anders"
-          resp.rows[0].doc["job"].should.eql "pilot"
-          resp.rows[0].doc["_rev"].length.should.be_at_least 30
-        },
-        error: function(status, error, reason){errorCallback(status, error, reason)}
-      });
-    end
-    
-    it 'should throw a 404 when the view doesnt exist'
-      db.view('spec_db/non_existing_view', {
-        error: function(status, error, reason){
-          status.should.eql 404
-          error.should.eql "not_found"
-          reason.should.eql "missing_named_view"
-        },
-        success: function(resp){successCallback(resp)}
-      });
-    end
-    
-    it 'should alert with an error message prefix'
-      db.view("asdf");
-      alert_msg.should.match /An error occurred accessing the view/
-    end
-  end
-  
-  describe 'setDbProperty'
-    it 'should return ok true'
-      db.setDbProperty("_revs_limit", 1500, {
-        success: function(resp){
-          resp.ok.should.be_true
-        },
-        error: function(status, error, reason){errorCallback(status, error, reason)}
-      });
-    end
-    
-    it 'should set a db property'
-      db.setDbProperty("_revs_limit", 1500);
-      db.getDbProperty("_revs_limit", {
-        success: function(resp){
-          resp.should.eql 1500
-        },
-        error: function(status, error, reason){errorCallback(status, error, reason)}
-      });
-      db.setDbProperty("_revs_limit", 1200);
-      db.getDbProperty("_revs_limit", {
-        success: function(resp){
-          resp.should.eql 1200
-        },
-        error: function(status, error, reason){errorCallback(status, error, reason)}
-      });
-    end
-    
-    it 'should alert with an error message prefix'
-      db.setDbProperty("asdf");
-      alert_msg.should.match /The property could not be updated/
-    end
-  end
-  
-  describe 'getDbProperty'
-    it 'should get a db property'
-      db.setDbProperty("_revs_limit", 1200);
-      db.getDbProperty("_revs_limit", {
-        success: function(resp){
-          resp.should.eql 1200
-        },
-        error: function(status, error, reason){errorCallback(status, error, reason)}
-      });
-    end
-   
-    it 'should throw a 404 when the property doesnt exist'
-      db.getDbProperty("_doesnt_exist", {
-        error: function(status, error, reason){
-          status.should.eql 404
-          error.should.eql "not_found"
-          reason.should.eql "missing"
-        },
-        success: function(resp){successCallback(resp)}
-      });
-    end
-    
-    it 'should alert with an error message prefix'
-      db.getDbProperty("asdf");
-      alert_msg.should.match /The property could not be retrieved/
-    end
-  end
-end
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/couchdb/blob/cca309f3/share/www/spec/run.html
----------------------------------------------------------------------
diff --git a/share/www/spec/run.html b/share/www/spec/run.html
deleted file mode 100644
index 9a248cb..0000000
--- a/share/www/spec/run.html
+++ /dev/null
@@ -1,47 +0,0 @@
-<!--
-Licensed under the Apache License, Version 2.0 (the "License"); you may not
-use this file except in compliance with the License. You may obtain a copy of
-the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-License for the specific language governing permissions and limitations under
-the License.
--->
-<html>
-  <head>
-    <link type="text/css" rel="stylesheet" href="../script/jspec/jspec.css" />
-    <script src="../script/jquery.js"></script>
-    <script src="../script/sha1.js"></script>
-    <script src="../script/jspec/jspec.js"></script>
-    <script src="../script/jspec/jspec.jquery.js"></script>
-    <script src="../script/jspec/jspec.xhr.js"></script>
-    <script src="./custom_helpers.js"></script>
-    <script src="../script/couch.js"></script>
-    <script src="../script/jquery.couch.js"></script>
-    <script src="../script/couch_test_runner.js"></script>
-    <script>
-      function runSuites() {
-        JSpec
-        .exec('couch_js_class_methods_spec.js')
-        .exec('couch_js_instance_methods_1_spec.js')
-        .exec('couch_js_instance_methods_2_spec.js')
-        .exec('couch_js_instance_methods_3_spec.js')
-        .exec('jquery_couch_js_class_methods_spec.js')
-        .exec('jquery_couch_js_instance_methods_1_spec.js')
-        .exec('jquery_couch_js_instance_methods_2_spec.js')
-        .exec('jquery_couch_js_instance_methods_3_spec.js')
-        .run({failuresOnly: true})
-        .report()
-      }
-    </script>
-  </head>
-  <body class="jspec" onLoad="runSuites();">
-    <div id="jspec-top"><h2 id="jspec-title">JSpec <em><script>document.write(JSpec.version)</script></em></h2></div>
-    <div id="jspec"></div>
-    <div id="jspec-bottom"></div>
-  </body>
-</html>

http://git-wip-us.apache.org/repos/asf/couchdb/blob/cca309f3/share/www/status.html
----------------------------------------------------------------------
diff --git a/share/www/status.html b/share/www/status.html
deleted file mode 100644
index df35b61..0000000
--- a/share/www/status.html
+++ /dev/null
@@ -1,152 +0,0 @@
-<!DOCTYPE html>
-<!--
-
-Licensed under the Apache License, Version 2.0 (the "License"); you may not use
-this file except in compliance with the License. You may obtain a copy of the
-License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software distributed
-under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
-CONDITIONS OF ANY KIND, either express or implied. See the License for the
-specific language governing permissions and limitations under the License.
-
--->
-<html lang="en">
-  <head>
-    <title>Status</title>
-    <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
-    <link rel="stylesheet" href="style/layout.css?0.11.0" type="text/css">
-    <script src="script/json2.js"></script>
-    <script src="script/sha1.js"></script>
-    <script src="script/jquery.js"></script>
-    <script src="script/jquery.couch.js"></script>
-    <script src="script/jquery.dialog.js"></script>
-    <script src="script/futon.js"></script>
-  </head>
-  <body><div id="wrap">
-    <h1>
-      <a href="index.html">Overview</a>
-      <strong>Status</strong>
-    </h1>
-    <div id="content">
-      <div id="interval">
-        <label>Poll interval:
-          <input type="range" min="1" max="30" value="5" size="3">
-          <span class="secs">5</span> second(s)
-        </label>
-      </div>
-      <table id="status" class="listing" cellspacing="0">
-        <caption>Active Tasks</caption>
-        <thead><tr>
-          <th>Type</th>
-          <th>Object</th>
-          <th>Started on</th>
-          <th>Last updated on</th>
-          <th>PID</th>
-          <th>Status</th>
-        </tr></thead>
-        <tbody class="content"></tbody>
-      </table>
-
-    </div>
-  </div></body>
-  <script>
-    function toTaskDate(timestamp) {
-      var d = new Date(timestamp * 1000);
-      var hours = d.getHours(), min = d.getMinutes(), secs = d.getSeconds();
-      var year = d.getFullYear(), month = d.getMonth() + 1, day = d.getDate();
-
-      return String(year) + "-" + (month < 10 ? "0" + month : month) + "-" +
-        day + " " + (hours < 10 ? "0" + hours : hours) + ":" +
-        (min < 10 ? "0" + min : min) + ":" + (secs < 10 ? "0" + secs : secs);
-    }
-    var refreshTimeout = null;
-
-    $.futon.storage.declare("poll_interval", {defaultValue: 5});
-
-    function refresh() {
-      $.couch.activeTasks({
-        success: function(tasks) {
-          clearTimeout(refreshTimeout);
-          $("#status tbody.content").empty();
-          if (!tasks.length) {
-            $("<tr class='none'><th colspan='6'>No tasks running</th></tr>")
-              .appendTo("#status tbody.content");
-          } else {
-            $.each(tasks, function(idx, task) {
-              var status, type, object;
-
-              switch (task.type) {
-              case "database_compaction":
-                type = "Database compaction";
-                object = task.database + (task.retry ? " retry" : "");
-                status = "Copied " + task.changes_done + " of " +
-                  task.total_changes + " changes (" + task.progress + "%)";
-                break;
-              case "view_compaction":
-                type = "View compaction";
-                object = task.database + ", " + task.design_document;
-                status = "Progress " + task.progress + "%";
-                break;
-              case "indexer":
-                type = "Indexer";
-                object = task.database + ", " + task.design_document;
-                status = "Processed " + task.changes_done + " of " +
-                  task.total_changes + " changes (" + task.progress + "%)";
-                break;
-              case "replication":
-                type = "Replication";
-                object = task.source + " to " + task.target;
-                status = "Checkpointed source sequence " +
-                  task.checkpointed_source_seq + ", current source sequence " +
-                  task.source_seq + ", progress " + task.progress + "%";
-              }
-
-              $("<tr><th></th><td class='object'></td><td class='started'>" +
-                "</td><td class='updated'></td><td class='pid'></td>" +
-                "<td class='status'></td></tr>")
-                .find("th").text(type).end()
-                .find("td.object").text(object).end()
-                .find("td.started").text(toTaskDate(task.started_on)).end()
-                .find("td.updated").text(toTaskDate(task.updated_on)).end()
-                .find("td.pid").text(task.pid).end()
-                .find("td.status").text(status).end()
-                .appendTo("#status tbody.content");
-            });
-          }
-          refreshTimeout = setTimeout(refresh,
-            parseInt($("#interval input").val(), 10) * 1000);
-        }
-      });
-    }
-
-    function updateInterval(value) {
-      if (isNaN(value)) {
-        value = 5;
-        $("#interval input").val(value);
-      }
-      $("#interval .secs").text(value);
-      refresh();
-      $.futon.storage.set("poll_interval", value);
-    }
-
-    $(function() {
-      var slider = $("#interval input");
-      slider.val(parseInt($.futon.storage.get("poll_interval")));
-      if (slider[0].type == "range") {
-        slider.bind("input", function() {
-          updateInterval(this.value);
-        });
-        $("#interval .secs").text($("#interval input").val());
-      } else {
-        slider.bind("change", function() {
-          updateInterval(this.value);
-        });
-        $("#interval .secs").hide();
-      }
-      refresh();
-    });
-  </script>
-</html>

http://git-wip-us.apache.org/repos/asf/couchdb/blob/cca309f3/share/www/style/jquery-ui-1.8.11.custom.css
----------------------------------------------------------------------
diff --git a/share/www/style/jquery-ui-1.8.11.custom.css b/share/www/style/jquery-ui-1.8.11.custom.css
deleted file mode 100644
index a6b2f74..0000000
--- a/share/www/style/jquery-ui-1.8.11.custom.css
+++ /dev/null
@@ -1,347 +0,0 @@
-/*
- * jQuery UI CSS Framework 1.8.11
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Theming/API
- */
-
-/* Layout helpers
-----------------------------------*/
-.ui-helper-hidden { display: none; }
-.ui-helper-hidden-accessible { position: absolute !important; clip: rect(1px 1px 1px 1px); clip: rect(1px,1px,1px,1px); }
-.ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; }
-.ui-helper-clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; }
-.ui-helper-clearfix { display: inline-block; }
-/* required comment for clearfix to work in Opera \*/
-* html .ui-helper-clearfix { height:1%; }
-.ui-helper-clearfix { display:block; }
-/* end clearfix */
-.ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); }
-
-
-/* Interaction Cues
-----------------------------------*/
-.ui-state-disabled { cursor: default !important; }
-
-
-/* Icons
-----------------------------------*/
-
-/* states and images */
-.ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; }
-
-
-/* Misc visuals
-----------------------------------*/
-
-/* Overlays */
-.ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
-
-
-/*
- * jQuery UI CSS Framework 1.8.11
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Theming/API
- *
- * To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Trebuchet%20MS,%20Tahoma,%20Verdana,%20Arial,%20sans-serif&fwDefault=bold&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=f6a828&bgTextureHeader=12_gloss_wave.png&bgImgOpacityHeader=35&borderColorHeader=e78f08&fcHeader=ffffff&iconColorHeader=ffffff&bgColorContent=eeeeee&bgTextureContent=03_highlight_soft.png&bgImgOpacityContent=100&borderColorContent=dddddd&fcContent=333333&iconColorContent=222222&bgColorDefault=f6f6f6&bgTextureDefault=02_glass.png&bgImgOpacityDefault=100&borderColorDefault=cccccc&fcDefault=1c94c4&iconColorDefault=ef8c08&bgColorHover=fdf5ce&bgTextureHover=02_glass.png&bgImgOpacityHover=100&borderColorHover=fbcb09&fcHover=c77405&iconColorHover=ef8c08&bgColorActive=ffffff&bgTextureActive=02_glass.png&bgImgOpacityActive=65&borderColorActive=fbd850&fcActive=eb8f00&iconColorActive=ef8c08&bgColorHighlight=ffe45c&bgTextureHighlight=03_highlight_soft.png&bgImgOpacityHighlight=75&borderColorHig
 hlight=fed22f&fcHighlight=363636&iconColorHighlight=228ef1&bgColorError=b81900&bgTextureError=08_diagonals_thick.png&bgImgOpacityError=18&borderColorError=cd0a0a&fcError=ffffff&iconColorError=ffd27a&bgColorOverlay=666666&bgTextureOverlay=08_diagonals_thick.png&bgImgOpacityOverlay=20&opacityOverlay=50&bgColorShadow=000000&bgTextureShadow=01_flat.png&bgImgOpacityShadow=10&opacityShadow=20&thicknessShadow=5px&offsetTopShadow=-5px&offsetLeftShadow=-5px&cornerRadiusShadow=5px
- */
-
-
-/* Component containers
-----------------------------------*/
-.ui-widget { font-family: Trebuchet MS, Tahoma, Verdana, Arial, sans-serif; font-size: 1.1em; }
-.ui-widget .ui-widget { font-size: 1em; }
-.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Trebuchet MS, Tahoma, Verdana, Arial, sans-serif; font-size: 1em; }
-.ui-widget-content { border: 1px solid #dddddd; background: #eeeeee 50% top repeat-x; color: #333333; }
-.ui-widget-content a { color: #333333; }
-.ui-widget-header { border: 1px solid #e78f08; background: #f6a828 50% 50% repeat-x; color: #ffffff; font-weight: bold; }
-.ui-widget-header a { color: #ffffff; }
-
-/* Interaction states
-----------------------------------*/
-.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #cccccc; background: #f6f6f6 50% 50% repeat-x; font-weight: bold; color: #1c94c4; }
-.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #1c94c4; text-decoration: none; }
-.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #fbcb09; background: #fdf5ce 50% 50% repeat-x; font-weight: bold; color: #c77405; }
-.ui-state-hover a, .ui-state-hover a:hover { color: #c77405; text-decoration: none; }
-.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #fbd850; background: #ffffff 50% 50% repeat-x; font-weight: bold; color: #eb8f00; }
-.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #eb8f00; text-decoration: none; }
-.ui-widget :active { outline: none; }
-
-/* Interaction Cues
-----------------------------------*/
-.ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight  {border: 1px solid #fed22f; background: #ffe45c 50% top repeat-x; color: #363636; }
-.ui-state-highlight a, .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a { color: #363636; }
-.ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {border: 1px solid #cd0a0a; background: #b81900 50% 50% repeat; color: #ffffff; }
-.ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a { color: #ffffff; }
-.ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text { color: #ffffff; }
-.ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: bold; }
-.ui-priority-secondary, .ui-widget-content .ui-priority-secondary,  .ui-widget-header .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; }
-.ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; }
-
-/* Icons
-----------------------------------*/
-
-/* states and images */
-.ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_222222_256x240.png); }
-.ui-widget-content .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); }
-.ui-widget-header .ui-icon {background-image: url(images/ui-icons_ffffff_256x240.png); }
-.ui-state-default .ui-icon { background-image: url(images/ui-icons_ef8c08_256x240.png); }
-.ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_ef8c08_256x240.png); }
-.ui-state-active .ui-icon {background-image: url(images/ui-icons_ef8c08_256x240.png); }
-.ui-state-highlight .ui-icon {background-image: url(images/ui-icons_228ef1_256x240.png); }
-.ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_ffd27a_256x240.png); }
-
-/* positioning */
-.ui-icon-carat-1-n { background-position: 0 0; }
-.ui-icon-carat-1-ne { background-position: -16px 0; }
-.ui-icon-carat-1-e { background-position: -32px 0; }
-.ui-icon-carat-1-se { background-position: -48px 0; }
-.ui-icon-carat-1-s { background-position: -64px 0; }
-.ui-icon-carat-1-sw { background-position: -80px 0; }
-.ui-icon-carat-1-w { background-position: -96px 0; }
-.ui-icon-carat-1-nw { background-position: -112px 0; }
-.ui-icon-carat-2-n-s { background-position: -128px 0; }
-.ui-icon-carat-2-e-w { background-position: -144px 0; }
-.ui-icon-triangle-1-n { background-position: 0 -16px; }
-.ui-icon-triangle-1-ne { background-position: -16px -16px; }
-.ui-icon-triangle-1-e { background-position: -32px -16px; }
-.ui-icon-triangle-1-se { background-position: -48px -16px; }
-.ui-icon-triangle-1-s { background-position: -64px -16px; }
-.ui-icon-triangle-1-sw { background-position: -80px -16px; }
-.ui-icon-triangle-1-w { background-position: -96px -16px; }
-.ui-icon-triangle-1-nw { background-position: -112px -16px; }
-.ui-icon-triangle-2-n-s { background-position: -128px -16px; }
-.ui-icon-triangle-2-e-w { background-position: -144px -16px; }
-.ui-icon-arrow-1-n { background-position: 0 -32px; }
-.ui-icon-arrow-1-ne { background-position: -16px -32px; }
-.ui-icon-arrow-1-e { background-position: -32px -32px; }
-.ui-icon-arrow-1-se { background-position: -48px -32px; }
-.ui-icon-arrow-1-s { background-position: -64px -32px; }
-.ui-icon-arrow-1-sw { background-position: -80px -32px; }
-.ui-icon-arrow-1-w { background-position: -96px -32px; }
-.ui-icon-arrow-1-nw { background-position: -112px -32px; }
-.ui-icon-arrow-2-n-s { background-position: -128px -32px; }
-.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; }
-.ui-icon-arrow-2-e-w { background-position: -160px -32px; }
-.ui-icon-arrow-2-se-nw { background-position: -176px -32px; }
-.ui-icon-arrowstop-1-n { background-position: -192px -32px; }
-.ui-icon-arrowstop-1-e { background-position: -208px -32px; }
-.ui-icon-arrowstop-1-s { background-position: -224px -32px; }
-.ui-icon-arrowstop-1-w { background-position: -240px -32px; }
-.ui-icon-arrowthick-1-n { background-position: 0 -48px; }
-.ui-icon-arrowthick-1-ne { background-position: -16px -48px; }
-.ui-icon-arrowthick-1-e { background-position: -32px -48px; }
-.ui-icon-arrowthick-1-se { background-position: -48px -48px; }
-.ui-icon-arrowthick-1-s { background-position: -64px -48px; }
-.ui-icon-arrowthick-1-sw { background-position: -80px -48px; }
-.ui-icon-arrowthick-1-w { background-position: -96px -48px; }
-.ui-icon-arrowthick-1-nw { background-position: -112px -48px; }
-.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; }
-.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; }
-.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; }
-.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; }
-.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; }
-.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; }
-.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; }
-.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; }
-.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; }
-.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; }
-.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; }
-.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; }
-.ui-icon-arrowreturn-1-w { background-position: -64px -64px; }
-.ui-icon-arrowreturn-1-n { background-position: -80px -64px; }
-.ui-icon-arrowreturn-1-e { background-position: -96px -64px; }
-.ui-icon-arrowreturn-1-s { background-position: -112px -64px; }
-.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; }
-.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; }
-.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; }
-.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; }
-.ui-icon-arrow-4 { background-position: 0 -80px; }
-.ui-icon-arrow-4-diag { background-position: -16px -80px; }
-.ui-icon-extlink { background-position: -32px -80px; }
-.ui-icon-newwin { background-position: -48px -80px; }
-.ui-icon-refresh { background-position: -64px -80px; }
-.ui-icon-shuffle { background-position: -80px -80px; }
-.ui-icon-transfer-e-w { background-position: -96px -80px; }
-.ui-icon-transferthick-e-w { background-position: -112px -80px; }
-.ui-icon-folder-collapsed { background-position: 0 -96px; }
-.ui-icon-folder-open { background-position: -16px -96px; }
-.ui-icon-document { background-position: -32px -96px; }
-.ui-icon-document-b { background-position: -48px -96px; }
-.ui-icon-note { background-position: -64px -96px; }
-.ui-icon-mail-closed { background-position: -80px -96px; }
-.ui-icon-mail-open { background-position: -96px -96px; }
-.ui-icon-suitcase { background-position: -112px -96px; }
-.ui-icon-comment { background-position: -128px -96px; }
-.ui-icon-person { background-position: -144px -96px; }
-.ui-icon-print { background-position: -160px -96px; }
-.ui-icon-trash { background-position: -176px -96px; }
-.ui-icon-locked { background-position: -192px -96px; }
-.ui-icon-unlocked { background-position: -208px -96px; }
-.ui-icon-bookmark { background-position: -224px -96px; }
-.ui-icon-tag { background-position: -240px -96px; }
-.ui-icon-home { background-position: 0 -112px; }
-.ui-icon-flag { background-position: -16px -112px; }
-.ui-icon-calendar { background-position: -32px -112px; }
-.ui-icon-cart { background-position: -48px -112px; }
-.ui-icon-pencil { background-position: -64px -112px; }
-.ui-icon-clock { background-position: -80px -112px; }
-.ui-icon-disk { background-position: -96px -112px; }
-.ui-icon-calculator { background-position: -112px -112px; }
-.ui-icon-zoomin { background-position: -128px -112px; }
-.ui-icon-zoomout { background-position: -144px -112px; }
-.ui-icon-search { background-position: -160px -112px; }
-.ui-icon-wrench { background-position: -176px -112px; }
-.ui-icon-gear { background-position: -192px -112px; }
-.ui-icon-heart { background-position: -208px -112px; }
-.ui-icon-star { background-position: -224px -112px; }
-.ui-icon-link { background-position: -240px -112px; }
-.ui-icon-cancel { background-position: 0 -128px; }
-.ui-icon-plus { background-position: -16px -128px; }
-.ui-icon-plusthick { background-position: -32px -128px; }
-.ui-icon-minus { background-position: -48px -128px; }
-.ui-icon-minusthick { background-position: -64px -128px; }
-.ui-icon-close { background-position: -80px -128px; }
-.ui-icon-closethick { background-position: -96px -128px; }
-.ui-icon-key { background-position: -112px -128px; }
-.ui-icon-lightbulb { background-position: -128px -128px; }
-.ui-icon-scissors { background-position: -144px -128px; }
-.ui-icon-clipboard { background-position: -160px -128px; }
-.ui-icon-copy { background-position: -176px -128px; }
-.ui-icon-contact { background-position: -192px -128px; }
-.ui-icon-image { background-position: -208px -128px; }
-.ui-icon-video { background-position: -224px -128px; }
-.ui-icon-script { background-position: -240px -128px; }
-.ui-icon-alert { background-position: 0 -144px; }
-.ui-icon-info { background-position: -16px -144px; }
-.ui-icon-notice { background-position: -32px -144px; }
-.ui-icon-help { background-position: -48px -144px; }
-.ui-icon-check { background-position: -64px -144px; }
-.ui-icon-bullet { background-position: -80px -144px; }
-.ui-icon-radio-off { background-position: -96px -144px; }
-.ui-icon-radio-on { background-position: -112px -144px; }
-.ui-icon-pin-w { background-position: -128px -144px; }
-.ui-icon-pin-s { background-position: -144px -144px; }
-.ui-icon-play { background-position: 0 -160px; }
-.ui-icon-pause { background-position: -16px -160px; }
-.ui-icon-seek-next { background-position: -32px -160px; }
-.ui-icon-seek-prev { background-position: -48px -160px; }
-.ui-icon-seek-end { background-position: -64px -160px; }
-.ui-icon-seek-start { background-position: -80px -160px; }
-/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */
-.ui-icon-seek-first { background-position: -80px -160px; }
-.ui-icon-stop { background-position: -96px -160px; }
-.ui-icon-eject { background-position: -112px -160px; }
-.ui-icon-volume-off { background-position: -128px -160px; }
-.ui-icon-volume-on { background-position: -144px -160px; }
-.ui-icon-power { background-position: 0 -176px; }
-.ui-icon-signal-diag { background-position: -16px -176px; }
-.ui-icon-signal { background-position: -32px -176px; }
-.ui-icon-battery-0 { background-position: -48px -176px; }
-.ui-icon-battery-1 { background-position: -64px -176px; }
-.ui-icon-battery-2 { background-position: -80px -176px; }
-.ui-icon-battery-3 { background-position: -96px -176px; }
-.ui-icon-circle-plus { background-position: 0 -192px; }
-.ui-icon-circle-minus { background-position: -16px -192px; }
-.ui-icon-circle-close { background-position: -32px -192px; }
-.ui-icon-circle-triangle-e { background-position: -48px -192px; }
-.ui-icon-circle-triangle-s { background-position: -64px -192px; }
-.ui-icon-circle-triangle-w { background-position: -80px -192px; }
-.ui-icon-circle-triangle-n { background-position: -96px -192px; }
-.ui-icon-circle-arrow-e { background-position: -112px -192px; }
-.ui-icon-circle-arrow-s { background-position: -128px -192px; }
-.ui-icon-circle-arrow-w { background-position: -144px -192px; }
-.ui-icon-circle-arrow-n { background-position: -160px -192px; }
-.ui-icon-circle-zoomin { background-position: -176px -192px; }
-.ui-icon-circle-zoomout { background-position: -192px -192px; }
-.ui-icon-circle-check { background-position: -208px -192px; }
-.ui-icon-circlesmall-plus { background-position: 0 -208px; }
-.ui-icon-circlesmall-minus { background-position: -16px -208px; }
-.ui-icon-circlesmall-close { background-position: -32px -208px; }
-.ui-icon-squaresmall-plus { background-position: -48px -208px; }
-.ui-icon-squaresmall-minus { background-position: -64px -208px; }
-.ui-icon-squaresmall-close { background-position: -80px -208px; }
-.ui-icon-grip-dotted-vertical { background-position: 0 -224px; }
-.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; }
-.ui-icon-grip-solid-vertical { background-position: -32px -224px; }
-.ui-icon-grip-solid-horizontal { background-position: -48px -224px; }
-.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; }
-.ui-icon-grip-diagonal-se { background-position: -80px -224px; }
-
-
-/* Misc visuals
-----------------------------------*/
-
-/* Corner radius */
-.ui-corner-tl { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; border-top-left-radius: 4px; }
-.ui-corner-tr { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; border-top-right-radius: 4px; }
-.ui-corner-bl { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; }
-.ui-corner-br { -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; }
-.ui-corner-top { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; border-top-left-radius: 4px; -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; border-top-right-radius: 4px; }
-.ui-corner-bottom { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; }
-.ui-corner-right {  -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; border-top-right-radius: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; }
-.ui-corner-left { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; border-top-left-radius: 4px; -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; }
-.ui-corner-all { -moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px; }
-
-/* Overlays */
-.ui-widget-overlay { background: #666666 50% 50% repeat; opacity: .50;filter:Alpha(Opacity=50); }
-.ui-widget-shadow { margin: -5px 0 0 -5px; padding: 5px; background: #000000 50% 50% repeat-x; opacity: .20;filter:Alpha(Opacity=20); -moz-border-radius: 5px; -webkit-border-radius: 5px; border-radius: 5px; }/*
- * jQuery UI Autocomplete 1.8.11
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Autocomplete#theming
- */
-.ui-autocomplete { position: absolute; cursor: default; }	
-
-/* workarounds */
-* html .ui-autocomplete { width:1px; } /* without this, the menu expands to 100% in IE6 */
-
-/*
- * jQuery UI Menu 1.8.11
- *
- * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Menu#theming
- */
-.ui-menu {
-	list-style:none;
-	padding: 2px;
-	margin: 0;
-	display:block;
-	float: left;
-}
-.ui-menu .ui-menu {
-	margin-top: -3px;
-}
-.ui-menu .ui-menu-item {
-	margin:0;
-	padding: 0;
-	zoom: 1;
-	float: left;
-	clear: left;
-	width: 100%;
-}
-.ui-menu .ui-menu-item a {
-	text-decoration:none;
-	display:block;
-	padding:.2em .4em;
-	line-height:1.5;
-	zoom:1;
-}
-.ui-menu .ui-menu-item a.ui-state-hover,
-.ui-menu .ui-menu-item a.ui-state-active {
-	font-weight: normal;
-	margin: -1px;
-}


[37/37] couchdb commit: updated refs/heads/goodbye-futon to 4fa015a

Posted by ja...@apache.org.
Add Fauxton build process to Makefile

`make` alone now builds Fauxton along with the rest.

`make fauxton` to only do the fauxton build.

`make distclean` cleans the Fauxton build.

Fauxton is deployed into share/www. `make distclean` simply removes
share/www.

If share/www exists, `make [fauxton]` skips building Fauxton.

Includes a letter for Noah ;)


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/4fa015a8
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/4fa015a8
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/4fa015a8

Branch: refs/heads/goodbye-futon
Commit: 4fa015a86109cf3b892ec581d0f2e66b22651cd0
Parents: cca309f
Author: Jan Lehnardt <ja...@apache.org>
Authored: Fri Oct 10 21:08:11 2014 +0200
Committer: Jan Lehnardt <ja...@apache.org>
Committed: Fri Oct 10 21:08:11 2014 +0200

----------------------------------------------------------------------
 Makefile | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/4fa015a8/Makefile
----------------------------------------------------------------------
diff --git a/Makefile b/Makefile
index e881f61..83cad0b 100644
--- a/Makefile
+++ b/Makefile
@@ -18,7 +18,7 @@ config.erl:
 	@echo
 	@false
 
-compile: config.erl
+compile: config.erl fauxton
 	@rebar compile
 	@cp src/couch/priv/couchjs bin/
 
@@ -34,6 +34,7 @@ dist: compile
 
 distclean: clean
 	@rm -rf rel/couchdb
+	@rm -rf share/www
 
 devclean:
 	@rm -rf dev/lib/*/data
@@ -69,3 +70,7 @@ eunit: compile
 
 javascript: compile
 	@dev/run test/javascript/run
+
+fauxton:
+# This next line so Noah throws his arms up in dispair and teaches me proper Make again -- Love, Jan
+	@if [ ! -d share/www ]; then echo "Building Fauxton" &&  cd src/fauxton && npm install && grunt couchdb; fi


[31/37] goodbye Futon, old friend <3

Posted by ja...@apache.org.
http://git-wip-us.apache.org/repos/asf/couchdb/blob/cca309f3/share/www/fauxton/js/ace/mode-json.js
----------------------------------------------------------------------
diff --git a/share/www/fauxton/js/ace/mode-json.js b/share/www/fauxton/js/ace/mode-json.js
deleted file mode 100644
index d1b3d47..0000000
--- a/share/www/fauxton/js/ace/mode-json.js
+++ /dev/null
@@ -1,578 +0,0 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Distributed under the BSD license:
- *
- * Copyright (c) 2010, Ajax.org B.V.
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of Ajax.org B.V. nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * ***** END LICENSE BLOCK ***** */
-
-define('ace/mode/json', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/json_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/mode/behaviour/cstyle', 'ace/mode/folding/cstyle', 'ace/worker/worker_client'], function(require, exports, module) {
-
-
-var oop = require("../lib/oop");
-var TextMode = require("./text").Mode;
-var Tokenizer = require("../tokenizer").Tokenizer;
-var HighlightRules = require("./json_highlight_rules").JsonHighlightRules;
-var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
-var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
-var CStyleFoldMode = require("./folding/cstyle").FoldMode;
-var WorkerClient = require("../worker/worker_client").WorkerClient;
-
-var Mode = function() {
-    this.HighlightRules = HighlightRules;
-    this.$outdent = new MatchingBraceOutdent();
-    this.$behaviour = new CstyleBehaviour();
-    this.foldingRules = new CStyleFoldMode();
-};
-oop.inherits(Mode, TextMode);
-
-(function() {
-
-    this.getNextLineIndent = function(state, line, tab) {
-        var indent = this.$getIndent(line);
-
-        if (state == "start") {
-            var match = line.match(/^.*[\{\(\[]\s*$/);
-            if (match) {
-                indent += tab;
-            }
-        }
-
-        return indent;
-    };
-
-    this.checkOutdent = function(state, line, input) {
-        return this.$outdent.checkOutdent(line, input);
-    };
-
-    this.autoOutdent = function(state, doc, row) {
-        this.$outdent.autoOutdent(doc, row);
-    };
-
-    this.createWorker = function(session) {
-        var worker = new WorkerClient(["ace"], "ace/mode/json_worker", "JsonWorker");
-        worker.attachToDocument(session.getDocument());
-
-        worker.on("error", function(e) {
-            session.setAnnotations([e.data]);
-        });
-
-        worker.on("ok", function() {
-            session.clearAnnotations();
-        });
-
-        return worker;
-    };
-
-
-}).call(Mode.prototype);
-
-exports.Mode = Mode;
-});
-
-define('ace/mode/json_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
-
-
-var oop = require("../lib/oop");
-var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
-
-var JsonHighlightRules = function() {
-    this.$rules = {
-        "start" : [
-            {
-                token : "variable", // single line
-                regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]\\s*(?=:)'
-            }, {
-                token : "string", // single line
-                regex : '"',
-                next  : "string"
-            }, {
-                token : "constant.numeric", // hex
-                regex : "0[xX][0-9a-fA-F]+\\b"
-            }, {
-                token : "constant.numeric", // float
-                regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"
-            }, {
-                token : "constant.language.boolean",
-                regex : "(?:true|false)\\b"
-            }, {
-                token : "invalid.illegal", // single quoted strings are not allowed
-                regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
-            }, {
-                token : "invalid.illegal", // comments are not allowed
-                regex : "\\/\\/.*$"
-            }, {
-                token : "paren.lparen",
-                regex : "[[({]"
-            }, {
-                token : "paren.rparen",
-                regex : "[\\])}]"
-            }, {
-                token : "text",
-                regex : "\\s+"
-            }
-        ],
-        "string" : [
-            {
-                token : "constant.language.escape",
-                regex : /\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|["\\\/bfnrt])/
-            }, {
-                token : "string",
-                regex : '[^"\\\\]+'
-            }, {
-                token : "string",
-                regex : '"',
-                next  : "start"
-            }, {
-                token : "string",
-                regex : "",
-                next  : "start"
-            }
-        ]
-    };
-    
-};
-
-oop.inherits(JsonHighlightRules, TextHighlightRules);
-
-exports.JsonHighlightRules = JsonHighlightRules;
-});
-
-define('ace/mode/matching_brace_outdent', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) {
-
-
-var Range = require("../range").Range;
-
-var MatchingBraceOutdent = function() {};
-
-(function() {
-
-    this.checkOutdent = function(line, input) {
-        if (! /^\s+$/.test(line))
-            return false;
-
-        return /^\s*\}/.test(input);
-    };
-
-    this.autoOutdent = function(doc, row) {
-        var line = doc.getLine(row);
-        var match = line.match(/^(\s*\})/);
-
-        if (!match) return 0;
-
-        var column = match[1].length;
-        var openBracePos = doc.findMatchingBracket({row: row, column: column});
-
-        if (!openBracePos || openBracePos.row == row) return 0;
-
-        var indent = this.$getIndent(doc.getLine(openBracePos.row));
-        doc.replace(new Range(row, 0, row, column-1), indent);
-    };
-
-    this.$getIndent = function(line) {
-        return line.match(/^\s*/)[0];
-    };
-
-}).call(MatchingBraceOutdent.prototype);
-
-exports.MatchingBraceOutdent = MatchingBraceOutdent;
-});
-
-define('ace/mode/behaviour/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour', 'ace/token_iterator', 'ace/lib/lang'], function(require, exports, module) {
-
-
-var oop = require("../../lib/oop");
-var Behaviour = require("../behaviour").Behaviour;
-var TokenIterator = require("../../token_iterator").TokenIterator;
-var lang = require("../../lib/lang");
-
-var SAFE_INSERT_IN_TOKENS =
-    ["text", "paren.rparen", "punctuation.operator"];
-var SAFE_INSERT_BEFORE_TOKENS =
-    ["text", "paren.rparen", "punctuation.operator", "comment"];
-
-
-var autoInsertedBrackets = 0;
-var autoInsertedRow = -1;
-var autoInsertedLineEnd = "";
-var maybeInsertedBrackets = 0;
-var maybeInsertedRow = -1;
-var maybeInsertedLineStart = "";
-var maybeInsertedLineEnd = "";
-
-var CstyleBehaviour = function () {
-    
-    CstyleBehaviour.isSaneInsertion = function(editor, session) {
-        var cursor = editor.getCursorPosition();
-        var iterator = new TokenIterator(session, cursor.row, cursor.column);
-        if (!this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) {
-            var iterator2 = new TokenIterator(session, cursor.row, cursor.column + 1);
-            if (!this.$matchTokenType(iterator2.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS))
-                return false;
-        }
-        iterator.stepForward();
-        return iterator.getCurrentTokenRow() !== cursor.row ||
-            this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_BEFORE_TOKENS);
-    };
-    
-    CstyleBehaviour.$matchTokenType = function(token, types) {
-        return types.indexOf(token.type || token) > -1;
-    };
-    
-    CstyleBehaviour.recordAutoInsert = function(editor, session, bracket) {
-        var cursor = editor.getCursorPosition();
-        var line = session.doc.getLine(cursor.row);
-        if (!this.isAutoInsertedClosing(cursor, line, autoInsertedLineEnd[0]))
-            autoInsertedBrackets = 0;
-        autoInsertedRow = cursor.row;
-        autoInsertedLineEnd = bracket + line.substr(cursor.column);
-        autoInsertedBrackets++;
-    };
-    
-    CstyleBehaviour.recordMaybeInsert = function(editor, session, bracket) {
-        var cursor = editor.getCursorPosition();
-        var line = session.doc.getLine(cursor.row);
-        if (!this.isMaybeInsertedClosing(cursor, line))
-            maybeInsertedBrackets = 0;
-        maybeInsertedRow = cursor.row;
-        maybeInsertedLineStart = line.substr(0, cursor.column) + bracket;
-        maybeInsertedLineEnd = line.substr(cursor.column);
-        maybeInsertedBrackets++;
-    };
-    
-    CstyleBehaviour.isAutoInsertedClosing = function(cursor, line, bracket) {
-        return autoInsertedBrackets > 0 &&
-            cursor.row === autoInsertedRow &&
-            bracket === autoInsertedLineEnd[0] &&
-            line.substr(cursor.column) === autoInsertedLineEnd;
-    };
-    
-    CstyleBehaviour.isMaybeInsertedClosing = function(cursor, line) {
-        return maybeInsertedBrackets > 0 &&
-            cursor.row === maybeInsertedRow &&
-            line.substr(cursor.column) === maybeInsertedLineEnd &&
-            line.substr(0, cursor.column) == maybeInsertedLineStart;
-    };
-    
-    CstyleBehaviour.popAutoInsertedClosing = function() {
-        autoInsertedLineEnd = autoInsertedLineEnd.substr(1);
-        autoInsertedBrackets--;
-    };
-    
-    CstyleBehaviour.clearMaybeInsertedClosing = function() {
-        maybeInsertedBrackets = 0;
-        maybeInsertedRow = -1;
-    };
-
-    this.add("braces", "insertion", function (state, action, editor, session, text) {
-        var cursor = editor.getCursorPosition();
-        var line = session.doc.getLine(cursor.row);
-        if (text == '{') {
-            var selection = editor.getSelectionRange();
-            var selected = session.doc.getTextRange(selection);
-            if (selected !== "" && selected !== "{" && editor.getWrapBehavioursEnabled()) {
-                return {
-                    text: '{' + selected + '}',
-                    selection: false
-                };
-            } else if (CstyleBehaviour.isSaneInsertion(editor, session)) {
-                if (/[\]\}\)]/.test(line[cursor.column])) {
-                    CstyleBehaviour.recordAutoInsert(editor, session, "}");
-                    return {
-                        text: '{}',
-                        selection: [1, 1]
-                    };
-                } else {
-                    CstyleBehaviour.recordMaybeInsert(editor, session, "{");
-                    return {
-                        text: '{',
-                        selection: [1, 1]
-                    };
-                }
-            }
-        } else if (text == '}') {
-            var rightChar = line.substring(cursor.column, cursor.column + 1);
-            if (rightChar == '}') {
-                var matching = session.$findOpeningBracket('}', {column: cursor.column + 1, row: cursor.row});
-                if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) {
-                    CstyleBehaviour.popAutoInsertedClosing();
-                    return {
-                        text: '',
-                        selection: [1, 1]
-                    };
-                }
-            }
-        } else if (text == "\n" || text == "\r\n") {
-            var closing = "";
-            if (CstyleBehaviour.isMaybeInsertedClosing(cursor, line)) {
-                closing = lang.stringRepeat("}", maybeInsertedBrackets);
-                CstyleBehaviour.clearMaybeInsertedClosing();
-            }
-            var rightChar = line.substring(cursor.column, cursor.column + 1);
-            if (rightChar == '}' || closing !== "") {
-                var openBracePos = session.findMatchingBracket({row: cursor.row, column: cursor.column}, '}');
-                if (!openBracePos)
-                     return null;
-
-                var indent = this.getNextLineIndent(state, line.substring(0, cursor.column), session.getTabString());
-                var next_indent = this.$getIndent(line);
-
-                return {
-                    text: '\n' + indent + '\n' + next_indent + closing,
-                    selection: [1, indent.length, 1, indent.length]
-                };
-            }
-        }
-    });
-
-    this.add("braces", "deletion", function (state, action, editor, session, range) {
-        var selected = session.doc.getTextRange(range);
-        if (!range.isMultiLine() && selected == '{') {
-            var line = session.doc.getLine(range.start.row);
-            var rightChar = line.substring(range.end.column, range.end.column + 1);
-            if (rightChar == '}') {
-                range.end.column++;
-                return range;
-            } else {
-                maybeInsertedBrackets--;
-            }
-        }
-    });
-
-    this.add("parens", "insertion", function (state, action, editor, session, text) {
-        if (text == '(') {
-            var selection = editor.getSelectionRange();
-            var selected = session.doc.getTextRange(selection);
-            if (selected !== "" && editor.getWrapBehavioursEnabled()) {
-                return {
-                    text: '(' + selected + ')',
-                    selection: false
-                };
-            } else if (CstyleBehaviour.isSaneInsertion(editor, session)) {
-                CstyleBehaviour.recordAutoInsert(editor, session, ")");
-                return {
-                    text: '()',
-                    selection: [1, 1]
-                };
-            }
-        } else if (text == ')') {
-            var cursor = editor.getCursorPosition();
-            var line = session.doc.getLine(cursor.row);
-            var rightChar = line.substring(cursor.column, cursor.column + 1);
-            if (rightChar == ')') {
-                var matching = session.$findOpeningBracket(')', {column: cursor.column + 1, row: cursor.row});
-                if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) {
-                    CstyleBehaviour.popAutoInsertedClosing();
-                    return {
-                        text: '',
-                        selection: [1, 1]
-                    };
-                }
-            }
-        }
-    });
-
-    this.add("parens", "deletion", function (state, action, editor, session, range) {
-        var selected = session.doc.getTextRange(range);
-        if (!range.isMultiLine() && selected == '(') {
-            var line = session.doc.getLine(range.start.row);
-            var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
-            if (rightChar == ')') {
-                range.end.column++;
-                return range;
-            }
-        }
-    });
-
-    this.add("brackets", "insertion", function (state, action, editor, session, text) {
-        if (text == '[') {
-            var selection = editor.getSelectionRange();
-            var selected = session.doc.getTextRange(selection);
-            if (selected !== "" && editor.getWrapBehavioursEnabled()) {
-                return {
-                    text: '[' + selected + ']',
-                    selection: false
-                };
-            } else if (CstyleBehaviour.isSaneInsertion(editor, session)) {
-                CstyleBehaviour.recordAutoInsert(editor, session, "]");
-                return {
-                    text: '[]',
-                    selection: [1, 1]
-                };
-            }
-        } else if (text == ']') {
-            var cursor = editor.getCursorPosition();
-            var line = session.doc.getLine(cursor.row);
-            var rightChar = line.substring(cursor.column, cursor.column + 1);
-            if (rightChar == ']') {
-                var matching = session.$findOpeningBracket(']', {column: cursor.column + 1, row: cursor.row});
-                if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) {
-                    CstyleBehaviour.popAutoInsertedClosing();
-                    return {
-                        text: '',
-                        selection: [1, 1]
-                    };
-                }
-            }
-        }
-    });
-
-    this.add("brackets", "deletion", function (state, action, editor, session, range) {
-        var selected = session.doc.getTextRange(range);
-        if (!range.isMultiLine() && selected == '[') {
-            var line = session.doc.getLine(range.start.row);
-            var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
-            if (rightChar == ']') {
-                range.end.column++;
-                return range;
-            }
-        }
-    });
-
-    this.add("string_dquotes", "insertion", function (state, action, editor, session, text) {
-        if (text == '"' || text == "'") {
-            var quote = text;
-            var selection = editor.getSelectionRange();
-            var selected = session.doc.getTextRange(selection);
-            if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) {
-                return {
-                    text: quote + selected + quote,
-                    selection: false
-                };
-            } else {
-                var cursor = editor.getCursorPosition();
-                var line = session.doc.getLine(cursor.row);
-                var leftChar = line.substring(cursor.column-1, cursor.column);
-                if (leftChar == '\\') {
-                    return null;
-                }
-                var tokens = session.getTokens(selection.start.row);
-                var col = 0, token;
-                var quotepos = -1; // Track whether we're inside an open quote.
-
-                for (var x = 0; x < tokens.length; x++) {
-                    token = tokens[x];
-                    if (token.type == "string") {
-                      quotepos = -1;
-                    } else if (quotepos < 0) {
-                      quotepos = token.value.indexOf(quote);
-                    }
-                    if ((token.value.length + col) > selection.start.column) {
-                        break;
-                    }
-                    col += tokens[x].value.length;
-                }
-                if (!token || (quotepos < 0 && token.type !== "comment" && (token.type !== "string" || ((selection.start.column !== token.value.length+col-1) && token.value.lastIndexOf(quote) === token.value.length-1)))) {
-                    if (!CstyleBehaviour.isSaneInsertion(editor, session))
-                        return;
-                    return {
-                        text: quote + quote,
-                        selection: [1,1]
-                    };
-                } else if (token && token.type === "string") {
-                    var rightChar = line.substring(cursor.column, cursor.column + 1);
-                    if (rightChar == quote) {
-                        return {
-                            text: '',
-                            selection: [1, 1]
-                        };
-                    }
-                }
-            }
-        }
-    });
-
-    this.add("string_dquotes", "deletion", function (state, action, editor, session, range) {
-        var selected = session.doc.getTextRange(range);
-        if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
-            var line = session.doc.getLine(range.start.row);
-            var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
-            if (rightChar == selected) {
-                range.end.column++;
-                return range;
-            }
-        }
-    });
-
-};
-
-oop.inherits(CstyleBehaviour, Behaviour);
-
-exports.CstyleBehaviour = CstyleBehaviour;
-});
-
-define('ace/mode/folding/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/range', 'ace/mode/folding/fold_mode'], function(require, exports, module) {
-
-
-var oop = require("../../lib/oop");
-var Range = require("../../range").Range;
-var BaseFoldMode = require("./fold_mode").FoldMode;
-
-var FoldMode = exports.FoldMode = function(commentRegex) {
-    if (commentRegex) {
-        this.foldingStartMarker = new RegExp(
-            this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start)
-        );
-        this.foldingStopMarker = new RegExp(
-            this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end)
-        );
-    }
-};
-oop.inherits(FoldMode, BaseFoldMode);
-
-(function() {
-
-    this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/;
-    this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/;
-
-    this.getFoldWidgetRange = function(session, foldStyle, row) {
-        var line = session.getLine(row);
-        var match = line.match(this.foldingStartMarker);
-        if (match) {
-            var i = match.index;
-
-            if (match[1])
-                return this.openingBracketBlock(session, match[1], row, i);
-
-            return session.getCommentFoldRange(row, i + match[0].length, 1);
-        }
-
-        if (foldStyle !== "markbeginend")
-            return;
-
-        var match = line.match(this.foldingStopMarker);
-        if (match) {
-            var i = match.index + match[0].length;
-
-            if (match[1])
-                return this.closingBracketBlock(session, match[1], row, i);
-
-            return session.getCommentFoldRange(row, i, -1);
-        }
-    };
-
-}).call(FoldMode.prototype);
-
-});

http://git-wip-us.apache.org/repos/asf/couchdb/blob/cca309f3/share/www/fauxton/js/ace/theme-crimson_editor.js
----------------------------------------------------------------------
diff --git a/share/www/fauxton/js/ace/theme-crimson_editor.js b/share/www/fauxton/js/ace/theme-crimson_editor.js
deleted file mode 100644
index 5192579..0000000
--- a/share/www/fauxton/js/ace/theme-crimson_editor.js
+++ /dev/null
@@ -1,148 +0,0 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Distributed under the BSD license:
- *
- * Copyright (c) 2010, Ajax.org B.V.
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of Ajax.org B.V. nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * ***** END LICENSE BLOCK ***** */
-
-define('ace/theme/crimson_editor', ['require', 'exports', 'module' , 'ace/lib/dom'], function(require, exports, module) {
-exports.isDark = false;
-exports.cssText = ".ace-crimson-editor .ace_gutter {\
-background: #ebebeb;\
-color: #333;\
-overflow : hidden;\
-}\
-.ace-crimson-editor .ace_gutter-layer {\
-width: 100%;\
-text-align: right;\
-}\
-.ace-crimson-editor .ace_print-margin {\
-width: 1px;\
-background: #e8e8e8;\
-}\
-.ace-crimson-editor {\
-background-color: #FFFFFF;\
-color: rgb(64, 64, 64);\
-}\
-.ace-crimson-editor .ace_cursor {\
-color: black;\
-}\
-.ace-crimson-editor .ace_invisible {\
-color: rgb(191, 191, 191);\
-}\
-.ace-crimson-editor .ace_identifier {\
-color: black;\
-}\
-.ace-crimson-editor .ace_keyword {\
-color: blue;\
-}\
-.ace-crimson-editor .ace_constant.ace_buildin {\
-color: rgb(88, 72, 246);\
-}\
-.ace-crimson-editor .ace_constant.ace_language {\
-color: rgb(255, 156, 0);\
-}\
-.ace-crimson-editor .ace_constant.ace_library {\
-color: rgb(6, 150, 14);\
-}\
-.ace-crimson-editor .ace_invalid {\
-text-decoration: line-through;\
-color: rgb(224, 0, 0);\
-}\
-.ace-crimson-editor .ace_fold {\
-}\
-.ace-crimson-editor .ace_support.ace_function {\
-color: rgb(192, 0, 0);\
-}\
-.ace-crimson-editor .ace_support.ace_constant {\
-color: rgb(6, 150, 14);\
-}\
-.ace-crimson-editor .ace_support.ace_type,\
-.ace-crimson-editor .ace_support.ace_class {\
-color: rgb(109, 121, 222);\
-}\
-.ace-crimson-editor .ace_keyword.ace_operator {\
-color: rgb(49, 132, 149);\
-}\
-.ace-crimson-editor .ace_string {\
-color: rgb(128, 0, 128);\
-}\
-.ace-crimson-editor .ace_comment {\
-color: rgb(76, 136, 107);\
-}\
-.ace-crimson-editor .ace_comment.ace_doc {\
-color: rgb(0, 102, 255);\
-}\
-.ace-crimson-editor .ace_comment.ace_doc.ace_tag {\
-color: rgb(128, 159, 191);\
-}\
-.ace-crimson-editor .ace_constant.ace_numeric {\
-color: rgb(0, 0, 64);\
-}\
-.ace-crimson-editor .ace_variable {\
-color: rgb(0, 64, 128);\
-}\
-.ace-crimson-editor .ace_xml-pe {\
-color: rgb(104, 104, 91);\
-}\
-.ace-crimson-editor .ace_marker-layer .ace_selection {\
-background: rgb(181, 213, 255);\
-}\
-.ace-crimson-editor .ace_marker-layer .ace_step {\
-background: rgb(252, 255, 0);\
-}\
-.ace-crimson-editor .ace_marker-layer .ace_stack {\
-background: rgb(164, 229, 101);\
-}\
-.ace-crimson-editor .ace_marker-layer .ace_bracket {\
-margin: -1px 0 0 -1px;\
-border: 1px solid rgb(192, 192, 192);\
-}\
-.ace-crimson-editor .ace_marker-layer .ace_active-line {\
-background: rgb(232, 242, 254);\
-}\
-.ace-crimson-editor .ace_gutter-active-line {\
-background-color : #dcdcdc;\
-}\
-.ace-crimson-editor .ace_meta.ace_tag {\
-color:rgb(28, 2, 255);\
-}\
-.ace-crimson-editor .ace_marker-layer .ace_selected-word {\
-background: rgb(250, 250, 255);\
-border: 1px solid rgb(200, 200, 250);\
-}\
-.ace-crimson-editor .ace_string.ace_regex {\
-color: rgb(192, 0, 192);\
-}\
-.ace-crimson-editor .ace_indent-guide {\
-background: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==\") right repeat-y;\
-}";
-
-exports.cssClass = "ace-crimson-editor";
-
-var dom = require("../lib/dom");
-dom.importCssString(exports.cssText, exports.cssClass);
-});


[25/37] goodbye Futon, old friend <3

Posted by ja...@apache.org.
http://git-wip-us.apache.org/repos/asf/couchdb/blob/cca309f3/share/www/script/jquery-ui-1.8.11.custom.min.js
----------------------------------------------------------------------
diff --git a/share/www/script/jquery-ui-1.8.11.custom.min.js b/share/www/script/jquery-ui-1.8.11.custom.min.js
deleted file mode 100644
index 45b927e..0000000
--- a/share/www/script/jquery-ui-1.8.11.custom.min.js
+++ /dev/null
@@ -1,81 +0,0 @@
-/*!
- * jQuery UI 1.8.11
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI
- */
-(function(c,j){function k(a){return!c(a).parents().andSelf().filter(function(){return c.curCSS(this,"visibility")==="hidden"||c.expr.filters.hidden(this)}).length}c.ui=c.ui||{};if(!c.ui.version){c.extend(c.ui,{version:"1.8.11",keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,
-NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}});c.fn.extend({_focus:c.fn.focus,focus:function(a,b){return typeof a==="number"?this.each(function(){var d=this;setTimeout(function(){c(d).focus();b&&b.call(d)},a)}):this._focus.apply(this,arguments)},scrollParent:function(){var a;a=c.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(c.curCSS(this,
-"position",1))&&/(auto|scroll)/.test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0);return/fixed/.test(this.css("position"))||!a.length?c(document):a},zIndex:function(a){if(a!==j)return this.css("zIndex",a);if(this.length){a=c(this[0]);for(var b;a.length&&a[0]!==document;){b=a.css("position");
-if(b==="absolute"||b==="relative"||b==="fixed"){b=parseInt(a.css("zIndex"),10);if(!isNaN(b)&&b!==0)return b}a=a.parent()}}return 0},disableSelection:function(){return this.bind((c.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(a){a.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}});c.each(["Width","Height"],function(a,b){function d(f,g,l,m){c.each(e,function(){g-=parseFloat(c.curCSS(f,"padding"+this,true))||0;if(l)g-=parseFloat(c.curCSS(f,
-"border"+this+"Width",true))||0;if(m)g-=parseFloat(c.curCSS(f,"margin"+this,true))||0});return g}var e=b==="Width"?["Left","Right"]:["Top","Bottom"],h=b.toLowerCase(),i={innerWidth:c.fn.innerWidth,innerHeight:c.fn.innerHeight,outerWidth:c.fn.outerWidth,outerHeight:c.fn.outerHeight};c.fn["inner"+b]=function(f){if(f===j)return i["inner"+b].call(this);return this.each(function(){c(this).css(h,d(this,f)+"px")})};c.fn["outer"+b]=function(f,g){if(typeof f!=="number")return i["outer"+b].call(this,f);return this.each(function(){c(this).css(h,
-d(this,f,true,g)+"px")})}});c.extend(c.expr[":"],{data:function(a,b,d){return!!c.data(a,d[3])},focusable:function(a){var b=a.nodeName.toLowerCase(),d=c.attr(a,"tabindex");if("area"===b){b=a.parentNode;d=b.name;if(!a.href||!d||b.nodeName.toLowerCase()!=="map")return false;a=c("img[usemap=#"+d+"]")[0];return!!a&&k(a)}return(/input|select|textarea|button|object/.test(b)?!a.disabled:"a"==b?a.href||!isNaN(d):!isNaN(d))&&k(a)},tabbable:function(a){var b=c.attr(a,"tabindex");return(isNaN(b)||b>=0)&&c(a).is(":focusable")}});
-c(function(){var a=document.body,b=a.appendChild(b=document.createElement("div"));c.extend(b.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0});c.support.minHeight=b.offsetHeight===100;c.support.selectstart="onselectstart"in b;a.removeChild(b).style.display="none"});c.extend(c.ui,{plugin:{add:function(a,b,d){a=c.ui[a].prototype;for(var e in d){a.plugins[e]=a.plugins[e]||[];a.plugins[e].push([b,d[e]])}},call:function(a,b,d){if((b=a.plugins[b])&&a.element[0].parentNode)for(var e=0;e<b.length;e++)a.options[b[e][0]]&&
-b[e][1].apply(a.element,d)}},contains:function(a,b){return document.compareDocumentPosition?a.compareDocumentPosition(b)&16:a!==b&&a.contains(b)},hasScroll:function(a,b){if(c(a).css("overflow")==="hidden")return false;b=b&&b==="left"?"scrollLeft":"scrollTop";var d=false;if(a[b]>0)return true;a[b]=1;d=a[b]>0;a[b]=0;return d},isOverAxis:function(a,b,d){return a>b&&a<b+d},isOver:function(a,b,d,e,h,i){return c.ui.isOverAxis(a,d,h)&&c.ui.isOverAxis(b,e,i)}})}})(jQuery);
-;/*!
- * jQuery UI Widget 1.8.11
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Widget
- */
-(function(b,j){if(b.cleanData){var k=b.cleanData;b.cleanData=function(a){for(var c=0,d;(d=a[c])!=null;c++)b(d).triggerHandler("remove");k(a)}}else{var l=b.fn.remove;b.fn.remove=function(a,c){return this.each(function(){if(!c)if(!a||b.filter(a,[this]).length)b("*",this).add([this]).each(function(){b(this).triggerHandler("remove")});return l.call(b(this),a,c)})}}b.widget=function(a,c,d){var e=a.split(".")[0],f;a=a.split(".")[1];f=e+"-"+a;if(!d){d=c;c=b.Widget}b.expr[":"][f]=function(h){return!!b.data(h,
-a)};b[e]=b[e]||{};b[e][a]=function(h,g){arguments.length&&this._createWidget(h,g)};c=new c;c.options=b.extend(true,{},c.options);b[e][a].prototype=b.extend(true,c,{namespace:e,widgetName:a,widgetEventPrefix:b[e][a].prototype.widgetEventPrefix||a,widgetBaseClass:f},d);b.widget.bridge(a,b[e][a])};b.widget.bridge=function(a,c){b.fn[a]=function(d){var e=typeof d==="string",f=Array.prototype.slice.call(arguments,1),h=this;d=!e&&f.length?b.extend.apply(null,[true,d].concat(f)):d;if(e&&d.charAt(0)==="_")return h;
-e?this.each(function(){var g=b.data(this,a),i=g&&b.isFunction(g[d])?g[d].apply(g,f):g;if(i!==g&&i!==j){h=i;return false}}):this.each(function(){var g=b.data(this,a);g?g.option(d||{})._init():b.data(this,a,new c(d,this))});return h}};b.Widget=function(a,c){arguments.length&&this._createWidget(a,c)};b.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:false},_createWidget:function(a,c){b.data(c,this.widgetName,this);this.element=b(c);this.options=b.extend(true,{},this.options,
-this._getCreateOptions(),a);var d=this;this.element.bind("remove."+this.widgetName,function(){d.destroy()});this._create();this._trigger("create");this._init()},_getCreateOptions:function(){return b.metadata&&b.metadata.get(this.element[0])[this.widgetName]},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName);this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+"-disabled ui-state-disabled")},
-widget:function(){return this.element},option:function(a,c){var d=a;if(arguments.length===0)return b.extend({},this.options);if(typeof a==="string"){if(c===j)return this.options[a];d={};d[a]=c}this._setOptions(d);return this},_setOptions:function(a){var c=this;b.each(a,function(d,e){c._setOption(d,e)});return this},_setOption:function(a,c){this.options[a]=c;if(a==="disabled")this.widget()[c?"addClass":"removeClass"](this.widgetBaseClass+"-disabled ui-state-disabled").attr("aria-disabled",c);return this},
-enable:function(){return this._setOption("disabled",false)},disable:function(){return this._setOption("disabled",true)},_trigger:function(a,c,d){var e=this.options[a];c=b.Event(c);c.type=(a===this.widgetEventPrefix?a:this.widgetEventPrefix+a).toLowerCase();d=d||{};if(c.originalEvent){a=b.event.props.length;for(var f;a;){f=b.event.props[--a];c[f]=c.originalEvent[f]}}this.element.trigger(c,d);return!(b.isFunction(e)&&e.call(this.element[0],c,d)===false||c.isDefaultPrevented())}}})(jQuery);
-;/*
- * jQuery UI Position 1.8.11
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Position
- */
-(function(c){c.ui=c.ui||{};var n=/left|center|right/,o=/top|center|bottom/,t=c.fn.position,u=c.fn.offset;c.fn.position=function(b){if(!b||!b.of)return t.apply(this,arguments);b=c.extend({},b);var a=c(b.of),d=a[0],g=(b.collision||"flip").split(" "),e=b.offset?b.offset.split(" "):[0,0],h,k,j;if(d.nodeType===9){h=a.width();k=a.height();j={top:0,left:0}}else if(d.setTimeout){h=a.width();k=a.height();j={top:a.scrollTop(),left:a.scrollLeft()}}else if(d.preventDefault){b.at="left top";h=k=0;j={top:b.of.pageY,
-left:b.of.pageX}}else{h=a.outerWidth();k=a.outerHeight();j=a.offset()}c.each(["my","at"],function(){var f=(b[this]||"").split(" ");if(f.length===1)f=n.test(f[0])?f.concat(["center"]):o.test(f[0])?["center"].concat(f):["center","center"];f[0]=n.test(f[0])?f[0]:"center";f[1]=o.test(f[1])?f[1]:"center";b[this]=f});if(g.length===1)g[1]=g[0];e[0]=parseInt(e[0],10)||0;if(e.length===1)e[1]=e[0];e[1]=parseInt(e[1],10)||0;if(b.at[0]==="right")j.left+=h;else if(b.at[0]==="center")j.left+=h/2;if(b.at[1]==="bottom")j.top+=
-k;else if(b.at[1]==="center")j.top+=k/2;j.left+=e[0];j.top+=e[1];return this.each(function(){var f=c(this),l=f.outerWidth(),m=f.outerHeight(),p=parseInt(c.curCSS(this,"marginLeft",true))||0,q=parseInt(c.curCSS(this,"marginTop",true))||0,v=l+p+(parseInt(c.curCSS(this,"marginRight",true))||0),w=m+q+(parseInt(c.curCSS(this,"marginBottom",true))||0),i=c.extend({},j),r;if(b.my[0]==="right")i.left-=l;else if(b.my[0]==="center")i.left-=l/2;if(b.my[1]==="bottom")i.top-=m;else if(b.my[1]==="center")i.top-=
-m/2;i.left=Math.round(i.left);i.top=Math.round(i.top);r={left:i.left-p,top:i.top-q};c.each(["left","top"],function(s,x){c.ui.position[g[s]]&&c.ui.position[g[s]][x](i,{targetWidth:h,targetHeight:k,elemWidth:l,elemHeight:m,collisionPosition:r,collisionWidth:v,collisionHeight:w,offset:e,my:b.my,at:b.at})});c.fn.bgiframe&&f.bgiframe();f.offset(c.extend(i,{using:b.using}))})};c.ui.position={fit:{left:function(b,a){var d=c(window);d=a.collisionPosition.left+a.collisionWidth-d.width()-d.scrollLeft();b.left=
-d>0?b.left-d:Math.max(b.left-a.collisionPosition.left,b.left)},top:function(b,a){var d=c(window);d=a.collisionPosition.top+a.collisionHeight-d.height()-d.scrollTop();b.top=d>0?b.top-d:Math.max(b.top-a.collisionPosition.top,b.top)}},flip:{left:function(b,a){if(a.at[0]!=="center"){var d=c(window);d=a.collisionPosition.left+a.collisionWidth-d.width()-d.scrollLeft();var g=a.my[0]==="left"?-a.elemWidth:a.my[0]==="right"?a.elemWidth:0,e=a.at[0]==="left"?a.targetWidth:-a.targetWidth,h=-2*a.offset[0];b.left+=
-a.collisionPosition.left<0?g+e+h:d>0?g+e+h:0}},top:function(b,a){if(a.at[1]!=="center"){var d=c(window);d=a.collisionPosition.top+a.collisionHeight-d.height()-d.scrollTop();var g=a.my[1]==="top"?-a.elemHeight:a.my[1]==="bottom"?a.elemHeight:0,e=a.at[1]==="top"?a.targetHeight:-a.targetHeight,h=-2*a.offset[1];b.top+=a.collisionPosition.top<0?g+e+h:d>0?g+e+h:0}}}};if(!c.offset.setOffset){c.offset.setOffset=function(b,a){if(/static/.test(c.curCSS(b,"position")))b.style.position="relative";var d=c(b),
-g=d.offset(),e=parseInt(c.curCSS(b,"top",true),10)||0,h=parseInt(c.curCSS(b,"left",true),10)||0;g={top:a.top-g.top+e,left:a.left-g.left+h};"using"in a?a.using.call(b,g):d.css(g)};c.fn.offset=function(b){var a=this[0];if(!a||!a.ownerDocument)return null;if(b)return this.each(function(){c.offset.setOffset(this,b)});return u.call(this)}}})(jQuery);
-;/*
- * jQuery UI Autocomplete 1.8.11
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Autocomplete
- *
- * Depends:
- *	jquery.ui.core.js
- *	jquery.ui.widget.js
- *	jquery.ui.position.js
- */
-(function(d){var e=0;d.widget("ui.autocomplete",{options:{appendTo:"body",autoFocus:false,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null},pending:0,_create:function(){var a=this,b=this.element[0].ownerDocument,g;this.element.addClass("ui-autocomplete-input").attr("autocomplete","off").attr({role:"textbox","aria-autocomplete":"list","aria-haspopup":"true"}).bind("keydown.autocomplete",function(c){if(!(a.options.disabled||a.element.attr("readonly"))){g=
-false;var f=d.ui.keyCode;switch(c.keyCode){case f.PAGE_UP:a._move("previousPage",c);break;case f.PAGE_DOWN:a._move("nextPage",c);break;case f.UP:a._move("previous",c);c.preventDefault();break;case f.DOWN:a._move("next",c);c.preventDefault();break;case f.ENTER:case f.NUMPAD_ENTER:if(a.menu.active){g=true;c.preventDefault()}case f.TAB:if(!a.menu.active)return;a.menu.select(c);break;case f.ESCAPE:a.element.val(a.term);a.close(c);break;default:clearTimeout(a.searching);a.searching=setTimeout(function(){if(a.term!=
-a.element.val()){a.selectedItem=null;a.search(null,c)}},a.options.delay);break}}}).bind("keypress.autocomplete",function(c){if(g){g=false;c.preventDefault()}}).bind("focus.autocomplete",function(){if(!a.options.disabled){a.selectedItem=null;a.previous=a.element.val()}}).bind("blur.autocomplete",function(c){if(!a.options.disabled){clearTimeout(a.searching);a.closing=setTimeout(function(){a.close(c);a._change(c)},150)}});this._initSource();this.response=function(){return a._response.apply(a,arguments)};
-this.menu=d("<ul></ul>").addClass("ui-autocomplete").appendTo(d(this.options.appendTo||"body",b)[0]).mousedown(function(c){var f=a.menu.element[0];d(c.target).closest(".ui-menu-item").length||setTimeout(function(){d(document).one("mousedown",function(h){h.target!==a.element[0]&&h.target!==f&&!d.ui.contains(f,h.target)&&a.close()})},1);setTimeout(function(){clearTimeout(a.closing)},13)}).menu({focus:function(c,f){f=f.item.data("item.autocomplete");false!==a._trigger("focus",c,{item:f})&&/^key/.test(c.originalEvent.type)&&
-a.element.val(f.value)},selected:function(c,f){var h=f.item.data("item.autocomplete"),i=a.previous;if(a.element[0]!==b.activeElement){a.element.focus();a.previous=i;setTimeout(function(){a.previous=i;a.selectedItem=h},1)}false!==a._trigger("select",c,{item:h})&&a.element.val(h.value);a.term=a.element.val();a.close(c);a.selectedItem=h},blur:function(){a.menu.element.is(":visible")&&a.element.val()!==a.term&&a.element.val(a.term)}}).zIndex(this.element.zIndex()+1).css({top:0,left:0}).hide().data("menu");
-d.fn.bgiframe&&this.menu.element.bgiframe()},destroy:function(){this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete").removeAttr("role").removeAttr("aria-autocomplete").removeAttr("aria-haspopup");this.menu.element.remove();d.Widget.prototype.destroy.call(this)},_setOption:function(a,b){d.Widget.prototype._setOption.apply(this,arguments);a==="source"&&this._initSource();if(a==="appendTo")this.menu.element.appendTo(d(b||"body",this.element[0].ownerDocument)[0]);a==="disabled"&&
-b&&this.xhr&&this.xhr.abort()},_initSource:function(){var a=this,b,g;if(d.isArray(this.options.source)){b=this.options.source;this.source=function(c,f){f(d.ui.autocomplete.filter(b,c.term))}}else if(typeof this.options.source==="string"){g=this.options.source;this.source=function(c,f){a.xhr&&a.xhr.abort();a.xhr=d.ajax({url:g,data:c,dataType:"json",autocompleteRequest:++e,success:function(h){this.autocompleteRequest===e&&f(h)},error:function(){this.autocompleteRequest===e&&f([])}})}}else this.source=
-this.options.source},search:function(a,b){a=a!=null?a:this.element.val();this.term=this.element.val();if(a.length<this.options.minLength)return this.close(b);clearTimeout(this.closing);if(this._trigger("search",b)!==false)return this._search(a)},_search:function(a){this.pending++;this.element.addClass("ui-autocomplete-loading");this.source({term:a},this.response)},_response:function(a){if(!this.options.disabled&&a&&a.length){a=this._normalize(a);this._suggest(a);this._trigger("open")}else this.close();
-this.pending--;this.pending||this.element.removeClass("ui-autocomplete-loading")},close:function(a){clearTimeout(this.closing);if(this.menu.element.is(":visible")){this.menu.element.hide();this.menu.deactivate();this._trigger("close",a)}},_change:function(a){this.previous!==this.element.val()&&this._trigger("change",a,{item:this.selectedItem})},_normalize:function(a){if(a.length&&a[0].label&&a[0].value)return a;return d.map(a,function(b){if(typeof b==="string")return{label:b,value:b};return d.extend({label:b.label||
-b.value,value:b.value||b.label},b)})},_suggest:function(a){var b=this.menu.element.empty().zIndex(this.element.zIndex()+1);this._renderMenu(b,a);this.menu.deactivate();this.menu.refresh();b.show();this._resizeMenu();b.position(d.extend({of:this.element},this.options.position));this.options.autoFocus&&this.menu.next(new d.Event("mouseover"))},_resizeMenu:function(){var a=this.menu.element;a.outerWidth(Math.max(a.width("").outerWidth(),this.element.outerWidth()))},_renderMenu:function(a,b){var g=this;
-d.each(b,function(c,f){g._renderItem(a,f)})},_renderItem:function(a,b){return d("<li></li>").data("item.autocomplete",b).append(d("<a></a>").text(b.label)).appendTo(a)},_move:function(a,b){if(this.menu.element.is(":visible"))if(this.menu.first()&&/^previous/.test(a)||this.menu.last()&&/^next/.test(a)){this.element.val(this.term);this.menu.deactivate()}else this.menu[a](b);else this.search(null,b)},widget:function(){return this.menu.element}});d.extend(d.ui.autocomplete,{escapeRegex:function(a){return a.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,
-"\\$&")},filter:function(a,b){var g=new RegExp(d.ui.autocomplete.escapeRegex(b),"i");return d.grep(a,function(c){return g.test(c.label||c.value||c)})}})})(jQuery);
-(function(d){d.widget("ui.menu",{_create:function(){var e=this;this.element.addClass("ui-menu ui-widget ui-widget-content ui-corner-all").attr({role:"listbox","aria-activedescendant":"ui-active-menuitem"}).click(function(a){if(d(a.target).closest(".ui-menu-item a").length){a.preventDefault();e.select(a)}});this.refresh()},refresh:function(){var e=this;this.element.children("li:not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","menuitem").children("a").addClass("ui-corner-all").attr("tabindex",
--1).mouseenter(function(a){e.activate(a,d(this).parent())}).mouseleave(function(){e.deactivate()})},activate:function(e,a){this.deactivate();if(this.hasScroll()){var b=a.offset().top-this.element.offset().top,g=this.element.attr("scrollTop"),c=this.element.height();if(b<0)this.element.attr("scrollTop",g+b);else b>=c&&this.element.attr("scrollTop",g+b-c+a.height())}this.active=a.eq(0).children("a").addClass("ui-state-hover").attr("id","ui-active-menuitem").end();this._trigger("focus",e,{item:a})},
-deactivate:function(){if(this.active){this.active.children("a").removeClass("ui-state-hover").removeAttr("id");this._trigger("blur");this.active=null}},next:function(e){this.move("next",".ui-menu-item:first",e)},previous:function(e){this.move("prev",".ui-menu-item:last",e)},first:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},last:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},move:function(e,a,b){if(this.active){e=this.active[e+"All"](".ui-menu-item").eq(0);
-e.length?this.activate(b,e):this.activate(b,this.element.children(a))}else this.activate(b,this.element.children(a))},nextPage:function(e){if(this.hasScroll())if(!this.active||this.last())this.activate(e,this.element.children(".ui-menu-item:first"));else{var a=this.active.offset().top,b=this.element.height(),g=this.element.children(".ui-menu-item").filter(function(){var c=d(this).offset().top-a-b+d(this).height();return c<10&&c>-10});g.length||(g=this.element.children(".ui-menu-item:last"));this.activate(e,
-g)}else this.activate(e,this.element.children(".ui-menu-item").filter(!this.active||this.last()?":first":":last"))},previousPage:function(e){if(this.hasScroll())if(!this.active||this.first())this.activate(e,this.element.children(".ui-menu-item:last"));else{var a=this.active.offset().top,b=this.element.height();result=this.element.children(".ui-menu-item").filter(function(){var g=d(this).offset().top-a+b-d(this).height();return g<10&&g>-10});result.length||(result=this.element.children(".ui-menu-item:first"));
-this.activate(e,result)}else this.activate(e,this.element.children(".ui-menu-item").filter(!this.active||this.first()?":last":":first"))},hasScroll:function(){return this.element.height()<this.element.attr("scrollHeight")},select:function(e){this._trigger("selected",e,{item:this.active})}})})(jQuery);
-;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/couchdb/blob/cca309f3/share/www/script/jquery.couch.js
----------------------------------------------------------------------
diff --git a/share/www/script/jquery.couch.js b/share/www/script/jquery.couch.js
deleted file mode 100644
index ffbad34..0000000
--- a/share/www/script/jquery.couch.js
+++ /dev/null
@@ -1,1079 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
-/**
- * @namespace
- * $.couch is used to communicate with a CouchDB server, the server methods can
- * be called directly without creating an instance. Typically all methods are
- * passed an <code>options</code> object which defines a success callback which
- * is called with the data returned from the http request to CouchDB, you can
- * find the other settings that can be used in the <code>options</code> object
- * from <a href="http://api.jquery.com/jQuery.ajax/#jQuery-ajax-settings">
- * jQuery.ajax settings</a>
- * <pre><code>$.couch.activeTasks({
- *   success: function (data) {
- *     console.log(data);
- *   }
- * });</code></pre>
- * Outputs (for example):
- * <pre><code>[
- *  {
- *   "pid" : "<0.11599.0>",
- *   "status" : "Copied 0 of 18369 changes (0%)",
- *   "task" : "recipes",
- *   "type" : "Database Compaction"
- *  }
- *]</code></pre>
- */
-(function($) {
-
-  $.couch = $.couch || {};
-  /** @lends $.couch */
-
-  /**
-   * @private
-   */
-  function encodeDocId(docID) {
-    var parts = docID.split("/");
-    if (parts[0] == "_design") {
-      parts.shift();
-      return "_design/" + encodeURIComponent(parts.join('/'));
-    }
-    return encodeURIComponent(docID);
-  }
-
-  /**
-   * @private
-   */
-
-  var uuidCache = [];
-
-  $.extend($.couch, {
-    urlPrefix: '',
-
-    /**
-     * You can obtain a list of active tasks by using the /_active_tasks URL.
-     * The result is a JSON array of the currently running tasks, with each task
-     * being described with a single object.
-     * @see <a href="http://docs.couchdb.org/en/latest/api/server/common.html#
-     * active-tasks">docs for /_active_tasks</a>
-     * @param {ajaxSettings} options <a href="http://api.jquery.com/jQuery.ajax
-     * /#jQuery-ajax-settings">jQuery ajax settings</a>
-     */
-    activeTasks: function(options) {
-      return ajax(
-        {url: this.urlPrefix + "/_active_tasks"},
-        options,
-        "Active task status could not be retrieved"
-      );
-    },
-
-    /**
-     * Returns a list of all the databases in the CouchDB instance
-     * @see <a href="http://docs.couchdb.org/en/latest/api/server/common.html
-     * #all-dbs">docs for /_all_dbs</a>
-     * @param {ajaxSettings} options <a href="http://api.jquery.com/jQuery.ajax
-     * /#jQuery-ajax-settings">jQuery ajax settings</a>
-     */
-    allDbs: function(options) {
-      return ajax(
-        {url: this.urlPrefix + "/_all_dbs"},
-        options,
-        "An error occurred retrieving the list of all databases"
-      );
-    },
-
-    /**
-     * View and edit the CouchDB configuration, called with just the options
-     * parameter the entire config is returned, you can be more specific by
-     * passing the section and option parameters, if you specify a value that
-     * value will be stored in the configuration.
-     * @see <a href="http://docs.couchdb.org/en/latest/api/server
-     * /configuration.html#config-section-key">docs for /_config</a>
-     * @param {ajaxSettings} options
-     * <a href="http://api.jquery.com/jQuery.ajax/#jQuery-ajax-settings">
-     * jQuery ajax settings</a>
-     * @param {String} [section] the section of the config
-     * @param {String} [option] the particular config option
-     * @param {String} [value] value to be set
-     */
-    config: function(options, section, option, value) {
-      var req = {url: this.urlPrefix + "/_config/"};
-      if (section) {
-        req.url += encodeURIComponent(section) + "/";
-        if (option) {
-          req.url += encodeURIComponent(option);
-        }
-      }
-      if (value === null) {
-        req.type = "DELETE";
-      } else if (value !== undefined) {
-        req.type = "PUT";
-        req.data = toJSON(value);
-        req.contentType = "application/json";
-        req.processData = false
-      }
-
-      return ajax(req, options,
-        "An error occurred retrieving/updating the server configuration"
-      );
-    },
-
-    /**
-     * Returns the session information for the currently logged in user.
-     * @see <a href="http://docs.couchdb.org/en/latest/api/server/authn.html
-     * #get--_session">docs for GET /_session</a>
-     * @param {ajaxSettings} options
-     * <a href="http://api.jquery.com/jQuery.ajax/#jQuery-ajax-settings">
-     * jQuery ajax settings</a>
-     */
-    session: function(options) {
-      options = options || {};
-      return ajax({
-        type: "GET", url: this.urlPrefix + "/_session",
-        beforeSend: function(xhr) {
-            xhr.setRequestHeader('Accept', 'application/json');
-        },
-        complete: function(req) {
-          var resp = $.parseJSON(req.responseText);
-          if (req.status == 200) {
-            if (options.success) options.success(resp);
-          } else if (options.error) {
-            options.error(req.status, resp.error, resp.reason);
-          } else {
-            throw "An error occurred getting session info: " + resp.reason;
-          }
-        }
-      });
-    },
-
-    /**
-     * @private
-     */
-    userDb : function(callback) {
-      return $.couch.session({
-        success : function(resp) {
-          var userDb = $.couch.db(resp.info.authentication_db);
-          callback(userDb);
-        }
-      });
-    },
-
-    /**
-     * Create a new user on the CouchDB server, <code>user_doc</code> is an
-     * object with a <code>name</code> field and other information you want
-     * to store relating to that user, for example
-     * <code>{"name": "daleharvey"}</code>
-     * @param {Object} user_doc Users details
-     * @param {String} password Users password
-     * @param {ajaxSettings} options
-     * <a href="http://api.jquery.com/jQuery.ajax/#jQuery-ajax-settings">
-      * jQuery ajax settings</a>
-     */
-    signup: function(user_doc, password, options) {
-      options = options || {};
-      user_doc.password = password;
-      user_doc.roles = user_doc.roles || [];
-      user_doc.type = "user";
-      var user_prefix = "org.couchdb.user:";
-      user_doc._id = user_doc._id || user_prefix + user_doc.name;
-
-      return $.couch.userDb(function(db) {
-        db.saveDoc(user_doc, options);
-      });
-    },
-
-    /**
-     * Authenticate against CouchDB, the <code>options</code> parameter is
-      *expected to have <code>name</code> and <code>password</code> fields.
-     * @see <a href="http://docs.couchdb.org/en/latest/api/server/authn.html
-     * #post--_session">docs for POST /_session</a>
-     * @param {ajaxSettings} options
-     * <a href="http://api.jquery.com/jQuery.ajax/#jQuery-ajax-settings">
-     * jQuery ajax settings</a>
-     */
-    login: function(options) {
-      options = options || {};
-      return $.ajax({
-        type: "POST", url: this.urlPrefix + "/_session", dataType: "json",
-        data: {name: options.name, password: options.password},
-        beforeSend: function(xhr) {
-            xhr.setRequestHeader('Accept', 'application/json');
-        },
-        complete: function(req) {
-          var resp = $.parseJSON(req.responseText);
-          if (req.status == 200) {
-            if (options.success) options.success(resp);
-          } else if (options.error) {
-            options.error(req.status, resp.error, resp.reason);
-          } else {
-            throw 'An error occurred logging in: ' + resp.reason;
-          }
-        }
-      });
-    },
-
-
-    /**
-     * Delete your current CouchDB user session
-     * @see <a href="http://docs.couchdb.org/en/latest/api/server/authn.html
-     * #delete--_session">docs for DELETE /_session</a>
-     * @param {ajaxSettings} options
-     * <a href="http://api.jquery.com/jQuery.ajax/#jQuery-ajax-settings">
-     * jQuery ajax settings</a>
-     */
-    logout: function(options) {
-      options = options || {};
-      return $.ajax({
-        type: "DELETE", url: this.urlPrefix + "/_session", dataType: "json",
-        username : "_", password : "_",
-        beforeSend: function(xhr) {
-            xhr.setRequestHeader('Accept', 'application/json');
-        },
-        complete: function(req) {
-          var resp = $.parseJSON(req.responseText);
-          if (req.status == 200) {
-            if (options.success) options.success(resp);
-          } else if (options.error) {
-            options.error(req.status, resp.error, resp.reason);
-          } else {
-            throw 'An error occurred logging out: ' + resp.reason;
-          }
-        }
-      });
-    },
-
-    /**
-     * @namespace
-     * $.couch.db is used to communicate with a specific CouchDB database
-     * <pre><code>var $db = $.couch.db("mydatabase");
-     *$db.allApps({
-     *  success: function (data) {
-     *    ... process data ...
-     *  }
-     *});
-     * </code></pre>
-     */
-    db: function(name, db_opts) {
-      db_opts = db_opts || {};
-      var rawDocs = {};
-      function maybeApplyVersion(doc) {
-        if (doc._id && doc._rev && rawDocs[doc._id] &&
-            rawDocs[doc._id].rev == doc._rev) {
-          // todo: can we use commonjs require here?
-          if (typeof Base64 == "undefined") {
-            throw 'Base64 support not found.';
-          } else {
-            doc._attachments = doc._attachments || {};
-            doc._attachments["rev-"+doc._rev.split("-")[0]] = {
-              content_type :"application/json",
-              data : Base64.encode(rawDocs[doc._id].raw)
-            };
-            return true;
-          }
-        }
-      }
-      return /** @lends $.couch.db */{
-        name: name,
-        uri: this.urlPrefix + "/" + encodeURIComponent(name) + "/",
-
-        /**
-         * Request compaction of the specified database.
-         * @see <a href="http://docs.couchdb.org/en/latest/api/database
-         * /compact.html#db-compact">docs for /db/_compact</a>
-         * @param {ajaxSettings} options
-         * <a href="http://api.jquery.com/jQuery.ajax/#jQuery-ajax-settings">
-         * jQuery ajax settings</a>
-         */
-        compact: function(options) {
-          $.extend(options, {successStatus: 202});
-          return ajax({
-              type: "POST", url: this.uri + "_compact",
-              data: "", processData: false
-            },
-            options,
-            "The database could not be compacted"
-          );
-        },
-
-        /**
-         * Cleans up the cached view output on disk for a given view.
-         * @see <a href="http://docs.couchdb.org/en/latest/api/database
-         * /compact.html#db-view-cleanup">docs for /db/_view_cleanup</a>
-         * @param {ajaxSettings} options <a href="http://api.jquery.com/
-         * jQuery.ajax/#jQuery-ajax-settings">jQuery ajax settings</a>
-         */
-        viewCleanup: function(options) {
-          $.extend(options, {successStatus: 202});
-          return ajax({
-              type: "POST", url: this.uri + "_view_cleanup",
-              data: "", processData: false
-            },
-            options,
-            "The views could not be cleaned up"
-          );
-        },
-
-        /**
-         * Compacts the view indexes associated with the specified design
-         * document. You can use this in place of the full database compaction
-         * if you know a specific set of view indexes have been affected by a
-         * recent database change.
-         * @see <a href="http://docs.couchdb.org/en/latest/api/database
-         * /compact.html#db-compact-design-doc">
-         * docs for /db/_compact/design-doc</a>
-         * @param {String} groupname Name of design-doc to compact
-         * @param {ajaxSettings} options <a href="http://api.jquery.com/
-         * jQuery.ajax/#jQuery-ajax-settings">jQuery ajax settings</a>
-         */
-        compactView: function(groupname, options) {
-          $.extend(options, {successStatus: 202});
-          return ajax({
-              type: "POST", url: this.uri + "_compact/" + groupname,
-              data: "", processData: false
-            },
-            options,
-            "The view could not be compacted"
-          );
-        },
-
-        /**
-         * Create a new database
-         * @see <a href="http://docs.couchdb.org/en/latest/api/database
-         * /common.html#put--db">docs for PUT /db/</a>
-         * @param {ajaxSettings} options <a href="http://api.jquery.com/
-         * jQuery.ajax/#jQuery-ajax-settings">jQuery ajax settings</a>
-         */
-        create: function(options) {
-          $.extend(options, {successStatus: 201});
-          return ajax({
-              type: "PUT", url: this.uri, contentType: "application/json",
-              data: "", processData: false
-            },
-            options,
-            "The database could not be created"
-          );
-        },
-
-        /**
-         * Deletes the specified database, and all the documents and
-         * attachments contained within it.
-         * @see <a href="http://docs.couchdb.org/en/latest/api/database
-         * /common.html#delete--db">docs for DELETE /db/</a>
-         * @param {ajaxSettings} options <a href="http://api.jquery.com/
-         * jQuery.ajax/#jQuery-ajax-settings">jQuery ajax settings</a>
-         */
-        drop: function(options) {
-          return ajax(
-            {type: "DELETE", url: this.uri},
-            options,
-            "The database could not be deleted"
-          );
-        },
-
-        /**
-         * Gets information about the specified database.
-         * @see <a href="http://docs.couchdb.org/en/latest/api/database
-         * /common.html#get--db">docs for GET /db/</a>
-         * @param {ajaxSettings} options <a href="http://api.jquery.com/
-         * jQuery.ajax/#jQuery-ajax-settings">jQuery ajax settings</a>
-         */
-        info: function(options) {
-          return ajax(
-            {url: this.uri},
-            options,
-            "Database information could not be retrieved"
-          );
-        },
-
-        /**
-         * @namespace
-         * $.couch.db.changes provides an API for subscribing to the changes
-         * feed
-         * <pre><code>var $changes = $.couch.db("mydatabase").changes();
-         *$changes.onChange = function (data) {
-         *    ... process data ...
-         * }
-         * $changes.stop();
-         * </code></pre>
-         */
-        changes: function(since, options) {
-
-          options = options || {};
-          // set up the promise object within a closure for this handler
-          var timeout = 100, db = this, active = true,
-            listeners = [],
-            xhr = null,
-            promise = /** @lends $.couch.db.changes */ {
-              /**
-               * Add a listener callback
-               * @see <a href="http://docs.couchdb.org/en/latest/api/database
-               * /changes.html#db-changes">docs for /db/_changes</a>
-               * @param {Function} fun Callback function to run when
-               * notified of changes.
-               */
-            onChange : function(fun) {
-              listeners.push(fun);
-            },
-              /**
-               * Stop subscribing to the changes feed
-               */
-            stop : function() {
-              active = false;
-              if (xhr){
-                xhr.abort();
-              }
-            }
-          };
-          // call each listener when there is a change
-          function triggerListeners(resp) {
-            $.each(listeners, function() {
-              this(resp);
-            });
-          }
-          // when there is a change, call any listeners, then check for
-          // another change
-          options.success = function(resp) {
-            timeout = 100;
-            if (active) {
-              since = resp.last_seq;
-              triggerListeners(resp);
-              getChangesSince();
-            }
-          };
-          options.error = function() {
-            if (active) {
-              setTimeout(getChangesSince, timeout);
-              timeout = timeout * 2;
-            }
-          };
-          // actually make the changes request
-          function getChangesSince() {
-            var opts = $.extend({heartbeat : 10 * 1000}, options, {
-              feed : "longpoll",
-              since : since
-            });
-            xhr = ajax(
-              {url: db.uri + "_changes"+encodeOptions(opts)},
-              options,
-              "Error connecting to "+db.uri+"/_changes."
-            );
-          }
-          // start the first request
-          if (since) {
-            getChangesSince();
-          } else {
-            db.info({
-              success : function(info) {
-                since = info.update_seq;
-                getChangesSince();
-              }
-            });
-          }
-          return promise;
-        },
-
-        /**
-         * Fetch all the docs in this db, you can specify an array of keys to
-         * fetch by passing the <code>keys</code> field in the
-         * <code>options</code>
-         * parameter.
-         * @see <a href="http://docs.couchdb.org/en/latest/api/database
-         * /bulk-api.html#db-all-docs">docs for /db/all_docs/</a>
-         * @param {ajaxSettings} options <a href="http://api.jquery.com/
-         * jQuery.ajax/#jQuery-ajax-settings">jQuery ajax settings</a>
-         */
-        allDocs: function(options) {
-          var type = "GET";
-          var data = null;
-          if (options["keys"]) {
-            type = "POST";
-            var keys = options["keys"];
-            delete options["keys"];
-            data = toJSON({ "keys": keys });
-          }
-          return ajax({
-              type: type,
-              data: data,
-              url: this.uri + "_all_docs" + encodeOptions(options)
-            },
-            options,
-            "An error occurred retrieving a list of all documents"
-          );
-        },
-
-        /**
-         * Fetch all the design docs in this db
-         * @param {ajaxSettings} options <a href="http://api.jquery.com/
-         * jQuery.ajax/#jQuery-ajax-settings">jQuery ajax settings</a>
-         */
-        allDesignDocs: function(options) {
-          return this.allDocs($.extend(
-            {startkey:"_design", endkey:"_design0"}, options));
-        },
-
-        /**
-         * Fetch all the design docs with an index.html, <code>options</code>
-         * parameter expects an <code>eachApp</code> field which is a callback
-         * called on each app found.
-         * @param {ajaxSettings} options <a href="http://api.jquery.com/
-         * jQuery.ajax/#jQuery-ajax-settings">jQuery ajax settings</a>
-         */
-        allApps: function(options) {
-          options = options || {};
-          var self = this;
-          if (options.eachApp) {
-            return this.allDesignDocs({
-              success: function(resp) {
-                $.each(resp.rows, function() {
-                  self.openDoc(this.id, {
-                    success: function(ddoc) {
-                      var index, appPath, appName = ddoc._id.split('/');
-                      appName.shift();
-                      appName = appName.join('/');
-                      index = ddoc.couchapp && ddoc.couchapp.index;
-                      if (index) {
-                        appPath = ['', name, ddoc._id, index].join('/');
-                      } else if (ddoc._attachments &&
-                                 ddoc._attachments["index.html"]) {
-                        appPath = ['', name, ddoc._id, "index.html"].join('/');
-                      }
-                      if (appPath) options.eachApp(appName, appPath, ddoc);
-                    }
-                  });
-                });
-              }
-            });
-          } else {
-            throw 'Please provide an eachApp function for allApps()';
-          }
-        },
-
-        /**
-         * Returns the specified doc from the specified db.
-         * @see <a href="http://docs.couchdb.org/en/latest/api/document
-         * /common.html#get--db-docid">docs for GET /db/doc</a>
-         * @param {String} docId id of document to fetch
-         * @param {ajaxSettings} options <a href="http://api.jquery.com/
-         * jQuery.ajax/#jQuery-ajax-settings">jQuery ajax settings</a>
-         * @param {ajaxSettings} ajaxOptions <a href="http://api.jquery.com/
-         * jQuery.ajax/#jQuery-ajax-settings">jQuery ajax settings</a>
-         */
-        openDoc: function(docId, options, ajaxOptions) {
-          options = options || {};
-          if (db_opts.attachPrevRev || options.attachPrevRev) {
-            $.extend(options, {
-              beforeSuccess : function(req, doc) {
-                rawDocs[doc._id] = {
-                  rev : doc._rev,
-                  raw : req.responseText
-                };
-              }
-            });
-          } else {
-            $.extend(options, {
-              beforeSuccess : function(req, doc) {
-                if (doc["jquery.couch.attachPrevRev"]) {
-                  rawDocs[doc._id] = {
-                    rev : doc._rev,
-                    raw : req.responseText
-                  };
-                }
-              }
-            });
-          }
-          return ajax(
-            {url: this.uri + encodeDocId(docId) + encodeOptions(options)},
-            options,
-            "The document could not be retrieved",
-            ajaxOptions
-          );
-        },
-
-        /**
-         * Create a new document in the specified database, using the supplied
-         * JSON document structure. If the JSON structure includes the _id
-         * field, then the document will be created with the specified document
-         * ID. If the _id field is not specified, a new unique ID will be
-         * generated.
-         * @see <a href="http://docs.couchdb.org/en/latest/api/document
-         * /common.html#put--db-docid">docs for PUT /db/doc</a>
-         * @param {String} doc document to save
-         * @param {ajaxSettings} options <a href="http://api.jquery.com/
-         * jQuery.ajax/#jQuery-ajax-settings">jQuery ajax settings</a>
-         */
-        saveDoc: function(doc, options) {
-          options = options || {};
-          var db = this;
-          var beforeSend = fullCommit(options);
-          if (doc._id === undefined) {
-            var method = "POST";
-            var uri = this.uri;
-          } else {
-            var method = "PUT";
-            var uri = this.uri + encodeDocId(doc._id);
-          }
-          var versioned = maybeApplyVersion(doc);
-          return $.ajax({
-            type: method, url: uri + encodeOptions(options),
-            contentType: "application/json",
-            dataType: "json", data: toJSON(doc),
-            beforeSend : beforeSend,
-            complete: function(req) {
-              var resp = $.parseJSON(req.responseText);
-              if (req.status == 200 || req.status == 201 || req.status == 202) {
-                doc._id = resp.id;
-                doc._rev = resp.rev;
-                if (versioned) {
-                  db.openDoc(doc._id, {
-                    attachPrevRev : true,
-                    success : function(d) {
-                      doc._attachments = d._attachments;
-                      if (options.success) options.success(resp);
-                    }
-                  });
-                } else {
-                  if (options.success) options.success(resp);
-                }
-              } else if (options.error) {
-                options.error(req.status, resp.error, resp.reason);
-              } else {
-                throw "The document could not be saved: " + resp.reason;
-              }
-            }
-          });
-        },
-
-        /**
-         * Save a list of documents
-         * @see <a href="http://docs.couchdb.org/en/latest/api/database
-         * /bulk-api.html#db-bulk-docs">docs for /db/_bulk_docs</a>
-         * @param {Object[]} docs List of documents to save
-         * @param {ajaxSettings} options <a href="http://api.jquery.com/
-         * jQuery.ajax/#jQuery-ajax-settings">jQuery ajax settings</a>
-         */
-        bulkSave: function(docs, options) {
-          var beforeSend = fullCommit(options);
-          $.extend(options, {successStatus: 201, beforeSend : beforeSend});
-          return ajax({
-              type: "POST",
-              url: this.uri + "_bulk_docs" + encodeOptions(options),
-              contentType: "application/json", data: toJSON(docs)
-            },
-            options,
-            "The documents could not be saved"
-          );
-        },
-
-        /**
-         * Deletes the specified document from the database. You must supply
-         * the current (latest) revision and <code>id</code> of the document
-         * to delete eg <code>removeDoc({_id:"mydoc", _rev: "1-2345"})</code>
-         * @see <a href="http://docs.couchdb.org/en/latest/api/document
-         * /common.html#delete--db-docid">docs for DELETE /db/doc</a>
-         * @param {Object} doc Document to delete
-         * @param {ajaxSettings} options <a href="http://api.jquery.com/
-         * jQuery.ajax/#jQuery-ajax-settings">jQuery ajax settings</a>
-         */
-        removeDoc: function(doc, options) {
-          return ajax({
-              type: "DELETE",
-              url: this.uri +
-                   encodeDocId(doc._id) +
-                   encodeOptions({rev: doc._rev})
-            },
-            options,
-            "The document could not be deleted"
-          );
-        },
-
-        /**
-         * Remove a set of documents
-         * @see <a href="http://docs.couchdb.org/en/latest/api/database
-         * /bulk-api.html#db-bulk-docs">docs for /db/_bulk_docs</a>
-         * @param {String[]} docs List of document id's to remove
-         * @param {ajaxSettings} options <a href="http://api.jquery.com/
-         * jQuery.ajax/#jQuery-ajax-settings">jQuery ajax settings</a>
-         */
-        bulkRemove: function(docs, options){
-          docs.docs = $.each(
-            docs.docs, function(i, doc){
-              doc._deleted = true;
-            }
-          );
-          $.extend(options, {successStatus: 201});
-          return ajax({
-              type: "POST",
-              url: this.uri + "_bulk_docs" + encodeOptions(options),
-              data: toJSON(docs)
-            },
-            options,
-            "The documents could not be deleted"
-          );
-        },
-
-        /**
-         * The COPY command (which is non-standard HTTP) copies an existing
-         * document to a new or existing document.
-         * @see <a href="http://docs.couchdb.org/en/latest/api/document
-         * /common.html#copy--db-docid">docs for COPY /db/doc</a>
-         * @param {String[]} docId document id to copy
-         * @param {ajaxSettings} options <a href="http://api.jquery.com/
-         * jQuery.ajax/#jQuery-ajax-settings">jQuery ajax settings</a>
-         * @param {ajaxSettings} ajaxOptions <a href="http://api.jquery.com/
-         * jQuery.ajax/#jQuery-ajax-settings">jQuery ajax settings</a>
-         */
-        copyDoc: function(docId, options, ajaxOptions) {
-          ajaxOptions = $.extend(ajaxOptions, {
-            complete: function(req) {
-              var resp = $.parseJSON(req.responseText);
-              if (req.status == 201) {
-                if (options.success) options.success(resp);
-              } else if (options.error) {
-                options.error(req.status, resp.error, resp.reason);
-              } else {
-                throw "The document could not be copied: " + resp.reason;
-              }
-            }
-          });
-          return ajax({
-              type: "COPY",
-              url: this.uri + encodeDocId(docId)
-            },
-            options,
-            "The document could not be copied",
-            ajaxOptions
-          );
-        },
-
-        /**
-         * Creates (and executes) a temporary view based on the view function
-         * supplied in the JSON request.
-         * @see <a href="http://docs.couchdb.org/en/latest/api/database
-         * /temp-views.html#db-temp-view">docs for /db/_temp_view</a>
-         * @param {Function} mapFun Map function
-         * @param {Function} reduceFun Reduce function
-         * @param {String} language Language the map / reduce funs are
-         * implemented in
-         * @param {ajaxSettings} options <a href="http://api.jquery.com/
-         * jQuery.ajax/#jQuery-ajax-settings">jQuery ajax settings</a>
-         */
-        query: function(mapFun, reduceFun, language, options) {
-          language = language || "javascript";
-          if (typeof(mapFun) !== "string") {
-            mapFun = mapFun.toSource ? mapFun.toSource()
-              : "(" + mapFun.toString() + ")";
-          }
-          var body = {language: language, map: mapFun};
-          if (reduceFun != null) {
-            if (typeof(reduceFun) !== "string")
-              reduceFun = reduceFun.toSource ? reduceFun.toSource()
-                : "(" + reduceFun.toString() + ")";
-            body.reduce = reduceFun;
-          }
-          return ajax({
-              type: "POST",
-              url: this.uri + "_temp_view" + encodeOptions(options),
-              contentType: "application/json", data: toJSON(body)
-            },
-            options,
-            "An error occurred querying the database"
-          );
-        },
-
-        /**
-         * Fetch a _list view output, you can specify a list of
-         * <code>keys</code> in the options object to receive only those keys.
-         * @see <a href="http://docs.couchdb.org/en/latest/api/ddoc/render.html
-         * #db-design-design-doc-list-list-name-view-name">
-         * docs for /db/_design/design-doc/_list/list/view</a>
-         * @param {String} list Listname in the form of ddoc/listname
-         * @param {String} view View to run list against
-         * @param {Object} options CouchDB <a href="http://docs.couchdb.org/en
-         * /latest/api/ddoc/views.html#get--db-_design-ddoc-_view-view">
-         * View Options</a>
-         * @param {ajaxSettings} ajaxOptions <a href="http://api.jquery.com/
-         * jQuery.ajax/#jQuery-ajax-settings">jQuery ajax settings</a>
-         */
-        list: function(list, view, options, ajaxOptions) {
-          var list = list.split('/');
-          var options = options || {};
-          var type = 'GET';
-          var data = null;
-          if (options['keys']) {
-            type = 'POST';
-            var keys = options['keys'];
-            delete options['keys'];
-            data = toJSON({'keys': keys });
-          }
-          return ajax({
-              type: type,
-              data: data,
-              url: this.uri + '_design/' + list[0] +
-                   '/_list/' + list[1] + '/' + view + encodeOptions(options)
-              },
-              ajaxOptions, 'An error occurred accessing the list'
-          );
-        },
-
-        /**
-         * Executes the specified view-name from the specified design-doc
-         * design document, you can specify a list of <code>keys</code>
-         * in the options object to receive only those keys.
-         * @see <a href="http://docs.couchdb.org/en/latest/api/ddoc/views.html
-         * #db-design-design-doc-view-view-name">docs for /db/
-         * _design/design-doc/_view/name</a>
-         * @param {String} name View to run list against (string should have
-         * the design-doc name followed by a slash and the view name)
-         * @param {ajaxSettings} options <a href="http://api.jquery.com/
-         * jQuery.ajax/#jQuery-ajax-settings">jQuery ajax settings</a>
-         */
-        view: function(name, options) {
-          var name = name.split('/');
-          var options = options || {};
-          var type = "GET";
-          var data= null;
-          if (options["keys"]) {
-            type = "POST";
-            var keys = options["keys"];
-            delete options["keys"];
-            data = toJSON({ "keys": keys });
-          }
-          return ajax({
-              type: type,
-              data: data,
-              url: this.uri + "_design/" + name[0] +
-                   "/_view/" + name[1] + encodeOptions(options)
-            },
-            options, "An error occurred accessing the view"
-          );
-        },
-
-        /**
-         * Fetch an arbitrary CouchDB database property
-         * @param {String} propName Property name to fetch
-         * @param {ajaxSettings} options <a href="http://api.jquery.com/
-         * jQuery.ajax/#jQuery-ajax-settings">jQuery ajax settings</a>
-         * @param {ajaxSettings} ajaxOptions <a href="http://api.jquery.com/
-         * jQuery.ajax/#jQuery-ajax-settings">jQuery ajax settings</a>
-         */
-        getDbProperty: function(propName, options, ajaxOptions) {
-          return ajax({url: this.uri + propName + encodeOptions(options)},
-            options,
-            "The property could not be retrieved",
-            ajaxOptions
-          );
-        },
-
-        /**
-         * Set an arbitrary CouchDB database property
-         * @param {String} propName Property name to fetch
-         * @param {String} propValue Property value to set
-         * @param {ajaxSettings} options <a href="http://api.jquery.com/
-         * jQuery.ajax/#jQuery-ajax-settings">jQuery ajax settings</a>
-         * @param {ajaxSettings} ajaxOptions <a href="http://api.jquery.com/
-         * jQuery.ajax/#jQuery-ajax-settings">jQuery ajax settings</a>
-         */
-        setDbProperty: function(propName, propValue, options, ajaxOptions) {
-          return ajax({
-            type: "PUT",
-            url: this.uri + propName + encodeOptions(options),
-            data : JSON.stringify(propValue)
-          },
-            options,
-            "The property could not be updated",
-            ajaxOptions
-          );
-        }
-      };
-    },
-
-    encodeDocId: encodeDocId,
-
-    /**
-     * Accessing the root of a CouchDB instance returns meta information about
-     * the instance. The response is a JSON structure containing information
-     * about the server, including a welcome message and the version of the
-     * server.
-     * @see <a href="http://docs.couchdb.org/en/latest/api/server/common.html
-     * #api-server-root">
-     * docs for GET /</a>
-     * @param {ajaxSettings} options <a href="http://api.jquery.com/
-     * jQuery.ajax/#jQuery-ajax-settings">jQuery ajax settings</a>
-     */
-    info: function(options) {
-      return ajax(
-        {url: this.urlPrefix + "/"},
-        options,
-        "Server information could not be retrieved"
-      );
-    },
-
-    /**
-     * Request, configure, or stop, a replication operation.
-     * @see <a href="http://docs.couchdb.org/en/latest/api/server/common.html
-     * #replicate">docs for POST /_replicate</a>
-     * @param {String} source Path or url to source database
-     * @param {String} target Path or url to target database
-     * @param {ajaxSettings} ajaxOptions <a href="http://api.jquery.com/
-     * jQuery.ajax/#jQuery-ajax-settings">jQuery ajax settings</a>
-     * @param {Object} repOpts Additional replication options
-     */
-    replicate: function(source, target, ajaxOptions, repOpts) {
-      repOpts = $.extend({source: source, target: target}, repOpts);
-      if (repOpts.continuous && !repOpts.cancel) {
-        ajaxOptions.successStatus = 202;
-      }
-      return ajax({
-          type: "POST", url: this.urlPrefix + "/_replicate",
-          data: JSON.stringify(repOpts),
-          contentType: "application/json"
-        },
-        ajaxOptions,
-        "Replication failed"
-      );
-    },
-
-    /**
-     * Fetch a new UUID
-     * @see <a href="http://docs.couchdb.org/en/latest/api/server/common.html
-     * #uuids">docs for /_uuids</a>
-     * @param {Integer} cacheNum Number of uuids to keep cached for future use
-     */
-    newUUID: function(cacheNum) {
-      if (cacheNum === undefined) {
-        cacheNum = 1;
-      }
-      if (!uuidCache.length) {
-        ajax({url: this.urlPrefix + "/_uuids", data: {count: cacheNum}, async:
-              false}, {
-            success: function(resp) {
-              uuidCache = resp.uuids;
-            }
-          },
-          "Failed to retrieve UUID batch."
-        );
-      }
-      return uuidCache.shift();
-    }
-  });
-
-  /**
-   * @private
-   */
-  function ajax(obj, options, errorMessage, ajaxOptions) {
-    var timeStart;
-    var defaultAjaxOpts = {
-      contentType: "application/json",
-      headers:{"Accept": "application/json"}
-    };
-
-    options = $.extend({successStatus: 200}, options);
-    ajaxOptions = $.extend(defaultAjaxOpts, ajaxOptions);
-    errorMessage = errorMessage || "Unknown error";
-    timeStart = (new Date()).getTime();
-    return $.ajax($.extend($.extend({
-      type: "GET", dataType: "json", cache : maybeUseCache(),
-      beforeSend: function(xhr){
-        if(ajaxOptions && ajaxOptions.headers){
-          for (var header in ajaxOptions.headers){
-            xhr.setRequestHeader(header, ajaxOptions.headers[header]);
-          }
-        }
-      },
-      complete: function(req) {
-        var reqDuration = (new Date()).getTime() - timeStart;
-        try {
-          var resp = $.parseJSON(req.responseText);
-        } catch(e) {
-          if (options.error) {
-            options.error(req.status, req, e);
-          } else {
-            throw errorMessage + ': ' + e;
-          }
-          return;
-        }
-        if (options.ajaxStart) {
-          options.ajaxStart(resp);
-        }
-        if (req.status == options.successStatus) {
-          if (options.beforeSuccess) options.beforeSuccess(req, resp, reqDuration);
-          if (options.success) options.success(resp, reqDuration);
-        } else if (options.error) {
-          options.error(req.status, resp && resp.error ||
-                        errorMessage, resp && resp.reason || "no response",
-                        reqDuration);
-        } else {
-          throw errorMessage + ": " + resp.reason;
-        }
-      }
-    }, obj), ajaxOptions));
-  }
-
-  /**
-   * @private
-   */
-  function fullCommit(options) {
-    var options = options || {};
-    if (typeof options.ensure_full_commit !== "undefined") {
-      var commit = options.ensure_full_commit;
-      delete options.ensure_full_commit;
-      return function(xhr) {
-        xhr.setRequestHeader('Accept', 'application/json');
-        xhr.setRequestHeader("X-Couch-Full-Commit", commit.toString());
-      };
-    }
-  }
-
-  /**
-   * @private
-   */
-  // Convert a options object to an url query string.
-  // ex: {key:'value',key2:'value2'} becomes '?key="value"&key2="value2"'
-  function encodeOptions(options) {
-    var buf = [];
-    if (typeof(options) === "object" && options !== null) {
-      for (var name in options) {
-        if ($.inArray(name,
-                      ["error", "success", "beforeSuccess", "ajaxStart"]) >= 0)
-          continue;
-        var value = options[name];
-        if ($.inArray(name, ["key", "startkey", "endkey"]) >= 0) {
-          value = toJSON(value);
-        }
-        buf.push(encodeURIComponent(name) + "=" + encodeURIComponent(value));
-      }
-    }
-    return buf.length ? "?" + buf.join("&") : "";
-  }
-
-  /**
-   * @private
-   */
-  function toJSON(obj) {
-    return obj !== null ? JSON.stringify(obj) : null;
-  }
-
-  /**
-   * @private
-   */
-  function maybeUseCache() {
-    if (!navigator){
-      return true;
-    }
-    else if (/(MSIE|Trident)/.test(navigator.userAgent)){
-      return false;
-    }
-    return true;
-  }
-
-})(jQuery);

http://git-wip-us.apache.org/repos/asf/couchdb/blob/cca309f3/share/www/script/jquery.dialog.js
----------------------------------------------------------------------
diff --git a/share/www/script/jquery.dialog.js b/share/www/script/jquery.dialog.js
deleted file mode 100644
index 02c0c49..0000000
--- a/share/www/script/jquery.dialog.js
+++ /dev/null
@@ -1,96 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
-(function($) {
-
-  $.fn.centerBox = function() {
-    return this.each(function() {
-      var s = this.style;
-      s.left = (($(window).width() - $(this).width()) / 2) + "px";
-      s.top = (($(window).height() - $(this).height()) / 2) + "px";
-    });
-  }
-
-  $.showDialog = function(url, options) {
-    options = options || {};
-    options.load = options.load || function() {};
-    options.cancel = options.cancel || function() {};
-    options.validate = options.validate || function() { return true };
-    options.submit = options.submit || function() {};
-
-    var overlay = $('<div id="overlay" style="z-index:1001"></div>')
-      .css("opacity", "0");
-    var dialog = $('<div id="dialog" style="z-index:1002;position:fixed;display:none;"></div>');
-    if ($.browser.msie) {
-      var frame = $('<iframe id="overlay-frame" style="z-index:1000;border:none;margin:0;padding:0;position:absolute;width:100%;height:100%;top:0;left:0" src="javascript:false"></iframe>')
-        .css("opacity", "0").appendTo(document.body);
-      if (parseInt($.browser.version)<7) {
-        dialog.css("position", "absolute");
-        overlay.css("position", "absolute");
-        $("html,body").css({width: "100%", height: "100%"});
-      }
-    }
-    overlay.appendTo(document.body).fadeTo(100, 0.6);
-    dialog.appendTo(document.body).addClass("loading").centerBox().fadeIn(400);
-
-    $(document).keydown(function(e) {
-      if (e.keyCode == 27) dismiss(); // dismiss on escape key
-    });
-    function dismiss() {
-      dialog.fadeOut("fast", function() {
-        $("#dialog, #overlay, #overlay-frame").remove();
-      });
-      $(document).unbind("keydown");
-    }
-    overlay.click(function() { dismiss(); });
-
-    function showError(name, message) {
-      var input = dialog.find(":input[name=" + name + "]");
-      input.addClass("error").next("div.error").remove();
-      $('<div class="error"></div>').text(message).insertAfter(input);
-    }
-
-    $.get(url, function(html) {
-      $(html).appendTo(dialog);
-      dialog.removeClass("loading").addClass("loaded").centerBox().each(function() {
-        options.load(dialog.children()[0]);
-        $(":input:first", dialog).each(function() { this.focus() });
-        $("button.cancel", dialog).click(function() { // dismiss on cancel
-          dismiss();
-          options.cancel();
-        });
-        $("form", dialog).submit(function(e) { // invoke callback on submit
-          e.preventDefault();
-          dialog.find("div.error").remove().end().find(".error").removeClass("error");
-          var data = {};
-          $.each($("form :input", dialog).serializeArray(), function(i, field) {
-            data[field.name] = field.value;
-          });
-          $("form :file", dialog).each(function() {
-            data[this.name] = this.value; // file inputs need special handling
-          });
-          options.submit(data, function callback(errors) {
-            if ($.isEmptyObject(errors)) {
-              dismiss();
-            } else {
-              for (var name in errors) {
-                showError(name, errors[name]);
-              }
-            }
-          });
-          return false;
-        });
-      });
-    });
-  }
-
-})(jQuery);

http://git-wip-us.apache.org/repos/asf/couchdb/blob/cca309f3/share/www/script/jquery.editinline.js
----------------------------------------------------------------------
diff --git a/share/www/script/jquery.editinline.js b/share/www/script/jquery.editinline.js
deleted file mode 100644
index b48607d..0000000
--- a/share/www/script/jquery.editinline.js
+++ /dev/null
@@ -1,114 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
-(function($) {
-
-  function startEditing(elem, options) {
-    var editable = $(elem);
-    var origHtml = editable.html();
-    var origText = options.populate($.trim(editable.text()));
-
-    if (!options.begin.apply(elem, [origText])) {
-      return;
-    }
-
-    var input = options.createInput.apply(elem, [origText])
-      .addClass("editinline").val(origText)
-      .dblclick(function() { return false; })
-      .keydown(function(evt) {
-        switch (evt.keyCode) {
-          case 13: { // return
-            if (!input.is("textarea")) applyChange(evt.keyCode);
-            break;
-          }
-          case 27: { // escape
-            cancelChange(evt.keyCode);
-            break;
-          }
-          case 9: { // tab
-            if (!input.is("textarea")) {
-              applyChange(evt.keyCode);
-              return false;
-            }
-          }
-        }
-      });
-    if (options.acceptOnBlur) {
-      input.blur(function() {
-        return applyChange();
-      });
-    }
-
-    function applyChange(keyCode) {
-      var newText = input.val();
-      if (newText == origText) {
-        cancelChange(keyCode);
-        return true;
-      }
-      if ((!options.allowEmpty && !newText.length) ||
-          !options.validate.apply(elem, [newText, origText])) {
-        input.addClass("invalid");
-        return false;
-      }
-      input.remove();
-      tools.remove();
-      options.accept.apply(elem, [newText, origText]);
-      editable.removeClass("editinline-container");
-      options.end.apply(elem, [keyCode]);
-      return true;
-    }
-
-    function cancelChange(keyCode) {
-      options.cancel.apply(elem, [origText]);
-      editable.html(origHtml).removeClass("editinline-container");
-      options.end.apply(elem, [keyCode]);
-    }
-
-    var tools = $("<span class='editinline-tools'></span>");
-    $("<button type='button' class='apply'></button>")
-      .text(options.acceptLabel).click(applyChange).appendTo(tools);
-    $("<button type='button' class='cancel'></button>")
-      .text(options.cancelLabel).click(cancelChange).appendTo(tools)
-
-    editable.html("").append(tools).append(input)
-      .addClass("editinline-container");
-    options.prepareInput.apply(elem, [input[0]]);
-    input.each(function() { this.focus(); this.select(); });
-  }
-
-  $.fn.makeEditable = function(options) {
-    options = $.extend({
-      allowEmpty: true,
-      acceptLabel: "",
-      cancelLabel: "",
-      toolTip: "Double click to edit",
-      acceptOnBlur: true,
-
-      // callbacks
-      begin: function() { return true },
-      accept: function(newValue, oldValue) {},
-      cancel: function(oldValue) {},
-      createInput: function(value) { return $("<input type='text'>") },
-      prepareInput: function(input) {},
-      end: function(keyCode) {},
-      populate: function(value) { return value },
-      validate: function() { return true }
-    }, options || {});
-
-    return this.each(function() {
-      $(this).attr("title", options.toolTip).dblclick(function() {
-        startEditing(this, options);
-      });
-    });
-  }
-
-})(jQuery);


[34/37] goodbye Futon, old friend <3

Posted by ja...@apache.org.
http://git-wip-us.apache.org/repos/asf/couchdb/blob/cca309f3/share/www/fauxton/img/couchdb-site.png
----------------------------------------------------------------------
diff --git a/share/www/fauxton/img/couchdb-site.png b/share/www/fauxton/img/couchdb-site.png
deleted file mode 100644
index a9b3a99..0000000
Binary files a/share/www/fauxton/img/couchdb-site.png and /dev/null differ

http://git-wip-us.apache.org/repos/asf/couchdb/blob/cca309f3/share/www/fauxton/img/couchdblogo.png
----------------------------------------------------------------------
diff --git a/share/www/fauxton/img/couchdblogo.png b/share/www/fauxton/img/couchdblogo.png
deleted file mode 100644
index cbe991c..0000000
Binary files a/share/www/fauxton/img/couchdblogo.png and /dev/null differ

http://git-wip-us.apache.org/repos/asf/couchdb/blob/cca309f3/share/www/fauxton/img/fontawesome-webfont.eot
----------------------------------------------------------------------
diff --git a/share/www/fauxton/img/fontawesome-webfont.eot b/share/www/fauxton/img/fontawesome-webfont.eot
deleted file mode 100644
index 0662cb9..0000000
Binary files a/share/www/fauxton/img/fontawesome-webfont.eot and /dev/null differ


[35/37] goodbye Futon, old friend <3

Posted by ja...@apache.org.
http://git-wip-us.apache.org/repos/asf/couchdb/blob/cca309f3/share/www/fauxton/css/index.css
----------------------------------------------------------------------
diff --git a/share/www/fauxton/css/index.css b/share/www/fauxton/css/index.css
deleted file mode 100644
index 16bf698..0000000
--- a/share/www/fauxton/css/index.css
+++ /dev/null
@@ -1,37 +0,0 @@
-.task-tabs li{cursor:pointer}table.active-tasks{font-size:16px}.menuDropdown{display:none}.compaction-option{background-color:#F7F7F7;border:1px solid #DDD;margin-bottom:30px;padding:10px}table.config #config-trash{width:5%}table.config #delete-value{text-align:center}button#add-section{float:right}/*!
- *
- * Fauxton less style files
- *
- */ /*!
- * Bootstrap v2.3.2
- *
- * Copyright 2012 Twitter, Inc
- * Licensed under the Apache License v2.0
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Designed and built with all the love in the world @twitter by @mdo and @fat.
- */ .clearfix{*zoom:1}.clearfix:before,.clearfix:after{display:table;content:"";line-height:0}.clearfix:after{clear:both}.hide-text{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.input-block-level{display:block;width:100%;min-height:30px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}article,aside,details,figcaption,figure,footer,header,hgroup,nav,section{display:block}audio,canvas,video{display:inline-block;*display:inline;*zoom:1}audio:not([controls]){display:none}html{font-size:100%;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}a:focus{outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}a:hover,a:active{outline:0}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}img{max-width:100%;width:auto\9;height:auto;vertical-align:middle;border:0;-ms-interpolation-mode:bicubic}#map_canvas img,.google-maps img{max-width
 :none}button,input,select,textarea{margin:0;font-size:100%;vertical-align:middle}button,input{*overflow:visible;line-height:normal}button::-moz-focus-inner,input::-moz-focus-inner{padding:0;border:0}button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}label,select,button,input[type=button],input[type=reset],input[type=submit],input[type=radio],input[type=checkbox]{cursor:pointer}input[type=search]{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;-webkit-appearance:textfield}input[type=search]::-webkit-search-decoration,input[type=search]::-webkit-search-cancel-button{-webkit-appearance:none}textarea{overflow:auto;vertical-align:top}@media print{*{text-shadow:none!important;color:#000!important;background:transparent!important;box-shadow:none!important}a,a:visited{text-decoration:underline}a[href]:after{content:" (" attr(href) ")"}abbr[title]:after{content:" (" attr(title) ")"}.ir a:after,a[href^
 ="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100%!important}@page{margin:.5cm}p,h2,h3{orphans:3;widows:3}h2,h3{page-break-after:avoid}}body{margin:0;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;line-height:20px;color:#333;background-color:#fff}a{color:#e33f3b;text-decoration:none}a:hover,a:focus{color:#b71e1a;text-decoration:underline}.img-rounded{-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px}.img-polaroid{padding:4px;background-color:#fff;border:1px solid #ccc;border:1px solid rgba(0,0,0,.2);-webkit-box-shadow:0 1px 3px rgba(0,0,0,.1);-moz-box-shadow:0 1px 3px rgba(0,0,0,.1);box-shadow:0 1px 3px rgba(0,0,0,.1)}.img-circle{-webkit-border-radius:500px;-moz-border-radius:500px;border-radius:500px}.row{margin-left:-20px;*zoom:1}.row:before,.row:after{display:table;content:"";line-height:0}.row:af
 ter{clear:both}.row:before,.row:after{display:table;content:"";line-height:0}.row:after{clear:both}[class*=span]{float:left;min-height:1px;margin-left:20px}.container,.navbar-static-top .container,.navbar-fixed-top .container,.navbar-fixed-bottom .container{width:940px}.span12{width:940px}.span11{width:860px}.span10{width:780px}.span9{width:700px}.span8{width:620px}.span7{width:540px}.span6{width:460px}.span5{width:380px}.span4{width:300px}.span3{width:220px}.span2{width:140px}.span1{width:60px}.offset12{margin-left:980px}.offset11{margin-left:900px}.offset10{margin-left:820px}.offset9{margin-left:740px}.offset8{margin-left:660px}.offset7{margin-left:580px}.offset6{margin-left:500px}.offset5{margin-left:420px}.offset4{margin-left:340px}.offset3{margin-left:260px}.offset2{margin-left:180px}.offset1{margin-left:100px}.row{margin-left:-20px;*zoom:1}.row:before,.row:after{display:table;content:"";line-height:0}.row:after{clear:both}.row:before,.row:after{display:table;content:"";line-he
 ight:0}.row:after{clear:both}[class*=span]{float:left;min-height:1px;margin-left:20px}.container,.navbar-static-top .container,.navbar-fixed-top .container,.navbar-fixed-bottom .container{width:940px}.span12{width:940px}.span11{width:860px}.span10{width:780px}.span9{width:700px}.span8{width:620px}.span7{width:540px}.span6{width:460px}.span5{width:380px}.span4{width:300px}.span3{width:220px}.span2{width:140px}.span1{width:60px}.offset12{margin-left:980px}.offset11{margin-left:900px}.offset10{margin-left:820px}.offset9{margin-left:740px}.offset8{margin-left:660px}.offset7{margin-left:580px}.offset6{margin-left:500px}.offset5{margin-left:420px}.offset4{margin-left:340px}.offset3{margin-left:260px}.offset2{margin-left:180px}.offset1{margin-left:100px}.row-fluid{width:100%;*zoom:1}.row-fluid:before,.row-fluid:after{display:table;content:"";line-height:0}.row-fluid:after{clear:both}.row-fluid:before,.row-fluid:after{display:table;content:"";line-height:0}.row-fluid:after{clear:both}.row-f
 luid [class*=span]{display:block;width:100%;min-height:30px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;float:left;margin-left:2.127659574468085%;*margin-left:2.074468085106383%}.row-fluid [class*=span]:first-child{margin-left:0}.row-fluid .controls-row [class*=span]+[class*=span]{margin-left:2.127659574468085%}.row-fluid .span12{width:100%;*width:99.94680851063829%}.row-fluid .span11{width:91.48936170212765%;*width:91.43617021276594%}.row-fluid .span10{width:82.97872340425532%;*width:82.92553191489361%}.row-fluid .span9{width:74.46808510638297%;*width:74.41489361702126%}.row-fluid .span8{width:65.95744680851064%;*width:65.90425531914893%}.row-fluid .span7{width:57.44680851063829%;*width:57.39361702127659%}.row-fluid .span6{width:48.93617021276595%;*width:48.88297872340425%}.row-fluid .span5{width:40.42553191489362%;*width:40.37234042553192%}.row-fluid .span4{width:31.914893617021278%;*width:31.861702127659576%}.row-fluid .span3{width:23.4042553191
 48934%;*width:23.351063829787233%}.row-fluid .span2{width:14.893617021276595%;*width:14.840425531914894%}.row-fluid .span1{width:6.382978723404255%;*width:6.329787234042553%}.row-fluid .offset12{margin-left:104.25531914893617%;*margin-left:104.14893617021275%}.row-fluid .offset12:first-child{margin-left:102.12765957446808%;*margin-left:102.02127659574467%}.row-fluid .offset11{margin-left:95.74468085106382%;*margin-left:95.6382978723404%}.row-fluid .offset11:first-child{margin-left:93.61702127659574%;*margin-left:93.51063829787232%}.row-fluid .offset10{margin-left:87.23404255319149%;*margin-left:87.12765957446807%}.row-fluid .offset10:first-child{margin-left:85.1063829787234%;*margin-left:84.99999999999999%}.row-fluid .offset9{margin-left:78.72340425531914%;*margin-left:78.61702127659572%}.row-fluid .offset9:first-child{margin-left:76.59574468085106%;*margin-left:76.48936170212764%}.row-fluid .offset8{margin-left:70.2127659574468%;*margin-left:70.10638297872339%}.row-fluid .offset8:f
 irst-child{margin-left:68.08510638297872%;*margin-left:67.9787234042553%}.row-fluid .offset7{margin-left:61.70212765957446%;*margin-left:61.59574468085106%}.row-fluid .offset7:first-child{margin-left:59.574468085106375%;*margin-left:59.46808510638297%}.row-fluid .offset6{margin-left:53.191489361702125%;*margin-left:53.085106382978715%}.row-fluid .offset6:first-child{margin-left:51.063829787234035%;*margin-left:50.95744680851063%}.row-fluid .offset5{margin-left:44.68085106382979%;*margin-left:44.57446808510638%}.row-fluid .offset5:first-child{margin-left:42.5531914893617%;*margin-left:42.4468085106383%}.row-fluid .offset4{margin-left:36.170212765957444%;*margin-left:36.06382978723405%}.row-fluid .offset4:first-child{margin-left:34.04255319148936%;*margin-left:33.93617021276596%}.row-fluid .offset3{margin-left:27.659574468085104%;*margin-left:27.5531914893617%}.row-fluid .offset3:first-child{margin-left:25.53191489361702%;*margin-left:25.425531914893618%}.row-fluid .offset2{margin-lef
 t:19.148936170212764%;*margin-left:19.04255319148936%}.row-fluid .offset2:first-child{margin-left:17.02127659574468%;*margin-left:16.914893617021278%}.row-fluid .offset1{margin-left:10.638297872340425%;*margin-left:10.53191489361702%}.row-fluid .offset1:first-child{margin-left:8.51063829787234%;*margin-left:8.404255319148938%}.row-fluid{width:100%;*zoom:1}.row-fluid:before,.row-fluid:after{display:table;content:"";line-height:0}.row-fluid:after{clear:both}.row-fluid:before,.row-fluid:after{display:table;content:"";line-height:0}.row-fluid:after{clear:both}.row-fluid [class*=span]{display:block;width:100%;min-height:30px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;float:left;margin-left:2.127659574468085%;*margin-left:2.074468085106383%}.row-fluid [class*=span]:first-child{margin-left:0}.row-fluid .controls-row [class*=span]+[class*=span]{margin-left:2.127659574468085%}.row-fluid .span12{width:100%;*width:99.94680851063829%}.row-fluid .span11{width:
 91.48936170212765%;*width:91.43617021276594%}.row-fluid .span10{width:82.97872340425532%;*width:82.92553191489361%}.row-fluid .span9{width:74.46808510638297%;*width:74.41489361702126%}.row-fluid .span8{width:65.95744680851064%;*width:65.90425531914893%}.row-fluid .span7{width:57.44680851063829%;*width:57.39361702127659%}.row-fluid .span6{width:48.93617021276595%;*width:48.88297872340425%}.row-fluid .span5{width:40.42553191489362%;*width:40.37234042553192%}.row-fluid .span4{width:31.914893617021278%;*width:31.861702127659576%}.row-fluid .span3{width:23.404255319148934%;*width:23.351063829787233%}.row-fluid .span2{width:14.893617021276595%;*width:14.840425531914894%}.row-fluid .span1{width:6.382978723404255%;*width:6.329787234042553%}.row-fluid .offset12{margin-left:104.25531914893617%;*margin-left:104.14893617021275%}.row-fluid .offset12:first-child{margin-left:102.12765957446808%;*margin-left:102.02127659574467%}.row-fluid .offset11{margin-left:95.74468085106382%;*margin-left:95.638
 2978723404%}.row-fluid .offset11:first-child{margin-left:93.61702127659574%;*margin-left:93.51063829787232%}.row-fluid .offset10{margin-left:87.23404255319149%;*margin-left:87.12765957446807%}.row-fluid .offset10:first-child{margin-left:85.1063829787234%;*margin-left:84.99999999999999%}.row-fluid .offset9{margin-left:78.72340425531914%;*margin-left:78.61702127659572%}.row-fluid .offset9:first-child{margin-left:76.59574468085106%;*margin-left:76.48936170212764%}.row-fluid .offset8{margin-left:70.2127659574468%;*margin-left:70.10638297872339%}.row-fluid .offset8:first-child{margin-left:68.08510638297872%;*margin-left:67.9787234042553%}.row-fluid .offset7{margin-left:61.70212765957446%;*margin-left:61.59574468085106%}.row-fluid .offset7:first-child{margin-left:59.574468085106375%;*margin-left:59.46808510638297%}.row-fluid .offset6{margin-left:53.191489361702125%;*margin-left:53.085106382978715%}.row-fluid .offset6:first-child{margin-left:51.063829787234035%;*margin-left:50.957446808510
 63%}.row-fluid .offset5{margin-left:44.68085106382979%;*margin-left:44.57446808510638%}.row-fluid .offset5:first-child{margin-left:42.5531914893617%;*margin-left:42.4468085106383%}.row-fluid .offset4{margin-left:36.170212765957444%;*margin-left:36.06382978723405%}.row-fluid .offset4:first-child{margin-left:34.04255319148936%;*margin-left:33.93617021276596%}.row-fluid .offset3{margin-left:27.659574468085104%;*margin-left:27.5531914893617%}.row-fluid .offset3:first-child{margin-left:25.53191489361702%;*margin-left:25.425531914893618%}.row-fluid .offset2{margin-left:19.148936170212764%;*margin-left:19.04255319148936%}.row-fluid .offset2:first-child{margin-left:17.02127659574468%;*margin-left:16.914893617021278%}.row-fluid .offset1{margin-left:10.638297872340425%;*margin-left:10.53191489361702%}.row-fluid .offset1:first-child{margin-left:8.51063829787234%;*margin-left:8.404255319148938%}[class*=span].hide,.row-fluid [class*=span].hide{display:none}[class*=span].pull-right,.row-fluid [cl
 ass*=span].pull-right{float:right}.container{margin-right:auto;margin-left:auto;*zoom:1}.container:before,.container:after{display:table;content:"";line-height:0}.container:after{clear:both}.container:before,.container:after{display:table;content:"";line-height:0}.container:after{clear:both}.container:before,.container:after{display:table;content:"";line-height:0}.container:after{clear:both}.container:before,.container:after{display:table;content:"";line-height:0}.container:after{clear:both}.container-fluid{padding-right:20px;padding-left:20px;*zoom:1}.container-fluid:before,.container-fluid:after{display:table;content:"";line-height:0}.container-fluid:after{clear:both}.container-fluid:before,.container-fluid:after{display:table;content:"";line-height:0}.container-fluid:after{clear:both}p{margin:0 0 10px}.lead{margin-bottom:20px;font-size:21px;font-weight:200;line-height:30px}small{font-size:85%}strong{font-weight:700}em{font-style:italic}cite{font-style:normal}.muted{color:#999}a.m
 uted:hover,a.muted:focus{color:gray}.text-warning{color:#c09853}a.text-warning:hover,a.text-warning:focus{color:#a47e3c}.text-error{color:#b94a48}a.text-error:hover,a.text-error:focus{color:#953b39}.text-info{color:#3a87ad}a.text-info:hover,a.text-info:focus{color:#2d6987}.text-success{color:#468847}a.text-success:hover,a.text-success:focus{color:#356635}.text-left{text-align:left}.text-right{text-align:right}.text-center{text-align:center}h1,h2,h3,h4,h5,h6{margin:10px 0;font-family:inherit;font-weight:700;line-height:20px;color:inherit;text-rendering:optimizelegibility}h1 small,h2 small,h3 small,h4 small,h5 small,h6 small{font-weight:400;line-height:1;color:#999}h1,h2,h3{line-height:40px}h1{font-size:38.5px}h2{font-size:31.5px}h3{font-size:24.5px}h4{font-size:17.5px}h5{font-size:14px}h6{font-size:11.9px}h1 small{font-size:24.5px}h2 small{font-size:17.5px}h3 small{font-size:14px}h4 small{font-size:14px}.page-header{padding-bottom:9px;margin:20px 0 30px;border-bottom:1px solid #eee}u
 l,ol{padding:0;margin:0 0 10px 25px}ul ul,ul ol,ol ol,ol ul{margin-bottom:0}li{line-height:20px}ul.unstyled,ol.unstyled{margin-left:0;list-style:none}ul.inline,ol.inline{margin-left:0;list-style:none}ul.inline>li,ol.inline>li{display:inline-block;*display:inline;*zoom:1;padding-left:5px;padding-right:5px}dl{margin-bottom:20px}dt,dd{line-height:20px}dt{font-weight:700}dd{margin-left:10px}.dl-horizontal{*zoom:1}.dl-horizontal:before,.dl-horizontal:after{display:table;content:"";line-height:0}.dl-horizontal:after{clear:both}.dl-horizontal:before,.dl-horizontal:after{display:table;content:"";line-height:0}.dl-horizontal:after{clear:both}.dl-horizontal dt{float:left;width:160px;clear:left;text-align:right;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dl-horizontal dd{margin-left:180px}hr{margin:20px 0;border:0;border-top:1px solid #eee;border-bottom:1px solid #fff}abbr[title],abbr[data-original-title]{cursor:help;border-bottom:1px dotted #999}abbr.initialism{font-size:90%;te
 xt-transform:uppercase}blockquote{padding:0 0 0 15px;margin:0 0 20px;border-left:5px solid #eee}blockquote p{margin-bottom:0;font-size:17.5px;font-weight:300;line-height:1.25}blockquote small{display:block;line-height:20px;color:#999}blockquote small:before{content:'\2014 \00A0'}blockquote.pull-right{float:right;padding-right:15px;padding-left:0;border-right:5px solid #eee;border-left:0}blockquote.pull-right p,blockquote.pull-right small{text-align:right}blockquote.pull-right small:before{content:''}blockquote.pull-right small:after{content:'\00A0 \2014'}q:before,q:after,blockquote:before,blockquote:after{content:""}address{display:block;margin-bottom:20px;font-style:normal;line-height:20px}code,pre{padding:0 3px 2px;font-family:Monaco,Menlo,Consolas,"Courier New",monospace;font-size:12px;color:#333;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}code{padding:2px 4px;color:#d14;background-color:#f7f7f9;border:1px solid #e1e1e8;white-space:nowrap}pre{display:block;
 padding:9.5px;margin:0 0 10px;font-size:13px;line-height:20px;word-break:break-all;word-wrap:break-word;white-space:pre;white-space:pre-wrap;background-color:#f5f5f5;border:1px solid #ccc;border:1px solid rgba(0,0,0,.15);-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}pre.prettyprint{margin-bottom:20px}pre code{padding:0;color:inherit;white-space:pre;white-space:pre-wrap;background-color:transparent;border:0}.pre-scrollable{max-height:340px;overflow-y:scroll}form{margin:0 0 20px}fieldset{padding:0;margin:0;border:0}legend{display:block;width:100%;padding:0;margin-bottom:20px;font-size:21px;line-height:40px;color:#333;border:0;border-bottom:1px solid #e5e5e5}legend small{font-size:15px;color:#999}label,input,button,select,textarea{font-size:14px;font-weight:400;line-height:20px}input,button,select,textarea{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif}label{display:block;margin-bottom:5px}select,textarea,input[type=text],input[type=password],input[type=da
 tetime],input[type=datetime-local],input[type=date],input[type=month],input[type=time],input[type=week],input[type=number],input[type=email],input[type=url],input[type=search],input[type=tel],input[type=color],.uneditable-input{display:inline-block;height:20px;padding:4px 6px;margin-bottom:10px;font-size:14px;line-height:20px;color:#555;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;vertical-align:middle}input,textarea,.uneditable-input{width:206px}textarea{height:auto}textarea,input[type=text],input[type=password],input[type=datetime],input[type=datetime-local],input[type=date],input[type=month],input[type=time],input[type=week],input[type=number],input[type=email],input[type=url],input[type=search],input[type=tel],input[type=color],.uneditable-input{background-color:#fff;border:1px solid #ccc;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075);-webkit-transition:border 
 linear .2s,box-shadow linear .2s;-moz-transition:border linear .2s,box-shadow linear .2s;-o-transition:border linear .2s,box-shadow linear .2s;transition:border linear .2s,box-shadow linear .2s}textarea:focus,input[type=text]:focus,input[type=password]:focus,input[type=datetime]:focus,input[type=datetime-local]:focus,input[type=date]:focus,input[type=month]:focus,input[type=time]:focus,input[type=week]:focus,input[type=number]:focus,input[type=email]:focus,input[type=url]:focus,input[type=search]:focus,input[type=tel]:focus,input[type=color]:focus,.uneditable-input:focus{border-color:rgba(82,168,236,.8);outline:0;outline:thin dotted \9;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(82,168,236,.6);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(82,168,236,.6);box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(82,168,236,.6)}input[type=radio],input[type=checkbox]{margin:4px 0 0;*margin-top:0;margin-top:1px \9;line-height:normal}input[type=file],in
 put[type=image],input[type=submit],input[type=reset],input[type=button],input[type=radio],input[type=checkbox]{width:auto}select,input[type=file]{height:30px;*margin-top:4px;line-height:30px}select{width:220px;border:1px solid #ccc;background-color:#fff}select[multiple],select[size]{height:auto}select:focus,input[type=file]:focus,input[type=radio]:focus,input[type=checkbox]:focus{outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.uneditable-input,.uneditable-textarea{color:#999;background-color:#fcfcfc;border-color:#ccc;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,.025);-moz-box-shadow:inset 0 1px 2px rgba(0,0,0,.025);box-shadow:inset 0 1px 2px rgba(0,0,0,.025);cursor:not-allowed}.uneditable-input{overflow:hidden;white-space:nowrap}.uneditable-textarea{width:auto;height:auto}input:-moz-placeholder,textarea:-moz-placeholder{color:#999}input:-ms-input-placeholder,textarea:-ms-input-placeholder{color:#999}input::-webkit-input-placeholder,textarea::
 -webkit-input-placeholder{color:#999}input:-moz-placeholder,textarea:-moz-placeholder{color:#999}input:-ms-input-placeholder,textarea:-ms-input-placeholder{color:#999}input::-webkit-input-placeholder,textarea::-webkit-input-placeholder{color:#999}.radio,.checkbox{min-height:20px;padding-left:20px}.radio input[type=radio],.checkbox input[type=checkbox]{float:left;margin-left:-20px}.controls>.radio:first-child,.controls>.checkbox:first-child{padding-top:5px}.radio.inline,.checkbox.inline{display:inline-block;padding-top:5px;margin-bottom:0;vertical-align:middle}.radio.inline+.radio.inline,.checkbox.inline+.checkbox.inline{margin-left:10px}.input-mini{width:60px}.input-small{width:90px}.input-medium{width:150px}.input-large{width:210px}.input-xlarge{width:270px}.input-xxlarge{width:530px}input[class*=span],select[class*=span],textarea[class*=span],.uneditable-input[class*=span],.row-fluid input[class*=span],.row-fluid select[class*=span],.row-fluid textarea[class*=span],.row-fluid .une
 ditable-input[class*=span]{float:none;margin-left:0}.input-append input[class*=span],.input-append .uneditable-input[class*=span],.input-prepend input[class*=span],.input-prepend .uneditable-input[class*=span],.row-fluid input[class*=span],.row-fluid select[class*=span],.row-fluid textarea[class*=span],.row-fluid .uneditable-input[class*=span],.row-fluid .input-prepend [class*=span],.row-fluid .input-append [class*=span]{display:inline-block}input,textarea,.uneditable-input{margin-left:0}.controls-row [class*=span]+[class*=span]{margin-left:20px}input.span12,textarea.span12,.uneditable-input.span12{width:926px}input.span11,textarea.span11,.uneditable-input.span11{width:846px}input.span10,textarea.span10,.uneditable-input.span10{width:766px}input.span9,textarea.span9,.uneditable-input.span9{width:686px}input.span8,textarea.span8,.uneditable-input.span8{width:606px}input.span7,textarea.span7,.uneditable-input.span7{width:526px}input.span6,textarea.span6,.uneditable-input.span6{width:4
 46px}input.span5,textarea.span5,.uneditable-input.span5{width:366px}input.span4,textarea.span4,.uneditable-input.span4{width:286px}input.span3,textarea.span3,.uneditable-input.span3{width:206px}input.span2,textarea.span2,.uneditable-input.span2{width:126px}input.span1,textarea.span1,.uneditable-input.span1{width:46px}input,textarea,.uneditable-input{margin-left:0}.controls-row [class*=span]+[class*=span]{margin-left:20px}input.span12,textarea.span12,.uneditable-input.span12{width:926px}input.span11,textarea.span11,.uneditable-input.span11{width:846px}input.span10,textarea.span10,.uneditable-input.span10{width:766px}input.span9,textarea.span9,.uneditable-input.span9{width:686px}input.span8,textarea.span8,.uneditable-input.span8{width:606px}input.span7,textarea.span7,.uneditable-input.span7{width:526px}input.span6,textarea.span6,.uneditable-input.span6{width:446px}input.span5,textarea.span5,.uneditable-input.span5{width:366px}input.span4,textarea.span4,.uneditable-input.span4{width:28
 6px}input.span3,textarea.span3,.uneditable-input.span3{width:206px}input.span2,textarea.span2,.uneditable-input.span2{width:126px}input.span1,textarea.span1,.uneditable-input.span1{width:46px}.controls-row{*zoom:1}.controls-row:before,.controls-row:after{display:table;content:"";line-height:0}.controls-row:after{clear:both}.controls-row:before,.controls-row:after{display:table;content:"";line-height:0}.controls-row:after{clear:both}.controls-row [class*=span],.row-fluid .controls-row [class*=span]{float:left}.controls-row .checkbox[class*=span],.controls-row .radio[class*=span]{padding-top:5px}input[disabled],select[disabled],textarea[disabled],input[readonly],select[readonly],textarea[readonly]{cursor:not-allowed;background-color:#eee}input[type=radio][disabled],input[type=checkbox][disabled],input[type=radio][readonly],input[type=checkbox][readonly]{background-color:transparent}.control-group.warning .control-label,.control-group.warning .help-block,.control-group.warning .help-in
 line{color:#c09853}.control-group.warning .checkbox,.control-group.warning .radio,.control-group.warning input,.control-group.warning select,.control-group.warning textarea{color:#c09853}.control-group.warning input,.control-group.warning select,.control-group.warning textarea{border-color:#c09853;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.control-group.warning input:focus,.control-group.warning select:focus,.control-group.warning textarea:focus{border-color:#a47e3c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #dbc59e;-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #dbc59e;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #dbc59e}.control-group.warning .input-prepend .add-on,.control-group.warning .input-append .add-on{color:#c09853;background-color:#fcf8e3;border-color:#c09853}.control-group.warning .control-label,.control-group.warning .help-block,.contr
 ol-group.warning .help-inline{color:#c09853}.control-group.warning .checkbox,.control-group.warning .radio,.control-group.warning input,.control-group.warning select,.control-group.warning textarea{color:#c09853}.control-group.warning input,.control-group.warning select,.control-group.warning textarea{border-color:#c09853;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.control-group.warning input:focus,.control-group.warning select:focus,.control-group.warning textarea:focus{border-color:#a47e3c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #dbc59e;-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #dbc59e;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #dbc59e}.control-group.warning .input-prepend .add-on,.control-group.warning .input-append .add-on{color:#c09853;background-color:#fcf8e3;border-color:#c09853}.control-group.error .control-label,.control-group.err
 or .help-block,.control-group.error .help-inline{color:#b94a48}.control-group.error .checkbox,.control-group.error .radio,.control-group.error input,.control-group.error select,.control-group.error textarea{color:#b94a48}.control-group.error input,.control-group.error select,.control-group.error textarea{border-color:#b94a48;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.control-group.error input:focus,.control-group.error select:focus,.control-group.error textarea:focus{border-color:#953b39;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #d59392;-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #d59392;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #d59392}.control-group.error .input-prepend .add-on,.control-group.error .input-append .add-on{color:#b94a48;background-color:#f2dede;border-color:#b94a48}.control-group.error .control-label,.control-group.error .hel
 p-block,.control-group.error .help-inline{color:#b94a48}.control-group.error .checkbox,.control-group.error .radio,.control-group.error input,.control-group.error select,.control-group.error textarea{color:#b94a48}.control-group.error input,.control-group.error select,.control-group.error textarea{border-color:#b94a48;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.control-group.error input:focus,.control-group.error select:focus,.control-group.error textarea:focus{border-color:#953b39;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #d59392;-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #d59392;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #d59392}.control-group.error .input-prepend .add-on,.control-group.error .input-append .add-on{color:#b94a48;background-color:#f2dede;border-color:#b94a48}.control-group.success .control-label,.control-group.success .help-b
 lock,.control-group.success .help-inline{color:#468847}.control-group.success .checkbox,.control-group.success .radio,.control-group.success input,.control-group.success select,.control-group.success textarea{color:#468847}.control-group.success input,.control-group.success select,.control-group.success textarea{border-color:#468847;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.control-group.success input:focus,.control-group.success select:focus,.control-group.success textarea:focus{border-color:#356635;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #7aba7b;-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #7aba7b;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #7aba7b}.control-group.success .input-prepend .add-on,.control-group.success .input-append .add-on{color:#468847;background-color:#dff0d8;border-color:#468847}.control-group.success .control-label,.cont
 rol-group.success .help-block,.control-group.success .help-inline{color:#468847}.control-group.success .checkbox,.control-group.success .radio,.control-group.success input,.control-group.success select,.control-group.success textarea{color:#468847}.control-group.success input,.control-group.success select,.control-group.success textarea{border-color:#468847;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.control-group.success input:focus,.control-group.success select:focus,.control-group.success textarea:focus{border-color:#356635;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #7aba7b;-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #7aba7b;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #7aba7b}.control-group.success .input-prepend .add-on,.control-group.success .input-append .add-on{color:#468847;background-color:#dff0d8;border-color:#468847}.control-group.inf
 o .control-label,.control-group.info .help-block,.control-group.info .help-inline{color:#3a87ad}.control-group.info .checkbox,.control-group.info .radio,.control-group.info input,.control-group.info select,.control-group.info textarea{color:#3a87ad}.control-group.info input,.control-group.info select,.control-group.info textarea{border-color:#3a87ad;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.control-group.info input:focus,.control-group.info select:focus,.control-group.info textarea:focus{border-color:#2d6987;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #7ab5d3;-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #7ab5d3;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #7ab5d3}.control-group.info .input-prepend .add-on,.control-group.info .input-append .add-on{color:#3a87ad;background-color:#d9edf7;border-color:#3a87ad}.control-group.info .control-label,.contr
 ol-group.info .help-block,.control-group.info .help-inline{color:#3a87ad}.control-group.info .checkbox,.control-group.info .radio,.control-group.info input,.control-group.info select,.control-group.info textarea{color:#3a87ad}.control-group.info input,.control-group.info select,.control-group.info textarea{border-color:#3a87ad;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.control-group.info input:focus,.control-group.info select:focus,.control-group.info textarea:focus{border-color:#2d6987;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #7ab5d3;-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #7ab5d3;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #7ab5d3}.control-group.info .input-prepend .add-on,.control-group.info .input-append .add-on{color:#3a87ad;background-color:#d9edf7;border-color:#3a87ad}input:focus:invalid,textarea:focus:invalid,select:focus:invalid{
 color:#b94a48;border-color:#ee5f5b}input:focus:invalid:focus,textarea:focus:invalid:focus,select:focus:invalid:focus{border-color:#e9322d;-webkit-box-shadow:0 0 6px #f8b9b7;-moz-box-shadow:0 0 6px #f8b9b7;box-shadow:0 0 6px #f8b9b7}.form-actions{padding:19px 20px 20px;margin-top:20px;margin-bottom:20px;background-color:#f5f5f5;border-top:1px solid #e5e5e5;*zoom:1}.form-actions:before,.form-actions:after{display:table;content:"";line-height:0}.form-actions:after{clear:both}.form-actions:before,.form-actions:after{display:table;content:"";line-height:0}.form-actions:after{clear:both}.help-block,.help-inline{color:#595959}.help-block{display:block;margin-bottom:10px}.help-inline{display:inline-block;*display:inline;*zoom:1;vertical-align:middle;padding-left:5px}.input-append,.input-prepend{display:inline-block;margin-bottom:10px;vertical-align:middle;font-size:0;white-space:nowrap}.input-append input,.input-prepend input,.input-append select,.input-prepend select,.input-append .unedita
 ble-input,.input-prepend .uneditable-input,.input-append .dropdown-menu,.input-prepend .dropdown-menu,.input-append .popover,.input-prepend .popover{font-size:14px}.input-append input,.input-prepend input,.input-append select,.input-prepend select,.input-append .uneditable-input,.input-prepend .uneditable-input{position:relative;margin-bottom:0;*margin-left:0;vertical-align:top;-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0}.input-append input:focus,.input-prepend input:focus,.input-append select:focus,.input-prepend select:focus,.input-append .uneditable-input:focus,.input-prepend .uneditable-input:focus{z-index:2}.input-append .add-on,.input-prepend .add-on{display:inline-block;width:auto;height:20px;min-width:16px;padding:4px 5px;font-size:14px;font-weight:400;line-height:20px;text-align:center;text-shadow:0 1px 0 #fff;background-color:#eee;border:1px solid #ccc}.input-append .add-on,.input-prepend .add-on,.input-append .btn,.input-prep
 end .btn,.input-append .btn-group>.dropdown-toggle,.input-prepend .btn-group>.dropdown-toggle{vertical-align:top;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.input-append .active,.input-prepend .active{background-color:#cdf355;border-color:#7fa30c}.input-prepend .add-on,.input-prepend .btn{margin-right:-1px}.input-prepend .add-on:first-child,.input-prepend .btn:first-child{-webkit-border-radius:4px 0 0 4px;-moz-border-radius:4px 0 0 4px;border-radius:4px 0 0 4px}.input-append input,.input-append select,.input-append .uneditable-input{-webkit-border-radius:4px 0 0 4px;-moz-border-radius:4px 0 0 4px;border-radius:4px 0 0 4px}.input-append input+.btn-group .btn:last-child,.input-append select+.btn-group .btn:last-child,.input-append .uneditable-input+.btn-group .btn:last-child{-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0}.input-append .add-on,.input-append .btn,.input-append .btn-group{margin-left:-1px}.input-append .add-on
 :last-child,.input-append .btn:last-child,.input-append .btn-group:last-child>.dropdown-toggle{-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0}.input-prepend.input-append input,.input-prepend.input-append select,.input-prepend.input-append .uneditable-input{-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.input-prepend.input-append input+.btn-group .btn,.input-prepend.input-append select+.btn-group .btn,.input-prepend.input-append .uneditable-input+.btn-group .btn{-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0}.input-prepend.input-append .add-on:first-child,.input-prepend.input-append .btn:first-child{margin-right:-1px;-webkit-border-radius:4px 0 0 4px;-moz-border-radius:4px 0 0 4px;border-radius:4px 0 0 4px}.input-prepend.input-append .add-on:last-child,.input-prepend.input-append .btn:last-child{margin-left:-1px;-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border
 -radius:0 4px 4px 0}.input-prepend.input-append .btn-group:first-child{margin-left:0}input.search-query{padding-right:14px;padding-right:4px \9;padding-left:14px;padding-left:4px \9;margin-bottom:0;-webkit-border-radius:15px;-moz-border-radius:15px;border-radius:15px}.form-search .input-append .search-query,.form-search .input-prepend .search-query{-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.form-search .input-append .search-query{-webkit-border-radius:14px 0 0 14px;-moz-border-radius:14px 0 0 14px;border-radius:14px 0 0 14px}.form-search .input-append .btn{-webkit-border-radius:0 14px 14px 0;-moz-border-radius:0 14px 14px 0;border-radius:0 14px 14px 0}.form-search .input-prepend .search-query{-webkit-border-radius:0 14px 14px 0;-moz-border-radius:0 14px 14px 0;border-radius:0 14px 14px 0}.form-search .input-prepend .btn{-webkit-border-radius:14px 0 0 14px;-moz-border-radius:14px 0 0 14px;border-radius:14px 0 0 14px}.form-search input,.form-inline input,.form-horiz
 ontal input,.form-search textarea,.form-inline textarea,.form-horizontal textarea,.form-search select,.form-inline select,.form-horizontal select,.form-search .help-inline,.form-inline .help-inline,.form-horizontal .help-inline,.form-search .uneditable-input,.form-inline .uneditable-input,.form-horizontal .uneditable-input,.form-search .input-prepend,.form-inline .input-prepend,.form-horizontal .input-prepend,.form-search .input-append,.form-inline .input-append,.form-horizontal .input-append{display:inline-block;*display:inline;*zoom:1;margin-bottom:0;vertical-align:middle}.form-search .hide,.form-inline .hide,.form-horizontal .hide{display:none}.form-search label,.form-inline label,.form-search .btn-group,.form-inline .btn-group{display:inline-block}.form-search .input-append,.form-inline .input-append,.form-search .input-prepend,.form-inline .input-prepend{margin-bottom:0}.form-search .radio,.form-search .checkbox,.form-inline .radio,.form-inline .checkbox{padding-left:0;margin-b
 ottom:0;vertical-align:middle}.form-search .radio input[type=radio],.form-search .checkbox input[type=checkbox],.form-inline .radio input[type=radio],.form-inline .checkbox input[type=checkbox]{float:left;margin-right:3px;margin-left:0}.control-group{margin-bottom:10px}legend+.control-group{margin-top:20px;-webkit-margin-top-collapse:separate}.form-horizontal .control-group{margin-bottom:20px;*zoom:1}.form-horizontal .control-group:before,.form-horizontal .control-group:after{display:table;content:"";line-height:0}.form-horizontal .control-group:after{clear:both}.form-horizontal .control-group:before,.form-horizontal .control-group:after{display:table;content:"";line-height:0}.form-horizontal .control-group:after{clear:both}.form-horizontal .control-label{float:left;width:160px;padding-top:5px;text-align:right}.form-horizontal .controls{*display:inline-block;*padding-left:20px;margin-left:180px;*margin-left:0}.form-horizontal .controls:first-child{*padding-left:180px}.form-horizonta
 l .help-block{margin-bottom:0}.form-horizontal input+.help-block,.form-horizontal select+.help-block,.form-horizontal textarea+.help-block,.form-horizontal .uneditable-input+.help-block,.form-horizontal .input-prepend+.help-block,.form-horizontal .input-append+.help-block{margin-top:10px}.form-horizontal .form-actions{padding-left:180px}table{max-width:100%;background-color:transparent;border-collapse:collapse;border-spacing:0}.table{width:100%;margin-bottom:20px}.table th,.table td{padding:8px;line-height:20px;text-align:left;vertical-align:top;border-top:1px solid #ddd}.table th{font-weight:700}.table thead th{vertical-align:bottom}.table caption+thead tr:first-child th,.table caption+thead tr:first-child td,.table colgroup+thead tr:first-child th,.table colgroup+thead tr:first-child td,.table thead:first-child tr:first-child th,.table thead:first-child tr:first-child td{border-top:0}.table tbody+tbody{border-top:2px solid #ddd}.table .table{background-color:#fff}.table-condensed 
 th,.table-condensed td{padding:4px 5px}.table-bordered{border:1px solid #ddd;border-collapse:separate;*border-collapse:collapse;border-left:0;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.table-bordered th,.table-bordered td{border-left:1px solid #ddd}.table-bordered caption+thead tr:first-child th,.table-bordered caption+tbody tr:first-child th,.table-bordered caption+tbody tr:first-child td,.table-bordered colgroup+thead tr:first-child th,.table-bordered colgroup+tbody tr:first-child th,.table-bordered colgroup+tbody tr:first-child td,.table-bordered thead:first-child tr:first-child th,.table-bordered tbody:first-child tr:first-child th,.table-bordered tbody:first-child tr:first-child td{border-top:0}.table-bordered thead:first-child tr:first-child>th:first-child,.table-bordered tbody:first-child tr:first-child>td:first-child,.table-bordered tbody:first-child tr:first-child>th:first-child{-webkit-border-top-left-radius:4px;-moz-border-radius-topleft:4px;borde
 r-top-left-radius:4px}.table-bordered thead:first-child tr:first-child>th:last-child,.table-bordered tbody:first-child tr:first-child>td:last-child,.table-bordered tbody:first-child tr:first-child>th:last-child{-webkit-border-top-right-radius:4px;-moz-border-radius-topright:4px;border-top-right-radius:4px}.table-bordered thead:last-child tr:last-child>th:first-child,.table-bordered tbody:last-child tr:last-child>td:first-child,.table-bordered tbody:last-child tr:last-child>th:first-child,.table-bordered tfoot:last-child tr:last-child>td:first-child,.table-bordered tfoot:last-child tr:last-child>th:first-child{-webkit-border-bottom-left-radius:4px;-moz-border-radius-bottomleft:4px;border-bottom-left-radius:4px}.table-bordered thead:last-child tr:last-child>th:last-child,.table-bordered tbody:last-child tr:last-child>td:last-child,.table-bordered tbody:last-child tr:last-child>th:last-child,.table-bordered tfoot:last-child tr:last-child>td:last-child,.table-bordered tfoot:last-child t
 r:last-child>th:last-child{-webkit-border-bottom-right-radius:4px;-moz-border-radius-bottomright:4px;border-bottom-right-radius:4px}.table-bordered tfoot+tbody:last-child tr:last-child td:first-child{-webkit-border-bottom-left-radius:0;-moz-border-radius-bottomleft:0;border-bottom-left-radius:0}.table-bordered tfoot+tbody:last-child tr:last-child td:last-child{-webkit-border-bottom-right-radius:0;-moz-border-radius-bottomright:0;border-bottom-right-radius:0}.table-bordered caption+thead tr:first-child th:first-child,.table-bordered caption+tbody tr:first-child td:first-child,.table-bordered colgroup+thead tr:first-child th:first-child,.table-bordered colgroup+tbody tr:first-child td:first-child{-webkit-border-top-left-radius:4px;-moz-border-radius-topleft:4px;border-top-left-radius:4px}.table-bordered caption+thead tr:first-child th:last-child,.table-bordered caption+tbody tr:first-child td:last-child,.table-bordered colgroup+thead tr:first-child th:last-child,.table-bordered colgro
 up+tbody tr:first-child td:last-child{-webkit-border-top-right-radius:4px;-moz-border-radius-topright:4px;border-top-right-radius:4px}.table-striped tbody>tr:nth-child(odd)>td,.table-striped tbody>tr:nth-child(odd)>th{background-color:#f9f9f9}.table-hover tbody tr:hover>td,.table-hover tbody tr:hover>th{background-color:#f5f5f5}table td[class*=span],table th[class*=span],.row-fluid table td[class*=span],.row-fluid table th[class*=span]{display:table-cell;float:none;margin-left:0}.table td.span1,.table th.span1{float:none;width:44px;margin-left:0}.table td.span2,.table th.span2{float:none;width:124px;margin-left:0}.table td.span3,.table th.span3{float:none;width:204px;margin-left:0}.table td.span4,.table th.span4{float:none;width:284px;margin-left:0}.table td.span5,.table th.span5{float:none;width:364px;margin-left:0}.table td.span6,.table th.span6{float:none;width:444px;margin-left:0}.table td.span7,.table th.span7{float:none;width:524px;margin-left:0}.table td.span8,.table th.span8
 {float:none;width:604px;margin-left:0}.table td.span9,.table th.span9{float:none;width:684px;margin-left:0}.table td.span10,.table th.span10{float:none;width:764px;margin-left:0}.table td.span11,.table th.span11{float:none;width:844px;margin-left:0}.table td.span12,.table th.span12{float:none;width:924px;margin-left:0}.table tbody tr.success>td{background-color:#dff0d8}.table tbody tr.error>td{background-color:#f2dede}.table tbody tr.warning>td{background-color:#fcf8e3}.table tbody tr.info>td{background-color:#d9edf7}.table-hover tbody tr.success:hover>td{background-color:#d0e9c6}.table-hover tbody tr.error:hover>td{background-color:#ebcccc}.table-hover tbody tr.warning:hover>td{background-color:#faf2cc}.table-hover tbody tr.info:hover>td{background-color:#c4e3f3}/*!
- *  Font Awesome 3.2.1
- *  the iconic font designed for Bootstrap
- *  ------------------------------------------------------------------------------
- *  The full suite of pictographic icons, examples, and documentation can be
- *  found at http://fontawesome.io.  Stay up to date on Twitter at
- *  http://twitter.com/fontawesome.
- *
- *  License
- *  ------------------------------------------------------------------------------
- *  - The Font Awesome font is licensed under SIL OFL 1.1 -
- *    http://scripts.sil.org/OFL
- *  - Font Awesome CSS, LESS, and SASS files are licensed under MIT License -
- *    http://opensource.org/licenses/mit-license.html
- *  - Font Awesome documentation licensed under CC BY 3.0 -
- *    http://creativecommons.org/licenses/by/3.0/
- *  - Attribution is no longer required in Font Awesome 3.0, but much appreciated:
- *    "Font Awesome by Dave Gandy - http://fontawesome.io"
- *
- *  Author - Dave Gandy
- *  ------------------------------------------------------------------------------
- *  Email: dave@fontawesome.io
- *  Twitter: http://twitter.com/davegandy
- *  Work: Lead Product Designer @ Kyruus - http://kyruus.com
- */ @font-face{font-family:FontAwesome;src:url(//netdna.bootstrapcdn.com/font-awesome/3.2.1/font/fontawesome-webfont.eot?v=3.2.1);src:url(//netdna.bootstrapcdn.com/font-awesome/3.2.1/font/fontawesome-webfont.eot?#iefix&v=3.2.1) format('embedded-opentype'),url(//netdna.bootstrapcdn.com/font-awesome/3.2.1/font/fontawesome-webfont.woff?v=3.2.1) format('woff'),url(//netdna.bootstrapcdn.com/font-awesome/3.2.1/font/fontawesome-webfont.ttf?v=3.2.1) format('truetype'),url(//netdna.bootstrapcdn.com/font-awesome/3.2.1/font/fontawesome-webfont.svg#fontawesomeregular?v=3.2.1) format('svg');font-weight:400;font-style:normal}[class^=icon-],[class*=" icon-"]{font-family:FontAwesome;font-weight:400;font-style:normal;text-decoration:inherit;-webkit-font-smoothing:antialiased;*margin-right:.3em}[class^=icon-]:before,[class*=" icon-"]:before{text-decoration:inherit;display:inline-block;speak:none}.icon-large:before{vertical-align:-10%;font-size:1.3333333333333333em}a [class^=icon-],a [class*=" icon-"]
 {display:inline}[class^=icon-].icon-fixed-width,[class*=" icon-"].icon-fixed-width{display:inline-block;width:1.1428571428571428em;text-align:right;padding-right:.2857142857142857em}[class^=icon-].icon-fixed-width.icon-large,[class*=" icon-"].icon-fixed-width.icon-large{width:1.4285714285714286em}.icons-ul{margin-left:2.142857142857143em;list-style-type:none}.icons-ul>li{position:relative}.icons-ul .icon-li{position:absolute;left:-2.142857142857143em;width:2.142857142857143em;text-align:center;line-height:inherit}[class^=icon-].hide,[class*=" icon-"].hide{display:none}.icon-muted{color:#eee}.icon-light{color:#fff}.icon-dark{color:#333}.icon-border{border:solid 1px #eee;padding:.2em .25em .15em;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.icon-2x{font-size:2em}.icon-2x.icon-border{border-width:2px;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.icon-3x{font-size:3em}.icon-3x.icon-border{border-width:3px;-webkit-border-radius:5px;-moz-border-
 radius:5px;border-radius:5px}.icon-4x{font-size:4em}.icon-4x.icon-border{border-width:4px;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px}.icon-5x{font-size:5em}.icon-5x.icon-border{border-width:5px;-webkit-border-radius:7px;-moz-border-radius:7px;border-radius:7px}.pull-right{float:right}.pull-left{float:left}[class^=icon-].pull-left,[class*=" icon-"].pull-left{margin-right:.3em}[class^=icon-].pull-right,[class*=" icon-"].pull-right{margin-left:.3em}[class^=icon-],[class*=" icon-"]{display:inline;width:auto;height:auto;line-height:normal;vertical-align:baseline;background-image:none;background-position:0 0;background-repeat:repeat;margin-top:0}.icon-white,.nav-pills>.active>a>[class^=icon-],.nav-pills>.active>a>[class*=" icon-"],.nav-list>.active>a>[class^=icon-],.nav-list>.active>a>[class*=" icon-"],.navbar-inverse .nav>.active>a>[class^=icon-],.navbar-inverse .nav>.active>a>[class*=" icon-"],.dropdown-menu>li>a:hover>[class^=icon-],.dropdown-menu>li>a:hover>[cl
 ass*=" icon-"],.dropdown-menu>.active>a>[class^=icon-],.dropdown-menu>.active>a>[class*=" icon-"],.dropdown-submenu:hover>a>[class^=icon-],.dropdown-submenu:hover>a>[class*=" icon-"]{background-image:none}.btn [class^=icon-].icon-large,.nav [class^=icon-].icon-large,.btn [class*=" icon-"].icon-large,.nav [class*=" icon-"].icon-large{line-height:.9em}.btn [class^=icon-].icon-spin,.nav [class^=icon-].icon-spin,.btn [class*=" icon-"].icon-spin,.nav [class*=" icon-"].icon-spin{display:inline-block}.nav-tabs [class^=icon-],.nav-pills [class^=icon-],.nav-tabs [class*=" icon-"],.nav-pills [class*=" icon-"],.nav-tabs [class^=icon-].icon-large,.nav-pills [class^=icon-].icon-large,.nav-tabs [class*=" icon-"].icon-large,.nav-pills [class*=" icon-"].icon-large{line-height:.9em}.btn [class^=icon-].pull-left.icon-2x,.btn [class*=" icon-"].pull-left.icon-2x,.btn [class^=icon-].pull-right.icon-2x,.btn [class*=" icon-"].pull-right.icon-2x{margin-top:.18em}.btn [class^=icon-].icon-spin.icon-large,.bt
 n [class*=" icon-"].icon-spin.icon-large{line-height:.8em}.btn.btn-small [class^=icon-].pull-left.icon-2x,.btn.btn-small [class*=" icon-"].pull-left.icon-2x,.btn.btn-small [class^=icon-].pull-right.icon-2x,.btn.btn-small [class*=" icon-"].pull-right.icon-2x{margin-top:.25em}.btn.btn-large [class^=icon-],.btn.btn-large [class*=" icon-"]{margin-top:0}.btn.btn-large [class^=icon-].pull-left.icon-2x,.btn.btn-large [class*=" icon-"].pull-left.icon-2x,.btn.btn-large [class^=icon-].pull-right.icon-2x,.btn.btn-large [class*=" icon-"].pull-right.icon-2x{margin-top:.05em}.btn.btn-large [class^=icon-].pull-left.icon-2x,.btn.btn-large [class*=" icon-"].pull-left.icon-2x{margin-right:.2em}.btn.btn-large [class^=icon-].pull-right.icon-2x,.btn.btn-large [class*=" icon-"].pull-right.icon-2x{margin-left:.2em}.nav-list [class^=icon-],.nav-list [class*=" icon-"]{line-height:inherit}.icon-stack{position:relative;display:inline-block;width:2em;height:2em;line-height:2em;vertical-align:-35%}.icon-stack [
 class^=icon-],.icon-stack [class*=" icon-"]{display:block;text-align:center;position:absolute;width:100%;height:100%;font-size:1em;line-height:inherit;*line-height:2em}.icon-stack .icon-stack-base{font-size:2em;*line-height:1em}.icon-spin{display:inline-block;-moz-animation:spin 2s infinite linear;-o-animation:spin 2s infinite linear;-webkit-animation:spin 2s infinite linear;animation:spin 2s infinite linear}a .icon-stack,a .icon-spin{display:inline-block;text-decoration:none}@-moz-keyframes spin{0%{-moz-transform:rotate(0deg)}100%{-moz-transform:rotate(359deg)}}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg)}}@-o-keyframes spin{0%{-o-transform:rotate(0deg)}100%{-o-transform:rotate(359deg)}}@-ms-keyframes spin{0%{-ms-transform:rotate(0deg)}100%{-ms-transform:rotate(359deg)}}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(359deg)}}.icon-rotate-90:before{-webkit-transform:rotate(90deg);-moz-transform:rotate(90deg);-ms-tra
 nsform:rotate(90deg);-o-transform:rotate(90deg);transform:rotate(90deg);filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=1)}.icon-rotate-180:before{-webkit-transform:rotate(180deg);-moz-transform:rotate(180deg);-ms-transform:rotate(180deg);-o-transform:rotate(180deg);transform:rotate(180deg);filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=2)}.icon-rotate-270:before{-webkit-transform:rotate(270deg);-moz-transform:rotate(270deg);-ms-transform:rotate(270deg);-o-transform:rotate(270deg);transform:rotate(270deg);filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=3)}.icon-flip-horizontal:before{-webkit-transform:scale(-1,1);-moz-transform:scale(-1,1);-ms-transform:scale(-1,1);-o-transform:scale(-1,1);transform:scale(-1,1)}.icon-flip-vertical:before{-webkit-transform:scale(1,-1);-moz-transform:scale(1,-1);-ms-transform:scale(1,-1);-o-transform:scale(1,-1);transform:scale(1,-1)}a .icon-rotate-90:before,a .icon-rotate-180:before,a .icon-rotate-270:before,a 
 .icon-flip-horizontal:before,a .icon-flip-vertical:before{display:inline-block}.icon-glass:before{content:"\f000"}.icon-music:before{content:"\f001"}.icon-search:before{content:"\f002"}.icon-envelope-alt:before{content:"\f003"}.icon-heart:before{content:"\f004"}.icon-star:before{content:"\f005"}.icon-star-empty:before{content:"\f006"}.icon-user:before{content:"\f007"}.icon-film:before{content:"\f008"}.icon-th-large:before{content:"\f009"}.icon-th:before{content:"\f00a"}.icon-th-list:before{content:"\f00b"}.icon-ok:before{content:"\f00c"}.icon-remove:before{content:"\f00d"}.icon-zoom-in:before{content:"\f00e"}.icon-zoom-out:before{content:"\f010"}.icon-power-off:before,.icon-off:before{content:"\f011"}.icon-signal:before{content:"\f012"}.icon-gear:before,.icon-cog:before{content:"\f013"}.icon-trash:before{content:"\f014"}.icon-home:before{content:"\f015"}.icon-file-alt:before{content:"\f016"}.icon-time:before{content:"\f017"}.icon-road:before{content:"\f018"}.icon-download-alt:before
 {content:"\f019"}.icon-download:before{content:"\f01a"}.icon-upload:before{content:"\f01b"}.icon-inbox:before{content:"\f01c"}.icon-play-circle:before{content:"\f01d"}.icon-rotate-right:before,.icon-repeat:before{content:"\f01e"}.icon-refresh:before{content:"\f021"}.icon-list-alt:before{content:"\f022"}.icon-lock:before{content:"\f023"}.icon-flag:before{content:"\f024"}.icon-headphones:before{content:"\f025"}.icon-volume-off:before{content:"\f026"}.icon-volume-down:before{content:"\f027"}.icon-volume-up:before{content:"\f028"}.icon-qrcode:before{content:"\f029"}.icon-barcode:before{content:"\f02a"}.icon-tag:before{content:"\f02b"}.icon-tags:before{content:"\f02c"}.icon-book:before{content:"\f02d"}.icon-bookmark:before{content:"\f02e"}.icon-print:before{content:"\f02f"}.icon-camera:before{content:"\f030"}.icon-font:before{content:"\f031"}.icon-bold:before{content:"\f032"}.icon-italic:before{content:"\f033"}.icon-text-height:before{content:"\f034"}.icon-text-width:before{content:"\f03
 5"}.icon-align-left:before{content:"\f036"}.icon-align-center:before{content:"\f037"}.icon-align-right:before{content:"\f038"}.icon-align-justify:before{content:"\f039"}.icon-list:before{content:"\f03a"}.icon-indent-left:before{content:"\f03b"}.icon-indent-right:before{content:"\f03c"}.icon-facetime-video:before{content:"\f03d"}.icon-picture:before{content:"\f03e"}.icon-pencil:before{content:"\f040"}.icon-map-marker:before{content:"\f041"}.icon-adjust:before{content:"\f042"}.icon-tint:before{content:"\f043"}.icon-edit:before{content:"\f044"}.icon-share:before{content:"\f045"}.icon-check:before{content:"\f046"}.icon-move:before{content:"\f047"}.icon-step-backward:before{content:"\f048"}.icon-fast-backward:before{content:"\f049"}.icon-backward:before{content:"\f04a"}.icon-play:before{content:"\f04b"}.icon-pause:before{content:"\f04c"}.icon-stop:before{content:"\f04d"}.icon-forward:before{content:"\f04e"}.icon-fast-forward:before{content:"\f050"}.icon-step-forward:before{content:"\f051
 "}.icon-eject:before{content:"\f052"}.icon-chevron-left:before{content:"\f053"}.icon-chevron-right:before{content:"\f054"}.icon-plus-sign:before{content:"\f055"}.icon-minus-sign:before{content:"\f056"}.icon-remove-sign:before{content:"\f057"}.icon-ok-sign:before{content:"\f058"}.icon-question-sign:before{content:"\f059"}.icon-info-sign:before{content:"\f05a"}.icon-screenshot:before{content:"\f05b"}.icon-remove-circle:before{content:"\f05c"}.icon-ok-circle:before{content:"\f05d"}.icon-ban-circle:before{content:"\f05e"}.icon-arrow-left:before{content:"\f060"}.icon-arrow-right:before{content:"\f061"}.icon-arrow-up:before{content:"\f062"}.icon-arrow-down:before{content:"\f063"}.icon-mail-forward:before,.icon-share-alt:before{content:"\f064"}.icon-resize-full:before{content:"\f065"}.icon-resize-small:before{content:"\f066"}.icon-plus:before{content:"\f067"}.icon-minus:before{content:"\f068"}.icon-asterisk:before{content:"\f069"}.icon-exclamation-sign:before{content:"\f06a"}.icon-gift:bef
 ore{content:"\f06b"}.icon-leaf:before{content:"\f06c"}.icon-fire:before{content:"\f06d"}.icon-eye-open:before{content:"\f06e"}.icon-eye-close:before{content:"\f070"}.icon-warning-sign:before{content:"\f071"}.icon-plane:before{content:"\f072"}.icon-calendar:before{content:"\f073"}.icon-random:before{content:"\f074"}.icon-comment:before{content:"\f075"}.icon-magnet:before{content:"\f076"}.icon-chevron-up:before{content:"\f077"}.icon-chevron-down:before{content:"\f078"}.icon-retweet:before{content:"\f079"}.icon-shopping-cart:before{content:"\f07a"}.icon-folder-close:before{content:"\f07b"}.icon-folder-open:before{content:"\f07c"}.icon-resize-vertical:before{content:"\f07d"}.icon-resize-horizontal:before{content:"\f07e"}.icon-bar-chart:before{content:"\f080"}.icon-twitter-sign:before{content:"\f081"}.icon-facebook-sign:before{content:"\f082"}.icon-camera-retro:before{content:"\f083"}.icon-key:before{content:"\f084"}.icon-gears:before,.icon-cogs:before{content:"\f085"}.icon-comments:befo
 re{content:"\f086"}.icon-thumbs-up-alt:before{content:"\f087"}.icon-thumbs-down-alt:before{content:"\f088"}.icon-star-half:before{content:"\f089"}.icon-heart-empty:before{content:"\f08a"}.icon-signout:before{content:"\f08b"}.icon-linkedin-sign:before{content:"\f08c"}.icon-pushpin:before{content:"\f08d"}.icon-external-link:before{content:"\f08e"}.icon-signin:before{content:"\f090"}.icon-trophy:before{content:"\f091"}.icon-github-sign:before{content:"\f092"}.icon-upload-alt:before{content:"\f093"}.icon-lemon:before{content:"\f094"}.icon-phone:before{content:"\f095"}.icon-unchecked:before,.icon-check-empty:before{content:"\f096"}.icon-bookmark-empty:before{content:"\f097"}.icon-phone-sign:before{content:"\f098"}.icon-twitter:before{content:"\f099"}.icon-facebook:before{content:"\f09a"}.icon-github:before{content:"\f09b"}.icon-unlock:before{content:"\f09c"}.icon-credit-card:before{content:"\f09d"}.icon-rss:before{content:"\f09e"}.icon-hdd:before{content:"\f0a0"}.icon-bullhorn:before{con
 tent:"\f0a1"}.icon-bell:before{content:"\f0a2"}.icon-certificate:before{content:"\f0a3"}.icon-hand-right:before{content:"\f0a4"}.icon-hand-left:before{content:"\f0a5"}.icon-hand-up:before{content:"\f0a6"}.icon-hand-down:before{content:"\f0a7"}.icon-circle-arrow-left:before{content:"\f0a8"}.icon-circle-arrow-right:before{content:"\f0a9"}.icon-circle-arrow-up:before{content:"\f0aa"}.icon-circle-arrow-down:before{content:"\f0ab"}.icon-globe:before{content:"\f0ac"}.icon-wrench:before{content:"\f0ad"}.icon-tasks:before{content:"\f0ae"}.icon-filter:before{content:"\f0b0"}.icon-briefcase:before{content:"\f0b1"}.icon-fullscreen:before{content:"\f0b2"}.icon-group:before{content:"\f0c0"}.icon-link:before{content:"\f0c1"}.icon-cloud:before{content:"\f0c2"}.icon-beaker:before{content:"\f0c3"}.icon-cut:before{content:"\f0c4"}.icon-copy:before{content:"\f0c5"}.icon-paperclip:before,.icon-paper-clip:before{content:"\f0c6"}.icon-save:before{content:"\f0c7"}.icon-sign-blank:before{content:"\f0c8"}.i
 con-reorder:before{content:"\f0c9"}.icon-list-ul:before{content:"\f0ca"}.icon-list-ol:before{content:"\f0cb"}.icon-strikethrough:before{content:"\f0cc"}.icon-underline:before{content:"\f0cd"}.icon-table:before{content:"\f0ce"}.icon-magic:before{content:"\f0d0"}.icon-truck:before{content:"\f0d1"}.icon-pinterest:before{content:"\f0d2"}.icon-pinterest-sign:before{content:"\f0d3"}.icon-google-plus-sign:before{content:"\f0d4"}.icon-google-plus:before{content:"\f0d5"}.icon-money:before{content:"\f0d6"}.icon-caret-down:before{content:"\f0d7"}.icon-caret-up:before{content:"\f0d8"}.icon-caret-left:before{content:"\f0d9"}.icon-caret-right:before{content:"\f0da"}.icon-columns:before{content:"\f0db"}.icon-sort:before{content:"\f0dc"}.icon-sort-down:before{content:"\f0dd"}.icon-sort-up:before{content:"\f0de"}.icon-envelope:before{content:"\f0e0"}.icon-linkedin:before{content:"\f0e1"}.icon-rotate-left:before,.icon-undo:before{content:"\f0e2"}.icon-legal:before{content:"\f0e3"}.icon-dashboard:befo
 re{content:"\f0e4"}.icon-comment-alt:before{content:"\f0e5"}.icon-comments-alt:before{content:"\f0e6"}.icon-bolt:before{content:"\f0e7"}.icon-sitemap:before{content:"\f0e8"}.icon-umbrella:before{content:"\f0e9"}.icon-paste:before{content:"\f0ea"}.icon-lightbulb:before{content:"\f0eb"}.icon-exchange:before{content:"\f0ec"}.icon-cloud-download:before{content:"\f0ed"}.icon-cloud-upload:before{content:"\f0ee"}.icon-user-md:before{content:"\f0f0"}.icon-stethoscope:before{content:"\f0f1"}.icon-suitcase:before{content:"\f0f2"}.icon-bell-alt:before{content:"\f0f3"}.icon-coffee:before{content:"\f0f4"}.icon-food:before{content:"\f0f5"}.icon-file-text-alt:before{content:"\f0f6"}.icon-building:before{content:"\f0f7"}.icon-hospital:before{content:"\f0f8"}.icon-ambulance:before{content:"\f0f9"}.icon-medkit:before{content:"\f0fa"}.icon-fighter-jet:before{content:"\f0fb"}.icon-beer:before{content:"\f0fc"}.icon-h-sign:before{content:"\f0fd"}.icon-plus-sign-alt:before{content:"\f0fe"}.icon-double-ang
 le-left:before{content:"\f100"}.icon-double-angle-right:before{content:"\f101"}.icon-double-angle-up:before{content:"\f102"}.icon-double-angle-down:before{content:"\f103"}.icon-angle-left:before{content:"\f104"}.icon-angle-right:before{content:"\f105"}.icon-angle-up:before{content:"\f106"}.icon-angle-down:before{content:"\f107"}.icon-desktop:before{content:"\f108"}.icon-laptop:before{content:"\f109"}.icon-tablet:before{content:"\f10a"}.icon-mobile-phone:before{content:"\f10b"}.icon-circle-blank:before{content:"\f10c"}.icon-quote-left:before{content:"\f10d"}.icon-quote-right:before{content:"\f10e"}.icon-spinner:before{content:"\f110"}.icon-circle:before{content:"\f111"}.icon-mail-reply:before,.icon-reply:before{content:"\f112"}.icon-github-alt:before{content:"\f113"}.icon-folder-close-alt:before{content:"\f114"}.icon-folder-open-alt:before{content:"\f115"}.icon-expand-alt:before{content:"\f116"}.icon-collapse-alt:before{content:"\f117"}.icon-smile:before{content:"\f118"}.icon-frown:b
 efore{content:"\f119"}.icon-meh:before{content:"\f11a"}.icon-gamepad:before{content:"\f11b"}.icon-keyboard:before{content:"\f11c"}.icon-flag-alt:before{content:"\f11d"}.icon-flag-checkered:before{content:"\f11e"}.icon-terminal:before{content:"\f120"}.icon-code:before{content:"\f121"}.icon-reply-all:before{content:"\f122"}.icon-mail-reply-all:before{content:"\f122"}.icon-star-half-full:before,.icon-star-half-empty:before{content:"\f123"}.icon-location-arrow:before{content:"\f124"}.icon-crop:before{content:"\f125"}.icon-code-fork:before{content:"\f126"}.icon-unlink:before{content:"\f127"}.icon-question:before{content:"\f128"}.icon-info:before{content:"\f129"}.icon-exclamation:before{content:"\f12a"}.icon-superscript:before{content:"\f12b"}.icon-subscript:before{content:"\f12c"}.icon-eraser:before{content:"\f12d"}.icon-puzzle-piece:before{content:"\f12e"}.icon-microphone:before{content:"\f130"}.icon-microphone-off:before{content:"\f131"}.icon-shield:before{content:"\f132"}.icon-calenda
 r-empty:before{content:"\f133"}.icon-fire-extinguisher:before{content:"\f134"}.icon-rocket:before{content:"\f135"}.icon-maxcdn:before{content:"\f136"}.icon-chevron-sign-left:before{content:"\f137"}.icon-chevron-sign-right:before{content:"\f138"}.icon-chevron-sign-up:before{content:"\f139"}.icon-chevron-sign-down:before{content:"\f13a"}.icon-html5:before{content:"\f13b"}.icon-css3:before{content:"\f13c"}.icon-anchor:before{content:"\f13d"}.icon-unlock-alt:before{content:"\f13e"}.icon-bullseye:before{content:"\f140"}.icon-ellipsis-horizontal:before{content:"\f141"}.icon-ellipsis-vertical:before{content:"\f142"}.icon-rss-sign:before{content:"\f143"}.icon-play-sign:before{content:"\f144"}.icon-ticket:before{content:"\f145"}.icon-minus-sign-alt:before{content:"\f146"}.icon-check-minus:before{content:"\f147"}.icon-level-up:before{content:"\f148"}.icon-level-down:before{content:"\f149"}.icon-check-sign:before{content:"\f14a"}.icon-edit-sign:before{content:"\f14b"}.icon-external-link-sign:b
 efore{content:"\f14c"}.icon-share-sign:before{content:"\f14d"}.icon-compass:before{content:"\f14e"}.icon-collapse:before{content:"\f150"}.icon-collapse-top:before{content:"\f151"}.icon-expand:before{content:"\f152"}.icon-euro:before,.icon-eur:before{content:"\f153"}.icon-gbp:before{content:"\f154"}.icon-dollar:before,.icon-usd:before{content:"\f155"}.icon-rupee:before,.icon-inr:before{content:"\f156"}.icon-yen:before,.icon-jpy:before{content:"\f157"}.icon-renminbi:before,.icon-cny:before{content:"\f158"}.icon-won:before,.icon-krw:before{content:"\f159"}.icon-bitcoin:before,.icon-btc:before{content:"\f15a"}.icon-file:before{content:"\f15b"}.icon-file-text:before{content:"\f15c"}.icon-sort-by-alphabet:before{content:"\f15d"}.icon-sort-by-alphabet-alt:before{content:"\f15e"}.icon-sort-by-attributes:before{content:"\f160"}.icon-sort-by-attributes-alt:before{content:"\f161"}.icon-sort-by-order:before{content:"\f162"}.icon-sort-by-order-alt:before{content:"\f163"}.icon-thumbs-up:before{co
 ntent:"\f164"}.icon-thumbs-down:before{content:"\f165"}.icon-youtube-sign:before{content:"\f166"}.icon-youtube:before{content:"\f167"}.icon-xing:before{content:"\f168"}.icon-xing-sign:before{content:"\f169"}.icon-youtube-play:before{content:"\f16a"}.icon-dropbox:before{content:"\f16b"}.icon-stackexchange:before{content:"\f16c"}.icon-instagram:before{content:"\f16d"}.icon-flickr:before{content:"\f16e"}.icon-adn:before{content:"\f170"}.icon-bitbucket:before{content:"\f171"}.icon-bitbucket-sign:before{content:"\f172"}.icon-tumblr:before{content:"\f173"}.icon-tumblr-sign:before{content:"\f174"}.icon-long-arrow-down:before{content:"\f175"}.icon-long-arrow-up:before{content:"\f176"}.icon-long-arrow-left:before{content:"\f177"}.icon-long-arrow-right:before{content:"\f178"}.icon-apple:before{content:"\f179"}.icon-windows:before{content:"\f17a"}.icon-android:before{content:"\f17b"}.icon-linux:before{content:"\f17c"}.icon-dribbble:before{content:"\f17d"}.icon-skype:before{content:"\f17e"}.ico
 n-foursquare:before{content:"\f180"}.icon-trello:before{content:"\f181"}.icon-female:before{content:"\f182"}.icon-male:before{content:"\f183"}.icon-gittip:before{content:"\f184"}.icon-sun:before{content:"\f185"}.icon-moon:before{content:"\f186"}.icon-archive:before{content:"\f187"}.icon-bug:before{content:"\f188"}.icon-vk:before{content:"\f189"}.icon-weibo:before{content:"\f18a"}.icon-renren:before{content:"\f18b"}.dropup,.dropdown{position:relative}.dropdown-toggle{*margin-bottom:-3px}.dropdown-toggle:active,.open .dropdown-toggle{outline:0}.caret{display:inline-block;width:0;height:0;vertical-align:top;border-top:4px solid #000;border-right:4px solid transparent;border-left:4px solid transparent;content:""}.dropdown .caret{margin-top:8px;margin-left:2px}.dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;display:none;float:left;min-width:160px;padding:5px 0;margin:2px 0 0;list-style:none;background-color:#fff;border:1px solid #ccc;border:1px solid rgba(0,0,0,.2);*border-
 right-width:2px;*border-bottom-width:2px;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,.2);-moz-box-shadow:0 5px 10px rgba(0,0,0,.2);box-shadow:0 5px 10px rgba(0,0,0,.2);-webkit-background-clip:padding-box;-moz-background-clip:padding;background-clip:padding-box}.dropdown-menu.pull-right{right:0;left:auto}.dropdown-menu .divider{*width:100%;height:1px;margin:9px 1px;*margin:-5px 0 5px;overflow:hidden;background-color:#e5e5e5;border-bottom:1px solid #fff}.dropdown-menu>li>a{display:block;padding:3px 20px;clear:both;font-weight:400;line-height:20px;color:#333;white-space:nowrap}.dropdown-menu>li>a:hover,.dropdown-menu>li>a:focus,.dropdown-submenu:hover>a,.dropdown-submenu:focus>a{text-decoration:none;color:#fff;background-color:#e23632;background-image:-moz-linear-gradient(top,#e33f3b,#e02925);background-image:-webkit-gradient(linear,0 0,0 100%,from(#e33f3b),to(#e02925));background-image:-webkit-linear-gradient(top,#e33f3b,
 #e02925);background-image:-o-linear-gradient(top,#e33f3b,#e02925);background-image:linear-gradient(to bottom,#e33f3b,#e02925);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe33f3b', endColorstr='#ffe02925', GradientType=0)}.dropdown-menu>.active>a,.dropdown-menu>.active>a:hover,.dropdown-menu>.active>a:focus{color:#fff;text-decoration:none;outline:0;background-color:#e23632;background-image:-moz-linear-gradient(top,#e33f3b,#e02925);background-image:-webkit-gradient(linear,0 0,0 100%,from(#e33f3b),to(#e02925));background-image:-webkit-linear-gradient(top,#e33f3b,#e02925);background-image:-o-linear-gradient(top,#e33f3b,#e02925);background-image:linear-gradient(to bottom,#e33f3b,#e02925);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe33f3b', endColorstr='#ffe02925', GradientType=0)}.dropdown-menu>.disabled>a,.dropdown-menu>.disabled>a:hover,.dropdown-menu>.disabled>a:focus{color:#999}.dropd
 own-menu>.disabled>a:hover,.dropdown-menu>.disabled>a:focus{text-decoration:none;background-color:transparent;background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);cursor:default}.open{*z-index:1000}.open>.dropdown-menu{display:block}.dropdown-backdrop{position:fixed;left:0;right:0;bottom:0;top:0;z-index:990}.pull-right>.dropdown-menu{right:0;left:auto}.dropup .caret,.navbar-fixed-bottom .dropdown .caret{border-top:0;border-bottom:4px solid #000;content:""}.dropup .dropdown-menu,.navbar-fixed-bottom .dropdown .dropdown-menu{top:auto;bottom:100%;margin-bottom:1px}.dropdown-submenu{position:relative}.dropdown-submenu>.dropdown-menu{top:0;left:100%;margin-top:-6px;margin-left:-1px;-webkit-border-radius:0 6px 6px;-moz-border-radius:0 6px 6px;border-radius:0 6px 6px}.dropdown-submenu:hover>.dropdown-menu{display:block}.dropup .dropdown-submenu>.dropdown-menu{top:auto;bottom:0;margin-top:0;margin-bottom:-2px;-webkit-border-radius:5px 5px 5px 0;-moz-border-
 radius:5px 5px 5px 0;border-radius:5px 5px 5px 0}.dropdown-submenu>a:after{display:block;content:" ";float:right;width:0;height:0;border-color:transparent;border-style:solid;border-width:5px 0 5px 5px;border-left-color:#ccc;margin-top:5px;margin-right:-10px}.dropdown-submenu:hover>a:after{border-left-color:#fff}.dropdown-submenu.pull-left{float:none}.dropdown-submenu.pull-left>.dropdown-menu{left:-100%;margin-left:10px;-webkit-border-radius:6px 0 6px 6px;-moz-border-radius:6px 0 6px 6px;border-radius:6px 0 6px 6px}.dropdown .dropdown-menu .nav-header{padding-left:20px;padding-right:20px}.typeahead{z-index:1051;margin-top:2px;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.well{min-height:20px;padding:19px;margin-bottom:20px;background-color:#f5f5f5;border:1px solid #e3e3e3;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.05);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.05);box-shadow:inset 0 1px 1px 
 rgba(0,0,0,.05)}.well blockquote{border-color:#ddd;border-color:rgba(0,0,0,.15)}.well-large{padding:24px;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px}.well-small{padding:9px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.fade{opacity:0;-webkit-transition:opacity .15s linear;-moz-transition:opacity .15s linear;-o-transition:opacity .15s linear;transition:opacity .15s linear}.fade.in{opacity:1}.collapse{position:relative;height:0;overflow:hidden;-webkit-transition:height .35s ease;-moz-transition:height .35s ease;-o-transition:height .35s ease;transition:height .35s ease}.collapse.in{height:auto}.close{float:right;font-size:20px;font-weight:700;line-height:20px;color:#000;text-shadow:0 1px 0 #fff;opacity:.2;filter:alpha(opacity=20)}.close:hover,.close:focus{color:#000;text-decoration:none;cursor:pointer;opacity:.4;filter:alpha(opacity=40)}button.close{padding:0;cursor:pointer;background:transparent;border:0;-webkit-appearance:none}.btn{displa
 y:inline-block;*display:inline;*zoom:1;padding:4px 12px;margin-bottom:0;font-size:14px;line-height:20px;text-align:center;vertical-align:middle;cursor:pointer;color:#333;text-shadow:0 1px 1px rgba(255,255,255,.75);background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#fff,#e6e6e6);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fff),to(#e6e6e6));background-image:-webkit-linear-gradient(top,#fff,#e6e6e6);background-image:-o-linear-gradient(top,#fff,#e6e6e6);background-image:linear-gradient(to bottom,#fff,#e6e6e6);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffe6e6e6', GradientType=0);border-color:#e6e6e6 #e6e6e6 #bfbfbf;border-color:rgba(0,0,0,.1) rgba(0,0,0,.1) rgba(0,0,0,.25);*background-color:#e6e6e6;filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);border:1px solid #ccc;*border:0;border-bottom-color:#b3b3b3;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4
 px;*margin-left:.3em;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.2),0 1px 2px rgba(0,0,0,.05);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,.2),0 1px 2px rgba(0,0,0,.05);box-shadow:inset 0 1px 0 rgba(255,255,255,.2),0 1px 2px rgba(0,0,0,.05)}.btn:hover,.btn:focus,.btn:active,.btn.active,.btn.disabled,.btn[disabled]{color:#333;background-color:#e6e6e6;*background-color:#d9d9d9}.btn:active,.btn.active{background-color:#ccc \9}.btn:hover,.btn:focus,.btn:active,.btn.active,.btn.disabled,.btn[disabled]{color:#333;background-color:#e6e6e6;*background-color:#d9d9d9}.btn:active,.btn.active{background-color:#ccc \9}.btn:first-child{*margin-left:0}.btn:first-child{*margin-left:0}.btn:hover,.btn:focus{color:#333;text-decoration:none;background-position:0 -15px;-webkit-transition:background-position .1s linear;-moz-transition:background-position .1s linear;-o-transition:background-position .1s linear;transition:background-position .1s linear}.btn:focus{outline:thin dotted #333;outline:5
 px auto -webkit-focus-ring-color;outline-offset:-2px}.btn.active,.btn:active{background-image:none;outline:0;-webkit-box-shadow:inset 0 2px 4px rgba(0,0,0,.15),0 1px 2px rgba(0,0,0,.05);-moz-box-shadow:inset 0 2px 4px rgba(0,0,0,.15),0 1px 2px rgba(0,0,0,.05);box-shadow:inset 0 2px 4px rgba(0,0,0,.15),0 1px 2px rgba(0,0,0,.05)}.btn.disabled,.btn[disabled]{cursor:default;background-image:none;opacity:.65;filter:alpha(opacity=65);-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.btn-large{padding:11px 19px;font-size:17.5px;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px}.btn-large [class^=icon-],.btn-large [class*=" icon-"]{margin-top:4px}.btn-small{padding:2px 10px;font-size:11.9px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.btn-small [class^=icon-],.btn-small [class*=" icon-"]{margin-top:0}.btn-mini [class^=icon-],.btn-mini [class*=" icon-"]{margin-top:-1px}.btn-mini{padding:0 6px;font-size:10.5px;-webkit-border-radius:3px;-moz-
 border-radius:3px;border-radius:3px}.btn-block{display:block;width:100%;padding-left:0;padding-right:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.btn-block+.btn-block{margin-top:5px}input[type=submit].btn-block,input[type=reset].btn-block,input[type=button].btn-block{width:100%}.btn-primary.active,.btn-warning.active,.btn-danger.active,.btn-success.active,.btn-info.active,.btn-inverse.active{color:rgba(255,255,255,.75)}.btn-primary{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,.25);background-color:#e3553b;background-image:-moz-linear-gradient(top,#e33f3b,#e3773b);background-image:-webkit-gradient(linear,0 0,0 100%,from(#e33f3b),to(#e3773b));background-image:-webkit-linear-gradient(top,#e33f3b,#e3773b);background-image:-o-linear-gradient(top,#e33f3b,#e3773b);background-image:linear-gradient(to bottom,#e33f3b,#e3773b);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe33f3b', endColorstr='#ffe3773b', Gradi
 entType=0);border-color:#e3773b #e3773b #b7521a;border-color:rgba(0,0,0,.1) rgba(0,0,0,.1) rgba(0,0,0,.25);*background-color:#e3773b;filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.btn-primary:hover,.btn-primary:focus,.btn-primary:active,.btn-primary.active,.btn-primary.disabled,.btn-primary[disabled]{color:#fff;background-color:#e3773b;*background-color:#e06825}.btn-primary:active,.btn-primary.active{background-color:#ce5c1d \9}.btn-primary:hover,.btn-primary:focus,.btn-primary:active,.btn-primary.active,.btn-primary.disabled,.btn-primary[disabled]{color:#fff;background-color:#e3773b;*background-color:#e06825}.btn-primary:active,.btn-primary.active{background-color:#ce5c1d \9}.btn-warning{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,.25);background-color:#f58258;background-image:-moz-linear-gradient(top,#f79875,#f3622d);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f79875),to(#f3622d));background-image:-webkit-linear-gradient(top,#f79875,#f3622d);backgro
 und-image:-o-linear-gradient(top,#f79875,#f3622d);background-image:linear-gradient(to bottom,#f79875,#f3622d);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff79875', endColorstr='#fff3622d', GradientType=0);border-color:#f3622d #f3622d #c83e0b;border-color:rgba(0,0,0,.1) rgba(0,0,0,.1) rgba(0,0,0,.25);*background-color:#f3622d;filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.btn-warning:hover,.btn-warning:focus,.btn-warning:active,.btn-warning.active,.btn-warning.disabled,.btn-warning[disabled]{color:#fff;background-color:#f3622d;*background-color:#f25015}.btn-warning:active,.btn-warning.active{background-color:#e0450d \9}.btn-warning:hover,.btn-warning:focus,.btn-warning:active,.btn-warning.active,.btn-warning.disabled,.btn-warning[disabled]{color:#fff;background-color:#f3622d;*background-color:#f25015}.btn-warning:active,.btn-warning.active{background-color:#e0450d \9}.btn-danger{color:#fff;text-shadow:0 -1px 0 rgba(
 0,0,0,.25);background-color:#da4f49;background-image:-moz-linear-gradient(top,#ee5f5b,#bd362f);background-image:-webkit-gradient(linear,0 0,0 100%,from(#ee5f5b),to(#bd362f));background-image:-webkit-linear-gradient(top,#ee5f5b,#bd362f);background-image:-o-linear-gradient(top,#ee5f5b,#bd362f);background-image:linear-gradient(to bottom,#ee5f5b,#bd362f);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffee5f5b', endColorstr='#ffbd362f', GradientType=0);border-color:#bd362f #bd362f #802420;border-color:rgba(0,0,0,.1) rgba(0,0,0,.1) rgba(0,0,0,.25);*background-color:#bd362f;filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.btn-danger:hover,.btn-danger:focus,.btn-danger:active,.btn-danger.active,.btn-danger.disabled,.btn-danger[disabled]{color:#fff;background-color:#bd362f;*background-color:#a9302a}.btn-danger:active,.btn-danger.active{background-color:#942a25 \9}.btn-danger:hover,.btn-danger:focus,.btn-danger:active,.btn-danger.
 active,.btn-danger.disabled,.btn-danger[disabled]{color:#fff;background-color:#bd362f;*background-color:#a9302a}.btn-danger:active,.btn-danger.active{background-color:#942a25 \9}.btn-success{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,.25);background-color:#5bb75b;background-image:-moz-linear-gradient(top,#62c462,#51a351);background-image:-webkit-gradient(linear,0 0,0 100%,from(#62c462),to(#51a351));background-image:-webkit-linear-gradient(top,#62c462,#51a351);background-image:-o-linear-gradient(top,#62c462,#51a351);background-image:linear-gradient(to bottom,#62c462,#51a351);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff62c462', endColorstr='#ff51a351', GradientType=0);border-color:#51a351 #51a351 #387038;border-color:rgba(0,0,0,.1) rgba(0,0,0,.1) rgba(0,0,0,.25);*background-color:#51a351;filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.btn-success:hover,.btn-success:focus,.btn-success:active,.btn-success.active,.btn-s
 uccess.disabled,.btn-success[disabled]{color:#fff;background-color:#51a351;*background-color:#499249}.btn-success:active,.btn-success.active{background-color:#408140 \9}.btn-success:hover,.btn-success:focus,.btn-success:active,.btn-success.active,.btn-success.disabled,.btn-success[disabled]{color:#fff;background-color:#51a351;*background-color:#499249}.btn-success:active,.btn-success.active{background-color:#408140 \9}.btn-info{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,.25);background-color:#49afcd;background-image:-moz-linear-gradient(top,#5bc0de,#2f96b4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#5bc0de),to(#2f96b4));background-image:-webkit-linear-gradient(top,#5bc0de,#2f96b4);background-image:-o-linear-gradient(top,#5bc0de,#2f96b4);background-image:linear-gradient(to bottom,#5bc0de,#2f96b4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff2f96b4', GradientType=0);border-color:#2f96b4 #2f96b4 #
 1f6377;border-color:rgba(0,0,0,.1) rgba(0,0,0,.1) rgba(0,0,0,.25);*background-color:#2f96b4;filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.btn-info:hover,.btn-info:focus,.btn-info:active,.btn-info.active,.btn-info.disabled,.btn-info[disabled]{color:#fff;background-color:#2f96b4;*background-color:#2a85a0}.btn-info:active,.btn-info.active{background-color:#24748c \9}.btn-info:hover,.btn-info:focus,.btn-info:active,.btn-info.active,.btn-info.disabled,.btn-info[disabled]{color:#fff;background-color:#2f96b4;*background-color:#2a85a0}.btn-info:active,.btn-info.active{background-color:#24748c \9}.btn-inverse{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,.25);background-color:#363636;background-image:-moz-linear-gradient(top,#444,#222);background-image:-webkit-gradient(linear,0 0,0 100%,from(#444),to(#222));background-image:-webkit-linear-gradient(top,#444,#222);background-image:-o-linear-gradient(top,#444,#222);background-image:linear-gradient(to bottom,#444,#222);backgroun
 d-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff444444', endColorstr='#ff222222', GradientType=0);border-color:#222 #222 #000;border-color:rgba(0,0,0,.1) rgba(0,0,0,.1) rgba(0,0,0,.25);*background-color:#222;filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.btn-inverse:hover,.btn-inverse:focus,.btn-inverse:active,.btn-inverse.active,.btn-inverse.disabled,.btn-inverse[disabled]{color:#fff;background-color:#222;*background-color:#151515}.btn-inverse:active,.btn-inverse.active{background-color:#080808 \9}.btn-inverse:hover,.btn-inverse:focus,.btn-inverse:active,.btn-inverse.active,.btn-inverse.disabled,.btn-inverse[disabled]{color:#fff;background-color:#222;*background-color:#151515}.btn-inverse:active,.btn-inverse.active{background-color:#080808 \9}button.btn,input[type=submit].btn{*padding-top:3px;*padding-bottom:3px}button.btn::-moz-focus-inner,input[type=submit].btn::-moz-focus-inner{padding:0;border:0}button.btn.btn-large,input
 [type=submit].btn.btn-large{*padding-top:7px;*padding-bottom:7px}button.btn.btn-small,input[type=submit].btn.btn-small{*padding-top:3px;*padding-bottom:3px}button.btn.btn-mini,input[type=submit].btn.btn-mini{*padding-top:1px;*padding-bottom:1px}.btn-link,.btn-link:active,.btn-link[disabled]{background-color:transparent;background-image:none;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.btn-link{border-color:transparent;cursor:pointer;color:#e33f3b;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.btn-link:hover,.btn-link:focus{color:#b71e1a;text-decoration:underline;background-color:transparent}.btn-link[disabled]:hover,.btn-link[disabled]:focus{color:#333;text-decoration:none}.btn-group{position:relative;display:inline-block;*display:inline;*zoom:1;font-size:0;vertical-align:middle;white-space:nowrap;*margin-left:.3em}.btn-group:first-child{*margin-left:0}.btn-group:first-child{*margin-left:0}.btn-group+.btn-group{margin-left:5px}.btn-toolbar{font-size:0
 ;margin-top:10px;margin-bottom:10px}.btn-toolbar>.btn+.btn,.btn-toolbar>.btn-group+.btn,.btn-toolbar>.btn+.btn-group{margin-left:5px}.btn-group>.btn{position:relative;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.btn-group>.btn+.btn{margin-left:-1px}.btn-group>.btn,.btn-group>.dropdown-menu,.btn-group>.popover{font-size:14px}.btn-group>.btn-mini{font-size:10.5px}.btn-group>.btn-small{font-size:11.9px}.btn-group>.btn-large{font-size:17.5px}.btn-group>.btn:first-child{margin-left:0;-webkit-border-top-left-radius:4px;-moz-border-radius-topleft:4px;border-top-left-radius:4px;-webkit-border-bottom-left-radius:4px;-moz-border-radius-bottomleft:4px;border-bottom-left-radius:4px}.btn-group>.btn:last-child,.btn-group>.dropdown-toggle{-webkit-border-top-right-radius:4px;-moz-border-radius-topright:4px;border-top-right-radius:4px;-webkit-border-bottom-right-radius:4px;-moz-border-radius-bottomright:4px;border-bottom-right-radius:4px}.btn-group>.btn.large:first-child{margin-left
 :0;-webkit-border-top-left-radius:6px;-moz-border-radius-topleft:6px;border-top-left-radius:6px;-webkit-border-bottom-left-radius:6px;-moz-border-radius-bottomleft:6px;border-bottom-left-radius:6px}.btn-group>.btn.large:last-child,.btn-group>.large.dropdown-toggle{-webkit-border-top-right-radius:6px;-moz-border-radius-topright:6px;border-top-right-radius:6px;-webkit-border-bottom-right-radius:6px;-moz-border-radius-bottomright:6px;border-bottom-right-radius:6px}.btn-group>.btn:hover,.btn-group>.btn:focus,.btn-group>.btn:active,.btn-group>.btn.active{z-index:2}.btn-group .dropdown-toggle:active,.btn-group.open .dropdown-toggle{outline:0}.btn-group>.btn+.dropdown-toggle{padding-left:8px;padding-right:8px;-webkit-box-shadow:inset 1px 0 0 rgba(255,255,255,.125),inset 0 1px 0 rgba(255,255,255,.2),0 1px 2px rgba(0,0,0,.05);-moz-box-shadow:inset 1px 0 0 rgba(255,255,255,.125),inset 0 1px 0 rgba(255,255,255,.2),0 1px 2px rgba(0,0,0,.05);box-shadow:inset 1px 0 0 rgba(255,255,255,.125),inset 
 0 1px 0 rgba(255,255,255,.2),0 1px 2px rgba(0,0,0,.05);*padding-top:5px;*padding-bottom:5px}.btn-group>.btn-mini+.dropdown-toggle{padding-left:5px;padding-right:5px;*padding-top:2px;*padding-bottom:2px}.btn-group>.btn-small+.dropdown-toggle{*padding-top:5px;*padding-bottom:4px}.btn-group>.btn-large+.dropdown-toggle{padding-left:12px;padding-right:12px;*padding-top:7px;*padding-bottom:7px}.btn-group.open .dropdown-toggle{background-image:none;-webkit-box-shadow:inset 0 2px 4px rgba(0,0,0,.15),0 1px 2px rgba(0,0,0,.05);-moz-box-shadow:inset 0 2px 4px rgba(0,0,0,.15),0 1px 2px rgba(0,0,0,.05);box-shadow:inset 0 2px 4px rgba(0,0,0,.15),0 1px 2px rgba(0,0,0,.05)}.btn-group.open .btn.dropdown-toggle{background-color:#e6e6e6}.btn-group.open .btn-primary.dropdown-toggle{background-color:#e3773b}.btn-group.open .btn-warning.dropdown-toggle{background-color:#f3622d}.btn-group.open .btn-danger.dropdown-toggle{background-color:#bd362f}.btn-group.open .btn-success.dropdown-toggle{background-colo
 r:#51a351}.btn-group.open .btn-info.dropdown-toggle{background-color:#2f96b4}.btn-group.open .btn-inverse.dropdown-toggle{background-color:#222}.btn .caret{margin-top:8px;margin-left:0}.btn-large .caret{margin-top:6px}.btn-large .caret{border-left-width:5px;border-right-width:5px;border-top-width:5px}.btn-mini .caret,.btn-small .caret{margin-top:8px}.dropup .btn-large .caret{border-bottom-width:5px}.btn-primary .caret,.btn-warning .caret,.btn-danger .caret,.btn-info .caret,.btn-success .caret,.btn-inverse .caret{border-top-color:#fff;border-bottom-color:#fff}.btn-group-vertical{display:inline-block;*display:inline;*zoom:1}.btn-group-vertical>.btn{display:block;float:none;max-width:100%;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.btn-group-vertical>.btn+.btn{margin-left:0;margin-top:-1px}.btn-group-vertical>.btn:first-child

<TRUNCATED>
http://git-wip-us.apache.org/repos/asf/couchdb/blob/cca309f3/share/www/fauxton/img/FontAwesome.otf
----------------------------------------------------------------------
diff --git a/share/www/fauxton/img/FontAwesome.otf b/share/www/fauxton/img/FontAwesome.otf
deleted file mode 100644
index 7012545..0000000
Binary files a/share/www/fauxton/img/FontAwesome.otf and /dev/null differ


[16/37] move JS tests into safety

Posted by ja...@apache.org.
http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/test/etags_head.js
----------------------------------------------------------------------
diff --git a/share/test/etags_head.js b/share/test/etags_head.js
new file mode 100644
index 0000000..63e2999
--- /dev/null
+++ b/share/test/etags_head.js
@@ -0,0 +1,78 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+
+couchTests.etags_head = function(debug) {
+  var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"});
+  db.deleteDb();
+  db.createDb();
+  if (debug) debugger;
+
+  var xhr;
+
+  // create a new doc
+  xhr = CouchDB.request("PUT", "/test_suite_db/1", {
+    body: "{}"
+  });
+  T(xhr.status == 201);
+
+  // extract the ETag header values
+  var etag = xhr.getResponseHeader("etag");
+
+  // get the doc and verify the headers match
+  xhr = CouchDB.request("GET", "/test_suite_db/1");
+  T(etag == xhr.getResponseHeader("etag"));
+
+  // 'head' the doc and verify the headers match
+  xhr = CouchDB.request("HEAD", "/test_suite_db/1", {
+    headers: {"if-none-match": "s"}
+  });
+  T(etag == xhr.getResponseHeader("etag"));
+
+  // replace a doc
+  xhr = CouchDB.request("PUT", "/test_suite_db/1", {
+    body: "{}",
+    headers: {"if-match": etag}
+  });
+  T(xhr.status == 201);
+
+  // extract the new ETag value
+  var etagOld= etag;
+  etag = xhr.getResponseHeader("etag");
+
+  // fail to replace a doc
+  xhr = CouchDB.request("PUT", "/test_suite_db/1", {
+    body: "{}"
+  });
+  T(xhr.status == 409);
+
+  // verify get w/Etag
+  xhr = CouchDB.request("GET", "/test_suite_db/1", {
+    headers: {"if-none-match": etagOld}
+  });
+  T(xhr.status == 200);
+  xhr = CouchDB.request("GET", "/test_suite_db/1", {
+    headers: {"if-none-match": etag}
+  });
+  T(xhr.status == 304);
+
+  // fail to delete a doc
+  xhr = CouchDB.request("DELETE", "/test_suite_db/1", {
+    headers: {"if-match": etagOld}
+  });
+  T(xhr.status == 409);
+
+  //now do it for real
+  xhr = CouchDB.request("DELETE", "/test_suite_db/1", {
+    headers: {"if-match": etag}
+  });
+  T(xhr.status == 200);
+};

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/test/etags_views.js
----------------------------------------------------------------------
diff --git a/share/test/etags_views.js b/share/test/etags_views.js
new file mode 100644
index 0000000..6d8e97b
--- /dev/null
+++ b/share/test/etags_views.js
@@ -0,0 +1,220 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+
+couchTests.etags_views = function(debug) {
+  var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"true"});
+  db.deleteDb();
+  db.createDb();
+  if (debug) debugger;
+
+  var designDoc = {
+    _id: "_design/etags",
+    language: "javascript",
+    views : {
+      fooView: {
+        map: stringFun(function(doc) {
+          if (doc.foo) {
+            emit("bar", 1);
+          }
+        }),
+      },
+      basicView : {
+        map : stringFun(function(doc) {
+          if(doc.integer && doc.string) {
+            emit(doc.integer, doc.string);
+          }
+        })
+      },
+      withReduce : {
+        map : stringFun(function(doc) {
+          if(doc.integer && doc.string) {
+            emit(doc.integer, doc.string);
+          }
+        }),
+        reduce : stringFun(function(keys, values, rereduce) {
+          if (rereduce) {
+            return sum(values);
+          } else {
+            return values.length;
+          }
+        })
+      }
+    }
+  };
+  T(db.save(designDoc).ok);
+  db.bulkSave(makeDocs(0, 10));
+
+  var xhr;
+
+  // verify get w/Etag on map view
+  xhr = CouchDB.request("GET", "/test_suite_db/_design/etags/_view/basicView");
+  T(xhr.status == 200);
+  var etag = xhr.getResponseHeader("etag");
+  xhr = CouchDB.request("GET", "/test_suite_db/_design/etags/_view/basicView", {
+    headers: {"if-none-match": etag}
+  });
+  T(xhr.status == 304);
+
+  // verify ETag doesn't change when an update
+  // doesn't change the view group's index
+  T(db.save({"_id":"doc1", "foo":"bar"}).ok);
+  xhr = CouchDB.request("GET", "/test_suite_db/_design/etags/_view/basicView");
+  var etag1 = xhr.getResponseHeader("etag");
+  T(etag1 == etag);
+
+  // verify ETag always changes for include_docs=true on update
+  xhr = CouchDB.request("GET", "/test_suite_db/_design/etags/_view/basicView?include_docs=true");
+  var etag1 = xhr.getResponseHeader("etag");
+  T(db.save({"_id":"doc2", "foo":"bar"}).ok);
+  xhr = CouchDB.request("GET", "/test_suite_db/_design/etags/_view/basicView?include_docs=true");
+  var etag2 = xhr.getResponseHeader("etag");
+  T(etag1 != etag2);
+ 
+  // Verify that purges affect etags
+  xhr = CouchDB.request("GET", "/test_suite_db/_design/etags/_view/fooView");
+  var foo_etag = xhr.getResponseHeader("etag");
+  var doc1 = db.open("doc1");
+  xhr = CouchDB.request("POST", "/test_suite_db/_purge", {
+    body: JSON.stringify({"doc1":[doc1._rev]})
+  });
+  xhr = CouchDB.request("GET", "/test_suite_db/_design/etags/_view/fooView");
+  var etag1 = xhr.getResponseHeader("etag");
+  T(etag1 != foo_etag);
+
+  // Test that _purge didn't affect the other view etags.
+  xhr = CouchDB.request("GET", "/test_suite_db/_design/etags/_view/basicView");
+  var etag1 = xhr.getResponseHeader("etag");
+  T(etag1 == etag);
+
+  // verify different views in the same view group may have different ETags
+  xhr = CouchDB.request("GET", "/test_suite_db/_design/etags/_view/fooView");
+  var etag1 = xhr.getResponseHeader("etag");
+  xhr = CouchDB.request("GET", "/test_suite_db/_design/etags/_view/basicView");
+  var etag2 = xhr.getResponseHeader("etag");
+  T(etag1 != etag2);
+
+  // verify ETag changes when an update changes the view group's index.
+  db.bulkSave(makeDocs(10, 20));
+  xhr = CouchDB.request("GET", "/test_suite_db/_design/etags/_view/basicView");
+  var etag1 = xhr.getResponseHeader("etag");
+  T(etag1 != etag);
+
+  // verify ETag is the same after a restart
+  restartServer();
+  xhr = CouchDB.request("GET", "/test_suite_db/_design/etags/_view/basicView");
+  var etag2 = xhr.getResponseHeader("etag");
+  T(etag1 == etag2);
+
+  // reduce view
+  xhr = CouchDB.request("GET", "/test_suite_db/_design/etags/_view/withReduce");
+  T(xhr.status == 200);
+  var etag = xhr.getResponseHeader("etag");
+  xhr = CouchDB.request("GET", "/test_suite_db/_design/etags/_view/withReduce",{
+    headers: {"if-none-match": etag}
+  });
+  T(xhr.status == 304);
+
+  // verify ETag doesn't change when an update
+  // doesn't change the view group's index
+  T(db.save({"_id":"doc3", "foo":"bar"}).ok);
+  xhr = CouchDB.request("GET", "/test_suite_db/_design/etags/_view/withReduce");
+  var etag1 = xhr.getResponseHeader("etag");
+  T(etag1 == etag);
+  // purge
+  var doc3 = db.open("doc3");
+  xhr = CouchDB.request("POST", "/test_suite_db/_purge", {
+    body: JSON.stringify({"doc3":[doc3._rev]})
+  });
+  xhr = CouchDB.request("GET", "/test_suite_db/_design/etags/_view/withReduce");
+  var etag1 = xhr.getResponseHeader("etag");
+  T(etag1 == etag);
+
+  // verify different views in the same view group may have different ETags
+  xhr = CouchDB.request("GET", "/test_suite_db/_design/etags/_view/fooView");
+  var etag1 = xhr.getResponseHeader("etag");
+  xhr = CouchDB.request("GET", "/test_suite_db/_design/etags/_view/withReduce");
+  var etag2 = xhr.getResponseHeader("etag");
+  T(etag1 != etag2);
+
+  // verify ETag changes when an update changes the view group's index
+  db.bulkSave(makeDocs(20, 30));
+  xhr = CouchDB.request("GET", "/test_suite_db/_design/etags/_view/withReduce");
+  var etag1 = xhr.getResponseHeader("etag");
+  T(etag1 != etag);
+
+  // verify ETag is the same after a restart
+  restartServer();
+  xhr = CouchDB.request("GET", "/test_suite_db/_design/etags/_view/withReduce");
+  var etag2 = xhr.getResponseHeader("etag");
+  T(etag1 == etag2);
+
+  // confirm ETag changes with different POST bodies
+  xhr = CouchDB.request("POST", "/test_suite_db/_design/etags/_view/basicView",
+    {body: JSON.stringify({keys:[1]})}
+  );
+  var etag1 = xhr.getResponseHeader("etag");
+  xhr = CouchDB.request("POST", "/test_suite_db/_design/etags/_view/basicView",
+    {body: JSON.stringify({keys:[2]})}
+  );
+  var etag2 = xhr.getResponseHeader("etag");
+  T(etag1 != etag2, "POST to map view generates key-depdendent ETags");
+
+  xhr = CouchDB.request("POST",
+    "/test_suite_db/_design/etags/_view/withReduce?group=true",
+    {body: JSON.stringify({keys:[1]})}
+  );
+  etag1 = xhr.getResponseHeader("etag");
+  xhr = CouchDB.request("POST",
+    "/test_suite_db/_design/etags/_view/withReduce?group=true",
+    {body: JSON.stringify({keys:[2]})}
+  );
+  etag2 = xhr.getResponseHeader("etag");
+  T(etag1 != etag2, "POST to reduce view generates key-depdendent ETags");
+  
+  // all docs
+  xhr = CouchDB.request("GET", "/test_suite_db/_all_docs");
+  T(xhr.status == 200);
+  var etag = xhr.getResponseHeader("etag");
+  xhr = CouchDB.request("GET", "/test_suite_db/_all_docs", {
+    headers: {"if-none-match": etag}
+  });
+  T(xhr.status == 304);
+
+  // _changes
+  xhr = CouchDB.request("GET", "/test_suite_db/_changes");
+  T(xhr.status == 200);
+  var etag = xhr.getResponseHeader("etag");
+  xhr = CouchDB.request("GET", "/test_suite_db/_changes", {
+    headers: {"if-none-match": etag}
+  });
+  T(xhr.status == 304);
+
+  // list etag
+  // in the list test for now
+  
+  // A new database should have unique _all_docs etags. 
+  db.deleteDb(); 
+  db.createDb(); 
+  db.save({a: 1}); 
+  xhr = CouchDB.request("GET", "/test_suite_db/_all_docs"); 
+  var etag = xhr.getResponseHeader("etag"); 
+  db.deleteDb(); 
+  db.createDb(); 
+  db.save({a: 2}); 
+  xhr = CouchDB.request("GET", "/test_suite_db/_all_docs"); 
+  var new_etag = xhr.getResponseHeader("etag");
+  T(etag != new_etag);
+  // but still be cacheable
+  xhr = CouchDB.request("GET", "/test_suite_db/_all_docs"); 
+  T(new_etag == xhr.getResponseHeader("etag"));
+  
+};

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/test/form_submit.js
----------------------------------------------------------------------
diff --git a/share/test/form_submit.js b/share/test/form_submit.js
new file mode 100644
index 0000000..710bf47
--- /dev/null
+++ b/share/test/form_submit.js
@@ -0,0 +1,25 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+
+// Do some basic tests.
+couchTests.form_submit = function(debug) {
+    var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"});
+    db.deleteDb();
+    db.createDb();
+
+    var json = "{}";
+    var xhr = CouchDB.request("POST", "/test_suite_db/baz", {body: json});
+    T(xhr.status == 415);
+    result = JSON.parse(xhr.responseText);
+    T(result.error, "bad_content_type");
+    T(result.reason, "Invalid Content-Type header for form upload");
+};

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/test/http.js
----------------------------------------------------------------------
diff --git a/share/test/http.js b/share/test/http.js
new file mode 100644
index 0000000..5f46af5
--- /dev/null
+++ b/share/test/http.js
@@ -0,0 +1,54 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+
+couchTests.http = function(debug) {
+  var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"});
+  db.deleteDb();
+
+  // bug COUCHDB-100: DELETE on non-existent DB returns 500 instead of 404
+  db.deleteDb();
+
+  db.createDb();
+
+  // PUT on existing DB should return 412 instead of 500
+  if (debug) debugger;
+
+  var xhr = CouchDB.request("PUT", "/test_suite_db/test", {body: "{}"});
+  var host = CouchDB.host;
+
+  TEquals(CouchDB.protocol + host + "/test_suite_db/test", 
+    xhr.getResponseHeader("Location"),
+    "should include ip address");
+
+  xhr = CouchDB.request("PUT", "/test_suite_db/test2", {
+    body: "{}",
+    headers: {"X-Forwarded-Host": "mysite.com"}
+  });
+
+  TEquals(CouchDB.protocol + "mysite.com/test_suite_db/test2",
+    xhr.getResponseHeader("Location"),
+    "should include X-Forwarded-Host");
+
+  run_on_modified_server([{
+    section:"httpd",
+    key:"x_forwarded_host",
+    value:"X-Host"}],
+    function() {
+      xhr = CouchDB.request("PUT", "/test_suite_db/test3", {
+        body: "{}",
+        headers: {"X-Host": "mysite2.com"}
+      });
+      TEquals(CouchDB.protocol + "mysite2.com/test_suite_db/test3",
+        xhr.getResponseHeader("Location"),
+        "should include X-Host");
+    });
+}

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/test/invalid_docids.js
----------------------------------------------------------------------
diff --git a/share/test/invalid_docids.js b/share/test/invalid_docids.js
new file mode 100644
index 0000000..d0195b0
--- /dev/null
+++ b/share/test/invalid_docids.js
@@ -0,0 +1,77 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+
+couchTests.invalid_docids = function(debug) {
+  var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"});
+  db.deleteDb();
+  db.createDb();
+  if (debug) debugger;
+
+  // Test _local explicitly first.
+  T(db.save({"_id": "_local/foo"}).ok);
+  T(db.open("_local/foo")._id == "_local/foo");
+
+  var urls = [
+      "/test_suite_db/_local",
+      "/test_suite_db/_local/",
+      "/test_suite_db/_local%2F",
+      "/test_suite_db/_local/foo/bar",
+  ];
+
+  urls.forEach(function(u) {
+    var res = db.request("PUT", u, {"body": "{}"});
+    T(res.status == 400);
+    T(JSON.parse(res.responseText).error == "bad_request");
+  });
+
+  //Test non-string
+  try {
+    db.save({"_id": 1});
+    T(1 == 0, "doc id must be string");
+  } catch(e) {
+      T(db.last_req.status == 400);
+      T(e.error == "bad_request");
+  }
+
+  // Via PUT with _id not in body.
+  var res = res = db.request("PUT", "/test_suite_db/_other", {"body": "{}"});
+  T(res.status == 400);
+  T(JSON.parse(res.responseText).error == "bad_request");
+
+  // Accidental POST to form handling code.
+  res = db.request("POST", "/test_suite_db/_tmp_view", {"body": "{}"});
+  T(res.status == 400);
+  T(JSON.parse(res.responseText).error == "bad_request");
+
+  // Test invalid _prefix
+  try {
+    db.save({"_id": "_invalid"});
+    T(1 == 0, "doc id may not start with underscore");
+  } catch(e) {
+      T(db.last_req.status == 400);
+      T(e.error == "bad_request");
+  }
+
+  // Test _bulk_docs explicitly.
+  var docs = [{"_id": "_design/foo"}, {"_id": "_local/bar"}];
+  db.bulkSave(docs);
+  docs.forEach(function(d) {T(db.open(d._id)._id == d._id);});
+
+  docs = [{"_id": "_invalid"}];
+  try {
+    db.bulkSave(docs);
+    T(1 == 0, "doc id may not start with underscore, even in bulk docs");
+  } catch(e) {
+      T(db.last_req.status == 400);
+      T(e.error == "bad_request");
+  }
+};

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/test/jsonp.js
----------------------------------------------------------------------
diff --git a/share/test/jsonp.js b/share/test/jsonp.js
new file mode 100644
index 0000000..e4f4490
--- /dev/null
+++ b/share/test/jsonp.js
@@ -0,0 +1,84 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+
+// Verify callbacks ran
+var jsonp_flag = 0;
+
+// Callbacks
+function jsonp_no_chunk(doc) {
+  T(jsonp_flag == 0);
+  T(doc._id == "0");
+  jsonp_flag = 1;
+}
+
+function jsonp_chunk(doc) {
+  T(jsonp_flag == 0);
+  T(doc.total_rows == 1);
+  jsonp_flag = 1;
+}
+
+// Do some jsonp tests.
+couchTests.jsonp = function(debug) {
+  var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"});
+  db.deleteDb();
+  db.createDb();
+  if (debug) debugger;
+  
+  var doc = {_id:"0",a:0,b:0};
+  T(db.save(doc).ok);
+  
+  // callback param is ignored unless jsonp is configured
+  var xhr = CouchDB.request("GET", "/test_suite_db/0?callback=jsonp_not_configured");
+  JSON.parse(xhr.responseText);
+
+  run_on_modified_server(
+    [{section: "httpd",
+      key: "allow_jsonp",
+      value: "true"}],
+  function() {
+
+    // Test unchunked callbacks.
+    var xhr = CouchDB.request("GET", "/test_suite_db/0?callback=jsonp_no_chunk");
+    TEquals("application/javascript", xhr.getResponseHeader("Content-Type"));
+    T(xhr.status == 200);
+    jsonp_flag = 0;
+    eval(xhr.responseText);
+    T(jsonp_flag == 1);
+    xhr = CouchDB.request("GET", "/test_suite_db/0?callback=foo\"");
+    T(xhr.status == 400);
+
+    // Test chunked responses
+    var doc = {_id:"1",a:1,b:1};
+    T(db.save(doc).ok);
+
+    var designDoc = {
+      _id:"_design/test",
+      language: "javascript",
+      views: {
+        all_docs: {map: "function(doc) {if(doc.a) emit(null, doc.a);}"}
+      }
+    };
+    T(db.save(designDoc).ok);
+
+    var url = "/test_suite_db/_design/test/_view/all_docs?callback=jsonp_chunk";
+    xhr = CouchDB.request("GET", url);
+    TEquals("application/javascript", xhr.getResponseHeader("Content-Type"));
+    T(xhr.status == 200);
+    jsonp_flag = 0;
+    eval(xhr.responseText);
+    T(jsonp_flag == 1);
+    xhr = CouchDB.request("GET", url + "\'");
+    T(xhr.status == 400);
+  });
+
+
+};

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/test/large_docs.js
----------------------------------------------------------------------
diff --git a/share/test/large_docs.js b/share/test/large_docs.js
new file mode 100644
index 0000000..b84648b
--- /dev/null
+++ b/share/test/large_docs.js
@@ -0,0 +1,33 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+
+couchTests.large_docs = function(debug) {
+  var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"});
+  db.deleteDb();
+  db.createDb();
+  if (debug) debugger;
+
+  var longtext = "0123456789\n";
+
+  for (var i=0; i<10; i++) {
+    longtext = longtext + longtext
+  }
+  T(db.save({"longtest":longtext}).ok);
+  T(db.save({"longtest":longtext}).ok);
+  T(db.save({"longtest":longtext}).ok);
+  T(db.save({"longtest":longtext}).ok);
+
+  // query all documents, and return the doc.foo member as a key.
+  results = db.query(function(doc){
+      emit(null, doc.longtest);
+  });
+};

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/test/list_views.js
----------------------------------------------------------------------
diff --git a/share/test/list_views.js b/share/test/list_views.js
new file mode 100644
index 0000000..ece81ea
--- /dev/null
+++ b/share/test/list_views.js
@@ -0,0 +1,492 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+
+couchTests.list_views = function(debug) {
+  var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"});
+  db.deleteDb();
+  db.createDb();
+  if (debug) debugger;
+
+  var designDoc = {
+    _id:"_design/lists",
+    language: "javascript",
+    views : {
+      basicView : {
+        map : stringFun(function(doc) {
+          emit(doc.integer, doc.string);
+        })
+      },
+      withReduce : {
+        map : stringFun(function(doc) {
+          emit(doc.integer, doc.string);
+        }),
+        reduce : stringFun(function(keys, values, rereduce) {
+          if (rereduce) {
+            return sum(values);
+          } else {
+            return values.length;
+          }
+        })
+      }
+    },
+    lists: {
+      basicBasic : stringFun(function(head, req) {
+        send("head");
+        var row;
+        while(row = getRow()) {
+          log("row: "+toJSON(row));
+          send(row.key);
+        };
+        return "tail";
+      }),
+      basicJSON : stringFun(function(head, req) {
+        start({"headers":{"Content-Type" : "application/json"}});
+        send('{"head":'+toJSON(head)+', ');
+        send('"req":'+toJSON(req)+', ');
+        send('"rows":[');
+        var row, sep = '';
+        while (row = getRow()) {
+          send(sep + toJSON(row));
+          sep = ', ';
+        }
+        return "]}";
+      }),
+      simpleForm: stringFun(function(head, req) {
+        log("simpleForm");
+        send('<ul>');
+        var row, row_number = 0, prevKey, firstKey = null;
+        while (row = getRow()) {
+          row_number += 1;
+          if (!firstKey) firstKey = row.key;
+          prevKey = row.key;
+          send('\n<li>Key: '+row.key
+          +' Value: '+row.value
+          +' LineNo: '+row_number+'</li>');
+        }
+        return '</ul><p>FirstKey: '+ firstKey + ' LastKey: '+ prevKey+'</p>';
+      }),
+      acceptSwitch: stringFun(function(head, req) {
+        // respondWith takes care of setting the proper headers
+        provides("html", function() {
+          send("HTML <ul>");
+
+          var row, num = 0;
+          while (row = getRow()) {
+            num ++;
+            send('\n<li>Key: '
+              +row.key+' Value: '+row.value
+              +' LineNo: '+num+'</li>');
+          }
+
+          // tail
+          return '</ul>';
+        });
+      }),
+      qsParams: stringFun(function(head, req) {
+        return toJSON(req.query) + "\n";
+      }),
+      stopIter: stringFun(function(req) {
+        send("head");
+        var row, row_number = 0;
+        while(row = getRow()) {
+          if(row_number > 2) break;
+          send(" " + row_number);
+          row_number += 1;
+        };
+        return " tail";
+      }),
+      stopIter2: stringFun(function(head, req) {
+        provides("html", function() {
+          send("head");
+          var row, row_number = 0;
+          while(row = getRow()) {
+            if(row_number > 2) break;
+            send(" " + row_number);
+            row_number += 1;
+          };
+          return " tail";
+        });
+      }),
+      tooManyGetRows : stringFun(function() {
+        send("head");
+        var row;
+        while(row = getRow()) {
+          send(row.key);
+        };
+        getRow();
+        getRow();
+        getRow();
+        row = getRow();
+        return "after row: "+toJSON(row);
+      }),
+      emptyList: stringFun(function() {
+        return " ";
+      }),
+      rowError : stringFun(function(head, req) {
+        send("head");
+        var row = getRow();
+        send(fooBarBam); // intentional error
+        return "tail";
+      }),
+      docReference : stringFun(function(head, req) {
+        send("head");
+        var row = getRow();
+        send(row.doc.integer);
+        return "tail";
+      }),
+      secObj: stringFun(function(head, req) {
+        return toJSON(req.secObj);
+      }),
+      setHeaderAfterGotRow: stringFun(function(head, req) {
+        getRow();
+        start({
+          code: 400,
+          headers: {
+            "X-My-Header": "MyHeader"
+          }
+        });
+        send("bad request");
+      }),
+      allDocs: stringFun(function(head, req){
+        start({'headers': {'Content-Type': 'application/json'}});
+        var resp = head;
+        var rows = [];
+        while(row=getRow()){
+          rows.push(row);
+        }
+        resp.rows = rows;
+        return toJSON(resp);
+      })
+    }
+  };
+  var viewOnlyDesignDoc = {
+    _id:"_design/views",
+    language: "javascript",
+    views : {
+      basicView : {
+        map : stringFun(function(doc) {
+          emit(-doc.integer, doc.string);
+        })
+      }
+    }
+  };
+  var erlListDoc = {
+    _id: "_design/erlang",
+    language: "erlang",
+    lists: {
+        simple:
+            'fun(Head, {Req}) -> ' +
+            '  Send(<<"[">>), ' +
+            '  Fun = fun({Row}, Sep) -> ' +
+            '    Val = couch_util:get_value(<<"key">>, Row, 23), ' +
+            '    Send(list_to_binary(Sep ++ integer_to_list(Val))), ' +
+            '    {ok, ","} ' +
+            '  end, ' +
+            '  {ok, _} = FoldRows(Fun, ""), ' +
+            '  Send(<<"]">>) ' +
+            'end.'
+    }
+  };
+
+  T(db.save(designDoc).ok);
+
+  var docs = makeDocs(0, 10);
+  db.bulkSave(docs);
+
+  var view = db.view('lists/basicView');
+  T(view.total_rows == 10);
+
+  // standard get
+  var xhr = CouchDB.request("GET", "/test_suite_db/_design/lists/_list/basicBasic/basicView");
+  T(xhr.status == 200, "standard get should be 200");
+  T(/head0123456789tail/.test(xhr.responseText));
+
+  // standard options
+  var xhr = CouchDB.request("OPTIONS", "/test_suite_db/_design/lists/_list/basicBasic/basicView");
+  T(xhr.status == 200, "standard get should be 200");
+  T(/head0123456789tail/.test(xhr.responseText));
+
+  // test that etags are available
+  var etag = xhr.getResponseHeader("etag");
+  xhr = CouchDB.request("GET", "/test_suite_db/_design/lists/_list/basicBasic/basicView", {
+    headers: {"if-none-match": etag}
+  });
+  T(xhr.status == 304);
+  
+  // confirm ETag changes with different POST bodies
+  xhr = CouchDB.request("POST", "/test_suite_db/_design/lists/_list/basicBasic/basicView",
+    {body: JSON.stringify({keys:[1]})}
+  );
+  var etag1 = xhr.getResponseHeader("etag");
+  xhr = CouchDB.request("POST", "/test_suite_db/_design/lists/_list/basicBasic/basicView",
+    {body: JSON.stringify({keys:[2]})}
+  );
+  var etag2 = xhr.getResponseHeader("etag");
+  T(etag1 != etag2, "POST to map _list generates key-depdendent ETags");
+
+  // test the richness of the arguments
+  xhr = CouchDB.request("GET", "/test_suite_db/_design/lists/_list/basicJSON/basicView?update_seq=true");
+  T(xhr.status == 200, "standard get should be 200");
+  var resp = JSON.parse(xhr.responseText);
+  TEquals(10, resp.head.total_rows);
+  TEquals(0, resp.head.offset);
+  TEquals(11, resp.head.update_seq);
+  
+  T(resp.rows.length == 10);
+  TEquals(resp.rows[0], {"id": "0","key": 0,"value": "0"});
+
+  TEquals(resp.req.info.db_name, "test_suite_db");
+  TEquals(resp.req.method, "GET");
+  TEquals(resp.req.path, [
+      "test_suite_db",
+      "_design",
+      "lists",
+      "_list",
+      "basicJSON",
+      "basicView"
+  ]);
+  T(resp.req.headers.Accept);
+  T(resp.req.headers.Host);
+  T(resp.req.headers["User-Agent"]);
+  T(resp.req.cookie);
+  TEquals("/test_suite_db/_design/lists/_list/basicJSON/basicView?update_seq=true",
+    resp.req.raw_path, "should include raw path");
+
+  // get with query params
+  xhr = CouchDB.request("GET", "/test_suite_db/_design/lists/_list/simpleForm/basicView?startkey=3&endkey=8");
+  T(xhr.status == 200, "with query params");
+  T(!(/Key: 1/.test(xhr.responseText)));
+  T(/FirstKey: 3/.test(xhr.responseText));
+  T(/LastKey: 8/.test(xhr.responseText));
+
+  // with 0 rows
+  var xhr = CouchDB.request("GET", "/test_suite_db/_design/lists/_list/simpleForm/basicView?startkey=30");
+  T(xhr.status == 200, "0 rows");
+  T(/<\/ul>/.test(xhr.responseText));
+
+  //too many Get Rows
+  var xhr = CouchDB.request("GET", "/test_suite_db/_design/lists/_list/tooManyGetRows/basicView");
+  T(xhr.status == 200, "tooManyGetRows");
+  T(/9after row: null/.test(xhr.responseText));
+
+
+  // reduce with 0 rows
+  var xhr = CouchDB.request("GET", "/test_suite_db/_design/lists/_list/simpleForm/withReduce?startkey=30");
+  T(xhr.status == 200, "reduce 0 rows");
+  T(/LastKey: undefined/.test(xhr.responseText));
+
+  // when there is a reduce present, but not used
+  var xhr = CouchDB.request("GET", "/test_suite_db/_design/lists/_list/simpleForm/withReduce?reduce=false");
+  T(xhr.status == 200, "reduce false");
+  T(/Key: 1/.test(xhr.responseText));
+
+
+  // when there is a reduce present, and used
+  xhr = CouchDB.request("GET", "/test_suite_db/_design/lists/_list/simpleForm/withReduce?group=true");
+  T(xhr.status == 200, "group reduce");
+  T(/Key: 1/.test(xhr.responseText));
+
+  // there should be etags on reduce as well
+  var etag = xhr.getResponseHeader("etag");
+  T(etag, "Etags should be served with reduce lists");
+  xhr = CouchDB.request("GET", "/test_suite_db/_design/lists/_list/simpleForm/withReduce?group=true", {
+    headers: {"if-none-match": etag}
+  });
+  T(xhr.status == 304);
+
+  // confirm ETag changes with different POST bodies
+  xhr = CouchDB.request("POST", "/test_suite_db/_design/lists/_list/simpleForm/withReduce?group=true",
+    {body: JSON.stringify({keys:[1]})}
+  );
+  var etag1 = xhr.getResponseHeader("etag");
+  xhr = CouchDB.request("POST", "/test_suite_db/_design/lists/_list/simpleForm/withReduce?group=true",
+    {body: JSON.stringify({keys:[2]})}
+  );
+  var etag2 = xhr.getResponseHeader("etag");
+  T(etag1 != etag2, "POST to reduce _list generates key-depdendent ETags");
+
+  // verify the etags expire correctly
+  var docs = makeDocs(11, 12);
+  db.bulkSave(docs);
+
+  xhr = CouchDB.request("GET", "/test_suite_db/_design/lists/_list/simpleForm/withReduce?group=true", {
+    headers: {"if-none-match": etag}
+  });
+  T(xhr.status == 200, "reduce etag");
+
+  // empty list
+  var xhr = CouchDB.request("GET", "/test_suite_db/_design/lists/_list/emptyList/basicView");
+  T(xhr.responseText.match(/^ $/));
+  xhr = CouchDB.request("GET", "/test_suite_db/_design/lists/_list/emptyList/withReduce?group=true");
+  T(xhr.responseText.match(/^ $/));
+
+  // multi-key fetch
+  var xhr = CouchDB.request("POST", "/test_suite_db/_design/lists/_list/simpleForm/basicView", {
+    body: '{"keys":[2,4,5,7]}'
+  });
+  T(xhr.status == 200, "multi key");
+  T(!(/Key: 1 /.test(xhr.responseText)));
+  T(/Key: 2/.test(xhr.responseText));
+  T(/FirstKey: 2/.test(xhr.responseText));
+  T(/LastKey: 7/.test(xhr.responseText));
+
+  // multi-key fetch with GET
+  var xhr = CouchDB.request("GET", "/test_suite_db/_design/lists/_list/simpleForm/basicView" +
+    "?keys=[2,4,5,7]");
+
+  T(xhr.status == 200, "multi key");
+  T(!(/Key: 1 /.test(xhr.responseText)));
+  T(/Key: 2/.test(xhr.responseText));
+  T(/FirstKey: 2/.test(xhr.responseText));
+  T(/LastKey: 7/.test(xhr.responseText));
+
+  // no multi-key fetch allowed when group=false
+  xhr = CouchDB.request("POST", "/test_suite_db/_design/lists/_list/simpleForm/withReduce?group=false", {
+    body: '{"keys":[2,4,5,7]}'
+  });
+  T(xhr.status == 400);
+  T(/query_parse_error/.test(xhr.responseText));
+
+  var xhr = CouchDB.request("GET", "/test_suite_db/_design/lists/_list/rowError/basicView");
+  T(/ReferenceError/.test(xhr.responseText));
+
+
+  // with include_docs and a reference to the doc.
+  var xhr = CouchDB.request("GET", "/test_suite_db/_design/lists/_list/docReference/basicView?include_docs=true");
+  T(xhr.responseText.match(/head0tail/));
+
+  // now with extra qs params
+  var xhr = CouchDB.request("GET", "/test_suite_db/_design/lists/_list/qsParams/basicView?foo=blam");
+  T(xhr.responseText.match(/blam/));
+
+  var xhr = CouchDB.request("GET", "/test_suite_db/_design/lists/_list/stopIter/basicView");
+  // T(xhr.getResponseHeader("Content-Type") == "text/plain");
+  T(xhr.responseText.match(/^head 0 1 2 tail$/) && "basic stop");
+
+  xhr = CouchDB.request("GET", "/test_suite_db/_design/lists/_list/stopIter2/basicView", {
+    headers : {
+      "Accept" : "text/html"
+    }
+  });
+  T(xhr.responseText.match(/^head 0 1 2 tail$/) && "stop 2");
+
+  // aborting iteration with reduce
+  var xhr = CouchDB.request("GET", "/test_suite_db/_design/lists/_list/stopIter/withReduce?group=true");
+  T(xhr.responseText.match(/^head 0 1 2 tail$/) && "reduce stop");
+  xhr = CouchDB.request("GET", "/test_suite_db/_design/lists/_list/stopIter2/withReduce?group=true", {
+    headers : {
+      "Accept" : "text/html"
+    }
+  });
+  T(xhr.responseText.match(/^head 0 1 2 tail$/) && "reduce stop 2");
+
+  // with accept headers for HTML
+  xhr = CouchDB.request("GET", "/test_suite_db/_design/lists/_list/acceptSwitch/basicView", {
+    headers: {
+      "Accept": 'text/html'
+    }
+  });
+  T(xhr.getResponseHeader("Content-Type") == "text/html; charset=utf-8");
+  T(xhr.responseText.match(/HTML/));
+  T(xhr.responseText.match(/Value/));
+
+  // Test we can run lists and views from separate docs.
+  T(db.save(viewOnlyDesignDoc).ok);
+  var url = "/test_suite_db/_design/lists/_list/simpleForm/views/basicView" +
+                "?startkey=-3";
+  xhr = CouchDB.request("GET", url);
+  T(xhr.status == 200, "multiple design docs.");
+  T(!(/Key: -4/.test(xhr.responseText)));
+  T(/FirstKey: -3/.test(xhr.responseText));
+  T(/LastKey: 0/.test(xhr.responseText));
+
+  // Test we do multi-key requests on lists and views in separate docs.
+  var url = "/test_suite_db/_design/lists/_list/simpleForm/views/basicView";
+  xhr = CouchDB.request("POST", url, {
+    body: '{"keys":[-2,-4,-5,-7]}'
+  });
+  
+  T(xhr.status == 200, "multi key separate docs");
+  T(!(/Key: -3/.test(xhr.responseText)));
+  T(/Key: -7/.test(xhr.responseText));
+  T(/FirstKey: -2/.test(xhr.responseText));
+  T(/LastKey: -7/.test(xhr.responseText));
+
+    // Test if secObj is available
+  var xhr = CouchDB.request("GET", "/test_suite_db/_design/lists/_list/secObj/basicView");
+  T(xhr.status == 200, "standard get should be 200");
+  var resp = JSON.parse(xhr.responseText);
+  T(typeof(resp) == "object");
+
+  var erlViewTest = function() {
+    T(db.save(erlListDoc).ok);
+    var url = "/test_suite_db/_design/erlang/_list/simple/views/basicView" +
+                "?startkey=-3";
+    xhr = CouchDB.request("GET", url);
+    T(xhr.status == 200, "multiple languages in design docs.");
+    var list = JSON.parse(xhr.responseText);
+    T(list.length == 4);
+    for(var i = 0; i < list.length; i++)
+    {
+        T(list[i] + 3 == i);
+    }
+  };
+
+  run_on_modified_server([{
+    section: "native_query_servers",
+    key: "erlang",
+    value: "{couch_native_process, start_link, []}"
+  }], erlViewTest);
+
+  // COUCHDB-1113
+  var ddoc = {
+    _id: "_design/test",
+    views: {
+      me: {
+        map: (function(doc) { emit(null,null)}).toString()
+      }
+    },
+    lists: {
+      you: (function(head, req) {
+        var row;
+        while(row = getRow()) {
+          send(row);
+        }
+      }).toString()
+    }
+  };
+  db.save(ddoc);
+
+  var resp = CouchDB.request("GET", "/" + db.name + "/_design/test/_list/you/me", {
+    headers: {
+      "Content-Type": "application/x-www-form-urlencoded"
+    }
+  });
+  TEquals(200, resp.status, "should return a 200 response");
+
+  // TEST HTTP header response set after getRow() called in _list function.
+  var xhr = CouchDB.request("GET", "/test_suite_db/_design/lists/_list/setHeaderAfterGotRow/basicView");
+  T(xhr.status == 400);
+  T(xhr.getResponseHeader("X-My-Header") == "MyHeader");
+  T(xhr.responseText.match(/^bad request$/));
+
+  // test handling _all_docs by _list functions. the result should be equal
+  var xhr_lAllDocs = CouchDB.request("GET", "/test_suite_db/_design/lists/_list/allDocs/_all_docs");
+  T(xhr_lAllDocs.status == 200, "standard get should be 200");
+  var xhr_allDocs = CouchDB.request("GET", "/test_suite_db/_all_docs");
+  var allDocs = JSON.parse(xhr_allDocs.responseText);
+  var lAllDocs = JSON.parse(xhr_lAllDocs.responseText);
+  TEquals(allDocs.total_rows, lAllDocs.total_rows, "total_rows mismatch");
+  TEquals(allDocs.offset, lAllDocs.offset, "offset mismatch");
+  TEquals(allDocs.rows.length, lAllDocs.rows.length, "amount of rows mismatch");
+  TEquals(allDocs.rows, lAllDocs.rows, "rows mismatch");
+};

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/test/lorem.txt
----------------------------------------------------------------------
diff --git a/share/test/lorem.txt b/share/test/lorem.txt
new file mode 100644
index 0000000..0ef85ba
--- /dev/null
+++ b/share/test/lorem.txt
@@ -0,0 +1,103 @@
+Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus nunc sapien, porta id pellentesque at, elementum et felis. Curabitur condimentum ante in metus iaculis quis congue diam commodo. Donec eleifend ante sed nulla dapibus convallis. Ut cursus aliquam neque, vel porttitor tellus interdum ut. Sed pharetra lacinia adipiscing. In tristique tristique felis non tincidunt. Nulla auctor mauris a velit cursus ultricies. In at libero quis justo consectetur laoreet. Nullam id ultrices nunc. Donec non turpis nulla, eu lacinia ante. Nunc eu orci et turpis pretium venenatis. Nam molestie, lacus at dignissim elementum, ante libero consectetur libero, ut lacinia lacus urna et purus. Nullam lorem ipsum, dapibus vel ullamcorper a, malesuada a metus. Sed porta adipiscing magna, quis pulvinar purus mattis fringilla. Integer pellentesque sapien in neque tristique ac iaculis libero ultricies. Ut eget pharetra purus.
+
+Nulla in convallis tellus. Proin tincidunt suscipit vulputate. Suspendisse potenti. Nullam tristique justo mi, a tristique ligula. Duis convallis aliquam iaculis. Nulla dictum fringilla congue. Suspendisse ac leo lectus, ac aliquam justo. Ut porttitor commodo mi sed luctus. Nulla at enim lorem. Nunc eu justo sapien, a blandit odio. Curabitur faucibus sollicitudin dolor, id lacinia sem auctor in. Donec varius nunc at lectus sagittis nec luctus arcu pharetra. Nunc sed metus justo. Cras vel mauris diam. Ut feugiat felis eget neque pharetra vestibulum consectetur massa facilisis. Quisque consectetur luctus nisi quis tincidunt. Vivamus cursus cursus quam non blandit. Pellentesque et velit lacus. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.
+
+In et dolor vitae orci adipiscing congue. Aliquam gravida nibh at nisl gravida molestie. Curabitur a bibendum sapien. Aliquam tincidunt, nulla nec pretium lobortis, odio augue tincidunt arcu, a lobortis odio sem ut purus. Donec accumsan mattis nunc vitae lacinia. Suspendisse potenti. Integer commodo nisl quis nibh interdum non fringilla dui sodales. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. In hac habitasse platea dictumst. Etiam ullamcorper, mi id feugiat bibendum, purus neque cursus mauris, id sodales quam nisi id velit. Sed lectus leo, tincidunt vel rhoncus imperdiet, blandit in leo. Integer quis magna nulla. Donec vel nisl magna, ut rhoncus dui. Aliquam gravida, nulla nec eleifend luctus, neque nibh pharetra ante, quis egestas elit metus a mi. Nunc nec augue quam. Morbi tincidunt tristique varius. Suspendisse iaculis elit feugiat magna pellentesque ultricies. Vestibulum aliquam tortor non ante ullamcorper fringilla. Donec iaculis
  mi quis mauris ornare vestibulum.
+
+In a magna nisi, a ultricies massa. Donec elit neque, viverra non tempor quis, fringilla in metus. Integer odio odio, euismod vitae mollis sed, sodales eget libero. Donec nec massa in felis ornare pharetra at nec tellus. Nunc lorem dolor, pretium vel auctor in, volutpat vitae felis. Maecenas rhoncus, orci vel blandit euismod, turpis erat tincidunt ante, elementum adipiscing nisl urna in nisi. Phasellus sagittis, enim sed accumsan consequat, urna augue lobortis erat, non malesuada quam metus sollicitudin ante. In leo purus, dignissim quis varius vel, pellentesque et nibh. In sed tortor iaculis libero mollis pellentesque id vitae lectus. In hac habitasse platea dictumst. Phasellus mauris enim, posuere eget luctus ac, iaculis et quam. Vivamus et nibh diam, elementum egestas tellus. Aenean vulputate malesuada est. Sed posuere porta diam a sodales. Proin eu sem non velit facilisis venenatis sed a turpis.
+
+Pellentesque sed risus a ante vulputate lobortis sit amet eu nisl. Suspendisse ut eros mi, a rhoncus lacus. Curabitur fermentum vehicula tellus, a ornare mi condimentum vel. Integer molestie volutpat viverra. Integer posuere euismod venenatis. Proin ac mauris sed nulla pharetra porttitor. Duis vel dui in risus sodales auctor sit amet non enim. Maecenas mollis lacus at ligula faucibus sodales. Cras vel neque arcu. Sed tincidunt tortor pretium nisi interdum quis dictum arcu laoreet. Morbi pretium ultrices feugiat. Maecenas convallis augue nec felis malesuada malesuada scelerisque mauris placerat. Sed at magna enim, at fringilla dolor. Quisque ut mattis dui. Praesent consectetur ante viverra nisi blandit pharetra. Quisque metus elit, dignissim vitae fermentum sit amet, fringilla imperdiet odio. Cras eget purus eget tellus feugiat luctus a ac purus. Cras vitae nisl vel augue rhoncus porttitor sit amet quis lorem. Donec interdum pellentesque adipiscing. Phasellus neque libero, aliquam in
  mattis vitae, consectetur adipiscing nibh.
+
+Donec nec nulla urna, ac sagittis lectus. Suspendisse non elit sed mi auctor facilisis vitae et lectus. Fusce ac vulputate mauris. Morbi condimentum ultrices metus, et accumsan purus malesuada at. Maecenas lobortis ante sed massa dictum vitae venenatis elit commodo. Proin tellus eros, adipiscing sed dignissim vitae, tempor eget ante. Aenean id tellus nec magna cursus pharetra vitae vel enim. Morbi vestibulum pharetra est in vulputate. Aliquam vitae metus arcu, id aliquet nulla. Phasellus ligula est, hendrerit nec iaculis ut, volutpat vel eros. Suspendisse vitae urna turpis, placerat adipiscing diam. Phasellus feugiat vestibulum neque eu dapibus. Nulla facilisi. Duis tortor felis, euismod sit amet aliquet in, volutpat nec turpis. Mauris rhoncus ipsum ut purus eleifend ut lobortis lectus dapibus. Quisque non erat lorem. Vivamus posuere imperdiet iaculis. Ut ligula lacus, eleifend at tempor id, auctor eu leo.
+
+Donec mi enim, laoreet pulvinar mollis eu, malesuada viverra nunc. In vitae metus vitae neque tempor dapibus. Maecenas tincidunt purus a felis aliquam placerat. Nulla facilisi. Suspendisse placerat pharetra mattis. Integer tempor malesuada justo at tempus. Maecenas vehicula lorem a sapien bibendum vel iaculis risus feugiat. Pellentesque diam erat, dapibus et pellentesque quis, molestie ut massa. Vivamus iaculis interdum massa id bibendum. Quisque ut mauris dui, sit amet varius elit. Vestibulum elit lorem, rutrum non consectetur ut, laoreet nec nunc. Donec nec mauris ante. Curabitur ut est sed odio pharetra laoreet. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur purus risus, laoreet sed porta id, sagittis vel ipsum. Maecenas nibh diam, cursus et varius sit amet, fringilla sed magna. Nullam id neque eu leo faucibus mollis. Duis nec adipiscing mauris. Suspendisse sollicitudin, enim eu pulvinar commodo, erat augue ultrices mi, a tristique magna sem non libero.
+
+Sed in metus nulla. Praesent nec adipiscing sapien. Donec laoreet, velit non rutrum vestibulum, ligula neque adipiscing turpis, at auctor sapien elit ut massa. Nullam aliquam, enim vel posuere rutrum, justo erat laoreet est, vel fringilla lacus nisi non lectus. Etiam lectus nunc, laoreet et placerat at, venenatis quis libero. Praesent in placerat elit. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Pellentesque fringilla augue eu nibh placerat dictum. Nunc porttitor tristique diam, eu aliquam enim aliquet vel. Aliquam lacinia interdum ipsum, in posuere metus luctus vel. Vivamus et nisl a eros semper elementum. Donec venenatis orci at diam tristique sollicitudin. In eu eros sed odio rutrum luctus non nec tellus.
+
+Nulla nec felis elit. Nullam in ipsum in ipsum consequat fringilla quis vel tortor. Phasellus non massa nisi, sit amet aliquam urna. Sed fermentum nibh vitae lacus tincidunt nec tincidunt massa bibendum. Etiam elit dui, facilisis sit amet vehicula nec, iaculis at sapien. Ut at massa id dui ultrices volutpat ut ac libero. Fusce ipsum mi, bibendum a lacinia et, pulvinar eget mauris. Proin faucibus urna ut lorem elementum vulputate. Duis quam leo, malesuada non euismod ut, blandit facilisis mauris. Suspendisse sit amet magna id velit tincidunt aliquet nec eu dolor. Curabitur bibendum lorem vel felis tempus dapibus. Aliquam erat volutpat. Aenean cursus tortor nec dui aliquet porta. Aenean commodo iaculis suscipit. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Quisque sit amet ornare elit. Nam ligula risus, vestibulum nec mattis in, condimentum ac ante. Donec fringilla, justo et ultrices faucibus, tellus est volutpat massa, vitae commodo sapien d
 iam non risus. Vivamus at arcu gravida purus mollis feugiat.
+
+Nulla a turpis quis sapien commodo dignissim eu quis justo. Maecenas eu lorem odio, ut hendrerit velit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Proin facilisis porttitor ullamcorper. Praesent mollis dignissim massa, laoreet aliquet velit pellentesque non. Nunc facilisis convallis tristique. Mauris porttitor ante at tellus convallis placerat. Morbi aliquet nisi ac nisl pulvinar id dictum nisl mollis. Sed ornare sem et risus placerat lobortis id eget elit. Integer consequat, magna id suscipit pharetra, nulla velit suscipit orci, ut interdum augue augue quis quam. Fusce pretium aliquet vulputate. Mauris blandit dictum molestie. Proin nulla nibh, bibendum eu placerat at, tincidunt ac nisl. Nullam vulputate metus ut libero rutrum ultricies. Nunc sit amet dui mauris. Suspendisse adipiscing lacus in augue eleifend mollis.
+
+Duis pretium ultrices mattis. Nam euismod risus a erat lacinia bibendum. Morbi massa tortor, consectetur id eleifend id, pellentesque vel tortor. Praesent urna lorem, porttitor at condimentum vitae, luctus eget elit. Maecenas fringilla quam convallis est hendrerit viverra. Etiam vehicula, sapien non pulvinar adipiscing, nisi massa vestibulum est, id interdum mauris velit eu est. Vestibulum est arcu, facilisis at ultricies non, vulputate id sapien. Vestibulum ipsum metus, pharetra nec pellentesque id, facilisis id sapien. Donec rutrum odio et lacus ultricies ullamcorper. Integer sed est ut mi posuere tincidunt quis non leo. Morbi tellus justo, ultricies sit amet ultrices quis, facilisis vitae magna. Donec ligula metus, pellentesque non tristique ac, vestibulum sed erat. Aliquam erat volutpat.
+
+Nam dignissim, nisl eget consequat euismod, sem lectus auctor orci, ut porttitor lacus dui ac neque. In hac habitasse platea dictumst. Fusce egestas porta facilisis. In hac habitasse platea dictumst. Mauris cursus rhoncus risus ac euismod. Quisque vitae risus a tellus venenatis convallis. Curabitur laoreet sapien eu quam luctus lobortis. Vivamus sollicitudin sodales dolor vitae sodales. Suspendisse pharetra laoreet aliquet. Maecenas ullamcorper orci vel tortor luctus iaculis ut vitae metus. Vestibulum ut arcu ac tellus mattis eleifend eget vehicula elit.
+
+In sed feugiat eros. Donec bibendum ullamcorper diam, eu faucibus mauris dictum sed. Duis tincidunt justo in neque accumsan dictum. Maecenas in rutrum sapien. Ut id feugiat lacus. Nulla facilisi. Nunc ac lorem id quam varius cursus a et elit. Aenean posuere libero eu tortor vehicula ut ullamcorper odio consequat. Sed in dignissim dui. Curabitur iaculis tempor quam nec placerat. Aliquam venenatis nibh et justo iaculis lacinia. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque tempus magna sed mi aliquet eget varius odio congue.
+
+Integer sem sem, semper in vestibulum vitae, lobortis quis erat. Duis ante lectus, fermentum sed tempor sit amet, placerat sit amet sem. Mauris congue tincidunt ipsum. Ut viverra, lacus vel varius pharetra, purus enim pulvinar ipsum, non pellentesque enim justo non erat. Fusce ipsum orci, ultrices sed pellentesque at, hendrerit laoreet enim. Nunc blandit mollis pretium. Ut mollis, nulla aliquam sodales vestibulum, libero lorem tempus tortor, a pellentesque nibh elit a ipsum. Phasellus fermentum ligula at neque adipiscing sollicitudin. Suspendisse id ipsum arcu. Sed tincidunt placerat viverra. Donec libero augue, porttitor sit amet varius eget, rutrum nec lacus. Proin blandit orci sit amet diam dictum id porttitor risus iaculis. Integer lacinia feugiat leo, vitae auctor turpis eleifend vel. Suspendisse lorem quam, pretium id bibendum sed, viverra vitae tortor. Nullam ultricies libero eu risus convallis eget ullamcorper nisi elementum. Mauris nulla elit, bibendum id vulputate vitae, i
 mperdiet rutrum lorem. Curabitur eget dignissim orci. Sed semper tellus ipsum, at blandit dui. Integer dapibus facilisis sodales. Vivamus sollicitudin varius est, quis ornare justo cursus id.
+
+Nunc vel ullamcorper mi. Suspendisse potenti. Nunc et urna a augue scelerisque ultrices non quis mi. In quis porttitor elit. Aenean quis erat nulla, a venenatis tellus. Fusce vestibulum nisi sed leo adipiscing dignissim. Nunc interdum, lorem et lacinia vestibulum, quam est mattis magna, sit amet volutpat elit augue at libero. Cras gravida dui quis velit lobortis condimentum et eleifend ligula. Phasellus ac metus quam, id venenatis mi. Aliquam ut turpis ac tellus dapibus dapibus eu in mi. Quisque eget nibh eros. Fusce consectetur leo velit.
+
+Vestibulum semper egestas mauris. Morbi vestibulum sem sem. Aliquam venenatis, felis sed eleifend porta, mauris diam semper arcu, sit amet ultricies est sapien sit amet libero. Vestibulum dui orci, ornare condimentum mollis nec, molestie ac eros. Proin vitae mollis velit. Praesent eget felis mi. Maecenas eu vulputate nisi. Vestibulum varius, arcu in ultricies vestibulum, nibh leo sagittis odio, ut bibendum nisl mi nec diam. Integer at enim feugiat nulla semper bibendum ut a velit. Proin at nisi ut lorem aliquam varius eget quis elit. Nullam nec odio vel lectus congue consequat adipiscing ac mi. Fusce vitae laoreet libero. Curabitur sit amet sem neque, nec posuere enim. Curabitur at massa a sem gravida iaculis nec et nibh. Sed vitae dui vitae leo tincidunt pretium a aliquam erat. Suspendisse ultricies odio at metus tempor in pellentesque arcu ultricies.
+
+Sed aliquam mattis quam, in vulputate sapien ultrices in. Pellentesque quis velit sed dui hendrerit cursus. Pellentesque non nunc lacus, a semper metus. Fusce euismod velit quis diam suscipit consequat. Praesent commodo accumsan neque. Proin viverra, ipsum non tristique ultrices, velit velit facilisis lorem, vel rutrum neque eros ac nisi. Suspendisse felis massa, faucibus in volutpat ac, dapibus et odio. Pellentesque id tellus sit amet risus ultricies ullamcorper non nec sapien. Nam placerat viverra ullamcorper. Nam placerat porttitor sapien nec pulvinar. Curabitur vel odio sit amet odio accumsan aliquet vitae a lectus. Pellentesque lobortis viverra consequat. Mauris elementum cursus nulla, sit amet hendrerit justo dictum sed. Maecenas diam odio, fringilla ac congue quis, adipiscing ut elit.
+
+Aliquam lorem eros, pharetra nec egestas vitae, mattis nec risus. Mauris arcu massa, sodales eget gravida sed, viverra vitae turpis. Ut ligula urna, euismod ac tincidunt eu, faucibus sed felis. Praesent mollis, ipsum quis rhoncus dignissim, odio sem venenatis nulla, at consequat felis augue vel erat. Nam fermentum feugiat volutpat. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Etiam vitae dui in nisi adipiscing ultricies non eu justo. Donec tristique ultricies adipiscing. Nulla sodales, nunc a tristique elementum, erat neque egestas nisl, at hendrerit orci sapien sed libero. Vivamus a mauris turpis, quis laoreet ipsum. Nunc nec mi et nisl pellentesque scelerisque. Vivamus volutpat, justo tristique lacinia condimentum, erat justo ultrices urna, elementum viverra eros augue non libero. Sed mollis mollis arcu, at fermentum diam suscipit quis.
+
+Etiam sit amet nibh justo, posuere volutpat nunc. Morbi pellentesque neque in orci volutpat eu scelerisque lorem dictum. Mauris mollis iaculis est, nec sagittis sapien consequat id. Nunc nec malesuada odio. Duis quis suscipit odio. Mauris purus dui, sodales id mattis sit amet, posuere in arcu. Phasellus porta elementum convallis. Maecenas at orci et mi vulputate sollicitudin in in turpis. Pellentesque cursus adipiscing neque sit amet commodo. Fusce ut mi eu lectus porttitor volutpat et nec felis.
+
+Curabitur scelerisque eros quis nisl viverra vel ultrices velit vestibulum. Sed lobortis pulvinar sapien ac venenatis. Sed ante nibh, rhoncus eget dictum in, mollis ut nisi. Phasellus facilisis mi non lorem tristique non eleifend sem fringilla. Integer ut augue est. In venenatis tincidunt scelerisque. Etiam ante dui, posuere quis malesuada vitae, malesuada a arcu. Aenean faucibus venenatis sapien, ut facilisis nisi blandit vel. Aenean ac lorem eu sem fermentum placerat. Proin neque purus, aliquet ut tincidunt ut, convallis sit amet eros. Phasellus vehicula ullamcorper enim non vehicula. Etiam porta odio ut ipsum adipiscing egestas id a odio. Pellentesque blandit, sapien ut pulvinar interdum, mi nulla hendrerit elit, in tempor diam enim a urna. In tellus odio, ornare sed condimentum a, mattis eu augue.
+
+Fusce hendrerit porttitor euismod. Donec malesuada egestas turpis, et ultricies felis elementum vitae. Nullam in sem nibh. Nullam ultricies hendrerit justo sit amet lobortis. Sed tincidunt, mauris at ornare laoreet, sapien purus elementum elit, nec porttitor nisl purus et erat. Donec felis nisi, rutrum ullamcorper gravida ac, tincidunt sit amet urna. Proin vel justo vitae eros sagittis bibendum a ut nibh. Phasellus sodales laoreet tincidunt. Maecenas odio massa, condimentum id aliquet ut, rhoncus vel lectus. Duis pharetra consectetur sapien. Phasellus posuere ultricies massa, non rhoncus risus aliquam tempus.
+
+Praesent venenatis magna id sem dictum eu vehicula ipsum vulputate. Sed a convallis sapien. Sed justo dolor, rhoncus vel rutrum mattis, sollicitudin ut risus. Nullam sit amet convallis est. Etiam non tincidunt ligula. Fusce suscipit pretium elit at ullamcorper. Quisque sollicitudin, diam id interdum porta, metus ipsum volutpat libero, id venenatis felis orci non velit. Suspendisse potenti. Mauris rutrum, tortor sit amet pellentesque tincidunt, erat quam ultricies odio, id aliquam elit leo nec leo. Pellentesque justo eros, rutrum at feugiat nec, porta et tellus. Aenean eget metus lectus.
+
+Praesent euismod, turpis quis laoreet consequat, neque ante imperdiet quam, ac semper tortor nibh in nulla. Integer scelerisque eros vehicula urna lacinia ac facilisis mauris accumsan. Phasellus at mauris nibh. Curabitur enim ante, rutrum sed adipiscing hendrerit, pellentesque non augue. In hac habitasse platea dictumst. Nam tempus euismod massa a dictum. Donec sit amet justo ac diam ultricies ultricies. Sed tincidunt erat quis quam tempus vel interdum erat rhoncus. In hac habitasse platea dictumst. Vestibulum vehicula varius sem eget interdum. Cras bibendum leo nec felis venenatis sed pharetra sem feugiat. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Sed quam orci, mollis eget sagittis accumsan, vulputate sit amet dui. Praesent eu elementum arcu.
+
+Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum nisl metus, hendrerit ut laoreet sed, consectetur at purus. Duis interdum congue lobortis. Nullam sed massa porta felis eleifend consequat sit amet nec metus. Aliquam placerat dictum erat at eleifend. Vestibulum libero ante, ullamcorper a porttitor suscipit, accumsan vel nisi. Donec et magna neque. Nam elementum ultrices justo, eget sollicitudin sapien imperdiet eget. Nullam auctor dictum nunc, at feugiat odio vestibulum a. Sed erat nulla, viverra hendrerit commodo id, ullamcorper ac orci. Phasellus pellentesque feugiat suscipit. Etiam egestas fermentum enim. Etiam gravida interdum tellus ac laoreet. Morbi mattis aliquet eros, non tempor erat ullamcorper in. Etiam pulvinar interdum turpis ac vehicula. Sed quam justo, accumsan id consectetur a, aliquet sed leo. Aenean vitae blandit mauris.
+
+In sed eros augue, non rutrum odio. Etiam vitae dui neque, in tristique massa. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Maecenas dictum elit at lectus tempor non pharetra nisl hendrerit. Sed sed quam eu lectus ultrices malesuada tincidunt a est. Nam vel eros risus. Maecenas eros elit, blandit fermentum tempor eget, lobortis id diam. Vestibulum lacinia lacus vitae magna volutpat eu dignissim eros convallis. Vivamus ac velit tellus, a congue neque. Integer mi nulla, varius non luctus in, dictum sit amet sem. Ut laoreet, sapien sit amet scelerisque porta, purus sapien vestibulum nibh, sed luctus libero massa ac elit. Donec iaculis odio eget odio sagittis nec venenatis lorem blandit.
+
+Aliquam imperdiet tellus posuere justo vehicula sed vestibulum ante tristique. Fusce feugiat faucibus purus nec molestie. Nulla tempor neque id magna iaculis quis sollicitudin eros semper. Praesent viverra sagittis luctus. Morbi sit amet magna sed odio gravida varius. Ut nisi libero, vulputate feugiat pretium tempus, egestas sit amet justo. Pellentesque consequat tempor nisi in lobortis. Sed fermentum convallis dui ac sollicitudin. Integer auctor augue eget tellus tempus fringilla. Proin nec dolor sapien, nec tristique nibh. Aliquam a velit at mi mattis aliquet.
+
+Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Aliquam ultrices erat non turpis auctor id ornare mauris sagittis. Quisque porttitor, tellus ut convallis sagittis, mi libero feugiat tellus, rhoncus placerat ipsum tortor id risus. Donec tincidunt feugiat leo. Cras id mi neque, eu malesuada eros. Ut molestie magna quis libero placerat malesuada. Aliquam erat volutpat. Aliquam non mauris lorem, in adipiscing metus. Donec eget ipsum in elit commodo ornare bibendum a nibh. Vivamus odio erat, placerat ac vestibulum eget, malesuada ut nisi. Etiam suscipit sollicitudin leo semper sollicitudin. Sed rhoncus risus sit amet sem eleifend dictum pretium sapien egestas. Nulla at urna nunc, vel aliquet leo. Praesent ultricies, mi eu pretium lobortis, erat nibh euismod leo, sit amet gravida sapien eros et turpis. Donec lacinia venenatis lectus, non lacinia mi hendrerit sit amet. Integer sed felis vel orci aliquam pulvinar. Phasellus et risus id erat euis
 mod tincidunt. Sed luctus tempor nisi, nec tempor ipsum elementum eget. Integer nisl tortor, viverra in dapibus at, mattis ac erat. Curabitur nec dui lectus.
+
+Phasellus suscipit, tortor eu varius fringilla, sapien magna egestas risus, ut suscipit dui mauris quis velit. Cras a sapien quis sapien hendrerit tristique a sit amet elit. Pellentesque dui arcu, malesuada et sodales sit amet, dapibus vel quam. Sed non adipiscing ligula. Ut vulputate purus at nisl posuere sodales. Maecenas diam velit, tincidunt id mattis eu, aliquam ac nisi. Maecenas pretium, augue a sagittis suscipit, leo ligula eleifend dolor, mollis feugiat odio augue non eros. Pellentesque scelerisque orci pretium quam mollis at lobortis dui facilisis. Morbi congue metus id tortor porta fringilla. Sed lorem mi, molestie fermentum sagittis at, gravida a nisi. Donec eu vestibulum velit. In viverra, enim eu elementum sodales, enim odio dapibus urna, eget commodo nisl mauris ut odio. Curabitur nec enim nulla. In nec elit ipsum. Nunc in massa suscipit magna elementum faucibus in nec ipsum. Nullam suscipit malesuada elementum. Etiam sed mi in nibh ultricies venenatis nec pharetra mag
 na. In purus ante, rhoncus vel placerat sed, fermentum sit amet dui. Sed at sodales velit.
+
+Duis suscipit pellentesque pellentesque. Praesent porta lobortis cursus. Quisque sagittis velit non tellus bibendum at sollicitudin lacus aliquet. Sed nibh risus, blandit a aliquet eget, vehicula et est. Suspendisse facilisis bibendum aliquam. Fusce consectetur convallis erat, eget mollis diam fermentum sollicitudin. Quisque tincidunt porttitor pretium. Nullam id nisl et urna vulputate dapibus. Donec quis lorem urna. Quisque id justo nec nunc blandit convallis. Nunc volutpat, massa sollicitudin adipiscing vestibulum, massa urna congue lectus, sit amet ultricies augue orci convallis turpis. Nulla at lorem elit. Nunc tristique, quam facilisis commodo porttitor, lacus ligula accumsan nisi, et laoreet justo ante vitae eros. Curabitur sed augue arcu. Phasellus porttitor vestibulum felis, ut consectetur arcu tempor non. In justo risus, semper et suscipit id, ullamcorper at urna. Quisque tincidunt, urna nec aliquam tristique, nibh odio faucibus augue, in ornare enim turpis accumsan dolor. 
 Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Suspendisse sodales varius turpis eu fermentum.
+
+Morbi ultricies diam eget massa posuere lobortis. Aliquam volutpat pellentesque enim eu porttitor. Donec lacus felis, consectetur a pretium vitae, bibendum non enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Etiam ut nibh a quam pellentesque auctor ut id velit. Duis lacinia justo eget mi placerat bibendum. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec velit tortor, tempus nec tristique id, aliquet sit amet turpis. Praesent et neque nec magna porta fringilla. Morbi id egestas eros. Donec semper tincidunt ullamcorper. Phasellus tempus lacinia hendrerit. Quisque faucibus pretium neque non convallis. Nunc malesuada accumsan rhoncus. Cras lobortis, sem sed fringilla convallis, augue velit semper nisl, commodo varius nisi diam ac leo.
+
+Quisque interdum tellus ac ante posuere ut cursus lorem egestas. Nulla facilisi. Aenean sed massa nec nisi scelerisque vulputate. Etiam convallis consectetur iaculis. Maecenas ac purus ut ante dignissim auctor ac quis lorem. Pellentesque suscipit tincidunt orci. Fusce aliquam dapibus orci, at bibendum ipsum adipiscing eget. Morbi pellentesque hendrerit quam, nec placerat urna vulputate sed. Quisque vel diam lorem. Praesent id diam quis enim elementum rhoncus sagittis eget purus. Quisque fringilla bibendum leo in laoreet. Vestibulum id nibh risus, non elementum metus. Ut a felis diam, non mollis nisl. Cras elit ante, ullamcorper quis iaculis eu, sodales vel est. Curabitur quis lobortis dolor. Aliquam mattis gravida metus pellentesque vulputate.
+
+Ut id augue id dolor luctus euismod et quis velit. Maecenas enim dolor, tempus sit amet hendrerit eu, faucibus vitae neque. Proin sit amet varius elit. Proin varius felis ullamcorper purus dignissim consequat. Cras cursus tempus eros. Nunc ultrices venenatis ullamcorper. Aliquam et feugiat tellus. Phasellus sit amet vestibulum elit. Phasellus ac purus lacus, et accumsan eros. Morbi ultrices, purus a porta sodales, odio metus posuere neque, nec elementum risus turpis sit amet magna. Sed est quam, ultricies at congue adipiscing, lobortis in justo. Proin iaculis dictum nunc, eu laoreet quam varius vitae. Donec sit amet feugiat turpis. Mauris sit amet magna quam, ac consectetur dui. Curabitur eget magna tellus, eu pharetra felis. Donec sit amet tortor nisl. Aliquam et tortor facilisis lacus tincidunt commodo. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Curabitur nunc magna, ultricies id convallis at, ullamcorper vitae massa.
+
+Phasellus viverra iaculis placerat. Nulla consequat dolor sit amet erat dignissim posuere. Nulla lacinia augue vitae mi tempor gravida. Phasellus non tempor tellus. Quisque non enim semper tortor sagittis facilisis. Aliquam urna felis, egestas at posuere nec, aliquet eu nibh. Praesent sed vestibulum enim. Mauris iaculis velit dui, et fringilla enim. Nulla nec nisi orci. Sed volutpat, justo eget fringilla adipiscing, nisl nulla condimentum libero, sed sodales est est et odio. Cras ipsum dui, varius eu elementum consequat, faucibus in leo. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.
+
+Ut malesuada molestie eleifend. Curabitur id enim dui, eu tincidunt nibh. Mauris sit amet ante leo. Duis turpis ipsum, bibendum sed mattis sit amet, accumsan quis dolor. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Aenean a imperdiet metus. Quisque sollicitudin felis id neque tempor scelerisque. Donec at orci felis. Vivamus tempus convallis auctor. Donec interdum euismod lobortis. Sed at lacus nec odio dignissim mollis. Sed sapien orci, porttitor tempus accumsan vel, tincidunt nec ante. Nunc rhoncus egestas dapibus. Suspendisse fermentum dictum fringilla. Nullam nisi justo, eleifend a consectetur convallis, porttitor et tortor. Proin vitae lorem non dolor suscipit lacinia eu eget nulla.
+
+Suspendisse egestas, sapien sit amet blandit scelerisque, nulla arcu tristique dui, a porta justo quam vitae arcu. In metus libero, bibendum non volutpat ut, laoreet vel turpis. Nunc faucibus velit eu ipsum commodo nec iaculis eros volutpat. Vivamus congue auctor elit sed suscipit. Duis commodo, libero eu vestibulum feugiat, leo mi dapibus tellus, in placerat nisl dui at est. Vestibulum viverra tristique lorem, ornare egestas erat rutrum a. Nullam at augue massa, ut consectetur ipsum. Pellentesque malesuada, velit ut lobortis sagittis, nisi massa semper odio, malesuada semper purus nisl vel lectus. Nunc dui sem, mattis vitae laoreet vitae, sollicitudin ac leo. Nulla vel fermentum est.
+
+Vivamus in odio a nisi dignissim rhoncus in in lacus. Donec et nisl tortor. Donec sagittis consequat mi, vel placerat tellus convallis id. Aliquam facilisis rutrum nisl sed pretium. Donec et lacinia nisl. Aliquam erat volutpat. Curabitur ac pulvinar tellus. Nullam varius lobortis porta. Cras dapibus, ligula ut porta ultricies, leo lacus viverra purus, quis mollis urna risus eu leo. Nunc malesuada consectetur purus, vel auctor lectus scelerisque posuere. Maecenas dui massa, vestibulum bibendum blandit non, interdum eget mauris. Phasellus est ante, pulvinar at imperdiet quis, imperdiet vel urna. Quisque eget volutpat orci. Quisque et arcu purus, ut faucibus velit.
+
+Praesent sed ipsum urna. Praesent sagittis varius magna, id commodo dolor malesuada ac. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Quisque sit amet nunc eu sem ornare tempor. Mauris id dolor nec erat convallis porta in lobortis nisi. Curabitur hendrerit rhoncus tortor eu hendrerit. Pellentesque eu ante vel elit luctus eleifend quis viverra nulla. Suspendisse odio diam, euismod eu porttitor molestie, sollicitudin sit amet nulla. Sed ante urna, dictum bibendum rhoncus et, blandit nec ante. Suspendisse tortor augue, accumsan quis suscipit id, accumsan sit amet erat. Donec pharetra varius lobortis. Maecenas ipsum diam, faucibus eu tempus id, convallis nec enim. Duis arcu turpis, fringilla nec egestas ut, dignissim tristique nulla. Curabitur suscipit dui non justo ultrices pharetra. Aliquam erat volutpat. Nulla facilisi. Quisque id felis eu sem aliquam fringilla.
+
+Etiam quis augue in tellus consequat eleifend. Aenean dignissim congue felis id elementum. Duis fringilla varius ipsum, nec suscipit leo semper vel. Ut sollicitudin, orci a tincidunt accumsan, diam lectus laoreet lacus, vel fermentum quam est vel eros. Aliquam fringilla sapien ac sapien faucibus convallis. Aliquam id nunc eu justo consequat tincidunt. Quisque nec nisl dui. Phasellus augue lectus, varius vitae auctor vel, rutrum at risus. Vivamus lacinia leo quis neque ultrices nec elementum felis fringilla. Proin vel porttitor lectus.
+
+Curabitur sapien lorem, mollis ut accumsan non, ultricies et metus. Curabitur vel lorem quis sapien fringilla laoreet. Morbi id urna ac orci elementum blandit eget volutpat neque. Pellentesque sem odio, iaculis eu pharetra vitae, cursus in quam. Nulla molestie ligula id massa luctus et pulvinar nisi pulvinar. Nunc fermentum augue a lacus fringilla rhoncus porttitor erat dictum. Nunc sit amet tellus et dui viverra auctor euismod at nisl. In sed congue magna. Proin et tortor ut augue placerat dignissim a eu justo. Morbi porttitor porta lobortis. Pellentesque nibh lacus, adipiscing ut tristique quis, consequat vitae velit. Maecenas ut luctus libero. Vivamus auctor odio et erat semper sagittis. Vivamus interdum velit in risus mattis quis dictum ante rhoncus. In sagittis porttitor eros, at lobortis metus ultrices vel. Curabitur non aliquam nisl. Vestibulum luctus feugiat suscipit. Etiam non lacus vel nulla egestas iaculis id quis risus.
+
+Etiam in auctor urna. Fusce ultricies molestie convallis. In hac habitasse platea dictumst. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Mauris iaculis lorem faucibus purus gravida at convallis turpis sollicitudin. Suspendisse at velit lorem, a fermentum ipsum. Etiam condimentum, dui vel condimentum elementum, sapien sem blandit sapien, et pharetra leo neque et lectus. Nunc viverra urna iaculis augue ultrices ac porttitor lacus dignissim. Aliquam ut turpis dui. Sed eget aliquet felis. In bibendum nibh sit amet sapien accumsan accumsan pharetra magna molestie.
+
+Mauris aliquet urna eget lectus adipiscing at congue turpis consequat. Vivamus tincidunt fermentum risus et feugiat. Nulla molestie ullamcorper nibh sed facilisis. Phasellus et cursus purus. Nam cursus, dui dictum ultrices viverra, erat risus varius elit, eu molestie dui eros quis quam. Aliquam et ante neque, ac consectetur dui. Donec condimentum erat id elit dictum sed accumsan leo sagittis. Proin consequat congue risus, vel tincidunt leo imperdiet eu. Vestibulum malesuada turpis eu metus imperdiet pretium. Aliquam condimentum ultrices nibh, eu semper enim eleifend a. Etiam condimentum nisl quam.
+
+Pellentesque id molestie nisl. Maecenas et lectus at justo molestie viverra sit amet sit amet ligula. Nullam non porttitor magna. Quisque elementum arcu cursus tortor rutrum lobortis. Morbi sit amet lectus vitae enim euismod dignissim eget at neque. Vivamus consequat vehicula dui, vitae auctor augue dignissim in. In tempus sem quis justo tincidunt sit amet auctor turpis lobortis. Pellentesque non est nunc. Vestibulum mollis fringilla interdum. Maecenas ipsum dolor, pharetra id tristique mattis, luctus vitae urna. Ut ullamcorper arcu eget elit convallis mollis. Pellentesque condimentum, massa ac hendrerit tempor, mauris purus blandit justo, et pharetra leo justo a est. Duis arcu augue, facilisis vel dignissim sed, aliquam quis magna. Quisque non consequat dolor. Suspendisse a ultrices leo.
+
+Donec vitae pretium nibh. Maecenas bibendum bibendum diam in placerat. Ut accumsan, mi vitae vestibulum euismod, nunc justo vulputate nisi, non placerat mi urna et diam. Maecenas malesuada lorem ut arcu mattis mollis. Nulla facilisi. Donec est leo, bibendum eu pulvinar in, cursus vel metus. Aliquam erat volutpat. Nullam feugiat porttitor neque in vulputate. Quisque nec mi eu magna consequat cursus non at arcu. Etiam risus metus, sollicitudin et ultrices at, tincidunt sed nunc. Sed eget scelerisque augue. Ut fringilla venenatis sem non eleifend. Nunc mattis, risus sit amet vulputate varius, risus justo egestas mauris, id interdum odio ipsum et nisl. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi id erat odio, nec pulvinar enim.
+
+Curabitur ac fermentum quam. Morbi eu eros sapien, vitae tempus dolor. Mauris vestibulum blandit enim ut venenatis. Aliquam egestas, eros at consectetur tincidunt, lorem augue iaculis est, nec mollis felis arcu in nunc. Sed in odio sed libero pellentesque volutpat vitae a ante. Morbi commodo volutpat tellus, ut viverra purus placerat fermentum. Integer iaculis facilisis arcu, at gravida lorem bibendum at. Aenean id eros eget est sagittis convallis sed et dui. Donec eu pulvinar tellus. Nunc dignissim rhoncus tellus, at pellentesque metus luctus at. Sed ornare aliquam diam, a porttitor leo sollicitudin sed. Nam vitae lectus lacus. Integer adipiscing quam neque, blandit posuere libero. Sed libero nunc, egestas sodales tempus sed, cursus blandit tellus. Vestibulum mi purus, ultricies quis placerat vel, molestie at dui.
+
+Nulla commodo odio justo. Pellentesque non ornare diam. In consectetur sapien ac nunc sagittis malesuada. Morbi ullamcorper tempor erat nec rutrum. Duis ut commodo justo. Cras est orci, consectetur sed interdum sed, scelerisque sit amet nulla. Vestibulum justo nulla, pellentesque a tempus et, dapibus et arcu. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi tristique, eros nec congue adipiscing, ligula sem rhoncus felis, at ornare tellus mauris ac risus. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Proin mauris dui, tempor fermentum dictum et, cursus a leo. Maecenas nec nisl a tellus pellentesque rhoncus. Nullam ultrices euismod dui eu congue.
+
+In nec tempor risus. In faucibus nisi eget diam dignissim consequat. Donec pulvinar ante nec enim mattis rutrum. Vestibulum leo augue, molestie nec dapibus in, dictum at enim. Integer aliquam, lorem eu vulputate lacinia, mi orci tempor enim, eget mattis ligula magna a magna. Praesent sed erat ut tortor interdum viverra. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla facilisi. Maecenas sit amet lectus lacus. Nunc vitae purus id ligula laoreet condimentum. Duis auctor tortor vel dui pulvinar a facilisis arcu dignissim. In hac habitasse platea dictumst. Donec sollicitudin pellentesque egestas. Sed sed sem justo. Maecenas laoreet hendrerit mauris, ut porttitor lorem iaculis ac. Quisque molestie sem quis lorem tempor rutrum. Phasellus nibh mauris, rhoncus in consectetur non, aliquet eu massa.
+
+Curabitur velit arcu, pretium porta placerat quis, varius ut metus. Vestibulum vulputate tincidunt justo, vitae porttitor lectus imperdiet sit amet. Vivamus enim dolor, sollicitudin ut semper non, ornare ornare dui. Aliquam tempor fermentum sapien eget condimentum. Curabitur laoreet bibendum ante, in euismod lacus lacinia eu. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Suspendisse potenti. Sed at libero eu tortor tempus scelerisque. Nulla facilisi. Nullam vitae neque id justo viverra rhoncus pretium at libero. Etiam est urna, aliquam vel pulvinar non, ornare vel purus.
+
+Nulla varius, nisi eget condimentum semper, metus est dictum odio, vel mattis risus est sed velit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nunc non est nec tellus ultricies mattis ut eget velit. Integer condimentum ante id lorem blandit lacinia. Donec vel tortor augue, in condimentum nisi. Pellentesque pellentesque nulla ut nulla porttitor quis sodales enim rutrum. Sed augue risus, euismod a aliquet at, vulputate non libero. Nullam nibh odio, dignissim fermentum pulvinar ac, congue eu mi. Duis tincidunt, nibh id venenatis placerat, diam turpis gravida leo, sit amet mollis massa dolor quis mauris. Vivamus scelerisque sodales arcu et dapibus. Suspendisse potenti. Cras quis tellus arcu, quis laoreet sem. Fusce porttitor, sapien vel tristique sodales, velit leo porta arcu, quis pellentesque nunc metus non odio. Nam arcu libero, ullamcorper ut pharetra non, dignissim et velit. Quisque dolor lorem, vehicula sit amet scelerisque in, varius at n
 ulla. Pellentesque vitae sem eget tortor iaculis pulvinar. Sed nunc justo, euismod gravida pulvinar eget, gravida eget turpis. Cras vel dictum nisi. Nullam nulla libero, gravida sit amet aliquam quis, commodo vitae odio. Cras vitae nibh nec dui placerat semper.
+
+Vivamus at fringilla eros. Vivamus at nisl id massa commodo feugiat quis non massa. Morbi tellus urna, auctor sit amet elementum sed, rutrum non lectus. Nulla feugiat dui in sapien ornare et imperdiet est ornare. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum semper rutrum tempor. Sed in felis nibh, sed aliquam enim. Curabitur ut quam scelerisque velit placerat dictum. Donec eleifend vehicula purus, eu vestibulum sapien rutrum eu. Vivamus in odio vel est vulputate iaculis. Nunc rutrum feugiat pretium.
+
+Maecenas ipsum neque, auctor quis lacinia vitae, euismod ac orci. Donec molestie massa consequat est porta ac porta purus tincidunt. Nam bibendum leo nec lacus mollis non condimentum dolor rhoncus. Nulla ac volutpat lorem. Nullam erat purus, convallis eget commodo id, varius quis augue. Nullam aliquam egestas mi, vel suscipit nisl mattis consequat. Quisque vel egestas sapien. Nunc lorem velit, convallis nec laoreet et, aliquet eget massa. Nam et nibh ac dui vehicula aliquam quis eu augue. Cras vel magna ut elit rhoncus interdum iaculis volutpat nisl. Suspendisse arcu lorem, varius rhoncus tempor id, pulvinar sed tortor. Pellentesque ultricies laoreet odio ac dignissim. Aliquam diam arcu, placerat quis egestas eget, facilisis eu nunc. Mauris vulputate, nisl sit amet mollis interdum, risus tortor ornare orci, sed egestas orci eros non diam. Vestibulum hendrerit, metus quis placerat pellentesque, enim purus faucibus dui, sit amet ultricies lectus ipsum id lorem. Class aptent taciti soc
 iosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Praesent eget diam odio, eu bibendum elit. In vestibulum orci eu erat tincidunt tristique.
+
+Cras consectetur ante eu turpis placerat sollicitudin. Mauris et lacus tortor, eget pharetra velit. Donec accumsan ultrices tempor. Donec at nibh a elit condimentum dapibus. Integer sit amet vulputate ante. Suspendisse potenti. In sodales laoreet massa vitae lacinia. Morbi vel lacus feugiat arcu vulputate molestie. Aliquam massa magna, ullamcorper accumsan gravida quis, rhoncus pulvinar nulla. Praesent sit amet ipsum diam, sit amet lacinia neque. In et sapien augue. Etiam enim elit, ultrices vel rutrum id, scelerisque non enim.
+
+Proin et egestas neque. Praesent et ipsum dolor. Nunc non varius nisl. Fusce in tortor nisi. Maecenas convallis neque in ligula blandit quis vehicula leo mollis. Pellentesque sagittis blandit leo, dapibus pellentesque leo ultrices ac. Curabitur ac egestas libero. Donec pretium pharetra pretium. Fusce imperdiet, turpis eu aliquam porta, ante elit eleifend risus, luctus auctor arcu ante ut nunc. Vivamus in leo felis, vitae eleifend lacus. Donec tempus aliquam purus porttitor tristique. Suspendisse diam neque, suscipit feugiat fringilla non, eleifend sit nullam.


[32/37] goodbye Futon, old friend <3

Posted by ja...@apache.org.
http://git-wip-us.apache.org/repos/asf/couchdb/blob/cca309f3/share/www/fauxton/img/fontawesome-webfont.woff
----------------------------------------------------------------------
diff --git a/share/www/fauxton/img/fontawesome-webfont.woff b/share/www/fauxton/img/fontawesome-webfont.woff
deleted file mode 100644
index b9bd17e..0000000
Binary files a/share/www/fauxton/img/fontawesome-webfont.woff and /dev/null differ

http://git-wip-us.apache.org/repos/asf/couchdb/blob/cca309f3/share/www/fauxton/img/fontcustom_fauxton.eot
----------------------------------------------------------------------
diff --git a/share/www/fauxton/img/fontcustom_fauxton.eot b/share/www/fauxton/img/fontcustom_fauxton.eot
deleted file mode 100644
index 48ed90d..0000000
Binary files a/share/www/fauxton/img/fontcustom_fauxton.eot and /dev/null differ

http://git-wip-us.apache.org/repos/asf/couchdb/blob/cca309f3/share/www/fauxton/img/fontcustom_fauxton.svg
----------------------------------------------------------------------
diff --git a/share/www/fauxton/img/fontcustom_fauxton.svg b/share/www/fauxton/img/fontcustom_fauxton.svg
deleted file mode 100644
index 79459f3..0000000
--- a/share/www/fauxton/img/fontcustom_fauxton.svg
+++ /dev/null
@@ -1,200 +0,0 @@
-<?xml version="1.0" standalone="no"?>
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
-<!--
-2013-7-2: Created.
--->
-<svg xmlns="http://www.w3.org/2000/svg">
-<metadata>
-Created by FontForge 20120731 at Tue Jul  2 15:07:12 2013
- By Sue Lockwood
-Created by Sue Lockwood with FontForge 2.0 (http://fontforge.sf.net)
-</metadata>
-<defs>
-<font id="fontcustom_fauxton" horiz-adv-x="512" >
-  <font-face 
-    font-family="fontcustom_fauxton"
-    font-weight="500"
-    font-stretch="normal"
-    units-per-em="512"
-    panose-1="2 0 6 9 0 0 0 0 0 0"
-    ascent="448"
-    descent="-64"
-    bbox="0 -63.7441 512.201 448"
-    underline-thickness="25.6"
-    underline-position="-51.2"
-    unicode-range="U+F100-F125"
-  />
-    <missing-glyph />
-    <glyph glyph-name="uniF100" unicode="&#xf100;" 
-d="M2.43164 128.608v142.632h507.137v-142.632h-507.137zM2.43164 81.0635h507.137v-142.632h-507.137v142.632zM493.72 -45.7197v110.936h-95.0879v-110.936h95.0879zM2.43164 445.568h507.137v-110.937h-507.137v110.937zM493.72 350.479v79.2402h-253.567v-79.2402
-h253.567z" />
-    <glyph glyph-name="uniF101" unicode="&#xf101;" 
-d="M478.972 2.39355c-48.708 -2.12891 -141.553 -10.46 -191.938 -36.6318c-2.37891 -15.2148 -14.9824 -27.0264 -30.8662 -27.0264c-15.8828 0 -28.4561 11.8115 -30.8652 27.0264c-50.3545 26.1719 -143.23 34.5029 -191.938 36.6318
-c-17.5615 0 -31.8291 14.2354 -31.8291 31.8281v381.949c0 17.5625 14.2676 31.8291 31.8291 31.8291c1.11914 0 2.03613 -0.543945 3.1543 -0.637695c218.887 -5.6416 219.648 -63.0205 219.648 -63.0205s0.761719 57.3789 219.648 63.0205
-c1.11914 0.09375 2.03613 0.637695 3.15527 0.637695c17.5928 0 31.8291 -14.2666 31.8291 -31.8291v-381.949c0 -17.5928 -14.2363 -31.8281 -31.8291 -31.8281zM224.34 348.254c-41.0615 20.8721 -108.978 29.5605 -159.146 33.2598v-317.202
-c85.4316 -4.32129 133.237 -17.127 159.146 -30.0898v314.032zM447.143 381.514c-50.1689 -3.69922 -118.085 -12.3877 -159.146 -33.2598v-314.032c25.9082 12.9316 73.7139 25.7539 159.146 30.0898v317.202zM415.312 320.684v-63.6582s-95.4863 0 -95.4863 -31.8291
-v63.6592s0 31.8281 95.4863 31.8281zM415.312 193.367v-63.6582s-95.4863 0 -95.4863 -31.8291v63.6582s0 31.8291 95.4863 31.8291zM192.511 288.855v-63.6592c0 31.8291 -95.4873 31.8291 -95.4873 31.8291v63.6582c95.4873 0 95.4873 -31.8281 95.4873 -31.8281z
-M192.511 161.538v-63.6582c0 31.8291 -95.4873 31.8291 -95.4873 31.8291v63.6582c95.4873 0 95.4873 -31.8291 95.4873 -31.8291z" />
-    <glyph glyph-name="uniF102" unicode="&#xf102;" 
-d="M167.89 -63.2324l-79.3857 79.7764l175.472 175.456l-175.472 175.472l79.8535 79.7607l255.139 -255.232z" />
-    <glyph glyph-name="uniF103" unicode="&#xf103;" 
-d="M255.092 446.464c140.025 0 253.556 -113.531 253.556 -253.556c0 -140.025 -113.546 -253.556 -253.556 -253.556c-140.024 0 -253.556 113.53 -253.556 253.556c0 140.024 113.546 253.556 253.556 253.556zM215.807 75.9111l197.201 197.215l-44.8184 44.8184
-l-152.397 -152.396l-71.8398 71.8604l-44.8096 -44.8174z" />
-    <glyph glyph-name="uniF104" unicode="&#xf104;" 
-d="M256.512 447.488c140.81 0 254.977 -114.166 254.977 -254.977c0 -140.81 -114.167 -254.976 -254.977 -254.976s-254.976 114.166 -254.976 254.976c0 140.811 114.166 254.977 254.976 254.977zM384 160.64v63.7441h-254.976v-63.7441h254.976z" />
-    <glyph glyph-name="uniF105" unicode="&#xf105;" 
-d="M256.195 446.464c140.635 0 254.659 -114.024 254.659 -254.659c0 -140.634 -114.024 -254.659 -254.659 -254.659s-254.659 114.025 -254.659 254.659c0 140.635 114.024 254.659 254.659 254.659zM383.524 159.973v63.6641h-95.498v95.498h-63.6641v-95.498h-95.4971
-v-63.6641h95.4971v-95.4961h63.665v95.4961h95.4971z" />
-    <glyph glyph-name="uniF106" unicode="&#xf106;" 
-d="M256.423 446.808c140.62 0 254.632 -114.012 254.632 -254.631c0 -140.618 -114.013 -254.631 -254.632 -254.631s-254.631 114.013 -254.631 254.631c0 140.619 114.012 254.631 254.631 254.631zM382.371 111.237l-80.9395 80.9395l80.9395 80.9404l-45.0078 45.0078
-l-80.9404 -80.9404l-80.9395 80.9404l-45.0088 -45.0078l80.9404 -80.9404l-80.9404 -80.9395l45.0088 -45.0078l80.9395 80.9395l80.9404 -80.9395z" />
-    <glyph glyph-name="uniF107" unicode="&#xf107;" 
-d="M511.744 160.645l-76.5098 -32.6094c-2.1084 -5.93457 -4.29395 -11.7754 -7.01172 -17.4912l31.5156 -76.3369l-45.2275 -45.2275l-76.7109 30.7344c-5.71582 -2.74805 -11.7129 -5.12207 -17.8037 -7.37109l-31.6406 -76.0869h-63.9678l-32.3594 75.7119
-c-6.37109 2.18652 -12.5557 4.49805 -18.6152 7.37109l-75.5244 -31.1094l-45.2275 45.2275l30.4219 75.8369c-2.99805 6.18457 -5.49609 12.4941 -7.80859 18.9912l-75.2744 31.3584v63.9688l75.2119 32.1709c2.31152 6.49609 4.74805 12.8066 7.74609 18.9902
-l-30.9844 75.3369l45.2275 45.2285l76.0244 -30.5469c6.05957 2.87305 12.1816 5.24707 18.5537 7.49609l31.6084 75.7119h63.9678l32.4219 -75.9619c6.12207 -2.18652 12.0566 -4.56055 17.8662 -7.37109l76.1494 31.3584l45.2588 -45.2266l-30.8906 -76.8369
-c2.74805 -5.7002 4.99707 -11.4941 7.12109 -17.4912l76.4619 -31.8584v-63.9678zM255.372 96.1758c52.9736 0 95.9521 42.9785 95.9521 95.9521c0 52.9746 -42.9785 95.9521 -95.9521 95.9521c-52.957 0 -95.9512 -42.9775 -95.9512 -95.9521
-c0 -52.9736 42.9932 -95.9521 95.9512 -95.9521z" />
-    <glyph glyph-name="uniF108" unicode="&#xf108;" 
-d="M256 235.195l228.377 -228.377l-68.6074 -68.6074l-159.77 159.769l-159.769 -159.769l-68.6074 68.6074zM256 445.44l228.377 -228.377l-68.6074 -68.6064l-159.77 159.768l-159.769 -159.768l-68.6074 68.6064z" />
-    <glyph glyph-name="uniF109" unicode="&#xf109;" 
-d="M512.201 -7.39062c0 -30.1455 -24.4502 -54.5957 -54.5977 -54.5957h-400.792c-30.1465 0 -54.5967 24.4502 -54.5967 54.5957v400.794c0 30.1455 24.4502 54.5967 54.5967 54.5967h400.792c30.1475 0 54.5977 -24.4512 54.5977 -54.5967v-400.794zM464.39 398.437
-c0 0.972656 -0.77832 1.75098 -1.74316 1.75098h-410.886c-0.956055 0 -1.73438 -0.77832 -1.73438 -1.75098v-410.869c0 -0.949219 0.77832 -1.74219 1.73438 -1.74219h410.886c0.96582 0 1.74316 0.792969 1.74316 1.74219v410.869zM100.945 76.1318l-38.9082 27.7959
-l96.0889 134.525l61.5615 -61.5635l65.6777 114.922l64.667 -80.8213l61.7871 98.8906l40.5586 -25.3213l-97.583 -156.103l-62.8301 78.5498l-61.8027 -108.199l-65.9346 65.9277z" />
-    <glyph glyph-name="uniF10A" unicode="&#xf10a;" 
-d="M250.592 -61.5244c-105.291 0 -190.688 42.6758 -190.688 95.3447v0v53.6611c0 -52.7305 85.4121 -85.4424 190.688 -85.4424c105.291 0 190.688 32.7119 190.688 85.4424v-53.6621v0c0 -52.668 -85.3818 -95.3438 -190.688 -95.3438zM250.592 33.8203
-c-105.291 0 -190.688 42.6748 -190.688 95.3438v53.6465c0 -52.6846 85.4121 -85.4287 190.688 -85.4287c105.291 0 190.688 32.7441 190.688 85.4287v-53.6465c0 -52.6689 -85.3818 -95.3438 -190.688 -95.3438zM250.592 129.164
-c-105.291 0 -190.688 42.6738 -190.688 95.3428v53.6475c0 -52.6846 85.4121 -85.4287 190.688 -85.4287c105.291 0 190.688 32.7432 190.688 85.4287v-53.6475c0 -52.6689 -85.3818 -95.3428 -190.688 -95.3428zM250.592 224.507
-c-105.275 0 -190.688 42.6748 -190.688 95.3438v31.7812c0 52.6689 85.3965 95.3438 190.688 95.3438s190.688 -42.6748 190.688 -95.3438v-31.7812c0 -52.6689 -85.3818 -95.3438 -190.688 -95.3438z" />
-    <glyph glyph-name="uniF10B" unicode="&#xf10b;" 
-d="M287.851 446.805l159.253 -159.222v-350.389h-382.207v509.61h222.954zM128.598 0.895508h254.805v254.806h-127.402v127.402h-127.402v-382.208z" />
-    <glyph glyph-name="uniF10C" unicode="&#xf10c;" 
-d="M335.36 446.976l158.72 -158.688v-253.983h-95.2324v-95.2314h-380.928v412.672h95.2324v95.2314h222.208zM335.36 2.55957v31.7441h-222.208v253.952h-31.7441v-285.696h253.952zM430.592 97.792v158.72h-126.976v126.977h-126.977v-285.696h253.952z" />
-    <glyph glyph-name="uniF10D" unicode="&#xf10d;" 
-d="M256 148.513l-228.994 228.995l68.793 68.793l160.201 -160.185l160.201 160.185l68.793 -68.793zM256 -62.3008l-228.994 228.993l68.793 68.7949l160.201 -160.201l160.201 160.201l68.793 -68.7949z" />
-    <glyph glyph-name="uniF10E" unicode="&#xf10e;" 
-d="M256.342 382.728c140.621 0 254.634 -188.489 254.634 -188.489s-114.013 -193.463 -254.634 -193.463s-254.635 193.463 -254.635 193.463s114.014 188.489 254.635 188.489zM256.342 64.4346c70.3105 0 127.317 57.0068 127.317 127.317
-s-57.0068 127.317 -127.317 127.317s-127.317 -57.0068 -127.317 -127.317s57.0068 -127.317 127.317 -127.317zM256.342 255.161c35.1553 0 63.6582 -28.5029 63.6582 -63.6582s-28.5029 -63.6582 -63.6582 -63.6582s-63.6592 28.5029 -63.6592 63.6582
-s28.5039 63.6582 63.6592 63.6582z" />
-    <glyph glyph-name="uniF10F" unicode="&#xf10f;" 
-d="M351.439 381.472c-52.2754 0 -94.7998 -42.5244 -94.7988 -94.8008c0 -4.9375 0.586914 -10.3701 1.85156 -17.1582l6.04785 -32.7119l-23.5146 -23.5137l-173.985 -173.985v-37.0312h63.2002v63.2002h63.1992v63.2002h63.2002v26.1689l18.5156 18.5156l2.90039 2.90137
-l23.5146 23.5146l32.7109 -6.04785c6.79004 -1.23438 12.2207 -1.85254 17.1582 -1.85254c52.2764 0 94.7998 42.5254 94.7998 94.8008s-42.5234 94.7998 -94.7998 94.7998zM351.439 444.672v0c87.2705 0 158.001 -70.7305 158.001 -158s-70.7305 -158 -158 -158
-c-9.875 0 -19.3799 1.17285 -28.6992 2.90039l-2.90137 -2.90039v-63.2002h-63.2002v-63.1992h-63.2002v-63.2002h-189.6v126.399l192.5 192.501c-1.72754 9.31934 -2.90039 18.8242 -2.90039 28.6992c0 87.2705 70.7305 158 158 158zM351.563 318.272
-c17.4658 0 31.6006 -14.1494 31.6006 -31.6006s-14.1338 -31.6006 -31.6006 -31.6006c-17.4512 0 -31.6006 14.1494 -31.6006 31.6006s14.1494 31.6006 31.6006 31.6006z" />
-    <glyph glyph-name="uniF110" unicode="&#xf110;" 
-d="M481.194 238.603l-46.6826 -46.6377c-29.1152 -29.0996 -72.3096 -34.9346 -107.445 -18.2158l107.445 107.499c12.3496 12.3418 12.3496 32.3262 0 44.6377l-44.6152 44.6914c-12.3193 12.3506 -32.2637 12.3506 -44.6143 0l-107.482 -107.507
-c-16.7266 35.1504 -10.8916 78.376 18.208 107.507l46.6055 46.6377c36.9883 36.957 96.9482 36.957 133.874 0l44.707 -44.6465c36.9268 -37.0039 36.9268 -96.9785 0 -133.966zM166.726 102.736c-12.3271 12.3496 -12.3271 32.2959 0 44.6299l133.912 133.913
-c12.3496 12.3496 32.2959 12.3496 44.6455 0c12.3496 -12.3428 12.3496 -32.2803 0 -44.6221l-133.913 -133.921c-12.3193 -12.3506 -32.3184 -12.3506 -44.6445 0zM77.4424 58.0596l44.6377 -44.6143c12.3496 -12.3496 32.3027 -12.3496 44.6289 0l107.53 107.508
-c16.75 -35.168 10.8682 -78.377 -18.2158 -107.508l-42.6768 -46.6367c-36.9961 -36.9883 -96.9395 -36.9883 -133.943 0l-48.6133 48.582c-36.957 36.9883 -36.957 96.9473 0 133.937l46.6211 42.6689c29.1621 29.0996 72.3555 34.9346 107.553 18.209l-107.521 -107.469
-c-12.3115 -12.3506 -12.3115 -32.3574 0 -44.6768z" />
-    <glyph glyph-name="uniF111" unicode="&#xf111;" 
-d="M510.208 382.88h-508.672v63.584h508.672v-63.584zM319.456 255.712h-317.92v63.584h317.92v-63.584zM510.208 64.96h-508.672v63.584h508.672v-63.584zM383.04 -62.208h-381.504v63.584h381.504v-63.584zM510.208 -30.416c0 -17.5723 -14.2812 -31.792 -31.792 -31.792
-c-17.6348 0 -31.8545 14.2188 -31.8545 31.792s14.2197 31.792 31.8545 31.792c17.5107 0 31.792 -14.2188 31.792 -31.792z" />
-    <glyph glyph-name="uniF112" unicode="&#xf112;" 
-d="M2.30371 128.576v126.848h507.393v-126.848h-507.393z" />
-    <glyph glyph-name="uniF113" unicode="&#xf113;" 
-d="M415.106 -61.2578h-317.007c-52.5352 0 -95.1025 42.5967 -95.1025 95.1016v317.006c0 52.5361 42.5664 95.1025 95.1025 95.1025h317.007c52.5039 0 95.1016 -42.5664 95.1016 -95.1025v-317.006c0 -52.5039 -42.5977 -95.1016 -95.1016 -95.1016zM446.807 350.85
-c0 17.4922 -14.1787 31.7012 -31.7002 31.7012h-317.007c-17.5225 0 -31.7012 -14.209 -31.7012 -31.7012v-317.006c0 -17.5225 14.1787 -31.7002 31.7012 -31.7002h317.007c17.5215 0 31.7002 14.1777 31.7002 31.7002v317.006zM351.704 97.2451v-47.5508
-c0 -8.74512 -7.08887 -15.8506 -15.8496 -15.8506c-8.76172 0 -15.8506 7.10547 -15.8506 15.8506v47.5508c-17.5225 0 -31.7012 14.1787 -31.7012 31.7012v31.7002c0 17.4912 14.1787 31.7002 31.7012 31.7002v142.653c0 8.74512 7.08887 15.8496 15.8506 15.8496
-c8.76074 0 15.8496 -7.10449 15.8496 -15.8496v-142.653c17.5225 0 31.7012 -14.209 31.7012 -31.7002v-31.7002c0 -17.5225 -14.1787 -31.7012 -31.7012 -31.7012zM193.201 192.347v-142.652c0 -8.74512 -7.10449 -15.8506 -15.8506 -15.8506
-s-15.8506 7.10547 -15.8506 15.8506v142.652c-17.5225 0 -31.7012 14.21 -31.7012 31.7012v31.7002c0 17.4912 14.1787 31.7012 31.7012 31.7012v47.5508c0 8.74512 7.10449 15.8496 15.8506 15.8496s15.8506 -7.10449 15.8506 -15.8496v-47.5508
-c17.5225 0 31.7012 -14.21 31.7012 -31.7012v-31.7002c-0.000976562 -17.4912 -14.1787 -31.7012 -31.7012 -31.7012z" />
-    <glyph glyph-name="uniF114" unicode="&#xf114;" 
-d="M25.3525 319.254v31.8145c0 52.7217 85.4834 95.4395 190.881 95.4395s190.882 -42.7178 190.882 -95.4395v-31.8145c0 -35.9141 -39.7363 -67.1689 -98.3926 -83.4639c-1.98828 -0.450195 -3.94531 -1.00977 -5.93359 -1.52246
-c-25.9736 -6.63281 -55.3633 -10.4541 -86.5557 -10.4541c-105.397 0.000976562 -190.881 42.7188 -190.881 95.4404zM384.062 234.299c14.6953 12.1943 23.0537 26.7178 23.0527 43.2002v-51.1074c-7.39453 3.24707 -15.1143 5.81055 -23.0527 7.90723zM205.748 1.33594
-c14.6016 -25.3037 35.8369 -46.2598 61.499 -60.2705c-16.249 -2.26855 -33.3359 -3.57324 -51.0137 -3.57324c-105.397 0 -190.881 42.749 -190.881 95.4395v53.7012c0 -50.9824 79.9062 -83.1836 180.396 -85.2969zM191.44 33.833
-c-93.6377 6.08984 -166.088 46.043 -166.089 94.54v53.7012c0 -47.4561 69.3125 -78.6484 160 -84.458c-0.589844 -5.57715 -0.931641 -11.2471 -0.931641 -16.9639c0 -16.2793 2.4541 -32.0303 7.02051 -46.8193zM192.032 129.243
-c-93.9502 5.93359 -166.68 45.9492 -166.68 94.5703v53.7012c0 -52.7373 85.4834 -85.5146 190.881 -85.5146c4.72266 0 9.35156 0.140625 13.9961 0.280273c-17.2734 -17.5381 -30.4932 -39.0527 -38.1973 -63.0371zM486.647 80.6523
-c0 -79.0674 -64.0928 -143.16 -143.16 -143.16c-79.0684 0 -143.161 64.0928 -143.161 143.16c0 79.0684 64.0938 143.161 143.161 143.161c79.0674 0.000976562 143.16 -64.0928 143.16 -143.161zM438.928 96.5605h-79.5342v79.5322h-31.8125v-79.5322h-79.5342v-31.8145
-h79.5342v-79.5342h31.8125v79.5342h79.5342v31.8145z" />
-    <glyph glyph-name="uniF115" unicode="&#xf115;" 
-d="M208.766 -59.6162c-46.3301 0 -89.874 18.0889 -122.595 50.8799c-32.7598 32.7432 -50.8096 76.2324 -50.8096 122.586c0.0302734 46.3223 18.0498 89.8584 50.8096 122.58l175.544 171.749c47.1777 47.2002 130.493 47.3848 178.093 -0.253906
-c49.1084 -49.1934 49.1084 -129.184 0 -178.322l-157.979 -154.101c-30.4199 -30.4355 -80.4199 -30.4961 -111.148 0.276367c-30.7285 30.79 -30.7285 80.7598 0 111.479l61.1465 61.1553l44.583 -44.582l-61.1465 -61.1475
-c-4.04199 -4.06348 -4.61914 -8.74414 -4.61914 -11.1465c0 -2.43066 0.577148 -7.11133 4.61914 -11.1758c8.06641 -8.03613 14.2168 -8.03613 22.291 0l157.888 154.123c24.3232 24.292 24.3232 64.2871 -0.24707 88.8965c-23.8301 23.8311 -65.334 23.8311 -89.165 0
-l-175.529 -171.766c-20.5908 -20.6211 -32.082 -48.3018 -32.082 -77.7656c0 -29.4971 11.4912 -57.2051 32.3281 -78.0195c41.6963 -41.7354 114.359 -41.7354 156.039 0l78.8203 78.8203l44.5527 -44.5674l-78.8213 -78.8193
-c-32.7275 -32.7617 -76.2568 -50.8799 -122.571 -50.8799z" />
-    <glyph glyph-name="uniF116" unicode="&#xf116;" 
-d="M192.16 1.76074l-190.368 -63.457l63.4561 190.368l317.28 317.28l126.912 -126.912zM65.248 1.76074l95.1836 31.7275l-63.4561 63.4561zM128.704 128.672l63.4561 -63.4561l190.368 190.367l-63.4561 63.457z" />
-    <glyph glyph-name="uniF117" unicode="&#xf117;" 
-d="M62.9756 448l383.425 -255.616l-383.425 -255.616v511.232z" />
-    <glyph glyph-name="uniF118" unicode="&#xf118;" 
-d="M511.232 256.288v-127.808h-191.713v-191.713h-127.808v191.713h-191.712v127.808h191.712v191.712h127.808v-191.712h191.713z" />
-    <glyph glyph-name="uniF119" unicode="&#xf119;" 
-d="M492.673 -62.7197h-474.753c0 61.3486 71.7646 112.591 169.562 129.326v25.1006c-40.3604 23.5342 -67.8223 66.7656 -67.8223 116.86v3.43066c-19.6826 7.0625 -33.918 25.3652 -33.918 47.4551c0 22.0742 14.2354 40.3916 33.9033 47.4248v3.42969
-c0.0146484 74.917 60.7275 135.645 135.644 135.645s135.644 -60.7275 135.644 -135.645v-3.42969c19.668 -7.0332 33.9033 -25.3506 33.9033 -47.4248c0 -22.0898 -14.2354 -40.3926 -33.9033 -47.4551v-3.43066c0 -50.0947 -27.4609 -93.3262 -67.8213 -116.813v-25.1016
-c97.8438 -16.7812 169.562 -68.0234 169.562 -129.372z" />
-    <glyph glyph-name="uniF11A" unicode="&#xf11a;" 
-d="M74.7285 233.082l-63.5254 63.5254c-6.20312 6.18945 -9.30469 14.3311 -9.30469 22.458c0 8.1416 3.10156 16.2686 9.30469 22.457l63.5254 63.5244c9.08887 9.04199 22.7373 11.7871 34.6172 6.90234c11.8486 -4.90137 19.6035 -16.5332 19.6035 -29.3594v-31.7939
-h31.7627v-63.5254h-31.7627v-31.7314c0 -12.8262 -7.75488 -24.459 -19.6035 -29.3594c-11.8799 -4.86914 -25.5283 -2.16992 -34.6172 6.90234zM437.271 150.931l63.5254 -63.5264c6.20312 -6.17188 9.30469 -14.2988 9.30469 -22.457
-c0 -8.12695 -3.10156 -16.2529 -9.30469 -22.4561l-63.5254 -63.5264c-9.08887 -9.05762 -22.7676 -11.7568 -34.6172 -6.88672c-11.8799 4.90137 -19.6035 16.5332 -19.6035 29.3438v31.7627h-31.7627v63.5264h31.7627v31.7627c0 12.8408 7.72363 24.4727 19.6035 29.374
-c11.8496 4.87012 25.5283 2.13965 34.6172 -6.91699zM224.237 96.7109h31.7627v-63.5264h-31.7627v63.5264zM192.475 350.796h31.7627v-63.5244h-31.7627v63.5244zM160.712 160.235c17.5254 0 31.7627 -14.2373 31.7627 -31.7617v-127.051
-c0 -17.5879 -14.2373 -31.7627 -31.7627 -31.7627h-127.052c-17.5254 0 -31.7617 14.1748 -31.7617 31.7627v127.051c0 17.5244 14.2363 31.7617 31.7617 31.7617h127.052zM128.949 33.1846v0v63.5264h-63.5254v-63.5264h63.5254zM256 350.796h31.7627v-63.5244h-31.7627
-v63.5244zM478.339 414.322c17.5566 0 31.7627 -14.2217 31.7627 -31.7627v-127.051c0 -17.541 -14.2061 -31.7637 -31.7627 -31.7637h-127.051c-17.5566 0 -31.7627 14.2227 -31.7627 31.7637v127.051c0 17.541 14.2061 31.7627 31.7627 31.7627h127.051zM446.576 287.271
-v63.5244h-63.5254v-63.5244h63.5254zM287.763 96.7109h31.7627v-63.5264h-31.7627v63.5264z" />
-    <glyph glyph-name="uniF11B" unicode="&#xf11b;" 
-d="M494.778 -2.67969c-29.6025 83.5303 -109.144 143.562 -202.873 143.562v-71.8408c0 -13.2529 -7.31543 -25.3379 -18.9727 -31.5967c-11.6572 -6.25781 -25.8516 -5.61426 -36.833 1.74902l-215.372 143.606c-10.0078 6.70898 -16.0205 17.876 -16.0205 29.8545
-c0 12.0332 6.0127 23.2129 15.9893 29.8926l215.357 143.615c11.0273 7.31641 25.1924 8.03613 36.8486 1.75586c11.6875 -6.21973 19.0029 -18.4199 19.0029 -31.6641v-71.7734c118.944 0 215.388 -96.4668 215.388 -215.44c0 -25.123 -4.58594 -49.2646 -12.5146 -71.7197
-z" />
-    <glyph glyph-name="uniF11C" unicode="&#xf11c;" 
-d="M107.919 318.031c-11.6172 0 -19.7217 8.78223 -19.7217 20.3984v86.7764c0 11.6172 8.10449 19.7217 19.7217 19.7217h148.576c11.6328 0 21.0312 -8.10449 21.0303 -19.7217v-86.0986c0 -11.6162 -8.78125 -21.0762 -20.3838 -21.0762h-149.223zM445.777 444.928
-c42.1543 0 42.1543 -42.0938 42.1553 -42.0938v-421.982c0 -39.4434 -41.416 -40.1836 -41.416 -40.1836v271.543c0 21.0166 -21.6934 22.3721 -21.6934 22.3721h-336.626c-21.0156 0 -21.0156 -21.7246 -21.0156 -21.7246v-272.807
-c-40.7988 0 -42.0938 42.0322 -42.0938 42.0322v420.75s0 42.0938 42.0938 42.0938l-0.677734 -126.882s1.07812 -20.3691 22.1562 -20.3691l335.469 -0.569336s20.2305 -0.308594 21.5859 21.3857zM404.361 212.858c0 0 20.4619 0 20.4619 -21.709v-229.404
-s0.615234 -21.6934 -21.0781 -21.6934h-295.147s-19.7217 0.615234 -19.7217 21.6934l-0.678711 230.112s-0.677734 21.001 21.6943 21.001h294.47zM330.405 45.1934c5.70117 0 10.2305 4.65234 10.2295 10.2305c0 5.5625 -4.52832 10.2148 -10.2295 10.2148h-168.929
-c-5.63867 0 -10.1689 -4.65234 -10.1689 -10.2148c0 -5.57715 4.54492 -10.2305 10.1689 -10.2305h168.929zM330.158 87.3486c5.70117 0 10.4775 4.02148 10.4775 9.86035c0 5.7168 -4.77637 10.4775 -10.4775 10.4775h-168.99
-c-5.83984 0 -10.5391 -4.76074 -10.5391 -10.4775c0 -5.83887 4.69922 -9.86035 10.5391 -9.86035h168.99zM330.405 129.38c5.70117 0 10.2305 4.53027 10.2295 10.2305c0 5.57715 -4.52832 10.1074 -10.2295 10.1074h-168.929
-c-5.63867 0 -10.1689 -4.53027 -10.1689 -10.1074c0 -5.7002 4.54492 -10.2305 10.1689 -10.2305h168.929zM381.435 318.031c-11.6475 0 -19.7217 9.45996 -19.7217 21.0762v86.0986c0 11.6172 8.07422 19.7217 19.7217 19.7217h23.666
-c11.5566 0 19.7227 -8.10547 19.7227 -19.7217v-86.0986c0 -11.6162 -8.16602 -21.0762 -19.7227 -21.0762h-23.666z" />
-    <glyph glyph-name="uniF11D" unicode="&#xf11d;" 
-d="M495.659 19.2988c18.6387 -18.6387 18.6387 -48.8457 -0.000976562 -67.4697c-18.6543 -18.6387 -48.8311 -18.6387 -67.4697 0l-111.865 111.804c-31.4941 -19.4453 -68.2607 -31.1992 -108.021 -31.1992c-114.191 0 -206.767 92.5752 -206.767 206.751
-c0 114.192 92.5752 206.768 206.767 206.768c114.192 0 206.768 -92.5752 206.768 -206.768c0 -39.7588 -11.7539 -76.541 -31.2305 -108.065zM208.303 96.0273c79.0537 0 143.159 64.1045 143.159 143.157c0 79.0537 -64.1055 143.159 -143.159 143.159
-c-79.0527 0 -143.158 -64.1055 -143.158 -143.159c0 -79.0527 64.1055 -143.157 143.158 -143.157z" />
-    <glyph glyph-name="uniF11E" unicode="&#xf11e;" 
-d="M228.974 393.2c0 -60.4707 -0.255859 -227.632 -0.255859 -227.632s170.018 -0.0644531 227.937 -0.0644531c0 -125.756 -101.94 -227.696 -227.681 -227.696c-125.756 0 -227.695 101.94 -227.695 227.696c0 125.307 101.25 226.989 226.38 227.696h1.31543z
-M510.722 201.067l-245.445 -0.353516s-0.641602 245.478 0.352539 245.478c135.386 0 245.093 -109.739 245.093 -245.124z" />
-    <glyph glyph-name="uniF11F" unicode="&#xf11f;" 
-d="M509.952 192.512c0 -10.7109 -0.868164 -21.2646 -2.16992 -31.6504c-0.326172 -2.51074 -0.744141 -5.05273 -1.14746 -7.56348c-1.37793 -8.68066 -3.13086 -17.2979 -5.34668 -25.6992c-0.417969 -1.48828 -0.744141 -3.00684 -1.13184 -4.47949
-c-6.04492 -21.002 -14.6631 -40.9824 -25.5752 -59.4111c-21.8232 -37.0293 -52.7305 -67.9209 -89.7598 -89.7764c-18.4297 -10.9121 -38.3936 -19.499 -59.4111 -25.5596c-1.48828 -0.387695 -2.97656 -0.712891 -4.47949 -1.13184
-c-8.41699 -2.21582 -16.9727 -3.96777 -25.6836 -5.34766c-2.51074 -0.387695 -5.05273 -0.836914 -7.58008 -1.13184c-10.4014 -1.33203 -20.9414 -2.20117 -31.667 -2.20117v0v0c-10.7256 0 -21.2656 0.869141 -31.6504 2.16992
-c-2.57324 0.326172 -5.05371 0.744141 -7.5957 1.14746c-8.71094 1.37891 -17.2979 3.13086 -25.7148 5.34668c-1.44043 0.418945 -2.99121 0.744141 -4.44824 1.13184c-21.0488 6.04492 -40.9814 14.6631 -59.4268 25.5752
-c-37.0137 21.8242 -67.9209 52.7305 -89.8066 89.7598c-10.8965 18.4307 -19.4834 38.3936 -25.5127 59.4121c-0.40332 1.47168 -0.744141 2.97559 -1.14746 4.47949c-2.23145 8.41602 -3.96777 16.9717 -5.31641 25.6836
-c-0.387695 2.50977 -0.836914 5.03613 -1.19336 7.5791c-1.27148 10.4023 -2.13965 20.9561 -2.13965 31.667v0v0c0 10.7109 0.868164 21.2666 2.16992 31.6504c0.30957 2.57324 0.744141 5.05273 1.17773 7.59473c1.34863 8.71191 3.10059 17.2988 5.34766 25.7148
-c0.387695 1.44238 0.728516 2.99219 1.14746 4.44922c6.0293 20.9863 14.6318 40.9668 25.5283 59.4121c21.8555 37.0137 52.793 67.9355 89.8066 89.791c18.3994 10.8652 38.3779 19.4678 59.3809 25.4971c1.47266 0.418945 2.99219 0.758789 4.44824 1.14746
-c8.40137 2.24707 17.0186 3.96777 25.6992 5.34668c2.54199 0.37207 5.02148 0.837891 7.61035 1.19336c10.3701 1.28711 20.9102 2.15527 31.6357 2.15527v0v0c10.7256 0 21.2656 -0.868164 31.6504 -2.15527c2.51172 -0.324219 5.05371 -0.758789 7.56445 -1.19238
-c8.67969 -1.34863 17.2969 -3.09961 25.6982 -5.34668c1.48828 -0.388672 3.00684 -0.729492 4.47949 -1.14746c21.0029 -6.03027 40.9834 -14.6328 59.4121 -25.498c37.0293 -21.8857 67.9209 -52.8242 89.7764 -89.8066
-c10.9121 -18.4443 19.499 -38.3779 25.5596 -59.4268c0.386719 -1.45703 0.712891 -2.97559 1.13184 -4.44824c2.21582 -8.41699 3.96777 -17.0039 5.34766 -25.7148c0.387695 -2.54199 0.835938 -5.00586 1.13086 -7.5791
-c1.33301 -10.3701 2.20117 -20.9258 2.20117 -31.6367v0v0zM108.486 250.219l-47.1973 47.2285c-16.957 -31.3887 -27.4971 -66.7432 -27.4971 -104.936c0 -38.1914 10.54 -73.5625 27.4971 -104.936l47.1973 47.1836c-7.02148 17.9482 -11.2061 37.3076 -11.2061 57.752
-c0 20.4297 4.18457 39.7744 11.2061 57.707zM256 -29.6963c38.1924 0 73.5635 10.5088 104.935 27.4668l-47.1816 47.2119c-17.9492 -6.97363 -37.3086 -11.1904 -57.7529 -11.1904c-20.4131 0 -39.7734 4.2168 -57.7217 11.2373l-47.2441 -47.2285
-c31.4189 -16.9883 66.7734 -27.4971 104.966 -27.4971zM256 414.72c-38.1924 0 -73.5469 -10.54 -104.935 -27.4971l47.2432 -47.1973c17.918 7.02246 37.2783 11.207 57.6914 11.207c20.4443 0 39.8037 -4.18457 57.7217 -11.207l47.1816 47.1973
-c-31.3398 16.957 -66.7109 27.4971 -104.903 27.4971zM378.28 224.984v0c-11.6416 43.8799 -45.8965 78.1191 -89.792 89.8076v0v0c-4.21582 1.09961 -8.43262 2.03027 -12.834 2.72852c-6.41699 1.14648 -12.8965 1.96777 -19.6543 1.96777
-s-13.2373 -0.821289 -19.6846 -1.96875c-4.34082 -0.697266 -8.60254 -1.62793 -12.7881 -2.72852v0v0c-43.8799 -11.6875 -78.1201 -45.957 -89.8066 -89.8066v0v0c-1.10059 -4.18457 -2.03027 -8.44824 -2.72852 -12.8037
-c-1.14648 -6.44727 -1.96777 -12.9258 -1.96777 -19.6689s0.821289 -13.2207 1.96777 -19.6543c0.666992 -4.40234 1.62793 -8.58594 2.72852 -12.833v0v0c11.6406 -43.8652 45.957 -78.1045 89.8066 -89.7607v0v0c4.18555 -1.10059 8.44727 -2.01562 12.7881 -2.72754
-c6.44727 -1.17871 12.9268 -2 19.6846 -2s13.2373 0.821289 19.6543 1.96777c4.40234 0.666992 8.58691 1.62891 12.834 2.72852v0v0c43.8643 11.6572 78.1045 45.8965 89.7598 89.792v0v0c1.10059 4.21582 2.01562 8.43164 2.72852 12.8184
-c1.17773 6.44824 1.99902 12.9258 1.99902 19.6689s-0.821289 13.2217 -1.96777 19.6689c-0.712891 4.35547 -1.62793 8.61914 -2.72754 12.8037v0zM450.742 297.447l-47.2129 -47.2441c6.97461 -17.917 11.1904 -37.2617 11.1904 -57.6914
-c0 -20.4443 -4.21582 -39.8037 -11.2373 -57.7217l47.2285 -47.1816c16.9883 31.3408 27.4971 66.7119 27.4971 104.903c0 38.1924 -10.5088 73.5469 -27.4658 104.936z" />
-    <glyph glyph-name="uniF120" unicode="&#xf120;" 
-d="M3.49219 294.4l101 102.399h25.0312v-78.7695h378.093v-47.2607h-378.093v-78.7695h-25.0312zM508.508 89.5996l-101.016 -102.399h-25.9082v78.7686h-378.092v47.2607h378.092v78.7705h25.9082z" />
-    <glyph glyph-name="uniF121" unicode="&#xf121;" 
-d="M443.778 287.818v-254.668c0 -52.7051 -42.7891 -95.4941 -95.4951 -95.4941h-191.005c-52.7529 0 -95.4951 42.7881 -95.4951 95.4941v254.668c-17.5625 0 -31.8311 14.2686 -31.8311 31.8311c0 17.5635 14.2686 31.832 31.8311 31.832h95.4951
-c0 52.7529 42.7422 95.4941 95.4941 95.4941c52.7217 0 95.4951 -42.7725 95.4951 -95.4941h95.4951c17.5947 0 31.832 -14.2686 31.832 -31.832c0.0146484 -17.5938 -14.207 -31.8311 -31.8164 -31.8311zM252.772 383.312c-17.5625 0 -31.8311 -14.2676 -31.8311 -31.8311
-h63.6631c0.015625 17.5635 -14.2686 31.8311 -31.832 31.8311zM380.115 287.818h-254.669v-254.668c0 -17.5781 14.2686 -31.8311 31.832 -31.8311h191.005c17.6104 0 31.832 14.2529 31.832 31.8311v254.668zM316.452 255.971h31.8311v-222.836h-31.8311v222.836z
-M220.941 255.971h63.6631v-222.836h-63.6631v222.836zM157.278 255.971h31.8311v-222.836h-31.8311v222.836z" />
-    <glyph glyph-name="uniF122" unicode="&#xf122;" 
-d="M331.522 -63.0078h-191.148c-52.7959 0 -95.5742 42.8086 -95.5742 95.5742v0c9.84668 58.4268 49.1562 107.521 99.1523 135.21c-21.8398 22.8672 -35.4355 53.667 -35.4355 87.7959v63.7158c-0.000976562 70.374 57.0576 127.432 127.432 127.432
-s127.432 -57.0576 127.432 -127.432v-63.7158c0 -34.1289 -13.5957 -64.9287 -35.4043 -87.7969c49.9648 -27.6885 89.2734 -76.7832 99.1211 -135.21v0c-0.000976562 -52.7646 -42.8096 -95.5732 -95.5742 -95.5732zM299.664 255.572v63.7158
-c0 35.1709 -28.5449 63.7158 -63.7158 63.7158c-35.1719 0 -63.7158 -28.5449 -63.7158 -63.7158v-63.7158c0 -35.1709 28.5439 -63.7158 63.7158 -63.7158c35.1709 0 63.7158 28.5449 63.7158 63.7158zM363.38 32.5654c-14.2178 54.8809 -68.1338 95.5742 -127.432 95.5742
-v0v0c-59.3291 0 -113.214 -40.6934 -127.433 -95.5742v0c0 -17.6084 14.2803 -31.8574 31.8584 -31.8574h191.148c17.6084 0 31.8574 14.249 31.8574 31.8574v0z" />
-    <glyph glyph-name="uniF123" unicode="&#xf123;" 
-d="M410.583 169.941c49.8057 -27.6006 88.9912 -76.5381 98.8057 -134.779c0 -52.5977 -42.6729 -95.2705 -95.2705 -95.2705h-43.9131c18.9473 16.5449 32.8418 38.4248 39.3848 63.5137h4.52832c17.5527 0 31.7568 14.2031 31.7568 31.7568
-c-8.1875 31.6318 -29.8184 58.1787 -57.8691 75.2666c-14.793 25.6484 -34.7344 48.7832 -58.9551 67.4834c3.64453 6.24902 6.85449 12.7773 9.59863 19.4922c25.3379 8.38867 43.7129 31.957 43.7129 60.0547v63.5137c0 28.1279 -18.375 51.6982 -43.7285 60.0557
-c-10.3574 25.1816 -27.3213 46.7197 -48.2871 63.4824c9.18066 2.12402 18.6699 3.48926 28.501 3.48926c70.1514 0 127.027 -56.877 127.027 -127.027v-63.5137c0 -34.0205 -13.5518 -64.7227 -35.292 -87.5176zM287.091 -60.1084h-190.54
-c-52.6279 0 -95.2705 42.6719 -95.2705 95.2705v0c9.81543 58.2412 49 107.179 98.8369 134.779c-21.7705 22.7949 -35.3232 53.4971 -35.3232 87.5176v63.5137c0 70.1504 56.877 127.027 127.026 127.027c70.1504 0 127.027 -56.877 127.027 -127.027v-63.5137
-c0 -34.0205 -13.5527 -64.7227 -35.292 -87.5176c49.8057 -27.6006 88.9902 -76.5381 98.8057 -134.779v0c0.000976562 -52.5986 -42.6729 -95.2705 -95.2705 -95.2705zM255.334 257.459v63.5137c0 35.0596 -28.4541 63.5137 -63.5137 63.5137
-s-63.5127 -28.4541 -63.5127 -63.5137v-63.5137c0 -35.0596 28.4531 -63.5127 63.5127 -63.5127s63.5137 28.4531 63.5137 63.5127zM318.848 35.1621c-14.1729 54.7061 -67.917 95.2695 -127.027 95.2695v0v0c-59.1396 0 -112.854 -40.5635 -127.026 -95.2695v0
-c0 -17.5537 14.2344 -31.7568 31.7568 -31.7568h190.54c17.5537 0 31.7568 14.2031 31.7568 31.7568v0z" />
-    <glyph glyph-name="uniF124" unicode="&#xf124;" 
-d="M502.882 356.449c3.70898 -11.8682 6.24414 -24.2305 6.24414 -37.3037c0 -69.8789 -56.6826 -126.592 -126.593 -126.592c-19.4707 0 -37.7676 4.79102 -54.209 12.6406l-253.556 -253.463c-7.54102 -7.66406 -18.1113 -12.3623 -29.793 -12.3623
-c-23.3652 0 -42.2188 18.915 -42.2188 42.1572c0 11.7441 4.75977 22.252 12.3633 29.917l253.493 253.431c-7.91211 16.5352 -12.6719 34.7695 -12.6719 54.2705c0 69.8789 56.6826 126.593 126.592 126.593c12.6719 0 24.7256 -2.44141 36.2842 -5.93457l-78.502 -78.4707
-v-84.374h83.0762z" />
-    <glyph glyph-name="uniF125" unicode="&#xf125;" 
-d="M511.488 39.5137l-102.029 -102.03l-152.973 153.044l-153.044 -153.044l-101.959 102.03l152.974 152.973l-152.974 152.973l101.959 102.029l153.044 -153.043l152.973 153.043l102.029 -102.029l-153.115 -152.973z" />
-  </font>
-</defs></svg>

http://git-wip-us.apache.org/repos/asf/couchdb/blob/cca309f3/share/www/fauxton/img/fontcustom_fauxton.ttf
----------------------------------------------------------------------
diff --git a/share/www/fauxton/img/fontcustom_fauxton.ttf b/share/www/fauxton/img/fontcustom_fauxton.ttf
deleted file mode 100644
index 4df286c..0000000
Binary files a/share/www/fauxton/img/fontcustom_fauxton.ttf and /dev/null differ

http://git-wip-us.apache.org/repos/asf/couchdb/blob/cca309f3/share/www/fauxton/img/fontcustom_fauxton.woff
----------------------------------------------------------------------
diff --git a/share/www/fauxton/img/fontcustom_fauxton.woff b/share/www/fauxton/img/fontcustom_fauxton.woff
deleted file mode 100644
index a6a3fb2..0000000
Binary files a/share/www/fauxton/img/fontcustom_fauxton.woff and /dev/null differ

http://git-wip-us.apache.org/repos/asf/couchdb/blob/cca309f3/share/www/fauxton/img/glyphicons-halflings-white.png
----------------------------------------------------------------------
diff --git a/share/www/fauxton/img/glyphicons-halflings-white.png b/share/www/fauxton/img/glyphicons-halflings-white.png
deleted file mode 100644
index 3bf6484..0000000
Binary files a/share/www/fauxton/img/glyphicons-halflings-white.png and /dev/null differ

http://git-wip-us.apache.org/repos/asf/couchdb/blob/cca309f3/share/www/fauxton/img/glyphicons-halflings.png
----------------------------------------------------------------------
diff --git a/share/www/fauxton/img/glyphicons-halflings.png b/share/www/fauxton/img/glyphicons-halflings.png
deleted file mode 100644
index 79bc568..0000000
Binary files a/share/www/fauxton/img/glyphicons-halflings.png and /dev/null differ

http://git-wip-us.apache.org/repos/asf/couchdb/blob/cca309f3/share/www/fauxton/img/linen.png
----------------------------------------------------------------------
diff --git a/share/www/fauxton/img/linen.png b/share/www/fauxton/img/linen.png
deleted file mode 100644
index 365c61a..0000000
Binary files a/share/www/fauxton/img/linen.png and /dev/null differ

http://git-wip-us.apache.org/repos/asf/couchdb/blob/cca309f3/share/www/fauxton/img/loader.gif
----------------------------------------------------------------------
diff --git a/share/www/fauxton/img/loader.gif b/share/www/fauxton/img/loader.gif
deleted file mode 100644
index 96ff188..0000000
Binary files a/share/www/fauxton/img/loader.gif and /dev/null differ

http://git-wip-us.apache.org/repos/asf/couchdb/blob/cca309f3/share/www/fauxton/img/minilogo.png
----------------------------------------------------------------------
diff --git a/share/www/fauxton/img/minilogo.png b/share/www/fauxton/img/minilogo.png
deleted file mode 100644
index 63e005c..0000000
Binary files a/share/www/fauxton/img/minilogo.png and /dev/null differ

http://git-wip-us.apache.org/repos/asf/couchdb/blob/cca309f3/share/www/fauxton/index.html
----------------------------------------------------------------------
diff --git a/share/www/fauxton/index.html b/share/www/fauxton/index.html
deleted file mode 100644
index 666c560..0000000
--- a/share/www/fauxton/index.html
+++ /dev/null
@@ -1,45 +0,0 @@
-<!doctype html>
-
-<!--
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
--->
-
-<html lang="en">
-<head>
-  <meta charset="utf-8">
-  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
-  <meta name="viewport" content="width=device-width,initial-scale=1">
-  <meta http-equiv="Content-Language" content="en" />
-
-  <title>Project Fauxton</title>
-
-  <!-- Application styles. -->
-  <link rel="stylesheet" href="./css/index.css">
-  
-</head>
-
-<body id="home">
-  <!-- Main container. -->
-  <div role="main" id="main">
-    <div id="global-notifications" class="container errors-container"></div>
-    <div id="app-container"></div>
-
-    <footer>
-      <div id="footer-content"></div>
-    </footer>
-  </div>
-
-  <!-- Application source. -->
-  <script data-main="/config" src="./js/require.js"></script>
-</body>
-</html>

http://git-wip-us.apache.org/repos/asf/couchdb/blob/cca309f3/share/www/fauxton/js/ace/mode-javascript.js
----------------------------------------------------------------------
diff --git a/share/www/fauxton/js/ace/mode-javascript.js b/share/www/fauxton/js/ace/mode-javascript.js
deleted file mode 100644
index c9e6f50..0000000
--- a/share/www/fauxton/js/ace/mode-javascript.js
+++ /dev/null
@@ -1,886 +0,0 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Distributed under the BSD license:
- *
- * Copyright (c) 2010, Ajax.org B.V.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of Ajax.org B.V. nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * ***** END LICENSE BLOCK ***** */
-
-define('ace/mode/javascript', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/javascript_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/range', 'ace/worker/worker_client', 'ace/mode/behaviour/cstyle', 'ace/mode/folding/cstyle'], function(require, exports, module) {
-
-
-var oop = require("../lib/oop");
-var TextMode = require("./text").Mode;
-var Tokenizer = require("../tokenizer").Tokenizer;
-var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
-var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
-var Range = require("../range").Range;
-var WorkerClient = require("../worker/worker_client").WorkerClient;
-var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
-var CStyleFoldMode = require("./folding/cstyle").FoldMode;
-
-var Mode = function() {
-    this.HighlightRules = JavaScriptHighlightRules;
-    
-    this.$outdent = new MatchingBraceOutdent();
-    this.$behaviour = new CstyleBehaviour();
-    this.foldingRules = new CStyleFoldMode();
-};
-oop.inherits(Mode, TextMode);
-
-(function() {
-
-    this.lineCommentStart = "//";
-    this.blockComment = {start: "/*", end: "*/"};
-
-    this.getNextLineIndent = function(state, line, tab) {
-        var indent = this.$getIndent(line);
-
-        var tokenizedLine = this.getTokenizer().getLineTokens(line, state);
-        var tokens = tokenizedLine.tokens;
-        var endState = tokenizedLine.state;
-
-        if (tokens.length && tokens[tokens.length-1].type == "comment") {
-            return indent;
-        }
-
-        if (state == "start" || state == "no_regex") {
-            var match = line.match(/^.*(?:\bcase\b.*\:|[\{\(\[])\s*$/);
-            if (match) {
-                indent += tab;
-            }
-        } else if (state == "doc-start") {
-            if (endState == "start" || endState == "no_regex") {
-                return "";
-            }
-            var match = line.match(/^\s*(\/?)\*/);
-            if (match) {
-                if (match[1]) {
-                    indent += " ";
-                }
-                indent += "* ";
-            }
-        }
-
-        return indent;
-    };
-
-    this.checkOutdent = function(state, line, input) {
-        return this.$outdent.checkOutdent(line, input);
-    };
-
-    this.autoOutdent = function(state, doc, row) {
-        this.$outdent.autoOutdent(doc, row);
-    };
-
-    this.createWorker = function(session) {
-        var worker = new WorkerClient(["ace"], "ace/mode/javascript_worker", "JavaScriptWorker");
-        worker.attachToDocument(session.getDocument());
-
-        worker.on("jslint", function(results) {
-            session.setAnnotations(results.data);
-        });
-
-        worker.on("terminate", function() {
-            session.clearAnnotations();
-        });
-
-        return worker;
-    };
-
-}).call(Mode.prototype);
-
-exports.Mode = Mode;
-});
-
-define('ace/mode/javascript_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/doc_comment_highlight_rules', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
-
-
-var oop = require("../lib/oop");
-var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
-var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
-
-var JavaScriptHighlightRules = function() {
-    var keywordMapper = this.createKeywordMapper({
-        "variable.language":
-            "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|"  + // Constructors
-            "Namespace|QName|XML|XMLList|"                                             + // E4X
-            "ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|"   +
-            "Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|"                    +
-            "Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|"   + // Errors
-            "SyntaxError|TypeError|URIError|"                                          +
-            "decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|" + // Non-constructor functions
-            "isNaN|parseFloat|parseInt|"                                               +
-            "JSON|Math|"                                                               + // Other
-            "this|arguments|prototype|window|document"                                 , // Pseudo
-        "keyword":
-            "const|yield|import|get|set|" +
-            "break|case|catch|continue|default|delete|do|else|finally|for|function|" +
-            "if|in|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" +
-            "__parent__|__count__|escape|unescape|with|__proto__|" +
-            "class|enum|extends|super|export|implements|private|public|interface|package|protected|static",
-        "storage.type":
-            "const|let|var|function",
-        "constant.language":
-            "null|Infinity|NaN|undefined",
-        "support.function":
-            "alert",
-        "constant.language.boolean": "true|false"
-    }, "identifier");
-    var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void";
-    var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*\\b";
-
-    var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex
-        "u[0-9a-fA-F]{4}|" + // unicode
-        "[0-2][0-7]{0,2}|" + // oct
-        "3[0-6][0-7]?|" + // oct
-        "37[0-7]?|" + // oct
-        "[4-7][0-7]?|" + //oct
-        ".)";
-
-    this.$rules = {
-        "no_regex" : [
-            {
-                token : "comment",
-                regex : "\\/\\/",
-                next : "line_comment"
-            },
-            DocCommentHighlightRules.getStartRule("doc-start"),
-            {
-                token : "comment", // multi line comment
-                regex : /\/\*/,
-                next : "comment"
-            }, {
-                token : "string",
-                regex : "'(?=.)",
-                next  : "qstring"
-            }, {
-                token : "string",
-                regex : '"(?=.)',
-                next  : "qqstring"
-            }, {
-                token : "constant.numeric", // hex
-                regex : /0[xX][0-9a-fA-F]+\b/
-            }, {
-                token : "constant.numeric", // float
-                regex : /[+-]?\d+(?:(?:\.\d*)?(?:[eE][+-]?\d+)?)?\b/
-            }, {
-                token : [
-                    "storage.type", "punctuation.operator", "support.function",
-                    "punctuation.operator", "entity.name.function", "text","keyword.operator"
-                ],
-                regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)",
-                next: "function_arguments"
-            }, {
-                token : [
-                    "storage.type", "punctuation.operator", "entity.name.function", "text",
-                    "keyword.operator", "text", "storage.type", "text", "paren.lparen"
-                ],
-                regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
-                next: "function_arguments"
-            }, {
-                token : [
-                    "entity.name.function", "text", "keyword.operator", "text", "storage.type",
-                    "text", "paren.lparen"
-                ],
-                regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
-                next: "function_arguments"
-            }, {
-                token : [
-                    "storage.type", "punctuation.operator", "entity.name.function", "text",
-                    "keyword.operator", "text",
-                    "storage.type", "text", "entity.name.function", "text", "paren.lparen"
-                ],
-                regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()",
-                next: "function_arguments"
-            }, {
-                token : [
-                    "storage.type", "text", "entity.name.function", "text", "paren.lparen"
-                ],
-                regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
-                next: "function_arguments"
-            }, {
-                token : [
-                    "entity.name.function", "text", "punctuation.operator",
-                    "text", "storage.type", "text", "paren.lparen"
-                ],
-                regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()",
-                next: "function_arguments"
-            }, {
-                token : [
-                    "text", "text", "storage.type", "text", "paren.lparen"
-                ],
-                regex : "(:)(\\s*)(function)(\\s*)(\\()",
-                next: "function_arguments"
-            }, {
-                token : "keyword",
-                regex : "(?:" + kwBeforeRe + ")\\b",
-                next : "start"
-            }, {
-                token : ["punctuation.operator", "support.function"],
-                regex : /(\.)(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nabl
 eExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/
-            }, {
-                token : ["punctuation.operator", "support.function.dom"],
-                regex : /(\.)(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/
-            }, {
-                token : ["punctuation.operator", "support.constant"],
-                regex : /(\.)(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thn
 ame|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/
-            }, {
-                token : ["storage.type", "punctuation.operator", "support.function.firebug"],
-                regex : /(console)(\.)(warn|info|log|error|time|timeEnd|assert)\b/
-            }, {
-                token : keywordMapper,
-                regex : identifierRe
-            }, {
-                token : "keyword.operator",
-                regex : /--|\+\+|[!$%&*+\-~]|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|\*=|%=|\+=|\-=|&=|\^=/,
-                next  : "start"
-            }, {
-                token : "punctuation.operator",
-                regex : /\?|\:|\,|\;|\./,
-                next  : "start"
-            }, {
-                token : "paren.lparen",
-                regex : /[\[({]/,
-                next  : "start"
-            }, {
-                token : "paren.rparen",
-                regex : /[\])}]/
-            }, {
-                token : "keyword.operator",
-                regex : /\/=?/,
-                next  : "start"
-            }, {
-                token: "comment",
-                regex: /^#!.*$/
-            }
-        ],
-        "start": [
-            DocCommentHighlightRules.getStartRule("doc-start"),
-            {
-                token : "comment", // multi line comment
-                regex : "\\/\\*",
-                next : "comment_regex_allowed"
-            }, {
-                token : "comment",
-                regex : "\\/\\/",
-                next : "line_comment_regex_allowed"
-            }, {
-                token: "string.regexp",
-                regex: "\\/",
-                next: "regex"
-            }, {
-                token : "text",
-                regex : "\\s+|^$",
-                next : "start"
-            }, {
-                token: "empty",
-                regex: "",
-                next: "no_regex"
-            }
-        ],
-        "regex": [
-            {
-                token: "regexp.keyword.operator",
-                regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
-            }, {
-                token: "string.regexp",
-                regex: "/\\w*",
-                next: "no_regex"
-            }, {
-                token : "invalid",
-                regex: /\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/
-            }, {
-                token : "constant.language.escape",
-                regex: /\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?]/
-            }, {
-                token : "constant.language.delimiter",
-                regex: /\|/
-            }, {
-                token: "constant.language.escape",
-                regex: /\[\^?/,
-                next: "regex_character_class"
-            }, {
-                token: "empty",
-                regex: "$",
-                next: "no_regex"
-            }, {
-                defaultToken: "string.regexp"
-            }
-        ],
-        "regex_character_class": [
-            {
-                token: "regexp.keyword.operator",
-                regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
-            }, {
-                token: "constant.language.escape",
-                regex: "]",
-                next: "regex"
-            }, {
-                token: "constant.language.escape",
-                regex: "-"
-            }, {
-                token: "empty",
-                regex: "$",
-                next: "no_regex"
-            }, {
-                defaultToken: "string.regexp.charachterclass"
-            }
-        ],
-        "function_arguments": [
-            {
-                token: "variable.parameter",
-                regex: identifierRe
-            }, {
-                token: "punctuation.operator",
-                regex: "[, ]+"
-            }, {
-                token: "punctuation.operator",
-                regex: "$"
-            }, {
-                token: "empty",
-                regex: "",
-                next: "no_regex"
-            }
-        ],
-        "comment_regex_allowed" : [
-            {token : "comment", regex : "\\*\\/", next : "start"},
-            {defaultToken : "comment"}
-        ],
-        "comment" : [
-            {token : "comment", regex : "\\*\\/", next : "no_regex"},
-            {defaultToken : "comment"}
-        ],
-        "line_comment_regex_allowed" : [
-            {token : "comment", regex : "$|^", next : "start"},
-            {defaultToken : "comment"}
-        ],
-        "line_comment" : [
-            {token : "comment", regex : "$|^", next : "no_regex"},
-            {defaultToken : "comment"}
-        ],
-        "qqstring" : [
-            {
-                token : "constant.language.escape",
-                regex : escapedRe
-            }, {
-                token : "string",
-                regex : "\\\\$",
-                next  : "qqstring"
-            }, {
-                token : "string",
-                regex : '"|$',
-                next  : "no_regex"
-            }, {
-                defaultToken: "string"
-            }
-        ],
-        "qstring" : [
-            {
-                token : "constant.language.escape",
-                regex : escapedRe
-            }, {
-                token : "string",
-                regex : "\\\\$",
-                next  : "qstring"
-            }, {
-                token : "string",
-                regex : "'|$",
-                next  : "no_regex"
-            }, {
-                defaultToken: "string"
-            }
-        ]
-    };
-
-    this.embedRules(DocCommentHighlightRules, "doc-",
-        [ DocCommentHighlightRules.getEndRule("no_regex") ]);
-};
-
-oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
-
-exports.JavaScriptHighlightRules = JavaScriptHighlightRules;
-});
-
-define('ace/mode/doc_comment_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
-
-
-var oop = require("../lib/oop");
-var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
-
-var DocCommentHighlightRules = function() {
-
-    this.$rules = {
-        "start" : [ {
-            token : "comment.doc.tag",
-            regex : "@[\\w\\d_]+" // TODO: fix email addresses
-        }, {
-            token : "comment.doc.tag",
-            regex : "\\bTODO\\b"
-        }, {
-            defaultToken : "comment.doc"
-        }]
-    };
-};
-
-oop.inherits(DocCommentHighlightRules, TextHighlightRules);
-
-DocCommentHighlightRules.getStartRule = function(start) {
-    return {
-        token : "comment.doc", // doc comment
-        regex : "\\/\\*(?=\\*)",
-        next  : start
-    };
-};
-
-DocCommentHighlightRules.getEndRule = function (start) {
-    return {
-        token : "comment.doc", // closing comment
-        regex : "\\*\\/",
-        next  : start
-    };
-};
-
-
-exports.DocCommentHighlightRules = DocCommentHighlightRules;
-
-});
-
-define('ace/mode/matching_brace_outdent', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) {
-
-
-var Range = require("../range").Range;
-
-var MatchingBraceOutdent = function() {};
-
-(function() {
-
-    this.checkOutdent = function(line, input) {
-        if (! /^\s+$/.test(line))
-            return false;
-
-        return /^\s*\}/.test(input);
-    };
-
-    this.autoOutdent = function(doc, row) {
-        var line = doc.getLine(row);
-        var match = line.match(/^(\s*\})/);
-
-        if (!match) return 0;
-
-        var column = match[1].length;
-        var openBracePos = doc.findMatchingBracket({row: row, column: column});
-
-        if (!openBracePos || openBracePos.row == row) return 0;
-
-        var indent = this.$getIndent(doc.getLine(openBracePos.row));
-        doc.replace(new Range(row, 0, row, column-1), indent);
-    };
-
-    this.$getIndent = function(line) {
-        return line.match(/^\s*/)[0];
-    };
-
-}).call(MatchingBraceOutdent.prototype);
-
-exports.MatchingBraceOutdent = MatchingBraceOutdent;
-});
-
-define('ace/mode/behaviour/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour', 'ace/token_iterator', 'ace/lib/lang'], function(require, exports, module) {
-
-
-var oop = require("../../lib/oop");
-var Behaviour = require("../behaviour").Behaviour;
-var TokenIterator = require("../../token_iterator").TokenIterator;
-var lang = require("../../lib/lang");
-
-var SAFE_INSERT_IN_TOKENS =
-    ["text", "paren.rparen", "punctuation.operator"];
-var SAFE_INSERT_BEFORE_TOKENS =
-    ["text", "paren.rparen", "punctuation.operator", "comment"];
-
-
-var autoInsertedBrackets = 0;
-var autoInsertedRow = -1;
-var autoInsertedLineEnd = "";
-var maybeInsertedBrackets = 0;
-var maybeInsertedRow = -1;
-var maybeInsertedLineStart = "";
-var maybeInsertedLineEnd = "";
-
-var CstyleBehaviour = function () {
-    
-    CstyleBehaviour.isSaneInsertion = function(editor, session) {
-        var cursor = editor.getCursorPosition();
-        var iterator = new TokenIterator(session, cursor.row, cursor.column);
-        if (!this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) {
-            var iterator2 = new TokenIterator(session, cursor.row, cursor.column + 1);
-            if (!this.$matchTokenType(iterator2.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS))
-                return false;
-        }
-        iterator.stepForward();
-        return iterator.getCurrentTokenRow() !== cursor.row ||
-            this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_BEFORE_TOKENS);
-    };
-    
-    CstyleBehaviour.$matchTokenType = function(token, types) {
-        return types.indexOf(token.type || token) > -1;
-    };
-    
-    CstyleBehaviour.recordAutoInsert = function(editor, session, bracket) {
-        var cursor = editor.getCursorPosition();
-        var line = session.doc.getLine(cursor.row);
-        if (!this.isAutoInsertedClosing(cursor, line, autoInsertedLineEnd[0]))
-            autoInsertedBrackets = 0;
-        autoInsertedRow = cursor.row;
-        autoInsertedLineEnd = bracket + line.substr(cursor.column);
-        autoInsertedBrackets++;
-    };
-    
-    CstyleBehaviour.recordMaybeInsert = function(editor, session, bracket) {
-        var cursor = editor.getCursorPosition();
-        var line = session.doc.getLine(cursor.row);
-        if (!this.isMaybeInsertedClosing(cursor, line))
-            maybeInsertedBrackets = 0;
-        maybeInsertedRow = cursor.row;
-        maybeInsertedLineStart = line.substr(0, cursor.column) + bracket;
-        maybeInsertedLineEnd = line.substr(cursor.column);
-        maybeInsertedBrackets++;
-    };
-    
-    CstyleBehaviour.isAutoInsertedClosing = function(cursor, line, bracket) {
-        return autoInsertedBrackets > 0 &&
-            cursor.row === autoInsertedRow &&
-            bracket === autoInsertedLineEnd[0] &&
-            line.substr(cursor.column) === autoInsertedLineEnd;
-    };
-    
-    CstyleBehaviour.isMaybeInsertedClosing = function(cursor, line) {
-        return maybeInsertedBrackets > 0 &&
-            cursor.row === maybeInsertedRow &&
-            line.substr(cursor.column) === maybeInsertedLineEnd &&
-            line.substr(0, cursor.column) == maybeInsertedLineStart;
-    };
-    
-    CstyleBehaviour.popAutoInsertedClosing = function() {
-        autoInsertedLineEnd = autoInsertedLineEnd.substr(1);
-        autoInsertedBrackets--;
-    };
-    
-    CstyleBehaviour.clearMaybeInsertedClosing = function() {
-        maybeInsertedBrackets = 0;
-        maybeInsertedRow = -1;
-    };
-
-    this.add("braces", "insertion", function (state, action, editor, session, text) {
-        var cursor = editor.getCursorPosition();
-        var line = session.doc.getLine(cursor.row);
-        if (text == '{') {
-            var selection = editor.getSelectionRange();
-            var selected = session.doc.getTextRange(selection);
-            if (selected !== "" && selected !== "{" && editor.getWrapBehavioursEnabled()) {
-                return {
-                    text: '{' + selected + '}',
-                    selection: false
-                };
-            } else if (CstyleBehaviour.isSaneInsertion(editor, session)) {
-                if (/[\]\}\)]/.test(line[cursor.column])) {
-                    CstyleBehaviour.recordAutoInsert(editor, session, "}");
-                    return {
-                        text: '{}',
-                        selection: [1, 1]
-                    };
-                } else {
-                    CstyleBehaviour.recordMaybeInsert(editor, session, "{");
-                    return {
-                        text: '{',
-                        selection: [1, 1]
-                    };
-                }
-            }
-        } else if (text == '}') {
-            var rightChar = line.substring(cursor.column, cursor.column + 1);
-            if (rightChar == '}') {
-                var matching = session.$findOpeningBracket('}', {column: cursor.column + 1, row: cursor.row});
-                if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) {
-                    CstyleBehaviour.popAutoInsertedClosing();
-                    return {
-                        text: '',
-                        selection: [1, 1]
-                    };
-                }
-            }
-        } else if (text == "\n" || text == "\r\n") {
-            var closing = "";
-            if (CstyleBehaviour.isMaybeInsertedClosing(cursor, line)) {
-                closing = lang.stringRepeat("}", maybeInsertedBrackets);
-                CstyleBehaviour.clearMaybeInsertedClosing();
-            }
-            var rightChar = line.substring(cursor.column, cursor.column + 1);
-            if (rightChar == '}' || closing !== "") {
-                var openBracePos = session.findMatchingBracket({row: cursor.row, column: cursor.column}, '}');
-                if (!openBracePos)
-                     return null;
-
-                var indent = this.getNextLineIndent(state, line.substring(0, cursor.column), session.getTabString());
-                var next_indent = this.$getIndent(line);
-
-                return {
-                    text: '\n' + indent + '\n' + next_indent + closing,
-                    selection: [1, indent.length, 1, indent.length]
-                };
-            }
-        }
-    });
-
-    this.add("braces", "deletion", function (state, action, editor, session, range) {
-        var selected = session.doc.getTextRange(range);
-        if (!range.isMultiLine() && selected == '{') {
-            var line = session.doc.getLine(range.start.row);
-            var rightChar = line.substring(range.end.column, range.end.column + 1);
-            if (rightChar == '}') {
-                range.end.column++;
-                return range;
-            } else {
-                maybeInsertedBrackets--;
-            }
-        }
-    });
-
-    this.add("parens", "insertion", function (state, action, editor, session, text) {
-        if (text == '(') {
-            var selection = editor.getSelectionRange();
-            var selected = session.doc.getTextRange(selection);
-            if (selected !== "" && editor.getWrapBehavioursEnabled()) {
-                return {
-                    text: '(' + selected + ')',
-                    selection: false
-                };
-            } else if (CstyleBehaviour.isSaneInsertion(editor, session)) {
-                CstyleBehaviour.recordAutoInsert(editor, session, ")");
-                return {
-                    text: '()',
-                    selection: [1, 1]
-                };
-            }
-        } else if (text == ')') {
-            var cursor = editor.getCursorPosition();
-            var line = session.doc.getLine(cursor.row);
-            var rightChar = line.substring(cursor.column, cursor.column + 1);
-            if (rightChar == ')') {
-                var matching = session.$findOpeningBracket(')', {column: cursor.column + 1, row: cursor.row});
-                if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) {
-                    CstyleBehaviour.popAutoInsertedClosing();
-                    return {
-                        text: '',
-                        selection: [1, 1]
-                    };
-                }
-            }
-        }
-    });
-
-    this.add("parens", "deletion", function (state, action, editor, session, range) {
-        var selected = session.doc.getTextRange(range);
-        if (!range.isMultiLine() && selected == '(') {
-            var line = session.doc.getLine(range.start.row);
-            var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
-            if (rightChar == ')') {
-                range.end.column++;
-                return range;
-            }
-        }
-    });
-
-    this.add("brackets", "insertion", function (state, action, editor, session, text) {
-        if (text == '[') {
-            var selection = editor.getSelectionRange();
-            var selected = session.doc.getTextRange(selection);
-            if (selected !== "" && editor.getWrapBehavioursEnabled()) {
-                return {
-                    text: '[' + selected + ']',
-                    selection: false
-                };
-            } else if (CstyleBehaviour.isSaneInsertion(editor, session)) {
-                CstyleBehaviour.recordAutoInsert(editor, session, "]");
-                return {
-                    text: '[]',
-                    selection: [1, 1]
-                };
-            }
-        } else if (text == ']') {
-            var cursor = editor.getCursorPosition();
-            var line = session.doc.getLine(cursor.row);
-            var rightChar = line.substring(cursor.column, cursor.column + 1);
-            if (rightChar == ']') {
-                var matching = session.$findOpeningBracket(']', {column: cursor.column + 1, row: cursor.row});
-                if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) {
-                    CstyleBehaviour.popAutoInsertedClosing();
-                    return {
-                        text: '',
-                        selection: [1, 1]
-                    };
-                }
-            }
-        }
-    });
-
-    this.add("brackets", "deletion", function (state, action, editor, session, range) {
-        var selected = session.doc.getTextRange(range);
-        if (!range.isMultiLine() && selected == '[') {
-            var line = session.doc.getLine(range.start.row);
-            var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
-            if (rightChar == ']') {
-                range.end.column++;
-                return range;
-            }
-        }
-    });
-
-    this.add("string_dquotes", "insertion", function (state, action, editor, session, text) {
-        if (text == '"' || text == "'") {
-            var quote = text;
-            var selection = editor.getSelectionRange();
-            var selected = session.doc.getTextRange(selection);
-            if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) {
-                return {
-                    text: quote + selected + quote,
-                    selection: false
-                };
-            } else {
-                var cursor = editor.getCursorPosition();
-                var line = session.doc.getLine(cursor.row);
-                var leftChar = line.substring(cursor.column-1, cursor.column);
-                if (leftChar == '\\') {
-                    return null;
-                }
-                var tokens = session.getTokens(selection.start.row);
-                var col = 0, token;
-                var quotepos = -1; // Track whether we're inside an open quote.
-
-                for (var x = 0; x < tokens.length; x++) {
-                    token = tokens[x];
-                    if (token.type == "string") {
-                      quotepos = -1;
-                    } else if (quotepos < 0) {
-                      quotepos = token.value.indexOf(quote);
-                    }
-                    if ((token.value.length + col) > selection.start.column) {
-                        break;
-                    }
-                    col += tokens[x].value.length;
-                }
-                if (!token || (quotepos < 0 && token.type !== "comment" && (token.type !== "string" || ((selection.start.column !== token.value.length+col-1) && token.value.lastIndexOf(quote) === token.value.length-1)))) {
-                    if (!CstyleBehaviour.isSaneInsertion(editor, session))
-                        return;
-                    return {
-                        text: quote + quote,
-                        selection: [1,1]
-                    };
-                } else if (token && token.type === "string") {
-                    var rightChar = line.substring(cursor.column, cursor.column + 1);
-                    if (rightChar == quote) {
-                        return {
-                            text: '',
-                            selection: [1, 1]
-                        };
-                    }
-                }
-            }
-        }
-    });
-
-    this.add("string_dquotes", "deletion", function (state, action, editor, session, range) {
-        var selected = session.doc.getTextRange(range);
-        if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
-            var line = session.doc.getLine(range.start.row);
-            var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
-            if (rightChar == selected) {
-                range.end.column++;
-                return range;
-            }
-        }
-    });
-
-};
-
-oop.inherits(CstyleBehaviour, Behaviour);
-
-exports.CstyleBehaviour = CstyleBehaviour;
-});
-
-define('ace/mode/folding/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/range', 'ace/mode/folding/fold_mode'], function(require, exports, module) {
-
-
-var oop = require("../../lib/oop");
-var Range = require("../../range").Range;
-var BaseFoldMode = require("./fold_mode").FoldMode;
-
-var FoldMode = exports.FoldMode = function(commentRegex) {
-    if (commentRegex) {
-        this.foldingStartMarker = new RegExp(
-            this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start)
-        );
-        this.foldingStopMarker = new RegExp(
-            this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end)
-        );
-    }
-};
-oop.inherits(FoldMode, BaseFoldMode);
-
-(function() {
-
-    this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/;
-    this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/;
-
-    this.getFoldWidgetRange = function(session, foldStyle, row) {
-        var line = session.getLine(row);
-        var match = line.match(this.foldingStartMarker);
-        if (match) {
-            var i = match.index;
-
-            if (match[1])
-                return this.openingBracketBlock(session, match[1], row, i);
-
-            return session.getCommentFoldRange(row, i + match[0].length, 1);
-        }
-
-        if (foldStyle !== "markbeginend")
-            return;
-
-        var match = line.match(this.foldingStopMarker);
-        if (match) {
-            var i = match.index + match[0].length;
-
-            if (match[1])
-                return this.closingBracketBlock(session, match[1], row, i);
-
-            return session.getCommentFoldRange(row, i, -1);
-        }
-    };
-
-}).call(FoldMode.prototype);
-
-});


[24/37] goodbye Futon, old friend <3

Posted by ja...@apache.org.
http://git-wip-us.apache.org/repos/asf/couchdb/blob/cca309f3/share/www/script/jquery.form.js
----------------------------------------------------------------------
diff --git a/share/www/script/jquery.form.js b/share/www/script/jquery.form.js
deleted file mode 100644
index 14e1457..0000000
--- a/share/www/script/jquery.form.js
+++ /dev/null
@@ -1,803 +0,0 @@
-/*!
- * jQuery Form Plugin
- * version: 2.63 (29-JAN-2011)
- * @requires jQuery v1.3.2 or later
- *
- * Examples and documentation at: http://malsup.com/jquery/form/
- * Dual licensed under the MIT and GPL licenses:
- *   http://www.opensource.org/licenses/mit-license.php
- *   http://www.gnu.org/licenses/gpl.html
- */
-;(function($) {
-
-/*
-	Usage Note:
-	-----------
-	Do not use both ajaxSubmit and ajaxForm on the same form.  These
-	functions are intended to be exclusive.  Use ajaxSubmit if you want
-	to bind your own submit handler to the form.  For example,
-
-	$(document).ready(function() {
-		$('#myForm').bind('submit', function(e) {
-			e.preventDefault(); // <-- important
-			$(this).ajaxSubmit({
-				target: '#output'
-			});
-		});
-	});
-
-	Use ajaxForm when you want the plugin to manage all the event binding
-	for you.  For example,
-
-	$(document).ready(function() {
-		$('#myForm').ajaxForm({
-			target: '#output'
-		});
-	});
-
-	When using ajaxForm, the ajaxSubmit function will be invoked for you
-	at the appropriate time.
-*/
-
-/**
- * ajaxSubmit() provides a mechanism for immediately submitting
- * an HTML form using AJAX.
- */
-$.fn.ajaxSubmit = function(options) {
-	// fast fail if nothing selected (http://dev.jquery.com/ticket/2752)
-	if (!this.length) {
-		log('ajaxSubmit: skipping submit process - no element selected');
-		return this;
-	}
-
-	if (typeof options == 'function') {
-		options = { success: options };
-	}
-
-	var action = this.attr('action');
-	var url = (typeof action === 'string') ? $.trim(action) : '';
-	if (url) {
-		// clean url (don't include hash vaue)
-		url = (url.match(/^([^#]+)/)||[])[1];
-	}
-	url = url || window.location.href || '';
-
-	options = $.extend(true, {
-		url:  url,
-		type: this[0].getAttribute('method') || 'GET', // IE7 massage (see issue 57)
-		iframeSrc: /^https/i.test(window.location.href || '') ? 'javascript:false' : 'about:blank'
-	}, options);
-
-	// hook for manipulating the form data before it is extracted;
-	// convenient for use with rich editors like tinyMCE or FCKEditor
-	var veto = {};
-	this.trigger('form-pre-serialize', [this, options, veto]);
-	if (veto.veto) {
-		log('ajaxSubmit: submit vetoed via form-pre-serialize trigger');
-		return this;
-	}
-
-	// provide opportunity to alter form data before it is serialized
-	if (options.beforeSerialize && options.beforeSerialize(this, options) === false) {
-		log('ajaxSubmit: submit aborted via beforeSerialize callback');
-		return this;
-	}
-
-	var n,v,a = this.formToArray(options.semantic);
-	if (options.data) {
-		options.extraData = options.data;
-		for (n in options.data) {
-			if(options.data[n] instanceof Array) {
-				for (var k in options.data[n]) {
-					a.push( { name: n, value: options.data[n][k] } );
-				}
-			}
-			else {
-				v = options.data[n];
-				v = $.isFunction(v) ? v() : v; // if value is fn, invoke it
-				a.push( { name: n, value: v } );
-			}
-		}
-	}
-
-	// give pre-submit callback an opportunity to abort the submit
-	if (options.beforeSubmit && options.beforeSubmit(a, this, options) === false) {
-		log('ajaxSubmit: submit aborted via beforeSubmit callback');
-		return this;
-	}
-
-	// fire vetoable 'validate' event
-	this.trigger('form-submit-validate', [a, this, options, veto]);
-	if (veto.veto) {
-		log('ajaxSubmit: submit vetoed via form-submit-validate trigger');
-		return this;
-	}
-
-	var q = $.param(a);
-
-	if (options.type.toUpperCase() == 'GET') {
-		options.url += (options.url.indexOf('?') >= 0 ? '&' : '?') + q;
-		options.data = null;  // data is null for 'get'
-	}
-	else {
-		options.data = q; // data is the query string for 'post'
-	}
-
-	var $form = this, callbacks = [];
-	if (options.resetForm) {
-		callbacks.push(function() { $form.resetForm(); });
-	}
-	if (options.clearForm) {
-		callbacks.push(function() { $form.clearForm(); });
-	}
-
-	// perform a load on the target only if dataType is not provided
-	if (!options.dataType && options.target) {
-		var oldSuccess = options.success || function(){};
-		callbacks.push(function(data) {
-			var fn = options.replaceTarget ? 'replaceWith' : 'html';
-			$(options.target)[fn](data).each(oldSuccess, arguments);
-		});
-	}
-	else if (options.success) {
-		callbacks.push(options.success);
-	}
-
-	options.success = function(data, status, xhr) { // jQuery 1.4+ passes xhr as 3rd arg
-		var context = options.context || options;   // jQuery 1.4+ supports scope context 
-		for (var i=0, max=callbacks.length; i < max; i++) {
-			callbacks[i].apply(context, [data, status, xhr || $form, $form]);
-		}
-	};
-
-	// are there files to upload?
-	var fileInputs = $('input:file', this).length > 0;
-	var mp = 'multipart/form-data';
-	var multipart = ($form.attr('enctype') == mp || $form.attr('encoding') == mp);
-
-	// options.iframe allows user to force iframe mode
-	// 06-NOV-09: now defaulting to iframe mode if file input is detected
-   if (options.iframe !== false && (fileInputs || options.iframe || multipart)) {
-	   // hack to fix Safari hang (thanks to Tim Molendijk for this)
-	   // see:  http://groups.google.com/group/jquery-dev/browse_thread/thread/36395b7ab510dd5d
-	   if (options.closeKeepAlive) {
-		   $.get(options.closeKeepAlive, fileUpload);
-		}
-	   else {
-		   fileUpload();
-		}
-   }
-   else {
-		$.ajax(options);
-   }
-
-	// fire 'notify' event
-	this.trigger('form-submit-notify', [this, options]);
-	return this;
-
-
-	// private function for handling file uploads (hat tip to YAHOO!)
-	function fileUpload() {
-		var form = $form[0];
-
-		if ($(':input[name=submit],:input[id=submit]', form).length) {
-			// if there is an input with a name or id of 'submit' then we won't be
-			// able to invoke the submit fn on the form (at least not x-browser)
-			alert('Error: Form elements must not have name or id of "submit".');
-			return;
-		}
-		
-		var s = $.extend(true, {}, $.ajaxSettings, options);
-		s.context = s.context || s;
-		var id = 'jqFormIO' + (new Date().getTime()), fn = '_'+id;
-		var $io = $('<iframe id="' + id + '" name="' + id + '" src="'+ s.iframeSrc +'" />');
-		var io = $io[0];
-
-		$io.css({ position: 'absolute', top: '-1000px', left: '-1000px' });
-
-		var xhr = { // mock object
-			aborted: 0,
-			responseText: null,
-			responseXML: null,
-			status: 0,
-			statusText: 'n/a',
-			getAllResponseHeaders: function() {},
-			getResponseHeader: function() {},
-			setRequestHeader: function() {},
-			abort: function() {
-				this.aborted = 1;
-				$io.attr('src', s.iframeSrc); // abort op in progress
-			}
-		};
-
-		var g = s.global;
-		// trigger ajax global events so that activity/block indicators work like normal
-		if (g && ! $.active++) {
-			$.event.trigger("ajaxStart");
-		}
-		if (g) {
-			$.event.trigger("ajaxSend", [xhr, s]);
-		}
-
-		if (s.beforeSend && s.beforeSend.call(s.context, xhr, s) === false) {
-			if (s.global) { 
-				$.active--;
-			}
-			return;
-		}
-		if (xhr.aborted) {
-			return;
-		}
-
-		var timedOut = 0;
-
-		// add submitting element to data if we know it
-		var sub = form.clk;
-		if (sub) {
-			var n = sub.name;
-			if (n && !sub.disabled) {
-				s.extraData = s.extraData || {};
-				s.extraData[n] = sub.value;
-				if (sub.type == "image") {
-					s.extraData[n+'.x'] = form.clk_x;
-					s.extraData[n+'.y'] = form.clk_y;
-				}
-			}
-		}
-
-		// take a breath so that pending repaints get some cpu time before the upload starts
-		function doSubmit() {
-			// make sure form attrs are set
-			var t = $form.attr('target'), a = $form.attr('action');
-
-			// update form attrs in IE friendly way
-			form.setAttribute('target',id);
-			if (form.getAttribute('method') != 'POST') {
-				form.setAttribute('method', 'POST');
-			}
-			if (form.getAttribute('action') != s.url) {
-				form.setAttribute('action', s.url);
-			}
-
-			// ie borks in some cases when setting encoding
-			if (! s.skipEncodingOverride) {
-				$form.attr({
-					encoding: 'multipart/form-data',
-					enctype:  'multipart/form-data'
-				});
-			}
-
-			// support timout
-			if (s.timeout) {
-				setTimeout(function() { timedOut = true; cb(); }, s.timeout);
-			}
-
-			// add "extra" data to form if provided in options
-			var extraInputs = [];
-			try {
-				if (s.extraData) {
-					for (var n in s.extraData) {
-						extraInputs.push(
-							$('<input type="hidden" name="'+n+'" value="'+s.extraData[n]+'" />')
-								.appendTo(form)[0]);
-					}
-				}
-
-				// add iframe to doc and submit the form
-				$io.appendTo('body');
-                io.attachEvent ? io.attachEvent('onload', cb) : io.addEventListener('load', cb, false);
-				form.submit();
-			}
-			finally {
-				// reset attrs and remove "extra" input elements
-				form.setAttribute('action',a);
-				if(t) {
-					form.setAttribute('target', t);
-				} else {
-					$form.removeAttr('target');
-				}
-				$(extraInputs).remove();
-			}
-		}
-
-		if (s.forceSync) {
-			doSubmit();
-		}
-		else {
-			setTimeout(doSubmit, 10); // this lets dom updates render
-		}
-	
-		var data, doc, domCheckCount = 50;
-
-		function cb() {
-			doc = io.contentWindow ? io.contentWindow.document : io.contentDocument ? io.contentDocument : io.document;
-			if (!doc || doc.location.href == s.iframeSrc) {
-				// response not received yet
-				return;
-			}
-            io.detachEvent ? io.detachEvent('onload', cb) : io.removeEventListener('load', cb, false);
-
-			var ok = true;
-			try {
-				if (timedOut) {
-					throw 'timeout';
-				}
-
-				var isXml = s.dataType == 'xml' || doc.XMLDocument || $.isXMLDoc(doc);
-				log('isXml='+isXml);
-				if (!isXml && window.opera && (doc.body == null || doc.body.innerHTML == '')) {
-					if (--domCheckCount) {
-						// in some browsers (Opera) the iframe DOM is not always traversable when
-						// the onload callback fires, so we loop a bit to accommodate
-						log('requeing onLoad callback, DOM not available');
-						setTimeout(cb, 250);
-						return;
-					}
-					// let this fall through because server response could be an empty document
-					//log('Could not access iframe DOM after mutiple tries.');
-					//throw 'DOMException: not available';
-				}
-
-				//log('response detected');
-				xhr.responseText = doc.body ? doc.body.innerHTML : doc.documentElement ? doc.documentElement.innerHTML : null; 
-				xhr.responseXML = doc.XMLDocument ? doc.XMLDocument : doc;
-				xhr.getResponseHeader = function(header){
-					var headers = {'content-type': s.dataType};
-					return headers[header];
-				};
-
-				var scr = /(json|script)/.test(s.dataType);
-				if (scr || s.textarea) {
-					// see if user embedded response in textarea
-					var ta = doc.getElementsByTagName('textarea')[0];
-					if (ta) {
-						xhr.responseText = ta.value;
-					}
-					else if (scr) {
-						// account for browsers injecting pre around json response
-						var pre = doc.getElementsByTagName('pre')[0];
-						var b = doc.getElementsByTagName('body')[0];
-						if (pre) {
-							xhr.responseText = pre.textContent;
-						}
-						else if (b) {
-							xhr.responseText = b.innerHTML;
-						}
-					}			  
-				}
-				else if (s.dataType == 'xml' && !xhr.responseXML && xhr.responseText != null) {
-					xhr.responseXML = toXml(xhr.responseText);
-				}
-				
-				data = httpData(xhr, s.dataType, s);
-			}
-			catch(e){
-				log('error caught:',e);
-				ok = false;
-				xhr.error = e;
-				s.error.call(s.context, xhr, 'error', e);
-				g && $.event.trigger("ajaxError", [xhr, s, e]);
-			}
-			
-			if (xhr.aborted) {
-				log('upload aborted');
-				ok = false;
-			}
-
-			// ordering of these callbacks/triggers is odd, but that's how $.ajax does it
-			if (ok) {
-				s.success.call(s.context, data, 'success', xhr);
-				g && $.event.trigger("ajaxSuccess", [xhr, s]);
-			}
-			
-			g && $.event.trigger("ajaxComplete", [xhr, s]);
-
-			if (g && ! --$.active) {
-				$.event.trigger("ajaxStop");
-			}
-			
-			s.complete && s.complete.call(s.context, xhr, ok ? 'success' : 'error');
-
-			// clean up
-			setTimeout(function() {
-				$io.removeData('form-plugin-onload');
-				$io.remove();
-				xhr.responseXML = null;
-			}, 100);
-		}
-
-		var toXml = $.parseXML || function(s, doc) { // use parseXML if available (jQuery 1.5+)
-			if (window.ActiveXObject) {
-				doc = new ActiveXObject('Microsoft.XMLDOM');
-				doc.async = 'false';
-				doc.loadXML(s);
-			}
-			else {
-				doc = (new DOMParser()).parseFromString(s, 'text/xml');
-			}
-			return (doc && doc.documentElement && doc.documentElement.nodeName != 'parsererror') ? doc : null;
-		};
-		var parseJSON = $.parseJSON || function(s) {
-			return window['eval']('(' + s + ')');
-		};
-		
-		var httpData = function( xhr, type, s ) { // mostly lifted from jq1.4.4
-			var ct = xhr.getResponseHeader('content-type') || '',
-				xml = type === 'xml' || !type && ct.indexOf('xml') >= 0,
-				data = xml ? xhr.responseXML : xhr.responseText;
-
-			if (xml && data.documentElement.nodeName === 'parsererror') {
-				$.error && $.error('parsererror');
-			}
-			if (s && s.dataFilter) {
-				data = s.dataFilter(data, type);
-			}
-			if (typeof data === 'string') {
-				if (type === 'json' || !type && ct.indexOf('json') >= 0) {
-					data = parseJSON(data);
-				} else if (type === "script" || !type && ct.indexOf("javascript") >= 0) {
-					$.globalEval(data);
-				}
-			}
-			return data;
-		};
-	}
-};
-
-/**
- * ajaxForm() provides a mechanism for fully automating form submission.
- *
- * The advantages of using this method instead of ajaxSubmit() are:
- *
- * 1: This method will include coordinates for <input type="image" /> elements (if the element
- *	is used to submit the form).
- * 2. This method will include the submit element's name/value data (for the element that was
- *	used to submit the form).
- * 3. This method binds the submit() method to the form for you.
- *
- * The options argument for ajaxForm works exactly as it does for ajaxSubmit.  ajaxForm merely
- * passes the options argument along after properly binding events for submit elements and
- * the form itself.
- */
-$.fn.ajaxForm = function(options) {
-	// in jQuery 1.3+ we can fix mistakes with the ready state
-	if (this.length === 0) {
-		var o = { s: this.selector, c: this.context };
-		if (!$.isReady && o.s) {
-			log('DOM not ready, queuing ajaxForm');
-			$(function() {
-				$(o.s,o.c).ajaxForm(options);
-			});
-			return this;
-		}
-		// is your DOM ready?  http://docs.jquery.com/Tutorials:Introducing_$(document).ready()
-		log('terminating; zero elements found by selector' + ($.isReady ? '' : ' (DOM not ready)'));
-		return this;
-	}
-	
-	return this.ajaxFormUnbind().bind('submit.form-plugin', function(e) {
-		if (!e.isDefaultPrevented()) { // if event has been canceled, don't proceed
-			e.preventDefault();
-			$(this).ajaxSubmit(options);
-		}
-	}).bind('click.form-plugin', function(e) {
-		var target = e.target;
-		var $el = $(target);
-		if (!($el.is(":submit,input:image"))) {
-			// is this a child element of the submit el?  (ex: a span within a button)
-			var t = $el.closest(':submit');
-			if (t.length == 0) {
-				return;
-			}
-			target = t[0];
-		}
-		var form = this;
-		form.clk = target;
-		if (target.type == 'image') {
-			if (e.offsetX != undefined) {
-				form.clk_x = e.offsetX;
-				form.clk_y = e.offsetY;
-			} else if (typeof $.fn.offset == 'function') { // try to use dimensions plugin
-				var offset = $el.offset();
-				form.clk_x = e.pageX - offset.left;
-				form.clk_y = e.pageY - offset.top;
-			} else {
-				form.clk_x = e.pageX - target.offsetLeft;
-				form.clk_y = e.pageY - target.offsetTop;
-			}
-		}
-		// clear form vars
-		setTimeout(function() { form.clk = form.clk_x = form.clk_y = null; }, 100);
-	});
-};
-
-// ajaxFormUnbind unbinds the event handlers that were bound by ajaxForm
-$.fn.ajaxFormUnbind = function() {
-	return this.unbind('submit.form-plugin click.form-plugin');
-};
-
-/**
- * formToArray() gathers form element data into an array of objects that can
- * be passed to any of the following ajax functions: $.get, $.post, or load.
- * Each object in the array has both a 'name' and 'value' property.  An example of
- * an array for a simple login form might be:
- *
- * [ { name: 'username', value: 'jresig' }, { name: 'password', value: 'secret' } ]
- *
- * It is this array that is passed to pre-submit callback functions provided to the
- * ajaxSubmit() and ajaxForm() methods.
- */
-$.fn.formToArray = function(semantic) {
-	var a = [];
-	if (this.length === 0) {
-		return a;
-	}
-
-	var form = this[0];
-	var els = semantic ? form.getElementsByTagName('*') : form.elements;
-	if (!els) {
-		return a;
-	}
-	
-	var i,j,n,v,el,max,jmax;
-	for(i=0, max=els.length; i < max; i++) {
-		el = els[i];
-		n = el.name;
-		if (!n) {
-			continue;
-		}
-
-		if (semantic && form.clk && el.type == "image") {
-			// handle image inputs on the fly when semantic == true
-			if(!el.disabled && form.clk == el) {
-				a.push({name: n, value: $(el).val()});
-				a.push({name: n+'.x', value: form.clk_x}, {name: n+'.y', value: form.clk_y});
-			}
-			continue;
-		}
-
-		v = $.fieldValue(el, true);
-		if (v && v.constructor == Array) {
-			for(j=0, jmax=v.length; j < jmax; j++) {
-				a.push({name: n, value: v[j]});
-			}
-		}
-		else if (v !== null && typeof v != 'undefined') {
-			a.push({name: n, value: v});
-		}
-	}
-
-	if (!semantic && form.clk) {
-		// input type=='image' are not found in elements array! handle it here
-		var $input = $(form.clk), input = $input[0];
-		n = input.name;
-		if (n && !input.disabled && input.type == 'image') {
-			a.push({name: n, value: $input.val()});
-			a.push({name: n+'.x', value: form.clk_x}, {name: n+'.y', value: form.clk_y});
-		}
-	}
-	return a;
-};
-
-/**
- * Serializes form data into a 'submittable' string. This method will return a string
- * in the format: name1=value1&amp;name2=value2
- */
-$.fn.formSerialize = function(semantic) {
-	//hand off to jQuery.param for proper encoding
-	return $.param(this.formToArray(semantic));
-};
-
-/**
- * Serializes all field elements in the jQuery object into a query string.
- * This method will return a string in the format: name1=value1&amp;name2=value2
- */
-$.fn.fieldSerialize = function(successful) {
-	var a = [];
-	this.each(function() {
-		var n = this.name;
-		if (!n) {
-			return;
-		}
-		var v = $.fieldValue(this, successful);
-		if (v && v.constructor == Array) {
-			for (var i=0,max=v.length; i < max; i++) {
-				a.push({name: n, value: v[i]});
-			}
-		}
-		else if (v !== null && typeof v != 'undefined') {
-			a.push({name: this.name, value: v});
-		}
-	});
-	//hand off to jQuery.param for proper encoding
-	return $.param(a);
-};
-
-/**
- * Returns the value(s) of the element in the matched set.  For example, consider the following form:
- *
- *  <form><fieldset>
- *	  <input name="A" type="text" />
- *	  <input name="A" type="text" />
- *	  <input name="B" type="checkbox" value="B1" />
- *	  <input name="B" type="checkbox" value="B2"/>
- *	  <input name="C" type="radio" value="C1" />
- *	  <input name="C" type="radio" value="C2" />
- *  </fieldset></form>
- *
- *  var v = $(':text').fieldValue();
- *  // if no values are entered into the text inputs
- *  v == ['','']
- *  // if values entered into the text inputs are 'foo' and 'bar'
- *  v == ['foo','bar']
- *
- *  var v = $(':checkbox').fieldValue();
- *  // if neither checkbox is checked
- *  v === undefined
- *  // if both checkboxes are checked
- *  v == ['B1', 'B2']
- *
- *  var v = $(':radio').fieldValue();
- *  // if neither radio is checked
- *  v === undefined
- *  // if first radio is checked
- *  v == ['C1']
- *
- * The successful argument controls whether or not the field element must be 'successful'
- * (per http://www.w3.org/TR/html4/interact/forms.html#successful-controls).
- * The default value of the successful argument is true.  If this value is false the value(s)
- * for each element is returned.
- *
- * Note: This method *always* returns an array.  If no valid value can be determined the
- *	   array will be empty, otherwise it will contain one or more values.
- */
-$.fn.fieldValue = function(successful) {
-	for (var val=[], i=0, max=this.length; i < max; i++) {
-		var el = this[i];
-		var v = $.fieldValue(el, successful);
-		if (v === null || typeof v == 'undefined' || (v.constructor == Array && !v.length)) {
-			continue;
-		}
-		v.constructor == Array ? $.merge(val, v) : val.push(v);
-	}
-	return val;
-};
-
-/**
- * Returns the value of the field element.
- */
-$.fieldValue = function(el, successful) {
-	var n = el.name, t = el.type, tag = el.tagName.toLowerCase();
-	if (successful === undefined) {
-		successful = true;
-	}
-
-	if (successful && (!n || el.disabled || t == 'reset' || t == 'button' ||
-		(t == 'checkbox' || t == 'radio') && !el.checked ||
-		(t == 'submit' || t == 'image') && el.form && el.form.clk != el ||
-		tag == 'select' && el.selectedIndex == -1)) {
-			return null;
-	}
-
-	if (tag == 'select') {
-		var index = el.selectedIndex;
-		if (index < 0) {
-			return null;
-		}
-		var a = [], ops = el.options;
-		var one = (t == 'select-one');
-		var max = (one ? index+1 : ops.length);
-		for(var i=(one ? index : 0); i < max; i++) {
-			var op = ops[i];
-			if (op.selected) {
-				var v = op.value;
-				if (!v) { // extra pain for IE...
-					v = (op.attributes && op.attributes['value'] && !(op.attributes['value'].specified)) ? op.text : op.value;
-				}
-				if (one) {
-					return v;
-				}
-				a.push(v);
-			}
-		}
-		return a;
-	}
-	return $(el).val();
-};
-
-/**
- * Clears the form data.  Takes the following actions on the form's input fields:
- *  - input text fields will have their 'value' property set to the empty string
- *  - select elements will have their 'selectedIndex' property set to -1
- *  - checkbox and radio inputs will have their 'checked' property set to false
- *  - inputs of type submit, button, reset, and hidden will *not* be effected
- *  - button elements will *not* be effected
- */
-$.fn.clearForm = function() {
-	return this.each(function() {
-		$('input,select,textarea', this).clearFields();
-	});
-};
-
-/**
- * Clears the selected form elements.
- */
-$.fn.clearFields = $.fn.clearInputs = function() {
-	return this.each(function() {
-		var t = this.type, tag = this.tagName.toLowerCase();
-		if (t == 'text' || t == 'password' || tag == 'textarea') {
-			this.value = '';
-		}
-		else if (t == 'checkbox' || t == 'radio') {
-			this.checked = false;
-		}
-		else if (tag == 'select') {
-			this.selectedIndex = -1;
-		}
-	});
-};
-
-/**
- * Resets the form data.  Causes all form elements to be reset to their original value.
- */
-$.fn.resetForm = function() {
-	return this.each(function() {
-		// guard against an input with the name of 'reset'
-		// note that IE reports the reset function as an 'object'
-		if (typeof this.reset == 'function' || (typeof this.reset == 'object' && !this.reset.nodeType)) {
-			this.reset();
-		}
-	});
-};
-
-/**
- * Enables or disables any matching elements.
- */
-$.fn.enable = function(b) {
-	if (b === undefined) {
-		b = true;
-	}
-	return this.each(function() {
-		this.disabled = !b;
-	});
-};
-
-/**
- * Checks/unchecks any matching checkboxes or radio buttons and
- * selects/deselects and matching option elements.
- */
-$.fn.selected = function(select) {
-	if (select === undefined) {
-		select = true;
-	}
-	return this.each(function() {
-		var t = this.type;
-		if (t == 'checkbox' || t == 'radio') {
-			this.checked = select;
-		}
-		else if (this.tagName.toLowerCase() == 'option') {
-			var $sel = $(this).parent('select');
-			if (select && $sel[0] && $sel[0].type == 'select-one') {
-				// deselect all other options
-				$sel.find('option').selected(false);
-			}
-			this.selected = select;
-		}
-	});
-};
-
-// helper fn for console logging
-// set $.fn.ajaxSubmit.debug to true to enable debug logging
-function log() {
-	if ($.fn.ajaxSubmit.debug) {
-		var msg = '[jquery.form] ' + Array.prototype.join.call(arguments,'');
-		if (window.console && window.console.log) {
-			window.console.log(msg);
-		}
-		else if (window.opera && window.opera.postError) {
-			window.opera.postError(msg);
-		}
-	}
-};
-
-})(jQuery);


[21/37] goodbye Futon, old friend <3

Posted by ja...@apache.org.
http://git-wip-us.apache.org/repos/asf/couchdb/blob/cca309f3/share/www/script/jspec/jspec.xhr.js
----------------------------------------------------------------------
diff --git a/share/www/script/jspec/jspec.xhr.js b/share/www/script/jspec/jspec.xhr.js
deleted file mode 100644
index 6164879..0000000
--- a/share/www/script/jspec/jspec.xhr.js
+++ /dev/null
@@ -1,195 +0,0 @@
-
-// JSpec - XHR - Copyright TJ Holowaychuk <tj...@vision-media.ca> (MIT Licensed)
-
-(function(){
-  
-  var lastRequest
-  
-  // --- Original XMLHttpRequest
-  
-  var OriginalXMLHttpRequest = 'XMLHttpRequest' in this ? 
-                                 XMLHttpRequest :
-                                   function(){}
-  var OriginalActiveXObject = 'ActiveXObject' in this ?
-                                 ActiveXObject :
-                                   undefined
-                                   
-  // --- MockXMLHttpRequest
-
-  var MockXMLHttpRequest = function() {
-    this.requestHeaders = {}
-  }
-  
-  MockXMLHttpRequest.prototype = {
-    status: 0,
-    async: true,
-    readyState: 0,
-    responseText: '',
-    abort: function(){},
-    onreadystatechange: function(){},
-
-   /**
-    * Return response headers hash.
-    */
-
-    getAllResponseHeaders : function(){
-      return this.responseHeaders
-    },
-    
-    /**
-     * Return case-insensitive value for header _name_.
-     */
-
-    getResponseHeader : function(name) {
-      return this.responseHeaders[name.toLowerCase()]
-    },
-    
-    /**
-     * Set case-insensitive _value_ for header _name_.
-     */
-
-    setRequestHeader : function(name, value) {
-      this.requestHeaders[name.toLowerCase()] = value
-    },
-    
-    /**
-     * Open mock request.
-     */
-
-    open : function(method, url, async, user, password) {
-      this.user = user
-      this.password = password
-      this.url = url
-      this.readyState = 1
-      this.method = method.toUpperCase()
-      if (async != undefined) this.async = async
-      if (this.async) this.onreadystatechange()
-    },
-    
-    /**
-     * Send request _data_.
-     */
-
-    send : function(data) {
-      var self = this
-      this.data = data
-      this.readyState = 4
-      if (this.method == 'HEAD') this.responseText = null
-      this.responseHeaders['content-length'] = (this.responseText || '').length
-      if(this.async) this.onreadystatechange()
-      lastRequest = function(){
-        return self
-      }
-    }
-  }
-  
-  // --- Response status codes
-  
-  JSpec.statusCodes = {
-    100: 'Continue',
-    101: 'Switching Protocols',
-    200: 'OK',
-    201: 'Created',
-    202: 'Accepted',
-    203: 'Non-Authoritative Information',
-    204: 'No Content',
-    205: 'Reset Content',
-    206: 'Partial Content',
-    300: 'Multiple Choice',
-    301: 'Moved Permanently',
-    302: 'Found',
-    303: 'See Other',
-    304: 'Not Modified',
-    305: 'Use Proxy',
-    307: 'Temporary Redirect',
-    400: 'Bad Request',
-    401: 'Unauthorized',
-    402: 'Payment Required',
-    403: 'Forbidden',
-    404: 'Not Found',
-    405: 'Method Not Allowed',
-    406: 'Not Acceptable',
-    407: 'Proxy Authentication Required',
-    408: 'Request Timeout',
-    409: 'Conflict',
-    410: 'Gone',
-    411: 'Length Required',
-    412: 'Precondition Failed',
-    413: 'Request Entity Too Large',
-    414: 'Request-URI Too Long',
-    415: 'Unsupported Media Type',
-    416: 'Requested Range Not Satisfiable',
-    417: 'Expectation Failed',
-    422: 'Unprocessable Entity',
-    500: 'Internal Server Error',
-    501: 'Not Implemented',
-    502: 'Bad Gateway',
-    503: 'Service Unavailable',
-    504: 'Gateway Timeout',
-    505: 'HTTP Version Not Supported'
-  }
-  
-  /**
-   * Mock XMLHttpRequest requests.
-   *
-   *   mockRequest().and_return('some data', 'text/plain', 200, { 'X-SomeHeader' : 'somevalue' })
-   *
-   * @return {hash}
-   * @api public
-   */
-  
-  function mockRequest() {
-    return { and_return : function(body, type, status, headers) {
-      XMLHttpRequest = MockXMLHttpRequest
-      ActiveXObject = false
-      status = status || 200
-      headers = headers || {}
-      headers['content-type'] = type
-      JSpec.extend(XMLHttpRequest.prototype, {
-        responseText: body,
-        responseHeaders: headers,
-        status: status,
-        statusText: JSpec.statusCodes[status]
-      })
-    }}
-  }
-  
-  /**
-   * Unmock XMLHttpRequest requests.
-   *
-   * @api public
-   */
-  
-  function unmockRequest() {
-    XMLHttpRequest = OriginalXMLHttpRequest
-    ActiveXObject = OriginalActiveXObject
-  }
-  
-  JSpec.include({
-    name: 'Mock XHR',
-
-    // --- Utilities
-
-    utilities : {
-      mockRequest: mockRequest,
-      unmockRequest: unmockRequest
-    },
-
-    // --- Hooks
-
-    afterSpec : function() {
-      unmockRequest()
-    },
-    
-    // --- DSLs
-    
-    DSLs : {
-      snake : {
-        mock_request: mockRequest,
-        unmock_request: unmockRequest,
-        last_request: function(){ return lastRequest() }
-      }
-    }
-
-  })
-})()
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/couchdb/blob/cca309f3/share/www/script/oauth.js
----------------------------------------------------------------------
diff --git a/share/www/script/oauth.js b/share/www/script/oauth.js
deleted file mode 100644
index ada00a2..0000000
--- a/share/www/script/oauth.js
+++ /dev/null
@@ -1,511 +0,0 @@
-/*
- * Copyright 2008 Netflix, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/* Here's some JavaScript software for implementing OAuth.
-
-   This isn't as useful as you might hope.  OAuth is based around
-   allowing tools and websites to talk to each other.  However,
-   JavaScript running in web browsers is hampered by security
-   restrictions that prevent code running on one website from
-   accessing data stored or served on another.
-
-   Before you start hacking, make sure you understand the limitations
-   posed by cross-domain XMLHttpRequest.
-
-   On the bright side, some platforms use JavaScript as their
-   language, but enable the programmer to access other web sites.
-   Examples include Google Gadgets, and Microsoft Vista Sidebar.
-   For those platforms, this library should come in handy.
-*/
-
-// The HMAC-SHA1 signature method calls b64_hmac_sha1, defined by
-// http://pajhome.org.uk/crypt/md5/sha1.js
-
-/* An OAuth message is represented as an object like this:
-   {method: "GET", action: "http://server.com/path", parameters: ...}
-
-   The parameters may be either a map {name: value, name2: value2}
-   or an Array of name-value pairs [[name, value], [name2, value2]].
-   The latter representation is more powerful: it supports parameters
-   in a specific sequence, or several parameters with the same name;
-   for example [["a", 1], ["b", 2], ["a", 3]].
-
-   Parameter names and values are NOT percent-encoded in an object.
-   They must be encoded before transmission and decoded after reception.
-   For example, this message object:
-   {method: "GET", action: "http://server/path", parameters: {p: "x y"}}
-   ... can be transmitted as an HTTP request that begins:
-   GET /path?p=x%20y HTTP/1.0
-   (This isn't a valid OAuth request, since it lacks a signature etc.)
-   Note that the object "x y" is transmitted as x%20y.  To encode
-   parameters, you can call OAuth.addToURL, OAuth.formEncode or
-   OAuth.getAuthorization.
-
-   This message object model harmonizes with the browser object model for
-   input elements of an form, whose value property isn't percent encoded.
-   The browser encodes each value before transmitting it. For example,
-   see consumer.setInputs in example/consumer.js.
- */
-var OAuth; if (OAuth == null) OAuth = {};
-
-OAuth.setProperties = function setProperties(into, from) {
-    if (into != null && from != null) {
-        for (var key in from) {
-            into[key] = from[key];
-        }
-    }
-    return into;
-}
-
-OAuth.setProperties(OAuth, // utility functions
-{
-    percentEncode: function percentEncode(s) {
-        if (s == null) {
-            return "";
-        }
-        if (s instanceof Array) {
-            var e = "";
-            for (var i = 0; i < s.length; ++i) {
-                if (e != "") e += '&';
-                e += percentEncode(s[i]);
-            }
-            return e;
-        }
-        s = encodeURIComponent(s);
-        // Now replace the values which encodeURIComponent doesn't do
-        // encodeURIComponent ignores: - _ . ! ~ * ' ( )
-        // OAuth dictates the only ones you can ignore are: - _ . ~
-        // Source: http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Global_Functions:encodeURIComponent
-        s = s.replace(/\!/g, "%21");
-        s = s.replace(/\*/g, "%2A");
-        s = s.replace(/\'/g, "%27");
-        s = s.replace(/\(/g, "%28");
-        s = s.replace(/\)/g, "%29");
-        return s;
-    }
-,
-    decodePercent: function decodePercent(s) {
-        if (s != null) {
-            // Handle application/x-www-form-urlencoded, which is defined by
-            // http://www.w3.org/TR/html4/interact/forms.html#h-17.13.4.1
-            s = s.replace(/\+/g, " ");
-        }
-        return decodeURIComponent(s);
-    }
-,
-    /** Convert the given parameters to an Array of name-value pairs. */
-    getParameterList: function getParameterList(parameters) {
-        if (parameters == null) {
-            return [];
-        }
-        if (typeof parameters != "object") {
-            return decodeForm(parameters + "");
-        }
-        if (parameters instanceof Array) {
-            return parameters;
-        }
-        var list = [];
-        for (var p in parameters) {
-            list.push([p, parameters[p]]);
-        }
-        return list;
-    }
-,
-    /** Convert the given parameters to a map from name to value. */
-    getParameterMap: function getParameterMap(parameters) {
-        if (parameters == null) {
-            return {};
-        }
-        if (typeof parameters != "object") {
-            return getParameterMap(decodeForm(parameters + ""));
-        }
-        if (parameters instanceof Array) {
-            var map = {};
-            for (var p = 0; p < parameters.length; ++p) {
-                var key = parameters[p][0];
-                if (map[key] === undefined) { // first value wins
-                    map[key] = parameters[p][1];
-                }
-            }
-            return map;
-        }
-        return parameters;
-    }
-,
-    getParameter: function getParameter(parameters, name) {
-        if (parameters instanceof Array) {
-            for (var p = 0; p < parameters.length; ++p) {
-                if (parameters[p][0] == name) {
-                    return parameters[p][1]; // first value wins
-                }
-            }
-        } else {
-            return OAuth.getParameterMap(parameters)[name];
-        }
-        return null;
-    }
-,
-    formEncode: function formEncode(parameters) {
-        var form = "";
-        var list = OAuth.getParameterList(parameters);
-        for (var p = 0; p < list.length; ++p) {
-            var value = list[p][1];
-            if (value == null) value = "";
-            if (form != "") form += '&';
-            form += OAuth.percentEncode(list[p][0])
-              +'='+ OAuth.percentEncode(value);
-        }
-        return form;
-    }
-,
-    decodeForm: function decodeForm(form) {
-        var list = [];
-        var nvps = form.split('&');
-        for (var n = 0; n < nvps.length; ++n) {
-            var nvp = nvps[n];
-            if (nvp == "") {
-                continue;
-            }
-            var equals = nvp.indexOf('=');
-            var name;
-            var value;
-            if (equals < 0) {
-                name = OAuth.decodePercent(nvp);
-                value = null;
-            } else {
-                name = OAuth.decodePercent(nvp.substring(0, equals));
-                value = OAuth.decodePercent(nvp.substring(equals + 1));
-            }
-            list.push([name, value]);
-        }
-        return list;
-    }
-,
-    setParameter: function setParameter(message, name, value) {
-        var parameters = message.parameters;
-        if (parameters instanceof Array) {
-            for (var p = 0; p < parameters.length; ++p) {
-                if (parameters[p][0] == name) {
-                    if (value === undefined) {
-                        parameters.splice(p, 1);
-                    } else {
-                        parameters[p][1] = value;
-                        value = undefined;
-                    }
-                }
-            }
-            if (value !== undefined) {
-                parameters.push([name, value]);
-            }
-        } else {
-            parameters = OAuth.getParameterMap(parameters);
-            parameters[name] = value;
-            message.parameters = parameters;
-        }
-    }
-,
-    setParameters: function setParameters(message, parameters) {
-        var list = OAuth.getParameterList(parameters);
-        for (var i = 0; i < list.length; ++i) {
-            OAuth.setParameter(message, list[i][0], list[i][1]);
-        }
-    }
-,
-    /** Fill in parameters to help construct a request message.
-        This function doesn't fill in every parameter.
-        The accessor object should be like:
-        {consumerKey:'foo', consumerSecret:'bar', accessorSecret:'nurn', token:'krelm', tokenSecret:'blah'}
-        The accessorSecret property is optional.
-     */
-    completeRequest: function completeRequest(message, accessor) {
-        if (message.method == null) {
-            message.method = "GET";
-        }
-        var map = OAuth.getParameterMap(message.parameters);
-        if (map.oauth_consumer_key == null) {
-            OAuth.setParameter(message, "oauth_consumer_key", accessor.consumerKey || "");
-        }
-        if (map.oauth_token == null && accessor.token != null) {
-            OAuth.setParameter(message, "oauth_token", accessor.token);
-        }
-        if (map.oauth_version == null) {
-            OAuth.setParameter(message, "oauth_version", "1.0");
-        }
-        if (map.oauth_timestamp == null) {
-            OAuth.setParameter(message, "oauth_timestamp", OAuth.timestamp());
-        }
-        if (map.oauth_nonce == null) {
-            OAuth.setParameter(message, "oauth_nonce", OAuth.nonce(6));
-        }
-        OAuth.SignatureMethod.sign(message, accessor);
-    }
-,
-    setTimestampAndNonce: function setTimestampAndNonce(message) {
-        OAuth.setParameter(message, "oauth_timestamp", OAuth.timestamp());
-        OAuth.setParameter(message, "oauth_nonce", OAuth.nonce(6));
-    }
-,
-    addToURL: function addToURL(url, parameters) {
-        newURL = url;
-        if (parameters != null) {
-            var toAdd = OAuth.formEncode(parameters);
-            if (toAdd.length > 0) {
-                var q = url.indexOf('?');
-                if (q < 0) newURL += '?';
-                else       newURL += '&';
-                newURL += toAdd;
-            }
-        }
-        return newURL;
-    }
-,
-    /** Construct the value of the Authorization header for an HTTP request. */
-    getAuthorizationHeader: function getAuthorizationHeader(realm, parameters) {
-        var header = 'OAuth realm="' + OAuth.percentEncode(realm) + '"';
-        var list = OAuth.getParameterList(parameters);
-        for (var p = 0; p < list.length; ++p) {
-            var parameter = list[p];
-            var name = parameter[0];
-            if (name.indexOf("oauth_") == 0) {
-                header += ',' + OAuth.percentEncode(name) + '="' + OAuth.percentEncode(parameter[1]) + '"';
-            }
-        }
-        return header;
-    }
-,
-    timestamp: function timestamp() {
-        var d = new Date();
-        return Math.floor(d.getTime()/1000);
-    }
-,
-    nonce: function nonce(length) {
-        var chars = OAuth.nonce.CHARS;
-        var result = "";
-        for (var i = 0; i < length; ++i) {
-            var rnum = Math.floor(Math.random() * chars.length);
-            result += chars.substring(rnum, rnum+1);
-        }
-        return result;
-    }
-});
-
-OAuth.nonce.CHARS = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";
-
-/** Define a constructor function,
-    without causing trouble to anyone who was using it as a namespace.
-    That is, if parent[name] already existed and had properties,
-    copy those properties into the new constructor.
- */
-OAuth.declareClass = function declareClass(parent, name, newConstructor) {
-    var previous = parent[name];
-    parent[name] = newConstructor;
-    if (newConstructor != null && previous != null) {
-        for (var key in previous) {
-            if (key != "prototype") {
-                newConstructor[key] = previous[key];
-            }
-        }
-    }
-    return newConstructor;
-}
-
-/** An abstract algorithm for signing messages. */
-OAuth.declareClass(OAuth, "SignatureMethod", function OAuthSignatureMethod(){});
-
-OAuth.setProperties(OAuth.SignatureMethod.prototype, // instance members
-{
-    /** Add a signature to the message. */
-    sign: function sign(message) {
-        var baseString = OAuth.SignatureMethod.getBaseString(message);
-        var signature = this.getSignature(baseString);
-        OAuth.setParameter(message, "oauth_signature", signature);
-        return signature; // just in case someone's interested
-    }
-,
-    /** Set the key string for signing. */
-    initialize: function initialize(name, accessor) {
-        var consumerSecret;
-        if (accessor.accessorSecret != null
-            && name.length > 9
-            && name.substring(name.length-9) == "-Accessor")
-        {
-            consumerSecret = accessor.accessorSecret;
-        } else {
-            consumerSecret = accessor.consumerSecret;
-        }
-        this.key = OAuth.percentEncode(consumerSecret)
-             +"&"+ OAuth.percentEncode(accessor.tokenSecret);
-    }
-});
-
-/* SignatureMethod expects an accessor object to be like this:
-   {tokenSecret: "lakjsdflkj...", consumerSecret: "QOUEWRI..", accessorSecret: "xcmvzc..."}
-   The accessorSecret property is optional.
- */
-// Class members:
-OAuth.setProperties(OAuth.SignatureMethod, // class members
-{
-    sign: function sign(message, accessor) {
-        var name = OAuth.getParameterMap(message.parameters).oauth_signature_method;
-        if (name == null || name == "") {
-            name = "HMAC-SHA1";
-            OAuth.setParameter(message, "oauth_signature_method", name);
-        }
-        OAuth.SignatureMethod.newMethod(name, accessor).sign(message);
-    }
-,
-    /** Instantiate a SignatureMethod for the given method name. */
-    newMethod: function newMethod(name, accessor) {
-        var impl = OAuth.SignatureMethod.REGISTERED[name];
-        if (impl != null) {
-            var method = new impl();
-            method.initialize(name, accessor);
-            return method;
-        }
-        var err = new Error("signature_method_rejected");
-        var acceptable = "";
-        for (var r in OAuth.SignatureMethod.REGISTERED) {
-            if (acceptable != "") acceptable += '&';
-            acceptable += OAuth.percentEncode(r);
-        }
-        err.oauth_acceptable_signature_methods = acceptable;
-        throw err;
-    }
-,
-    /** A map from signature method name to constructor. */
-    REGISTERED : {}
-,
-    /** Subsequently, the given constructor will be used for the named methods.
-        The constructor will be called with no parameters.
-        The resulting object should usually implement getSignature(baseString).
-        You can easily define such a constructor by calling makeSubclass, below.
-     */
-    registerMethodClass: function registerMethodClass(names, classConstructor) {
-        for (var n = 0; n < names.length; ++n) {
-            OAuth.SignatureMethod.REGISTERED[names[n]] = classConstructor;
-        }
-    }
-,
-    /** Create a subclass of OAuth.SignatureMethod, with the given getSignature function. */
-    makeSubclass: function makeSubclass(getSignatureFunction) {
-        var superClass = OAuth.SignatureMethod;
-        var subClass = function() {
-            superClass.call(this);
-        }; 
-        subClass.prototype = new superClass();
-        // Delete instance variables from prototype:
-        // delete subclass.prototype... There aren't any.
-        subClass.prototype.getSignature = getSignatureFunction;
-        subClass.prototype.constructor = subClass;
-        return subClass;
-    }
-,
-    getBaseString: function getBaseString(message) {
-        var URL = message.action;
-        var q = URL.indexOf('?');
-        var parameters;
-        if (q < 0) {
-            parameters = message.parameters;
-        } else {
-            // Combine the URL query string with the other parameters:
-            parameters = OAuth.decodeForm(URL.substring(q + 1));
-            var toAdd = OAuth.getParameterList(message.parameters);
-            for (var a = 0; a < toAdd.length; ++a) {
-                parameters.push(toAdd[a]);
-            }
-        }
-        return OAuth.percentEncode(message.method.toUpperCase())
-         +'&'+ OAuth.percentEncode(OAuth.SignatureMethod.normalizeUrl(URL))
-         +'&'+ OAuth.percentEncode(OAuth.SignatureMethod.normalizeParameters(parameters));
-    }
-,
-    normalizeUrl: function normalizeUrl(url) {
-        var uri = OAuth.SignatureMethod.parseUri(url);
-        var scheme = uri.protocol.toLowerCase();
-        var authority = uri.authority.toLowerCase();
-        var dropPort = (scheme == "http" && uri.port == 80)
-                    || (scheme == "https" && uri.port == 443);
-        if (dropPort) {
-            // find the last : in the authority
-            var index = authority.lastIndexOf(":");
-            if (index >= 0) {
-                authority = authority.substring(0, index);
-            }
-        }
-        var path = uri.path;
-        if (!path) {
-            path = "/"; // conforms to RFC 2616 section 3.2.2
-        }
-        // we know that there is no query and no fragment here.
-        return scheme + "://" + authority + path;
-    }
-,
-    parseUri: function parseUri (str) {
-        /* This function was adapted from parseUri 1.2.1
-           http://stevenlevithan.com/demo/parseuri/js/assets/parseuri.js
-         */
-        var o = {key: ["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],
-                 parser: {strict: /^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/ }};
-        var m = o.parser.strict.exec(str);
-        var uri = {};
-        var i = 14;
-        while (i--) uri[o.key[i]] = m[i] || "";
-        return uri;
-    }
-,
-    normalizeParameters: function normalizeParameters(parameters) {
-        if (parameters == null) {
-            return "";
-        }
-        var list = OAuth.getParameterList(parameters);
-        var sortable = [];
-        for (var p = 0; p < list.length; ++p) {
-            var nvp = list[p];
-            if (nvp[0] != "oauth_signature") {
-                sortable.push([ OAuth.percentEncode(nvp[0])
-                              + " " // because it comes before any character that can appear in a percentEncoded string.
-                              + OAuth.percentEncode(nvp[1])
-                              , nvp]);
-            }
-        }
-        sortable.sort(function(a,b) {
-                          if (a[0] < b[0]) return  -1;
-                          if (a[0] > b[0]) return 1;
-                          return 0;
-                      });
-        var sorted = [];
-        for (var s = 0; s < sortable.length; ++s) {
-            sorted.push(sortable[s][1]);
-        }
-        return OAuth.formEncode(sorted);
-    }
-});
-
-OAuth.SignatureMethod.registerMethodClass(["PLAINTEXT", "PLAINTEXT-Accessor"],
-    OAuth.SignatureMethod.makeSubclass(
-        function getSignature(baseString) {
-            return this.key;
-        }
-    ));
-
-OAuth.SignatureMethod.registerMethodClass(["HMAC-SHA1", "HMAC-SHA1-Accessor"],
-    OAuth.SignatureMethod.makeSubclass(
-        function getSignature(baseString) {
-            b64pad = '=';
-            var signature = b64_hmac_sha1(this.key, baseString);
-            return signature;
-        }
-    ));

http://git-wip-us.apache.org/repos/asf/couchdb/blob/cca309f3/share/www/script/replicator_db_inc.js
----------------------------------------------------------------------
diff --git a/share/www/script/replicator_db_inc.js b/share/www/script/replicator_db_inc.js
deleted file mode 100644
index 23f8587..0000000
--- a/share/www/script/replicator_db_inc.js
+++ /dev/null
@@ -1,96 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
-var replicator_db = {};
-replicator_db.wait_rep_doc = 500; // number of millisecs to wait after saving a Rep Doc
-replicator_db.dbA = new CouchDB("test_suite_rep_db_a", {"X-Couch-Full-Commit":"false"});
-replicator_db.dbB = new CouchDB("test_suite_rep_db_b", {"X-Couch-Full-Commit":"false"});
-replicator_db.repDb = new CouchDB("test_suite_rep_db", {"X-Couch-Full-Commit":"false"});
-replicator_db.usersDb = new CouchDB("test_suite_auth", {"X-Couch-Full-Commit":"false"});
-
-replicator_db.docs1 = [
-  {
-    _id: "foo1",
-    value: 11
-  },
-  {
-    _id: "foo2",
-    value: 22
-  },
-  {
-    _id: "foo3",
-    value: 33
-  }
-];
-
-replicator_db.waitForRep = function waitForSeq(repDb, repDoc, state) {
-  var newRep,
-      t0 = new Date(),
-      t1,
-      ms = 3000;
-
-  do {
-    newRep = repDb.open(repDoc._id);
-    t1 = new Date();
-  } while (((t1 - t0) <= ms) && newRep._replication_state !== state);
-}
-
-replicator_db.waitForSeq = function waitForSeq(sourceDb, targetDb) {
-  var targetSeq,
-      sourceSeq = sourceDb.info().update_seq,
-      t0 = new Date(),
-      t1,
-      ms = 3000;
-
-  do {
-    targetSeq = targetDb.info().update_seq;
-    t1 = new Date();
-  } while (((t1 - t0) <= ms) && targetSeq < sourceSeq);
-}
-
-replicator_db.waitForDocPos = function waitForDocPos(db, docId, pos) {
-  var doc, curPos, t0, t1,
-      maxWait = 3000;
-
-  doc = db.open(docId);
-  curPos = Number(doc._rev.split("-", 1));
-  t0 = t1 = new Date();
-
-  while ((curPos < pos) && ((t1 - t0) <= maxWait)) {
-     doc = db.open(docId);
-     curPos = Number(doc._rev.split("-", 1));
-     t1 = new Date();
-  }
-
-  return doc;
-}
-
-replicator_db.wait = function wait(ms) {
-  var t0 = new Date(), t1;
-  do {
-    CouchDB.request("GET", "/");
-    t1 = new Date();
-  } while ((t1 - t0) <= ms);
-}
-
-
-replicator_db.populate_db = function populate_db(db, docs) {
-  if (db.name !== replicator_db.usersDb.name) {
-    db.deleteDb();
-    db.createDb();
-  }
-  for (var i = 0; i < docs.length; i++) {
-    var d = docs[i];
-    delete d._rev;
-    T(db.save(d).ok);
-  }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/couchdb/blob/cca309f3/share/www/script/sha1.js
----------------------------------------------------------------------
diff --git a/share/www/script/sha1.js b/share/www/script/sha1.js
deleted file mode 100644
index ee73a63..0000000
--- a/share/www/script/sha1.js
+++ /dev/null
@@ -1,202 +0,0 @@
-/*
- * A JavaScript implementation of the Secure Hash Algorithm, SHA-1, as defined
- * in FIPS PUB 180-1
- * Version 2.1a Copyright Paul Johnston 2000 - 2002.
- * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
- * Distributed under the BSD License
- * See http://pajhome.org.uk/crypt/md5 for details.
- */
-
-/*
- * Configurable variables. You may need to tweak these to be compatible with
- * the server-side, but the defaults work in most cases.
- */
-var hexcase = 0;  /* hex output format. 0 - lowercase; 1 - uppercase        */
-var b64pad  = "="; /* base-64 pad character. "=" for strict RFC compliance   */
-var chrsz   = 8;  /* bits per input character. 8 - ASCII; 16 - Unicode      */
-
-/*
- * These are the functions you'll usually want to call
- * They take string arguments and return either hex or base-64 encoded strings
- */
-function hex_sha1(s){return binb2hex(core_sha1(str2binb(s),s.length * chrsz));}
-function b64_sha1(s){return binb2b64(core_sha1(str2binb(s),s.length * chrsz));}
-function str_sha1(s){return binb2str(core_sha1(str2binb(s),s.length * chrsz));}
-function hex_hmac_sha1(key, data){ return binb2hex(core_hmac_sha1(key, data));}
-function b64_hmac_sha1(key, data){ return binb2b64(core_hmac_sha1(key, data));}
-function str_hmac_sha1(key, data){ return binb2str(core_hmac_sha1(key, data));}
-
-/*
- * Perform a simple self-test to see if the VM is working
- */
-function sha1_vm_test()
-{
-  return hex_sha1("abc") == "a9993e364706816aba3e25717850c26c9cd0d89d";
-}
-
-/*
- * Calculate the SHA-1 of an array of big-endian words, and a bit length
- */
-function core_sha1(x, len)
-{
-  /* append padding */
-  x[len >> 5] |= 0x80 << (24 - len % 32);
-  x[((len + 64 >> 9) << 4) + 15] = len;
-
-  var w = Array(80);
-  var a =  1732584193;
-  var b = -271733879;
-  var c = -1732584194;
-  var d =  271733878;
-  var e = -1009589776;
-
-  for(var i = 0; i < x.length; i += 16)
-  {
-    var olda = a;
-    var oldb = b;
-    var oldc = c;
-    var oldd = d;
-    var olde = e;
-
-    for(var j = 0; j < 80; j++)
-    {
-      if(j < 16) w[j] = x[i + j];
-      else w[j] = rol(w[j-3] ^ w[j-8] ^ w[j-14] ^ w[j-16], 1);
-      var t = safe_add(safe_add(rol(a, 5), sha1_ft(j, b, c, d)),
-                       safe_add(safe_add(e, w[j]), sha1_kt(j)));
-      e = d;
-      d = c;
-      c = rol(b, 30);
-      b = a;
-      a = t;
-    }
-
-    a = safe_add(a, olda);
-    b = safe_add(b, oldb);
-    c = safe_add(c, oldc);
-    d = safe_add(d, oldd);
-    e = safe_add(e, olde);
-  }
-  return Array(a, b, c, d, e);
-
-}
-
-/*
- * Perform the appropriate triplet combination function for the current
- * iteration
- */
-function sha1_ft(t, b, c, d)
-{
-  if(t < 20) return (b & c) | ((~b) & d);
-  if(t < 40) return b ^ c ^ d;
-  if(t < 60) return (b & c) | (b & d) | (c & d);
-  return b ^ c ^ d;
-}
-
-/*
- * Determine the appropriate additive constant for the current iteration
- */
-function sha1_kt(t)
-{
-  return (t < 20) ?  1518500249 : (t < 40) ?  1859775393 :
-         (t < 60) ? -1894007588 : -899497514;
-}
-
-/*
- * Calculate the HMAC-SHA1 of a key and some data
- */
-function core_hmac_sha1(key, data)
-{
-  var bkey = str2binb(key);
-  if(bkey.length > 16) bkey = core_sha1(bkey, key.length * chrsz);
-
-  var ipad = Array(16), opad = Array(16);
-  for(var i = 0; i < 16; i++)
-  {
-    ipad[i] = bkey[i] ^ 0x36363636;
-    opad[i] = bkey[i] ^ 0x5C5C5C5C;
-  }
-
-  var hash = core_sha1(ipad.concat(str2binb(data)), 512 + data.length * chrsz);
-  return core_sha1(opad.concat(hash), 512 + 160);
-}
-
-/*
- * Add integers, wrapping at 2^32. This uses 16-bit operations internally
- * to work around bugs in some JS interpreters.
- */
-function safe_add(x, y)
-{
-  var lsw = (x & 0xFFFF) + (y & 0xFFFF);
-  var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
-  return (msw << 16) | (lsw & 0xFFFF);
-}
-
-/*
- * Bitwise rotate a 32-bit number to the left.
- */
-function rol(num, cnt)
-{
-  return (num << cnt) | (num >>> (32 - cnt));
-}
-
-/*
- * Convert an 8-bit or 16-bit string to an array of big-endian words
- * In 8-bit function, characters >255 have their hi-byte silently ignored.
- */
-function str2binb(str)
-{
-  var bin = Array();
-  var mask = (1 << chrsz) - 1;
-  for(var i = 0; i < str.length * chrsz; i += chrsz)
-    bin[i>>5] |= (str.charCodeAt(i / chrsz) & mask) << (32 - chrsz - i%32);
-  return bin;
-}
-
-/*
- * Convert an array of big-endian words to a string
- */
-function binb2str(bin)
-{
-  var str = "";
-  var mask = (1 << chrsz) - 1;
-  for(var i = 0; i < bin.length * 32; i += chrsz)
-    str += String.fromCharCode((bin[i>>5] >>> (32 - chrsz - i%32)) & mask);
-  return str;
-}
-
-/*
- * Convert an array of big-endian words to a hex string.
- */
-function binb2hex(binarray)
-{
-  var hex_tab = hexcase ? "0123456789ABCDEF" : "0123456789abcdef";
-  var str = "";
-  for(var i = 0; i < binarray.length * 4; i++)
-  {
-    str += hex_tab.charAt((binarray[i>>2] >> ((3 - i%4)*8+4)) & 0xF) +
-           hex_tab.charAt((binarray[i>>2] >> ((3 - i%4)*8  )) & 0xF);
-  }
-  return str;
-}
-
-/*
- * Convert an array of big-endian words to a base-64 string
- */
-function binb2b64(binarray)
-{
-  var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
-  var str = "";
-  for(var i = 0; i < binarray.length * 4; i += 3)
-  {
-    var triplet = (((binarray[i   >> 2] >> 8 * (3 -  i   %4)) & 0xFF) << 16)
-                | (((binarray[i+1 >> 2] >> 8 * (3 - (i+1)%4)) & 0xFF) << 8 )
-                |  ((binarray[i+2 >> 2] >> 8 * (3 - (i+2)%4)) & 0xFF);
-    for(var j = 0; j < 4; j++)
-    {
-      if(i * 8 + j * 6 > binarray.length * 32) str += b64pad;
-      else str += tab.charAt((triplet >> 6*(3-j)) & 0x3F);
-    }
-  }
-  return str;
-}

http://git-wip-us.apache.org/repos/asf/couchdb/blob/cca309f3/share/www/session.html
----------------------------------------------------------------------
diff --git a/share/www/session.html b/share/www/session.html
deleted file mode 100644
index 922f738..0000000
--- a/share/www/session.html
+++ /dev/null
@@ -1,96 +0,0 @@
-<!DOCTYPE html>
-<!--
-
-Licensed under the Apache License, Version 2.0 (the "License"); you may not use
-this file except in compliance with the License. You may obtain a copy of the
-License at
-
-   http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software distributed
-under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
-CONDITIONS OF ANY KIND, either express or implied. See the License for the
-specific language governing permissions and limitations under the License.
-
--->
-<html lang="en">
-  <head>
-    <title>Session</title>
-    <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
-    <link rel="stylesheet" href="style/layout.css?0.11.0" type="text/css">
-    <script src="script/json2.js"></script>
-    <script src="script/sha1.js"></script>
-    <script src="script/jquery.js"></script>
-    <script src="script/jquery.couch.js"></script>
-    <script src="script/jquery.dialog.js"></script>
-    <script src="script/futon.js"></script>
-    <script src="script/futon.browse.js"></script>
-    <script src="script/futon.format.js"></script>
-    <script>
-      $(function() {
-        var ret, reason, q = window.location.search, qps = q.split("&");
-        $.map(qps, function(qp) {
-          var m = qp.match(/return=(.*)/);
-          if (m) {
-            ret = decodeURIComponent(m[1]);
-          }
-          m = qp.match(/reason=(.*)/);
-          if (m) {
-            reason = $.futon.escape(decodeURIComponent(m[1]));
-          }
-        });
-        if (reason) {
-          $("#aboutSession").append('<p>The application says: <em>'+reason+'</em></p>');
-        }
-        if (ret) {
-          $("#aboutSession").append($('<p>Once you are logged in, click this link to return to your application: </p>').append($("<a></a>").attr("href", ret).text(ret)));
-          // todo this needs to look different if you are already logged in
-          // a note about you are logged in but you can't access this
-        }
-        // do the sidebar but in the middle without the sidebar
-        $.futon.storage.set("sidebar", "hidden");
-        setTimeout(function() {
-          var ctx = $$("#userCtx").userCtx;
-          $.futon.storage.set("sidebar", "show");
-          if (ctx && ctx.name) {
-            $("#aboutSession").append("<p>It looks like you are logged in, maybe you don't have access to that url.</p>");
-          }
-        },100);
-      });
-    </script>
-  </head>
-  <body>
-    <div id="wrap">
-      <h1><a href="index.html">Overview</a>
-      <strong>Session</strong></h1>
-      <div id="content">
-        <h2>Establish or Modify Your Session</h2>
-        <div id="loginSignup">
-          <div id="aboutSession"></div>
-          <span id="userCtx">
-            <span class="loggedout">
-              <a href="#" class="signup">Signup</a> or <a href="#" class="login">Login</a>
-            </span>
-            <span class="loggedin">
-              Welcome <a class="name">?</a>!
-              <br/>
-              <a href="#" class="logout">Logout</a>
-            </span>
-            <span class="loggedinadmin">
-              Welcome <a class="name">?</a>!
-              <br/>
-              <a href="#" class="createadmin">Setup more admins</a> or
-              <a href="#" class="logout">Logout</a>
-            </span>
-            <span class="adminparty">
-              Welcome to Admin Party!
-              <br/>
-              Everyone is admin. <a href="#" class="createadmin">Fix this</a>
-            </span>
-          </span>
-        </div>
-      </div>
-
-    </div>
-  </body>
-</html>

http://git-wip-us.apache.org/repos/asf/couchdb/blob/cca309f3/share/www/spec/couch_js_class_methods_spec.js
----------------------------------------------------------------------
diff --git a/share/www/spec/couch_js_class_methods_spec.js b/share/www/spec/couch_js_class_methods_spec.js
deleted file mode 100644
index fc8db36..0000000
--- a/share/www/spec/couch_js_class_methods_spec.js
+++ /dev/null
@@ -1,401 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
-// Specs for couch.js lines 313-470
-
-describe 'CouchDB class'
-  describe 'session stuff'
-    before
-      useTestUserDb();
-    end
-  
-    after
-      useOldUserDb();
-    end
-    
-    before_each
-      userDoc = users_db.save(CouchDB.prepareUserDoc({name: "Gaius Baltar", roles: ["president"]}, "secretpass"));
-    end
-  
-    after_each
-      users_db.deleteDoc({_id : userDoc.id, _rev : userDoc.rev})
-    end
-    
-    describe '.login'
-      it 'should return ok true'
-        CouchDB.login("Gaius Baltar", "secretpass").ok.should.be_true
-      end
-          
-      it 'should return the name of the logged in user'
-        CouchDB.login("Gaius Baltar", "secretpass").name.should.eql "Gaius Baltar"
-      end
-          
-      it 'should return the roles of the logged in user'
-        CouchDB.login("Gaius Baltar", "secretpass").roles.should.eql ["president"]
-      end
-      
-      it 'should post _session'
-        CouchDB.should.receive("request", "once").with_args("POST", "/_session")
-        CouchDB.login("Gaius Baltar", "secretpass");
-      end
-      
-      it 'should create a session'
-        CouchDB.login("Gaius Baltar", "secretpass");
-        CouchDB.session().userCtx.name.should.eql "Gaius Baltar"
-      end
-    end
-      
-    describe '.logout'
-      before_each
-        CouchDB.login("Gaius Baltar", "secretpass");
-      end
-    
-      it 'should return ok true'
-        CouchDB.logout().ok.should.be_true
-      end
-    
-      it 'should delete _session'
-        CouchDB.should.receive("request", "once").with_args("DELETE", "/_session")
-        CouchDB.logout();
-      end
-      
-      it 'should result in an invalid session'
-        CouchDB.logout();
-        CouchDB.session().name.should.be_null
-      end
-    end
-  
-    describe '.session'
-      before_each
-        CouchDB.login("Gaius Baltar", "secretpass");
-      end
-    
-      it 'should return ok true'
-        CouchDB.session().ok.should.be_true
-      end
-    
-      it 'should return the users name'
-        CouchDB.session().userCtx.name.should.eql "Gaius Baltar"
-      end
-    
-      it 'should return the users roles'
-        CouchDB.session().userCtx.roles.should.eql ["president"]
-      end
-    
-      it 'should return the name of the authentication db'
-        CouchDB.session().info.authentication_db.should.eql "spec_users_db"
-      end
-    
-      it 'should return the active authentication handler'
-        CouchDB.session().info.authenticated.should.eql "cookie"
-      end
-    end
-  end
-  
-  describe 'db stuff'
-    before_each
-      db = new CouchDB("spec_db", {"X-Couch-Full-Commit":"false"});
-      db.createDb();
-    end
-  
-    after_each
-      db.deleteDb();
-    end
-  
-    describe '.prepareUserDoc'
-      before_each
-        userDoc = CouchDB.prepareUserDoc({name: "Laura Roslin"}, "secretpass");
-      end
-      
-      it 'should return the users name'
-        userDoc.name.should.eql "Laura Roslin"
-      end
-      
-      it 'should prefix the id with the CouchDB user_prefix'
-        userDoc._id.should.eql "org.couchdb.user:Laura Roslin"
-      end
-      
-      it 'should return the users roles'
-        var userDocWithRoles = CouchDB.prepareUserDoc({name: "William Adama", roles: ["admiral", "commander"]}, "secretpass")
-        userDocWithRoles.roles.should.eql ["admiral", "commander"]
-      end
-      
-      it 'should return the hashed password'
-        userDoc.password_sha.length.should.be_at_least 30
-        userDoc.password_sha.should.be_a String
-      end
-    end
-      
-    describe '.allDbs'
-      it 'should get _all_dbs'
-        CouchDB.should.receive("request", "once").with_args("GET", "/_all_dbs");
-        CouchDB.allDbs();
-      end
-      
-      it 'should return an array that includes a created database'
-        temp_db = new CouchDB("temp_spec_db", {"X-Couch-Full-Commit":"false"});
-        temp_db.createDb();
-        CouchDB.allDbs().should.include("temp_spec_db");
-        temp_db.deleteDb();
-      end
-      
-      it 'should return an array that does not include a database that does not exist'
-        CouchDB.allDbs().should.not.include("not_existing_temp_spec_db");
-      end
-    end
-    
-    describe '.allDesignDocs'
-      it 'should return the total number of documents'
-        CouchDB.allDesignDocs().spec_db.total_rows.should.eql 0
-        db.save({'type':'battlestar', 'name':'galactica'});
-        CouchDB.allDesignDocs().spec_db.total_rows.should.eql 1
-      end
-      
-      it 'should return undefined when the db does not exist'
-        CouchDB.allDesignDocs().non_existing_db.should.be_undefined
-      end
-      
-      it 'should return no documents when there are no design documents'
-        CouchDB.allDesignDocs().spec_db.rows.should.eql []
-      end
-      
-      it 'should return all design documents'
-        var designDoc = {
-          "views" : {
-            "people" : {
-              "map" : "function(doc) { emit(doc._id, doc); }"
-            }
-          },
-          "_id" : "_design/spec_db"
-        };
-        db.save(designDoc);
-        
-        var allDesignDocs = CouchDB.allDesignDocs();
-        allDesignDocs.spec_db.rows[0].id.should.eql "_design/spec_db"
-        allDesignDocs.spec_db.rows[0].key.should.eql "_design/spec_db"
-        allDesignDocs.spec_db.rows[0].value.rev.length.should.be_at_least 30
-      end
-    end
-    
-    describe '.getVersion'
-      it 'should get the CouchDB version'
-        CouchDB.should.receive("request", "once").with_args("GET", "/")
-        CouchDB.getVersion();
-      end
-      
-      it 'should return the CouchDB version'
-        CouchDB.getVersion().should_match /^\d\d?\.\d\d?\.\d\d?.*/
-      end
-    end
-    
-    describe '.replicate'
-      before_each
-        db2 = new CouchDB("spec_db_2", {"X-Couch-Full-Commit":"false"});
-        db2.createDb();
-        host = window.location.protocol + "//" + window.location.host ;
-      end
-      
-      after_each
-        db2.deleteDb();
-      end
-      
-      it 'should return no_changes true when there are no changes between the dbs'
-        CouchDB.replicate(host + db.uri, host + db2.uri).no_changes.should.be_true
-      end
-      
-      it 'should return the session ID'
-        db.save({'type':'battlestar', 'name':'galactica'});
-        CouchDB.replicate(host + db.uri, host + db2.uri).session_id.length.should.be_at_least 30
-      end
-      
-      it 'should return source_last_seq'
-        db.save({'type':'battlestar', 'name':'galactica'});
-        db.save({'type':'battlestar', 'name':'pegasus'});
-        
-        CouchDB.replicate(host + db.uri, host + db2.uri).source_last_seq.should.eql 2
-      end
-      
-      it 'should return the replication history'
-        db.save({'type':'battlestar', 'name':'galactica'});
-        db.save({'type':'battlestar', 'name':'pegasus'});
-        
-        var result = CouchDB.replicate(host + db.uri, host + db2.uri);
-        result.history[0].docs_written.should.eql 2
-        result.history[0].start_last_seq.should.eql 0
-      end
-      
-      it 'should pass through replication options'
-        db.save({'type':'battlestar', 'name':'galactica'});
-        db2.deleteDb();
-        -{CouchDB.replicate(host + db.uri, host + db2.uri)}.should.throw_error
-        var result = CouchDB.replicate(host + db.uri, host + db2.uri, {"body" : {"create_target":true}});
-    
-        result.ok.should.eql true
-        result.history[0].docs_written.should.eql 1
-        db2.info().db_name.should.eql "spec_db_2"
-      end
-    end
-    
-    describe '.newXhr'
-      it 'should return a XMLHTTPRequest'
-        CouchDB.newXhr().should.have_prop 'readyState'
-        CouchDB.newXhr().should.have_prop 'responseText'
-        CouchDB.newXhr().should.have_prop 'status'
-      end
-    end
-    
-    describe '.request'
-      it 'should return a XMLHttpRequest'
-        var req = CouchDB.request("GET", '/');
-        req.should.include "readyState"
-        req.should.include "responseText"
-        req.should.include "statusText"
-      end
-      
-      it 'should pass through the options headers'
-        var xhr = CouchDB.newXhr();
-        stub(CouchDB, 'newXhr').and_return(xhr);
-        
-        xhr.should.receive("setRequestHeader", "once").with_args("X-Couch-Full-Commit", "true")
-        CouchDB.request("GET", "/", {'headers': {"X-Couch-Full-Commit":"true"}});
-      end
-      
-      it 'should pass through the options body'
-        var xhr = CouchDB.newXhr();
-        stub(CouchDB, 'newXhr').and_return(xhr);
-       
-        xhr.should.receive("send", "once").with_args({"body_key":"body_value"})
-        CouchDB.request("GET", "/", {'body': {"body_key":"body_value"}});
-      end
-      
-      it 'should prepend the urlPrefix to the uri'
-        var oldPrefix = CouchDB.urlPrefix;
-        CouchDB.urlPrefix = "/_utils";
-       
-        var xhr = CouchDB.newXhr();
-        stub(CouchDB, 'newXhr').and_return(xhr);
-        
-        xhr.should.receive("open", "once").with_args("GET", "/_utils/", false)
-        CouchDB.request("GET", "/", {'headers': {"X-Couch-Full-Commit":"true"}});
-        
-        CouchDB.urlPrefix = oldPrefix;
-      end
-    end
-    
-    describe '.requestStats'
-      it 'should get the stats for specified path'
-        var stats = CouchDB.requestStats(['couchdb', 'open_databases'], null);
-        stats.description.should.eql 'number of open databases'
-        stats.current.should.be_a Number
-      end
-      
-      it 'should add flush true to the request when there is a test argument'
-        CouchDB.should.receive("request", "once").with_args("GET", "/_stats/httpd/requests?flush=true")
-        CouchDB.requestStats(['couchdb', 'httpd', 'requests'], 'test');
-      end
-      
-      it 'should still work when there is a test argument'
-        var stats = CouchDB.requestStats(['couchdb', 'httpd_status_codes', 200], 'test');
-        stats.description.should.eql 'number of HTTP 200 OK responses'
-        stats.sum.should.be_a Number
-      end
-    end
-    
-    describe '.newUuids'
-      after_each
-        CouchDB.uuids_cache = [];
-      end
-      
-      it 'should return the specified amount of uuids'
-        var uuids = CouchDB.newUuids(45);
-        uuids.should.have_length 45
-      end
-          
-      it 'should return an array with uuids'
-        var uuids = CouchDB.newUuids(1);
-        uuids[0].should.be_a String
-        uuids[0].should.have_length 32
-      end
-      
-      it 'should leave the uuids_cache with 100 uuids when theres no buffer size specified'
-        CouchDB.newUuids(23);
-        CouchDB.uuids_cache.should.have_length 100
-      end
-      
-      it 'should leave the uuids_cache with the specified buffer size'
-        CouchDB.newUuids(23, 150);
-        CouchDB.uuids_cache.should.have_length 150
-      end
-      
-      it 'should get the uuids from the uuids_cache when there are enough uuids in there'
-        CouchDB.newUuids(10);
-        CouchDB.newUuids(25);
-        CouchDB.uuids_cache.should.have_length 75
-      end
-      
-      it 'should create new uuids and add as many as specified to the uuids_cache when there are not enough uuids in the cache'
-        CouchDB.newUuids(10);
-        CouchDB.newUuids(125, 60);
-        CouchDB.uuids_cache.should.have_length 160
-      end
-    end
-    
-    describe '.maybeThrowError'
-      it 'should throw an error when the request has status 404'
-        var req = CouchDB.request("GET", "/nonexisting_db");
-        -{CouchDB.maybeThrowError(req)}.should.throw_error
-      end
-    
-      it 'should throw an error when the request has status 412'
-        var req = CouchDB.request("PUT", "/spec_db");
-        -{CouchDB.maybeThrowError(req)}.should.throw_error
-      end
-    
-      it 'should throw an error when the request has status 405'
-        var req = CouchDB.request("DELETE", "/_utils");
-        -{CouchDB.maybeThrowError(req)}.should.throw_error
-      end
-    
-      it 'should throw the responseText of the request'
-        var req = CouchDB.request("GET", "/nonexisting_db");
-        try {
-          CouchDB.maybeThrowError(req)
-        } catch(e) {
-          e.error.should.eql JSON.parse(req.responseText).error
-          e.reason.should.eql JSON.parse(req.responseText).reason
-        }
-      end
-    
-      it 'should throw an unknown error when the responseText is invalid json'
-        mock_request().and_return("invalid json...", "application/json", 404, {})
-        try {
-          CouchDB.maybeThrowError(CouchDB.newXhr())
-        } catch(e) {
-          e.error.should.eql "unknown"
-          e.reason.should.eql "invalid json..."
-        }
-      end
-    end
-    
-    describe '.params'
-      it 'should turn a json object into a http params string'
-        var params = CouchDB.params({"president":"laura", "cag":"lee"})
-        params.should.eql "president=laura&cag=lee"
-      end
-    
-      it 'should return a blank string when the object is empty'
-        var params = CouchDB.params({})
-        params.should.eql ""
-      end
-    end
-  end
-end

http://git-wip-us.apache.org/repos/asf/couchdb/blob/cca309f3/share/www/spec/couch_js_instance_methods_1_spec.js
----------------------------------------------------------------------
diff --git a/share/www/spec/couch_js_instance_methods_1_spec.js b/share/www/spec/couch_js_instance_methods_1_spec.js
deleted file mode 100644
index 7f23bd2..0000000
--- a/share/www/spec/couch_js_instance_methods_1_spec.js
+++ /dev/null
@@ -1,311 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
-// Specs for couch.js lines 1-130
-
-describe 'CouchDB instance'
-  before_each
-    db = new CouchDB("spec_db", {"X-Couch-Full-Commit":"false"});
-  end
-  
-  describe '.request'
-    before_each
-      db.createDb();
-    end
-
-    after_each
-      db.deleteDb();
-    end
-
-    it 'should return a XMLHttpRequest'
-      var req = db.request("GET", "/spec_db");
-      req.should.include "readyState"
-      req.should.include "responseText"
-      req.should.include "statusText"
-      // in Safari a XMLHttpRequest is actually a XMLHttpRequestConstructor,
-      // otherwise we could just do:
-      // req.should.be_a XMLHttpRequest
-    end
-    
-    it 'should set the options the CouchDB instance has got as httpHeaders'
-      CouchDB.should.receive("request", "once").with_args("GET", "/spec_db", {headers: {"X-Couch-Full-Commit": "false"}})
-      db.request("GET", "/spec_db");
-    end
-    
-    it 'should pass through the options'
-      CouchDB.should.receive("request", "once").with_args("GET", "/spec_db", {"X-Couch-Persist": "true", headers: {"X-Couch-Full-Commit": "false"}})
-      db.request("GET", "/spec_db", {"X-Couch-Persist":"true"});
-    end
-  end
-    
-  describe '.createDb'
-    after_each
-      db.deleteDb();
-    end
-     
-    it 'should create the db'
-      db.createDb();
-      db.last_req.status.should.eql 201
-    end
-    
-    it 'should return the ok true'
-      db.createDb().should.eql {"ok" : true}
-    end
-    
-    it 'should result in a created db'
-      db.createDb();
-      try{
-        db.createDb();
-      } catch(e) {
-        e.error.should.eql "file_exists"
-      }
-    end
-    
-    it 'should have create a db with update sequence 0'
-      db.createDb();
-      db.info().update_seq.should.eql 0
-    end
-  end
-   
-  describe '.deleteDb'
-    before_each
-      db.createDb();
-    end
-  
-    it 'should delete the db'
-      db.deleteDb();
-      db.last_req.status.should.eql 200
-    end
-    
-    it 'should return the responseText of the request'
-      db.deleteDb().should.eql {"ok" : true}
-    end
-    
-    it 'should result in a deleted db'
-      db.deleteDb();
-      db.deleteDb();
-      db.last_req.status.should.eql 404
-    end
-  end
-  
-  describe 'document methods'
-    before_each
-      doc = {"Name" : "Kara Thrace", "Callsign" : "Starbuck"};
-      db.createDb();
-    end
-  
-    after_each
-      db.deleteDb();
-    end
-    
-    describe '.save'
-      it 'should save the document'
-        db.save(doc);
-        db.last_req.status.should.eql 201
-      end
-    
-      it 'should return ok true'
-        db.save(doc).ok.should.be_true
-      end
-      
-      it 'should return ID and revision of the document'
-        var response = db.save(doc);
-        response.id.should.be_a String
-        response.id.should.have_length 32
-        response.rev.should.be_a String
-        response.rev.length.should.be_at_least 30
-      end
-      
-      it 'should result in a saved document with generated ID'
-        var response  = db.save(doc);
-        var saved_doc = db.open(response.id);
-        saved_doc.Name.should.eql "Kara Thrace"
-        saved_doc.Callsign.should.eql "Starbuck"
-      end
-  
-      it 'should save the document with the specified ID'
-        doc._id = "123";
-        var response = db.save(doc);
-        response.id.should.eql "123"
-      end
-    
-      it 'should pass through the options'
-        doc._id = "123";
-        CouchDB.should.receive("request", "once").with_args("PUT", "/spec_db/123?batch=ok")
-        db.save(doc, {"batch" : "ok"});
-      end
-    end
-      
-    describe '.open'
-      before_each
-        doc._id = "123";
-        db.save(doc);
-      end
-      
-      it 'should open the document'
-        db.open("123").should.eql doc
-      end
-    
-      it 'should return null when there is no document with the given ID'
-        db.open("non_existing").should.be_null
-      end
-    
-      it 'should pass through the options'
-        CouchDB.should.receive("request", "once").with_args("GET", "/spec_db/123?revs=true")
-        db.open("123", {"revs" : "true"});
-      end
-    end
-      
-    describe '.deleteDoc'
-      before_each
-        doc._id = "123";
-        saved_doc = db.save(doc);
-        delete_response = db.deleteDoc({_id : "123", _rev : saved_doc.rev});
-        delete_last_req = db.last_req;
-        db.open("123");
-      end
-      
-      it 'should send a successful request'
-        delete_last_req.status.should.eql 200
-      end
-    
-      it 'should result in a deleted document'
-        db.open("123").should.be_null
-      end
-    
-      it 'should return ok true, the ID and the revision of the deleted document'
-        delete_response.ok.should.be_true
-        delete_response.id.should.eql "123"
-        delete_response.rev.should.be_a String
-        delete_response.rev.length.should.be_at_least 30
-      end
-      
-      it 'should mark the document as deleted'
-        var responseText = db.request("GET", "/spec_db/123").responseText;
-        JSON.parse(responseText).should.eql {"error":"not_found","reason":"deleted"}
-      end
-    
-      it 'should record the revision in the deleted document'
-        var responseText = db.request("GET", "/spec_db/123?rev=" + delete_response.rev).responseText;
-        var deleted_doc = JSON.parse(responseText);
-        deleted_doc._rev.should.eql delete_response.rev
-        deleted_doc._id.should.eql delete_response.id
-        deleted_doc._deleted.should.be_true
-      end
-    end
-      
-    describe '.deleteDocAttachment'
-      before_each
-        doc._id = "123";
-        doc._attachments = {
-          "friend.txt" : {
-            "content_type": "text\/plain",
-            // base64 encoded
-            "data": "TGVlIEFkYW1hIGlzIGEgZm9ybWVyIENvbG9uaWFsIEZsZWV0IFJlc2VydmUgb2ZmaWNlci4="
-          }
-        };
-        saved_doc = db.save(doc);
-      end
-     
-      it 'should be executed on a document with attachment'
-        db.open("123")._attachments.should.include "friend.txt"
-        db.open("123")._attachments["friend.txt"].stub.should.be_true
-      end
-     
-      describe 'after delete'
-        before_each
-          delete_response = db.deleteDocAttachment({_id : "123", _rev : saved_doc.rev}, "friend.txt");
-          db.open("123");
-        end
-        
-        it 'should send a successful request'
-          db.last_req.status.should.eql 200
-        end
-     
-        it 'should leave the document untouched'
-          db.open("123").Callsign.should.eql "Starbuck"
-        end
-     
-        it 'should result in a deleted document attachment'
-          db.open("123").should.not.include "_attachments"
-        end
-     
-        it 'should record the revision in the document whose attachment has been deleted'
-          var responseText = db.request("GET", "/spec_db/123?rev=" + delete_response.rev).responseText;
-          var deleted_doc = JSON.parse(responseText);
-          deleted_doc._rev.should.eql delete_response.rev
-          deleted_doc._id.should.eql delete_response.id
-        end
-     
-        it 'should return ok true, the ID and the revision of the document whose attachment has been deleted'
-          delete_response.ok.should.be_true
-          delete_response.id.should.eql "123"
-          delete_response.should.have_property 'rev'
-        end
-      end
-    end
-          
-    describe '.bulkSave'
-      before_each
-        doc  = {"Name" : "Kara Thrace", "Callsign" : "Starbuck"};
-        doc2 = {"Name" : "Karl C. Agathon", "Callsign" : "Helo"};
-        doc3 = {"Name" : "Sharon Valerii", "Callsign" : "Boomer"};
-        docs = [doc, doc2, doc3];
-      end
-      
-      it 'should save the documents'
-        db.bulkSave(docs);
-        db.last_req.status.should.eql 201
-      end
-      
-      it 'should return ID and revision of the documents'
-        var response = db.bulkSave(docs);
-        response[0].id.should.be_a String
-        response[0].id.should.have_length 32
-        response[0].rev.should.be_a String
-        response[0].rev.length.should.be_at_least 30
-        response[1].id.should.be_a String
-        response[1].id.should.have_length 32
-        response[1].rev.should.be_a String
-        response[1].rev.length.should.be_at_least 30
-        response[2].id.should.be_a String
-        response[2].id.should.have_length 32
-        response[2].rev.should.be_a String
-        response[2].rev.length.should.be_at_least 30
-      end
-      
-      it 'should result in saved documents'
-        var response  = db.bulkSave(docs);
-        db.open(response[0].id).Name.should.eql "Kara Thrace"
-        db.open(response[1].id).Name.should.eql "Karl C. Agathon"
-        db.open(response[2].id).Name.should.eql "Sharon Valerii"
-      end
-    
-      it 'should save the document with specified IDs'
-        doc._id  = "123";
-        doc2._id = "456";
-        docs = [doc, doc2, doc3];
-        var response = db.bulkSave(docs);
-        response[0].id.should.eql "123"
-        response[1].id.should.eql "456"
-        response[2].id.should.have_length 32
-      end
-      
-      it 'should pass through the options'
-        doc._id  = "123";
-        docs = [doc];
-        CouchDB.should.receive("request", "once").with_args("POST", "/spec_db/_bulk_docs", {body: '{"docs":[{"Name":"Kara Thrace","Callsign":"Starbuck","_id":"123"}],"batch":"ok"}'})
-        db.bulkSave(docs, {"batch" : "ok"});
-      end
-    end
-  end
-end
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/couchdb/blob/cca309f3/share/www/spec/couch_js_instance_methods_2_spec.js
----------------------------------------------------------------------
diff --git a/share/www/spec/couch_js_instance_methods_2_spec.js b/share/www/spec/couch_js_instance_methods_2_spec.js
deleted file mode 100644
index 76df636..0000000
--- a/share/www/spec/couch_js_instance_methods_2_spec.js
+++ /dev/null
@@ -1,246 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
-// Specs for couch.js lines 132-199
-
-describe 'CouchDB instance'
-  before_each
-    db = new CouchDB("spec_db", {"X-Couch-Full-Commit":"false"});
-    db.createDb();
-  end
-  
-  after_each
-    db.deleteDb();
-  end
-  
-  describe '.ensureFullCommit'
-    it 'should return ok true'
-      db.ensureFullCommit().ok.should.be_true
-    end
-    
-    it 'should return the instance start time'
-      db.ensureFullCommit().instance_start_time.should.have_length 16
-    end
-    
-    it 'should post _ensure_full_commit to the db'
-      db.should.receive("request", "once").with_args("POST", "/spec_db/_ensure_full_commit")
-      db.ensureFullCommit();
-    end
-  end
-  
-  describe '.query'
-    before_each
-      db.save({"Name" : "Cally Tyrol",      "job" : "deckhand", "_id" : "789"});
-      db.save({"Name" : "Felix Gaeta",      "job" : "officer",  "_id" : "123"});
-      db.save({"Name" : "Samuel T. Anders", "job" : "pilot",    "_id" : "456"});
-      map_function    = "function(doc) { emit(doc._id, 1); }";
-      reduce_function = "function(key, values, rereduce) { return sum(values); }";
-    end
-    
-    it 'should apply the map function'
-      var result = db.query(map_function);
-      
-      result.rows.should.have_length 3
-      result.rows[0].id.should.eql "123"
-      result.rows[0].key.should.eql "123"
-      result.rows[0].value.should.eql 1
-      result.rows[1].id.should.eql "456"
-      result.rows[1].key.should.eql "456"
-      result.rows[1].value.should.eql 1
-      result.rows[2].id.should.eql "789"
-      result.rows[2].key.should.eql "789"
-      result.rows[2].value.should.eql 1
-    end
-    
-    it 'should apply the reduce function'
-      var result = db.query(map_function, reduce_function);
-    
-      result.rows.should.have_length 1
-      result.rows[0].key.should.be_null
-      result.rows[0].value.should_eql 3
-    end
-    
-    it 'should pass through the options'
-      var result = db.query(map_function, null, {"startkey":"456"});
-      
-      result.rows.should.have_length 2
-      result.rows[0].id.should.eql "456"
-      result.rows[0].key.should.eql "456"
-      result.rows[0].value.should.eql 1
-      result.rows[1].id.should.eql "789"
-      result.rows[1].key.should.eql "789"
-      result.rows[1].value.should.eql 1
-    end
-    
-    it 'should pass through the keys'
-      var result = db.query(map_function, null, {}, ["456", "123"]);
-
-      result.rows.should.have_length 2
-      result.rows[0].id.should.eql "456"
-      result.rows[0].key.should.eql "456"
-      result.rows[0].value.should.eql 1
-      result.rows[1].id.should.eql "123"
-      result.rows[1].key.should.eql "123"
-      result.rows[1].value.should.eql 1
-    end
-      
-    it 'should pass through the options and the keys'
-      var result = db.query(map_function, null, {"include_docs":"true"}, ["456"]);
-    
-      result.rows.should.have_length 1
-      result.rows[0].id.should.eql "456"
-      result.rows[0].key.should.eql "456"
-      result.rows[0].value.should.eql 1
-      result.rows[0].doc["job"].should.eql "pilot"
-      result.rows[0].doc["_rev"].length.should.be_at_least 30
-    end
-  
-    it 'should apply a view in erlang also'
-      // when this test fails, read this: http://wiki.apache.org/couchdb/EnableErlangViews
-      var erlang_map = 'fun({Doc}) -> ' +
-                       'ID = proplists:get_value(<<"_id">>, Doc, null), ' +
-                       'Emit(ID, 1) ' +
-                       'end.';
-      var result = db.query(erlang_map, null, null, null, "erlang");
-  
-      result.rows.should.have_length 3
-      result.rows[0].id.should.eql "123"
-      result.rows[0].key.should.eql "123"
-      result.rows[0].value.should.eql 1
-      result.rows[1].id.should.eql "456"
-      result.rows[1].key.should.eql "456"
-      result.rows[1].value.should.eql 1
-      result.rows[2].id.should.eql "789"
-      result.rows[2].key.should.eql "789"
-      result.rows[2].value.should.eql 1
-    end
-  end
-  
-  describe '.view'
-    before_each
-      db.save({"Name" : "Cally Tyrol",      "job" : "deckhand", "_id" : "789"});
-      db.save({"Name" : "Felix Gaeta",      "job" : "officer",  "_id" : "123"});
-      db.save({"Name" : "Samuel T. Anders", "job" : "pilot",    "_id" : "456"});
-      view = {
-        "views" : {
-          "people" : {
-            "map" : "function(doc) { emit(doc._id, doc.Name); }"
-          }
-        },
-        "_id" : "_design/spec_db"
-      };
-      db.save(view);
-    end
-    
-    it 'should apply the view'
-      var result = db.view('spec_db/people');
-      
-      result.rows.should.have_length 3
-      result.rows[0].id.should.eql "123"
-      result.rows[0].key.should.eql "123"
-      result.rows[0].value.should.eql "Felix Gaeta"
-      result.rows[1].id.should.eql "456"
-      result.rows[1].key.should.eql "456"
-      result.rows[1].value.should.eql "Samuel T. Anders"
-      result.rows[2].id.should.eql "789"
-      result.rows[2].key.should.eql "789"
-      result.rows[2].value.should.eql "Cally Tyrol"
-    end
-    
-    it 'should pass through the options'
-      var result = db.view('spec_db/people', {"skip":"2"});
-    
-      result.rows.should.have_length 1
-      result.rows[0].id.should.eql "789"
-      result.rows[0].key.should.eql "789"
-      result.rows[0].value.should.eql "Cally Tyrol"
-    end
-    
-    it 'should pass through the keys'
-      var result = db.view('spec_db/people', {}, ["456", "123"]);
-
-      result.rows.should.have_length 2
-      result.rows[0].id.should.eql "456"
-      result.rows[0].key.should.eql "456"
-      result.rows[0].value.should.eql "Samuel T. Anders"
-      result.rows[1].id.should.eql "123"
-      result.rows[1].key.should.eql "123"
-      result.rows[1].value.should.eql "Felix Gaeta"
-    end
-    
-    it 'should pass through the options and the keys'
-      var result = db.view('spec_db/people', {"include_docs":"true"}, ["456"]);
-      
-      result.rows.should.have_length 1
-      result.rows[0].id.should.eql "456"
-      result.rows[0].key.should.eql "456"
-      result.rows[0].value.should.eql "Samuel T. Anders"
-      result.rows[0].doc["job"].should.eql "pilot"
-      result.rows[0].doc["_rev"].length.should.be_at_least 30
-    end
-    
-    it 'should return null when the view doesnt exist'
-      var result = db.view('spec_db/non_existing_view');
-    
-      result.should.be_null
-    end
-  end
-  
-  describe '.info'
-    before_each
-      result = db.info();
-    end
-    
-    it 'should return the name of the database'
-      result.db_name.should.eql "spec_db"
-    end
-    
-    it 'should return the number of documents'
-      result.doc_count.should.eql 0
-    end
-    
-    it 'should return the start time of the db instance'
-      result.instance_start_time.should.have_length 16
-    end
-  end
-  
-  describe '.designInfo'
-    before_each
-      designDoc = {
-        "views" : {
-          "people" : {
-            "map" : "function(doc) { emit(doc._id, doc); }"
-          }
-        },
-        "_id" : "_design/spec_db"
-      };
-      db.save(designDoc);
-      result = db.designInfo("_design/spec_db");
-    end
-    
-    it 'should return the database name'
-      result.name.should.eql "spec_db"
-    end
-        
-    it 'should return a views language'
-      result.view_index.language.should.eql "javascript"
-    end
-  
-    it 'should return a views update sequence'
-      result.view_index.update_seq.should.eql 0
-    end
-  
-    it 'should return a views signature'
-      result.view_index.signature.should.have_length 32
-    end
-  end
-end
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/couchdb/blob/cca309f3/share/www/spec/couch_js_instance_methods_3_spec.js
----------------------------------------------------------------------
diff --git a/share/www/spec/couch_js_instance_methods_3_spec.js b/share/www/spec/couch_js_instance_methods_3_spec.js
deleted file mode 100644
index 4e5c99f..0000000
--- a/share/www/spec/couch_js_instance_methods_3_spec.js
+++ /dev/null
@@ -1,215 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
-// Specs for couch.js lines 201-265
-
-describe 'CouchDB instance'
-  before_each
-    db = new CouchDB("spec_db", {"X-Couch-Full-Commit":"false"});
-    db.createDb();
-  end
-  
-  after_each
-    db.deleteDb();
-  end
-  
-  describe '.allDocs'
-    it 'should return no docs when there arent any'
-      db.allDocs().total_rows.should.eql 0
-      db.allDocs().rows.should.eql []
-    end
-    
-    describe 'with docs'
-      before_each
-        db.save({"Name" : "Felix Gaeta",      "_id" : "123"});
-        db.save({"Name" : "Samuel T. Anders", "_id" : "456"});
-      end
-    
-      it 'should return all docs'
-        var result = db.allDocs();
-        
-        result.total_rows.should.eql 2
-        result.rows.should.have_length 2
-        result.rows[0].id.should.eql "123"
-        result.rows[0].key.should.eql "123"
-        result.rows[0].value.rev.length.should.be_at_least 30
-        result.rows[1].id.should.eql "456"
-      end
-    
-      it 'should pass through the options'
-        var result = db.allDocs({"startkey": "123", "limit": "1"});
-      
-        result.rows.should.have_length 1
-        result.rows[0].id.should.eql "123"
-      end
-      
-      it 'should pass through the keys'
-        var result = db.allDocs({}, ["456"]);
-
-        result.rows.should.have_length 1
-        result.rows[0].id.should.eql "456"
-        result.rows[0].key.should.eql "456"
-        result.rows[0].value.rev.length.should.be_at_least 30
-      end
-
-      it 'should pass through the options and the keys'
-        var result = db.allDocs({"include_docs":"true"}, ["456"]);
-
-        result.rows.should.have_length 1
-        result.rows[0].id.should.eql "456"
-        result.rows[0].key.should.eql "456"
-        result.rows[0].value.rev.length.should.be_at_least 30
-        result.rows[0].doc["Name"].should.eql "Samuel T. Anders"
-        result.rows[0].doc["_rev"].length.should.be_at_least 30
-      end
-
-    end
-  end
-  
-  describe '.designDocs'
-    it 'should return nothing when there arent any design docs'
-      db.save({"Name" : "Felix Gaeta", "_id" : "123"});
-      db.designDocs().rows.should.eql []
-    end
-    
-    it 'should return all design docs'
-      var designDoc = {
-        "views" : {
-          "people" : {
-            "map" : "function(doc) { emit(doc._id, doc); }"
-          }
-        },
-        "_id" : "_design/spec_db"
-      };
-      db.save(designDoc);
-      db.save({"Name" : "Felix Gaeta", "_id" : "123"});
-      
-      var result = db.designDocs();
-      
-      result.total_rows.should.eql 2
-      result.rows.should.have_length 1
-      result.rows[0].id.should.eql "_design/spec_db"
-      result.rows[0].key.should.eql "_design/spec_db"
-      result.rows[0].value.rev.length.should.be_at_least 30
-    end
-  end
-  
-  describe '.changes'
-    it 'should return no changes when there arent any'
-      db.changes().last_seq.should.eql 0
-      db.changes().results.should.eql []
-    end
-    
-    describe 'with changes'
-      before_each
-        db.save({"Name" : "Felix Gaeta",      "_id" : "123"});
-        db.save({"Name" : "Samuel T. Anders", "_id" : "456"});
-      end
-    
-      it 'should return changes'
-        var result = db.changes();
-    
-        result.last_seq.should.eql 2
-        result.results[0].id.should.eql "123"
-        result.results[0].seq.should.eql 1
-        result.results[0].changes[0].rev.length.should.be_at_least 30
-        result.results[1].id.should.eql "456"
-        result.results[1].seq.should.eql 2
-        result.results[1].changes[0].rev.length.should.be_at_least 30
-      end
-    
-      it 'should pass through the options'
-        var result = db.changes({"since":"1"});
-      
-        result.last_seq.should.eql 2
-        result.results[0].id.should.eql "456"
-      end
-    end
-  end
-  
-  describe '.compact'
-    it 'should return ok true'
-      db.compact().ok.should.be_true
-    end
-    
-    it 'should post _compact to the db'
-      db.should.receive("request", "once").with_args("POST", "/spec_db/_compact")
-      db.compact();
-    end
-  end
-  
-  describe '.viewCleanup'
-    it 'should return ok true'
-      db.viewCleanup().ok.should.be_true
-    end
-    
-    it 'should post _view_cleanup to the db'
-      db.should.receive("request", "once").with_args("POST", "/spec_db/_view_cleanup")
-      db.viewCleanup();
-    end
-  end
-  
-  describe '.setDbProperty'
-    it 'should return ok true'
-      db.setDbProperty("_revs_limit", 1500).ok.should.be_true
-    end
-    
-    it 'should set a db property'
-      db.setDbProperty("_revs_limit", 1500);
-      db.getDbProperty("_revs_limit").should.eql 1500
-      db.setDbProperty("_revs_limit", 1200);
-      db.getDbProperty("_revs_limit").should.eql 1200
-    end
-  end
-  
-  describe '.getDbProperty'
-    it 'should get a db property'
-      db.setDbProperty("_revs_limit", 1200);
-      db.getDbProperty("_revs_limit").should.eql 1200
-    end
-   
-    it 'should throw an error when the property doesnt exist'
-      function(){ db.getDbProperty("_doesnt_exist")}.should.throw_error
-    end
-  end
-  
-  describe '.setSecObj'
-    it 'should return ok true'
-      db.setSecObj({"members":{"names":["laura"],"roles":["president"]}}).ok.should.be_true
-    end
-      
-    it 'should save a well formed object into the _security object '
-      db.should.receive("request", "once").with_args("PUT", "/spec_db/_security", {body: '{"members":{"names":["laura"],"roles":["president"]}}'})
-      db.setSecObj({"members": {"names" : ["laura"], "roles" : ["president"]}})
-    end
-    
-    it 'should throw an error when the members or admins object is malformed'
-      -{ db.setSecObj({"admins":["cylon"]}) }.should.throw_error
-    end
-    
-    it 'should save any other object into the _security object'
-      db.setSecObj({"something" : "anything"})
-      db.getSecObj().should.eql {"something" : "anything"}
-    end
-  end
-  
-  describe '.getSecObj'
-    it 'should get the security object'
-      db.setSecObj({"admins" : {"names" : ["bill"], "roles" : ["admiral"]}})
-      db.getSecObj().should.eql {"admins" : {"names": ["bill"], "roles": ["admiral"]}}
-    end
-    
-    it 'should return an empty object when there is no security object'
-      db.getSecObj().should.eql {}
-    end
-  end
-end
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/couchdb/blob/cca309f3/share/www/spec/custom_helpers.js
----------------------------------------------------------------------
diff --git a/share/www/spec/custom_helpers.js b/share/www/spec/custom_helpers.js
deleted file mode 100644
index d29ee87..0000000
--- a/share/www/spec/custom_helpers.js
+++ /dev/null
@@ -1,51 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
-function stubAlert(){
-  if(typeof(old_alert) == 'undefined'){
-    old_alert = alert;
-  }
-  alert = function(msg){
-    alert_msg = msg;
-  };
-}
-
-function destubAlert(){
-  alert = old_alert;
-}
-
-function errorCallback(status, error, reason){
-  console.log("Unexpected " + status + " error: " + error + " - " + reason)
-  throw("Unexpected " + status + " error: " + error + " - " + reason);
-}
-
-function successCallback(resp){
-  console.log("No error message here unexpectedly, successful response instead.")
-  throw("No error message here unexpectedly, successful response instead.");
-}
-
-function useTestUserDb(){
-  users_db = new CouchDB("spec_users_db");
-  var xhr = CouchDB.request("PUT", "/_config/couch_httpd_auth/authentication_db", {
-    body: JSON.stringify("spec_users_db")
-  });
-  if(typeof(old_auth_db) == 'undefined'){
-    old_auth_db = xhr.responseText.replace(/\n/,'').replace(/"/g,'');
-  }
-}
-
-function useOldUserDb(){
-  CouchDB.request("PUT", "/_config/couch_httpd_auth/authentication_db", {
-    body: JSON.stringify(old_auth_db)
-  });
-  users_db.deleteDb();
-}
\ No newline at end of file


[17/37] move JS tests into safety

Posted by ja...@apache.org.
http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/test/changes.js
----------------------------------------------------------------------
diff --git a/share/test/changes.js b/share/test/changes.js
new file mode 100644
index 0000000..d5a4236
--- /dev/null
+++ b/share/test/changes.js
@@ -0,0 +1,738 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+
+function jsonp(obj) {
+  T(jsonp_flag == 0);
+  T(obj.results.length == 1 && obj.last_seq == 1, "jsonp");
+  jsonp_flag = 1;
+}
+
+couchTests.changes = function(debug) {
+  var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"true"});
+  db.deleteDb();
+  db.createDb();
+  if (debug) debugger;
+
+  var req = CouchDB.request("GET", "/test_suite_db/_changes");
+  var resp = JSON.parse(req.responseText);
+
+  T(resp.results.length == 0 && resp.last_seq == 0, "empty db");
+  var docFoo = {_id:"foo", bar:1};
+  T(db.save(docFoo).ok);
+  T(db.ensureFullCommit().ok);
+  T(db.open(docFoo._id)._id == docFoo._id);
+
+  req = CouchDB.request("GET", "/test_suite_db/_changes");
+  var resp = JSON.parse(req.responseText);
+
+  T(resp.last_seq == 1);
+  T(resp.results.length == 1, "one doc db");
+  T(resp.results[0].changes[0].rev == docFoo._rev);
+
+  // test with callback
+
+  run_on_modified_server(
+    [{section: "httpd",
+      key: "allow_jsonp",
+      value: "true"}],
+  function() {
+    var xhr = CouchDB.request("GET", "/test_suite_db/_changes?callback=jsonp");
+    T(xhr.status == 200);
+    jsonp_flag = 0;
+    eval(xhr.responseText);
+    T(jsonp_flag == 1);
+  });
+
+  req = CouchDB.request("GET", "/test_suite_db/_changes?feed=continuous&timeout=10");
+  var lines = req.responseText.split("\n");
+  T(JSON.parse(lines[0]).changes[0].rev == docFoo._rev);
+  T(JSON.parse(lines[1]).last_seq == 1);
+
+  var xhr;
+
+  try {
+    xhr = CouchDB.newXhr();
+  } catch (err) {
+  }
+
+  // poor man's browser detection
+  var is_safari = false;
+  if(typeof(navigator) == "undefined") {
+    is_safari = true; // For CouchHTTP based runners
+  } else if(navigator.userAgent.match(/AppleWebKit/)) {
+    is_safari = true;
+  };
+  if (!is_safari && xhr) {
+    // Only test the continuous stuff if we have a real XHR object
+    // with real async support.
+
+    // WebKit (last checked on nightly #47686) does fail on processing
+    // the async-request properly while javascript is executed.
+
+    xhr.open("GET", CouchDB.proxyUrl("/test_suite_db/_changes?feed=continuous&timeout=500"), true);
+    xhr.send("");
+
+    var docBar = {_id:"bar", bar:1};
+    db.save(docBar);
+
+    var lines, change1, change2;
+    waitForSuccess(function() {
+      lines = xhr.responseText.split("\n");
+      change1 = JSON.parse(lines[0]);
+      change2 = JSON.parse(lines[1]);
+      if (change2.seq != 2) {
+          throw "bad seq, try again";
+      }
+      return true;
+    }, "bar-only");
+
+    T(change1.seq == 1);
+    T(change1.id == "foo");
+
+    T(change2.seq == 2);
+    T(change2.id == "bar");
+    T(change2.changes[0].rev == docBar._rev);
+
+
+    var docBaz = {_id:"baz", baz:1};
+    db.save(docBaz);
+
+    var change3;
+    waitForSuccess(function() {
+      lines = xhr.responseText.split("\n");
+      change3 = JSON.parse(lines[2]);
+      if (change3.seq != 3) {
+        throw "bad seq, try again";
+      }
+      return true;
+    });
+
+    T(change3.seq == 3);
+    T(change3.id == "baz");
+    T(change3.changes[0].rev == docBaz._rev);
+
+
+    xhr = CouchDB.newXhr();
+
+    //verify the heartbeat newlines are sent
+    xhr.open("GET", CouchDB.proxyUrl("/test_suite_db/_changes?feed=continuous&heartbeat=10&timeout=500"), true);
+    xhr.send("");
+
+    var str;
+    waitForSuccess(function() {
+      str = xhr.responseText;
+      if (str.charAt(str.length - 1) != "\n" || str.charAt(str.length - 2) != "\n") {
+        throw("keep waiting");
+      }
+      return true;
+    }, "heartbeat");
+
+    T(str.charAt(str.length - 1) == "\n");
+    T(str.charAt(str.length - 2) == "\n");
+
+    // otherwise we'll continue to receive heartbeats forever
+    xhr.abort();
+
+    // test Server Sent Event (eventsource)
+    if (!!window.EventSource) {
+      var source = new EventSource(
+              "/test_suite_db/_changes?feed=eventsource");
+      var results = [];
+      var sourceListener = function(e) {
+        var data = JSON.parse(e.data);
+        results.push(data);
+      };
+
+      source.addEventListener('message', sourceListener , false);
+
+      waitForSuccess(function() {
+        if (results.length != 3) {
+          throw "bad seq, try again";
+        }
+        return true;
+      });
+
+      source.removeEventListener('message', sourceListener, false);
+
+      T(results[0].seq == 1);
+      T(results[0].id == "foo");
+
+      T(results[1].seq == 2);
+      T(results[1].id == "bar");
+      T(results[1].changes[0].rev == docBar._rev);
+    }
+
+    // test that we receive EventSource heartbeat events
+    if (!!window.EventSource) {
+      var source = new EventSource(
+              "/test_suite_db/_changes?feed=eventsource&heartbeat=10");
+
+      var count_heartbeats = 0;
+      source.addEventListener('heartbeat', function () { count_heartbeats = count_heartbeats + 1; } , false);
+
+      waitForSuccess(function() {
+        if (count_heartbeats < 3) {
+          throw "keep waiting";
+        }
+        return true;
+      }, "eventsource-heartbeat");
+
+      T(count_heartbeats >= 3);
+      source.close();
+    }
+
+    // test longpolling
+    xhr = CouchDB.newXhr();
+
+    xhr.open("GET", CouchDB.proxyUrl("/test_suite_db/_changes?feed=longpoll"), true);
+    xhr.send("");
+
+    waitForSuccess(function() {
+      lines = xhr.responseText.split("\n");
+      if (lines[5] != '"last_seq":3}') {
+        throw("still waiting");
+      }
+      return true;
+    }, "last_seq");
+
+    xhr = CouchDB.newXhr();
+
+    xhr.open("GET", CouchDB.proxyUrl("/test_suite_db/_changes?feed=longpoll&since=3"), true);
+    xhr.send("");
+
+    var docBarz = {_id:"barz", bar:1};
+    db.save(docBarz);
+
+    var parse_changes_line = function(line) {
+      if (line.charAt(line.length-1) == ",") {
+        var linetrimmed = line.substring(0, line.length-1);
+      } else {
+        var linetrimmed = line;
+      }
+      return JSON.parse(linetrimmed);
+    };
+
+    waitForSuccess(function() {
+      lines = xhr.responseText.split("\n");
+      if (lines[3] != '"last_seq":4}') {
+        throw("still waiting");
+      }
+      return true;
+    }, "change_lines");
+
+    var change = parse_changes_line(lines[1]);
+    T(change.seq == 4);
+    T(change.id == "barz");
+    T(change.changes[0].rev == docBarz._rev);
+    T(lines[3]=='"last_seq":4}');
+
+
+    // test since=now
+    xhr = CouchDB.newXhr();
+
+    xhr.open("GET", "/test_suite_db/_changes?feed=longpoll&since=now", true);
+    xhr.send("");
+
+    var docBarz = {_id:"barzzzz", bar:1};
+    db.save(docBarz);
+
+    var parse_changes_line = function(line) {
+      if (line.charAt(line.length-1) == ",") {
+        var linetrimmed = line.substring(0, line.length-1);
+      } else {
+        var linetrimmed = line;
+      }
+      return JSON.parse(linetrimmed);
+    };
+
+    waitForSuccess(function() {
+      lines = xhr.responseText.split("\n");
+      if (lines[3] != '"last_seq":5}') {
+        throw("still waiting");
+      }
+      return true;
+    }, "change_lines");
+
+    var change = parse_changes_line(lines[1]);
+    T(change.seq == 5);
+    T(change.id == "barzzzz");
+    T(change.changes[0].rev == docBarz._rev);
+    T(lines[3]=='"last_seq":5}');
+
+
+  }
+
+  // test the filtered changes
+  var ddoc = {
+    _id : "_design/changes_filter",
+    "filters" : {
+      "bop" : "function(doc, req) { return (doc.bop);}",
+      "dynamic" : stringFun(function(doc, req) {
+        var field = req.query.field;
+        return doc[field];
+      }),
+      "userCtx" : stringFun(function(doc, req) {
+        return doc.user && (doc.user == req.userCtx.name);
+      }),
+      "conflicted" : "function(doc, req) { return (doc._conflicts);}"
+    },
+    options : {
+      local_seq : true
+    },
+    views : {
+      local_seq : {
+        map : "function(doc) {emit(doc._local_seq, null)}"
+      },
+      blah: {
+        map : 'function(doc) {' +
+              '  if (doc._id == "blah") {' +
+              '    emit(null, null);' +
+              '  }' +
+              '}'
+      }
+    }
+  };
+
+  db.save(ddoc);
+
+  var req = CouchDB.request("GET", "/test_suite_db/_changes?filter=changes_filter/bop");
+  var resp = JSON.parse(req.responseText);
+  T(resp.results.length == 0);
+
+  db.save({"bop" : "foom"});
+  db.save({"bop" : false});
+
+  var req = CouchDB.request("GET", "/test_suite_db/_changes?filter=changes_filter/bop");
+  var resp = JSON.parse(req.responseText);
+  T(resp.results.length == 1, "filtered/bop");
+
+  req = CouchDB.request("GET", "/test_suite_db/_changes?filter=changes_filter/dynamic&field=woox");
+  resp = JSON.parse(req.responseText);
+  T(resp.results.length == 0);
+
+  req = CouchDB.request("GET", "/test_suite_db/_changes?filter=changes_filter/dynamic&field=bop");
+  resp = JSON.parse(req.responseText);
+  T(resp.results.length == 1, "changes_filter/dynamic&field=bop");
+
+  if (!is_safari && xhr) { // full test requires parallel connections
+    // filter with longpoll
+    // longpoll filters full history when run without a since seq
+    xhr = CouchDB.newXhr();
+    xhr.open("GET", CouchDB.proxyUrl("/test_suite_db/_changes?feed=longpoll&filter=changes_filter/bop"), false);
+    xhr.send("");
+    var resp = JSON.parse(xhr.responseText);
+    T(resp.last_seq == 8);
+    // longpoll waits until a matching change before returning
+    xhr = CouchDB.newXhr();
+    xhr.open("GET", CouchDB.proxyUrl("/test_suite_db/_changes?feed=longpoll&since=7&filter=changes_filter/bop"), true);
+    xhr.send("");
+    db.save({"_id":"falsy", "bop" : ""}); // empty string is falsy
+    db.save({"_id":"bingo","bop" : "bingo"});
+
+    waitForSuccess(function() {
+      resp = JSON.parse(xhr.responseText);
+      return true;
+    }, "longpoll-since");
+
+    T(resp.last_seq == 10);
+    T(resp.results && resp.results.length > 0 && resp.results[0]["id"] == "bingo", "filter the correct update");
+    xhr.abort();
+
+    var timeout = 500;
+    var last_seq = 11;
+    while (true) {
+
+      // filter with continuous
+      xhr = CouchDB.newXhr();
+      xhr.open("GET", CouchDB.proxyUrl("/test_suite_db/_changes?feed=continuous&filter=changes_filter/bop&timeout="+timeout), true);
+      xhr.send("");
+
+      db.save({"_id":"rusty", "bop" : "plankton"});
+      T(xhr.readyState != 4, "test client too slow");
+      var rusty = db.open("rusty", {cache_bust : new Date()});
+      T(rusty._id == "rusty");
+
+      waitForSuccess(function() { // throws an error after 5 seconds
+        if (xhr.readyState != 4) {
+          throw("still waiting");
+        }
+        return true;
+      }, "continuous-rusty");
+      lines = xhr.responseText.split("\n");
+      var good = false;
+      try {
+        JSON.parse(lines[3]);
+        good = true;
+      } catch(e) {
+      }
+      if (good) {
+        T(JSON.parse(lines[1]).id == "bingo", lines[1]);
+        T(JSON.parse(lines[2]).id == "rusty", lines[2]);
+        T(JSON.parse(lines[3]).last_seq == last_seq, lines[3]);
+        break;
+      } else {
+        xhr.abort();
+        db.deleteDoc(rusty);
+        timeout = timeout * 2;
+        last_seq = last_seq + 2;
+      }
+    }
+  }
+  // error conditions
+
+  // non-existing design doc
+  var req = CouchDB.request("GET",
+    "/test_suite_db/_changes?filter=nothingtosee/bop");
+  TEquals(404, req.status, "should return 404 for non existant design doc");
+
+  // non-existing filter
+  var req = CouchDB.request("GET",
+    "/test_suite_db/_changes?filter=changes_filter/movealong");
+  TEquals(404, req.status, "should return 404 for non existant filter fun");
+
+  // both
+  var req = CouchDB.request("GET",
+    "/test_suite_db/_changes?filter=nothingtosee/movealong");
+  TEquals(404, req.status,
+    "should return 404 for non existant design doc and filter fun");
+
+  // changes get all_docs style with deleted docs
+  var doc = {a:1};
+  db.save(doc);
+  db.deleteDoc(doc);
+  var req = CouchDB.request("GET",
+    "/test_suite_db/_changes?filter=changes_filter/bop&style=all_docs");
+  var resp = JSON.parse(req.responseText);
+  var expect = (!is_safari && xhr) ? 3: 1;
+  TEquals(expect, resp.results.length, "should return matching rows");
+
+  // test filter on view function (map)
+  //
+  T(db.save({"_id":"blah", "bop" : "plankton"}).ok);
+  var req = CouchDB.request("GET", "/test_suite_db/_changes?filter=_view&view=changes_filter/blah");
+  var resp = JSON.parse(req.responseText);
+  T(resp.results.length === 1);
+  T(resp.results[0].id === "blah");
+
+
+  // test for userCtx
+  run_on_modified_server(
+    [{section: "httpd",
+      key: "authentication_handlers",
+      value: "{couch_httpd_auth, special_test_authentication_handler}"},
+     {section:"httpd",
+      key: "WWW-Authenticate",
+      value:  "X-Couch-Test-Auth"}],
+
+    function() {
+      var authOpts = {"headers":{"WWW-Authenticate": "X-Couch-Test-Auth Chris Anderson:mp3"}};
+
+      var req = CouchDB.request("GET", "/_session", authOpts);
+      var resp = JSON.parse(req.responseText);
+
+      T(db.save({"user" : "Noah Slater"}).ok);
+      var req = CouchDB.request("GET", "/test_suite_db/_changes?filter=changes_filter/userCtx", authOpts);
+      var resp = JSON.parse(req.responseText);
+      T(resp.results.length == 0);
+
+      var docResp = db.save({"user" : "Chris Anderson"});
+      T(docResp.ok);
+      T(db.ensureFullCommit().ok);
+      req = CouchDB.request("GET", "/test_suite_db/_changes?filter=changes_filter/userCtx", authOpts);
+      resp = JSON.parse(req.responseText);
+      T(resp.results.length == 1, "userCtx");
+      T(resp.results[0].id == docResp.id);
+    }
+  );
+
+  req = CouchDB.request("GET", "/test_suite_db/_changes?limit=1");
+  resp = JSON.parse(req.responseText);
+  TEquals(1, resp.results.length);
+
+  //filter includes _conflicts
+  var id = db.save({'food' : 'pizza'}).id;
+  db.bulkSave([{_id: id, 'food' : 'pasta'}], {all_or_nothing:true});
+
+  req = CouchDB.request("GET", "/test_suite_db/_changes?filter=changes_filter/conflicted");
+  resp = JSON.parse(req.responseText);
+  T(resp.results.length == 1, "filter=changes_filter/conflicted");
+
+  // test with erlang filter function
+  run_on_modified_server([{
+    section: "native_query_servers",
+    key: "erlang",
+    value: "{couch_native_process, start_link, []}"
+  }], function() {
+    var erl_ddoc = {
+      _id: "_design/erlang",
+      language: "erlang",
+      filters: {
+        foo:
+          'fun({Doc}, Req) -> ' +
+          '  case couch_util:get_value(<<"value">>, Doc) of' +
+          '  undefined -> false;' +
+          '  Value -> (Value rem 2) =:= 0;' +
+          '  _ -> false' +
+          '  end ' +
+          'end.'
+      }
+    };
+
+    db.deleteDb();
+    db.createDb();
+    T(db.save(erl_ddoc).ok);
+
+    var req = CouchDB.request("GET", "/test_suite_db/_changes?filter=erlang/foo");
+    var resp = JSON.parse(req.responseText);
+    T(resp.results.length === 0);
+
+    T(db.save({_id: "doc1", value : 1}).ok);
+    T(db.save({_id: "doc2", value : 2}).ok);
+    T(db.save({_id: "doc3", value : 3}).ok);
+    T(db.save({_id: "doc4", value : 4}).ok);
+
+    var req = CouchDB.request("GET", "/test_suite_db/_changes?filter=erlang/foo");
+    var resp = JSON.parse(req.responseText);
+    T(resp.results.length === 2);
+    T(resp.results[0].id === "doc2");
+    T(resp.results[1].id === "doc4");
+
+    // test filtering on docids
+    //
+
+    var options = {
+        headers: {"Content-Type": "application/json"},
+        body: JSON.stringify({"doc_ids": ["something", "anotherthing", "andmore"]})
+    };
+
+    var req = CouchDB.request("POST", "/test_suite_db/_changes?filter=_doc_ids", options);
+    var resp = JSON.parse(req.responseText);
+    T(resp.results.length === 0);
+
+    T(db.save({"_id":"something", "bop" : "plankton"}).ok);
+    var req = CouchDB.request("POST", "/test_suite_db/_changes?filter=_doc_ids", options);
+    var resp = JSON.parse(req.responseText);
+    T(resp.results.length === 1);
+    T(resp.results[0].id === "something");
+
+    T(db.save({"_id":"anotherthing", "bop" : "plankton"}).ok);
+    var req = CouchDB.request("POST", "/test_suite_db/_changes?filter=_doc_ids", options);
+    var resp = JSON.parse(req.responseText);
+    T(resp.results.length === 2);
+    T(resp.results[0].id === "something");
+    T(resp.results[1].id === "anotherthing");
+
+    var docids = JSON.stringify(["something", "anotherthing", "andmore"]),
+        req = CouchDB.request("GET", "/test_suite_db/_changes?filter=_doc_ids&doc_ids="+docids, options);
+    var resp = JSON.parse(req.responseText);
+    T(resp.results.length === 2);
+    T(resp.results[0].id === "something");
+    T(resp.results[1].id === "anotherthing");
+
+    var req = CouchDB.request("GET", "/test_suite_db/_changes?filter=_design");
+    var resp = JSON.parse(req.responseText);
+    T(resp.results.length === 1);
+    T(resp.results[0].id === "_design/erlang");
+
+
+    if (!is_safari && xhr) {
+        // filter docids with continuous
+        xhr = CouchDB.newXhr();
+        xhr.open("POST", CouchDB.proxyUrl("/test_suite_db/_changes?feed=continuous&timeout=500&since=7&filter=_doc_ids"), true);
+        xhr.setRequestHeader("Content-Type", "application/json");
+
+        xhr.send(options.body);
+
+        T(db.save({"_id":"andmore", "bop" : "plankton"}).ok);
+
+        waitForSuccess(function() {
+            if (xhr.readyState != 4) {
+              throw("still waiting");
+            }
+            return true;
+        }, "andmore-only");
+
+        var line = JSON.parse(xhr.responseText.split("\n")[0]);
+        T(line.seq == 8);
+        T(line.id == "andmore");
+    }
+  });
+
+  // COUCHDB-1037 - empty result for ?limit=1&filter=foo/bar in some cases
+  T(db.deleteDb());
+  T(db.createDb());
+
+  ddoc = {
+    _id: "_design/testdocs",
+    filters: {
+      testdocsonly: (function(doc, req) {
+        return (typeof doc.integer === "number");
+      }).toString()
+    }
+  };
+  T(db.save(ddoc));
+
+  ddoc = {
+    _id: "_design/foobar",
+    foo: "bar"
+  };
+  T(db.save(ddoc));
+
+  db.bulkSave(makeDocs(0, 5));
+
+  req = CouchDB.request("GET", "/" + db.name + "/_changes");
+  resp = JSON.parse(req.responseText);
+  TEquals(7, resp.last_seq);
+  TEquals(7, resp.results.length);
+
+  req = CouchDB.request(
+    "GET", "/"+ db.name + "/_changes?limit=1&filter=testdocs/testdocsonly");
+  resp = JSON.parse(req.responseText);
+  TEquals(3, resp.last_seq);
+  TEquals(1, resp.results.length);
+  TEquals("0", resp.results[0].id);
+
+  req = CouchDB.request(
+    "GET", "/" + db.name + "/_changes?limit=2&filter=testdocs/testdocsonly");
+  resp = JSON.parse(req.responseText);
+  TEquals(4, resp.last_seq);
+  TEquals(2, resp.results.length);
+  TEquals("0", resp.results[0].id);
+  TEquals("1", resp.results[1].id);
+
+  TEquals(0, CouchDB.requestStats(['couchdb', 'httpd', 'clients_requesting_changes'], true).value);
+  CouchDB.request("GET", "/" + db.name + "/_changes");
+  TEquals(0, CouchDB.requestStats(['couchdb', 'httpd', 'clients_requesting_changes'], true).value);
+
+  // COUCHDB-1256
+  T(db.deleteDb());
+  T(db.createDb());
+
+  T(db.save({"_id":"foo", "a" : 123}).ok);
+  T(db.save({"_id":"bar", "a" : 456}).ok);
+
+  options = {
+      headers: {"Content-Type": "application/json"},
+      body: JSON.stringify({"_rev":"1-cc609831f0ca66e8cd3d4c1e0d98108a", "a":456})
+  };
+  req = CouchDB.request("PUT", "/" + db.name + "/foo?new_edits=false", options);
+
+  req = CouchDB.request("GET", "/" + db.name + "/_changes?style=all_docs");
+  resp = JSON.parse(req.responseText);
+
+  TEquals(3, resp.last_seq);
+  TEquals(2, resp.results.length);
+
+  req = CouchDB.request("GET", "/" + db.name + "/_changes?style=all_docs&since=2");
+  resp = JSON.parse(req.responseText);
+
+  TEquals(3, resp.last_seq);
+  TEquals(1, resp.results.length);
+  TEquals(2, resp.results[0].changes.length);
+
+  // COUCHDB-1852
+  T(db.deleteDb());
+  T(db.createDb());
+
+  // create 4 documents... this assumes the update sequnce will start from 0 and get to 4
+  db.save({"bop" : "foom"});
+  db.save({"bop" : "foom"});
+  db.save({"bop" : "foom"});
+  db.save({"bop" : "foom"});
+
+  // simulate an EventSource request with a Last-Event-ID header
+  req = CouchDB.request("GET", "/test_suite_db/_changes?feed=eventsource&timeout=0&since=0",
+        {"headers": {"Accept": "text/event-stream", "Last-Event-ID": "2"}});
+
+  // "parse" the eventsource response and collect only the "id: ..." lines
+  var changes = req.responseText.split('\n')
+     .map(function (el) {
+        return el.split(":").map(function (el) { return el.trim()});
+     })
+     .filter(function (el) { return (el[0] === "id"); })
+
+  // make sure we only got 2 changes, and they are update_seq=3 and update_seq=4
+  T(changes.length === 2);
+  T(changes[0][1] === "3");
+  T(changes[1][1] === "4");
+
+  // COUCHDB-1923
+  T(db.deleteDb());
+  T(db.createDb());
+
+  var attachmentData = "VGhpcyBpcyBhIGJhc2U2NCBlbmNvZGVkIHRleHQ=";
+
+  db.bulkSave(makeDocs(20, 30, {
+    _attachments:{
+      "foo.txt": {
+        content_type:"text/plain",
+        data: attachmentData
+      },
+      "bar.txt": {
+        content_type:"text/plain",
+        data: attachmentData
+      }
+    }
+  }));
+
+  var mapFunction = function(doc) {
+    var count = 0;
+
+    for(var idx in doc._attachments) {
+      count = count + 1;
+    }
+
+    emit(parseInt(doc._id), count);
+  };
+
+  var req = CouchDB.request("GET", "/test_suite_db/_changes?include_docs=true");
+  var resp = JSON.parse(req.responseText);
+
+  T(resp.results.length == 10);
+  T(resp.results[0].doc._attachments['foo.txt'].stub === true);
+  T(resp.results[0].doc._attachments['foo.txt'].data === undefined);
+  T(resp.results[0].doc._attachments['foo.txt'].encoding === undefined);
+  T(resp.results[0].doc._attachments['foo.txt'].encoded_length === undefined);
+  T(resp.results[0].doc._attachments['bar.txt'].stub === true);
+  T(resp.results[0].doc._attachments['bar.txt'].data === undefined);
+  T(resp.results[0].doc._attachments['bar.txt'].encoding === undefined);
+  T(resp.results[0].doc._attachments['bar.txt'].encoded_length === undefined);
+
+  var req = CouchDB.request("GET", "/test_suite_db/_changes?include_docs=true&attachments=true");
+  var resp = JSON.parse(req.responseText);
+
+  T(resp.results.length == 10);
+  T(resp.results[0].doc._attachments['foo.txt'].stub === undefined);
+  T(resp.results[0].doc._attachments['foo.txt'].data === attachmentData);
+  T(resp.results[0].doc._attachments['foo.txt'].encoding === undefined);
+  T(resp.results[0].doc._attachments['foo.txt'].encoded_length === undefined);
+  T(resp.results[0].doc._attachments['bar.txt'].stub === undefined);
+  T(resp.results[0].doc._attachments['bar.txt'].data == attachmentData);
+  T(resp.results[0].doc._attachments['bar.txt'].encoding === undefined);
+  T(resp.results[0].doc._attachments['bar.txt'].encoded_length === undefined);
+
+  var req = CouchDB.request("GET", "/test_suite_db/_changes?include_docs=true&att_encoding_info=true");
+  var resp = JSON.parse(req.responseText);
+
+  T(resp.results.length == 10);
+  T(resp.results[0].doc._attachments['foo.txt'].stub === true);
+  T(resp.results[0].doc._attachments['foo.txt'].data === undefined);
+  T(resp.results[0].doc._attachments['foo.txt'].encoding === "gzip");
+  T(resp.results[0].doc._attachments['foo.txt'].encoded_length === 47);
+  T(resp.results[0].doc._attachments['bar.txt'].stub === true);
+  T(resp.results[0].doc._attachments['bar.txt'].data === undefined);
+  T(resp.results[0].doc._attachments['bar.txt'].encoding === "gzip");
+  T(resp.results[0].doc._attachments['bar.txt'].encoded_length === 47);
+
+  // cleanup
+  db.deleteDb();
+};

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/test/coffee.js
----------------------------------------------------------------------
diff --git a/share/test/coffee.js b/share/test/coffee.js
new file mode 100644
index 0000000..9306124
--- /dev/null
+++ b/share/test/coffee.js
@@ -0,0 +1,67 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+
+// test basic coffeescript functionality
+couchTests.coffee = function(debug) {
+  var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"});
+  db.deleteDb();
+  db.createDb();
+  if (debug) debugger;
+
+  var ddoc = {
+    _id: "_design/coffee",
+    language: "coffeescript",
+    views: {
+      myview: {
+        map: '(doc) -> if doc.foo\n  emit(doc.foo, 1)',
+        reduce: '(keys, values, rereduce) ->\n  sum = 0\n  for x in values\n    sum = sum + x\n  sum'
+      }
+    },
+    shows: {
+      myshow: '(doc) ->\n  "Foo #{doc.foo}"'
+    },
+    lists: {
+      mylist: '(head, req) ->\n  while row = getRow()\n    send("Foo #{row.value}")\n  return "Foo"'
+    },
+    filters: {
+      filter: "(doc) ->\n  doc.foo"
+    }
+  };
+
+  db.save(ddoc);
+
+  var docs = [
+    {_id:"a", foo: 100},
+    {foo:1},
+    {foo:1},
+    {foo:2},
+    {foo:2},
+    {bar:1},
+    {bar:1},
+    {bar:2},
+    {bar:2}
+  ];
+
+  db.bulkSave(docs);
+
+  var res = db.view("coffee/myview");
+  TEquals(5, res.rows[0].value, "should sum up values");
+
+  var res = CouchDB.request("GET", "/" + db.name + "/_design/coffee/_show/myshow/a");
+  TEquals("Foo 100", res.responseText, "should show 100");
+
+  var res = CouchDB.request("GET", "/" + db.name + "/_design/coffee/_list/mylist/myview");
+  TEquals("Foo 5Foo", res.responseText, "should list");
+
+  var changes = db.changes({filter: "coffee/filter"});
+  TEquals(5, changes.results.length, "should have changes");
+};

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/test/compact.js
----------------------------------------------------------------------
diff --git a/share/test/compact.js b/share/test/compact.js
new file mode 100644
index 0000000..68c83b3
--- /dev/null
+++ b/share/test/compact.js
@@ -0,0 +1,65 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+
+couchTests.compact = function(debug) {
+  var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"});
+  db.deleteDb();
+  db.createDb();
+  if (debug) debugger;
+  var docs = makeDocs(0, 20);
+  db.bulkSave(docs);
+
+  var binAttDoc = {
+    _id: "bin_doc",
+    _attachments:{
+      "foo.txt": {
+        content_type:"text/plain",
+        data: "VGhpcyBpcyBhIGJhc2U2NCBlbmNvZGVkIHRleHQ="
+      }
+    }
+  };
+
+  T(db.save(binAttDoc).ok);
+
+  var originalsize = db.info().disk_size;
+  var originaldatasize = db.info().data_size;
+  var start_time = db.info().instance_start_time;
+
+  TEquals("number", typeof originaldatasize, "data_size is a number");
+  T(originaldatasize < originalsize, "data size is < then db file size");
+
+  for(var i in docs) {
+      db.deleteDoc(docs[i]);
+  }
+  T(db.ensureFullCommit().ok);
+  var deletesize = db.info().disk_size;
+  T(deletesize > originalsize);
+  T(db.setDbProperty("_revs_limit", 666).ok);
+
+  T(db.compact().ok);
+  T(db.last_req.status == 202);
+  // compaction isn't instantaneous, loop until done
+  while (db.info().compact_running) {};
+  T(db.info().instance_start_time == start_time);
+  T(db.getDbProperty("_revs_limit") === 666);
+
+  T(db.ensureFullCommit().ok);
+  restartServer();
+  var xhr = CouchDB.request("GET", "/test_suite_db/bin_doc/foo.txt");
+  T(xhr.responseText == "This is a base64 encoded text");
+  T(xhr.getResponseHeader("Content-Type") == "text/plain");
+  T(db.info().doc_count == 1);
+  T(db.info().disk_size < deletesize);
+  TEquals("number", typeof db.info().data_size, "data_size is a number");
+  T(db.info().data_size < db.info().disk_size, "data size is < then db file size");
+
+};

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/test/config.js
----------------------------------------------------------------------
diff --git a/share/test/config.js b/share/test/config.js
new file mode 100644
index 0000000..37b339b
--- /dev/null
+++ b/share/test/config.js
@@ -0,0 +1,211 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+
+couchTests.config = function(debug) {
+  var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"});
+  db.deleteDb();
+  db.createDb();
+  if (debug) debugger;
+
+  // test that /_config returns all the settings
+  var xhr = CouchDB.request("GET", "/_config");
+  var config = JSON.parse(xhr.responseText);
+
+  /*
+    if we run on standard ports, we can't extract
+    the number from the URL. Instead we try to guess
+    from the protocol what port we are running on.
+    If we can't guess, we don't test for the port.
+    Overengineering FTW.
+  */
+  var server_port = CouchDB.host.split(':');
+  if(server_port.length == 1 && CouchDB.inBrowser) {
+    if(CouchDB.protocol == "http://") {
+      port = "80";
+    }
+    if(CouchDB.protocol == "https://") {
+      port = "443";
+    }
+  } else {
+    port = server_port.pop();
+  }
+
+  if(CouchDB.protocol == "http://") {
+    config_port = config.httpd.port;
+  }
+  if(CouchDB.protocol == "https://") {
+    config_port = config.ssl.port;
+  }
+
+  if(port && config_port != "0") {
+    TEquals(config_port, port, "ports should match");
+  }
+
+  T(config.couchdb.database_dir);
+  T(config.daemons.httpd);
+  T(config.httpd_global_handlers._config);
+  // T(config.log.level);
+  T(config.query_servers.javascript);
+
+  // test that settings can be altered, and that an undefined whitelist allows any change
+  TEquals(undefined, config.httpd.config_whitelist, "Default whitelist is empty");
+  xhr = CouchDB.request("PUT", "/_config/test/foo",{
+    body : JSON.stringify("bar"),
+    headers: {"X-Couch-Persist": "false"}
+  });
+  T(xhr.status == 200);
+  xhr = CouchDB.request("GET", "/_config/test");
+  config = JSON.parse(xhr.responseText);
+  T(config.foo == "bar");
+
+  // you can get a single key
+  xhr = CouchDB.request("GET", "/_config/test/foo");
+  config = JSON.parse(xhr.responseText);
+  T(config == "bar");
+
+  // Server-side password hashing, and raw updates disabling that.
+  var password_plain = 's3cret';
+  var password_hashed = null;
+
+  xhr = CouchDB.request("PUT", "/_config/admins/administrator",{
+    body : JSON.stringify(password_plain),
+    headers: {"X-Couch-Persist": "false"}
+  });
+  TEquals(200, xhr.status, "Create an admin in the config");
+
+  T(CouchDB.login("administrator", password_plain).ok);
+
+  xhr = CouchDB.request("GET", "/_config/admins/administrator");
+  password_hashed = JSON.parse(xhr.responseText);
+  T(password_hashed.match(/^-pbkdf2-/) || password_hashed.match(/^-hashed-/),
+    "Admin password is hashed");
+
+  xhr = CouchDB.request("PUT", "/_config/admins/administrator?raw=nothanks",{
+    body : JSON.stringify(password_hashed),
+    headers: {"X-Couch-Persist": "false"}
+  });
+  TEquals(400, xhr.status, "CouchDB rejects an invalid 'raw' option");
+
+  xhr = CouchDB.request("PUT", "/_config/admins/administrator?raw=true",{
+    body : JSON.stringify(password_hashed),
+    headers: {"X-Couch-Persist": "false"}
+  });
+  TEquals(200, xhr.status, "Set an raw, pre-hashed admin password");
+
+  xhr = CouchDB.request("PUT", "/_config/admins/administrator?raw=false",{
+    body : JSON.stringify(password_hashed),
+    headers: {"X-Couch-Persist": "false"}
+  });
+  TEquals(200, xhr.status, "Set an admin password with raw=false");
+
+  // The password is literally the string "-pbkdf2-abcd...".
+  T(CouchDB.login("administrator", password_hashed).ok);
+
+  xhr = CouchDB.request("GET", "/_config/admins/administrator");
+  T(password_hashed != JSON.parse(xhr.responseText),
+    "Hashed password was not stored as a raw string");
+
+  xhr = CouchDB.request("DELETE", "/_config/admins/administrator",{
+    headers: {"X-Couch-Persist": "false"}
+  });
+  TEquals(200, xhr.status, "Delete an admin from the config");
+  T(CouchDB.logout().ok);
+
+  // Non-term whitelist values allow further modification of the whitelist.
+  xhr = CouchDB.request("PUT", "/_config/httpd/config_whitelist",{
+    body : JSON.stringify("!This is an invalid Erlang term!"),
+    headers: {"X-Couch-Persist": "false"}
+  });
+  TEquals(200, xhr.status, "Set config whitelist to an invalid Erlang term");
+  xhr = CouchDB.request("DELETE", "/_config/httpd/config_whitelist",{
+    headers: {"X-Couch-Persist": "false"}
+  });
+  TEquals(200, xhr.status, "Modify whitelist despite it being invalid syntax");
+
+  // Non-list whitelist values allow further modification of the whitelist.
+  xhr = CouchDB.request("PUT", "/_config/httpd/config_whitelist",{
+    body : JSON.stringify("{[yes, a_valid_erlang_term, but_unfortunately, not_a_list]}"),
+    headers: {"X-Couch-Persist": "false"}
+  });
+  TEquals(200, xhr.status, "Set config whitelist to an non-list term");
+  xhr = CouchDB.request("DELETE", "/_config/httpd/config_whitelist",{
+    headers: {"X-Couch-Persist": "false"}
+  });
+  TEquals(200, xhr.status, "Modify whitelist despite it not being a list");
+
+  // Keys not in the whitelist may not be modified.
+  xhr = CouchDB.request("PUT", "/_config/httpd/config_whitelist",{
+    body : JSON.stringify("[{httpd,config_whitelist}, {test,foo}]"),
+    headers: {"X-Couch-Persist": "false"}
+  });
+  TEquals(200, xhr.status, "Set config whitelist to something valid");
+
+  ["PUT", "DELETE"].forEach(function(method) {
+    ["test/not_foo", "not_test/foo", "neither_test/nor_foo"].forEach(function(pair) {
+      var path = "/_config/" + pair;
+      var test_name = method + " to " + path + " disallowed: not whitelisted";
+
+      xhr = CouchDB.request(method, path, {
+        body : JSON.stringify("Bummer! " + test_name),
+        headers: {"X-Couch-Persist": "false"}
+      });
+      TEquals(400, xhr.status, test_name);
+    });
+  });
+
+  // Keys in the whitelist may be modified.
+  ["PUT", "DELETE"].forEach(function(method) {
+    xhr = CouchDB.request(method, "/_config/test/foo",{
+      body : JSON.stringify(method + " to whitelisted config variable"),
+      headers: {"X-Couch-Persist": "false"}
+    });
+    TEquals(200, xhr.status, "Keys in the whitelist may be modified");
+  });
+
+  // Non-2-tuples in the whitelist are ignored
+  xhr = CouchDB.request("PUT", "/_config/httpd/config_whitelist",{
+    body : JSON.stringify("[{httpd,config_whitelist}, these, {are}, {nOt, 2, tuples}," +
+                          " [so], [they, will], [all, become, noops], {test,foo}]"),
+    headers: {"X-Couch-Persist": "false"}
+  });
+  TEquals(200, xhr.status, "Set config whitelist with some inert values");
+  ["PUT", "DELETE"].forEach(function(method) {
+    xhr = CouchDB.request(method, "/_config/test/foo",{
+      body : JSON.stringify(method + " to whitelisted config variable"),
+      headers: {"X-Couch-Persist": "false"}
+    });
+    TEquals(200, xhr.status, "Update whitelisted variable despite invalid entries");
+  });
+
+  // Atoms, binaries, and strings suffice as whitelist sections and keys.
+  ["{test,foo}", '{"test","foo"}', '{<<"test">>,<<"foo">>}'].forEach(function(pair) {
+    xhr = CouchDB.request("PUT", "/_config/httpd/config_whitelist",{
+      body : JSON.stringify("[{httpd,config_whitelist}, " + pair + "]"),
+      headers: {"X-Couch-Persist": "false"}
+    });
+    TEquals(200, xhr.status, "Set config whitelist to include " + pair);
+
+    var pair_format = {"t":"tuple", '"':"string", "<":"binary"}[pair[1]];
+    ["PUT", "DELETE"].forEach(function(method) {
+      xhr = CouchDB.request(method, "/_config/test/foo",{
+        body : JSON.stringify(method + " with " + pair_format),
+        headers: {"X-Couch-Persist": "false"}
+      });
+      TEquals(200, xhr.status, "Whitelist works with " + pair_format);
+    });
+  });
+
+  xhr = CouchDB.request("DELETE", "/_config/httpd/config_whitelist",{
+    headers: {"X-Couch-Persist": "false"}
+  });
+  TEquals(200, xhr.status, "Reset config whitelist to undefined");
+};

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/test/conflicts.js
----------------------------------------------------------------------
diff --git a/share/test/conflicts.js b/share/test/conflicts.js
new file mode 100644
index 0000000..79266ab
--- /dev/null
+++ b/share/test/conflicts.js
@@ -0,0 +1,119 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+
+// Do some edit conflict detection tests
+couchTests.conflicts = function(debug) {
+  var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"});
+  db.deleteDb();
+  db.createDb();
+  if (debug) debugger;
+
+  // create a doc and save
+  var doc = {_id:"foo",a:1,b:1};
+  T(db.save(doc).ok);
+
+  // reopen
+  var doc2 = db.open(doc._id);
+
+  // ensure the revisions are the same
+  T(doc._id == doc2._id && doc._rev == doc2._rev);
+
+  // edit the documents.
+  doc.a = 2;
+  doc2.a = 3;
+
+  // save one document
+  T(db.save(doc).ok);
+
+  // save the other document
+  try {
+    db.save(doc2);  // this should generate a conflict exception
+    T("no save conflict 1" && false); // we shouldn't hit here
+  } catch (e) {
+    T(e.error == "conflict");
+  }
+
+  var changes = db.changes();
+
+  T(changes.results.length == 1);
+
+  // Now clear out the _rev member and save. This indicates this document is
+  // new, not based on an existing revision.
+  doc2._rev = undefined;
+  try {
+    db.save(doc2); // this should generate a conflict exception
+    T("no save conflict 2" && false); // we shouldn't hit here
+  } catch (e) {
+    T(e.error == "conflict");
+  }
+
+  // Make a few bad requests, specifying conflicting revs
+  // ?rev doesn't match body
+  var xhr = CouchDB.request("PUT", "/test_suite_db/foo?rev=1-foobar", {
+    body : JSON.stringify(doc)
+  });
+  T(xhr.status == 400);
+
+  // If-Match doesn't match body
+  xhr = CouchDB.request("PUT", "/test_suite_db/foo", {
+    headers: {"If-Match": "1-foobar"},
+    body: JSON.stringify(doc)
+  });
+  T(xhr.status == 400);
+
+  // ?rev= doesn't match If-Match
+  xhr = CouchDB.request("PUT", "/test_suite_db/foo?rev=1-boobaz", {
+    headers: {"If-Match": "1-foobar"},
+    body: JSON.stringify(doc2)
+  });
+  T(xhr.status == 400);
+
+  // Now update the document using ?rev=
+  xhr = CouchDB.request("PUT", "/test_suite_db/foo?rev=" + doc._rev, {
+    body: JSON.stringify(doc)
+  });
+  T(xhr.status == 201);
+
+  // reopen
+  var doc = db.open(doc._id);
+
+  // Now delete the document from the database
+  T(db.deleteDoc(doc).ok);
+
+  T(db.save(doc2).ok);  // we can save a new document over a deletion without
+                        // knowing the deletion rev.
+
+  // Verify COUCHDB-1178
+  var r1 = {"_id":"doc","foo":"bar"};
+  var r2 = {"_id":"doc","foo":"baz","_rev":"1-4c6114c65e295552ab1019e2b046b10e"};
+  var r3 = {"_id":"doc","foo":"bam","_rev":"2-cfcd6781f13994bde69a1c3320bfdadb"};
+  var r4 = {"_id":"doc","foo":"bat","_rev":"3-cc2f3210d779aef595cd4738be0ef8ff"};
+
+  T(db.save({"_id":"_design/couchdb-1178","validate_doc_update":"function(){}"}).ok);
+  T(db.save(r1).ok);
+  T(db.save(r2).ok);
+  T(db.save(r3).ok);
+
+  T(db.compact().ok);
+  while (db.info().compact_running) {};
+
+  TEquals({"_id":"doc",
+        "_rev":"3-cc2f3210d779aef595cd4738be0ef8ff",
+        "foo":"bam",
+        "_revisions":{"start":3,
+          "ids":["cc2f3210d779aef595cd4738be0ef8ff",
+                 "cfcd6781f13994bde69a1c3320bfdadb",
+                                      "4c6114c65e295552ab1019e2b046b10e"]}},
+    db.open("doc", {"revs": true}));
+  TEquals([], db.bulkSave([r4, r3, r2], {"new_edits":false}), "no failures");
+
+};

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/test/content_negotiation.js
----------------------------------------------------------------------
diff --git a/share/test/content_negotiation.js b/share/test/content_negotiation.js
new file mode 100644
index 0000000..36e7dfb
--- /dev/null
+++ b/share/test/content_negotiation.js
@@ -0,0 +1,39 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+
+couchTests.content_negotiation = function(debug) {
+  var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"});
+  db.deleteDb();
+  db.createDb();
+  if (debug) debugger;
+  var xhr;
+
+  // with no accept header
+  var req = CouchDB.newXhr();
+  req.open("GET", CouchDB.proxyUrl("/test_suite_db/"), false);
+  req.send("");
+  TEquals("text/plain; charset=utf-8", req.getResponseHeader("Content-Type"));
+
+  // make sure JSON responses end in a newline
+  var text = req.responseText;
+  TEquals("\n", text[text.length-1]);
+
+  xhr = CouchDB.request("GET", "/test_suite_db/", {
+    headers: {"Accept": "text/html; text/plain;*/*"}
+  });
+  TEquals("text/plain; charset=utf-8", xhr.getResponseHeader("Content-Type"));
+
+  xhr = CouchDB.request("GET", "/test_suite_db/", {
+    headers: {"Accept": "application/json"}
+  });
+  TEquals("application/json", xhr.getResponseHeader("Content-Type"));
+};

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/test/cookie_auth.js
----------------------------------------------------------------------
diff --git a/share/test/cookie_auth.js b/share/test/cookie_auth.js
new file mode 100644
index 0000000..9b4bd64
--- /dev/null
+++ b/share/test/cookie_auth.js
@@ -0,0 +1,288 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License.  You may obtain a copy
+// of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+// License for the specific language governing permissions and limitations under
+// the License.
+
+couchTests.cookie_auth = function(debug) {
+  // This tests cookie-based authentication.
+
+  var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"});
+  db.deleteDb();
+  db.createDb();
+  if (debug) debugger;
+
+  var password = "3.141592653589";
+
+  var loginUser = function(username) {
+    var pws = {
+      jan: "apple",
+      "Jason Davies": password,
+      jchris: "funnybone"
+    };
+    var username1 = username.replace(/[0-9]$/, "");
+    var password = pws[username];
+    //console.log("Logging in '" + username1 + "' with password '" + password + "'");
+    T(CouchDB.login(username1, pws[username]).ok);
+  };
+
+  var open_as = function(db, docId, username) {
+    loginUser(username);
+    try {
+      return db.open(docId, {"anti-cache": Math.round(Math.random() * 100000)});
+    } finally {
+      CouchDB.logout();
+    }
+  };
+
+  var save_as = function(db, doc, username)
+  {
+    loginUser(username);
+    try {
+      return db.save(doc);
+    } catch (ex) {
+      return ex;
+    } finally {
+      CouchDB.logout();
+    }
+  };
+
+  // Simple secret key generator
+  function generateSecret(length) {
+    var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
+    var secret = '';
+    for (var i=0; i<length; i++) {
+      secret += tab.charAt(Math.floor(Math.random() * 64));
+    }
+    return secret;
+  }
+
+  // this function will be called on the modified server
+  var testFun = function () {
+    try {
+
+      // test that the users db is born with the auth ddoc
+      var ddoc = open_as(usersDb, "_design/_auth", "jan");
+      T(ddoc.validate_doc_update);
+
+      // TODO test that changing the config so an existing db becomes the users db installs the ddoc also
+
+      // Create a user
+      var jasonUserDoc = CouchDB.prepareUserDoc({
+        name: "Jason Davies"
+      }, password);
+      T(usersDb.save(jasonUserDoc).ok);
+
+      var checkDoc = open_as(usersDb, jasonUserDoc._id, "jan");
+      TEquals("Jason Davies", checkDoc.name);
+
+      var jchrisUserDoc = CouchDB.prepareUserDoc({
+        name: "jchris@apache.org"
+      }, "funnybone");
+      T(usersDb.save(jchrisUserDoc).ok);
+
+      // make sure we cant create duplicate users
+      var duplicateJchrisDoc = CouchDB.prepareUserDoc({
+        name: "jchris@apache.org"
+      }, "eh, Boo-Boo?");
+
+      try {
+        usersDb.save(duplicateJchrisDoc);
+        T(false && "Can't create duplicate user names. Should have thrown an error.");
+      } catch (e) {
+        TEquals("conflict", e.error);
+        TEquals(409, usersDb.last_req.status);
+      }
+
+      // we can't create _names
+      var underscoreUserDoc = CouchDB.prepareUserDoc({
+        name: "_why"
+      }, "copperfield");
+
+      try {
+        usersDb.save(underscoreUserDoc);
+        T(false && "Can't create underscore user names. Should have thrown an error.");
+      } catch (e) {
+        TEquals("forbidden", e.error);
+        TEquals(403, usersDb.last_req.status);
+      }
+
+      // we can't create docs with malformed ids
+      var badIdDoc = CouchDB.prepareUserDoc({
+        name: "w00x"
+      }, "bar");
+
+      badIdDoc._id = "org.apache.couchdb:w00x";
+
+      try {
+        usersDb.save(badIdDoc);
+        T(false && "Can't create malformed docids. Should have thrown an error.");
+      } catch (e) {
+        TEquals("forbidden", e.error);
+        TEquals(403, usersDb.last_req.status);
+      }
+
+      // login works
+      T(CouchDB.login('Jason Davies', password).ok);
+      TEquals('Jason Davies', CouchDB.session().userCtx.name);
+
+      // JSON login works
+      var xhr = CouchDB.request("POST", "/_session", {
+        headers: {"Content-Type": "application/json"},
+        body: JSON.stringify({
+          name: 'Jason Davies',
+          password: password
+        })
+      });
+
+      T(JSON.parse(xhr.responseText).ok);
+      TEquals('Jason Davies', CouchDB.session().userCtx.name);
+
+      // update one's own credentials document
+      jasonUserDoc.foo=2;
+      T(usersDb.save(jasonUserDoc).ok);
+      T(CouchDB.session().userCtx.roles.indexOf("_admin") == -1);
+      // can't delete another users doc unless you are admin
+      try {
+        usersDb.deleteDoc(jchrisUserDoc);
+        T(false && "Can't delete other users docs. Should have thrown an error.");
+      } catch (e) {
+        TEquals("not_found", e.error);
+        TEquals(404, usersDb.last_req.status);
+      }
+
+      // TODO should login() throw an exception here?
+       T(!CouchDB.login('Jason Davies', "2.71828").ok);
+       T(!CouchDB.login('Robert Allen Zimmerman', 'd00d').ok);
+
+       // a failed login attempt should log you out
+       T(CouchDB.session().userCtx.name != 'Jason Davies');
+
+       // test redirect on success
+       xhr = CouchDB.request("POST", "/_session?next=/", {
+         headers: {"Content-Type": "application/x-www-form-urlencoded"},
+         body: "name=Jason%20Davies&password="+encodeURIComponent(password)
+       });
+       // the browser should transparently follow the redirect and GET the server root (/)
+       // see http://dev.w3.org/2006/webapi/XMLHttpRequest/#infrastructure-for-the-send-method
+       if (xhr.status == 200) {
+         T(/Welcome/.test(xhr.responseText))
+       }
+
+       // test redirect on fail
+       xhr = CouchDB.request("POST", "/_session?fail=/", {
+         headers: {"Content-Type": "application/x-www-form-urlencoded"},
+         body: "name=Jason%20Davies&password=foobar"
+       });
+       if (xhr.status == 200) {
+         T(/Welcome/.test(xhr.responseText));
+       }
+
+      // test users db validations
+      //
+      // test that you can't update docs unless you are logged in as the user (or are admin)
+      T(CouchDB.login("jchris@apache.org", "funnybone").ok);
+      T(CouchDB.session().userCtx.name == "jchris@apache.org");
+      T(CouchDB.session().userCtx.roles.length == 0);
+
+      jasonUserDoc.foo=3;
+
+      try {
+        usersDb.save(jasonUserDoc);
+        T(false && "Can't update someone else's user doc. Should have thrown an error.");
+      } catch (e) {
+        T(e.error == "not_found");
+        T(usersDb.last_req.status == 404);
+      }
+
+      // test that you can't edit roles unless you are admin
+      jchrisUserDoc.roles = ["foo"];
+
+      try {
+        usersDb.save(jchrisUserDoc);
+        T(false && "Can't set roles unless you are admin. Should have thrown an error.");
+      } catch (e) {
+        T(e.error == "forbidden");
+        T(usersDb.last_req.status == 403);
+      }
+
+      T(CouchDB.logout().ok);
+
+      jchrisUserDoc.foo = ["foo"];
+      T(save_as(usersDb, jchrisUserDoc, "jan"));
+
+      // test that you can't save system (underscore) roles even if you are admin
+      jchrisUserDoc.roles = ["_bar"];
+
+      var res = save_as(usersDb, jchrisUserDoc, "jan");
+      T(res.error == "forbidden");
+      T(usersDb.last_req.status == 403);
+
+      // make sure the foo role has been applied
+      T(CouchDB.login("jchris@apache.org", "funnybone").ok);
+      T(CouchDB.session().userCtx.name == "jchris@apache.org");
+      T(CouchDB.session().userCtx.roles.indexOf("_admin") == -1);
+      T(CouchDB.session().userCtx.roles.indexOf("foo") != -1);
+
+      // now let's make jchris a server admin
+      T(CouchDB.logout().ok);
+
+      // set the -hashed- password so the salt matches
+      // todo ask on the ML about this
+
+      TEquals(true, CouchDB.login("jan", "apple").ok);
+      run_on_modified_server([{section: "admins",
+        key: "jchris@apache.org", value: "funnybone"}], function() {
+          T(CouchDB.login("jchris@apache.org", "funnybone").ok);
+          T(CouchDB.session().userCtx.name == "jchris@apache.org");
+          T(CouchDB.session().userCtx.roles.indexOf("_admin") != -1);
+          // test that jchris still has the foo role
+          T(CouchDB.session().userCtx.roles.indexOf("foo") != -1);
+
+          // should work even when user doc has no password
+          jchrisUserDoc = usersDb.open(jchrisUserDoc._id);
+          delete jchrisUserDoc.salt;
+          delete jchrisUserDoc.password_sha;
+          T(usersDb.save(jchrisUserDoc).ok);
+          T(CouchDB.logout().ok);
+          T(CouchDB.login("jchris@apache.org", "funnybone").ok);
+          var s = CouchDB.session();
+          T(s.userCtx.name == "jchris@apache.org");
+          T(s.userCtx.roles.indexOf("_admin") != -1);
+          // test session info
+          T(s.info.authenticated == "cookie");
+          T(s.info.authentication_db == "test_suite_users");
+          // test that jchris still has the foo role
+          T(CouchDB.session().userCtx.roles.indexOf("foo") != -1);
+        });
+
+    } finally {
+      // Make sure we erase any auth cookies so we don't affect other tests
+      T(CouchDB.logout().ok);
+    }
+    // log in one last time so run_on_modified_server can clean up the admin account
+    TEquals(true, CouchDB.login("jan", "apple").ok);
+  };
+
+  var usersDb = new CouchDB("test_suite_users", {"X-Couch-Full-Commit":"false"});
+  usersDb.deleteDb();
+
+  run_on_modified_server(
+    [
+     {section: "couch_httpd_auth",
+      key: "authentication_db", value: "test_suite_users"},
+     {section: "couch_httpd_auth",
+      key: "iterations", value: "1"},
+     {section: "admins",
+       key: "jan", value: "apple"}
+    ],
+    testFun
+  );
+
+};

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/test/copy_doc.js
----------------------------------------------------------------------
diff --git a/share/test/copy_doc.js b/share/test/copy_doc.js
new file mode 100644
index 0000000..d595761
--- /dev/null
+++ b/share/test/copy_doc.js
@@ -0,0 +1,65 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+
+couchTests.copy_doc = function(debug) {
+  var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"});
+  db.deleteDb();
+  db.createDb();
+  if (debug) debugger;
+
+  // copy a doc
+  var ok = db.save({_id:"doc_to_be_copied",v:1}).ok;
+  TEquals(true, ok, "Should return ok:true");
+  var xhr = CouchDB.request("COPY", "/test_suite_db/doc_to_be_copied", {
+    headers: {"Destination":"doc_that_was_copied"}
+  });
+
+  TEquals(true, JSON.parse(xhr.responseText).ok, "Should return ok:true");
+
+  TEquals(201, xhr.status, "Should return 201 status");
+  TEquals(1, db.open("doc_that_was_copied").v, "Should have value 1");
+
+  // COPY with existing target
+  var ok = db.save({_id:"doc_to_be_copied2",v:1}).ok;
+  TEquals(true, ok, "Should return ok:true");
+  var doc = db.save({_id:"doc_to_be_overwritten",v:2});
+  TEquals(true, doc.ok, "Should return ok:true");
+
+  // error condition
+  var xhr = CouchDB.request("COPY", "/test_suite_db/doc_to_be_copied2", {
+      headers: {"Destination":"doc_to_be_overwritten"}
+  });
+  TEquals(409, xhr.status, "Should return 409 status"); // conflict
+
+  var xhr = CouchDB.request("COPY", "/test_suite_db/doc_to_be_copied2");
+  TEquals(400, xhr.status, "Should return 400 status");
+  TEquals("Destination header is mandatory for COPY.", JSON.parse(xhr.responseText).reason,
+    "Should report missing destination header");
+
+  var xhr = CouchDB.request("COPY", "/test_suite_db/doc_to_be_copied2", {
+    headers: {
+      "Destination": "http://localhost:5984/test_suite_db/doc_to_be_written"
+  }});
+  TEquals(400, xhr.status, "Should return 400 status");
+  TEquals("Destination URL must be relative.", JSON.parse(xhr.responseText).reason,
+    "Should report invalid destination header");
+
+  var rev = db.open("doc_to_be_overwritten")._rev;
+  var xhr = CouchDB.request("COPY", "/test_suite_db/doc_to_be_copied2", {
+    headers: {"Destination":"doc_to_be_overwritten?rev=" + rev}
+  });
+  TEquals(201, xhr.status, "Should return 201 status");
+
+  var over = db.open("doc_to_be_overwritten");
+  T(rev != over._rev);
+  TEquals(1, over.v, "Should be value 1");
+};

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/test/delayed_commits.js
----------------------------------------------------------------------
diff --git a/share/test/delayed_commits.js b/share/test/delayed_commits.js
new file mode 100644
index 0000000..dbb072f
--- /dev/null
+++ b/share/test/delayed_commits.js
@@ -0,0 +1,154 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+
+couchTests.delayed_commits = function(debug) {
+  var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"});
+  db.deleteDb();
+  db.createDb();
+  if (debug) debugger;
+
+  run_on_modified_server(
+    [{section: "couchdb",
+      key: "delayed_commits",
+      value: "true"}],
+
+    function () {
+      // By default, couchdb doesn't fully commit documents to disk right away,
+      // it waits about a second to batch the full commit flush along with any
+      // other updates. If it crashes or is restarted you may lose the most
+      // recent commits.
+
+      T(db.save({_id:"1",a:2,b:4}).ok);
+      T(db.open("1") != null);
+
+      restartServer();
+
+      T(db.open("1") == null); // lost the update.
+      // note if we waited > 1 sec before the restart, the doc would likely
+      // commit.
+
+
+      // Retry the same thing but with full commits on.
+
+      var db2 = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"true"});
+
+      T(db2.save({_id:"1",a:2,b:4}).ok);
+      T(db2.open("1") != null);
+
+      restartServer();
+
+      T(db2.open("1") != null);
+
+      // You can update but without committing immediately, and then ensure
+      // everything is commited in the last step.
+
+      T(db.save({_id:"2",a:2,b:4}).ok);
+      T(db.open("2") != null);
+      T(db.ensureFullCommit().ok);
+      restartServer();
+
+      T(db.open("2") != null);
+
+      // However, it's possible even when flushed, that the server crashed between
+      // the update and the commit, and you don't want to check to make sure
+      // every doc you updated actually made it to disk. So record the instance
+      // start time of the database before the updates and then check it again
+      // after the flush (the instance start time is returned by the flush
+      // operation). if they are the same, we know everything was updated
+      // safely.
+
+      // First try it with a crash.
+
+      var instanceStartTime = db.info().instance_start_time;
+
+      T(db.save({_id:"3",a:2,b:4}).ok);
+      T(db.open("3") != null);
+
+      restartServer();
+
+      var commitResult = db.ensureFullCommit();
+      T(commitResult.ok && commitResult.instance_start_time != instanceStartTime);
+      // start times don't match, meaning the server lost our change
+
+      T(db.open("3") == null); // yup lost it
+
+      // retry with no server restart
+
+      var instanceStartTime = db.info().instance_start_time;
+
+      T(db.save({_id:"4",a:2,b:4}).ok);
+      T(db.open("4") != null);
+
+      var commitResult = db.ensureFullCommit();
+      T(commitResult.ok && commitResult.instance_start_time == instanceStartTime);
+      // Successful commit, start times match!
+
+      restartServer();
+
+      T(db.open("4") != null);
+    });
+
+  // Now test that when we exceed the max_dbs_open, pending commits are safely
+  // written.
+  T(db.save({_id:"5",foo:"bar"}).ok);
+  var max = 2;
+  run_on_modified_server(
+    [{section: "couchdb",
+      key: "delayed_commits",
+      value: "true"},
+     {section: "couchdb",
+      key: "max_dbs_open",
+      value: max.toString()}],
+
+    function () {
+      for(var i=0; i<max; i++) {
+        var dbi = new CouchDB("test_suite_db" + i);
+        dbi.deleteDb();
+        dbi.createDb();
+      }
+      T(db.open("5").foo=="bar");
+      for(var i=0; i<max+1; i++) {
+        var dbi = new CouchDB("test_suite_db" + i);
+        dbi.deleteDb();
+      }
+    });
+
+
+  // Test that a conflict can't cause delayed commits to fail
+  run_on_modified_server(
+    [{section: "couchdb",
+      key: "delayed_commits",
+      value: "true"}],
+
+    function() {
+      //First save a document and commit it
+      T(db.save({_id:"6",a:2,b:4}).ok);
+      T(db.ensureFullCommit().ok);
+      //Generate a conflict
+      try {
+        db.save({_id:"6",a:2,b:4});
+      } catch( e) {
+        T(e.error == "conflict");
+      }
+      //Wait for the delayed commit interval to pass
+      var time = new Date();
+      while(new Date() - time < 2000);
+      //Save a new doc
+      T(db.save({_id:"7",a:2,b:4}).ok);
+      //Wait for the delayed commit interval to pass
+      var time = new Date();
+      while(new Date() - time < 2000);
+      //Crash the server and make sure the last doc was written
+      restartServer();
+      T(db.open("7") != null);
+    });
+};

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/test/design_docs.js
----------------------------------------------------------------------
diff --git a/share/test/design_docs.js b/share/test/design_docs.js
new file mode 100644
index 0000000..dd38858
--- /dev/null
+++ b/share/test/design_docs.js
@@ -0,0 +1,466 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+
+couchTests.design_docs = function(debug) {
+  var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"});
+  var db2 = new CouchDB("test_suite_db_a", {"X-Couch-Full-Commit":"false"});
+
+  if (debug) debugger;
+
+  db.deleteDb();
+  db.createDb();
+  db2.deleteDb();
+  db2.createDb();
+
+  var server_config = [
+    {
+      section: "query_server_config",
+      key: "reduce_limit",
+      value: "false"
+    }
+  ];
+
+  var testFun = function() {
+    var numDocs = 500;
+
+    function makebigstring(power) {
+      var str = "a";
+      while(power-- > 0) {
+        str = str + str;
+      }
+      return str;
+    }
+
+    var designDoc = {
+      _id: "_design/test",
+      language: "javascript",
+      whatever : {
+        stringzone : "exports.string = 'plankton';",
+        commonjs : {
+          whynot : "exports.test = require('../stringzone'); " +
+            "exports.foo = require('whatever/stringzone');",
+          upper : "exports.testing = require('./whynot').test.string.toUpperCase()+" +
+            "module.id+require('./whynot').foo.string",
+          circular_one: "require('./circular_two'); exports.name = 'One';",
+          circular_two: "require('./circular_one'); exports.name = 'Two';"
+        },
+        // paths relative to parent
+        idtest1: {
+          a: {
+            b: {d: "module.exports = require('../c/e').id;"},
+            c: {e: "exports.id = module.id;"}
+          }
+        },
+        // multiple paths relative to parent
+        idtest2: {
+          a: {
+            b: {d: "module.exports = require('../../a/c/e').id;"},
+            c: {e: "exports.id = module.id;"}
+          }
+        },
+        // paths relative to module
+        idtest3: {
+          a: {
+            b: "module.exports = require('./c/d').id;",
+            c: {
+              d: "module.exports = require('./e');",
+              e: "exports.id = module.id;"
+            }
+          }
+        },
+        // paths relative to module and parent
+        idtest4: {
+          a: {
+            b: "module.exports = require('../a/./c/d').id;",
+            c: {
+              d: "module.exports = require('./e');",
+              e: "exports.id = module.id;"
+            }
+          }
+        },
+        // paths relative to root
+        idtest5: {
+          a: "module.exports = require('whatever/idtest5/b').id;",
+          b: "exports.id = module.id;"
+        }
+      },
+      views: {
+        all_docs_twice: {
+          map:
+            (function(doc) {
+              emit(doc.integer, null);
+              emit(doc.integer, null);
+            }).toString()
+        },
+        no_docs: {
+          map:
+            (function(doc) {
+            }).toString()
+        },
+        single_doc: {
+          map:
+            (function(doc) {
+              if (doc._id === "1") {
+                emit(1, null);
+              }
+            }).toString()
+        },
+        summate: {
+          map:
+            (function(doc) {
+              emit(doc.integer, doc.integer);
+            }).toString(),
+          reduce:
+            (function(keys, values) {
+              return sum(values);
+            }).toString()
+        },
+        summate2: {
+          map:
+            (function(doc) {
+              emit(doc.integer, doc.integer);
+            }).toString(),
+          reduce:
+            (function(keys, values) {
+              return sum(values);
+            }).toString()
+        },
+        huge_src_and_results: {
+          map:
+            (function(doc) {
+              if (doc._id === "1") {
+                emit(makebigstring(16), null);
+              }
+            }).toString(),
+          reduce:
+            (function(keys, values) {
+              return makebigstring(16);
+            }).toString()
+        },
+        lib : {
+          baz : "exports.baz = 'bam';",
+          foo : {
+            foo : "exports.foo = 'bar';",
+            boom : "exports.boom = 'ok';",
+            zoom : "exports.zoom = 'yeah';"
+          }
+        },
+        commonjs : {
+          map :
+            (function(doc) {
+              emit(null, require('views/lib/foo/boom').boom);
+            }).toString()
+        }
+      },
+      shows: {
+        simple:
+          (function() {
+            return 'ok';
+          }).toString(),
+        requirey:
+          (function() {
+            var lib = require('whatever/commonjs/upper');
+            return lib.testing;
+          }).toString(),
+        circular:
+          (function() {
+            var lib = require('whatever/commonjs/upper');
+            return JSON.stringify(this);
+          }).toString(),
+        circular_require:
+          (function() {
+            return require('whatever/commonjs/circular_one').name;
+          }).toString(),
+        idtest1: (function() {
+            return require('whatever/idtest1/a/b/d');
+          }).toString(),
+        idtest2: (function() {
+            return require('whatever/idtest2/a/b/d');
+          }).toString(),
+        idtest3: (function() {
+            return require('whatever/idtest3/a/b');
+          }).toString(),
+        idtest4: (function() {
+            return require('whatever/idtest4/a/b');
+          }).toString(),
+        idtest5: (function() {
+            return require('whatever/idtest5/a');
+          }).toString()
+      }
+    }; // designDoc
+
+    var xhr = CouchDB.request(
+      "PUT", "/test_suite_db_a/_design/test", {body: JSON.stringify(designDoc)}
+    );
+    var resp = JSON.parse(xhr.responseText);
+
+    TEquals(resp.rev, db.save(designDoc).rev);
+
+    // test that editing a show fun on the ddoc results in a change in output
+    xhr = CouchDB.request("GET", "/test_suite_db/_design/test/_show/simple");
+    T(xhr.status == 200);
+    TEquals(xhr.responseText, "ok");
+
+    designDoc.shows.simple = (function() {
+      return 'ko';
+    }).toString();
+    T(db.save(designDoc).ok);
+
+    xhr = CouchDB.request("GET", "/test_suite_db/_design/test/_show/simple");
+    T(xhr.status == 200);
+    TEquals(xhr.responseText, "ko");
+
+    xhr = CouchDB.request(
+      "GET", "/test_suite_db_a/_design/test/_show/simple?cache=buster"
+    );
+    T(xhr.status == 200);
+    TEquals("ok", xhr.responseText, 'query server used wrong ddoc');
+
+    // test commonjs require
+    xhr = CouchDB.request("GET", "/test_suite_db/_design/test/_show/requirey");
+    T(xhr.status == 200);
+    TEquals("PLANKTONwhatever/commonjs/upperplankton", xhr.responseText);
+
+    xhr = CouchDB.request("GET", "/test_suite_db/_design/test/_show/circular");
+    T(xhr.status == 200);
+    TEquals("javascript", JSON.parse(xhr.responseText).language);
+
+    // test circular commonjs dependencies
+    xhr = CouchDB.request(
+      "GET",
+      "/test_suite_db/_design/test/_show/circular_require"
+    );
+    TEquals(200, xhr.status);
+    TEquals("One", xhr.responseText);
+
+    // Test that changes to the design doc properly invalidate cached modules:
+
+    // update the designDoc and replace
+    designDoc.whatever.commonjs.circular_one = "exports.name = 'Updated';"
+    T(db.save(designDoc).ok);
+
+    // request circular_require show function again and check the response has
+    // changed
+    xhr = CouchDB.request(
+      "GET",
+      "/test_suite_db/_design/test/_show/circular_require"
+    );
+    TEquals(200, xhr.status);
+    TEquals("Updated", xhr.responseText);
+
+
+    // test module id values are as expected:
+    xhr = CouchDB.request("GET", "/test_suite_db/_design/test/_show/idtest1");
+    TEquals(200, xhr.status);
+    TEquals("whatever/idtest1/a/c/e", xhr.responseText);
+
+    xhr = CouchDB.request("GET", "/test_suite_db/_design/test/_show/idtest2");
+    TEquals(200, xhr.status);
+    TEquals("whatever/idtest2/a/c/e", xhr.responseText);
+
+    xhr = CouchDB.request("GET", "/test_suite_db/_design/test/_show/idtest3");
+    TEquals(200, xhr.status);
+    TEquals("whatever/idtest3/a/c/e", xhr.responseText);
+
+    xhr = CouchDB.request("GET", "/test_suite_db/_design/test/_show/idtest4");
+    TEquals(200, xhr.status);
+    TEquals("whatever/idtest4/a/c/e", xhr.responseText);
+
+    xhr = CouchDB.request("GET", "/test_suite_db/_design/test/_show/idtest5");
+    TEquals(200, xhr.status);
+    TEquals("whatever/idtest5/b", xhr.responseText);
+
+
+    var prev_view_sig = db.designInfo("_design/test").view_index.signature;
+    var prev_view_size = db.designInfo("_design/test").view_index.disk_size;
+
+    db.bulkSave(makeDocs(1, numDocs + 1));
+    T(db.ensureFullCommit().ok);
+
+    // test that we get correct design doc info back,
+    // and also that GET /db/_design/test/_info
+    // hasn't triggered an update of the views
+    db.view("test/summate", {stale: "ok"}); // make sure view group's open
+    for (var i = 0; i < 2; i++) {
+      var dinfo = db.designInfo("_design/test");
+      TEquals("test", dinfo.name);
+      var vinfo = dinfo.view_index;
+      TEquals(prev_view_size, vinfo.disk_size, "view group disk size didn't change");
+      TEquals(false, vinfo.compact_running);
+      TEquals(prev_view_sig, vinfo.signature, 'ddoc sig');
+      // wait some time (there were issues where an update
+      // of the views had been triggered in the background)
+      var start = new Date().getTime();
+      while (new Date().getTime() < start + 2000);
+      TEquals(0, db.view("test/all_docs_twice", {stale: "ok"}).total_rows, 'view info');
+      TEquals(0, db.view("test/single_doc", {stale: "ok"}).total_rows, 'view info');
+      TEquals(0, db.view("test/summate", {stale: "ok"}).rows.length, 'view info');
+      T(db.ensureFullCommit().ok);
+      restartServer();
+    };
+
+    db.bulkSave(makeDocs(numDocs + 1, numDocs * 2 + 1));
+    T(db.ensureFullCommit().ok);
+
+    // open view group
+    db.view("test/summate", {stale: "ok"});
+    // wait so the views can get initialized
+    var start = new Date().getTime();
+    while (new Date().getTime() < start + 2000);
+
+    // test that POST /db/_view_cleanup
+    // doesn't trigger an update of the views
+    var len1 = db.view("test/all_docs_twice", {stale: "ok"}).total_rows;
+    var len2 = db.view("test/single_doc", {stale: "ok"}).total_rows;
+    var len3 = db.view("test/summate", {stale: "ok"}).rows.length;
+    for (i = 0; i < 2; i++) {
+      T(db.viewCleanup().ok);
+      // wait some time (there were issues where an update
+      // of the views had been triggered in the background)
+      start = new Date().getTime();
+      while (new Date().getTime() < start + 2000);
+      TEquals(len1, db.view("test/all_docs_twice", {stale: "ok"}).total_rows, 'view cleanup');
+      TEquals(len2, db.view("test/single_doc", {stale: "ok"}).total_rows, 'view cleanup');
+      TEquals(len3, db.view("test/summate", {stale: "ok"}).rows.length, 'view cleanup');
+      T(db.ensureFullCommit().ok);
+      restartServer();
+      // we'll test whether the view group stays closed
+      // and the views stay uninitialized (they should!)
+      len1 = len2 = len3 = 0;
+    };
+
+    // test commonjs in map functions
+    resp = db.view("test/commonjs", {limit:1});
+    T(resp.rows[0].value == 'ok');
+
+    // test that the _all_docs view returns correctly with keys
+    var results = db.allDocs({startkey:"_design", endkey:"_design0"});
+    T(results.rows.length == 1);
+
+    for (i = 0; i < 2; i++) {
+      var rows = db.view("test/all_docs_twice").rows;
+      for (var j = 0; j < numDocs; j++) {
+        T(rows[2 * j].key == (j + 1));
+        T(rows[(2 * j) + 1].key == (j + 1));
+      };
+      T(db.view("test/no_docs").total_rows == 0);
+      T(db.view("test/single_doc").total_rows == 1);
+      T(db.ensureFullCommit().ok);
+      restartServer();
+    };
+
+    // test when language not specified, Javascript is implied
+    var designDoc2 = {
+      _id: "_design/test2",
+      // language: "javascript",
+      views: {
+        single_doc: {
+          map:
+            (function(doc) {
+              if (doc._id === "1") {
+                emit(1, null);
+              }
+            }).toString()
+        }
+      }
+    };
+
+    T(db.save(designDoc2).ok);
+    T(db.view("test2/single_doc").total_rows == 1);
+
+    var summate = function(N) {
+      return (N + 1) * (N / 2);
+    };
+    var result = db.view("test/summate");
+    T(result.rows[0].value == summate(numDocs * 2));
+
+    result = db.view("test/summate", {startkey: 4, endkey: 4});
+    T(result.rows[0].value == 4);
+
+    result = db.view("test/summate", {startkey: 4, endkey: 5});
+    T(result.rows[0].value == 9);
+
+    result = db.view("test/summate", {startkey: 4, endkey: 6});
+    T(result.rows[0].value == 15);
+
+    // test start_key and end_key aliases
+    result = db.view("test/summate", {start_key: 4, end_key: 6});
+    T(result.rows[0].value == 15);
+
+    // Verify that a shared index (view def is an exact copy of "summate")
+    // does not confuse the reduce stage
+    result = db.view("test/summate2", {startkey: 4, endkey: 6});
+    T(result.rows[0].value == 15);
+
+    for(i = 1; i < (numDocs / 2); i += 30) {
+      result = db.view("test/summate", {startkey: i, endkey: (numDocs - i)});
+      T(result.rows[0].value == summate(numDocs - i) - summate(i - 1));
+    }
+
+    T(db.deleteDoc(designDoc).ok);
+    T(db.open(designDoc._id) == null);
+    T(db.view("test/no_docs") == null);
+
+    T(db.ensureFullCommit().ok);
+    restartServer();
+    T(db.open(designDoc._id) == null);
+    T(db.view("test/no_docs") == null);
+
+    // trigger ddoc cleanup
+    T(db.viewCleanup().ok);
+  }; // enf of testFun
+
+  run_on_modified_server(server_config, testFun);
+
+  // COUCHDB-1227 - if a design document is deleted, by adding a "_deleted"
+  // field with the boolean value true, its validate_doc_update functions
+  // should no longer have effect.
+  db.deleteDb();
+  db.createDb();
+  var ddoc = {
+    _id: "_design/test",
+    language: "javascript",
+    validate_doc_update: (function(newDoc, oldDoc, userCtx, secObj) {
+       if (newDoc.value % 2 == 0) {
+          throw({forbidden: "dont like even numbers"});
+       }
+       return true;
+    }).toString()
+  };
+
+  TEquals(true, db.save(ddoc).ok);
+  try {
+    db.save({_id: "doc1", value: 4});
+    T(false, "doc insertion should have failed");
+  } catch (x) {
+    TEquals("forbidden", x.error);
+  }
+
+  var doc = db.open("doc1");
+  TEquals(null, doc);
+  ddoc._deleted = true;
+  TEquals(true, db.save(ddoc).ok);
+
+  try {
+    TEquals(true, db.save({_id: "doc1", value: 4}).ok);
+  } catch (x) {
+    T(false, "doc insertion should have succeeded");
+  }
+
+  doc = db.open("doc1");
+  TEquals(true, doc !== null, "doc was not persisted");
+  TEquals(4, doc.value);
+
+  // cleanup
+  db.deleteDb();
+  db2.deleteDb();
+};

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/test/design_options.js
----------------------------------------------------------------------
diff --git a/share/test/design_options.js b/share/test/design_options.js
new file mode 100644
index 0000000..05764e2
--- /dev/null
+++ b/share/test/design_options.js
@@ -0,0 +1,74 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+
+couchTests.design_options = function(debug) {
+  var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"});
+  db.deleteDb();
+  db.createDb();
+  if (debug) debugger;
+
+  //// test the includes_design option
+  var map = "function (doc) {emit(null, doc._id);}";
+  var withseq = "function(doc) {emit(doc._local_seq, null)}"
+
+  // we need a design doc even to test temp views with it
+  var designDoc = {
+    _id:"_design/fu",
+    language: "javascript",
+    options: {
+      include_design: true,
+      local_seq: true
+    },
+    views: {
+      data: {"map": map},
+      with_seq : {"map" : withseq}
+    }
+  };
+  T(db.save(designDoc).ok);
+
+  // should work for temp views
+  var rows = db.query(map, null, {options:{include_design: true}}).rows;
+  T(rows.length == 1);
+  T(rows[0].value == "_design/fu");
+
+  rows = db.query(map).rows;
+  T(rows.length == 0);
+
+  // when true, should include design docs in views
+  rows = db.view("fu/data").rows;
+  T(rows.length == 1);
+  T(rows[0].value == "_design/fu");
+
+  // when false, should not
+  designDoc.options.include_design = false;
+  delete designDoc._rev;
+  designDoc._id = "_design/bingo";
+  T(db.save(designDoc).ok);
+  rows = db.view("bingo/data").rows;
+  T(rows.length == 0);
+
+  // should default to false
+  delete designDoc.options;
+  delete designDoc._rev;
+  designDoc._id = "_design/bango";
+  T(db.save(designDoc).ok);
+  rows = db.view("bango/data").rows;
+  T(rows.length == 0);
+
+  // should also have local_seq in the view
+  var resp = db.save({});
+  rows = db.view("fu/with_seq").rows;
+  T(rows[0].key == 1)
+  T(rows[1].key == 2)
+  var doc = db.open(resp.id);
+  db.deleteDoc(doc);
+};

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/test/design_paths.js
----------------------------------------------------------------------
diff --git a/share/test/design_paths.js b/share/test/design_paths.js
new file mode 100644
index 0000000..426a252
--- /dev/null
+++ b/share/test/design_paths.js
@@ -0,0 +1,72 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+
+couchTests.design_paths = function(debug) {
+  if (debug) debugger;
+  var dbNames = ["test_suite_db", "test_suite_db/with_slashes"];
+  for (var i=0; i < dbNames.length; i++) {
+    var db = new CouchDB(dbNames[i]);
+    var dbName = encodeURIComponent(dbNames[i]);
+    db.deleteDb();
+    db.createDb();
+
+    // create a ddoc w bulk_docs
+    db.bulkSave([{
+      _id : "_design/test",
+      views : {
+        "testing" : {
+          "map" : "function(){emit(1,1)}"
+        }
+      }
+    }]);
+
+    // ddoc is getable
+    var xhr = CouchDB.request("GET", "/"+dbName+"/_design/test");
+    var resp = JSON.parse(xhr.responseText);
+    T(resp._id == "_design/test");
+
+    // it's at 2 urls...
+    var xhr = CouchDB.request("GET", "/"+dbName+"/_design%2Ftest");
+    var resp = JSON.parse(xhr.responseText);
+    T(resp._id == "_design/test");
+
+    // ensure that views are addressable
+    resp = db.view("test/testing")
+    T(resp.total_rows == 0)
+
+    // create a ddoc by putting to url with raw slash
+    var xhr = CouchDB.request("PUT", "/"+dbName+"/_design/test2",{
+      body : JSON.stringify({
+        _id : "_design/test2",
+        views : {
+          "testing" : {
+            "map" : "function(){emit(1,1)}"
+          }
+        }
+      })
+    });
+
+    // ddoc is getable
+    var xhr = CouchDB.request("GET", "/"+dbName+"/_design/test2");
+    var resp = JSON.parse(xhr.responseText);
+    T(resp._id == "_design/test2");
+
+    // it's at 2 urls...
+    var xhr = CouchDB.request("GET", "/"+dbName+"/_design%2Ftest2");
+    var resp = JSON.parse(xhr.responseText);
+    T(resp._id == "_design/test2");
+
+    // ensure that views are addressable
+    resp = db.view("test2/testing");
+    T(resp.total_rows == 0);
+  };
+};

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/test/erlang_views.js
----------------------------------------------------------------------
diff --git a/share/test/erlang_views.js b/share/test/erlang_views.js
new file mode 100644
index 0000000..c6bc5d7
--- /dev/null
+++ b/share/test/erlang_views.js
@@ -0,0 +1,136 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+
+couchTests.erlang_views = function(debug) {
+  var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"});
+  db.deleteDb();
+  db.createDb();
+  if (debug) debugger;
+
+
+
+  run_on_modified_server(
+    [{section: "native_query_servers",
+      key: "erlang",
+      value: "{couch_native_process, start_link, []}"}],
+    function() {
+      // Note we just do some basic 'smoke tests' here - the
+      // test/query_server_spec.rb tests have more comprehensive tests
+      var doc = {_id: "1", integer: 1, string: "str1", array: [1, 2, 3]};
+      T(db.save(doc).ok);
+
+      var mfun = 'fun({Doc}) -> ' +
+                 ' K = couch_util:get_value(<<"integer">>, Doc, null), ' +
+                 ' V = couch_util:get_value(<<"string">>, Doc, null), ' +
+                 ' Emit(K, V) ' +
+                 'end.';
+
+      // emitting a key value that is undefined should result in that row not
+      // being included in the view results
+      var results = db.query(mfun, null, null, null, "erlang");
+      T(results.total_rows == 1);
+      T(results.rows[0].key == 1);
+      T(results.rows[0].value == "str1");
+      
+      // check simple reduction - another doc with same key.
+      var doc = {_id: "2", integer: 1, string: "str2"};
+      T(db.save(doc).ok);
+      rfun = 'fun' +
+              ' (_, Values, false) -> length(Values); ' +
+              ' (_, Values, true) -> lists:sum(Values) ' +
+              ' end.';
+      results = db.query(mfun, rfun, null, null, "erlang");
+      T(results.rows[0].value == 2);
+
+      // simple 'list' tests
+      var designDoc = {
+        _id:"_design/erlview",
+        language: "erlang",
+        shows: {
+          simple:
+            'fun(Doc, {Req}) -> ' +
+            '  {Info} = couch_util:get_value(<<"info">>, Req, {[]}), ' +
+            '  Purged = couch_util:get_value(<<"purge_seq">>, Info, -1), ' +
+            '  Verb = couch_util:get_value(<<"method">>, Req, <<"not_get">>), ' +
+            '  R = list_to_binary(io_lib:format("~b - ~s", [Purged, Verb])), ' +
+            '  {[{<<"code">>, 200}, {<<"headers">>, {[]}}, {<<"body">>, R}]} ' +
+            'end.'
+        },
+        lists: {
+          simple_list :
+            'fun(Head, {Req}) -> ' +
+            '  Send(<<"head">>), ' +
+            '  Fun = fun({Row}, _) -> ' +
+            '    Val = couch_util:get_value(<<"value">>, Row, -1), ' +
+            '    Send(list_to_binary(integer_to_list(Val))), ' +
+            '    {ok, nil} ' +
+            '  end, ' +
+            '  {ok, _} = FoldRows(Fun, nil), ' +
+            '  <<"tail">> ' +
+            'end. '
+        },
+        views: {
+          simple_view : {
+            map: mfun,
+            reduce: rfun
+          }
+        }
+      };
+      T(db.save(designDoc).ok);
+
+      var url = "/test_suite_db/_design/erlview/_show/simple/1";
+      var xhr = CouchDB.request("GET", url);
+      T(xhr.status == 200, "standard get should be 200");
+      T(xhr.responseText == "0 - GET");
+
+      var url = "/test_suite_db/_design/erlview/_list/simple_list/simple_view";
+      var xhr = CouchDB.request("GET", url);
+      T(xhr.status == 200, "standard get should be 200");
+      T(xhr.responseText == "head2tail");
+
+      // Larger dataset
+
+      db.deleteDb();
+      db.createDb();
+      var words = "foo bar abc def baz xxyz".split(/\s+/);
+      
+      var docs = [];
+      for(var i = 0; i < 250; i++) {
+        var body = [];
+        for(var j = 0; j < 100; j++) {
+          body.push({
+            word: words[j%words.length],
+            count: j
+          });
+        }
+        docs.push({
+          "_id": "test-" + i,
+          "words": body
+        });
+      }
+      T(db.bulkSave(docs).length, 250, "Saved big doc set.");
+      
+      var mfun = 'fun({Doc}) -> ' +
+        'Words = couch_util:get_value(<<"words">>, Doc), ' +
+        'lists:foreach(fun({Word}) -> ' +
+            'WordString = couch_util:get_value(<<"word">>, Word), ' + 
+            'Count = couch_util:get_value(<<"count">>, Word), ' + 
+            'Emit(WordString , Count) ' +
+          'end, Words) ' +
+        'end.';
+      
+      var rfun = 'fun(Keys, Values, RR) -> length(Values) end.';
+      var results = db.query(mfun, rfun, null, null, "erlang");
+      T(results.rows[0].key === null, "Returned a reduced value.");
+      T(results.rows[0].value > 0, "Reduce value exists.");
+    });
+};


[36/37] couchdb commit: updated refs/heads/goodbye-futon to 4fa015a

Posted by ja...@apache.org.
goodbye Futon, old friend <3


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/cca309f3
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/cca309f3
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/cca309f3

Branch: refs/heads/goodbye-futon
Commit: cca309f39232238ec87b73b3a61f1ba0374b3db9
Parents: 3ba4fc0
Author: Jan Lehnardt <ja...@apache.org>
Authored: Fri Oct 10 20:46:33 2014 +0200
Committer: Jan Lehnardt <ja...@apache.org>
Committed: Fri Oct 10 20:46:33 2014 +0200

----------------------------------------------------------------------
 share/www/_sidebar.html                         |    67 -
 share/www/config.html                           |   135 -
 share/www/couch_tests.html                      |    98 -
 share/www/custom_test.html                      |   112 -
 share/www/database.html                         |   270 -
 share/www/dialog/_admin_party.html              |    33 -
 share/www/dialog/_change_password.html          |    31 -
 share/www/dialog/_compact_cleanup.html          |    51 -
 share/www/dialog/_create_admin.html             |    50 -
 share/www/dialog/_create_config.html            |    42 -
 share/www/dialog/_create_database.html          |    33 -
 share/www/dialog/_database_security.html        |    50 -
 share/www/dialog/_delete_database.html          |    29 -
 share/www/dialog/_delete_document.html          |    26 -
 share/www/dialog/_login.html                    |    34 -
 share/www/dialog/_save_view_as.html             |    35 -
 share/www/dialog/_share_test_reports.html       |    42 -
 share/www/dialog/_signup.html                   |    35 -
 share/www/dialog/_upload_attachment.html        |    36 -
 share/www/document.html                         |   114 -
 share/www/fauxton/css/index.css                 |    37 -
 share/www/fauxton/img/FontAwesome.otf           |   Bin 61896 -> 0 bytes
 share/www/fauxton/img/couchdb-site.png          |   Bin 4946 -> 0 bytes
 share/www/fauxton/img/couchdblogo.png           |   Bin 2738 -> 0 bytes
 share/www/fauxton/img/fontawesome-webfont.eot   |   Bin 37405 -> 0 bytes
 share/www/fauxton/img/fontawesome-webfont.svg   |   399 -
 share/www/fauxton/img/fontawesome-webfont.ttf   |   Bin 79076 -> 0 bytes
 share/www/fauxton/img/fontawesome-webfont.woff  |   Bin 43572 -> 0 bytes
 share/www/fauxton/img/fontcustom_fauxton.eot    |   Bin 7364 -> 0 bytes
 share/www/fauxton/img/fontcustom_fauxton.svg    |   200 -
 share/www/fauxton/img/fontcustom_fauxton.ttf    |   Bin 9636 -> 0 bytes
 share/www/fauxton/img/fontcustom_fauxton.woff   |   Bin 4816 -> 0 bytes
 .../fauxton/img/glyphicons-halflings-white.png  |   Bin 8777 -> 0 bytes
 share/www/fauxton/img/glyphicons-halflings.png  |   Bin 13826 -> 0 bytes
 share/www/fauxton/img/linen.png                 |   Bin 87134 -> 0 bytes
 share/www/fauxton/img/loader.gif                |   Bin 5193 -> 0 bytes
 share/www/fauxton/img/minilogo.png              |   Bin 2927 -> 0 bytes
 share/www/fauxton/index.html                    |    45 -
 share/www/fauxton/js/ace/mode-javascript.js     |   886 --
 share/www/fauxton/js/ace/mode-json.js           |   578 -
 .../www/fauxton/js/ace/theme-crimson_editor.js  |   148 -
 share/www/fauxton/js/ace/worker-javascript.js   | 10088 -----------------
 share/www/fauxton/js/ace/worker-json.js         |  2271 ----
 share/www/fauxton/js/require.js                 |    35 -
 share/www/favicon.ico                           |   Bin 1406 -> 0 bytes
 share/www/image/add.png                         |   Bin 709 -> 0 bytes
 share/www/image/apply.gif                       |   Bin 652 -> 0 bytes
 share/www/image/bg.png                          |   Bin 372 -> 0 bytes
 share/www/image/cancel.gif                      |   Bin 659 -> 0 bytes
 share/www/image/compact.png                     |   Bin 28735 -> 0 bytes
 share/www/image/delete-mini.png                 |   Bin 418 -> 0 bytes
 share/www/image/delete.png                      |   Bin 718 -> 0 bytes
 share/www/image/grippie.gif                     |   Bin 75 -> 0 bytes
 share/www/image/hgrad.gif                       |   Bin 118 -> 0 bytes
 share/www/image/key.png                         |   Bin 859 -> 0 bytes
 share/www/image/load.png                        |   Bin 780 -> 0 bytes
 share/www/image/logo.png                        |   Bin 3010 -> 0 bytes
 share/www/image/order-asc.gif                   |   Bin 195 -> 0 bytes
 share/www/image/order-desc.gif                  |   Bin 187 -> 0 bytes
 share/www/image/path.gif                        |   Bin 104 -> 0 bytes
 share/www/image/progress.gif                    |   Bin 10819 -> 0 bytes
 share/www/image/rarrow.png                      |   Bin 27721 -> 0 bytes
 share/www/image/run-mini.png                    |   Bin 478 -> 0 bytes
 share/www/image/run.png                         |   Bin 718 -> 0 bytes
 share/www/image/running.png                     |   Bin 284 -> 0 bytes
 share/www/image/save.png                        |   Bin 843 -> 0 bytes
 share/www/image/sidebar-toggle.png              |   Bin 512 -> 0 bytes
 share/www/image/spinner.gif                     |   Bin 3008 -> 0 bytes
 share/www/image/spinner_33.gif                  |   Bin 2987 -> 0 bytes
 share/www/image/spinner_6b.gif                  |   Bin 2969 -> 0 bytes
 share/www/image/test_failure.gif                |   Bin 114 -> 0 bytes
 share/www/image/test_success.gif                |   Bin 185 -> 0 bytes
 share/www/image/thead-key.gif                   |   Bin 77 -> 0 bytes
 share/www/image/thead.gif                       |   Bin 51 -> 0 bytes
 share/www/image/toggle-collapse.gif             |   Bin 176 -> 0 bytes
 share/www/image/toggle-expand.gif               |   Bin 181 -> 0 bytes
 share/www/image/twisty.gif                      |   Bin 160 -> 0 bytes
 share/www/index.html                            |    94 -
 share/www/plugins.html                          |   121 -
 share/www/replicator.html                       |   184 -
 share/www/script/base64.js                      |   124 -
 share/www/script/couch.js                       |   520 -
 share/www/script/couch_test_runner.js           |   465 -
 share/www/script/couch_tests.js                 |   114 -
 share/www/script/futon.browse.js                |  1344 ---
 share/www/script/futon.format.js                |   146 -
 share/www/script/futon.js                       |   597 -
 share/www/script/jquery-ui-1.8.11.custom.min.js |    81 -
 share/www/script/jquery.couch.js                |  1079 --
 share/www/script/jquery.dialog.js               |    96 -
 share/www/script/jquery.editinline.js           |   114 -
 share/www/script/jquery.form.js                 |   803 --
 share/www/script/jquery.js                      |  9472 ----------------
 share/www/script/jquery.resizer.js              |    84 -
 share/www/script/jquery.suggest.js              |   161 -
 share/www/script/json2.js                       |   482 -
 share/www/script/jspec/jspec.css                |   149 -
 share/www/script/jspec/jspec.jquery.js          |    72 -
 share/www/script/jspec/jspec.js                 |  1756 ---
 share/www/script/jspec/jspec.xhr.js             |   195 -
 share/www/script/oauth.js                       |   511 -
 share/www/script/replicator_db_inc.js           |    96 -
 share/www/script/sha1.js                        |   202 -
 share/www/session.html                          |    96 -
 share/www/spec/couch_js_class_methods_spec.js   |   401 -
 .../spec/couch_js_instance_methods_1_spec.js    |   311 -
 .../spec/couch_js_instance_methods_2_spec.js    |   246 -
 .../spec/couch_js_instance_methods_3_spec.js    |   215 -
 share/www/spec/custom_helpers.js                |    51 -
 .../spec/jquery_couch_js_class_methods_spec.js  |   523 -
 .../jquery_couch_js_instance_methods_1_spec.js  |   202 -
 .../jquery_couch_js_instance_methods_2_spec.js  |   433 -
 .../jquery_couch_js_instance_methods_3_spec.js  |   540 -
 share/www/spec/run.html                         |    47 -
 share/www/status.html                           |   152 -
 share/www/style/jquery-ui-1.8.11.custom.css     |   347 -
 share/www/style/layout.css                      |   626 -
 share/www/verify_install.html                   |   119 -
 118 files changed, 39381 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/cca309f3/share/www/_sidebar.html
----------------------------------------------------------------------
diff --git a/share/www/_sidebar.html b/share/www/_sidebar.html
deleted file mode 100644
index 7ef3513..0000000
--- a/share/www/_sidebar.html
+++ /dev/null
@@ -1,67 +0,0 @@
-<!--
-
-Licensed under the Apache License, Version 2.0 (the "License"); you may not use
-this file except in compliance with the License. You may obtain a copy of the
-License at
-
-   http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software distributed
-under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
-CONDITIONS OF ANY KIND, either express or implied. See the License for the
-specific language governing permissions and limitations under the License.
-
--->
-<div id="sidebar">
-  <a id="sidebar-toggle" href="#" title="Hide Sidebar"></a>
-  <a href="index.html">
-    <img id="logo" src="image/logo.png" width="175" height="150" alt="Apache CouchDB: Relax">
-  </a>
-  <ul id="nav">
-    <li><span>Tools</span><ul>
-      <li><a href="index.html">Overview</a></li>
-      <li><a href="config.html">Configuration</a></li>
-      <li><a href="replicator.html">Replicator</a></li>
-      <li><a href="status.html">Status</a></li>
-      <!-- <li><a href="plugins.html">Plugins</a></li> -->
-    </ul></li>
-    <li><span>Documentation</span><ul>
-      <li><a href="docs/">Manual</a></li>
-    </ul></li>
-    <li><span>Diagnostics</span><ul>
-      <li><a href="verify_install.html">Verify Installation</a></li>
-      <!-- These tests are run during installation, so this link is disabled by default. -->
-      <!-- <li><a href="couch_tests.html?script/couch_tests.js">Test Suite</a></li> -->
-    </ul></li>
-    <li><span>Recent Databases</span>
-      <ul id="dbs"></ul>
-    </li>
-  </ul>
-  <div id="footer">
-    <span id="userCtx">
-      <span class="loggedout">
-        <a href="#" class="signup">Signup</a> or <a href="#" class="login">Login</a>
-      </span>
-      <span class="loggedin">
-        Welcome <a class="name">?</a>!
-        <br/>
-        <span class="loggedinadmin">
-          <a href="#" class="createadmin">Setup more admins</a> or
-          <br/>
-        </span>
-        <a href="#" class="changepass">Change password</a> or
-        <a href="#" class="logout">Logout</a>
-      </span>
-      <span class="adminparty">
-        Welcome to Admin Party!
-        <br/>
-        Everyone is admin. <a href="#" class="createadmin">Fix this</a>
-      </span>
-    </span>
-    <hr/>
-    <span class="couch">
-      Futon on <a href="http://couchdb.apache.org/">Apache CouchDB</a>
-      <span id="version">?</span>
-    </span>
-  </div>
-</div>

http://git-wip-us.apache.org/repos/asf/couchdb/blob/cca309f3/share/www/config.html
----------------------------------------------------------------------
diff --git a/share/www/config.html b/share/www/config.html
deleted file mode 100644
index cfb1a5b..0000000
--- a/share/www/config.html
+++ /dev/null
@@ -1,135 +0,0 @@
-<!DOCTYPE html>
-<!--
-
-Licensed under the Apache License, Version 2.0 (the "License"); you may not use
-this file except in compliance with the License. You may obtain a copy of the
-License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software distributed
-under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
-CONDITIONS OF ANY KIND, either express or implied. See the License for the
-specific language governing permissions and limitations under the License.
-
--->
-<html lang="en">
-  <head>
-    <title>Configuration</title>
-    <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
-    <link rel="stylesheet" href="style/layout.css?0.11.0" type="text/css">
-    <script src="script/json2.js"></script>
-    <script src="script/sha1.js"></script>
-    <script src="script/jquery.js"></script>
-    <script src="script/jquery.couch.js"></script>
-    <script src="script/jquery.dialog.js"></script>
-    <script src="script/futon.js"></script>
-    <script src="script/jquery.editinline.js"></script>
-    <script>
-      $(function() {
-        $.couch.config({
-          success: function(resp) {
-            var sections = [];
-            for (var sectionName in resp) {
-              sections.push(sectionName);
-            }
-            sections.sort();
-            $.each(sections, function(idx, sectionName) {
-              var row = $("<tr><th></th></tr>")
-                .find("th").text(sectionName).end()
-                .appendTo("#config tbody.content");
-              var section = resp[sectionName]
-              var options = [];
-              for (var option in section) {
-                options.push(option);
-              }
-              options = options.sort();
-              var prev = null;
-              $.each(options, function(idx, optionName) {
-                var cur = idx == 0 ? row : $("<tr></tr>");
-                $("<td class='name' section="+sectionName+"><b></b></td>")
-                  .find("b").text(optionName).end().appendTo(cur);
-                $("<td class='value'><code></code></td>")
-                  .find("code").text(section[optionName]).end().appendTo(cur);
-                cur.data("section", sectionName).data("option", optionName);
-                if (cur !== row) cur.insertAfter(prev);
-                prev = cur;
-              });
-              row.find("th").attr("rowspan", options.length);
-            });
-            $("#config tbody tr").removeClass("odd").filter(":odd").addClass("odd");
-            $("#config tbody td.value code").makeEditable({
-              accept: function(newValue) {
-                var row = $(this).parents("tr").eq(0);
-                $.couch.config({
-                  success: function(resp) {
-                    row.find("td.value code").text(newValue);
-                }}, row.data("section"), row.data("option"), newValue);
-              }
-            }).parent().parent()
-              .append($('<td><div style="text-align:center;""><a class="remove" href="#remove">x</a></div></td>'))
-              .click(function (ev) {
-                // There is a listener that stops all events below this element which is
-                // why the remove link listener has to be here
-                var n = $(ev.target).parent().parent().parent();
-                if ($(ev.target).attr('href') === "#remove" ) {
-                  $.couch.config({ success: function () {location = location.href.split('#')[0];} }
-                                 , n.find('td.name').attr("section"), n.find('td.name').text(), null);
-                }
-            })
-            var add = $('<a href="#add">Add a new section</a>').click(function () {
-              $.showDialog("dialog/_create_config.html", {
-                submit: function(data, callback) {
-                  var fail = false;
-                  if (!data.section || data.section.length == 0) {
-                    callback({section: "Please enter a section."});
-                    fail = true;
-                  }
-                  if (!data.option || data.option.length == 0) {
-                    callback({option: "Please enter a option."});
-                    fail = true;
-                  }
-                  if (!data.val || data.val.length == 0) {
-                    callback({val: "Please enter a value."});
-                    fail = true;
-                  }
-                  if (fail) {return}
-                  $.couch.config({ success: function () {callback();location = location.href.split('#')[0]} }
-                                 , data.section, data.option, data.val);
-                }
-              });
-            })
-            $("div#content").append(add)
-          }
-        });
-
-      });
-    </script>
-  </head>
-  <body><div id="wrap">
-    <h1>
-      <a href="index.html">Overview</a>
-      <strong>Configuration</strong>
-    </h1>
-    <div id="content">
-      <p class="help">
-        <strong>Note:</strong> Some configuration options may require
-        restarting the server to take effect after modification.
-      </p>
-      <p class="help">
-       For the strongest consistency guarantees, <tt>delayed_commits</tt> should be set to <tt>false</tt>. The default value of <tt>true</tt> is designed for single-user performance. For more details see <a href="http://wiki.apache.org/couchdb/Durability_Matrix">a discussion of durability on the CouchDB wiki</a>.
-      </p>
-      <table id="config" class="listing" cellspacing="0">
-        <caption>Configuration</caption>
-        <thead><tr>
-          <th>Section</th>
-          <th>Option</th>
-          <th>Value</th>
-          <th>Delete</th>
-        </tr></thead>
-        <tbody class="content"></tbody>
-      </table>
-
-    </div>
-  </div></body>
-</html>

http://git-wip-us.apache.org/repos/asf/couchdb/blob/cca309f3/share/www/couch_tests.html
----------------------------------------------------------------------
diff --git a/share/www/couch_tests.html b/share/www/couch_tests.html
deleted file mode 100644
index 8f47ce3..0000000
--- a/share/www/couch_tests.html
+++ /dev/null
@@ -1,98 +0,0 @@
-<!DOCTYPE html>
-<!--
-
-Licensed under the Apache License, Version 2.0 (the "License"); you may not use
-this file except in compliance with the License. You may obtain a copy of the
-License at
-
-   http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software distributed
-under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
-CONDITIONS OF ANY KIND, either express or implied. See the License for the
-specific language governing permissions and limitations under the License.
-
--->
-<html lang="en">
-  <head>
-    <title>Test Suite</title>
-    <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
-    <link rel="stylesheet" href="style/layout.css?0.11.0" type="text/css">
-    <script src="script/json2.js"></script>
-    <script src="script/sha1.js"></script>
-    <script src="script/jquery.js"></script>
-    <script src="script/jquery.couch.js"></script>
-    <script src="script/jquery.dialog.js"></script>
-    <script src="script/futon.js"></script>
-    <script src="script/couch.js"></script>
-    <script src="script/couch_test_runner.js"></script>
-    <script>
-      $(function() {
-        updateTestsListing();
-        $("#toolbar button.run").click(function() {
-          setupAdminParty(runAllTests) ;
-        });
-        $("#toolbar button.load").click(function() {
-          location.reload(true);
-        });
-        $("#toolbar button.share").click(function() {
-          $.showDialog("dialog/_share_test_reports.html", {
-            submit: function(data, callback) {
-              $.couch.replicate("test_suite_reports", "http://couchdb.couchdb.org/test_suite_reports");
-              callback();
-            }
-          });
-        });
-        $("#toolbar button.add").click(function() {
-          location = "custom_test.html";
-        });
-      });
-      var testsPath = document.location.toString().split('?')[1];
-      loadScript(testsPath||"script/couch_tests.js");
-    </script>
-  </head>
-  <body><div id="wrap">
-    <h1>
-      <a href="index.html">Overview</a>
-      <strong>Test Suite</strong>
-    </h1>
-    <div id="content">
-      <ul id="toolbar">
-        <li><button class="run">Run All</button></li>
-        <li><button class="load">Reload</button></li>
-        <li><button class="share">Share Test Reports</button></li>
-        <li><button class="add">Custom Test</button></li>
-        <li class="current"></li>
-      </ul>
-      <p class="help">
-        <strong>Note:</strong> Each of the tests will block the browser. If the
-        connection to your CouchDB server is slow, running the tests will take
-        some time, and you'll not be able to do much with your browser while
-        a test is being executed. <strong>Also:</strong> The test suite is designed
-        to work with Firefox (with Firebug disabled). Patches are welcome for 
-        convenience compatibility with other browsers, but official support is
-        for Firefox (latest stable version) only.
-      </p>
-
-      <table class="listing" id="tests" cellspacing="0">
-        <caption>Tests</caption>
-        <thead>
-          <tr>
-            <th class="name">Name</th>
-            <th class="status">Status</th>
-            <th class="duration">Elapsed Time</th>
-            <th class="details">Details</th>
-          </tr>
-        </thead>
-        <tbody class="content">
-        </tbody>
-        <tbody class="footer">
-          <tr>
-            <td colspan="4"></td>
-          </tr>
-        </tbody>
-      </table>
-
-    </div>
-  </div></body>
-</html>

http://git-wip-us.apache.org/repos/asf/couchdb/blob/cca309f3/share/www/custom_test.html
----------------------------------------------------------------------
diff --git a/share/www/custom_test.html b/share/www/custom_test.html
deleted file mode 100644
index 155b185..0000000
--- a/share/www/custom_test.html
+++ /dev/null
@@ -1,112 +0,0 @@
-<!DOCTYPE html>
-<!--
-
-Licensed under the Apache License, Version 2.0 (the "License"); you may not use
-this file except in compliance with the License. You may obtain a copy of the
-License at
-
-   http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software distributed
-under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
-CONDITIONS OF ANY KIND, either express or implied. See the License for the
-specific language governing permissions and limitations under the License.
-
--->
-<html lang="en">
-  <head>
-    <title>Custom Test</title>
-    <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
-    <link rel="stylesheet" href="style/layout.css?0.11.0" type="text/css">
-    <script src="script/json2.js"></script>
-    <script src="script/sha1.js"></script>
-    <script src="script/jquery.js"></script>
-    <script src="script/jquery.couch.js"></script>
-    <script src="script/jquery.dialog.js"></script>
-    <script src="script/futon.js"></script>
-    <script src="script/jquery.resizer.js"></script>
-    <script src="script/couch.js"></script>
-    <script src="script/couch_test_runner.js"></script>
-    <script src="script/couch_tests.js"></script>
-    <script>
-      function T(arg, desc) {
-        if(!arg) {
-          mesg = "Assertion failed" + (desc ? ": " + desc : "");
-          throw new Error(mesg);
-        }
-      }
-
-      function TEquals(expect, found, descr) {
-        var mesg = "expected '" + expect + "', got '" + found + "' " + descr;
-        T(expect === found, mesg);
-      }
-
-      $.futon.navigation.ready(function() {
-        this.updateSelection(
-          location.pathname.replace(/custom_test\.html/, "couch_tests.html"),
-            "?script/couch_tests.js");
-      });
-
-      $(function() {
-        $("#status").removeClass("failure").removeClass("success");
-        $("#viewcode textarea").enableTabInsertion().makeResizable({
-          always: true,
-          grippie: $("#viewcode .bottom"),
-          vertical: true
-        });
-        $("#viewcode button.run").click(function() {
-          $("#status").removeClass("failure").removeClass("success");
-          var code = $("#code").val();
-          try {
-            var couchTests = {};
-            var debug = false;
-            code = eval(code);
-            $.each(couchTests, function(elm) {
-              couchTests[elm](debug);
-            });
-          } catch(e) {
-            alert("" + e);
-            $("#status").text("failure").addClass("failure");
-            return false;
-          }
-          $("#status").text("success").addClass("success");
-          return false;
-        });
-      });
-    </script>
-  </head>
-  <body><div id="wrap">
-    <h1>
-      <a href="index.html">Overview</a>
-      <a class="dbname" href="couch_tests.html">Test Suite</a>
-      <strong>Custom Test</strong>
-    </h1>
-
-    <div id="content">
-      <div id="viewcode">
-        <div class="top">
-          <span>Test Function</span>
-        </div>
-        <table summary="Custom Test Function" cellspacing="0"><tr>
-          <td class="code">
-            <textarea name="code" id="code" rows="18" cols="120">
-couchTests.custom_test = function(debug) {
-  var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"});
-  db.deleteDb();
-  db.createDb();
-
-  if (debug) debugger;
-
-  alert("You can start writing your test now.");
-};
-</textarea>
-          </td>
-        </tr></table>
-        <div class="bottom">
-          <button class="run" type="button">Run</button>
-          <span id="status">&nbsp;&nbsp;</span>
-        </div>
-      </div>
-    </div>
-  </div></body>
-</html>

http://git-wip-us.apache.org/repos/asf/couchdb/blob/cca309f3/share/www/database.html
----------------------------------------------------------------------
diff --git a/share/www/database.html b/share/www/database.html
deleted file mode 100644
index c64f749..0000000
--- a/share/www/database.html
+++ /dev/null
@@ -1,270 +0,0 @@
-<!DOCTYPE html>
-<!--
-
-Licensed under the Apache License, Version 2.0 (the "License"); you may not use
-this file except in compliance with the License. You may obtain a copy of the
-License at
-
-   http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software distributed
-under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
-CONDITIONS OF ANY KIND, either express or implied. See the License for the
-specific language governing permissions and limitations under the License.
-
--->
-<html lang="en">
-  <head>
-    <title>Browse Database</title>
-    <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
-    <link rel="stylesheet" href="style/layout.css" type="text/css">
-    <script src="script/json2.js"></script>
-    <script src="script/sha1.js"></script>
-    <script src="script/jquery.js"></script>
-    <script src="script/jquery.couch.js"></script>
-    <script src="script/jquery.dialog.js"></script>
-    <script src="script/futon.js"></script>
-    <script src="script/jquery.resizer.js"></script>
-    <script src="script/jquery.suggest.js"></script>
-    <script src="script/futon.browse.js"></script>
-    <script src="script/futon.format.js"></script>
-    <script>
-      var page = new $.futon.CouchDatabasePage();
-      $.futon.navigation.ready(function() {
-        this.addDatabase(page.db.name);
-        this.updateSelection(location.pathname, "?" + page.db.name);
-      });
-
-      $(function() {
-        if (page.redirecting) return;
-        $("h1 strong").text(page.db.name);
-        var viewPath = page.viewName || "_all_docs";
-        if (viewPath != "_temp_view" && viewPath != "_design_docs") {
-          viewPath = $.map(viewPath.split("/"), function (part) {
-            return encodeURIComponent(part);
-          }).join("/");
-
-          $("h1 a.raw").attr("href", "/" + encodeURIComponent(page.db.name) +
-            "/" + viewPath);
-        }
-
-        $("#viewcode span").click(function() {
-          $("#viewcode").toggleClass("collapsed");
-        });
-        $("#viewcode button.run").click(function() {
-          page.updateDocumentListing();
-        });
-        $("#viewcode button.revert").click(function() {
-          page.revertViewChanges();
-        });
-        $("#viewcode button.save").click(function() {
-          page.saveViewChanges();
-        });
-        $("#viewcode button.saveas").click(function() {
-          page.saveViewAs();
-        });
-        $("#viewcode textarea").makeResizable({
-          always: true,
-          grippie: $("#viewcode .bottom"),
-          vertical: true
-        });
-        $("#viewcode td.map").makeResizable({
-          always: true,
-          grippie: $("#viewcode td.splitter"),
-          horizontal: true
-        });
-
-        // Restore preferences/state
-        $("#documents thead th.key").toggleClass("desc", !!$.futon.storage.get("desc"));
-        var reduce = !!$.futon.storage.get("reduce");
-        $("#reduce :checkbox")[0].checked = reduce;
-        $("#grouplevel select").val(parseInt($.futon.storage.get("group_level")));
-        $("#grouplevel").toggleClass("disabled", !reduce).find("select").each(function() {
-          this.disabled = !reduce;
-        });
-
-        $("#perpage").val(parseInt($.futon.storage.get("per_page")));
-
-        var staleViews = !!$.futon.storage.get("stale");
-        $("#staleviews :checkbox")[0].checked = staleViews;
-
-        page.populateViewsMenu();
-        page.populateViewEditor();
-        if (page.isTempView) {
-          $("#viewcode").show().removeClass("collapsed").find("textarea")[0].focus();
-          $("#documents").hide();
-        }
-
-        $("#switch select").change(function() {
-          var viewName = $(this).val();
-          if (!viewName) $.futon.storage.del("view");
-          location.href = "?" + encodeURIComponent(page.db.name) +
-            (viewName ? "/" + viewName  : "");
-        });
-        $("#staleviews :checkbox").click(function() {
-          $.futon.storage.set("stale", this.checked);
-        });
-        $("#documents thead th.key span").click(function() {
-          $(this).closest("th").toggleClass("desc");
-          page.updateDocumentListing();
-        });
-        $("#grouplevel select").change(function() {
-          page.updateDocumentListing();
-          $.futon.storage.set("group_level", this.value);
-        });
-        $("#reduce :checkbox").click(function() {
-          page.updateDocumentListing();
-          var cb = this;
-          $("#grouplevel").toggleClass("disabled", !cb.checked).find("select").each(function() {
-            this.disabled = !cb.checked;
-          });
-          $.futon.storage.set("reduce", this.checked);
-        });
-        $("#perpage").change(function() {
-          page.updateDocumentListing();
-          $.futon.storage.set("per_page", this.value);
-        });
-        $("#toolbar button.add").click(page.newDocument);
-        $("#toolbar button.compact").click(page.compactAndCleanup);
-        $("#toolbar button.delete").click(page.deleteDatabase);
-        $("#toolbar button.security").click(page.databaseSecurity);
-
-        $('#jumpto input').suggest(function(text, callback) {
-          page.db.allDocs({
-            limit: 10, startkey: text, endkey: text + 'zzz',
-            success: function(docs) {
-              var matches = [];
-              for (var i = 0; i < docs.rows.length; i++) {
-                if (docs.rows[i].id.indexOf(text) == 0) {
-                  matches[i] = docs.rows[i].id;
-                }
-              }
-              callback(matches);
-            }
-          });
-        }).keypress(function(e) {
-          if (e.keyCode == 13) {
-            page.jumpToDocument($(this).val());
-          }
-        });
-      });
-    </script>
-  </head>
-
-  <body><div id="wrap">
-    <h1>
-      <a href="index.html">Overview</a>
-      <strong>?</strong>
-      <a class="raw" title="Raw view"></a>
-    </h1>
-    <div id="content">
-      <div id="staleviews">
-        <label>Stale views
-           <input name="staleviews" type="checkbox" />
-        </label>
-      </div>
-      <div id="switch">
-        <label>View: <select autocomplete="false">
-          <option value="_all_docs">All documents</option>
-          <option value="_design_docs">Design documents</option>
-          <option value="_temp_view">Temporary view…</option>
-        </select></label>
-      </div>
-      <div id="jumpto">
-        <label>Jump to:
-          <input type="text" name="docid" placeholder="Document ID" autocomplete="off" />
-        </label>
-      </div>
-      <ul id="toolbar">
-        <li><button class="add">New Document</button></li>
-        <li><button class="security userAdmin serverAdmin">Security…</button></li>
-        <li><button class="compact">Compact &amp; Cleanup…</button></li>
-        <li><button class="delete serverAdmin">Delete Database…</button></li>
-      </ul>
-
-      <div id="viewcode" class="collapsed" style="display: none">
-        <div class="top">
-          <a id="designdoc-link"></a>
-          <span id="view-toggle">View Code</span>
-        </div>
-        <table summary="View functions" cellspacing="0"><tr>
-          <td class="code map">
-            <label for="viewcode_map">Map Function:</label>
-            <textarea id="viewcode_map" class="map" rows="5" cols="20" spellcheck="false" wrap="off"></textarea>
-          </td>
-          <td class="splitter"></td>
-          <td class="code reduce">
-            <label for="viewcode_reduce">Reduce Function (optional):</label>
-            <textarea id="viewcode_reduce" class="reduce" rows="5" cols="20" spellcheck="false" wrap="off"></textarea>
-          </td>
-        </tr></table>
-        <div class="bottom">
-          <button class="save" type="button" disabled>Save</button>
-          <button class="saveas" type="button">Save As…</button>
-          <button class="revert" type="button" disabled>Revert</button>
-          <button class="run" type="button">Run</button>
-          <label>Language: <select id="language"></select></label>
-        </div>
-      </div>
-      <p id="tempwarn">
-        <strong>Warning</strong>: Please note that temporary views are not
-        suitable for use in production, as they are really slow for any
-        database with more than a few dozen documents. You can use a temporary
-        view to experiment with view functions, but switch to a permanent view
-        before using them in an application.
-      </p>
-
-      <table id="documents" class="listing" cellspacing="0">
-        <caption>Documents</caption>
-        <thead>
-          <tr>
-            <th class="key">
-              <label id="grouplevel">
-                Grouping: <select>
-                  <option value="0">none</option>
-                  <option value="1">level 1</option>
-                  <option value="2">level 2</option>
-                  <option value="3">level 3</option>
-                  <option value="4">level 4</option>
-                  <option value="5">level 5</option>
-                  <option value="6">level 6</option>
-                  <option value="7">level 7</option>
-                  <option value="8">level 8</option>
-                  <option value="9">level 9</option>
-                  <option value="100" selected>exact</option>
-                </select>
-              </label>
-              <span>Key</span>
-            </th>
-            <th class="value">
-              <label id="reduce"><input type="checkbox" autocomplete="off" checked> Reduce</label>
-              Value
-            </th>
-          </tr>
-        </thead>
-        <tbody class="content">
-        </tbody>
-        <tbody class="footer">
-          <tr>
-            <td colspan="4">
-              <div id="paging">
-                <a class="prev">← Previous Page</a> |
-                <label>Rows per page: <select id="perpage">
-                  <option selected>10</option>
-                  <option>25</option>
-                  <option>50</option>
-                  <option>100</option>
-                </select></label> |
-                <a class="next">Next Page →</a>
-              </div>
-              <span></span>
-            </td>
-          </tr>
-        </tbody>
-      </table>
-      <p id="viewrequestduration">
-        View request duration: <span class="timestamp"></span>
-      </p>
-    </div>
-  </div></body>
-</html>

http://git-wip-us.apache.org/repos/asf/couchdb/blob/cca309f3/share/www/dialog/_admin_party.html
----------------------------------------------------------------------
diff --git a/share/www/dialog/_admin_party.html b/share/www/dialog/_admin_party.html
deleted file mode 100644
index ea9fb15..0000000
--- a/share/www/dialog/_admin_party.html
+++ /dev/null
@@ -1,33 +0,0 @@
-<!--
-
-Licensed under the Apache License, Version 2.0 (the "License"); you may not use
-this file except in compliance with the License. You may obtain a copy of the
-License at
-
-   http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software distributed
-under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
-CONDITIONS OF ANY KIND, either express or implied. See the License for the
-specific language governing permissions and limitations under the License.
-
--->
-<form action="" method="post">
-  <h2>Admin Party!</h2>
-  <fieldset>
-    <p class="help">
-      The test suite requires CouchDB to be in <em>Admin Party</em> mode. This
-      mode give all users admin capabilities. This is the least secure mode of 
-      operation. Do not run the tests on production servers, as you'll impact 
-      both performance and security.
-    </p>
-    <p class="help">
-      Clicking “Remove Admins” will remove all admins from the configuration. You will
-      have to recreate any admins by hand after the tests have finished.
-    </p>
-  </fieldset>
-  <div class="buttons">
-    <button type="submit">Remove Admins</button>
-    <button type="button" class="cancel">Cancel</button>
-  </div>
-</form>

http://git-wip-us.apache.org/repos/asf/couchdb/blob/cca309f3/share/www/dialog/_change_password.html
----------------------------------------------------------------------
diff --git a/share/www/dialog/_change_password.html b/share/www/dialog/_change_password.html
deleted file mode 100644
index 40601d9..0000000
--- a/share/www/dialog/_change_password.html
+++ /dev/null
@@ -1,31 +0,0 @@
-<!--
-
-Licensed under the Apache License, Version 2.0 (the "License"); you may not use
-this file except in compliance with the License. You may obtain a copy of the
-License at
-
-   http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software distributed
-under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
-CONDITIONS OF ANY KIND, either express or implied. See the License for the
-specific language governing permissions and limitations under the License.
-
--->
-<form action="" method="post">
-  <h2>Change Password</h2>
-  <fieldset>
-    <table summary=""><tbody><tr>
-      <th><label>New Password:</label></th>
-      <td><input type="password" name="password" size="24" /></td>
-    </tr><tr>
-      <th><label>Verify New Password:</label></th>
-      <td><input type="password" name="verify_password" size="24" /></td>
-    </tr>
-    </tbody></table>
-  </fieldset>
-  <div class="buttons">
-    <button type="submit">Login</button>
-    <button type="button" class="cancel">Cancel</button>
-  </div>
-</form>

http://git-wip-us.apache.org/repos/asf/couchdb/blob/cca309f3/share/www/dialog/_compact_cleanup.html
----------------------------------------------------------------------
diff --git a/share/www/dialog/_compact_cleanup.html b/share/www/dialog/_compact_cleanup.html
deleted file mode 100644
index 506417f..0000000
--- a/share/www/dialog/_compact_cleanup.html
+++ /dev/null
@@ -1,51 +0,0 @@
-<!--
-
-Licensed under the Apache License, Version 2.0 (the "License"); you may not use
-this file except in compliance with the License. You may obtain a copy of the
-License at
-
-   http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software distributed
-under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
-CONDITIONS OF ANY KIND, either express or implied. See the License for the
-specific language governing permissions and limitations under the License.
-
--->
-<form action="" method="post">
-  <h2>Compact &amp; Cleanup</h2>
-  <fieldset class="radiogroup">
-    <label>
-      <input type="radio" name="action" value="compact_database" checked>
-      Compact Database
-    </label>
-    <p class="help">
-      Compacting a database removes deleted documents and previous revisions.
-      It is an <strong>irreversible operation</strong> and may take
-      a while to complete for large databases.
-    </p>
-    <hr>
-    <label>
-      <input type="radio" name="action" value="compact_views">
-      Compact Views
-    </label>
-    <p class="help">
-      View compaction will affect all views in this design document. This
-      operation may take some time to complete. Your views will still operate
-      normally during compaction.
-    </p>
-    <hr>
-    <label>
-      <input type="radio" name="action" value="view_cleanup">
-      Cleanup Views
-    </label>
-    <p class="help">
-      Cleaning up views in a database removes old view files still stored
-      on the filesystem. It is an <strong>irreversible operation</strong>.
-    </p>
-  </fieldset>
-  <div class="buttons">
-    <button type="submit">Run</button>
-    <button type="button" class="cancel">Cancel</button>
-  </div>
-</form>

http://git-wip-us.apache.org/repos/asf/couchdb/blob/cca309f3/share/www/dialog/_create_admin.html
----------------------------------------------------------------------
diff --git a/share/www/dialog/_create_admin.html b/share/www/dialog/_create_admin.html
deleted file mode 100644
index d4aec95..0000000
--- a/share/www/dialog/_create_admin.html
+++ /dev/null
@@ -1,50 +0,0 @@
-<!--
-
-Licensed under the Apache License, Version 2.0 (the "License"); you may not use
-this file except in compliance with the License. You may obtain a copy of the
-License at
-
-   http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software distributed
-under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
-CONDITIONS OF ANY KIND, either express or implied. See the License for the
-specific language governing permissions and limitations under the License.
-
--->
-<form action="" method="post">
-  <h2>Create Server Admin</h2>
-  <fieldset>
-    <p class="help">
-      Before a server admin is configured, all clients have admin privileges.
-      This is fine when HTTP access is restricted 
-      to trusted users. <strong>If end-users will be accessing this CouchDB, you must
-      create an admin account to prevent accidental (or malicious) data loss.</strong>
-    </p>
-    <p class="help">Server admins can create and destroy databases, install 
-      and update _design documents, run the test suite, and edit all aspects of CouchDB 
-      configuration.
-    </p>
-    <table summary=""><tbody><tr>
-      <th><label>Username:</label></th>
-      <td><input type="text" name="name" size="24"></td>
-    </tr><tr>
-      <th><label>Password:</label></th>
-      <td><input type="password" name="password" size="24"></td>
-    </tr>
-    </tbody></table>
-    <p class="help">Non-admin users have read and write access to all databases, which
-      are controlled by validation functions. CouchDB can be configured to block all
-      access to anonymous users.
-    </p>
-    <h3>About Authentication</h3>     
-    <p class="help">
-      Couch has a pluggable authentication mechanism. Futon exposes a user friendly cookie-auth which handles login and logout, so app developers can relax. Just use <tt>$.couch.session()</tt> to load the current user's info.
-    </p>
-
-  </fieldset>
-  <div class="buttons">
-    <button type="submit">Create</button>
-    <button type="button" class="cancel">Cancel</button>
-  </div>
-</form>

http://git-wip-us.apache.org/repos/asf/couchdb/blob/cca309f3/share/www/dialog/_create_config.html
----------------------------------------------------------------------
diff --git a/share/www/dialog/_create_config.html b/share/www/dialog/_create_config.html
deleted file mode 100644
index 79e08b0..0000000
--- a/share/www/dialog/_create_config.html
+++ /dev/null
@@ -1,42 +0,0 @@
-<!--
-
-Licensed under the Apache License, Version 2.0 (the "License"); you may not use
-this file except in compliance with the License. You may obtain a copy of the
-License at
-
-   http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software distributed
-under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
-CONDITIONS OF ANY KIND, either express or implied. See the License for the
-specific language governing permissions and limitations under the License.
-
--->
-<form action="" method="post">
-  <h2>Create New Config Option</h2>
-  <fieldset>
-    <p class="help">
-      Please enter the section, option, and value.
-    </p>
-    <table summary="">
-      <tbody>
-        <tr>
-          <th><label>section:</label></th>
-          <td><input type="text" name="section" size="24"></td>
-        </tr>
-        <tr>  
-          <th><label>option:</label></th>
-          <td><input type="text" name="option" size="24"></td>
-        </tr>
-        <tr>
-            <th><label>value:</label></th>
-            <td><input type="text" name="val" size="24"></td>
-        </tr>
-      </tbody>
-    </table>
-  </fieldset>
-  <div class="buttons">
-    <button type="submit">Create</button>
-    <button type="button" class="cancel">Cancel</button>
-  </div>
-</form>

http://git-wip-us.apache.org/repos/asf/couchdb/blob/cca309f3/share/www/dialog/_create_database.html
----------------------------------------------------------------------
diff --git a/share/www/dialog/_create_database.html b/share/www/dialog/_create_database.html
deleted file mode 100644
index 74e7ea6..0000000
--- a/share/www/dialog/_create_database.html
+++ /dev/null
@@ -1,33 +0,0 @@
-<!--
-
-Licensed under the Apache License, Version 2.0 (the "License"); you may not use
-this file except in compliance with the License. You may obtain a copy of the
-License at
-
-   http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software distributed
-under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
-CONDITIONS OF ANY KIND, either express or implied. See the License for the
-specific language governing permissions and limitations under the License.
-
--->
-<form action="" method="post">
-  <h2>Create New Database</h2>
-  <fieldset>
-    <p class="help">
-      Please enter the name of the database. Note that only lowercase
-      characters (<tt>a-z</tt>), digits (<tt>0-9</tt>), or any of the
-      characters <tt>_</tt>, <tt>$</tt>, <tt>(</tt>, <tt>)</tt>, <tt>+</tt>,
-      <tt>-</tt>, and <tt>/</tt> are allowed.
-    </p>
-    <table summary=""><tbody><tr>
-      <th><label>Database Name:</label></th>
-      <td><input type="text" name="name" size="24"></td>
-    </tr></table>
-  </fieldset>
-  <div class="buttons">
-    <button type="submit">Create</button>
-    <button type="button" class="cancel">Cancel</button>
-  </div>
-</form>

http://git-wip-us.apache.org/repos/asf/couchdb/blob/cca309f3/share/www/dialog/_database_security.html
----------------------------------------------------------------------
diff --git a/share/www/dialog/_database_security.html b/share/www/dialog/_database_security.html
deleted file mode 100644
index 265cb6f..0000000
--- a/share/www/dialog/_database_security.html
+++ /dev/null
@@ -1,50 +0,0 @@
-<!--
-
-Licensed under the Apache License, Version 2.0 (the "License"); you may not use
-this file except in compliance with the License. You may obtain a copy of the
-License at
-
-   http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software distributed
-under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
-CONDITIONS OF ANY KIND, either express or implied. See the License for the
-specific language governing permissions and limitations under the License.
-
--->
-<form action="" method="post">
-  <h2>Security</h2>
-  <fieldset>
-    <p class="help">
-      Each database contains lists of admins and members.
-      Admins and members are each defined by <tt>names</tt> and <tt>roles</tt>, which are lists of strings.
-    </p>
-
-    <h3>Admins</h3>
-    <p class="help">Database admins can update design documents and edit the admin and member lists.</p>
-    <table summary=""><tbody><tr>
-      <th><label>Names:</label></th>
-      <td><input type="text" name="admin_names" size="40"></td>
-    </tr><tr>
-      <th><label>Roles:</label></th>
-      <td><input type="text" name="admin_roles" size="40"></td>
-    </tr>
-    </tbody></table>
-
-    <h3>Members</h3>
-    <p class="help">Database members can access the database. If no members are defined, the database is public.</p>
-    <table summary=""><tbody><tr>
-      <th><label>Names:</label></th>
-      <td><input type="text" name="member_names" size="40"></td>
-    </tr><tr>
-      <th><label>Roles:</label></th>
-      <td><input type="text" name="member_roles" size="40"></td>
-    </tr>
-    </tbody></table>
-
-  </fieldset>
-  <div class="buttons">
-    <button type="submit">Update</button>
-    <button type="button" class="cancel">Cancel</button>
-  </div>
-</form>

http://git-wip-us.apache.org/repos/asf/couchdb/blob/cca309f3/share/www/dialog/_delete_database.html
----------------------------------------------------------------------
diff --git a/share/www/dialog/_delete_database.html b/share/www/dialog/_delete_database.html
deleted file mode 100644
index 7fdf62f..0000000
--- a/share/www/dialog/_delete_database.html
+++ /dev/null
@@ -1,29 +0,0 @@
-<!--
-
-Licensed under the Apache License, Version 2.0 (the "License"); you may not use
-this file except in compliance with the License. You may obtain a copy of the
-License at
-
-   http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software distributed
-under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
-CONDITIONS OF ANY KIND, either express or implied. See the License for the
-specific language governing permissions and limitations under the License.
-
--->
-<form action="" method="post">
-  <h2>Delete Database</h2>
-  <fieldset>
-    <p class="help">
-      Are you sure you want to delete this database? This includes all
-      documents, design documents, views and security settings.
-      <br><br>
-      Note that this is an <strong>irreversible operation</strong>!
-    </p>
-  </fieldset>
-  <div class="buttons">
-    <button type="submit">Delete</button>
-    <button type="button" class="cancel">Cancel</button>
-  </div>
-</form>

http://git-wip-us.apache.org/repos/asf/couchdb/blob/cca309f3/share/www/dialog/_delete_document.html
----------------------------------------------------------------------
diff --git a/share/www/dialog/_delete_document.html b/share/www/dialog/_delete_document.html
deleted file mode 100644
index 8ae8971..0000000
--- a/share/www/dialog/_delete_document.html
+++ /dev/null
@@ -1,26 +0,0 @@
-<!--
-
-Licensed under the Apache License, Version 2.0 (the "License"); you may not use
-this file except in compliance with the License. You may obtain a copy of the
-License at
-
-   http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software distributed
-under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
-CONDITIONS OF ANY KIND, either express or implied. See the License for the
-specific language governing permissions and limitations under the License.
-
--->
-<form action="" method="post">
-  <h2>Delete Document</h2>
-  <fieldset>
-    <p class="help">
-      Are you sure you want to delete this document?
-    </p>
-  </fieldset>
-  <div class="buttons">
-    <button type="submit">Delete</button>
-    <button type="button" class="cancel">Cancel</button>
-  </div>
-</form>

http://git-wip-us.apache.org/repos/asf/couchdb/blob/cca309f3/share/www/dialog/_login.html
----------------------------------------------------------------------
diff --git a/share/www/dialog/_login.html b/share/www/dialog/_login.html
deleted file mode 100644
index f05a5fd..0000000
--- a/share/www/dialog/_login.html
+++ /dev/null
@@ -1,34 +0,0 @@
-<!--
-
-Licensed under the Apache License, Version 2.0 (the "License"); you may not use
-this file except in compliance with the License. You may obtain a copy of the
-License at
-
-   http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software distributed
-under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
-CONDITIONS OF ANY KIND, either express or implied. See the License for the
-specific language governing permissions and limitations under the License.
-
--->
-<form action="" method="post">
-  <h2>Login</h2>
-  <fieldset>
-    <p class="help">
-      Login to CouchDB with your name and password.
-    </p>
-    <table summary=""><tbody><tr>
-      <th><label>Username:</label></th>
-      <td><input type="text" name="name" size="24"></td>
-    </tr><tr>
-      <th><label>Password:</label></th>
-      <td><input type="password" name="password" size="24"></td>
-    </tr>
-    </tbody></table>
-  </fieldset>
-  <div class="buttons">
-    <button type="submit">Login</button>
-    <button type="button" class="cancel">Cancel</button>
-  </div>
-</form>

http://git-wip-us.apache.org/repos/asf/couchdb/blob/cca309f3/share/www/dialog/_save_view_as.html
----------------------------------------------------------------------
diff --git a/share/www/dialog/_save_view_as.html b/share/www/dialog/_save_view_as.html
deleted file mode 100644
index d59122b..0000000
--- a/share/www/dialog/_save_view_as.html
+++ /dev/null
@@ -1,35 +0,0 @@
-<!--
-
-Licensed under the Apache License, Version 2.0 (the "License"); you may not use
-this file except in compliance with the License. You may obtain a copy of the
-License at
-
-   http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software distributed
-under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
-CONDITIONS OF ANY KIND, either express or implied. See the License for the
-specific language governing permissions and limitations under the License.
-
--->
-<form action="" method="post" id="view-save-as" onload="initForm(this)">
-  <h2>Save View As&hellip;</h2>
-  <fieldset>
-    <p class="help">
-      You can save this function code as a permanent view in the database. Just
-      enter or select the design document and the name of the view below. Note
-      that if you choose an existing view, it will be overwritten!
-    </p>
-    <table summary=""><tbody><tr>
-      <th><label for="input_docid">Design Document:</label></th>
-      <td><tt>_design/</tt><input type="text" id="input_docid" name="docid" size="20"></td>
-    </tr><tr>
-      <th><label for="input_name">View Name:<label></th>
-      <td><input type="text" id="input_name" name="name" size="30"></td>
-    </tr></table>
-  </fieldset>
-  <div class="buttons">
-    <button type="submit">Save</button>
-    <button type="button" class="cancel">Cancel</button>
-  </div>
-</form>

http://git-wip-us.apache.org/repos/asf/couchdb/blob/cca309f3/share/www/dialog/_share_test_reports.html
----------------------------------------------------------------------
diff --git a/share/www/dialog/_share_test_reports.html b/share/www/dialog/_share_test_reports.html
deleted file mode 100644
index 82b49a7..0000000
--- a/share/www/dialog/_share_test_reports.html
+++ /dev/null
@@ -1,42 +0,0 @@
-<!--
-
-Licensed under the Apache License, Version 2.0 (the "License"); you may not use
-this file except in compliance with the License. You may obtain a copy of the
-License at
-
-   http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software distributed
-under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
-CONDITIONS OF ANY KIND, either express or implied. See the License for the
-specific language governing permissions and limitations under the License.
-
--->
-<form action="" method="post">
-  <h2>Share Test Reports</h2>
-  <fieldset>
-    <p class="help">
-      After each test run, a results summary document is stored in
-      <a href="/_utils/database.html?test_suite_reports">your local
-        <tt>test_suite_reports</tt> database.</a> The data has no personally
-      identifying information, just details about the test run and your CouchDB
-      and browser versions. (Click the red link above to see what's stored.)
-      The data remains private until you click the "share" button below.
-    </p>
-    <p class="help">
-      Test reports are very valuable to the CouchDB community, and are easy to share.
-      Clicking the "share" button below triggers replication from
-      your local <tt>test_suite_reports</tt> database, to a database hosted by the
-      project.
-    </p>
-    <p class="help">
-      <a href="http://couchdb.couchdb.org/_utils/database.html?test_suite_reports">
-        Browse test reports shared by other users.</a>
-      Thank you for sharing!
-    </p>
-  </fieldset>
-  <div class="buttons">
-    <button type="submit">Share</button>
-    <button type="button" class="cancel">Cancel</button>
-  </div>
-</form>

http://git-wip-us.apache.org/repos/asf/couchdb/blob/cca309f3/share/www/dialog/_signup.html
----------------------------------------------------------------------
diff --git a/share/www/dialog/_signup.html b/share/www/dialog/_signup.html
deleted file mode 100644
index 7ba3448..0000000
--- a/share/www/dialog/_signup.html
+++ /dev/null
@@ -1,35 +0,0 @@
-<!--
-
-Licensed under the Apache License, Version 2.0 (the "License"); you may not use
-this file except in compliance with the License. You may obtain a copy of the
-License at
-
-   http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software distributed
-under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
-CONDITIONS OF ANY KIND, either express or implied. See the License for the
-specific language governing permissions and limitations under the License.
-
--->
-<form action="" method="post">
-  <h2>Create User Account</h2>
-  <fieldset>
-    <p class="help">
-      Create a user document on this CouchDB. You will be logged in as this 
-      user after the document is created.
-    </p>
-    <table summary=""><tbody><tr>
-      <th><label>Username:</label></th>
-      <td><input type="text" name="name" size="24"></td>
-    </tr><tr>
-      <th><label>Password:</label></th>
-      <td><input type="password" name="password" size="24"></td>
-    </tr>
-    </tbody></table>
-  </fieldset>
-  <div class="buttons">
-    <button type="submit">Create</button>
-    <button type="button" class="cancel">Cancel</button>
-  </div>
-</form>

http://git-wip-us.apache.org/repos/asf/couchdb/blob/cca309f3/share/www/dialog/_upload_attachment.html
----------------------------------------------------------------------
diff --git a/share/www/dialog/_upload_attachment.html b/share/www/dialog/_upload_attachment.html
deleted file mode 100644
index 50b7e1f..0000000
--- a/share/www/dialog/_upload_attachment.html
+++ /dev/null
@@ -1,36 +0,0 @@
-<!--
-
-Licensed under the Apache License, Version 2.0 (the "License"); you may not use
-this file except in compliance with the License. You may obtain a copy of the
-License at
-
-   http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software distributed
-under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
-CONDITIONS OF ANY KIND, either express or implied. See the License for the
-specific language governing permissions and limitations under the License.
-
--->
-<form action="" method="post" id="upload-form">
-  <h2>Upload Attachment</h2>
-  <fieldset>
-    <p class="help">
-      Please select the file you want to upload as an attachment to this
-      document. Please note that this will result in the immediate creation of
-      a new revision of the document, so it's not necessary to save the
-      document after the upload.
-    </p>
-    <table summary=""><tbody><tr>
-      <th><label>File:</label></th>
-      <td><input type="file" name="_attachments"></td>
-    </tr><tr>
-      <td id="progress" colspan="2">&nbsp;</td>
-    </tr></table>
-  </fieldset>
-  <div class="buttons">
-    <input type="hidden" name="_rev" value="">
-    <button type="submit">Upload</button>
-    <button type="button" class="cancel">Cancel</button>
-  </div>
-</form>

http://git-wip-us.apache.org/repos/asf/couchdb/blob/cca309f3/share/www/document.html
----------------------------------------------------------------------
diff --git a/share/www/document.html b/share/www/document.html
deleted file mode 100644
index e041cd9..0000000
--- a/share/www/document.html
+++ /dev/null
@@ -1,114 +0,0 @@
-<!DOCTYPE html>
-<!--
-
-Licensed under the Apache License, Version 2.0 (the "License"); you may not use
-this file except in compliance with the License. You may obtain a copy of the
-License at
-
-   http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software distributed
-under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
-CONDITIONS OF ANY KIND, either express or implied. See the License for the
-specific language governing permissions and limitations under the License.
-
--->
-<html lang="en">
-  <head>
-    <title>View Document</title>
-    <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
-    <link rel="stylesheet" href="style/layout.css?0.11.0" type="text/css">
-    <script src="script/json2.js"></script>
-    <script src="script/sha1.js"></script>
-    <script src="script/base64.js"></script>
-    <script src="script/jquery.js"></script>
-    <script src="script/jquery.couch.js"></script>
-    <script src="script/jquery.dialog.js"></script>
-    <script src="script/futon.js"></script>
-    <script src="script/jquery.resizer.js"></script>
-    <script src="script/futon.browse.js"></script>
-    <script src="script/futon.format.js"></script>    
-    <script src="script/jquery.editinline.js"></script>
-    <script src="script/jquery.form.js"></script>
-    <script>
-      var page = new $.futon.CouchDocumentPage();
-
-      $.futon.navigation.ready(function() {
-        this.addDatabase(page.db.name);
-        this.updateSelection(
-          location.pathname.replace(/document\.html/, "database.html"),
-          "?" + page.db.name
-        );
-      });
-
-      $(function() {
-        $("h1 a.dbname").text(page.dbName)
-          .attr("href", "database.html?" + encodeURIComponent(page.db.name));
-        $("h1 strong").text(page.docId);
-        $("h1 a.raw").attr("href", "/" + encodeURIComponent(page.db.name) +
-          "/" + encodeURIComponent(page.docId));
-        page.updateFieldListing();
-
-        $("#tabs li.tabular a").click(page.activateTabularView);
-        $("#tabs li.source a").click(page.activateSourceView);
-
-        $("#toolbar button.save").click(page.saveDocument);
-        $("#toolbar button.add").click(page.addField);
-        $("#toolbar button.load").click(page.uploadAttachment);
-        if (page.isNew) {
-          $("#toolbar button.delete").hide();
-        } else {
-          $("#toolbar button.delete").click(page.deleteDocument);
-        }
-      });
-    </script>
-  </head>
-
-  <body><div id="wrap">
-    <h1>
-      <a href="index.html">Overview</a>
-      <a class="dbname" href="#">?</a>
-      <strong>?</strong>
-      <a class="raw" title="Raw document"></a>
-    </h1>
-    <div id="content">
-      <ul id="toolbar">
-        <li><button class="save">Save Document</button></li>
-        <li><button class="add">Add Field</button></li>
-        <li><button class="load">Upload Attachment…</button></li>
-        <li><button class="delete">Delete Document…</button></li>
-      </ul>
-
-      <ul id="tabs">
-        <li class="active tabular"><a href="#tabular">Fields</a></li>
-        <li class="source"><a href="#source">Source</a></li>
-      </ul>
-      <table id="fields" class="listing" cellspacing="0">
-        <col class="field"><col class="value">
-        <caption>Fields</caption>
-        <thead>
-          <tr>
-            <th>Field</th>
-            <th>Value</th>
-          </tr>
-        </thead>
-        <tbody class="content">
-        </tbody>
-        <tbody class="source" style="display: none">
-          <tr><td colspan="2"></td></tr>
-        </tbody>
-        <tbody class="footer">
-          <tr>
-            <td colspan="2">
-              <div id="paging">
-                <a class="prev">← Previous Version</a> | <a class="next">Next Version →</a>
-              </div>
-              <span></span>
-            </td>
-          </tr>
-        </tbody>
-      </table>
-
-    </div>
-  </div></body>
-</html>


[15/37] move JS tests into safety

Posted by ja...@apache.org.
http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/test/lorem_b64.txt
----------------------------------------------------------------------
diff --git a/share/test/lorem_b64.txt b/share/test/lorem_b64.txt
new file mode 100644
index 0000000..8a21d79
--- /dev/null
+++ b/share/test/lorem_b64.txt
@@ -0,0 +1 @@
+TG9yZW0gaXBzdW0gZG9sb3Igc2l0IGFtZXQsIGNvbnNlY3RldHVyIGFkaXBpc2NpbmcgZWxpdC4gUGhhc2VsbHVzIG51bmMgc2FwaWVuLCBwb3J0YSBpZCBwZWxsZW50ZXNxdWUgYXQsIGVsZW1lbnR1bSBldCBmZWxpcy4gQ3VyYWJpdHVyIGNvbmRpbWVudHVtIGFudGUgaW4gbWV0dXMgaWFjdWxpcyBxdWlzIGNvbmd1ZSBkaWFtIGNvbW1vZG8uIERvbmVjIGVsZWlmZW5kIGFudGUgc2VkIG51bGxhIGRhcGlidXMgY29udmFsbGlzLiBVdCBjdXJzdXMgYWxpcXVhbSBuZXF1ZSwgdmVsIHBvcnR0aXRvciB0ZWxsdXMgaW50ZXJkdW0gdXQuIFNlZCBwaGFyZXRyYSBsYWNpbmlhIGFkaXBpc2NpbmcuIEluIHRyaXN0aXF1ZSB0cmlzdGlxdWUgZmVsaXMgbm9uIHRpbmNpZHVudC4gTnVsbGEgYXVjdG9yIG1hdXJpcyBhIHZlbGl0IGN1cnN1cyB1bHRyaWNpZXMuIEluIGF0IGxpYmVybyBxdWlzIGp1c3RvIGNvbnNlY3RldHVyIGxhb3JlZXQuIE51bGxhbSBpZCB1bHRyaWNlcyBudW5jLiBEb25lYyBub24gdHVycGlzIG51bGxhLCBldSBsYWNpbmlhIGFudGUuIE51bmMgZXUgb3JjaSBldCB0dXJwaXMgcHJldGl1bSB2ZW5lbmF0aXMuIE5hbSBtb2xlc3RpZSwgbGFjdXMgYXQgZGlnbmlzc2ltIGVsZW1lbnR1bSwgYW50ZSBsaWJlcm8gY29uc2VjdGV0dXIgbGliZXJvLCB1dCBsYWNpbmlhIGxhY3VzIHVybmEgZXQgcHVydXMuIE51bGxhbSBsb3JlbSBpcHN1bSwgZGFwaWJ1cyB2ZWwgdWxsYW1jb3JwZXIgYSwgbWFsZXN1YWRhIGEgb
 WV0dXMuIFNlZCBwb3J0YSBhZGlwaXNjaW5nIG1hZ25hLCBxdWlzIHB1bHZpbmFyIHB1cnVzIG1hdHRpcyBmcmluZ2lsbGEuIEludGVnZXIgcGVsbGVudGVzcXVlIHNhcGllbiBpbiBuZXF1ZSB0cmlzdGlxdWUgYWMgaWFjdWxpcyBsaWJlcm8gdWx0cmljaWVzLiBVdCBlZ2V0IHBoYXJldHJhIHB1cnVzLgoKTnVsbGEgaW4gY29udmFsbGlzIHRlbGx1cy4gUHJvaW4gdGluY2lkdW50IHN1c2NpcGl0IHZ1bHB1dGF0ZS4gU3VzcGVuZGlzc2UgcG90ZW50aS4gTnVsbGFtIHRyaXN0aXF1ZSBqdXN0byBtaSwgYSB0cmlzdGlxdWUgbGlndWxhLiBEdWlzIGNvbnZhbGxpcyBhbGlxdWFtIGlhY3VsaXMuIE51bGxhIGRpY3R1bSBmcmluZ2lsbGEgY29uZ3VlLiBTdXNwZW5kaXNzZSBhYyBsZW8gbGVjdHVzLCBhYyBhbGlxdWFtIGp1c3RvLiBVdCBwb3J0dGl0b3IgY29tbW9kbyBtaSBzZWQgbHVjdHVzLiBOdWxsYSBhdCBlbmltIGxvcmVtLiBOdW5jIGV1IGp1c3RvIHNhcGllbiwgYSBibGFuZGl0IG9kaW8uIEN1cmFiaXR1ciBmYXVjaWJ1cyBzb2xsaWNpdHVkaW4gZG9sb3IsIGlkIGxhY2luaWEgc2VtIGF1Y3RvciBpbi4gRG9uZWMgdmFyaXVzIG51bmMgYXQgbGVjdHVzIHNhZ2l0dGlzIG5lYyBsdWN0dXMgYXJjdSBwaGFyZXRyYS4gTnVuYyBzZWQgbWV0dXMganVzdG8uIENyYXMgdmVsIG1hdXJpcyBkaWFtLiBVdCBmZXVnaWF0IGZlbGlzIGVnZXQgbmVxdWUgcGhhcmV0cmEgdmVzdGlidWx1bSBjb25zZWN0ZXR1ciBtYXNzYSBmYW
 NpbGlzaXMuIFF1aXNxdWUgY29uc2VjdGV0dXIgbHVjdHVzIG5pc2kgcXVpcyB0aW5jaWR1bnQuIFZpdmFtdXMgY3Vyc3VzIGN1cnN1cyBxdWFtIG5vbiBibGFuZGl0LiBQZWxsZW50ZXNxdWUgZXQgdmVsaXQgbGFjdXMuIFBlbGxlbnRlc3F1ZSBoYWJpdGFudCBtb3JiaSB0cmlzdGlxdWUgc2VuZWN0dXMgZXQgbmV0dXMgZXQgbWFsZXN1YWRhIGZhbWVzIGFjIHR1cnBpcyBlZ2VzdGFzLgoKSW4gZXQgZG9sb3Igdml0YWUgb3JjaSBhZGlwaXNjaW5nIGNvbmd1ZS4gQWxpcXVhbSBncmF2aWRhIG5pYmggYXQgbmlzbCBncmF2aWRhIG1vbGVzdGllLiBDdXJhYml0dXIgYSBiaWJlbmR1bSBzYXBpZW4uIEFsaXF1YW0gdGluY2lkdW50LCBudWxsYSBuZWMgcHJldGl1bSBsb2JvcnRpcywgb2RpbyBhdWd1ZSB0aW5jaWR1bnQgYXJjdSwgYSBsb2JvcnRpcyBvZGlvIHNlbSB1dCBwdXJ1cy4gRG9uZWMgYWNjdW1zYW4gbWF0dGlzIG51bmMgdml0YWUgbGFjaW5pYS4gU3VzcGVuZGlzc2UgcG90ZW50aS4gSW50ZWdlciBjb21tb2RvIG5pc2wgcXVpcyBuaWJoIGludGVyZHVtIG5vbiBmcmluZ2lsbGEgZHVpIHNvZGFsZXMuIENsYXNzIGFwdGVudCB0YWNpdGkgc29jaW9zcXUgYWQgbGl0b3JhIHRvcnF1ZW50IHBlciBjb251YmlhIG5vc3RyYSwgcGVyIGluY2VwdG9zIGhpbWVuYWVvcy4gSW4gaGFjIGhhYml0YXNzZSBwbGF0ZWEgZGljdHVtc3QuIEV0aWFtIHVsbGFtY29ycGVyLCBtaSBpZCBmZXVnaWF0IGJpYmVuZHVtLCBwdXJ1cyB
 uZXF1ZSBjdXJzdXMgbWF1cmlzLCBpZCBzb2RhbGVzIHF1YW0gbmlzaSBpZCB2ZWxpdC4gU2VkIGxlY3R1cyBsZW8sIHRpbmNpZHVudCB2ZWwgcmhvbmN1cyBpbXBlcmRpZXQsIGJsYW5kaXQgaW4gbGVvLiBJbnRlZ2VyIHF1aXMgbWFnbmEgbnVsbGEuIERvbmVjIHZlbCBuaXNsIG1hZ25hLCB1dCByaG9uY3VzIGR1aS4gQWxpcXVhbSBncmF2aWRhLCBudWxsYSBuZWMgZWxlaWZlbmQgbHVjdHVzLCBuZXF1ZSBuaWJoIHBoYXJldHJhIGFudGUsIHF1aXMgZWdlc3RhcyBlbGl0IG1ldHVzIGEgbWkuIE51bmMgbmVjIGF1Z3VlIHF1YW0uIE1vcmJpIHRpbmNpZHVudCB0cmlzdGlxdWUgdmFyaXVzLiBTdXNwZW5kaXNzZSBpYWN1bGlzIGVsaXQgZmV1Z2lhdCBtYWduYSBwZWxsZW50ZXNxdWUgdWx0cmljaWVzLiBWZXN0aWJ1bHVtIGFsaXF1YW0gdG9ydG9yIG5vbiBhbnRlIHVsbGFtY29ycGVyIGZyaW5naWxsYS4gRG9uZWMgaWFjdWxpcyBtaSBxdWlzIG1hdXJpcyBvcm5hcmUgdmVzdGlidWx1bS4KCkluIGEgbWFnbmEgbmlzaSwgYSB1bHRyaWNpZXMgbWFzc2EuIERvbmVjIGVsaXQgbmVxdWUsIHZpdmVycmEgbm9uIHRlbXBvciBxdWlzLCBmcmluZ2lsbGEgaW4gbWV0dXMuIEludGVnZXIgb2RpbyBvZGlvLCBldWlzbW9kIHZpdGFlIG1vbGxpcyBzZWQsIHNvZGFsZXMgZWdldCBsaWJlcm8uIERvbmVjIG5lYyBtYXNzYSBpbiBmZWxpcyBvcm5hcmUgcGhhcmV0cmEgYXQgbmVjIHRlbGx1cy4gTnVuYyBsb3JlbSBkb2xvciwgcHJl
 dGl1bSB2ZWwgYXVjdG9yIGluLCB2b2x1dHBhdCB2aXRhZSBmZWxpcy4gTWFlY2VuYXMgcmhvbmN1cywgb3JjaSB2ZWwgYmxhbmRpdCBldWlzbW9kLCB0dXJwaXMgZXJhdCB0aW5jaWR1bnQgYW50ZSwgZWxlbWVudHVtIGFkaXBpc2NpbmcgbmlzbCB1cm5hIGluIG5pc2kuIFBoYXNlbGx1cyBzYWdpdHRpcywgZW5pbSBzZWQgYWNjdW1zYW4gY29uc2VxdWF0LCB1cm5hIGF1Z3VlIGxvYm9ydGlzIGVyYXQsIG5vbiBtYWxlc3VhZGEgcXVhbSBtZXR1cyBzb2xsaWNpdHVkaW4gYW50ZS4gSW4gbGVvIHB1cnVzLCBkaWduaXNzaW0gcXVpcyB2YXJpdXMgdmVsLCBwZWxsZW50ZXNxdWUgZXQgbmliaC4gSW4gc2VkIHRvcnRvciBpYWN1bGlzIGxpYmVybyBtb2xsaXMgcGVsbGVudGVzcXVlIGlkIHZpdGFlIGxlY3R1cy4gSW4gaGFjIGhhYml0YXNzZSBwbGF0ZWEgZGljdHVtc3QuIFBoYXNlbGx1cyBtYXVyaXMgZW5pbSwgcG9zdWVyZSBlZ2V0IGx1Y3R1cyBhYywgaWFjdWxpcyBldCBxdWFtLiBWaXZhbXVzIGV0IG5pYmggZGlhbSwgZWxlbWVudHVtIGVnZXN0YXMgdGVsbHVzLiBBZW5lYW4gdnVscHV0YXRlIG1hbGVzdWFkYSBlc3QuIFNlZCBwb3N1ZXJlIHBvcnRhIGRpYW0gYSBzb2RhbGVzLiBQcm9pbiBldSBzZW0gbm9uIHZlbGl0IGZhY2lsaXNpcyB2ZW5lbmF0aXMgc2VkIGEgdHVycGlzLgoKUGVsbGVudGVzcXVlIHNlZCByaXN1cyBhIGFudGUgdnVscHV0YXRlIGxvYm9ydGlzIHNpdCBhbWV0IGV1IG5pc2wuIFN1c3BlbmRpc
 3NlIHV0IGVyb3MgbWksIGEgcmhvbmN1cyBsYWN1cy4gQ3VyYWJpdHVyIGZlcm1lbnR1bSB2ZWhpY3VsYSB0ZWxsdXMsIGEgb3JuYXJlIG1pIGNvbmRpbWVudHVtIHZlbC4gSW50ZWdlciBtb2xlc3RpZSB2b2x1dHBhdCB2aXZlcnJhLiBJbnRlZ2VyIHBvc3VlcmUgZXVpc21vZCB2ZW5lbmF0aXMuIFByb2luIGFjIG1hdXJpcyBzZWQgbnVsbGEgcGhhcmV0cmEgcG9ydHRpdG9yLiBEdWlzIHZlbCBkdWkgaW4gcmlzdXMgc29kYWxlcyBhdWN0b3Igc2l0IGFtZXQgbm9uIGVuaW0uIE1hZWNlbmFzIG1vbGxpcyBsYWN1cyBhdCBsaWd1bGEgZmF1Y2lidXMgc29kYWxlcy4gQ3JhcyB2ZWwgbmVxdWUgYXJjdS4gU2VkIHRpbmNpZHVudCB0b3J0b3IgcHJldGl1bSBuaXNpIGludGVyZHVtIHF1aXMgZGljdHVtIGFyY3UgbGFvcmVldC4gTW9yYmkgcHJldGl1bSB1bHRyaWNlcyBmZXVnaWF0LiBNYWVjZW5hcyBjb252YWxsaXMgYXVndWUgbmVjIGZlbGlzIG1hbGVzdWFkYSBtYWxlc3VhZGEgc2NlbGVyaXNxdWUgbWF1cmlzIHBsYWNlcmF0LiBTZWQgYXQgbWFnbmEgZW5pbSwgYXQgZnJpbmdpbGxhIGRvbG9yLiBRdWlzcXVlIHV0IG1hdHRpcyBkdWkuIFByYWVzZW50IGNvbnNlY3RldHVyIGFudGUgdml2ZXJyYSBuaXNpIGJsYW5kaXQgcGhhcmV0cmEuIFF1aXNxdWUgbWV0dXMgZWxpdCwgZGlnbmlzc2ltIHZpdGFlIGZlcm1lbnR1bSBzaXQgYW1ldCwgZnJpbmdpbGxhIGltcGVyZGlldCBvZGlvLiBDcmFzIGVnZXQgcHVydXMgZWdldC
 B0ZWxsdXMgZmV1Z2lhdCBsdWN0dXMgYSBhYyBwdXJ1cy4gQ3JhcyB2aXRhZSBuaXNsIHZlbCBhdWd1ZSByaG9uY3VzIHBvcnR0aXRvciBzaXQgYW1ldCBxdWlzIGxvcmVtLiBEb25lYyBpbnRlcmR1bSBwZWxsZW50ZXNxdWUgYWRpcGlzY2luZy4gUGhhc2VsbHVzIG5lcXVlIGxpYmVybywgYWxpcXVhbSBpbiBtYXR0aXMgdml0YWUsIGNvbnNlY3RldHVyIGFkaXBpc2NpbmcgbmliaC4KCkRvbmVjIG5lYyBudWxsYSB1cm5hLCBhYyBzYWdpdHRpcyBsZWN0dXMuIFN1c3BlbmRpc3NlIG5vbiBlbGl0IHNlZCBtaSBhdWN0b3IgZmFjaWxpc2lzIHZpdGFlIGV0IGxlY3R1cy4gRnVzY2UgYWMgdnVscHV0YXRlIG1hdXJpcy4gTW9yYmkgY29uZGltZW50dW0gdWx0cmljZXMgbWV0dXMsIGV0IGFjY3Vtc2FuIHB1cnVzIG1hbGVzdWFkYSBhdC4gTWFlY2VuYXMgbG9ib3J0aXMgYW50ZSBzZWQgbWFzc2EgZGljdHVtIHZpdGFlIHZlbmVuYXRpcyBlbGl0IGNvbW1vZG8uIFByb2luIHRlbGx1cyBlcm9zLCBhZGlwaXNjaW5nIHNlZCBkaWduaXNzaW0gdml0YWUsIHRlbXBvciBlZ2V0IGFudGUuIEFlbmVhbiBpZCB0ZWxsdXMgbmVjIG1hZ25hIGN1cnN1cyBwaGFyZXRyYSB2aXRhZSB2ZWwgZW5pbS4gTW9yYmkgdmVzdGlidWx1bSBwaGFyZXRyYSBlc3QgaW4gdnVscHV0YXRlLiBBbGlxdWFtIHZpdGFlIG1ldHVzIGFyY3UsIGlkIGFsaXF1ZXQgbnVsbGEuIFBoYXNlbGx1cyBsaWd1bGEgZXN0LCBoZW5kcmVyaXQgbmVjIGlhY3VsaXMgdXQ
 sIHZvbHV0cGF0IHZlbCBlcm9zLiBTdXNwZW5kaXNzZSB2aXRhZSB1cm5hIHR1cnBpcywgcGxhY2VyYXQgYWRpcGlzY2luZyBkaWFtLiBQaGFzZWxsdXMgZmV1Z2lhdCB2ZXN0aWJ1bHVtIG5lcXVlIGV1IGRhcGlidXMuIE51bGxhIGZhY2lsaXNpLiBEdWlzIHRvcnRvciBmZWxpcywgZXVpc21vZCBzaXQgYW1ldCBhbGlxdWV0IGluLCB2b2x1dHBhdCBuZWMgdHVycGlzLiBNYXVyaXMgcmhvbmN1cyBpcHN1bSB1dCBwdXJ1cyBlbGVpZmVuZCB1dCBsb2JvcnRpcyBsZWN0dXMgZGFwaWJ1cy4gUXVpc3F1ZSBub24gZXJhdCBsb3JlbS4gVml2YW11cyBwb3N1ZXJlIGltcGVyZGlldCBpYWN1bGlzLiBVdCBsaWd1bGEgbGFjdXMsIGVsZWlmZW5kIGF0IHRlbXBvciBpZCwgYXVjdG9yIGV1IGxlby4KCkRvbmVjIG1pIGVuaW0sIGxhb3JlZXQgcHVsdmluYXIgbW9sbGlzIGV1LCBtYWxlc3VhZGEgdml2ZXJyYSBudW5jLiBJbiB2aXRhZSBtZXR1cyB2aXRhZSBuZXF1ZSB0ZW1wb3IgZGFwaWJ1cy4gTWFlY2VuYXMgdGluY2lkdW50IHB1cnVzIGEgZmVsaXMgYWxpcXVhbSBwbGFjZXJhdC4gTnVsbGEgZmFjaWxpc2kuIFN1c3BlbmRpc3NlIHBsYWNlcmF0IHBoYXJldHJhIG1hdHRpcy4gSW50ZWdlciB0ZW1wb3IgbWFsZXN1YWRhIGp1c3RvIGF0IHRlbXB1cy4gTWFlY2VuYXMgdmVoaWN1bGEgbG9yZW0gYSBzYXBpZW4gYmliZW5kdW0gdmVsIGlhY3VsaXMgcmlzdXMgZmV1Z2lhdC4gUGVsbGVudGVzcXVlIGRpYW0gZXJhdCwgZGFwaWJ1
 cyBldCBwZWxsZW50ZXNxdWUgcXVpcywgbW9sZXN0aWUgdXQgbWFzc2EuIFZpdmFtdXMgaWFjdWxpcyBpbnRlcmR1bSBtYXNzYSBpZCBiaWJlbmR1bS4gUXVpc3F1ZSB1dCBtYXVyaXMgZHVpLCBzaXQgYW1ldCB2YXJpdXMgZWxpdC4gVmVzdGlidWx1bSBlbGl0IGxvcmVtLCBydXRydW0gbm9uIGNvbnNlY3RldHVyIHV0LCBsYW9yZWV0IG5lYyBudW5jLiBEb25lYyBuZWMgbWF1cmlzIGFudGUuIEN1cmFiaXR1ciB1dCBlc3Qgc2VkIG9kaW8gcGhhcmV0cmEgbGFvcmVldC4gTG9yZW0gaXBzdW0gZG9sb3Igc2l0IGFtZXQsIGNvbnNlY3RldHVyIGFkaXBpc2NpbmcgZWxpdC4gQ3VyYWJpdHVyIHB1cnVzIHJpc3VzLCBsYW9yZWV0IHNlZCBwb3J0YSBpZCwgc2FnaXR0aXMgdmVsIGlwc3VtLiBNYWVjZW5hcyBuaWJoIGRpYW0sIGN1cnN1cyBldCB2YXJpdXMgc2l0IGFtZXQsIGZyaW5naWxsYSBzZWQgbWFnbmEuIE51bGxhbSBpZCBuZXF1ZSBldSBsZW8gZmF1Y2lidXMgbW9sbGlzLiBEdWlzIG5lYyBhZGlwaXNjaW5nIG1hdXJpcy4gU3VzcGVuZGlzc2Ugc29sbGljaXR1ZGluLCBlbmltIGV1IHB1bHZpbmFyIGNvbW1vZG8sIGVyYXQgYXVndWUgdWx0cmljZXMgbWksIGEgdHJpc3RpcXVlIG1hZ25hIHNlbSBub24gbGliZXJvLgoKU2VkIGluIG1ldHVzIG51bGxhLiBQcmFlc2VudCBuZWMgYWRpcGlzY2luZyBzYXBpZW4uIERvbmVjIGxhb3JlZXQsIHZlbGl0IG5vbiBydXRydW0gdmVzdGlidWx1bSwgbGlndWxhIG5lcXVlIGFka
 XBpc2NpbmcgdHVycGlzLCBhdCBhdWN0b3Igc2FwaWVuIGVsaXQgdXQgbWFzc2EuIE51bGxhbSBhbGlxdWFtLCBlbmltIHZlbCBwb3N1ZXJlIHJ1dHJ1bSwganVzdG8gZXJhdCBsYW9yZWV0IGVzdCwgdmVsIGZyaW5naWxsYSBsYWN1cyBuaXNpIG5vbiBsZWN0dXMuIEV0aWFtIGxlY3R1cyBudW5jLCBsYW9yZWV0IGV0IHBsYWNlcmF0IGF0LCB2ZW5lbmF0aXMgcXVpcyBsaWJlcm8uIFByYWVzZW50IGluIHBsYWNlcmF0IGVsaXQuIENsYXNzIGFwdGVudCB0YWNpdGkgc29jaW9zcXUgYWQgbGl0b3JhIHRvcnF1ZW50IHBlciBjb251YmlhIG5vc3RyYSwgcGVyIGluY2VwdG9zIGhpbWVuYWVvcy4gUGVsbGVudGVzcXVlIGZyaW5naWxsYSBhdWd1ZSBldSBuaWJoIHBsYWNlcmF0IGRpY3R1bS4gTnVuYyBwb3J0dGl0b3IgdHJpc3RpcXVlIGRpYW0sIGV1IGFsaXF1YW0gZW5pbSBhbGlxdWV0IHZlbC4gQWxpcXVhbSBsYWNpbmlhIGludGVyZHVtIGlwc3VtLCBpbiBwb3N1ZXJlIG1ldHVzIGx1Y3R1cyB2ZWwuIFZpdmFtdXMgZXQgbmlzbCBhIGVyb3Mgc2VtcGVyIGVsZW1lbnR1bS4gRG9uZWMgdmVuZW5hdGlzIG9yY2kgYXQgZGlhbSB0cmlzdGlxdWUgc29sbGljaXR1ZGluLiBJbiBldSBlcm9zIHNlZCBvZGlvIHJ1dHJ1bSBsdWN0dXMgbm9uIG5lYyB0ZWxsdXMuCgpOdWxsYSBuZWMgZmVsaXMgZWxpdC4gTnVsbGFtIGluIGlwc3VtIGluIGlwc3VtIGNvbnNlcXVhdCBmcmluZ2lsbGEgcXVpcyB2ZWwgdG9ydG9yLiBQaGFzZWxsdX
 Mgbm9uIG1hc3NhIG5pc2ksIHNpdCBhbWV0IGFsaXF1YW0gdXJuYS4gU2VkIGZlcm1lbnR1bSBuaWJoIHZpdGFlIGxhY3VzIHRpbmNpZHVudCBuZWMgdGluY2lkdW50IG1hc3NhIGJpYmVuZHVtLiBFdGlhbSBlbGl0IGR1aSwgZmFjaWxpc2lzIHNpdCBhbWV0IHZlaGljdWxhIG5lYywgaWFjdWxpcyBhdCBzYXBpZW4uIFV0IGF0IG1hc3NhIGlkIGR1aSB1bHRyaWNlcyB2b2x1dHBhdCB1dCBhYyBsaWJlcm8uIEZ1c2NlIGlwc3VtIG1pLCBiaWJlbmR1bSBhIGxhY2luaWEgZXQsIHB1bHZpbmFyIGVnZXQgbWF1cmlzLiBQcm9pbiBmYXVjaWJ1cyB1cm5hIHV0IGxvcmVtIGVsZW1lbnR1bSB2dWxwdXRhdGUuIER1aXMgcXVhbSBsZW8sIG1hbGVzdWFkYSBub24gZXVpc21vZCB1dCwgYmxhbmRpdCBmYWNpbGlzaXMgbWF1cmlzLiBTdXNwZW5kaXNzZSBzaXQgYW1ldCBtYWduYSBpZCB2ZWxpdCB0aW5jaWR1bnQgYWxpcXVldCBuZWMgZXUgZG9sb3IuIEN1cmFiaXR1ciBiaWJlbmR1bSBsb3JlbSB2ZWwgZmVsaXMgdGVtcHVzIGRhcGlidXMuIEFsaXF1YW0gZXJhdCB2b2x1dHBhdC4gQWVuZWFuIGN1cnN1cyB0b3J0b3IgbmVjIGR1aSBhbGlxdWV0IHBvcnRhLiBBZW5lYW4gY29tbW9kbyBpYWN1bGlzIHN1c2NpcGl0LiBWZXN0aWJ1bHVtIGFudGUgaXBzdW0gcHJpbWlzIGluIGZhdWNpYnVzIG9yY2kgbHVjdHVzIGV0IHVsdHJpY2VzIHBvc3VlcmUgY3ViaWxpYSBDdXJhZTsgUXVpc3F1ZSBzaXQgYW1ldCBvcm5hcmUgZWxpdC4gTmF
 tIGxpZ3VsYSByaXN1cywgdmVzdGlidWx1bSBuZWMgbWF0dGlzIGluLCBjb25kaW1lbnR1bSBhYyBhbnRlLiBEb25lYyBmcmluZ2lsbGEsIGp1c3RvIGV0IHVsdHJpY2VzIGZhdWNpYnVzLCB0ZWxsdXMgZXN0IHZvbHV0cGF0IG1hc3NhLCB2aXRhZSBjb21tb2RvIHNhcGllbiBkaWFtIG5vbiByaXN1cy4gVml2YW11cyBhdCBhcmN1IGdyYXZpZGEgcHVydXMgbW9sbGlzIGZldWdpYXQuCgpOdWxsYSBhIHR1cnBpcyBxdWlzIHNhcGllbiBjb21tb2RvIGRpZ25pc3NpbSBldSBxdWlzIGp1c3RvLiBNYWVjZW5hcyBldSBsb3JlbSBvZGlvLCB1dCBoZW5kcmVyaXQgdmVsaXQuIEN1bSBzb2NpaXMgbmF0b3F1ZSBwZW5hdGlidXMgZXQgbWFnbmlzIGRpcyBwYXJ0dXJpZW50IG1vbnRlcywgbmFzY2V0dXIgcmlkaWN1bHVzIG11cy4gUHJvaW4gZmFjaWxpc2lzIHBvcnR0aXRvciB1bGxhbWNvcnBlci4gUHJhZXNlbnQgbW9sbGlzIGRpZ25pc3NpbSBtYXNzYSwgbGFvcmVldCBhbGlxdWV0IHZlbGl0IHBlbGxlbnRlc3F1ZSBub24uIE51bmMgZmFjaWxpc2lzIGNvbnZhbGxpcyB0cmlzdGlxdWUuIE1hdXJpcyBwb3J0dGl0b3IgYW50ZSBhdCB0ZWxsdXMgY29udmFsbGlzIHBsYWNlcmF0LiBNb3JiaSBhbGlxdWV0IG5pc2kgYWMgbmlzbCBwdWx2aW5hciBpZCBkaWN0dW0gbmlzbCBtb2xsaXMuIFNlZCBvcm5hcmUgc2VtIGV0IHJpc3VzIHBsYWNlcmF0IGxvYm9ydGlzIGlkIGVnZXQgZWxpdC4gSW50ZWdlciBjb25zZXF1YXQsIG1hZ25h
 IGlkIHN1c2NpcGl0IHBoYXJldHJhLCBudWxsYSB2ZWxpdCBzdXNjaXBpdCBvcmNpLCB1dCBpbnRlcmR1bSBhdWd1ZSBhdWd1ZSBxdWlzIHF1YW0uIEZ1c2NlIHByZXRpdW0gYWxpcXVldCB2dWxwdXRhdGUuIE1hdXJpcyBibGFuZGl0IGRpY3R1bSBtb2xlc3RpZS4gUHJvaW4gbnVsbGEgbmliaCwgYmliZW5kdW0gZXUgcGxhY2VyYXQgYXQsIHRpbmNpZHVudCBhYyBuaXNsLiBOdWxsYW0gdnVscHV0YXRlIG1ldHVzIHV0IGxpYmVybyBydXRydW0gdWx0cmljaWVzLiBOdW5jIHNpdCBhbWV0IGR1aSBtYXVyaXMuIFN1c3BlbmRpc3NlIGFkaXBpc2NpbmcgbGFjdXMgaW4gYXVndWUgZWxlaWZlbmQgbW9sbGlzLgoKRHVpcyBwcmV0aXVtIHVsdHJpY2VzIG1hdHRpcy4gTmFtIGV1aXNtb2QgcmlzdXMgYSBlcmF0IGxhY2luaWEgYmliZW5kdW0uIE1vcmJpIG1hc3NhIHRvcnRvciwgY29uc2VjdGV0dXIgaWQgZWxlaWZlbmQgaWQsIHBlbGxlbnRlc3F1ZSB2ZWwgdG9ydG9yLiBQcmFlc2VudCB1cm5hIGxvcmVtLCBwb3J0dGl0b3IgYXQgY29uZGltZW50dW0gdml0YWUsIGx1Y3R1cyBlZ2V0IGVsaXQuIE1hZWNlbmFzIGZyaW5naWxsYSBxdWFtIGNvbnZhbGxpcyBlc3QgaGVuZHJlcml0IHZpdmVycmEuIEV0aWFtIHZlaGljdWxhLCBzYXBpZW4gbm9uIHB1bHZpbmFyIGFkaXBpc2NpbmcsIG5pc2kgbWFzc2EgdmVzdGlidWx1bSBlc3QsIGlkIGludGVyZHVtIG1hdXJpcyB2ZWxpdCBldSBlc3QuIFZlc3RpYnVsdW0gZXN0IGFyY3UsI
 GZhY2lsaXNpcyBhdCB1bHRyaWNpZXMgbm9uLCB2dWxwdXRhdGUgaWQgc2FwaWVuLiBWZXN0aWJ1bHVtIGlwc3VtIG1ldHVzLCBwaGFyZXRyYSBuZWMgcGVsbGVudGVzcXVlIGlkLCBmYWNpbGlzaXMgaWQgc2FwaWVuLiBEb25lYyBydXRydW0gb2RpbyBldCBsYWN1cyB1bHRyaWNpZXMgdWxsYW1jb3JwZXIuIEludGVnZXIgc2VkIGVzdCB1dCBtaSBwb3N1ZXJlIHRpbmNpZHVudCBxdWlzIG5vbiBsZW8uIE1vcmJpIHRlbGx1cyBqdXN0bywgdWx0cmljaWVzIHNpdCBhbWV0IHVsdHJpY2VzIHF1aXMsIGZhY2lsaXNpcyB2aXRhZSBtYWduYS4gRG9uZWMgbGlndWxhIG1ldHVzLCBwZWxsZW50ZXNxdWUgbm9uIHRyaXN0aXF1ZSBhYywgdmVzdGlidWx1bSBzZWQgZXJhdC4gQWxpcXVhbSBlcmF0IHZvbHV0cGF0LgoKTmFtIGRpZ25pc3NpbSwgbmlzbCBlZ2V0IGNvbnNlcXVhdCBldWlzbW9kLCBzZW0gbGVjdHVzIGF1Y3RvciBvcmNpLCB1dCBwb3J0dGl0b3IgbGFjdXMgZHVpIGFjIG5lcXVlLiBJbiBoYWMgaGFiaXRhc3NlIHBsYXRlYSBkaWN0dW1zdC4gRnVzY2UgZWdlc3RhcyBwb3J0YSBmYWNpbGlzaXMuIEluIGhhYyBoYWJpdGFzc2UgcGxhdGVhIGRpY3R1bXN0LiBNYXVyaXMgY3Vyc3VzIHJob25jdXMgcmlzdXMgYWMgZXVpc21vZC4gUXVpc3F1ZSB2aXRhZSByaXN1cyBhIHRlbGx1cyB2ZW5lbmF0aXMgY29udmFsbGlzLiBDdXJhYml0dXIgbGFvcmVldCBzYXBpZW4gZXUgcXVhbSBsdWN0dXMgbG9ib3J0aXMuIFZpdmFtdX
 Mgc29sbGljaXR1ZGluIHNvZGFsZXMgZG9sb3Igdml0YWUgc29kYWxlcy4gU3VzcGVuZGlzc2UgcGhhcmV0cmEgbGFvcmVldCBhbGlxdWV0LiBNYWVjZW5hcyB1bGxhbWNvcnBlciBvcmNpIHZlbCB0b3J0b3IgbHVjdHVzIGlhY3VsaXMgdXQgdml0YWUgbWV0dXMuIFZlc3RpYnVsdW0gdXQgYXJjdSBhYyB0ZWxsdXMgbWF0dGlzIGVsZWlmZW5kIGVnZXQgdmVoaWN1bGEgZWxpdC4KCkluIHNlZCBmZXVnaWF0IGVyb3MuIERvbmVjIGJpYmVuZHVtIHVsbGFtY29ycGVyIGRpYW0sIGV1IGZhdWNpYnVzIG1hdXJpcyBkaWN0dW0gc2VkLiBEdWlzIHRpbmNpZHVudCBqdXN0byBpbiBuZXF1ZSBhY2N1bXNhbiBkaWN0dW0uIE1hZWNlbmFzIGluIHJ1dHJ1bSBzYXBpZW4uIFV0IGlkIGZldWdpYXQgbGFjdXMuIE51bGxhIGZhY2lsaXNpLiBOdW5jIGFjIGxvcmVtIGlkIHF1YW0gdmFyaXVzIGN1cnN1cyBhIGV0IGVsaXQuIEFlbmVhbiBwb3N1ZXJlIGxpYmVybyBldSB0b3J0b3IgdmVoaWN1bGEgdXQgdWxsYW1jb3JwZXIgb2RpbyBjb25zZXF1YXQuIFNlZCBpbiBkaWduaXNzaW0gZHVpLiBDdXJhYml0dXIgaWFjdWxpcyB0ZW1wb3IgcXVhbSBuZWMgcGxhY2VyYXQuIEFsaXF1YW0gdmVuZW5hdGlzIG5pYmggZXQganVzdG8gaWFjdWxpcyBsYWNpbmlhLiBQZWxsZW50ZXNxdWUgaGFiaXRhbnQgbW9yYmkgdHJpc3RpcXVlIHNlbmVjdHVzIGV0IG5ldHVzIGV0IG1hbGVzdWFkYSBmYW1lcyBhYyB0dXJwaXMgZWdlc3Rhcy4gTG9yZW0gaXB
 zdW0gZG9sb3Igc2l0IGFtZXQsIGNvbnNlY3RldHVyIGFkaXBpc2NpbmcgZWxpdC4gUGVsbGVudGVzcXVlIHRlbXB1cyBtYWduYSBzZWQgbWkgYWxpcXVldCBlZ2V0IHZhcml1cyBvZGlvIGNvbmd1ZS4KCkludGVnZXIgc2VtIHNlbSwgc2VtcGVyIGluIHZlc3RpYnVsdW0gdml0YWUsIGxvYm9ydGlzIHF1aXMgZXJhdC4gRHVpcyBhbnRlIGxlY3R1cywgZmVybWVudHVtIHNlZCB0ZW1wb3Igc2l0IGFtZXQsIHBsYWNlcmF0IHNpdCBhbWV0IHNlbS4gTWF1cmlzIGNvbmd1ZSB0aW5jaWR1bnQgaXBzdW0uIFV0IHZpdmVycmEsIGxhY3VzIHZlbCB2YXJpdXMgcGhhcmV0cmEsIHB1cnVzIGVuaW0gcHVsdmluYXIgaXBzdW0sIG5vbiBwZWxsZW50ZXNxdWUgZW5pbSBqdXN0byBub24gZXJhdC4gRnVzY2UgaXBzdW0gb3JjaSwgdWx0cmljZXMgc2VkIHBlbGxlbnRlc3F1ZSBhdCwgaGVuZHJlcml0IGxhb3JlZXQgZW5pbS4gTnVuYyBibGFuZGl0IG1vbGxpcyBwcmV0aXVtLiBVdCBtb2xsaXMsIG51bGxhIGFsaXF1YW0gc29kYWxlcyB2ZXN0aWJ1bHVtLCBsaWJlcm8gbG9yZW0gdGVtcHVzIHRvcnRvciwgYSBwZWxsZW50ZXNxdWUgbmliaCBlbGl0IGEgaXBzdW0uIFBoYXNlbGx1cyBmZXJtZW50dW0gbGlndWxhIGF0IG5lcXVlIGFkaXBpc2Npbmcgc29sbGljaXR1ZGluLiBTdXNwZW5kaXNzZSBpZCBpcHN1bSBhcmN1LiBTZWQgdGluY2lkdW50IHBsYWNlcmF0IHZpdmVycmEuIERvbmVjIGxpYmVybyBhdWd1ZSwgcG9ydHRpdG9yIHNp
 dCBhbWV0IHZhcml1cyBlZ2V0LCBydXRydW0gbmVjIGxhY3VzLiBQcm9pbiBibGFuZGl0IG9yY2kgc2l0IGFtZXQgZGlhbSBkaWN0dW0gaWQgcG9ydHRpdG9yIHJpc3VzIGlhY3VsaXMuIEludGVnZXIgbGFjaW5pYSBmZXVnaWF0IGxlbywgdml0YWUgYXVjdG9yIHR1cnBpcyBlbGVpZmVuZCB2ZWwuIFN1c3BlbmRpc3NlIGxvcmVtIHF1YW0sIHByZXRpdW0gaWQgYmliZW5kdW0gc2VkLCB2aXZlcnJhIHZpdGFlIHRvcnRvci4gTnVsbGFtIHVsdHJpY2llcyBsaWJlcm8gZXUgcmlzdXMgY29udmFsbGlzIGVnZXQgdWxsYW1jb3JwZXIgbmlzaSBlbGVtZW50dW0uIE1hdXJpcyBudWxsYSBlbGl0LCBiaWJlbmR1bSBpZCB2dWxwdXRhdGUgdml0YWUsIGltcGVyZGlldCBydXRydW0gbG9yZW0uIEN1cmFiaXR1ciBlZ2V0IGRpZ25pc3NpbSBvcmNpLiBTZWQgc2VtcGVyIHRlbGx1cyBpcHN1bSwgYXQgYmxhbmRpdCBkdWkuIEludGVnZXIgZGFwaWJ1cyBmYWNpbGlzaXMgc29kYWxlcy4gVml2YW11cyBzb2xsaWNpdHVkaW4gdmFyaXVzIGVzdCwgcXVpcyBvcm5hcmUganVzdG8gY3Vyc3VzIGlkLgoKTnVuYyB2ZWwgdWxsYW1jb3JwZXIgbWkuIFN1c3BlbmRpc3NlIHBvdGVudGkuIE51bmMgZXQgdXJuYSBhIGF1Z3VlIHNjZWxlcmlzcXVlIHVsdHJpY2VzIG5vbiBxdWlzIG1pLiBJbiBxdWlzIHBvcnR0aXRvciBlbGl0LiBBZW5lYW4gcXVpcyBlcmF0IG51bGxhLCBhIHZlbmVuYXRpcyB0ZWxsdXMuIEZ1c2NlIHZlc3RpYnVsdW0gbmlza
 SBzZWQgbGVvIGFkaXBpc2NpbmcgZGlnbmlzc2ltLiBOdW5jIGludGVyZHVtLCBsb3JlbSBldCBsYWNpbmlhIHZlc3RpYnVsdW0sIHF1YW0gZXN0IG1hdHRpcyBtYWduYSwgc2l0IGFtZXQgdm9sdXRwYXQgZWxpdCBhdWd1ZSBhdCBsaWJlcm8uIENyYXMgZ3JhdmlkYSBkdWkgcXVpcyB2ZWxpdCBsb2JvcnRpcyBjb25kaW1lbnR1bSBldCBlbGVpZmVuZCBsaWd1bGEuIFBoYXNlbGx1cyBhYyBtZXR1cyBxdWFtLCBpZCB2ZW5lbmF0aXMgbWkuIEFsaXF1YW0gdXQgdHVycGlzIGFjIHRlbGx1cyBkYXBpYnVzIGRhcGlidXMgZXUgaW4gbWkuIFF1aXNxdWUgZWdldCBuaWJoIGVyb3MuIEZ1c2NlIGNvbnNlY3RldHVyIGxlbyB2ZWxpdC4KClZlc3RpYnVsdW0gc2VtcGVyIGVnZXN0YXMgbWF1cmlzLiBNb3JiaSB2ZXN0aWJ1bHVtIHNlbSBzZW0uIEFsaXF1YW0gdmVuZW5hdGlzLCBmZWxpcyBzZWQgZWxlaWZlbmQgcG9ydGEsIG1hdXJpcyBkaWFtIHNlbXBlciBhcmN1LCBzaXQgYW1ldCB1bHRyaWNpZXMgZXN0IHNhcGllbiBzaXQgYW1ldCBsaWJlcm8uIFZlc3RpYnVsdW0gZHVpIG9yY2ksIG9ybmFyZSBjb25kaW1lbnR1bSBtb2xsaXMgbmVjLCBtb2xlc3RpZSBhYyBlcm9zLiBQcm9pbiB2aXRhZSBtb2xsaXMgdmVsaXQuIFByYWVzZW50IGVnZXQgZmVsaXMgbWkuIE1hZWNlbmFzIGV1IHZ1bHB1dGF0ZSBuaXNpLiBWZXN0aWJ1bHVtIHZhcml1cywgYXJjdSBpbiB1bHRyaWNpZXMgdmVzdGlidWx1bSwgbmliaCBsZW8gc2FnaXR0aX
 Mgb2RpbywgdXQgYmliZW5kdW0gbmlzbCBtaSBuZWMgZGlhbS4gSW50ZWdlciBhdCBlbmltIGZldWdpYXQgbnVsbGEgc2VtcGVyIGJpYmVuZHVtIHV0IGEgdmVsaXQuIFByb2luIGF0IG5pc2kgdXQgbG9yZW0gYWxpcXVhbSB2YXJpdXMgZWdldCBxdWlzIGVsaXQuIE51bGxhbSBuZWMgb2RpbyB2ZWwgbGVjdHVzIGNvbmd1ZSBjb25zZXF1YXQgYWRpcGlzY2luZyBhYyBtaS4gRnVzY2Ugdml0YWUgbGFvcmVldCBsaWJlcm8uIEN1cmFiaXR1ciBzaXQgYW1ldCBzZW0gbmVxdWUsIG5lYyBwb3N1ZXJlIGVuaW0uIEN1cmFiaXR1ciBhdCBtYXNzYSBhIHNlbSBncmF2aWRhIGlhY3VsaXMgbmVjIGV0IG5pYmguIFNlZCB2aXRhZSBkdWkgdml0YWUgbGVvIHRpbmNpZHVudCBwcmV0aXVtIGEgYWxpcXVhbSBlcmF0LiBTdXNwZW5kaXNzZSB1bHRyaWNpZXMgb2RpbyBhdCBtZXR1cyB0ZW1wb3IgaW4gcGVsbGVudGVzcXVlIGFyY3UgdWx0cmljaWVzLgoKU2VkIGFsaXF1YW0gbWF0dGlzIHF1YW0sIGluIHZ1bHB1dGF0ZSBzYXBpZW4gdWx0cmljZXMgaW4uIFBlbGxlbnRlc3F1ZSBxdWlzIHZlbGl0IHNlZCBkdWkgaGVuZHJlcml0IGN1cnN1cy4gUGVsbGVudGVzcXVlIG5vbiBudW5jIGxhY3VzLCBhIHNlbXBlciBtZXR1cy4gRnVzY2UgZXVpc21vZCB2ZWxpdCBxdWlzIGRpYW0gc3VzY2lwaXQgY29uc2VxdWF0LiBQcmFlc2VudCBjb21tb2RvIGFjY3Vtc2FuIG5lcXVlLiBQcm9pbiB2aXZlcnJhLCBpcHN1bSBub24gdHJpc3RpcXVlIHV
 sdHJpY2VzLCB2ZWxpdCB2ZWxpdCBmYWNpbGlzaXMgbG9yZW0sIHZlbCBydXRydW0gbmVxdWUgZXJvcyBhYyBuaXNpLiBTdXNwZW5kaXNzZSBmZWxpcyBtYXNzYSwgZmF1Y2lidXMgaW4gdm9sdXRwYXQgYWMsIGRhcGlidXMgZXQgb2Rpby4gUGVsbGVudGVzcXVlIGlkIHRlbGx1cyBzaXQgYW1ldCByaXN1cyB1bHRyaWNpZXMgdWxsYW1jb3JwZXIgbm9uIG5lYyBzYXBpZW4uIE5hbSBwbGFjZXJhdCB2aXZlcnJhIHVsbGFtY29ycGVyLiBOYW0gcGxhY2VyYXQgcG9ydHRpdG9yIHNhcGllbiBuZWMgcHVsdmluYXIuIEN1cmFiaXR1ciB2ZWwgb2RpbyBzaXQgYW1ldCBvZGlvIGFjY3Vtc2FuIGFsaXF1ZXQgdml0YWUgYSBsZWN0dXMuIFBlbGxlbnRlc3F1ZSBsb2JvcnRpcyB2aXZlcnJhIGNvbnNlcXVhdC4gTWF1cmlzIGVsZW1lbnR1bSBjdXJzdXMgbnVsbGEsIHNpdCBhbWV0IGhlbmRyZXJpdCBqdXN0byBkaWN0dW0gc2VkLiBNYWVjZW5hcyBkaWFtIG9kaW8sIGZyaW5naWxsYSBhYyBjb25ndWUgcXVpcywgYWRpcGlzY2luZyB1dCBlbGl0LgoKQWxpcXVhbSBsb3JlbSBlcm9zLCBwaGFyZXRyYSBuZWMgZWdlc3RhcyB2aXRhZSwgbWF0dGlzIG5lYyByaXN1cy4gTWF1cmlzIGFyY3UgbWFzc2EsIHNvZGFsZXMgZWdldCBncmF2aWRhIHNlZCwgdml2ZXJyYSB2aXRhZSB0dXJwaXMuIFV0IGxpZ3VsYSB1cm5hLCBldWlzbW9kIGFjIHRpbmNpZHVudCBldSwgZmF1Y2lidXMgc2VkIGZlbGlzLiBQcmFlc2VudCBtb2xsaXMsIGlwc3Vt
 IHF1aXMgcmhvbmN1cyBkaWduaXNzaW0sIG9kaW8gc2VtIHZlbmVuYXRpcyBudWxsYSwgYXQgY29uc2VxdWF0IGZlbGlzIGF1Z3VlIHZlbCBlcmF0LiBOYW0gZmVybWVudHVtIGZldWdpYXQgdm9sdXRwYXQuIENsYXNzIGFwdGVudCB0YWNpdGkgc29jaW9zcXUgYWQgbGl0b3JhIHRvcnF1ZW50IHBlciBjb251YmlhIG5vc3RyYSwgcGVyIGluY2VwdG9zIGhpbWVuYWVvcy4gRXRpYW0gdml0YWUgZHVpIGluIG5pc2kgYWRpcGlzY2luZyB1bHRyaWNpZXMgbm9uIGV1IGp1c3RvLiBEb25lYyB0cmlzdGlxdWUgdWx0cmljaWVzIGFkaXBpc2NpbmcuIE51bGxhIHNvZGFsZXMsIG51bmMgYSB0cmlzdGlxdWUgZWxlbWVudHVtLCBlcmF0IG5lcXVlIGVnZXN0YXMgbmlzbCwgYXQgaGVuZHJlcml0IG9yY2kgc2FwaWVuIHNlZCBsaWJlcm8uIFZpdmFtdXMgYSBtYXVyaXMgdHVycGlzLCBxdWlzIGxhb3JlZXQgaXBzdW0uIE51bmMgbmVjIG1pIGV0IG5pc2wgcGVsbGVudGVzcXVlIHNjZWxlcmlzcXVlLiBWaXZhbXVzIHZvbHV0cGF0LCBqdXN0byB0cmlzdGlxdWUgbGFjaW5pYSBjb25kaW1lbnR1bSwgZXJhdCBqdXN0byB1bHRyaWNlcyB1cm5hLCBlbGVtZW50dW0gdml2ZXJyYSBlcm9zIGF1Z3VlIG5vbiBsaWJlcm8uIFNlZCBtb2xsaXMgbW9sbGlzIGFyY3UsIGF0IGZlcm1lbnR1bSBkaWFtIHN1c2NpcGl0IHF1aXMuCgpFdGlhbSBzaXQgYW1ldCBuaWJoIGp1c3RvLCBwb3N1ZXJlIHZvbHV0cGF0IG51bmMuIE1vcmJpIHBlbGxlbnRlc
 3F1ZSBuZXF1ZSBpbiBvcmNpIHZvbHV0cGF0IGV1IHNjZWxlcmlzcXVlIGxvcmVtIGRpY3R1bS4gTWF1cmlzIG1vbGxpcyBpYWN1bGlzIGVzdCwgbmVjIHNhZ2l0dGlzIHNhcGllbiBjb25zZXF1YXQgaWQuIE51bmMgbmVjIG1hbGVzdWFkYSBvZGlvLiBEdWlzIHF1aXMgc3VzY2lwaXQgb2Rpby4gTWF1cmlzIHB1cnVzIGR1aSwgc29kYWxlcyBpZCBtYXR0aXMgc2l0IGFtZXQsIHBvc3VlcmUgaW4gYXJjdS4gUGhhc2VsbHVzIHBvcnRhIGVsZW1lbnR1bSBjb252YWxsaXMuIE1hZWNlbmFzIGF0IG9yY2kgZXQgbWkgdnVscHV0YXRlIHNvbGxpY2l0dWRpbiBpbiBpbiB0dXJwaXMuIFBlbGxlbnRlc3F1ZSBjdXJzdXMgYWRpcGlzY2luZyBuZXF1ZSBzaXQgYW1ldCBjb21tb2RvLiBGdXNjZSB1dCBtaSBldSBsZWN0dXMgcG9ydHRpdG9yIHZvbHV0cGF0IGV0IG5lYyBmZWxpcy4KCkN1cmFiaXR1ciBzY2VsZXJpc3F1ZSBlcm9zIHF1aXMgbmlzbCB2aXZlcnJhIHZlbCB1bHRyaWNlcyB2ZWxpdCB2ZXN0aWJ1bHVtLiBTZWQgbG9ib3J0aXMgcHVsdmluYXIgc2FwaWVuIGFjIHZlbmVuYXRpcy4gU2VkIGFudGUgbmliaCwgcmhvbmN1cyBlZ2V0IGRpY3R1bSBpbiwgbW9sbGlzIHV0IG5pc2kuIFBoYXNlbGx1cyBmYWNpbGlzaXMgbWkgbm9uIGxvcmVtIHRyaXN0aXF1ZSBub24gZWxlaWZlbmQgc2VtIGZyaW5naWxsYS4gSW50ZWdlciB1dCBhdWd1ZSBlc3QuIEluIHZlbmVuYXRpcyB0aW5jaWR1bnQgc2NlbGVyaXNxdWUuIEV0aWFtIG
 FudGUgZHVpLCBwb3N1ZXJlIHF1aXMgbWFsZXN1YWRhIHZpdGFlLCBtYWxlc3VhZGEgYSBhcmN1LiBBZW5lYW4gZmF1Y2lidXMgdmVuZW5hdGlzIHNhcGllbiwgdXQgZmFjaWxpc2lzIG5pc2kgYmxhbmRpdCB2ZWwuIEFlbmVhbiBhYyBsb3JlbSBldSBzZW0gZmVybWVudHVtIHBsYWNlcmF0LiBQcm9pbiBuZXF1ZSBwdXJ1cywgYWxpcXVldCB1dCB0aW5jaWR1bnQgdXQsIGNvbnZhbGxpcyBzaXQgYW1ldCBlcm9zLiBQaGFzZWxsdXMgdmVoaWN1bGEgdWxsYW1jb3JwZXIgZW5pbSBub24gdmVoaWN1bGEuIEV0aWFtIHBvcnRhIG9kaW8gdXQgaXBzdW0gYWRpcGlzY2luZyBlZ2VzdGFzIGlkIGEgb2Rpby4gUGVsbGVudGVzcXVlIGJsYW5kaXQsIHNhcGllbiB1dCBwdWx2aW5hciBpbnRlcmR1bSwgbWkgbnVsbGEgaGVuZHJlcml0IGVsaXQsIGluIHRlbXBvciBkaWFtIGVuaW0gYSB1cm5hLiBJbiB0ZWxsdXMgb2Rpbywgb3JuYXJlIHNlZCBjb25kaW1lbnR1bSBhLCBtYXR0aXMgZXUgYXVndWUuCgpGdXNjZSBoZW5kcmVyaXQgcG9ydHRpdG9yIGV1aXNtb2QuIERvbmVjIG1hbGVzdWFkYSBlZ2VzdGFzIHR1cnBpcywgZXQgdWx0cmljaWVzIGZlbGlzIGVsZW1lbnR1bSB2aXRhZS4gTnVsbGFtIGluIHNlbSBuaWJoLiBOdWxsYW0gdWx0cmljaWVzIGhlbmRyZXJpdCBqdXN0byBzaXQgYW1ldCBsb2JvcnRpcy4gU2VkIHRpbmNpZHVudCwgbWF1cmlzIGF0IG9ybmFyZSBsYW9yZWV0LCBzYXBpZW4gcHVydXMgZWxlbWVudHVtIGVsaXQ
 sIG5lYyBwb3J0dGl0b3IgbmlzbCBwdXJ1cyBldCBlcmF0LiBEb25lYyBmZWxpcyBuaXNpLCBydXRydW0gdWxsYW1jb3JwZXIgZ3JhdmlkYSBhYywgdGluY2lkdW50IHNpdCBhbWV0IHVybmEuIFByb2luIHZlbCBqdXN0byB2aXRhZSBlcm9zIHNhZ2l0dGlzIGJpYmVuZHVtIGEgdXQgbmliaC4gUGhhc2VsbHVzIHNvZGFsZXMgbGFvcmVldCB0aW5jaWR1bnQuIE1hZWNlbmFzIG9kaW8gbWFzc2EsIGNvbmRpbWVudHVtIGlkIGFsaXF1ZXQgdXQsIHJob25jdXMgdmVsIGxlY3R1cy4gRHVpcyBwaGFyZXRyYSBjb25zZWN0ZXR1ciBzYXBpZW4uIFBoYXNlbGx1cyBwb3N1ZXJlIHVsdHJpY2llcyBtYXNzYSwgbm9uIHJob25jdXMgcmlzdXMgYWxpcXVhbSB0ZW1wdXMuCgpQcmFlc2VudCB2ZW5lbmF0aXMgbWFnbmEgaWQgc2VtIGRpY3R1bSBldSB2ZWhpY3VsYSBpcHN1bSB2dWxwdXRhdGUuIFNlZCBhIGNvbnZhbGxpcyBzYXBpZW4uIFNlZCBqdXN0byBkb2xvciwgcmhvbmN1cyB2ZWwgcnV0cnVtIG1hdHRpcywgc29sbGljaXR1ZGluIHV0IHJpc3VzLiBOdWxsYW0gc2l0IGFtZXQgY29udmFsbGlzIGVzdC4gRXRpYW0gbm9uIHRpbmNpZHVudCBsaWd1bGEuIEZ1c2NlIHN1c2NpcGl0IHByZXRpdW0gZWxpdCBhdCB1bGxhbWNvcnBlci4gUXVpc3F1ZSBzb2xsaWNpdHVkaW4sIGRpYW0gaWQgaW50ZXJkdW0gcG9ydGEsIG1ldHVzIGlwc3VtIHZvbHV0cGF0IGxpYmVybywgaWQgdmVuZW5hdGlzIGZlbGlzIG9yY2kgbm9uIHZlbGl0LiBT
 dXNwZW5kaXNzZSBwb3RlbnRpLiBNYXVyaXMgcnV0cnVtLCB0b3J0b3Igc2l0IGFtZXQgcGVsbGVudGVzcXVlIHRpbmNpZHVudCwgZXJhdCBxdWFtIHVsdHJpY2llcyBvZGlvLCBpZCBhbGlxdWFtIGVsaXQgbGVvIG5lYyBsZW8uIFBlbGxlbnRlc3F1ZSBqdXN0byBlcm9zLCBydXRydW0gYXQgZmV1Z2lhdCBuZWMsIHBvcnRhIGV0IHRlbGx1cy4gQWVuZWFuIGVnZXQgbWV0dXMgbGVjdHVzLgoKUHJhZXNlbnQgZXVpc21vZCwgdHVycGlzIHF1aXMgbGFvcmVldCBjb25zZXF1YXQsIG5lcXVlIGFudGUgaW1wZXJkaWV0IHF1YW0sIGFjIHNlbXBlciB0b3J0b3IgbmliaCBpbiBudWxsYS4gSW50ZWdlciBzY2VsZXJpc3F1ZSBlcm9zIHZlaGljdWxhIHVybmEgbGFjaW5pYSBhYyBmYWNpbGlzaXMgbWF1cmlzIGFjY3Vtc2FuLiBQaGFzZWxsdXMgYXQgbWF1cmlzIG5pYmguIEN1cmFiaXR1ciBlbmltIGFudGUsIHJ1dHJ1bSBzZWQgYWRpcGlzY2luZyBoZW5kcmVyaXQsIHBlbGxlbnRlc3F1ZSBub24gYXVndWUuIEluIGhhYyBoYWJpdGFzc2UgcGxhdGVhIGRpY3R1bXN0LiBOYW0gdGVtcHVzIGV1aXNtb2QgbWFzc2EgYSBkaWN0dW0uIERvbmVjIHNpdCBhbWV0IGp1c3RvIGFjIGRpYW0gdWx0cmljaWVzIHVsdHJpY2llcy4gU2VkIHRpbmNpZHVudCBlcmF0IHF1aXMgcXVhbSB0ZW1wdXMgdmVsIGludGVyZHVtIGVyYXQgcmhvbmN1cy4gSW4gaGFjIGhhYml0YXNzZSBwbGF0ZWEgZGljdHVtc3QuIFZlc3RpYnVsdW0gdmVoaWN1bGEgd
 mFyaXVzIHNlbSBlZ2V0IGludGVyZHVtLiBDcmFzIGJpYmVuZHVtIGxlbyBuZWMgZmVsaXMgdmVuZW5hdGlzIHNlZCBwaGFyZXRyYSBzZW0gZmV1Z2lhdC4gQ3VtIHNvY2lpcyBuYXRvcXVlIHBlbmF0aWJ1cyBldCBtYWduaXMgZGlzIHBhcnR1cmllbnQgbW9udGVzLCBuYXNjZXR1ciByaWRpY3VsdXMgbXVzLiBTZWQgcXVhbSBvcmNpLCBtb2xsaXMgZWdldCBzYWdpdHRpcyBhY2N1bXNhbiwgdnVscHV0YXRlIHNpdCBhbWV0IGR1aS4gUHJhZXNlbnQgZXUgZWxlbWVudHVtIGFyY3UuCgpMb3JlbSBpcHN1bSBkb2xvciBzaXQgYW1ldCwgY29uc2VjdGV0dXIgYWRpcGlzY2luZyBlbGl0LiBWZXN0aWJ1bHVtIG5pc2wgbWV0dXMsIGhlbmRyZXJpdCB1dCBsYW9yZWV0IHNlZCwgY29uc2VjdGV0dXIgYXQgcHVydXMuIER1aXMgaW50ZXJkdW0gY29uZ3VlIGxvYm9ydGlzLiBOdWxsYW0gc2VkIG1hc3NhIHBvcnRhIGZlbGlzIGVsZWlmZW5kIGNvbnNlcXVhdCBzaXQgYW1ldCBuZWMgbWV0dXMuIEFsaXF1YW0gcGxhY2VyYXQgZGljdHVtIGVyYXQgYXQgZWxlaWZlbmQuIFZlc3RpYnVsdW0gbGliZXJvIGFudGUsIHVsbGFtY29ycGVyIGEgcG9ydHRpdG9yIHN1c2NpcGl0LCBhY2N1bXNhbiB2ZWwgbmlzaS4gRG9uZWMgZXQgbWFnbmEgbmVxdWUuIE5hbSBlbGVtZW50dW0gdWx0cmljZXMganVzdG8sIGVnZXQgc29sbGljaXR1ZGluIHNhcGllbiBpbXBlcmRpZXQgZWdldC4gTnVsbGFtIGF1Y3RvciBkaWN0dW0gbnVuYywgYXQgZmV1Z2
 lhdCBvZGlvIHZlc3RpYnVsdW0gYS4gU2VkIGVyYXQgbnVsbGEsIHZpdmVycmEgaGVuZHJlcml0IGNvbW1vZG8gaWQsIHVsbGFtY29ycGVyIGFjIG9yY2kuIFBoYXNlbGx1cyBwZWxsZW50ZXNxdWUgZmV1Z2lhdCBzdXNjaXBpdC4gRXRpYW0gZWdlc3RhcyBmZXJtZW50dW0gZW5pbS4gRXRpYW0gZ3JhdmlkYSBpbnRlcmR1bSB0ZWxsdXMgYWMgbGFvcmVldC4gTW9yYmkgbWF0dGlzIGFsaXF1ZXQgZXJvcywgbm9uIHRlbXBvciBlcmF0IHVsbGFtY29ycGVyIGluLiBFdGlhbSBwdWx2aW5hciBpbnRlcmR1bSB0dXJwaXMgYWMgdmVoaWN1bGEuIFNlZCBxdWFtIGp1c3RvLCBhY2N1bXNhbiBpZCBjb25zZWN0ZXR1ciBhLCBhbGlxdWV0IHNlZCBsZW8uIEFlbmVhbiB2aXRhZSBibGFuZGl0IG1hdXJpcy4KCkluIHNlZCBlcm9zIGF1Z3VlLCBub24gcnV0cnVtIG9kaW8uIEV0aWFtIHZpdGFlIGR1aSBuZXF1ZSwgaW4gdHJpc3RpcXVlIG1hc3NhLiBWZXN0aWJ1bHVtIGFudGUgaXBzdW0gcHJpbWlzIGluIGZhdWNpYnVzIG9yY2kgbHVjdHVzIGV0IHVsdHJpY2VzIHBvc3VlcmUgY3ViaWxpYSBDdXJhZTsgTWFlY2VuYXMgZGljdHVtIGVsaXQgYXQgbGVjdHVzIHRlbXBvciBub24gcGhhcmV0cmEgbmlzbCBoZW5kcmVyaXQuIFNlZCBzZWQgcXVhbSBldSBsZWN0dXMgdWx0cmljZXMgbWFsZXN1YWRhIHRpbmNpZHVudCBhIGVzdC4gTmFtIHZlbCBlcm9zIHJpc3VzLiBNYWVjZW5hcyBlcm9zIGVsaXQsIGJsYW5kaXQgZmVybWVudHVtIHR
 lbXBvciBlZ2V0LCBsb2JvcnRpcyBpZCBkaWFtLiBWZXN0aWJ1bHVtIGxhY2luaWEgbGFjdXMgdml0YWUgbWFnbmEgdm9sdXRwYXQgZXUgZGlnbmlzc2ltIGVyb3MgY29udmFsbGlzLiBWaXZhbXVzIGFjIHZlbGl0IHRlbGx1cywgYSBjb25ndWUgbmVxdWUuIEludGVnZXIgbWkgbnVsbGEsIHZhcml1cyBub24gbHVjdHVzIGluLCBkaWN0dW0gc2l0IGFtZXQgc2VtLiBVdCBsYW9yZWV0LCBzYXBpZW4gc2l0IGFtZXQgc2NlbGVyaXNxdWUgcG9ydGEsIHB1cnVzIHNhcGllbiB2ZXN0aWJ1bHVtIG5pYmgsIHNlZCBsdWN0dXMgbGliZXJvIG1hc3NhIGFjIGVsaXQuIERvbmVjIGlhY3VsaXMgb2RpbyBlZ2V0IG9kaW8gc2FnaXR0aXMgbmVjIHZlbmVuYXRpcyBsb3JlbSBibGFuZGl0LgoKQWxpcXVhbSBpbXBlcmRpZXQgdGVsbHVzIHBvc3VlcmUganVzdG8gdmVoaWN1bGEgc2VkIHZlc3RpYnVsdW0gYW50ZSB0cmlzdGlxdWUuIEZ1c2NlIGZldWdpYXQgZmF1Y2lidXMgcHVydXMgbmVjIG1vbGVzdGllLiBOdWxsYSB0ZW1wb3IgbmVxdWUgaWQgbWFnbmEgaWFjdWxpcyBxdWlzIHNvbGxpY2l0dWRpbiBlcm9zIHNlbXBlci4gUHJhZXNlbnQgdml2ZXJyYSBzYWdpdHRpcyBsdWN0dXMuIE1vcmJpIHNpdCBhbWV0IG1hZ25hIHNlZCBvZGlvIGdyYXZpZGEgdmFyaXVzLiBVdCBuaXNpIGxpYmVybywgdnVscHV0YXRlIGZldWdpYXQgcHJldGl1bSB0ZW1wdXMsIGVnZXN0YXMgc2l0IGFtZXQganVzdG8uIFBlbGxlbnRlc3F1ZSBjb25zZXF1
 YXQgdGVtcG9yIG5pc2kgaW4gbG9ib3J0aXMuIFNlZCBmZXJtZW50dW0gY29udmFsbGlzIGR1aSBhYyBzb2xsaWNpdHVkaW4uIEludGVnZXIgYXVjdG9yIGF1Z3VlIGVnZXQgdGVsbHVzIHRlbXB1cyBmcmluZ2lsbGEuIFByb2luIG5lYyBkb2xvciBzYXBpZW4sIG5lYyB0cmlzdGlxdWUgbmliaC4gQWxpcXVhbSBhIHZlbGl0IGF0IG1pIG1hdHRpcyBhbGlxdWV0LgoKUGVsbGVudGVzcXVlIGhhYml0YW50IG1vcmJpIHRyaXN0aXF1ZSBzZW5lY3R1cyBldCBuZXR1cyBldCBtYWxlc3VhZGEgZmFtZXMgYWMgdHVycGlzIGVnZXN0YXMuIEFsaXF1YW0gdWx0cmljZXMgZXJhdCBub24gdHVycGlzIGF1Y3RvciBpZCBvcm5hcmUgbWF1cmlzIHNhZ2l0dGlzLiBRdWlzcXVlIHBvcnR0aXRvciwgdGVsbHVzIHV0IGNvbnZhbGxpcyBzYWdpdHRpcywgbWkgbGliZXJvIGZldWdpYXQgdGVsbHVzLCByaG9uY3VzIHBsYWNlcmF0IGlwc3VtIHRvcnRvciBpZCByaXN1cy4gRG9uZWMgdGluY2lkdW50IGZldWdpYXQgbGVvLiBDcmFzIGlkIG1pIG5lcXVlLCBldSBtYWxlc3VhZGEgZXJvcy4gVXQgbW9sZXN0aWUgbWFnbmEgcXVpcyBsaWJlcm8gcGxhY2VyYXQgbWFsZXN1YWRhLiBBbGlxdWFtIGVyYXQgdm9sdXRwYXQuIEFsaXF1YW0gbm9uIG1hdXJpcyBsb3JlbSwgaW4gYWRpcGlzY2luZyBtZXR1cy4gRG9uZWMgZWdldCBpcHN1bSBpbiBlbGl0IGNvbW1vZG8gb3JuYXJlIGJpYmVuZHVtIGEgbmliaC4gVml2YW11cyBvZGlvIGVyYXQsIHBsY
 WNlcmF0IGFjIHZlc3RpYnVsdW0gZWdldCwgbWFsZXN1YWRhIHV0IG5pc2kuIEV0aWFtIHN1c2NpcGl0IHNvbGxpY2l0dWRpbiBsZW8gc2VtcGVyIHNvbGxpY2l0dWRpbi4gU2VkIHJob25jdXMgcmlzdXMgc2l0IGFtZXQgc2VtIGVsZWlmZW5kIGRpY3R1bSBwcmV0aXVtIHNhcGllbiBlZ2VzdGFzLiBOdWxsYSBhdCB1cm5hIG51bmMsIHZlbCBhbGlxdWV0IGxlby4gUHJhZXNlbnQgdWx0cmljaWVzLCBtaSBldSBwcmV0aXVtIGxvYm9ydGlzLCBlcmF0IG5pYmggZXVpc21vZCBsZW8sIHNpdCBhbWV0IGdyYXZpZGEgc2FwaWVuIGVyb3MgZXQgdHVycGlzLiBEb25lYyBsYWNpbmlhIHZlbmVuYXRpcyBsZWN0dXMsIG5vbiBsYWNpbmlhIG1pIGhlbmRyZXJpdCBzaXQgYW1ldC4gSW50ZWdlciBzZWQgZmVsaXMgdmVsIG9yY2kgYWxpcXVhbSBwdWx2aW5hci4gUGhhc2VsbHVzIGV0IHJpc3VzIGlkIGVyYXQgZXVpc21vZCB0aW5jaWR1bnQuIFNlZCBsdWN0dXMgdGVtcG9yIG5pc2ksIG5lYyB0ZW1wb3IgaXBzdW0gZWxlbWVudHVtIGVnZXQuIEludGVnZXIgbmlzbCB0b3J0b3IsIHZpdmVycmEgaW4gZGFwaWJ1cyBhdCwgbWF0dGlzIGFjIGVyYXQuIEN1cmFiaXR1ciBuZWMgZHVpIGxlY3R1cy4KClBoYXNlbGx1cyBzdXNjaXBpdCwgdG9ydG9yIGV1IHZhcml1cyBmcmluZ2lsbGEsIHNhcGllbiBtYWduYSBlZ2VzdGFzIHJpc3VzLCB1dCBzdXNjaXBpdCBkdWkgbWF1cmlzIHF1aXMgdmVsaXQuIENyYXMgYSBzYXBpZW4gcXVpcyBzYX
 BpZW4gaGVuZHJlcml0IHRyaXN0aXF1ZSBhIHNpdCBhbWV0IGVsaXQuIFBlbGxlbnRlc3F1ZSBkdWkgYXJjdSwgbWFsZXN1YWRhIGV0IHNvZGFsZXMgc2l0IGFtZXQsIGRhcGlidXMgdmVsIHF1YW0uIFNlZCBub24gYWRpcGlzY2luZyBsaWd1bGEuIFV0IHZ1bHB1dGF0ZSBwdXJ1cyBhdCBuaXNsIHBvc3VlcmUgc29kYWxlcy4gTWFlY2VuYXMgZGlhbSB2ZWxpdCwgdGluY2lkdW50IGlkIG1hdHRpcyBldSwgYWxpcXVhbSBhYyBuaXNpLiBNYWVjZW5hcyBwcmV0aXVtLCBhdWd1ZSBhIHNhZ2l0dGlzIHN1c2NpcGl0LCBsZW8gbGlndWxhIGVsZWlmZW5kIGRvbG9yLCBtb2xsaXMgZmV1Z2lhdCBvZGlvIGF1Z3VlIG5vbiBlcm9zLiBQZWxsZW50ZXNxdWUgc2NlbGVyaXNxdWUgb3JjaSBwcmV0aXVtIHF1YW0gbW9sbGlzIGF0IGxvYm9ydGlzIGR1aSBmYWNpbGlzaXMuIE1vcmJpIGNvbmd1ZSBtZXR1cyBpZCB0b3J0b3IgcG9ydGEgZnJpbmdpbGxhLiBTZWQgbG9yZW0gbWksIG1vbGVzdGllIGZlcm1lbnR1bSBzYWdpdHRpcyBhdCwgZ3JhdmlkYSBhIG5pc2kuIERvbmVjIGV1IHZlc3RpYnVsdW0gdmVsaXQuIEluIHZpdmVycmEsIGVuaW0gZXUgZWxlbWVudHVtIHNvZGFsZXMsIGVuaW0gb2RpbyBkYXBpYnVzIHVybmEsIGVnZXQgY29tbW9kbyBuaXNsIG1hdXJpcyB1dCBvZGlvLiBDdXJhYml0dXIgbmVjIGVuaW0gbnVsbGEuIEluIG5lYyBlbGl0IGlwc3VtLiBOdW5jIGluIG1hc3NhIHN1c2NpcGl0IG1hZ25hIGVsZW1lbnR1bSB
 mYXVjaWJ1cyBpbiBuZWMgaXBzdW0uIE51bGxhbSBzdXNjaXBpdCBtYWxlc3VhZGEgZWxlbWVudHVtLiBFdGlhbSBzZWQgbWkgaW4gbmliaCB1bHRyaWNpZXMgdmVuZW5hdGlzIG5lYyBwaGFyZXRyYSBtYWduYS4gSW4gcHVydXMgYW50ZSwgcmhvbmN1cyB2ZWwgcGxhY2VyYXQgc2VkLCBmZXJtZW50dW0gc2l0IGFtZXQgZHVpLiBTZWQgYXQgc29kYWxlcyB2ZWxpdC4KCkR1aXMgc3VzY2lwaXQgcGVsbGVudGVzcXVlIHBlbGxlbnRlc3F1ZS4gUHJhZXNlbnQgcG9ydGEgbG9ib3J0aXMgY3Vyc3VzLiBRdWlzcXVlIHNhZ2l0dGlzIHZlbGl0IG5vbiB0ZWxsdXMgYmliZW5kdW0gYXQgc29sbGljaXR1ZGluIGxhY3VzIGFsaXF1ZXQuIFNlZCBuaWJoIHJpc3VzLCBibGFuZGl0IGEgYWxpcXVldCBlZ2V0LCB2ZWhpY3VsYSBldCBlc3QuIFN1c3BlbmRpc3NlIGZhY2lsaXNpcyBiaWJlbmR1bSBhbGlxdWFtLiBGdXNjZSBjb25zZWN0ZXR1ciBjb252YWxsaXMgZXJhdCwgZWdldCBtb2xsaXMgZGlhbSBmZXJtZW50dW0gc29sbGljaXR1ZGluLiBRdWlzcXVlIHRpbmNpZHVudCBwb3J0dGl0b3IgcHJldGl1bS4gTnVsbGFtIGlkIG5pc2wgZXQgdXJuYSB2dWxwdXRhdGUgZGFwaWJ1cy4gRG9uZWMgcXVpcyBsb3JlbSB1cm5hLiBRdWlzcXVlIGlkIGp1c3RvIG5lYyBudW5jIGJsYW5kaXQgY29udmFsbGlzLiBOdW5jIHZvbHV0cGF0LCBtYXNzYSBzb2xsaWNpdHVkaW4gYWRpcGlzY2luZyB2ZXN0aWJ1bHVtLCBtYXNzYSB1cm5hIGNvbmd1
 ZSBsZWN0dXMsIHNpdCBhbWV0IHVsdHJpY2llcyBhdWd1ZSBvcmNpIGNvbnZhbGxpcyB0dXJwaXMuIE51bGxhIGF0IGxvcmVtIGVsaXQuIE51bmMgdHJpc3RpcXVlLCBxdWFtIGZhY2lsaXNpcyBjb21tb2RvIHBvcnR0aXRvciwgbGFjdXMgbGlndWxhIGFjY3Vtc2FuIG5pc2ksIGV0IGxhb3JlZXQganVzdG8gYW50ZSB2aXRhZSBlcm9zLiBDdXJhYml0dXIgc2VkIGF1Z3VlIGFyY3UuIFBoYXNlbGx1cyBwb3J0dGl0b3IgdmVzdGlidWx1bSBmZWxpcywgdXQgY29uc2VjdGV0dXIgYXJjdSB0ZW1wb3Igbm9uLiBJbiBqdXN0byByaXN1cywgc2VtcGVyIGV0IHN1c2NpcGl0IGlkLCB1bGxhbWNvcnBlciBhdCB1cm5hLiBRdWlzcXVlIHRpbmNpZHVudCwgdXJuYSBuZWMgYWxpcXVhbSB0cmlzdGlxdWUsIG5pYmggb2RpbyBmYXVjaWJ1cyBhdWd1ZSwgaW4gb3JuYXJlIGVuaW0gdHVycGlzIGFjY3Vtc2FuIGRvbG9yLiBQZWxsZW50ZXNxdWUgaGFiaXRhbnQgbW9yYmkgdHJpc3RpcXVlIHNlbmVjdHVzIGV0IG5ldHVzIGV0IG1hbGVzdWFkYSBmYW1lcyBhYyB0dXJwaXMgZWdlc3Rhcy4gU3VzcGVuZGlzc2Ugc29kYWxlcyB2YXJpdXMgdHVycGlzIGV1IGZlcm1lbnR1bS4KCk1vcmJpIHVsdHJpY2llcyBkaWFtIGVnZXQgbWFzc2EgcG9zdWVyZSBsb2JvcnRpcy4gQWxpcXVhbSB2b2x1dHBhdCBwZWxsZW50ZXNxdWUgZW5pbSBldSBwb3J0dGl0b3IuIERvbmVjIGxhY3VzIGZlbGlzLCBjb25zZWN0ZXR1ciBhIHByZXRpdW0gdml0YWUsI
 GJpYmVuZHVtIG5vbiBlbmltLiBQZWxsZW50ZXNxdWUgaGFiaXRhbnQgbW9yYmkgdHJpc3RpcXVlIHNlbmVjdHVzIGV0IG5ldHVzIGV0IG1hbGVzdWFkYSBmYW1lcyBhYyB0dXJwaXMgZWdlc3Rhcy4gRXRpYW0gdXQgbmliaCBhIHF1YW0gcGVsbGVudGVzcXVlIGF1Y3RvciB1dCBpZCB2ZWxpdC4gRHVpcyBsYWNpbmlhIGp1c3RvIGVnZXQgbWkgcGxhY2VyYXQgYmliZW5kdW0uIEN1bSBzb2NpaXMgbmF0b3F1ZSBwZW5hdGlidXMgZXQgbWFnbmlzIGRpcyBwYXJ0dXJpZW50IG1vbnRlcywgbmFzY2V0dXIgcmlkaWN1bHVzIG11cy4gRG9uZWMgdmVsaXQgdG9ydG9yLCB0ZW1wdXMgbmVjIHRyaXN0aXF1ZSBpZCwgYWxpcXVldCBzaXQgYW1ldCB0dXJwaXMuIFByYWVzZW50IGV0IG5lcXVlIG5lYyBtYWduYSBwb3J0YSBmcmluZ2lsbGEuIE1vcmJpIGlkIGVnZXN0YXMgZXJvcy4gRG9uZWMgc2VtcGVyIHRpbmNpZHVudCB1bGxhbWNvcnBlci4gUGhhc2VsbHVzIHRlbXB1cyBsYWNpbmlhIGhlbmRyZXJpdC4gUXVpc3F1ZSBmYXVjaWJ1cyBwcmV0aXVtIG5lcXVlIG5vbiBjb252YWxsaXMuIE51bmMgbWFsZXN1YWRhIGFjY3Vtc2FuIHJob25jdXMuIENyYXMgbG9ib3J0aXMsIHNlbSBzZWQgZnJpbmdpbGxhIGNvbnZhbGxpcywgYXVndWUgdmVsaXQgc2VtcGVyIG5pc2wsIGNvbW1vZG8gdmFyaXVzIG5pc2kgZGlhbSBhYyBsZW8uCgpRdWlzcXVlIGludGVyZHVtIHRlbGx1cyBhYyBhbnRlIHBvc3VlcmUgdXQgY3Vyc3VzIGxvcmVtIG
 VnZXN0YXMuIE51bGxhIGZhY2lsaXNpLiBBZW5lYW4gc2VkIG1hc3NhIG5lYyBuaXNpIHNjZWxlcmlzcXVlIHZ1bHB1dGF0ZS4gRXRpYW0gY29udmFsbGlzIGNvbnNlY3RldHVyIGlhY3VsaXMuIE1hZWNlbmFzIGFjIHB1cnVzIHV0IGFudGUgZGlnbmlzc2ltIGF1Y3RvciBhYyBxdWlzIGxvcmVtLiBQZWxsZW50ZXNxdWUgc3VzY2lwaXQgdGluY2lkdW50IG9yY2kuIEZ1c2NlIGFsaXF1YW0gZGFwaWJ1cyBvcmNpLCBhdCBiaWJlbmR1bSBpcHN1bSBhZGlwaXNjaW5nIGVnZXQuIE1vcmJpIHBlbGxlbnRlc3F1ZSBoZW5kcmVyaXQgcXVhbSwgbmVjIHBsYWNlcmF0IHVybmEgdnVscHV0YXRlIHNlZC4gUXVpc3F1ZSB2ZWwgZGlhbSBsb3JlbS4gUHJhZXNlbnQgaWQgZGlhbSBxdWlzIGVuaW0gZWxlbWVudHVtIHJob25jdXMgc2FnaXR0aXMgZWdldCBwdXJ1cy4gUXVpc3F1ZSBmcmluZ2lsbGEgYmliZW5kdW0gbGVvIGluIGxhb3JlZXQuIFZlc3RpYnVsdW0gaWQgbmliaCByaXN1cywgbm9uIGVsZW1lbnR1bSBtZXR1cy4gVXQgYSBmZWxpcyBkaWFtLCBub24gbW9sbGlzIG5pc2wuIENyYXMgZWxpdCBhbnRlLCB1bGxhbWNvcnBlciBxdWlzIGlhY3VsaXMgZXUsIHNvZGFsZXMgdmVsIGVzdC4gQ3VyYWJpdHVyIHF1aXMgbG9ib3J0aXMgZG9sb3IuIEFsaXF1YW0gbWF0dGlzIGdyYXZpZGEgbWV0dXMgcGVsbGVudGVzcXVlIHZ1bHB1dGF0ZS4KClV0IGlkIGF1Z3VlIGlkIGRvbG9yIGx1Y3R1cyBldWlzbW9kIGV0IHF1aXMgdmVsaXQ
 uIE1hZWNlbmFzIGVuaW0gZG9sb3IsIHRlbXB1cyBzaXQgYW1ldCBoZW5kcmVyaXQgZXUsIGZhdWNpYnVzIHZpdGFlIG5lcXVlLiBQcm9pbiBzaXQgYW1ldCB2YXJpdXMgZWxpdC4gUHJvaW4gdmFyaXVzIGZlbGlzIHVsbGFtY29ycGVyIHB1cnVzIGRpZ25pc3NpbSBjb25zZXF1YXQuIENyYXMgY3Vyc3VzIHRlbXB1cyBlcm9zLiBOdW5jIHVsdHJpY2VzIHZlbmVuYXRpcyB1bGxhbWNvcnBlci4gQWxpcXVhbSBldCBmZXVnaWF0IHRlbGx1cy4gUGhhc2VsbHVzIHNpdCBhbWV0IHZlc3RpYnVsdW0gZWxpdC4gUGhhc2VsbHVzIGFjIHB1cnVzIGxhY3VzLCBldCBhY2N1bXNhbiBlcm9zLiBNb3JiaSB1bHRyaWNlcywgcHVydXMgYSBwb3J0YSBzb2RhbGVzLCBvZGlvIG1ldHVzIHBvc3VlcmUgbmVxdWUsIG5lYyBlbGVtZW50dW0gcmlzdXMgdHVycGlzIHNpdCBhbWV0IG1hZ25hLiBTZWQgZXN0IHF1YW0sIHVsdHJpY2llcyBhdCBjb25ndWUgYWRpcGlzY2luZywgbG9ib3J0aXMgaW4ganVzdG8uIFByb2luIGlhY3VsaXMgZGljdHVtIG51bmMsIGV1IGxhb3JlZXQgcXVhbSB2YXJpdXMgdml0YWUuIERvbmVjIHNpdCBhbWV0IGZldWdpYXQgdHVycGlzLiBNYXVyaXMgc2l0IGFtZXQgbWFnbmEgcXVhbSwgYWMgY29uc2VjdGV0dXIgZHVpLiBDdXJhYml0dXIgZWdldCBtYWduYSB0ZWxsdXMsIGV1IHBoYXJldHJhIGZlbGlzLiBEb25lYyBzaXQgYW1ldCB0b3J0b3IgbmlzbC4gQWxpcXVhbSBldCB0b3J0b3IgZmFjaWxpc2lzIGxhY3Vz
 IHRpbmNpZHVudCBjb21tb2RvLiBQZWxsZW50ZXNxdWUgaGFiaXRhbnQgbW9yYmkgdHJpc3RpcXVlIHNlbmVjdHVzIGV0IG5ldHVzIGV0IG1hbGVzdWFkYSBmYW1lcyBhYyB0dXJwaXMgZWdlc3Rhcy4gQ3VyYWJpdHVyIG51bmMgbWFnbmEsIHVsdHJpY2llcyBpZCBjb252YWxsaXMgYXQsIHVsbGFtY29ycGVyIHZpdGFlIG1hc3NhLgoKUGhhc2VsbHVzIHZpdmVycmEgaWFjdWxpcyBwbGFjZXJhdC4gTnVsbGEgY29uc2VxdWF0IGRvbG9yIHNpdCBhbWV0IGVyYXQgZGlnbmlzc2ltIHBvc3VlcmUuIE51bGxhIGxhY2luaWEgYXVndWUgdml0YWUgbWkgdGVtcG9yIGdyYXZpZGEuIFBoYXNlbGx1cyBub24gdGVtcG9yIHRlbGx1cy4gUXVpc3F1ZSBub24gZW5pbSBzZW1wZXIgdG9ydG9yIHNhZ2l0dGlzIGZhY2lsaXNpcy4gQWxpcXVhbSB1cm5hIGZlbGlzLCBlZ2VzdGFzIGF0IHBvc3VlcmUgbmVjLCBhbGlxdWV0IGV1IG5pYmguIFByYWVzZW50IHNlZCB2ZXN0aWJ1bHVtIGVuaW0uIE1hdXJpcyBpYWN1bGlzIHZlbGl0IGR1aSwgZXQgZnJpbmdpbGxhIGVuaW0uIE51bGxhIG5lYyBuaXNpIG9yY2kuIFNlZCB2b2x1dHBhdCwganVzdG8gZWdldCBmcmluZ2lsbGEgYWRpcGlzY2luZywgbmlzbCBudWxsYSBjb25kaW1lbnR1bSBsaWJlcm8sIHNlZCBzb2RhbGVzIGVzdCBlc3QgZXQgb2Rpby4gQ3JhcyBpcHN1bSBkdWksIHZhcml1cyBldSBlbGVtZW50dW0gY29uc2VxdWF0LCBmYXVjaWJ1cyBpbiBsZW8uIFBlbGxlbnRlc3F1ZSBoY
 WJpdGFudCBtb3JiaSB0cmlzdGlxdWUgc2VuZWN0dXMgZXQgbmV0dXMgZXQgbWFsZXN1YWRhIGZhbWVzIGFjIHR1cnBpcyBlZ2VzdGFzLgoKVXQgbWFsZXN1YWRhIG1vbGVzdGllIGVsZWlmZW5kLiBDdXJhYml0dXIgaWQgZW5pbSBkdWksIGV1IHRpbmNpZHVudCBuaWJoLiBNYXVyaXMgc2l0IGFtZXQgYW50ZSBsZW8uIER1aXMgdHVycGlzIGlwc3VtLCBiaWJlbmR1bSBzZWQgbWF0dGlzIHNpdCBhbWV0LCBhY2N1bXNhbiBxdWlzIGRvbG9yLiBWZXN0aWJ1bHVtIGFudGUgaXBzdW0gcHJpbWlzIGluIGZhdWNpYnVzIG9yY2kgbHVjdHVzIGV0IHVsdHJpY2VzIHBvc3VlcmUgY3ViaWxpYSBDdXJhZTsgQWVuZWFuIGEgaW1wZXJkaWV0IG1ldHVzLiBRdWlzcXVlIHNvbGxpY2l0dWRpbiBmZWxpcyBpZCBuZXF1ZSB0ZW1wb3Igc2NlbGVyaXNxdWUuIERvbmVjIGF0IG9yY2kgZmVsaXMuIFZpdmFtdXMgdGVtcHVzIGNvbnZhbGxpcyBhdWN0b3IuIERvbmVjIGludGVyZHVtIGV1aXNtb2QgbG9ib3J0aXMuIFNlZCBhdCBsYWN1cyBuZWMgb2RpbyBkaWduaXNzaW0gbW9sbGlzLiBTZWQgc2FwaWVuIG9yY2ksIHBvcnR0aXRvciB0ZW1wdXMgYWNjdW1zYW4gdmVsLCB0aW5jaWR1bnQgbmVjIGFudGUuIE51bmMgcmhvbmN1cyBlZ2VzdGFzIGRhcGlidXMuIFN1c3BlbmRpc3NlIGZlcm1lbnR1bSBkaWN0dW0gZnJpbmdpbGxhLiBOdWxsYW0gbmlzaSBqdXN0bywgZWxlaWZlbmQgYSBjb25zZWN0ZXR1ciBjb252YWxsaXMsIHBvcnR0aXRvci
 BldCB0b3J0b3IuIFByb2luIHZpdGFlIGxvcmVtIG5vbiBkb2xvciBzdXNjaXBpdCBsYWNpbmlhIGV1IGVnZXQgbnVsbGEuCgpTdXNwZW5kaXNzZSBlZ2VzdGFzLCBzYXBpZW4gc2l0IGFtZXQgYmxhbmRpdCBzY2VsZXJpc3F1ZSwgbnVsbGEgYXJjdSB0cmlzdGlxdWUgZHVpLCBhIHBvcnRhIGp1c3RvIHF1YW0gdml0YWUgYXJjdS4gSW4gbWV0dXMgbGliZXJvLCBiaWJlbmR1bSBub24gdm9sdXRwYXQgdXQsIGxhb3JlZXQgdmVsIHR1cnBpcy4gTnVuYyBmYXVjaWJ1cyB2ZWxpdCBldSBpcHN1bSBjb21tb2RvIG5lYyBpYWN1bGlzIGVyb3Mgdm9sdXRwYXQuIFZpdmFtdXMgY29uZ3VlIGF1Y3RvciBlbGl0IHNlZCBzdXNjaXBpdC4gRHVpcyBjb21tb2RvLCBsaWJlcm8gZXUgdmVzdGlidWx1bSBmZXVnaWF0LCBsZW8gbWkgZGFwaWJ1cyB0ZWxsdXMsIGluIHBsYWNlcmF0IG5pc2wgZHVpIGF0IGVzdC4gVmVzdGlidWx1bSB2aXZlcnJhIHRyaXN0aXF1ZSBsb3JlbSwgb3JuYXJlIGVnZXN0YXMgZXJhdCBydXRydW0gYS4gTnVsbGFtIGF0IGF1Z3VlIG1hc3NhLCB1dCBjb25zZWN0ZXR1ciBpcHN1bS4gUGVsbGVudGVzcXVlIG1hbGVzdWFkYSwgdmVsaXQgdXQgbG9ib3J0aXMgc2FnaXR0aXMsIG5pc2kgbWFzc2Egc2VtcGVyIG9kaW8sIG1hbGVzdWFkYSBzZW1wZXIgcHVydXMgbmlzbCB2ZWwgbGVjdHVzLiBOdW5jIGR1aSBzZW0sIG1hdHRpcyB2aXRhZSBsYW9yZWV0IHZpdGFlLCBzb2xsaWNpdHVkaW4gYWMgbGVvLiBOdWxsYSB
 2ZWwgZmVybWVudHVtIGVzdC4KClZpdmFtdXMgaW4gb2RpbyBhIG5pc2kgZGlnbmlzc2ltIHJob25jdXMgaW4gaW4gbGFjdXMuIERvbmVjIGV0IG5pc2wgdG9ydG9yLiBEb25lYyBzYWdpdHRpcyBjb25zZXF1YXQgbWksIHZlbCBwbGFjZXJhdCB0ZWxsdXMgY29udmFsbGlzIGlkLiBBbGlxdWFtIGZhY2lsaXNpcyBydXRydW0gbmlzbCBzZWQgcHJldGl1bS4gRG9uZWMgZXQgbGFjaW5pYSBuaXNsLiBBbGlxdWFtIGVyYXQgdm9sdXRwYXQuIEN1cmFiaXR1ciBhYyBwdWx2aW5hciB0ZWxsdXMuIE51bGxhbSB2YXJpdXMgbG9ib3J0aXMgcG9ydGEuIENyYXMgZGFwaWJ1cywgbGlndWxhIHV0IHBvcnRhIHVsdHJpY2llcywgbGVvIGxhY3VzIHZpdmVycmEgcHVydXMsIHF1aXMgbW9sbGlzIHVybmEgcmlzdXMgZXUgbGVvLiBOdW5jIG1hbGVzdWFkYSBjb25zZWN0ZXR1ciBwdXJ1cywgdmVsIGF1Y3RvciBsZWN0dXMgc2NlbGVyaXNxdWUgcG9zdWVyZS4gTWFlY2VuYXMgZHVpIG1hc3NhLCB2ZXN0aWJ1bHVtIGJpYmVuZHVtIGJsYW5kaXQgbm9uLCBpbnRlcmR1bSBlZ2V0IG1hdXJpcy4gUGhhc2VsbHVzIGVzdCBhbnRlLCBwdWx2aW5hciBhdCBpbXBlcmRpZXQgcXVpcywgaW1wZXJkaWV0IHZlbCB1cm5hLiBRdWlzcXVlIGVnZXQgdm9sdXRwYXQgb3JjaS4gUXVpc3F1ZSBldCBhcmN1IHB1cnVzLCB1dCBmYXVjaWJ1cyB2ZWxpdC4KClByYWVzZW50IHNlZCBpcHN1bSB1cm5hLiBQcmFlc2VudCBzYWdpdHRpcyB2YXJpdXMgbWFnbmEs
 IGlkIGNvbW1vZG8gZG9sb3IgbWFsZXN1YWRhIGFjLiBQZWxsZW50ZXNxdWUgaGFiaXRhbnQgbW9yYmkgdHJpc3RpcXVlIHNlbmVjdHVzIGV0IG5ldHVzIGV0IG1hbGVzdWFkYSBmYW1lcyBhYyB0dXJwaXMgZWdlc3Rhcy4gUXVpc3F1ZSBzaXQgYW1ldCBudW5jIGV1IHNlbSBvcm5hcmUgdGVtcG9yLiBNYXVyaXMgaWQgZG9sb3IgbmVjIGVyYXQgY29udmFsbGlzIHBvcnRhIGluIGxvYm9ydGlzIG5pc2kuIEN1cmFiaXR1ciBoZW5kcmVyaXQgcmhvbmN1cyB0b3J0b3IgZXUgaGVuZHJlcml0LiBQZWxsZW50ZXNxdWUgZXUgYW50ZSB2ZWwgZWxpdCBsdWN0dXMgZWxlaWZlbmQgcXVpcyB2aXZlcnJhIG51bGxhLiBTdXNwZW5kaXNzZSBvZGlvIGRpYW0sIGV1aXNtb2QgZXUgcG9ydHRpdG9yIG1vbGVzdGllLCBzb2xsaWNpdHVkaW4gc2l0IGFtZXQgbnVsbGEuIFNlZCBhbnRlIHVybmEsIGRpY3R1bSBiaWJlbmR1bSByaG9uY3VzIGV0LCBibGFuZGl0IG5lYyBhbnRlLiBTdXNwZW5kaXNzZSB0b3J0b3IgYXVndWUsIGFjY3Vtc2FuIHF1aXMgc3VzY2lwaXQgaWQsIGFjY3Vtc2FuIHNpdCBhbWV0IGVyYXQuIERvbmVjIHBoYXJldHJhIHZhcml1cyBsb2JvcnRpcy4gTWFlY2VuYXMgaXBzdW0gZGlhbSwgZmF1Y2lidXMgZXUgdGVtcHVzIGlkLCBjb252YWxsaXMgbmVjIGVuaW0uIER1aXMgYXJjdSB0dXJwaXMsIGZyaW5naWxsYSBuZWMgZWdlc3RhcyB1dCwgZGlnbmlzc2ltIHRyaXN0aXF1ZSBudWxsYS4gQ3VyYWJpdHVyIHN1c2Npc
 Gl0IGR1aSBub24ganVzdG8gdWx0cmljZXMgcGhhcmV0cmEuIEFsaXF1YW0gZXJhdCB2b2x1dHBhdC4gTnVsbGEgZmFjaWxpc2kuIFF1aXNxdWUgaWQgZmVsaXMgZXUgc2VtIGFsaXF1YW0gZnJpbmdpbGxhLgoKRXRpYW0gcXVpcyBhdWd1ZSBpbiB0ZWxsdXMgY29uc2VxdWF0IGVsZWlmZW5kLiBBZW5lYW4gZGlnbmlzc2ltIGNvbmd1ZSBmZWxpcyBpZCBlbGVtZW50dW0uIER1aXMgZnJpbmdpbGxhIHZhcml1cyBpcHN1bSwgbmVjIHN1c2NpcGl0IGxlbyBzZW1wZXIgdmVsLiBVdCBzb2xsaWNpdHVkaW4sIG9yY2kgYSB0aW5jaWR1bnQgYWNjdW1zYW4sIGRpYW0gbGVjdHVzIGxhb3JlZXQgbGFjdXMsIHZlbCBmZXJtZW50dW0gcXVhbSBlc3QgdmVsIGVyb3MuIEFsaXF1YW0gZnJpbmdpbGxhIHNhcGllbiBhYyBzYXBpZW4gZmF1Y2lidXMgY29udmFsbGlzLiBBbGlxdWFtIGlkIG51bmMgZXUganVzdG8gY29uc2VxdWF0IHRpbmNpZHVudC4gUXVpc3F1ZSBuZWMgbmlzbCBkdWkuIFBoYXNlbGx1cyBhdWd1ZSBsZWN0dXMsIHZhcml1cyB2aXRhZSBhdWN0b3IgdmVsLCBydXRydW0gYXQgcmlzdXMuIFZpdmFtdXMgbGFjaW5pYSBsZW8gcXVpcyBuZXF1ZSB1bHRyaWNlcyBuZWMgZWxlbWVudHVtIGZlbGlzIGZyaW5naWxsYS4gUHJvaW4gdmVsIHBvcnR0aXRvciBsZWN0dXMuCgpDdXJhYml0dXIgc2FwaWVuIGxvcmVtLCBtb2xsaXMgdXQgYWNjdW1zYW4gbm9uLCB1bHRyaWNpZXMgZXQgbWV0dXMuIEN1cmFiaXR1ciB2ZWwgbG9yZW
 0gcXVpcyBzYXBpZW4gZnJpbmdpbGxhIGxhb3JlZXQuIE1vcmJpIGlkIHVybmEgYWMgb3JjaSBlbGVtZW50dW0gYmxhbmRpdCBlZ2V0IHZvbHV0cGF0IG5lcXVlLiBQZWxsZW50ZXNxdWUgc2VtIG9kaW8sIGlhY3VsaXMgZXUgcGhhcmV0cmEgdml0YWUsIGN1cnN1cyBpbiBxdWFtLiBOdWxsYSBtb2xlc3RpZSBsaWd1bGEgaWQgbWFzc2EgbHVjdHVzIGV0IHB1bHZpbmFyIG5pc2kgcHVsdmluYXIuIE51bmMgZmVybWVudHVtIGF1Z3VlIGEgbGFjdXMgZnJpbmdpbGxhIHJob25jdXMgcG9ydHRpdG9yIGVyYXQgZGljdHVtLiBOdW5jIHNpdCBhbWV0IHRlbGx1cyBldCBkdWkgdml2ZXJyYSBhdWN0b3IgZXVpc21vZCBhdCBuaXNsLiBJbiBzZWQgY29uZ3VlIG1hZ25hLiBQcm9pbiBldCB0b3J0b3IgdXQgYXVndWUgcGxhY2VyYXQgZGlnbmlzc2ltIGEgZXUganVzdG8uIE1vcmJpIHBvcnR0aXRvciBwb3J0YSBsb2JvcnRpcy4gUGVsbGVudGVzcXVlIG5pYmggbGFjdXMsIGFkaXBpc2NpbmcgdXQgdHJpc3RpcXVlIHF1aXMsIGNvbnNlcXVhdCB2aXRhZSB2ZWxpdC4gTWFlY2VuYXMgdXQgbHVjdHVzIGxpYmVyby4gVml2YW11cyBhdWN0b3Igb2RpbyBldCBlcmF0IHNlbXBlciBzYWdpdHRpcy4gVml2YW11cyBpbnRlcmR1bSB2ZWxpdCBpbiByaXN1cyBtYXR0aXMgcXVpcyBkaWN0dW0gYW50ZSByaG9uY3VzLiBJbiBzYWdpdHRpcyBwb3J0dGl0b3IgZXJvcywgYXQgbG9ib3J0aXMgbWV0dXMgdWx0cmljZXMgdmVsLiBDdXJhYml0dXI
 gbm9uIGFsaXF1YW0gbmlzbC4gVmVzdGlidWx1bSBsdWN0dXMgZmV1Z2lhdCBzdXNjaXBpdC4gRXRpYW0gbm9uIGxhY3VzIHZlbCBudWxsYSBlZ2VzdGFzIGlhY3VsaXMgaWQgcXVpcyByaXN1cy4KCkV0aWFtIGluIGF1Y3RvciB1cm5hLiBGdXNjZSB1bHRyaWNpZXMgbW9sZXN0aWUgY29udmFsbGlzLiBJbiBoYWMgaGFiaXRhc3NlIHBsYXRlYSBkaWN0dW1zdC4gVmVzdGlidWx1bSBhbnRlIGlwc3VtIHByaW1pcyBpbiBmYXVjaWJ1cyBvcmNpIGx1Y3R1cyBldCB1bHRyaWNlcyBwb3N1ZXJlIGN1YmlsaWEgQ3VyYWU7IE1hdXJpcyBpYWN1bGlzIGxvcmVtIGZhdWNpYnVzIHB1cnVzIGdyYXZpZGEgYXQgY29udmFsbGlzIHR1cnBpcyBzb2xsaWNpdHVkaW4uIFN1c3BlbmRpc3NlIGF0IHZlbGl0IGxvcmVtLCBhIGZlcm1lbnR1bSBpcHN1bS4gRXRpYW0gY29uZGltZW50dW0sIGR1aSB2ZWwgY29uZGltZW50dW0gZWxlbWVudHVtLCBzYXBpZW4gc2VtIGJsYW5kaXQgc2FwaWVuLCBldCBwaGFyZXRyYSBsZW8gbmVxdWUgZXQgbGVjdHVzLiBOdW5jIHZpdmVycmEgdXJuYSBpYWN1bGlzIGF1Z3VlIHVsdHJpY2VzIGFjIHBvcnR0aXRvciBsYWN1cyBkaWduaXNzaW0uIEFsaXF1YW0gdXQgdHVycGlzIGR1aS4gU2VkIGVnZXQgYWxpcXVldCBmZWxpcy4gSW4gYmliZW5kdW0gbmliaCBzaXQgYW1ldCBzYXBpZW4gYWNjdW1zYW4gYWNjdW1zYW4gcGhhcmV0cmEgbWFnbmEgbW9sZXN0aWUuCgpNYXVyaXMgYWxpcXVldCB1cm5hIGVnZXQg
 bGVjdHVzIGFkaXBpc2NpbmcgYXQgY29uZ3VlIHR1cnBpcyBjb25zZXF1YXQuIFZpdmFtdXMgdGluY2lkdW50IGZlcm1lbnR1bSByaXN1cyBldCBmZXVnaWF0LiBOdWxsYSBtb2xlc3RpZSB1bGxhbWNvcnBlciBuaWJoIHNlZCBmYWNpbGlzaXMuIFBoYXNlbGx1cyBldCBjdXJzdXMgcHVydXMuIE5hbSBjdXJzdXMsIGR1aSBkaWN0dW0gdWx0cmljZXMgdml2ZXJyYSwgZXJhdCByaXN1cyB2YXJpdXMgZWxpdCwgZXUgbW9sZXN0aWUgZHVpIGVyb3MgcXVpcyBxdWFtLiBBbGlxdWFtIGV0IGFudGUgbmVxdWUsIGFjIGNvbnNlY3RldHVyIGR1aS4gRG9uZWMgY29uZGltZW50dW0gZXJhdCBpZCBlbGl0IGRpY3R1bSBzZWQgYWNjdW1zYW4gbGVvIHNhZ2l0dGlzLiBQcm9pbiBjb25zZXF1YXQgY29uZ3VlIHJpc3VzLCB2ZWwgdGluY2lkdW50IGxlbyBpbXBlcmRpZXQgZXUuIFZlc3RpYnVsdW0gbWFsZXN1YWRhIHR1cnBpcyBldSBtZXR1cyBpbXBlcmRpZXQgcHJldGl1bS4gQWxpcXVhbSBjb25kaW1lbnR1bSB1bHRyaWNlcyBuaWJoLCBldSBzZW1wZXIgZW5pbSBlbGVpZmVuZCBhLiBFdGlhbSBjb25kaW1lbnR1bSBuaXNsIHF1YW0uCgpQZWxsZW50ZXNxdWUgaWQgbW9sZXN0aWUgbmlzbC4gTWFlY2VuYXMgZXQgbGVjdHVzIGF0IGp1c3RvIG1vbGVzdGllIHZpdmVycmEgc2l0IGFtZXQgc2l0IGFtZXQgbGlndWxhLiBOdWxsYW0gbm9uIHBvcnR0aXRvciBtYWduYS4gUXVpc3F1ZSBlbGVtZW50dW0gYXJjdSBjdXJzdXMgdG9ydG9yI
 HJ1dHJ1bSBsb2JvcnRpcy4gTW9yYmkgc2l0IGFtZXQgbGVjdHVzIHZpdGFlIGVuaW0gZXVpc21vZCBkaWduaXNzaW0gZWdldCBhdCBuZXF1ZS4gVml2YW11cyBjb25zZXF1YXQgdmVoaWN1bGEgZHVpLCB2aXRhZSBhdWN0b3IgYXVndWUgZGlnbmlzc2ltIGluLiBJbiB0ZW1wdXMgc2VtIHF1aXMganVzdG8gdGluY2lkdW50IHNpdCBhbWV0IGF1Y3RvciB0dXJwaXMgbG9ib3J0aXMuIFBlbGxlbnRlc3F1ZSBub24gZXN0IG51bmMuIFZlc3RpYnVsdW0gbW9sbGlzIGZyaW5naWxsYSBpbnRlcmR1bS4gTWFlY2VuYXMgaXBzdW0gZG9sb3IsIHBoYXJldHJhIGlkIHRyaXN0aXF1ZSBtYXR0aXMsIGx1Y3R1cyB2aXRhZSB1cm5hLiBVdCB1bGxhbWNvcnBlciBhcmN1IGVnZXQgZWxpdCBjb252YWxsaXMgbW9sbGlzLiBQZWxsZW50ZXNxdWUgY29uZGltZW50dW0sIG1hc3NhIGFjIGhlbmRyZXJpdCB0ZW1wb3IsIG1hdXJpcyBwdXJ1cyBibGFuZGl0IGp1c3RvLCBldCBwaGFyZXRyYSBsZW8ganVzdG8gYSBlc3QuIER1aXMgYXJjdSBhdWd1ZSwgZmFjaWxpc2lzIHZlbCBkaWduaXNzaW0gc2VkLCBhbGlxdWFtIHF1aXMgbWFnbmEuIFF1aXNxdWUgbm9uIGNvbnNlcXVhdCBkb2xvci4gU3VzcGVuZGlzc2UgYSB1bHRyaWNlcyBsZW8uCgpEb25lYyB2aXRhZSBwcmV0aXVtIG5pYmguIE1hZWNlbmFzIGJpYmVuZHVtIGJpYmVuZHVtIGRpYW0gaW4gcGxhY2VyYXQuIFV0IGFjY3Vtc2FuLCBtaSB2aXRhZSB2ZXN0aWJ1bHVtIGV1aXNtb2QsIG
 51bmMganVzdG8gdnVscHV0YXRlIG5pc2ksIG5vbiBwbGFjZXJhdCBtaSB1cm5hIGV0IGRpYW0uIE1hZWNlbmFzIG1hbGVzdWFkYSBsb3JlbSB1dCBhcmN1IG1hdHRpcyBtb2xsaXMuIE51bGxhIGZhY2lsaXNpLiBEb25lYyBlc3QgbGVvLCBiaWJlbmR1bSBldSBwdWx2aW5hciBpbiwgY3Vyc3VzIHZlbCBtZXR1cy4gQWxpcXVhbSBlcmF0IHZvbHV0cGF0LiBOdWxsYW0gZmV1Z2lhdCBwb3J0dGl0b3IgbmVxdWUgaW4gdnVscHV0YXRlLiBRdWlzcXVlIG5lYyBtaSBldSBtYWduYSBjb25zZXF1YXQgY3Vyc3VzIG5vbiBhdCBhcmN1LiBFdGlhbSByaXN1cyBtZXR1cywgc29sbGljaXR1ZGluIGV0IHVsdHJpY2VzIGF0LCB0aW5jaWR1bnQgc2VkIG51bmMuIFNlZCBlZ2V0IHNjZWxlcmlzcXVlIGF1Z3VlLiBVdCBmcmluZ2lsbGEgdmVuZW5hdGlzIHNlbSBub24gZWxlaWZlbmQuIE51bmMgbWF0dGlzLCByaXN1cyBzaXQgYW1ldCB2dWxwdXRhdGUgdmFyaXVzLCByaXN1cyBqdXN0byBlZ2VzdGFzIG1hdXJpcywgaWQgaW50ZXJkdW0gb2RpbyBpcHN1bSBldCBuaXNsLiBMb3JlbSBpcHN1bSBkb2xvciBzaXQgYW1ldCwgY29uc2VjdGV0dXIgYWRpcGlzY2luZyBlbGl0LiBNb3JiaSBpZCBlcmF0IG9kaW8sIG5lYyBwdWx2aW5hciBlbmltLgoKQ3VyYWJpdHVyIGFjIGZlcm1lbnR1bSBxdWFtLiBNb3JiaSBldSBlcm9zIHNhcGllbiwgdml0YWUgdGVtcHVzIGRvbG9yLiBNYXVyaXMgdmVzdGlidWx1bSBibGFuZGl0IGVuaW0gdXQgdmV
 uZW5hdGlzLiBBbGlxdWFtIGVnZXN0YXMsIGVyb3MgYXQgY29uc2VjdGV0dXIgdGluY2lkdW50LCBsb3JlbSBhdWd1ZSBpYWN1bGlzIGVzdCwgbmVjIG1vbGxpcyBmZWxpcyBhcmN1IGluIG51bmMuIFNlZCBpbiBvZGlvIHNlZCBsaWJlcm8gcGVsbGVudGVzcXVlIHZvbHV0cGF0IHZpdGFlIGEgYW50ZS4gTW9yYmkgY29tbW9kbyB2b2x1dHBhdCB0ZWxsdXMsIHV0IHZpdmVycmEgcHVydXMgcGxhY2VyYXQgZmVybWVudHVtLiBJbnRlZ2VyIGlhY3VsaXMgZmFjaWxpc2lzIGFyY3UsIGF0IGdyYXZpZGEgbG9yZW0gYmliZW5kdW0gYXQuIEFlbmVhbiBpZCBlcm9zIGVnZXQgZXN0IHNhZ2l0dGlzIGNvbnZhbGxpcyBzZWQgZXQgZHVpLiBEb25lYyBldSBwdWx2aW5hciB0ZWxsdXMuIE51bmMgZGlnbmlzc2ltIHJob25jdXMgdGVsbHVzLCBhdCBwZWxsZW50ZXNxdWUgbWV0dXMgbHVjdHVzIGF0LiBTZWQgb3JuYXJlIGFsaXF1YW0gZGlhbSwgYSBwb3J0dGl0b3IgbGVvIHNvbGxpY2l0dWRpbiBzZWQuIE5hbSB2aXRhZSBsZWN0dXMgbGFjdXMuIEludGVnZXIgYWRpcGlzY2luZyBxdWFtIG5lcXVlLCBibGFuZGl0IHBvc3VlcmUgbGliZXJvLiBTZWQgbGliZXJvIG51bmMsIGVnZXN0YXMgc29kYWxlcyB0ZW1wdXMgc2VkLCBjdXJzdXMgYmxhbmRpdCB0ZWxsdXMuIFZlc3RpYnVsdW0gbWkgcHVydXMsIHVsdHJpY2llcyBxdWlzIHBsYWNlcmF0IHZlbCwgbW9sZXN0aWUgYXQgZHVpLgoKTnVsbGEgY29tbW9kbyBvZGlvIGp1c3RvLiBQ
 ZWxsZW50ZXNxdWUgbm9uIG9ybmFyZSBkaWFtLiBJbiBjb25zZWN0ZXR1ciBzYXBpZW4gYWMgbnVuYyBzYWdpdHRpcyBtYWxlc3VhZGEuIE1vcmJpIHVsbGFtY29ycGVyIHRlbXBvciBlcmF0IG5lYyBydXRydW0uIER1aXMgdXQgY29tbW9kbyBqdXN0by4gQ3JhcyBlc3Qgb3JjaSwgY29uc2VjdGV0dXIgc2VkIGludGVyZHVtIHNlZCwgc2NlbGVyaXNxdWUgc2l0IGFtZXQgbnVsbGEuIFZlc3RpYnVsdW0ganVzdG8gbnVsbGEsIHBlbGxlbnRlc3F1ZSBhIHRlbXB1cyBldCwgZGFwaWJ1cyBldCBhcmN1LiBMb3JlbSBpcHN1bSBkb2xvciBzaXQgYW1ldCwgY29uc2VjdGV0dXIgYWRpcGlzY2luZyBlbGl0LiBNb3JiaSB0cmlzdGlxdWUsIGVyb3MgbmVjIGNvbmd1ZSBhZGlwaXNjaW5nLCBsaWd1bGEgc2VtIHJob25jdXMgZmVsaXMsIGF0IG9ybmFyZSB0ZWxsdXMgbWF1cmlzIGFjIHJpc3VzLiBWZXN0aWJ1bHVtIGFudGUgaXBzdW0gcHJpbWlzIGluIGZhdWNpYnVzIG9yY2kgbHVjdHVzIGV0IHVsdHJpY2VzIHBvc3VlcmUgY3ViaWxpYSBDdXJhZTsgUHJvaW4gbWF1cmlzIGR1aSwgdGVtcG9yIGZlcm1lbnR1bSBkaWN0dW0gZXQsIGN1cnN1cyBhIGxlby4gTWFlY2VuYXMgbmVjIG5pc2wgYSB0ZWxsdXMgcGVsbGVudGVzcXVlIHJob25jdXMuIE51bGxhbSB1bHRyaWNlcyBldWlzbW9kIGR1aSBldSBjb25ndWUuCgpJbiBuZWMgdGVtcG9yIHJpc3VzLiBJbiBmYXVjaWJ1cyBuaXNpIGVnZXQgZGlhbSBkaWduaXNzaW0gY29uc2Vxd
 WF0LiBEb25lYyBwdWx2aW5hciBhbnRlIG5lYyBlbmltIG1hdHRpcyBydXRydW0uIFZlc3RpYnVsdW0gbGVvIGF1Z3VlLCBtb2xlc3RpZSBuZWMgZGFwaWJ1cyBpbiwgZGljdHVtIGF0IGVuaW0uIEludGVnZXIgYWxpcXVhbSwgbG9yZW0gZXUgdnVscHV0YXRlIGxhY2luaWEsIG1pIG9yY2kgdGVtcG9yIGVuaW0sIGVnZXQgbWF0dGlzIGxpZ3VsYSBtYWduYSBhIG1hZ25hLiBQcmFlc2VudCBzZWQgZXJhdCB1dCB0b3J0b3IgaW50ZXJkdW0gdml2ZXJyYS4gTG9yZW0gaXBzdW0gZG9sb3Igc2l0IGFtZXQsIGNvbnNlY3RldHVyIGFkaXBpc2NpbmcgZWxpdC4gTnVsbGEgZmFjaWxpc2kuIE1hZWNlbmFzIHNpdCBhbWV0IGxlY3R1cyBsYWN1cy4gTnVuYyB2aXRhZSBwdXJ1cyBpZCBsaWd1bGEgbGFvcmVldCBjb25kaW1lbnR1bS4gRHVpcyBhdWN0b3IgdG9ydG9yIHZlbCBkdWkgcHVsdmluYXIgYSBmYWNpbGlzaXMgYXJjdSBkaWduaXNzaW0uIEluIGhhYyBoYWJpdGFzc2UgcGxhdGVhIGRpY3R1bXN0LiBEb25lYyBzb2xsaWNpdHVkaW4gcGVsbGVudGVzcXVlIGVnZXN0YXMuIFNlZCBzZWQgc2VtIGp1c3RvLiBNYWVjZW5hcyBsYW9yZWV0IGhlbmRyZXJpdCBtYXVyaXMsIHV0IHBvcnR0aXRvciBsb3JlbSBpYWN1bGlzIGFjLiBRdWlzcXVlIG1vbGVzdGllIHNlbSBxdWlzIGxvcmVtIHRlbXBvciBydXRydW0uIFBoYXNlbGx1cyBuaWJoIG1hdXJpcywgcmhvbmN1cyBpbiBjb25zZWN0ZXR1ciBub24sIGFsaXF1ZXQgZXUgbWFzc2
 EuCgpDdXJhYml0dXIgdmVsaXQgYXJjdSwgcHJldGl1bSBwb3J0YSBwbGFjZXJhdCBxdWlzLCB2YXJpdXMgdXQgbWV0dXMuIFZlc3RpYnVsdW0gdnVscHV0YXRlIHRpbmNpZHVudCBqdXN0bywgdml0YWUgcG9ydHRpdG9yIGxlY3R1cyBpbXBlcmRpZXQgc2l0IGFtZXQuIFZpdmFtdXMgZW5pbSBkb2xvciwgc29sbGljaXR1ZGluIHV0IHNlbXBlciBub24sIG9ybmFyZSBvcm5hcmUgZHVpLiBBbGlxdWFtIHRlbXBvciBmZXJtZW50dW0gc2FwaWVuIGVnZXQgY29uZGltZW50dW0uIEN1cmFiaXR1ciBsYW9yZWV0IGJpYmVuZHVtIGFudGUsIGluIGV1aXNtb2QgbGFjdXMgbGFjaW5pYSBldS4gUGVsbGVudGVzcXVlIGhhYml0YW50IG1vcmJpIHRyaXN0aXF1ZSBzZW5lY3R1cyBldCBuZXR1cyBldCBtYWxlc3VhZGEgZmFtZXMgYWMgdHVycGlzIGVnZXN0YXMuIFN1c3BlbmRpc3NlIHBvdGVudGkuIFNlZCBhdCBsaWJlcm8gZXUgdG9ydG9yIHRlbXB1cyBzY2VsZXJpc3F1ZS4gTnVsbGEgZmFjaWxpc2kuIE51bGxhbSB2aXRhZSBuZXF1ZSBpZCBqdXN0byB2aXZlcnJhIHJob25jdXMgcHJldGl1bSBhdCBsaWJlcm8uIEV0aWFtIGVzdCB1cm5hLCBhbGlxdWFtIHZlbCBwdWx2aW5hciBub24sIG9ybmFyZSB2ZWwgcHVydXMuCgpOdWxsYSB2YXJpdXMsIG5pc2kgZWdldCBjb25kaW1lbnR1bSBzZW1wZXIsIG1ldHVzIGVzdCBkaWN0dW0gb2RpbywgdmVsIG1hdHRpcyByaXN1cyBlc3Qgc2VkIHZlbGl0LiBDdW0gc29jaWlzIG5hdG9xdWU
 gcGVuYXRpYnVzIGV0IG1hZ25pcyBkaXMgcGFydHVyaWVudCBtb250ZXMsIG5hc2NldHVyIHJpZGljdWx1cyBtdXMuIE51bmMgbm9uIGVzdCBuZWMgdGVsbHVzIHVsdHJpY2llcyBtYXR0aXMgdXQgZWdldCB2ZWxpdC4gSW50ZWdlciBjb25kaW1lbnR1bSBhbnRlIGlkIGxvcmVtIGJsYW5kaXQgbGFjaW5pYS4gRG9uZWMgdmVsIHRvcnRvciBhdWd1ZSwgaW4gY29uZGltZW50dW0gbmlzaS4gUGVsbGVudGVzcXVlIHBlbGxlbnRlc3F1ZSBudWxsYSB1dCBudWxsYSBwb3J0dGl0b3IgcXVpcyBzb2RhbGVzIGVuaW0gcnV0cnVtLiBTZWQgYXVndWUgcmlzdXMsIGV1aXNtb2QgYSBhbGlxdWV0IGF0LCB2dWxwdXRhdGUgbm9uIGxpYmVyby4gTnVsbGFtIG5pYmggb2RpbywgZGlnbmlzc2ltIGZlcm1lbnR1bSBwdWx2aW5hciBhYywgY29uZ3VlIGV1IG1pLiBEdWlzIHRpbmNpZHVudCwgbmliaCBpZCB2ZW5lbmF0aXMgcGxhY2VyYXQsIGRpYW0gdHVycGlzIGdyYXZpZGEgbGVvLCBzaXQgYW1ldCBtb2xsaXMgbWFzc2EgZG9sb3IgcXVpcyBtYXVyaXMuIFZpdmFtdXMgc2NlbGVyaXNxdWUgc29kYWxlcyBhcmN1IGV0IGRhcGlidXMuIFN1c3BlbmRpc3NlIHBvdGVudGkuIENyYXMgcXVpcyB0ZWxsdXMgYXJjdSwgcXVpcyBsYW9yZWV0IHNlbS4gRnVzY2UgcG9ydHRpdG9yLCBzYXBpZW4gdmVsIHRyaXN0aXF1ZSBzb2RhbGVzLCB2ZWxpdCBsZW8gcG9ydGEgYXJjdSwgcXVpcyBwZWxsZW50ZXNxdWUgbnVuYyBtZXR1cyBub24gb2Rpby4g
 TmFtIGFyY3UgbGliZXJvLCB1bGxhbWNvcnBlciB1dCBwaGFyZXRyYSBub24sIGRpZ25pc3NpbSBldCB2ZWxpdC4gUXVpc3F1ZSBkb2xvciBsb3JlbSwgdmVoaWN1bGEgc2l0IGFtZXQgc2NlbGVyaXNxdWUgaW4sIHZhcml1cyBhdCBudWxsYS4gUGVsbGVudGVzcXVlIHZpdGFlIHNlbSBlZ2V0IHRvcnRvciBpYWN1bGlzIHB1bHZpbmFyLiBTZWQgbnVuYyBqdXN0bywgZXVpc21vZCBncmF2aWRhIHB1bHZpbmFyIGVnZXQsIGdyYXZpZGEgZWdldCB0dXJwaXMuIENyYXMgdmVsIGRpY3R1bSBuaXNpLiBOdWxsYW0gbnVsbGEgbGliZXJvLCBncmF2aWRhIHNpdCBhbWV0IGFsaXF1YW0gcXVpcywgY29tbW9kbyB2aXRhZSBvZGlvLiBDcmFzIHZpdGFlIG5pYmggbmVjIGR1aSBwbGFjZXJhdCBzZW1wZXIuCgpWaXZhbXVzIGF0IGZyaW5naWxsYSBlcm9zLiBWaXZhbXVzIGF0IG5pc2wgaWQgbWFzc2EgY29tbW9kbyBmZXVnaWF0IHF1aXMgbm9uIG1hc3NhLiBNb3JiaSB0ZWxsdXMgdXJuYSwgYXVjdG9yIHNpdCBhbWV0IGVsZW1lbnR1bSBzZWQsIHJ1dHJ1bSBub24gbGVjdHVzLiBOdWxsYSBmZXVnaWF0IGR1aSBpbiBzYXBpZW4gb3JuYXJlIGV0IGltcGVyZGlldCBlc3Qgb3JuYXJlLiBQZWxsZW50ZXNxdWUgaGFiaXRhbnQgbW9yYmkgdHJpc3RpcXVlIHNlbmVjdHVzIGV0IG5ldHVzIGV0IG1hbGVzdWFkYSBmYW1lcyBhYyB0dXJwaXMgZWdlc3Rhcy4gVmVzdGlidWx1bSBzZW1wZXIgcnV0cnVtIHRlbXBvci4gU2VkIGluIGZlbGlzI
 G5pYmgsIHNlZCBhbGlxdWFtIGVuaW0uIEN1cmFiaXR1ciB1dCBxdWFtIHNjZWxlcmlzcXVlIHZlbGl0IHBsYWNlcmF0IGRpY3R1bS4gRG9uZWMgZWxlaWZlbmQgdmVoaWN1bGEgcHVydXMsIGV1IHZlc3RpYnVsdW0gc2FwaWVuIHJ1dHJ1bSBldS4gVml2YW11cyBpbiBvZGlvIHZlbCBlc3QgdnVscHV0YXRlIGlhY3VsaXMuIE51bmMgcnV0cnVtIGZldWdpYXQgcHJldGl1bS4KCk1hZWNlbmFzIGlwc3VtIG5lcXVlLCBhdWN0b3IgcXVpcyBsYWNpbmlhIHZpdGFlLCBldWlzbW9kIGFjIG9yY2kuIERvbmVjIG1vbGVzdGllIG1hc3NhIGNvbnNlcXVhdCBlc3QgcG9ydGEgYWMgcG9ydGEgcHVydXMgdGluY2lkdW50LiBOYW0gYmliZW5kdW0gbGVvIG5lYyBsYWN1cyBtb2xsaXMgbm9uIGNvbmRpbWVudHVtIGRvbG9yIHJob25jdXMuIE51bGxhIGFjIHZvbHV0cGF0IGxvcmVtLiBOdWxsYW0gZXJhdCBwdXJ1cywgY29udmFsbGlzIGVnZXQgY29tbW9kbyBpZCwgdmFyaXVzIHF1aXMgYXVndWUuIE51bGxhbSBhbGlxdWFtIGVnZXN0YXMgbWksIHZlbCBzdXNjaXBpdCBuaXNsIG1hdHRpcyBjb25zZXF1YXQuIFF1aXNxdWUgdmVsIGVnZXN0YXMgc2FwaWVuLiBOdW5jIGxvcmVtIHZlbGl0LCBjb252YWxsaXMgbmVjIGxhb3JlZXQgZXQsIGFsaXF1ZXQgZWdldCBtYXNzYS4gTmFtIGV0IG5pYmggYWMgZHVpIHZlaGljdWxhIGFsaXF1YW0gcXVpcyBldSBhdWd1ZS4gQ3JhcyB2ZWwgbWFnbmEgdXQgZWxpdCByaG9uY3VzIGludGVyZHVtIG
 lhY3VsaXMgdm9sdXRwYXQgbmlzbC4gU3VzcGVuZGlzc2UgYXJjdSBsb3JlbSwgdmFyaXVzIHJob25jdXMgdGVtcG9yIGlkLCBwdWx2aW5hciBzZWQgdG9ydG9yLiBQZWxsZW50ZXNxdWUgdWx0cmljaWVzIGxhb3JlZXQgb2RpbyBhYyBkaWduaXNzaW0uIEFsaXF1YW0gZGlhbSBhcmN1LCBwbGFjZXJhdCBxdWlzIGVnZXN0YXMgZWdldCwgZmFjaWxpc2lzIGV1IG51bmMuIE1hdXJpcyB2dWxwdXRhdGUsIG5pc2wgc2l0IGFtZXQgbW9sbGlzIGludGVyZHVtLCByaXN1cyB0b3J0b3Igb3JuYXJlIG9yY2ksIHNlZCBlZ2VzdGFzIG9yY2kgZXJvcyBub24gZGlhbS4gVmVzdGlidWx1bSBoZW5kcmVyaXQsIG1ldHVzIHF1aXMgcGxhY2VyYXQgcGVsbGVudGVzcXVlLCBlbmltIHB1cnVzIGZhdWNpYnVzIGR1aSwgc2l0IGFtZXQgdWx0cmljaWVzIGxlY3R1cyBpcHN1bSBpZCBsb3JlbS4gQ2xhc3MgYXB0ZW50IHRhY2l0aSBzb2Npb3NxdSBhZCBsaXRvcmEgdG9ycXVlbnQgcGVyIGNvbnViaWEgbm9zdHJhLCBwZXIgaW5jZXB0b3MgaGltZW5hZW9zLiBQcmFlc2VudCBlZ2V0IGRpYW0gb2RpbywgZXUgYmliZW5kdW0gZWxpdC4gSW4gdmVzdGlidWx1bSBvcmNpIGV1IGVyYXQgdGluY2lkdW50IHRyaXN0aXF1ZS4KCkNyYXMgY29uc2VjdGV0dXIgYW50ZSBldSB0dXJwaXMgcGxhY2VyYXQgc29sbGljaXR1ZGluLiBNYXVyaXMgZXQgbGFjdXMgdG9ydG9yLCBlZ2V0IHBoYXJldHJhIHZlbGl0LiBEb25lYyBhY2N1bXNhbiB1bHRyaWNlcyB
 0ZW1wb3IuIERvbmVjIGF0IG5pYmggYSBlbGl0IGNvbmRpbWVudHVtIGRhcGlidXMuIEludGVnZXIgc2l0IGFtZXQgdnVscHV0YXRlIGFudGUuIFN1c3BlbmRpc3NlIHBvdGVudGkuIEluIHNvZGFsZXMgbGFvcmVldCBtYXNzYSB2aXRhZSBsYWNpbmlhLiBNb3JiaSB2ZWwgbGFjdXMgZmV1Z2lhdCBhcmN1IHZ1bHB1dGF0ZSBtb2xlc3RpZS4gQWxpcXVhbSBtYXNzYSBtYWduYSwgdWxsYW1jb3JwZXIgYWNjdW1zYW4gZ3JhdmlkYSBxdWlzLCByaG9uY3VzIHB1bHZpbmFyIG51bGxhLiBQcmFlc2VudCBzaXQgYW1ldCBpcHN1bSBkaWFtLCBzaXQgYW1ldCBsYWNpbmlhIG5lcXVlLiBJbiBldCBzYXBpZW4gYXVndWUuIEV0aWFtIGVuaW0gZWxpdCwgdWx0cmljZXMgdmVsIHJ1dHJ1bSBpZCwgc2NlbGVyaXNxdWUgbm9uIGVuaW0uCgpQcm9pbiBldCBlZ2VzdGFzIG5lcXVlLiBQcmFlc2VudCBldCBpcHN1bSBkb2xvci4gTnVuYyBub24gdmFyaXVzIG5pc2wuIEZ1c2NlIGluIHRvcnRvciBuaXNpLiBNYWVjZW5hcyBjb252YWxsaXMgbmVxdWUgaW4gbGlndWxhIGJsYW5kaXQgcXVpcyB2ZWhpY3VsYSBsZW8gbW9sbGlzLiBQZWxsZW50ZXNxdWUgc2FnaXR0aXMgYmxhbmRpdCBsZW8sIGRhcGlidXMgcGVsbGVudGVzcXVlIGxlbyB1bHRyaWNlcyBhYy4gQ3VyYWJpdHVyIGFjIGVnZXN0YXMgbGliZXJvLiBEb25lYyBwcmV0aXVtIHBoYXJldHJhIHByZXRpdW0uIEZ1c2NlIGltcGVyZGlldCwgdHVycGlzIGV1IGFsaXF1YW0gcG9ydGEs
 IGFudGUgZWxpdCBlbGVpZmVuZCByaXN1cywgbHVjdHVzIGF1Y3RvciBhcmN1IGFudGUgdXQgbnVuYy4gVml2YW11cyBpbiBsZW8gZmVsaXMsIHZpdGFlIGVsZWlmZW5kIGxhY3VzLiBEb25lYyB0ZW1wdXMgYWxpcXVhbSBwdXJ1cyBwb3J0dGl0b3IgdHJpc3RpcXVlLiBTdXNwZW5kaXNzZSBkaWFtIG5lcXVlLCBzdXNjaXBpdCBmZXVnaWF0IGZyaW5naWxsYSBub24sIGVsZWlmZW5kIHNpdCBudWxsYW0uCg==
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/test/lots_of_docs.js
----------------------------------------------------------------------
diff --git a/share/test/lots_of_docs.js b/share/test/lots_of_docs.js
new file mode 100644
index 0000000..2fe702b
--- /dev/null
+++ b/share/test/lots_of_docs.js
@@ -0,0 +1,55 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+
+// test saving a semi-large quanitity of documents and do some view queries.
+couchTests.lots_of_docs = function(debug) {
+  var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"});
+  db.deleteDb();
+  db.createDb();
+  if (debug) debugger;
+
+  // keep number lowish for now to keep tests fasts. Crank up manually to
+  // to really test.
+  var numDocsToCreate = 500;
+
+  for(var i=0; i < numDocsToCreate; i += 100) {
+      var createNow = Math.min(numDocsToCreate - i, 100);
+      var docs = makeDocs(i, i + createNow);
+      db.bulkSave(docs);
+  }
+
+  // query all documents, and return the doc.integer member as a key.
+  results = db.query(function(doc){ emit(doc.integer, null) });
+
+  T(results.total_rows == numDocsToCreate);
+
+  // validate the keys are ordered ascending
+  for(var i=0; i<numDocsToCreate; i++) {
+    T(results.rows[i].key==i);
+  }
+
+  // do the query again, but with descending output
+  results = db.query(function(doc){ emit(doc.integer, null) }, null, {
+    descending: true
+  });
+
+  T(results.total_rows == numDocsToCreate);
+
+  // validate the keys are ordered descending
+  for(var i=0; i<numDocsToCreate; i++) {
+    T(results.rows[numDocsToCreate-1-i].key==i);
+  }
+
+  // Check _all_docs with descending=true again (now that there are many docs)
+  var desc = db.allDocs({descending:true});
+  T(desc.total_rows == desc.rows.length);
+};

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/test/method_override.js
----------------------------------------------------------------------
diff --git a/share/test/method_override.js b/share/test/method_override.js
new file mode 100644
index 0000000..0bb4c61
--- /dev/null
+++ b/share/test/method_override.js
@@ -0,0 +1,40 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+
+// Allow broken HTTP clients to fake a full method vocabulary with an X-HTTP-METHOD-OVERRIDE header
+couchTests.method_override = function(debug) {
+  var result = JSON.parse(CouchDB.request("GET", "/").responseText);
+  T(result.couchdb == "Welcome");
+
+  var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"});
+  db.deleteDb();
+
+  db.createDb();
+
+  var doc = {bob : "connie"};
+  xhr = CouchDB.request("POST", "/test_suite_db/fnord", {body: JSON.stringify(doc), headers:{"X-HTTP-Method-Override" : "PUT"}});
+  T(xhr.status == 201);
+
+  doc = db.open("fnord");
+  T(doc.bob == "connie");
+
+  xhr = CouchDB.request("POST", "/test_suite_db/fnord?rev=" + doc._rev, {headers:{"X-HTTP-Method-Override" : "DELETE"}});
+  T(xhr.status == 200);
+
+  xhr = CouchDB.request("GET", "/test_suite_db/fnord2", {body: JSON.stringify(doc), headers:{"X-HTTP-Method-Override" : "PUT"}});
+  // Method Override is ignored when original Method isn't POST
+  T(xhr.status == 404);
+
+  doc = db.open("fnord");
+  T(doc == null);  
+
+};

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/test/multiple_rows.js
----------------------------------------------------------------------
diff --git a/share/test/multiple_rows.js b/share/test/multiple_rows.js
new file mode 100644
index 0000000..4f6fcd3
--- /dev/null
+++ b/share/test/multiple_rows.js
@@ -0,0 +1,80 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+
+couchTests.multiple_rows = function(debug) {
+  var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"});
+  db.deleteDb();
+  db.createDb();
+  if (debug) debugger;
+
+  var nc = {_id:"NC", cities:["Charlotte", "Raleigh"]};
+  var ma = {_id:"MA", cities:["Boston", "Lowell", "Worcester", "Cambridge", "Springfield"]};
+  var fl = {_id:"FL", cities:["Miami", "Tampa", "Orlando", "Springfield"]};
+
+  T(db.save(nc).ok);
+  T(db.save(ma).ok);
+  T(db.save(fl).ok);
+
+  var generateListOfCitiesAndState = "function(doc) {" +
+  " for (var i = 0; i < doc.cities.length; i++)" +
+  "  emit(doc.cities[i] + \", \" + doc._id, null);" +
+  "}";
+
+  var results = db.query(generateListOfCitiesAndState);
+  var rows = results.rows;
+
+  T(rows[0].key == "Boston, MA");
+  T(rows[1].key == "Cambridge, MA");
+  T(rows[2].key == "Charlotte, NC");
+  T(rows[3].key == "Lowell, MA");
+  T(rows[4].key == "Miami, FL");
+  T(rows[5].key == "Orlando, FL");
+  T(rows[6].key == "Raleigh, NC");
+  T(rows[7].key == "Springfield, FL");
+  T(rows[8].key == "Springfield, MA");
+  T(rows[9].key == "Tampa, FL");
+  T(rows[10].key == "Worcester, MA");
+
+  // add another city to NC
+  nc.cities.push("Wilmington");
+  T(db.save(nc).ok);
+
+  var results = db.query(generateListOfCitiesAndState);
+  var rows = results.rows;
+
+  T(rows[0].key == "Boston, MA");
+  T(rows[1].key == "Cambridge, MA");
+  T(rows[2].key == "Charlotte, NC");
+  T(rows[3].key == "Lowell, MA");
+  T(rows[4].key == "Miami, FL");
+  T(rows[5].key == "Orlando, FL");
+  T(rows[6].key == "Raleigh, NC");
+  T(rows[7].key == "Springfield, FL");
+  T(rows[8].key == "Springfield, MA");
+  T(rows[9].key == "Tampa, FL");
+  T(rows[10].key == "Wilmington, NC");
+  T(rows[11].key == "Worcester, MA");
+
+  // now delete MA
+  T(db.deleteDoc(ma).ok);
+
+  var results = db.query(generateListOfCitiesAndState);
+  var rows = results.rows;
+
+  T(rows[0].key == "Charlotte, NC");
+  T(rows[1].key == "Miami, FL");
+  T(rows[2].key == "Orlando, FL");
+  T(rows[3].key == "Raleigh, NC");
+  T(rows[4].key == "Springfield, FL");
+  T(rows[5].key == "Tampa, FL");
+  T(rows[6].key == "Wilmington, NC");
+};

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/test/oauth.js
----------------------------------------------------------------------
diff --git a/share/test/oauth.js b/share/test/oauth.js
new file mode 100644
index 0000000..8b4e694
--- /dev/null
+++ b/share/test/oauth.js
@@ -0,0 +1,294 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License.  You may obtain a copy
+// of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+// License for the specific language governing permissions and limitations under
+// the License.
+
+couchTests.oauth = function(debug) {
+  // This tests OAuth authentication.
+
+  var authorization_url = "/_oauth/authorize";
+
+  var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"});
+  db.deleteDb();
+  db.createDb();
+  if (debug) debugger;
+
+  var dbA = new CouchDB("test_suite_db_a", {"X-Couch-Full-Commit":"false"});
+  var dbB = new CouchDB("test_suite_db_b", {"X-Couch-Full-Commit":"false"});
+  var dbC = new CouchDB("test_suite_db_c", {"X-Couch-Full-Commit":"false"});
+  var dbD = new CouchDB("test_suite_users", {"X-Couch-Full-Commit":"false"});
+  dbA.deleteDb();
+  dbA.createDb();
+  dbB.deleteDb();
+  dbB.createDb();
+  dbC.deleteDb();
+  dbC.createDb();
+  dbD.deleteDb();
+
+  // Simple secret key generator
+  function generateSecret(length) {
+    var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
+    var secret = '';
+    for (var i=0; i<length; i++) {
+      secret += tab.charAt(Math.floor(Math.random() * 64));
+    }
+    return secret;
+  }
+
+  function oauthRequest(method, path, message, accessor) {
+    message.action = path;
+    message.method = method || 'GET';
+    OAuth.SignatureMethod.sign(message, accessor);
+    var parameters = message.parameters;
+    if (method == "POST" || method == "GET") {
+      if (method == "GET") {
+        return CouchDB.request("GET", OAuth.addToURL(path, parameters));
+      } else {
+        return CouchDB.request("POST", path, {
+          headers: {"Content-Type": "application/x-www-form-urlencoded"},
+          body: OAuth.formEncode(parameters)
+        });
+      }
+    } else {
+      return CouchDB.request(method, path, {
+        headers: {Authorization: OAuth.getAuthorizationHeader('', parameters)}
+      });
+    }
+  }
+
+  var consumerSecret = generateSecret(64);
+  var tokenSecret = generateSecret(64);
+  var admintokenSecret = generateSecret(64);
+  var testadminPassword = "ohsosecret";
+
+  var adminBasicAuthHeaderValue = function() {
+    var retval = 'Basic ' + binb2b64(str2binb("testadmin:" + testadminPassword));
+    return retval;
+  }
+
+  var host = CouchDB.host;
+  var dbPair = {
+    source: {
+      url: CouchDB.protocol + host + "/test_suite_db_a",
+      auth: {
+        oauth: {
+          consumer_key: "key",
+          consumer_secret: consumerSecret,
+          token_secret: tokenSecret,
+          token: "foo"
+        }
+      }
+    },
+    target: {
+      url: CouchDB.protocol + host + "/test_suite_db_b",
+      headers: {"Authorization": adminBasicAuthHeaderValue()}
+    }
+  };
+
+  // this function will be called on the modified server
+  var testFun = function () {
+    try {
+      CouchDB.request("PUT", CouchDB.protocol + host + "/_config/admins/testadmin", {
+        headers: {"X-Couch-Persist": "false"},
+        body: JSON.stringify(testadminPassword)
+      });
+      var i = 0;
+      waitForSuccess(function() {
+        //loop until the couch server has processed the password
+        i += 1;
+        var xhr = CouchDB.request("GET", CouchDB.protocol + host + "/_config/admins/testadmin?foo="+i,{
+            headers: {
+              "Authorization": adminBasicAuthHeaderValue()
+            }});
+        if (xhr.responseText.indexOf("\"-pbkdf2-") != 0) {
+            throw("still waiting");
+        }
+        return true;
+      }, "wait-for-admin");
+
+      CouchDB.newUuids(2); // so we have one to make the salt
+
+      CouchDB.request("PUT", CouchDB.protocol + host + "/_config/couch_httpd_auth/require_valid_user", {
+        headers: {
+          "X-Couch-Persist": "false",
+          "Authorization": adminBasicAuthHeaderValue()
+        },
+        body: JSON.stringify("true")
+      });
+
+      var usersDb = new CouchDB("test_suite_users", {
+        "X-Couch-Full-Commit":"false",
+        "Authorization": adminBasicAuthHeaderValue()
+      });
+        
+      // Create a user
+      var jasonUserDoc = CouchDB.prepareUserDoc({
+        name: "jason",
+        roles: ["test"]
+      }, "testpassword");
+      T(usersDb.save(jasonUserDoc).ok);
+
+
+      var accessor = {
+        consumerSecret: consumerSecret,
+        tokenSecret: tokenSecret
+      };
+      var adminAccessor = {
+        consumerSecret: consumerSecret,
+        tokenSecret: admintokenSecret
+      };
+
+      var signatureMethods = ["PLAINTEXT", "HMAC-SHA1"];
+      var consumerKeys = {key: 200, nonexistent_key: 400};
+      for (var i=0; i<signatureMethods.length; i++) {
+        for (var consumerKey in consumerKeys) {
+          var expectedCode = consumerKeys[consumerKey];
+          var message = {
+            parameters: {
+              oauth_signature_method: signatureMethods[i],
+              oauth_consumer_key: consumerKey,
+              oauth_token: "foo",
+              oauth_token_secret: tokenSecret,
+              oauth_version: "1.0"
+            }
+          };
+
+          // Get request token via Authorization header
+          xhr = oauthRequest("GET", CouchDB.protocol + host + "/_oauth/request_token", message, accessor);
+          T(xhr.status == expectedCode);
+
+          // GET request token via query parameters
+          xhr = oauthRequest("GET", CouchDB.protocol + host + "/_oauth/request_token", message, accessor);
+          T(xhr.status == expectedCode);
+
+          responseMessage = OAuth.decodeForm(xhr.responseText);
+
+          // Obtaining User Authorization
+          //Only needed for 3-legged OAuth
+          //xhr = CouchDB.request("GET", authorization_url + '?oauth_token=' + responseMessage.oauth_token);
+          //T(xhr.status == expectedCode);
+
+          xhr = oauthRequest("GET", CouchDB.protocol + host + "/_session", message, accessor);
+          T(xhr.status == expectedCode);
+          if (xhr.status == expectedCode == 200) {
+            data = JSON.parse(xhr.responseText);
+            T(data.name == "jason");
+            T(data.roles[0] == "test");
+          }
+
+          xhr = oauthRequest("GET", CouchDB.protocol + host + "/_session?foo=bar", message, accessor);
+          T(xhr.status == expectedCode);
+
+          // Test HEAD method
+          xhr = oauthRequest("HEAD", CouchDB.protocol + host + "/_session?foo=bar", message, accessor);
+          T(xhr.status == expectedCode);
+
+          // Replication
+          var dbA = new CouchDB("test_suite_db_a", {
+            "X-Couch-Full-Commit":"false",
+            "Authorization": adminBasicAuthHeaderValue()
+          });
+          T(dbA.save({_id:"_design/"+i+consumerKey}).ok);
+          var result = CouchDB.replicate(dbPair.source, dbPair.target, {
+            headers: {"Authorization": adminBasicAuthHeaderValue()}
+          });
+          T(result.ok);
+
+          // Test if rewriting doesn't break OAuth (c.f. COUCHDB-1321)
+          var dbC = new CouchDB("test_suite_db_c", {
+            "X-Couch-Full-Commit":"false",
+            "Authorization": adminBasicAuthHeaderValue()
+          });
+          var ddocId = "_design/"+ i + consumerKey;
+          var ddoc = {
+            _id: ddocId,
+            language: "javascript",
+            _attachments:{
+              "bar": {
+                content_type:"text/plain",
+                data: "VGhpcyBpcyBhIGJhc2U2NCBlbmNvZGVkIHRleHQ="
+              }
+            },
+            rewrites: [{"from": "foo/:a",  "to": ":a"}]
+          };
+          T(dbC.save(ddoc).ok);
+          xhr = oauthRequest("GET", CouchDB.protocol + host + "/test_suite_db_c/" + ddocId + "/_rewrite/foo/bar", message, accessor);
+          T(xhr.status == expectedCode);
+
+          // Test auth via admin user defined in .ini
+          var message = {
+            parameters: {
+              oauth_signature_method: signatureMethods[i],
+              oauth_consumer_key: consumerKey,
+              oauth_token: "bar",
+              oauth_token_secret: admintokenSecret,
+              oauth_version: "1.0"
+            }
+          };
+          xhr = oauthRequest("GET", CouchDB.protocol + host + "/_session?foo=bar", message, adminAccessor);
+          if (xhr.status == expectedCode == 200) {
+            data = JSON.parse(xhr.responseText);
+            T(data.name == "testadmin");
+            T(data.roles[0] == "_admin");
+          }
+
+          // Test when the user's token doesn't exist.
+          message.parameters.oauth_token = "not a token!";
+          xhr = oauthRequest("GET", CouchDB.protocol + host + "/_session?foo=bar",
+                  message, adminAccessor);
+          T(xhr.status == 400, "Request should be invalid.");
+        }
+      }
+    } finally {
+      var xhr = CouchDB.request("PUT", CouchDB.protocol + host + "/_config/couch_httpd_auth/require_valid_user", {
+        headers: {
+          "Authorization": adminBasicAuthHeaderValue(),
+          "X-Couch-Persist": "false"
+        },
+        body: JSON.stringify("false")
+      });
+      T(xhr.status == 200);
+
+      var xhr = CouchDB.request("DELETE", CouchDB.protocol + host + "/_config/admins/testadmin", {
+        headers: {
+          "Authorization": adminBasicAuthHeaderValue(),
+          "X-Couch-Persist": "false"
+        }
+      });
+      T(xhr.status == 200);
+    }
+  };
+
+  run_on_modified_server(
+    [
+     {section: "httpd",
+      key: "WWW-Authenticate", value: 'OAuth'},
+     {section: "couch_httpd_auth",
+      key: "secret", value: generateSecret(64)},
+     {section: "couch_httpd_auth",
+      key: "authentication_db", value: "test_suite_users"},
+     {section: "oauth_consumer_secrets",
+      key: "key", value: consumerSecret},
+     {section: "oauth_token_users",
+      key: "foo", value: "jason"},
+     {section: "oauth_token_users",
+      key: "bar", value: "testadmin"},
+     {section: "oauth_token_secrets",
+      key: "foo", value: tokenSecret},
+     {section: "oauth_token_secrets",
+      key: "bar", value: admintokenSecret},
+     {section: "couch_httpd_oauth",
+      key: "authorization_url", value: authorization_url},
+     {section: "couch_httpd_oauth",
+      key: "use_users_db", value: "false"}
+    ],
+    testFun
+  );
+};

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/test/oauth_users_db.js
----------------------------------------------------------------------
diff --git a/share/test/oauth_users_db.js b/share/test/oauth_users_db.js
new file mode 100644
index 0000000..b98069e
--- /dev/null
+++ b/share/test/oauth_users_db.js
@@ -0,0 +1,161 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License.  You may obtain a copy
+// of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+// License for the specific language governing permissions and limitations under
+// the License.
+
+couchTests.oauth_users_db = function(debug) {
+  // This tests OAuth authentication using the _users DB instead of the ini
+  // configuration for storing OAuth tokens and secrets.
+
+  if (debug) debugger;
+
+  var usersDb = new CouchDB("test_suite_users",{"X-Couch-Full-Commit":"false"});
+  var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"});
+  var host = CouchDB.host;
+  var authorization_url = "/_oauth/authorize";
+
+
+  // Simple secret key generator
+  function generateSecret(length) {
+    var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
+    var secret = '';
+    for (var i = 0; i < length; i++) {
+      secret += tab.charAt(Math.floor(Math.random() * 64));
+    }
+    return secret;
+  }
+
+
+  function oauthRequest(method, path, message, accessor) {
+    message.action = path;
+    message.method = method || 'GET';
+    OAuth.SignatureMethod.sign(message, accessor);
+    var parameters = message.parameters;
+    if (method == "POST" || method == "GET") {
+      if (method == "GET") {
+        return CouchDB.request("GET", OAuth.addToURL(path, parameters));
+      } else {
+        return CouchDB.request("POST", path, {
+          headers: {"Content-Type": "application/x-www-form-urlencoded"},
+          body: OAuth.formEncode(parameters)
+        });
+      }
+    } else {
+      return CouchDB.request(method, path, {
+        headers: {Authorization: OAuth.getAuthorizationHeader('', parameters)}
+      });
+    }
+  }
+
+
+  // this function will be called on the modified server
+  var testFun = function () {
+    var fdmanana = CouchDB.prepareUserDoc({
+      name: "fdmanana",
+      roles: ["dev"],
+      oauth: {
+        consumer_keys: {
+          "key_foo": "bar",
+          "key_xpto": "mars"
+        },
+        tokens: {
+          "salut": "ola",
+          "tok1": "123"
+        }
+      }
+    }, "qwerty");
+    TEquals(true, usersDb.save(fdmanana).ok);
+
+    var signatureMethods = ["PLAINTEXT", "HMAC-SHA1"];
+    var message, xhr, responseMessage, accessor, data;
+
+    for (var i = 0; i < signatureMethods.length; i++) {
+      message = {
+        parameters: {
+          oauth_signature_method: signatureMethods[i],
+          oauth_consumer_key: "key_foo",
+          oauth_token: "tok1",
+          oauth_version: "1.0"
+        }
+      };
+      accessor = {
+        consumerSecret: "bar",
+        tokenSecret: "123"
+      };
+
+      xhr = oauthRequest("GET", CouchDB.protocol + host + "/_oauth/request_token",
+        message, accessor
+      );
+      TEquals(200, xhr.status);
+
+      responseMessage = OAuth.decodeForm(xhr.responseText);
+
+      // Obtaining User Authorization
+      // Only needed for 3-legged OAuth
+      //xhr = CouchDB.request(
+      //  "GET", authorization_url + '?oauth_token=' + responseMessage.oauth_token);
+      //TEquals(200, xhr.status);
+
+      xhr = oauthRequest(
+        "GET", CouchDB.protocol + host + "/_session", message, accessor);
+      TEquals(200, xhr.status);
+      data = JSON.parse(xhr.responseText);
+      TEquals(true, data.ok);
+      TEquals("object", typeof data.userCtx);
+      TEquals("fdmanana", data.userCtx.name);
+      TEquals("dev", data.userCtx.roles[0]);
+      TEquals("oauth", data.info.authenticated);
+
+      // test invalid token
+      message.parameters.oauth_token = "not a token!";
+      xhr = oauthRequest("GET", CouchDB.protocol + host + "/_session",
+        message, accessor
+      );
+      TEquals(400, xhr.status, "Request should be invalid.");
+
+      // test invalid secret
+      message.parameters.oauth_token = "tok1";
+      accessor.tokenSecret = "badone";
+      xhr = oauthRequest("GET", CouchDB.protocol + host + "/_session",
+        message, accessor
+      );
+      data = JSON.parse(xhr.responseText);
+      TEquals(null, data.userCtx.name);
+      TEquals(1, data.userCtx.roles.length);
+      TEquals("_admin", data.userCtx.roles[0]);
+      TEquals(true, data.info.authentication_handlers.indexOf("default") >= 0);
+      TEquals("default", data.info.authenticated);
+    }
+  };
+
+
+  usersDb.deleteDb();
+
+  run_on_modified_server(
+    [
+     {section: "httpd",
+      key: "WWW-Authenticate", value: 'OAuth'},
+     {section: "couch_httpd_auth",
+      key: "secret", value: generateSecret(64)},
+     {section: "couch_httpd_auth",
+      key: "authentication_db", value: usersDb.name},
+     {section: "couch_httpd_oauth",
+      key: "use_users_db", value: "true"},
+     {section: "httpd", key: "authentication_handlers",
+      value: "{couch_httpd_oauth, oauth_authentication_handler}, " +
+        "{couch_httpd_auth, default_authentication_handler}"}
+    ],
+    testFun
+  );
+
+  // cleanup
+  usersDb.deleteDb();
+  db.deleteDb();
+};

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/test/proxyauth.js
----------------------------------------------------------------------
diff --git a/share/test/proxyauth.js b/share/test/proxyauth.js
new file mode 100644
index 0000000..1677a66
--- /dev/null
+++ b/share/test/proxyauth.js
@@ -0,0 +1,130 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+ 
+ 
+ 
+couchTests.proxyauth = function(debug) {
+  // this test proxy authentification handler
+  
+  var usersDb = new CouchDB("test_suite_users", {"X-Couch-Full-Commit":"false"});
+  var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"});
+  
+  if (debug) debugger;
+ 
+  usersDb.deleteDb();
+
+  // Simple secret key generator
+  function generateSecret(length) {
+    var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
+    var secret = '';
+    for (var i=0; i<length; i++) {
+      secret += tab.charAt(Math.floor(Math.random() * 64));
+    }
+    return secret;
+  }
+  
+  var secret = generateSecret(64);
+  
+  function TestFun() {
+    db.deleteDb();
+    db.createDb();
+    
+    var benoitcUserDoc = CouchDB.prepareUserDoc({
+      name: "benoitc@apache.org"
+    }, "test");
+    T(usersDb.save(benoitcUserDoc).ok);
+    
+    T(CouchDB.session().userCtx.name == null);
+
+    // test that you can use basic auth aginst the users db
+    var s = CouchDB.session({
+      headers : {
+        "Authorization" : "Basic YmVub2l0Y0BhcGFjaGUub3JnOnRlc3Q="
+      }
+    });
+    T(s.userCtx.name == "benoitc@apache.org");
+    T(s.info.authenticated == "default");
+    
+    CouchDB.logout();
+    
+    var headers = {
+      "X-Auth-CouchDB-UserName": "benoitc@apache.org",
+      "X-Auth-CouchDB-Roles": "test",
+      "X-Auth-CouchDB-Token": hex_hmac_sha1(secret, "benoitc@apache.org")
+    };
+    
+    var designDoc = {
+      _id:"_design/test",
+      language: "javascript",
+       
+      shows: {
+        "welcome": stringFun(function(doc,req) {
+          return "Welcome " + req.userCtx["name"];
+        }),
+        "role": stringFun(function(doc, req) {
+          return req.userCtx['roles'][0];
+        })
+      }
+    };
+
+    db.save(designDoc);
+    
+    var req = CouchDB.request("GET", "/test_suite_db/_design/test/_show/welcome",
+                        {headers: headers});
+    T(req.responseText == "Welcome benoitc@apache.org");
+    
+    req = CouchDB.request("GET", "/test_suite_db/_design/test/_show/role",
+                        {headers: headers});
+    T(req.responseText == "test");
+    
+    var xhr = CouchDB.request("PUT", "/_config/couch_httpd_auth/proxy_use_secret",{
+      body : JSON.stringify("true"),
+      headers: {"X-Couch-Persist": "false"}
+    });
+    T(xhr.status == 200);
+    
+    req = CouchDB.request("GET", "/test_suite_db/_design/test/_show/welcome",
+                        {headers: headers});
+    T(req.responseText == "Welcome benoitc@apache.org");
+    
+    req = CouchDB.request("GET", "/test_suite_db/_design/test/_show/role",
+                        {headers: headers});
+    T(req.responseText == "test");
+    
+  }
+  
+  run_on_modified_server(
+    [{section: "httpd",
+      key: "authentication_handlers",
+      value:"{couch_httpd_auth, proxy_authentification_handler}, {couch_httpd_auth, default_authentication_handler}"},
+      {section: "couch_httpd_auth",
+        key: "authentication_db", 
+        value: "test_suite_users"},
+      {section: "couch_httpd_auth",
+        key: "secret", 
+        value: secret},
+      {section: "couch_httpd_auth",
+        key: "x_auth_username", 
+        value: "X-Auth-CouchDB-UserName"},
+      {section: "couch_httpd_auth",
+        key: "x_auth_roles", 
+        value: "X-Auth-CouchDB-Roles"},
+      {section: "couch_httpd_auth",
+        key: "x_auth_token", 
+        value: "X-Auth-CouchDB-Token"},
+      {section: "couch_httpd_auth",
+        key: "proxy_use_secret", 
+        value: "false"}],
+    TestFun
+  );
+  
+};


[23/37] goodbye Futon, old friend <3

Posted by ja...@apache.org.
http://git-wip-us.apache.org/repos/asf/couchdb/blob/cca309f3/share/www/script/jquery.js
----------------------------------------------------------------------
diff --git a/share/www/script/jquery.js b/share/www/script/jquery.js
deleted file mode 100644
index a86bf79..0000000
--- a/share/www/script/jquery.js
+++ /dev/null
@@ -1,9472 +0,0 @@
-/*!
- * jQuery JavaScript Library v1.8.3
- * http://jquery.com/
- *
- * Includes Sizzle.js
- * http://sizzlejs.com/
- *
- * Copyright 2012 jQuery Foundation and other contributors
- * Released under the MIT license
- * http://jquery.org/license
- *
- * Date: Tue Nov 13 2012 08:20:33 GMT-0500 (Eastern Standard Time)
- */
-(function( window, undefined ) {
-var
-	// A central reference to the root jQuery(document)
-	rootjQuery,
-
-	// The deferred used on DOM ready
-	readyList,
-
-	// Use the correct document accordingly with window argument (sandbox)
-	document = window.document,
-	location = window.location,
-	navigator = window.navigator,
-
-	// Map over jQuery in case of overwrite
-	_jQuery = window.jQuery,
-
-	// Map over the $ in case of overwrite
-	_$ = window.$,
-
-	// Save a reference to some core methods
-	core_push = Array.prototype.push,
-	core_slice = Array.prototype.slice,
-	core_indexOf = Array.prototype.indexOf,
-	core_toString = Object.prototype.toString,
-	core_hasOwn = Object.prototype.hasOwnProperty,
-	core_trim = String.prototype.trim,
-
-	// Define a local copy of jQuery
-	jQuery = function( selector, context ) {
-		// The jQuery object is actually just the init constructor 'enhanced'
-		return new jQuery.fn.init( selector, context, rootjQuery );
-	},
-
-	// Used for matching numbers
-	core_pnum = /[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source,
-
-	// Used for detecting and trimming whitespace
-	core_rnotwhite = /\S/,
-	core_rspace = /\s+/,
-
-	// Make sure we trim BOM and NBSP (here's looking at you, Safari 5.0 and IE)
-	rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
-
-	// A simple way to check for HTML strings
-	// Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
-	rquickExpr = /^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,
-
-	// Match a standalone tag
-	rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>|)$/,
-
-	// JSON RegExp
-	rvalidchars = /^[\],:{}\s]*$/,
-	rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g,
-	rvalidescape = /\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,
-	rvalidtokens = /"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g,
-
-	// Matches dashed string for camelizing
-	rmsPrefix = /^-ms-/,
-	rdashAlpha = /-([\da-z])/gi,
-
-	// Used by jQuery.camelCase as callback to replace()
-	fcamelCase = function( all, letter ) {
-		return ( letter + "" ).toUpperCase();
-	},
-
-	// The ready event handler and self cleanup method
-	DOMContentLoaded = function() {
-		if ( document.addEventListener ) {
-			document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false );
-			jQuery.ready();
-		} else if ( document.readyState === "complete" ) {
-			// we're here because readyState === "complete" in oldIE
-			// which is good enough for us to call the dom ready!
-			document.detachEvent( "onreadystatechange", DOMContentLoaded );
-			jQuery.ready();
-		}
-	},
-
-	// [[Class]] -> type pairs
-	class2type = {};
-
-jQuery.fn = jQuery.prototype = {
-	constructor: jQuery,
-	init: function( selector, context, rootjQuery ) {
-		var match, elem, ret, doc;
-
-		// Handle $(""), $(null), $(undefined), $(false)
-		if ( !selector ) {
-			return this;
-		}
-
-		// Handle $(DOMElement)
-		if ( selector.nodeType ) {
-			this.context = this[0] = selector;
-			this.length = 1;
-			return this;
-		}
-
-		// Handle HTML strings
-		if ( typeof selector === "string" ) {
-			if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) {
-				// Assume that strings that start and end with <> are HTML and skip the regex check
-				match = [ null, selector, null ];
-
-			} else {
-				match = rquickExpr.exec( selector );
-			}
-
-			// Match html or make sure no context is specified for #id
-			if ( match && (match[1] || !context) ) {
-
-				// HANDLE: $(html) -> $(array)
-				if ( match[1] ) {
-					context = context instanceof jQuery ? context[0] : context;
-					doc = ( context && context.nodeType ? context.ownerDocument || context : document );
-
-					// scripts is true for back-compat
-					selector = jQuery.parseHTML( match[1], doc, true );
-					if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) {
-						this.attr.call( selector, context, true );
-					}
-
-					return jQuery.merge( this, selector );
-
-				// HANDLE: $(#id)
-				} else {
-					elem = document.getElementById( match[2] );
-
-					// Check parentNode to catch when Blackberry 4.6 returns
-					// nodes that are no longer in the document #6963
-					if ( elem && elem.parentNode ) {
-						// Handle the case where IE and Opera return items
-						// by name instead of ID
-						if ( elem.id !== match[2] ) {
-							return rootjQuery.find( selector );
-						}
-
-						// Otherwise, we inject the element directly into the jQuery object
-						this.length = 1;
-						this[0] = elem;
-					}
-
-					this.context = document;
-					this.selector = selector;
-					return this;
-				}
-
-			// HANDLE: $(expr, $(...))
-			} else if ( !context || context.jquery ) {
-				return ( context || rootjQuery ).find( selector );
-
-			// HANDLE: $(expr, context)
-			// (which is just equivalent to: $(context).find(expr)
-			} else {
-				return this.constructor( context ).find( selector );
-			}
-
-		// HANDLE: $(function)
-		// Shortcut for document ready
-		} else if ( jQuery.isFunction( selector ) ) {
-			return rootjQuery.ready( selector );
-		}
-
-		if ( selector.selector !== undefined ) {
-			this.selector = selector.selector;
-			this.context = selector.context;
-		}
-
-		return jQuery.makeArray( selector, this );
-	},
-
-	// Start with an empty selector
-	selector: "",
-
-	// The current version of jQuery being used
-	jquery: "1.8.3",
-
-	// The default length of a jQuery object is 0
-	length: 0,
-
-	// The number of elements contained in the matched element set
-	size: function() {
-		return this.length;
-	},
-
-	toArray: function() {
-		return core_slice.call( this );
-	},
-
-	// Get the Nth element in the matched element set OR
-	// Get the whole matched element set as a clean array
-	get: function( num ) {
-		return num == null ?
-
-			// Return a 'clean' array
-			this.toArray() :
-
-			// Return just the object
-			( num < 0 ? this[ this.length + num ] : this[ num ] );
-	},
-
-	// Take an array of elements and push it onto the stack
-	// (returning the new matched element set)
-	pushStack: function( elems, name, selector ) {
-
-		// Build a new jQuery matched element set
-		var ret = jQuery.merge( this.constructor(), elems );
-
-		// Add the old object onto the stack (as a reference)
-		ret.prevObject = this;
-
-		ret.context = this.context;
-
-		if ( name === "find" ) {
-			ret.selector = this.selector + ( this.selector ? " " : "" ) + selector;
-		} else if ( name ) {
-			ret.selector = this.selector + "." + name + "(" + selector + ")";
-		}
-
-		// Return the newly-formed element set
-		return ret;
-	},
-
-	// Execute a callback for every element in the matched set.
-	// (You can seed the arguments with an array of args, but this is
-	// only used internally.)
-	each: function( callback, args ) {
-		return jQuery.each( this, callback, args );
-	},
-
-	ready: function( fn ) {
-		// Add the callback
-		jQuery.ready.promise().done( fn );
-
-		return this;
-	},
-
-	eq: function( i ) {
-		i = +i;
-		return i === -1 ?
-			this.slice( i ) :
-			this.slice( i, i + 1 );
-	},
-
-	first: function() {
-		return this.eq( 0 );
-	},
-
-	last: function() {
-		return this.eq( -1 );
-	},
-
-	slice: function() {
-		return this.pushStack( core_slice.apply( this, arguments ),
-			"slice", core_slice.call(arguments).join(",") );
-	},
-
-	map: function( callback ) {
-		return this.pushStack( jQuery.map(this, function( elem, i ) {
-			return callback.call( elem, i, elem );
-		}));
-	},
-
-	end: function() {
-		return this.prevObject || this.constructor(null);
-	},
-
-	// For internal use only.
-	// Behaves like an Array's method, not like a jQuery method.
-	push: core_push,
-	sort: [].sort,
-	splice: [].splice
-};
-
-// Give the init function the jQuery prototype for later instantiation
-jQuery.fn.init.prototype = jQuery.fn;
-
-jQuery.extend = jQuery.fn.extend = function() {
-	var options, name, src, copy, copyIsArray, clone,
-		target = arguments[0] || {},
-		i = 1,
-		length = arguments.length,
-		deep = false;
-
-	// Handle a deep copy situation
-	if ( typeof target === "boolean" ) {
-		deep = target;
-		target = arguments[1] || {};
-		// skip the boolean and the target
-		i = 2;
-	}
-
-	// Handle case when target is a string or something (possible in deep copy)
-	if ( typeof target !== "object" && !jQuery.isFunction(target) ) {
-		target = {};
-	}
-
-	// extend jQuery itself if only one argument is passed
-	if ( length === i ) {
-		target = this;
-		--i;
-	}
-
-	for ( ; i < length; i++ ) {
-		// Only deal with non-null/undefined values
-		if ( (options = arguments[ i ]) != null ) {
-			// Extend the base object
-			for ( name in options ) {
-				src = target[ name ];
-				copy = options[ name ];
-
-				// Prevent never-ending loop
-				if ( target === copy ) {
-					continue;
-				}
-
-				// Recurse if we're merging plain objects or arrays
-				if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {
-					if ( copyIsArray ) {
-						copyIsArray = false;
-						clone = src && jQuery.isArray(src) ? src : [];
-
-					} else {
-						clone = src && jQuery.isPlainObject(src) ? src : {};
-					}
-
-					// Never move original objects, clone them
-					target[ name ] = jQuery.extend( deep, clone, copy );
-
-				// Don't bring in undefined values
-				} else if ( copy !== undefined ) {
-					target[ name ] = copy;
-				}
-			}
-		}
-	}
-
-	// Return the modified object
-	return target;
-};
-
-jQuery.extend({
-	noConflict: function( deep ) {
-		if ( window.$ === jQuery ) {
-			window.$ = _$;
-		}
-
-		if ( deep && window.jQuery === jQuery ) {
-			window.jQuery = _jQuery;
-		}
-
-		return jQuery;
-	},
-
-	// Is the DOM ready to be used? Set to true once it occurs.
-	isReady: false,
-
-	// A counter to track how many items to wait for before
-	// the ready event fires. See #6781
-	readyWait: 1,
-
-	// Hold (or release) the ready event
-	holdReady: function( hold ) {
-		if ( hold ) {
-			jQuery.readyWait++;
-		} else {
-			jQuery.ready( true );
-		}
-	},
-
-	// Handle when the DOM is ready
-	ready: function( wait ) {
-
-		// Abort if there are pending holds or we're already ready
-		if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {
-			return;
-		}
-
-		// Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
-		if ( !document.body ) {
-			return setTimeout( jQuery.ready, 1 );
-		}
-
-		// Remember that the DOM is ready
-		jQuery.isReady = true;
-
-		// If a normal DOM Ready event fired, decrement, and wait if need be
-		if ( wait !== true && --jQuery.readyWait > 0 ) {
-			return;
-		}
-
-		// If there are functions bound, to execute
-		readyList.resolveWith( document, [ jQuery ] );
-
-		// Trigger any bound ready events
-		if ( jQuery.fn.trigger ) {
-			jQuery( document ).trigger("ready").off("ready");
-		}
-	},
-
-	// See test/unit/core.js for details concerning isFunction.
-	// Since version 1.3, DOM methods and functions like alert
-	// aren't supported. They return false on IE (#2968).
-	isFunction: function( obj ) {
-		return jQuery.type(obj) === "function";
-	},
-
-	isArray: Array.isArray || function( obj ) {
-		return jQuery.type(obj) === "array";
-	},
-
-	isWindow: function( obj ) {
-		return obj != null && obj == obj.window;
-	},
-
-	isNumeric: function( obj ) {
-		return !isNaN( parseFloat(obj) ) && isFinite( obj );
-	},
-
-	type: function( obj ) {
-		return obj == null ?
-			String( obj ) :
-			class2type[ core_toString.call(obj) ] || "object";
-	},
-
-	isPlainObject: function( obj ) {
-		// Must be an Object.
-		// Because of IE, we also have to check the presence of the constructor property.
-		// Make sure that DOM nodes and window objects don't pass through, as well
-		if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {
-			return false;
-		}
-
-		try {
-			// Not own constructor property must be Object
-			if ( obj.constructor &&
-				!core_hasOwn.call(obj, "constructor") &&
-				!core_hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) {
-				return false;
-			}
-		} catch ( e ) {
-			// IE8,9 Will throw exceptions on certain host objects #9897
-			return false;
-		}
-
-		// Own properties are enumerated firstly, so to speed up,
-		// if last one is own, then all properties are own.
-
-		var key;
-		for ( key in obj ) {}
-
-		return key === undefined || core_hasOwn.call( obj, key );
-	},
-
-	isEmptyObject: function( obj ) {
-		var name;
-		for ( name in obj ) {
-			return false;
-		}
-		return true;
-	},
-
-	error: function( msg ) {
-		throw new Error( msg );
-	},
-
-	// data: string of html
-	// context (optional): If specified, the fragment will be created in this context, defaults to document
-	// scripts (optional): If true, will include scripts passed in the html string
-	parseHTML: function( data, context, scripts ) {
-		var parsed;
-		if ( !data || typeof data !== "string" ) {
-			return null;
-		}
-		if ( typeof context === "boolean" ) {
-			scripts = context;
-			context = 0;
-		}
-		context = context || document;
-
-		// Single tag
-		if ( (parsed = rsingleTag.exec( data )) ) {
-			return [ context.createElement( parsed[1] ) ];
-		}
-
-		parsed = jQuery.buildFragment( [ data ], context, scripts ? null : [] );
-		return jQuery.merge( [],
-			(parsed.cacheable ? jQuery.clone( parsed.fragment ) : parsed.fragment).childNodes );
-	},
-
-	parseJSON: function( data ) {
-		if ( !data || typeof data !== "string") {
-			return null;
-		}
-
-		// Make sure leading/trailing whitespace is removed (IE can't handle it)
-		data = jQuery.trim( data );
-
-		// Attempt to parse using the native JSON parser first
-		if ( window.JSON && window.JSON.parse ) {
-			return window.JSON.parse( data );
-		}
-
-		// Make sure the incoming data is actual JSON
-		// Logic borrowed from http://json.org/json2.js
-		if ( rvalidchars.test( data.replace( rvalidescape, "@" )
-			.replace( rvalidtokens, "]" )
-			.replace( rvalidbraces, "")) ) {
-
-			return ( new Function( "return " + data ) )();
-
-		}
-		jQuery.error( "Invalid JSON: " + data );
-	},
-
-	// Cross-browser xml parsing
-	parseXML: function( data ) {
-		var xml, tmp;
-		if ( !data || typeof data !== "string" ) {
-			return null;
-		}
-		try {
-			if ( window.DOMParser ) { // Standard
-				tmp = new DOMParser();
-				xml = tmp.parseFromString( data , "text/xml" );
-			} else { // IE
-				xml = new ActiveXObject( "Microsoft.XMLDOM" );
-				xml.async = "false";
-				xml.loadXML( data );
-			}
-		} catch( e ) {
-			xml = undefined;
-		}
-		if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) {
-			jQuery.error( "Invalid XML: " + data );
-		}
-		return xml;
-	},
-
-	noop: function() {},
-
-	// Evaluates a script in a global context
-	// Workarounds based on findings by Jim Driscoll
-	// http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context
-	globalEval: function( data ) {
-		if ( data && core_rnotwhite.test( data ) ) {
-			// We use execScript on Internet Explorer
-			// We use an anonymous function so that context is window
-			// rather than jQuery in Firefox
-			( window.execScript || function( data ) {
-				window[ "eval" ].call( window, data );
-			} )( data );
-		}
-	},
-
-	// Convert dashed to camelCase; used by the css and data modules
-	// Microsoft forgot to hump their vendor prefix (#9572)
-	camelCase: function( string ) {
-		return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
-	},
-
-	nodeName: function( elem, name ) {
-		return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
-	},
-
-	// args is for internal usage only
-	each: function( obj, callback, args ) {
-		var name,
-			i = 0,
-			length = obj.length,
-			isObj = length === undefined || jQuery.isFunction( obj );
-
-		if ( args ) {
-			if ( isObj ) {
-				for ( name in obj ) {
-					if ( callback.apply( obj[ name ], args ) === false ) {
-						break;
-					}
-				}
-			} else {
-				for ( ; i < length; ) {
-					if ( callback.apply( obj[ i++ ], args ) === false ) {
-						break;
-					}
-				}
-			}
-
-		// A special, fast, case for the most common use of each
-		} else {
-			if ( isObj ) {
-				for ( name in obj ) {
-					if ( callback.call( obj[ name ], name, obj[ name ] ) === false ) {
-						break;
-					}
-				}
-			} else {
-				for ( ; i < length; ) {
-					if ( callback.call( obj[ i ], i, obj[ i++ ] ) === false ) {
-						break;
-					}
-				}
-			}
-		}
-
-		return obj;
-	},
-
-	// Use native String.trim function wherever possible
-	trim: core_trim && !core_trim.call("\uFEFF\xA0") ?
-		function( text ) {
-			return text == null ?
-				"" :
-				core_trim.call( text );
-		} :
-
-		// Otherwise use our own trimming functionality
-		function( text ) {
-			return text == null ?
-				"" :
-				( text + "" ).replace( rtrim, "" );
-		},
-
-	// results is for internal usage only
-	makeArray: function( arr, results ) {
-		var type,
-			ret = results || [];
-
-		if ( arr != null ) {
-			// The window, strings (and functions) also have 'length'
-			// Tweaked logic slightly to handle Blackberry 4.7 RegExp issues #6930
-			type = jQuery.type( arr );
-
-			if ( arr.length == null || type === "string" || type === "function" || type === "regexp" || jQuery.isWindow( arr ) ) {
-				core_push.call( ret, arr );
-			} else {
-				jQuery.merge( ret, arr );
-			}
-		}
-
-		return ret;
-	},
-
-	inArray: function( elem, arr, i ) {
-		var len;
-
-		if ( arr ) {
-			if ( core_indexOf ) {
-				return core_indexOf.call( arr, elem, i );
-			}
-
-			len = arr.length;
-			i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0;
-
-			for ( ; i < len; i++ ) {
-				// Skip accessing in sparse arrays
-				if ( i in arr && arr[ i ] === elem ) {
-					return i;
-				}
-			}
-		}
-
-		return -1;
-	},
-
-	merge: function( first, second ) {
-		var l = second.length,
-			i = first.length,
-			j = 0;
-
-		if ( typeof l === "number" ) {
-			for ( ; j < l; j++ ) {
-				first[ i++ ] = second[ j ];
-			}
-
-		} else {
-			while ( second[j] !== undefined ) {
-				first[ i++ ] = second[ j++ ];
-			}
-		}
-
-		first.length = i;
-
-		return first;
-	},
-
-	grep: function( elems, callback, inv ) {
-		var retVal,
-			ret = [],
-			i = 0,
-			length = elems.length;
-		inv = !!inv;
-
-		// Go through the array, only saving the items
-		// that pass the validator function
-		for ( ; i < length; i++ ) {
-			retVal = !!callback( elems[ i ], i );
-			if ( inv !== retVal ) {
-				ret.push( elems[ i ] );
-			}
-		}
-
-		return ret;
-	},
-
-	// arg is for internal usage only
-	map: function( elems, callback, arg ) {
-		var value, key,
-			ret = [],
-			i = 0,
-			length = elems.length,
-			// jquery objects are treated as arrays
-			isArray = elems instanceof jQuery || length !== undefined && typeof length === "number" && ( ( length > 0 && elems[ 0 ] && elems[ length -1 ] ) || length === 0 || jQuery.isArray( elems ) ) ;
-
-		// Go through the array, translating each of the items to their
-		if ( isArray ) {
-			for ( ; i < length; i++ ) {
-				value = callback( elems[ i ], i, arg );
-
-				if ( value != null ) {
-					ret[ ret.length ] = value;
-				}
-			}
-
-		// Go through every key on the object,
-		} else {
-			for ( key in elems ) {
-				value = callback( elems[ key ], key, arg );
-
-				if ( value != null ) {
-					ret[ ret.length ] = value;
-				}
-			}
-		}
-
-		// Flatten any nested arrays
-		return ret.concat.apply( [], ret );
-	},
-
-	// A global GUID counter for objects
-	guid: 1,
-
-	// Bind a function to a context, optionally partially applying any
-	// arguments.
-	proxy: function( fn, context ) {
-		var tmp, args, proxy;
-
-		if ( typeof context === "string" ) {
-			tmp = fn[ context ];
-			context = fn;
-			fn = tmp;
-		}
-
-		// Quick check to determine if target is callable, in the spec
-		// this throws a TypeError, but we will just return undefined.
-		if ( !jQuery.isFunction( fn ) ) {
-			return undefined;
-		}
-
-		// Simulated bind
-		args = core_slice.call( arguments, 2 );
-		proxy = function() {
-			return fn.apply( context, args.concat( core_slice.call( arguments ) ) );
-		};
-
-		// Set the guid of unique handler to the same of original handler, so it can be removed
-		proxy.guid = fn.guid = fn.guid || jQuery.guid++;
-
-		return proxy;
-	},
-
-	// Multifunctional method to get and set values of a collection
-	// The value/s can optionally be executed if it's a function
-	access: function( elems, fn, key, value, chainable, emptyGet, pass ) {
-		var exec,
-			bulk = key == null,
-			i = 0,
-			length = elems.length;
-
-		// Sets many values
-		if ( key && typeof key === "object" ) {
-			for ( i in key ) {
-				jQuery.access( elems, fn, i, key[i], 1, emptyGet, value );
-			}
-			chainable = 1;
-
-		// Sets one value
-		} else if ( value !== undefined ) {
-			// Optionally, function values get executed if exec is true
-			exec = pass === undefined && jQuery.isFunction( value );
-
-			if ( bulk ) {
-				// Bulk operations only iterate when executing function values
-				if ( exec ) {
-					exec = fn;
-					fn = function( elem, key, value ) {
-						return exec.call( jQuery( elem ), value );
-					};
-
-				// Otherwise they run against the entire set
-				} else {
-					fn.call( elems, value );
-					fn = null;
-				}
-			}
-
-			if ( fn ) {
-				for (; i < length; i++ ) {
-					fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass );
-				}
-			}
-
-			chainable = 1;
-		}
-
-		return chainable ?
-			elems :
-
-			// Gets
-			bulk ?
-				fn.call( elems ) :
-				length ? fn( elems[0], key ) : emptyGet;
-	},
-
-	now: function() {
-		return ( new Date() ).getTime();
-	}
-});
-
-jQuery.ready.promise = function( obj ) {
-	if ( !readyList ) {
-
-		readyList = jQuery.Deferred();
-
-		// Catch cases where $(document).ready() is called after the browser event has already occurred.
-		// we once tried to use readyState "interactive" here, but it caused issues like the one
-		// discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15
-		if ( document.readyState === "complete" ) {
-			// Handle it asynchronously to allow scripts the opportunity to delay ready
-			setTimeout( jQuery.ready, 1 );
-
-		// Standards-based browsers support DOMContentLoaded
-		} else if ( document.addEventListener ) {
-			// Use the handy event callback
-			document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false );
-
-			// A fallback to window.onload, that will always work
-			window.addEventListener( "load", jQuery.ready, false );
-
-		// If IE event model is used
-		} else {
-			// Ensure firing before onload, maybe late but safe also for iframes
-			document.attachEvent( "onreadystatechange", DOMContentLoaded );
-
-			// A fallback to window.onload, that will always work
-			window.attachEvent( "onload", jQuery.ready );
-
-			// If IE and not a frame
-			// continually check to see if the document is ready
-			var top = false;
-
-			try {
-				top = window.frameElement == null && document.documentElement;
-			} catch(e) {}
-
-			if ( top && top.doScroll ) {
-				(function doScrollCheck() {
-					if ( !jQuery.isReady ) {
-
-						try {
-							// Use the trick by Diego Perini
-							// http://javascript.nwbox.com/IEContentLoaded/
-							top.doScroll("left");
-						} catch(e) {
-							return setTimeout( doScrollCheck, 50 );
-						}
-
-						// and execute any waiting functions
-						jQuery.ready();
-					}
-				})();
-			}
-		}
-	}
-	return readyList.promise( obj );
-};
-
-// Populate the class2type map
-jQuery.each("Boolean Number String Function Array Date RegExp Object".split(" "), function(i, name) {
-	class2type[ "[object " + name + "]" ] = name.toLowerCase();
-});
-
-// All jQuery objects should point back to these
-rootjQuery = jQuery(document);
-// String to Object options format cache
-var optionsCache = {};
-
-// Convert String-formatted options into Object-formatted ones and store in cache
-function createOptions( options ) {
-	var object = optionsCache[ options ] = {};
-	jQuery.each( options.split( core_rspace ), function( _, flag ) {
-		object[ flag ] = true;
-	});
-	return object;
-}
-
-/*
- * Create a callback list using the following parameters:
- *
- *	options: an optional list of space-separated options that will change how
- *			the callback list behaves or a more traditional option object
- *
- * By default a callback list will act like an event callback list and can be
- * "fired" multiple times.
- *
- * Possible options:
- *
- *	once:			will ensure the callback list can only be fired once (like a Deferred)
- *
- *	memory:			will keep track of previous values and will call any callback added
- *					after the list has been fired right away with the latest "memorized"
- *					values (like a Deferred)
- *
- *	unique:			will ensure a callback can only be added once (no duplicate in the list)
- *
- *	stopOnFalse:	interrupt callings when a callback returns false
- *
- */
-jQuery.Callbacks = function( options ) {
-
-	// Convert options from String-formatted to Object-formatted if needed
-	// (we check in cache first)
-	options = typeof options === "string" ?
-		( optionsCache[ options ] || createOptions( options ) ) :
-		jQuery.extend( {}, options );
-
-	var // Last fire value (for non-forgettable lists)
-		memory,
-		// Flag to know if list was already fired
-		fired,
-		// Flag to know if list is currently firing
-		firing,
-		// First callback to fire (used internally by add and fireWith)
-		firingStart,
-		// End of the loop when firing
-		firingLength,
-		// Index of currently firing callback (modified by remove if needed)
-		firingIndex,
-		// Actual callback list
-		list = [],
-		// Stack of fire calls for repeatable lists
-		stack = !options.once && [],
-		// Fire callbacks
-		fire = function( data ) {
-			memory = options.memory && data;
-			fired = true;
-			firingIndex = firingStart || 0;
-			firingStart = 0;
-			firingLength = list.length;
-			firing = true;
-			for ( ; list && firingIndex < firingLength; firingIndex++ ) {
-				if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) {
-					memory = false; // To prevent further calls using add
-					break;
-				}
-			}
-			firing = false;
-			if ( list ) {
-				if ( stack ) {
-					if ( stack.length ) {
-						fire( stack.shift() );
-					}
-				} else if ( memory ) {
-					list = [];
-				} else {
-					self.disable();
-				}
-			}
-		},
-		// Actual Callbacks object
-		self = {
-			// Add a callback or a collection of callbacks to the list
-			add: function() {
-				if ( list ) {
-					// First, we save the current length
-					var start = list.length;
-					(function add( args ) {
-						jQuery.each( args, function( _, arg ) {
-							var type = jQuery.type( arg );
-							if ( type === "function" ) {
-								if ( !options.unique || !self.has( arg ) ) {
-									list.push( arg );
-								}
-							} else if ( arg && arg.length && type !== "string" ) {
-								// Inspect recursively
-								add( arg );
-							}
-						});
-					})( arguments );
-					// Do we need to add the callbacks to the
-					// current firing batch?
-					if ( firing ) {
-						firingLength = list.length;
-					// With memory, if we're not firing then
-					// we should call right away
-					} else if ( memory ) {
-						firingStart = start;
-						fire( memory );
-					}
-				}
-				return this;
-			},
-			// Remove a callback from the list
-			remove: function() {
-				if ( list ) {
-					jQuery.each( arguments, function( _, arg ) {
-						var index;
-						while( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {
-							list.splice( index, 1 );
-							// Handle firing indexes
-							if ( firing ) {
-								if ( index <= firingLength ) {
-									firingLength--;
-								}
-								if ( index <= firingIndex ) {
-									firingIndex--;
-								}
-							}
-						}
-					});
-				}
-				return this;
-			},
-			// Control if a given callback is in the list
-			has: function( fn ) {
-				return jQuery.inArray( fn, list ) > -1;
-			},
-			// Remove all callbacks from the list
-			empty: function() {
-				list = [];
-				return this;
-			},
-			// Have the list do nothing anymore
-			disable: function() {
-				list = stack = memory = undefined;
-				return this;
-			},
-			// Is it disabled?
-			disabled: function() {
-				return !list;
-			},
-			// Lock the list in its current state
-			lock: function() {
-				stack = undefined;
-				if ( !memory ) {
-					self.disable();
-				}
-				return this;
-			},
-			// Is it locked?
-			locked: function() {
-				return !stack;
-			},
-			// Call all callbacks with the given context and arguments
-			fireWith: function( context, args ) {
-				args = args || [];
-				args = [ context, args.slice ? args.slice() : args ];
-				if ( list && ( !fired || stack ) ) {
-					if ( firing ) {
-						stack.push( args );
-					} else {
-						fire( args );
-					}
-				}
-				return this;
-			},
-			// Call all the callbacks with the given arguments
-			fire: function() {
-				self.fireWith( this, arguments );
-				return this;
-			},
-			// To know if the callbacks have already been called at least once
-			fired: function() {
-				return !!fired;
-			}
-		};
-
-	return self;
-};
-jQuery.extend({
-
-	Deferred: function( func ) {
-		var tuples = [
-				// action, add listener, listener list, final state
-				[ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ],
-				[ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ],
-				[ "notify", "progress", jQuery.Callbacks("memory") ]
-			],
-			state = "pending",
-			promise = {
-				state: function() {
-					return state;
-				},
-				always: function() {
-					deferred.done( arguments ).fail( arguments );
-					return this;
-				},
-				then: function( /* fnDone, fnFail, fnProgress */ ) {
-					var fns = arguments;
-					return jQuery.Deferred(function( newDefer ) {
-						jQuery.each( tuples, function( i, tuple ) {
-							var action = tuple[ 0 ],
-								fn = fns[ i ];
-							// deferred[ done | fail | progress ] for forwarding actions to newDefer
-							deferred[ tuple[1] ]( jQuery.isFunction( fn ) ?
-								function() {
-									var returned = fn.apply( this, arguments );
-									if ( returned && jQuery.isFunction( returned.promise ) ) {
-										returned.promise()
-											.done( newDefer.resolve )
-											.fail( newDefer.reject )
-											.progress( newDefer.notify );
-									} else {
-										newDefer[ action + "With" ]( this === deferred ? newDefer : this, [ returned ] );
-									}
-								} :
-								newDefer[ action ]
-							);
-						});
-						fns = null;
-					}).promise();
-				},
-				// Get a promise for this deferred
-				// If obj is provided, the promise aspect is added to the object
-				promise: function( obj ) {
-					return obj != null ? jQuery.extend( obj, promise ) : promise;
-				}
-			},
-			deferred = {};
-
-		// Keep pipe for back-compat
-		promise.pipe = promise.then;
-
-		// Add list-specific methods
-		jQuery.each( tuples, function( i, tuple ) {
-			var list = tuple[ 2 ],
-				stateString = tuple[ 3 ];
-
-			// promise[ done | fail | progress ] = list.add
-			promise[ tuple[1] ] = list.add;
-
-			// Handle state
-			if ( stateString ) {
-				list.add(function() {
-					// state = [ resolved | rejected ]
-					state = stateString;
-
-				// [ reject_list | resolve_list ].disable; progress_list.lock
-				}, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock );
-			}
-
-			// deferred[ resolve | reject | notify ] = list.fire
-			deferred[ tuple[0] ] = list.fire;
-			deferred[ tuple[0] + "With" ] = list.fireWith;
-		});
-
-		// Make the deferred a promise
-		promise.promise( deferred );
-
-		// Call given func if any
-		if ( func ) {
-			func.call( deferred, deferred );
-		}
-
-		// All done!
-		return deferred;
-	},
-
-	// Deferred helper
-	when: function( subordinate /* , ..., subordinateN */ ) {
-		var i = 0,
-			resolveValues = core_slice.call( arguments ),
-			length = resolveValues.length,
-
-			// the count of uncompleted subordinates
-			remaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0,
-
-			// the master Deferred. If resolveValues consist of only a single Deferred, just use that.
-			deferred = remaining === 1 ? subordinate : jQuery.Deferred(),
-
-			// Update function for both resolve and progress values
-			updateFunc = function( i, contexts, values ) {
-				return function( value ) {
-					contexts[ i ] = this;
-					values[ i ] = arguments.length > 1 ? core_slice.call( arguments ) : value;
-					if( values === progressValues ) {
-						deferred.notifyWith( contexts, values );
-					} else if ( !( --remaining ) ) {
-						deferred.resolveWith( contexts, values );
-					}
-				};
-			},
-
-			progressValues, progressContexts, resolveContexts;
-
-		// add listeners to Deferred subordinates; treat others as resolved
-		if ( length > 1 ) {
-			progressValues = new Array( length );
-			progressContexts = new Array( length );
-			resolveContexts = new Array( length );
-			for ( ; i < length; i++ ) {
-				if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) {
-					resolveValues[ i ].promise()
-						.done( updateFunc( i, resolveContexts, resolveValues ) )
-						.fail( deferred.reject )
-						.progress( updateFunc( i, progressContexts, progressValues ) );
-				} else {
-					--remaining;
-				}
-			}
-		}
-
-		// if we're not waiting on anything, resolve the master
-		if ( !remaining ) {
-			deferred.resolveWith( resolveContexts, resolveValues );
-		}
-
-		return deferred.promise();
-	}
-});
-jQuery.support = (function() {
-
-	var support,
-		all,
-		a,
-		select,
-		opt,
-		input,
-		fragment,
-		eventName,
-		i,
-		isSupported,
-		clickFn,
-		div = document.createElement("div");
-
-	// Setup
-	div.setAttribute( "className", "t" );
-	div.innerHTML = "  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";
-
-	// Support tests won't run in some limited or non-browser environments
-	all = div.getElementsByTagName("*");
-	a = div.getElementsByTagName("a")[ 0 ];
-	if ( !all || !a || !all.length ) {
-		return {};
-	}
-
-	// First batch of tests
-	select = document.createElement("select");
-	opt = select.appendChild( document.createElement("option") );
-	input = div.getElementsByTagName("input")[ 0 ];
-
-	a.style.cssText = "top:1px;float:left;opacity:.5";
-	support = {
-		// IE strips leading whitespace when .innerHTML is used
-		leadingWhitespace: ( div.firstChild.nodeType === 3 ),
-
-		// Make sure that tbody elements aren't automatically inserted
-		// IE will insert them into empty tables
-		tbody: !div.getElementsByTagName("tbody").length,
-
-		// Make sure that link elements get serialized correctly by innerHTML
-		// This requires a wrapper element in IE
-		htmlSerialize: !!div.getElementsByTagName("link").length,
-
-		// Get the style information from getAttribute
-		// (IE uses .cssText instead)
-		style: /top/.test( a.getAttribute("style") ),
-
-		// Make sure that URLs aren't manipulated
-		// (IE normalizes it by default)
-		hrefNormalized: ( a.getAttribute("href") === "/a" ),
-
-		// Make sure that element opacity exists
-		// (IE uses filter instead)
-		// Use a regex to work around a WebKit issue. See #5145
-		opacity: /^0.5/.test( a.style.opacity ),
-
-		// Verify style float existence
-		// (IE uses styleFloat instead of cssFloat)
-		cssFloat: !!a.style.cssFloat,
-
-		// Make sure that if no value is specified for a checkbox
-		// that it defaults to "on".
-		// (WebKit defaults to "" instead)
-		checkOn: ( input.value === "on" ),
-
-		// Make sure that a selected-by-default option has a working selected property.
-		// (WebKit defaults to false instead of true, IE too, if it's in an optgroup)
-		optSelected: opt.selected,
-
-		// Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7)
-		getSetAttribute: div.className !== "t",
-
-		// Tests for enctype support on a form (#6743)
-		enctype: !!document.createElement("form").enctype,
-
-		// Makes sure cloning an html5 element does not cause problems
-		// Where outerHTML is undefined, this still works
-		html5Clone: document.createElement("nav").cloneNode( true ).outerHTML !== "<:nav></:nav>",
-
-		// jQuery.support.boxModel DEPRECATED in 1.8 since we don't support Quirks Mode
-		boxModel: ( document.compatMode === "CSS1Compat" ),
-
-		// Will be defined later
-		submitBubbles: true,
-		changeBubbles: true,
-		focusinBubbles: false,
-		deleteExpando: true,
-		noCloneEvent: true,
-		inlineBlockNeedsLayout: false,
-		shrinkWrapBlocks: false,
-		reliableMarginRight: true,
-		boxSizingReliable: true,
-		pixelPosition: false
-	};
-
-	// Make sure checked status is properly cloned
-	input.checked = true;
-	support.noCloneChecked = input.cloneNode( true ).checked;
-
-	// Make sure that the options inside disabled selects aren't marked as disabled
-	// (WebKit marks them as disabled)
-	select.disabled = true;
-	support.optDisabled = !opt.disabled;
-
-	// Test to see if it's possible to delete an expando from an element
-	// Fails in Internet Explorer
-	try {
-		delete div.test;
-	} catch( e ) {
-		support.deleteExpando = false;
-	}
-
-	if ( !div.addEventListener && div.attachEvent && div.fireEvent ) {
-		div.attachEvent( "onclick", clickFn = function() {
-			// Cloning a node shouldn't copy over any
-			// bound event handlers (IE does this)
-			support.noCloneEvent = false;
-		});
-		div.cloneNode( true ).fireEvent("onclick");
-		div.detachEvent( "onclick", clickFn );
-	}
-
-	// Check if a radio maintains its value
-	// after being appended to the DOM
-	input = document.createElement("input");
-	input.value = "t";
-	input.setAttribute( "type", "radio" );
-	support.radioValue = input.value === "t";
-
-	input.setAttribute( "checked", "checked" );
-
-	// #11217 - WebKit loses check when the name is after the checked attribute
-	input.setAttribute( "name", "t" );
-
-	div.appendChild( input );
-	fragment = document.createDocumentFragment();
-	fragment.appendChild( div.lastChild );
-
-	// WebKit doesn't clone checked state correctly in fragments
-	support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked;
-
-	// Check if a disconnected checkbox will retain its checked
-	// value of true after appended to the DOM (IE6/7)
-	support.appendChecked = input.checked;
-
-	fragment.removeChild( input );
-	fragment.appendChild( div );
-
-	// Technique from Juriy Zaytsev
-	// http://perfectionkills.com/detecting-event-support-without-browser-sniffing/
-	// We only care about the case where non-standard event systems
-	// are used, namely in IE. Short-circuiting here helps us to
-	// avoid an eval call (in setAttribute) which can cause CSP
-	// to go haywire. See: https://developer.mozilla.org/en/Security/CSP
-	if ( div.attachEvent ) {
-		for ( i in {
-			submit: true,
-			change: true,
-			focusin: true
-		}) {
-			eventName = "on" + i;
-			isSupported = ( eventName in div );
-			if ( !isSupported ) {
-				div.setAttribute( eventName, "return;" );
-				isSupported = ( typeof div[ eventName ] === "function" );
-			}
-			support[ i + "Bubbles" ] = isSupported;
-		}
-	}
-
-	// Run tests that need a body at doc ready
-	jQuery(function() {
-		var container, div, tds, marginDiv,
-			divReset = "padding:0;margin:0;border:0;display:block;overflow:hidden;",
-			body = document.getElementsByTagName("body")[0];
-
-		if ( !body ) {
-			// Return for frameset docs that don't have a body
-			return;
-		}
-
-		container = document.createElement("div");
-		container.style.cssText = "visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px";
-		body.insertBefore( container, body.firstChild );
-
-		// Construct the test element
-		div = document.createElement("div");
-		container.appendChild( div );
-
-		// Check if table cells still have offsetWidth/Height when they are set
-		// to display:none and there are still other visible table cells in a
-		// table row; if so, offsetWidth/Height are not reliable for use when
-		// determining if an element has been hidden directly using
-		// display:none (it is still safe to use offsets if a parent element is
-		// hidden; don safety goggles and see bug #4512 for more information).
-		// (only IE 8 fails this test)
-		div.innerHTML = "<table><tr><td></td><td>t</td></tr></table>";
-		tds = div.getElementsByTagName("td");
-		tds[ 0 ].style.cssText = "padding:0;margin:0;border:0;display:none";
-		isSupported = ( tds[ 0 ].offsetHeight === 0 );
-
-		tds[ 0 ].style.display = "";
-		tds[ 1 ].style.display = "none";
-
-		// Check if empty table cells still have offsetWidth/Height
-		// (IE <= 8 fail this test)
-		support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 );
-
-		// Check box-sizing and margin behavior
-		div.innerHTML = "";
-		div.style.cssText = "box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;";
-		support.boxSizing = ( div.offsetWidth === 4 );
-		support.doesNotIncludeMarginInBodyOffset = ( body.offsetTop !== 1 );
-
-		// NOTE: To any future maintainer, we've window.getComputedStyle
-		// because jsdom on node.js will break without it.
-		if ( window.getComputedStyle ) {
-			support.pixelPosition = ( window.getComputedStyle( div, null ) || {} ).top !== "1%";
-			support.boxSizingReliable = ( window.getComputedStyle( div, null ) || { width: "4px" } ).width === "4px";
-
-			// Check if div with explicit width and no margin-right incorrectly
-			// gets computed margin-right based on width of container. For more
-			// info see bug #3333
-			// Fails in WebKit before Feb 2011 nightlies
-			// WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
-			marginDiv = document.createElement("div");
-			marginDiv.style.cssText = div.style.cssText = divReset;
-			marginDiv.style.marginRight = marginDiv.style.width = "0";
-			div.style.width = "1px";
-			div.appendChild( marginDiv );
-			support.reliableMarginRight =
-				!parseFloat( ( window.getComputedStyle( marginDiv, null ) || {} ).marginRight );
-		}
-
-		if ( typeof div.style.zoom !== "undefined" ) {
-			// Check if natively block-level elements act like inline-block
-			// elements when setting their display to 'inline' and giving
-			// them layout
-			// (IE < 8 does this)
-			div.innerHTML = "";
-			div.style.cssText = divReset + "width:1px;padding:1px;display:inline;zoom:1";
-			support.inlineBlockNeedsLayout = ( div.offsetWidth === 3 );
-
-			// Check if elements with layout shrink-wrap their children
-			// (IE 6 does this)
-			div.style.display = "block";
-			div.style.overflow = "visible";
-			div.innerHTML = "<div></div>";
-			div.firstChild.style.width = "5px";
-			support.shrinkWrapBlocks = ( div.offsetWidth !== 3 );
-
-			container.style.zoom = 1;
-		}
-
-		// Null elements to avoid leaks in IE
-		body.removeChild( container );
-		container = div = tds = marginDiv = null;
-	});
-
-	// Null elements to avoid leaks in IE
-	fragment.removeChild( div );
-	all = a = select = opt = input = fragment = div = null;
-
-	return support;
-})();
-var rbrace = /(?:\{[\s\S]*\}|\[[\s\S]*\])$/,
-	rmultiDash = /([A-Z])/g;
-
-jQuery.extend({
-	cache: {},
-
-	deletedIds: [],
-
-	// Remove at next major release (1.9/2.0)
-	uuid: 0,
-
-	// Unique for each copy of jQuery on the page
-	// Non-digits removed to match rinlinejQuery
-	expando: "jQuery" + ( jQuery.fn.jquery + Math.random() ).replace( /\D/g, "" ),
-
-	// The following elements throw uncatchable exceptions if you
-	// attempt to add expando properties to them.
-	noData: {
-		"embed": true,
-		// Ban all objects except for Flash (which handle expandos)
-		"object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",
-		"applet": true
-	},
-
-	hasData: function( elem ) {
-		elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ];
-		return !!elem && !isEmptyDataObject( elem );
-	},
-
-	data: function( elem, name, data, pvt /* Internal Use Only */ ) {
-		if ( !jQuery.acceptData( elem ) ) {
-			return;
-		}
-
-		var thisCache, ret,
-			internalKey = jQuery.expando,
-			getByName = typeof name === "string",
-
-			// We have to handle DOM nodes and JS objects differently because IE6-7
-			// can't GC object references properly across the DOM-JS boundary
-			isNode = elem.nodeType,
-
-			// Only DOM nodes need the global jQuery cache; JS object data is
-			// attached directly to the object so GC can occur automatically
-			cache = isNode ? jQuery.cache : elem,
-
-			// Only defining an ID for JS objects if its cache already exists allows
-			// the code to shortcut on the same path as a DOM node with no cache
-			id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey;
-
-		// Avoid doing any more work than we need to when trying to get data on an
-		// object that has no data at all
-		if ( (!id || !cache[id] || (!pvt && !cache[id].data)) && getByName && data === undefined ) {
-			return;
-		}
-
-		if ( !id ) {
-			// Only DOM nodes need a new unique ID for each element since their data
-			// ends up in the global cache
-			if ( isNode ) {
-				elem[ internalKey ] = id = jQuery.deletedIds.pop() || jQuery.guid++;
-			} else {
-				id = internalKey;
-			}
-		}
-
-		if ( !cache[ id ] ) {
-			cache[ id ] = {};
-
-			// Avoids exposing jQuery metadata on plain JS objects when the object
-			// is serialized using JSON.stringify
-			if ( !isNode ) {
-				cache[ id ].toJSON = jQuery.noop;
-			}
-		}
-
-		// An object can be passed to jQuery.data instead of a key/value pair; this gets
-		// shallow copied over onto the existing cache
-		if ( typeof name === "object" || typeof name === "function" ) {
-			if ( pvt ) {
-				cache[ id ] = jQuery.extend( cache[ id ], name );
-			} else {
-				cache[ id ].data = jQuery.extend( cache[ id ].data, name );
-			}
-		}
-
-		thisCache = cache[ id ];
-
-		// jQuery data() is stored in a separate object inside the object's internal data
-		// cache in order to avoid key collisions between internal data and user-defined
-		// data.
-		if ( !pvt ) {
-			if ( !thisCache.data ) {
-				thisCache.data = {};
-			}
-
-			thisCache = thisCache.data;
-		}
-
-		if ( data !== undefined ) {
-			thisCache[ jQuery.camelCase( name ) ] = data;
-		}
-
-		// Check for both converted-to-camel and non-converted data property names
-		// If a data property was specified
-		if ( getByName ) {
-
-			// First Try to find as-is property data
-			ret = thisCache[ name ];
-
-			// Test for null|undefined property data
-			if ( ret == null ) {
-
-				// Try to find the camelCased property
-				ret = thisCache[ jQuery.camelCase( name ) ];
-			}
-		} else {
-			ret = thisCache;
-		}
-
-		return ret;
-	},
-
-	removeData: function( elem, name, pvt /* Internal Use Only */ ) {
-		if ( !jQuery.acceptData( elem ) ) {
-			return;
-		}
-
-		var thisCache, i, l,
-
-			isNode = elem.nodeType,
-
-			// See jQuery.data for more information
-			cache = isNode ? jQuery.cache : elem,
-			id = isNode ? elem[ jQuery.expando ] : jQuery.expando;
-
-		// If there is already no cache entry for this object, there is no
-		// purpose in continuing
-		if ( !cache[ id ] ) {
-			return;
-		}
-
-		if ( name ) {
-
-			thisCache = pvt ? cache[ id ] : cache[ id ].data;
-
-			if ( thisCache ) {
-
-				// Support array or space separated string names for data keys
-				if ( !jQuery.isArray( name ) ) {
-
-					// try the string as a key before any manipulation
-					if ( name in thisCache ) {
-						name = [ name ];
-					} else {
-
-						// split the camel cased version by spaces unless a key with the spaces exists
-						name = jQuery.camelCase( name );
-						if ( name in thisCache ) {
-							name = [ name ];
-						} else {
-							name = name.split(" ");
-						}
-					}
-				}
-
-				for ( i = 0, l = name.length; i < l; i++ ) {
-					delete thisCache[ name[i] ];
-				}
-
-				// If there is no data left in the cache, we want to continue
-				// and let the cache object itself get destroyed
-				if ( !( pvt ? isEmptyDataObject : jQuery.isEmptyObject )( thisCache ) ) {
-					return;
-				}
-			}
-		}
-
-		// See jQuery.data for more information
-		if ( !pvt ) {
-			delete cache[ id ].data;
-
-			// Don't destroy the parent cache unless the internal data object
-			// had been the only thing left in it
-			if ( !isEmptyDataObject( cache[ id ] ) ) {
-				return;
-			}
-		}
-
-		// Destroy the cache
-		if ( isNode ) {
-			jQuery.cleanData( [ elem ], true );
-
-		// Use delete when supported for expandos or `cache` is not a window per isWindow (#10080)
-		} else if ( jQuery.support.deleteExpando || cache != cache.window ) {
-			delete cache[ id ];
-
-		// When all else fails, null
-		} else {
-			cache[ id ] = null;
-		}
-	},
-
-	// For internal use only.
-	_data: function( elem, name, data ) {
-		return jQuery.data( elem, name, data, true );
-	},
-
-	// A method for determining if a DOM node can handle the data expando
-	acceptData: function( elem ) {
-		var noData = elem.nodeName && jQuery.noData[ elem.nodeName.toLowerCase() ];
-
-		// nodes accept data unless otherwise specified; rejection can be conditional
-		return !noData || noData !== true && elem.getAttribute("classid") === noData;
-	}
-});
-
-jQuery.fn.extend({
-	data: function( key, value ) {
-		var parts, part, attr, name, l,
-			elem = this[0],
-			i = 0,
-			data = null;
-
-		// Gets all values
-		if ( key === undefined ) {
-			if ( this.length ) {
-				data = jQuery.data( elem );
-
-				if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) {
-					attr = elem.attributes;
-					for ( l = attr.length; i < l; i++ ) {
-						name = attr[i].name;
-
-						if ( !name.indexOf( "data-" ) ) {
-							name = jQuery.camelCase( name.substring(5) );
-
-							dataAttr( elem, name, data[ name ] );
-						}
-					}
-					jQuery._data( elem, "parsedAttrs", true );
-				}
-			}
-
-			return data;
-		}
-
-		// Sets multiple values
-		if ( typeof key === "object" ) {
-			return this.each(function() {
-				jQuery.data( this, key );
-			});
-		}
-
-		parts = key.split( ".", 2 );
-		parts[1] = parts[1] ? "." + parts[1] : "";
-		part = parts[1] + "!";
-
-		return jQuery.access( this, function( value ) {
-
-			if ( value === undefined ) {
-				data = this.triggerHandler( "getData" + part, [ parts[0] ] );
-
-				// Try to fetch any internally stored data first
-				if ( data === undefined && elem ) {
-					data = jQuery.data( elem, key );
-					data = dataAttr( elem, key, data );
-				}
-
-				return data === undefined && parts[1] ?
-					this.data( parts[0] ) :
-					data;
-			}
-
-			parts[1] = value;
-			this.each(function() {
-				var self = jQuery( this );
-
-				self.triggerHandler( "setData" + part, parts );
-				jQuery.data( this, key, value );
-				self.triggerHandler( "changeData" + part, parts );
-			});
-		}, null, value, arguments.length > 1, null, false );
-	},
-
-	removeData: function( key ) {
-		return this.each(function() {
-			jQuery.removeData( this, key );
-		});
-	}
-});
-
-function dataAttr( elem, key, data ) {
-	// If nothing was found internally, try to fetch any
-	// data from the HTML5 data-* attribute
-	if ( data === undefined && elem.nodeType === 1 ) {
-
-		var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase();
-
-		data = elem.getAttribute( name );
-
-		if ( typeof data === "string" ) {
-			try {
-				data = data === "true" ? true :
-				data === "false" ? false :
-				data === "null" ? null :
-				// Only convert to a number if it doesn't change the string
-				+data + "" === data ? +data :
-				rbrace.test( data ) ? jQuery.parseJSON( data ) :
-					data;
-			} catch( e ) {}
-
-			// Make sure we set the data so it isn't changed later
-			jQuery.data( elem, key, data );
-
-		} else {
-			data = undefined;
-		}
-	}
-
-	return data;
-}
-
-// checks a cache object for emptiness
-function isEmptyDataObject( obj ) {
-	var name;
-	for ( name in obj ) {
-
-		// if the public data object is empty, the private is still empty
-		if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) {
-			continue;
-		}
-		if ( name !== "toJSON" ) {
-			return false;
-		}
-	}
-
-	return true;
-}
-jQuery.extend({
-	queue: function( elem, type, data ) {
-		var queue;
-
-		if ( elem ) {
-			type = ( type || "fx" ) + "queue";
-			queue = jQuery._data( elem, type );
-
-			// Speed up dequeue by getting out quickly if this is just a lookup
-			if ( data ) {
-				if ( !queue || jQuery.isArray(data) ) {
-					queue = jQuery._data( elem, type, jQuery.makeArray(data) );
-				} else {
-					queue.push( data );
-				}
-			}
-			return queue || [];
-		}
-	},
-
-	dequeue: function( elem, type ) {
-		type = type || "fx";
-
-		var queue = jQuery.queue( elem, type ),
-			startLength = queue.length,
-			fn = queue.shift(),
-			hooks = jQuery._queueHooks( elem, type ),
-			next = function() {
-				jQuery.dequeue( elem, type );
-			};
-
-		// If the fx queue is dequeued, always remove the progress sentinel
-		if ( fn === "inprogress" ) {
-			fn = queue.shift();
-			startLength--;
-		}
-
-		if ( fn ) {
-
-			// Add a progress sentinel to prevent the fx queue from being
-			// automatically dequeued
-			if ( type === "fx" ) {
-				queue.unshift( "inprogress" );
-			}
-
-			// clear up the last queue stop function
-			delete hooks.stop;
-			fn.call( elem, next, hooks );
-		}
-
-		if ( !startLength && hooks ) {
-			hooks.empty.fire();
-		}
-	},
-
-	// not intended for public consumption - generates a queueHooks object, or returns the current one
-	_queueHooks: function( elem, type ) {
-		var key = type + "queueHooks";
-		return jQuery._data( elem, key ) || jQuery._data( elem, key, {
-			empty: jQuery.Callbacks("once memory").add(function() {
-				jQuery.removeData( elem, type + "queue", true );
-				jQuery.removeData( elem, key, true );
-			})
-		});
-	}
-});
-
-jQuery.fn.extend({
-	queue: function( type, data ) {
-		var setter = 2;
-
-		if ( typeof type !== "string" ) {
-			data = type;
-			type = "fx";
-			setter--;
-		}
-
-		if ( arguments.length < setter ) {
-			return jQuery.queue( this[0], type );
-		}
-
-		return data === undefined ?
-			this :
-			this.each(function() {
-				var queue = jQuery.queue( this, type, data );
-
-				// ensure a hooks for this queue
-				jQuery._queueHooks( this, type );
-
-				if ( type === "fx" && queue[0] !== "inprogress" ) {
-					jQuery.dequeue( this, type );
-				}
-			});
-	},
-	dequeue: function( type ) {
-		return this.each(function() {
-			jQuery.dequeue( this, type );
-		});
-	},
-	// Based off of the plugin by Clint Helfers, with permission.
-	// http://blindsignals.com/index.php/2009/07/jquery-delay/
-	delay: function( time, type ) {
-		time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
-		type = type || "fx";
-
-		return this.queue( type, function( next, hooks ) {
-			var timeout = setTimeout( next, time );
-			hooks.stop = function() {
-				clearTimeout( timeout );
-			};
-		});
-	},
-	clearQueue: function( type ) {
-		return this.queue( type || "fx", [] );
-	},
-	// Get a promise resolved when queues of a certain type
-	// are emptied (fx is the type by default)
-	promise: function( type, obj ) {
-		var tmp,
-			count = 1,
-			defer = jQuery.Deferred(),
-			elements = this,
-			i = this.length,
-			resolve = function() {
-				if ( !( --count ) ) {
-					defer.resolveWith( elements, [ elements ] );
-				}
-			};
-
-		if ( typeof type !== "string" ) {
-			obj = type;
-			type = undefined;
-		}
-		type = type || "fx";
-
-		while( i-- ) {
-			tmp = jQuery._data( elements[ i ], type + "queueHooks" );
-			if ( tmp && tmp.empty ) {
-				count++;
-				tmp.empty.add( resolve );
-			}
-		}
-		resolve();
-		return defer.promise( obj );
-	}
-});
-var nodeHook, boolHook, fixSpecified,
-	rclass = /[\t\r\n]/g,
-	rreturn = /\r/g,
-	rtype = /^(?:button|input)$/i,
-	rfocusable = /^(?:button|input|object|select|textarea)$/i,
-	rclickable = /^a(?:rea|)$/i,
-	rboolean = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,
-	getSetAttribute = jQuery.support.getSetAttribute;
-
-jQuery.fn.extend({
-	attr: function( name, value ) {
-		return jQuery.access( this, jQuery.attr, name, value, arguments.length > 1 );
-	},
-
-	removeAttr: function( name ) {
-		return this.each(function() {
-			jQuery.removeAttr( this, name );
-		});
-	},
-
-	prop: function( name, value ) {
-		return jQuery.access( this, jQuery.prop, name, value, arguments.length > 1 );
-	},
-
-	removeProp: function( name ) {
-		name = jQuery.propFix[ name ] || name;
-		return this.each(function() {
-			// try/catch handles cases where IE balks (such as removing a property on window)
-			try {
-				this[ name ] = undefined;
-				delete this[ name ];
-			} catch( e ) {}
-		});
-	},
-
-	addClass: function( value ) {
-		var classNames, i, l, elem,
-			setClass, c, cl;
-
-		if ( jQuery.isFunction( value ) ) {
-			return this.each(function( j ) {
-				jQuery( this ).addClass( value.call(this, j, this.className) );
-			});
-		}
-
-		if ( value && typeof value === "string" ) {
-			classNames = value.split( core_rspace );
-
-			for ( i = 0, l = this.length; i < l; i++ ) {
-				elem = this[ i ];
-
-				if ( elem.nodeType === 1 ) {
-					if ( !elem.className && classNames.length === 1 ) {
-						elem.className = value;
-
-					} else {
-						setClass = " " + elem.className + " ";
-
-						for ( c = 0, cl = classNames.length; c < cl; c++ ) {
-							if ( setClass.indexOf( " " + classNames[ c ] + " " ) < 0 ) {
-								setClass += classNames[ c ] + " ";
-							}
-						}
-						elem.className = jQuery.trim( setClass );
-					}
-				}
-			}
-		}
-
-		return this;
-	},
-
-	removeClass: function( value ) {
-		var removes, className, elem, c, cl, i, l;
-
-		if ( jQuery.isFunction( value ) ) {
-			return this.each(function( j ) {
-				jQuery( this ).removeClass( value.call(this, j, this.className) );
-			});
-		}
-		if ( (value && typeof value === "string") || value === undefined ) {
-			removes = ( value || "" ).split( core_rspace );
-
-			for ( i = 0, l = this.length; i < l; i++ ) {
-				elem = this[ i ];
-				if ( elem.nodeType === 1 && elem.className ) {
-
-					className = (" " + elem.className + " ").replace( rclass, " " );
-
-					// loop over each item in the removal list
-					for ( c = 0, cl = removes.length; c < cl; c++ ) {
-						// Remove until there is nothing to remove,
-						while ( className.indexOf(" " + removes[ c ] + " ") >= 0 ) {
-							className = className.replace( " " + removes[ c ] + " " , " " );
-						}
-					}
-					elem.className = value ? jQuery.trim( className ) : "";
-				}
-			}
-		}
-
-		return this;
-	},
-
-	toggleClass: function( value, stateVal ) {
-		var type = typeof value,
-			isBool = typeof stateVal === "boolean";
-
-		if ( jQuery.isFunction( value ) ) {
-			return this.each(function( i ) {
-				jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal );
-			});
-		}
-
-		return this.each(function() {
-			if ( type === "string" ) {
-				// toggle individual class names
-				var className,
-					i = 0,
-					self = jQuery( this ),
-					state = stateVal,
-					classNames = value.split( core_rspace );
-
-				while ( (className = classNames[ i++ ]) ) {
-					// check each className given, space separated list
-					state = isBool ? state : !self.hasClass( className );
-					self[ state ? "addClass" : "removeClass" ]( className );
-				}
-
-			} else if ( type === "undefined" || type === "boolean" ) {
-				if ( this.className ) {
-					// store className if set
-					jQuery._data( this, "__className__", this.className );
-				}
-
-				// toggle whole className
-				this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || "";
-			}
-		});
-	},
-
-	hasClass: function( selector ) {
-		var className = " " + selector + " ",
-			i = 0,
-			l = this.length;
-		for ( ; i < l; i++ ) {
-			if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) >= 0 ) {
-				return true;
-			}
-		}
-
-		return false;
-	},
-
-	val: function( value ) {
-		var hooks, ret, isFunction,
-			elem = this[0];
-
-		if ( !arguments.length ) {
-			if ( elem ) {
-				hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ];
-
-				if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) {
-					return ret;
-				}
-
-				ret = elem.value;
-
-				return typeof ret === "string" ?
-					// handle most common string cases
-					ret.replace(rreturn, "") :
-					// handle cases where value is null/undef or number
-					ret == null ? "" : ret;
-			}
-
-			return;
-		}
-
-		isFunction = jQuery.isFunction( value );
-
-		return this.each(function( i ) {
-			var val,
-				self = jQuery(this);
-
-			if ( this.nodeType !== 1 ) {
-				return;
-			}
-
-			if ( isFunction ) {
-				val = value.call( this, i, self.val() );
-			} else {
-				val = value;
-			}
-
-			// Treat null/undefined as ""; convert numbers to string
-			if ( val == null ) {
-				val = "";
-			} else if ( typeof val === "number" ) {
-				val += "";
-			} else if ( jQuery.isArray( val ) ) {
-				val = jQuery.map(val, function ( value ) {
-					return value == null ? "" : value + "";
-				});
-			}
-
-			hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];
-
-			// If set returns undefined, fall back to normal setting
-			if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) {
-				this.value = val;
-			}
-		});
-	}
-});
-
-jQuery.extend({
-	valHooks: {
-		option: {
-			get: function( elem ) {
-				// attributes.value is undefined in Blackberry 4.7 but
-				// uses .value. See #6932
-				var val = elem.attributes.value;
-				return !val || val.specified ? elem.value : elem.text;
-			}
-		},
-		select: {
-			get: function( elem ) {
-				var value, option,
-					options = elem.options,
-					index = elem.selectedIndex,
-					one = elem.type === "select-one" || index < 0,
-					values = one ? null : [],
-					max = one ? index + 1 : options.length,
-					i = index < 0 ?
-						max :
-						one ? index : 0;
-
-				// Loop through all the selected options
-				for ( ; i < max; i++ ) {
-					option = options[ i ];
-
-					// oldIE doesn't update selected after form reset (#2551)
-					if ( ( option.selected || i === index ) &&
-							// Don't return options that are disabled or in a disabled optgroup
-							( jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null ) &&
-							( !option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" ) ) ) {
-
-						// Get the specific value for the option
-						value = jQuery( option ).val();
-
-						// We don't need an array for one selects
-						if ( one ) {
-							return value;
-						}
-
-						// Multi-Selects return an array
-						values.push( value );
-					}
-				}
-
-				return values;
-			},
-
-			set: function( elem, value ) {
-				var values = jQuery.makeArray( value );
-
-				jQuery(elem).find("option").each(function() {
-					this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0;
-				});
-
-				if ( !values.length ) {
-					elem.selectedIndex = -1;
-				}
-				return values;
-			}
-		}
-	},
-
-	// Unused in 1.8, left in so attrFn-stabbers won't die; remove in 1.9
-	attrFn: {},
-
-	attr: function( elem, name, value, pass ) {
-		var ret, hooks, notxml,
-			nType = elem.nodeType;
-
-		// don't get/set attributes on text, comment and attribute nodes
-		if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
-			return;
-		}
-
-		if ( pass && jQuery.isFunction( jQuery.fn[ name ] ) ) {
-			return jQuery( elem )[ name ]( value );
-		}
-
-		// Fallback to prop when attributes are not supported
-		if ( typeof elem.getAttribute === "undefined" ) {
-			return jQuery.prop( elem, name, value );
-		}
-
-		notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
-
-		// All attributes are lowercase
-		// Grab necessary hook if one is defined
-		if ( notxml ) {
-			name = name.toLowerCase();
-			hooks = jQuery.attrHooks[ name ] || ( rboolean.test( name ) ? boolHook : nodeHook );
-		}
-
-		if ( value !== undefined ) {
-
-			if ( value === null ) {
-				jQuery.removeAttr( elem, name );
-				return;
-
-			} else if ( hooks && "set" in hooks && notxml && (ret = hooks.set( elem, value, name )) !== undefined ) {
-				return ret;
-
-			} else {
-				elem.setAttribute( name, value + "" );
-				return value;
-			}
-
-		} else if ( hooks && "get" in hooks && notxml && (ret = hooks.get( elem, name )) !== null ) {
-			return ret;
-
-		} else {
-
-			ret = elem.getAttribute( name );
-
-			// Non-existent attributes return null, we normalize to undefined
-			return ret === null ?
-				undefined :
-				ret;
-		}
-	},
-
-	removeAttr: function( elem, value ) {
-		var propName, attrNames, name, isBool,
-			i = 0;
-
-		if ( value && elem.nodeType === 1 ) {
-
-			attrNames = value.split( core_rspace );
-
-			for ( ; i < attrNames.length; i++ ) {
-				name = attrNames[ i ];
-
-				if ( name ) {
-					propName = jQuery.propFix[ name ] || name;
-					isBool = rboolean.test( name );
-
-					// See #9699 for explanation of this approach (setting first, then removal)
-					// Do not do this for boolean attributes (see #10870)
-					if ( !isBool ) {
-						jQuery.attr( elem, name, "" );
-					}
-					elem.removeAttribute( getSetAttribute ? name : propName );
-
-					// Set corresponding property to false for boolean attributes
-					if ( isBool && propName in elem ) {
-						elem[ propName ] = false;
-					}
-				}
-			}
-		}
-	},
-
-	attrHooks: {
-		type: {
-			set: function( elem, value ) {
-				// We can't allow the type property to be changed (since it causes problems in IE)
-				if ( rtype.test( elem.nodeName ) && elem.parentNode ) {
-					jQuery.error( "type property can't be changed" );
-				} else if ( !jQuery.support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) {
-					// Setting the type on a radio button after the value resets the value in IE6-9
-					// Reset value to it's default in case type is set after value
-					// This is for element creation
-					var val = elem.value;
-					elem.setAttribute( "type", value );
-					if ( val ) {
-						elem.value = val;
-					}
-					return value;
-				}
-			}
-		},
-		// Use the value property for back compat
-		// Use the nodeHook for button elements in IE6/7 (#1954)
-		value: {
-			get: function( elem, name ) {
-				if ( nodeHook && jQuery.nodeName( elem, "button" ) ) {
-					return nodeHook.get( elem, name );
-				}
-				return name in elem ?
-					elem.value :
-					null;
-			},
-			set: function( elem, value, name ) {
-				if ( nodeHook && jQuery.nodeName( elem, "button" ) ) {
-					return nodeHook.set( elem, value, name );
-				}
-				// Does not return so that setAttribute is also used
-				elem.value = value;
-			}
-		}
-	},
-
-	propFix: {
-		tabindex: "tabIndex",
-		readonly: "readOnly",
-		"for": "htmlFor",
-		"class": "className",
-		maxlength: "maxLength",
-		cellspacing: "cellSpacing",
-		cellpadding: "cellPadding",
-		rowspan: "rowSpan",
-		colspan: "colSpan",
-		usemap: "useMap",
-		frameborder: "frameBorder",
-		contenteditable: "contentEditable"
-	},
-
-	prop: function( elem, name, value ) {
-		var ret, hooks, notxml,
-			nType = elem.nodeType;
-
-		// don't get/set properties on text, comment and attribute nodes
-		if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
-			return;
-		}
-
-		notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
-
-		if ( notxml ) {
-			// Fix name and attach hooks
-			name = jQuery.propFix[ name ] || name;
-			hooks = jQuery.propHooks[ name ];
-		}
-
-		if ( value !== undefined ) {
-			if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {
-				return ret;
-
-			} else {
-				return ( elem[ name ] = value );
-			}
-
-		} else {
-			if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) {
-				return ret;
-
-			} else {
-				return elem[ name ];
-			}
-		}
-	},
-
-	propHooks: {
-		tabIndex: {
-			get: function( elem ) {
-				// elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set
-				// http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
-				var attributeNode = elem.getAttributeNode("tabindex");
-
-				return attributeNode && attributeNode.specified ?
-					parseInt( attributeNode.value, 10 ) :
-					rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ?
-						0 :
-						undefined;
-			}
-		}
-	}
-});
-
-// Hook for boolean attributes
-boolHook = {
-	get: function( elem, name ) {
-		// Align boolean attributes with corresponding properties
-		// Fall back to attribute presence where some booleans are not supported
-		var attrNode,
-			property = jQuery.prop( elem, name );
-		return property === true || typeof property !== "boolean" && ( attrNode = elem.getAttributeNode(name) ) && attrNode.nodeValue !== false ?
-			name.toLowerCase() :
-			undefined;
-	},
-	set: function( elem, value, name ) {
-		var propName;
-		if ( value === false ) {
-			// Remove boolean attributes when set to false
-			jQuery.removeAttr( elem, name );
-		} else {
-			// value is true since we know at this point it's type boolean and not false
-			// Set boolean attributes to the same name and set the DOM property
-			propName = jQuery.propFix[ name ] || name;
-			if ( propName in elem ) {
-				// Only set the IDL specifically if it already exists on the element
-				elem[ propName ] = true;
-			}
-
-			elem.setAttribute( name, name.toLowerCase() );
-		}
-		return name;
-	}
-};
-
-// IE6/7 do not support getting/setting some attributes with get/setAttribute
-if ( !getSetAttribute ) {
-
-	fixSpecified = {
-		name: true,
-		id: true,
-		coords: true
-	};
-
-	// Use this for any attribute in IE6/7
-	// This fixes almost every IE6/7 issue
-	nodeHook = jQuery.valHooks.button = {
-		get: function( elem, name ) {
-			var ret;
-			ret = elem.getAttributeNode( name );
-			return ret && ( fixSpecified[ name ] ? ret.value !== "" : ret.specified ) ?
-				ret.value :
-				undefined;
-		},
-		set: function( elem, value, name ) {
-			// Set the existing or create a new attribute node
-			var ret = elem.getAttributeNode( name );
-			if ( !ret ) {
-				ret = document.createAttribute( name );
-				elem.setAttributeNode( ret );
-			}
-			return ( ret.value = value + "" );
-		}
-	};
-
-	// Set width and height to auto instead of 0 on empty string( Bug #8150 )
-	// This is for removals
-	jQuery.each([ "width", "height" ], function( i, name ) {
-		jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {
-			set: function( elem, value ) {
-				if ( value === "" ) {
-					elem.setAttribute( name, "auto" );
-					return value;
-				}
-			}
-		});
-	});
-
-	// Set contenteditable to false on removals(#10429)
-	// Setting to empty string throws an error as an invalid value
-	jQuery.attrHooks.contenteditable = {
-		get: nodeHook.get,
-		set: function( elem, value, name ) {
-			if ( value === "" ) {
-				value = "false";
-			}
-			nodeHook.set( elem, value, name );
-		}
-	};
-}
-
-
-// Some attributes require a special call on IE
-if ( !jQuery.support.hrefNormalized ) {
-	jQuery.each([ "href", "src", "width", "height" ], function( i, name ) {
-		jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {
-			get: function( elem ) {
-				var ret = elem.getAttribute( name, 2 );
-				return ret === null ? undefined : ret;
-			}
-		});
-	});
-}
-
-if ( !jQuery.support.style ) {
-	jQuery.attrHooks.style = {
-		get: function( elem ) {
-			// Return undefined in the case of empty string
-			// Normalize to lowercase since IE uppercases css property names
-			return elem.style.cssText.toLowerCase() || undefined;
-		},
-		set: function( elem, value ) {
-			return ( elem.style.cssText = value + "" );
-		}
-	};
-}
-
-// Safari mis-reports the default selected property of an option
-// Accessing the parent's selectedIndex property fixes it
-if ( !jQuery.support.optSelected ) {
-	jQuery.propHooks.selected = jQuery.extend( jQuery.propHooks.selected, {
-		get: function( elem ) {
-			var parent = elem.parentNode;
-
-			if ( parent ) {
-				parent.selectedIndex;
-
-				// Make sure that it also works with optgroups, see #5701
-				if ( parent.parentNode ) {
-					parent.parentNode.selectedIndex;
-				}
-			}
-			return null;
-		}
-	});
-}
-
-// IE6/7 call enctype encoding
-if ( !jQuery.support.enctype ) {
-	jQuery.propFix.enctype = "encoding";
-}
-
-// Radios and checkboxes getter/setter
-if ( !jQuery.support.checkOn ) {
-	jQuery.each([ "radio", "checkbox" ], function() {
-		jQuery.valHooks[ this ] = {
-			get: function( elem ) {
-				// Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified
-				return elem.getAttribute("value") === null ? "on" : elem.value;
-			}
-		};
-	});
-}
-jQuery.each([ "radio", "checkbox" ], function() {
-	jQuery.valHooks[ this ] = jQuery.extend( jQuery.valHooks[ this ], {
-		set: function( elem, value ) {
-			if ( jQuery.isArray( value ) ) {
-				return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 );
-			}
-		}
-	});
-});
-var rformElems = /^(?:textarea|input|select)$/i,
-	rtypenamespace = /^([^\.]*|)(?:\.(.+)|)$/,
-	rhoverHack = /(?:^|\s)hover(\.\S+|)\b/,
-	rkeyEvent = /^key/,
-	rmouseEvent = /^(?:mouse|contextmenu)|click/,
-	rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,
-	hoverHack = function( events ) {
-		return jQuery.event.special.hover ? events : events.replace( rhoverHack, "mouseenter$1 mouseleave$1" );
-	};
-
-/*
- * Helper functions for managing events -- not part of the public interface.
- * Props to Dean Edwards' addEvent library for many of the ideas.
- */
-jQuery.event = {
-
-	add: function( elem, types, handler, data, selector ) {
-
-		var elemData, eventHandle, events,
-			t, tns, type, namespaces, handleObj,
-			handleObjIn, handlers, special;
-
-		// Don't attach events to noData or text/comment nodes (allow plain objects tho)
-		if ( elem.nodeType === 3 || elem.nodeType === 8 || !types || !handler || !(elemData = jQuery._data( elem )) ) {
-			return;
-		}
-
-		// Caller can pass in an object of custom data in lieu of the handler
-		if ( handler.handler ) {
-			handleObjIn = handler;
-			handler = handleObjIn.handler;
-			selector = handleObjIn.selector;
-		}
-
-		// Make sure that the handler has a unique ID, used to find/remove it later
-		if ( !handler.guid ) {
-			handler.guid = jQuery.guid++;
-		}
-
-		// Init the element's event structure and main handler, if this is the first
-		events = elemData.events;
-		if ( !events ) {
-			elemData.events = events = {};
-		}
-		eventHandle = elemData.handle;
-		if ( !eventHandle ) {
-			elemData.handle = eventHandle = function( e ) {
-				// Discard the second event of a jQuery.event.trigger() and
-				// when an event is called after a page has unloaded
-				return typeof jQuery !== "undefined" && (!e || jQuery.event.triggered !== e.type) ?
-					jQuery.event.dispatch.apply( eventHandle.elem, arguments ) :
-					undefined;
-			};
-			// Add elem as a property of the handle fn to prevent a memory leak with IE non-native events
-			eventHandle.elem = elem;
-		}
-
-		// Handle multiple events separated by a space
-		// jQuery(...).bind("mouseover mouseout", fn);
-		types = jQuery.trim( hoverHack(types) ).split( " " );
-		for ( t = 0; t < types.length; t++ ) {
-
-			tns = rtypenamespace.exec( types[t] ) || [];
-			type = tns[1];
-			namespaces = ( tns[2] || "" ).split( "." ).sort();
-
-			// If event changes its type, use the special event handlers for the changed type
-			special = jQuery.event.special[ type ] || {};
-
-			// If selector defined, determine special event api type, otherwise given type
-			type = ( selector ? special.delegateType : special.bindType ) || type;
-
-			// Update special based on newly reset type
-			special = jQuery.event.special[ type ] || {};
-
-			// handleObj is passed to all event handlers
-			handleObj = jQuery.extend({
-				type: type,
-				origType: tns[1],
-				data: data,
-				handler: handler,
-				guid: handler.guid,
-				selector: selector,
-				needsContext: selector && jQuery.expr.match.needsContext.test( selector ),
-				namespace: namespaces.join(".")
-			}, handleObjIn );
-
-			// Init the event handler queue if we're the first
-			handlers = events[ type ];
-			if ( !handlers ) {
-				handlers = events[ type ] = [];
-				handlers.delegateCount = 0;
-
-				// Only use addEventListener/attachEvent if the special events handler returns false
-				if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
-					// Bind the global event handler to the element
-					if ( elem.addEventListener ) {
-						elem.addEventListener( type, eventHandle, false );
-
-					} else if ( elem.attachEvent ) {
-						elem.attachEvent( "on" + type, eventHandle );
-					}
-				}
-			}
-
-			if ( special.add ) {
-				special.add.call( elem, handleObj );
-
-				if ( !handleObj.handler.guid ) {
-					handleObj.handler.guid = handler.guid;
-				}
-			}
-
-			// Add to the element's handler list, delegates in front
-			if ( selector ) {
-				handlers.splice( handlers.delegateCount++, 0, handleObj );
-			} else {
-				handlers.push( handleObj );
-			}
-
-			// Keep track of which events have ever been used, for event optimization
-			jQuery.event.global[ type ] = true;
-		}
-
-		// Nullify elem to prevent memory leaks in IE
-		elem = null;
-	},
-
-	global: {},
-
-	// Detach an event or set of events from an element
-	remove: function( elem, types, handler, selector, mappedTypes ) {
-
-		var t, tns, type, origType, namespaces, origCount,
-			j, events, special, eventType, handleObj,
-			elemData = jQuery.hasData( elem ) && jQuery._data( elem );
-
-		if ( !elemData || !(events = elemData.events) ) {
-			return;
-		}
-
-		// Once for each type.namespace in types; type may be omitted
-		types = jQuery.trim( hoverHack( types || "" ) ).split(" ");
-		for ( t = 0; t < types.length; t++ ) {
-			tns = rtypenamespace.exec( types[t] ) || [];
-			type = origType = tns[1];
-			namespaces = tns[2];
-
-			// Unbind all events (on this namespace, if provided) for the element
-			if ( !type ) {
-				for ( type in events ) {
-					jQuery.event.remove( elem, type + types[ t ], handler, selector, true );
-				}
-				continue;
-			}
-
-			special = jQuery.event.special[ type ] || {};
-			type = ( selector? special.delegateType : special.bindType ) || type;
-			eventType = events[ type ] || [];
-			origCount = eventType.length;
-			namespaces = namespaces ? new RegExp("(^|\\.)" + namespaces.split(".").sort().join("\\.(?:.*\\.|)") + "(\\.|$)") : null;
-
-			// Remove matching events
-			for ( j = 0; j < eventType.length; j++ ) {
-				handleObj = eventType[ j ];
-
-				if ( ( mappedTypes || origType === handleObj.origType ) &&
-					 ( !handler || handler.guid === handleObj.guid ) &&
-					 ( !namespaces || namespaces.test( handleObj.namespace ) ) &&
-					 ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) {
-					eventType.splice( j--, 1 );
-
-					if ( handleObj.selector ) {
-						eventType.delegateCount--;
-					}
-					if ( special.remove ) {
-						special.remove.call( elem, handleObj );
-					}
-				}
-			}
-
-			// Remove generic event handler if we removed something and no more handlers exist
-			// (avoids potential for endless recursion during removal of special event handlers)
-			if ( eventType.length === 0 && origCount !== eventType.length ) {
-				if ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) {
-					jQuery.removeEvent( elem, type, elemData.handle );
-				}
-
-				delete events[ type ];
-			}
-		}
-
-		// Remove the expando if it's no longer used
-		if ( jQuery.isEmptyObject( events ) ) {
-			delete elemData.handle;
-
-			// removeData also checks for emptiness and clears the expando if empty
-			// so use it instead of delete
-			jQuery.removeData( elem, "events", true );
-		}
-	},
-
-	// Events that are safe to short-circuit if no handlers are attached.
-	// Native DOM events should not be added, they may have inline handlers.
-	customEvent: {
-		"getData": true,
-		"setData": true,
-		"changeData": true
-	},
-
-	trigger: function( event, data, elem, onlyHandlers ) {
-		// Don't do events on text and comment nodes
-		if ( elem && (elem.nodeType === 3 || elem.nodeType === 8) ) {
-			return;
-		}
-
-		// Event object or event type
-		var cache, exclusive, i, cur, old, ontype, special, handle, eventPath, bubbleType,
-			type = event.type || event,
-			namespaces = [];
-
-		// focus/blur morphs to focusin/out; ensure we're not firing them right now
-		if ( rfocusMorph.test( type + jQuery.event.triggered ) ) {
-			return;
-		}
-
-		if ( type.indexOf( "!" ) >= 0 ) {
-			// Exclusive events trigger only for the exact event (no namespaces)
-			type = type.slice(0, -1);
-			exclusive = true;
-		}
-
-		if ( type.indexOf( "." ) >= 0 ) {
-			// Namespaced trigger; create a regexp to match event type in handle()
-			namespaces = type.split(".");
-			type = namespaces.shift();
-			namespaces.sort();
-		}
-
-		if ( (!elem || jQuery.event.customEvent[ type ]) && !jQuery.event.global[ type ] ) {
-			// No jQuery handlers for this event type, and it can't have inline handlers
-			return;
-		}
-
-		// Caller can pass in an Event, Object, or just an event type string
-		event = typeof event === "object" ?
-			// jQuery.Event object
-			event[ jQuery.expando ] ? event :
-			// Object literal
-			new jQuery.Event( type, event ) :
-			// Just the event type (string)
-			new jQuery.Event( type );
-
-		event.type = type;
-		event.isTrigger = true;
-		event.exclusive = exclusive;
-		event.namespace = namespaces.join( "." );
-		event.namespace_re = event.namespace? new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)") : null;
-		ontype = type.indexOf( ":" ) < 0 ? "on" + type : "";
-
-		// Handle a global trigger
-		if ( !elem ) {
-
-			// TODO: Stop taunting the data cache; remove global events and always attach to document
-			cache = jQuery.cache;
-			for ( i in cache ) {
-				if ( cache[ i ].events && cache[ i ].events[ type ] ) {
-					jQuery.event.trigger( event, data, cache[ i ].handle.elem, true );
-				}
-			}
-			return;
-		}
-
-		// Clean up the event in case it is being reused
-		event.result = undefined;
-		if ( !event.target ) {
-			event.target = elem;
-		}
-
-		// Clone any incoming data and prepend the event, creating the handler arg list
-		data = data != null ? jQuery.makeArray( data ) : [];
-		data.unshift( event );
-
-		// Allow special events to draw outside the lines
-		special = jQuery.event.special[ type ] || {};
-		if ( special.trigger && special.trigger.apply( elem, data ) === false ) {
-			return;
-		}
-
-		// Determine event propagation path in advance, per W3C events spec (#9951)
-		// Bubble up to document, then to window; watch for a global ownerDocument var (#9724)
-		eventPath = [[ elem, special.bindType || type ]];
-		if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) {
-
-			bubbleType = special.delegateType || type;
-			cur = rfocusMorph.test( bubbleType + type ) ? elem : elem.parentNode;
-			for ( old = elem; cur; cur = cur.parentNode ) {
-				eventPath.push([ cur, bubbleType ]);
-				old = cur;
-			}
-
-			// Only add window if we got to document (e.g., not plain obj or detached DOM)
-			if ( old === (elem.ownerDocument || document) ) {
-				eventPath.push([ old.defaultView || old.parentWindow || window, bubbleType ]);
-			}
-		}
-
-		// Fire handlers on the event path
-		for ( i = 0; i < eventPath.length && !event.isPropagationStopped(); i++ ) {
-
-			cur = eventPath[i][0];
-			event.type = eventPath[i][1];
-
-			handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" );
-			if ( handle ) {
-				handle.apply( cur, data );
-			}
-			// Note that this is a bare JS function and not a jQuery handler
-			handle = ontype && cur[ ontype ];
-			if ( handle && jQuery.acceptData( cur ) && handle.apply && handle.apply( cur, data ) === false ) {
-				event.preventDefault();
-			}
-		}
-		event.type = type;
-
-		// If nobody prevented the default action, do it now
-		if ( !onlyHandlers && !event.isDefaultPrevented() ) {
-
-			if ( (!special._default || special._default.apply( elem.ownerDocument, data ) === false) &&
-				!(type === "click" && jQuery.nodeName( elem, "a" )) && jQuery.acceptData( elem ) ) {
-
-				// Call a native DOM method on the target with the same name name as the event.
-				// Can't use an .isFunction() check here because IE6/7 fails that test.
-				// Don't do default actions on window, that's where global variables be (#6170)
-				// IE<9 dies on focus/blur to hidden element (#1486)
-				if ( ontype && elem[ type ] && ((type !== "focus" && type !== "blur") || event.target.offsetWidth !== 0) && !jQuery.isWindow( elem ) ) {
-
-					// Don't re-trigger an onFOO event when we call its FOO() method
-					old = elem[ ontype ];
-
-					if ( old ) {
-						elem[ ontype ] = null;
-					}
-
-					// Prevent re-triggering of the same event, since we already bubbled it above
-					jQuery.event.triggered = type;
-					elem[ type ]();
-					jQuery.event.triggered = undefined;
-
-					if ( old ) {
-						elem[ ontype ] = old;
-					}
-				}
-			}
-		}
-
-		return event.result;
-	},
-
-	dispatch: function( event ) {
-
-		// Make a writable jQuery.Event from the native event object
-		event = jQuery.event.fix( event || window.event );
-
-		var i, j, cur, ret, selMatch, matched, matches, handleObj, sel, related,
-			handlers = ( (jQuery._data( this, "events" ) || {} )[ event.type ] || []),
-			delegateCount = handlers.delegateCount,
-			args = core_slice.call( arguments ),
-			run_all = !event.exclusive && !event.namespace,
-			special = jQuery.event.special[ event.type ] || {},
-			handlerQueue = [];
-
-		// Use the fix-ed jQuery.Event rather than the (read-only) native event
-		args[0] = event;
-		event.delegateTarget = this;
-
-		// Call the preDispatch hook for the mapped type, and let it bail if desired
-		if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {
-			return;
-		}
-
-		// Determine handlers that should run if there are delegated events
-		// Avoid non-left-click bubbling in Firefox (#3861)
-		if ( delegateCount && !(event.button && event.type === "click") ) {
-
-			for ( cur = event.target; cur != this; cur = cur.parentNode || this ) {
-
-				// Don't process clicks (ONLY) on disabled elements (#6911, #8165, #11382, #11764)
-				if ( cur.disabled !== true || event.type !== "click" ) {
-					selMatch = {};
-					matches = [];
-					for ( i = 0; i < delegateCount; i++ ) {
-						handleObj = handlers[ i ];
-						sel = handleObj.selector;
-
-						if ( selMatch[ sel ] === undefined ) {
-							selMatch[ sel ] = handleObj.needsContext ?
-								jQuery( sel, this ).index( cur ) >= 0 :
-								jQuery.find( sel, this, null, [ cur ] ).length;
-						}
-						if ( selMatch[ sel ] ) {
-							matches.push( handleObj );
-						}
-					}
-					if ( matches.length ) {
-						handlerQueue.push({ elem: cur, matches: matches });
-					}
-				}
-			}
-		}
-
-		// Add the remaining (directly-bound) handlers
-		if ( handlers.length > delegateCount ) {
-			handlerQueue.push({ elem: this, matches: handlers.slice( delegateCount ) });
-		}
-
-		// Run delegates first; they may want to stop propagation beneath us
-		for ( i = 0; i < handlerQueue.length && !event.isPropagationStopped(); i++ ) {
-			matched = handlerQueue[ i ];
-			event.currentTarget = matched.elem;
-
-			for ( j = 0; j < matched.matches.length && !event.isImmediatePropagationStopped(); j++ ) {
-				handleObj = matched.matches[ j ];
-
-				// Triggered event must either 1) be non-exclusive and have no namespace, or
-				// 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace).
-				if ( run_all || (!event.namespace && !handleObj.namespace) || event.namespace_re && event.namespace_re.test( handleObj.namespace ) ) {
-
-					event.data = handleObj.data;
-					event.handleObj = handleObj;
-
-					ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler )
-							.apply( matched.elem, args );
-
-					if ( ret !== undefined ) {
-						event.result = ret;
-						if ( ret === false ) {
-							event.preventDefault();
-							event.stopPropagation();
-						}
-					

<TRUNCATED>

[08/37] move JS tests into safety

Posted by ja...@apache.org.
http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/www/script/test/cookie_auth.js
----------------------------------------------------------------------
diff --git a/share/www/script/test/cookie_auth.js b/share/www/script/test/cookie_auth.js
deleted file mode 100644
index 9b4bd64..0000000
--- a/share/www/script/test/cookie_auth.js
+++ /dev/null
@@ -1,288 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License.  You may obtain a copy
-// of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
-couchTests.cookie_auth = function(debug) {
-  // This tests cookie-based authentication.
-
-  var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"});
-  db.deleteDb();
-  db.createDb();
-  if (debug) debugger;
-
-  var password = "3.141592653589";
-
-  var loginUser = function(username) {
-    var pws = {
-      jan: "apple",
-      "Jason Davies": password,
-      jchris: "funnybone"
-    };
-    var username1 = username.replace(/[0-9]$/, "");
-    var password = pws[username];
-    //console.log("Logging in '" + username1 + "' with password '" + password + "'");
-    T(CouchDB.login(username1, pws[username]).ok);
-  };
-
-  var open_as = function(db, docId, username) {
-    loginUser(username);
-    try {
-      return db.open(docId, {"anti-cache": Math.round(Math.random() * 100000)});
-    } finally {
-      CouchDB.logout();
-    }
-  };
-
-  var save_as = function(db, doc, username)
-  {
-    loginUser(username);
-    try {
-      return db.save(doc);
-    } catch (ex) {
-      return ex;
-    } finally {
-      CouchDB.logout();
-    }
-  };
-
-  // Simple secret key generator
-  function generateSecret(length) {
-    var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
-    var secret = '';
-    for (var i=0; i<length; i++) {
-      secret += tab.charAt(Math.floor(Math.random() * 64));
-    }
-    return secret;
-  }
-
-  // this function will be called on the modified server
-  var testFun = function () {
-    try {
-
-      // test that the users db is born with the auth ddoc
-      var ddoc = open_as(usersDb, "_design/_auth", "jan");
-      T(ddoc.validate_doc_update);
-
-      // TODO test that changing the config so an existing db becomes the users db installs the ddoc also
-
-      // Create a user
-      var jasonUserDoc = CouchDB.prepareUserDoc({
-        name: "Jason Davies"
-      }, password);
-      T(usersDb.save(jasonUserDoc).ok);
-
-      var checkDoc = open_as(usersDb, jasonUserDoc._id, "jan");
-      TEquals("Jason Davies", checkDoc.name);
-
-      var jchrisUserDoc = CouchDB.prepareUserDoc({
-        name: "jchris@apache.org"
-      }, "funnybone");
-      T(usersDb.save(jchrisUserDoc).ok);
-
-      // make sure we cant create duplicate users
-      var duplicateJchrisDoc = CouchDB.prepareUserDoc({
-        name: "jchris@apache.org"
-      }, "eh, Boo-Boo?");
-
-      try {
-        usersDb.save(duplicateJchrisDoc);
-        T(false && "Can't create duplicate user names. Should have thrown an error.");
-      } catch (e) {
-        TEquals("conflict", e.error);
-        TEquals(409, usersDb.last_req.status);
-      }
-
-      // we can't create _names
-      var underscoreUserDoc = CouchDB.prepareUserDoc({
-        name: "_why"
-      }, "copperfield");
-
-      try {
-        usersDb.save(underscoreUserDoc);
-        T(false && "Can't create underscore user names. Should have thrown an error.");
-      } catch (e) {
-        TEquals("forbidden", e.error);
-        TEquals(403, usersDb.last_req.status);
-      }
-
-      // we can't create docs with malformed ids
-      var badIdDoc = CouchDB.prepareUserDoc({
-        name: "w00x"
-      }, "bar");
-
-      badIdDoc._id = "org.apache.couchdb:w00x";
-
-      try {
-        usersDb.save(badIdDoc);
-        T(false && "Can't create malformed docids. Should have thrown an error.");
-      } catch (e) {
-        TEquals("forbidden", e.error);
-        TEquals(403, usersDb.last_req.status);
-      }
-
-      // login works
-      T(CouchDB.login('Jason Davies', password).ok);
-      TEquals('Jason Davies', CouchDB.session().userCtx.name);
-
-      // JSON login works
-      var xhr = CouchDB.request("POST", "/_session", {
-        headers: {"Content-Type": "application/json"},
-        body: JSON.stringify({
-          name: 'Jason Davies',
-          password: password
-        })
-      });
-
-      T(JSON.parse(xhr.responseText).ok);
-      TEquals('Jason Davies', CouchDB.session().userCtx.name);
-
-      // update one's own credentials document
-      jasonUserDoc.foo=2;
-      T(usersDb.save(jasonUserDoc).ok);
-      T(CouchDB.session().userCtx.roles.indexOf("_admin") == -1);
-      // can't delete another users doc unless you are admin
-      try {
-        usersDb.deleteDoc(jchrisUserDoc);
-        T(false && "Can't delete other users docs. Should have thrown an error.");
-      } catch (e) {
-        TEquals("not_found", e.error);
-        TEquals(404, usersDb.last_req.status);
-      }
-
-      // TODO should login() throw an exception here?
-       T(!CouchDB.login('Jason Davies', "2.71828").ok);
-       T(!CouchDB.login('Robert Allen Zimmerman', 'd00d').ok);
-
-       // a failed login attempt should log you out
-       T(CouchDB.session().userCtx.name != 'Jason Davies');
-
-       // test redirect on success
-       xhr = CouchDB.request("POST", "/_session?next=/", {
-         headers: {"Content-Type": "application/x-www-form-urlencoded"},
-         body: "name=Jason%20Davies&password="+encodeURIComponent(password)
-       });
-       // the browser should transparently follow the redirect and GET the server root (/)
-       // see http://dev.w3.org/2006/webapi/XMLHttpRequest/#infrastructure-for-the-send-method
-       if (xhr.status == 200) {
-         T(/Welcome/.test(xhr.responseText))
-       }
-
-       // test redirect on fail
-       xhr = CouchDB.request("POST", "/_session?fail=/", {
-         headers: {"Content-Type": "application/x-www-form-urlencoded"},
-         body: "name=Jason%20Davies&password=foobar"
-       });
-       if (xhr.status == 200) {
-         T(/Welcome/.test(xhr.responseText));
-       }
-
-      // test users db validations
-      //
-      // test that you can't update docs unless you are logged in as the user (or are admin)
-      T(CouchDB.login("jchris@apache.org", "funnybone").ok);
-      T(CouchDB.session().userCtx.name == "jchris@apache.org");
-      T(CouchDB.session().userCtx.roles.length == 0);
-
-      jasonUserDoc.foo=3;
-
-      try {
-        usersDb.save(jasonUserDoc);
-        T(false && "Can't update someone else's user doc. Should have thrown an error.");
-      } catch (e) {
-        T(e.error == "not_found");
-        T(usersDb.last_req.status == 404);
-      }
-
-      // test that you can't edit roles unless you are admin
-      jchrisUserDoc.roles = ["foo"];
-
-      try {
-        usersDb.save(jchrisUserDoc);
-        T(false && "Can't set roles unless you are admin. Should have thrown an error.");
-      } catch (e) {
-        T(e.error == "forbidden");
-        T(usersDb.last_req.status == 403);
-      }
-
-      T(CouchDB.logout().ok);
-
-      jchrisUserDoc.foo = ["foo"];
-      T(save_as(usersDb, jchrisUserDoc, "jan"));
-
-      // test that you can't save system (underscore) roles even if you are admin
-      jchrisUserDoc.roles = ["_bar"];
-
-      var res = save_as(usersDb, jchrisUserDoc, "jan");
-      T(res.error == "forbidden");
-      T(usersDb.last_req.status == 403);
-
-      // make sure the foo role has been applied
-      T(CouchDB.login("jchris@apache.org", "funnybone").ok);
-      T(CouchDB.session().userCtx.name == "jchris@apache.org");
-      T(CouchDB.session().userCtx.roles.indexOf("_admin") == -1);
-      T(CouchDB.session().userCtx.roles.indexOf("foo") != -1);
-
-      // now let's make jchris a server admin
-      T(CouchDB.logout().ok);
-
-      // set the -hashed- password so the salt matches
-      // todo ask on the ML about this
-
-      TEquals(true, CouchDB.login("jan", "apple").ok);
-      run_on_modified_server([{section: "admins",
-        key: "jchris@apache.org", value: "funnybone"}], function() {
-          T(CouchDB.login("jchris@apache.org", "funnybone").ok);
-          T(CouchDB.session().userCtx.name == "jchris@apache.org");
-          T(CouchDB.session().userCtx.roles.indexOf("_admin") != -1);
-          // test that jchris still has the foo role
-          T(CouchDB.session().userCtx.roles.indexOf("foo") != -1);
-
-          // should work even when user doc has no password
-          jchrisUserDoc = usersDb.open(jchrisUserDoc._id);
-          delete jchrisUserDoc.salt;
-          delete jchrisUserDoc.password_sha;
-          T(usersDb.save(jchrisUserDoc).ok);
-          T(CouchDB.logout().ok);
-          T(CouchDB.login("jchris@apache.org", "funnybone").ok);
-          var s = CouchDB.session();
-          T(s.userCtx.name == "jchris@apache.org");
-          T(s.userCtx.roles.indexOf("_admin") != -1);
-          // test session info
-          T(s.info.authenticated == "cookie");
-          T(s.info.authentication_db == "test_suite_users");
-          // test that jchris still has the foo role
-          T(CouchDB.session().userCtx.roles.indexOf("foo") != -1);
-        });
-
-    } finally {
-      // Make sure we erase any auth cookies so we don't affect other tests
-      T(CouchDB.logout().ok);
-    }
-    // log in one last time so run_on_modified_server can clean up the admin account
-    TEquals(true, CouchDB.login("jan", "apple").ok);
-  };
-
-  var usersDb = new CouchDB("test_suite_users", {"X-Couch-Full-Commit":"false"});
-  usersDb.deleteDb();
-
-  run_on_modified_server(
-    [
-     {section: "couch_httpd_auth",
-      key: "authentication_db", value: "test_suite_users"},
-     {section: "couch_httpd_auth",
-      key: "iterations", value: "1"},
-     {section: "admins",
-       key: "jan", value: "apple"}
-    ],
-    testFun
-  );
-
-};

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/www/script/test/copy_doc.js
----------------------------------------------------------------------
diff --git a/share/www/script/test/copy_doc.js b/share/www/script/test/copy_doc.js
deleted file mode 100644
index d595761..0000000
--- a/share/www/script/test/copy_doc.js
+++ /dev/null
@@ -1,65 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
-couchTests.copy_doc = function(debug) {
-  var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"});
-  db.deleteDb();
-  db.createDb();
-  if (debug) debugger;
-
-  // copy a doc
-  var ok = db.save({_id:"doc_to_be_copied",v:1}).ok;
-  TEquals(true, ok, "Should return ok:true");
-  var xhr = CouchDB.request("COPY", "/test_suite_db/doc_to_be_copied", {
-    headers: {"Destination":"doc_that_was_copied"}
-  });
-
-  TEquals(true, JSON.parse(xhr.responseText).ok, "Should return ok:true");
-
-  TEquals(201, xhr.status, "Should return 201 status");
-  TEquals(1, db.open("doc_that_was_copied").v, "Should have value 1");
-
-  // COPY with existing target
-  var ok = db.save({_id:"doc_to_be_copied2",v:1}).ok;
-  TEquals(true, ok, "Should return ok:true");
-  var doc = db.save({_id:"doc_to_be_overwritten",v:2});
-  TEquals(true, doc.ok, "Should return ok:true");
-
-  // error condition
-  var xhr = CouchDB.request("COPY", "/test_suite_db/doc_to_be_copied2", {
-      headers: {"Destination":"doc_to_be_overwritten"}
-  });
-  TEquals(409, xhr.status, "Should return 409 status"); // conflict
-
-  var xhr = CouchDB.request("COPY", "/test_suite_db/doc_to_be_copied2");
-  TEquals(400, xhr.status, "Should return 400 status");
-  TEquals("Destination header is mandatory for COPY.", JSON.parse(xhr.responseText).reason,
-    "Should report missing destination header");
-
-  var xhr = CouchDB.request("COPY", "/test_suite_db/doc_to_be_copied2", {
-    headers: {
-      "Destination": "http://localhost:5984/test_suite_db/doc_to_be_written"
-  }});
-  TEquals(400, xhr.status, "Should return 400 status");
-  TEquals("Destination URL must be relative.", JSON.parse(xhr.responseText).reason,
-    "Should report invalid destination header");
-
-  var rev = db.open("doc_to_be_overwritten")._rev;
-  var xhr = CouchDB.request("COPY", "/test_suite_db/doc_to_be_copied2", {
-    headers: {"Destination":"doc_to_be_overwritten?rev=" + rev}
-  });
-  TEquals(201, xhr.status, "Should return 201 status");
-
-  var over = db.open("doc_to_be_overwritten");
-  T(rev != over._rev);
-  TEquals(1, over.v, "Should be value 1");
-};

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/www/script/test/delayed_commits.js
----------------------------------------------------------------------
diff --git a/share/www/script/test/delayed_commits.js b/share/www/script/test/delayed_commits.js
deleted file mode 100644
index dbb072f..0000000
--- a/share/www/script/test/delayed_commits.js
+++ /dev/null
@@ -1,154 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
-couchTests.delayed_commits = function(debug) {
-  var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"});
-  db.deleteDb();
-  db.createDb();
-  if (debug) debugger;
-
-  run_on_modified_server(
-    [{section: "couchdb",
-      key: "delayed_commits",
-      value: "true"}],
-
-    function () {
-      // By default, couchdb doesn't fully commit documents to disk right away,
-      // it waits about a second to batch the full commit flush along with any
-      // other updates. If it crashes or is restarted you may lose the most
-      // recent commits.
-
-      T(db.save({_id:"1",a:2,b:4}).ok);
-      T(db.open("1") != null);
-
-      restartServer();
-
-      T(db.open("1") == null); // lost the update.
-      // note if we waited > 1 sec before the restart, the doc would likely
-      // commit.
-
-
-      // Retry the same thing but with full commits on.
-
-      var db2 = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"true"});
-
-      T(db2.save({_id:"1",a:2,b:4}).ok);
-      T(db2.open("1") != null);
-
-      restartServer();
-
-      T(db2.open("1") != null);
-
-      // You can update but without committing immediately, and then ensure
-      // everything is commited in the last step.
-
-      T(db.save({_id:"2",a:2,b:4}).ok);
-      T(db.open("2") != null);
-      T(db.ensureFullCommit().ok);
-      restartServer();
-
-      T(db.open("2") != null);
-
-      // However, it's possible even when flushed, that the server crashed between
-      // the update and the commit, and you don't want to check to make sure
-      // every doc you updated actually made it to disk. So record the instance
-      // start time of the database before the updates and then check it again
-      // after the flush (the instance start time is returned by the flush
-      // operation). if they are the same, we know everything was updated
-      // safely.
-
-      // First try it with a crash.
-
-      var instanceStartTime = db.info().instance_start_time;
-
-      T(db.save({_id:"3",a:2,b:4}).ok);
-      T(db.open("3") != null);
-
-      restartServer();
-
-      var commitResult = db.ensureFullCommit();
-      T(commitResult.ok && commitResult.instance_start_time != instanceStartTime);
-      // start times don't match, meaning the server lost our change
-
-      T(db.open("3") == null); // yup lost it
-
-      // retry with no server restart
-
-      var instanceStartTime = db.info().instance_start_time;
-
-      T(db.save({_id:"4",a:2,b:4}).ok);
-      T(db.open("4") != null);
-
-      var commitResult = db.ensureFullCommit();
-      T(commitResult.ok && commitResult.instance_start_time == instanceStartTime);
-      // Successful commit, start times match!
-
-      restartServer();
-
-      T(db.open("4") != null);
-    });
-
-  // Now test that when we exceed the max_dbs_open, pending commits are safely
-  // written.
-  T(db.save({_id:"5",foo:"bar"}).ok);
-  var max = 2;
-  run_on_modified_server(
-    [{section: "couchdb",
-      key: "delayed_commits",
-      value: "true"},
-     {section: "couchdb",
-      key: "max_dbs_open",
-      value: max.toString()}],
-
-    function () {
-      for(var i=0; i<max; i++) {
-        var dbi = new CouchDB("test_suite_db" + i);
-        dbi.deleteDb();
-        dbi.createDb();
-      }
-      T(db.open("5").foo=="bar");
-      for(var i=0; i<max+1; i++) {
-        var dbi = new CouchDB("test_suite_db" + i);
-        dbi.deleteDb();
-      }
-    });
-
-
-  // Test that a conflict can't cause delayed commits to fail
-  run_on_modified_server(
-    [{section: "couchdb",
-      key: "delayed_commits",
-      value: "true"}],
-
-    function() {
-      //First save a document and commit it
-      T(db.save({_id:"6",a:2,b:4}).ok);
-      T(db.ensureFullCommit().ok);
-      //Generate a conflict
-      try {
-        db.save({_id:"6",a:2,b:4});
-      } catch( e) {
-        T(e.error == "conflict");
-      }
-      //Wait for the delayed commit interval to pass
-      var time = new Date();
-      while(new Date() - time < 2000);
-      //Save a new doc
-      T(db.save({_id:"7",a:2,b:4}).ok);
-      //Wait for the delayed commit interval to pass
-      var time = new Date();
-      while(new Date() - time < 2000);
-      //Crash the server and make sure the last doc was written
-      restartServer();
-      T(db.open("7") != null);
-    });
-};

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/www/script/test/design_docs.js
----------------------------------------------------------------------
diff --git a/share/www/script/test/design_docs.js b/share/www/script/test/design_docs.js
deleted file mode 100644
index dd38858..0000000
--- a/share/www/script/test/design_docs.js
+++ /dev/null
@@ -1,466 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
-couchTests.design_docs = function(debug) {
-  var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"});
-  var db2 = new CouchDB("test_suite_db_a", {"X-Couch-Full-Commit":"false"});
-
-  if (debug) debugger;
-
-  db.deleteDb();
-  db.createDb();
-  db2.deleteDb();
-  db2.createDb();
-
-  var server_config = [
-    {
-      section: "query_server_config",
-      key: "reduce_limit",
-      value: "false"
-    }
-  ];
-
-  var testFun = function() {
-    var numDocs = 500;
-
-    function makebigstring(power) {
-      var str = "a";
-      while(power-- > 0) {
-        str = str + str;
-      }
-      return str;
-    }
-
-    var designDoc = {
-      _id: "_design/test",
-      language: "javascript",
-      whatever : {
-        stringzone : "exports.string = 'plankton';",
-        commonjs : {
-          whynot : "exports.test = require('../stringzone'); " +
-            "exports.foo = require('whatever/stringzone');",
-          upper : "exports.testing = require('./whynot').test.string.toUpperCase()+" +
-            "module.id+require('./whynot').foo.string",
-          circular_one: "require('./circular_two'); exports.name = 'One';",
-          circular_two: "require('./circular_one'); exports.name = 'Two';"
-        },
-        // paths relative to parent
-        idtest1: {
-          a: {
-            b: {d: "module.exports = require('../c/e').id;"},
-            c: {e: "exports.id = module.id;"}
-          }
-        },
-        // multiple paths relative to parent
-        idtest2: {
-          a: {
-            b: {d: "module.exports = require('../../a/c/e').id;"},
-            c: {e: "exports.id = module.id;"}
-          }
-        },
-        // paths relative to module
-        idtest3: {
-          a: {
-            b: "module.exports = require('./c/d').id;",
-            c: {
-              d: "module.exports = require('./e');",
-              e: "exports.id = module.id;"
-            }
-          }
-        },
-        // paths relative to module and parent
-        idtest4: {
-          a: {
-            b: "module.exports = require('../a/./c/d').id;",
-            c: {
-              d: "module.exports = require('./e');",
-              e: "exports.id = module.id;"
-            }
-          }
-        },
-        // paths relative to root
-        idtest5: {
-          a: "module.exports = require('whatever/idtest5/b').id;",
-          b: "exports.id = module.id;"
-        }
-      },
-      views: {
-        all_docs_twice: {
-          map:
-            (function(doc) {
-              emit(doc.integer, null);
-              emit(doc.integer, null);
-            }).toString()
-        },
-        no_docs: {
-          map:
-            (function(doc) {
-            }).toString()
-        },
-        single_doc: {
-          map:
-            (function(doc) {
-              if (doc._id === "1") {
-                emit(1, null);
-              }
-            }).toString()
-        },
-        summate: {
-          map:
-            (function(doc) {
-              emit(doc.integer, doc.integer);
-            }).toString(),
-          reduce:
-            (function(keys, values) {
-              return sum(values);
-            }).toString()
-        },
-        summate2: {
-          map:
-            (function(doc) {
-              emit(doc.integer, doc.integer);
-            }).toString(),
-          reduce:
-            (function(keys, values) {
-              return sum(values);
-            }).toString()
-        },
-        huge_src_and_results: {
-          map:
-            (function(doc) {
-              if (doc._id === "1") {
-                emit(makebigstring(16), null);
-              }
-            }).toString(),
-          reduce:
-            (function(keys, values) {
-              return makebigstring(16);
-            }).toString()
-        },
-        lib : {
-          baz : "exports.baz = 'bam';",
-          foo : {
-            foo : "exports.foo = 'bar';",
-            boom : "exports.boom = 'ok';",
-            zoom : "exports.zoom = 'yeah';"
-          }
-        },
-        commonjs : {
-          map :
-            (function(doc) {
-              emit(null, require('views/lib/foo/boom').boom);
-            }).toString()
-        }
-      },
-      shows: {
-        simple:
-          (function() {
-            return 'ok';
-          }).toString(),
-        requirey:
-          (function() {
-            var lib = require('whatever/commonjs/upper');
-            return lib.testing;
-          }).toString(),
-        circular:
-          (function() {
-            var lib = require('whatever/commonjs/upper');
-            return JSON.stringify(this);
-          }).toString(),
-        circular_require:
-          (function() {
-            return require('whatever/commonjs/circular_one').name;
-          }).toString(),
-        idtest1: (function() {
-            return require('whatever/idtest1/a/b/d');
-          }).toString(),
-        idtest2: (function() {
-            return require('whatever/idtest2/a/b/d');
-          }).toString(),
-        idtest3: (function() {
-            return require('whatever/idtest3/a/b');
-          }).toString(),
-        idtest4: (function() {
-            return require('whatever/idtest4/a/b');
-          }).toString(),
-        idtest5: (function() {
-            return require('whatever/idtest5/a');
-          }).toString()
-      }
-    }; // designDoc
-
-    var xhr = CouchDB.request(
-      "PUT", "/test_suite_db_a/_design/test", {body: JSON.stringify(designDoc)}
-    );
-    var resp = JSON.parse(xhr.responseText);
-
-    TEquals(resp.rev, db.save(designDoc).rev);
-
-    // test that editing a show fun on the ddoc results in a change in output
-    xhr = CouchDB.request("GET", "/test_suite_db/_design/test/_show/simple");
-    T(xhr.status == 200);
-    TEquals(xhr.responseText, "ok");
-
-    designDoc.shows.simple = (function() {
-      return 'ko';
-    }).toString();
-    T(db.save(designDoc).ok);
-
-    xhr = CouchDB.request("GET", "/test_suite_db/_design/test/_show/simple");
-    T(xhr.status == 200);
-    TEquals(xhr.responseText, "ko");
-
-    xhr = CouchDB.request(
-      "GET", "/test_suite_db_a/_design/test/_show/simple?cache=buster"
-    );
-    T(xhr.status == 200);
-    TEquals("ok", xhr.responseText, 'query server used wrong ddoc');
-
-    // test commonjs require
-    xhr = CouchDB.request("GET", "/test_suite_db/_design/test/_show/requirey");
-    T(xhr.status == 200);
-    TEquals("PLANKTONwhatever/commonjs/upperplankton", xhr.responseText);
-
-    xhr = CouchDB.request("GET", "/test_suite_db/_design/test/_show/circular");
-    T(xhr.status == 200);
-    TEquals("javascript", JSON.parse(xhr.responseText).language);
-
-    // test circular commonjs dependencies
-    xhr = CouchDB.request(
-      "GET",
-      "/test_suite_db/_design/test/_show/circular_require"
-    );
-    TEquals(200, xhr.status);
-    TEquals("One", xhr.responseText);
-
-    // Test that changes to the design doc properly invalidate cached modules:
-
-    // update the designDoc and replace
-    designDoc.whatever.commonjs.circular_one = "exports.name = 'Updated';"
-    T(db.save(designDoc).ok);
-
-    // request circular_require show function again and check the response has
-    // changed
-    xhr = CouchDB.request(
-      "GET",
-      "/test_suite_db/_design/test/_show/circular_require"
-    );
-    TEquals(200, xhr.status);
-    TEquals("Updated", xhr.responseText);
-
-
-    // test module id values are as expected:
-    xhr = CouchDB.request("GET", "/test_suite_db/_design/test/_show/idtest1");
-    TEquals(200, xhr.status);
-    TEquals("whatever/idtest1/a/c/e", xhr.responseText);
-
-    xhr = CouchDB.request("GET", "/test_suite_db/_design/test/_show/idtest2");
-    TEquals(200, xhr.status);
-    TEquals("whatever/idtest2/a/c/e", xhr.responseText);
-
-    xhr = CouchDB.request("GET", "/test_suite_db/_design/test/_show/idtest3");
-    TEquals(200, xhr.status);
-    TEquals("whatever/idtest3/a/c/e", xhr.responseText);
-
-    xhr = CouchDB.request("GET", "/test_suite_db/_design/test/_show/idtest4");
-    TEquals(200, xhr.status);
-    TEquals("whatever/idtest4/a/c/e", xhr.responseText);
-
-    xhr = CouchDB.request("GET", "/test_suite_db/_design/test/_show/idtest5");
-    TEquals(200, xhr.status);
-    TEquals("whatever/idtest5/b", xhr.responseText);
-
-
-    var prev_view_sig = db.designInfo("_design/test").view_index.signature;
-    var prev_view_size = db.designInfo("_design/test").view_index.disk_size;
-
-    db.bulkSave(makeDocs(1, numDocs + 1));
-    T(db.ensureFullCommit().ok);
-
-    // test that we get correct design doc info back,
-    // and also that GET /db/_design/test/_info
-    // hasn't triggered an update of the views
-    db.view("test/summate", {stale: "ok"}); // make sure view group's open
-    for (var i = 0; i < 2; i++) {
-      var dinfo = db.designInfo("_design/test");
-      TEquals("test", dinfo.name);
-      var vinfo = dinfo.view_index;
-      TEquals(prev_view_size, vinfo.disk_size, "view group disk size didn't change");
-      TEquals(false, vinfo.compact_running);
-      TEquals(prev_view_sig, vinfo.signature, 'ddoc sig');
-      // wait some time (there were issues where an update
-      // of the views had been triggered in the background)
-      var start = new Date().getTime();
-      while (new Date().getTime() < start + 2000);
-      TEquals(0, db.view("test/all_docs_twice", {stale: "ok"}).total_rows, 'view info');
-      TEquals(0, db.view("test/single_doc", {stale: "ok"}).total_rows, 'view info');
-      TEquals(0, db.view("test/summate", {stale: "ok"}).rows.length, 'view info');
-      T(db.ensureFullCommit().ok);
-      restartServer();
-    };
-
-    db.bulkSave(makeDocs(numDocs + 1, numDocs * 2 + 1));
-    T(db.ensureFullCommit().ok);
-
-    // open view group
-    db.view("test/summate", {stale: "ok"});
-    // wait so the views can get initialized
-    var start = new Date().getTime();
-    while (new Date().getTime() < start + 2000);
-
-    // test that POST /db/_view_cleanup
-    // doesn't trigger an update of the views
-    var len1 = db.view("test/all_docs_twice", {stale: "ok"}).total_rows;
-    var len2 = db.view("test/single_doc", {stale: "ok"}).total_rows;
-    var len3 = db.view("test/summate", {stale: "ok"}).rows.length;
-    for (i = 0; i < 2; i++) {
-      T(db.viewCleanup().ok);
-      // wait some time (there were issues where an update
-      // of the views had been triggered in the background)
-      start = new Date().getTime();
-      while (new Date().getTime() < start + 2000);
-      TEquals(len1, db.view("test/all_docs_twice", {stale: "ok"}).total_rows, 'view cleanup');
-      TEquals(len2, db.view("test/single_doc", {stale: "ok"}).total_rows, 'view cleanup');
-      TEquals(len3, db.view("test/summate", {stale: "ok"}).rows.length, 'view cleanup');
-      T(db.ensureFullCommit().ok);
-      restartServer();
-      // we'll test whether the view group stays closed
-      // and the views stay uninitialized (they should!)
-      len1 = len2 = len3 = 0;
-    };
-
-    // test commonjs in map functions
-    resp = db.view("test/commonjs", {limit:1});
-    T(resp.rows[0].value == 'ok');
-
-    // test that the _all_docs view returns correctly with keys
-    var results = db.allDocs({startkey:"_design", endkey:"_design0"});
-    T(results.rows.length == 1);
-
-    for (i = 0; i < 2; i++) {
-      var rows = db.view("test/all_docs_twice").rows;
-      for (var j = 0; j < numDocs; j++) {
-        T(rows[2 * j].key == (j + 1));
-        T(rows[(2 * j) + 1].key == (j + 1));
-      };
-      T(db.view("test/no_docs").total_rows == 0);
-      T(db.view("test/single_doc").total_rows == 1);
-      T(db.ensureFullCommit().ok);
-      restartServer();
-    };
-
-    // test when language not specified, Javascript is implied
-    var designDoc2 = {
-      _id: "_design/test2",
-      // language: "javascript",
-      views: {
-        single_doc: {
-          map:
-            (function(doc) {
-              if (doc._id === "1") {
-                emit(1, null);
-              }
-            }).toString()
-        }
-      }
-    };
-
-    T(db.save(designDoc2).ok);
-    T(db.view("test2/single_doc").total_rows == 1);
-
-    var summate = function(N) {
-      return (N + 1) * (N / 2);
-    };
-    var result = db.view("test/summate");
-    T(result.rows[0].value == summate(numDocs * 2));
-
-    result = db.view("test/summate", {startkey: 4, endkey: 4});
-    T(result.rows[0].value == 4);
-
-    result = db.view("test/summate", {startkey: 4, endkey: 5});
-    T(result.rows[0].value == 9);
-
-    result = db.view("test/summate", {startkey: 4, endkey: 6});
-    T(result.rows[0].value == 15);
-
-    // test start_key and end_key aliases
-    result = db.view("test/summate", {start_key: 4, end_key: 6});
-    T(result.rows[0].value == 15);
-
-    // Verify that a shared index (view def is an exact copy of "summate")
-    // does not confuse the reduce stage
-    result = db.view("test/summate2", {startkey: 4, endkey: 6});
-    T(result.rows[0].value == 15);
-
-    for(i = 1; i < (numDocs / 2); i += 30) {
-      result = db.view("test/summate", {startkey: i, endkey: (numDocs - i)});
-      T(result.rows[0].value == summate(numDocs - i) - summate(i - 1));
-    }
-
-    T(db.deleteDoc(designDoc).ok);
-    T(db.open(designDoc._id) == null);
-    T(db.view("test/no_docs") == null);
-
-    T(db.ensureFullCommit().ok);
-    restartServer();
-    T(db.open(designDoc._id) == null);
-    T(db.view("test/no_docs") == null);
-
-    // trigger ddoc cleanup
-    T(db.viewCleanup().ok);
-  }; // enf of testFun
-
-  run_on_modified_server(server_config, testFun);
-
-  // COUCHDB-1227 - if a design document is deleted, by adding a "_deleted"
-  // field with the boolean value true, its validate_doc_update functions
-  // should no longer have effect.
-  db.deleteDb();
-  db.createDb();
-  var ddoc = {
-    _id: "_design/test",
-    language: "javascript",
-    validate_doc_update: (function(newDoc, oldDoc, userCtx, secObj) {
-       if (newDoc.value % 2 == 0) {
-          throw({forbidden: "dont like even numbers"});
-       }
-       return true;
-    }).toString()
-  };
-
-  TEquals(true, db.save(ddoc).ok);
-  try {
-    db.save({_id: "doc1", value: 4});
-    T(false, "doc insertion should have failed");
-  } catch (x) {
-    TEquals("forbidden", x.error);
-  }
-
-  var doc = db.open("doc1");
-  TEquals(null, doc);
-  ddoc._deleted = true;
-  TEquals(true, db.save(ddoc).ok);
-
-  try {
-    TEquals(true, db.save({_id: "doc1", value: 4}).ok);
-  } catch (x) {
-    T(false, "doc insertion should have succeeded");
-  }
-
-  doc = db.open("doc1");
-  TEquals(true, doc !== null, "doc was not persisted");
-  TEquals(4, doc.value);
-
-  // cleanup
-  db.deleteDb();
-  db2.deleteDb();
-};

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/www/script/test/design_options.js
----------------------------------------------------------------------
diff --git a/share/www/script/test/design_options.js b/share/www/script/test/design_options.js
deleted file mode 100644
index 05764e2..0000000
--- a/share/www/script/test/design_options.js
+++ /dev/null
@@ -1,74 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
-couchTests.design_options = function(debug) {
-  var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"});
-  db.deleteDb();
-  db.createDb();
-  if (debug) debugger;
-
-  //// test the includes_design option
-  var map = "function (doc) {emit(null, doc._id);}";
-  var withseq = "function(doc) {emit(doc._local_seq, null)}"
-
-  // we need a design doc even to test temp views with it
-  var designDoc = {
-    _id:"_design/fu",
-    language: "javascript",
-    options: {
-      include_design: true,
-      local_seq: true
-    },
-    views: {
-      data: {"map": map},
-      with_seq : {"map" : withseq}
-    }
-  };
-  T(db.save(designDoc).ok);
-
-  // should work for temp views
-  var rows = db.query(map, null, {options:{include_design: true}}).rows;
-  T(rows.length == 1);
-  T(rows[0].value == "_design/fu");
-
-  rows = db.query(map).rows;
-  T(rows.length == 0);
-
-  // when true, should include design docs in views
-  rows = db.view("fu/data").rows;
-  T(rows.length == 1);
-  T(rows[0].value == "_design/fu");
-
-  // when false, should not
-  designDoc.options.include_design = false;
-  delete designDoc._rev;
-  designDoc._id = "_design/bingo";
-  T(db.save(designDoc).ok);
-  rows = db.view("bingo/data").rows;
-  T(rows.length == 0);
-
-  // should default to false
-  delete designDoc.options;
-  delete designDoc._rev;
-  designDoc._id = "_design/bango";
-  T(db.save(designDoc).ok);
-  rows = db.view("bango/data").rows;
-  T(rows.length == 0);
-
-  // should also have local_seq in the view
-  var resp = db.save({});
-  rows = db.view("fu/with_seq").rows;
-  T(rows[0].key == 1)
-  T(rows[1].key == 2)
-  var doc = db.open(resp.id);
-  db.deleteDoc(doc);
-};

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/www/script/test/design_paths.js
----------------------------------------------------------------------
diff --git a/share/www/script/test/design_paths.js b/share/www/script/test/design_paths.js
deleted file mode 100644
index 426a252..0000000
--- a/share/www/script/test/design_paths.js
+++ /dev/null
@@ -1,72 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
-couchTests.design_paths = function(debug) {
-  if (debug) debugger;
-  var dbNames = ["test_suite_db", "test_suite_db/with_slashes"];
-  for (var i=0; i < dbNames.length; i++) {
-    var db = new CouchDB(dbNames[i]);
-    var dbName = encodeURIComponent(dbNames[i]);
-    db.deleteDb();
-    db.createDb();
-
-    // create a ddoc w bulk_docs
-    db.bulkSave([{
-      _id : "_design/test",
-      views : {
-        "testing" : {
-          "map" : "function(){emit(1,1)}"
-        }
-      }
-    }]);
-
-    // ddoc is getable
-    var xhr = CouchDB.request("GET", "/"+dbName+"/_design/test");
-    var resp = JSON.parse(xhr.responseText);
-    T(resp._id == "_design/test");
-
-    // it's at 2 urls...
-    var xhr = CouchDB.request("GET", "/"+dbName+"/_design%2Ftest");
-    var resp = JSON.parse(xhr.responseText);
-    T(resp._id == "_design/test");
-
-    // ensure that views are addressable
-    resp = db.view("test/testing")
-    T(resp.total_rows == 0)
-
-    // create a ddoc by putting to url with raw slash
-    var xhr = CouchDB.request("PUT", "/"+dbName+"/_design/test2",{
-      body : JSON.stringify({
-        _id : "_design/test2",
-        views : {
-          "testing" : {
-            "map" : "function(){emit(1,1)}"
-          }
-        }
-      })
-    });
-
-    // ddoc is getable
-    var xhr = CouchDB.request("GET", "/"+dbName+"/_design/test2");
-    var resp = JSON.parse(xhr.responseText);
-    T(resp._id == "_design/test2");
-
-    // it's at 2 urls...
-    var xhr = CouchDB.request("GET", "/"+dbName+"/_design%2Ftest2");
-    var resp = JSON.parse(xhr.responseText);
-    T(resp._id == "_design/test2");
-
-    // ensure that views are addressable
-    resp = db.view("test2/testing");
-    T(resp.total_rows == 0);
-  };
-};

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/www/script/test/erlang_views.js
----------------------------------------------------------------------
diff --git a/share/www/script/test/erlang_views.js b/share/www/script/test/erlang_views.js
deleted file mode 100644
index c6bc5d7..0000000
--- a/share/www/script/test/erlang_views.js
+++ /dev/null
@@ -1,136 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
-couchTests.erlang_views = function(debug) {
-  var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"});
-  db.deleteDb();
-  db.createDb();
-  if (debug) debugger;
-
-
-
-  run_on_modified_server(
-    [{section: "native_query_servers",
-      key: "erlang",
-      value: "{couch_native_process, start_link, []}"}],
-    function() {
-      // Note we just do some basic 'smoke tests' here - the
-      // test/query_server_spec.rb tests have more comprehensive tests
-      var doc = {_id: "1", integer: 1, string: "str1", array: [1, 2, 3]};
-      T(db.save(doc).ok);
-
-      var mfun = 'fun({Doc}) -> ' +
-                 ' K = couch_util:get_value(<<"integer">>, Doc, null), ' +
-                 ' V = couch_util:get_value(<<"string">>, Doc, null), ' +
-                 ' Emit(K, V) ' +
-                 'end.';
-
-      // emitting a key value that is undefined should result in that row not
-      // being included in the view results
-      var results = db.query(mfun, null, null, null, "erlang");
-      T(results.total_rows == 1);
-      T(results.rows[0].key == 1);
-      T(results.rows[0].value == "str1");
-      
-      // check simple reduction - another doc with same key.
-      var doc = {_id: "2", integer: 1, string: "str2"};
-      T(db.save(doc).ok);
-      rfun = 'fun' +
-              ' (_, Values, false) -> length(Values); ' +
-              ' (_, Values, true) -> lists:sum(Values) ' +
-              ' end.';
-      results = db.query(mfun, rfun, null, null, "erlang");
-      T(results.rows[0].value == 2);
-
-      // simple 'list' tests
-      var designDoc = {
-        _id:"_design/erlview",
-        language: "erlang",
-        shows: {
-          simple:
-            'fun(Doc, {Req}) -> ' +
-            '  {Info} = couch_util:get_value(<<"info">>, Req, {[]}), ' +
-            '  Purged = couch_util:get_value(<<"purge_seq">>, Info, -1), ' +
-            '  Verb = couch_util:get_value(<<"method">>, Req, <<"not_get">>), ' +
-            '  R = list_to_binary(io_lib:format("~b - ~s", [Purged, Verb])), ' +
-            '  {[{<<"code">>, 200}, {<<"headers">>, {[]}}, {<<"body">>, R}]} ' +
-            'end.'
-        },
-        lists: {
-          simple_list :
-            'fun(Head, {Req}) -> ' +
-            '  Send(<<"head">>), ' +
-            '  Fun = fun({Row}, _) -> ' +
-            '    Val = couch_util:get_value(<<"value">>, Row, -1), ' +
-            '    Send(list_to_binary(integer_to_list(Val))), ' +
-            '    {ok, nil} ' +
-            '  end, ' +
-            '  {ok, _} = FoldRows(Fun, nil), ' +
-            '  <<"tail">> ' +
-            'end. '
-        },
-        views: {
-          simple_view : {
-            map: mfun,
-            reduce: rfun
-          }
-        }
-      };
-      T(db.save(designDoc).ok);
-
-      var url = "/test_suite_db/_design/erlview/_show/simple/1";
-      var xhr = CouchDB.request("GET", url);
-      T(xhr.status == 200, "standard get should be 200");
-      T(xhr.responseText == "0 - GET");
-
-      var url = "/test_suite_db/_design/erlview/_list/simple_list/simple_view";
-      var xhr = CouchDB.request("GET", url);
-      T(xhr.status == 200, "standard get should be 200");
-      T(xhr.responseText == "head2tail");
-
-      // Larger dataset
-
-      db.deleteDb();
-      db.createDb();
-      var words = "foo bar abc def baz xxyz".split(/\s+/);
-      
-      var docs = [];
-      for(var i = 0; i < 250; i++) {
-        var body = [];
-        for(var j = 0; j < 100; j++) {
-          body.push({
-            word: words[j%words.length],
-            count: j
-          });
-        }
-        docs.push({
-          "_id": "test-" + i,
-          "words": body
-        });
-      }
-      T(db.bulkSave(docs).length, 250, "Saved big doc set.");
-      
-      var mfun = 'fun({Doc}) -> ' +
-        'Words = couch_util:get_value(<<"words">>, Doc), ' +
-        'lists:foreach(fun({Word}) -> ' +
-            'WordString = couch_util:get_value(<<"word">>, Word), ' + 
-            'Count = couch_util:get_value(<<"count">>, Word), ' + 
-            'Emit(WordString , Count) ' +
-          'end, Words) ' +
-        'end.';
-      
-      var rfun = 'fun(Keys, Values, RR) -> length(Values) end.';
-      var results = db.query(mfun, rfun, null, null, "erlang");
-      T(results.rows[0].key === null, "Returned a reduced value.");
-      T(results.rows[0].value > 0, "Reduce value exists.");
-    });
-};

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/www/script/test/etags_head.js
----------------------------------------------------------------------
diff --git a/share/www/script/test/etags_head.js b/share/www/script/test/etags_head.js
deleted file mode 100644
index 63e2999..0000000
--- a/share/www/script/test/etags_head.js
+++ /dev/null
@@ -1,78 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
-couchTests.etags_head = function(debug) {
-  var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"});
-  db.deleteDb();
-  db.createDb();
-  if (debug) debugger;
-
-  var xhr;
-
-  // create a new doc
-  xhr = CouchDB.request("PUT", "/test_suite_db/1", {
-    body: "{}"
-  });
-  T(xhr.status == 201);
-
-  // extract the ETag header values
-  var etag = xhr.getResponseHeader("etag");
-
-  // get the doc and verify the headers match
-  xhr = CouchDB.request("GET", "/test_suite_db/1");
-  T(etag == xhr.getResponseHeader("etag"));
-
-  // 'head' the doc and verify the headers match
-  xhr = CouchDB.request("HEAD", "/test_suite_db/1", {
-    headers: {"if-none-match": "s"}
-  });
-  T(etag == xhr.getResponseHeader("etag"));
-
-  // replace a doc
-  xhr = CouchDB.request("PUT", "/test_suite_db/1", {
-    body: "{}",
-    headers: {"if-match": etag}
-  });
-  T(xhr.status == 201);
-
-  // extract the new ETag value
-  var etagOld= etag;
-  etag = xhr.getResponseHeader("etag");
-
-  // fail to replace a doc
-  xhr = CouchDB.request("PUT", "/test_suite_db/1", {
-    body: "{}"
-  });
-  T(xhr.status == 409);
-
-  // verify get w/Etag
-  xhr = CouchDB.request("GET", "/test_suite_db/1", {
-    headers: {"if-none-match": etagOld}
-  });
-  T(xhr.status == 200);
-  xhr = CouchDB.request("GET", "/test_suite_db/1", {
-    headers: {"if-none-match": etag}
-  });
-  T(xhr.status == 304);
-
-  // fail to delete a doc
-  xhr = CouchDB.request("DELETE", "/test_suite_db/1", {
-    headers: {"if-match": etagOld}
-  });
-  T(xhr.status == 409);
-
-  //now do it for real
-  xhr = CouchDB.request("DELETE", "/test_suite_db/1", {
-    headers: {"if-match": etag}
-  });
-  T(xhr.status == 200);
-};

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/www/script/test/etags_views.js
----------------------------------------------------------------------
diff --git a/share/www/script/test/etags_views.js b/share/www/script/test/etags_views.js
deleted file mode 100644
index 6d8e97b..0000000
--- a/share/www/script/test/etags_views.js
+++ /dev/null
@@ -1,220 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
-couchTests.etags_views = function(debug) {
-  var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"true"});
-  db.deleteDb();
-  db.createDb();
-  if (debug) debugger;
-
-  var designDoc = {
-    _id: "_design/etags",
-    language: "javascript",
-    views : {
-      fooView: {
-        map: stringFun(function(doc) {
-          if (doc.foo) {
-            emit("bar", 1);
-          }
-        }),
-      },
-      basicView : {
-        map : stringFun(function(doc) {
-          if(doc.integer && doc.string) {
-            emit(doc.integer, doc.string);
-          }
-        })
-      },
-      withReduce : {
-        map : stringFun(function(doc) {
-          if(doc.integer && doc.string) {
-            emit(doc.integer, doc.string);
-          }
-        }),
-        reduce : stringFun(function(keys, values, rereduce) {
-          if (rereduce) {
-            return sum(values);
-          } else {
-            return values.length;
-          }
-        })
-      }
-    }
-  };
-  T(db.save(designDoc).ok);
-  db.bulkSave(makeDocs(0, 10));
-
-  var xhr;
-
-  // verify get w/Etag on map view
-  xhr = CouchDB.request("GET", "/test_suite_db/_design/etags/_view/basicView");
-  T(xhr.status == 200);
-  var etag = xhr.getResponseHeader("etag");
-  xhr = CouchDB.request("GET", "/test_suite_db/_design/etags/_view/basicView", {
-    headers: {"if-none-match": etag}
-  });
-  T(xhr.status == 304);
-
-  // verify ETag doesn't change when an update
-  // doesn't change the view group's index
-  T(db.save({"_id":"doc1", "foo":"bar"}).ok);
-  xhr = CouchDB.request("GET", "/test_suite_db/_design/etags/_view/basicView");
-  var etag1 = xhr.getResponseHeader("etag");
-  T(etag1 == etag);
-
-  // verify ETag always changes for include_docs=true on update
-  xhr = CouchDB.request("GET", "/test_suite_db/_design/etags/_view/basicView?include_docs=true");
-  var etag1 = xhr.getResponseHeader("etag");
-  T(db.save({"_id":"doc2", "foo":"bar"}).ok);
-  xhr = CouchDB.request("GET", "/test_suite_db/_design/etags/_view/basicView?include_docs=true");
-  var etag2 = xhr.getResponseHeader("etag");
-  T(etag1 != etag2);
- 
-  // Verify that purges affect etags
-  xhr = CouchDB.request("GET", "/test_suite_db/_design/etags/_view/fooView");
-  var foo_etag = xhr.getResponseHeader("etag");
-  var doc1 = db.open("doc1");
-  xhr = CouchDB.request("POST", "/test_suite_db/_purge", {
-    body: JSON.stringify({"doc1":[doc1._rev]})
-  });
-  xhr = CouchDB.request("GET", "/test_suite_db/_design/etags/_view/fooView");
-  var etag1 = xhr.getResponseHeader("etag");
-  T(etag1 != foo_etag);
-
-  // Test that _purge didn't affect the other view etags.
-  xhr = CouchDB.request("GET", "/test_suite_db/_design/etags/_view/basicView");
-  var etag1 = xhr.getResponseHeader("etag");
-  T(etag1 == etag);
-
-  // verify different views in the same view group may have different ETags
-  xhr = CouchDB.request("GET", "/test_suite_db/_design/etags/_view/fooView");
-  var etag1 = xhr.getResponseHeader("etag");
-  xhr = CouchDB.request("GET", "/test_suite_db/_design/etags/_view/basicView");
-  var etag2 = xhr.getResponseHeader("etag");
-  T(etag1 != etag2);
-
-  // verify ETag changes when an update changes the view group's index.
-  db.bulkSave(makeDocs(10, 20));
-  xhr = CouchDB.request("GET", "/test_suite_db/_design/etags/_view/basicView");
-  var etag1 = xhr.getResponseHeader("etag");
-  T(etag1 != etag);
-
-  // verify ETag is the same after a restart
-  restartServer();
-  xhr = CouchDB.request("GET", "/test_suite_db/_design/etags/_view/basicView");
-  var etag2 = xhr.getResponseHeader("etag");
-  T(etag1 == etag2);
-
-  // reduce view
-  xhr = CouchDB.request("GET", "/test_suite_db/_design/etags/_view/withReduce");
-  T(xhr.status == 200);
-  var etag = xhr.getResponseHeader("etag");
-  xhr = CouchDB.request("GET", "/test_suite_db/_design/etags/_view/withReduce",{
-    headers: {"if-none-match": etag}
-  });
-  T(xhr.status == 304);
-
-  // verify ETag doesn't change when an update
-  // doesn't change the view group's index
-  T(db.save({"_id":"doc3", "foo":"bar"}).ok);
-  xhr = CouchDB.request("GET", "/test_suite_db/_design/etags/_view/withReduce");
-  var etag1 = xhr.getResponseHeader("etag");
-  T(etag1 == etag);
-  // purge
-  var doc3 = db.open("doc3");
-  xhr = CouchDB.request("POST", "/test_suite_db/_purge", {
-    body: JSON.stringify({"doc3":[doc3._rev]})
-  });
-  xhr = CouchDB.request("GET", "/test_suite_db/_design/etags/_view/withReduce");
-  var etag1 = xhr.getResponseHeader("etag");
-  T(etag1 == etag);
-
-  // verify different views in the same view group may have different ETags
-  xhr = CouchDB.request("GET", "/test_suite_db/_design/etags/_view/fooView");
-  var etag1 = xhr.getResponseHeader("etag");
-  xhr = CouchDB.request("GET", "/test_suite_db/_design/etags/_view/withReduce");
-  var etag2 = xhr.getResponseHeader("etag");
-  T(etag1 != etag2);
-
-  // verify ETag changes when an update changes the view group's index
-  db.bulkSave(makeDocs(20, 30));
-  xhr = CouchDB.request("GET", "/test_suite_db/_design/etags/_view/withReduce");
-  var etag1 = xhr.getResponseHeader("etag");
-  T(etag1 != etag);
-
-  // verify ETag is the same after a restart
-  restartServer();
-  xhr = CouchDB.request("GET", "/test_suite_db/_design/etags/_view/withReduce");
-  var etag2 = xhr.getResponseHeader("etag");
-  T(etag1 == etag2);
-
-  // confirm ETag changes with different POST bodies
-  xhr = CouchDB.request("POST", "/test_suite_db/_design/etags/_view/basicView",
-    {body: JSON.stringify({keys:[1]})}
-  );
-  var etag1 = xhr.getResponseHeader("etag");
-  xhr = CouchDB.request("POST", "/test_suite_db/_design/etags/_view/basicView",
-    {body: JSON.stringify({keys:[2]})}
-  );
-  var etag2 = xhr.getResponseHeader("etag");
-  T(etag1 != etag2, "POST to map view generates key-depdendent ETags");
-
-  xhr = CouchDB.request("POST",
-    "/test_suite_db/_design/etags/_view/withReduce?group=true",
-    {body: JSON.stringify({keys:[1]})}
-  );
-  etag1 = xhr.getResponseHeader("etag");
-  xhr = CouchDB.request("POST",
-    "/test_suite_db/_design/etags/_view/withReduce?group=true",
-    {body: JSON.stringify({keys:[2]})}
-  );
-  etag2 = xhr.getResponseHeader("etag");
-  T(etag1 != etag2, "POST to reduce view generates key-depdendent ETags");
-  
-  // all docs
-  xhr = CouchDB.request("GET", "/test_suite_db/_all_docs");
-  T(xhr.status == 200);
-  var etag = xhr.getResponseHeader("etag");
-  xhr = CouchDB.request("GET", "/test_suite_db/_all_docs", {
-    headers: {"if-none-match": etag}
-  });
-  T(xhr.status == 304);
-
-  // _changes
-  xhr = CouchDB.request("GET", "/test_suite_db/_changes");
-  T(xhr.status == 200);
-  var etag = xhr.getResponseHeader("etag");
-  xhr = CouchDB.request("GET", "/test_suite_db/_changes", {
-    headers: {"if-none-match": etag}
-  });
-  T(xhr.status == 304);
-
-  // list etag
-  // in the list test for now
-  
-  // A new database should have unique _all_docs etags. 
-  db.deleteDb(); 
-  db.createDb(); 
-  db.save({a: 1}); 
-  xhr = CouchDB.request("GET", "/test_suite_db/_all_docs"); 
-  var etag = xhr.getResponseHeader("etag"); 
-  db.deleteDb(); 
-  db.createDb(); 
-  db.save({a: 2}); 
-  xhr = CouchDB.request("GET", "/test_suite_db/_all_docs"); 
-  var new_etag = xhr.getResponseHeader("etag");
-  T(etag != new_etag);
-  // but still be cacheable
-  xhr = CouchDB.request("GET", "/test_suite_db/_all_docs"); 
-  T(new_etag == xhr.getResponseHeader("etag"));
-  
-};

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/www/script/test/form_submit.js
----------------------------------------------------------------------
diff --git a/share/www/script/test/form_submit.js b/share/www/script/test/form_submit.js
deleted file mode 100644
index 710bf47..0000000
--- a/share/www/script/test/form_submit.js
+++ /dev/null
@@ -1,25 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
-// Do some basic tests.
-couchTests.form_submit = function(debug) {
-    var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"});
-    db.deleteDb();
-    db.createDb();
-
-    var json = "{}";
-    var xhr = CouchDB.request("POST", "/test_suite_db/baz", {body: json});
-    T(xhr.status == 415);
-    result = JSON.parse(xhr.responseText);
-    T(result.error, "bad_content_type");
-    T(result.reason, "Invalid Content-Type header for form upload");
-};

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/www/script/test/http.js
----------------------------------------------------------------------
diff --git a/share/www/script/test/http.js b/share/www/script/test/http.js
deleted file mode 100644
index 5f46af5..0000000
--- a/share/www/script/test/http.js
+++ /dev/null
@@ -1,54 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
-couchTests.http = function(debug) {
-  var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"});
-  db.deleteDb();
-
-  // bug COUCHDB-100: DELETE on non-existent DB returns 500 instead of 404
-  db.deleteDb();
-
-  db.createDb();
-
-  // PUT on existing DB should return 412 instead of 500
-  if (debug) debugger;
-
-  var xhr = CouchDB.request("PUT", "/test_suite_db/test", {body: "{}"});
-  var host = CouchDB.host;
-
-  TEquals(CouchDB.protocol + host + "/test_suite_db/test", 
-    xhr.getResponseHeader("Location"),
-    "should include ip address");
-
-  xhr = CouchDB.request("PUT", "/test_suite_db/test2", {
-    body: "{}",
-    headers: {"X-Forwarded-Host": "mysite.com"}
-  });
-
-  TEquals(CouchDB.protocol + "mysite.com/test_suite_db/test2",
-    xhr.getResponseHeader("Location"),
-    "should include X-Forwarded-Host");
-
-  run_on_modified_server([{
-    section:"httpd",
-    key:"x_forwarded_host",
-    value:"X-Host"}],
-    function() {
-      xhr = CouchDB.request("PUT", "/test_suite_db/test3", {
-        body: "{}",
-        headers: {"X-Host": "mysite2.com"}
-      });
-      TEquals(CouchDB.protocol + "mysite2.com/test_suite_db/test3",
-        xhr.getResponseHeader("Location"),
-        "should include X-Host");
-    });
-}

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/www/script/test/invalid_docids.js
----------------------------------------------------------------------
diff --git a/share/www/script/test/invalid_docids.js b/share/www/script/test/invalid_docids.js
deleted file mode 100644
index d0195b0..0000000
--- a/share/www/script/test/invalid_docids.js
+++ /dev/null
@@ -1,77 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
-couchTests.invalid_docids = function(debug) {
-  var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"});
-  db.deleteDb();
-  db.createDb();
-  if (debug) debugger;
-
-  // Test _local explicitly first.
-  T(db.save({"_id": "_local/foo"}).ok);
-  T(db.open("_local/foo")._id == "_local/foo");
-
-  var urls = [
-      "/test_suite_db/_local",
-      "/test_suite_db/_local/",
-      "/test_suite_db/_local%2F",
-      "/test_suite_db/_local/foo/bar",
-  ];
-
-  urls.forEach(function(u) {
-    var res = db.request("PUT", u, {"body": "{}"});
-    T(res.status == 400);
-    T(JSON.parse(res.responseText).error == "bad_request");
-  });
-
-  //Test non-string
-  try {
-    db.save({"_id": 1});
-    T(1 == 0, "doc id must be string");
-  } catch(e) {
-      T(db.last_req.status == 400);
-      T(e.error == "bad_request");
-  }
-
-  // Via PUT with _id not in body.
-  var res = res = db.request("PUT", "/test_suite_db/_other", {"body": "{}"});
-  T(res.status == 400);
-  T(JSON.parse(res.responseText).error == "bad_request");
-
-  // Accidental POST to form handling code.
-  res = db.request("POST", "/test_suite_db/_tmp_view", {"body": "{}"});
-  T(res.status == 400);
-  T(JSON.parse(res.responseText).error == "bad_request");
-
-  // Test invalid _prefix
-  try {
-    db.save({"_id": "_invalid"});
-    T(1 == 0, "doc id may not start with underscore");
-  } catch(e) {
-      T(db.last_req.status == 400);
-      T(e.error == "bad_request");
-  }
-
-  // Test _bulk_docs explicitly.
-  var docs = [{"_id": "_design/foo"}, {"_id": "_local/bar"}];
-  db.bulkSave(docs);
-  docs.forEach(function(d) {T(db.open(d._id)._id == d._id);});
-
-  docs = [{"_id": "_invalid"}];
-  try {
-    db.bulkSave(docs);
-    T(1 == 0, "doc id may not start with underscore, even in bulk docs");
-  } catch(e) {
-      T(db.last_req.status == 400);
-      T(e.error == "bad_request");
-  }
-};

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/www/script/test/jsonp.js
----------------------------------------------------------------------
diff --git a/share/www/script/test/jsonp.js b/share/www/script/test/jsonp.js
deleted file mode 100644
index e4f4490..0000000
--- a/share/www/script/test/jsonp.js
+++ /dev/null
@@ -1,84 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
-// Verify callbacks ran
-var jsonp_flag = 0;
-
-// Callbacks
-function jsonp_no_chunk(doc) {
-  T(jsonp_flag == 0);
-  T(doc._id == "0");
-  jsonp_flag = 1;
-}
-
-function jsonp_chunk(doc) {
-  T(jsonp_flag == 0);
-  T(doc.total_rows == 1);
-  jsonp_flag = 1;
-}
-
-// Do some jsonp tests.
-couchTests.jsonp = function(debug) {
-  var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"});
-  db.deleteDb();
-  db.createDb();
-  if (debug) debugger;
-  
-  var doc = {_id:"0",a:0,b:0};
-  T(db.save(doc).ok);
-  
-  // callback param is ignored unless jsonp is configured
-  var xhr = CouchDB.request("GET", "/test_suite_db/0?callback=jsonp_not_configured");
-  JSON.parse(xhr.responseText);
-
-  run_on_modified_server(
-    [{section: "httpd",
-      key: "allow_jsonp",
-      value: "true"}],
-  function() {
-
-    // Test unchunked callbacks.
-    var xhr = CouchDB.request("GET", "/test_suite_db/0?callback=jsonp_no_chunk");
-    TEquals("application/javascript", xhr.getResponseHeader("Content-Type"));
-    T(xhr.status == 200);
-    jsonp_flag = 0;
-    eval(xhr.responseText);
-    T(jsonp_flag == 1);
-    xhr = CouchDB.request("GET", "/test_suite_db/0?callback=foo\"");
-    T(xhr.status == 400);
-
-    // Test chunked responses
-    var doc = {_id:"1",a:1,b:1};
-    T(db.save(doc).ok);
-
-    var designDoc = {
-      _id:"_design/test",
-      language: "javascript",
-      views: {
-        all_docs: {map: "function(doc) {if(doc.a) emit(null, doc.a);}"}
-      }
-    };
-    T(db.save(designDoc).ok);
-
-    var url = "/test_suite_db/_design/test/_view/all_docs?callback=jsonp_chunk";
-    xhr = CouchDB.request("GET", url);
-    TEquals("application/javascript", xhr.getResponseHeader("Content-Type"));
-    T(xhr.status == 200);
-    jsonp_flag = 0;
-    eval(xhr.responseText);
-    T(jsonp_flag == 1);
-    xhr = CouchDB.request("GET", url + "\'");
-    T(xhr.status == 400);
-  });
-
-
-};

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/www/script/test/large_docs.js
----------------------------------------------------------------------
diff --git a/share/www/script/test/large_docs.js b/share/www/script/test/large_docs.js
deleted file mode 100644
index b84648b..0000000
--- a/share/www/script/test/large_docs.js
+++ /dev/null
@@ -1,33 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
-couchTests.large_docs = function(debug) {
-  var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"});
-  db.deleteDb();
-  db.createDb();
-  if (debug) debugger;
-
-  var longtext = "0123456789\n";
-
-  for (var i=0; i<10; i++) {
-    longtext = longtext + longtext
-  }
-  T(db.save({"longtest":longtext}).ok);
-  T(db.save({"longtest":longtext}).ok);
-  T(db.save({"longtest":longtext}).ok);
-  T(db.save({"longtest":longtext}).ok);
-
-  // query all documents, and return the doc.foo member as a key.
-  results = db.query(function(doc){
-      emit(null, doc.longtest);
-  });
-};

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/www/script/test/list_views.js
----------------------------------------------------------------------
diff --git a/share/www/script/test/list_views.js b/share/www/script/test/list_views.js
deleted file mode 100644
index ece81ea..0000000
--- a/share/www/script/test/list_views.js
+++ /dev/null
@@ -1,492 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
-couchTests.list_views = function(debug) {
-  var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"});
-  db.deleteDb();
-  db.createDb();
-  if (debug) debugger;
-
-  var designDoc = {
-    _id:"_design/lists",
-    language: "javascript",
-    views : {
-      basicView : {
-        map : stringFun(function(doc) {
-          emit(doc.integer, doc.string);
-        })
-      },
-      withReduce : {
-        map : stringFun(function(doc) {
-          emit(doc.integer, doc.string);
-        }),
-        reduce : stringFun(function(keys, values, rereduce) {
-          if (rereduce) {
-            return sum(values);
-          } else {
-            return values.length;
-          }
-        })
-      }
-    },
-    lists: {
-      basicBasic : stringFun(function(head, req) {
-        send("head");
-        var row;
-        while(row = getRow()) {
-          log("row: "+toJSON(row));
-          send(row.key);
-        };
-        return "tail";
-      }),
-      basicJSON : stringFun(function(head, req) {
-        start({"headers":{"Content-Type" : "application/json"}});
-        send('{"head":'+toJSON(head)+', ');
-        send('"req":'+toJSON(req)+', ');
-        send('"rows":[');
-        var row, sep = '';
-        while (row = getRow()) {
-          send(sep + toJSON(row));
-          sep = ', ';
-        }
-        return "]}";
-      }),
-      simpleForm: stringFun(function(head, req) {
-        log("simpleForm");
-        send('<ul>');
-        var row, row_number = 0, prevKey, firstKey = null;
-        while (row = getRow()) {
-          row_number += 1;
-          if (!firstKey) firstKey = row.key;
-          prevKey = row.key;
-          send('\n<li>Key: '+row.key
-          +' Value: '+row.value
-          +' LineNo: '+row_number+'</li>');
-        }
-        return '</ul><p>FirstKey: '+ firstKey + ' LastKey: '+ prevKey+'</p>';
-      }),
-      acceptSwitch: stringFun(function(head, req) {
-        // respondWith takes care of setting the proper headers
-        provides("html", function() {
-          send("HTML <ul>");
-
-          var row, num = 0;
-          while (row = getRow()) {
-            num ++;
-            send('\n<li>Key: '
-              +row.key+' Value: '+row.value
-              +' LineNo: '+num+'</li>');
-          }
-
-          // tail
-          return '</ul>';
-        });
-      }),
-      qsParams: stringFun(function(head, req) {
-        return toJSON(req.query) + "\n";
-      }),
-      stopIter: stringFun(function(req) {
-        send("head");
-        var row, row_number = 0;
-        while(row = getRow()) {
-          if(row_number > 2) break;
-          send(" " + row_number);
-          row_number += 1;
-        };
-        return " tail";
-      }),
-      stopIter2: stringFun(function(head, req) {
-        provides("html", function() {
-          send("head");
-          var row, row_number = 0;
-          while(row = getRow()) {
-            if(row_number > 2) break;
-            send(" " + row_number);
-            row_number += 1;
-          };
-          return " tail";
-        });
-      }),
-      tooManyGetRows : stringFun(function() {
-        send("head");
-        var row;
-        while(row = getRow()) {
-          send(row.key);
-        };
-        getRow();
-        getRow();
-        getRow();
-        row = getRow();
-        return "after row: "+toJSON(row);
-      }),
-      emptyList: stringFun(function() {
-        return " ";
-      }),
-      rowError : stringFun(function(head, req) {
-        send("head");
-        var row = getRow();
-        send(fooBarBam); // intentional error
-        return "tail";
-      }),
-      docReference : stringFun(function(head, req) {
-        send("head");
-        var row = getRow();
-        send(row.doc.integer);
-        return "tail";
-      }),
-      secObj: stringFun(function(head, req) {
-        return toJSON(req.secObj);
-      }),
-      setHeaderAfterGotRow: stringFun(function(head, req) {
-        getRow();
-        start({
-          code: 400,
-          headers: {
-            "X-My-Header": "MyHeader"
-          }
-        });
-        send("bad request");
-      }),
-      allDocs: stringFun(function(head, req){
-        start({'headers': {'Content-Type': 'application/json'}});
-        var resp = head;
-        var rows = [];
-        while(row=getRow()){
-          rows.push(row);
-        }
-        resp.rows = rows;
-        return toJSON(resp);
-      })
-    }
-  };
-  var viewOnlyDesignDoc = {
-    _id:"_design/views",
-    language: "javascript",
-    views : {
-      basicView : {
-        map : stringFun(function(doc) {
-          emit(-doc.integer, doc.string);
-        })
-      }
-    }
-  };
-  var erlListDoc = {
-    _id: "_design/erlang",
-    language: "erlang",
-    lists: {
-        simple:
-            'fun(Head, {Req}) -> ' +
-            '  Send(<<"[">>), ' +
-            '  Fun = fun({Row}, Sep) -> ' +
-            '    Val = couch_util:get_value(<<"key">>, Row, 23), ' +
-            '    Send(list_to_binary(Sep ++ integer_to_list(Val))), ' +
-            '    {ok, ","} ' +
-            '  end, ' +
-            '  {ok, _} = FoldRows(Fun, ""), ' +
-            '  Send(<<"]">>) ' +
-            'end.'
-    }
-  };
-
-  T(db.save(designDoc).ok);
-
-  var docs = makeDocs(0, 10);
-  db.bulkSave(docs);
-
-  var view = db.view('lists/basicView');
-  T(view.total_rows == 10);
-
-  // standard get
-  var xhr = CouchDB.request("GET", "/test_suite_db/_design/lists/_list/basicBasic/basicView");
-  T(xhr.status == 200, "standard get should be 200");
-  T(/head0123456789tail/.test(xhr.responseText));
-
-  // standard options
-  var xhr = CouchDB.request("OPTIONS", "/test_suite_db/_design/lists/_list/basicBasic/basicView");
-  T(xhr.status == 200, "standard get should be 200");
-  T(/head0123456789tail/.test(xhr.responseText));
-
-  // test that etags are available
-  var etag = xhr.getResponseHeader("etag");
-  xhr = CouchDB.request("GET", "/test_suite_db/_design/lists/_list/basicBasic/basicView", {
-    headers: {"if-none-match": etag}
-  });
-  T(xhr.status == 304);
-  
-  // confirm ETag changes with different POST bodies
-  xhr = CouchDB.request("POST", "/test_suite_db/_design/lists/_list/basicBasic/basicView",
-    {body: JSON.stringify({keys:[1]})}
-  );
-  var etag1 = xhr.getResponseHeader("etag");
-  xhr = CouchDB.request("POST", "/test_suite_db/_design/lists/_list/basicBasic/basicView",
-    {body: JSON.stringify({keys:[2]})}
-  );
-  var etag2 = xhr.getResponseHeader("etag");
-  T(etag1 != etag2, "POST to map _list generates key-depdendent ETags");
-
-  // test the richness of the arguments
-  xhr = CouchDB.request("GET", "/test_suite_db/_design/lists/_list/basicJSON/basicView?update_seq=true");
-  T(xhr.status == 200, "standard get should be 200");
-  var resp = JSON.parse(xhr.responseText);
-  TEquals(10, resp.head.total_rows);
-  TEquals(0, resp.head.offset);
-  TEquals(11, resp.head.update_seq);
-  
-  T(resp.rows.length == 10);
-  TEquals(resp.rows[0], {"id": "0","key": 0,"value": "0"});
-
-  TEquals(resp.req.info.db_name, "test_suite_db");
-  TEquals(resp.req.method, "GET");
-  TEquals(resp.req.path, [
-      "test_suite_db",
-      "_design",
-      "lists",
-      "_list",
-      "basicJSON",
-      "basicView"
-  ]);
-  T(resp.req.headers.Accept);
-  T(resp.req.headers.Host);
-  T(resp.req.headers["User-Agent"]);
-  T(resp.req.cookie);
-  TEquals("/test_suite_db/_design/lists/_list/basicJSON/basicView?update_seq=true",
-    resp.req.raw_path, "should include raw path");
-
-  // get with query params
-  xhr = CouchDB.request("GET", "/test_suite_db/_design/lists/_list/simpleForm/basicView?startkey=3&endkey=8");
-  T(xhr.status == 200, "with query params");
-  T(!(/Key: 1/.test(xhr.responseText)));
-  T(/FirstKey: 3/.test(xhr.responseText));
-  T(/LastKey: 8/.test(xhr.responseText));
-
-  // with 0 rows
-  var xhr = CouchDB.request("GET", "/test_suite_db/_design/lists/_list/simpleForm/basicView?startkey=30");
-  T(xhr.status == 200, "0 rows");
-  T(/<\/ul>/.test(xhr.responseText));
-
-  //too many Get Rows
-  var xhr = CouchDB.request("GET", "/test_suite_db/_design/lists/_list/tooManyGetRows/basicView");
-  T(xhr.status == 200, "tooManyGetRows");
-  T(/9after row: null/.test(xhr.responseText));
-
-
-  // reduce with 0 rows
-  var xhr = CouchDB.request("GET", "/test_suite_db/_design/lists/_list/simpleForm/withReduce?startkey=30");
-  T(xhr.status == 200, "reduce 0 rows");
-  T(/LastKey: undefined/.test(xhr.responseText));
-
-  // when there is a reduce present, but not used
-  var xhr = CouchDB.request("GET", "/test_suite_db/_design/lists/_list/simpleForm/withReduce?reduce=false");
-  T(xhr.status == 200, "reduce false");
-  T(/Key: 1/.test(xhr.responseText));
-
-
-  // when there is a reduce present, and used
-  xhr = CouchDB.request("GET", "/test_suite_db/_design/lists/_list/simpleForm/withReduce?group=true");
-  T(xhr.status == 200, "group reduce");
-  T(/Key: 1/.test(xhr.responseText));
-
-  // there should be etags on reduce as well
-  var etag = xhr.getResponseHeader("etag");
-  T(etag, "Etags should be served with reduce lists");
-  xhr = CouchDB.request("GET", "/test_suite_db/_design/lists/_list/simpleForm/withReduce?group=true", {
-    headers: {"if-none-match": etag}
-  });
-  T(xhr.status == 304);
-
-  // confirm ETag changes with different POST bodies
-  xhr = CouchDB.request("POST", "/test_suite_db/_design/lists/_list/simpleForm/withReduce?group=true",
-    {body: JSON.stringify({keys:[1]})}
-  );
-  var etag1 = xhr.getResponseHeader("etag");
-  xhr = CouchDB.request("POST", "/test_suite_db/_design/lists/_list/simpleForm/withReduce?group=true",
-    {body: JSON.stringify({keys:[2]})}
-  );
-  var etag2 = xhr.getResponseHeader("etag");
-  T(etag1 != etag2, "POST to reduce _list generates key-depdendent ETags");
-
-  // verify the etags expire correctly
-  var docs = makeDocs(11, 12);
-  db.bulkSave(docs);
-
-  xhr = CouchDB.request("GET", "/test_suite_db/_design/lists/_list/simpleForm/withReduce?group=true", {
-    headers: {"if-none-match": etag}
-  });
-  T(xhr.status == 200, "reduce etag");
-
-  // empty list
-  var xhr = CouchDB.request("GET", "/test_suite_db/_design/lists/_list/emptyList/basicView");
-  T(xhr.responseText.match(/^ $/));
-  xhr = CouchDB.request("GET", "/test_suite_db/_design/lists/_list/emptyList/withReduce?group=true");
-  T(xhr.responseText.match(/^ $/));
-
-  // multi-key fetch
-  var xhr = CouchDB.request("POST", "/test_suite_db/_design/lists/_list/simpleForm/basicView", {
-    body: '{"keys":[2,4,5,7]}'
-  });
-  T(xhr.status == 200, "multi key");
-  T(!(/Key: 1 /.test(xhr.responseText)));
-  T(/Key: 2/.test(xhr.responseText));
-  T(/FirstKey: 2/.test(xhr.responseText));
-  T(/LastKey: 7/.test(xhr.responseText));
-
-  // multi-key fetch with GET
-  var xhr = CouchDB.request("GET", "/test_suite_db/_design/lists/_list/simpleForm/basicView" +
-    "?keys=[2,4,5,7]");
-
-  T(xhr.status == 200, "multi key");
-  T(!(/Key: 1 /.test(xhr.responseText)));
-  T(/Key: 2/.test(xhr.responseText));
-  T(/FirstKey: 2/.test(xhr.responseText));
-  T(/LastKey: 7/.test(xhr.responseText));
-
-  // no multi-key fetch allowed when group=false
-  xhr = CouchDB.request("POST", "/test_suite_db/_design/lists/_list/simpleForm/withReduce?group=false", {
-    body: '{"keys":[2,4,5,7]}'
-  });
-  T(xhr.status == 400);
-  T(/query_parse_error/.test(xhr.responseText));
-
-  var xhr = CouchDB.request("GET", "/test_suite_db/_design/lists/_list/rowError/basicView");
-  T(/ReferenceError/.test(xhr.responseText));
-
-
-  // with include_docs and a reference to the doc.
-  var xhr = CouchDB.request("GET", "/test_suite_db/_design/lists/_list/docReference/basicView?include_docs=true");
-  T(xhr.responseText.match(/head0tail/));
-
-  // now with extra qs params
-  var xhr = CouchDB.request("GET", "/test_suite_db/_design/lists/_list/qsParams/basicView?foo=blam");
-  T(xhr.responseText.match(/blam/));
-
-  var xhr = CouchDB.request("GET", "/test_suite_db/_design/lists/_list/stopIter/basicView");
-  // T(xhr.getResponseHeader("Content-Type") == "text/plain");
-  T(xhr.responseText.match(/^head 0 1 2 tail$/) && "basic stop");
-
-  xhr = CouchDB.request("GET", "/test_suite_db/_design/lists/_list/stopIter2/basicView", {
-    headers : {
-      "Accept" : "text/html"
-    }
-  });
-  T(xhr.responseText.match(/^head 0 1 2 tail$/) && "stop 2");
-
-  // aborting iteration with reduce
-  var xhr = CouchDB.request("GET", "/test_suite_db/_design/lists/_list/stopIter/withReduce?group=true");
-  T(xhr.responseText.match(/^head 0 1 2 tail$/) && "reduce stop");
-  xhr = CouchDB.request("GET", "/test_suite_db/_design/lists/_list/stopIter2/withReduce?group=true", {
-    headers : {
-      "Accept" : "text/html"
-    }
-  });
-  T(xhr.responseText.match(/^head 0 1 2 tail$/) && "reduce stop 2");
-
-  // with accept headers for HTML
-  xhr = CouchDB.request("GET", "/test_suite_db/_design/lists/_list/acceptSwitch/basicView", {
-    headers: {
-      "Accept": 'text/html'
-    }
-  });
-  T(xhr.getResponseHeader("Content-Type") == "text/html; charset=utf-8");
-  T(xhr.responseText.match(/HTML/));
-  T(xhr.responseText.match(/Value/));
-
-  // Test we can run lists and views from separate docs.
-  T(db.save(viewOnlyDesignDoc).ok);
-  var url = "/test_suite_db/_design/lists/_list/simpleForm/views/basicView" +
-                "?startkey=-3";
-  xhr = CouchDB.request("GET", url);
-  T(xhr.status == 200, "multiple design docs.");
-  T(!(/Key: -4/.test(xhr.responseText)));
-  T(/FirstKey: -3/.test(xhr.responseText));
-  T(/LastKey: 0/.test(xhr.responseText));
-
-  // Test we do multi-key requests on lists and views in separate docs.
-  var url = "/test_suite_db/_design/lists/_list/simpleForm/views/basicView";
-  xhr = CouchDB.request("POST", url, {
-    body: '{"keys":[-2,-4,-5,-7]}'
-  });
-  
-  T(xhr.status == 200, "multi key separate docs");
-  T(!(/Key: -3/.test(xhr.responseText)));
-  T(/Key: -7/.test(xhr.responseText));
-  T(/FirstKey: -2/.test(xhr.responseText));
-  T(/LastKey: -7/.test(xhr.responseText));
-
-    // Test if secObj is available
-  var xhr = CouchDB.request("GET", "/test_suite_db/_design/lists/_list/secObj/basicView");
-  T(xhr.status == 200, "standard get should be 200");
-  var resp = JSON.parse(xhr.responseText);
-  T(typeof(resp) == "object");
-
-  var erlViewTest = function() {
-    T(db.save(erlListDoc).ok);
-    var url = "/test_suite_db/_design/erlang/_list/simple/views/basicView" +
-                "?startkey=-3";
-    xhr = CouchDB.request("GET", url);
-    T(xhr.status == 200, "multiple languages in design docs.");
-    var list = JSON.parse(xhr.responseText);
-    T(list.length == 4);
-    for(var i = 0; i < list.length; i++)
-    {
-        T(list[i] + 3 == i);
-    }
-  };
-
-  run_on_modified_server([{
-    section: "native_query_servers",
-    key: "erlang",
-    value: "{couch_native_process, start_link, []}"
-  }], erlViewTest);
-
-  // COUCHDB-1113
-  var ddoc = {
-    _id: "_design/test",
-    views: {
-      me: {
-        map: (function(doc) { emit(null,null)}).toString()
-      }
-    },
-    lists: {
-      you: (function(head, req) {
-        var row;
-        while(row = getRow()) {
-          send(row);
-        }
-      }).toString()
-    }
-  };
-  db.save(ddoc);
-
-  var resp = CouchDB.request("GET", "/" + db.name + "/_design/test/_list/you/me", {
-    headers: {
-      "Content-Type": "application/x-www-form-urlencoded"
-    }
-  });
-  TEquals(200, resp.status, "should return a 200 response");
-
-  // TEST HTTP header response set after getRow() called in _list function.
-  var xhr = CouchDB.request("GET", "/test_suite_db/_design/lists/_list/setHeaderAfterGotRow/basicView");
-  T(xhr.status == 400);
-  T(xhr.getResponseHeader("X-My-Header") == "MyHeader");
-  T(xhr.responseText.match(/^bad request$/));
-
-  // test handling _all_docs by _list functions. the result should be equal
-  var xhr_lAllDocs = CouchDB.request("GET", "/test_suite_db/_design/lists/_list/allDocs/_all_docs");
-  T(xhr_lAllDocs.status == 200, "standard get should be 200");
-  var xhr_allDocs = CouchDB.request("GET", "/test_suite_db/_all_docs");
-  var allDocs = JSON.parse(xhr_allDocs.responseText);
-  var lAllDocs = JSON.parse(xhr_lAllDocs.responseText);
-  TEquals(allDocs.total_rows, lAllDocs.total_rows, "total_rows mismatch");
-  TEquals(allDocs.offset, lAllDocs.offset, "offset mismatch");
-  TEquals(allDocs.rows.length, lAllDocs.rows.length, "amount of rows mismatch");
-  TEquals(allDocs.rows, lAllDocs.rows, "rows mismatch");
-};


[22/37] goodbye Futon, old friend <3

Posted by ja...@apache.org.
http://git-wip-us.apache.org/repos/asf/couchdb/blob/cca309f3/share/www/script/jquery.resizer.js
----------------------------------------------------------------------
diff --git a/share/www/script/jquery.resizer.js b/share/www/script/jquery.resizer.js
deleted file mode 100644
index 42f0cc7..0000000
--- a/share/www/script/jquery.resizer.js
+++ /dev/null
@@ -1,84 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
-(function($) {
-
-  $.fn.makeResizable = function(options) {
-    options = options || {};
-    options.always = options.always || false;
-    options.grippie = options.grippie || null;
-    options.horizontal = options.horizontal || false;
-    options.minWidth = options.minWidth || 100;
-    options.maxWidth = options.maxWidth || null;
-    options.vertical = options.vertical || false;
-    options.minHeight = options.minHeight || 32;
-    options.maxHeight = options.maxHeight || null;
-
-    return this.each(function() {
-      if ($(this).is("textarea") && !options.always &&
-          $.browser.safari && parseInt($.browser.version) >= 522)
-        return this; // safari3 and later provides textarea resizing natively
-
-      var grippie = options.grippie;
-      if (!grippie) grippie = $("<div></div>").appendTo(this.parentNode);
-      grippie.addClass("grippie");
-      if (options.horizontal && options.vertical) {
-        grippie.css("cursor", "nwse-resize");
-      } else if (options.horizontal) {
-        grippie.css("cursor", "col-resize");
-      } else if (options.vertical) {
-        grippie.css("cursor", "row-resize");
-      }
-
-      var elem = $(this);
-      grippie.mousedown(function(e) {
-        var pos = {x: e.screenX, y: e.screenY};
-        var dimensions = {width: elem.width(), height: elem.height()};
-        $(document)
-          .mousemove(function(e) {
-            if (options.horizontal) {
-              var offset = e.screenX - pos.x;
-              if (offset) {
-                var newWidth = dimensions.width + offset;
-                if (newWidth >= options.minWidth &&
-                    (!options.maxWidth || newWidth <= options.maxWidth)) {
-                  elem.width(newWidth);
-                  dimensions.width = newWidth;
-                }
-                pos.x = e.screenX;
-              }
-            }
-            if (options.vertical) {
-              var offset = e.screenY - pos.y;
-              if (offset) {
-                var newHeight = dimensions.height + offset;
-                if (newHeight >= options.minHeight &&
-                    (!options.maxHeight || newHeight <= options.maxHeight)) {
-                  elem.height(newHeight);
-                  dimensions.height = newHeight;
-                }
-                pos.y = e.screenY;
-              }
-            }
-            document.onselectstart = function() { return false }; // for IE
-            return false;
-          })
-          .one("mouseup", function() {
-            $(document).unbind("mousemove");
-            document.onselectstart = null; // for IE
-          });
-        return true;
-      });
-    });
-  }
-
-})(jQuery);

http://git-wip-us.apache.org/repos/asf/couchdb/blob/cca309f3/share/www/script/jquery.suggest.js
----------------------------------------------------------------------
diff --git a/share/www/script/jquery.suggest.js b/share/www/script/jquery.suggest.js
deleted file mode 100644
index cad020d..0000000
--- a/share/www/script/jquery.suggest.js
+++ /dev/null
@@ -1,161 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
-(function($) {
-
-  function suggest(elem, options) {
-    var timer = null;
-    var prevVal = null;
-    var cache = {};
-    var cacheKeys = [];
-
-    var input = $(elem).attr("autocomplete", "off");
-    var dropdown = $('<ul style="display: none; position: absolute; z-index: 10000"></ul>')
-      .addClass(options.dropdownClass).appendTo(document.body);
-
-    input
-      .blur(function() {
-        if (timer) clearTimeout(timer);
-        setTimeout(function() { dropdown.hide() }, 200);
-      })
-      .keydown(function(e) {
-        if ($.inArray(e.keyCode, [16, 17, 18, 20, 144, 91, 93, 224]) != -1) {
-          return; // ignore modifier keys
-        }
-        if (timer) clearTimeout(timer);
-        if ($.inArray(e.keyCode, [38, 40]) != -1 ||
-            (dropdown.is(":visible") && (e.keyCode == 27 ||
-             ($.inArray(e.keyCode, [9, 13]) != -1 && getSelection())))) {
-          switch(e.keyCode) {
-            case 38: // up
-              moveUp();
-              break;
-            case 40: // down
-              moveDown();
-              break;
-            case 9:  // tab
-            case 13: // return
-              commit();
-              if (e.keyCode == 9) return true;
-              break;
-            case 27: // escape
-              dropdown.hide();
-              break;
-          }
-          e.preventDefault(); e.stopPropagation();
-          return false;
-        } else {
-          timer = setTimeout(function() { suggest() }, options.delay);
-        }
-      });
-
-    function suggest(force) {
-      var newVal = $.trim(input.val());
-      if (force || newVal != prevVal) {
-        if (force || newVal.length >= options.minChars) {
-          if (options.cache && cache.hasOwnProperty(newVal)) {
-            show(cache[newVal].items, cache[newVal].render);
-          } else {
-            options.callback.apply(elem, [newVal, function(items, render) {
-              if (options.cache) {
-                if (cacheKeys.length >= options.cacheLimit) {
-                  delete cache[cacheKeys.shift()];
-                }
-                cache[newVal] = {items: items, render: render};
-                cacheKeys.push(newVal);
-              }
-              show(items, render);
-            }]);
-          }
-        } else {
-          dropdown.hide();
-        }
-        prevVal = newVal;
-      }
-    }
-
-    function show(items, render) {
-      if (!items) return;
-      if (!items.length) { dropdown.hide(); return; }
-      var offset = input.offset();
-      dropdown.empty().css({
-        top: (offset.top + input.outerHeight()) + "px", left: offset.left + "px",
-        minWidth: input.css("width")
-      });
-      render = render || function(idx, value) { return value; }
-      for (var i = 0; i < items.length; i++) {
-        var item = $("<li></li>").data("value", items[i]);
-        var rendered = render(i, items[i]);
-        if (typeof(rendered) == "string") {
-          item.text(rendered);
-        } else {
-          item.append(rendered);
-        }
-        item.appendTo(dropdown);
-      }
-      dropdown.slideDown("fast");
-      dropdown.children("li").click(function(e) {
-        $(this).addClass("selected");
-        commit();
-      });
-    }
-
-    function commit() {
-      var sel = getSelection();
-      if (sel) {
-        prevVal = sel.data("value");
-        input.val(prevVal);
-        if (options.select) {
-          options.select.apply(elem, [prevVal]);
-        }
-        dropdown.hide();
-      }
-      if (timer) clearTimeout(timer)
-    }
-
-    function getSelection() {
-      if (!dropdown.is(":visible")) return null;
-      var sel = dropdown.children("li.selected");
-      return sel.length ? sel : null;
-    }
-
-    function moveDown() {
-      if (!dropdown.is(":visible")) suggest(true);
-      var sel = getSelection();
-      if (sel) sel.removeClass("selected").next().addClass("selected");
-      else dropdown.children("li:first-child").addClass("selected");
-    }
-
-    function moveUp() {
-      if (!dropdown.is(":visible")) suggest(true);
-      var sel = getSelection();
-      if (sel) sel.removeClass("selected").prev().addClass("selected");
-      else dropdown.children("li:last-child").addClass("selected");
-    }
-  }
-
-  $.fn.suggest = function(callback, options) {
-    options = $.extend({
-      cache: true,
-      cacheLimit: 10,
-      callback: callback,
-      delay: 250,
-      dropdownClass: "suggest-dropdown",
-      minChars: 1,
-      select: null
-    }, options || {});
-    return this.each(function() {
-      suggest(this, options);
-    });
-  };
-
-})(jQuery);

http://git-wip-us.apache.org/repos/asf/couchdb/blob/cca309f3/share/www/script/json2.js
----------------------------------------------------------------------
diff --git a/share/www/script/json2.js b/share/www/script/json2.js
deleted file mode 100644
index a1a3b17..0000000
--- a/share/www/script/json2.js
+++ /dev/null
@@ -1,482 +0,0 @@
-/*
-    http://www.JSON.org/json2.js
-    2010-03-20
-
-    Public Domain.
-
-    NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
-
-    See http://www.JSON.org/js.html
-
-
-    This code should be minified before deployment.
-    See http://javascript.crockford.com/jsmin.html
-
-    USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO
-    NOT CONTROL.
-
-
-    This file creates a global JSON object containing two methods: stringify
-    and parse.
-
-        JSON.stringify(value, replacer, space)
-            value       any JavaScript value, usually an object or array.
-
-            replacer    an optional parameter that determines how object
-                        values are stringified for objects. It can be a
-                        function or an array of strings.
-
-            space       an optional parameter that specifies the indentation
-                        of nested structures. If it is omitted, the text will
-                        be packed without extra whitespace. If it is a number,
-                        it will specify the number of spaces to indent at each
-                        level. If it is a string (such as '\t' or '&nbsp;'),
-                        it contains the characters used to indent at each level.
-
-            This method produces a JSON text from a JavaScript value.
-
-            When an object value is found, if the object contains a toJSON
-            method, its toJSON method will be called and the result will be
-            stringified. A toJSON method does not serialize: it returns the
-            value represented by the name/value pair that should be serialized,
-            or undefined if nothing should be serialized. The toJSON method
-            will be passed the key associated with the value, and this will be
-            bound to the value
-
-            For example, this would serialize Dates as ISO strings.
-
-                Date.prototype.toJSON = function (key) {
-                    function f(n) {
-                        // Format integers to have at least two digits.
-                        return n < 10 ? '0' + n : n;
-                    }
-
-                    return this.getUTCFullYear()   + '-' +
-                         f(this.getUTCMonth() + 1) + '-' +
-                         f(this.getUTCDate())      + 'T' +
-                         f(this.getUTCHours())     + ':' +
-                         f(this.getUTCMinutes())   + ':' +
-                         f(this.getUTCSeconds())   + 'Z';
-                };
-
-            You can provide an optional replacer method. It will be passed the
-            key and value of each member, with this bound to the containing
-            object. The value that is returned from your method will be
-            serialized. If your method returns undefined, then the member will
-            be excluded from the serialization.
-
-            If the replacer parameter is an array of strings, then it will be
-            used to select the members to be serialized. It filters the results
-            such that only members with keys listed in the replacer array are
-            stringified.
-
-            Values that do not have JSON representations, such as undefined or
-            functions, will not be serialized. Such values in objects will be
-            dropped; in arrays they will be replaced with null. You can use
-            a replacer function to replace those with JSON values.
-            JSON.stringify(undefined) returns undefined.
-
-            The optional space parameter produces a stringification of the
-            value that is filled with line breaks and indentation to make it
-            easier to read.
-
-            If the space parameter is a non-empty string, then that string will
-            be used for indentation. If the space parameter is a number, then
-            the indentation will be that many spaces.
-
-            Example:
-
-            text = JSON.stringify(['e', {pluribus: 'unum'}]);
-            // text is '["e",{"pluribus":"unum"}]'
-
-
-            text = JSON.stringify(['e', {pluribus: 'unum'}], null, '\t');
-            // text is '[\n\t"e",\n\t{\n\t\t"pluribus": "unum"\n\t}\n]'
-
-            text = JSON.stringify([new Date()], function (key, value) {
-                return this[key] instanceof Date ?
-                    'Date(' + this[key] + ')' : value;
-            });
-            // text is '["Date(---current time---)"]'
-
-
-        JSON.parse(text, reviver)
-            This method parses a JSON text to produce an object or array.
-            It can throw a SyntaxError exception.
-
-            The optional reviver parameter is a function that can filter and
-            transform the results. It receives each of the keys and values,
-            and its return value is used instead of the original value.
-            If it returns what it received, then the structure is not modified.
-            If it returns undefined then the member is deleted.
-
-            Example:
-
-            // Parse the text. Values that look like ISO date strings will
-            // be converted to Date objects.
-
-            myData = JSON.parse(text, function (key, value) {
-                var a;
-                if (typeof value === 'string') {
-                    a =
-/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)Z$/.exec(value);
-                    if (a) {
-                        return new Date(Date.UTC(+a[1], +a[2] - 1, +a[3], +a[4],
-                            +a[5], +a[6]));
-                    }
-                }
-                return value;
-            });
-
-            myData = JSON.parse('["Date(09/09/2001)"]', function (key, value) {
-                var d;
-                if (typeof value === 'string' &&
-                        value.slice(0, 5) === 'Date(' &&
-                        value.slice(-1) === ')') {
-                    d = new Date(value.slice(5, -1));
-                    if (d) {
-                        return d;
-                    }
-                }
-                return value;
-            });
-
-
-    This is a reference implementation. You are free to copy, modify, or
-    redistribute.
-*/
-
-/*jslint evil: true, strict: false */
-
-/*members "", "\b", "\t", "\n", "\f", "\r", "\"", JSON, "\\", apply,
-    call, charCodeAt, getUTCDate, getUTCFullYear, getUTCHours,
-    getUTCMinutes, getUTCMonth, getUTCSeconds, hasOwnProperty, join,
-    lastIndex, length, parse, prototype, push, replace, slice, stringify,
-    test, toJSON, toString, valueOf
-*/
-
-
-// Create a JSON object only if one does not already exist. We create the
-// methods in a closure to avoid creating global variables.
-
-if (!this.JSON) {
-    this.JSON = {};
-}
-
-(function () {
-
-    function f(n) {
-        // Format integers to have at least two digits.
-        return n < 10 ? '0' + n : n;
-    }
-
-    if (typeof Date.prototype.toJSON !== 'function') {
-
-        Date.prototype.toJSON = function (key) {
-
-            return isFinite(this.valueOf()) ?
-                   this.getUTCFullYear()   + '-' +
-                 f(this.getUTCMonth() + 1) + '-' +
-                 f(this.getUTCDate())      + 'T' +
-                 f(this.getUTCHours())     + ':' +
-                 f(this.getUTCMinutes())   + ':' +
-                 f(this.getUTCSeconds())   + 'Z' : null;
-        };
-
-        String.prototype.toJSON =
-        Number.prototype.toJSON =
-        Boolean.prototype.toJSON = function (key) {
-            return this.valueOf();
-        };
-    }
-
-    var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
-        escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
-        gap,
-        indent,
-        meta = {    // table of character substitutions
-            '\b': '\\b',
-            '\t': '\\t',
-            '\n': '\\n',
-            '\f': '\\f',
-            '\r': '\\r',
-            '"' : '\\"',
-            '\\': '\\\\'
-        },
-        rep;
-
-
-    function quote(string) {
-
-// If the string contains no control characters, no quote characters, and no
-// backslash characters, then we can safely slap some quotes around it.
-// Otherwise we must also replace the offending characters with safe escape
-// sequences.
-
-        escapable.lastIndex = 0;
-        return escapable.test(string) ?
-            '"' + string.replace(escapable, function (a) {
-                var c = meta[a];
-                return typeof c === 'string' ? c :
-                    '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
-            }) + '"' :
-            '"' + string + '"';
-    }
-
-
-    function str(key, holder) {
-
-// Produce a string from holder[key].
-
-        var i,          // The loop counter.
-            k,          // The member key.
-            v,          // The member value.
-            length,
-            mind = gap,
-            partial,
-            value = holder[key];
-
-// If the value has a toJSON method, call it to obtain a replacement value.
-
-        if (value && typeof value === 'object' &&
-                typeof value.toJSON === 'function') {
-            value = value.toJSON(key);
-        }
-
-// If we were called with a replacer function, then call the replacer to
-// obtain a replacement value.
-
-        if (typeof rep === 'function') {
-            value = rep.call(holder, key, value);
-        }
-
-// What happens next depends on the value's type.
-
-        switch (typeof value) {
-        case 'string':
-            return quote(value);
-
-        case 'number':
-
-// JSON numbers must be finite. Encode non-finite numbers as null.
-
-            return isFinite(value) ? String(value) : 'null';
-
-        case 'boolean':
-        case 'null':
-
-// If the value is a boolean or null, convert it to a string. Note:
-// typeof null does not produce 'null'. The case is included here in
-// the remote chance that this gets fixed someday.
-
-            return String(value);
-
-// If the type is 'object', we might be dealing with an object or an array or
-// null.
-
-        case 'object':
-
-// Due to a specification blunder in ECMAScript, typeof null is 'object',
-// so watch out for that case.
-
-            if (!value) {
-                return 'null';
-            }
-
-// Make an array to hold the partial results of stringifying this object value.
-
-            gap += indent;
-            partial = [];
-
-// Is the value an array?
-
-            if (Object.prototype.toString.apply(value) === '[object Array]') {
-
-// The value is an array. Stringify every element. Use null as a placeholder
-// for non-JSON values.
-
-                length = value.length;
-                for (i = 0; i < length; i += 1) {
-                    partial[i] = str(i, value) || 'null';
-                }
-
-// Join all of the elements together, separated with commas, and wrap them in
-// brackets.
-
-                v = partial.length === 0 ? '[]' :
-                    gap ? '[\n' + gap +
-                            partial.join(',\n' + gap) + '\n' +
-                                mind + ']' :
-                          '[' + partial.join(',') + ']';
-                gap = mind;
-                return v;
-            }
-
-// If the replacer is an array, use it to select the members to be stringified.
-
-            if (rep && typeof rep === 'object') {
-                length = rep.length;
-                for (i = 0; i < length; i += 1) {
-                    k = rep[i];
-                    if (typeof k === 'string') {
-                        v = str(k, value);
-                        if (v) {
-                            partial.push(quote(k) + (gap ? ': ' : ':') + v);
-                        }
-                    }
-                }
-            } else {
-
-// Otherwise, iterate through all of the keys in the object.
-
-                for (k in value) {
-                    if (Object.hasOwnProperty.call(value, k)) {
-                        v = str(k, value);
-                        if (v) {
-                            partial.push(quote(k) + (gap ? ': ' : ':') + v);
-                        }
-                    }
-                }
-            }
-
-// Join all of the member texts together, separated with commas,
-// and wrap them in braces.
-
-            v = partial.length === 0 ? '{}' :
-                gap ? '{\n' + gap + partial.join(',\n' + gap) + '\n' +
-                        mind + '}' : '{' + partial.join(',') + '}';
-            gap = mind;
-            return v;
-        }
-    }
-
-// If the JSON object does not yet have a stringify method, give it one.
-
-    if (typeof JSON.stringify !== 'function') {
-        JSON.stringify = function (value, replacer, space) {
-
-// The stringify method takes a value and an optional replacer, and an optional
-// space parameter, and returns a JSON text. The replacer can be a function
-// that can replace values, or an array of strings that will select the keys.
-// A default replacer method can be provided. Use of the space parameter can
-// produce text that is more easily readable.
-
-            var i;
-            gap = '';
-            indent = '';
-
-// If the space parameter is a number, make an indent string containing that
-// many spaces.
-
-            if (typeof space === 'number') {
-                for (i = 0; i < space; i += 1) {
-                    indent += ' ';
-                }
-
-// If the space parameter is a string, it will be used as the indent string.
-
-            } else if (typeof space === 'string') {
-                indent = space;
-            }
-
-// If there is a replacer, it must be a function or an array.
-// Otherwise, throw an error.
-
-            rep = replacer;
-            if (replacer && typeof replacer !== 'function' &&
-                    (typeof replacer !== 'object' ||
-                     typeof replacer.length !== 'number')) {
-                throw new Error('JSON.stringify');
-            }
-
-// Make a fake root object containing our value under the key of ''.
-// Return the result of stringifying the value.
-
-            return str('', {'': value});
-        };
-    }
-
-
-// If the JSON object does not yet have a parse method, give it one.
-
-    if (typeof JSON.parse !== 'function') {
-        JSON.parse = function (text, reviver) {
-
-// The parse method takes a text and an optional reviver function, and returns
-// a JavaScript value if the text is a valid JSON text.
-
-            var j;
-
-            function walk(holder, key) {
-
-// The walk method is used to recursively walk the resulting structure so
-// that modifications can be made.
-
-                var k, v, value = holder[key];
-                if (value && typeof value === 'object') {
-                    for (k in value) {
-                        if (Object.hasOwnProperty.call(value, k)) {
-                            v = walk(value, k);
-                            if (v !== undefined) {
-                                value[k] = v;
-                            } else {
-                                delete value[k];
-                            }
-                        }
-                    }
-                }
-                return reviver.call(holder, key, value);
-            }
-
-
-// Parsing happens in four stages. In the first stage, we replace certain
-// Unicode characters with escape sequences. JavaScript handles many characters
-// incorrectly, either silently deleting them, or treating them as line endings.
-
-            text = String(text);
-            cx.lastIndex = 0;
-            if (cx.test(text)) {
-                text = text.replace(cx, function (a) {
-                    return '\\u' +
-                        ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
-                });
-            }
-
-// In the second stage, we run the text against regular expressions that look
-// for non-JSON patterns. We are especially concerned with '()' and 'new'
-// because they can cause invocation, and '=' because it can cause mutation.
-// But just to be safe, we want to reject all unexpected forms.
-
-// We split the second stage into 4 regexp operations in order to work around
-// crippling inefficiencies in IE's and Safari's regexp engines. First we
-// replace the JSON backslash pairs with '@' (a non-JSON character). Second, we
-// replace all simple value tokens with ']' characters. Third, we delete all
-// open brackets that follow a colon or comma or that begin the text. Finally,
-// we look to see that the remaining characters are only whitespace or ']' or
-// ',' or ':' or '{' or '}'. If that is so, then the text is safe for eval.
-
-            if (/^[\],:{}\s]*$/.
-test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@').
-replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']').
-replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) {
-
-// In the third stage we use the eval function to compile the text into a
-// JavaScript structure. The '{' operator is subject to a syntactic ambiguity
-// in JavaScript: it can begin a block or an object literal. We wrap the text
-// in parens to eliminate the ambiguity.
-
-                j = eval('(' + text + ')');
-
-// In the optional fourth stage, we recursively walk the new structure, passing
-// each name/value pair to a reviver function for possible transformation.
-
-                return typeof reviver === 'function' ?
-                    walk({'': j}, '') : j;
-            }
-
-// If the text is not JSON parseable, then a SyntaxError is thrown.
-
-            throw new SyntaxError('JSON.parse');
-        };
-    }
-}());

http://git-wip-us.apache.org/repos/asf/couchdb/blob/cca309f3/share/www/script/jspec/jspec.css
----------------------------------------------------------------------
diff --git a/share/www/script/jspec/jspec.css b/share/www/script/jspec/jspec.css
deleted file mode 100644
index 629d41c..0000000
--- a/share/www/script/jspec/jspec.css
+++ /dev/null
@@ -1,149 +0,0 @@
-body.jspec {
-  margin: 45px 0;
-  font: 12px "Helvetica Neue Light", "Lucida Grande", "Calibri", "Arial", sans-serif;
-  background: #efefef url(images/bg.png) top left repeat-x;
-  text-align: center;
-}
-#jspec {
-  margin: 0 auto;
-  padding-top: 30px;
-  width: 1008px;
-  background: url(images/vr.png) top left repeat-y;
-  text-align: left;
-}
-#jspec-top {
-  position: relative;
-  margin: 0 auto;
-  width: 1008px;
-  height: 40px;
-  background: url(images/sprites.bg.png) top left no-repeat;
-}
-#jspec-bottom {
-  margin: 0 auto;
-  width: 1008px;
-  height: 15px;
-  background: url(images/sprites.bg.png) bottom left no-repeat;
-}
-#jspec .loading {
-  margin-top: -45px;
-  width: 1008px;
-  height: 80px;
-  background: url(images/loading.gif) 50% 50% no-repeat;
-}
-#jspec-title {
-  position: absolute;
-  top: 15px;
-  left: 20px;
-  width: 160px;
-  font-size: 22px;
-  font-weight: normal;
-  background: url(images/sprites.png) 0 -126px no-repeat;
-  text-align: center;
-}
-#jspec-title em {
-  font-size: 10px;
-  font-style: normal;
-  color: #BCC8D1;
-}
-#jspec-report * {
-	margin: 0;
-	padding: 0;
-	background: none;
-	border: none;
-}
-#jspec-report {
-  padding: 15px 40px;
-	font: 11px "Helvetica Neue Light", "Lucida Grande", "Calibri", "Arial", sans-serif;
-	color: #7B8D9B;
-}
-#jspec-report.has-failures {
-  padding-bottom: 30px;
-}
-#jspec-report .hidden {
-  display: none;
-}
-#jspec-report .heading {
-  margin-bottom: 15px;
-}
-#jspec-report .heading span {
-  padding-right: 10px;
-}
-#jspec-report .heading .passes em {
-  color: #0ea0eb;
-}
-#jspec-report .heading .failures em {
-  color: #FA1616;
-}
-#jspec-report table {
-  font-size: 11px;
-  border-collapse: collapse;
-}
-#jspec-report td {
-  padding: 8px;
-  text-indent: 30px;
-  color: #7B8D9B;
-}
-#jspec-report tr.body {
-  display: none;
-}
-#jspec-report tr.body pre {
-  margin: 0;
-  padding: 0 0 5px 25px;
-}
-#jspec-report tr.even:hover + tr.body, 
-#jspec-report tr.odd:hover + tr.body {
-  display: block;
-}
-#jspec-report tr td:first-child em {
-	display: block;
-	clear: both;
-  font-style: normal;
-  font-weight: normal;
-  color: #7B8D9B;
-}
-#jspec-report tr.even:hover, 
-#jspec-report tr.odd:hover {
-  text-shadow: 1px 1px 1px #fff;
-  background: #F2F5F7;
-}
-#jspec-report td + td {
-  padding-right: 0;
-  width: 15px;
-}
-#jspec-report td.pass {
-  background: url(images/sprites.png) 3px -7px no-repeat;
-}
-#jspec-report td.fail {
-  background: url(images/sprites.png) 3px -158px no-repeat;
-  font-weight: bold;
-  color: #FC0D0D;
-}
-#jspec-report td.requires-implementation {
-  background: url(images/sprites.png) 3px -333px no-repeat;
-}
-#jspec-report tr.description td {
-  margin-top: 25px;
-  padding-top: 25px;
-  font-size: 12px;
-  font-weight: bold;
-  text-indent: 0;
-  color: #1a1a1a;
-}
-#jspec-report tr.description:first-child td {
-  border-top: none;  
-}
-#jspec-report .assertion {
-  display: block;
-  float: left;
-  margin: 0 0 0 1px;
-  padding: 0;
-  width: 1px;
-  height: 5px;
-  background: #7B8D9B;
-}
-#jspec-report .assertion.failed {
-  background: red;
-}
-.jspec-sandbox {
-  display: none;
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/couchdb/blob/cca309f3/share/www/script/jspec/jspec.jquery.js
----------------------------------------------------------------------
diff --git a/share/www/script/jspec/jspec.jquery.js b/share/www/script/jspec/jspec.jquery.js
deleted file mode 100644
index fcad7ab..0000000
--- a/share/www/script/jspec/jspec.jquery.js
+++ /dev/null
@@ -1,72 +0,0 @@
-
-// JSpec - jQuery - Copyright TJ Holowaychuk <tj...@vision-media.ca> (MIT Licensed)
-
-JSpec
-.requires('jQuery', 'when using jspec.jquery.js')
-.include({
-  name: 'jQuery',
-  
-  // --- Initialize
-  
-  init : function() {
-    jQuery.ajaxSetup({ async: false })
-  },
-  
-  // --- Utilities
-  
-  utilities : {
-    element:  jQuery,
-    elements: jQuery,
-    sandbox : function() {
-      return jQuery('<div class="sandbox"></div>')
-    }
-  },
-  
-  // --- Matchers
-  
-  matchers : {
-    have_tag      : "jQuery(expected, actual).length === 1",
-    have_one      : "alias have_tag",
-    have_tags     : "jQuery(expected, actual).length > 1",
-    have_many     : "alias have_tags",
-    have_any      : "alias have_tags",
-    have_child    : "jQuery(actual).children(expected).length === 1",
-    have_children : "jQuery(actual).children(expected).length > 1",
-    have_text     : "jQuery(actual).text() === expected",
-    have_value    : "jQuery(actual).val() === expected",
-    be_enabled    : "!jQuery(actual).attr('disabled')",
-    have_class    : "jQuery(actual).hasClass(expected)",
-    
-    be_visible : function(actual) {
-      return jQuery(actual).css('display') != 'none' &&
-             jQuery(actual).css('visibility') != 'hidden' &&
-             jQuery(actual).attr('type') != 'hidden'
-    },
-    
-    be_hidden : function(actual) {
-      return !JSpec.does(actual, 'be_visible')
-    },
-
-    have_classes : function(actual) {
-      return !JSpec.any(JSpec.toArray(arguments, 1), function(arg){
-        return !JSpec.does(actual, 'have_class', arg)
-      })
-    },
-
-    have_attr : function(actual, attr, value) {
-      return value ? jQuery(actual).attr(attr) == value:
-                     jQuery(actual).attr(attr)
-    },
-    
-    'be disabled selected checked' : function(attr) {
-      return 'jQuery(actual).attr("' + attr + '")'
-    },
-    
-    'have type id title alt href src sel rev name target' : function(attr) {
-      return function(actual, value) {
-        return JSpec.does(actual, 'have_attr', attr, value)
-      }
-    }
-  }
-})
-

http://git-wip-us.apache.org/repos/asf/couchdb/blob/cca309f3/share/www/script/jspec/jspec.js
----------------------------------------------------------------------
diff --git a/share/www/script/jspec/jspec.js b/share/www/script/jspec/jspec.js
deleted file mode 100644
index b2ea476..0000000
--- a/share/www/script/jspec/jspec.js
+++ /dev/null
@@ -1,1756 +0,0 @@
-
-// JSpec - Core - Copyright TJ Holowaychuk <tj...@vision-media.ca> (MIT Licensed)
-
-;(function(){
-
-  JSpec = {
-    version   : '3.3.2',
-    assert    : true,
-    cache     : {},
-    suites    : [],
-    modules   : [],
-    allSuites : [],
-    matchers  : {},
-    stubbed   : [],
-    options   : {},
-    request   : 'XMLHttpRequest' in this ? XMLHttpRequest : null,
-    stats     : { specs: 0, assertions: 0, failures: 0, passes: 0, specsFinished: 0, suitesFinished: 0 },
-
-    /**
-     * Default context in which bodies are evaluated.
-     *
-     * Replace context simply by setting JSpec.context
-     * to your own like below:
-     *
-     * JSpec.context = { foo : 'bar' }
-     *
-     * Contexts can be changed within any body, this can be useful
-     * in order to provide specific helper methods to specific suites.
-     *
-     * To reset (usually in after hook) simply set to null like below:
-     *
-     * JSpec.context = null
-     *
-     */
-
-     defaultContext : {
-      
-      /**
-       * Return an object used for proxy assertions. 
-       * This object is used to indicate that an object
-       * should be an instance of _object_, not the constructor
-       * itself.
-       *
-       * @param  {function} constructor
-       * @return {hash}
-       * @api public
-       */
-      
-      an_instance_of : function(constructor) {
-        return { an_instance_of : constructor }
-      },
-      
-      /**
-       * Load fixture at _path_.
-       *
-       * Fixtures are resolved as:
-       *
-       *  - <path>
-       *  - <path>.html
-       *
-       * @param  {string} path
-       * @return {string}
-       * @api public
-       */
-      
-      fixture : function(path) {
-        if (JSpec.cache[path]) return JSpec.cache[path]
-        return JSpec.cache[path] = 
-          JSpec.tryLoading(JSpec.options.fixturePath + '/' + path) ||
-          JSpec.tryLoading(JSpec.options.fixturePath + '/' + path + '.html')
-      }
-    },
-
-    // --- Objects
-    
-    reporters : {
-      
-      /**
-       * Report to server.
-       * 
-       * Options:
-       *  - uri           specific uri to report to.
-       *  - verbose       weither or not to output messages
-       *  - failuresOnly  output failure messages only
-       *
-       * @api public
-       */
-      
-      Server : function(results, options) {
-        var uri = options.uri || window.location.protocol + "//" + window.location.host + '/results'
-        JSpec.post(uri, {
-          stats: JSpec.stats,
-          options: options,
-          results: map(results.allSuites, function(suite) {
-            if (suite.hasSpecs())
-              return {
-                description: suite.description,
-                specs: map(suite.specs, function(spec) {
-                  return {
-                    description: spec.description,
-                    message: !spec.passed() ? spec.failure().message : null,
-                    status: spec.requiresImplementation() ? 'pending' :
-                              spec.passed() ? 'pass' :
-                                'fail',
-                    assertions: map(spec.assertions, function(assertion){
-                      return {
-                        passed: assertion.passed  
-                      }
-                    })
-                  }
-                })
-              }
-          })
-        })
-  			if ('close' in main) main.close()
-      },
-
-      /**
-       * Default reporter, outputting to the DOM.
-       *
-       * Options:
-       *   - reportToId    id of element to output reports to, defaults to 'jspec'
-       *   - failuresOnly  displays only suites with failing specs
-       *
-       * @api public
-       */
-
-      DOM : function(results, options) {
-        var id = option('reportToId') || 'jspec',
-            report = document.getElementById(id),
-            failuresOnly = option('failuresOnly'),
-            classes = results.stats.failures ? 'has-failures' : ''
-        if (!report) throw 'JSpec requires the element #' + id + ' to output its reports'
-        
-        function bodyContents(body) {
-          return JSpec.
-            escape(JSpec.contentsOf(body)).
-            replace(/^ */gm, function(a){ return (new Array(Math.round(a.length / 3))).join(' ') }).
-            replace(/\r\n|\r|\n/gm, '<br/>')
-        }
-        
-        report.innerHTML = '<div id="jspec-report" class="' + classes + '"><div class="heading"> \
-        <span class="passes">Passes: <em>' + results.stats.passes + '</em></span>                \
-        <span class="failures">Failures: <em>' + results.stats.failures + '</em></span>          \
-        <span class="passes">Duration: <em>' + results.duration + '</em> ms</span>          \
-        </div><table class="suites">' + map(results.allSuites, function(suite) {
-          var displaySuite = failuresOnly ? suite.ran && !suite.passed() : suite.ran
-          if (displaySuite && suite.hasSpecs())
-            return '<tr class="description"><td colspan="2">' + escape(suite.description) + '</td></tr>' +
-              map(suite.specs, function(i, spec) {
-                return '<tr class="' + (i % 2 ? 'odd' : 'even') + '">' +
-                  (spec.requiresImplementation() ?
-                    '<td class="requires-implementation" colspan="2">' + escape(spec.description) + '</td>' :
-                      (spec.passed() && !failuresOnly) ?
-                        '<td class="pass">' + escape(spec.description)+ '</td><td>' + spec.assertionsGraph() + '</td>' :
-                          !spec.passed() ?
-                            '<td class="fail">' + escape(spec.description) + 
-  													map(spec.failures(), function(a){ return '<em>' + escape(a.message) + '</em>' }).join('') +
- 														'</td><td>' + spec.assertionsGraph() + '</td>' :
-                              '') +
-                  '<tr class="body"><td colspan="2"><pre>' + bodyContents(spec.body) + '</pre></td></tr>'
-              }).join('') + '</tr>'
-        }).join('') + '</table></div>'
-      },
-      
-      /**
-       * Terminal reporter.
-       *
-       * @api public
-       */
-       
-       Terminal : function(results, options) {
-         var failuresOnly = option('failuresOnly')
-         print(color("\n Passes: ", 'bold') + color(results.stats.passes, 'green') + 
-               color(" Failures: ", 'bold') + color(results.stats.failures, 'red') +
-               color(" Duration: ", 'bold') + color(results.duration, 'green') + " ms \n")
-              
-         function indent(string) {
-           return string.replace(/^(.)/gm, '  $1')
-         }
-         
-         each(results.allSuites, function(suite) {
-           var displaySuite = failuresOnly ? suite.ran && !suite.passed() : suite.ran
-            if (displaySuite && suite.hasSpecs()) {
-              print(color(' ' + suite.description, 'bold'))
-              each(suite.specs, function(spec){
-                var assertionsGraph = inject(spec.assertions, '', function(graph, assertion){
-                  return graph + color('.', assertion.passed ? 'green' : 'red')
-                })
-                if (spec.requiresImplementation())
-                  print(color('  ' + spec.description, 'blue') + assertionsGraph)
-                else if (spec.passed() && !failuresOnly)
-                  print(color('  ' + spec.description, 'green') + assertionsGraph)
-                else if (!spec.passed())
-                  print(color('  ' + spec.description, 'red') + assertionsGraph + 
-                        "\n" + indent(map(spec.failures(), function(a){ return a.message }).join("\n")) + "\n")
-              })
-              print("")
-            }
-         })
-         
-         quit(results.stats.failures)
-       }
-    },
-    
-    Assertion : function(matcher, actual, expected, negate) {
-      extend(this, {
-        message: '',
-        passed: false,
-        actual: actual,
-        negate: negate,
-        matcher: matcher,
-        expected: expected,
-        
-        // Report assertion results
-        
-        report : function() {
-          if (JSpec.assert) 
-            this.passed ? JSpec.stats.passes++ : JSpec.stats.failures++
-          return this
-        },
-        
-        // Run the assertion
-        
-        run : function() {
-          // TODO: remove unshifting 
-          expected.unshift(actual)
-          this.result = matcher.match.apply(this, expected)
-          this.passed = negate ? !this.result : this.result
-          if (!this.passed) this.message = matcher.message.call(this, actual, expected, negate, matcher.name)
-          return this
-        }
-      })
-    },
-    
-    ProxyAssertion : function(object, method, times, negate) {
-      var self = this
-      var old = object[method]
-      
-      // Proxy
-      
-      object[method] = function(){
-        args = toArray(arguments)
-        result = old.apply(object, args)
-        self.calls.push({ args : args, result : result })
-        return result
-      }
-      
-      // Times
-      
-      this.times = {
-        once  : 1,
-        twice : 2
-      }[times] || times || 1
-      
-      extend(this, {
-        calls: [],
-        message: '',
-        defer: true,
-        passed: false,
-        negate: negate,
-        object: object,
-        method: method,
-        
-        // Proxy return value
-        
-        and_return : function(result) {
-          this.expectedResult = result
-          return this
-        },
-        
-        // Proxy arguments passed
-        
-        with_args : function() {
-          this.expectedArgs = toArray(arguments)
-          return this
-        },
-        
-        // Check if any calls have failing results
-        
-        anyResultsFail : function() {
-          return any(this.calls, function(call){
-            return self.expectedResult.an_instance_of ?
-                     call.result.constructor != self.expectedResult.an_instance_of:
-                       !equal(self.expectedResult, call.result)
-          })
-        },
-        
-        // Check if any calls have passing results
-        
-        anyResultsPass : function() {
-          return any(this.calls, function(call){
-            return self.expectedResult.an_instance_of ?
-                     call.result.constructor == self.expectedResult.an_instance_of:
-                       equal(self.expectedResult, call.result)
-          })
-        },
-        
-        // Return the passing result
-        
-        passingResult : function() {
-          return this.anyResultsPass().result
-        },
-
-        // Return the failing result
-        
-        failingResult : function() {
-          return this.anyResultsFail().result
-        },
-        
-        // Check if any arguments fail
-        
-        anyArgsFail : function() {
-          return any(this.calls, function(call){
-            return any(self.expectedArgs, function(i, arg){
-              if (arg == null) return call.args[i] == null
-              return arg.an_instance_of ?
-                       call.args[i].constructor != arg.an_instance_of:
-                         !equal(arg, call.args[i])
-                       
-            })
-          })
-        },
-        
-        // Check if any arguments pass
-        
-        anyArgsPass : function() {
-          return any(this.calls, function(call){
-            return any(self.expectedArgs, function(i, arg){
-              return arg.an_instance_of ?
-                       call.args[i].constructor == arg.an_instance_of:
-                         equal(arg, call.args[i])
-                       
-            })
-          })
-        },
-        
-        // Return the passing args
-        
-        passingArgs : function() {
-          return this.anyArgsPass().args
-        },
-                
-        // Return the failing args
-        
-        failingArgs : function() {
-          return this.anyArgsFail().args
-        },
-        
-        // Report assertion results
-        
-        report : function() {
-          if (JSpec.assert) 
-            this.passed ? ++JSpec.stats.passes : ++JSpec.stats.failures
-          return this
-        },
-        
-        // Run the assertion
-                
-        run : function() {
-          var methodString = 'expected ' + object.toString() + '.' + method + '()' + (negate ? ' not' : '' )
-          
-          function times(n) {
-            return n > 2 ?  n + ' times' : { 1: 'once', 2: 'twice' }[n]
-          }
-          
-          if (this.expectedResult != null && (negate ? this.anyResultsPass() : this.anyResultsFail()))
-            this.message = methodString + ' to return ' + puts(this.expectedResult) + 
-              ' but ' + (negate ? 'it did' : 'got ' + puts(this.failingResult())) 
-
-          if (this.expectedArgs && (negate ? !this.expectedResult && this.anyArgsPass() : this.anyArgsFail()))
-            this.message = methodString + ' to be called with ' + puts.apply(this, this.expectedArgs) +
-             ' but was' + (negate ? '' : ' called with ' + puts.apply(this, this.failingArgs()))
-
-          if (negate ? !this.expectedResult && !this.expectedArgs && this.calls.length >= this.times : this.calls.length != this.times)
-            this.message = methodString + ' to be called ' + times(this.times) + 
-            ', but ' +  (this.calls.length == 0 ? ' was not called' : ' was called ' + times(this.calls.length))
-                
-          if (!this.message.length) 
-            this.passed = true
-          
-          return this
-        }
-      })
-    },
-      
-    /**
-     * Specification Suite block object.
-     *
-     * @param {string} description
-     * @param {function} body
-     * @api private
-     */
-
-    Suite : function(description, body) {
-      var self = this
-      extend(this, {
-        body: body,
-        description: description,
-        suites: [],
-        specs: [],
-        ran: false,
-        hooks: { 'before' : [], 'after' : [], 'before_each' : [], 'after_each' : [] },
-        
-        // Add a spec to the suite
-
-        addSpec : function(description, body) {
-          var spec = new JSpec.Spec(description, body)
-          this.specs.push(spec)
-          JSpec.stats.specs++ // TODO: abstract
-          spec.suite = this
-        },
-
-        // Add a hook to the suite
-
-        addHook : function(hook, body) {
-          this.hooks[hook].push(body)
-        },
-
-        // Add a nested suite
-
-        addSuite : function(description, body) {
-          var suite = new JSpec.Suite(description, body)
-          JSpec.allSuites.push(suite)
-          suite.name = suite.description
-          suite.description = this.description + ' ' + suite.description
-          this.suites.push(suite)
-          suite.suite = this
-        },
-
-        // Invoke a hook in context to this suite
-
-        hook : function(hook) {
-          if (this.suite) this.suite.hook(hook)
-          each(this.hooks[hook], function(body) {
-            JSpec.evalBody(body, "Error in hook '" + hook + "', suite '" + self.description + "': ")
-          })
-        },
-
-        // Check if nested suites are present
-
-        hasSuites : function() {
-          return this.suites.length  
-        },
-
-        // Check if this suite has specs
-
-        hasSpecs : function() {
-          return this.specs.length
-        },
-
-        // Check if the entire suite passed
-
-        passed : function() {
-          return !any(this.specs, function(spec){
-            return !spec.passed() 
-          })
-        }
-      })
-    },
-    
-    /**
-     * Specification block object.
-     *
-     * @param {string} description
-     * @param {function} body
-     * @api private
-     */
-
-    Spec : function(description, body) {
-      extend(this, {
-        body: body,
-        description: description,
-        assertions: [],
-        
-        // Add passing assertion
-        
-        pass : function(message) {
-          this.assertions.push({ passed: true, message: message })
-          if (JSpec.assert) ++JSpec.stats.passes
-        },
-        
-        // Add failing assertion
-        
-        fail : function(message) {
-          this.assertions.push({ passed: false, message: message })
-          if (JSpec.assert) ++JSpec.stats.failures
-        },
-                
-        // Run deferred assertions
-        
-        runDeferredAssertions : function() {
-          each(this.assertions, function(assertion){
-            if (assertion.defer) assertion.run().report(), hook('afterAssertion', assertion)
-          })
-        },
-        
-        // Find first failing assertion
-
-        failure : function() {
-          return find(this.assertions, function(assertion){
-            return !assertion.passed
-          })
-        },
-
-        // Find all failing assertions
-
-        failures : function() {
-          return select(this.assertions, function(assertion){
-            return !assertion.passed
-          })
-        },
-
-        // Weither or not the spec passed
-
-        passed : function() {
-          return !this.failure()
-        },
-
-        // Weither or not the spec requires implementation (no assertions)
-
-        requiresImplementation : function() {
-          return this.assertions.length == 0
-        },
-
-        // Sprite based assertions graph
-
-        assertionsGraph : function() {
-          return map(this.assertions, function(assertion){
-            return '<span class="assertion ' + (assertion.passed ? 'passed' : 'failed') + '"></span>'
-          }).join('')
-        }
-      })
-    },
-    
-    Module : function(methods) {
-      extend(this, methods)
-    },
-    
-    JSON : {
-      
-      /**
-       * Generic sequences.
-       */
-      
-      meta : {
-        '\b' : '\\b',
-        '\t' : '\\t',
-        '\n' : '\\n',
-        '\f' : '\\f',
-        '\r' : '\\r',
-        '"'  : '\\"',
-        '\\' : '\\\\'
-      },
-      
-      /**
-       * Escapable sequences.
-       */
-      
-      escapable : /[\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
-      
-      /**
-       * JSON encode _object_.
-       *
-       * @param  {mixed} object
-       * @return {string}
-       * @api private
-       */
-       
-      encode : function(object) {
-        var self = this
-        if (object == undefined || object == null) return 'null'
-        if (object === true) return 'true'
-        if (object === false) return 'false'
-        switch (typeof object) {
-          case 'number': return object
-          case 'string': return this.escapable.test(object) ?
-            '"' + object.replace(this.escapable, function (a) {
-              return typeof self.meta[a] === 'string' ? self.meta[a] :
-                '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4)
-            }) + '"' :
-            '"' + object + '"'
-          case 'object':  
-            if (object.constructor == Array)
-              return '[' + map(object, function(val){
-                return self.encode(val)
-              }).join(', ') + ']'
-            else if (object)
-              return '{' + map(object, function(key, val){
-                return self.encode(key) + ':' + self.encode(val)
-              }).join(', ') + '}'
-        }
-        return 'null'
-      }
-    },
-    
-    // --- DSLs
-    
-    DSLs : {
-      snake : {
-        expect : function(actual){
-          return JSpec.expect(actual)
-        },
-
-        describe : function(description, body) {
-          return JSpec.currentSuite.addSuite(description, body)
-        },
-
-        it : function(description, body) {
-          return JSpec.currentSuite.addSpec(description, body)
-        },
-
-        before : function(body) {
-          return JSpec.currentSuite.addHook('before', body)
-        },
-
-        after : function(body) {
-          return JSpec.currentSuite.addHook('after', body)
-        },
-
-        before_each : function(body) {
-          return JSpec.currentSuite.addHook('before_each', body)
-        },
-
-        after_each : function(body) {
-          return JSpec.currentSuite.addHook('after_each', body)
-        },
-        
-        should_behave_like : function(description) {
-          return JSpec.shareBehaviorsOf(description)
-        }
-      }
-    },
-
-    // --- Methods
-    
-    /**
-     * Check if _value_ is 'stop'. For use as a
-     * utility callback function.
-     *
-     * @param  {mixed} value
-     * @return {bool}
-     * @api public
-     */
-    
-    haveStopped : function(value) {
-      return value === 'stop'
-    },
-    
-    /**
-     * Include _object_ which may be a hash or Module instance.
-     *
-     * @param  {hash, Module} object
-     * @return {JSpec}
-     * @api public
-     */
-    
-    include : function(object) {
-      var module = object.constructor == JSpec.Module ? object : new JSpec.Module(object)
-      this.modules.push(module)
-      if ('init' in module) module.init()
-      if ('utilities' in module) extend(this.defaultContext, module.utilities)
-      if ('matchers' in module) this.addMatchers(module.matchers)
-      if ('reporters' in module) extend(this.reporters, module.reporters)
-      if ('DSLs' in module)
-        each(module.DSLs, function(name, methods){
-          JSpec.DSLs[name] = JSpec.DSLs[name] || {}
-          extend(JSpec.DSLs[name], methods)
-        })
-      return this
-    },
-    
-    /**
-     * Add a module hook _name_, which is immediately
-     * called per module with the _args_ given. An array of
-     * hook return values is returned.
-     *
-     * @param  {name} string
-     * @param  {...} args
-     * @return {array}
-     * @api private
-     */
-    
-    hook : function(name, args) {
-      args = toArray(arguments, 1)
-      return inject(JSpec.modules, [], function(results, module){
-        if (typeof module[name] == 'function')
-          results.push(JSpec.evalHook(module, name, args))
-      })
-    },
-    
-    /**
-     * Eval _module_ hook _name_ with _args_. Evaluates in context
-     * to the module itself, JSpec, and JSpec.context.
-     *
-     * @param  {Module} module
-     * @param  {string} name
-     * @param  {array} args
-     * @return {mixed}
-     * @api private
-     */
-    
-    evalHook : function(module, name, args) {
-      hook('evaluatingHookBody', module, name)
-      try { return module[name].apply(module, args) }
-      catch(e) { error('Error in hook ' + module.name + '.' + name + ': ', e) }
-    },
-    
-    /**
-     * Same as hook() however accepts only one _arg_ which is
-     * considered immutable. This function passes the arg
-     * to the first module, then passes the return value of the last
-     * module called, to the following module. 
-     *
-     * @param  {string} name
-     * @param  {mixed} arg
-     * @return {mixed}
-     * @api private
-     */
-    
-    hookImmutable : function(name, arg) {
-      return inject(JSpec.modules, arg, function(result, module){
-        if (typeof module[name] == 'function')
-          return JSpec.evalHook(module, name, [result])
-      })
-    },
-    
-    /**
-     * Find a suite by its description or name.
-     *
-     * @param  {string} description
-     * @return {Suite}
-     * @api private
-     */
-    
-    findSuite : function(description) {
-      return find(this.allSuites, function(suite){
-        return suite.name == description || suite.description == description
-      })
-    },
-    
-    /**
-     * Share behaviors (specs) of the given suite with
-     * the current suite.
-     *
-     * @param  {string} description
-     * @api public
-     */
-    
-    shareBehaviorsOf : function(description) {
-      if (suite = this.findSuite(description)) this.copySpecs(suite, this.currentSuite)
-      else throw 'failed to share behaviors. ' + puts(description) + ' is not a valid Suite name'
-    },
-    
-    /**
-     * Copy specs from one suite to another. 
-     *
-     * @param  {Suite} fromSuite
-     * @param  {Suite} toSuite
-     * @api public
-     */
-    
-    copySpecs : function(fromSuite, toSuite) {
-      each(fromSuite.specs, function(spec){
-        var newSpec = new Object();
-        extend(newSpec, spec);
-        newSpec.assertions = [];
-        toSuite.specs.push(newSpec);
-      })
-    },
-    
-    /**
-     * Convert arguments to an array.
-     *
-     * @param  {object} arguments
-     * @param  {int} offset
-     * @return {array}
-     * @api public
-     */
-    
-    toArray : function(arguments, offset) {
-      return Array.prototype.slice.call(arguments, offset || 0)
-    },
-    
-    /**
-     * Return ANSI-escaped colored string.
-     *
-     * @param  {string} string
-     * @param  {string} color
-     * @return {string}
-     * @api public
-     */
-    
-    color : function(string, color) {
-      return "\u001B[" + {
-       bold    : 1,
-       black   : 30,
-       red     : 31,
-       green   : 32,
-       yellow  : 33,
-       blue    : 34,
-       magenta : 35,
-       cyan    : 36,
-       white   : 37
-      }[color] + 'm' + string + "\u001B[0m"
-    },
-    
-    /**
-     * Default matcher message callback.
-     *
-     * @api private
-     */
-    
-    defaultMatcherMessage : function(actual, expected, negate, name) {
-      return 'expected ' + puts(actual) + ' to ' + 
-               (negate ? 'not ' : '') + 
-                  name.replace(/_/g, ' ') +
-                    ' ' + (expected.length > 1 ?
-                      puts.apply(this, expected.slice(1)) :
-                        '')
-    },
-    
-    /**
-     * Normalize a matcher message.
-     *
-     * When no messge callback is present the defaultMatcherMessage
-     * will be assigned, will suffice for most matchers.
-     *
-     * @param  {hash} matcher
-     * @return {hash}
-     * @api public
-     */
-    
-    normalizeMatcherMessage : function(matcher) {
-      if (typeof matcher.message != 'function') 
-        matcher.message = this.defaultMatcherMessage
-      return matcher
-    },
-    
-    /**
-     * Normalize a matcher body
-     * 
-     * This process allows the following conversions until
-     * the matcher is in its final normalized hash state.
-     *
-     * - '==' becomes 'actual == expected'
-     * - 'actual == expected' becomes 'return actual == expected'
-     * - function(actual, expected) { return actual == expected } becomes 
-     *   { match : function(actual, expected) { return actual == expected }}
-     *
-     * @param  {mixed} body
-     * @return {hash}
-     * @api public
-     */
-    
-    normalizeMatcherBody : function(body) {
-      switch (body.constructor) {
-        case String:
-          if (captures = body.match(/^alias (\w+)/)) return JSpec.matchers[last(captures)]
-          if (body.length < 4) body = 'actual ' + body + ' expected'
-          return { match: function(actual, expected) { return eval(body) }}  
-          
-        case Function:
-          return { match: body }
-          
-        default:
-          return body
-      }
-    },
-    
-    /**
-     * Get option value. This method first checks if
-     * the option key has been set via the query string,
-     * otherwise returning the options hash value.
-     *
-     * @param  {string} key
-     * @return {mixed}
-     * @api public
-     */
-     
-     option : function(key) {
-       return (value = query(key)) !== null ? value :
-                JSpec.options[key] || null
-     },
-     
-     /**
-      * Check if object _a_, is equal to object _b_.
-      *
-      * @param  {object} a
-      * @param  {object} b
-      * @return {bool}
-      * @api private
-      */
-     
-     equal: function(a, b) {
-       if (typeof a != typeof b) return
-       if (a === b) return true
-       if (a instanceof RegExp)
-         return a.toString() === b.toString()
-       if (a instanceof Date)
-         return Number(a) === Number(b)
-       if (typeof a != 'object') return
-       if (a.length !== undefined)
-         if (a.length !== b.length) return
-         else
-           for (var i = 0, len = a.length; i < len; ++i)
-             if (!equal(a[i], b[i]))
-               return
-       for (var key in a)
-         if (!equal(a[key], b[key]))
-           return
-       return true
-     },
-
-    /**
-     * Return last element of an array.
-     *
-     * @param  {array} array
-     * @return {object}
-     * @api public
-     */
-
-    last : function(array) {
-      return array[array.length - 1]
-    },
-
-    /**
-     * Convert object(s) to a print-friend string.
-     *
-     * @param  {...} object
-     * @return {string}
-     * @api public
-     */
-
-    puts : function(object) {
-      if (arguments.length > 1)
-        return map(toArray(arguments), function(arg){
-          return puts(arg)
-        }).join(', ')
-      if (object === undefined) return 'undefined'
-      if (object === null) return 'null'
-      if (object === true) return 'true'
-      if (object === false) return 'false'
-      if (object.an_instance_of) return 'an instance of ' + object.an_instance_of.name
-      if (object.jquery && object.selector.length > 0) return 'selector ' + puts(object.selector)
-      if (object.jquery) return object.get(0).outerHTML
-      if (object.nodeName) return object.outerHTML
-      switch (object.constructor) {
-        case Function: return object.name || object 
-        case String: 
-          return '"' + object
-            .replace(/"/g,  '\\"')
-            .replace(/\n/g, '\\n')
-            .replace(/\t/g, '\\t')
-            + '"'
-        case Array: 
-          return inject(object, '[', function(b, v){
-            return b + ', ' + puts(v)
-          }).replace('[,', '[') + ' ]'
-        case Object:
-          object.__hit__ = true
-          return inject(object, '{', function(b, k, v) {
-            if (k == '__hit__') return b
-            return b + ', ' + k + ': ' + (v && v.__hit__ ? '<circular reference>' : puts(v))
-          }).replace('{,', '{') + ' }'
-        default: 
-          return object.toString()
-      }
-    },
-
-    /**
-     * Escape HTML.
-     *
-     * @param  {string} html
-     * @return {string}
-     * @api public
-     */
-
-     escape : function(html) {
-       return html.toString()
-         .replace(/&/gmi, '&amp;')
-         .replace(/"/gmi, '&quot;')
-         .replace(/>/gmi, '&gt;')
-         .replace(/</gmi, '&lt;')
-     },
-     
-     /**
-      * Perform an assertion without reporting.
-      *
-      * This method is primarily used for internal
-      * matchers in order retain DRYness. May be invoked 
-      * like below:
-      *
-      *   does('foo', 'eql', 'foo')
-      *   does([1,2], 'include', 1, 2)
-      *
-      * External hooks are not run for internal assertions
-      * performed by does().
-      *
-      * @param  {mixed} actual
-      * @param  {string} matcher
-      * @param  {...} expected
-      * @return {mixed}
-      * @api private
-      */
-     
-     does : function(actual, matcher, expected) {
-       var assertion = new JSpec.Assertion(JSpec.matchers[matcher], actual, toArray(arguments, 2))
-       return assertion.run().result
-     },
-
-    /**
-     * Perform an assertion.
-     *
-     *   expect(true).to('be', true)
-     *   expect('foo').not_to('include', 'bar')
-     *   expect([1, [2]]).to('include', 1, [2])
-     *
-     * @param  {mixed} actual
-     * @return {hash}
-     * @api public
-     */
-
-    expect : function(actual) {
-      function assert(matcher, args, negate) {
-        var expected = toArray(args, 1)
-        matcher.negate = negate  
-        assertion = new JSpec.Assertion(matcher, actual, expected, negate)
-        hook('beforeAssertion', assertion)
-        if (matcher.defer) assertion.run()
-        else JSpec.currentSpec.assertions.push(assertion.run().report()), hook('afterAssertion', assertion)
-        return assertion.result
-      }
-      
-      function to(matcher) {
-        return assert(matcher, arguments, false)
-      }
-      
-      function not_to(matcher) {
-        return assert(matcher, arguments, true)
-      }
-      
-      return {
-        to : to,
-        should : to,
-        not_to: not_to,
-        should_not : not_to
-      }
-    },
-
-    /**
-     * Strim whitespace or chars.
-     *
-     * @param  {string} string
-     * @param  {string} chars
-     * @return {string}
-     * @api public
-     */
-
-     strip : function(string, chars) {
-       return string.
-         replace(new RegExp('['  + (chars || '\\s') + ']*$'), '').
-         replace(new RegExp('^[' + (chars || '\\s') + ']*'),  '')
-     },
-     
-     /**
-      * Call an iterator callback with arguments a, or b
-      * depending on the arity of the callback.
-      *
-      * @param  {function} callback
-      * @param  {mixed} a
-      * @param  {mixed} b
-      * @return {mixed}
-      * @api private
-      */
-     
-     callIterator : function(callback, a, b) {
-       return callback.length == 1 ? callback(b) : callback(a, b)
-     },
-     
-     /**
-      * Extend an object with another.
-      *
-      * @param  {object} object
-      * @param  {object} other
-      * @api public
-      */
-     
-     extend : function(object, other) {
-       each(other, function(property, value){
-         object[property] = value
-       })
-     },
-     
-     /**
-      * Iterate an object, invoking the given callback.
-      *
-      * @param  {hash, array} object
-      * @param  {function} callback
-      * @return {JSpec}
-      * @api public
-      */
-
-     each : function(object, callback) {
-       if (object.constructor == Array)
-         for (var i = 0, len = object.length; i < len; ++i)
-           callIterator(callback, i, object[i])
-       else
-         for (var key in object) 
-           if (object.hasOwnProperty(key))
-             callIterator(callback, key, object[key])
-     },
-
-     /**
-      * Iterate with memo.
-      *
-      * @param  {hash, array} object
-      * @param  {object} memo
-      * @param  {function} callback
-      * @return {object}
-      * @api public
-      */
-
-     inject : function(object, memo, callback) {
-       each(object, function(key, value){
-         memo = (callback.length == 2 ?
-                   callback(memo, value):
-                     callback(memo, key, value)) ||
-                       memo
-       })
-       return memo
-     },
-     
-     /**
-      * Destub _object_'s _method_. When no _method_ is passed
-      * all stubbed methods are destubbed. When no arguments
-      * are passed every object found in JSpec.stubbed will be
-      * destubbed.
-      *
-      * @param  {mixed} object
-      * @param  {string} method
-      * @api public
-      */
-     
-     destub : function(object, method) {
-       if (method) {
-         if (object['__prototype__' + method])
-           delete object[method]
-         else
-           object[method] = object['__original__' + method]
-         delete object['__prototype__' + method]
-         delete object['__original____' + method]
-       }
-       else if (object) {
-         for (var key in object)
-           if (captures = key.match(/^(?:__prototype__|__original__)(.*)/))
-             destub(object, captures[1])
-       }
-       else
-         while (JSpec.stubbed.length)
-            destub(JSpec.stubbed.shift())
-     },
-     
-     /**
-      * Stub _object_'s _method_. 
-      *
-      * stub(foo, 'toString').and_return('bar')
-      *
-      * @param  {mixed} object
-      * @param  {string} method
-      * @return {hash}
-      * @api public
-      */
-     
-     stub : function(object, method) {
-       hook('stubbing', object, method)
-       JSpec.stubbed.push(object)
-       var type = object.hasOwnProperty(method) ? '__original__' : '__prototype__'
-       object[type + method] = object[method]
-       object[method] = function(){}
-       return {
-         and_return : function(value) {
-           if (typeof value == 'function') object[method] = value
-           else object[method] = function(){ return value }
-         }
-      }
-     },
-     
-    /**
-     * Map callback return values.
-     *
-     * @param  {hash, array} object
-     * @param  {function} callback
-     * @return {array}
-     * @api public
-     */
-
-    map : function(object, callback) {
-      return inject(object, [], function(memo, key, value){
-        memo.push(callIterator(callback, key, value))
-      })
-    },
-    
-    /**
-     * Returns the first matching expression or null.
-     *
-     * @param  {hash, array} object
-     * @param  {function} callback
-     * @return {mixed}
-     * @api public
-     */
-         
-    any : function(object, callback) {
-      return inject(object, null, function(state, key, value){
-        if (state == undefined)
-          return callIterator(callback, key, value) ? value : state
-      })
-    },
-    
-    /**
-     * Returns an array of values collected when the callback
-     * given evaluates to true.
-     *
-     * @param  {hash, array} object
-     * @return {function} callback
-     * @return {array}
-     * @api public
-     */
-    
-    select : function(object, callback) {
-      return inject(object, [], function(selected, key, value){
-        if (callIterator(callback, key, value))
-          selected.push(value)
-      })
-    },
-
-    /**
-     * Define matchers.
-     *
-     * @param  {hash} matchers
-     * @api public
-     */
-
-    addMatchers : function(matchers) {
-      each(matchers, function(name, body){
-        JSpec.addMatcher(name, body)  
-      })
-    },
-    
-    /**
-     * Define a matcher.
-     *
-     * @param  {string} name
-     * @param  {hash, function, string} body
-     * @api public
-     */
-    
-    addMatcher : function(name, body) {
-      hook('addingMatcher', name, body)
-      if (name.indexOf(' ') != -1) {
-        var matchers = name.split(/\s+/)
-        var prefix = matchers.shift()
-        each(matchers, function(name) {
-          JSpec.addMatcher(prefix + '_' + name, body(name))
-        })
-      }
-      this.matchers[name] = this.normalizeMatcherMessage(this.normalizeMatcherBody(body))
-      this.matchers[name].name = name
-    },
-    
-    /**
-     * Add a root suite to JSpec.
-     *
-     * @param  {string} description
-     * @param  {body} function
-     * @api public
-     */
-    
-    describe : function(description, body) {
-      var suite = new JSpec.Suite(description, body)
-      hook('addingSuite', suite)
-      this.allSuites.push(suite)
-      this.suites.push(suite)
-    },
-    
-    /**
-     * Return the contents of a function body.
-     *
-     * @param  {function} body
-     * @return {string}
-     * @api public
-     */
-    
-    contentsOf : function(body) {
-      return body.toString().match(/^[^\{]*{((.*\n*)*)}/m)[1]
-    },
-
-    /**
-     * Evaluate a JSpec capture body.
-     *
-     * @param  {function} body
-     * @param  {string} errorMessage (optional)
-     * @return {Type}
-     * @api private
-     */
-
-    evalBody : function(body, errorMessage) {
-      var dsl = this.DSL || this.DSLs.snake
-      var matchers = this.matchers
-      var context = this.context || this.defaultContext
-      var contents = this.contentsOf(body)
-      hook('evaluatingBody', dsl, matchers, context, contents)
-      try { with (dsl){ with (context) { with (matchers) { eval(contents) }}} }
-      catch(e) { error(errorMessage, e) }
-    },
-
-    /**
-     * Pre-process a string of JSpec.
-     *
-     * @param  {string} input
-     * @return {string}
-     * @api private
-     */
-
-    preprocess : function(input) {
-      if (typeof input != 'string') return
-      input = hookImmutable('preprocessing', input)
-      return input.
-        replace(/\t/g, '  ').
-        replace(/\r\n|\n|\r/g, '\n').
-        split('__END__')[0].
-        replace(/([\w\.]+)\.(stub|destub)\((.*?)\)$/gm, '$2($1, $3)').
-        replace(/describe\s+(.*?)$/gm, 'describe($1, function(){').
-        replace(/^\s+it\s+(.*?)$/gm, ' it($1, function(){').
-        replace(/^ *(before_each|after_each|before|after)(?= |\n|$)/gm, 'JSpec.currentSuite.addHook("$1", function(){').
-        replace(/^\s*end(?=\s|$)/gm, '});').
-        replace(/-\{/g, 'function(){').
-        replace(/(\d+)\.\.(\d+)/g, function(_, a, b){ return range(a, b) }).
-        replace(/\.should([_\.]not)?[_\.](\w+)(?: |;|$)(.*)$/gm, '.should$1_$2($3)').
-        replace(/([\/\s]*)(.+?)\.(should(?:[_\.]not)?)[_\.](\w+)\((.*)\)\s*;?$/gm, '$1 expect($2).$3($4, $5)').
-        replace(/, \)/g, ')').
-        replace(/should\.not/g, 'should_not')
-    },
-
-    /**
-     * Create a range string which can be evaluated to a native array.
-     *
-     * @param  {int} start
-     * @param  {int} end
-     * @return {string}
-     * @api public
-     */
-
-    range : function(start, end) {
-      var current = parseInt(start), end = parseInt(end), values = [current]
-      if (end > current) while (++current <= end) values.push(current)
-      else               while (--current >= end) values.push(current)
-      return '[' + values + ']'
-    },
-
-    /**
-     * Report on the results. 
-     *
-     * @api public
-     */
-
-    report : function() {
-      this.duration = Number(new Date) - this.start
-      hook('reporting', JSpec.options)
-      new (JSpec.options.reporter || JSpec.reporters.DOM)(JSpec, JSpec.options)
-    },
-
-    /**
-     * Run the spec suites. Options are merged
-     * with JSpec options when present.
-     *
-     * @param  {hash} options
-     * @return {JSpec}
-     * @api public
-     */
-
-    run : function(options) {
-      if (any(hook('running'), haveStopped)) return this
-      if (options) extend(this.options, options)
-      this.start = Number(new Date)
-      each(this.suites, function(suite) { JSpec.runSuite(suite) })
-      return this
-    },
-    
-    /**
-     * Run a suite.
-     *
-     * @param  {Suite} suite
-     * @api public
-     */
-
-    runSuite : function(suite) {
-      this.currentSuite = suite
-      this.evalBody(suite.body)
-      suite.ran = true
-      hook('beforeSuite', suite), suite.hook('before')
-      each(suite.specs, function(spec) {
-        hook('beforeSpec', spec)
-        suite.hook('before_each')
-        JSpec.runSpec(spec)
-        hook('afterSpec', spec)
-        suite.hook('after_each')
-      })
-      if (suite.hasSuites()) {
-        each(suite.suites, function(suite) {
-          JSpec.runSuite(suite)
-        })
-      }
-      hook('afterSuite', suite), suite.hook('after')
-      this.stats.suitesFinished++
-    },
-         
-    /**
-     * Report a failure for the current spec.
-     *
-     * @param  {string} message
-     * @api public
-     */
-     
-     fail : function(message) {
-       JSpec.currentSpec.fail(message)
-     },
-     
-     /**
-      * Report a passing assertion for the current spec.
-      *
-      * @param  {string} message
-      * @api public
-      */
-      
-     pass : function(message) {
-       JSpec.currentSpec.pass(message)
-     },
-
-    /**
-     * Run a spec.
-     *
-     * @param  {Spec} spec
-     * @api public
-     */
-
-    runSpec : function(spec) {
-      this.currentSpec = spec
-      try { this.evalBody(spec.body) }
-      catch (e) { fail(e) }
-      spec.runDeferredAssertions()
-      destub()
-      this.stats.specsFinished++
-      this.stats.assertions += spec.assertions.length
-    },
-
-    /**
-     * Require a dependency, with optional message.
-     *
-     * @param  {string} dependency
-     * @param  {string} message (optional)
-     * @return {JSpec}
-     * @api public
-     */
-
-    requires : function(dependency, message) {
-      hook('requiring', dependency, message)
-      try { eval(dependency) }
-      catch (e) { throw 'JSpec depends on ' + dependency + ' ' + message }
-      return this
-    },
-
-    /**
-     * Query against the current query strings keys
-     * or the queryString specified.
-     *
-     * @param  {string} key
-     * @param  {string} queryString
-     * @return {string, null}
-     * @api private
-     */
-
-    query : function(key, queryString) {
-      var queryString = (queryString || (main.location ? main.location.search : null) || '').substring(1)
-      return inject(queryString.split('&'), null, function(value, pair){
-        parts = pair.split('=')
-        return parts[0] == key ? parts[1].replace(/%20|\+/gmi, ' ') : value
-      })
-    },
-
-    /**
-     * Throw a JSpec related error.
-     *
-     * @param {string} message
-     * @param {Exception} e
-     * @api public
-     */
-
-    error : function(message, e) {
-      throw (message ? message : '') + e.toString() + 
-              (e.line ? ' near line ' + e.line : '')
-    },
-    
-    /**
-     * Ad-hoc POST request for JSpec server usage.
-     *
-     * @param  {string} uri
-     * @param  {string} data
-     * @api private
-     */
-    
-    post : function(uri, data) {
-      if (any(hook('posting', uri, data), haveStopped)) return
-      var request = this.xhr()
-      request.open('POST', uri, false)
-      request.setRequestHeader('Content-Type', 'application/json')
-      request.send(JSpec.JSON.encode(data))
-    },
-
-    /**
-     * Instantiate an XMLHttpRequest.
-     *
-     * Here we utilize IE's lame ActiveXObjects first which
-     * allow IE access serve files via the file: protocol, otherwise
-     * we then default to XMLHttpRequest.
-     *
-     * @return {XMLHttpRequest, ActiveXObject}
-     * @api private
-     */
-    
-    xhr : function() {
-      return this.ieXhr() || new JSpec.request
-    },
-    
-    /**
-     * Return Microsoft piece of crap ActiveXObject.
-     *
-     * @return {ActiveXObject}
-     * @api public
-     */
-    
-    ieXhr : function() {
-      function object(str) {
-        try { return new ActiveXObject(str) } catch(e) {}
-      }
-      return object('Msxml2.XMLHTTP.6.0') ||
-        object('Msxml2.XMLHTTP.3.0') ||
-        object('Msxml2.XMLHTTP') ||
-        object('Microsoft.XMLHTTP')
-    },
-    
-    /**
-     * Check for HTTP request support.
-     *
-     * @return {bool}
-     * @api private
-     */
-    
-    hasXhr : function() {
-      return JSpec.request || 'ActiveXObject' in main
-    },
-    
-    /**
-     * Try loading _file_ returning the contents
-     * string or null. Chain to locate / read a file.
-     *
-     * @param  {string} file
-     * @return {string}
-     * @api public
-     */
-    
-    tryLoading : function(file) {
-      try { return JSpec.load(file) } catch (e) {}
-    },
-
-    /**
-     * Load a _file_'s contents.
-     *
-     * @param  {string} file
-     * @param  {function} callback
-     * @return {string}
-     * @api public
-     */
-
-    load : function(file, callback) {
-      if (any(hook('loading', file), haveStopped)) return
-      if ('readFile' in main)
-        return readFile(file)
-      else if (this.hasXhr()) {
-        var request = this.xhr()
-        request.open('GET', file, false)
-        request.send(null)
-        if (request.readyState == 4 && 
-           (request.status == 0 || 
-            request.status.toString().charAt(0) == 2)) 
-          return request.responseText
-      }
-      else
-        error("failed to load `" + file + "'")
-    },
-
-    /**
-     * Load, pre-process, and evaluate a file.
-     *
-     * @param {string} file
-     * @param {JSpec}
-     * @api public
-     */
-
-    exec : function(file) {
-      if (any(hook('executing', file), haveStopped)) return this
-      eval('with (JSpec){' + this.preprocess(this.load(file)) + '}')
-      return this
-    }
-  }
-  
-  // --- Node.js support
-  
-  if (typeof GLOBAL === 'object' && typeof exports === 'object')
-    quit = process.exit,
-    print = require('sys').puts,
-    readFile = require('fs').readFileSync
-  
-  // --- Utility functions
-
-  var main = this,
-      find = JSpec.any,
-      utils = 'haveStopped stub hookImmutable hook destub map any last pass fail range each option inject select \
-               error escape extend puts query strip color does addMatchers callIterator toArray equal'.split(/\s+/)
-  while (utils.length) eval('var ' + utils[0] + ' = JSpec.' + utils.shift())
-  if (!main.setTimeout) main.setTimeout = function(callback){ callback() }
-
-  // --- Matchers
-
-  addMatchers({
-    equal              : "===",
-    eql                : "equal(actual, expected)",
-    be                 : "alias equal",
-    be_greater_than    : ">",
-    be_less_than       : "<",
-    be_at_least        : ">=",
-    be_at_most         : "<=",
-    be_a               : "actual.constructor == expected",
-    be_an              : "alias be_a",
-    be_an_instance_of  : "actual instanceof expected",
-    be_null            : "actual == null",
-    be_true            : "actual == true",
-    be_false           : "actual == false",
-    be_undefined       : "typeof actual == 'undefined'",
-    be_type            : "typeof actual == expected",
-    match              : "typeof actual == 'string' ? actual.match(expected) : false",
-    respond_to         : "typeof actual[expected] == 'function'",
-    have_length        : "actual.length == expected",
-    be_within          : "actual >= expected[0] && actual <= last(expected)",
-    have_length_within : "actual.length >= expected[0] && actual.length <= last(expected)",
-    
-    receive : { defer : true, match : function(actual, method, times) {
-      proxy = new JSpec.ProxyAssertion(actual, method, times, this.negate)
-      JSpec.currentSpec.assertions.push(proxy)
-      return proxy
-    }},
-    
-    be_empty : function(actual) {
-      if (actual.constructor == Object && actual.length == undefined)
-        for (var key in actual)
-          return false;
-      return !actual.length
-    },
-
-    include : function(actual) {
-      for (state = true, i = 1; i < arguments.length; i++) {
-        arg = arguments[i]
-        switch (actual.constructor) {
-          case String: 
-          case Number:
-          case RegExp:
-          case Function:
-            state = actual.toString().indexOf(arg) !== -1
-            break
-         
-          case Object:
-            state = arg in actual
-            break
-          
-          case Array: 
-            state = any(actual, function(value){ return equal(value, arg) })
-            break
-        }
-        if (!state) return false
-      }
-      return true
-    },
-
-    throw_error : { match : function(actual, expected, message) {
-      try { actual() }
-      catch (e) {
-        this.e = e
-        var assert = function(arg) {
-          switch (arg.constructor) {
-            case RegExp   : return arg.test(e.message || e.toString())
-            case String   : return arg == (e.message || e.toString())
-            case Function : return e instanceof arg || e.name == arg.name
-          }
-        }
-        return message ? assert(expected) && assert(message) :
-                 expected ? assert(expected) :
-                   true
-      }
-    }, message : function(actual, expected, negate) {
-      // TODO: refactor when actual is not in expected [0]
-      var message_for = function(i) {
-        if (expected[i] == undefined) return 'exception'
-        switch (expected[i].constructor) {
-          case RegExp   : return 'exception matching ' + puts(expected[i])
-          case String   : return 'exception of ' + puts(expected[i])
-          case Function : return expected[i].name || 'Error'
-        }
-      }
-      exception = message_for(1) + (expected[2] ? ' and ' + message_for(2) : '')
-      return 'expected ' + exception + (negate ? ' not ' : '' ) +
-               ' to be thrown, but ' + (this.e ? 'got ' + puts(this.e) : 'nothing was')
-    }},
-    
-    have : function(actual, length, property) {
-      return actual[property].length == length
-    },
-    
-    have_at_least : function(actual, length, property) {
-      return actual[property].length >= length
-    },
-    
-    have_at_most :function(actual, length, property) {
-      return actual[property].length <= length
-    },
-    
-    have_within : function(actual, range, property) {
-      length = actual[property].length
-      return length >= range.shift() && length <= range.pop()
-    },
-    
-    have_prop : function(actual, property, value) {
-      return actual[property] == null || 
-               actual[property] instanceof Function ? false:
-                 value == null ? true:
-                   does(actual[property], 'eql', value)
-    },
-    
-    have_property : function(actual, property, value) {
-      return actual[property] == null ||
-               actual[property] instanceof Function ? false:
-                 value == null ? true:
-                   value === actual[property]
-    }
-  })
-  
-})()


[33/37] goodbye Futon, old friend <3

Posted by ja...@apache.org.
http://git-wip-us.apache.org/repos/asf/couchdb/blob/cca309f3/share/www/fauxton/img/fontawesome-webfont.svg
----------------------------------------------------------------------
diff --git a/share/www/fauxton/img/fontawesome-webfont.svg b/share/www/fauxton/img/fontawesome-webfont.svg
deleted file mode 100644
index 2edb4ec..0000000
--- a/share/www/fauxton/img/fontawesome-webfont.svg
+++ /dev/null
@@ -1,399 +0,0 @@
-<?xml version="1.0" standalone="no"?>
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
-<svg xmlns="http://www.w3.org/2000/svg">
-<metadata></metadata>
-<defs>
-<font id="fontawesomeregular" horiz-adv-x="1536" >
-<font-face units-per-em="1792" ascent="1536" descent="-256" />
-<missing-glyph horiz-adv-x="448" />
-<glyph unicode=" "  horiz-adv-x="448" />
-<glyph unicode="&#x09;" horiz-adv-x="448" />
-<glyph unicode="&#xa0;" horiz-adv-x="448" />
-<glyph unicode="&#xa8;" horiz-adv-x="1792" />
-<glyph unicode="&#xa9;" horiz-adv-x="1792" />
-<glyph unicode="&#xae;" horiz-adv-x="1792" />
-<glyph unicode="&#xb4;" horiz-adv-x="1792" />
-<glyph unicode="&#xc6;" horiz-adv-x="1792" />
-<glyph unicode="&#x2000;" horiz-adv-x="768" />
-<glyph unicode="&#x2001;" />
-<glyph unicode="&#x2002;" horiz-adv-x="768" />
-<glyph unicode="&#x2003;" />
-<glyph unicode="&#x2004;" horiz-adv-x="512" />
-<glyph unicode="&#x2005;" horiz-adv-x="384" />
-<glyph unicode="&#x2006;" horiz-adv-x="256" />
-<glyph unicode="&#x2007;" horiz-adv-x="256" />
-<glyph unicode="&#x2008;" horiz-adv-x="192" />
-<glyph unicode="&#x2009;" horiz-adv-x="307" />
-<glyph unicode="&#x200a;" horiz-adv-x="85" />
-<glyph unicode="&#x202f;" horiz-adv-x="307" />
-<glyph unicode="&#x205f;" horiz-adv-x="384" />
-<glyph unicode="&#x2122;" horiz-adv-x="1792" />
-<glyph unicode="&#x221e;" horiz-adv-x="1792" />
-<glyph unicode="&#x2260;" horiz-adv-x="1792" />
-<glyph unicode="&#xe000;" horiz-adv-x="500" d="M0 0z" />
-<glyph unicode="&#xf000;" horiz-adv-x="1792" d="M1699 1350q0 -35 -43 -78l-632 -632v-768h320q26 0 45 -19t19 -45t-19 -45t-45 -19h-896q-26 0 -45 19t-19 45t19 45t45 19h320v768l-632 632q-43 43 -43 78q0 23 18 36.5t38 17.5t43 4h1408q23 0 43 -4t38 -17.5t18 -36.5z" />
-<glyph unicode="&#xf001;" d="M1536 1312v-1120q0 -50 -34 -89t-86 -60.5t-103.5 -32t-96.5 -10.5t-96.5 10.5t-103.5 32t-86 60.5t-34 89t34 89t86 60.5t103.5 32t96.5 10.5q105 0 192 -39v537l-768 -237v-709q0 -50 -34 -89t-86 -60.5t-103.5 -32t-96.5 -10.5t-96.5 10.5t-103.5 32t-86 60.5t-34 89 t34 89t86 60.5t103.5 32t96.5 10.5q105 0 192 -39v967q0 31 19 56.5t49 35.5l832 256q12 4 28 4q40 0 68 -28t28 -68z" />
-<glyph unicode="&#xf002;" horiz-adv-x="1664" d="M1152 704q0 185 -131.5 316.5t-316.5 131.5t-316.5 -131.5t-131.5 -316.5t131.5 -316.5t316.5 -131.5t316.5 131.5t131.5 316.5zM1664 -128q0 -52 -38 -90t-90 -38q-54 0 -90 38l-343 342q-179 -124 -399 -124q-143 0 -273.5 55.5t-225 150t-150 225t-55.5 273.5 t55.5 273.5t150 225t225 150t273.5 55.5t273.5 -55.5t225 -150t150 -225t55.5 -273.5q0 -220 -124 -399l343 -343q37 -37 37 -90z" />
-<glyph unicode="&#xf003;" horiz-adv-x="1792" d="M1664 32v768q-32 -36 -69 -66q-268 -206 -426 -338q-51 -43 -83 -67t-86.5 -48.5t-102.5 -24.5h-1h-1q-48 0 -102.5 24.5t-86.5 48.5t-83 67q-158 132 -426 338q-37 30 -69 66v-768q0 -13 9.5 -22.5t22.5 -9.5h1472q13 0 22.5 9.5t9.5 22.5zM1664 1083v11v13.5t-0.5 13 t-3 12.5t-5.5 9t-9 7.5t-14 2.5h-1472q-13 0 -22.5 -9.5t-9.5 -22.5q0 -168 147 -284q193 -152 401 -317q6 -5 35 -29.5t46 -37.5t44.5 -31.5t50.5 -27.5t43 -9h1h1q20 0 43 9t50.5 27.5t44.5 31.5t46 37.5t35 29.5q208 165 401 317q54 43 100.5 115.5t46.5 131.5z M1792 1120v-1088q0 -66 -47 -113t-113 -47h-1472q-66 0 -113 47t-47 113v1088q0 66 47 113t113 47h1472q66 0 113 -47t47 -113z" />
-<glyph unicode="&#xf004;" horiz-adv-x="1792" d="M896 -128q-26 0 -44 18l-624 602q-10 8 -27.5 26t-55.5 65.5t-68 97.5t-53.5 121t-23.5 138q0 220 127 344t351 124q62 0 126.5 -21.5t120 -58t95.5 -68.5t76 -68q36 36 76 68t95.5 68.5t120 58t126.5 21.5q224 0 351 -124t127 -344q0 -221 -229 -450l-623 -600 q-18 -18 -44 -18z" />
-<glyph unicode="&#xf005;" horiz-adv-x="1664" d="M1664 889q0 -22 -26 -48l-363 -354l86 -500q1 -7 1 -20q0 -21 -10.5 -35.5t-30.5 -14.5q-19 0 -40 12l-449 236l-449 -236q-22 -12 -40 -12q-21 0 -31.5 14.5t-10.5 35.5q0 6 2 20l86 500l-364 354q-25 27 -25 48q0 37 56 46l502 73l225 455q19 41 49 41t49 -41l225 -455 l502 -73q56 -9 56 -46z" />
-<glyph unicode="&#xf006;" horiz-adv-x="1664" d="M1137 532l306 297l-422 62l-189 382l-189 -382l-422 -62l306 -297l-73 -421l378 199l377 -199zM1664 889q0 -22 -26 -48l-363 -354l86 -500q1 -7 1 -20q0 -50 -41 -50q-19 0 -40 12l-449 236l-449 -236q-22 -12 -40 -12q-21 0 -31.5 14.5t-10.5 35.5q0 6 2 20l86 500 l-364 354q-25 27 -25 48q0 37 56 46l502 73l225 455q19 41 49 41t49 -41l225 -455l502 -73q56 -9 56 -46z" />
-<glyph unicode="&#xf007;" horiz-adv-x="1408" d="M1408 131q0 -120 -73 -189.5t-194 -69.5h-874q-121 0 -194 69.5t-73 189.5q0 53 3.5 103.5t14 109t26.5 108.5t43 97.5t62 81t85.5 53.5t111.5 20q9 0 42 -21.5t74.5 -48t108 -48t133.5 -21.5t133.5 21.5t108 48t74.5 48t42 21.5q61 0 111.5 -20t85.5 -53.5t62 -81 t43 -97.5t26.5 -108.5t14 -109t3.5 -103.5zM1088 1024q0 -159 -112.5 -271.5t-271.5 -112.5t-271.5 112.5t-112.5 271.5t112.5 271.5t271.5 112.5t271.5 -112.5t112.5 -271.5z" />
-<glyph unicode="&#xf008;" horiz-adv-x="1920" d="M384 -64v128q0 26 -19 45t-45 19h-128q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45t45 -19h128q26 0 45 19t19 45zM384 320v128q0 26 -19 45t-45 19h-128q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45t45 -19h128q26 0 45 19t19 45zM384 704v128q0 26 -19 45t-45 19h-128 q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45t45 -19h128q26 0 45 19t19 45zM1408 -64v512q0 26 -19 45t-45 19h-768q-26 0 -45 -19t-19 -45v-512q0 -26 19 -45t45 -19h768q26 0 45 19t19 45zM384 1088v128q0 26 -19 45t-45 19h-128q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45 t45 -19h128q26 0 45 19t19 45zM1792 -64v128q0 26 -19 45t-45 19h-128q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45t45 -19h128q26 0 45 19t19 45zM1408 704v512q0 26 -19 45t-45 19h-768q-26 0 -45 -19t-19 -45v-512q0 -26 19 -45t45 -19h768q26 0 45 19t19 45zM1792 320v128 q0 26 -19 45t-45 19h-128q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45t45 -19h128q26 0 45 19t19 45zM1792 704v128q0 26 -19 45t-45 19h-128q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45t45 -19h128q26 0 45 19t1
 9 45zM1792 1088v128q0 26 -19 45t-45 19h-128q-26 0 -45 -19 t-19 -45v-128q0 -26 19 -45t45 -19h128q26 0 45 19t19 45zM1920 1248v-1344q0 -66 -47 -113t-113 -47h-1600q-66 0 -113 47t-47 113v1344q0 66 47 113t113 47h1600q66 0 113 -47t47 -113z" />
-<glyph unicode="&#xf009;" horiz-adv-x="1664" d="M768 512v-384q0 -52 -38 -90t-90 -38h-512q-52 0 -90 38t-38 90v384q0 52 38 90t90 38h512q52 0 90 -38t38 -90zM768 1280v-384q0 -52 -38 -90t-90 -38h-512q-52 0 -90 38t-38 90v384q0 52 38 90t90 38h512q52 0 90 -38t38 -90zM1664 512v-384q0 -52 -38 -90t-90 -38 h-512q-52 0 -90 38t-38 90v384q0 52 38 90t90 38h512q52 0 90 -38t38 -90zM1664 1280v-384q0 -52 -38 -90t-90 -38h-512q-52 0 -90 38t-38 90v384q0 52 38 90t90 38h512q52 0 90 -38t38 -90z" />
-<glyph unicode="&#xf00a;" horiz-adv-x="1792" d="M512 288v-192q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h320q40 0 68 -28t28 -68zM512 800v-192q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h320q40 0 68 -28t28 -68zM1152 288v-192q0 -40 -28 -68t-68 -28h-320 q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h320q40 0 68 -28t28 -68zM512 1312v-192q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h320q40 0 68 -28t28 -68zM1152 800v-192q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v192q0 40 28 68t68 28 h320q40 0 68 -28t28 -68zM1792 288v-192q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h320q40 0 68 -28t28 -68zM1152 1312v-192q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h320q40 0 68 -28t28 -68zM1792 800v-192 q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h320q40 0 68 -28t28 -68zM1792 1312v-192q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h320q40 0 68 -28
 t28 -68z" />
-<glyph unicode="&#xf00b;" horiz-adv-x="1792" d="M512 288v-192q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h320q40 0 68 -28t28 -68zM512 800v-192q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h320q40 0 68 -28t28 -68zM1792 288v-192q0 -40 -28 -68t-68 -28h-960 q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h960q40 0 68 -28t28 -68zM512 1312v-192q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h320q40 0 68 -28t28 -68zM1792 800v-192q0 -40 -28 -68t-68 -28h-960q-40 0 -68 28t-28 68v192q0 40 28 68t68 28 h960q40 0 68 -28t28 -68zM1792 1312v-192q0 -40 -28 -68t-68 -28h-960q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h960q40 0 68 -28t28 -68z" />
-<glyph unicode="&#xf00c;" horiz-adv-x="1792" d="M1671 970q0 -40 -28 -68l-724 -724l-136 -136q-28 -28 -68 -28t-68 28l-136 136l-362 362q-28 28 -28 68t28 68l136 136q28 28 68 28t68 -28l294 -295l656 657q28 28 68 28t68 -28l136 -136q28 -28 28 -68z" />
-<glyph unicode="&#xf00d;" horiz-adv-x="1408" d="M1298 214q0 -40 -28 -68l-136 -136q-28 -28 -68 -28t-68 28l-294 294l-294 -294q-28 -28 -68 -28t-68 28l-136 136q-28 28 -28 68t28 68l294 294l-294 294q-28 28 -28 68t28 68l136 136q28 28 68 28t68 -28l294 -294l294 294q28 28 68 28t68 -28l136 -136q28 -28 28 -68 t-28 -68l-294 -294l294 -294q28 -28 28 -68z" />
-<glyph unicode="&#xf00e;" horiz-adv-x="1664" d="M1024 736v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-224v-224q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v224h-224q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h224v224q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5v-224h224 q13 0 22.5 -9.5t9.5 -22.5zM1152 704q0 185 -131.5 316.5t-316.5 131.5t-316.5 -131.5t-131.5 -316.5t131.5 -316.5t316.5 -131.5t316.5 131.5t131.5 316.5zM1664 -128q0 -53 -37.5 -90.5t-90.5 -37.5q-54 0 -90 38l-343 342q-179 -124 -399 -124q-143 0 -273.5 55.5 t-225 150t-150 225t-55.5 273.5t55.5 273.5t150 225t225 150t273.5 55.5t273.5 -55.5t225 -150t150 -225t55.5 -273.5q0 -220 -124 -399l343 -343q37 -37 37 -90z" />
-<glyph unicode="&#xf010;" horiz-adv-x="1664" d="M1024 736v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-576q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h576q13 0 22.5 -9.5t9.5 -22.5zM1152 704q0 185 -131.5 316.5t-316.5 131.5t-316.5 -131.5t-131.5 -316.5t131.5 -316.5t316.5 -131.5t316.5 131.5t131.5 316.5z M1664 -128q0 -53 -37.5 -90.5t-90.5 -37.5q-54 0 -90 38l-343 342q-179 -124 -399 -124q-143 0 -273.5 55.5t-225 150t-150 225t-55.5 273.5t55.5 273.5t150 225t225 150t273.5 55.5t273.5 -55.5t225 -150t150 -225t55.5 -273.5q0 -220 -124 -399l343 -343q37 -37 37 -90z " />
-<glyph unicode="&#xf011;" d="M1536 640q0 -156 -61 -298t-164 -245t-245 -164t-298 -61t-298 61t-245 164t-164 245t-61 298q0 182 80.5 343t226.5 270q43 32 95.5 25t83.5 -50q32 -42 24.5 -94.5t-49.5 -84.5q-98 -74 -151.5 -181t-53.5 -228q0 -104 40.5 -198.5t109.5 -163.5t163.5 -109.5 t198.5 -40.5t198.5 40.5t163.5 109.5t109.5 163.5t40.5 198.5q0 121 -53.5 228t-151.5 181q-42 32 -49.5 84.5t24.5 94.5q31 43 84 50t95 -25q146 -109 226.5 -270t80.5 -343zM896 1408v-640q0 -52 -38 -90t-90 -38t-90 38t-38 90v640q0 52 38 90t90 38t90 -38t38 -90z" />
-<glyph unicode="&#xf012;" horiz-adv-x="1792" d="M256 96v-192q0 -14 -9 -23t-23 -9h-192q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h192q14 0 23 -9t9 -23zM640 224v-320q0 -14 -9 -23t-23 -9h-192q-14 0 -23 9t-9 23v320q0 14 9 23t23 9h192q14 0 23 -9t9 -23zM1024 480v-576q0 -14 -9 -23t-23 -9h-192q-14 0 -23 9t-9 23 v576q0 14 9 23t23 9h192q14 0 23 -9t9 -23zM1408 864v-960q0 -14 -9 -23t-23 -9h-192q-14 0 -23 9t-9 23v960q0 14 9 23t23 9h192q14 0 23 -9t9 -23zM1792 1376v-1472q0 -14 -9 -23t-23 -9h-192q-14 0 -23 9t-9 23v1472q0 14 9 23t23 9h192q14 0 23 -9t9 -23z" />
-<glyph unicode="&#xf013;" d="M1024 640q0 106 -75 181t-181 75t-181 -75t-75 -181t75 -181t181 -75t181 75t75 181zM1536 749v-222q0 -12 -8 -23t-20 -13l-185 -28q-19 -54 -39 -91q35 -50 107 -138q10 -12 10 -25t-9 -23q-27 -37 -99 -108t-94 -71q-12 0 -26 9l-138 108q-44 -23 -91 -38 q-16 -136 -29 -186q-7 -28 -36 -28h-222q-14 0 -24.5 8.5t-11.5 21.5l-28 184q-49 16 -90 37l-141 -107q-10 -9 -25 -9q-14 0 -25 11q-126 114 -165 168q-7 10 -7 23q0 12 8 23q15 21 51 66.5t54 70.5q-27 50 -41 99l-183 27q-13 2 -21 12.5t-8 23.5v222q0 12 8 23t19 13 l186 28q14 46 39 92q-40 57 -107 138q-10 12 -10 24q0 10 9 23q26 36 98.5 107.5t94.5 71.5q13 0 26 -10l138 -107q44 23 91 38q16 136 29 186q7 28 36 28h222q14 0 24.5 -8.5t11.5 -21.5l28 -184q49 -16 90 -37l142 107q9 9 24 9q13 0 25 -10q129 -119 165 -170q7 -8 7 -22 q0 -12 -8 -23q-15 -21 -51 -66.5t-54 -70.5q26 -50 41 -98l183 -28q13 -2 21 -12.5t8 -23.5z" />
-<glyph unicode="&#xf014;" horiz-adv-x="1408" d="M512 800v-576q0 -14 -9 -23t-23 -9h-64q-14 0 -23 9t-9 23v576q0 14 9 23t23 9h64q14 0 23 -9t9 -23zM768 800v-576q0 -14 -9 -23t-23 -9h-64q-14 0 -23 9t-9 23v576q0 14 9 23t23 9h64q14 0 23 -9t9 -23zM1024 800v-576q0 -14 -9 -23t-23 -9h-64q-14 0 -23 9t-9 23v576 q0 14 9 23t23 9h64q14 0 23 -9t9 -23zM1152 76v948h-896v-948q0 -22 7 -40.5t14.5 -27t10.5 -8.5h832q3 0 10.5 8.5t14.5 27t7 40.5zM480 1152h448l-48 117q-7 9 -17 11h-317q-10 -2 -17 -11zM1408 1120v-64q0 -14 -9 -23t-23 -9h-96v-948q0 -83 -47 -143.5t-113 -60.5h-832 q-66 0 -113 58.5t-47 141.5v952h-96q-14 0 -23 9t-9 23v64q0 14 9 23t23 9h309l70 167q15 37 54 63t79 26h320q40 0 79 -26t54 -63l70 -167h309q14 0 23 -9t9 -23z" />
-<glyph unicode="&#xf015;" horiz-adv-x="1664" d="M1408 544v-480q0 -26 -19 -45t-45 -19h-384v384h-256v-384h-384q-26 0 -45 19t-19 45v480q0 1 0.5 3t0.5 3l575 474l575 -474q1 -2 1 -6zM1631 613l-62 -74q-8 -9 -21 -11h-3q-13 0 -21 7l-692 577l-692 -577q-12 -8 -24 -7q-13 2 -21 11l-62 74q-8 10 -7 23.5t11 21.5 l719 599q32 26 76 26t76 -26l244 -204v195q0 14 9 23t23 9h192q14 0 23 -9t9 -23v-408l219 -182q10 -8 11 -21.5t-7 -23.5z" />
-<glyph unicode="&#xf016;" horiz-adv-x="1280" d="M128 0h1024v768h-416q-40 0 -68 28t-28 68v416h-512v-1280zM768 896h376q-10 29 -22 41l-313 313q-12 12 -41 22v-376zM1280 864v-896q0 -40 -28 -68t-68 -28h-1088q-40 0 -68 28t-28 68v1344q0 40 28 68t68 28h640q40 0 88 -20t76 -48l312 -312q28 -28 48 -76t20 -88z " />
-<glyph unicode="&#xf017;" d="M896 992v-448q0 -14 -9 -23t-23 -9h-320q-14 0 -23 9t-9 23v64q0 14 9 23t23 9h224v352q0 14 9 23t23 9h64q14 0 23 -9t9 -23zM1312 640q0 148 -73 273t-198 198t-273 73t-273 -73t-198 -198t-73 -273t73 -273t198 -198t273 -73t273 73t198 198t73 273zM1536 640 q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
-<glyph unicode="&#xf018;" horiz-adv-x="1920" d="M1111 540v4l-24 320q-1 13 -11 22.5t-23 9.5h-186q-13 0 -23 -9.5t-11 -22.5l-24 -320v-4q-1 -12 8 -20t21 -8h244q12 0 21 8t8 20zM1870 73q0 -73 -46 -73h-704q13 0 22 9.5t8 22.5l-20 256q-1 13 -11 22.5t-23 9.5h-272q-13 0 -23 -9.5t-11 -22.5l-20 -256 q-1 -13 8 -22.5t22 -9.5h-704q-46 0 -46 73q0 54 26 116l417 1044q8 19 26 33t38 14h339q-13 0 -23 -9.5t-11 -22.5l-15 -192q-1 -14 8 -23t22 -9h166q13 0 22 9t8 23l-15 192q-1 13 -11 22.5t-23 9.5h339q20 0 38 -14t26 -33l417 -1044q26 -62 26 -116z" />
-<glyph unicode="&#xf019;" horiz-adv-x="1664" d="M1280 192q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1536 192q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1664 416v-320q0 -40 -28 -68t-68 -28h-1472q-40 0 -68 28t-28 68v320q0 40 28 68t68 28h465l135 -136 q58 -56 136 -56t136 56l136 136h464q40 0 68 -28t28 -68zM1339 985q17 -41 -14 -70l-448 -448q-18 -19 -45 -19t-45 19l-448 448q-31 29 -14 70q17 39 59 39h256v448q0 26 19 45t45 19h256q26 0 45 -19t19 -45v-448h256q42 0 59 -39z" />
-<glyph unicode="&#xf01a;" d="M1120 608q0 -12 -10 -24l-319 -319q-11 -9 -23 -9t-23 9l-320 320q-15 16 -7 35q8 20 30 20h192v352q0 14 9 23t23 9h192q14 0 23 -9t9 -23v-352h192q14 0 23 -9t9 -23zM768 1184q-148 0 -273 -73t-198 -198t-73 -273t73 -273t198 -198t273 -73t273 73t198 198t73 273 t-73 273t-198 198t-273 73zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
-<glyph unicode="&#xf01b;" d="M1118 660q-8 -20 -30 -20h-192v-352q0 -14 -9 -23t-23 -9h-192q-14 0 -23 9t-9 23v352h-192q-14 0 -23 9t-9 23q0 12 10 24l319 319q11 9 23 9t23 -9l320 -320q15 -16 7 -35zM768 1184q-148 0 -273 -73t-198 -198t-73 -273t73 -273t198 -198t273 -73t273 73t198 198 t73 273t-73 273t-198 198t-273 73zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
-<glyph unicode="&#xf01c;" d="M1023 576h316q-1 3 -2.5 8t-2.5 8l-212 496h-708l-212 -496q-1 -2 -2.5 -8t-2.5 -8h316l95 -192h320zM1536 546v-482q0 -26 -19 -45t-45 -19h-1408q-26 0 -45 19t-19 45v482q0 62 25 123l238 552q10 25 36.5 42t52.5 17h832q26 0 52.5 -17t36.5 -42l238 -552 q25 -61 25 -123z" />
-<glyph unicode="&#xf01d;" d="M1184 640q0 -37 -32 -55l-544 -320q-15 -9 -32 -9q-16 0 -32 8q-32 19 -32 56v640q0 37 32 56q33 18 64 -1l544 -320q32 -18 32 -55zM1312 640q0 148 -73 273t-198 198t-273 73t-273 -73t-198 -198t-73 -273t73 -273t198 -198t273 -73t273 73t198 198t73 273zM1536 640 q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
-<glyph unicode="&#xf01e;" d="M1536 1280v-448q0 -26 -19 -45t-45 -19h-448q-42 0 -59 40q-17 39 14 69l138 138q-148 137 -349 137q-104 0 -198.5 -40.5t-163.5 -109.5t-109.5 -163.5t-40.5 -198.5t40.5 -198.5t109.5 -163.5t163.5 -109.5t198.5 -40.5q119 0 225 52t179 147q7 10 23 12q14 0 25 -9 l137 -138q9 -8 9.5 -20.5t-7.5 -22.5q-109 -132 -264 -204.5t-327 -72.5q-156 0 -298 61t-245 164t-164 245t-61 298t61 298t164 245t245 164t298 61q147 0 284.5 -55.5t244.5 -156.5l130 129q29 31 70 14q39 -17 39 -59z" />
-<glyph unicode="&#xf021;" d="M1511 480q0 -5 -1 -7q-64 -268 -268 -434.5t-478 -166.5q-146 0 -282.5 55t-243.5 157l-129 -129q-19 -19 -45 -19t-45 19t-19 45v448q0 26 19 45t45 19h448q26 0 45 -19t19 -45t-19 -45l-137 -137q71 -66 161 -102t187 -36q134 0 250 65t186 179q11 17 53 117 q8 23 30 23h192q13 0 22.5 -9.5t9.5 -22.5zM1536 1280v-448q0 -26 -19 -45t-45 -19h-448q-26 0 -45 19t-19 45t19 45l138 138q-148 137 -349 137q-134 0 -250 -65t-186 -179q-11 -17 -53 -117q-8 -23 -30 -23h-199q-13 0 -22.5 9.5t-9.5 22.5v7q65 268 270 434.5t480 166.5 q146 0 284 -55.5t245 -156.5l130 129q19 19 45 19t45 -19t19 -45z" />
-<glyph unicode="&#xf022;" horiz-adv-x="1792" d="M384 352v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM384 608v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M384 864v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM1536 352v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-960q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h960q13 0 22.5 -9.5t9.5 -22.5z M1536 608v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-960q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h960q13 0 22.5 -9.5t9.5 -22.5zM1536 864v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-960q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h960q13 0 22.5 -9.5 t9.5 -22.5zM1664 160v832q0 13 -9.5 22.5t-22.5 9.5h-1472q-13 0 -22.5 -9.5t-9.5 -22.5v-832q0 -13 9.5 -22.5t22.5 -9.5h1472q13 0 22.5 9.5t9.5 22.5zM1792 1248v-1088q0 -66 -47 -113t-113 -47h-1472q-66 0 -1
 13 47t-47 113v1088q0 66 47 113t113 47h1472q66 0 113 -47 t47 -113z" />
-<glyph unicode="&#xf023;" horiz-adv-x="1152" d="M320 768h512v192q0 106 -75 181t-181 75t-181 -75t-75 -181v-192zM1152 672v-576q0 -40 -28 -68t-68 -28h-960q-40 0 -68 28t-28 68v576q0 40 28 68t68 28h32v192q0 184 132 316t316 132t316 -132t132 -316v-192h32q40 0 68 -28t28 -68z" />
-<glyph unicode="&#xf024;" horiz-adv-x="1792" d="M320 1280q0 -72 -64 -110v-1266q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v1266q-64 38 -64 110q0 53 37.5 90.5t90.5 37.5t90.5 -37.5t37.5 -90.5zM1792 1216v-763q0 -25 -12.5 -38.5t-39.5 -27.5q-215 -116 -369 -116q-61 0 -123.5 22t-108.5 48 t-115.5 48t-142.5 22q-192 0 -464 -146q-17 -9 -33 -9q-26 0 -45 19t-19 45v742q0 32 31 55q21 14 79 43q236 120 421 120q107 0 200 -29t219 -88q38 -19 88 -19q54 0 117.5 21t110 47t88 47t54.5 21q26 0 45 -19t19 -45z" />
-<glyph unicode="&#xf025;" horiz-adv-x="1664" d="M1664 650q0 -166 -60 -314l-20 -49l-185 -33q-22 -83 -90.5 -136.5t-156.5 -53.5v-32q0 -14 -9 -23t-23 -9h-64q-14 0 -23 9t-9 23v576q0 14 9 23t23 9h64q14 0 23 -9t9 -23v-32q71 0 130 -35.5t93 -95.5l68 12q29 95 29 193q0 148 -88 279t-236.5 209t-315.5 78 t-315.5 -78t-236.5 -209t-88 -279q0 -98 29 -193l68 -12q34 60 93 95.5t130 35.5v32q0 14 9 23t23 9h64q14 0 23 -9t9 -23v-576q0 -14 -9 -23t-23 -9h-64q-14 0 -23 9t-9 23v32q-88 0 -156.5 53.5t-90.5 136.5l-185 33l-20 49q-60 148 -60 314q0 151 67 291t179 242.5 t266 163.5t320 61t320 -61t266 -163.5t179 -242.5t67 -291z" />
-<glyph unicode="&#xf026;" horiz-adv-x="768" d="M768 1184v-1088q0 -26 -19 -45t-45 -19t-45 19l-333 333h-262q-26 0 -45 19t-19 45v384q0 26 19 45t45 19h262l333 333q19 19 45 19t45 -19t19 -45z" />
-<glyph unicode="&#xf027;" horiz-adv-x="1152" d="M768 1184v-1088q0 -26 -19 -45t-45 -19t-45 19l-333 333h-262q-26 0 -45 19t-19 45v384q0 26 19 45t45 19h262l333 333q19 19 45 19t45 -19t19 -45zM1152 640q0 -76 -42.5 -141.5t-112.5 -93.5q-10 -5 -25 -5q-26 0 -45 18.5t-19 45.5q0 21 12 35.5t29 25t34 23t29 35.5 t12 57t-12 57t-29 35.5t-34 23t-29 25t-12 35.5q0 27 19 45.5t45 18.5q15 0 25 -5q70 -27 112.5 -93t42.5 -142z" />
-<glyph unicode="&#xf028;" horiz-adv-x="1664" d="M768 1184v-1088q0 -26 -19 -45t-45 -19t-45 19l-333 333h-262q-26 0 -45 19t-19 45v384q0 26 19 45t45 19h262l333 333q19 19 45 19t45 -19t19 -45zM1152 640q0 -76 -42.5 -141.5t-112.5 -93.5q-10 -5 -25 -5q-26 0 -45 18.5t-19 45.5q0 21 12 35.5t29 25t34 23t29 35.5 t12 57t-12 57t-29 35.5t-34 23t-29 25t-12 35.5q0 27 19 45.5t45 18.5q15 0 25 -5q70 -27 112.5 -93t42.5 -142zM1408 640q0 -153 -85 -282.5t-225 -188.5q-13 -5 -25 -5q-27 0 -46 19t-19 45q0 39 39 59q56 29 76 44q74 54 115.5 135.5t41.5 173.5t-41.5 173.5 t-115.5 135.5q-20 15 -76 44q-39 20 -39 59q0 26 19 45t45 19q13 0 26 -5q140 -59 225 -188.5t85 -282.5zM1664 640q0 -230 -127 -422.5t-338 -283.5q-13 -5 -26 -5q-26 0 -45 19t-19 45q0 36 39 59q7 4 22.5 10.5t22.5 10.5q46 25 82 51q123 91 192 227t69 289t-69 289 t-192 227q-36 26 -82 51q-7 4 -22.5 10.5t-22.5 10.5q-39 23 -39 59q0 26 19 45t45 19q13 0 26 -5q211 -91 338 -283.5t127 -422.5z" />
-<glyph unicode="&#xf029;" horiz-adv-x="1408" d="M384 384v-128h-128v128h128zM384 1152v-128h-128v128h128zM1152 1152v-128h-128v128h128zM128 129h384v383h-384v-383zM128 896h384v384h-384v-384zM896 896h384v384h-384v-384zM640 640v-640h-640v640h640zM1152 128v-128h-128v128h128zM1408 128v-128h-128v128h128z M1408 640v-384h-384v128h-128v-384h-128v640h384v-128h128v128h128zM640 1408v-640h-640v640h640zM1408 1408v-640h-640v640h640z" />
-<glyph unicode="&#xf02a;" horiz-adv-x="1792" d="M63 0h-63v1408h63v-1408zM126 1h-32v1407h32v-1407zM220 1h-31v1407h31v-1407zM377 1h-31v1407h31v-1407zM534 1h-62v1407h62v-1407zM660 1h-31v1407h31v-1407zM723 1h-31v1407h31v-1407zM786 1h-31v1407h31v-1407zM943 1h-63v1407h63v-1407zM1100 1h-63v1407h63v-1407z M1226 1h-63v1407h63v-1407zM1352 1h-63v1407h63v-1407zM1446 1h-63v1407h63v-1407zM1635 1h-94v1407h94v-1407zM1698 1h-32v1407h32v-1407zM1792 0h-63v1408h63v-1408z" />
-<glyph unicode="&#xf02b;" d="M448 1088q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5t-37.5 -90.5t37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM1515 512q0 -53 -37 -90l-491 -492q-39 -37 -91 -37q-53 0 -90 37l-715 716q-38 37 -64.5 101t-26.5 117v416q0 52 38 90t90 38h416q53 0 117 -26.5t102 -64.5 l715 -714q37 -39 37 -91z" />
-<glyph unicode="&#xf02c;" horiz-adv-x="1920" d="M448 1088q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5t-37.5 -90.5t37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM1515 512q0 -53 -37 -90l-491 -492q-39 -37 -91 -37q-53 0 -90 37l-715 716q-38 37 -64.5 101t-26.5 117v416q0 52 38 90t90 38h416q53 0 117 -26.5t102 -64.5 l715 -714q37 -39 37 -91zM1899 512q0 -53 -37 -90l-491 -492q-39 -37 -91 -37q-36 0 -59 14t-53 45l470 470q37 37 37 90q0 52 -37 91l-715 714q-38 38 -102 64.5t-117 26.5h224q53 0 117 -26.5t102 -64.5l715 -714q37 -39 37 -91z" />
-<glyph unicode="&#xf02d;" horiz-adv-x="1664" d="M1639 1058q40 -57 18 -129l-275 -906q-19 -64 -76.5 -107.5t-122.5 -43.5h-923q-77 0 -148.5 53.5t-99.5 131.5q-24 67 -2 127q0 4 3 27t4 37q1 8 -3 21.5t-3 19.5q2 11 8 21t16.5 23.5t16.5 23.5q23 38 45 91.5t30 91.5q3 10 0.5 30t-0.5 28q3 11 17 28t17 23 q21 36 42 92t25 90q1 9 -2.5 32t0.5 28q4 13 22 30.5t22 22.5q19 26 42.5 84.5t27.5 96.5q1 8 -3 25.5t-2 26.5q2 8 9 18t18 23t17 21q8 12 16.5 30.5t15 35t16 36t19.5 32t26.5 23.5t36 11.5t47.5 -5.5l-1 -3q38 9 51 9h761q74 0 114 -56t18 -130l-274 -906 q-36 -119 -71.5 -153.5t-128.5 -34.5h-869q-27 0 -38 -15q-11 -16 -1 -43q24 -70 144 -70h923q29 0 56 15.5t35 41.5l300 987q7 22 5 57q38 -15 59 -43zM575 1056q-4 -13 2 -22.5t20 -9.5h608q13 0 25.5 9.5t16.5 22.5l21 64q4 13 -2 22.5t-20 9.5h-608q-13 0 -25.5 -9.5 t-16.5 -22.5zM492 800q-4 -13 2 -22.5t20 -9.5h608q13 0 25.5 9.5t16.5 22.5l21 64q4 13 -2 22.5t-20 9.5h-608q-13 0 -25.5 -9.5t-16.5 -22.5z" />
-<glyph unicode="&#xf02e;" horiz-adv-x="1280" d="M1164 1408q23 0 44 -9q33 -13 52.5 -41t19.5 -62v-1289q0 -34 -19.5 -62t-52.5 -41q-19 -8 -44 -8q-48 0 -83 32l-441 424l-441 -424q-36 -33 -83 -33q-23 0 -44 9q-33 13 -52.5 41t-19.5 62v1289q0 34 19.5 62t52.5 41q21 9 44 9h1048z" />
-<glyph unicode="&#xf02f;" horiz-adv-x="1664" d="M384 0h896v256h-896v-256zM384 640h896v384h-160q-40 0 -68 28t-28 68v160h-640v-640zM1536 576q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1664 576v-416q0 -13 -9.5 -22.5t-22.5 -9.5h-224v-160q0 -40 -28 -68t-68 -28h-960q-40 0 -68 28t-28 68 v160h-224q-13 0 -22.5 9.5t-9.5 22.5v416q0 79 56.5 135.5t135.5 56.5h64v544q0 40 28 68t68 28h672q40 0 88 -20t76 -48l152 -152q28 -28 48 -76t20 -88v-256h64q79 0 135.5 -56.5t56.5 -135.5z" />
-<glyph unicode="&#xf030;" horiz-adv-x="1920" d="M960 864q119 0 203.5 -84.5t84.5 -203.5t-84.5 -203.5t-203.5 -84.5t-203.5 84.5t-84.5 203.5t84.5 203.5t203.5 84.5zM1664 1280q106 0 181 -75t75 -181v-896q0 -106 -75 -181t-181 -75h-1408q-106 0 -181 75t-75 181v896q0 106 75 181t181 75h224l51 136 q19 49 69.5 84.5t103.5 35.5h512q53 0 103.5 -35.5t69.5 -84.5l51 -136h224zM960 128q185 0 316.5 131.5t131.5 316.5t-131.5 316.5t-316.5 131.5t-316.5 -131.5t-131.5 -316.5t131.5 -316.5t316.5 -131.5z" />
-<glyph unicode="&#xf031;" horiz-adv-x="1664" d="M725 977l-170 -450q73 -1 153.5 -2t119 -1.5t52.5 -0.5l29 2q-32 95 -92 241q-53 132 -92 211zM21 -128h-21l2 79q22 7 80 18q89 16 110 31q20 16 48 68l237 616l280 724h75h53l11 -21l205 -480q103 -242 124 -297q39 -102 96 -235q26 -58 65 -164q24 -67 65 -149 q22 -49 35 -57q22 -19 69 -23q47 -6 103 -27q6 -39 6 -57q0 -14 -1 -26q-80 0 -192 8q-93 8 -189 8q-79 0 -135 -2l-200 -11l-58 -2q0 45 4 78l131 28q56 13 68 23q12 12 12 27t-6 32l-47 114l-92 228l-450 2q-29 -65 -104 -274q-23 -64 -23 -84q0 -31 17 -43 q26 -21 103 -32q3 0 13.5 -2t30 -5t40.5 -6q1 -28 1 -58q0 -17 -2 -27q-66 0 -349 20l-48 -8q-81 -14 -167 -14z" />
-<glyph unicode="&#xf032;" horiz-adv-x="1408" d="M555 15q76 -32 140 -32q131 0 216 41t122 113q38 70 38 181q0 114 -41 180q-58 94 -141 126q-80 32 -247 32q-74 0 -101 -10v-144l-1 -173l3 -270q0 -15 12 -44zM541 761q43 -7 109 -7q175 0 264 65t89 224q0 112 -85 187q-84 75 -255 75q-52 0 -130 -13q0 -44 2 -77 q7 -122 6 -279l-1 -98q0 -43 1 -77zM0 -128l2 94q45 9 68 12q77 12 123 31q17 27 21 51q9 66 9 194l-2 497q-5 256 -9 404q-1 87 -11 109q-1 4 -12 12q-18 12 -69 15q-30 2 -114 13l-4 83l260 6l380 13l45 1q5 0 14 0.5t14 0.5q1 0 21.5 -0.5t40.5 -0.5h74q88 0 191 -27 q43 -13 96 -39q57 -29 102 -76q44 -47 65 -104t21 -122q0 -70 -32 -128t-95 -105q-26 -20 -150 -77q177 -41 267 -146q92 -106 92 -236q0 -76 -29 -161q-21 -62 -71 -117q-66 -72 -140 -108q-73 -36 -203 -60q-82 -15 -198 -11l-197 4q-84 2 -298 -11q-33 -3 -272 -11z" />
-<glyph unicode="&#xf033;" horiz-adv-x="1024" d="M0 -126l17 85q4 1 77 20q76 19 116 39q29 37 41 101l27 139l56 268l12 64q8 44 17 84.5t16 67t12.5 46.5t9 30.5t3.5 11.5l29 157l16 63l22 135l8 50v38q-41 22 -144 28q-28 2 -38 4l19 103l317 -14q39 -2 73 -2q66 0 214 9q33 2 68 4.5t36 2.5q-2 -19 -6 -38 q-7 -29 -13 -51q-55 -19 -109 -31q-64 -16 -101 -31q-12 -31 -24 -88q-9 -44 -13 -82q-44 -199 -66 -306l-61 -311l-38 -158l-43 -235l-12 -45q-2 -7 1 -27q64 -15 119 -21q36 -5 66 -10q-1 -29 -7 -58q-7 -31 -9 -41q-18 0 -23 -1q-24 -2 -42 -2q-9 0 -28 3q-19 4 -145 17 l-198 2q-41 1 -174 -11q-74 -7 -98 -9z" />
-<glyph unicode="&#xf034;" horiz-adv-x="1792" d="M81 1407l54 -27q20 -5 211 -5h130l19 3l115 1l215 -1h293l34 -2q14 -1 28 7t21 16l7 8l42 1q15 0 28 -1v-104.5t1 -131.5l1 -100l-1 -58q0 -32 -4 -51q-39 -15 -68 -18q-25 43 -54 128q-8 24 -15.5 62.5t-11.5 65.5t-6 29q-13 15 -27 19q-7 2 -42.5 2t-103.5 -1t-111 -1 q-34 0 -67 -5q-10 -97 -8 -136l1 -152v-332l3 -359l-1 -147q-1 -46 11 -85q49 -25 89 -32q2 0 18 -5t44 -13t43 -12q30 -8 50 -18q5 -45 5 -50q0 -10 -3 -29q-14 -1 -34 -1q-110 0 -187 10q-72 8 -238 8q-88 0 -233 -14q-48 -4 -70 -4q-2 22 -2 26l-1 26v9q21 33 79 49 q139 38 159 50q9 21 12 56q8 192 6 433l-5 428q-1 62 -0.5 118.5t0.5 102.5t-2 57t-6 15q-6 5 -14 6q-38 6 -148 6q-43 0 -100 -13.5t-73 -24.5q-13 -9 -22 -33t-22 -75t-24 -84q-6 -19 -19.5 -32t-20.5 -13q-44 27 -56 44v297v86zM1744 128q33 0 42 -18.5t-11 -44.5 l-126 -162q-20 -26 -49 -26t-49 26l-126 162q-20 26 -11 44.5t42 18.5h80v1024h-80q-33 0 -42 18.5t11 44.5l126 162q20 26 49 26t49 -26l126 -162q20 -26 11 -44.5t-42 -18.5h-80v-1024h80z" />
-<glyph unicode="&#xf035;" d="M81 1407l54 -27q20 -5 211 -5h130l19 3l115 1l446 -1h318l34 -2q14 -1 28 7t21 16l7 8l42 1q15 0 28 -1v-104.5t1 -131.5l1 -100l-1 -58q0 -32 -4 -51q-39 -15 -68 -18q-25 43 -54 128q-8 24 -15.5 62.5t-11.5 65.5t-6 29q-13 15 -27 19q-7 2 -58.5 2t-138.5 -1t-128 -1 q-94 0 -127 -5q-10 -97 -8 -136l1 -152v52l3 -359l-1 -147q-1 -46 11 -85q49 -25 89 -32q2 0 18 -5t44 -13t43 -12q30 -8 50 -18q5 -45 5 -50q0 -10 -3 -29q-14 -1 -34 -1q-110 0 -187 10q-72 8 -238 8q-82 0 -233 -13q-45 -5 -70 -5q-2 22 -2 26l-1 26v9q21 33 79 49 q139 38 159 50q9 21 12 56q6 137 6 433l-5 44q0 265 -2 278q-2 11 -6 15q-6 5 -14 6q-38 6 -148 6q-50 0 -168.5 -14t-132.5 -24q-13 -9 -22 -33t-22 -75t-24 -84q-6 -19 -19.5 -32t-20.5 -13q-44 27 -56 44v297v86zM1505 113q26 -20 26 -49t-26 -49l-162 -126 q-26 -20 -44.5 -11t-18.5 42v80h-1024v-80q0 -33 -18.5 -42t-44.5 11l-162 126q-26 20 -26 49t26 49l162 126q26 20 44.5 11t18.5 -42v-80h1024v80q0 33 18.5 42t44.5 -11z" />
-<glyph unicode="&#xf036;" horiz-adv-x="1792" d="M1792 192v-128q0 -26 -19 -45t-45 -19h-1664q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1664q26 0 45 -19t19 -45zM1408 576v-128q0 -26 -19 -45t-45 -19h-1280q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1280q26 0 45 -19t19 -45zM1664 960v-128q0 -26 -19 -45 t-45 -19h-1536q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1536q26 0 45 -19t19 -45zM1280 1344v-128q0 -26 -19 -45t-45 -19h-1152q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1152q26 0 45 -19t19 -45z" />
-<glyph unicode="&#xf037;" horiz-adv-x="1792" d="M1792 192v-128q0 -26 -19 -45t-45 -19h-1664q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1664q26 0 45 -19t19 -45zM1408 576v-128q0 -26 -19 -45t-45 -19h-896q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h896q26 0 45 -19t19 -45zM1664 960v-128q0 -26 -19 -45t-45 -19 h-1408q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1408q26 0 45 -19t19 -45zM1280 1344v-128q0 -26 -19 -45t-45 -19h-640q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h640q26 0 45 -19t19 -45z" />
-<glyph unicode="&#xf038;" horiz-adv-x="1792" d="M1792 192v-128q0 -26 -19 -45t-45 -19h-1664q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1664q26 0 45 -19t19 -45zM1792 576v-128q0 -26 -19 -45t-45 -19h-1280q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1280q26 0 45 -19t19 -45zM1792 960v-128q0 -26 -19 -45 t-45 -19h-1536q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1536q26 0 45 -19t19 -45zM1792 1344v-128q0 -26 -19 -45t-45 -19h-1152q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1152q26 0 45 -19t19 -45z" />
-<glyph unicode="&#xf039;" horiz-adv-x="1792" d="M1792 192v-128q0 -26 -19 -45t-45 -19h-1664q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1664q26 0 45 -19t19 -45zM1792 576v-128q0 -26 -19 -45t-45 -19h-1664q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1664q26 0 45 -19t19 -45zM1792 960v-128q0 -26 -19 -45 t-45 -19h-1664q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1664q26 0 45 -19t19 -45zM1792 1344v-128q0 -26 -19 -45t-45 -19h-1664q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1664q26 0 45 -19t19 -45z" />
-<glyph unicode="&#xf03a;" horiz-adv-x="1792" d="M256 224v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-192q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h192q13 0 22.5 -9.5t9.5 -22.5zM256 608v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-192q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h192q13 0 22.5 -9.5 t9.5 -22.5zM256 992v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-192q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h192q13 0 22.5 -9.5t9.5 -22.5zM1792 224v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1344q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h1344 q13 0 22.5 -9.5t9.5 -22.5zM256 1376v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-192q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h192q13 0 22.5 -9.5t9.5 -22.5zM1792 608v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1344q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5 t22.5 9.5h1344q13 0 22.5 -9.5t9.5 -22.5zM1792 992v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1344q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h1344q13 0 22.5 -9.5t9.5 -22.5zM1792 1376v-192q0 -13 -9.5 -22.5t
 -22.5 -9.5h-1344q-13 0 -22.5 9.5t-9.5 22.5v192 q0 13 9.5 22.5t22.5 9.5h1344q13 0 22.5 -9.5t9.5 -22.5z" />
-<glyph unicode="&#xf03b;" horiz-adv-x="1792" d="M384 992v-576q0 -13 -9.5 -22.5t-22.5 -9.5q-14 0 -23 9l-288 288q-9 9 -9 23t9 23l288 288q9 9 23 9q13 0 22.5 -9.5t9.5 -22.5zM1792 224v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1728q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h1728q13 0 22.5 -9.5 t9.5 -22.5zM1792 608v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1088q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h1088q13 0 22.5 -9.5t9.5 -22.5zM1792 992v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1088q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h1088 q13 0 22.5 -9.5t9.5 -22.5zM1792 1376v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1728q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h1728q13 0 22.5 -9.5t9.5 -22.5z" />
-<glyph unicode="&#xf03c;" horiz-adv-x="1792" d="M352 704q0 -14 -9 -23l-288 -288q-9 -9 -23 -9q-13 0 -22.5 9.5t-9.5 22.5v576q0 13 9.5 22.5t22.5 9.5q14 0 23 -9l288 -288q9 -9 9 -23zM1792 224v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1728q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h1728q13 0 22.5 -9.5 t9.5 -22.5zM1792 608v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1088q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h1088q13 0 22.5 -9.5t9.5 -22.5zM1792 992v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1088q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h1088 q13 0 22.5 -9.5t9.5 -22.5zM1792 1376v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1728q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h1728q13 0 22.5 -9.5t9.5 -22.5z" />
-<glyph unicode="&#xf03d;" horiz-adv-x="1792" d="M1792 1184v-1088q0 -42 -39 -59q-13 -5 -25 -5q-27 0 -45 19l-403 403v-166q0 -119 -84.5 -203.5t-203.5 -84.5h-704q-119 0 -203.5 84.5t-84.5 203.5v704q0 119 84.5 203.5t203.5 84.5h704q119 0 203.5 -84.5t84.5 -203.5v-165l403 402q18 19 45 19q12 0 25 -5 q39 -17 39 -59z" />
-<glyph unicode="&#xf03e;" horiz-adv-x="1920" d="M640 960q0 -80 -56 -136t-136 -56t-136 56t-56 136t56 136t136 56t136 -56t56 -136zM1664 576v-448h-1408v192l320 320l160 -160l512 512zM1760 1280h-1600q-13 0 -22.5 -9.5t-9.5 -22.5v-1216q0 -13 9.5 -22.5t22.5 -9.5h1600q13 0 22.5 9.5t9.5 22.5v1216 q0 13 -9.5 22.5t-22.5 9.5zM1920 1248v-1216q0 -66 -47 -113t-113 -47h-1600q-66 0 -113 47t-47 113v1216q0 66 47 113t113 47h1600q66 0 113 -47t47 -113z" />
-<glyph unicode="&#xf040;" d="M363 0l91 91l-235 235l-91 -91v-107h128v-128h107zM886 928q0 22 -22 22q-10 0 -17 -7l-542 -542q-7 -7 -7 -17q0 -22 22 -22q10 0 17 7l542 542q7 7 7 17zM832 1120l416 -416l-832 -832h-416v416zM1515 1024q0 -53 -37 -90l-166 -166l-416 416l166 165q36 38 90 38 q53 0 91 -38l235 -234q37 -39 37 -91z" />
-<glyph unicode="&#xf041;" horiz-adv-x="1024" d="M768 896q0 106 -75 181t-181 75t-181 -75t-75 -181t75 -181t181 -75t181 75t75 181zM1024 896q0 -109 -33 -179l-364 -774q-16 -33 -47.5 -52t-67.5 -19t-67.5 19t-46.5 52l-365 774q-33 70 -33 179q0 212 150 362t362 150t362 -150t150 -362z" />
-<glyph unicode="&#xf042;" d="M768 96v1088q-148 0 -273 -73t-198 -198t-73 -273t73 -273t198 -198t273 -73zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
-<glyph unicode="&#xf043;" horiz-adv-x="1024" d="M512 384q0 36 -20 69q-1 1 -15.5 22.5t-25.5 38t-25 44t-21 50.5q-4 16 -21 16t-21 -16q-7 -23 -21 -50.5t-25 -44t-25.5 -38t-15.5 -22.5q-20 -33 -20 -69q0 -53 37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM1024 512q0 -212 -150 -362t-362 -150t-362 150t-150 362 q0 145 81 275q6 9 62.5 90.5t101 151t99.5 178t83 201.5q9 30 34 47t51 17t51.5 -17t33.5 -47q28 -93 83 -201.5t99.5 -178t101 -151t62.5 -90.5q81 -127 81 -275z" />
-<glyph unicode="&#xf044;" horiz-adv-x="1792" d="M888 352l116 116l-152 152l-116 -116v-56h96v-96h56zM1328 1072q-16 16 -33 -1l-350 -350q-17 -17 -1 -33t33 1l350 350q17 17 1 33zM1408 478v-190q0 -119 -84.5 -203.5t-203.5 -84.5h-832q-119 0 -203.5 84.5t-84.5 203.5v832q0 119 84.5 203.5t203.5 84.5h832 q63 0 117 -25q15 -7 18 -23q3 -17 -9 -29l-49 -49q-14 -14 -32 -8q-23 6 -45 6h-832q-66 0 -113 -47t-47 -113v-832q0 -66 47 -113t113 -47h832q66 0 113 47t47 113v126q0 13 9 22l64 64q15 15 35 7t20 -29zM1312 1216l288 -288l-672 -672h-288v288zM1756 1084l-92 -92 l-288 288l92 92q28 28 68 28t68 -28l152 -152q28 -28 28 -68t-28 -68z" />
-<glyph unicode="&#xf045;" horiz-adv-x="1664" d="M1408 547v-259q0 -119 -84.5 -203.5t-203.5 -84.5h-832q-119 0 -203.5 84.5t-84.5 203.5v832q0 119 84.5 203.5t203.5 84.5h255v0q13 0 22.5 -9.5t9.5 -22.5q0 -27 -26 -32q-77 -26 -133 -60q-10 -4 -16 -4h-112q-66 0 -113 -47t-47 -113v-832q0 -66 47 -113t113 -47h832 q66 0 113 47t47 113v214q0 19 18 29q28 13 54 37q16 16 35 8q21 -9 21 -29zM1645 1043l-384 -384q-18 -19 -45 -19q-12 0 -25 5q-39 17 -39 59v192h-160q-323 0 -438 -131q-119 -137 -74 -473q3 -23 -20 -34q-8 -2 -12 -2q-16 0 -26 13q-10 14 -21 31t-39.5 68.5t-49.5 99.5 t-38.5 114t-17.5 122q0 49 3.5 91t14 90t28 88t47 81.5t68.5 74t94.5 61.5t124.5 48.5t159.5 30.5t196.5 11h160v192q0 42 39 59q13 5 25 5q26 0 45 -19l384 -384q19 -19 19 -45t-19 -45z" />
-<glyph unicode="&#xf046;" horiz-adv-x="1664" d="M1408 606v-318q0 -119 -84.5 -203.5t-203.5 -84.5h-832q-119 0 -203.5 84.5t-84.5 203.5v832q0 119 84.5 203.5t203.5 84.5h832q63 0 117 -25q15 -7 18 -23q3 -17 -9 -29l-49 -49q-10 -10 -23 -10q-3 0 -9 2q-23 6 -45 6h-832q-66 0 -113 -47t-47 -113v-832 q0 -66 47 -113t113 -47h832q66 0 113 47t47 113v254q0 13 9 22l64 64q10 10 23 10q6 0 12 -3q20 -8 20 -29zM1639 1095l-814 -814q-24 -24 -57 -24t-57 24l-430 430q-24 24 -24 57t24 57l110 110q24 24 57 24t57 -24l263 -263l647 647q24 24 57 24t57 -24l110 -110 q24 -24 24 -57t-24 -57z" />
-<glyph unicode="&#xf047;" horiz-adv-x="1792" d="M1792 640q0 -26 -19 -45l-256 -256q-19 -19 -45 -19t-45 19t-19 45v128h-384v-384h128q26 0 45 -19t19 -45t-19 -45l-256 -256q-19 -19 -45 -19t-45 19l-256 256q-19 19 -19 45t19 45t45 19h128v384h-384v-128q0 -26 -19 -45t-45 -19t-45 19l-256 256q-19 19 -19 45 t19 45l256 256q19 19 45 19t45 -19t19 -45v-128h384v384h-128q-26 0 -45 19t-19 45t19 45l256 256q19 19 45 19t45 -19l256 -256q19 -19 19 -45t-19 -45t-45 -19h-128v-384h384v128q0 26 19 45t45 19t45 -19l256 -256q19 -19 19 -45z" />
-<glyph unicode="&#xf048;" horiz-adv-x="1024" d="M979 1395q19 19 32 13t13 -32v-1472q0 -26 -13 -32t-32 13l-710 710q-9 9 -13 19v-678q0 -26 -19 -45t-45 -19h-128q-26 0 -45 19t-19 45v1408q0 26 19 45t45 19h128q26 0 45 -19t19 -45v-678q4 11 13 19z" />
-<glyph unicode="&#xf049;" horiz-adv-x="1792" d="M1747 1395q19 19 32 13t13 -32v-1472q0 -26 -13 -32t-32 13l-710 710q-9 9 -13 19v-710q0 -26 -13 -32t-32 13l-710 710q-9 9 -13 19v-678q0 -26 -19 -45t-45 -19h-128q-26 0 -45 19t-19 45v1408q0 26 19 45t45 19h128q26 0 45 -19t19 -45v-678q4 11 13 19l710 710 q19 19 32 13t13 -32v-710q4 11 13 19z" />
-<glyph unicode="&#xf04a;" horiz-adv-x="1664" d="M1619 1395q19 19 32 13t13 -32v-1472q0 -26 -13 -32t-32 13l-710 710q-8 9 -13 19v-710q0 -26 -13 -32t-32 13l-710 710q-19 19 -19 45t19 45l710 710q19 19 32 13t13 -32v-710q5 11 13 19z" />
-<glyph unicode="&#xf04b;" horiz-adv-x="1408" d="M1384 609l-1328 -738q-23 -13 -39.5 -3t-16.5 36v1472q0 26 16.5 36t39.5 -3l1328 -738q23 -13 23 -31t-23 -31z" />
-<glyph unicode="&#xf04c;" d="M1536 1344v-1408q0 -26 -19 -45t-45 -19h-512q-26 0 -45 19t-19 45v1408q0 26 19 45t45 19h512q26 0 45 -19t19 -45zM640 1344v-1408q0 -26 -19 -45t-45 -19h-512q-26 0 -45 19t-19 45v1408q0 26 19 45t45 19h512q26 0 45 -19t19 -45z" />
-<glyph unicode="&#xf04d;" d="M1536 1344v-1408q0 -26 -19 -45t-45 -19h-1408q-26 0 -45 19t-19 45v1408q0 26 19 45t45 19h1408q26 0 45 -19t19 -45z" />
-<glyph unicode="&#xf04e;" horiz-adv-x="1664" d="M45 -115q-19 -19 -32 -13t-13 32v1472q0 26 13 32t32 -13l710 -710q8 -8 13 -19v710q0 26 13 32t32 -13l710 -710q19 -19 19 -45t-19 -45l-710 -710q-19 -19 -32 -13t-13 32v710q-5 -10 -13 -19z" />
-<glyph unicode="&#xf050;" horiz-adv-x="1792" d="M45 -115q-19 -19 -32 -13t-13 32v1472q0 26 13 32t32 -13l710 -710q8 -8 13 -19v710q0 26 13 32t32 -13l710 -710q8 -8 13 -19v678q0 26 19 45t45 19h128q26 0 45 -19t19 -45v-1408q0 -26 -19 -45t-45 -19h-128q-26 0 -45 19t-19 45v678q-5 -10 -13 -19l-710 -710 q-19 -19 -32 -13t-13 32v710q-5 -10 -13 -19z" />
-<glyph unicode="&#xf051;" horiz-adv-x="1024" d="M45 -115q-19 -19 -32 -13t-13 32v1472q0 26 13 32t32 -13l710 -710q8 -8 13 -19v678q0 26 19 45t45 19h128q26 0 45 -19t19 -45v-1408q0 -26 -19 -45t-45 -19h-128q-26 0 -45 19t-19 45v678q-5 -10 -13 -19z" />
-<glyph unicode="&#xf052;" horiz-adv-x="1538" d="M14 557l710 710q19 19 45 19t45 -19l710 -710q19 -19 13 -32t-32 -13h-1472q-26 0 -32 13t13 32zM1473 0h-1408q-26 0 -45 19t-19 45v256q0 26 19 45t45 19h1408q26 0 45 -19t19 -45v-256q0 -26 -19 -45t-45 -19z" />
-<glyph unicode="&#xf053;" horiz-adv-x="1152" d="M742 -37l-652 651q-37 37 -37 90.5t37 90.5l652 651q37 37 90.5 37t90.5 -37l75 -75q37 -37 37 -90.5t-37 -90.5l-486 -486l486 -485q37 -38 37 -91t-37 -90l-75 -75q-37 -37 -90.5 -37t-90.5 37z" />
-<glyph unicode="&#xf054;" horiz-adv-x="1152" d="M1099 704q0 -52 -37 -91l-652 -651q-37 -37 -90 -37t-90 37l-76 75q-37 39 -37 91q0 53 37 90l486 486l-486 485q-37 39 -37 91q0 53 37 90l76 75q36 38 90 38t90 -38l652 -651q37 -37 37 -90z" />
-<glyph unicode="&#xf055;" d="M1216 576v128q0 26 -19 45t-45 19h-256v256q0 26 -19 45t-45 19h-128q-26 0 -45 -19t-19 -45v-256h-256q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45t45 -19h256v-256q0 -26 19 -45t45 -19h128q26 0 45 19t19 45v256h256q26 0 45 19t19 45zM1536 640q0 -209 -103 -385.5 t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
-<glyph unicode="&#xf056;" d="M1216 576v128q0 26 -19 45t-45 19h-768q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45t45 -19h768q26 0 45 19t19 45zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5 t103 -385.5z" />
-<glyph unicode="&#xf057;" d="M1149 414q0 26 -19 45l-181 181l181 181q19 19 19 45q0 27 -19 46l-90 90q-19 19 -46 19q-26 0 -45 -19l-181 -181l-181 181q-19 19 -45 19q-27 0 -46 -19l-90 -90q-19 -19 -19 -46q0 -26 19 -45l181 -181l-181 -181q-19 -19 -19 -45q0 -27 19 -46l90 -90q19 -19 46 -19 q26 0 45 19l181 181l181 -181q19 -19 45 -19q27 0 46 19l90 90q19 19 19 46zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
-<glyph unicode="&#xf058;" d="M1284 802q0 28 -18 46l-91 90q-19 19 -45 19t-45 -19l-408 -407l-226 226q-19 19 -45 19t-45 -19l-91 -90q-18 -18 -18 -46q0 -27 18 -45l362 -362q19 -19 45 -19q27 0 46 19l543 543q18 18 18 45zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103 t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
-<glyph unicode="&#xf059;" d="M896 160v192q0 14 -9 23t-23 9h-192q-14 0 -23 -9t-9 -23v-192q0 -14 9 -23t23 -9h192q14 0 23 9t9 23zM1152 832q0 88 -55.5 163t-138.5 116t-170 41q-243 0 -371 -213q-15 -24 8 -42l132 -100q7 -6 19 -6q16 0 25 12q53 68 86 92q34 24 86 24q48 0 85.5 -26t37.5 -59 q0 -38 -20 -61t-68 -45q-63 -28 -115.5 -86.5t-52.5 -125.5v-36q0 -14 9 -23t23 -9h192q14 0 23 9t9 23q0 19 21.5 49.5t54.5 49.5q32 18 49 28.5t46 35t44.5 48t28 60.5t12.5 81zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5 t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
-<glyph unicode="&#xf05a;" d="M1024 160v160q0 14 -9 23t-23 9h-96v512q0 14 -9 23t-23 9h-320q-14 0 -23 -9t-9 -23v-160q0 -14 9 -23t23 -9h96v-320h-96q-14 0 -23 -9t-9 -23v-160q0 -14 9 -23t23 -9h448q14 0 23 9t9 23zM896 1056v160q0 14 -9 23t-23 9h-192q-14 0 -23 -9t-9 -23v-160q0 -14 9 -23 t23 -9h192q14 0 23 9t9 23zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
-<glyph unicode="&#xf05b;" d="M1197 512h-109q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h109q-32 108 -112.5 188.5t-188.5 112.5v-109q0 -26 -19 -45t-45 -19h-128q-26 0 -45 19t-19 45v109q-108 -32 -188.5 -112.5t-112.5 -188.5h109q26 0 45 -19t19 -45v-128q0 -26 -19 -45t-45 -19h-109 q32 -108 112.5 -188.5t188.5 -112.5v109q0 26 19 45t45 19h128q26 0 45 -19t19 -45v-109q108 32 188.5 112.5t112.5 188.5zM1536 704v-128q0 -26 -19 -45t-45 -19h-143q-37 -161 -154.5 -278.5t-278.5 -154.5v-143q0 -26 -19 -45t-45 -19h-128q-26 0 -45 19t-19 45v143 q-161 37 -278.5 154.5t-154.5 278.5h-143q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h143q37 161 154.5 278.5t278.5 154.5v143q0 26 19 45t45 19h128q26 0 45 -19t19 -45v-143q161 -37 278.5 -154.5t154.5 -278.5h143q26 0 45 -19t19 -45z" />
-<glyph unicode="&#xf05c;" d="M1097 457l-146 -146q-10 -10 -23 -10t-23 10l-137 137l-137 -137q-10 -10 -23 -10t-23 10l-146 146q-10 10 -10 23t10 23l137 137l-137 137q-10 10 -10 23t10 23l146 146q10 10 23 10t23 -10l137 -137l137 137q10 10 23 10t23 -10l146 -146q10 -10 10 -23t-10 -23 l-137 -137l137 -137q10 -10 10 -23t-10 -23zM1312 640q0 148 -73 273t-198 198t-273 73t-273 -73t-198 -198t-73 -273t73 -273t198 -198t273 -73t273 73t198 198t73 273zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5 t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
-<glyph unicode="&#xf05d;" d="M1171 723l-422 -422q-19 -19 -45 -19t-45 19l-294 294q-19 19 -19 45t19 45l102 102q19 19 45 19t45 -19l147 -147l275 275q19 19 45 19t45 -19l102 -102q19 -19 19 -45t-19 -45zM1312 640q0 148 -73 273t-198 198t-273 73t-273 -73t-198 -198t-73 -273t73 -273t198 -198 t273 -73t273 73t198 198t73 273zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
-<glyph unicode="&#xf05e;" d="M1312 643q0 161 -87 295l-754 -753q137 -89 297 -89q111 0 211.5 43.5t173.5 116.5t116 174.5t43 212.5zM313 344l755 754q-135 91 -300 91q-148 0 -273 -73t-198 -199t-73 -274q0 -162 89 -299zM1536 643q0 -157 -61 -300t-163.5 -246t-245 -164t-298.5 -61t-298.5 61 t-245 164t-163.5 246t-61 300t61 299.5t163.5 245.5t245 164t298.5 61t298.5 -61t245 -164t163.5 -245.5t61 -299.5z" />
-<glyph unicode="&#xf060;" d="M1536 640v-128q0 -53 -32.5 -90.5t-84.5 -37.5h-704l293 -294q38 -36 38 -90t-38 -90l-75 -76q-37 -37 -90 -37q-52 0 -91 37l-651 652q-37 37 -37 90q0 52 37 91l651 650q38 38 91 38q52 0 90 -38l75 -74q38 -38 38 -91t-38 -91l-293 -293h704q52 0 84.5 -37.5 t32.5 -90.5z" />
-<glyph unicode="&#xf061;" d="M1472 576q0 -54 -37 -91l-651 -651q-39 -37 -91 -37q-51 0 -90 37l-75 75q-38 38 -38 91t38 91l293 293h-704q-52 0 -84.5 37.5t-32.5 90.5v128q0 53 32.5 90.5t84.5 37.5h704l-293 294q-38 36 -38 90t38 90l75 75q38 38 90 38q53 0 91 -38l651 -651q37 -35 37 -90z" />
-<glyph unicode="&#xf062;" horiz-adv-x="1664" d="M1611 565q0 -51 -37 -90l-75 -75q-38 -38 -91 -38q-54 0 -90 38l-294 293v-704q0 -52 -37.5 -84.5t-90.5 -32.5h-128q-53 0 -90.5 32.5t-37.5 84.5v704l-294 -293q-36 -38 -90 -38t-90 38l-75 75q-38 38 -38 90q0 53 38 91l651 651q35 37 90 37q54 0 91 -37l651 -651 q37 -39 37 -91z" />
-<glyph unicode="&#xf063;" horiz-adv-x="1664" d="M1611 704q0 -53 -37 -90l-651 -652q-39 -37 -91 -37q-53 0 -90 37l-651 652q-38 36 -38 90q0 53 38 91l74 75q39 37 91 37q53 0 90 -37l294 -294v704q0 52 38 90t90 38h128q52 0 90 -38t38 -90v-704l294 294q37 37 90 37q52 0 91 -37l75 -75q37 -39 37 -91z" />
-<glyph unicode="&#xf064;" horiz-adv-x="1792" d="M1792 896q0 -26 -19 -45l-512 -512q-19 -19 -45 -19t-45 19t-19 45v256h-224q-98 0 -175.5 -6t-154 -21.5t-133 -42.5t-105.5 -69.5t-80 -101t-48.5 -138.5t-17.5 -181q0 -55 5 -123q0 -6 2.5 -23.5t2.5 -26.5q0 -15 -8.5 -25t-23.5 -10q-16 0 -28 17q-7 9 -13 22 t-13.5 30t-10.5 24q-127 285 -127 451q0 199 53 333q162 403 875 403h224v256q0 26 19 45t45 19t45 -19l512 -512q19 -19 19 -45z" />
-<glyph unicode="&#xf065;" d="M755 480q0 -13 -10 -23l-332 -332l144 -144q19 -19 19 -45t-19 -45t-45 -19h-448q-26 0 -45 19t-19 45v448q0 26 19 45t45 19t45 -19l144 -144l332 332q10 10 23 10t23 -10l114 -114q10 -10 10 -23zM1536 1344v-448q0 -26 -19 -45t-45 -19t-45 19l-144 144l-332 -332 q-10 -10 -23 -10t-23 10l-114 114q-10 10 -10 23t10 23l332 332l-144 144q-19 19 -19 45t19 45t45 19h448q26 0 45 -19t19 -45z" />
-<glyph unicode="&#xf066;" d="M768 576v-448q0 -26 -19 -45t-45 -19t-45 19l-144 144l-332 -332q-10 -10 -23 -10t-23 10l-114 114q-10 10 -10 23t10 23l332 332l-144 144q-19 19 -19 45t19 45t45 19h448q26 0 45 -19t19 -45zM1523 1248q0 -13 -10 -23l-332 -332l144 -144q19 -19 19 -45t-19 -45 t-45 -19h-448q-26 0 -45 19t-19 45v448q0 26 19 45t45 19t45 -19l144 -144l332 332q10 10 23 10t23 -10l114 -114q10 -10 10 -23z" />
-<glyph unicode="&#xf067;" horiz-adv-x="1408" d="M1408 800v-192q0 -40 -28 -68t-68 -28h-416v-416q0 -40 -28 -68t-68 -28h-192q-40 0 -68 28t-28 68v416h-416q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h416v416q0 40 28 68t68 28h192q40 0 68 -28t28 -68v-416h416q40 0 68 -28t28 -68z" />
-<glyph unicode="&#xf068;" horiz-adv-x="1408" d="M1408 800v-192q0 -40 -28 -68t-68 -28h-1216q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h1216q40 0 68 -28t28 -68z" />
-<glyph unicode="&#xf069;" horiz-adv-x="1664" d="M1482 486q46 -26 59.5 -77.5t-12.5 -97.5l-64 -110q-26 -46 -77.5 -59.5t-97.5 12.5l-266 153v-307q0 -52 -38 -90t-90 -38h-128q-52 0 -90 38t-38 90v307l-266 -153q-46 -26 -97.5 -12.5t-77.5 59.5l-64 110q-26 46 -12.5 97.5t59.5 77.5l266 154l-266 154 q-46 26 -59.5 77.5t12.5 97.5l64 110q26 46 77.5 59.5t97.5 -12.5l266 -153v307q0 52 38 90t90 38h128q52 0 90 -38t38 -90v-307l266 153q46 26 97.5 12.5t77.5 -59.5l64 -110q26 -46 12.5 -97.5t-59.5 -77.5l-266 -154z" />
-<glyph unicode="&#xf06a;" d="M768 1408q209 0 385.5 -103t279.5 -279.5t103 -385.5t-103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103zM896 161v190q0 14 -9 23.5t-22 9.5h-192q-13 0 -23 -10t-10 -23v-190q0 -13 10 -23t23 -10h192 q13 0 22 9.5t9 23.5zM894 505l18 621q0 12 -10 18q-10 8 -24 8h-220q-14 0 -24 -8q-10 -6 -10 -18l17 -621q0 -10 10 -17.5t24 -7.5h185q14 0 23.5 7.5t10.5 17.5z" />
-<glyph unicode="&#xf06b;" d="M928 180v56v468v192h-320v-192v-468v-56q0 -25 18 -38.5t46 -13.5h192q28 0 46 13.5t18 38.5zM472 1024h195l-126 161q-26 31 -69 31q-40 0 -68 -28t-28 -68t28 -68t68 -28zM1160 1120q0 40 -28 68t-68 28q-43 0 -69 -31l-125 -161h194q40 0 68 28t28 68zM1536 864v-320 q0 -14 -9 -23t-23 -9h-96v-416q0 -40 -28 -68t-68 -28h-1088q-40 0 -68 28t-28 68v416h-96q-14 0 -23 9t-9 23v320q0 14 9 23t23 9h440q-93 0 -158.5 65.5t-65.5 158.5t65.5 158.5t158.5 65.5q107 0 168 -77l128 -165l128 165q61 77 168 77q93 0 158.5 -65.5t65.5 -158.5 t-65.5 -158.5t-158.5 -65.5h440q14 0 23 -9t9 -23z" />
-<glyph unicode="&#xf06c;" horiz-adv-x="1792" d="M1280 832q0 26 -19 45t-45 19q-172 0 -318 -49.5t-259.5 -134t-235.5 -219.5q-19 -21 -19 -45q0 -26 19 -45t45 -19q24 0 45 19q27 24 74 71t67 66q137 124 268.5 176t313.5 52q26 0 45 19t19 45zM1792 1030q0 -95 -20 -193q-46 -224 -184.5 -383t-357.5 -268 q-214 -108 -438 -108q-148 0 -286 47q-15 5 -88 42t-96 37q-16 0 -39.5 -32t-45 -70t-52.5 -70t-60 -32q-30 0 -51 11t-31 24t-27 42q-2 4 -6 11t-5.5 10t-3 9.5t-1.5 13.5q0 35 31 73.5t68 65.5t68 56t31 48q0 4 -14 38t-16 44q-9 51 -9 104q0 115 43.5 220t119 184.5 t170.5 139t204 95.5q55 18 145 25.5t179.5 9t178.5 6t163.5 24t113.5 56.5l29.5 29.5t29.5 28t27 20t36.5 16t43.5 4.5q39 0 70.5 -46t47.5 -112t24 -124t8 -96z" />
-<glyph unicode="&#xf06d;" horiz-adv-x="1408" d="M1408 -160v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-1344q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h1344q13 0 22.5 -9.5t9.5 -22.5zM1152 896q0 -78 -24.5 -144t-64 -112.5t-87.5 -88t-96 -77.5t-87.5 -72t-64 -81.5t-24.5 -96.5q0 -96 67 -224l-4 1l1 -1 q-90 41 -160 83t-138.5 100t-113.5 122.5t-72.5 150.5t-27.5 184q0 78 24.5 144t64 112.5t87.5 88t96 77.5t87.5 72t64 81.5t24.5 96.5q0 94 -66 224l3 -1l-1 1q90 -41 160 -83t138.5 -100t113.5 -122.5t72.5 -150.5t27.5 -184z" />
-<glyph unicode="&#xf06e;" horiz-adv-x="1792" d="M1664 576q-152 236 -381 353q61 -104 61 -225q0 -185 -131.5 -316.5t-316.5 -131.5t-316.5 131.5t-131.5 316.5q0 121 61 225q-229 -117 -381 -353q133 -205 333.5 -326.5t434.5 -121.5t434.5 121.5t333.5 326.5zM944 960q0 20 -14 34t-34 14q-125 0 -214.5 -89.5 t-89.5 -214.5q0 -20 14 -34t34 -14t34 14t14 34q0 86 61 147t147 61q20 0 34 14t14 34zM1792 576q0 -34 -20 -69q-140 -230 -376.5 -368.5t-499.5 -138.5t-499.5 139t-376.5 368q-20 35 -20 69t20 69q140 229 376.5 368t499.5 139t499.5 -139t376.5 -368q20 -35 20 -69z" />
-<glyph unicode="&#xf070;" horiz-adv-x="1792" d="M555 201l78 141q-87 63 -136 159t-49 203q0 121 61 225q-229 -117 -381 -353q167 -258 427 -375zM944 960q0 20 -14 34t-34 14q-125 0 -214.5 -89.5t-89.5 -214.5q0 -20 14 -34t34 -14t34 14t14 34q0 86 61 147t147 61q20 0 34 14t14 34zM1307 1151q0 -7 -1 -9 q-105 -188 -315 -566t-316 -567l-49 -89q-10 -16 -28 -16q-12 0 -134 70q-16 10 -16 28q0 12 44 87q-143 65 -263.5 173t-208.5 245q-20 31 -20 69t20 69q153 235 380 371t496 136q89 0 180 -17l54 97q10 16 28 16q5 0 18 -6t31 -15.5t33 -18.5t31.5 -18.5t19.5 -11.5 q16 -10 16 -27zM1344 704q0 -139 -79 -253.5t-209 -164.5l280 502q8 -45 8 -84zM1792 576q0 -35 -20 -69q-39 -64 -109 -145q-150 -172 -347.5 -267t-419.5 -95l74 132q212 18 392.5 137t301.5 307q-115 179 -282 294l63 112q95 -64 182.5 -153t144.5 -184q20 -34 20 -69z " />
-<glyph unicode="&#xf071;" horiz-adv-x="1792" d="M1024 161v190q0 14 -9.5 23.5t-22.5 9.5h-192q-13 0 -22.5 -9.5t-9.5 -23.5v-190q0 -14 9.5 -23.5t22.5 -9.5h192q13 0 22.5 9.5t9.5 23.5zM1022 535l18 459q0 12 -10 19q-13 11 -24 11h-220q-11 0 -24 -11q-10 -7 -10 -21l17 -457q0 -10 10 -16.5t24 -6.5h185 q14 0 23.5 6.5t10.5 16.5zM1008 1469l768 -1408q35 -63 -2 -126q-17 -29 -46.5 -46t-63.5 -17h-1536q-34 0 -63.5 17t-46.5 46q-37 63 -2 126l768 1408q17 31 47 49t65 18t65 -18t47 -49z" />
-<glyph unicode="&#xf072;" horiz-adv-x="1408" d="M1376 1376q44 -52 12 -148t-108 -172l-161 -161l160 -696q5 -19 -12 -33l-128 -96q-7 -6 -19 -6q-4 0 -7 1q-15 3 -21 16l-279 508l-259 -259l53 -194q5 -17 -8 -31l-96 -96q-9 -9 -23 -9h-2q-15 2 -24 13l-189 252l-252 189q-11 7 -13 23q-1 13 9 25l96 97q9 9 23 9 q6 0 8 -1l194 -53l259 259l-508 279q-14 8 -17 24q-2 16 9 27l128 128q14 13 30 8l665 -159l160 160q76 76 172 108t148 -12z" />
-<glyph unicode="&#xf073;" horiz-adv-x="1664" d="M128 -128h288v288h-288v-288zM480 -128h320v288h-320v-288zM128 224h288v320h-288v-320zM480 224h320v320h-320v-320zM128 608h288v288h-288v-288zM864 -128h320v288h-320v-288zM480 608h320v288h-320v-288zM1248 -128h288v288h-288v-288zM864 224h320v320h-320v-320z M512 1088v288q0 13 -9.5 22.5t-22.5 9.5h-64q-13 0 -22.5 -9.5t-9.5 -22.5v-288q0 -13 9.5 -22.5t22.5 -9.5h64q13 0 22.5 9.5t9.5 22.5zM1248 224h288v320h-288v-320zM864 608h320v288h-320v-288zM1248 608h288v288h-288v-288zM1280 1088v288q0 13 -9.5 22.5t-22.5 9.5h-64 q-13 0 -22.5 -9.5t-9.5 -22.5v-288q0 -13 9.5 -22.5t22.5 -9.5h64q13 0 22.5 9.5t9.5 22.5zM1664 1152v-1280q0 -52 -38 -90t-90 -38h-1408q-52 0 -90 38t-38 90v1280q0 52 38 90t90 38h128v96q0 66 47 113t113 47h64q66 0 113 -47t47 -113v-96h384v96q0 66 47 113t113 47 h64q66 0 113 -47t47 -113v-96h128q52 0 90 -38t38 -90z" />
-<glyph unicode="&#xf074;" horiz-adv-x="1792" d="M666 1055q-60 -92 -137 -273q-22 45 -37 72.5t-40.5 63.5t-51 56.5t-63 35t-81.5 14.5h-224q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h224q250 0 410 -225zM1792 256q0 -14 -9 -23l-320 -320q-9 -9 -23 -9q-13 0 -22.5 9.5t-9.5 22.5v192q-32 0 -85 -0.5t-81 -1t-73 1 t-71 5t-64 10.5t-63 18.5t-58 28.5t-59 40t-55 53.5t-56 69.5q59 93 136 273q22 -45 37 -72.5t40.5 -63.5t51 -56.5t63 -35t81.5 -14.5h256v192q0 14 9 23t23 9q12 0 24 -10l319 -319q9 -9 9 -23zM1792 1152q0 -14 -9 -23l-320 -320q-9 -9 -23 -9q-13 0 -22.5 9.5t-9.5 22.5 v192h-256q-48 0 -87 -15t-69 -45t-51 -61.5t-45 -77.5q-32 -62 -78 -171q-29 -66 -49.5 -111t-54 -105t-64 -100t-74 -83t-90 -68.5t-106.5 -42t-128 -16.5h-224q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h224q48 0 87 15t69 45t51 61.5t45 77.5q32 62 78 171q29 66 49.5 111 t54 105t64 100t74 83t90 68.5t106.5 42t128 16.5h256v192q0 14 9 23t23 9q12 0 24 -10l319 -319q9 -9 9 -23z" />
-<glyph unicode="&#xf075;" horiz-adv-x="1792" d="M1792 640q0 -174 -120 -321.5t-326 -233t-450 -85.5q-70 0 -145 8q-198 -175 -460 -242q-49 -14 -114 -22q-17 -2 -30.5 9t-17.5 29v1q-3 4 -0.5 12t2 10t4.5 9.5l6 9t7 8.5t8 9q7 8 31 34.5t34.5 38t31 39.5t32.5 51t27 59t26 76q-157 89 -247.5 220t-90.5 281 q0 130 71 248.5t191 204.5t286 136.5t348 50.5q244 0 450 -85.5t326 -233t120 -321.5z" />
-<glyph unicode="&#xf076;" d="M1536 704v-128q0 -201 -98.5 -362t-274 -251.5t-395.5 -90.5t-395.5 90.5t-274 251.5t-98.5 362v128q0 26 19 45t45 19h384q26 0 45 -19t19 -45v-128q0 -52 23.5 -90t53.5 -57t71 -30t64 -13t44 -2t44 2t64 13t71 30t53.5 57t23.5 90v128q0 26 19 45t45 19h384 q26 0 45 -19t19 -45zM512 1344v-384q0 -26 -19 -45t-45 -19h-384q-26 0 -45 19t-19 45v384q0 26 19 45t45 19h384q26 0 45 -19t19 -45zM1536 1344v-384q0 -26 -19 -45t-45 -19h-384q-26 0 -45 19t-19 45v384q0 26 19 45t45 19h384q26 0 45 -19t19 -45z" />
-<glyph unicode="&#xf077;" horiz-adv-x="1664" d="M1611 320q0 -53 -37 -90l-75 -75q-38 -38 -91 -38q-54 0 -90 38l-486 485l-486 -485q-36 -38 -90 -38t-90 38l-75 75q-38 36 -38 90q0 53 38 91l651 651q37 37 90 37q52 0 91 -37l650 -651q38 -38 38 -91z" />
-<glyph unicode="&#xf078;" horiz-adv-x="1664" d="M1611 832q0 -53 -37 -90l-651 -651q-38 -38 -91 -38q-54 0 -90 38l-651 651q-38 36 -38 90q0 53 38 91l74 75q39 37 91 37q53 0 90 -37l486 -486l486 486q37 37 90 37q52 0 91 -37l75 -75q37 -39 37 -91z" />
-<glyph unicode="&#xf079;" horiz-adv-x="1920" d="M1280 32q0 -13 -9.5 -22.5t-22.5 -9.5h-960q-8 0 -13.5 2t-9 7t-5.5 8t-3 11.5t-1 11.5v13v11v160v416h-192q-26 0 -45 19t-19 45q0 24 15 41l320 384q19 22 49 22t49 -22l320 -384q15 -17 15 -41q0 -26 -19 -45t-45 -19h-192v-384h576q16 0 25 -11l160 -192q7 -11 7 -21 zM1920 448q0 -24 -15 -41l-320 -384q-20 -23 -49 -23t-49 23l-320 384q-15 17 -15 41q0 26 19 45t45 19h192v384h-576q-16 0 -25 12l-160 192q-7 9 -7 20q0 13 9.5 22.5t22.5 9.5h960q8 0 13.5 -2t9 -7t5.5 -8t3 -11.5t1 -11.5v-13v-11v-160v-416h192q26 0 45 -19t19 -45z " />
-<glyph unicode="&#xf07a;" horiz-adv-x="1664" d="M640 0q0 -53 -37.5 -90.5t-90.5 -37.5t-90.5 37.5t-37.5 90.5t37.5 90.5t90.5 37.5t90.5 -37.5t37.5 -90.5zM1536 0q0 -53 -37.5 -90.5t-90.5 -37.5t-90.5 37.5t-37.5 90.5t37.5 90.5t90.5 37.5t90.5 -37.5t37.5 -90.5zM1664 1088v-512q0 -24 -16 -42.5t-41 -21.5 l-1044 -122q1 -7 4.5 -21.5t6 -26.5t2.5 -22q0 -16 -24 -64h920q26 0 45 -19t19 -45t-19 -45t-45 -19h-1024q-26 0 -45 19t-19 45q0 14 11 39.5t29.5 59.5t20.5 38l-177 823h-204q-26 0 -45 19t-19 45t19 45t45 19h256q16 0 28.5 -6.5t20 -15.5t13 -24.5t7.5 -26.5 t5.5 -29.5t4.5 -25.5h1201q26 0 45 -19t19 -45z" />
-<glyph unicode="&#xf07b;" horiz-adv-x="1664" d="M1664 928v-704q0 -92 -66 -158t-158 -66h-1216q-92 0 -158 66t-66 158v960q0 92 66 158t158 66h320q92 0 158 -66t66 -158v-32h672q92 0 158 -66t66 -158z" />
-<glyph unicode="&#xf07c;" horiz-adv-x="1920" d="M1879 584q0 -31 -31 -66l-336 -396q-43 -51 -120.5 -86.5t-143.5 -35.5h-1088q-34 0 -60.5 13t-26.5 43q0 31 31 66l336 396q43 51 120.5 86.5t143.5 35.5h1088q34 0 60.5 -13t26.5 -43zM1536 928v-160h-832q-94 0 -197 -47.5t-164 -119.5l-337 -396l-5 -6q0 4 -0.5 12.5 t-0.5 12.5v960q0 92 66 158t158 66h320q92 0 158 -66t66 -158v-32h544q92 0 158 -66t66 -158z" />
-<glyph unicode="&#xf07d;" horiz-adv-x="768" d="M704 1216q0 -26 -19 -45t-45 -19h-128v-1024h128q26 0 45 -19t19 -45t-19 -45l-256 -256q-19 -19 -45 -19t-45 19l-256 256q-19 19 -19 45t19 45t45 19h128v1024h-128q-26 0 -45 19t-19 45t19 45l256 256q19 19 45 19t45 -19l256 -256q19 -19 19 -45z" />
-<glyph unicode="&#xf07e;" horiz-adv-x="1792" d="M1792 640q0 -26 -19 -45l-256 -256q-19 -19 -45 -19t-45 19t-19 45v128h-1024v-128q0 -26 -19 -45t-45 -19t-45 19l-256 256q-19 19 -19 45t19 45l256 256q19 19 45 19t45 -19t19 -45v-128h1024v128q0 26 19 45t45 19t45 -19l256 -256q19 -19 19 -45z" />
-<glyph unicode="&#xf080;" horiz-adv-x="1920" d="M512 512v-384h-256v384h256zM896 1024v-896h-256v896h256zM1280 768v-640h-256v640h256zM1664 1152v-1024h-256v1024h256zM1792 32v1216q0 13 -9.5 22.5t-22.5 9.5h-1600q-13 0 -22.5 -9.5t-9.5 -22.5v-1216q0 -13 9.5 -22.5t22.5 -9.5h1600q13 0 22.5 9.5t9.5 22.5z M1920 1248v-1216q0 -66 -47 -113t-113 -47h-1600q-66 0 -113 47t-47 113v1216q0 66 47 113t113 47h1600q66 0 113 -47t47 -113z" />
-<glyph unicode="&#xf081;" d="M1280 926q-56 -25 -121 -34q68 40 93 117q-65 -38 -134 -51q-61 66 -153 66q-87 0 -148.5 -61.5t-61.5 -148.5q0 -29 5 -48q-129 7 -242 65t-192 155q-29 -50 -29 -106q0 -114 91 -175q-47 1 -100 26v-2q0 -75 50 -133.5t123 -72.5q-29 -8 -51 -8q-13 0 -39 4 q21 -63 74.5 -104t121.5 -42q-116 -90 -261 -90q-26 0 -50 3q148 -94 322 -94q112 0 210 35.5t168 95t120.5 137t75 162t24.5 168.5q0 18 -1 27q63 45 105 109zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5 t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
-<glyph unicode="&#xf082;" d="M1307 618l23 219h-198v109q0 49 15.5 68.5t71.5 19.5h110v219h-175q-152 0 -218 -72t-66 -213v-131h-131v-219h131v-635h262v635h175zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960 q119 0 203.5 -84.5t84.5 -203.5z" />
-<glyph unicode="&#xf083;" horiz-adv-x="1792" d="M928 704q0 14 -9 23t-23 9q-66 0 -113 -47t-47 -113q0 -14 9 -23t23 -9t23 9t9 23q0 40 28 68t68 28q14 0 23 9t9 23zM1152 574q0 -106 -75 -181t-181 -75t-181 75t-75 181t75 181t181 75t181 -75t75 -181zM128 0h1536v128h-1536v-128zM1280 574q0 159 -112.5 271.5 t-271.5 112.5t-271.5 -112.5t-112.5 -271.5t112.5 -271.5t271.5 -112.5t271.5 112.5t112.5 271.5zM256 1216h384v128h-384v-128zM128 1024h1536v118v138h-828l-64 -128h-644v-128zM1792 1280v-1280q0 -53 -37.5 -90.5t-90.5 -37.5h-1536q-53 0 -90.5 37.5t-37.5 90.5v1280 q0 53 37.5 90.5t90.5 37.5h1536q53 0 90.5 -37.5t37.5 -90.5z" />
-<glyph unicode="&#xf084;" horiz-adv-x="1792" d="M832 1024q0 80 -56 136t-136 56t-136 -56t-56 -136q0 -42 19 -83q-41 19 -83 19q-80 0 -136 -56t-56 -136t56 -136t136 -56t136 56t56 136q0 42 -19 83q41 -19 83 -19q80 0 136 56t56 136zM1683 320q0 -17 -49 -66t-66 -49q-9 0 -28.5 16t-36.5 33t-38.5 40t-24.5 26 l-96 -96l220 -220q28 -28 28 -68q0 -42 -39 -81t-81 -39q-40 0 -68 28l-671 671q-176 -131 -365 -131q-163 0 -265.5 102.5t-102.5 265.5q0 160 95 313t248 248t313 95q163 0 265.5 -102.5t102.5 -265.5q0 -189 -131 -365l355 -355l96 96q-3 3 -26 24.5t-40 38.5t-33 36.5 t-16 28.5q0 17 49 66t66 49q13 0 23 -10q6 -6 46 -44.5t82 -79.5t86.5 -86t73 -78t28.5 -41z" />
-<glyph unicode="&#xf085;" horiz-adv-x="1920" d="M896 640q0 106 -75 181t-181 75t-181 -75t-75 -181t75 -181t181 -75t181 75t75 181zM1664 128q0 52 -38 90t-90 38t-90 -38t-38 -90q0 -53 37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM1664 1152q0 52 -38 90t-90 38t-90 -38t-38 -90q0 -53 37.5 -90.5t90.5 -37.5 t90.5 37.5t37.5 90.5zM1280 731v-185q0 -10 -7 -19.5t-16 -10.5l-155 -24q-11 -35 -32 -76q34 -48 90 -115q7 -10 7 -20q0 -12 -7 -19q-23 -30 -82.5 -89.5t-78.5 -59.5q-11 0 -21 7l-115 90q-37 -19 -77 -31q-11 -108 -23 -155q-7 -24 -30 -24h-186q-11 0 -20 7.5t-10 17.5 l-23 153q-34 10 -75 31l-118 -89q-7 -7 -20 -7q-11 0 -21 8q-144 133 -144 160q0 9 7 19q10 14 41 53t47 61q-23 44 -35 82l-152 24q-10 1 -17 9.5t-7 19.5v185q0 10 7 19.5t16 10.5l155 24q11 35 32 76q-34 48 -90 115q-7 11 -7 20q0 12 7 20q22 30 82 89t79 59q11 0 21 -7 l115 -90q34 18 77 32q11 108 23 154q7 24 30 24h186q11 0 20 -7.5t10 -17.5l23 -153q34 -10 75 -31l118 89q8 7 20 7q11 0 21 -8q144 -133 144 -160q0 -9 -7 -19q-12 -16 -42 -54t-45 -60q23 -48 34 -82l152 
 -23q10 -2 17 -10.5t7 -19.5zM1920 198v-140q0 -16 -149 -31 q-12 -27 -30 -52q51 -113 51 -138q0 -4 -4 -7q-122 -71 -124 -71q-8 0 -46 47t-52 68q-20 -2 -30 -2t-30 2q-14 -21 -52 -68t-46 -47q-2 0 -124 71q-4 3 -4 7q0 25 51 138q-18 25 -30 52q-149 15 -149 31v140q0 16 149 31q13 29 30 52q-51 113 -51 138q0 4 4 7q4 2 35 20 t59 34t30 16q8 0 46 -46.5t52 -67.5q20 2 30 2t30 -2q51 71 92 112l6 2q4 0 124 -70q4 -3 4 -7q0 -25 -51 -138q17 -23 30 -52q149 -15 149 -31zM1920 1222v-140q0 -16 -149 -31q-12 -27 -30 -52q51 -113 51 -138q0 -4 -4 -7q-122 -71 -124 -71q-8 0 -46 47t-52 68 q-20 -2 -30 -2t-30 2q-14 -21 -52 -68t-46 -47q-2 0 -124 71q-4 3 -4 7q0 25 51 138q-18 25 -30 52q-149 15 -149 31v140q0 16 149 31q13 29 30 52q-51 113 -51 138q0 4 4 7q4 2 35 20t59 34t30 16q8 0 46 -46.5t52 -67.5q20 2 30 2t30 -2q51 71 92 112l6 2q4 0 124 -70 q4 -3 4 -7q0 -25 -51 -138q17 -23 30 -52q149 -15 149 -31z" />
-<glyph unicode="&#xf086;" horiz-adv-x="1792" d="M1408 768q0 -139 -94 -257t-256.5 -186.5t-353.5 -68.5q-86 0 -176 16q-124 -88 -278 -128q-36 -9 -86 -16h-3q-11 0 -20.5 8t-11.5 21q-1 3 -1 6.5t0.5 6.5t2 6l2.5 5t3.5 5.5t4 5t4.5 5t4 4.5q5 6 23 25t26 29.5t22.5 29t25 38.5t20.5 44q-124 72 -195 177t-71 224 q0 139 94 257t256.5 186.5t353.5 68.5t353.5 -68.5t256.5 -186.5t94 -257zM1792 512q0 -120 -71 -224.5t-195 -176.5q10 -24 20.5 -44t25 -38.5t22.5 -29t26 -29.5t23 -25q1 -1 4 -4.5t4.5 -5t4 -5t3.5 -5.5l2.5 -5t2 -6t0.5 -6.5t-1 -6.5q-3 -14 -13 -22t-22 -7 q-50 7 -86 16q-154 40 -278 128q-90 -16 -176 -16q-271 0 -472 132q58 -4 88 -4q161 0 309 45t264 129q125 92 192 212t67 254q0 77 -23 152q129 -71 204 -178t75 -230z" />
-<glyph unicode="&#xf087;" d="M256 192q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1408 768q0 51 -39 89.5t-89 38.5h-352q0 58 48 159.5t48 160.5q0 98 -32 145t-128 47q-26 -26 -38 -85t-30.5 -125.5t-59.5 -109.5q-22 -23 -77 -91q-4 -5 -23 -30t-31.5 -41t-34.5 -42.5 t-40 -44t-38.5 -35.5t-40 -27t-35.5 -9h-32v-640h32q13 0 31.5 -3t33 -6.5t38 -11t35 -11.5t35.5 -12.5t29 -10.5q211 -73 342 -73h121q192 0 192 167q0 26 -5 56q30 16 47.5 52.5t17.5 73.5t-18 69q53 50 53 119q0 25 -10 55.5t-25 47.5q32 1 53.5 47t21.5 81zM1536 769 q0 -89 -49 -163q9 -33 9 -69q0 -77 -38 -144q3 -21 3 -43q0 -101 -60 -178q1 -139 -85 -219.5t-227 -80.5h-36h-93q-96 0 -189.5 22.5t-216.5 65.5q-116 40 -138 40h-288q-53 0 -90.5 37.5t-37.5 90.5v640q0 53 37.5 90.5t90.5 37.5h274q36 24 137 155q58 75 107 128 q24 25 35.5 85.5t30.5 126.5t62 108q39 37 90 37q84 0 151 -32.5t102 -101.5t35 -186q0 -93 -48 -192h176q104 0 180 -76t76 -179z" />
-<glyph unicode="&#xf088;" d="M256 1088q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1408 512q0 35 -21.5 81t-53.5 47q15 17 25 47.5t10 55.5q0 69 -53 119q18 32 18 69t-17.5 73.5t-47.5 52.5q5 30 5 56q0 85 -49 126t-136 41h-128q-131 0 -342 -73q-5 -2 -29 -10.5 t-35.5 -12.5t-35 -11.5t-38 -11t-33 -6.5t-31.5 -3h-32v-640h32q16 0 35.5 -9t40 -27t38.5 -35.5t40 -44t34.5 -42.5t31.5 -41t23 -30q55 -68 77 -91q41 -43 59.5 -109.5t30.5 -125.5t38 -85q96 0 128 47t32 145q0 59 -48 160.5t-48 159.5h352q50 0 89 38.5t39 89.5z M1536 511q0 -103 -76 -179t-180 -76h-176q48 -99 48 -192q0 -118 -35 -186q-35 -69 -102 -101.5t-151 -32.5q-51 0 -90 37q-34 33 -54 82t-25.5 90.5t-17.5 84.5t-31 64q-48 50 -107 127q-101 131 -137 155h-274q-53 0 -90.5 37.5t-37.5 90.5v640q0 53 37.5 90.5t90.5 37.5 h288q22 0 138 40q128 44 223 66t200 22h112q140 0 226.5 -79t85.5 -216v-5q60 -77 60 -178q0 -22 -3 -43q38 -67 38 -144q0 -36 -9 -69q49 -74 49 -163z" />
-<glyph unicode="&#xf089;" horiz-adv-x="896" d="M832 1504v-1339l-449 -236q-22 -12 -40 -12q-21 0 -31.5 14.5t-10.5 35.5q0 6 2 20l86 500l-364 354q-25 27 -25 48q0 37 56 46l502 73l225 455q19 41 49 41z" />
-<glyph unicode="&#xf08a;" horiz-adv-x="1792" d="M1664 940q0 81 -21.5 143t-55 98.5t-81.5 59.5t-94 31t-98 8t-112 -25.5t-110.5 -64t-86.5 -72t-60 -61.5q-18 -22 -49 -22t-49 22q-24 28 -60 61.5t-86.5 72t-110.5 64t-112 25.5t-98 -8t-94 -31t-81.5 -59.5t-55 -98.5t-21.5 -143q0 -168 187 -355l581 -560l580 559 q188 188 188 356zM1792 940q0 -221 -229 -450l-623 -600q-18 -18 -44 -18t-44 18l-624 602q-10 8 -27.5 26t-55.5 65.5t-68 97.5t-53.5 121t-23.5 138q0 220 127 344t351 124q62 0 126.5 -21.5t120 -58t95.5 -68.5t76 -68q36 36 76 68t95.5 68.5t120 58t126.5 21.5 q224 0 351 -124t127 -344z" />
-<glyph unicode="&#xf08b;" horiz-adv-x="1664" d="M640 96q0 -4 1 -20t0.5 -26.5t-3 -23.5t-10 -19.5t-20.5 -6.5h-320q-119 0 -203.5 84.5t-84.5 203.5v704q0 119 84.5 203.5t203.5 84.5h320q13 0 22.5 -9.5t9.5 -22.5q0 -4 1 -20t0.5 -26.5t-3 -23.5t-10 -19.5t-20.5 -6.5h-320q-66 0 -113 -47t-47 -113v-704 q0 -66 47 -113t113 -47h288h11h13t11.5 -1t11.5 -3t8 -5.5t7 -9t2 -13.5zM1568 640q0 -26 -19 -45l-544 -544q-19 -19 -45 -19t-45 19t-19 45v288h-448q-26 0 -45 19t-19 45v384q0 26 19 45t45 19h448v288q0 26 19 45t45 19t45 -19l544 -544q19 -19 19 -45z" />
-<glyph unicode="&#xf08c;" d="M237 122h231v694h-231v-694zM483 1030q-1 52 -36 86t-93 34t-94.5 -34t-36.5 -86q0 -51 35.5 -85.5t92.5 -34.5h1q59 0 95 34.5t36 85.5zM1068 122h231v398q0 154 -73 233t-193 79q-136 0 -209 -117h2v101h-231q3 -66 0 -694h231v388q0 38 7 56q15 35 45 59.5t74 24.5 q116 0 116 -157v-371zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
-<glyph unicode="&#xf08d;" horiz-adv-x="1152" d="M480 672v448q0 14 -9 23t-23 9t-23 -9t-9 -23v-448q0 -14 9 -23t23 -9t23 9t9 23zM1152 320q0 -26 -19 -45t-45 -19h-429l-51 -483q-2 -12 -10.5 -20.5t-20.5 -8.5h-1q-27 0 -32 27l-76 485h-404q-26 0 -45 19t-19 45q0 123 78.5 221.5t177.5 98.5v512q-52 0 -90 38 t-38 90t38 90t90 38h640q52 0 90 -38t38 -90t-38 -90t-90 -38v-512q99 0 177.5 -98.5t78.5 -221.5z" />
-<glyph unicode="&#xf08e;" horiz-adv-x="1792" d="M1408 608v-320q0 -119 -84.5 -203.5t-203.5 -84.5h-832q-119 0 -203.5 84.5t-84.5 203.5v832q0 119 84.5 203.5t203.5 84.5h704q14 0 23 -9t9 -23v-64q0 -14 -9 -23t-23 -9h-704q-66 0 -113 -47t-47 -113v-832q0 -66 47 -113t113 -47h832q66 0 113 47t47 113v320 q0 14 9 23t23 9h64q14 0 23 -9t9 -23zM1792 1472v-512q0 -26 -19 -45t-45 -19t-45 19l-176 176l-652 -652q-10 -10 -23 -10t-23 10l-114 114q-10 10 -10 23t10 23l652 652l-176 176q-19 19 -19 45t19 45t45 19h512q26 0 45 -19t19 -45z" />
-<glyph unicode="&#xf090;" d="M1184 640q0 -26 -19 -45l-544 -544q-19 -19 -45 -19t-45 19t-19 45v288h-448q-26 0 -45 19t-19 45v384q0 26 19 45t45 19h448v288q0 26 19 45t45 19t45 -19l544 -544q19 -19 19 -45zM1536 992v-704q0 -119 -84.5 -203.5t-203.5 -84.5h-320q-13 0 -22.5 9.5t-9.5 22.5 q0 4 -1 20t-0.5 26.5t3 23.5t10 19.5t20.5 6.5h320q66 0 113 47t47 113v704q0 66 -47 113t-113 47h-288h-11h-13t-11.5 1t-11.5 3t-8 5.5t-7 9t-2 13.5q0 4 -1 20t-0.5 26.5t3 23.5t10 19.5t20.5 6.5h320q119 0 203.5 -84.5t84.5 -203.5z" />
-<glyph unicode="&#xf091;" horiz-adv-x="1664" d="M458 653q-74 162 -74 371h-256v-96q0 -78 94.5 -162t235.5 -113zM1536 928v96h-256q0 -209 -74 -371q141 29 235.5 113t94.5 162zM1664 1056v-128q0 -71 -41.5 -143t-112 -130t-173 -97.5t-215.5 -44.5q-42 -54 -95 -95q-38 -34 -52.5 -72.5t-14.5 -89.5q0 -54 30.5 -91 t97.5 -37q75 0 133.5 -45.5t58.5 -114.5v-64q0 -14 -9 -23t-23 -9h-832q-14 0 -23 9t-9 23v64q0 69 58.5 114.5t133.5 45.5q67 0 97.5 37t30.5 91q0 51 -14.5 89.5t-52.5 72.5q-53 41 -95 95q-113 5 -215.5 44.5t-173 97.5t-112 130t-41.5 143v128q0 40 28 68t68 28h288v96 q0 66 47 113t113 47h576q66 0 113 -47t47 -113v-96h288q40 0 68 -28t28 -68z" />
-<glyph unicode="&#xf092;" d="M394 184q-8 -9 -20 3q-13 11 -4 19q8 9 20 -3q12 -11 4 -19zM352 245q9 -12 0 -19q-8 -6 -17 7t0 18q9 7 17 -6zM291 305q-5 -7 -13 -2q-10 5 -7 12q3 5 13 2q10 -5 7 -12zM322 271q-6 -7 -16 3q-9 11 -2 16q6 6 16 -3q9 -11 2 -16zM451 159q-4 -12 -19 -6q-17 4 -13 15 t19 7q16 -5 13 -16zM514 154q0 -11 -16 -11q-17 -2 -17 11q0 11 16 11q17 2 17 -11zM572 164q2 -10 -14 -14t-18 8t14 15q16 2 18 -9zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-224q-16 0 -24.5 1t-19.5 5t-16 14.5t-5 27.5v239q0 97 -52 142q57 6 102.5 18t94 39 t81 66.5t53 105t20.5 150.5q0 121 -79 206q37 91 -8 204q-28 9 -81 -11t-92 -44l-38 -24q-93 26 -192 26t-192 -26q-16 11 -42.5 27t-83.5 38.5t-86 13.5q-44 -113 -7 -204q-79 -85 -79 -206q0 -85 20.5 -150t52.5 -105t80.5 -67t94 -39t102.5 -18q-40 -36 -49 -103 q-21 -10 -45 -15t-57 -5t-65.5 21.5t-55.5 62.5q-19 32 -48.5 52t-49.5 24l-20 3q-21 0 -29 -4.5t-5 -11.5t9 -14t13 -12l7 -5q22 -10 43.5 -38t31.5 -51l10 -23q13 -38 44 -61.5t67 -30t69.5 -7t55.5 3.5l23 4q0 -38 0.5 -103t0.5 
 -68q0 -22 -11 -33.5t-22 -13t-33 -1.5 h-224q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
-<glyph unicode="&#xf093;" horiz-adv-x="1664" d="M1280 64q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1536 64q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1664 288v-320q0 -40 -28 -68t-68 -28h-1472q-40 0 -68 28t-28 68v320q0 40 28 68t68 28h427q21 -56 70.5 -92 t110.5 -36h256q61 0 110.5 36t70.5 92h427q40 0 68 -28t28 -68zM1339 936q-17 -40 -59 -40h-256v-448q0 -26 -19 -45t-45 -19h-256q-26 0 -45 19t-19 45v448h-256q-42 0 -59 40q-17 39 14 69l448 448q18 19 45 19t45 -19l448 -448q31 -30 14 -69z" />
-<glyph unicode="&#xf094;" d="M1407 710q0 44 -7 113.5t-18 96.5q-12 30 -17 44t-9 36.5t-4 48.5q0 23 5 68.5t5 67.5q0 37 -10 55q-4 1 -13 1q-19 0 -58 -4.5t-59 -4.5q-60 0 -176 24t-175 24q-43 0 -94.5 -11.5t-85 -23.5t-89.5 -34q-137 -54 -202 -103q-96 -73 -159.5 -189.5t-88 -236t-24.5 -248.5 q0 -40 12.5 -120t12.5 -121q0 -23 -11 -66.5t-11 -65.5t12 -36.5t34 -14.5q24 0 72.5 11t73.5 11q57 0 169.5 -15.5t169.5 -15.5q181 0 284 36q129 45 235.5 152.5t166 245.5t59.5 275zM1535 712q0 -165 -70 -327.5t-196 -288t-281 -180.5q-124 -44 -326 -44 q-57 0 -170 14.5t-169 14.5q-24 0 -72.5 -14.5t-73.5 -14.5q-73 0 -123.5 55.5t-50.5 128.5q0 24 11 68t11 67q0 40 -12.5 120.5t-12.5 121.5q0 111 18 217.5t54.5 209.5t100.5 194t150 156q78 59 232 120q194 78 316 78q60 0 175.5 -24t173.5 -24q19 0 57 5t58 5 q81 0 118 -50.5t37 -134.5q0 -23 -5 -68t-5 -68q0 -10 1 -18.5t3 -17t4 -13.5t6.5 -16t6.5 -17q16 -40 25 -118.5t9 -136.5z" />
-<glyph unicode="&#xf095;" horiz-adv-x="1408" d="M1408 296q0 -27 -10 -70.5t-21 -68.5q-21 -50 -122 -106q-94 -51 -186 -51q-27 0 -52.5 3.5t-57.5 12.5t-47.5 14.5t-55.5 20.5t-49 18q-98 35 -175 83q-128 79 -264.5 215.5t-215.5 264.5q-48 77 -83 175q-3 9 -18 49t-20.5 55.5t-14.5 47.5t-12.5 57.5t-3.5 52.5 q0 92 51 186q56 101 106 122q25 11 68.5 21t70.5 10q14 0 21 -3q18 -6 53 -76q11 -19 30 -54t35 -63.5t31 -53.5q3 -4 17.5 -25t21.5 -35.5t7 -28.5q0 -20 -28.5 -50t-62 -55t-62 -53t-28.5 -46q0 -9 5 -22.5t8.5 -20.5t14 -24t11.5 -19q76 -137 174 -235t235 -174 q2 -1 19 -11.5t24 -14t20.5 -8.5t22.5 -5q18 0 46 28.5t53 62t55 62t50 28.5q14 0 28.5 -7t35.5 -21.5t25 -17.5q25 -15 53.5 -31t63.5 -35t54 -30q70 -35 76 -53q3 -7 3 -21z" />
-<glyph unicode="&#xf096;" horiz-adv-x="1408" d="M1120 1280h-832q-66 0 -113 -47t-47 -113v-832q0 -66 47 -113t113 -47h832q66 0 113 47t47 113v832q0 66 -47 113t-113 47zM1408 1120v-832q0 -119 -84.5 -203.5t-203.5 -84.5h-832q-119 0 -203.5 84.5t-84.5 203.5v832q0 119 84.5 203.5t203.5 84.5h832 q119 0 203.5 -84.5t84.5 -203.5z" />
-<glyph unicode="&#xf097;" horiz-adv-x="1280" d="M1152 1280h-1024v-1242l423 406l89 85l89 -85l423 -406v1242zM1164 1408q23 0 44 -9q33 -13 52.5 -41t19.5 -62v-1289q0 -34 -19.5 -62t-52.5 -41q-19 -8 -44 -8q-48 0 -83 32l-441 424l-441 -424q-36 -33 -83 -33q-23 0 -44 9q-33 13 -52.5 41t-19.5 62v1289 q0 34 19.5 62t52.5 41q21 9 44 9h1048z" />
-<glyph unicode="&#xf098;" d="M1280 343q0 11 -2 16q-3 8 -38.5 29.5t-88.5 49.5l-53 29q-5 3 -19 13t-25 15t-21 5q-18 0 -47 -32.5t-57 -65.5t-44 -33q-7 0 -16.5 3.5t-15.5 6.5t-17 9.5t-14 8.5q-99 55 -170.5 126.5t-126.5 170.5q-2 3 -8.5 14t-9.5 17t-6.5 15.5t-3.5 16.5q0 13 20.5 33.5t45 38.5 t45 39.5t20.5 36.5q0 10 -5 21t-15 25t-13 19q-3 6 -15 28.5t-25 45.5t-26.5 47.5t-25 40.5t-16.5 18t-16 2q-48 0 -101 -22q-46 -21 -80 -94.5t-34 -130.5q0 -16 2.5 -34t5 -30.5t9 -33t10 -29.5t12.5 -33t11 -30q60 -164 216.5 -320.5t320.5 -216.5q6 -2 30 -11t33 -12.5 t29.5 -10t33 -9t30.5 -5t34 -2.5q57 0 130.5 34t94.5 80q22 53 22 101zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
-<glyph unicode="&#xf099;" horiz-adv-x="1664" d="M1620 1128q-67 -98 -162 -167q1 -14 1 -42q0 -130 -38 -259.5t-115.5 -248.5t-184.5 -210.5t-258 -146t-323 -54.5q-271 0 -496 145q35 -4 78 -4q225 0 401 138q-105 2 -188 64.5t-114 159.5q33 -5 61 -5q43 0 85 11q-112 23 -185.5 111.5t-73.5 205.5v4q68 -38 146 -41 q-66 44 -105 115t-39 154q0 88 44 163q121 -149 294.5 -238.5t371.5 -99.5q-8 38 -8 74q0 134 94.5 228.5t228.5 94.5q140 0 236 -102q109 21 205 78q-37 -115 -142 -178q93 10 186 50z" />
-<glyph unicode="&#xf09a;" horiz-adv-x="768" d="M511 980h257l-30 -284h-227v-824h-341v824h-170v284h170v171q0 182 86 275.5t283 93.5h227v-284h-142q-39 0 -62.5 -6.5t-34 -23.5t-13.5 -34.5t-3 -49.5v-142z" />
-<glyph unicode="&#xf09b;" d="M1536 640q0 -251 -146.5 -451.5t-378.5 -277.5q-27 -5 -39.5 7t-12.5 30v211q0 97 -52 142q57 6 102.5 18t94 39t81 66.5t53 105t20.5 150.5q0 121 -79 206q37 91 -8 204q-28 9 -81 -11t-92 -44l-38 -24q-93 26 -192 26t-192 -26q-16 11 -42.5 27t-83.5 38.5t-86 13.5 q-44 -113 -7 -204q-79 -85 -79 -206q0 -85 20.5 -150t52.5 -105t80.5 -67t94 -39t102.5 -18q-40 -36 -49 -103q-21 -10 -45 -15t-57 -5t-65.5 21.5t-55.5 62.5q-19 32 -48.5 52t-49.5 24l-20 3q-21 0 -29 -4.5t-5 -11.5t9 -14t13 -12l7 -5q22 -10 43.5 -38t31.5 -51l10 -23 q13 -38 44 -61.5t67 -30t69.5 -7t55.5 3.5l23 4q0 -38 0.5 -89t0.5 -54q0 -18 -13 -30t-40 -7q-232 77 -378.5 277.5t-146.5 451.5q0 209 103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
-<glyph unicode="&#xf09c;" horiz-adv-x="1664" d="M1664 960v-256q0 -26 -19 -45t-45 -19h-64q-26 0 -45 19t-19 45v256q0 106 -75 181t-181 75t-181 -75t-75 -181v-192h96q40 0 68 -28t28 -68v-576q0 -40 -28 -68t-68 -28h-960q-40 0 -68 28t-28 68v576q0 40 28 68t68 28h672v192q0 185 131.5 316.5t316.5 131.5 t316.5 -131.5t131.5 -316.5z" />
-<glyph unicode="&#xf09d;" horiz-adv-x="1920" d="M1760 1408q66 0 113 -47t47 -113v-1216q0 -66 -47 -113t-113 -47h-1600q-66 0 -113 47t-47 113v1216q0 66 47 113t113 47h1600zM160 1280q-13 0 -22.5 -9.5t-9.5 -22.5v-224h1664v224q0 13 -9.5 22.5t-22.5 9.5h-1600zM1760 0q13 0 22.5 9.5t9.5 22.5v608h-1664v-608 q0 -13 9.5 -22.5t22.5 -9.5h1600zM256 128v128h256v-128h-256zM640 128v128h384v-128h-384z" />
-<glyph unicode="&#xf09e;" horiz-adv-x="1408" d="M384 192q0 -80 -56 -136t-136 -56t-136 56t-56 136t56 136t136 56t136 -56t56 -136zM896 69q2 -28 -17 -48q-18 -21 -47 -21h-135q-25 0 -43 16.5t-20 41.5q-22 229 -184.5 391.5t-391.5 184.5q-25 2 -41.5 20t-16.5 43v135q0 29 21 47q17 17 43 17h5q160 -13 306 -80.5 t259 -181.5q114 -113 181.5 -259t80.5 -306zM1408 67q2 -27 -18 -47q-18 -20 -46 -20h-143q-26 0 -44.5 17.5t-19.5 42.5q-12 215 -101 408.5t-231.5 336t-336 231.5t-408.5 102q-25 1 -42.5 19.5t-17.5 43.5v143q0 28 20 46q18 18 44 18h3q262 -13 501.5 -120t425.5 -294 q187 -186 294 -425.5t120 -501.5z" />
-<glyph unicode="&#xf0a0;" d="M1040 320q0 -33 -23.5 -56.5t-56.5 -23.5t-56.5 23.5t-23.5 56.5t23.5 56.5t56.5 23.5t56.5 -23.5t23.5 -56.5zM1296 320q0 -33 -23.5 -56.5t-56.5 -23.5t-56.5 23.5t-23.5 56.5t23.5 56.5t56.5 23.5t56.5 -23.5t23.5 -56.5zM1408 160v320q0 13 -9.5 22.5t-22.5 9.5 h-1216q-13 0 -22.5 -9.5t-9.5 -22.5v-320q0 -13 9.5 -22.5t22.5 -9.5h1216q13 0 22.5 9.5t9.5 22.5zM178 640h1180l-157 482q-4 13 -16 21.5t-26 8.5h-782q-14 0 -26 -8.5t-16 -21.5zM1536 480v-320q0 -66 -47 -113t-113 -47h-1216q-66 0 -113 47t-47 113v320q0 25 16 75 l197 606q17 53 63 86t101 33h782q55 0 101 -33t63 -86l197 -606q16 -50 16 -75z" />
-<glyph unicode="&#xf0a1;" horiz-adv-x="1792" d="M1664 896q53 0 90.5 -37.5t37.5 -90.5t-37.5 -90.5t-90.5 -37.5v-384q0 -52 -38 -90t-90 -38q-417 347 -812 380q-58 -19 -91 -66t-31 -100.5t40 -92.5q-20 -33 -23 -65.5t6 -58t33.5 -55t48 -50t61.5 -50.5q-29 -58 -111.5 -83t-168.5 -11.5t-132 55.5q-7 23 -29.5 87.5 t-32 94.5t-23 89t-15 101t3.5 98.5t22 110.5h-122q-66 0 -113 47t-47 113v192q0 66 47 113t113 47h480q435 0 896 384q52 0 90 -38t38 -90v-384zM1536 292v954q-394 -302 -768 -343v-270q377 -42 768 -341z" />
-<glyph unicode="&#xf0a2;" horiz-adv-x="1664" d="M848 -160q0 16 -16 16q-59 0 -101.5 42.5t-42.5 101.5q0 16 -16 16t-16 -16q0 -73 51.5 -124.5t124.5 -51.5q16 0 16 16zM183 128h1298q-164 181 -246.5 411.5t-82.5 484.5q0 256 -320 256t-320 -256q0 -254 -82.5 -484.5t-246.5 -411.5zM1664 128q0 -52 -38 -90t-90 -38 h-448q0 -106 -75 -181t-181 -75t-181 75t-75 181h-448q-52 0 -90 38t-38 90q190 161 287 397.5t97 498.5q0 165 96 262t264 117q-8 18 -8 37q0 40 28 68t68 28t68 -28t28 -68q0 -19 -8 -37q168 -20 264 -117t96 -262q0 -262 97 -498.5t287 -397.5z" />
-<glyph unicode="&#xf0a3;" d="M1376 640l138 -135q30 -28 20 -70q-12 -41 -52 -51l-188 -48l53 -186q12 -41 -19 -70q-29 -31 -70 -19l-186 53l-48 -188q-10 -40 -51 -52q-12 -2 -19 -2q-31 0 -51 22l-135 138l-135 -138q-28 -30 -70 -20q-41 11 -51 52l-48 188l-186 -53q-41 -12 -70 19q-31 29 -19 70 l53 186l-188 48q-40 10 -52 51q-10 42 20 70l138 135l-138 135q-30 28 -20 70q12 41 52 51l188 48l-53 186q-12 41 19 70q29 31 70 19l186 -53l48 188q10 41 51 51q41 12 70 -19l135 -139l135 139q29 30 70 19q41 -10 51 -51l48 -188l186 53q41 12 70 -19q31 -29 19 -70 l-53 -186l188 -48q40 -10 52 -51q10 -42 -20 -70z" />
-<glyph unicode="&#xf0a4;" horiz-adv-x="1792" d="M256 192q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1664 768q0 51 -39 89.5t-89 38.5h-576q0 20 15 48.5t33 55t33 68t15 84.5q0 67 -44.5 97.5t-115.5 30.5q-24 0 -90 -139q-24 -44 -37 -65q-40 -64 -112 -145q-71 -81 -101 -106 q-69 -57 -140 -57h-32v-640h32q72 0 167 -32t193.5 -64t179.5 -32q189 0 189 167q0 26 -5 56q30 16 47.5 52.5t17.5 73.5t-18 69q53 50 53 119q0 25 -10 55.5t-25 47.5h331q52 0 90 38t38 90zM1792 769q0 -105 -75.5 -181t-180.5 -76h-169q-4 -62 -37 -119q3 -21 3 -43 q0 -101 -60 -178q1 -139 -85 -219.5t-227 -80.5q-133 0 -322 69q-164 59 -223 59h-288q-53 0 -90.5 37.5t-37.5 90.5v640q0 53 37.5 90.5t90.5 37.5h288q10 0 21.5 4.5t23.5 14t22.5 18t24 22.5t20.5 21.5t19 21.5t14 17q65 74 100 129q13 21 33 62t37 72t40.5 63t55 49.5 t69.5 17.5q125 0 206.5 -67t81.5 -189q0 -68 -22 -128h374q104 0 180 -76t76 -179z" />
-<glyph unicode="&#xf0a5;" horiz-adv-x="1792" d="M1376 128h32v640h-32q-35 0 -67.5 12t-62.5 37t-50 46t-49 54q-2 3 -3.5 4.5t-4 4.5t-4.5 5q-72 81 -112 145q-14 22 -38 68q-1 3 -10.5 22.5t-18.5 36t-20 35.5t-21.5 30.5t-18.5 11.5q-71 0 -115.5 -30.5t-44.5 -97.5q0 -43 15 -84.5t33 -68t33 -55t15 -48.5h-576 q-50 0 -89 -38.5t-39 -89.5q0 -52 38 -90t90 -38h331q-15 -17 -25 -47.5t-10 -55.5q0 -69 53 -119q-18 -32 -18 -69t17.5 -73.5t47.5 -52.5q-4 -24 -4 -56q0 -85 48.5 -126t135.5 -41q84 0 183 32t194 64t167 32zM1664 192q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45 t45 -19t45 19t19 45zM1792 768v-640q0 -53 -37.5 -90.5t-90.5 -37.5h-288q-59 0 -223 -59q-190 -69 -317 -69q-142 0 -230 77.5t-87 217.5l1 5q-61 76 -61 178q0 22 3 43q-33 57 -37 119h-169q-105 0 -180.5 76t-75.5 181q0 103 76 179t180 76h374q-22 60 -22 128 q0 122 81.5 189t206.5 67q38 0 69.5 -17.5t55 -49.5t40.5 -63t37 -72t33 -62q35 -55 100 -129q2 -3 14 -17t19 -21.5t20.5 -21.5t24 -22.5t22.5 -18t23.5 -14t21.5 -4.5h288q53 0 90.5 -37.5t37.5 -90.5z" />
-<glyph unicode="&#xf0a6;" d="M1280 -64q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1408 700q0 189 -167 189q-26 0 -56 -5q-16 30 -52.5 47.5t-73.5 17.5t-69 -18q-50 53 -119 53q-25 0 -55.5 -10t-47.5 -25v331q0 52 -38 90t-90 38q-51 0 -89.5 -39t-38.5 -89v-576 q-20 0 -48.5 15t-55 33t-68 33t-84.5 15q-67 0 -97.5 -44.5t-30.5 -115.5q0 -24 139 -90q44 -24 65 -37q64 -40 145 -112q81 -71 106 -101q57 -69 57 -140v-32h640v32q0 72 32 167t64 193.5t32 179.5zM1536 705q0 -133 -69 -322q-59 -164 -59 -223v-288q0 -53 -37.5 -90.5 t-90.5 -37.5h-640q-53 0 -90.5 37.5t-37.5 90.5v288q0 10 -4.5 21.5t-14 23.5t-18 22.5t-22.5 24t-21.5 20.5t-21.5 19t-17 14q-74 65 -129 100q-21 13 -62 33t-72 37t-63 40.5t-49.5 55t-17.5 69.5q0 125 67 206.5t189 81.5q68 0 128 -22v374q0 104 76 180t179 76 q105 0 181 -75.5t76 -180.5v-169q62 -4 119 -37q21 3 43 3q101 0 178 -60q139 1 219.5 -85t80.5 -227z" />
-<glyph unicode="&#xf0a7;" d="M1408 576q0 84 -32 183t-64 194t-32 167v32h-640v-32q0 -35 -12 -67.5t-37 -62.5t-46 -50t-54 -49q-9 -8 -14 -12q-81 -72 -145 -112q-22 -14 -68 -38q-3 -1 -22.5 -10.5t-36 -18.5t-35.5 -20t-30.5 -21.5t-11.5 -18.5q0 -71 30.5 -115.5t97.5 -44.5q43 0 84.5 15t68 33 t55 33t48.5 15v-576q0 -50 38.5 -89t89.5 -39q52 0 90 38t38 90v331q46 -35 103 -35q69 0 119 53q32 -18 69 -18t73.5 17.5t52.5 47.5q24 -4 56 -4q85 0 126 48.5t41 135.5zM1280 1344q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1536 580 q0 -142 -77.5 -230t-217.5 -87l-5 1q-76 -61 -178 -61q-22 0 -43 3q-54 -30 -119 -37v-169q0 -105 -76 -180.5t-181 -75.5q-103 0 -179 76t-76 180v374q-54 -22 -128 -22q-121 0 -188.5 81.5t-67.5 206.5q0 38 17.5 69.5t49.5 55t63 40.5t72 37t62 33q55 35 129 100 q3 2 17 14t21.5 19t21.5 20.5t22.5 24t18 22.5t14 23.5t4.5 21.5v288q0 53 37.5 90.5t90.5 37.5h640q53 0 90.5 -37.5t37.5 -90.5v-288q0 -59 59 -223q69 -190 69 -317z" />
-<glyph unicode="&#xf0a8;" d="M1280 576v128q0 26 -19 45t-45 19h-502l189 189q19 19 19 45t-19 45l-91 91q-18 18 -45 18t-45 -18l-362 -362l-91 -91q-18 -18 -18 -45t18 -45l91 -91l362 -362q18 -18 45 -18t45 18l91 91q18 18 18 45t-18 45l-189 189h502q26 0 45 19t19 45zM1536 640 q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
-<glyph unicode="&#xf0a9;" d="M1285 640q0 27 -18 45l-91 91l-362 362q-18 18 -45 18t-45 -18l-91 -91q-18 -18 -18 -45t18 -45l189 -189h-502q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45t45 -19h502l-189 -189q-19 -19 -19 -45t19 -45l91 -91q18 -18 45 -18t45 18l362 362l91 91q18 18 18 45zM1536 640 q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
-<glyph unicode="&#xf0aa;" d="M1284 641q0 27 -18 45l-362 362l-91 91q-18 18 -45 18t-45 -18l-91 -91l-362 -362q-18 -18 -18 -45t18 -45l91 -91q18 -18 45 -18t45 18l189 189v-502q0 -26 19 -45t45 -19h128q26 0 45 19t19 45v502l189 -189q19 -19 45 -19t45 19l91 91q18 18 18 45zM1536 640 q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
-<glyph unicode="&#xf0ab;" d="M1284 639q0 27 -18 45l-91 91q-18 18 -45 18t-45 -18l-189 -189v502q0 26 -19 45t-45 19h-128q-26 0 -45 -19t-19 -45v-502l-189 189q-19 19 -45 19t-45 -19l-91 -91q-18 -18 -18 -45t18 -45l362 -362l91 -91q18 -18 45 -18t45 18l91 91l362 362q18 18 18 45zM1536 640 q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
-<glyph unicode="&#xf0ac;" d="M768 1408q209 0 385.5 -103t279.5 -279.5t103 -385.5t-103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103zM1042 887q-2 -1 -9.5 -9.5t-13.5 -9.5q2 0 4.5 5t5 11t3.5 7q6 7 22 15q14 6 52 12q34 8 51 -11 q-2 2 9.5 13t14.5 12q3 2 15 4.5t15 7.5l2 22q-12 -1 -17.5 7t-6.5 21q0 -2 -6 -8q0 7 -4.5 8t-11.5 -1t-9 -1q-10 3 -15 7.5t-8 16.5t-4 15q-2 5 -9.5 10.5t-9.5 10.5q-1 2 -2.5 5.5t-3 6.5t-4 5.5t-5.5 2.5t-7 -5t-7.5 -10t-4.5 -5q-3 2 -6 1.5t-4.5 -1t-4.5 -3t-5 -3.5 q-3 -2 -8.5 -3t-8.5 -2q15 5 -1 11q-10 4 -16 3q9 4 7.5 12t-8.5 14h5q-1 4 -8.5 8.5t-17.5 8.5t-13 6q-8 5 -34 9.5t-33 0.5q-5 -6 -4.5 -10.5t4 -14t3.5 -12.5q1 -6 -5.5 -13t-6.5 -12q0 -7 14 -15.5t10 -21.5q-3 -8 -16 -16t-16 -12q-5 -8 -1.5 -18.5t10.5 -16.5 q2 -2 1.5 -4t-3.5 -4.5t-5.5 -4t-6.5 -3.5l-3 -2q-11 -5 -20.5 6t-13.5 26q-7 25 -16 30q-23 8 -29 -1q-5 13 -41 26q-25 9 -58 4q6 1 0 15q-7 15 -19 12q3 6 4 17.5t1 13.5q3 13 12 23q1 1 7 8.5t9.5 13.5t0.5 6q35 -4 50 11q5 5 11.5 17
 t10.5 17q9 6 14 5.5t14.5 -5.5 t14.5 -5q14 -1 15.5 11t-7.5 20q12 -1 3 17q-5 7 -8 9q-12 4 -27 -5q-8 -4 2 -8q-1 1 -9.5 -10.5t-16.5 -17.5t-16 5q-1 1 -5.5 13.5t-9.5 13.5q-8 0 -16 -15q3 8 -11 15t-24 8q19 12 -8 27q-7 4 -20.5 5t-19.5 -4q-5 -7 -5.5 -11.5t5 -8t10.5 -5.5t11.5 -4t8.5 -3 q14 -10 8 -14q-2 -1 -8.5 -3.5t-11.5 -4.5t-6 -4q-3 -4 0 -14t-2 -14q-5 5 -9 17.5t-7 16.5q7 -9 -25 -6l-10 1q-4 0 -16 -2t-20.5 -1t-13.5 8q-4 8 0 20q1 4 4 2q-4 3 -11 9.5t-10 8.5q-46 -15 -94 -41q6 -1 12 1q5 2 13 6.5t10 5.5q34 14 42 7l5 5q14 -16 20 -25 q-7 4 -30 1q-20 -6 -22 -12q7 -12 5 -18q-4 3 -11.5 10t-14.5 11t-15 5q-16 0 -22 -1q-146 -80 -235 -222q7 -7 12 -8q4 -1 5 -9t2.5 -11t11.5 3q9 -8 3 -19q1 1 44 -27q19 -17 21 -21q3 -11 -10 -18q-1 2 -9 9t-9 4q-3 -5 0.5 -18.5t10.5 -12.5q-7 0 -9.5 -16t-2.5 -35.5 t-1 -23.5l2 -1q-3 -12 5.5 -34.5t21.5 -19.5q-13 -3 20 -43q6 -8 8 -9q3 -2 12 -7.5t15 -10t10 -10.5q4 -5 10 -22.5t14 -23.5q-2 -6 9.5 -20t10.5 -23q-1 0 -2.5 -1t-2.5 -1q3 -7 15.5 -14t15.5 -13q1 -3 2 -10t3 -11t8 -2q2 20 -24 62q-1
 5 25 -17 29q-3 5 -5.5 15.5 t-4.5 14.5q2 0 6 -1.5t8.5 -3.5t7.5 -4t2 -3q-3 -7 2 -17.5t12 -18.5t17 -19t12 -13q6 -6 14 -19.5t0 -13.5q9 0 20 -10t17 -20q5 -8 8 -26t5 -24q2 -7 8.5 -13.5t12.5 -9.5l16 -8t13 -7q5 -2 18.5 -10.5t21.5 -11.5q10 -4 16 -4t14.5 2.5t13.5 3.5q15 2 29 -15t21 -21 q36 -19 55 -11q-2 -1 0.5 -7.5t8 -15.5t9 -14.5t5.5 -8.5q5 -6 18 -15t18 -15q6 4 7 9q-3 -8 7 -20t18 -10q14 3 14 32q-31 -15 -49 18q0 1 -2.5 5.5t-4 8.5t-2.5 8.5t0 7.5t5 3q9 0 10 3.5t-2 12.5t-4 13q-1 8 -11 20t-12 15q-5 -9 -16 -8t-16 9q0 -1 -1.5 -5.5t-1.5 -6.5 q-13 0 -15 1q1 3 2.5 17.5t3.5 22.5q1 4 5.5 12t7.5 14.5t4 12.5t-4.5 9.5t-17.5 2.5q-19 -1 -26 -20q-1 -3 -3 -10.5t-5 -11.5t-9 -7q-7 -3 -24 -2t-24 5q-13 8 -22.5 29t-9.5 37q0 10 2.5 26.5t3 25t-5.5 24.5q3 2 9 9.5t10 10.5q2 1 4.5 1.5t4.5 0t4 1.5t3 6q-1 1 -4 3 q-3 3 -4 3q7 -3 28.5 1.5t27.5 -1.5q15 -11 22 2q0 1 -2.5 9.5t-0.5 13.5q5 -27 29 -9q3 -3 15.5 -5t17.5 -5q3 -2 7 -5.5t5.5 -4.5t5 0.5t8.5 6.5q10 -14 12 -24q11 -40 19 -44q7 -3 11 -2t4.5 9.5t0 14t-1.5 12.5l-1 8v18l-1 8q
 -15 3 -18.5 12t1.5 18.5t15 18.5q1 1 8 3.5 t15.5 6.5t12.5 8q21 19 15 35q7 0 11 9q-1 0 -5 3t-7.5 5t-4.5 2q9 5 2 16q5 3 7.5 11t7.5 10q9 -12 21 -2q7 8 1 16q5 7 20.5 10.5t18.5 9.5q7 -2 8 2t1 12t3 12q4 5 15 9t13 5l17 11q3 4 0 4q18 -2 31 11q10 11 -6 20q3 6 -3 9.5t-15 5.5q3 1 11.5 0.5t10.5 1.5 q15 10 -7 16q-17 5 -43 -12zM879 10q206 36 351 189q-3 3 -12.5 4.5t-12.5 3.5q-18 7 -24 8q1 7 -2.5 13t-8 9t-12.5 8t-11 7q-2 2 -7 6t-7 5.5t-7.5 4.5t-8.5 2t-10 -1l-3 -1q-3 -1 -5.5 -2.5t-5.5 -3t-4 -3t0 -2.5q-21 17 -36 22q-5 1 -11 5.5t-10.5 7t-10 1.5t-11.5 -7 q-5 -5 -6 -15t-2 -13q-7 5 0 17.5t2 18.5q-3 6 -10.5 4.5t-12 -4.5t-11.5 -8.5t-9 -6.5t-8.5 -5.5t-8.5 -7.5q-3 -4 -6 -12t-5 -11q-2 4 -11.5 6.5t-9.5 5.5q2 -10 4 -35t5 -38q7 -31 -12 -48q-27 -25 -29 -40q-4 -22 12 -26q0 -7 -8 -20.5t-7 -21.5q0 -6 2 -16z" />
-<glyph unicode="&#xf0ad;" horiz-adv-x="1664" d="M384 64q0 26 -19 45t-45 19t-45 -1

<TRUNCATED>
http://git-wip-us.apache.org/repos/asf/couchdb/blob/cca309f3/share/www/fauxton/img/fontawesome-webfont.ttf
----------------------------------------------------------------------
diff --git a/share/www/fauxton/img/fontawesome-webfont.ttf b/share/www/fauxton/img/fontawesome-webfont.ttf
deleted file mode 100644
index d365924..0000000
Binary files a/share/www/fauxton/img/fontawesome-webfont.ttf and /dev/null differ


[04/37] move JS tests into safety

Posted by ja...@apache.org.
http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/www/script/test/replication.js
----------------------------------------------------------------------
diff --git a/share/www/script/test/replication.js b/share/www/script/test/replication.js
deleted file mode 100644
index 21a4304..0000000
--- a/share/www/script/test/replication.js
+++ /dev/null
@@ -1,1795 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
-couchTests.replication = function(debug) {
-
-  if (debug) debugger;
-
-  var host = CouchDB.host;
-  var sourceDb = new CouchDB("test_suite_db_a",{"X-Couch-Full-Commit":"false"});
-  var targetDb = new CouchDB("test_suite_db_b",{"X-Couch-Full-Commit":"false"});
-
-  var dbPairs = [
-    {
-      source: sourceDb.name,
-      target: targetDb.name
-    },
-    {
-      source: CouchDB.protocol + host + "/" + sourceDb.name,
-      target: targetDb.name
-    },
-    {
-      source: sourceDb.name,
-      target: CouchDB.protocol + host + "/" + targetDb.name
-    },
-    {
-      source: CouchDB.protocol + host + "/" + sourceDb.name,
-      target: CouchDB.protocol + host + "/" + targetDb.name
-    }
-  ];
-
-  var att1_data = CouchDB.request("GET", "/_utils/script/test/lorem.txt");
-  att1_data = att1_data.responseText;
-
-  var att2_data = CouchDB.request("GET", "/_utils/script/test/lorem_b64.txt");
-  att2_data = att2_data.responseText;
-
-  var sourceInfo, targetInfo;
-  var docs, doc, copy;
-  var repResult;
-  var i, j, k;
-
-
-  function makeAttData(minSize) {
-    var data = att1_data;
-
-    while (data.length < minSize) {
-      data = data + att1_data;
-    }
-    return data;
-  }
-
-
-  function enableAttCompression(level, types) {
-    var xhr = CouchDB.request(
-      "PUT",
-      "/_config/attachments/compression_level",
-      {
-        body: JSON.stringify(level),
-        headers: {"X-Couch-Persist": "false"}
-      }
-    );
-    T(xhr.status === 200);
-    xhr = CouchDB.request(
-      "PUT",
-      "/_config/attachments/compressible_types",
-      {
-        body: JSON.stringify(types),
-        headers: {"X-Couch-Persist": "false"}
-      }
-    );
-    T(xhr.status === 200);
-  }
-
-
-  function disableAttCompression() {
-    var xhr = CouchDB.request(
-      "PUT",
-      "/_config/attachments/compression_level",
-      {
-        body: JSON.stringify("0"),
-        headers: {"X-Couch-Persist": "false"}
-      }
-    );
-    T(xhr.status === 200);
-  }
-
-
-  function populateDb(db, docs, dontRecreateDb) {
-    if (dontRecreateDb !== true) {
-      db.deleteDb();
-      db.createDb();
-    }
-    for (var i = 0; i < docs.length; i++) {
-      var doc = docs[i];
-      delete doc._rev;
-    }
-    if (docs.length > 0) {
-      db.bulkSave(docs);
-    }
-  }
-
-
-  function addAtt(db, doc, attName, attData, type) {
-    var uri = "/" + db.name + "/" + encodeURIComponent(doc._id) + "/" + attName;
-
-    if (doc._rev) {
-      uri += "?rev=" + doc._rev;
-    }
-
-    var xhr = CouchDB.request("PUT", uri, {
-      headers: {
-        "Content-Type": type
-      },
-      body: attData
-    });
-
-    T(xhr.status === 201);
-    doc._rev = JSON.parse(xhr.responseText).rev;
-  }
-
-
-  function compareObjects(o1, o2) {
-    for (var p in o1) {
-      if (o1[p] === null && o2[p] !== null) {
-        return false;
-      } else if (typeof o1[p] === "object") {
-        if ((typeof o2[p] !== "object") || o2[p] === null) {
-          return false;
-        }
-        if (!arguments.callee(o1[p], o2[p])) {
-          return false;
-        }
-      } else {
-        if (o1[p] !== o2[p]) {
-          return false;
-        }
-      }
-    }
-    return true;
-  }
-
-
-  function getTask(rep_id, delay) {
-    var t0 = new Date();
-    var t1;
-    do {
-      var xhr = CouchDB.request("GET", "/_active_tasks");
-      var tasks = JSON.parse(xhr.responseText);
-      for(var i = 0; i < tasks.length; i++) {
-        if(tasks[i].replication_id == repResult._local_id) {
-          return tasks[i];
-        }
-      }
-      t1 = new Date();
-    } while((t1 - t0) <= delay);
-
-    return null;
-  }
-
-
-  function waitForSeq(sourceDb, targetDb, rep_id) {
-    var sourceSeq = sourceDb.info().update_seq,
-        t0 = new Date(),
-        t1,
-        ms = 3000;
-
-    do {
-      var task = getTask(rep_id, 0);
-      if(task && task["through_seq"] == sourceSeq) {
-        return;
-      }
-      t1 = new Date();
-    } while (((t1 - t0) <= ms));
-  }
-
-
-  // test simple replications (not continuous, not filtered), including
-  // conflict creation
-  docs = makeDocs(1, 21);
-  docs.push({
-    _id: "_design/foo",
-    language: "javascript",
-    value: "ddoc"
-  });
-
-  for (i = 0; i < dbPairs.length; i++) {
-    populateDb(sourceDb, docs);
-    populateDb(targetDb, []);
-
-    // add some attachments
-    for (j = 10; j < 15; j++) {
-      addAtt(sourceDb, docs[j], "readme.txt", att1_data, "text/plain");
-    }
-
-    repResult = CouchDB.replicate(dbPairs[i].source, dbPairs[i].target);
-    TEquals(true, repResult.ok);
-
-    sourceInfo = sourceDb.info();
-    targetInfo = targetDb.info();
-
-    TEquals(sourceInfo.doc_count, targetInfo.doc_count);
-
-    TEquals('string', typeof repResult.session_id);
-    TEquals(repResult.source_last_seq, sourceInfo.update_seq);
-    TEquals(true, repResult.history instanceof Array);
-    TEquals(1, repResult.history.length);
-    TEquals(repResult.history[0].session_id, repResult.session_id);
-    TEquals('string', typeof repResult.history[0].start_time);
-    TEquals('string', typeof repResult.history[0].end_time);
-    TEquals(0, repResult.history[0].start_last_seq);
-    TEquals(sourceInfo.update_seq, repResult.history[0].end_last_seq);
-    TEquals(sourceInfo.update_seq, repResult.history[0].recorded_seq);
-    TEquals(sourceInfo.doc_count, repResult.history[0].missing_checked);
-    TEquals(sourceInfo.doc_count, repResult.history[0].missing_found);
-    TEquals(sourceInfo.doc_count, repResult.history[0].docs_read);
-    TEquals(sourceInfo.doc_count, repResult.history[0].docs_written);
-    TEquals(0, repResult.history[0].doc_write_failures);
-
-    for (j = 0; j < docs.length; j++) {
-      doc = docs[j];
-      copy = targetDb.open(doc._id);
-
-      T(copy !== null);
-      TEquals(true, compareObjects(doc, copy));
-
-      if (j >= 10 && j < 15) {
-        var atts = copy._attachments;
-        TEquals('object', typeof atts);
-        TEquals('object', typeof atts["readme.txt"]);
-        TEquals(2, atts["readme.txt"].revpos);
-        TEquals(0, atts["readme.txt"].content_type.indexOf("text/plain"));
-        TEquals(true, atts["readme.txt"].stub);
-
-        var att_copy = CouchDB.request(
-          "GET", "/" + targetDb.name + "/" + copy._id + "/readme.txt"
-        ).responseText;
-        TEquals(att1_data.length, att_copy.length);
-        TEquals(att1_data, att_copy);
-      }
-    }
-
-
-    // add one more doc to source, more attachments to some existing docs
-    // and replicate again
-    var newDoc = {
-      _id: "foo666",
-      value: "d"
-    };
-    TEquals(true, sourceDb.save(newDoc).ok);
-
-    // add some more attachments
-    for (j = 10; j < 15; j++) {
-      addAtt(sourceDb, docs[j], "data.dat", att2_data, "application/binary");
-    }
-
-    repResult = CouchDB.replicate(dbPairs[i].source, dbPairs[i].target);
-    TEquals(true, repResult.ok);
-
-    sourceInfo = sourceDb.info();
-    targetInfo = targetDb.info();
-
-    TEquals(targetInfo.doc_count, sourceInfo.doc_count);
-
-    TEquals('string', typeof repResult.session_id);
-    TEquals(sourceInfo.update_seq, repResult.source_last_seq);
-    TEquals(true, repResult.history instanceof Array);
-    TEquals(2, repResult.history.length);
-    TEquals(repResult.history[0].session_id, repResult.session_id);
-    TEquals('string', typeof repResult.history[0].start_time);
-    TEquals('string', typeof repResult.history[0].end_time);
-    TEquals((sourceInfo.update_seq - 6), repResult.history[0].start_last_seq);
-    TEquals(sourceInfo.update_seq, repResult.history[0].end_last_seq);
-    TEquals(sourceInfo.update_seq, repResult.history[0].recorded_seq);
-    TEquals(6, repResult.history[0].missing_checked);
-    TEquals(6, repResult.history[0].missing_found);
-    TEquals(6, repResult.history[0].docs_read);
-    TEquals(6, repResult.history[0].docs_written);
-    TEquals(0, repResult.history[0].doc_write_failures);
-
-    copy = targetDb.open(newDoc._id);
-    T(copy !== null);
-    TEquals(newDoc._id, copy._id);
-    TEquals(newDoc.value, copy.value);
-
-    for (j = 10; j < 15; j++) {
-      doc = docs[j];
-      copy = targetDb.open(doc._id);
-
-      T(copy !== null);
-      TEquals(true, compareObjects(doc, copy));
-
-      var atts = copy._attachments;
-      TEquals('object', typeof atts);
-      TEquals('object', typeof atts["readme.txt"]);
-      TEquals(2, atts["readme.txt"].revpos);
-      TEquals(0, atts["readme.txt"].content_type.indexOf("text/plain"));
-      TEquals(true, atts["readme.txt"].stub);
-
-      var att1_copy = CouchDB.request(
-        "GET", "/" + targetDb.name + "/" + copy._id + "/readme.txt"
-      ).responseText;
-      TEquals(att1_data.length, att1_copy.length);
-      TEquals(att1_data, att1_copy);
-
-      TEquals('object', typeof atts["data.dat"]);
-      TEquals(3, atts["data.dat"].revpos);
-      TEquals(0, atts["data.dat"].content_type.indexOf("application/binary"));
-      TEquals(true, atts["data.dat"].stub);
-
-      var att2_copy = CouchDB.request(
-        "GET", "/" + targetDb.name + "/" + copy._id + "/data.dat"
-      ).responseText;
-      TEquals(att2_data.length, att2_copy.length);
-      TEquals(att2_data, att2_copy);
-    }
-
-    // test deletion is replicated
-    doc = sourceDb.open(docs[1]._id);
-    TEquals(true, sourceDb.deleteDoc(doc).ok);
-
-    repResult = CouchDB.replicate(dbPairs[i].source, dbPairs[i].target);
-    TEquals(true, repResult.ok);
-
-    sourceInfo = sourceDb.info();
-    targetInfo = targetDb.info();
-
-    TEquals(targetInfo.doc_count, sourceInfo.doc_count);
-    TEquals(targetInfo.doc_del_count, sourceInfo.doc_del_count);
-    TEquals(1, targetInfo.doc_del_count);
-
-    TEquals(true, repResult.history instanceof Array);
-    TEquals(3, repResult.history.length);
-    TEquals((sourceInfo.update_seq - 1), repResult.history[0].start_last_seq);
-    TEquals(sourceInfo.update_seq, repResult.history[0].end_last_seq);
-    TEquals(sourceInfo.update_seq, repResult.history[0].recorded_seq);
-    TEquals(1, repResult.history[0].missing_checked);
-    TEquals(1, repResult.history[0].missing_found);
-    TEquals(1, repResult.history[0].docs_read);
-    TEquals(1, repResult.history[0].docs_written);
-    TEquals(0, repResult.history[0].doc_write_failures);
-
-    copy = targetDb.open(docs[1]._id);
-    TEquals(null, copy);
-
-    var changes = targetDb.changes({since: 0});
-    var idx = changes.results.length - 1;
-    TEquals(docs[1]._id, changes.results[idx].id);
-    TEquals(true, changes.results[idx].deleted);
-
-    // test conflict
-    doc = sourceDb.open(docs[0]._id);
-    doc.value = "white";
-    TEquals(true, sourceDb.save(doc).ok);
-
-    copy = targetDb.open(docs[0]._id);
-    copy.value = "black";
-    TEquals(true, targetDb.save(copy).ok);
-
-    repResult = CouchDB.replicate(dbPairs[i].source, dbPairs[i].target);
-    TEquals(true, repResult.ok);
-
-    sourceInfo = sourceDb.info();
-    targetInfo = targetDb.info();
-
-    TEquals(sourceInfo.doc_count, targetInfo.doc_count);
-
-    TEquals(true, repResult.history instanceof Array);
-    TEquals(4, repResult.history.length);
-    TEquals((sourceInfo.update_seq - 1), repResult.history[0].start_last_seq);
-    TEquals(sourceInfo.update_seq, repResult.history[0].end_last_seq);
-    TEquals(sourceInfo.update_seq, repResult.history[0].recorded_seq);
-    TEquals(1, repResult.history[0].missing_checked);
-    TEquals(1, repResult.history[0].missing_found);
-    TEquals(1, repResult.history[0].docs_read);
-    TEquals(1, repResult.history[0].docs_written);
-    TEquals(0, repResult.history[0].doc_write_failures);
-
-    copy = targetDb.open(docs[0]._id, {conflicts: true});
-
-    TEquals(0, copy._rev.indexOf("2-"));
-    TEquals(true, copy._conflicts instanceof Array);
-    TEquals(1, copy._conflicts.length);
-    TEquals(0, copy._conflicts[0].indexOf("2-"));
-
-    // replicate again with conflict
-    doc.value = "yellow";
-    TEquals(true, sourceDb.save(doc).ok);
-
-    repResult = CouchDB.replicate(dbPairs[i].source, dbPairs[i].target);
-    TEquals(true, repResult.ok);
-
-    sourceInfo = sourceDb.info();
-    targetInfo = targetDb.info();
-
-    TEquals(sourceInfo.doc_count, targetInfo.doc_count);
-
-    TEquals(true, repResult.history instanceof Array);
-    TEquals(5, repResult.history.length);
-    TEquals((sourceInfo.update_seq - 1), repResult.history[0].start_last_seq);
-    TEquals(sourceInfo.update_seq, repResult.history[0].end_last_seq);
-    TEquals(sourceInfo.update_seq, repResult.history[0].recorded_seq);
-    TEquals(1, repResult.history[0].missing_checked);
-    TEquals(1, repResult.history[0].missing_found);
-    TEquals(1, repResult.history[0].docs_read);
-    TEquals(1, repResult.history[0].docs_written);
-    TEquals(0, repResult.history[0].doc_write_failures);
-
-    copy = targetDb.open(docs[0]._id, {conflicts: true});
-
-    TEquals(0, copy._rev.indexOf("3-"));
-    TEquals(true, copy._conflicts instanceof Array);
-    TEquals(1, copy._conflicts.length);
-    TEquals(0, copy._conflicts[0].indexOf("2-"));
-
-    // resolve the conflict
-    TEquals(true, targetDb.deleteDoc({_id: copy._id, _rev: copy._conflicts[0]}).ok);
-
-    // replicate again, check there are no more conflicts
-    doc.value = "rainbow";
-    TEquals(true, sourceDb.save(doc).ok);
-
-    repResult = CouchDB.replicate(dbPairs[i].source, dbPairs[i].target);
-    TEquals(true, repResult.ok);
-
-    sourceInfo = sourceDb.info();
-    targetInfo = targetDb.info();
-
-    TEquals(sourceInfo.doc_count, targetInfo.doc_count);
-
-    TEquals(true, repResult.history instanceof Array);
-    TEquals(6, repResult.history.length);
-    TEquals((sourceInfo.update_seq - 1), repResult.history[0].start_last_seq);
-    TEquals(sourceInfo.update_seq, repResult.history[0].end_last_seq);
-    TEquals(sourceInfo.update_seq, repResult.history[0].recorded_seq);
-    TEquals(1, repResult.history[0].missing_checked);
-    TEquals(1, repResult.history[0].missing_found);
-    TEquals(1, repResult.history[0].docs_read);
-    TEquals(1, repResult.history[0].docs_written);
-    TEquals(0, repResult.history[0].doc_write_failures);
-
-    copy = targetDb.open(docs[0]._id, {conflicts: true});
-
-    TEquals(0, copy._rev.indexOf("4-"));
-    TEquals('undefined', typeof copy._conflicts);
-
-    // test that revisions already in a target are not copied
-    TEquals(true, sourceDb.save({_id: "foo1", value: 111}).ok);
-    TEquals(true, targetDb.save({_id: "foo1", value: 111}).ok);
-    TEquals(true, sourceDb.save({_id: "foo2", value: 222}).ok);
-    TEquals(true, sourceDb.save({_id: "foo3", value: 333}).ok);
-    TEquals(true, targetDb.save({_id: "foo3", value: 333}).ok);
-
-    repResult = CouchDB.replicate(dbPairs[i].source, dbPairs[i].target);
-    TEquals(true, repResult.ok);
-
-    sourceInfo = sourceDb.info();
-    TEquals(sourceInfo.update_seq, repResult.source_last_seq);
-    TEquals(sourceInfo.update_seq - 3, repResult.history[0].start_last_seq);
-    TEquals(sourceInfo.update_seq, repResult.history[0].end_last_seq);
-    TEquals(sourceInfo.update_seq, repResult.history[0].recorded_seq);
-    TEquals(3, repResult.history[0].missing_checked);
-    TEquals(1, repResult.history[0].missing_found);
-    TEquals(1, repResult.history[0].docs_read);
-    TEquals(1, repResult.history[0].docs_written);
-    TEquals(0, repResult.history[0].doc_write_failures);
-
-    TEquals(true, sourceDb.save({_id: "foo4", value: 444}).ok);
-    TEquals(true, targetDb.save({_id: "foo4", value: 444}).ok);
-    TEquals(true, sourceDb.save({_id: "foo5", value: 555}).ok);
-    TEquals(true, targetDb.save({_id: "foo5", value: 555}).ok);
-
-    repResult = CouchDB.replicate(dbPairs[i].source, dbPairs[i].target);
-    TEquals(true, repResult.ok);
-
-    sourceInfo = sourceDb.info();
-    TEquals(sourceInfo.update_seq, repResult.source_last_seq);
-    TEquals(sourceInfo.update_seq - 2, repResult.history[0].start_last_seq);
-    TEquals(sourceInfo.update_seq, repResult.history[0].end_last_seq);
-    TEquals(sourceInfo.update_seq, repResult.history[0].recorded_seq);
-    TEquals(2, repResult.history[0].missing_checked);
-    TEquals(0, repResult.history[0].missing_found);
-    TEquals(0, repResult.history[0].docs_read);
-    TEquals(0, repResult.history[0].docs_written);
-    TEquals(0, repResult.history[0].doc_write_failures);
-
-    repResult = CouchDB.replicate(dbPairs[i].source, dbPairs[i].target);
-    TEquals(true, repResult.ok);
-    TEquals(true, repResult.no_changes);
-    sourceInfo = sourceDb.info();
-    TEquals(sourceInfo.update_seq, repResult.source_last_seq);
-  }
-
-
-  // test error when source database does not exist
-  try {
-    CouchDB.replicate("foobar", "test_suite_db");
-    T(false, "should have failed with db_not_found error");
-  } catch (x) {
-    TEquals("db_not_found", x.error);
-  }
-
-  // validate COUCHDB-317
-  try {
-    CouchDB.replicate("/foobar", "test_suite_db");
-    T(false, "should have failed with db_not_found error");
-  } catch (x) {
-    TEquals("db_not_found", x.error);
-  }
-
-  try {
-    CouchDB.replicate(CouchDB.protocol + host + "/foobar", "test_suite_db");
-    T(false, "should have failed with db_not_found error");
-  } catch (x) {
-    TEquals("db_not_found", x.error);
-  }
-
-
-  // test since_seq parameter
-  docs = makeDocs(1, 6);
-
-  for (i = 0; i < dbPairs.length; i++) {
-    var since_seq = 3;
-    populateDb(sourceDb, docs);
-    populateDb(targetDb, []);
-
-    var expected_ids = [];
-    var changes = sourceDb.changes({since: since_seq});
-    for (j = 0; j < changes.results.length; j++) {
-      expected_ids.push(changes.results[j].id);
-    }
-    TEquals(2, expected_ids.length, "2 documents since since_seq");
-
-    // For OTP < R14B03, temporary child specs are kept in the supervisor
-    // after the child terminates, so cancel the replication to delete the
-    // child spec in those OTP releases, otherwise since_seq will have no
-    // effect.
-    try {
-      CouchDB.replicate(
-        dbPairs[i].source,
-        dbPairs[i].target,
-        {body: {cancel: true}}
-      );
-    } catch (x) {
-      // OTP R14B03 onwards
-      TEquals("not found", x.error);
-    }
-    repResult = CouchDB.replicate(
-      dbPairs[i].source,
-      dbPairs[i].target,
-      {body: {since_seq: since_seq}}
-    );
-    // Same reason as before. But here we don't want since_seq to affect
-    // subsequent replications, so we need to delete the child spec from the
-    // supervisor (since_seq is not used to calculate the replication ID).
-    try {
-      CouchDB.replicate(
-        dbPairs[i].source,
-        dbPairs[i].target,
-        {body: {cancel: true}}
-      );
-    } catch (x) {
-      // OTP R14B03 onwards
-      TEquals("not found", x.error);
-    }
-    TEquals(true, repResult.ok);
-    TEquals(2, repResult.history[0].missing_checked);
-    TEquals(2, repResult.history[0].missing_found);
-    TEquals(2, repResult.history[0].docs_read);
-    TEquals(2, repResult.history[0].docs_written);
-    TEquals(0, repResult.history[0].doc_write_failures);
-
-    for (j = 0; j < docs.length; j++) {
-      doc = docs[j];
-      copy = targetDb.open(doc._id);
-
-      if (expected_ids.indexOf(doc._id) === -1) {
-        T(copy === null);
-      } else {
-        T(copy !== null);
-        TEquals(true, compareObjects(doc, copy));
-      }
-    }
-  }
-
-
-  // test errors due to doc validate_doc_update functions in the target endpoint
-  docs = makeDocs(1, 8);
-  docs[2]["_attachments"] = {
-    "hello.txt": {
-      "content_type": "text/plain",
-      "data": "aGVsbG8gd29ybGQ="  // base64:encode("hello world")
-    }
-  };
-  var ddoc = {
-    _id: "_design/test",
-    language: "javascript",
-    validate_doc_update: (function(newDoc, oldDoc, userCtx, secObj) {
-      if ((newDoc.integer % 2) !== 0) {
-        throw {forbidden: "I only like multiples of 2."};
-      }
-    }).toString()
-  };
-
-  for (i = 0; i < dbPairs.length; i++) {
-    populateDb(sourceDb, docs);
-    populateDb(targetDb, [ddoc]);
-
-    repResult = CouchDB.replicate(
-      dbPairs[i].source,
-      dbPairs[i].target
-    );
-    TEquals(true, repResult.ok);
-    TEquals(7, repResult.history[0].missing_checked);
-    TEquals(7, repResult.history[0].missing_found);
-    TEquals(7, repResult.history[0].docs_read);
-    TEquals(3, repResult.history[0].docs_written);
-    TEquals(4, repResult.history[0].doc_write_failures);
-
-    for (j = 0; j < docs.length; j++) {
-      doc = docs[j];
-      copy = targetDb.open(doc._id);
-
-      if (doc.integer % 2 === 0) {
-        T(copy !== null);
-        TEquals(copy.integer, doc.integer);
-      } else {
-        T(copy === null);
-      }
-    }
-  }
-
-
-  // test create_target option
-  docs = makeDocs(1, 2);
-
-  for (i = 0; i < dbPairs.length; i++) {
-    populateDb(sourceDb, docs);
-    targetDb.deleteDb();
-
-    repResult = CouchDB.replicate(
-      dbPairs[i].source,
-      dbPairs[i].target,
-      {body: {create_target: true}}
-    );
-    TEquals(true, repResult.ok);
-
-    sourceInfo = sourceDb.info();
-    targetInfo = targetDb.info();
-
-    TEquals(sourceInfo.doc_count, targetInfo.doc_count);
-    TEquals(sourceInfo.update_seq, targetInfo.update_seq);
-  }
-
-
-  // test filtered replication
-  docs = makeDocs(1, 31);
-  docs.push({
-    _id: "_design/mydesign",
-    language: "javascript",
-    filters: {
-      myfilter: (function(doc, req) {
-        var modulus = Number(req.query.modulus);
-        var special = req.query.special;
-        return (doc.integer % modulus === 0) || (doc.string === special);
-      }).toString()
-    }
-  });
-
-  for (i = 0; i < dbPairs.length; i++) {
-    populateDb(sourceDb, docs);
-    populateDb(targetDb, []);
-
-    repResult = CouchDB.replicate(
-      dbPairs[i].source,
-      dbPairs[i].target,
-      {
-        body: {
-          filter: "mydesign/myfilter",
-          query_params: {
-            modulus: "2",
-            special: "7"
-          }
-        }
-      }
-    );
-
-    TEquals(true, repResult.ok);
-
-    for (j = 0; j < docs.length; j++) {
-      doc = docs[j];
-      copy = targetDb.open(doc._id);
-
-      if ((doc.integer && (doc.integer % 2 === 0)) || (doc.string === "7")) {
-
-        T(copy !== null);
-        TEquals(true, compareObjects(doc, copy));
-      } else {
-        TEquals(null, copy);
-      }
-    }
-
-    TEquals(true, repResult.history instanceof Array);
-    TEquals(1, repResult.history.length);
-    // We (incorrectly) don't record update sequences for things
-    // that don't pass the changse feed filter. Historically the
-    // last document to pass was the second to last doc which has
-    // an update sequence of 30. Work that has been applied to avoid
-    // conflicts from duplicate IDs breaking _bulk_docs updates added
-    // a sort to the logic which changes this. Now the last document
-    // to pass has an doc id of "8" and is at update_seq 29 (because only
-    // "9" and the design doc are after it).
-    //
-    // In the future the fix ought to be that we record that update
-    // sequence of the database. BigCouch has some existing work on
-    // this in the clustered case because if you have very few documents
-    // that pass the filter then (given single node's behavior) you end
-    // up having to rescan a large portion of the database.
-    TEquals(29, repResult.source_last_seq);
-    TEquals(0, repResult.history[0].start_last_seq);
-    TEquals(29, repResult.history[0].end_last_seq);
-    TEquals(29, repResult.history[0].recorded_seq);
-    // 16 => 15 docs with even integer field  + 1 doc with string field "7"
-    TEquals(16, repResult.history[0].missing_checked);
-    TEquals(16, repResult.history[0].missing_found);
-    TEquals(16, repResult.history[0].docs_read);
-    TEquals(16, repResult.history[0].docs_written);
-    TEquals(0, repResult.history[0].doc_write_failures);
-
-
-    // add new docs to source and resume the same replication
-    var newDocs = makeDocs(50, 56);
-    populateDb(sourceDb, newDocs, true);
-
-    repResult = CouchDB.replicate(
-      dbPairs[i].source,
-      dbPairs[i].target,
-      {
-        body: {
-          filter: "mydesign/myfilter",
-          query_params: {
-            modulus: "2",
-            special: "7"
-          }
-        }
-      }
-    );
-
-    TEquals(true, repResult.ok);
-
-    for (j = 0; j < newDocs.length; j++) {
-      doc = newDocs[j];
-      copy = targetDb.open(doc._id);
-
-      if (doc.integer && (doc.integer % 2 === 0)) {
-
-        T(copy !== null);
-        TEquals(true, compareObjects(doc, copy));
-      } else {
-        TEquals(null, copy);
-      }
-    }
-
-    // last doc has even integer field, so last replicated seq is 36
-    TEquals(36, repResult.source_last_seq);
-    TEquals(true, repResult.history instanceof Array);
-    TEquals(2, repResult.history.length);
-    TEquals(29, repResult.history[0].start_last_seq);
-    TEquals(36, repResult.history[0].end_last_seq);
-    TEquals(36, repResult.history[0].recorded_seq);
-    TEquals(3, repResult.history[0].missing_checked);
-    TEquals(3, repResult.history[0].missing_found);
-    TEquals(3, repResult.history[0].docs_read);
-    TEquals(3, repResult.history[0].docs_written);
-    TEquals(0, repResult.history[0].doc_write_failures);
-  }
-
-
-  // test filtered replication works as expected after changing the filter's
-  // code (ticket COUCHDB-892)
-  var filterFun1 = (function(doc, req) {
-    if (doc.value < Number(req.query.maxvalue)) {
-      return true;
-    } else {
-      return false;
-    }
-  }).toString();
-
-  var filterFun2 = (function(doc, req) {
-    return true;
-  }).toString();
-
-  for (i = 0; i < dbPairs.length; i++) {
-    populateDb(targetDb, []);
-    populateDb(sourceDb, []);
-
-    TEquals(true, sourceDb.save({_id: "foo1", value: 1}).ok);
-    TEquals(true, sourceDb.save({_id: "foo2", value: 2}).ok);
-    TEquals(true, sourceDb.save({_id: "foo3", value: 3}).ok);
-    TEquals(true, sourceDb.save({_id: "foo4", value: 4}).ok);
-
-    var ddoc = {
-      "_id": "_design/mydesign",
-      "language": "javascript",
-      "filters": {
-        "myfilter": filterFun1
-      }
-    };
-
-    TEquals(true, sourceDb.save(ddoc).ok);
-
-    repResult = CouchDB.replicate(
-      dbPairs[i].source,
-      dbPairs[i].target,
-      {
-        body: {
-          filter: "mydesign/myfilter",
-          query_params: {
-            maxvalue: "3"
-          }
-        }
-      }
-    );
-
-    TEquals(true, repResult.ok);
-    TEquals(true, repResult.history instanceof Array);
-    TEquals(1, repResult.history.length);
-    TEquals(2, repResult.history[0].docs_written);
-    TEquals(2, repResult.history[0].docs_read);
-    TEquals(0, repResult.history[0].doc_write_failures);
-
-    var docFoo1 = targetDb.open("foo1");
-    T(docFoo1 !== null);
-    TEquals(1, docFoo1.value);
-
-    var docFoo2 = targetDb.open("foo2");
-    T(docFoo2 !== null);
-    TEquals(2, docFoo2.value);
-
-    var docFoo3 = targetDb.open("foo3");
-    TEquals(null, docFoo3);
-
-    var docFoo4 = targetDb.open("foo4");
-    TEquals(null, docFoo4);
-
-    // replication should start from scratch after the filter's code changed
-
-    ddoc.filters.myfilter = filterFun2;
-    TEquals(true, sourceDb.save(ddoc).ok);
-
-    repResult = CouchDB.replicate(
-      dbPairs[i].source,
-      dbPairs[i].target,
-      {
-        body: {
-          filter: "mydesign/myfilter",
-          query_params : {
-            maxvalue: "3"
-          }
-        }
-      }
-    );
-
-    TEquals(true, repResult.ok);
-    TEquals(true, repResult.history instanceof Array);
-    TEquals(1, repResult.history.length);
-    TEquals(3, repResult.history[0].docs_written);
-    TEquals(3, repResult.history[0].docs_read);
-    TEquals(0, repResult.history[0].doc_write_failures);
-
-    docFoo1 = targetDb.open("foo1");
-    T(docFoo1 !== null);
-    TEquals(1, docFoo1.value);
-
-    docFoo2 = targetDb.open("foo2");
-    T(docFoo2 !== null);
-    TEquals(2, docFoo2.value);
-
-    docFoo3 = targetDb.open("foo3");
-    T(docFoo3 !== null);
-    TEquals(3, docFoo3.value);
-
-    docFoo4 = targetDb.open("foo4");
-    T(docFoo4 !== null);
-    TEquals(4, docFoo4.value);
-
-    T(targetDb.open("_design/mydesign") !== null);
-  }
-
-
-  // test replication by doc IDs
-  docs = makeDocs(1, 11);
-  docs.push({
-    _id: "_design/foo",
-    language: "javascript",
-    integer: 1
-  });
-
-  var target_doc_ids = [
-    { initial: ["1", "2", "10"], after: [], conflict_id: "2" },
-    { initial: ["1", "2"], after: ["7"], conflict_id: "1" },
-    { initial: ["1", "foo_666", "10"], after: ["7"], conflict_id: "10" },
-    { initial: ["_design/foo", "8"], after: ["foo_5"], conflict_id: "8" },
-    { initial: ["_design%2Ffoo", "8"], after: ["foo_5"], conflict_id: "8" },
-    { initial: [], after: ["foo_1000", "_design/foo", "1"], conflict_id: "1" }
-  ];
-  var doc_ids, after_doc_ids;
-  var id, num_inexistent_docs, after_num_inexistent_docs;
-  var total, after_total;
-
-  for (i = 0; i < dbPairs.length; i++) {
-
-    for (j = 0; j < target_doc_ids.length; j++) {
-      doc_ids = target_doc_ids[j].initial;
-      num_inexistent_docs = 0;
-
-      for (k = 0; k < doc_ids.length; k++) {
-        id = doc_ids[k];
-        if (id.indexOf("foo_") === 0) {
-          num_inexistent_docs += 1;
-        }
-      }
-
-      populateDb(sourceDb, docs);
-      populateDb(targetDb, []);
-
-      repResult = CouchDB.replicate(
-        dbPairs[i].source,
-        dbPairs[i].target,
-        {
-          body: {
-            doc_ids: doc_ids
-          }
-        }
-      );
-
-      total = doc_ids.length - num_inexistent_docs;
-      TEquals(true, repResult.ok);
-      if (total === 0) {
-        TEquals(true, repResult.no_changes);
-      } else {
-        TEquals('string', typeof repResult.start_time);
-        TEquals('string', typeof repResult.end_time);
-        TEquals(total, repResult.docs_read);
-        TEquals(total, repResult.docs_written);
-        TEquals(0, repResult.doc_write_failures);
-      }
-
-      for (k = 0; k < doc_ids.length; k++) {
-        id = decodeURIComponent(doc_ids[k]);
-        doc = sourceDb.open(id);
-        copy = targetDb.open(id);
-
-        if (id.indexOf("foo_") === 0) {
-          TEquals(null, doc);
-          TEquals(null, copy);
-        } else {
-          T(doc !== null);
-          T(copy !== null);
-          TEquals(true, compareObjects(doc, copy));
-        }
-      }
-
-      // be absolutely sure that other docs were not replicated
-      for (k = 0; k < docs.length; k++) {
-        var base_id = docs[k]._id;
-        id = encodeURIComponent(base_id);
-        doc = targetDb.open(base_id);
-
-        if ((doc_ids.indexOf(id) >= 0) || (doc_ids.indexOf(base_id) >= 0)) {
-            T(doc !== null);
-        } else {
-            TEquals(null, doc);
-        }
-      }
-
-      targetInfo = targetDb.info();
-      TEquals(total, targetInfo.doc_count);
-
-
-      // add more docs throught replication by doc IDs
-      after_doc_ids = target_doc_ids[j].after;
-      after_num_inexistent_docs = 0;
-
-      for (k = 0; k < after_doc_ids.length; k++) {
-        id = after_doc_ids[k];
-        if (id.indexOf("foo_") === 0) {
-          after_num_inexistent_docs += 1;
-        }
-      }
-
-      repResult = CouchDB.replicate(
-        dbPairs[i].source,
-        dbPairs[i].target,
-        {
-          body: {
-            doc_ids: after_doc_ids
-          }
-        }
-      );
-
-      after_total = after_doc_ids.length - after_num_inexistent_docs;
-      TEquals(true, repResult.ok);
-      if (after_total === 0) {
-        TEquals(true, repResult.no_changes);
-      } else {
-        TEquals('string', typeof repResult.start_time);
-        TEquals('string', typeof repResult.end_time);
-        TEquals(after_total, repResult.docs_read);
-        TEquals(after_total, repResult.docs_written);
-        TEquals(0, repResult.doc_write_failures);
-      }
-
-      for (k = 0; k < after_doc_ids.length; k++) {
-        id = after_doc_ids[k];
-        doc = sourceDb.open(id);
-        copy = targetDb.open(id);
-
-        if (id.indexOf("foo_") === 0) {
-          TEquals(null, doc);
-          TEquals(null, copy);
-        } else {
-          T(doc !== null);
-          T(copy !== null);
-          TEquals(true, compareObjects(doc, copy));
-        }
-      }
-
-      // be absolutely sure that other docs were not replicated
-      for (k = 0; k < docs.length; k++) {
-        var base_id = docs[k]._id;
-        id = encodeURIComponent(base_id);
-        doc = targetDb.open(base_id);
-
-        if ((doc_ids.indexOf(id) >= 0) || (after_doc_ids.indexOf(id) >= 0) ||
-            (doc_ids.indexOf(base_id) >= 0) ||
-            (after_doc_ids.indexOf(base_id) >= 0)) {
-            T(doc !== null);
-        } else {
-            TEquals(null, doc);
-        }
-      }
-
-      targetInfo = targetDb.info();
-      TEquals((total + after_total), targetInfo.doc_count);
-
-
-      // replicate again the same doc after updated on source (no conflict)
-      id = target_doc_ids[j].conflict_id;
-      doc = sourceDb.open(id);
-      T(doc !== null);
-      doc.integer = 666;
-      TEquals(true, sourceDb.save(doc).ok);
-      addAtt(sourceDb, doc, "readme.txt", att1_data, "text/plain");
-      addAtt(sourceDb, doc, "data.dat", att2_data, "application/binary");
-
-      repResult = CouchDB.replicate(
-        dbPairs[i].source,
-        dbPairs[i].target,
-        {
-          body: {
-            doc_ids: [id]
-          }
-        }
-      );
-
-      TEquals(true, repResult.ok);
-      TEquals(1, repResult.docs_read);
-      TEquals(1, repResult.docs_written);
-      TEquals(0, repResult.doc_write_failures);
-
-      copy = targetDb.open(id, {conflicts: true});
-
-      TEquals(666, copy.integer);
-      TEquals(0, copy._rev.indexOf("4-"));
-      TEquals('undefined', typeof copy._conflicts);
-
-      var atts = copy._attachments;
-      TEquals('object', typeof atts);
-      TEquals('object', typeof atts["readme.txt"]);
-      TEquals(3, atts["readme.txt"].revpos);
-      TEquals(0, atts["readme.txt"].content_type.indexOf("text/plain"));
-      TEquals(true, atts["readme.txt"].stub);
-
-      var att1_copy = CouchDB.request(
-        "GET", "/" + targetDb.name + "/" + copy._id + "/readme.txt"
-      ).responseText;
-      TEquals(att1_data.length, att1_copy.length);
-      TEquals(att1_data, att1_copy);
-
-      TEquals('object', typeof atts["data.dat"]);
-      TEquals(4, atts["data.dat"].revpos);
-      TEquals(0, atts["data.dat"].content_type.indexOf("application/binary"));
-      TEquals(true, atts["data.dat"].stub);
-
-      var att2_copy = CouchDB.request(
-        "GET", "/" + targetDb.name + "/" + copy._id + "/data.dat"
-      ).responseText;
-      TEquals(att2_data.length, att2_copy.length);
-      TEquals(att2_data, att2_copy);
-
-
-      // generate a conflict throught replication by doc IDs
-      id = target_doc_ids[j].conflict_id;
-      doc = sourceDb.open(id);
-      copy = targetDb.open(id);
-      T(doc !== null);
-      T(copy !== null);
-      doc.integer += 100;
-      copy.integer += 1;
-      TEquals(true, sourceDb.save(doc).ok);
-      TEquals(true, targetDb.save(copy).ok);
-
-      repResult = CouchDB.replicate(
-        dbPairs[i].source,
-        dbPairs[i].target,
-        {
-          body: {
-            doc_ids: [id]
-          }
-        }
-      );
-
-      TEquals(true, repResult.ok);
-      TEquals(1, repResult.docs_read);
-      TEquals(1, repResult.docs_written);
-      TEquals(0, repResult.doc_write_failures);
-
-      copy = targetDb.open(id, {conflicts: true});
-
-      TEquals(0, copy._rev.indexOf("5-"));
-      TEquals(true, copy._conflicts instanceof Array);
-      TEquals(1, copy._conflicts.length);
-      TEquals(0, copy._conflicts[0].indexOf("5-"));
-    }
-  }
-
-
-  docs = makeDocs(1, 25);
-  docs.push({
-    _id: "_design/foo",
-    language: "javascript",
-    filters: {
-      myfilter: (function(doc, req) { return true; }).toString()
-    }
-  });
-
-  for (i = 0; i < dbPairs.length; i++) {
-    populateDb(sourceDb, docs);
-    populateDb(targetDb, []);
-
-    // add some attachments
-    for (j = 10; j < 15; j++) {
-      addAtt(sourceDb, docs[j], "readme.txt", att1_data, "text/plain");
-    }
-
-    repResult = CouchDB.replicate(
-      dbPairs[i].source,
-      dbPairs[i].target,
-      {
-        body: {
-          continuous: true
-        }
-      }
-    );
-    TEquals(true, repResult.ok);
-    TEquals('string', typeof repResult._local_id);
-
-    var rep_id = repResult._local_id;
-
-    waitForSeq(sourceDb, targetDb, rep_id);
-
-    for (j = 0; j < docs.length; j++) {
-      doc = docs[j];
-      copy = targetDb.open(doc._id);
-
-      T(copy !== null);
-      TEquals(true, compareObjects(doc, copy));
-
-      if (j >= 10 && j < 15) {
-        var atts = copy._attachments;
-        TEquals('object', typeof atts);
-        TEquals('object', typeof atts["readme.txt"]);
-        TEquals(2, atts["readme.txt"].revpos);
-        TEquals(0, atts["readme.txt"].content_type.indexOf("text/plain"));
-        TEquals(true, atts["readme.txt"].stub);
-
-        var att_copy = CouchDB.request(
-          "GET", "/" + targetDb.name + "/" + copy._id + "/readme.txt"
-        ).responseText;
-        TEquals(att1_data.length, att_copy.length);
-        TEquals(att1_data, att_copy);
-      }
-    }
-
-    sourceInfo = sourceDb.info();
-    targetInfo = targetDb.info();
-
-    TEquals(sourceInfo.doc_count, targetInfo.doc_count);
-
-    // add attachments to docs in source
-    for (j = 10; j < 15; j++) {
-      addAtt(sourceDb, docs[j], "data.dat", att2_data, "application/binary");
-    }
-
-    var ddoc = docs[docs.length - 1]; // design doc
-    addAtt(sourceDb, ddoc, "readme.txt", att1_data, "text/plain");
-
-    waitForSeq(sourceDb, targetDb, rep_id);
-
-    var modifDocs = docs.slice(10, 15).concat([ddoc]);
-    for (j = 0; j < modifDocs.length; j++) {
-      doc = modifDocs[j];
-      copy = targetDb.open(doc._id);
-
-      T(copy !== null);
-      TEquals(true, compareObjects(doc, copy));
-
-      var atts = copy._attachments;
-      TEquals('object', typeof atts);
-      TEquals('object', typeof atts["readme.txt"]);
-      TEquals(2, atts["readme.txt"].revpos);
-      TEquals(0, atts["readme.txt"].content_type.indexOf("text/plain"));
-      TEquals(true, atts["readme.txt"].stub);
-
-      var att1_copy = CouchDB.request(
-        "GET", "/" + targetDb.name + "/" + copy._id + "/readme.txt"
-      ).responseText;
-      TEquals(att1_data.length, att1_copy.length);
-      TEquals(att1_data, att1_copy);
-
-      if (doc._id.indexOf("_design/") === -1) {
-        TEquals('object', typeof atts["data.dat"]);
-        TEquals(3, atts["data.dat"].revpos);
-        TEquals(0, atts["data.dat"].content_type.indexOf("application/binary"));
-        TEquals(true, atts["data.dat"].stub);
-
-        var att2_copy = CouchDB.request(
-          "GET", "/" + targetDb.name + "/" + copy._id + "/data.dat"
-        ).responseText;
-        TEquals(att2_data.length, att2_copy.length);
-        TEquals(att2_data, att2_copy);
-      }
-    }
-
-    sourceInfo = sourceDb.info();
-    targetInfo = targetDb.info();
-
-    TEquals(sourceInfo.doc_count, targetInfo.doc_count);
-
-    // add another attachment to the ddoc on source
-    addAtt(sourceDb, ddoc, "data.dat", att2_data, "application/binary");
-
-    waitForSeq(sourceDb, targetDb, rep_id);
-
-    copy = targetDb.open(ddoc._id);
-    var atts = copy._attachments;
-    TEquals('object', typeof atts);
-    TEquals('object', typeof atts["readme.txt"]);
-    TEquals(2, atts["readme.txt"].revpos);
-    TEquals(0, atts["readme.txt"].content_type.indexOf("text/plain"));
-    TEquals(true, atts["readme.txt"].stub);
-
-    var att1_copy = CouchDB.request(
-      "GET", "/" + targetDb.name + "/" + copy._id + "/readme.txt"
-    ).responseText;
-    TEquals(att1_data.length, att1_copy.length);
-    TEquals(att1_data, att1_copy);
-
-    TEquals('object', typeof atts["data.dat"]);
-    TEquals(3, atts["data.dat"].revpos);
-    TEquals(0, atts["data.dat"].content_type.indexOf("application/binary"));
-    TEquals(true, atts["data.dat"].stub);
-
-    var att2_copy = CouchDB.request(
-      "GET", "/" + targetDb.name + "/" + copy._id + "/data.dat"
-    ).responseText;
-    TEquals(att2_data.length, att2_copy.length);
-    TEquals(att2_data, att2_copy);
-
-    sourceInfo = sourceDb.info();
-    targetInfo = targetDb.info();
-
-    TEquals(sourceInfo.doc_count, targetInfo.doc_count);
-
-
-    // add more docs to source
-    var newDocs = makeDocs(25, 35);
-    populateDb(sourceDb, newDocs, true);
-
-    waitForSeq(sourceDb, targetDb, rep_id);
-
-    for (j = 0; j < newDocs.length; j++) {
-      doc = newDocs[j];
-      copy = targetDb.open(doc._id);
-
-      T(copy !== null);
-      TEquals(true, compareObjects(doc, copy));
-    }
-
-    sourceInfo = sourceDb.info();
-    targetInfo = targetDb.info();
-
-    TEquals(sourceInfo.doc_count, targetInfo.doc_count);
-
-    // delete docs from source
-    TEquals(true, sourceDb.deleteDoc(newDocs[0]).ok);
-    TEquals(true, sourceDb.deleteDoc(newDocs[6]).ok);
-
-    waitForSeq(sourceDb, targetDb, rep_id);
-
-    copy = targetDb.open(newDocs[0]._id);
-    TEquals(null, copy);
-    copy = targetDb.open(newDocs[6]._id);
-    TEquals(null, copy);
-
-    var changes = targetDb.changes({since: targetInfo.update_seq});
-    var line1 = changes.results[changes.results.length - 2];
-    var line2 = changes.results[changes.results.length - 1];
-    TEquals(newDocs[0]._id, line1.id);
-    TEquals(true, line1.deleted);
-    TEquals(newDocs[6]._id, line2.id);
-    TEquals(true, line2.deleted);
-
-    // cancel the replication
-    repResult = CouchDB.replicate(
-      dbPairs[i].source,
-      dbPairs[i].target,
-      {
-        body: {
-          continuous: true,
-          cancel: true
-        }
-      }
-    );
-    TEquals(true, repResult.ok);
-    TEquals(rep_id, repResult._local_id);
-
-    doc = {
-      _id: 'foobar',
-      value: 666
-    };
-    TEquals(true, sourceDb.save(doc).ok);
-
-    waitForSeq(sourceDb, targetDb, rep_id);
-    copy = targetDb.open(doc._id);
-    TEquals(null, copy);
-  }
-
-  // COUCHDB-1093 - filtered and continuous _changes feed dies when the
-  // database is compacted
-  docs = makeDocs(1, 10);
-  docs.push({
-    _id: "_design/foo",
-    language: "javascript",
-    filters: {
-      myfilter: (function(doc, req) { return true; }).toString()
-    }
-  });
-  populateDb(sourceDb, docs);
-  populateDb(targetDb, []);
-
-  repResult = CouchDB.replicate(
-    CouchDB.protocol + host + "/" + sourceDb.name,
-    targetDb.name,
-    {
-      body: {
-        continuous: true,
-        filter: "foo/myfilter"
-      }
-    }
-  );
-  TEquals(true, repResult.ok);
-  TEquals('string', typeof repResult._local_id);
-
-  TEquals(true, sourceDb.compact().ok);
-  while (sourceDb.info().compact_running) {};
-
-  TEquals(true, sourceDb.save(makeDocs(30, 31)[0]).ok);
-
-  var task = getTask(repResult._local_id, 1000);
-  T(task != null);
-
-  waitForSeq(sourceDb, targetDb, repResult._local_id);
-  T(sourceDb.open("30") !== null);
-
-  // cancel replication
-  repResult = CouchDB.replicate(
-    CouchDB.protocol + host + "/" + sourceDb.name,
-    targetDb.name,
-    {
-      body: {
-        continuous: true,
-        filter: "foo/myfilter",
-        cancel: true
-      }
-    }
-  );
-  TEquals(true, repResult.ok);
-  TEquals('string', typeof repResult._local_id);
-
-
-  //
-  // test replication of compressed attachments
-  //
-  doc = {
-    _id: "foobar"
-  };
-  var bigTextAtt = makeAttData(128 * 1024);
-  var attName = "readme.txt";
-  var xhr = CouchDB.request("GET", "/_config/attachments/compression_level");
-  var compressionLevel = JSON.parse(xhr.responseText);
-  xhr = CouchDB.request("GET", "/_config/attachments/compressible_types");
-  var compressibleTypes = JSON.parse(xhr.responseText);
-
-  for (i = 0; i < dbPairs.length; i++) {
-    populateDb(sourceDb, [doc]);
-    populateDb(targetDb, []);
-
-    // enable compression of text types
-    enableAttCompression("8", "text/*");
-
-    // add text attachment to foobar doc
-    xhr = CouchDB.request(
-      "PUT",
-      "/" + sourceDb.name + "/" + doc._id + "/" + attName + "?rev=" + doc._rev,
-      {
-        body: bigTextAtt,
-        headers: {"Content-Type": "text/plain"}
-      }
-    );
-    TEquals(201, xhr.status);
-
-    // disable compression and replicate
-    disableAttCompression();
-
-    repResult = CouchDB.replicate(dbPairs[i].source, dbPairs[i].target);
-    TEquals(true, repResult.ok);
-    TEquals(true, repResult.history instanceof Array);
-    TEquals(1, repResult.history.length);
-    TEquals(1, repResult.history[0].missing_checked);
-    TEquals(1, repResult.history[0].missing_found);
-    TEquals(1, repResult.history[0].docs_read);
-    TEquals(1, repResult.history[0].docs_written);
-    TEquals(0, repResult.history[0].doc_write_failures);
-
-    copy = targetDb.open(
-      doc._id,
-      {att_encoding_info: true, bypass_cache: Math.round(Math.random() * 1000)}
-    );
-    T(copy !== null);
-    T(attName in copy._attachments);
-    TEquals("gzip", copy._attachments[attName].encoding);
-    TEquals("number", typeof copy._attachments[attName].length);
-    TEquals("number", typeof copy._attachments[attName].encoded_length);
-    T(copy._attachments[attName].encoded_length < copy._attachments[attName].length);
-  }
-
-  delete bigTextAtt;
-  // restore original settings
-  enableAttCompression(compressionLevel, compressibleTypes);
-
-
-  //
-  // test replication triggered by non admins
-  //
-
-  // case 1) user triggering the replication is not a DB admin of the target DB
-  var joeUserDoc = CouchDB.prepareUserDoc({
-    name: "joe",
-    roles: ["erlanger"]
-  }, "erly");
-  var usersDb = new CouchDB("test_suite_auth", {"X-Couch-Full-Commit":"false"});
-  var server_config = [
-    {
-      section: "couch_httpd_auth",
-      key: "authentication_db",
-      value: usersDb.name
-    }
-  ];
-
-  docs = makeDocs(1, 6);
-  docs.push({
-    _id: "_design/foo",
-    language: "javascript"
-  });
-
-  dbPairs = [
-    {
-      source: sourceDb.name,
-      target: targetDb.name
-    },
-    {
-      source: CouchDB.protocol + host + "/" + sourceDb.name,
-      target: targetDb.name
-    },
-    {
-      source: sourceDb.name,
-      target: CouchDB.protocol + "joe:erly@" + host + "/" + targetDb.name
-    },
-    {
-      source: CouchDB.protocol + host + "/" + sourceDb.name,
-      target: CouchDB.protocol + "joe:erly@" + host + "/" + targetDb.name
-    }
-  ];
-
-  for (i = 0; i < dbPairs.length; i++) {
-    usersDb.deleteDb();
-    populateDb(sourceDb, docs);
-    populateDb(targetDb, []);
-
-    TEquals(true, targetDb.setSecObj({
-      admins: {
-        names: ["superman"],
-        roles: ["god"]
-      }
-    }).ok);
-
-    run_on_modified_server(server_config, function() {
-      delete joeUserDoc._rev;
-      TEquals(true, usersDb.save(joeUserDoc).ok);
-
-      TEquals(true, CouchDB.login("joe", "erly").ok);
-      TEquals('joe', CouchDB.session().userCtx.name);
-
-      repResult = CouchDB.replicate(dbPairs[i].source, dbPairs[i].target);
-
-      TEquals(true, CouchDB.logout().ok);
-
-      TEquals(true, repResult.ok);
-      TEquals(docs.length, repResult.history[0].docs_read);
-      TEquals((docs.length - 1), repResult.history[0].docs_written); // 1 ddoc
-      TEquals(1, repResult.history[0].doc_write_failures);
-    });
-
-    for (j = 0; j < docs.length; j++) {
-      doc = docs[j];
-      copy = targetDb.open(doc._id);
-
-      if (doc._id.indexOf("_design/") === 0) {
-        TEquals(null, copy);
-      } else {
-        T(copy !== null);
-        TEquals(true, compareObjects(doc, copy));
-      }
-    }
-  }
-
-  // case 2) user triggering the replication is not a reader (nor admin) of the
-  //         source DB
-  dbPairs = [
-    {
-      source: sourceDb.name,
-      target: targetDb.name
-    },
-    {
-      source: CouchDB.protocol + "joe:erly@" + host + "/" + sourceDb.name,
-      target: targetDb.name
-    },
-    {
-      source: sourceDb.name,
-      target: CouchDB.protocol + host + "/" + targetDb.name
-    },
-    {
-      source: CouchDB.protocol + "joe:erly@" + host + "/" + sourceDb.name,
-      target: CouchDB.protocol + host + "/" + targetDb.name
-    }
-  ];
-
-  for (i = 0; i < dbPairs.length; i++) {
-    usersDb.deleteDb();
-    populateDb(sourceDb, docs);
-    populateDb(targetDb, []);
-
-    TEquals(true, sourceDb.setSecObj({
-      admins: {
-        names: ["superman"],
-        roles: ["god"]
-      },
-      readers: {
-        names: ["john"],
-        roles: ["secret"]
-      }
-    }).ok);
-
-    run_on_modified_server(server_config, function() {
-      delete joeUserDoc._rev;
-      TEquals(true, usersDb.save(joeUserDoc).ok);
-
-      TEquals(true, CouchDB.login("joe", "erly").ok);
-      TEquals('joe', CouchDB.session().userCtx.name);
-
-      try {
-        CouchDB.replicate(dbPairs[i].source, dbPairs[i].target);
-        T(false, "should have raised an exception");
-      } catch (x) {
-        TEquals("unauthorized", x.error);
-      }
-
-      TEquals(true, CouchDB.logout().ok);
-    });
-
-    for (j = 0; j < docs.length; j++) {
-      doc = docs[j];
-      copy = targetDb.open(doc._id);
-      TEquals(null, copy);
-    }
-  }
-
-
-  // COUCHDB-885 - push replication of a doc with attachment causes a
-  //               conflict in the target.
-  sourceDb = new CouchDB("test_suite_db_a");
-  targetDb = new CouchDB("test_suite_db_b");
-
-  sourceDb.deleteDb();
-  sourceDb.createDb();
-  targetDb.deleteDb();
-  targetDb.createDb();
-
-  doc = {
-    _id: "doc1"
-  };
-  TEquals(true, sourceDb.save(doc).ok);
-
-  repResult = CouchDB.replicate(
-    sourceDb.name,
-    CouchDB.protocol + host + "/" + targetDb.name
-  );
-  TEquals(true, repResult.ok);
-  TEquals(true, repResult.history instanceof Array);
-  TEquals(1, repResult.history.length);
-  TEquals(1, repResult.history[0].docs_written);
-  TEquals(1, repResult.history[0].docs_read);
-  TEquals(0, repResult.history[0].doc_write_failures);
-
-  doc["_attachments"] = {
-    "hello.txt": {
-      "content_type": "text/plain",
-      "data": "aGVsbG8gd29ybGQ="  // base64:encode("hello world")
-    },
-    "foo.dat": {
-      "content_type": "not/compressible",
-      "data": "aSBhbSBub3QgZ3ppcGVk"  // base64:encode("i am not gziped")
-    }
-  };
-
-  TEquals(true, sourceDb.save(doc).ok);
-  repResult = CouchDB.replicate(
-    sourceDb.name,
-    CouchDB.protocol + host + "/" + targetDb.name
-  );
-  TEquals(true, repResult.ok);
-  TEquals(true, repResult.history instanceof Array);
-  TEquals(2, repResult.history.length);
-  TEquals(1, repResult.history[0].docs_written);
-  TEquals(1, repResult.history[0].docs_read);
-  TEquals(0, repResult.history[0].doc_write_failures);
-
-  copy = targetDb.open(doc._id, {
-    conflicts: true, deleted_conflicts: true,
-    attachments: true, att_encoding_info: true});
-  T(copy !== null);
-  TEquals("undefined", typeof copy._conflicts);
-  TEquals("undefined", typeof copy._deleted_conflicts);
-  TEquals("text/plain", copy._attachments["hello.txt"]["content_type"]);
-  TEquals("aGVsbG8gd29ybGQ=", copy._attachments["hello.txt"]["data"]);
-  TEquals("gzip", copy._attachments["hello.txt"]["encoding"]);
-  TEquals("not/compressible", copy._attachments["foo.dat"]["content_type"]);
-  TEquals("aSBhbSBub3QgZ3ppcGVk", copy._attachments["foo.dat"]["data"]);
-  TEquals("undefined", typeof copy._attachments["foo.dat"]["encoding"]);
-  // end of test for COUCHDB-885
-
-  // Test for COUCHDB-1242 (reject non-string query_params)
-  try {
-    CouchDB.replicate(sourceDb, targetDb, {
-      body: {
-        filter : "mydesign/myfilter",
-        query_params : {
-          "maxvalue": 4
-        }
-      }
-    });
-  } catch (e) {
-    TEquals("bad_request", e.error);
-  }
-
-
-  // Test that we can cancel a replication just by POSTing an object
-  // like  {"replication_id": Id, "cancel": true}. The replication ID
-  // can be obtained from a continuous replication request response
-  // (_local_id field), from _active_tasks or from the log
-  populateDb(sourceDb, makeDocs(1, 6));
-  populateDb(targetDb, []);
-
-  repResult = CouchDB.replicate(
-    CouchDB.protocol + host + "/" + sourceDb.name,
-    targetDb.name,
-    {
-      body: {
-        continuous: true,
-        create_target: true
-      }
-    }
-  );
-  TEquals(true, repResult.ok);
-  TEquals('string', typeof repResult._local_id);
-  var repId = repResult._local_id;
-
-  var task = getTask(repId, 3000);
-  T(task != null);
-
-  TEquals(task["replication_id"], repId, "Replication found in _active_tasks");
-  xhr = CouchDB.request(
-    "POST", "/_replicate", {
-      body: JSON.stringify({"replication_id": repId, "cancel": true}),
-      headers: {"Content-Type": "application/json"}
-  });
-  TEquals(200, xhr.status, "Replication cancel request success");
-
-  task = getTask(repId);
-  TEquals(null, task, "Replication was canceled");
-
-  xhr = CouchDB.request(
-    "POST", "/_replicate", {
-      body: JSON.stringify({"replication_id": repId, "cancel": true}),
-      headers: {"Content-Type": "application/json"}
-  });
-  TEquals(404, xhr.status, "2nd replication cancel failed");
-
-  // Non-admin user can not cancel replications triggered by other users
-  var userDoc = CouchDB.prepareUserDoc({
-    name: "tony",
-    roles: ["mafia"]
-  }, "soprano");
-  usersDb = new CouchDB("test_suite_auth", {"X-Couch-Full-Commit":"false"});
-  server_config = [
-    {
-      section: "couch_httpd_auth",
-      key: "authentication_db",
-      value: usersDb.name
-    }
-  ];
-
-  run_on_modified_server(server_config, function() {
-    populateDb(sourceDb, makeDocs(1, 6));
-    populateDb(targetDb, []);
-    TEquals(true, usersDb.save(userDoc).ok);
-
-    repResult = CouchDB.replicate(
-      CouchDB.protocol + host + "/" + sourceDb.name,
-      targetDb.name,
-      {
-        body: {
-          continuous: true
-        }
-      }
-    );
-    TEquals(true, repResult.ok);
-    TEquals('string', typeof repResult._local_id);
-
-    TEquals(true, CouchDB.login("tony", "soprano").ok);
-    TEquals('tony', CouchDB.session().userCtx.name);
-
-    xhr = CouchDB.request(
-      "POST", "/_replicate", {
-        body: JSON.stringify({"replication_id": repResult._local_id, "cancel": true}),
-        headers: {"Content-Type": "application/json"}
-    });
-    TEquals(401, xhr.status, "Unauthorized to cancel replication");
-    TEquals("unauthorized", JSON.parse(xhr.responseText).error);
-
-    TEquals(true, CouchDB.logout().ok);
-
-    xhr = CouchDB.request(
-      "POST", "/_replicate", {
-        body: JSON.stringify({"replication_id": repResult._local_id, "cancel": true}),
-        headers: {"Content-Type": "application/json"}
-    });
-    TEquals(200, xhr.status, "Authorized to cancel replication");
-  });
-
-  // cleanup
-  usersDb.deleteDb();
-  sourceDb.deleteDb();
-  targetDb.deleteDb();
-};

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/www/script/test/replicator_db_bad_rep_id.js
----------------------------------------------------------------------
diff --git a/share/www/script/test/replicator_db_bad_rep_id.js b/share/www/script/test/replicator_db_bad_rep_id.js
deleted file mode 100644
index 285b863..0000000
--- a/share/www/script/test/replicator_db_bad_rep_id.js
+++ /dev/null
@@ -1,77 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
-couchTests.replicator_db_bad_rep_id = function(debug) {
-
-  if (debug) debugger;
-
-  var populate_db = replicator_db.populate_db;
-  var docs1 = replicator_db.docs1;
-  var dbA = replicator_db.dbA;
-  var dbB = replicator_db.dbB;
-  var repDb = replicator_db.repDb;
-  var wait = replicator_db.wait;
-  var waitForRep = replicator_db.waitForRep;
-  var waitForSeq = replicator_db.waitForSeq;
-
-  function rep_doc_with_bad_rep_id() {
-    populate_db(dbA, docs1);
-    populate_db(dbB, []);
-
-    var repDoc = {
-      _id: "foo_rep",
-      source: dbA.name,
-      target: dbB.name,
-      replication_id: "1234abc"
-    };
-    T(repDb.save(repDoc).ok);
-
-    waitForRep(repDb, repDoc, "completed");
-    for (var i = 0; i < docs1.length; i++) {
-      var doc = docs1[i];
-      var copy = dbB.open(doc._id);
-      T(copy !== null);
-      T(copy.value === doc.value);
-    }
-
-    var repDoc1 = repDb.open(repDoc._id);
-    T(repDoc1 !== null);
-    T(repDoc1.source === repDoc.source);
-    T(repDoc1.target === repDoc.target);
-    T(repDoc1._replication_state === "completed",
-      "replication document with bad replication id failed");
-    T(typeof repDoc1._replication_state_time === "string");
-    T(typeof repDoc1._replication_id  === "string");
-    T(repDoc1._replication_id !== "1234abc");
-  }
-
-  var server_config = [
-    {
-      section: "couch_httpd_auth",
-      key: "iterations",
-      value: "1"
-    },
-    {
-      section: "replicator",
-      key: "db",
-      value: repDb.name
-    }
-  ];
-
-  repDb.deleteDb();
-  run_on_modified_server(server_config, rep_doc_with_bad_rep_id);
-
-  // cleanup
-  repDb.deleteDb();
-  dbA.deleteDb();
-  dbB.deleteDb();
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/www/script/test/replicator_db_by_doc_id.js
----------------------------------------------------------------------
diff --git a/share/www/script/test/replicator_db_by_doc_id.js b/share/www/script/test/replicator_db_by_doc_id.js
deleted file mode 100644
index 1e1a385..0000000
--- a/share/www/script/test/replicator_db_by_doc_id.js
+++ /dev/null
@@ -1,99 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
-couchTests.replicator_db_by_doc_id = function(debug) {
-
-  if (debug) debugger;
-
-  var populate_db = replicator_db.populate_db;
-  var docs1 = replicator_db.docs1;
-  var dbA = replicator_db.dbA;
-  var dbB = replicator_db.dbB;
-  var repDb = replicator_db.repDb;
-  var wait = replicator_db.wait;
-  var waitForRep = replicator_db.waitForRep;
-  var waitForSeq = replicator_db.waitForSeq;
-
-  function by_doc_ids_replication() {
-    // to test that we can replicate docs with slashes in their IDs
-    var docs2 = docs1.concat([
-      {
-        _id: "_design/mydesign",
-        language : "javascript"
-      }
-    ]);
-
-    populate_db(dbA, docs2);
-    populate_db(dbB, []);
-
-    var repDoc = {
-      _id: "foo_cont_rep_doc",
-      source: "http://" + CouchDB.host + "/" + dbA.name,
-      target: dbB.name,
-      doc_ids: ["foo666", "foo3", "_design/mydesign", "foo999", "foo1"]
-    };
-    T(repDb.save(repDoc).ok);
-
-    waitForRep(repDb, repDoc, "completed");
-    var copy = dbB.open("foo1");
-    T(copy !== null);
-    T(copy.value === 11);
-
-    copy = dbB.open("foo2");
-    T(copy === null);
-
-    copy = dbB.open("foo3");
-    T(copy !== null);
-    T(copy.value === 33);
-
-    copy = dbB.open("foo666");
-    T(copy === null);
-
-    copy = dbB.open("foo999");
-    T(copy === null);
-
-    copy = dbB.open("_design/mydesign");
-    T(copy === null);
-
-    repDoc = repDb.open(repDoc._id);
-    T(typeof repDoc._replication_stats === "object", "doc has stats");
-    var stats = repDoc._replication_stats;
-    TEquals(3, stats.revisions_checked, "right # of revisions_checked");
-    TEquals(3, stats.missing_revisions_found, "right # of missing_revisions_found");
-    TEquals(3, stats.docs_read, "right # of docs_read");
-    TEquals(2, stats.docs_written, "right # of docs_written");
-    TEquals(1, stats.doc_write_failures, "right # of doc_write_failures");
-    TEquals(dbA.info().update_seq, stats.checkpointed_source_seq,
-      "right checkpointed_source_seq");
-  }
-
-  var server_config = [
-    {
-      section: "couch_httpd_auth",
-      key: "iterations",
-      value: "1"
-    },
-    {
-      section: "replicator",
-      key: "db",
-      value: repDb.name
-    }
-  ];
-
-  repDb.deleteDb();
-  run_on_modified_server(server_config, by_doc_ids_replication);
-
-  // cleanup
-  repDb.deleteDb();
-  dbA.deleteDb();
-  dbB.deleteDb();
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/www/script/test/replicator_db_compact_rep_db.js
----------------------------------------------------------------------
diff --git a/share/www/script/test/replicator_db_compact_rep_db.js b/share/www/script/test/replicator_db_compact_rep_db.js
deleted file mode 100644
index 0dea0ed..0000000
--- a/share/www/script/test/replicator_db_compact_rep_db.js
+++ /dev/null
@@ -1,119 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
-couchTests.replicator_db_compact_rep_db = function(debug) {
-
-  if (debug) debugger;
-
-  var populate_db = replicator_db.populate_db;
-  var docs1 = replicator_db.docs1;
-  var dbA = replicator_db.dbA;
-  var dbB = replicator_db.dbB;
-  var repDb = replicator_db.repDb;
-  var usersDb = replicator_db.usersDb;
-  var wait = replicator_db.wait;
-  var waitForRep = replicator_db.waitForRep;
-  var waitForSeq = replicator_db.waitForSeq;
-  var wait_rep_doc = replicator_db.wait_rep_doc;
-
-  function compact_rep_db() {
-    var dbA_copy = new CouchDB("test_suite_rep_db_a_copy");
-    var dbB_copy = new CouchDB("test_suite_rep_db_b_copy");
-    var repDoc1, repDoc2;
-    var xhr, i, doc, copy, new_doc;
-    var docs = makeDocs(1, 50);
-
-    populate_db(dbA, docs);
-    populate_db(dbB, docs);
-    populate_db(dbA_copy, []);
-    populate_db(dbB_copy, []);
-
-    repDoc1 = {
-      _id: "rep1",
-      source: CouchDB.protocol + CouchDB.host + "/" + dbA.name,
-      target: dbA_copy.name,
-      continuous: true
-    };
-    repDoc2 = {
-      _id: "rep2",
-      source: CouchDB.protocol + CouchDB.host + "/" + dbB.name,
-      target: dbB_copy.name,
-      continuous: true
-    };
-
-    TEquals(true, repDb.save(repDoc1).ok);
-    TEquals(true, repDb.save(repDoc2).ok);
-
-    TEquals(true, repDb.compact().ok);
-    TEquals(202, repDb.last_req.status);
-
-    waitForSeq(dbA, dbA_copy);
-    waitForSeq(dbB, dbB_copy);
-
-    while (repDb.info().compact_running) {};
-
-    for (i = 0; i < docs.length; i++) {
-      copy = dbA_copy.open(docs[i]._id);
-      T(copy !== null);
-      copy = dbB_copy.open(docs[i]._id);
-      T(copy !== null);
-    }
-
-    new_doc = {
-      _id: "foo666",
-      value: 666
-    };
-
-    TEquals(true, dbA.save(new_doc).ok);
-    TEquals(true, dbB.save(new_doc).ok);
-
-    waitForSeq(dbA, dbA_copy);
-    waitForSeq(dbB, dbB_copy);
-
-    copy = dbA.open(new_doc._id);
-    T(copy !== null);
-    TEquals(666, copy.value);
-    copy = dbB.open(new_doc._id);
-    T(copy !== null);
-    TEquals(666, copy.value);
-  }
-
-  var server_config = [
-    {
-      section: "couch_httpd_auth",
-      key: "iterations",
-      value: "1"
-    },
-    {
-      section: "replicator",
-      key: "db",
-      value: repDb.name
-    },
-    {
-      section: "couch_httpd_auth",
-      key: "authentication_db",
-      value: usersDb.name
-    }
-  ];
-
-  repDb.deleteDb();
-  run_on_modified_server(server_config, compact_rep_db);
-
-  // cleanup
-  repDb.deleteDb();
-  dbA.deleteDb();
-  dbB.deleteDb();
-  usersDb.deleteDb();
-  (new CouchDB("test_suite_rep_db_a_copy")).deleteDb();
-  (new CouchDB("test_suite_rep_db_b_copy")).deleteDb();
-
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/www/script/test/replicator_db_continuous.js
----------------------------------------------------------------------
diff --git a/share/www/script/test/replicator_db_continuous.js b/share/www/script/test/replicator_db_continuous.js
deleted file mode 100644
index a2b17d0..0000000
--- a/share/www/script/test/replicator_db_continuous.js
+++ /dev/null
@@ -1,137 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
-couchTests.replicator_db_continuous = function(debug) {
-
-  if (debug) debugger;
-
-  var populate_db = replicator_db.populate_db;
-  var docs1 = replicator_db.docs1;
-  var dbA = replicator_db.dbA;
-  var dbB = replicator_db.dbB;
-  var repDb = replicator_db.repDb;
-  var wait = replicator_db.wait;
-  var waitForRep = replicator_db.waitForRep;
-  var waitForSeq = replicator_db.waitForSeq;
-
-  function continuous_replication() {
-    populate_db(dbA, docs1);
-    populate_db(dbB, []);
-
-    var repDoc = {
-      _id: "foo_cont_rep_doc",
-      source: "http://" + CouchDB.host + "/" + dbA.name,
-      target: dbB.name,
-      continuous: true,
-      user_ctx: {
-        roles: ["_admin"]
-      }
-    };
-
-    T(repDb.save(repDoc).ok);
-
-    waitForSeq(dbA, dbB);
-    for (var i = 0; i < docs1.length; i++) {
-      var doc = docs1[i];
-      var copy = dbB.open(doc._id);
-      T(copy !== null);
-      T(copy.value === doc.value);
-    }
-
-    var tasks = JSON.parse(CouchDB.request("GET", "/_active_tasks").responseText);
-    TEquals(1, tasks.length, "1 active task");
-    TEquals(repDoc._id, tasks[0].doc_id, "replication doc id in active tasks");
-
-    // add another doc to source, it will be replicated to target
-    var docX = {
-      _id: "foo1000",
-      value: 1001
-    };
-
-    T(dbA.save(docX).ok);
-
-    waitForSeq(dbA, dbB);
-    var copy = dbB.open("foo1000");
-    T(copy !== null);
-    T(copy.value === 1001);
-
-    var repDoc1 = repDb.open(repDoc._id);
-    T(repDoc1 !== null);
-    T(repDoc1.source === repDoc.source);
-    T(repDoc1.target === repDoc.target);
-    T(repDoc1._replication_state === "triggered");
-    T(typeof repDoc1._replication_state_time === "string");
-    T(typeof repDoc1._replication_id  === "string");
-
-    // Design documents are only replicated to local targets if the respective
-    // replication document has a user_ctx filed with the "_admin" role in it.
-    var ddoc = {
-      _id: "_design/foobar",
-      language: "javascript"
-    };
-
-    T(dbA.save(ddoc).ok);
-
-    waitForSeq(dbA, dbB);
-    var ddoc_copy = dbB.open("_design/foobar");
-    T(ddoc_copy !== null);
-    T(ddoc.language === "javascript");
-
-    // update the design doc on source, test that the new revision is replicated
-    ddoc.language = "erlang";
-    T(dbA.save(ddoc).ok);
-    T(ddoc._rev.indexOf("2-") === 0);
-
-    waitForSeq(dbA, dbB);
-    ddoc_copy = dbB.open("_design/foobar");
-    T(ddoc_copy !== null);
-    T(ddoc_copy._rev === ddoc._rev);
-    T(ddoc.language === "erlang");
-
-    // stop replication by deleting the replication document
-    T(repDb.deleteDoc(repDoc1).ok);
-
-    // add another doc to source, it will NOT be replicated to target
-    var docY = {
-      _id: "foo666",
-      value: 999
-    };
-
-    T(dbA.save(docY).ok);
-
-    wait(200); // is there a way to avoid wait here?
-    var copy = dbB.open("foo666");
-    T(copy === null);
-  }
-
-
-  var server_config = [
-    {
-      section: "couch_httpd_auth",
-      key: "iterations",
-      value: "1"
-    },
-    {
-      section: "replicator",
-      key: "db",
-      value: repDb.name
-    }
-  ];
-
-  repDb.deleteDb();
-  run_on_modified_server(server_config, continuous_replication);
-
-  // cleanup
-  repDb.deleteDb();
-  dbA.deleteDb();
-  dbB.deleteDb();
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/www/script/test/replicator_db_credential_delegation.js
----------------------------------------------------------------------
diff --git a/share/www/script/test/replicator_db_credential_delegation.js b/share/www/script/test/replicator_db_credential_delegation.js
deleted file mode 100644
index 7dd9d18..0000000
--- a/share/www/script/test/replicator_db_credential_delegation.js
+++ /dev/null
@@ -1,149 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
-couchTests.replicator_db_credential_delegation = function(debug) {
-
-  if (debug) debugger;
-
-  var populate_db = replicator_db.populate_db;
-  var docs1 = replicator_db.docs1;
-  var dbA = replicator_db.dbA;
-  var dbB = replicator_db.dbB;
-  var repDb = replicator_db.repDb;
-  var usersDb = replicator_db.usersDb;
-  var wait = replicator_db.wait;
-  var waitForRep = replicator_db.waitForRep;
-  var waitForSeq = replicator_db.waitForSeq;
-  var wait_rep_doc = replicator_db.wait_rep_doc;
-
-  function test_replication_credentials_delegation() {
-    populate_db(usersDb, []);
-
-    var joeUserDoc = CouchDB.prepareUserDoc({
-      name: "joe",
-      roles: ["god", "erlanger"]
-    }, "erly");
-    T(usersDb.save(joeUserDoc).ok);
-
-    var ddoc = {
-      _id: "_design/beer",
-      language: "javascript"
-    };
-    populate_db(dbA, docs1.concat([ddoc]));
-    populate_db(dbB, []);
-
-    T(dbB.setSecObj({
-      admins: {
-        names: [],
-        roles: ["god"]
-      }
-    }).ok);
-
-    var server_admins_config = [
-      {
-        section: "couch_httpd_auth",
-        key: "iterations",
-        value: "1"
-      },
-      {
-        section: "admins",
-        key: "fdmanana",
-        value: "qwerty"
-      }
-    ];
-
-    run_on_modified_server(server_admins_config, function() {
-
-      T(CouchDB.login("fdmanana", "qwerty").ok);
-      T(CouchDB.session().userCtx.name === "fdmanana");
-      T(CouchDB.session().userCtx.roles.indexOf("_admin") !== -1);
-
-      var repDoc = {
-        _id: "foo_rep_del_doc_1",
-        source: dbA.name,
-        target: dbB.name,
-        user_ctx: {
-          name: "joe",
-          roles: ["erlanger"]
-        }
-      };
-
-      T(repDb.save(repDoc).ok);
-
-      waitForRep(repDb, repDoc, "completed");
-      for (var i = 0; i < docs1.length; i++) {
-        var doc = docs1[i];
-        var copy = dbB.open(doc._id);
-        T(copy !== null);
-        T(copy.value === doc.value);
-      }
-
-      // design doc was not replicated, because joe is not an admin of db B
-      var doc = dbB.open(ddoc._id);
-      T(doc === null);
-
-      // now test the same replication but putting the role "god" in the
-      // delegation user context property
-      var repDoc2 = {
-        _id: "foo_rep_del_doc_2",
-        source: dbA.name,
-        target: dbB.name,
-        user_ctx: {
-          name: "joe",
-          roles: ["erlanger", "god"]
-        }
-      };
-      T(repDb.save(repDoc2).ok);
-
-      waitForRep(repDb, repDoc2, "completed");
-      for (var i = 0; i < docs1.length; i++) {
-        var doc = docs1[i];
-        var copy = dbB.open(doc._id);
-        T(copy !== null);
-        T(copy.value === doc.value);
-      }
-
-      // because anyone with a 'god' role is an admin of db B, a replication
-      // that is delegated to a 'god' role can write design docs to db B
-      doc = dbB.open(ddoc._id);
-      T(doc !== null);
-      T(doc.language === ddoc.language);
-    });
-  }
-
-  var server_config = [
-    {
-      section: "couch_httpd_auth",
-      key: "iterations",
-      value: "1"
-    },
-    {
-      section: "replicator",
-      key: "db",
-      value: repDb.name
-    },
-    {
-      section: "couch_httpd_auth",
-      key: "authentication_db",
-      value: usersDb.name
-    }
-  ];
-
-  repDb.deleteDb();
-  run_on_modified_server(server_config, test_replication_credentials_delegation);
-
-  // cleanup
-  repDb.deleteDb();
-  dbA.deleteDb();
-  dbB.deleteDb();
-  usersDb.deleteDb();
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/www/script/test/replicator_db_field_validation.js
----------------------------------------------------------------------
diff --git a/share/www/script/test/replicator_db_field_validation.js b/share/www/script/test/replicator_db_field_validation.js
deleted file mode 100644
index 167bdcc..0000000
--- a/share/www/script/test/replicator_db_field_validation.js
+++ /dev/null
@@ -1,178 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
-couchTests.replicator_db_field_validation = function(debug) {
-
-  if (debug) debugger;
-
-  var populate_db = replicator_db.populate_db;
-  var docs1 = replicator_db.docs1;
-  var dbA = replicator_db.dbA;
-  var dbB = replicator_db.dbB;
-  var repDb = replicator_db.repDb;
-  var usersDb = replicator_db.usersDb;
-  var wait = replicator_db.wait;
-  var waitForRep = replicator_db.waitForRep;
-  var waitForSeq = replicator_db.waitForSeq;
-  var wait_rep_doc = replicator_db.wait_rep_doc;
-
-  function rep_doc_field_validation() {
-    var docs = makeDocs(1, 5);
-
-    populate_db(dbA, docs);
-    populate_db(dbB, []);
-
-    var repDoc = {
-       _id: "rep1",
-       target: dbB.name
-    };
-
-    try {
-      repDb.save(repDoc);
-      T(false, "should have failed because source field is missing");
-    } catch (x) {
-      TEquals("forbidden", x.error);
-    }
-
-    repDoc = {
-       _id: "rep1",
-       source: 123,
-       target: dbB.name
-    };
-
-    try {
-      repDb.save(repDoc);
-      T(false, "should have failed because source field is a number");
-    } catch (x) {
-      TEquals("forbidden", x.error);
-    }
-
-    repDoc = {
-       _id: "rep1",
-       source: dbA.name
-    };
-
-    try {
-      repDb.save(repDoc);
-      T(false, "should have failed because target field is missing");
-    } catch (x) {
-      TEquals("forbidden", x.error);
-    }
-
-    repDoc = {
-       _id: "rep1",
-       source: dbA.name,
-       target: null
-    };
-
-    try {
-      repDb.save(repDoc);
-      T(false, "should have failed because target field is null");
-    } catch (x) {
-      TEquals("forbidden", x.error);
-    }
-
-    repDoc = {
-       _id: "rep1",
-       source: dbA.name,
-       target: { url: 123 }
-    };
-
-    try {
-      repDb.save(repDoc);
-      T(false, "should have failed because target.url field is not a string");
-    } catch (x) {
-      TEquals("forbidden", x.error);
-    }
-
-    repDoc = {
-       _id: "rep1",
-       source: dbA.name,
-       target: { url: dbB.name, auth: null }
-    };
-
-    try {
-      repDb.save(repDoc);
-      T(false, "should have failed because target.auth field is null");
-    } catch (x) {
-      TEquals("forbidden", x.error);
-    }
-
-    repDoc = {
-       _id: "rep1",
-       source: dbA.name,
-       target: { url: dbB.name, auth: "foo:bar" }
-    };
-
-    try {
-      repDb.save(repDoc);
-      T(false, "should have failed because target.auth field is not an object");
-    } catch (x) {
-      TEquals("forbidden", x.error);
-    }
-
-    repDoc = {
-       _id: "rep1",
-       source: dbA.name,
-       target: dbB.name,
-       continuous: "true"
-    };
-
-    try {
-      repDb.save(repDoc);
-      T(false, "should have failed because continuous is not a boolean");
-    } catch (x) {
-      TEquals("forbidden", x.error);
-    }
-
-    repDoc = {
-       _id: "rep1",
-       source: dbA.name,
-       target: dbB.name,
-       filter: 123
-    };
-
-    try {
-      repDb.save(repDoc);
-      T(false, "should have failed because filter is not a string");
-    } catch (x) {
-      TEquals("forbidden", x.error);
-    }
-  }
-
-  var server_config = [
-    {
-      section: "couch_httpd_auth",
-      key: "iterations",
-      value: "1"
-    },
-    {
-      section: "replicator",
-      key: "db",
-      value: repDb.name
-    },
-    {
-      section: "couch_httpd_auth",
-      key: "authentication_db",
-      value: usersDb.name
-    }
-  ];
-
-  repDb.deleteDb();
-  run_on_modified_server(server_config, rep_doc_field_validation);
-
-  // cleanup
-  repDb.deleteDb();
-  dbA.deleteDb();
-  dbB.deleteDb();
-  usersDb.deleteDb();
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/www/script/test/replicator_db_filtered.js
----------------------------------------------------------------------
diff --git a/share/www/script/test/replicator_db_filtered.js b/share/www/script/test/replicator_db_filtered.js
deleted file mode 100644
index 31c78a7..0000000
--- a/share/www/script/test/replicator_db_filtered.js
+++ /dev/null
@@ -1,105 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
-couchTests.replicator_db_filtered = function(debug) {
-
-  if (debug) debugger;
-
-  var populate_db = replicator_db.populate_db;
-  var docs1 = replicator_db.docs1;
-  var dbA = replicator_db.dbA;
-  var dbB = replicator_db.dbB;
-  var repDb = replicator_db.repDb;
-  var waitForRep = replicator_db.waitForRep;
-
-  function filtered_replication() {
-    var docs2 = docs1.concat([
-      {
-        _id: "_design/mydesign",
-        language : "javascript",
-        filters : {
-          myfilter : (function(doc, req) {
-            return (doc.value % 2) !== Number(req.query.myparam);
-          }).toString()
-        }
-      }
-    ]);
-
-    populate_db(dbA, docs2);
-    populate_db(dbB, []);
-
-    var repDoc = {
-      _id: "foo_filt_rep_doc",
-      source: "http://" + CouchDB.host + "/" + dbA.name,
-      target: dbB.name,
-      filter: "mydesign/myfilter",
-      query_params: {
-        myparam: 1
-      }
-    };
-    T(repDb.save(repDoc).ok);
-
-    waitForRep(repDb, repDoc, "completed");
-    for (var i = 0; i < docs2.length; i++) {
-      var doc = docs2[i];
-      var copy = dbB.open(doc._id);
-
-      if (typeof doc.value === "number") {
-        if ((doc.value % 2) !== 1) {
-          T(copy !== null);
-          T(copy.value === doc.value);
-        } else {
-          T(copy === null);
-        }
-      }
-    }
-
-    var repDoc1 = repDb.open(repDoc._id);
-    T(repDoc1 !== null);
-    T(repDoc1.source === repDoc.source);
-    T(repDoc1.target === repDoc.target);
-    T(repDoc1._replication_state === "completed", "filtered");
-    T(typeof repDoc1._replication_state_time === "string");
-    T(typeof repDoc1._replication_id  === "string");
-    T(typeof repDoc1._replication_stats === "object", "doc has stats");
-    var stats = repDoc1._replication_stats;
-    TEquals(2, stats.revisions_checked, "right # of revisions_checked");
-    TEquals(2, stats.missing_revisions_found, "right # of missing_revisions_found");
-    TEquals(2, stats.docs_read, "right # of docs_read");
-    TEquals(1, stats.docs_written, "right # of docs_written");
-    TEquals(1, stats.doc_write_failures, "right # of doc_write_failures");
-    TEquals(dbA.info().update_seq, stats.checkpointed_source_seq,
-      "right checkpointed_source_seq");
-  }
-
-
-  var server_config = [
-    {
-      section: "couch_httpd_auth",
-      key: "iterations",
-      value: "1"
-    },
-    {
-      section: "replicator",
-      key: "db",
-      value: repDb.name
-    }
-  ];
-
-  repDb.deleteDb();
-  run_on_modified_server(server_config, filtered_replication);
-
-  // cleanup
-  repDb.deleteDb();
-  dbA.deleteDb();
-  dbB.deleteDb();
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/www/script/test/replicator_db_identical.js
----------------------------------------------------------------------
diff --git a/share/www/script/test/replicator_db_identical.js b/share/www/script/test/replicator_db_identical.js
deleted file mode 100644
index cdf4592..0000000
--- a/share/www/script/test/replicator_db_identical.js
+++ /dev/null
@@ -1,87 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
-couchTests.replicator_db_identical = function(debug) {
-
-  if (debug) debugger;
-
-  var populate_db = replicator_db.populate_db;
-  var docs1 = replicator_db.docs1;
-  var dbA = replicator_db.dbA;
-  var dbB = replicator_db.dbB;
-  var repDb = replicator_db.repDb;
-  var wait = replicator_db.wait;
-  var waitForRep = replicator_db.waitForRep;
-  var waitForSeq = replicator_db.waitForSeq;
-
-  // test the case where multiple replication docs (different IDs)
-  // describe in fact the same replication (source, target, etc)
-  function identical_rep_docs() {
-    populate_db(dbA, docs1);
-    populate_db(dbB, []);
-
-    var repDoc1 = {
-      _id: "foo_dup_rep_doc_1",
-      source: "http://" + CouchDB.host + "/" + dbA.name,
-      target: dbB.name
-    };
-    var repDoc2 = {
-      _id: "foo_dup_rep_doc_2",
-      source: "http://" + CouchDB.host + "/" + dbA.name,
-      target: dbB.name
-    };
-
-    T(repDb.save(repDoc1).ok);
-    T(repDb.save(repDoc2).ok);
-
-    waitForRep(repDb, repDoc1, "completed");
-    for (var i = 0; i < docs1.length; i++) {
-      var doc = docs1[i];
-      var copy = dbB.open(doc._id);
-      T(copy !== null);
-      T(copy.value === doc.value);
-    }
-
-    repDoc1 = repDb.open("foo_dup_rep_doc_1");
-    T(repDoc1 !== null);
-    T(repDoc1._replication_state === "completed", "identical");
-    T(typeof repDoc1._replication_state_time === "string");
-    T(typeof repDoc1._replication_id  === "string");
-
-    repDoc2 = repDb.open("foo_dup_rep_doc_2");
-    T(repDoc2 !== null);
-    T(typeof repDoc2._replication_state === "undefined");
-    T(typeof repDoc2._replication_state_time === "undefined");
-    T(repDoc2._replication_id === repDoc1._replication_id);
-  }
-
-  var server_config = [
-    {
-      section: "couch_httpd_auth",
-      key: "iterations",
-      value: "1"
-    },
-    {
-      section: "replicator",
-      key: "db",
-      value: repDb.name
-    }
-  ];
-
-  repDb.deleteDb();
-  run_on_modified_server(server_config, identical_rep_docs);
-
-  // cleanup
-  repDb.deleteDb();
-  dbA.deleteDb();
-  dbB.deleteDb();
-}
\ No newline at end of file


[13/37] move JS tests into safety

Posted by ja...@apache.org.
http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/test/replication.js
----------------------------------------------------------------------
diff --git a/share/test/replication.js b/share/test/replication.js
new file mode 100644
index 0000000..21a4304
--- /dev/null
+++ b/share/test/replication.js
@@ -0,0 +1,1795 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+
+couchTests.replication = function(debug) {
+
+  if (debug) debugger;
+
+  var host = CouchDB.host;
+  var sourceDb = new CouchDB("test_suite_db_a",{"X-Couch-Full-Commit":"false"});
+  var targetDb = new CouchDB("test_suite_db_b",{"X-Couch-Full-Commit":"false"});
+
+  var dbPairs = [
+    {
+      source: sourceDb.name,
+      target: targetDb.name
+    },
+    {
+      source: CouchDB.protocol + host + "/" + sourceDb.name,
+      target: targetDb.name
+    },
+    {
+      source: sourceDb.name,
+      target: CouchDB.protocol + host + "/" + targetDb.name
+    },
+    {
+      source: CouchDB.protocol + host + "/" + sourceDb.name,
+      target: CouchDB.protocol + host + "/" + targetDb.name
+    }
+  ];
+
+  var att1_data = CouchDB.request("GET", "/_utils/script/test/lorem.txt");
+  att1_data = att1_data.responseText;
+
+  var att2_data = CouchDB.request("GET", "/_utils/script/test/lorem_b64.txt");
+  att2_data = att2_data.responseText;
+
+  var sourceInfo, targetInfo;
+  var docs, doc, copy;
+  var repResult;
+  var i, j, k;
+
+
+  function makeAttData(minSize) {
+    var data = att1_data;
+
+    while (data.length < minSize) {
+      data = data + att1_data;
+    }
+    return data;
+  }
+
+
+  function enableAttCompression(level, types) {
+    var xhr = CouchDB.request(
+      "PUT",
+      "/_config/attachments/compression_level",
+      {
+        body: JSON.stringify(level),
+        headers: {"X-Couch-Persist": "false"}
+      }
+    );
+    T(xhr.status === 200);
+    xhr = CouchDB.request(
+      "PUT",
+      "/_config/attachments/compressible_types",
+      {
+        body: JSON.stringify(types),
+        headers: {"X-Couch-Persist": "false"}
+      }
+    );
+    T(xhr.status === 200);
+  }
+
+
+  function disableAttCompression() {
+    var xhr = CouchDB.request(
+      "PUT",
+      "/_config/attachments/compression_level",
+      {
+        body: JSON.stringify("0"),
+        headers: {"X-Couch-Persist": "false"}
+      }
+    );
+    T(xhr.status === 200);
+  }
+
+
+  function populateDb(db, docs, dontRecreateDb) {
+    if (dontRecreateDb !== true) {
+      db.deleteDb();
+      db.createDb();
+    }
+    for (var i = 0; i < docs.length; i++) {
+      var doc = docs[i];
+      delete doc._rev;
+    }
+    if (docs.length > 0) {
+      db.bulkSave(docs);
+    }
+  }
+
+
+  function addAtt(db, doc, attName, attData, type) {
+    var uri = "/" + db.name + "/" + encodeURIComponent(doc._id) + "/" + attName;
+
+    if (doc._rev) {
+      uri += "?rev=" + doc._rev;
+    }
+
+    var xhr = CouchDB.request("PUT", uri, {
+      headers: {
+        "Content-Type": type
+      },
+      body: attData
+    });
+
+    T(xhr.status === 201);
+    doc._rev = JSON.parse(xhr.responseText).rev;
+  }
+
+
+  function compareObjects(o1, o2) {
+    for (var p in o1) {
+      if (o1[p] === null && o2[p] !== null) {
+        return false;
+      } else if (typeof o1[p] === "object") {
+        if ((typeof o2[p] !== "object") || o2[p] === null) {
+          return false;
+        }
+        if (!arguments.callee(o1[p], o2[p])) {
+          return false;
+        }
+      } else {
+        if (o1[p] !== o2[p]) {
+          return false;
+        }
+      }
+    }
+    return true;
+  }
+
+
+  function getTask(rep_id, delay) {
+    var t0 = new Date();
+    var t1;
+    do {
+      var xhr = CouchDB.request("GET", "/_active_tasks");
+      var tasks = JSON.parse(xhr.responseText);
+      for(var i = 0; i < tasks.length; i++) {
+        if(tasks[i].replication_id == repResult._local_id) {
+          return tasks[i];
+        }
+      }
+      t1 = new Date();
+    } while((t1 - t0) <= delay);
+
+    return null;
+  }
+
+
+  function waitForSeq(sourceDb, targetDb, rep_id) {
+    var sourceSeq = sourceDb.info().update_seq,
+        t0 = new Date(),
+        t1,
+        ms = 3000;
+
+    do {
+      var task = getTask(rep_id, 0);
+      if(task && task["through_seq"] == sourceSeq) {
+        return;
+      }
+      t1 = new Date();
+    } while (((t1 - t0) <= ms));
+  }
+
+
+  // test simple replications (not continuous, not filtered), including
+  // conflict creation
+  docs = makeDocs(1, 21);
+  docs.push({
+    _id: "_design/foo",
+    language: "javascript",
+    value: "ddoc"
+  });
+
+  for (i = 0; i < dbPairs.length; i++) {
+    populateDb(sourceDb, docs);
+    populateDb(targetDb, []);
+
+    // add some attachments
+    for (j = 10; j < 15; j++) {
+      addAtt(sourceDb, docs[j], "readme.txt", att1_data, "text/plain");
+    }
+
+    repResult = CouchDB.replicate(dbPairs[i].source, dbPairs[i].target);
+    TEquals(true, repResult.ok);
+
+    sourceInfo = sourceDb.info();
+    targetInfo = targetDb.info();
+
+    TEquals(sourceInfo.doc_count, targetInfo.doc_count);
+
+    TEquals('string', typeof repResult.session_id);
+    TEquals(repResult.source_last_seq, sourceInfo.update_seq);
+    TEquals(true, repResult.history instanceof Array);
+    TEquals(1, repResult.history.length);
+    TEquals(repResult.history[0].session_id, repResult.session_id);
+    TEquals('string', typeof repResult.history[0].start_time);
+    TEquals('string', typeof repResult.history[0].end_time);
+    TEquals(0, repResult.history[0].start_last_seq);
+    TEquals(sourceInfo.update_seq, repResult.history[0].end_last_seq);
+    TEquals(sourceInfo.update_seq, repResult.history[0].recorded_seq);
+    TEquals(sourceInfo.doc_count, repResult.history[0].missing_checked);
+    TEquals(sourceInfo.doc_count, repResult.history[0].missing_found);
+    TEquals(sourceInfo.doc_count, repResult.history[0].docs_read);
+    TEquals(sourceInfo.doc_count, repResult.history[0].docs_written);
+    TEquals(0, repResult.history[0].doc_write_failures);
+
+    for (j = 0; j < docs.length; j++) {
+      doc = docs[j];
+      copy = targetDb.open(doc._id);
+
+      T(copy !== null);
+      TEquals(true, compareObjects(doc, copy));
+
+      if (j >= 10 && j < 15) {
+        var atts = copy._attachments;
+        TEquals('object', typeof atts);
+        TEquals('object', typeof atts["readme.txt"]);
+        TEquals(2, atts["readme.txt"].revpos);
+        TEquals(0, atts["readme.txt"].content_type.indexOf("text/plain"));
+        TEquals(true, atts["readme.txt"].stub);
+
+        var att_copy = CouchDB.request(
+          "GET", "/" + targetDb.name + "/" + copy._id + "/readme.txt"
+        ).responseText;
+        TEquals(att1_data.length, att_copy.length);
+        TEquals(att1_data, att_copy);
+      }
+    }
+
+
+    // add one more doc to source, more attachments to some existing docs
+    // and replicate again
+    var newDoc = {
+      _id: "foo666",
+      value: "d"
+    };
+    TEquals(true, sourceDb.save(newDoc).ok);
+
+    // add some more attachments
+    for (j = 10; j < 15; j++) {
+      addAtt(sourceDb, docs[j], "data.dat", att2_data, "application/binary");
+    }
+
+    repResult = CouchDB.replicate(dbPairs[i].source, dbPairs[i].target);
+    TEquals(true, repResult.ok);
+
+    sourceInfo = sourceDb.info();
+    targetInfo = targetDb.info();
+
+    TEquals(targetInfo.doc_count, sourceInfo.doc_count);
+
+    TEquals('string', typeof repResult.session_id);
+    TEquals(sourceInfo.update_seq, repResult.source_last_seq);
+    TEquals(true, repResult.history instanceof Array);
+    TEquals(2, repResult.history.length);
+    TEquals(repResult.history[0].session_id, repResult.session_id);
+    TEquals('string', typeof repResult.history[0].start_time);
+    TEquals('string', typeof repResult.history[0].end_time);
+    TEquals((sourceInfo.update_seq - 6), repResult.history[0].start_last_seq);
+    TEquals(sourceInfo.update_seq, repResult.history[0].end_last_seq);
+    TEquals(sourceInfo.update_seq, repResult.history[0].recorded_seq);
+    TEquals(6, repResult.history[0].missing_checked);
+    TEquals(6, repResult.history[0].missing_found);
+    TEquals(6, repResult.history[0].docs_read);
+    TEquals(6, repResult.history[0].docs_written);
+    TEquals(0, repResult.history[0].doc_write_failures);
+
+    copy = targetDb.open(newDoc._id);
+    T(copy !== null);
+    TEquals(newDoc._id, copy._id);
+    TEquals(newDoc.value, copy.value);
+
+    for (j = 10; j < 15; j++) {
+      doc = docs[j];
+      copy = targetDb.open(doc._id);
+
+      T(copy !== null);
+      TEquals(true, compareObjects(doc, copy));
+
+      var atts = copy._attachments;
+      TEquals('object', typeof atts);
+      TEquals('object', typeof atts["readme.txt"]);
+      TEquals(2, atts["readme.txt"].revpos);
+      TEquals(0, atts["readme.txt"].content_type.indexOf("text/plain"));
+      TEquals(true, atts["readme.txt"].stub);
+
+      var att1_copy = CouchDB.request(
+        "GET", "/" + targetDb.name + "/" + copy._id + "/readme.txt"
+      ).responseText;
+      TEquals(att1_data.length, att1_copy.length);
+      TEquals(att1_data, att1_copy);
+
+      TEquals('object', typeof atts["data.dat"]);
+      TEquals(3, atts["data.dat"].revpos);
+      TEquals(0, atts["data.dat"].content_type.indexOf("application/binary"));
+      TEquals(true, atts["data.dat"].stub);
+
+      var att2_copy = CouchDB.request(
+        "GET", "/" + targetDb.name + "/" + copy._id + "/data.dat"
+      ).responseText;
+      TEquals(att2_data.length, att2_copy.length);
+      TEquals(att2_data, att2_copy);
+    }
+
+    // test deletion is replicated
+    doc = sourceDb.open(docs[1]._id);
+    TEquals(true, sourceDb.deleteDoc(doc).ok);
+
+    repResult = CouchDB.replicate(dbPairs[i].source, dbPairs[i].target);
+    TEquals(true, repResult.ok);
+
+    sourceInfo = sourceDb.info();
+    targetInfo = targetDb.info();
+
+    TEquals(targetInfo.doc_count, sourceInfo.doc_count);
+    TEquals(targetInfo.doc_del_count, sourceInfo.doc_del_count);
+    TEquals(1, targetInfo.doc_del_count);
+
+    TEquals(true, repResult.history instanceof Array);
+    TEquals(3, repResult.history.length);
+    TEquals((sourceInfo.update_seq - 1), repResult.history[0].start_last_seq);
+    TEquals(sourceInfo.update_seq, repResult.history[0].end_last_seq);
+    TEquals(sourceInfo.update_seq, repResult.history[0].recorded_seq);
+    TEquals(1, repResult.history[0].missing_checked);
+    TEquals(1, repResult.history[0].missing_found);
+    TEquals(1, repResult.history[0].docs_read);
+    TEquals(1, repResult.history[0].docs_written);
+    TEquals(0, repResult.history[0].doc_write_failures);
+
+    copy = targetDb.open(docs[1]._id);
+    TEquals(null, copy);
+
+    var changes = targetDb.changes({since: 0});
+    var idx = changes.results.length - 1;
+    TEquals(docs[1]._id, changes.results[idx].id);
+    TEquals(true, changes.results[idx].deleted);
+
+    // test conflict
+    doc = sourceDb.open(docs[0]._id);
+    doc.value = "white";
+    TEquals(true, sourceDb.save(doc).ok);
+
+    copy = targetDb.open(docs[0]._id);
+    copy.value = "black";
+    TEquals(true, targetDb.save(copy).ok);
+
+    repResult = CouchDB.replicate(dbPairs[i].source, dbPairs[i].target);
+    TEquals(true, repResult.ok);
+
+    sourceInfo = sourceDb.info();
+    targetInfo = targetDb.info();
+
+    TEquals(sourceInfo.doc_count, targetInfo.doc_count);
+
+    TEquals(true, repResult.history instanceof Array);
+    TEquals(4, repResult.history.length);
+    TEquals((sourceInfo.update_seq - 1), repResult.history[0].start_last_seq);
+    TEquals(sourceInfo.update_seq, repResult.history[0].end_last_seq);
+    TEquals(sourceInfo.update_seq, repResult.history[0].recorded_seq);
+    TEquals(1, repResult.history[0].missing_checked);
+    TEquals(1, repResult.history[0].missing_found);
+    TEquals(1, repResult.history[0].docs_read);
+    TEquals(1, repResult.history[0].docs_written);
+    TEquals(0, repResult.history[0].doc_write_failures);
+
+    copy = targetDb.open(docs[0]._id, {conflicts: true});
+
+    TEquals(0, copy._rev.indexOf("2-"));
+    TEquals(true, copy._conflicts instanceof Array);
+    TEquals(1, copy._conflicts.length);
+    TEquals(0, copy._conflicts[0].indexOf("2-"));
+
+    // replicate again with conflict
+    doc.value = "yellow";
+    TEquals(true, sourceDb.save(doc).ok);
+
+    repResult = CouchDB.replicate(dbPairs[i].source, dbPairs[i].target);
+    TEquals(true, repResult.ok);
+
+    sourceInfo = sourceDb.info();
+    targetInfo = targetDb.info();
+
+    TEquals(sourceInfo.doc_count, targetInfo.doc_count);
+
+    TEquals(true, repResult.history instanceof Array);
+    TEquals(5, repResult.history.length);
+    TEquals((sourceInfo.update_seq - 1), repResult.history[0].start_last_seq);
+    TEquals(sourceInfo.update_seq, repResult.history[0].end_last_seq);
+    TEquals(sourceInfo.update_seq, repResult.history[0].recorded_seq);
+    TEquals(1, repResult.history[0].missing_checked);
+    TEquals(1, repResult.history[0].missing_found);
+    TEquals(1, repResult.history[0].docs_read);
+    TEquals(1, repResult.history[0].docs_written);
+    TEquals(0, repResult.history[0].doc_write_failures);
+
+    copy = targetDb.open(docs[0]._id, {conflicts: true});
+
+    TEquals(0, copy._rev.indexOf("3-"));
+    TEquals(true, copy._conflicts instanceof Array);
+    TEquals(1, copy._conflicts.length);
+    TEquals(0, copy._conflicts[0].indexOf("2-"));
+
+    // resolve the conflict
+    TEquals(true, targetDb.deleteDoc({_id: copy._id, _rev: copy._conflicts[0]}).ok);
+
+    // replicate again, check there are no more conflicts
+    doc.value = "rainbow";
+    TEquals(true, sourceDb.save(doc).ok);
+
+    repResult = CouchDB.replicate(dbPairs[i].source, dbPairs[i].target);
+    TEquals(true, repResult.ok);
+
+    sourceInfo = sourceDb.info();
+    targetInfo = targetDb.info();
+
+    TEquals(sourceInfo.doc_count, targetInfo.doc_count);
+
+    TEquals(true, repResult.history instanceof Array);
+    TEquals(6, repResult.history.length);
+    TEquals((sourceInfo.update_seq - 1), repResult.history[0].start_last_seq);
+    TEquals(sourceInfo.update_seq, repResult.history[0].end_last_seq);
+    TEquals(sourceInfo.update_seq, repResult.history[0].recorded_seq);
+    TEquals(1, repResult.history[0].missing_checked);
+    TEquals(1, repResult.history[0].missing_found);
+    TEquals(1, repResult.history[0].docs_read);
+    TEquals(1, repResult.history[0].docs_written);
+    TEquals(0, repResult.history[0].doc_write_failures);
+
+    copy = targetDb.open(docs[0]._id, {conflicts: true});
+
+    TEquals(0, copy._rev.indexOf("4-"));
+    TEquals('undefined', typeof copy._conflicts);
+
+    // test that revisions already in a target are not copied
+    TEquals(true, sourceDb.save({_id: "foo1", value: 111}).ok);
+    TEquals(true, targetDb.save({_id: "foo1", value: 111}).ok);
+    TEquals(true, sourceDb.save({_id: "foo2", value: 222}).ok);
+    TEquals(true, sourceDb.save({_id: "foo3", value: 333}).ok);
+    TEquals(true, targetDb.save({_id: "foo3", value: 333}).ok);
+
+    repResult = CouchDB.replicate(dbPairs[i].source, dbPairs[i].target);
+    TEquals(true, repResult.ok);
+
+    sourceInfo = sourceDb.info();
+    TEquals(sourceInfo.update_seq, repResult.source_last_seq);
+    TEquals(sourceInfo.update_seq - 3, repResult.history[0].start_last_seq);
+    TEquals(sourceInfo.update_seq, repResult.history[0].end_last_seq);
+    TEquals(sourceInfo.update_seq, repResult.history[0].recorded_seq);
+    TEquals(3, repResult.history[0].missing_checked);
+    TEquals(1, repResult.history[0].missing_found);
+    TEquals(1, repResult.history[0].docs_read);
+    TEquals(1, repResult.history[0].docs_written);
+    TEquals(0, repResult.history[0].doc_write_failures);
+
+    TEquals(true, sourceDb.save({_id: "foo4", value: 444}).ok);
+    TEquals(true, targetDb.save({_id: "foo4", value: 444}).ok);
+    TEquals(true, sourceDb.save({_id: "foo5", value: 555}).ok);
+    TEquals(true, targetDb.save({_id: "foo5", value: 555}).ok);
+
+    repResult = CouchDB.replicate(dbPairs[i].source, dbPairs[i].target);
+    TEquals(true, repResult.ok);
+
+    sourceInfo = sourceDb.info();
+    TEquals(sourceInfo.update_seq, repResult.source_last_seq);
+    TEquals(sourceInfo.update_seq - 2, repResult.history[0].start_last_seq);
+    TEquals(sourceInfo.update_seq, repResult.history[0].end_last_seq);
+    TEquals(sourceInfo.update_seq, repResult.history[0].recorded_seq);
+    TEquals(2, repResult.history[0].missing_checked);
+    TEquals(0, repResult.history[0].missing_found);
+    TEquals(0, repResult.history[0].docs_read);
+    TEquals(0, repResult.history[0].docs_written);
+    TEquals(0, repResult.history[0].doc_write_failures);
+
+    repResult = CouchDB.replicate(dbPairs[i].source, dbPairs[i].target);
+    TEquals(true, repResult.ok);
+    TEquals(true, repResult.no_changes);
+    sourceInfo = sourceDb.info();
+    TEquals(sourceInfo.update_seq, repResult.source_last_seq);
+  }
+
+
+  // test error when source database does not exist
+  try {
+    CouchDB.replicate("foobar", "test_suite_db");
+    T(false, "should have failed with db_not_found error");
+  } catch (x) {
+    TEquals("db_not_found", x.error);
+  }
+
+  // validate COUCHDB-317
+  try {
+    CouchDB.replicate("/foobar", "test_suite_db");
+    T(false, "should have failed with db_not_found error");
+  } catch (x) {
+    TEquals("db_not_found", x.error);
+  }
+
+  try {
+    CouchDB.replicate(CouchDB.protocol + host + "/foobar", "test_suite_db");
+    T(false, "should have failed with db_not_found error");
+  } catch (x) {
+    TEquals("db_not_found", x.error);
+  }
+
+
+  // test since_seq parameter
+  docs = makeDocs(1, 6);
+
+  for (i = 0; i < dbPairs.length; i++) {
+    var since_seq = 3;
+    populateDb(sourceDb, docs);
+    populateDb(targetDb, []);
+
+    var expected_ids = [];
+    var changes = sourceDb.changes({since: since_seq});
+    for (j = 0; j < changes.results.length; j++) {
+      expected_ids.push(changes.results[j].id);
+    }
+    TEquals(2, expected_ids.length, "2 documents since since_seq");
+
+    // For OTP < R14B03, temporary child specs are kept in the supervisor
+    // after the child terminates, so cancel the replication to delete the
+    // child spec in those OTP releases, otherwise since_seq will have no
+    // effect.
+    try {
+      CouchDB.replicate(
+        dbPairs[i].source,
+        dbPairs[i].target,
+        {body: {cancel: true}}
+      );
+    } catch (x) {
+      // OTP R14B03 onwards
+      TEquals("not found", x.error);
+    }
+    repResult = CouchDB.replicate(
+      dbPairs[i].source,
+      dbPairs[i].target,
+      {body: {since_seq: since_seq}}
+    );
+    // Same reason as before. But here we don't want since_seq to affect
+    // subsequent replications, so we need to delete the child spec from the
+    // supervisor (since_seq is not used to calculate the replication ID).
+    try {
+      CouchDB.replicate(
+        dbPairs[i].source,
+        dbPairs[i].target,
+        {body: {cancel: true}}
+      );
+    } catch (x) {
+      // OTP R14B03 onwards
+      TEquals("not found", x.error);
+    }
+    TEquals(true, repResult.ok);
+    TEquals(2, repResult.history[0].missing_checked);
+    TEquals(2, repResult.history[0].missing_found);
+    TEquals(2, repResult.history[0].docs_read);
+    TEquals(2, repResult.history[0].docs_written);
+    TEquals(0, repResult.history[0].doc_write_failures);
+
+    for (j = 0; j < docs.length; j++) {
+      doc = docs[j];
+      copy = targetDb.open(doc._id);
+
+      if (expected_ids.indexOf(doc._id) === -1) {
+        T(copy === null);
+      } else {
+        T(copy !== null);
+        TEquals(true, compareObjects(doc, copy));
+      }
+    }
+  }
+
+
+  // test errors due to doc validate_doc_update functions in the target endpoint
+  docs = makeDocs(1, 8);
+  docs[2]["_attachments"] = {
+    "hello.txt": {
+      "content_type": "text/plain",
+      "data": "aGVsbG8gd29ybGQ="  // base64:encode("hello world")
+    }
+  };
+  var ddoc = {
+    _id: "_design/test",
+    language: "javascript",
+    validate_doc_update: (function(newDoc, oldDoc, userCtx, secObj) {
+      if ((newDoc.integer % 2) !== 0) {
+        throw {forbidden: "I only like multiples of 2."};
+      }
+    }).toString()
+  };
+
+  for (i = 0; i < dbPairs.length; i++) {
+    populateDb(sourceDb, docs);
+    populateDb(targetDb, [ddoc]);
+
+    repResult = CouchDB.replicate(
+      dbPairs[i].source,
+      dbPairs[i].target
+    );
+    TEquals(true, repResult.ok);
+    TEquals(7, repResult.history[0].missing_checked);
+    TEquals(7, repResult.history[0].missing_found);
+    TEquals(7, repResult.history[0].docs_read);
+    TEquals(3, repResult.history[0].docs_written);
+    TEquals(4, repResult.history[0].doc_write_failures);
+
+    for (j = 0; j < docs.length; j++) {
+      doc = docs[j];
+      copy = targetDb.open(doc._id);
+
+      if (doc.integer % 2 === 0) {
+        T(copy !== null);
+        TEquals(copy.integer, doc.integer);
+      } else {
+        T(copy === null);
+      }
+    }
+  }
+
+
+  // test create_target option
+  docs = makeDocs(1, 2);
+
+  for (i = 0; i < dbPairs.length; i++) {
+    populateDb(sourceDb, docs);
+    targetDb.deleteDb();
+
+    repResult = CouchDB.replicate(
+      dbPairs[i].source,
+      dbPairs[i].target,
+      {body: {create_target: true}}
+    );
+    TEquals(true, repResult.ok);
+
+    sourceInfo = sourceDb.info();
+    targetInfo = targetDb.info();
+
+    TEquals(sourceInfo.doc_count, targetInfo.doc_count);
+    TEquals(sourceInfo.update_seq, targetInfo.update_seq);
+  }
+
+
+  // test filtered replication
+  docs = makeDocs(1, 31);
+  docs.push({
+    _id: "_design/mydesign",
+    language: "javascript",
+    filters: {
+      myfilter: (function(doc, req) {
+        var modulus = Number(req.query.modulus);
+        var special = req.query.special;
+        return (doc.integer % modulus === 0) || (doc.string === special);
+      }).toString()
+    }
+  });
+
+  for (i = 0; i < dbPairs.length; i++) {
+    populateDb(sourceDb, docs);
+    populateDb(targetDb, []);
+
+    repResult = CouchDB.replicate(
+      dbPairs[i].source,
+      dbPairs[i].target,
+      {
+        body: {
+          filter: "mydesign/myfilter",
+          query_params: {
+            modulus: "2",
+            special: "7"
+          }
+        }
+      }
+    );
+
+    TEquals(true, repResult.ok);
+
+    for (j = 0; j < docs.length; j++) {
+      doc = docs[j];
+      copy = targetDb.open(doc._id);
+
+      if ((doc.integer && (doc.integer % 2 === 0)) || (doc.string === "7")) {
+
+        T(copy !== null);
+        TEquals(true, compareObjects(doc, copy));
+      } else {
+        TEquals(null, copy);
+      }
+    }
+
+    TEquals(true, repResult.history instanceof Array);
+    TEquals(1, repResult.history.length);
+    // We (incorrectly) don't record update sequences for things
+    // that don't pass the changse feed filter. Historically the
+    // last document to pass was the second to last doc which has
+    // an update sequence of 30. Work that has been applied to avoid
+    // conflicts from duplicate IDs breaking _bulk_docs updates added
+    // a sort to the logic which changes this. Now the last document
+    // to pass has an doc id of "8" and is at update_seq 29 (because only
+    // "9" and the design doc are after it).
+    //
+    // In the future the fix ought to be that we record that update
+    // sequence of the database. BigCouch has some existing work on
+    // this in the clustered case because if you have very few documents
+    // that pass the filter then (given single node's behavior) you end
+    // up having to rescan a large portion of the database.
+    TEquals(29, repResult.source_last_seq);
+    TEquals(0, repResult.history[0].start_last_seq);
+    TEquals(29, repResult.history[0].end_last_seq);
+    TEquals(29, repResult.history[0].recorded_seq);
+    // 16 => 15 docs with even integer field  + 1 doc with string field "7"
+    TEquals(16, repResult.history[0].missing_checked);
+    TEquals(16, repResult.history[0].missing_found);
+    TEquals(16, repResult.history[0].docs_read);
+    TEquals(16, repResult.history[0].docs_written);
+    TEquals(0, repResult.history[0].doc_write_failures);
+
+
+    // add new docs to source and resume the same replication
+    var newDocs = makeDocs(50, 56);
+    populateDb(sourceDb, newDocs, true);
+
+    repResult = CouchDB.replicate(
+      dbPairs[i].source,
+      dbPairs[i].target,
+      {
+        body: {
+          filter: "mydesign/myfilter",
+          query_params: {
+            modulus: "2",
+            special: "7"
+          }
+        }
+      }
+    );
+
+    TEquals(true, repResult.ok);
+
+    for (j = 0; j < newDocs.length; j++) {
+      doc = newDocs[j];
+      copy = targetDb.open(doc._id);
+
+      if (doc.integer && (doc.integer % 2 === 0)) {
+
+        T(copy !== null);
+        TEquals(true, compareObjects(doc, copy));
+      } else {
+        TEquals(null, copy);
+      }
+    }
+
+    // last doc has even integer field, so last replicated seq is 36
+    TEquals(36, repResult.source_last_seq);
+    TEquals(true, repResult.history instanceof Array);
+    TEquals(2, repResult.history.length);
+    TEquals(29, repResult.history[0].start_last_seq);
+    TEquals(36, repResult.history[0].end_last_seq);
+    TEquals(36, repResult.history[0].recorded_seq);
+    TEquals(3, repResult.history[0].missing_checked);
+    TEquals(3, repResult.history[0].missing_found);
+    TEquals(3, repResult.history[0].docs_read);
+    TEquals(3, repResult.history[0].docs_written);
+    TEquals(0, repResult.history[0].doc_write_failures);
+  }
+
+
+  // test filtered replication works as expected after changing the filter's
+  // code (ticket COUCHDB-892)
+  var filterFun1 = (function(doc, req) {
+    if (doc.value < Number(req.query.maxvalue)) {
+      return true;
+    } else {
+      return false;
+    }
+  }).toString();
+
+  var filterFun2 = (function(doc, req) {
+    return true;
+  }).toString();
+
+  for (i = 0; i < dbPairs.length; i++) {
+    populateDb(targetDb, []);
+    populateDb(sourceDb, []);
+
+    TEquals(true, sourceDb.save({_id: "foo1", value: 1}).ok);
+    TEquals(true, sourceDb.save({_id: "foo2", value: 2}).ok);
+    TEquals(true, sourceDb.save({_id: "foo3", value: 3}).ok);
+    TEquals(true, sourceDb.save({_id: "foo4", value: 4}).ok);
+
+    var ddoc = {
+      "_id": "_design/mydesign",
+      "language": "javascript",
+      "filters": {
+        "myfilter": filterFun1
+      }
+    };
+
+    TEquals(true, sourceDb.save(ddoc).ok);
+
+    repResult = CouchDB.replicate(
+      dbPairs[i].source,
+      dbPairs[i].target,
+      {
+        body: {
+          filter: "mydesign/myfilter",
+          query_params: {
+            maxvalue: "3"
+          }
+        }
+      }
+    );
+
+    TEquals(true, repResult.ok);
+    TEquals(true, repResult.history instanceof Array);
+    TEquals(1, repResult.history.length);
+    TEquals(2, repResult.history[0].docs_written);
+    TEquals(2, repResult.history[0].docs_read);
+    TEquals(0, repResult.history[0].doc_write_failures);
+
+    var docFoo1 = targetDb.open("foo1");
+    T(docFoo1 !== null);
+    TEquals(1, docFoo1.value);
+
+    var docFoo2 = targetDb.open("foo2");
+    T(docFoo2 !== null);
+    TEquals(2, docFoo2.value);
+
+    var docFoo3 = targetDb.open("foo3");
+    TEquals(null, docFoo3);
+
+    var docFoo4 = targetDb.open("foo4");
+    TEquals(null, docFoo4);
+
+    // replication should start from scratch after the filter's code changed
+
+    ddoc.filters.myfilter = filterFun2;
+    TEquals(true, sourceDb.save(ddoc).ok);
+
+    repResult = CouchDB.replicate(
+      dbPairs[i].source,
+      dbPairs[i].target,
+      {
+        body: {
+          filter: "mydesign/myfilter",
+          query_params : {
+            maxvalue: "3"
+          }
+        }
+      }
+    );
+
+    TEquals(true, repResult.ok);
+    TEquals(true, repResult.history instanceof Array);
+    TEquals(1, repResult.history.length);
+    TEquals(3, repResult.history[0].docs_written);
+    TEquals(3, repResult.history[0].docs_read);
+    TEquals(0, repResult.history[0].doc_write_failures);
+
+    docFoo1 = targetDb.open("foo1");
+    T(docFoo1 !== null);
+    TEquals(1, docFoo1.value);
+
+    docFoo2 = targetDb.open("foo2");
+    T(docFoo2 !== null);
+    TEquals(2, docFoo2.value);
+
+    docFoo3 = targetDb.open("foo3");
+    T(docFoo3 !== null);
+    TEquals(3, docFoo3.value);
+
+    docFoo4 = targetDb.open("foo4");
+    T(docFoo4 !== null);
+    TEquals(4, docFoo4.value);
+
+    T(targetDb.open("_design/mydesign") !== null);
+  }
+
+
+  // test replication by doc IDs
+  docs = makeDocs(1, 11);
+  docs.push({
+    _id: "_design/foo",
+    language: "javascript",
+    integer: 1
+  });
+
+  var target_doc_ids = [
+    { initial: ["1", "2", "10"], after: [], conflict_id: "2" },
+    { initial: ["1", "2"], after: ["7"], conflict_id: "1" },
+    { initial: ["1", "foo_666", "10"], after: ["7"], conflict_id: "10" },
+    { initial: ["_design/foo", "8"], after: ["foo_5"], conflict_id: "8" },
+    { initial: ["_design%2Ffoo", "8"], after: ["foo_5"], conflict_id: "8" },
+    { initial: [], after: ["foo_1000", "_design/foo", "1"], conflict_id: "1" }
+  ];
+  var doc_ids, after_doc_ids;
+  var id, num_inexistent_docs, after_num_inexistent_docs;
+  var total, after_total;
+
+  for (i = 0; i < dbPairs.length; i++) {
+
+    for (j = 0; j < target_doc_ids.length; j++) {
+      doc_ids = target_doc_ids[j].initial;
+      num_inexistent_docs = 0;
+
+      for (k = 0; k < doc_ids.length; k++) {
+        id = doc_ids[k];
+        if (id.indexOf("foo_") === 0) {
+          num_inexistent_docs += 1;
+        }
+      }
+
+      populateDb(sourceDb, docs);
+      populateDb(targetDb, []);
+
+      repResult = CouchDB.replicate(
+        dbPairs[i].source,
+        dbPairs[i].target,
+        {
+          body: {
+            doc_ids: doc_ids
+          }
+        }
+      );
+
+      total = doc_ids.length - num_inexistent_docs;
+      TEquals(true, repResult.ok);
+      if (total === 0) {
+        TEquals(true, repResult.no_changes);
+      } else {
+        TEquals('string', typeof repResult.start_time);
+        TEquals('string', typeof repResult.end_time);
+        TEquals(total, repResult.docs_read);
+        TEquals(total, repResult.docs_written);
+        TEquals(0, repResult.doc_write_failures);
+      }
+
+      for (k = 0; k < doc_ids.length; k++) {
+        id = decodeURIComponent(doc_ids[k]);
+        doc = sourceDb.open(id);
+        copy = targetDb.open(id);
+
+        if (id.indexOf("foo_") === 0) {
+          TEquals(null, doc);
+          TEquals(null, copy);
+        } else {
+          T(doc !== null);
+          T(copy !== null);
+          TEquals(true, compareObjects(doc, copy));
+        }
+      }
+
+      // be absolutely sure that other docs were not replicated
+      for (k = 0; k < docs.length; k++) {
+        var base_id = docs[k]._id;
+        id = encodeURIComponent(base_id);
+        doc = targetDb.open(base_id);
+
+        if ((doc_ids.indexOf(id) >= 0) || (doc_ids.indexOf(base_id) >= 0)) {
+            T(doc !== null);
+        } else {
+            TEquals(null, doc);
+        }
+      }
+
+      targetInfo = targetDb.info();
+      TEquals(total, targetInfo.doc_count);
+
+
+      // add more docs throught replication by doc IDs
+      after_doc_ids = target_doc_ids[j].after;
+      after_num_inexistent_docs = 0;
+
+      for (k = 0; k < after_doc_ids.length; k++) {
+        id = after_doc_ids[k];
+        if (id.indexOf("foo_") === 0) {
+          after_num_inexistent_docs += 1;
+        }
+      }
+
+      repResult = CouchDB.replicate(
+        dbPairs[i].source,
+        dbPairs[i].target,
+        {
+          body: {
+            doc_ids: after_doc_ids
+          }
+        }
+      );
+
+      after_total = after_doc_ids.length - after_num_inexistent_docs;
+      TEquals(true, repResult.ok);
+      if (after_total === 0) {
+        TEquals(true, repResult.no_changes);
+      } else {
+        TEquals('string', typeof repResult.start_time);
+        TEquals('string', typeof repResult.end_time);
+        TEquals(after_total, repResult.docs_read);
+        TEquals(after_total, repResult.docs_written);
+        TEquals(0, repResult.doc_write_failures);
+      }
+
+      for (k = 0; k < after_doc_ids.length; k++) {
+        id = after_doc_ids[k];
+        doc = sourceDb.open(id);
+        copy = targetDb.open(id);
+
+        if (id.indexOf("foo_") === 0) {
+          TEquals(null, doc);
+          TEquals(null, copy);
+        } else {
+          T(doc !== null);
+          T(copy !== null);
+          TEquals(true, compareObjects(doc, copy));
+        }
+      }
+
+      // be absolutely sure that other docs were not replicated
+      for (k = 0; k < docs.length; k++) {
+        var base_id = docs[k]._id;
+        id = encodeURIComponent(base_id);
+        doc = targetDb.open(base_id);
+
+        if ((doc_ids.indexOf(id) >= 0) || (after_doc_ids.indexOf(id) >= 0) ||
+            (doc_ids.indexOf(base_id) >= 0) ||
+            (after_doc_ids.indexOf(base_id) >= 0)) {
+            T(doc !== null);
+        } else {
+            TEquals(null, doc);
+        }
+      }
+
+      targetInfo = targetDb.info();
+      TEquals((total + after_total), targetInfo.doc_count);
+
+
+      // replicate again the same doc after updated on source (no conflict)
+      id = target_doc_ids[j].conflict_id;
+      doc = sourceDb.open(id);
+      T(doc !== null);
+      doc.integer = 666;
+      TEquals(true, sourceDb.save(doc).ok);
+      addAtt(sourceDb, doc, "readme.txt", att1_data, "text/plain");
+      addAtt(sourceDb, doc, "data.dat", att2_data, "application/binary");
+
+      repResult = CouchDB.replicate(
+        dbPairs[i].source,
+        dbPairs[i].target,
+        {
+          body: {
+            doc_ids: [id]
+          }
+        }
+      );
+
+      TEquals(true, repResult.ok);
+      TEquals(1, repResult.docs_read);
+      TEquals(1, repResult.docs_written);
+      TEquals(0, repResult.doc_write_failures);
+
+      copy = targetDb.open(id, {conflicts: true});
+
+      TEquals(666, copy.integer);
+      TEquals(0, copy._rev.indexOf("4-"));
+      TEquals('undefined', typeof copy._conflicts);
+
+      var atts = copy._attachments;
+      TEquals('object', typeof atts);
+      TEquals('object', typeof atts["readme.txt"]);
+      TEquals(3, atts["readme.txt"].revpos);
+      TEquals(0, atts["readme.txt"].content_type.indexOf("text/plain"));
+      TEquals(true, atts["readme.txt"].stub);
+
+      var att1_copy = CouchDB.request(
+        "GET", "/" + targetDb.name + "/" + copy._id + "/readme.txt"
+      ).responseText;
+      TEquals(att1_data.length, att1_copy.length);
+      TEquals(att1_data, att1_copy);
+
+      TEquals('object', typeof atts["data.dat"]);
+      TEquals(4, atts["data.dat"].revpos);
+      TEquals(0, atts["data.dat"].content_type.indexOf("application/binary"));
+      TEquals(true, atts["data.dat"].stub);
+
+      var att2_copy = CouchDB.request(
+        "GET", "/" + targetDb.name + "/" + copy._id + "/data.dat"
+      ).responseText;
+      TEquals(att2_data.length, att2_copy.length);
+      TEquals(att2_data, att2_copy);
+
+
+      // generate a conflict throught replication by doc IDs
+      id = target_doc_ids[j].conflict_id;
+      doc = sourceDb.open(id);
+      copy = targetDb.open(id);
+      T(doc !== null);
+      T(copy !== null);
+      doc.integer += 100;
+      copy.integer += 1;
+      TEquals(true, sourceDb.save(doc).ok);
+      TEquals(true, targetDb.save(copy).ok);
+
+      repResult = CouchDB.replicate(
+        dbPairs[i].source,
+        dbPairs[i].target,
+        {
+          body: {
+            doc_ids: [id]
+          }
+        }
+      );
+
+      TEquals(true, repResult.ok);
+      TEquals(1, repResult.docs_read);
+      TEquals(1, repResult.docs_written);
+      TEquals(0, repResult.doc_write_failures);
+
+      copy = targetDb.open(id, {conflicts: true});
+
+      TEquals(0, copy._rev.indexOf("5-"));
+      TEquals(true, copy._conflicts instanceof Array);
+      TEquals(1, copy._conflicts.length);
+      TEquals(0, copy._conflicts[0].indexOf("5-"));
+    }
+  }
+
+
+  docs = makeDocs(1, 25);
+  docs.push({
+    _id: "_design/foo",
+    language: "javascript",
+    filters: {
+      myfilter: (function(doc, req) { return true; }).toString()
+    }
+  });
+
+  for (i = 0; i < dbPairs.length; i++) {
+    populateDb(sourceDb, docs);
+    populateDb(targetDb, []);
+
+    // add some attachments
+    for (j = 10; j < 15; j++) {
+      addAtt(sourceDb, docs[j], "readme.txt", att1_data, "text/plain");
+    }
+
+    repResult = CouchDB.replicate(
+      dbPairs[i].source,
+      dbPairs[i].target,
+      {
+        body: {
+          continuous: true
+        }
+      }
+    );
+    TEquals(true, repResult.ok);
+    TEquals('string', typeof repResult._local_id);
+
+    var rep_id = repResult._local_id;
+
+    waitForSeq(sourceDb, targetDb, rep_id);
+
+    for (j = 0; j < docs.length; j++) {
+      doc = docs[j];
+      copy = targetDb.open(doc._id);
+
+      T(copy !== null);
+      TEquals(true, compareObjects(doc, copy));
+
+      if (j >= 10 && j < 15) {
+        var atts = copy._attachments;
+        TEquals('object', typeof atts);
+        TEquals('object', typeof atts["readme.txt"]);
+        TEquals(2, atts["readme.txt"].revpos);
+        TEquals(0, atts["readme.txt"].content_type.indexOf("text/plain"));
+        TEquals(true, atts["readme.txt"].stub);
+
+        var att_copy = CouchDB.request(
+          "GET", "/" + targetDb.name + "/" + copy._id + "/readme.txt"
+        ).responseText;
+        TEquals(att1_data.length, att_copy.length);
+        TEquals(att1_data, att_copy);
+      }
+    }
+
+    sourceInfo = sourceDb.info();
+    targetInfo = targetDb.info();
+
+    TEquals(sourceInfo.doc_count, targetInfo.doc_count);
+
+    // add attachments to docs in source
+    for (j = 10; j < 15; j++) {
+      addAtt(sourceDb, docs[j], "data.dat", att2_data, "application/binary");
+    }
+
+    var ddoc = docs[docs.length - 1]; // design doc
+    addAtt(sourceDb, ddoc, "readme.txt", att1_data, "text/plain");
+
+    waitForSeq(sourceDb, targetDb, rep_id);
+
+    var modifDocs = docs.slice(10, 15).concat([ddoc]);
+    for (j = 0; j < modifDocs.length; j++) {
+      doc = modifDocs[j];
+      copy = targetDb.open(doc._id);
+
+      T(copy !== null);
+      TEquals(true, compareObjects(doc, copy));
+
+      var atts = copy._attachments;
+      TEquals('object', typeof atts);
+      TEquals('object', typeof atts["readme.txt"]);
+      TEquals(2, atts["readme.txt"].revpos);
+      TEquals(0, atts["readme.txt"].content_type.indexOf("text/plain"));
+      TEquals(true, atts["readme.txt"].stub);
+
+      var att1_copy = CouchDB.request(
+        "GET", "/" + targetDb.name + "/" + copy._id + "/readme.txt"
+      ).responseText;
+      TEquals(att1_data.length, att1_copy.length);
+      TEquals(att1_data, att1_copy);
+
+      if (doc._id.indexOf("_design/") === -1) {
+        TEquals('object', typeof atts["data.dat"]);
+        TEquals(3, atts["data.dat"].revpos);
+        TEquals(0, atts["data.dat"].content_type.indexOf("application/binary"));
+        TEquals(true, atts["data.dat"].stub);
+
+        var att2_copy = CouchDB.request(
+          "GET", "/" + targetDb.name + "/" + copy._id + "/data.dat"
+        ).responseText;
+        TEquals(att2_data.length, att2_copy.length);
+        TEquals(att2_data, att2_copy);
+      }
+    }
+
+    sourceInfo = sourceDb.info();
+    targetInfo = targetDb.info();
+
+    TEquals(sourceInfo.doc_count, targetInfo.doc_count);
+
+    // add another attachment to the ddoc on source
+    addAtt(sourceDb, ddoc, "data.dat", att2_data, "application/binary");
+
+    waitForSeq(sourceDb, targetDb, rep_id);
+
+    copy = targetDb.open(ddoc._id);
+    var atts = copy._attachments;
+    TEquals('object', typeof atts);
+    TEquals('object', typeof atts["readme.txt"]);
+    TEquals(2, atts["readme.txt"].revpos);
+    TEquals(0, atts["readme.txt"].content_type.indexOf("text/plain"));
+    TEquals(true, atts["readme.txt"].stub);
+
+    var att1_copy = CouchDB.request(
+      "GET", "/" + targetDb.name + "/" + copy._id + "/readme.txt"
+    ).responseText;
+    TEquals(att1_data.length, att1_copy.length);
+    TEquals(att1_data, att1_copy);
+
+    TEquals('object', typeof atts["data.dat"]);
+    TEquals(3, atts["data.dat"].revpos);
+    TEquals(0, atts["data.dat"].content_type.indexOf("application/binary"));
+    TEquals(true, atts["data.dat"].stub);
+
+    var att2_copy = CouchDB.request(
+      "GET", "/" + targetDb.name + "/" + copy._id + "/data.dat"
+    ).responseText;
+    TEquals(att2_data.length, att2_copy.length);
+    TEquals(att2_data, att2_copy);
+
+    sourceInfo = sourceDb.info();
+    targetInfo = targetDb.info();
+
+    TEquals(sourceInfo.doc_count, targetInfo.doc_count);
+
+
+    // add more docs to source
+    var newDocs = makeDocs(25, 35);
+    populateDb(sourceDb, newDocs, true);
+
+    waitForSeq(sourceDb, targetDb, rep_id);
+
+    for (j = 0; j < newDocs.length; j++) {
+      doc = newDocs[j];
+      copy = targetDb.open(doc._id);
+
+      T(copy !== null);
+      TEquals(true, compareObjects(doc, copy));
+    }
+
+    sourceInfo = sourceDb.info();
+    targetInfo = targetDb.info();
+
+    TEquals(sourceInfo.doc_count, targetInfo.doc_count);
+
+    // delete docs from source
+    TEquals(true, sourceDb.deleteDoc(newDocs[0]).ok);
+    TEquals(true, sourceDb.deleteDoc(newDocs[6]).ok);
+
+    waitForSeq(sourceDb, targetDb, rep_id);
+
+    copy = targetDb.open(newDocs[0]._id);
+    TEquals(null, copy);
+    copy = targetDb.open(newDocs[6]._id);
+    TEquals(null, copy);
+
+    var changes = targetDb.changes({since: targetInfo.update_seq});
+    var line1 = changes.results[changes.results.length - 2];
+    var line2 = changes.results[changes.results.length - 1];
+    TEquals(newDocs[0]._id, line1.id);
+    TEquals(true, line1.deleted);
+    TEquals(newDocs[6]._id, line2.id);
+    TEquals(true, line2.deleted);
+
+    // cancel the replication
+    repResult = CouchDB.replicate(
+      dbPairs[i].source,
+      dbPairs[i].target,
+      {
+        body: {
+          continuous: true,
+          cancel: true
+        }
+      }
+    );
+    TEquals(true, repResult.ok);
+    TEquals(rep_id, repResult._local_id);
+
+    doc = {
+      _id: 'foobar',
+      value: 666
+    };
+    TEquals(true, sourceDb.save(doc).ok);
+
+    waitForSeq(sourceDb, targetDb, rep_id);
+    copy = targetDb.open(doc._id);
+    TEquals(null, copy);
+  }
+
+  // COUCHDB-1093 - filtered and continuous _changes feed dies when the
+  // database is compacted
+  docs = makeDocs(1, 10);
+  docs.push({
+    _id: "_design/foo",
+    language: "javascript",
+    filters: {
+      myfilter: (function(doc, req) { return true; }).toString()
+    }
+  });
+  populateDb(sourceDb, docs);
+  populateDb(targetDb, []);
+
+  repResult = CouchDB.replicate(
+    CouchDB.protocol + host + "/" + sourceDb.name,
+    targetDb.name,
+    {
+      body: {
+        continuous: true,
+        filter: "foo/myfilter"
+      }
+    }
+  );
+  TEquals(true, repResult.ok);
+  TEquals('string', typeof repResult._local_id);
+
+  TEquals(true, sourceDb.compact().ok);
+  while (sourceDb.info().compact_running) {};
+
+  TEquals(true, sourceDb.save(makeDocs(30, 31)[0]).ok);
+
+  var task = getTask(repResult._local_id, 1000);
+  T(task != null);
+
+  waitForSeq(sourceDb, targetDb, repResult._local_id);
+  T(sourceDb.open("30") !== null);
+
+  // cancel replication
+  repResult = CouchDB.replicate(
+    CouchDB.protocol + host + "/" + sourceDb.name,
+    targetDb.name,
+    {
+      body: {
+        continuous: true,
+        filter: "foo/myfilter",
+        cancel: true
+      }
+    }
+  );
+  TEquals(true, repResult.ok);
+  TEquals('string', typeof repResult._local_id);
+
+
+  //
+  // test replication of compressed attachments
+  //
+  doc = {
+    _id: "foobar"
+  };
+  var bigTextAtt = makeAttData(128 * 1024);
+  var attName = "readme.txt";
+  var xhr = CouchDB.request("GET", "/_config/attachments/compression_level");
+  var compressionLevel = JSON.parse(xhr.responseText);
+  xhr = CouchDB.request("GET", "/_config/attachments/compressible_types");
+  var compressibleTypes = JSON.parse(xhr.responseText);
+
+  for (i = 0; i < dbPairs.length; i++) {
+    populateDb(sourceDb, [doc]);
+    populateDb(targetDb, []);
+
+    // enable compression of text types
+    enableAttCompression("8", "text/*");
+
+    // add text attachment to foobar doc
+    xhr = CouchDB.request(
+      "PUT",
+      "/" + sourceDb.name + "/" + doc._id + "/" + attName + "?rev=" + doc._rev,
+      {
+        body: bigTextAtt,
+        headers: {"Content-Type": "text/plain"}
+      }
+    );
+    TEquals(201, xhr.status);
+
+    // disable compression and replicate
+    disableAttCompression();
+
+    repResult = CouchDB.replicate(dbPairs[i].source, dbPairs[i].target);
+    TEquals(true, repResult.ok);
+    TEquals(true, repResult.history instanceof Array);
+    TEquals(1, repResult.history.length);
+    TEquals(1, repResult.history[0].missing_checked);
+    TEquals(1, repResult.history[0].missing_found);
+    TEquals(1, repResult.history[0].docs_read);
+    TEquals(1, repResult.history[0].docs_written);
+    TEquals(0, repResult.history[0].doc_write_failures);
+
+    copy = targetDb.open(
+      doc._id,
+      {att_encoding_info: true, bypass_cache: Math.round(Math.random() * 1000)}
+    );
+    T(copy !== null);
+    T(attName in copy._attachments);
+    TEquals("gzip", copy._attachments[attName].encoding);
+    TEquals("number", typeof copy._attachments[attName].length);
+    TEquals("number", typeof copy._attachments[attName].encoded_length);
+    T(copy._attachments[attName].encoded_length < copy._attachments[attName].length);
+  }
+
+  delete bigTextAtt;
+  // restore original settings
+  enableAttCompression(compressionLevel, compressibleTypes);
+
+
+  //
+  // test replication triggered by non admins
+  //
+
+  // case 1) user triggering the replication is not a DB admin of the target DB
+  var joeUserDoc = CouchDB.prepareUserDoc({
+    name: "joe",
+    roles: ["erlanger"]
+  }, "erly");
+  var usersDb = new CouchDB("test_suite_auth", {"X-Couch-Full-Commit":"false"});
+  var server_config = [
+    {
+      section: "couch_httpd_auth",
+      key: "authentication_db",
+      value: usersDb.name
+    }
+  ];
+
+  docs = makeDocs(1, 6);
+  docs.push({
+    _id: "_design/foo",
+    language: "javascript"
+  });
+
+  dbPairs = [
+    {
+      source: sourceDb.name,
+      target: targetDb.name
+    },
+    {
+      source: CouchDB.protocol + host + "/" + sourceDb.name,
+      target: targetDb.name
+    },
+    {
+      source: sourceDb.name,
+      target: CouchDB.protocol + "joe:erly@" + host + "/" + targetDb.name
+    },
+    {
+      source: CouchDB.protocol + host + "/" + sourceDb.name,
+      target: CouchDB.protocol + "joe:erly@" + host + "/" + targetDb.name
+    }
+  ];
+
+  for (i = 0; i < dbPairs.length; i++) {
+    usersDb.deleteDb();
+    populateDb(sourceDb, docs);
+    populateDb(targetDb, []);
+
+    TEquals(true, targetDb.setSecObj({
+      admins: {
+        names: ["superman"],
+        roles: ["god"]
+      }
+    }).ok);
+
+    run_on_modified_server(server_config, function() {
+      delete joeUserDoc._rev;
+      TEquals(true, usersDb.save(joeUserDoc).ok);
+
+      TEquals(true, CouchDB.login("joe", "erly").ok);
+      TEquals('joe', CouchDB.session().userCtx.name);
+
+      repResult = CouchDB.replicate(dbPairs[i].source, dbPairs[i].target);
+
+      TEquals(true, CouchDB.logout().ok);
+
+      TEquals(true, repResult.ok);
+      TEquals(docs.length, repResult.history[0].docs_read);
+      TEquals((docs.length - 1), repResult.history[0].docs_written); // 1 ddoc
+      TEquals(1, repResult.history[0].doc_write_failures);
+    });
+
+    for (j = 0; j < docs.length; j++) {
+      doc = docs[j];
+      copy = targetDb.open(doc._id);
+
+      if (doc._id.indexOf("_design/") === 0) {
+        TEquals(null, copy);
+      } else {
+        T(copy !== null);
+        TEquals(true, compareObjects(doc, copy));
+      }
+    }
+  }
+
+  // case 2) user triggering the replication is not a reader (nor admin) of the
+  //         source DB
+  dbPairs = [
+    {
+      source: sourceDb.name,
+      target: targetDb.name
+    },
+    {
+      source: CouchDB.protocol + "joe:erly@" + host + "/" + sourceDb.name,
+      target: targetDb.name
+    },
+    {
+      source: sourceDb.name,
+      target: CouchDB.protocol + host + "/" + targetDb.name
+    },
+    {
+      source: CouchDB.protocol + "joe:erly@" + host + "/" + sourceDb.name,
+      target: CouchDB.protocol + host + "/" + targetDb.name
+    }
+  ];
+
+  for (i = 0; i < dbPairs.length; i++) {
+    usersDb.deleteDb();
+    populateDb(sourceDb, docs);
+    populateDb(targetDb, []);
+
+    TEquals(true, sourceDb.setSecObj({
+      admins: {
+        names: ["superman"],
+        roles: ["god"]
+      },
+      readers: {
+        names: ["john"],
+        roles: ["secret"]
+      }
+    }).ok);
+
+    run_on_modified_server(server_config, function() {
+      delete joeUserDoc._rev;
+      TEquals(true, usersDb.save(joeUserDoc).ok);
+
+      TEquals(true, CouchDB.login("joe", "erly").ok);
+      TEquals('joe', CouchDB.session().userCtx.name);
+
+      try {
+        CouchDB.replicate(dbPairs[i].source, dbPairs[i].target);
+        T(false, "should have raised an exception");
+      } catch (x) {
+        TEquals("unauthorized", x.error);
+      }
+
+      TEquals(true, CouchDB.logout().ok);
+    });
+
+    for (j = 0; j < docs.length; j++) {
+      doc = docs[j];
+      copy = targetDb.open(doc._id);
+      TEquals(null, copy);
+    }
+  }
+
+
+  // COUCHDB-885 - push replication of a doc with attachment causes a
+  //               conflict in the target.
+  sourceDb = new CouchDB("test_suite_db_a");
+  targetDb = new CouchDB("test_suite_db_b");
+
+  sourceDb.deleteDb();
+  sourceDb.createDb();
+  targetDb.deleteDb();
+  targetDb.createDb();
+
+  doc = {
+    _id: "doc1"
+  };
+  TEquals(true, sourceDb.save(doc).ok);
+
+  repResult = CouchDB.replicate(
+    sourceDb.name,
+    CouchDB.protocol + host + "/" + targetDb.name
+  );
+  TEquals(true, repResult.ok);
+  TEquals(true, repResult.history instanceof Array);
+  TEquals(1, repResult.history.length);
+  TEquals(1, repResult.history[0].docs_written);
+  TEquals(1, repResult.history[0].docs_read);
+  TEquals(0, repResult.history[0].doc_write_failures);
+
+  doc["_attachments"] = {
+    "hello.txt": {
+      "content_type": "text/plain",
+      "data": "aGVsbG8gd29ybGQ="  // base64:encode("hello world")
+    },
+    "foo.dat": {
+      "content_type": "not/compressible",
+      "data": "aSBhbSBub3QgZ3ppcGVk"  // base64:encode("i am not gziped")
+    }
+  };
+
+  TEquals(true, sourceDb.save(doc).ok);
+  repResult = CouchDB.replicate(
+    sourceDb.name,
+    CouchDB.protocol + host + "/" + targetDb.name
+  );
+  TEquals(true, repResult.ok);
+  TEquals(true, repResult.history instanceof Array);
+  TEquals(2, repResult.history.length);
+  TEquals(1, repResult.history[0].docs_written);
+  TEquals(1, repResult.history[0].docs_read);
+  TEquals(0, repResult.history[0].doc_write_failures);
+
+  copy = targetDb.open(doc._id, {
+    conflicts: true, deleted_conflicts: true,
+    attachments: true, att_encoding_info: true});
+  T(copy !== null);
+  TEquals("undefined", typeof copy._conflicts);
+  TEquals("undefined", typeof copy._deleted_conflicts);
+  TEquals("text/plain", copy._attachments["hello.txt"]["content_type"]);
+  TEquals("aGVsbG8gd29ybGQ=", copy._attachments["hello.txt"]["data"]);
+  TEquals("gzip", copy._attachments["hello.txt"]["encoding"]);
+  TEquals("not/compressible", copy._attachments["foo.dat"]["content_type"]);
+  TEquals("aSBhbSBub3QgZ3ppcGVk", copy._attachments["foo.dat"]["data"]);
+  TEquals("undefined", typeof copy._attachments["foo.dat"]["encoding"]);
+  // end of test for COUCHDB-885
+
+  // Test for COUCHDB-1242 (reject non-string query_params)
+  try {
+    CouchDB.replicate(sourceDb, targetDb, {
+      body: {
+        filter : "mydesign/myfilter",
+        query_params : {
+          "maxvalue": 4
+        }
+      }
+    });
+  } catch (e) {
+    TEquals("bad_request", e.error);
+  }
+
+
+  // Test that we can cancel a replication just by POSTing an object
+  // like  {"replication_id": Id, "cancel": true}. The replication ID
+  // can be obtained from a continuous replication request response
+  // (_local_id field), from _active_tasks or from the log
+  populateDb(sourceDb, makeDocs(1, 6));
+  populateDb(targetDb, []);
+
+  repResult = CouchDB.replicate(
+    CouchDB.protocol + host + "/" + sourceDb.name,
+    targetDb.name,
+    {
+      body: {
+        continuous: true,
+        create_target: true
+      }
+    }
+  );
+  TEquals(true, repResult.ok);
+  TEquals('string', typeof repResult._local_id);
+  var repId = repResult._local_id;
+
+  var task = getTask(repId, 3000);
+  T(task != null);
+
+  TEquals(task["replication_id"], repId, "Replication found in _active_tasks");
+  xhr = CouchDB.request(
+    "POST", "/_replicate", {
+      body: JSON.stringify({"replication_id": repId, "cancel": true}),
+      headers: {"Content-Type": "application/json"}
+  });
+  TEquals(200, xhr.status, "Replication cancel request success");
+
+  task = getTask(repId);
+  TEquals(null, task, "Replication was canceled");
+
+  xhr = CouchDB.request(
+    "POST", "/_replicate", {
+      body: JSON.stringify({"replication_id": repId, "cancel": true}),
+      headers: {"Content-Type": "application/json"}
+  });
+  TEquals(404, xhr.status, "2nd replication cancel failed");
+
+  // Non-admin user can not cancel replications triggered by other users
+  var userDoc = CouchDB.prepareUserDoc({
+    name: "tony",
+    roles: ["mafia"]
+  }, "soprano");
+  usersDb = new CouchDB("test_suite_auth", {"X-Couch-Full-Commit":"false"});
+  server_config = [
+    {
+      section: "couch_httpd_auth",
+      key: "authentication_db",
+      value: usersDb.name
+    }
+  ];
+
+  run_on_modified_server(server_config, function() {
+    populateDb(sourceDb, makeDocs(1, 6));
+    populateDb(targetDb, []);
+    TEquals(true, usersDb.save(userDoc).ok);
+
+    repResult = CouchDB.replicate(
+      CouchDB.protocol + host + "/" + sourceDb.name,
+      targetDb.name,
+      {
+        body: {
+          continuous: true
+        }
+      }
+    );
+    TEquals(true, repResult.ok);
+    TEquals('string', typeof repResult._local_id);
+
+    TEquals(true, CouchDB.login("tony", "soprano").ok);
+    TEquals('tony', CouchDB.session().userCtx.name);
+
+    xhr = CouchDB.request(
+      "POST", "/_replicate", {
+        body: JSON.stringify({"replication_id": repResult._local_id, "cancel": true}),
+        headers: {"Content-Type": "application/json"}
+    });
+    TEquals(401, xhr.status, "Unauthorized to cancel replication");
+    TEquals("unauthorized", JSON.parse(xhr.responseText).error);
+
+    TEquals(true, CouchDB.logout().ok);
+
+    xhr = CouchDB.request(
+      "POST", "/_replicate", {
+        body: JSON.stringify({"replication_id": repResult._local_id, "cancel": true}),
+        headers: {"Content-Type": "application/json"}
+    });
+    TEquals(200, xhr.status, "Authorized to cancel replication");
+  });
+
+  // cleanup
+  usersDb.deleteDb();
+  sourceDb.deleteDb();
+  targetDb.deleteDb();
+};

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/test/replicator_db_bad_rep_id.js
----------------------------------------------------------------------
diff --git a/share/test/replicator_db_bad_rep_id.js b/share/test/replicator_db_bad_rep_id.js
new file mode 100644
index 0000000..285b863
--- /dev/null
+++ b/share/test/replicator_db_bad_rep_id.js
@@ -0,0 +1,77 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+
+couchTests.replicator_db_bad_rep_id = function(debug) {
+
+  if (debug) debugger;
+
+  var populate_db = replicator_db.populate_db;
+  var docs1 = replicator_db.docs1;
+  var dbA = replicator_db.dbA;
+  var dbB = replicator_db.dbB;
+  var repDb = replicator_db.repDb;
+  var wait = replicator_db.wait;
+  var waitForRep = replicator_db.waitForRep;
+  var waitForSeq = replicator_db.waitForSeq;
+
+  function rep_doc_with_bad_rep_id() {
+    populate_db(dbA, docs1);
+    populate_db(dbB, []);
+
+    var repDoc = {
+      _id: "foo_rep",
+      source: dbA.name,
+      target: dbB.name,
+      replication_id: "1234abc"
+    };
+    T(repDb.save(repDoc).ok);
+
+    waitForRep(repDb, repDoc, "completed");
+    for (var i = 0; i < docs1.length; i++) {
+      var doc = docs1[i];
+      var copy = dbB.open(doc._id);
+      T(copy !== null);
+      T(copy.value === doc.value);
+    }
+
+    var repDoc1 = repDb.open(repDoc._id);
+    T(repDoc1 !== null);
+    T(repDoc1.source === repDoc.source);
+    T(repDoc1.target === repDoc.target);
+    T(repDoc1._replication_state === "completed",
+      "replication document with bad replication id failed");
+    T(typeof repDoc1._replication_state_time === "string");
+    T(typeof repDoc1._replication_id  === "string");
+    T(repDoc1._replication_id !== "1234abc");
+  }
+
+  var server_config = [
+    {
+      section: "couch_httpd_auth",
+      key: "iterations",
+      value: "1"
+    },
+    {
+      section: "replicator",
+      key: "db",
+      value: repDb.name
+    }
+  ];
+
+  repDb.deleteDb();
+  run_on_modified_server(server_config, rep_doc_with_bad_rep_id);
+
+  // cleanup
+  repDb.deleteDb();
+  dbA.deleteDb();
+  dbB.deleteDb();
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/test/replicator_db_by_doc_id.js
----------------------------------------------------------------------
diff --git a/share/test/replicator_db_by_doc_id.js b/share/test/replicator_db_by_doc_id.js
new file mode 100644
index 0000000..1e1a385
--- /dev/null
+++ b/share/test/replicator_db_by_doc_id.js
@@ -0,0 +1,99 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+
+couchTests.replicator_db_by_doc_id = function(debug) {
+
+  if (debug) debugger;
+
+  var populate_db = replicator_db.populate_db;
+  var docs1 = replicator_db.docs1;
+  var dbA = replicator_db.dbA;
+  var dbB = replicator_db.dbB;
+  var repDb = replicator_db.repDb;
+  var wait = replicator_db.wait;
+  var waitForRep = replicator_db.waitForRep;
+  var waitForSeq = replicator_db.waitForSeq;
+
+  function by_doc_ids_replication() {
+    // to test that we can replicate docs with slashes in their IDs
+    var docs2 = docs1.concat([
+      {
+        _id: "_design/mydesign",
+        language : "javascript"
+      }
+    ]);
+
+    populate_db(dbA, docs2);
+    populate_db(dbB, []);
+
+    var repDoc = {
+      _id: "foo_cont_rep_doc",
+      source: "http://" + CouchDB.host + "/" + dbA.name,
+      target: dbB.name,
+      doc_ids: ["foo666", "foo3", "_design/mydesign", "foo999", "foo1"]
+    };
+    T(repDb.save(repDoc).ok);
+
+    waitForRep(repDb, repDoc, "completed");
+    var copy = dbB.open("foo1");
+    T(copy !== null);
+    T(copy.value === 11);
+
+    copy = dbB.open("foo2");
+    T(copy === null);
+
+    copy = dbB.open("foo3");
+    T(copy !== null);
+    T(copy.value === 33);
+
+    copy = dbB.open("foo666");
+    T(copy === null);
+
+    copy = dbB.open("foo999");
+    T(copy === null);
+
+    copy = dbB.open("_design/mydesign");
+    T(copy === null);
+
+    repDoc = repDb.open(repDoc._id);
+    T(typeof repDoc._replication_stats === "object", "doc has stats");
+    var stats = repDoc._replication_stats;
+    TEquals(3, stats.revisions_checked, "right # of revisions_checked");
+    TEquals(3, stats.missing_revisions_found, "right # of missing_revisions_found");
+    TEquals(3, stats.docs_read, "right # of docs_read");
+    TEquals(2, stats.docs_written, "right # of docs_written");
+    TEquals(1, stats.doc_write_failures, "right # of doc_write_failures");
+    TEquals(dbA.info().update_seq, stats.checkpointed_source_seq,
+      "right checkpointed_source_seq");
+  }
+
+  var server_config = [
+    {
+      section: "couch_httpd_auth",
+      key: "iterations",
+      value: "1"
+    },
+    {
+      section: "replicator",
+      key: "db",
+      value: repDb.name
+    }
+  ];
+
+  repDb.deleteDb();
+  run_on_modified_server(server_config, by_doc_ids_replication);
+
+  // cleanup
+  repDb.deleteDb();
+  dbA.deleteDb();
+  dbB.deleteDb();
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/test/replicator_db_compact_rep_db.js
----------------------------------------------------------------------
diff --git a/share/test/replicator_db_compact_rep_db.js b/share/test/replicator_db_compact_rep_db.js
new file mode 100644
index 0000000..0dea0ed
--- /dev/null
+++ b/share/test/replicator_db_compact_rep_db.js
@@ -0,0 +1,119 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+
+couchTests.replicator_db_compact_rep_db = function(debug) {
+
+  if (debug) debugger;
+
+  var populate_db = replicator_db.populate_db;
+  var docs1 = replicator_db.docs1;
+  var dbA = replicator_db.dbA;
+  var dbB = replicator_db.dbB;
+  var repDb = replicator_db.repDb;
+  var usersDb = replicator_db.usersDb;
+  var wait = replicator_db.wait;
+  var waitForRep = replicator_db.waitForRep;
+  var waitForSeq = replicator_db.waitForSeq;
+  var wait_rep_doc = replicator_db.wait_rep_doc;
+
+  function compact_rep_db() {
+    var dbA_copy = new CouchDB("test_suite_rep_db_a_copy");
+    var dbB_copy = new CouchDB("test_suite_rep_db_b_copy");
+    var repDoc1, repDoc2;
+    var xhr, i, doc, copy, new_doc;
+    var docs = makeDocs(1, 50);
+
+    populate_db(dbA, docs);
+    populate_db(dbB, docs);
+    populate_db(dbA_copy, []);
+    populate_db(dbB_copy, []);
+
+    repDoc1 = {
+      _id: "rep1",
+      source: CouchDB.protocol + CouchDB.host + "/" + dbA.name,
+      target: dbA_copy.name,
+      continuous: true
+    };
+    repDoc2 = {
+      _id: "rep2",
+      source: CouchDB.protocol + CouchDB.host + "/" + dbB.name,
+      target: dbB_copy.name,
+      continuous: true
+    };
+
+    TEquals(true, repDb.save(repDoc1).ok);
+    TEquals(true, repDb.save(repDoc2).ok);
+
+    TEquals(true, repDb.compact().ok);
+    TEquals(202, repDb.last_req.status);
+
+    waitForSeq(dbA, dbA_copy);
+    waitForSeq(dbB, dbB_copy);
+
+    while (repDb.info().compact_running) {};
+
+    for (i = 0; i < docs.length; i++) {
+      copy = dbA_copy.open(docs[i]._id);
+      T(copy !== null);
+      copy = dbB_copy.open(docs[i]._id);
+      T(copy !== null);
+    }
+
+    new_doc = {
+      _id: "foo666",
+      value: 666
+    };
+
+    TEquals(true, dbA.save(new_doc).ok);
+    TEquals(true, dbB.save(new_doc).ok);
+
+    waitForSeq(dbA, dbA_copy);
+    waitForSeq(dbB, dbB_copy);
+
+    copy = dbA.open(new_doc._id);
+    T(copy !== null);
+    TEquals(666, copy.value);
+    copy = dbB.open(new_doc._id);
+    T(copy !== null);
+    TEquals(666, copy.value);
+  }
+
+  var server_config = [
+    {
+      section: "couch_httpd_auth",
+      key: "iterations",
+      value: "1"
+    },
+    {
+      section: "replicator",
+      key: "db",
+      value: repDb.name
+    },
+    {
+      section: "couch_httpd_auth",
+      key: "authentication_db",
+      value: usersDb.name
+    }
+  ];
+
+  repDb.deleteDb();
+  run_on_modified_server(server_config, compact_rep_db);
+
+  // cleanup
+  repDb.deleteDb();
+  dbA.deleteDb();
+  dbB.deleteDb();
+  usersDb.deleteDb();
+  (new CouchDB("test_suite_rep_db_a_copy")).deleteDb();
+  (new CouchDB("test_suite_rep_db_b_copy")).deleteDb();
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/test/replicator_db_continuous.js
----------------------------------------------------------------------
diff --git a/share/test/replicator_db_continuous.js b/share/test/replicator_db_continuous.js
new file mode 100644
index 0000000..a2b17d0
--- /dev/null
+++ b/share/test/replicator_db_continuous.js
@@ -0,0 +1,137 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+
+couchTests.replicator_db_continuous = function(debug) {
+
+  if (debug) debugger;
+
+  var populate_db = replicator_db.populate_db;
+  var docs1 = replicator_db.docs1;
+  var dbA = replicator_db.dbA;
+  var dbB = replicator_db.dbB;
+  var repDb = replicator_db.repDb;
+  var wait = replicator_db.wait;
+  var waitForRep = replicator_db.waitForRep;
+  var waitForSeq = replicator_db.waitForSeq;
+
+  function continuous_replication() {
+    populate_db(dbA, docs1);
+    populate_db(dbB, []);
+
+    var repDoc = {
+      _id: "foo_cont_rep_doc",
+      source: "http://" + CouchDB.host + "/" + dbA.name,
+      target: dbB.name,
+      continuous: true,
+      user_ctx: {
+        roles: ["_admin"]
+      }
+    };
+
+    T(repDb.save(repDoc).ok);
+
+    waitForSeq(dbA, dbB);
+    for (var i = 0; i < docs1.length; i++) {
+      var doc = docs1[i];
+      var copy = dbB.open(doc._id);
+      T(copy !== null);
+      T(copy.value === doc.value);
+    }
+
+    var tasks = JSON.parse(CouchDB.request("GET", "/_active_tasks").responseText);
+    TEquals(1, tasks.length, "1 active task");
+    TEquals(repDoc._id, tasks[0].doc_id, "replication doc id in active tasks");
+
+    // add another doc to source, it will be replicated to target
+    var docX = {
+      _id: "foo1000",
+      value: 1001
+    };
+
+    T(dbA.save(docX).ok);
+
+    waitForSeq(dbA, dbB);
+    var copy = dbB.open("foo1000");
+    T(copy !== null);
+    T(copy.value === 1001);
+
+    var repDoc1 = repDb.open(repDoc._id);
+    T(repDoc1 !== null);
+    T(repDoc1.source === repDoc.source);
+    T(repDoc1.target === repDoc.target);
+    T(repDoc1._replication_state === "triggered");
+    T(typeof repDoc1._replication_state_time === "string");
+    T(typeof repDoc1._replication_id  === "string");
+
+    // Design documents are only replicated to local targets if the respective
+    // replication document has a user_ctx filed with the "_admin" role in it.
+    var ddoc = {
+      _id: "_design/foobar",
+      language: "javascript"
+    };
+
+    T(dbA.save(ddoc).ok);
+
+    waitForSeq(dbA, dbB);
+    var ddoc_copy = dbB.open("_design/foobar");
+    T(ddoc_copy !== null);
+    T(ddoc.language === "javascript");
+
+    // update the design doc on source, test that the new revision is replicated
+    ddoc.language = "erlang";
+    T(dbA.save(ddoc).ok);
+    T(ddoc._rev.indexOf("2-") === 0);
+
+    waitForSeq(dbA, dbB);
+    ddoc_copy = dbB.open("_design/foobar");
+    T(ddoc_copy !== null);
+    T(ddoc_copy._rev === ddoc._rev);
+    T(ddoc.language === "erlang");
+
+    // stop replication by deleting the replication document
+    T(repDb.deleteDoc(repDoc1).ok);
+
+    // add another doc to source, it will NOT be replicated to target
+    var docY = {
+      _id: "foo666",
+      value: 999
+    };
+
+    T(dbA.save(docY).ok);
+
+    wait(200); // is there a way to avoid wait here?
+    var copy = dbB.open("foo666");
+    T(copy === null);
+  }
+
+
+  var server_config = [
+    {
+      section: "couch_httpd_auth",
+      key: "iterations",
+      value: "1"
+    },
+    {
+      section: "replicator",
+      key: "db",
+      value: repDb.name
+    }
+  ];
+
+  repDb.deleteDb();
+  run_on_modified_server(server_config, continuous_replication);
+
+  // cleanup
+  repDb.deleteDb();
+  dbA.deleteDb();
+  dbB.deleteDb();
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/test/replicator_db_credential_delegation.js
----------------------------------------------------------------------
diff --git a/share/test/replicator_db_credential_delegation.js b/share/test/replicator_db_credential_delegation.js
new file mode 100644
index 0000000..7dd9d18
--- /dev/null
+++ b/share/test/replicator_db_credential_delegation.js
@@ -0,0 +1,149 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+
+couchTests.replicator_db_credential_delegation = function(debug) {
+
+  if (debug) debugger;
+
+  var populate_db = replicator_db.populate_db;
+  var docs1 = replicator_db.docs1;
+  var dbA = replicator_db.dbA;
+  var dbB = replicator_db.dbB;
+  var repDb = replicator_db.repDb;
+  var usersDb = replicator_db.usersDb;
+  var wait = replicator_db.wait;
+  var waitForRep = replicator_db.waitForRep;
+  var waitForSeq = replicator_db.waitForSeq;
+  var wait_rep_doc = replicator_db.wait_rep_doc;
+
+  function test_replication_credentials_delegation() {
+    populate_db(usersDb, []);
+
+    var joeUserDoc = CouchDB.prepareUserDoc({
+      name: "joe",
+      roles: ["god", "erlanger"]
+    }, "erly");
+    T(usersDb.save(joeUserDoc).ok);
+
+    var ddoc = {
+      _id: "_design/beer",
+      language: "javascript"
+    };
+    populate_db(dbA, docs1.concat([ddoc]));
+    populate_db(dbB, []);
+
+    T(dbB.setSecObj({
+      admins: {
+        names: [],
+        roles: ["god"]
+      }
+    }).ok);
+
+    var server_admins_config = [
+      {
+        section: "couch_httpd_auth",
+        key: "iterations",
+        value: "1"
+      },
+      {
+        section: "admins",
+        key: "fdmanana",
+        value: "qwerty"
+      }
+    ];
+
+    run_on_modified_server(server_admins_config, function() {
+
+      T(CouchDB.login("fdmanana", "qwerty").ok);
+      T(CouchDB.session().userCtx.name === "fdmanana");
+      T(CouchDB.session().userCtx.roles.indexOf("_admin") !== -1);
+
+      var repDoc = {
+        _id: "foo_rep_del_doc_1",
+        source: dbA.name,
+        target: dbB.name,
+        user_ctx: {
+          name: "joe",
+          roles: ["erlanger"]
+        }
+      };
+
+      T(repDb.save(repDoc).ok);
+
+      waitForRep(repDb, repDoc, "completed");
+      for (var i = 0; i < docs1.length; i++) {
+        var doc = docs1[i];
+        var copy = dbB.open(doc._id);
+        T(copy !== null);
+        T(copy.value === doc.value);
+      }
+
+      // design doc was not replicated, because joe is not an admin of db B
+      var doc = dbB.open(ddoc._id);
+      T(doc === null);
+
+      // now test the same replication but putting the role "god" in the
+      // delegation user context property
+      var repDoc2 = {
+        _id: "foo_rep_del_doc_2",
+        source: dbA.name,
+        target: dbB.name,
+        user_ctx: {
+          name: "joe",
+          roles: ["erlanger", "god"]
+        }
+      };
+      T(repDb.save(repDoc2).ok);
+
+      waitForRep(repDb, repDoc2, "completed");
+      for (var i = 0; i < docs1.length; i++) {
+        var doc = docs1[i];
+        var copy = dbB.open(doc._id);
+        T(copy !== null);
+        T(copy.value === doc.value);
+      }
+
+      // because anyone with a 'god' role is an admin of db B, a replication
+      // that is delegated to a 'god' role can write design docs to db B
+      doc = dbB.open(ddoc._id);
+      T(doc !== null);
+      T(doc.language === ddoc.language);
+    });
+  }
+
+  var server_config = [
+    {
+      section: "couch_httpd_auth",
+      key: "iterations",
+      value: "1"
+    },
+    {
+      section: "replicator",
+      key: "db",
+      value: repDb.name
+    },
+    {
+      section: "couch_httpd_auth",
+      key: "authentication_db",
+      value: usersDb.name
+    }
+  ];
+
+  repDb.deleteDb();
+  run_on_modified_server(server_config, test_replication_credentials_delegation);
+
+  // cleanup
+  repDb.deleteDb();
+  dbA.deleteDb();
+  dbB.deleteDb();
+  usersDb.deleteDb();
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/test/replicator_db_field_validation.js
----------------------------------------------------------------------
diff --git a/share/test/replicator_db_field_validation.js b/share/test/replicator_db_field_validation.js
new file mode 100644
index 0000000..167bdcc
--- /dev/null
+++ b/share/test/replicator_db_field_validation.js
@@ -0,0 +1,178 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+
+couchTests.replicator_db_field_validation = function(debug) {
+
+  if (debug) debugger;
+
+  var populate_db = replicator_db.populate_db;
+  var docs1 = replicator_db.docs1;
+  var dbA = replicator_db.dbA;
+  var dbB = replicator_db.dbB;
+  var repDb = replicator_db.repDb;
+  var usersDb = replicator_db.usersDb;
+  var wait = replicator_db.wait;
+  var waitForRep = replicator_db.waitForRep;
+  var waitForSeq = replicator_db.waitForSeq;
+  var wait_rep_doc = replicator_db.wait_rep_doc;
+
+  function rep_doc_field_validation() {
+    var docs = makeDocs(1, 5);
+
+    populate_db(dbA, docs);
+    populate_db(dbB, []);
+
+    var repDoc = {
+       _id: "rep1",
+       target: dbB.name
+    };
+
+    try {
+      repDb.save(repDoc);
+      T(false, "should have failed because source field is missing");
+    } catch (x) {
+      TEquals("forbidden", x.error);
+    }
+
+    repDoc = {
+       _id: "rep1",
+       source: 123,
+       target: dbB.name
+    };
+
+    try {
+      repDb.save(repDoc);
+      T(false, "should have failed because source field is a number");
+    } catch (x) {
+      TEquals("forbidden", x.error);
+    }
+
+    repDoc = {
+       _id: "rep1",
+       source: dbA.name
+    };
+
+    try {
+      repDb.save(repDoc);
+      T(false, "should have failed because target field is missing");
+    } catch (x) {
+      TEquals("forbidden", x.error);
+    }
+
+    repDoc = {
+       _id: "rep1",
+       source: dbA.name,
+       target: null
+    };
+
+    try {
+      repDb.save(repDoc);
+      T(false, "should have failed because target field is null");
+    } catch (x) {
+      TEquals("forbidden", x.error);
+    }
+
+    repDoc = {
+       _id: "rep1",
+       source: dbA.name,
+       target: { url: 123 }
+    };
+
+    try {
+      repDb.save(repDoc);
+      T(false, "should have failed because target.url field is not a string");
+    } catch (x) {
+      TEquals("forbidden", x.error);
+    }
+
+    repDoc = {
+       _id: "rep1",
+       source: dbA.name,
+       target: { url: dbB.name, auth: null }
+    };
+
+    try {
+      repDb.save(repDoc);
+      T(false, "should have failed because target.auth field is null");
+    } catch (x) {
+      TEquals("forbidden", x.error);
+    }
+
+    repDoc = {
+       _id: "rep1",
+       source: dbA.name,
+       target: { url: dbB.name, auth: "foo:bar" }
+    };
+
+    try {
+      repDb.save(repDoc);
+      T(false, "should have failed because target.auth field is not an object");
+    } catch (x) {
+      TEquals("forbidden", x.error);
+    }
+
+    repDoc = {
+       _id: "rep1",
+       source: dbA.name,
+       target: dbB.name,
+       continuous: "true"
+    };
+
+    try {
+      repDb.save(repDoc);
+      T(false, "should have failed because continuous is not a boolean");
+    } catch (x) {
+      TEquals("forbidden", x.error);
+    }
+
+    repDoc = {
+       _id: "rep1",
+       source: dbA.name,
+       target: dbB.name,
+       filter: 123
+    };
+
+    try {
+      repDb.save(repDoc);
+      T(false, "should have failed because filter is not a string");
+    } catch (x) {
+      TEquals("forbidden", x.error);
+    }
+  }
+
+  var server_config = [
+    {
+      section: "couch_httpd_auth",
+      key: "iterations",
+      value: "1"
+    },
+    {
+      section: "replicator",
+      key: "db",
+      value: repDb.name
+    },
+    {
+      section: "couch_httpd_auth",
+      key: "authentication_db",
+      value: usersDb.name
+    }
+  ];
+
+  repDb.deleteDb();
+  run_on_modified_server(server_config, rep_doc_field_validation);
+
+  // cleanup
+  repDb.deleteDb();
+  dbA.deleteDb();
+  dbB.deleteDb();
+  usersDb.deleteDb();
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/test/replicator_db_filtered.js
----------------------------------------------------------------------
diff --git a/share/test/replicator_db_filtered.js b/share/test/replicator_db_filtered.js
new file mode 100644
index 0000000..31c78a7
--- /dev/null
+++ b/share/test/replicator_db_filtered.js
@@ -0,0 +1,105 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+
+couchTests.replicator_db_filtered = function(debug) {
+
+  if (debug) debugger;
+
+  var populate_db = replicator_db.populate_db;
+  var docs1 = replicator_db.docs1;
+  var dbA = replicator_db.dbA;
+  var dbB = replicator_db.dbB;
+  var repDb = replicator_db.repDb;
+  var waitForRep = replicator_db.waitForRep;
+
+  function filtered_replication() {
+    var docs2 = docs1.concat([
+      {
+        _id: "_design/mydesign",
+        language : "javascript",
+        filters : {
+          myfilter : (function(doc, req) {
+            return (doc.value % 2) !== Number(req.query.myparam);
+          }).toString()
+        }
+      }
+    ]);
+
+    populate_db(dbA, docs2);
+    populate_db(dbB, []);
+
+    var repDoc = {
+      _id: "foo_filt_rep_doc",
+      source: "http://" + CouchDB.host + "/" + dbA.name,
+      target: dbB.name,
+      filter: "mydesign/myfilter",
+      query_params: {
+        myparam: 1
+      }
+    };
+    T(repDb.save(repDoc).ok);
+
+    waitForRep(repDb, repDoc, "completed");
+    for (var i = 0; i < docs2.length; i++) {
+      var doc = docs2[i];
+      var copy = dbB.open(doc._id);
+
+      if (typeof doc.value === "number") {
+        if ((doc.value % 2) !== 1) {
+          T(copy !== null);
+          T(copy.value === doc.value);
+        } else {
+          T(copy === null);
+        }
+      }
+    }
+
+    var repDoc1 = repDb.open(repDoc._id);
+    T(repDoc1 !== null);
+    T(repDoc1.source === repDoc.source);
+    T(repDoc1.target === repDoc.target);
+    T(repDoc1._replication_state === "completed", "filtered");
+    T(typeof repDoc1._replication_state_time === "string");
+    T(typeof repDoc1._replication_id  === "string");
+    T(typeof repDoc1._replication_stats === "object", "doc has stats");
+    var stats = repDoc1._replication_stats;
+    TEquals(2, stats.revisions_checked, "right # of revisions_checked");
+    TEquals(2, stats.missing_revisions_found, "right # of missing_revisions_found");
+    TEquals(2, stats.docs_read, "right # of docs_read");
+    TEquals(1, stats.docs_written, "right # of docs_written");
+    TEquals(1, stats.doc_write_failures, "right # of doc_write_failures");
+    TEquals(dbA.info().update_seq, stats.checkpointed_source_seq,
+      "right checkpointed_source_seq");
+  }
+
+
+  var server_config = [
+    {
+      section: "couch_httpd_auth",
+      key: "iterations",
+      value: "1"
+    },
+    {
+      section: "replicator",
+      key: "db",
+      value: repDb.name
+    }
+  ];
+
+  repDb.deleteDb();
+  run_on_modified_server(server_config, filtered_replication);
+
+  // cleanup
+  repDb.deleteDb();
+  dbA.deleteDb();
+  dbB.deleteDb();
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3ba4fc0b/share/test/replicator_db_identical.js
----------------------------------------------------------------------
diff --git a/share/test/replicator_db_identical.js b/share/test/replicator_db_identical.js
new file mode 100644
index 0000000..cdf4592
--- /dev/null
+++ b/share/test/replicator_db_identical.js
@@ -0,0 +1,87 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+
+couchTests.replicator_db_identical = function(debug) {
+
+  if (debug) debugger;
+
+  var populate_db = replicator_db.populate_db;
+  var docs1 = replicator_db.docs1;
+  var dbA = replicator_db.dbA;
+  var dbB = replicator_db.dbB;
+  var repDb = replicator_db.repDb;
+  var wait = replicator_db.wait;
+  var waitForRep = replicator_db.waitForRep;
+  var waitForSeq = replicator_db.waitForSeq;
+
+  // test the case where multiple replication docs (different IDs)
+  // describe in fact the same replication (source, target, etc)
+  function identical_rep_docs() {
+    populate_db(dbA, docs1);
+    populate_db(dbB, []);
+
+    var repDoc1 = {
+      _id: "foo_dup_rep_doc_1",
+      source: "http://" + CouchDB.host + "/" + dbA.name,
+      target: dbB.name
+    };
+    var repDoc2 = {
+      _id: "foo_dup_rep_doc_2",
+      source: "http://" + CouchDB.host + "/" + dbA.name,
+      target: dbB.name
+    };
+
+    T(repDb.save(repDoc1).ok);
+    T(repDb.save(repDoc2).ok);
+
+    waitForRep(repDb, repDoc1, "completed");
+    for (var i = 0; i < docs1.length; i++) {
+      var doc = docs1[i];
+      var copy = dbB.open(doc._id);
+      T(copy !== null);
+      T(copy.value === doc.value);
+    }
+
+    repDoc1 = repDb.open("foo_dup_rep_doc_1");
+    T(repDoc1 !== null);
+    T(repDoc1._replication_state === "completed", "identical");
+    T(typeof repDoc1._replication_state_time === "string");
+    T(typeof repDoc1._replication_id  === "string");
+
+    repDoc2 = repDb.open("foo_dup_rep_doc_2");
+    T(repDoc2 !== null);
+    T(typeof repDoc2._replication_state === "undefined");
+    T(typeof repDoc2._replication_state_time === "undefined");
+    T(repDoc2._replication_id === repDoc1._replication_id);
+  }
+
+  var server_config = [
+    {
+      section: "couch_httpd_auth",
+      key: "iterations",
+      value: "1"
+    },
+    {
+      section: "replicator",
+      key: "db",
+      value: repDb.name
+    }
+  ];
+
+  repDb.deleteDb();
+  run_on_modified_server(server_config, identical_rep_docs);
+
+  // cleanup
+  repDb.deleteDb();
+  dbA.deleteDb();
+  dbB.deleteDb();
+}
\ No newline at end of file