couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From robertkowal...@apache.org
Subject [1/5] fauxton commit: updated refs/heads/master to d138e01
Date Fri, 28 Aug 2015 16:59:26 GMT
Repository: couchdb-fauxton
Updated Branches:
  refs/heads/master 825bbfc42 -> d138e0197


fix url for resources

PR: #504
PR-URL: https://github.com/apache/couchdb-fauxton/pull/504
Reviewed-By: Benjamin Keen <ben.keen@gmail.com>


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

Branch: refs/heads/master
Commit: 2ed6be403c40fe2cfd7bfb56b3232c525c6fea27
Parents: 825bbfc
Author: Robert Kowalski <robertkowalski@apache.org>
Authored: Wed Aug 26 16:04:55 2015 +0200
Committer: Robert Kowalski <robertkowalski@apache.org>
Committed: Fri Aug 28 18:59:09 2015 +0200

----------------------------------------------------------------------
 app/addons/documents/resources.js           | 8 ++++++--
 app/addons/documents/routes-index-editor.js | 2 +-
 app/addons/documents/tests/resourcesSpec.js | 3 +--
 3 files changed, 8 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/2ed6be40/app/addons/documents/resources.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/resources.js b/app/addons/documents/resources.js
index 7857231..c6cbb29 100644
--- a/app/addons/documents/resources.js
+++ b/app/addons/documents/resources.js
@@ -458,7 +458,7 @@ function (app, FauxtonAPI, Documents, PagingCollection) {
       return !this.params.reduce;
     },
 
-    urlRef: function (params) {
+    urlRef: function (context, params) {
       var query = "";
 
       if (params) {
@@ -472,10 +472,14 @@ function (app, FauxtonAPI, Documents, PagingCollection) {
         query = "?" + $.param(parsedParam);
       }
 
+      if (!context) {
+        context = 'server';
+      }
+
       var database = this.database.safeID(),
           design = app.utils.safeURLName(this.design),
           view = app.utils.safeURLName(this.view),
-          url = FauxtonAPI.urls('view', 'apiurl', database, design, view);
+          url = FauxtonAPI.urls('view', context, database, design, view);
 
       return url + query;
     },

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/2ed6be40/app/addons/documents/routes-index-editor.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/routes-index-editor.js b/app/addons/documents/routes-index-editor.js
index ad04b44..450c4c1 100644
--- a/app/addons/documents/routes-index-editor.js
+++ b/app/addons/documents/routes-index-editor.js
@@ -111,7 +111,7 @@ function (app, FauxtonAPI, Helpers, BaseRoute, Documents, IndexEditorComponents,
       this.setComponent('#dashboard-lower-content', IndexResultsComponents.List);
 
       this.apiUrl = function () {
-        return [this.indexedDocs.urlRef(urlParams), FauxtonAPI.constants.DOC_URLS.GENERAL];
+        return [this.indexedDocs.urlRef('apiurl'), FauxtonAPI.constants.DOC_URLS.GENERAL];
       };
 
       this.showQueryOptions(urlParams, ddoc, viewName);

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/2ed6be40/app/addons/documents/tests/resourcesSpec.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/tests/resourcesSpec.js b/app/addons/documents/tests/resourcesSpec.js
index 9e246c2..e751266 100644
--- a/app/addons/documents/tests/resourcesSpec.js
+++ b/app/addons/documents/tests/resourcesSpec.js
@@ -36,8 +36,7 @@ define([
     });
 
     it('creates the right api-url with an absolute url', function () {
-
-      assert.ok(/file:/.test(collection.urlRef()));
+      assert.ok(/file:/.test(collection.urlRef('apiurl')));
     });
 
   });


Mime
View raw message