couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject [01/14] couchdb commit: updated refs/heads/1.6.x to 6529f77
Date Fri, 11 Apr 2014 19:14:59 GMT
Repository: couchdb
Updated Branches:
  refs/heads/1.6.x 79035f8db -> 6529f7779


Update template helpers with utils methods for encoding and removing special characters


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

Branch: refs/heads/1.6.x
Commit: 50382cadc00b292ae74d0e976b88dbc3b0392871
Parents: 027ffa4
Author: suelockwood <deathbear@apache.org>
Authored: Tue Apr 1 13:40:35 2014 -0400
Committer: suelockwood <deathbear@apache.org>
Committed: Tue Apr 1 13:40:43 2014 -0400

----------------------------------------------------------------------
 src/fauxton/app/helpers.js | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/50382cad/src/fauxton/app/helpers.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/helpers.js b/src/fauxton/app/helpers.js
index d4836b9..a58cc20 100644
--- a/src/fauxton/app/helpers.js
+++ b/src/fauxton/app/helpers.js
@@ -12,20 +12,25 @@
 
 
 // This file creates a set of helper functions that will be loaded for all html
-// templates. These functions should be self contained and not rely on any 
+// templates. These functions should be self contained and not rely on any
 // external dependencies as they are loaded prior to the application. We may
 // want to change this later, but for now this should be thought of as a
 // "purely functional" helper system.
 
 
 define([
+  "core/utils",
   "d3"
 ],
 
-function() {
+function(utils) {
 
   var Helpers = {};
 
+  Helpers.removeSpecialCharacters = utils.removeSpecialCharacters;
+
+  Helpers.safeURL = utils.safeURLName;
+
   Helpers.imageUrl = function(path) {
     // TODO: add dynamic path for different deploy targets
     return path;
@@ -33,7 +38,7 @@ function() {
 
 
   // Get the URL for documentation, wiki, wherever we store it.
-  // update the URLs in documentation_urls.js 
+  // update the URLs in documentation_urls.js
   Helpers.docs =  {
     "docs": "http://docs.couchdb.org/en/latest/intro/api.html#documents",
     "all_dbs": "http://docs.couchdb.org/en/latest/api/server/common.html?highlight=all_dbs#get--_all_dbs",
@@ -50,8 +55,8 @@ function() {
     "config": "http://docs.couchdb.org/en/latest/config/index.html",
     "views": "http://docs.couchdb.org/en/latest/intro/overview.html#views",
     "changes": "http://docs.couchdb.org/en/latest/api/database/changes.html?highlight=changes#post--db-_changes"
-  }; 
-  
+  };
+
   Helpers.getDocUrl = function(docKey){
     return Helpers.docs[docKey] || '#';
   };
@@ -70,7 +75,7 @@ function() {
     };
 
   Helpers.formatDate = function(timestamp){
-    format = d3.time.format("%b. %e at %H:%M%p"); 
+    format = d3.time.format("%b. %e at %H:%M%p");
     return format(new Date(timestamp*1000));
   };
 


Mime
View raw message