couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kxe...@apache.org
Subject [07/50] jquery-couch commit: updated refs/heads/import-master to 66dbcbf
Date Tue, 01 Apr 2014 08:52:12 GMT
Allow Futon to run behind a HTTP proxy.

Depending no the Proxy's RFC 2616 compliance,
some tests might fail (looking at you, nginx).

Patch by Jack Moffit and Damjan Georgievski.

Closes COUCHDB-321.

git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@904705 13f79535-47bb-0310-9956-ffa450edef68


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

Branch: refs/heads/import-master
Commit: 41d19501e339cfceb16e3e58eb67970caeb526c9
Parents: dd34212
Author: Jan Lehnardt <jan@apache.org>
Authored: Sat Jan 30 01:22:36 2010 +0000
Committer: Alexander Shorin <kxepal@gmail.com>
Committed: Sat Jan 30 01:22:36 2010 +0000

----------------------------------------------------------------------
 jquery.couch.js | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-jquery-couch/blob/41d19501/jquery.couch.js
----------------------------------------------------------------------
diff --git a/jquery.couch.js b/jquery.couch.js
index 986c519..1925b3b 100644
--- a/jquery.couch.js
+++ b/jquery.couch.js
@@ -44,9 +44,10 @@
   uuidCache = [];
 
   $.extend($.couch, {
+    urlPrefix: '',
     activeTasks: function(options) {
       ajax(
-        {url: "/_active_tasks"},
+        {url: this.urlPrefix + "/_active_tasks"},
         options,
         "Active task status could not be retrieved"
       );
@@ -54,14 +55,14 @@
 
     allDbs: function(options) {
       ajax(
-        {url: "/_all_dbs"},
+        {url: this.urlPrefix + "/_all_dbs"},
         options,
         "An error occurred retrieving the list of all databases"
       );
     },
 
     config: function(options, section, option, value) {
-      var req = {url: "/_config/"};
+      var req = {url: this.urlPrefix + "/_config/"};
       if (section) {
         req.url += encodeURIComponent(section) + "/";
         if (option) {
@@ -85,7 +86,7 @@
     session: function(options) {
       options = options || {};
       $.ajax({
-        type: "GET", url: "/_session",
+        type: "GET", url: this.urlPrefix + "/_session",
         complete: function(req) {
           var resp = $.httpData(req, "json");
           if (req.status == 200) {
@@ -120,7 +121,7 @@
     login: function(options) {
       options = options || {};
       $.ajax({
-        type: "POST", url: "/_session", dataType: "json",
+        type: "POST", url: this.urlPrefix + "/_session", dataType: "json",
         data: {name: options.name, password: options.password},
         complete: function(req) {
           var resp = $.httpData(req, "json");
@@ -137,7 +138,7 @@
     logout: function(options) {
       options = options || {};
       $.ajax({
-        type: "DELETE", url: "/_session", dataType: "json",
+        type: "DELETE", url: this.urlPrefix + "/_session", dataType: "json",
         username : "_", password : "_",
         complete: function(req) {
           var resp = $.httpData(req, "json");
@@ -155,7 +156,7 @@
     db: function(name) {
       return {
         name: name,
-        uri: "/" + encodeURIComponent(name) + "/",
+        uri: this.urlPrefix + "/" + encodeURIComponent(name) + "/",
 
         compact: function(options) {
           $.extend(options, {successStatus: 202});
@@ -377,7 +378,7 @@
 
     info: function(options) {
       ajax(
-        {url: "/"},
+        {url: this.urlPrefix + "/"},
         options,
         "Server information could not be retrieved"
       );
@@ -385,7 +386,7 @@
 
     replicate: function(source, target, options) {
       ajax({
-          type: "POST", url: "/_replicate",
+          type: "POST", url: this.urlPrefix + "/_replicate",
           data: JSON.stringify({source: source, target: target}),
           contentType: "application/json"
         },
@@ -399,7 +400,7 @@
         cacheNum = 1;
       }
       if (!uuidCache.length) {
-        ajax({url: "/_uuids", data: {count: cacheNum}, async: false}, {
+        ajax({url: this.urlPrefix + "/_uuids", data: {count: cacheNum}, async: false}, {
             success: function(resp) {
               uuidCache = resp.uuids
             }


Mime
View raw message