Fauxton: reformat code & remove whitespace
Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/7b80bc2e Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/7b80bc2e Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/7b80bc2e Branch: refs/heads/1.6.x Commit: 7b80bc2e0aae6d43bf15b19da3a482d15c336d38 Parents: 99e2b9e Author: Robert Kowalski <[email protected]> Authored: Sun Apr 6 18:17:36 2014 +0200 Committer: Robert Kowalski <[email protected]> Committed: Thu May 15 21:07:08 2014 +0200 ---------------------------------------------------------------------- src/fauxton/app/addons/activetasks/base.js | 2 +- src/fauxton/app/addons/activetasks/routes.js | 19 ++++++++++++------- .../app/addons/activetasks/templates/table.html | 2 +- .../app/addons/activetasks/tests/viewsSpec.js | 12 ++++++------ src/fauxton/app/addons/activetasks/views.js | 4 ++-- 5 files changed, 22 insertions(+), 17 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/couchdb/blob/7b80bc2e/src/fauxton/app/addons/activetasks/base.js ---------------------------------------------------------------------- diff --git a/src/fauxton/app/addons/activetasks/base.js b/src/fauxton/app/addons/activetasks/base.js index 647add0..c01fd55 100644 --- a/src/fauxton/app/addons/activetasks/base.js +++ b/src/fauxton/app/addons/activetasks/base.js @@ -21,6 +21,6 @@ function (app, FauxtonAPI, Activetasks) { Activetasks.initialize = function() { FauxtonAPI.addHeaderLink({title: "Active Tasks", icon: "fonticon-activetasks", href: "#/activetasks"}); }; - + return Activetasks; }); http://git-wip-us.apache.org/repos/asf/couchdb/blob/7b80bc2e/src/fauxton/app/addons/activetasks/routes.js ---------------------------------------------------------------------- diff --git a/src/fauxton/app/addons/activetasks/routes.js b/src/fauxton/app/addons/activetasks/routes.js index 89bcfcc..dcb2efe 100644 --- a/src/fauxton/app/addons/activetasks/routes.js +++ b/src/fauxton/app/addons/activetasks/routes.js @@ -21,34 +21,39 @@ function (app, FauxtonAPI, Activetasks, Views) { var ActiveTasksRouteObject = FauxtonAPI.RouteObject.extend({ layout: "with_sidebar", + routes: { "activetasks/:id": "defaultView", "activetasks": "defaultView" }, + selectedHeader: 'Active Tasks', + crumbs: [ - {"name": "Active tasks", "link": "activetasks"} + {"name": "Active tasks", "link": "activetasks"} ], - apiUrl: function(){ + + apiUrl: function () { return [this.newtasks.url("apiurl"), this.newtasks.documentation]; - }, + }, roles: ["_admin"], - defaultView: function(id){ + defaultView: function (id) { this.newtasks = new Activetasks.Tasks({ - currentView: "all", + currentView: "all", id:'activeTasks' }); + this.setView("#sidebar-content", new Views.TabMenu({ currentView: "all", model: this.newtasks - })); + })); this.setView("#dashboard-content", new Views.DataSection({ model: this.newtasks, currentView: "all" - })); + })); } }); http://git-wip-us.apache.org/repos/asf/couchdb/blob/7b80bc2e/src/fauxton/app/addons/activetasks/templates/table.html ---------------------------------------------------------------------- diff --git a/src/fauxton/app/addons/activetasks/templates/table.html b/src/fauxton/app/addons/activetasks/templates/table.html index 77d2a42..84dbccd 100644 --- a/src/fauxton/app/addons/activetasks/templates/table.html +++ b/src/fauxton/app/addons/activetasks/templates/table.html @@ -27,7 +27,7 @@ the License. --> <% if (collection.length === 0){%> - <tr> + <tr> <td> <p>No tasks.</p> </td> http://git-wip-us.apache.org/repos/asf/couchdb/blob/7b80bc2e/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 c1be25b..5da2c3f 100644 --- a/src/fauxton/app/addons/activetasks/tests/viewsSpec.js +++ b/src/fauxton/app/addons/activetasks/tests/viewsSpec.js @@ -17,13 +17,13 @@ define([ ], function (FauxtonAPI, Views, Models, testUtils) { var assert = testUtils.assert, ViewSandbox = testUtils.ViewSandbox; - + describe("TabMenu", function () { var tabMenu; beforeEach(function () { var newtasks = new Models.Tasks({ - currentView: "all", + currentView: "all", id:'activeTasks' }); @@ -37,7 +37,7 @@ define([ var viewSandbox; beforeEach(function () { viewSandbox = new ViewSandbox(); - viewSandbox.renderView(tabMenu); + viewSandbox.renderView(tabMenu); }); afterEach(function () { @@ -76,7 +76,7 @@ define([ var viewSandbox; beforeEach(function () { viewSandbox = new ViewSandbox(); - viewSandbox.renderView(tabMenu); + viewSandbox.renderView(tabMenu); }); afterEach(function () { @@ -105,7 +105,7 @@ define([ var viewSandbox, dataSection; beforeEach(function () { var newtasks = new Models.Tasks({ - currentView: "all", + currentView: "all", id:'activeTasks' }); newtasks.parse([]); @@ -116,7 +116,7 @@ define([ }); viewSandbox = new ViewSandbox(); - viewSandbox.renderView(dataSection); + viewSandbox.renderView(dataSection); }); afterEach(function () { http://git-wip-us.apache.org/repos/asf/couchdb/blob/7b80bc2e/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 c7e904a..22918a6 100644 --- a/src/fauxton/app/addons/activetasks/views.js +++ b/src/fauxton/app/addons/activetasks/views.js @@ -74,7 +74,7 @@ function (app, FauxtonAPI, activetasks) { if (this.dataView) { this.dataView.update(currentData, this.model.get('currentView').replace('_',' ')); } else { - this.dataView = this.insertView( new Views.TableData({ + this.dataView = this.insertView( new Views.TableData({ collection: currentData, currentView: this.model.get('currentView').replace('_',' ') })); @@ -140,7 +140,7 @@ function (app, FauxtonAPI, activetasks) { beforeRender: function(){ //iterate over the collection to add each this.collection.forEach(function(item) { - this.insertView("#tasks_go_here", new Views.TableDetail({ + this.insertView("#tasks_go_here", new Views.TableDetail({ model: item })); }, this);
