couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From benk...@apache.org
Subject fauxton commit: updated refs/heads/master to b51fec6
Date Tue, 10 Mar 2015 21:34:14 GMT
Repository: couchdb-fauxton
Updated Branches:
  refs/heads/master 276451138 -> b51fec6d3


Add extension support for doc list and editor

This adds the option to allow extensions to add icons on the
documents list and on the full page code editor page.


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

Branch: refs/heads/master
Commit: b51fec6d360beef6ad66e0f6e1a79433059bab8c
Parents: 2764511
Author: Ben Keen <ben.keen@gmail.com>
Authored: Mon Mar 9 13:16:22 2015 -0700
Committer: Ben Keen <ben.keen@gmail.com>
Committed: Tue Mar 10 14:35:14 2015 -0700

----------------------------------------------------------------------
 app/addons/documents/assets/less/documents.less   | 4 ++++
 app/addons/documents/templates/all_docs_item.html | 3 +++
 app/addons/documents/templates/code_editor.html   | 2 ++
 app/addons/documents/views-doceditor.js           | 5 +++++
 app/addons/documents/views.js                     | 7 +++++++
 5 files changed, 21 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/b51fec6d/app/addons/documents/assets/less/documents.less
----------------------------------------------------------------------
diff --git a/app/addons/documents/assets/less/documents.less b/app/addons/documents/assets/less/documents.less
index baae4d7..899e9e9 100644
--- a/app/addons/documents/assets/less/documents.less
+++ b/app/addons/documents/assets/less/documents.less
@@ -244,3 +244,7 @@ button.string-edit[disabled] {
 #react-headerbar {
   float: left;
 }
+
+.doc-editor-extension-icons {
+  display: inline-block;
+}

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/b51fec6d/app/addons/documents/templates/all_docs_item.html
----------------------------------------------------------------------
diff --git a/app/addons/documents/templates/all_docs_item.html b/app/addons/documents/templates/all_docs_item.html
index 74e944a..f8151b8 100644
--- a/app/addons/documents/templates/all_docs_item.html
+++ b/app/addons/documents/templates/all_docs_item.html
@@ -32,6 +32,9 @@ the License.
         </a>
       </div>
     <% } %>
+
+    <div class="doc-item-extension-icons pull-right"></div>
+
   </header>
   <div class="doc-data">
     <pre class="prettyprint"><%- doc.prettyJSON() %></pre>

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/b51fec6d/app/addons/documents/templates/code_editor.html
----------------------------------------------------------------------
diff --git a/app/addons/documents/templates/code_editor.html b/app/addons/documents/templates/code_editor.html
index c5fa517..f341df3 100644
--- a/app/addons/documents/templates/code_editor.html
+++ b/app/addons/documents/templates/code_editor.html
@@ -44,6 +44,8 @@ the License.
     </div>
     <% } %>
 
+    <div class="doc-editor-extension-icons"></div>
+
     <div class="panel-section">
       <button class="panel-button upload" title="Upload attachment">
         <i class="icon icon-circle-arrow-up"></i>

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/b51fec6d/app/addons/documents/views-doceditor.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/views-doceditor.js b/app/addons/documents/views-doceditor.js
index a4b604f..396994d 100644
--- a/app/addons/documents/views-doceditor.js
+++ b/app/addons/documents/views-doceditor.js
@@ -342,6 +342,11 @@ function (app, FauxtonAPI, Components, Documents, Databases, prettify)
{
 
       // ensures it's initialized only once
       this.stringEditModal = this.stringEditModal || this.setView('#string-edit-modal', new
Views.StringEditModal());
+
+      var extensions = FauxtonAPI.getExtensions('DocEditor:icons');
+      _.each(extensions, function (View) {
+        this.insertView('.doc-editor-extension-icons', new View({ doc: this.model }));
+      }, this);
     },
 
     updateValues: function () {

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/b51fec6d/app/addons/documents/views.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/views.js b/app/addons/documents/views.js
index c36d04f..f4f466e 100644
--- a/app/addons/documents/views.js
+++ b/app/addons/documents/views.js
@@ -250,6 +250,13 @@ function (app, FauxtonAPI, Components, Documents,
       };
     },
 
+    beforeRender: function () {
+      var extensions = FauxtonAPI.getExtensions('DocList:icons');
+      _.each(extensions, function (View) {
+        this.insertView('.doc-item-extension-icons', new View({ doc: this.model }));
+      }, this);
+    },
+
     establish: function() {
       return [this.model.fetch()];
     },


Mime
View raw message