Return-Path: X-Original-To: apmail-couchdb-commits-archive@www.apache.org Delivered-To: apmail-couchdb-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id DF2BEF5F9 for ; Fri, 14 Nov 2014 17:23:11 +0000 (UTC) Received: (qmail 85800 invoked by uid 500); 14 Nov 2014 17:23:08 -0000 Delivered-To: apmail-couchdb-commits-archive@couchdb.apache.org Received: (qmail 85746 invoked by uid 500); 14 Nov 2014 17:23:08 -0000 Mailing-List: contact commits-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list commits@couchdb.apache.org Received: (qmail 83847 invoked by uid 99); 14 Nov 2014 17:23:07 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 14 Nov 2014 17:23:07 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 35470941375; Fri, 14 Nov 2014 17:23:07 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: jan@apache.org To: commits@couchdb.apache.org Date: Fri, 14 Nov 2014 17:23:44 -0000 Message-Id: In-Reply-To: <98fec4d5f86a4856a1de13c1c8a6a0f7@git.apache.org> References: <98fec4d5f86a4856a1de13c1c8a6a0f7@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [39/50] [abbrv] couchdb commit: updated refs/heads/goodbye-futon to 393108c http://git-wip-us.apache.org/repos/asf/couchdb/blob/4b24def6/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/4b24def6/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/4b24def6/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/4b24def6/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/4b24def6/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/4b24def6/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/4b24def6/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/4b24def6/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/4b24def6/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/4b24def6/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/4b24def6/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/4b24def6/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/4b24def6/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/4b24def6/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/4b24def6/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/4b24def6/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/4b24def6/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/4b24def6/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/4b24def6/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/4b24def6/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/4b24def6/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/4b24def6/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/4b24def6/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/4b24def6/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/4b24def6/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/4b24def6/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/4b24def6/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/4b24def6/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/4b24def6/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/4b24def6/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/4b24def6/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/4b24def6/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/4b24def6/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 @@ - - - - - Overview - - - - - - - - - - - - - -
-

Overview

-
-
    -
  • -
- - - - - - - - - - - - - - - - - - -
Databases
NameSizeNumber of DocumentsUpdate Seq
-
- | - | - -
- -
-
- -
- - http://git-wip-us.apache.org/repos/asf/couchdb/blob/4b24def6/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 @@ - - - - - Plugins - - - - - - - - - -
-

- Overview - Plugins -

-
-
-

GeoCouch

-

Version: couchdb1.2.x_v0.3.0-11-g66e6219

-

Author: Volker Mische

-

- Available Erlang Versions: -

    -
  • CouchDB 1.4.0-XXX R15B01
  • -
-

-

- -

-
-
-

CouchPerUser

-

Version: 1.0.0

-

Author: Bob Ippolito

-

- Available Erlang Versions: -

    -
  • CouchDB 1.4.0-XXX R15B01
  • -
-

-

- -

-
-
-
- - - http://git-wip-us.apache.org/repos/asf/couchdb/blob/4b24def6/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 @@ - - - - - Replicator - - - - - - - - - - - - -
-

- Overview - Replicator -

-
- -
-
- Replicate changes from: -

- - - -

- - - -

-
-

-
- to: -

- - - -

- - - -

-
-

- - -

-
- - - - - - - - - - -
Replication History
Event
No replication
- -
-
- http://git-wip-us.apache.org/repos/asf/couchdb/blob/4b24def6/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 - * 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/4b24def6/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= 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/4b24def6/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(''); -}; - -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) { - $("
    ").appendTo($("td.details", row)); - } - $("
  1. Exception raised:
  2. ") - .find("code").text(JSON.stringify(e)).end() - .appendTo($("td.details ol", row)); - if (debug) { - currentRow = null; - throw e; - } - } - if ($("td.details ol", row).length) { - $("Run with debugger").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 = $("") - .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(); - $("").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(""+testsRun.length + " of " + tests.length + - " test(s) run, " + testsFailed.length + " failures (" + - totalDuration + " ms) "); -} - -// 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) { - $("
      ").appendTo($("td.details", currentRow)); - } - var message = (arg2 != null ? arg2 : arg1).toString(); - $("
    1. Assertion " + (testName ? "'" + testName + "'" : "") + " failed:
    2. ") - .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/4b24def6/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 -