You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ro...@apache.org on 2014/04/24 20:32:47 UTC
[1/3] couchdb commit: updated refs/heads/master to 5858a35
Repository: couchdb
Updated Branches:
refs/heads/master abeaf26c5 -> 5858a3556
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/master
Commit: 5858a35567c984d30e10304eb6264ef2c0a32b80
Parents: 9e7a841
Author: Robert Kowalski <ro...@kowalski.gd>
Authored: Sun Apr 20 15:36:47 2014 +0200
Committer: Robert Kowalski <ro...@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({
[3/3] couchdb commit: updated refs/heads/master to 5858a35
Posted by ro...@apache.org.
Fauxton: test for globals
As a developer, I don't want to accidentally pollute the global
namespace and rely on global state.
Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/12485a00
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/12485a00
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/12485a00
Branch: refs/heads/master
Commit: 12485a0090fb212e4a6dc49435fe2c0ab07daa79
Parents: abeaf26
Author: Robert Kowalski <ro...@kowalski.gd>
Authored: Sun Apr 20 15:32:42 2014 +0200
Committer: Robert Kowalski <ro...@kowalski.gd>
Committed: Thu Apr 24 20:32:08 2014 +0200
----------------------------------------------------------------------
src/fauxton/Gruntfile.js | 36 ++++++++++++++++++++++++++++++++++--
1 file changed, 34 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/couchdb/blob/12485a00/src/fauxton/Gruntfile.js
----------------------------------------------------------------------
diff --git a/src/fauxton/Gruntfile.js b/src/fauxton/Gruntfile.js
index c650b9f..8ffb2f8 100644
--- a/src/fauxton/Gruntfile.js
+++ b/src/fauxton/Gruntfile.js
@@ -164,7 +164,39 @@ module.exports = function(grunt) {
options: {
scripturl: true,
evil: true,
- expr: true
+ expr: true,
+ undef: true,
+ globals: {
+ document: true,
+ window: true,
+ location: true,
+ alert: true,
+ console: true,
+ clearInterval: true,
+ setInterval: true,
+ setTimeout: true,
+ prompt: true,
+ confirm: true,
+
+ jQuery: true,
+ Backbone: true,
+ $: true,
+ _: true,
+ require: true,
+ module: true,
+ sinon: true,
+ it: true,
+ describe: true,
+ beforeEach: true,
+ afterEach: true,
+ before: true,
+ after: true,
+ define: true,
+
+ Spinner: true,
+ prettyPrint: true
+
+ }
}
},
@@ -242,7 +274,7 @@ module.exports = function(grunt) {
couchserver: couchserver_config,
watch: {
- js: {
+ js: {
files: helper.watchFiles(['.js'], ["./app/**/*.js", '!./app/load_addons.js',"./assets/**/*.js", "./test/**/*.js"]),
tasks: ['watchRun'],
},
[2/3] couchdb commit: updated refs/heads/master to 5858a35
Posted by ro...@apache.org.
Fauxton: remove superfluous console.log
Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/9e7a8415
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/9e7a8415
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/9e7a8415
Branch: refs/heads/master
Commit: 9e7a8415660075bf17c74ef166e5bbe8cabe0aa9
Parents: 12485a0
Author: Robert Kowalski <ro...@kowalski.gd>
Authored: Sun Apr 20 15:34:36 2014 +0200
Committer: Robert Kowalski <ro...@kowalski.gd>
Committed: Thu Apr 24 20:32:08 2014 +0200
----------------------------------------------------------------------
src/fauxton/app/addons/stats/views.js | 1 -
1 file changed, 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/couchdb/blob/9e7a8415/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 4bd24d8..f75ee64 100644
--- a/src/fauxton/app/addons/stats/views.js
+++ b/src/fauxton/app/addons/stats/views.js
@@ -21,7 +21,6 @@ define([
],
function(app, FauxtonAPI,Stats, d3, nv) {
- console.log(nv);
Views = {};
datatypeEventer = {};