You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by de...@apache.org on 2013/10/04 22:42:47 UTC
git commit: updated refs/heads/API-url-docs to ccaa657
Updated Branches:
refs/heads/API-url-docs [created] ccaa657a9
api url docs fix
Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/ccaa657a
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/ccaa657a
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/ccaa657a
Branch: refs/heads/API-url-docs
Commit: ccaa657a94396bea50cee987ea5d4d4760f9e44d
Parents: fba51db
Author: suelockwood <de...@gmail.com>
Authored: Fri Oct 4 12:20:38 2013 -0400
Committer: suelockwood <de...@gmail.com>
Committed: Fri Oct 4 16:42:35 2013 -0400
----------------------------------------------------------------------
src/fauxton/app/addons/activetasks/routes.js | 2 +-
src/fauxton/app/addons/logs/routes.js | 2 +-
src/fauxton/app/addons/replication/route.js | 2 +-
src/fauxton/app/api.js | 5 ++++-
src/fauxton/app/helpers.js | 6 ++++--
src/fauxton/app/modules/databases/routes.js | 2 +-
src/fauxton/app/modules/documents/routes.js | 8 ++++----
src/fauxton/app/modules/fauxton/base.js | 12 ++++++++++--
src/fauxton/app/templates/fauxton/api_bar.html | 4 ++--
9 files changed, 28 insertions(+), 15 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/couchdb/blob/ccaa657a/src/fauxton/app/addons/activetasks/routes.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/activetasks/routes.js b/src/fauxton/app/addons/activetasks/routes.js
index 03ece47..068fa3a 100644
--- a/src/fauxton/app/addons/activetasks/routes.js
+++ b/src/fauxton/app/addons/activetasks/routes.js
@@ -30,7 +30,7 @@ function (app, FauxtonAPI, Activetasks, Views) {
{"name": "Active tasks", "link": "activetasks"}
],
apiUrl: function(){
- return app.host+"/_active_tasks";
+ return [app.host+"/_active_tasks", "docs"];
},
roles: ["_admin"],
http://git-wip-us.apache.org/repos/asf/couchdb/blob/ccaa657a/src/fauxton/app/addons/logs/routes.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/logs/routes.js b/src/fauxton/app/addons/logs/routes.js
index 7c498b0..bc4de9a 100644
--- a/src/fauxton/app/addons/logs/routes.js
+++ b/src/fauxton/app/addons/logs/routes.js
@@ -37,7 +37,7 @@ function(app, FauxtonAPI, Log) {
roles: ["_admin"],
apiUrl: function() {
- return this.logs.url();
+ return [this.logs.url(), "logs"];
},
initialize: function () {
http://git-wip-us.apache.org/repos/asf/couchdb/blob/ccaa657a/src/fauxton/app/addons/replication/route.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/replication/route.js b/src/fauxton/app/addons/replication/route.js
index 7ea318c..be850e9 100644
--- a/src/fauxton/app/addons/replication/route.js
+++ b/src/fauxton/app/addons/replication/route.js
@@ -26,7 +26,7 @@ function(app, FauxtonAPI, Replication, Views) {
},
selectedHeader: "Replication",
apiUrl: function() {
- return app.host+"/_replication";
+ return [app.host+"/_replicate", "replication_doc"];
},
crumbs: [
{"name": "Replicate changes from: ", "link": "replication"}
http://git-wip-us.apache.org/repos/asf/couchdb/blob/ccaa657a/src/fauxton/app/api.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/api.js b/src/fauxton/app/api.js
index 9c2b523..d1dc268 100644
--- a/src/fauxton/app/api.js
+++ b/src/fauxton/app/api.js
@@ -363,7 +363,10 @@ function(app, Fauxton) {
});
});
- if (this.get('apiUrl')) masterLayout.apiBar.update(this.get('apiUrl'));
+ if (this.get('apiUrl')){
+ console.log(this.get('apiUrl'), "API URL");
+ masterLayout.apiBar.update(this.get('apiUrl'));
+ }
// Track that we've done a full initial render
this.renderedState = true;
http://git-wip-us.apache.org/repos/asf/couchdb/blob/ccaa657a/src/fauxton/app/helpers.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/helpers.js b/src/fauxton/app/helpers.js
index a8e0698..e72422d 100644
--- a/src/fauxton/app/helpers.js
+++ b/src/fauxton/app/helpers.js
@@ -45,8 +45,10 @@ function() {
"database_permission": "http://docs.couchdb.org/en/latest/api/database/security.html#db-security"
};
- Helpers.getDocUrl = function(doc){
- return Helpers.docs[doc] || '#';
+ Helpers.getDocUrl = function(getthis){
+ console.log(getthis, "oh hai", Helpers.docs, "docs");
+ console.log(Helpers.docs[getthis], "inside helpers");
+ return Helpers.docs[getthis] || '#';
};
// File size pretty printing, taken from futon.format.js
http://git-wip-us.apache.org/repos/asf/couchdb/blob/ccaa657a/src/fauxton/app/modules/databases/routes.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/modules/databases/routes.js b/src/fauxton/app/modules/databases/routes.js
index 1977264..88c52c8 100644
--- a/src/fauxton/app/modules/databases/routes.js
+++ b/src/fauxton/app/modules/databases/routes.js
@@ -37,7 +37,7 @@ function(app, FauxtonAPI, Databases, Views) {
},
apiUrl: function() {
- return this.databases.url();
+ return [this.databases.url(), "docs"];
},
selectedHeader: "Databases",
http://git-wip-us.apache.org/repos/asf/couchdb/blob/ccaa657a/src/fauxton/app/modules/documents/routes.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/modules/documents/routes.js b/src/fauxton/app/modules/documents/routes.js
index 7a75740..4eb5bcf 100644
--- a/src/fauxton/app/modules/documents/routes.js
+++ b/src/fauxton/app/modules/documents/routes.js
@@ -111,7 +111,7 @@ function(app, FauxtonAPI, Documents, Databases) {
},
apiUrl: function() {
- return this.doc.url();
+ return [this.doc.url(), "docs"];
}
});
@@ -219,7 +219,7 @@ function(app, FauxtonAPI, Documents, Databases) {
{"name": this.data.database.id, "link": Databases.databaseUrl(this.data.database)}
];
- this.apiUrl = this.data.database.allDocs.url();
+ this.apiUrl = [this.data.database.allDocs.url(), "docs"];
},
viewFn: function (databaseName, ddoc, view) {
@@ -270,7 +270,7 @@ function(app, FauxtonAPI, Documents, Databases) {
];
};
- this.apiUrl = this.data.indexedDocs.url();
+ this.apiUrl = [this.data.indexedDocs.url(), "docs"];
},
newViewEditor: function () {
@@ -388,7 +388,7 @@ function(app, FauxtonAPI, Documents, Databases) {
},
apiUrl: function() {
- return this.database.changes.url();
+ return [this.database.changes.url(), "docs"];
}
});
http://git-wip-us.apache.org/repos/asf/couchdb/blob/ccaa657a/src/fauxton/app/modules/fauxton/base.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/modules/fauxton/base.js b/src/fauxton/app/modules/fauxton/base.js
index a4b3a5e..f76a7f6 100644
--- a/src/fauxton/app/modules/fauxton/base.js
+++ b/src/fauxton/app/modules/fauxton/base.js
@@ -190,6 +190,8 @@ function(app, Backbone, resizeColumns) {
template: "templates/fauxton/api_bar",
endpoint: '_all_docs',
+ docs: 'docs',
+
events: {
"click .api-url-btn" : "toggleAPIbar"
},
@@ -207,14 +209,20 @@ function(app, Backbone, resizeColumns) {
},
serialize: function() {
- return {endpoint: this.endpoint};
+ return {
+ endpoint: this.endpoint,
+ docname: this.docs
+ };
},
update: function(endpoint) {
+ console.log(endpoint);
// Take endpoint and write it into the api bar.
console.log('ApiBar endpoint: ' + endpoint);
- this.endpoint = endpoint;
+ this.endpoint = endpoint[0];
+ this.docs = endpoint[1];
this.render();
+ console.log(this.docs, "docs");
}
});
http://git-wip-us.apache.org/repos/asf/couchdb/blob/ccaa657a/src/fauxton/app/templates/fauxton/api_bar.html
----------------------------------------------------------------------
diff --git a/src/fauxton/app/templates/fauxton/api_bar.html b/src/fauxton/app/templates/fauxton/api_bar.html
index cbed3d5..bc6dee1 100644
--- a/src/fauxton/app/templates/fauxton/api_bar.html
+++ b/src/fauxton/app/templates/fauxton/api_bar.html
@@ -19,8 +19,8 @@ the License.
<div class="api-navbar" style="display: none">
<div class="input-prepend input-append">
<span class="add-on">
- API reference
- <a href="<%=getDocUrl('api_reference')%>" target="_blank">
+ API reference sjlhjlhdsfhjksdfhjkdshjkfdshkfsdkhjdjskh <%=docs%>
+ <a href="<%=getDocUrl('replication_doc')%>" target="_blank">
<i class="icon-question-sign"></i>
</a>
</span>