couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From deathb...@apache.org
Subject git commit: updated refs/heads/ENCODE-EVERYTHING to 01258aa
Date Fri, 20 Dec 2013 22:25:19 GMT
Updated Branches:
  refs/heads/ENCODE-EVERYTHING b9ed5ed7a -> 01258aa0c


More encoding for Ddocs


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

Branch: refs/heads/ENCODE-EVERYTHING
Commit: 01258aa0cccb70e1914bd36f0066d290c1aa1d39
Parents: b9ed5ed
Author: suelockwood <deathbear@apache.org>
Authored: Fri Dec 20 17:18:33 2013 -0500
Committer: suelockwood <deathbear@apache.org>
Committed: Fri Dec 20 17:18:33 2013 -0500

----------------------------------------------------------------------
 src/fauxton/app/modules/documents/resources.js         | 8 +++++++-
 src/fauxton/app/modules/documents/views.js             | 5 +++--
 src/fauxton/app/templates/documents/all_docs_item.html | 2 +-
 3 files changed, 11 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/01258aa0/src/fauxton/app/modules/documents/resources.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/modules/documents/resources.js b/src/fauxton/app/modules/documents/resources.js
index a171cae..8e97f95 100644
--- a/src/fauxton/app/modules/documents/resources.js
+++ b/src/fauxton/app/modules/documents/resources.js
@@ -26,6 +26,8 @@ function(app, FauxtonAPI) {
     url: function(context) {
       if (context === "app") {
         return this.getDatabase().url("app") + "/" + this.safeID();
+      } else if (context === "web-index") {
+        return this.getDatabase().url("app") + "/" + app.mixins.safeURLName(this.id);
       } else {
         return app.host + "/" + this.getDatabase().safeID() + "/" + this.safeID();
       }
@@ -139,7 +141,11 @@ function(app, FauxtonAPI) {
     // treated separately. For instance, we could default into the
     // json editor for docs, or into a ddoc specific page.
     safeID: function() {
-      return app.mixins.safeURLName(this.id);
+      if (this.isDdoc()){
+        return this.id;
+      }else{
+        return app.mixins.safeURLName(this.id);
+      }
     },
 
     destroy: function() {

http://git-wip-us.apache.org/repos/asf/couchdb/blob/01258aa0/src/fauxton/app/modules/documents/views.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/modules/documents/views.js b/src/fauxton/app/modules/documents/views.js
index 94fe699..e7c67d1 100644
--- a/src/fauxton/app/modules/documents/views.js
+++ b/src/fauxton/app/modules/documents/views.js
@@ -238,10 +238,11 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb,
resizeColum
 
     duplicate: function (event) {
       event.preventDefault();
-      var newId = this.$('#dup-id').val();
+      var newId = this.$('#dup-id').val(),
+          encodedID = app.mixins.safeURLName(newID);
 
       this.hideModal();
-      FauxtonAPI.triggerRouteEvent('duplicateDoc', newId);
+      FauxtonAPI.triggerRouteEvent('duplicateDoc', encodedID);
     },
 
     _showModal: function () {

http://git-wip-us.apache.org/repos/asf/couchdb/blob/01258aa0/src/fauxton/app/templates/documents/all_docs_item.html
----------------------------------------------------------------------
diff --git a/src/fauxton/app/templates/documents/all_docs_item.html b/src/fauxton/app/templates/documents/all_docs_item.html
index c0e61cf..bfedaaa 100644
--- a/src/fauxton/app/templates/documents/all_docs_item.html
+++ b/src/fauxton/app/templates/documents/all_docs_item.html
@@ -18,7 +18,7 @@ the License.
     <pre class="prettyprint"><%- doc.prettyJSON() %></pre>
     <% if (doc.isEditable()) { %>
       <div class="btn-group">
-        <a href="#<%= doc.url('app') %>" class="btn btn-small edits">Edit <%=
doc.docType() %></a>
+        <a href="#<%= doc.url('web-index') %>" class="btn btn-small edits">Edit
<%= doc.docType() %></a>
         <button href="#" class="btn btn-small btn-danger delete" title="Delete this document."><i
class="icon icon-trash"></i></button>
       </div>
     <% } %>


Mime
View raw message