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/1889-centralized-documentation to 1b4736b
Date Tue, 17 Sep 2013 14:58:45 GMT
Updated Branches:
  refs/heads/1889-centralized-documentation [created] 1b4736b0f


Moved the documentation urls into helpers.js so we can update them without having to edit
templates.


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

Branch: refs/heads/1889-centralized-documentation
Commit: 1b4736b0fbde8495bdb144ead0e3f18548429616
Parents: 8a33322
Author: suelockwood <deathbearbrown@gmail.com>
Authored: Tue Sep 17 10:58:33 2013 -0400
Committer: suelockwood <deathbearbrown@gmail.com>
Committed: Tue Sep 17 10:58:33 2013 -0400

----------------------------------------------------------------------
 .../app/addons/replication/templates/form.html      |  2 +-
 src/fauxton/app/helpers.js                          | 16 ++++++++++++++++
 .../app/templates/documents/view_editor.html        |  8 ++++----
 src/fauxton/app/templates/fauxton/api_bar.html      |  2 +-
 src/fauxton/app/templates/fauxton/nav_bar.html      |  2 +-
 src/fauxton/assets/less/fauxton.less                |  5 -----
 6 files changed, 23 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/1b4736b0/src/fauxton/app/addons/replication/templates/form.html
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/replication/templates/form.html b/src/fauxton/app/addons/replication/templates/form.html
index ad8c9b2..32a87dc 100644
--- a/src/fauxton/app/addons/replication/templates/form.html
+++ b/src/fauxton/app/addons/replication/templates/form.html
@@ -63,7 +63,7 @@ the License.
 
 			<label for="createTarget">
 				<input type="checkbox" name="create_target" value="true" id="createTarget">
-				Create Target <a href="http://docs.couchdb.org/en/latest/json-structure.html?highlight=replication#replication-settings"><i
class="icon-question-sign" rel="tooltip" title="Create the target database"></i></a>
+				Create Target <a href="<%=getDocUrl('replication_doc')%>" target="_blank"><i
class="icon-question-sign" rel="tooltip" title="Create the target database"></i></a>
 			</label>
 		</div>
 

http://git-wip-us.apache.org/repos/asf/couchdb/blob/1b4736b0/src/fauxton/app/helpers.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/helpers.js b/src/fauxton/app/helpers.js
index 6408afc..27711c7 100644
--- a/src/fauxton/app/helpers.js
+++ b/src/fauxton/app/helpers.js
@@ -31,6 +31,22 @@ function() {
     return path;
   };
 
+
+  // Get the URL for documentation, wiki, wherever we store it.
+  // update the URLs in documentation_urls.js  
+  Helpers.getDocUrl = function(doc){
+    var docs =  {
+      "docs": "http://docs.couchdb.org/en/latest/index.html",
+      "replication_doc": "http://docs.couchdb.org/en/latest/replicator.html#basics",
+      "design_doc": "http://docs.couchdb.org/en/latest/ddocs.html#design-docs",
+      "view_functions": "http://docs.couchdb.org/en/latest/ddocs.html#view-functions",
+      "map_functions": "http://docs.couchdb.org/en/latest/ddocs.html#map-functions",
+      "reduce_functions": "http://docs.couchdb.org/en/latest/ddocs.html#reduce-and-rereduce-functions",
+      "api_reference": "http://docs.couchdb.org/en/latest/api-basics.html?highlight=api"
+    };
+    return docs[doc] || '#';
+  };
+
   // File size pretty printing, taken from futon.format.js
   Helpers.formatSize = function(size) {
       var jump = 512;

http://git-wip-us.apache.org/repos/asf/couchdb/blob/1b4736b0/src/fauxton/app/templates/documents/view_editor.html
----------------------------------------------------------------------
diff --git a/src/fauxton/app/templates/documents/view_editor.html b/src/fauxton/app/templates/documents/view_editor.html
index e04caa4..83f0ad7 100644
--- a/src/fauxton/app/templates/documents/view_editor.html
+++ b/src/fauxton/app/templates/documents/view_editor.html
@@ -25,7 +25,7 @@ the License.
         <form class="form-horizontal view-query-save">
 
           <div class="control-group">
-            <label for="ddoc">Design document <a target="_couch_docs" href="http://docs.couchdb.org/en/latest/ddocs/#design-docs"><i
class="icon-question-sign"></i></a></label>
+            <label for="ddoc">Design document <a href="<%=getDocUrl('design_doc')%>"
target="_blank"><i class="icon-question-sign"></i></a></label>
               <select id="ddoc">
                 <optgroup label="Select a document">
                   <option id="new-doc">New document</option>
@@ -47,13 +47,13 @@ the License.
           </div>
 
           <div class="control-group">
-            <label for="index-name">Index name <a target="_couch_docs" href="http://docs.couchdb.org/en/latest/ddocs/#view-functions"><i
class="icon-question-sign"></i></a></label>
+            <label for="index-name">Index name <a href="<%=getDocUrl('view_functions')%>"
target="_blank"><i class="icon-question-sign"></i></a></label>
             <input type="text" id="index-name" value="<%= viewName %>" placeholder="Index
name" />
           </div>
 
 
           <div class="control-group">
-            <label for="map-function">Map function <a target="_couch_docs" href="http://docs.couchdb.org/en/latest/ddocs/#map-functions"><i
class="icon-question-sign"></i></a></label>
+            <label for="map-function">Map function <a href="<%=getDocUrl('map_functions')%>"
target="_blank"><i class="icon-question-sign"></i></a></label>
               <% if (newView) { %>
               <textarea class="js-editor" id="map-function"><%= langTemplates.map
%></textarea>
               <% } else { %>
@@ -63,7 +63,7 @@ the License.
 
 
           <div class="control-group">
-            <label for="reduce-function-selector">Reduce function <a target="_couch_docs"
href="http://docs.couchdb.org/en/latest/ddocs.html#reduce-and-rereduce-functions"><i
class="icon-question-sign"></i></a></label>
+            <label for="reduce-function-selector">Reduce function <a href="<%=getDocUrl('reduce_functions')%>"
target="_blank"><i class="icon-question-sign"></i></a></label>
 
               <select id="reduce-function-selector">
                 <option value="" <%= !reduceFunStr ? 'selected="selected"' : '' %>>None</option>

http://git-wip-us.apache.org/repos/asf/couchdb/blob/1b4736b0/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 42d20ce..a1a31a6 100644
--- a/src/fauxton/app/templates/fauxton/api_bar.html
+++ b/src/fauxton/app/templates/fauxton/api_bar.html
@@ -21,7 +21,7 @@ the License.
     <div class="input-prepend input-append">
       <span class="add-on">
         API reference
-        <a href="http://docs.couchdb.org/en/latest/" target="_blank">
+        <a href="<%=getDocUrl('api_reference')%>" target="_blank">
           <i class="icon-question-sign"></i>
         </a>
       </span>

http://git-wip-us.apache.org/repos/asf/couchdb/blob/1b4736b0/src/fauxton/app/templates/fauxton/nav_bar.html
----------------------------------------------------------------------
diff --git a/src/fauxton/app/templates/fauxton/nav_bar.html b/src/fauxton/app/templates/fauxton/nav_bar.html
index 64a0336..8c18f09 100644
--- a/src/fauxton/app/templates/fauxton/nav_bar.html
+++ b/src/fauxton/app/templates/fauxton/nav_bar.html
@@ -33,7 +33,7 @@ the License.
 
     <ul id="bottom-nav-links" class="nav">
         <li data-nav-name= "Documentation">
-            <a class="fonticon-bookmark fonticon" target="_blank" href="http://docs.couchdb.org/en/latest/">
+            <a class="fonticon-bookmark fonticon" href="<%=getDocUrl('docs')%>"
target="_blank">
                 Documentation
             </a>
         </li>

http://git-wip-us.apache.org/repos/asf/couchdb/blob/1b4736b0/src/fauxton/assets/less/fauxton.less
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/less/fauxton.less b/src/fauxton/assets/less/fauxton.less
index f19709c..e5f5142 100644
--- a/src/fauxton/assets/less/fauxton.less
+++ b/src/fauxton/assets/less/fauxton.less
@@ -537,11 +537,6 @@ footer#mainFooter{
   color: white;
 }
 
-.nav-tabs > .active > a, .nav-tabs > .active > a:hover, .nav-tabs > .active
> a:focus {
-  color: white;
-  background-color: @darkRed;
-  border: 1px solid @darkRed;
-}
 
 .tab-content {
   margin-top: 70px;


Mime
View raw message