couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gar...@apache.org
Subject [06/47] couchdb commit: updated refs/heads/Update-Sidebar-Ui to c173e52
Date Mon, 19 May 2014 16:17:24 GMT
Fauxton: remove accidental globals


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

Branch: refs/heads/Update-Sidebar-Ui
Commit: 5858a35567c984d30e10304eb6264ef2c0a32b80
Parents: 9e7a841
Author: Robert Kowalski <rok@kowalski.gd>
Authored: Sun Apr 20 15:36:47 2014 +0200
Committer: Robert Kowalski <rok@kowalski.gd>
Committed: Thu Apr 24 20:32:08 2014 +0200

----------------------------------------------------------------------
 src/fauxton/app/addons/activetasks/tests/viewsSpec.js |  8 ++++----
 src/fauxton/app/addons/activetasks/views.js           |  4 ++--
 src/fauxton/app/addons/auth/resources.js              |  2 +-
 src/fauxton/app/addons/documents/resources.js         |  2 +-
 src/fauxton/app/addons/documents/routes.js            |  2 +-
 src/fauxton/app/addons/documents/views.js             |  2 ++
 src/fauxton/app/addons/permissions/tests/viewsSpec.js | 10 +++++++---
 src/fauxton/app/addons/pouchdb/pouchdb.mapreduce.js   | 10 +++++-----
 src/fauxton/app/addons/stats/routes.js                | 11 +++++------
 src/fauxton/app/addons/stats/views.js                 |  6 +++---
 10 files changed, 31 insertions(+), 26 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/5858a355/src/fauxton/app/addons/activetasks/tests/viewsSpec.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/activetasks/tests/viewsSpec.js b/src/fauxton/app/addons/activetasks/tests/viewsSpec.js
index 13c9049..c1be25b 100644
--- a/src/fauxton/app/addons/activetasks/tests/viewsSpec.js
+++ b/src/fauxton/app/addons/activetasks/tests/viewsSpec.js
@@ -45,7 +45,7 @@ define([
       });
 
       it("Should set polling rate", function () {
-        $range = tabMenu.$('#pollingRange');
+        var $range = tabMenu.$('#pollingRange');
         $range.val(15);
         $range.trigger('change');
 
@@ -53,8 +53,8 @@ define([
       });
 
       it("Should clearInterval", function () {
-        $range = tabMenu.$('#pollingRange');
-        clearIntervalMock = sinon.spy(window,'clearInterval');
+        var $range = tabMenu.$('#pollingRange');
+        var clearIntervalMock = sinon.spy(window,'clearInterval');
         $range.trigger('change');
 
         assert.ok(clearIntervalMock.calledOnce);
@@ -64,7 +64,7 @@ define([
       it("Should trigger update:poll event", function () {
         var spy = sinon.spy();
         Views.Events.on('update:poll', spy);
-        $range = tabMenu.$('#pollingRange');
+        var $range = tabMenu.$('#pollingRange');
         $range.trigger('change');
 
         assert.ok(spy.calledOnce);

http://git-wip-us.apache.org/repos/asf/couchdb/blob/5858a355/src/fauxton/app/addons/activetasks/views.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/activetasks/views.js b/src/fauxton/app/addons/activetasks/views.js
index b0940bf..c7e904a 100644
--- a/src/fauxton/app/addons/activetasks/views.js
+++ b/src/fauxton/app/addons/activetasks/views.js
@@ -116,7 +116,7 @@ function (app, FauxtonAPI, activetasks) {
       "click th": "sortByType"
     },
     initialize: function(){
-      currentView = this.options.currentView;
+      this.currentView = this.options.currentView;
     },
     sortByType:  function(e){
       var currentTarget = e.currentTarget,
@@ -127,7 +127,7 @@ function (app, FauxtonAPI, activetasks) {
     },
     serialize: function(){
       return {
-        currentView: currentView,
+        currentView: this.currentView,
         collection: this.collection
       };
     },

http://git-wip-us.apache.org/repos/asf/couchdb/blob/5858a355/src/fauxton/app/addons/auth/resources.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/auth/resources.js b/src/fauxton/app/addons/auth/resources.js
index ba3a438..6e191b1 100644
--- a/src/fauxton/app/addons/auth/resources.js
+++ b/src/fauxton/app/addons/auth/resources.js
@@ -299,7 +299,7 @@ function (app, FauxtonAPI, CouchdbSession) {
       "submit #change-password": "changePassword"
     },
 
-    changePassword: function () {
+    changePassword: function (event) {
       event.preventDefault();
 
       var that = this,

http://git-wip-us.apache.org/repos/asf/couchdb/blob/5858a355/src/fauxton/app/addons/documents/resources.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/documents/resources.js b/src/fauxton/app/addons/documents/resources.js
index a787f0d..eb6615a 100644
--- a/src/fauxton/app/addons/documents/resources.js
+++ b/src/fauxton/app/addons/documents/resources.js
@@ -119,7 +119,7 @@ function(app, FauxtonAPI, PagingCollection) {
 
     setDdocView: function (view, map, reduce) {
       if (!this.isDdoc()) return false;
-      var views = this.get('views');
+      var views = this.get('views'),
           tempView = views[view] || {};
 
       if (reduce) {

http://git-wip-us.apache.org/repos/asf/couchdb/blob/5858a355/src/fauxton/app/addons/documents/routes.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/documents/routes.js b/src/fauxton/app/addons/documents/routes.js
index d574588..5a2a04f 100644
--- a/src/fauxton/app/addons/documents/routes.js
+++ b/src/fauxton/app/addons/documents/routes.js
@@ -256,7 +256,7 @@ function(app, FauxtonAPI, Documents, Databases) {
     viewFn: function (databaseName, ddoc, view) {
       var params = this.createParams(),
           urlParams = params.urlParams,
-          docParams = params.docParams;
+          docParams = params.docParams,
           decodeDdoc = decodeURIComponent(ddoc);
 
       view = view.replace(/\?.*$/,'');

http://git-wip-us.apache.org/repos/asf/couchdb/blob/5858a355/src/fauxton/app/addons/documents/views.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/documents/views.js b/src/fauxton/app/addons/documents/views.js
index 5b096bb..77f3bde 100644
--- a/src/fauxton/app/addons/documents/views.js
+++ b/src/fauxton/app/addons/documents/views.js
@@ -883,6 +883,8 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb,
     },
 
     getDocFromEditor: function () {
+      var json;
+
       if (!this.hasValidCode()) {
         return false;
       }

http://git-wip-us.apache.org/repos/asf/couchdb/blob/5858a355/src/fauxton/app/addons/permissions/tests/viewsSpec.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/permissions/tests/viewsSpec.js b/src/fauxton/app/addons/permissions/tests/viewsSpec.js
index 27abca4..c22d405 100644
--- a/src/fauxton/app/addons/permissions/tests/viewsSpec.js
+++ b/src/fauxton/app/addons/permissions/tests/viewsSpec.js
@@ -16,9 +16,10 @@ define([
        'testUtils'
 ], function (FauxtonAPI, Views, Models, testUtils) {
   var assert = testUtils.assert,
-  ViewSandbox = testUtils.ViewSandbox;
+      ViewSandbox = testUtils.ViewSandbox;
 
   describe('Permission View', function () {
+    var security, section, viewSandbox;
 
     beforeEach(function () {
       security = new Models.Security({'admins': {
@@ -62,7 +63,9 @@ define([
   });
 
   describe('PermissionsSection', function () {
-    var section, security;
+    var section,
+        security,
+        viewSandbox;
 
     beforeEach(function () {
       security = new Models.Security({'admins': {
@@ -124,7 +127,8 @@ define([
   });
 
   describe('PermissionItem', function () {
-    var item;
+    var item,
+        viewSandbox;
 
     beforeEach(function () {
       item = new Views.PermissionItem({

http://git-wip-us.apache.org/repos/asf/couchdb/blob/5858a355/src/fauxton/app/addons/pouchdb/pouchdb.mapreduce.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/pouchdb/pouchdb.mapreduce.js b/src/fauxton/app/addons/pouchdb/pouchdb.mapreduce.js
index 224a6f6..502e0eb 100644
--- a/src/fauxton/app/addons/pouchdb/pouchdb.mapreduce.js
+++ b/src/fauxton/app/addons/pouchdb/pouchdb.mapreduce.js
@@ -36,6 +36,10 @@ function(app, FauxtonAPI, Collate) {
   var Pouch = {};
   Pouch.collate = Collate.collate;
 
+  function sum(values) {
+    return values.reduce(function(a, b) { return a + b; }, 0);
+  }
+
   //var MapReduce = function(db) {
   var MapReduce = function() {
 
@@ -59,7 +63,7 @@ function(app, FauxtonAPI, Collate) {
           'max': Math.max.apply(null, values),
           'count': values.length,
           'sumsqr': (function(){
-            _sumsqr = 0;
+            var _sumsqr = 0;
             for(var idx in values){
               _sumsqr += values[idx] * values[idx];
             }
@@ -75,10 +79,6 @@ function(app, FauxtonAPI, Collate) {
         return;
       }
 
-      function sum(values) {
-        return values.reduce(function(a, b) { return a + b; }, 0);
-      }
-
       var results = [];
       var current = null;
       var num_started= 0;

http://git-wip-us.apache.org/repos/asf/couchdb/blob/5858a355/src/fauxton/app/addons/stats/routes.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/stats/routes.js b/src/fauxton/app/addons/stats/routes.js
index 971c111..9939d43 100644
--- a/src/fauxton/app/addons/stats/routes.js
+++ b/src/fauxton/app/addons/stats/routes.js
@@ -25,8 +25,8 @@ function(app, FauxtonAPI, Stats) {
       "stats":"showStats",
       "_stats": "showStats"
     },
-    
-    
+
+
     crumbs: [
       {"name": "Statistics", "link": "_stats"}
     ],
@@ -35,15 +35,14 @@ function(app, FauxtonAPI, Stats) {
 
     initialize: function () {
       this.stats = new Stats.Collection();
-
-      this.setView("#sidebar-content", new Views.StatSelect({
+      this.setView("#sidebar-content", new Stats.Views.StatSelect({
         collection: this.stats
       }));
 
     },
 
     showStats: function () {
-      this.setView("#dashboard-content", new Views.Statistics({
+      this.setView("#dashboard-content", new Stats.Views.Statistics({
         collection: this.stats
       }));
     },
@@ -53,7 +52,7 @@ function(app, FauxtonAPI, Stats) {
     },
 
     apiUrl: function(){
-      return [ this.stats.url, this.stats.documentation]; 
+      return [ this.stats.url, this.stats.documentation];
     }
   });
 

http://git-wip-us.apache.org/repos/asf/couchdb/blob/5858a355/src/fauxton/app/addons/stats/views.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/stats/views.js b/src/fauxton/app/addons/stats/views.js
index f75ee64..275c30b 100644
--- a/src/fauxton/app/addons/stats/views.js
+++ b/src/fauxton/app/addons/stats/views.js
@@ -20,10 +20,10 @@ define([
 
 ],
 
-function(app, FauxtonAPI,Stats, d3, nv) {
-  Views = {};
+function(app, FauxtonAPI, Stats, d3, nv) {
+  var Views = {},
+      datatypeEventer = {};
 
-  datatypeEventer = {};
   _.extend(datatypeEventer, Backbone.Events);
 
   Views.Legend = FauxtonAPI.View.extend({


Mime
View raw message