couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From robertkowal...@apache.org
Subject fauxton commit: updated refs/heads/master to bbebeb7
Date Tue, 03 Mar 2015 09:01:21 GMT
Repository: couchdb-fauxton
Updated Branches:
  refs/heads/master a85eb42a1 -> bbebeb7e0


fix broken api-url link

also removes unused parameter from function, the only usage of
`indexedDocs.urlRef` is in `routes-index-editor.js`


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

Branch: refs/heads/master
Commit: bbebeb7e0538588934ff82ac5bb8814c3b50c4b3
Parents: a85eb42
Author: Robert Kowalski <robertkowalski@apache.org>
Authored: Mon Mar 2 18:09:28 2015 +0100
Committer: Robert Kowalski <robertkowalski@apache.org>
Committed: Mon Mar 2 18:11:08 2015 +0100

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


http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/bbebeb7e/app/addons/documents/resources.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/resources.js b/app/addons/documents/resources.js
index 5867038..a8fb3d3 100644
--- a/app/addons/documents/resources.js
+++ b/app/addons/documents/resources.js
@@ -194,7 +194,7 @@ function(app, FauxtonAPI, Documents, PagingCollection) {
       }
     },
 
-    urlRef: function(context, params) {
+    urlRef: function (params) {
       var query = "";
 
       if (params) {
@@ -208,17 +208,10 @@ function(app, FauxtonAPI, Documents, PagingCollection) {
         query = "?" + $.param(parsedParam);
       }
 
-      var startOfUrl = app.host;
-      if (context === 'app') {
-        startOfUrl = 'database';
-      } else if (context === "apiurl"){
-        startOfUrl = window.location.origin;
-      }
-
       var database = this.database.safeID(),
           design = app.utils.safeURLName(this.design),
           view = app.utils.safeURLName(this.view),
-          url = FauxtonAPI.urls('view', 'server', database, design, view);
+          url = FauxtonAPI.urls('view', 'apiurl', database, design, view);
 
       return url + query;
     },

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/bbebeb7e/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 fd2660c..5855e1e 100644
--- a/app/addons/documents/routes-index-editor.js
+++ b/app/addons/documents/routes-index-editor.js
@@ -113,7 +113,7 @@ function (app, FauxtonAPI, Helpers, BaseRoute, Documents, Index, Databases,
Comp
       });
 
       this.apiUrl = function () {
-        return [this.indexedDocs.urlRef('apiurl', urlParams), FauxtonAPI.constants.DOC_URLS.GENERAL];
+        return [this.indexedDocs.urlRef(urlParams), FauxtonAPI.constants.DOC_URLS.GENERAL];
       };
 
       this.showQueryOptions(urlParams, ddoc, viewName);

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/bbebeb7e/app/addons/documents/tests/resourcesSpec.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/tests/resourcesSpec.js b/app/addons/documents/tests/resourcesSpec.js
index 1e3a612..5f87fd3 100644
--- a/app/addons/documents/tests/resourcesSpec.js
+++ b/app/addons/documents/tests/resourcesSpec.js
@@ -29,7 +29,11 @@ define([
         database: {id: 'databaseId', safeID: function () { return this.id; }},
         design: '_design/myDoc'
       });
+    });
+
+    it('does not remove an id attribute', function () {
 
+      assert.ok(/file:/.test(collection.urlRef('')));
     });
 
   });


Mime
View raw message