couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From benk...@apache.org
Subject [2/2] fauxton commit: updated refs/heads/master to aae7b7c
Date Thu, 22 Jan 2015 03:53:48 GMT
Code cleanup: whitespace, styles


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

Branch: refs/heads/master
Commit: aae7b7c72bda945c81bfd234c17bdea53bc3bf3e
Parents: d8d5df7
Author: Benjamin Keen <ben.keen@gmail.com>
Authored: Fri Jan 16 14:15:39 2015 -0800
Committer: Ben Keen <ben.keen@gmail.com>
Committed: Wed Jan 21 18:33:00 2015 -0800

----------------------------------------------------------------------
 app/addons/permissions/base.js                |  6 ++--
 app/addons/permissions/resources.js           | 18 +++-------
 app/addons/permissions/templates/item.html    |  4 +--
 app/addons/permissions/templates/section.html | 18 +++++-----
 app/addons/permissions/views.js               | 40 ++++++++++------------
 5 files changed, 38 insertions(+), 48 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/aae7b7c7/app/addons/permissions/base.js
----------------------------------------------------------------------
diff --git a/app/addons/permissions/base.js b/app/addons/permissions/base.js
index 016ba1c..6c071c6 100644
--- a/app/addons/permissions/base.js
+++ b/app/addons/permissions/base.js
@@ -11,9 +11,9 @@
 // the License.
 
 define([
-       "app",
-       "api",
-       "addons/permissions/routes"
+  'app',
+  'api',
+  'addons/permissions/routes'
 ],
 
 function(app, FauxtonAPI, Permissions) {

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/aae7b7c7/app/addons/permissions/resources.js
----------------------------------------------------------------------
diff --git a/app/addons/permissions/resources.js b/app/addons/permissions/resources.js
index 4ddd3ae..604d595 100644
--- a/app/addons/permissions/resources.js
+++ b/app/addons/permissions/resources.js
@@ -11,23 +11,16 @@
 // the License.
 
 define([
-       "app",
-       "api"
+  'app',
+  'api'
 ],
 function (app, FauxtonAPI ) {
   var Permissions = FauxtonAPI.addon();
 
   Permissions.Security = Backbone.Model.extend({
     defaults: {
-      admins: {
-        names: [],
-        roles: []
-      },
-
-      members: {
-        names: [],
-        roles: []
-      }
+      admins:  { names: [], roles: [] },
+      members: { names: [], roles: [] }
     },
 
     isNew: function () {
@@ -39,7 +32,7 @@ function (app, FauxtonAPI ) {
     },
 
     url: function () {
-      return window.location.origin +"/"+ this.database.safeID() + '/_security';
+      return window.location.origin + '/' + this.database.safeID() + '/_security';
     },
 
     addItem: function (value, type, section) {
@@ -62,7 +55,6 @@ function (app, FauxtonAPI ) {
       sectionValues[type].push(value);
       return this.set(section, sectionValues);
     }
-
   });
 
   return Permissions;

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/aae7b7c7/app/addons/permissions/templates/item.html
----------------------------------------------------------------------
diff --git a/app/addons/permissions/templates/item.html b/app/addons/permissions/templates/item.html
index 4682dcb..fd65a87 100644
--- a/app/addons/permissions/templates/item.html
+++ b/app/addons/permissions/templates/item.html
@@ -1,4 +1,4 @@
-<!--
+<% /*
 Licensed under the Apache License, Version 2.0 (the "License"); you may not
 use this file except in compliance with the License. You may obtain a copy of
 the License at
@@ -10,7 +10,7 @@ distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 License for the specific language governing permissions and limitations under
 the License.
--->
+*/ %>
 
 <span> <%- item %> </span>
 <button type="button" class="pull-right close">&times;</button>

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/aae7b7c7/app/addons/permissions/templates/section.html
----------------------------------------------------------------------
diff --git a/app/addons/permissions/templates/section.html b/app/addons/permissions/templates/section.html
index 83c5398..1895140 100644
--- a/app/addons/permissions/templates/section.html
+++ b/app/addons/permissions/templates/section.html
@@ -11,36 +11,36 @@ WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 License for the specific language governing permissions and limitations under
 the License.
 */ %>
+
 <header class="page-header">
-<h3> <%- section %> </h3>
-<p class="help"> <%- help %> <a class="help-link" data-bypass="true" href="<%-getDocUrl('DB_PERMISSION')%>"
target="_blank"><i class="icon-question-sign"> </i> </a></p>
+  <h3><%- section %></h3>
+  <p class="help"><%- help %>
+    <a class="help-link" data-bypass="true" href="<%-getDocUrl('DB_PERMISSION')%>"
target="_blank"><i class="icon-question-sign"> </i> </a>
+  </p>
 </header>
 
 <div class="row-fluid">
   <div class="span6">
     <header>
-      <h4> Users </h4>
+      <h4>Users</h4>
       <p>Specify users who will have <%- section %> access to this database.</p>
     </header>
     <form class="permission-item-form form-inline">
       <input data-section="<%- section %>" data-type="names" type="text" class="item
input-small" placeholder="Add Name">
       <button type="submit" class="btn btn-success"><i class="icon fonticon-plus-circled"></i>
Add Name</button>
     </form>
-    <ul class="clearfix unstyled permission-items span10" id="<%- section %>-items-names">
-    </ul>
+    <ul class="clearfix unstyled permission-items span10" id="<%- section %>-items-names"></ul>
   </div>
   <div class="span6">
     <header>
-      <h4> Roles </h4>
+      <h4>Roles</h4>
       <p>All users under the following role(s) will have <%- section %> access.</p>
     </header>
 
-
     <form class="permission-item-form form-inline">
       <input data-section="<%- section %>" data-type="roles" type="text" class="item
input-small" placeholder="Add Role">
       <button type="submit" class="btn btn-success"><i class="icon fonticon-plus-circled"></i>
Add Role</button>
     </form>
-    <ul class="unstyled permission-items span10" id="<%- (section) %>-items-roles">
-    </ul>
+    <ul class="unstyled permission-items span10" id="<%- (section) %>-items-roles"></ul>
   </div>
 </div>

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/aae7b7c7/app/addons/permissions/views.js
----------------------------------------------------------------------
diff --git a/app/addons/permissions/views.js b/app/addons/permissions/views.js
index 43f5aab..b73145f 100644
--- a/app/addons/permissions/views.js
+++ b/app/addons/permissions/views.js
@@ -11,23 +11,24 @@
 // the License.
 
 define([
-       "app",
-       "api",
-       "addons/permissions/resources"
+  'app',
+  'api',
+  'addons/permissions/resources'
 ],
-function (app, FauxtonAPI, Permissions ) {
+function (app, FauxtonAPI, Permissions) {
+
   var events = {};
   Permissions.events = _.extend(events, Backbone.Events);
 
   Permissions.Permissions = FauxtonAPI.View.extend({
-    template: "addons/permissions/templates/permissions",
+    template: 'addons/permissions/templates/permissions',
 
     initialize: function (options) {
       this.database = options.database;
       this.listenTo(Permissions.events, 'itemRemoved', this.itemRemoved);
     },
 
-    itemRemoved: function (event) {
+    itemRemoved: function () {
       this.model.set({
         admins: this.adminsView.items(),
         members: this.membersView.items()
@@ -37,7 +38,7 @@ function (app, FauxtonAPI, Permissions ) {
         FauxtonAPI.addNotification({
           msg: 'Database permissions has been updated.'
         });
-        }, function (xhr) {
+      }, function (xhr) {
         FauxtonAPI.addNotification({
           msg: 'Could not update permissions - reason: ' + xhr.responseText,
           type: 'error'
@@ -61,21 +62,21 @@ function (app, FauxtonAPI, Permissions ) {
 
     serialize: function () {
       return {
-        databaseName: this.database.id,
+        databaseName: this.database.id
       };
     }
   });
 
   Permissions.PermissionSection = FauxtonAPI.View.extend({
-    template: "addons/permissions/templates/section",
+    template: 'addons/permissions/templates/section',
     initialize: function (options) {
       this.section = options.section;
       this.help = options.help;
     },
 
     events: {
-      "submit .permission-item-form": "addItem",
-      'click button.close': "removeItem"
+      'submit .permission-item-form': 'addItem',
+      'click button.close': 'removeItem'
     },
 
     beforeRender: function () {
@@ -85,15 +86,15 @@ function (app, FauxtonAPI, Permissions ) {
       this.roleViews = [];
 
       _.each(section.names, function (name) {
-        var nameView = this.insertView('#'+this.section+'-items-names', new Permissions.PermissionItem({
-          item: name,
+        var nameView = this.insertView('#' + this.section + '-items-names', new Permissions.PermissionItem({
+          item: name
         }));
         this.nameViews.push(nameView);
       }, this);
 
       _.each(section.roles, function (role) {
-        var roleView = this.insertView('#'+this.section+'-items-roles', new Permissions.PermissionItem({
-          item: role,
+        var roleView = this.insertView('#' + this.section + '-items-roles', new Permissions.PermissionItem({
+          item: role
         }));
         this.roleViews.push(roleView);
       }, this);
@@ -160,19 +161,18 @@ function (app, FauxtonAPI, Permissions ) {
         help: this.help
       };
     }
-
   });
 
   Permissions.PermissionItem = FauxtonAPI.View.extend({
-    tagName: "li",
-    template: "addons/permissions/templates/item",
+    tagName: 'li',
+    template: 'addons/permissions/templates/item',
     initialize: function (options) {
       this.item = options.item;
       this.viewsList = options.viewsList;
     },
 
     events: {
-      'click .close': "removeItem"
+      'click .close': 'removeItem'
     },
 
     removeItem: function (event) {
@@ -187,13 +187,11 @@ function (app, FauxtonAPI, Permissions ) {
       });
     },
 
-
     serialize: function () {
       return {
         item: this.item
       };
     }
-
   });
 
   return Permissions;


Mime
View raw message