From 5d11d12a5ad34b784b2aac254e692bc8e4348440 Mon Sep 17 00:00:00 2001 From: Mike Pennisi Date: Wed, 11 Jun 2014 21:43:03 -0400 Subject: [PATCH 1/2] Fix linting errors - Relax requirement for use of strict mode - Ensure that all source files are linted - Temporarily allow global variables defined by third-party libraries - Alter source code to satisfy linting rules --- Gruntfile.js | 27 ++++++++++--------- src/scripts/app.js | 9 +++---- src/scripts/apps/about/about_app.js | 2 +- src/scripts/apps/about/about_controller.js | 2 +- src/scripts/apps/about/about_view.js | 2 +- src/scripts/apps/bills/bills_app.js | 7 ++--- .../apps/bills/list/list_controller.js | 10 ++++--- src/scripts/apps/bills/list/list_view.js | 7 ++--- .../apps/bills/show/show_controller.js | 24 ++++++++--------- src/scripts/apps/bills/show/show_view.js | 6 ++--- .../apps/members/list/list_controller.js | 4 +-- src/scripts/apps/members/list/list_view.js | 5 ++-- .../apps/members/show/show_controller.js | 2 +- src/scripts/apps/members/show/show_view.js | 2 +- .../watched_bills/list/list_controller.js | 15 +++++------ .../apps/watched_bills/list/list_view.js | 4 +-- .../watched_bills/show/show_controller.js | 12 ++++----- .../apps/watched_bills/show/show_view.js | 2 +- .../apps/watched_bills/watched_bills_app.js | 2 +- src/scripts/apps/welcome/welcome_app.js | 2 +- .../apps/welcome/welcome_controller.js | 6 ++--- src/scripts/apps/welcome/welcome_view.js | 2 +- src/scripts/common/app.js | 22 ++++++++------- src/scripts/common/views.js | 6 ++--- src/scripts/entities/bill.js | 22 +++++++++------ src/scripts/entities/common.js | 2 +- src/scripts/entities/days_left.js | 2 +- src/scripts/entities/member.js | 10 +++---- src/scripts/entities/news_items.js | 2 +- src/scripts/entities/top_contributors.js | 2 +- src/scripts/entities/watched_bill.js | 8 +++--- src/scripts/require_main.js | 5 ++-- 32 files changed, 126 insertions(+), 109 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index 1ceed14..e16cafc 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -25,7 +25,8 @@ module.exports = function(grunt) { //quotmark: true, undef: true, unused: true, - strict: true, + // TODO: re-enable the "strict" option + //strict: true, trailing: true, smarttabs: true, indent: 2 @@ -34,21 +35,23 @@ module.exports = function(grunt) { options: { globals: { JQuery: true, - $: true + $: true, + require: true, + define: true, + _: true, + Backbone: true, + Tabletop: true, + google: true } }, files: { src: [ - 'src/scripts/*.js', - 'src/scripts/entities/*.js', - 'src/scripts/apps/bills/*.js', - 'src/scripts/apps/bills/show/*.js', - 'src/scripts/apps/members/*.js', - 'src/scripts/apps/members/list/*.js', - 'src/scripts/apps/members/show/*.js', - 'src/scripts/apps/watched_bills/*.js', - 'src/scripts/apps/watched_bills/list/*.js', - 'src/scripts/apps/watched_bills/show/*.js' + 'src/scripts/**/*.js', + '!src/scripts/build.js', + // TODO: Remove built files from `src/` directory + '!src/scripts/require_main.built*', + '!src/scripts/underscore*', + '!src/scripts/lib/**/*' ] } }, diff --git a/src/scripts/app.js b/src/scripts/app.js index 16c3aec..583866c 100644 --- a/src/scripts/app.js +++ b/src/scripts/app.js @@ -6,7 +6,7 @@ define(["marionette"], function(Marionette) { }); GeneralAssemblyApp.navigate = function(route, options) { - options || (options = {}); + options = options || {}; Backbone.history.navigate(route, options); }; @@ -23,14 +23,13 @@ define(["marionette"], function(Marionette) { // GeneralAssemblyApp.trigger("welcome:show"); // } - var public_spreadsheet_url = 'https://docs.google.com/spreadsheet/pub?key=0Ap9h1zLSgOWUdEhsQi1Yb0JZV3REUVExV1hqT2h6NHc&output=html'; Tabletop.init({ key: 'https://docs.google.com/spreadsheet/pub?key=0Ap9h1zLSgOWUdEhsQi1Yb0JZV3REUVExV1hqT2h6NHc&output=html', simpleSheet: true, proxie: 'https://s3.amazonaws.com/obscure-atoll-3469', - callback: function(data, tabletop) { - text = {}; - _.each(data, function(row) { text[row.id] = row.text }); + callback: function(data) { + var text = {}; + _.each(data, function(row) { text[row.id] = row.text; }); GeneralAssemblyApp.text = text; } }); diff --git a/src/scripts/apps/about/about_app.js b/src/scripts/apps/about/about_app.js index 9bb241b..9726c54 100644 --- a/src/scripts/apps/about/about_app.js +++ b/src/scripts/apps/about/about_app.js @@ -1,5 +1,5 @@ define(["app"], function(GeneralAssemblyApp) { - GeneralAssemblyApp.module("AboutApp", function(AboutApp, GeneralAssemblyApp, Backbone, Marionette, $, _) { + GeneralAssemblyApp.module("AboutApp", function(AboutApp, GeneralAssemblyApp, Backbone, Marionette) { AboutApp.Router = Marionette.AppRouter.extend({ appRoutes: { "about": "about" diff --git a/src/scripts/apps/about/about_controller.js b/src/scripts/apps/about/about_controller.js index abb415d..fdb583c 100644 --- a/src/scripts/apps/about/about_controller.js +++ b/src/scripts/apps/about/about_controller.js @@ -1,5 +1,5 @@ define(["app","apps/about/about_view"], function(GeneralAssemblyApp, View) { - GeneralAssemblyApp.module("AboutApp", function(AboutApp, GeneralAssemblyApp, Backbone, Marionette, $, _) { + GeneralAssemblyApp.module("AboutApp", function(AboutApp, GeneralAssemblyApp) { AboutApp.Controler = { showAbout: function() { var aboutView = new View.AboutView(); diff --git a/src/scripts/apps/about/about_view.js b/src/scripts/apps/about/about_view.js index e89da10..233e407 100644 --- a/src/scripts/apps/about/about_view.js +++ b/src/scripts/apps/about/about_view.js @@ -1,5 +1,5 @@ define(["app"], function(GeneralAssemblyApp) { - GeneralAssemblyApp.module("AboutApp.View", function(View, GeneralAssemblyApp, Backbone, Marionette, $, _) { + GeneralAssemblyApp.module("AboutApp.View", function(View, GeneralAssemblyApp, Backbone, Marionette, $) { View.AboutView = Marionette.ItemView.extend({ template: "#about-template", onShow: function() { diff --git a/src/scripts/apps/bills/bills_app.js b/src/scripts/apps/bills/bills_app.js index c9f6f0d..c7cebba 100644 --- a/src/scripts/apps/bills/bills_app.js +++ b/src/scripts/apps/bills/bills_app.js @@ -1,5 +1,5 @@ define(["app"], function(GeneralAssemblyApp) { - GeneralAssemblyApp.module("BillsApp", function(BillsApp, GeneralAssemblyApp, Backbone, Marionette, $, _) { + GeneralAssemblyApp.module("BillsApp", function(BillsApp, GeneralAssemblyApp, Backbone, Marionette) { BillsApp.Router = Marionette.AppRouter.extend({ appRoutes: { "bills(?:query)": "listBills", @@ -9,8 +9,9 @@ define(["app"], function(GeneralAssemblyApp) { }); var API = { - listBills: function(query) { - require(["apps/bills/list/list_controller"], function (ListController) { + listBills: function() { + require(["apps/bills/list/list_controller"], function () { + // TODO: Do something with required module? }); }, showBill: function(id) { diff --git a/src/scripts/apps/bills/list/list_controller.js b/src/scripts/apps/bills/list/list_controller.js index a649dc3..4608617 100644 --- a/src/scripts/apps/bills/list/list_controller.js +++ b/src/scripts/apps/bills/list/list_controller.js @@ -1,10 +1,12 @@ -define(["app","apps/bills/list/list_view"], function(GeneralAssemblyApp, View) { - GeneralAssemblyApp.module("BillsApp.List", function(List, GeneralAssemblyApp, Backbone, Marionette, $, _) { +// TODO: Remove dependency on "list_view" module if it has no side-effects +define(["app","apps/bills/list/list_view"], function(GeneralAssemblyApp) { + // TODO: Determine if this is dead code and remove if so. + GeneralAssemblyApp.module("BillsApp.List", function(List) { List.Controller = { - ListBills: function(criterion) { + ListBills: function() { require(["entities/bills"], function() { }); - }; + } }; }); return GeneralAssemblyApp.BillsApp.List.Controller; diff --git a/src/scripts/apps/bills/list/list_view.js b/src/scripts/apps/bills/list/list_view.js index cd13e0c..8f25d54 100644 --- a/src/scripts/apps/bills/list/list_view.js +++ b/src/scripts/apps/bills/list/list_view.js @@ -1,10 +1,11 @@ define(["app"], function(GeneralAssemblyApp) { - GeneralAssemblyApp.module("BillsApp.List.View", function(View, GeneralAssemblyApp, Backbone, Marionette, $, _) { - View.BillView = Marrionette.ItemView,extend({ + GeneralAssemblyApp.module("BillsApp.List.View", function(View, GeneralAssemblyApp, Backbone, Marionette) { + // TODO: Determine if this is dead code and remove if so. + View.BillView = Marionette.ItemView.extend({ template: "bill-item-template" }); - view.BillListView = Marrinonette.CompositView.extend({ + View.BillListView = Marionette.CompositView.extend({ template: "bill-search-list-template", itemView: View.BillView, tagName: "tr", diff --git a/src/scripts/apps/bills/show/show_controller.js b/src/scripts/apps/bills/show/show_controller.js index 85f2e43..02dd38f 100644 --- a/src/scripts/apps/bills/show/show_controller.js +++ b/src/scripts/apps/bills/show/show_controller.js @@ -1,5 +1,5 @@ define(["app","apps/bills/show/show_view"], function(GeneralAssemblyApp, View) { - GeneralAssemblyApp.module("BillsApp.Show", function(Show, GeneralAssemblyApp, Backbone, Marionette, $, _) { + GeneralAssemblyApp.module("BillsApp.Show", function(Show, GeneralAssemblyApp, Backbone, Marionette, $) { Show.Controller = { showBill: function(param) { // param is appended to the end of hte api request url -- it can be @@ -11,24 +11,24 @@ define(["app","apps/bills/show/show_view"], function(GeneralAssemblyApp, View) { $.when(fetchingBill).done(function(bill) { window.bill = bill; - billView = new View.BillView({ + var billView = new View.BillView({ model: bill }); - author = new GeneralAssemblyApp.Entities.BillAuthors( bill.get("author") ); - authorView = new View.AuthorsView({ collection: author }); + var author = new GeneralAssemblyApp.Entities.BillAuthors( bill.get("author") ); + var authorView = new View.AuthorsView({ collection: author }); - coauthors = new GeneralAssemblyApp.Entities.BillAuthors( bill.get("coauthors") ); - coauthorsView = new View.AuthorsView({ collection: coauthors }); + var coauthors = new GeneralAssemblyApp.Entities.BillAuthors( bill.get("coauthors") ); + var coauthorsView = new View.AuthorsView({ collection: coauthors }); - bill_status_listings = new GeneralAssemblyApp.Entities.BillStatusListings( bill.get("bill_status_listings" ) ); - stausListingsView = new View.StatusListingsView({ collection: bill_status_listings }); + var bill_status_listings = new GeneralAssemblyApp.Entities.BillStatusListings( bill.get("bill_status_listings" ) ); + var stausListingsView = new View.StatusListingsView({ collection: bill_status_listings }); - bill_versions = new GeneralAssemblyApp.Entities.BillVersions( bill.get("versions") ); - versionListingsView = new View.VersionsListingView({ collection: bill_versions }); + var bill_versions = new GeneralAssemblyApp.Entities.BillVersions( bill.get("versions") ); + var versionListingsView = new View.VersionsListingView({ collection: bill_versions }); - bill_votes = new GeneralAssemblyApp.Entities.BillVotes( bill.get("votes") ); - votesListingsView = new View.VotesListingView({ collection: bill_votes }); + var bill_votes = new GeneralAssemblyApp.Entities.BillVotes( bill.get("votes") ); + var votesListingsView = new View.VotesListingView({ collection: bill_votes }); billLayout.on("show", function() { billLayout.billRegion.show(billView); diff --git a/src/scripts/apps/bills/show/show_view.js b/src/scripts/apps/bills/show/show_view.js index 914af21..7c0e6d2 100644 --- a/src/scripts/apps/bills/show/show_view.js +++ b/src/scripts/apps/bills/show/show_view.js @@ -1,5 +1,5 @@ define(["app"], function(GeneralAssemblyApp) { - GeneralAssemblyApp.module("BillsApp.Show.View", function(View, GeneralAssemblyApp, Backbone, Marionette, $, _) { + GeneralAssemblyApp.module("BillsApp.Show.View", function(View, GeneralAssemblyApp, Backbone, Marionette, $) { View.BillLayout = Marionette.Layout.extend({ template: "#bill-detail-layout", className: "container", @@ -34,7 +34,7 @@ define(["app"], function(GeneralAssemblyApp) { }); if (crossover_status === -1) { - var billnum = $(".billnumhed") + var billnum = $(".billnumhed"); $(billnum).addClass("red"); } } @@ -44,7 +44,7 @@ define(["app"], function(GeneralAssemblyApp) { View.AuthorView = Marionette.ItemView.extend({ tagName: "li", className: function() { - return "media " + this.model.get("party") + return "media " + this.model.get("party"); }, template: "#bill-author-template" }); diff --git a/src/scripts/apps/members/list/list_controller.js b/src/scripts/apps/members/list/list_controller.js index f07e39b..d597990 100644 --- a/src/scripts/apps/members/list/list_controller.js +++ b/src/scripts/apps/members/list/list_controller.js @@ -1,5 +1,5 @@ define(["app","apps/members/list/list_view"], function(GeneralAssemblyApp, View) { - GeneralAssemblyApp.module("MembersApp.List", function(List, GeneralAssemblyApp, Backbone, Marionette, $, _) { + GeneralAssemblyApp.module("MembersApp.List", function(List, GeneralAssemblyApp, Backbone, Marionette, $) { List.Controller = { listMembers: function(criterion) { require(["entities/member"], function() { @@ -9,7 +9,7 @@ define(["app","apps/members/list/list_view"], function(GeneralAssemblyApp, View) var membersListPanel = new View.MemberPanel(); $.when(fetchingMembers).done(function(members) { - filteredMembers = GeneralAssemblyApp.Entities.FilteredCollection({ + var filteredMembers = GeneralAssemblyApp.Entities.FilteredCollection({ collection: members, filterCriterion: criterion }); diff --git a/src/scripts/apps/members/list/list_view.js b/src/scripts/apps/members/list/list_view.js index f521443..1675e85 100644 --- a/src/scripts/apps/members/list/list_view.js +++ b/src/scripts/apps/members/list/list_view.js @@ -1,5 +1,5 @@ define(["app"], function(GeneralAssemblyApp) { - GeneralAssemblyApp.module("MembersApp.List.View", function(View, GeneralAssemblyApp, Backbone, Marionette, $, _) { + GeneralAssemblyApp.module("MembersApp.List.View", function(View, GeneralAssemblyApp, Backbone, Marionette, $) { View.MemberLayout = Marionette.Layout.extend({ template: "#member-list-layout", regions: { @@ -63,7 +63,8 @@ define(["app"], function(GeneralAssemblyApp) { if ((navPos.top+jumboHeight) < offset){ $('#panel-region').addClass('fixed'); $('#members-region').css({'margin-top':'50px'}); - } if ((navPos.top+jumboHeight) >= offset){ + } + if ((navPos.top+jumboHeight) >= offset){ $('#members-region').css({'margin-top':'0px'}); $('#panel-region').removeClass('fixed'); } diff --git a/src/scripts/apps/members/show/show_controller.js b/src/scripts/apps/members/show/show_controller.js index 963a7c0..e14e8ae 100644 --- a/src/scripts/apps/members/show/show_controller.js +++ b/src/scripts/apps/members/show/show_controller.js @@ -1,5 +1,5 @@ define(["app","apps/members/show/show_view"], function(GeneralAssemblyApp, View) { - GeneralAssemblyApp.module("MembersApp.Show", function(Show, GeneralAssemblyApp, Backbone, Marionette, $, _) { + GeneralAssemblyApp.module("MembersApp.Show", function(Show, GeneralAssemblyApp, Backbone, Marionette, $) { Show.Controller = { showMember: function(id) { require(["entities/member","entities/top_contributors"], function() { diff --git a/src/scripts/apps/members/show/show_view.js b/src/scripts/apps/members/show/show_view.js index 5077721..f1a28c3 100644 --- a/src/scripts/apps/members/show/show_view.js +++ b/src/scripts/apps/members/show/show_view.js @@ -1,5 +1,5 @@ define(["app"], function(GeneralAssemblyApp){ - GeneralAssemblyApp.module("MembersApp.Show.View", function(View, GeneralAssemblyApp, Backbone, Marionette, $, _) { + GeneralAssemblyApp.module("MembersApp.Show.View", function(View, GeneralAssemblyApp, Backbone, Marionette, $) { View.Layout = Marionette.Layout.extend({ template: "#member-show-layout", regions: { diff --git a/src/scripts/apps/watched_bills/list/list_controller.js b/src/scripts/apps/watched_bills/list/list_controller.js index 90aea5a..f5eb4db 100644 --- a/src/scripts/apps/watched_bills/list/list_controller.js +++ b/src/scripts/apps/watched_bills/list/list_controller.js @@ -8,20 +8,19 @@ define(["app","apps/watched_bills/list/list_view"], function(GeneralAssemblyApp, var categories_layout = new View.CategoriesLayout(); $.when(fetchingWatchedBills, fetchingBillsCount).done(function(watched_bills, bills_count) { - category_model_data = _.chain(watched_bills.models) - .countBy(function(model) { return model.get("category") }) + var category_model_data = _.chain(watched_bills.models) + .countBy(function(model) { return model.get("category"); }) .pairs() .map(function(model) { return {name: model[0], count: model[1]}; }) .value(); - window.category_model_data = category_model_data - categories = new GeneralAssemblyApp.Entities.BillCategories( category_model_data ); + var categories = new GeneralAssemblyApp.Entities.BillCategories( category_model_data ); - categories_view = new View.CategoriesView({ + var categories_view = new View.CategoriesView({ collection: categories }); - bills_count_view = new GeneralAssemblyApp.Common.View.BillsCountView({ + var bills_count_view = new GeneralAssemblyApp.Common.View.BillsCountView({ model: bills_count, className: "jumbotron" }); @@ -35,9 +34,9 @@ define(["app","apps/watched_bills/list/list_view"], function(GeneralAssemblyApp, }); }); }, - listWatchedBills: function(category) { + listWatchedBills: function() { } - } + }; }); return GeneralAssemblyApp.WatchedBillsApp.List.Controller; }); diff --git a/src/scripts/apps/watched_bills/list/list_view.js b/src/scripts/apps/watched_bills/list/list_view.js index 77d2953..48627ca 100644 --- a/src/scripts/apps/watched_bills/list/list_view.js +++ b/src/scripts/apps/watched_bills/list/list_view.js @@ -1,5 +1,5 @@ define(["app"], function(GeneralAssemblyApp) { - GeneralAssemblyApp.module("WatchedBillsApp.List.View", function(View, GeneralAssemblyApp, Backbone, Marionette, $, _) { + GeneralAssemblyApp.module("WatchedBillsApp.List.View", function(View, GeneralAssemblyApp, Backbone, Marionette, $) { View.CategoriesLayout = Marionette.Layout.extend({ template: "#bill-category-layout", regions: { @@ -27,7 +27,7 @@ define(["app"], function(GeneralAssemblyApp) { showBillsCategory: function(e) { e.preventDefault(); e.stopPropagation(); - GeneralAssemblyApp.trigger("watchedbills:categories:show", this.model.get("name")) + GeneralAssemblyApp.trigger("watchedbills:categories:show", this.model.get("name")); } }); diff --git a/src/scripts/apps/watched_bills/show/show_controller.js b/src/scripts/apps/watched_bills/show/show_controller.js index 4337006..0d74faf 100644 --- a/src/scripts/apps/watched_bills/show/show_controller.js +++ b/src/scripts/apps/watched_bills/show/show_controller.js @@ -1,5 +1,5 @@ define(["app","apps/watched_bills/show/show_view"], function(GeneralAssemblyApp, View) { - GeneralAssemblyApp.module("WatchedBillsApp.Show", function(Show, GeneralAssemblyApp, Backbone, Marionette, $, _) { + GeneralAssemblyApp.module("WatchedBillsApp.Show", function(Show, GeneralAssemblyApp, Backbone, Marionette, $) { Show.Controller = { showBillsForCategory: function(category) { require(["entities/watched_bill"], function() { @@ -7,18 +7,18 @@ define(["app","apps/watched_bills/show/show_view"], function(GeneralAssemblyApp, var categoryLayout = new View.CategoryLayout(); $.when(fetchingWatchedBills).done(function(watched_bills) { - billsForCategory = GeneralAssemblyApp.Entities.FilteredCollection({ + var billsForCategory = GeneralAssemblyApp.Entities.FilteredCollection({ collection: watched_bills }); billsForCategory.filter({category: category}); - categoryView = new View.CategoryCollectionView({ + var categoryView = new View.CategoryCollectionView({ collection: billsForCategory }); - headline = new GeneralAssemblyApp.Entities.CetegoryHeadline({category: category.replace(/\_/g, " ")}); - headlineView = new View.CategoryHeadlineView({ + var headline = new GeneralAssemblyApp.Entities.CetegoryHeadline({category: category.replace(/\_/g, " ")}); + var headlineView = new View.CategoryHeadlineView({ model: headline }); @@ -37,5 +37,5 @@ define(["app","apps/watched_bills/show/show_view"], function(GeneralAssemblyApp, } }; }); -return GeneralAssemblyApp.WatchedBillsApp.Show.Controller; + return GeneralAssemblyApp.WatchedBillsApp.Show.Controller; }); diff --git a/src/scripts/apps/watched_bills/show/show_view.js b/src/scripts/apps/watched_bills/show/show_view.js index da57e8f..529e7e5 100644 --- a/src/scripts/apps/watched_bills/show/show_view.js +++ b/src/scripts/apps/watched_bills/show/show_view.js @@ -1,5 +1,5 @@ define(["app"], function(GeneralAssemblyApp) { - GeneralAssemblyApp.module("WatchedBillsApp.Show.View", function(View, GeneralAssemblyApp, Backbone, Marionette, $, _) { + GeneralAssemblyApp.module("WatchedBillsApp.Show.View", function(View, GeneralAssemblyApp, Backbone, Marionette, $) { View.CategoryLayout = Marionette.Layout.extend({ template: "#show-category-layout", regions: { diff --git a/src/scripts/apps/watched_bills/watched_bills_app.js b/src/scripts/apps/watched_bills/watched_bills_app.js index a8b9386..1909314 100644 --- a/src/scripts/apps/watched_bills/watched_bills_app.js +++ b/src/scripts/apps/watched_bills/watched_bills_app.js @@ -1,5 +1,5 @@ define(["app"], function(GeneralAssemblyApp) { - GeneralAssemblyApp.module("WatchedBillsApp", function(WatchedBillsApp, GeneralAssemblyApp, Backbone, Marionette, $, _) { + GeneralAssemblyApp.module("WatchedBillsApp", function(WatchedBillsApp, GeneralAssemblyApp, Backbone, Marionette) { WatchedBillsApp.Router = Marionette.AppRouter.extend({ appRoutes: { "watched_bills": "listBillCategories", diff --git a/src/scripts/apps/welcome/welcome_app.js b/src/scripts/apps/welcome/welcome_app.js index 46d0057..d523b85 100644 --- a/src/scripts/apps/welcome/welcome_app.js +++ b/src/scripts/apps/welcome/welcome_app.js @@ -1,5 +1,5 @@ define(["app"], function(GeneralAssemblyApp) { - GeneralAssemblyApp.module("WelcomeApp", function(WelcomeApp, GeneralAssemblyApp, Backbone, Marionette, $, _) { + GeneralAssemblyApp.module("WelcomeApp", function(WelcomeApp, GeneralAssemblyApp, Backbone, Marionette) { WelcomeApp.Router = Marionette.AppRouter.extend({ appRoutes: { "": "welcome" diff --git a/src/scripts/apps/welcome/welcome_controller.js b/src/scripts/apps/welcome/welcome_controller.js index 5c58017..3e2adfa 100644 --- a/src/scripts/apps/welcome/welcome_controller.js +++ b/src/scripts/apps/welcome/welcome_controller.js @@ -1,5 +1,5 @@ define(["app","apps/welcome/welcome_view"], function(GeneralAssemblyApp, View) { - GeneralAssemblyApp.module("WelcomeApp", function(WelcomeApp, GeneralAssemblyApp, Backbone, Marionette, $, _) { + GeneralAssemblyApp.module("WelcomeApp", function(WelcomeApp, GeneralAssemblyApp, Backbone, Marionette, $) { WelcomeApp.Controler = { showWelcome: function() { require(["entities/bill","entities/days_left","goog!feeds,1"], function() { @@ -8,11 +8,11 @@ define(["app","apps/welcome/welcome_view"], function(GeneralAssemblyApp, View) { var fetchingDaysLeft = GeneralAssemblyApp.request("days:left"); $.when(fetchingBillsCount, fetchingDaysLeft).done(function(billsCount, daysLeft) { - billsCountView = new GeneralAssemblyApp.Common.View.BillsCountView({ + var billsCountView = new GeneralAssemblyApp.Common.View.BillsCountView({ model: billsCount }); - daysLeftView = new View.DaysLeftView({ + var daysLeftView = new View.DaysLeftView({ model: daysLeft }); diff --git a/src/scripts/apps/welcome/welcome_view.js b/src/scripts/apps/welcome/welcome_view.js index e8b2c93..ce52e2d 100644 --- a/src/scripts/apps/welcome/welcome_view.js +++ b/src/scripts/apps/welcome/welcome_view.js @@ -1,5 +1,5 @@ define(["app"], function(GeneralAssemblyApp) { - GeneralAssemblyApp.module("WelcomeApp.View", function(View, GeneralAssemblyApp, Backbone, Marionette, $, _) { + GeneralAssemblyApp.module("WelcomeApp.View", function(View, GeneralAssemblyApp, Backbone, Marionette, $) { View.WelcomeLayout = Marionette.Layout.extend({ template: "#welcome-layout", regions: { diff --git a/src/scripts/common/app.js b/src/scripts/common/app.js index cc8e815..4b7e573 100644 --- a/src/scripts/common/app.js +++ b/src/scripts/common/app.js @@ -1,13 +1,13 @@ define(["app"], function(GeneralAssemblyApp) { - GeneralAssemblyApp.module("Common", function(Common, GeneralAssemblyApp, Backbone, Marionette, $, _) { + GeneralAssemblyApp.module("Common", function(Common) { Common.tweet = function(d, s, id){ - var s = typeof s !== "undefined" ? s : "script"; - var id = typeof id !== "undefined" ? id : "twitter-wjs"; + s = typeof s !== "undefined" ? s : "script"; + id = typeof id !== "undefined" ? id : "twitter-wjs"; var js, fjs=d.getElementsByTagName(s)[1], p=/^http:/.test(d.location)?'http':'https'; - console.log(fjs); + if (!d.getElementById(id)) { js=d.createElement(s); js.id=id; @@ -17,17 +17,19 @@ define(["app"], function(GeneralAssemblyApp) { }; Common.facebook = function(d, s, id) { - var s = typeof s !== "undefined" ? s : 'script'; - var id = typeof id !== "undefined" ? id : 'facebook-jssdk'; + s = typeof s !== "undefined" ? s : 'script'; + id = typeof id !== "undefined" ? id : 'facebook-jssdk'; var js, fjs = d.getElementsByTagName(s)[0]; - console.log(fjs); - if (d.getElementById(id)) return; + + if (d.getElementById(id)) { + return; + } js = d.createElement(s); js.id = id; js.src = "http://connect.facebook.net/en_US/all.js#xfbml=1&appId=1446015978947149"; fjs.parentNode.insertBefore(js, fjs); - } + }; }); - return GeneralAssemblyApp.Common + return GeneralAssemblyApp.Common; }); diff --git a/src/scripts/common/views.js b/src/scripts/common/views.js index b1afd4c..459fe36 100644 --- a/src/scripts/common/views.js +++ b/src/scripts/common/views.js @@ -1,5 +1,5 @@ define(["app"], function(GeneralAssemblyApp) { - GeneralAssemblyApp.module("Common.View", function(View, GeneralAssemblyApp, Backbone, Marionette, $, _) { + GeneralAssemblyApp.module("Common.View", function(View, GeneralAssemblyApp, Backbone, Marionette, $) { View.Loading = Marionette.ItemView.extend({ template: "#loading-template", onShow: function() { @@ -29,5 +29,5 @@ define(["app"], function(GeneralAssemblyApp) { template: "#bills-count-template" }); }); - return GeneralAssemblyApp.Common.View -}); \ No newline at end of file + return GeneralAssemblyApp.Common.View; +}); diff --git a/src/scripts/entities/bill.js b/src/scripts/entities/bill.js index 1cc8ab3..18c0fc1 100644 --- a/src/scripts/entities/bill.js +++ b/src/scripts/entities/bill.js @@ -5,7 +5,7 @@ define(["app"], function(GeneralAssemblyApp) { Entities.Bill = Backbone.Model.extend({ initialize: function(id) { - this.url = Entities.bills_url + id + this.url = Entities.bills_url + id; } }); Entities.Bills = Backbone.Collection.extend({ @@ -22,8 +22,13 @@ define(["app"], function(GeneralAssemblyApp) { Entities.BillAuthor = Backbone.Model.extend({ initialize: function() { var full_name = this.get("name_first") + " "; - if ( ! _.isNull(this.get("name_middle")) ) full_name += this.get("name_middle") + " "; - if ( ! _.isNull(this.get("name_nickname")) ) full_name += "'" + this.get("name_nickname") + "' "; + if ( ! _.isNull(this.get("name_middle")) ) { + full_name += this.get("name_middle") + " "; + } + if ( ! _.isNull(this.get("name_nickname")) ) { + full_name += "'" + this.get("name_nickname") + "' "; + } + full_name += this.get("name_last"); this.set("full_name", full_name); } @@ -61,7 +66,7 @@ define(["app"], function(GeneralAssemblyApp) { var API = { getBillsCount: function() { var defer = $.Deferred(); - Entities.bills_count = new Entities.BillsCount() + Entities.bills_count = new Entities.BillsCount(); Entities.bills_count.fetch({ dataType: "jsonp", success: function(data) { @@ -76,11 +81,11 @@ define(["app"], function(GeneralAssemblyApp) { // either the bill id or a string with the doc type (i.e. HB) and // bill number separated by a '/' var defer = $.Deferred(); - bill = new Entities.Bill(param); + var bill = new Entities.Bill(param); bill.fetch({ dataType: "jsonp", success: function(data) { - defer.resolve(data) + defer.resolve(data); } }); return defer.promise(); @@ -88,11 +93,12 @@ define(["app"], function(GeneralAssemblyApp) { getBills: function() { var defer = $.Deferred(); - bills = new Entities.Bills(); + var bills = new Entities.Bills(); bills.fetch({ dataType: "jsonp", success: function() { - defer.resolve(data) + // TODO: Ensure this is not dead code and resolve with data + defer.resolve(); } }); return defer.promise(); diff --git a/src/scripts/entities/common.js b/src/scripts/entities/common.js index c8489f9..13c2e1c 100644 --- a/src/scripts/entities/common.js +++ b/src/scripts/entities/common.js @@ -10,7 +10,7 @@ define(["app"], function(GeneralAssemblyApp) { filtered.filterCriterion = options.filterCriterion || {}; var applyFilter = function(filterCriterion, collection) { - var collection = collection || original; + collection = collection || original; var criterion = filterCriterion; var items = _.isEmpty(criterion) ? collection.models : collection.where(criterion); diff --git a/src/scripts/entities/days_left.js b/src/scripts/entities/days_left.js index 0731533..2ff3123 100644 --- a/src/scripts/entities/days_left.js +++ b/src/scripts/entities/days_left.js @@ -1,5 +1,5 @@ define(["app"], function(GeneralAssemblyApp) { - GeneralAssemblyApp.module("Entities", function(Entities, GeneralAssemblyApp, Backbone, Marionette, $, _){ + GeneralAssemblyApp.module("Entities", function(Entities, GeneralAssemblyApp, Backbone, Marionette, $){ Entities.DaysLeft = Backbone.Model.extend({ urlRoot: Entities.api_base + 'days_left', diff --git a/src/scripts/entities/member.js b/src/scripts/entities/member.js index f8172d9..fbfd189 100644 --- a/src/scripts/entities/member.js +++ b/src/scripts/entities/member.js @@ -4,7 +4,7 @@ define(["app"], function(GeneralAssemblyApp) { Entities.Member = Backbone.Model.extend({ urlRoot: Entities.members_url, - initialize: function(id) { + initialize: function() { // Create tooltip info string var tooltipInfo = this.get("full_name") + ", " + this.get("district_address_city"); if ( this.get("title") !== null ) { @@ -41,12 +41,12 @@ define(["app"], function(GeneralAssemblyApp) { Entities.MemberVote = Backbone.Model.extend({ initialize: function() { - this.set("vote_date", new Date(this.get("vote_date"))) + this.set("vote_date", new Date(this.get("vote_date"))); } }); Entities.MemberVotes = Backbone.Collection.extend({ initialize: function(id) { - this.url = Entities.members_url+ id + '/votes' + this.url = Entities.members_url+ id + '/votes'; }, model: Entities.MemberVote }); @@ -54,7 +54,7 @@ define(["app"], function(GeneralAssemblyApp) { var API = { getMembers: function() { var defer = $.Deferred(); - if (! Entities.members || Entities.members.length == 0) { + if (! Entities.members || Entities.members.length === 0) { Entities.members = new Entities.MembersCollection(); Entities.members.fetch({ dataType: "jsonp", @@ -71,7 +71,7 @@ define(["app"], function(GeneralAssemblyApp) { getMember: function(memberId) { // var member = Entities.members.where({id: memberId})[0]; var defer = $.Deferred(); - member = new Entities.Member({id: memberId}); + var member = new Entities.Member({id: memberId}); member.fetch({ dataType: "jsonp", success: function(data) { diff --git a/src/scripts/entities/news_items.js b/src/scripts/entities/news_items.js index 1d728b0..ca091dc 100644 --- a/src/scripts/entities/news_items.js +++ b/src/scripts/entities/news_items.js @@ -1,5 +1,5 @@ define(["app"], function(GeneralAssemblyApp) { - GeneralAssemblyApp.module("Entities", function(Entities, GeneralAssemblyApp, Backbone, Marionette, $, _){ + GeneralAssemblyApp.module("Entities", function(Entities, GeneralAssemblyApp, Backbone){ Entities.NewsItem = Backbone.Model.extend(); Entities.NewsItemsCollection = Backbone.Collection.extend({ model: Entities.NewsItems diff --git a/src/scripts/entities/top_contributors.js b/src/scripts/entities/top_contributors.js index de9288c..b5e8894 100644 --- a/src/scripts/entities/top_contributors.js +++ b/src/scripts/entities/top_contributors.js @@ -1,5 +1,5 @@ define(["app"], function(GeneralAssemblyApp) { - GeneralAssemblyApp.module("Entities", function(Entities, GeneralAssemblyApp, Backbone, Marionette, $, _){ + GeneralAssemblyApp.module("Entities", function(Entities, GeneralAssemblyApp, Backbone, Marionette, $){ Entities.TopContributor = Backbone.Model.extend({}); Entities.TopContributorsCollection = Backbone.Collection.extend({ diff --git a/src/scripts/entities/watched_bill.js b/src/scripts/entities/watched_bill.js index 31413d3..67281ee 100644 --- a/src/scripts/entities/watched_bill.js +++ b/src/scripts/entities/watched_bill.js @@ -1,11 +1,13 @@ define(["app"], function(GeneralAssemblyApp) { - GeneralAssemblyApp.module("Entities", function(Entities, GeneralAssemblyApp, Backbone, Marionette, $, _){ + GeneralAssemblyApp.module("Entities", function(Entities, GeneralAssemblyApp, Backbone, Marionette, $){ Entities.watched_bills_url = Entities.api_base + 'watched_bills/'; Entities.WatchedBill = Backbone.Model.extend({ base_url: Entities.watched_bills_url, initialize: function() { - if ( this.get("category") ) this.set("category", this.get("category").replace(/ /g,'_')); + if ( this.get("category") ) { + this.set("category", this.get("category").replace(/ /g,'_')); + } this.set("status_date", new Date(this.get("status_date"))); } }); @@ -25,7 +27,7 @@ define(["app"], function(GeneralAssemblyApp) { var API = { getWatchedBills: function() { var defer = $.Deferred(); - if (! Entities.watched_bills || Entities.watched_bills.length == 0) { + if (! Entities.watched_bills || Entities.watched_bills.length === 0) { Entities.watched_bills = new Entities.WatchedBills(); Entities.watched_bills.fetch({ dataType: "jsonp", diff --git a/src/scripts/require_main.js b/src/scripts/require_main.js index e3e8ec1..cec253a 100644 --- a/src/scripts/require_main.js +++ b/src/scripts/require_main.js @@ -1,4 +1,4 @@ -requirejs.config({ +require.config({ // enforceDefine: true, baseUrl: "scripts", paths: { @@ -54,5 +54,6 @@ requirejs.config({ require(["app","jquery-ui","jquery-scrolltofixed","jquery-datatables","datejs","underscore.string", "spin","spin.jquery","tabletop","goog"], function(GeneralAssemblyApp) { GeneralAssemblyApp.start(); -}); + } +); From 75ed4bbb080b7470d97d2874f73529459d26f525 Mon Sep 17 00:00:00 2001 From: Mike Pennisi Date: Wed, 11 Jun 2014 22:19:47 -0400 Subject: [PATCH 2/2] Re-enable lint check for strict mode --- Gruntfile.js | 5 +++-- src/scripts/app.js | 2 ++ src/scripts/apps/about/about_app.js | 2 ++ src/scripts/apps/about/about_controller.js | 2 ++ src/scripts/apps/about/about_view.js | 2 ++ src/scripts/apps/bills/bills_app.js | 2 ++ src/scripts/apps/bills/list/list_controller.js | 2 ++ src/scripts/apps/bills/list/list_view.js | 2 ++ src/scripts/apps/bills/show/show_controller.js | 2 ++ src/scripts/apps/bills/show/show_view.js | 2 ++ src/scripts/apps/members/list/list_controller.js | 2 ++ src/scripts/apps/members/list/list_view.js | 2 ++ src/scripts/apps/members/members_app.js | 2 ++ src/scripts/apps/members/show/show_controller.js | 2 ++ src/scripts/apps/members/show/show_view.js | 2 ++ src/scripts/apps/watched_bills/list/list_controller.js | 2 ++ src/scripts/apps/watched_bills/list/list_view.js | 2 ++ src/scripts/apps/watched_bills/show/show_controller.js | 2 ++ src/scripts/apps/watched_bills/show/show_view.js | 2 ++ src/scripts/apps/watched_bills/watched_bills_app.js | 2 ++ src/scripts/apps/welcome/welcome_app.js | 2 ++ src/scripts/apps/welcome/welcome_controller.js | 2 ++ src/scripts/apps/welcome/welcome_view.js | 2 ++ src/scripts/common/app.js | 2 ++ src/scripts/common/views.js | 2 ++ src/scripts/entities/bill.js | 2 ++ src/scripts/entities/common.js | 2 ++ src/scripts/entities/days_left.js | 2 ++ src/scripts/entities/member.js | 2 ++ src/scripts/entities/news_items.js | 2 ++ src/scripts/entities/top_contributors.js | 2 ++ src/scripts/entities/watched_bill.js | 2 ++ src/scripts/require_main.js | 2 ++ 33 files changed, 67 insertions(+), 2 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index e16cafc..7794058 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -1,3 +1,5 @@ +"use strict"; + module.exports = function(grunt) { // Project configuration grunt.initConfig({ @@ -25,8 +27,7 @@ module.exports = function(grunt) { //quotmark: true, undef: true, unused: true, - // TODO: re-enable the "strict" option - //strict: true, + strict: true, trailing: true, smarttabs: true, indent: 2 diff --git a/src/scripts/app.js b/src/scripts/app.js index 583866c..965cb2d 100644 --- a/src/scripts/app.js +++ b/src/scripts/app.js @@ -1,4 +1,6 @@ define(["marionette"], function(Marionette) { + "use strict"; + var GeneralAssemblyApp = new Marionette.Application(); GeneralAssemblyApp.addRegions({ diff --git a/src/scripts/apps/about/about_app.js b/src/scripts/apps/about/about_app.js index 9726c54..663b984 100644 --- a/src/scripts/apps/about/about_app.js +++ b/src/scripts/apps/about/about_app.js @@ -1,4 +1,6 @@ define(["app"], function(GeneralAssemblyApp) { + "use strict"; + GeneralAssemblyApp.module("AboutApp", function(AboutApp, GeneralAssemblyApp, Backbone, Marionette) { AboutApp.Router = Marionette.AppRouter.extend({ appRoutes: { diff --git a/src/scripts/apps/about/about_controller.js b/src/scripts/apps/about/about_controller.js index fdb583c..f71327c 100644 --- a/src/scripts/apps/about/about_controller.js +++ b/src/scripts/apps/about/about_controller.js @@ -1,4 +1,6 @@ define(["app","apps/about/about_view"], function(GeneralAssemblyApp, View) { + "use strict"; + GeneralAssemblyApp.module("AboutApp", function(AboutApp, GeneralAssemblyApp) { AboutApp.Controler = { showAbout: function() { diff --git a/src/scripts/apps/about/about_view.js b/src/scripts/apps/about/about_view.js index 233e407..bb743ac 100644 --- a/src/scripts/apps/about/about_view.js +++ b/src/scripts/apps/about/about_view.js @@ -1,4 +1,6 @@ define(["app"], function(GeneralAssemblyApp) { + "use strict"; + GeneralAssemblyApp.module("AboutApp.View", function(View, GeneralAssemblyApp, Backbone, Marionette, $) { View.AboutView = Marionette.ItemView.extend({ template: "#about-template", diff --git a/src/scripts/apps/bills/bills_app.js b/src/scripts/apps/bills/bills_app.js index c7cebba..5adfdde 100644 --- a/src/scripts/apps/bills/bills_app.js +++ b/src/scripts/apps/bills/bills_app.js @@ -1,4 +1,6 @@ define(["app"], function(GeneralAssemblyApp) { + "use strict"; + GeneralAssemblyApp.module("BillsApp", function(BillsApp, GeneralAssemblyApp, Backbone, Marionette) { BillsApp.Router = Marionette.AppRouter.extend({ appRoutes: { diff --git a/src/scripts/apps/bills/list/list_controller.js b/src/scripts/apps/bills/list/list_controller.js index 4608617..2f1bc1f 100644 --- a/src/scripts/apps/bills/list/list_controller.js +++ b/src/scripts/apps/bills/list/list_controller.js @@ -1,5 +1,7 @@ // TODO: Remove dependency on "list_view" module if it has no side-effects define(["app","apps/bills/list/list_view"], function(GeneralAssemblyApp) { + "use strict"; + // TODO: Determine if this is dead code and remove if so. GeneralAssemblyApp.module("BillsApp.List", function(List) { List.Controller = { diff --git a/src/scripts/apps/bills/list/list_view.js b/src/scripts/apps/bills/list/list_view.js index 8f25d54..42508a9 100644 --- a/src/scripts/apps/bills/list/list_view.js +++ b/src/scripts/apps/bills/list/list_view.js @@ -1,4 +1,6 @@ define(["app"], function(GeneralAssemblyApp) { + "use strict"; + GeneralAssemblyApp.module("BillsApp.List.View", function(View, GeneralAssemblyApp, Backbone, Marionette) { // TODO: Determine if this is dead code and remove if so. View.BillView = Marionette.ItemView.extend({ diff --git a/src/scripts/apps/bills/show/show_controller.js b/src/scripts/apps/bills/show/show_controller.js index 02dd38f..58b7536 100644 --- a/src/scripts/apps/bills/show/show_controller.js +++ b/src/scripts/apps/bills/show/show_controller.js @@ -1,4 +1,6 @@ define(["app","apps/bills/show/show_view"], function(GeneralAssemblyApp, View) { + "use strict"; + GeneralAssemblyApp.module("BillsApp.Show", function(Show, GeneralAssemblyApp, Backbone, Marionette, $) { Show.Controller = { showBill: function(param) { diff --git a/src/scripts/apps/bills/show/show_view.js b/src/scripts/apps/bills/show/show_view.js index 7c0e6d2..a55fb9d 100644 --- a/src/scripts/apps/bills/show/show_view.js +++ b/src/scripts/apps/bills/show/show_view.js @@ -1,4 +1,6 @@ define(["app"], function(GeneralAssemblyApp) { + "use strict"; + GeneralAssemblyApp.module("BillsApp.Show.View", function(View, GeneralAssemblyApp, Backbone, Marionette, $) { View.BillLayout = Marionette.Layout.extend({ template: "#bill-detail-layout", diff --git a/src/scripts/apps/members/list/list_controller.js b/src/scripts/apps/members/list/list_controller.js index d597990..d4d4b11 100644 --- a/src/scripts/apps/members/list/list_controller.js +++ b/src/scripts/apps/members/list/list_controller.js @@ -1,4 +1,6 @@ define(["app","apps/members/list/list_view"], function(GeneralAssemblyApp, View) { + "use strict"; + GeneralAssemblyApp.module("MembersApp.List", function(List, GeneralAssemblyApp, Backbone, Marionette, $) { List.Controller = { listMembers: function(criterion) { diff --git a/src/scripts/apps/members/list/list_view.js b/src/scripts/apps/members/list/list_view.js index 1675e85..0716242 100644 --- a/src/scripts/apps/members/list/list_view.js +++ b/src/scripts/apps/members/list/list_view.js @@ -1,4 +1,6 @@ define(["app"], function(GeneralAssemblyApp) { + "use strict"; + GeneralAssemblyApp.module("MembersApp.List.View", function(View, GeneralAssemblyApp, Backbone, Marionette, $) { View.MemberLayout = Marionette.Layout.extend({ template: "#member-list-layout", diff --git a/src/scripts/apps/members/members_app.js b/src/scripts/apps/members/members_app.js index fbceac9..52529b0 100644 --- a/src/scripts/apps/members/members_app.js +++ b/src/scripts/apps/members/members_app.js @@ -1,4 +1,6 @@ define(["app"], function(GeneralAssemblyApp) { + "use strict"; + GeneralAssemblyApp.module("MembersApp", function(MembersApp, GeneralAssemblyApp, Backbone, Marionette, $, _) { MembersApp.Router = Marionette.AppRouter.extend({ appRoutes: { diff --git a/src/scripts/apps/members/show/show_controller.js b/src/scripts/apps/members/show/show_controller.js index e14e8ae..527004f 100644 --- a/src/scripts/apps/members/show/show_controller.js +++ b/src/scripts/apps/members/show/show_controller.js @@ -1,4 +1,6 @@ define(["app","apps/members/show/show_view"], function(GeneralAssemblyApp, View) { + "use strict"; + GeneralAssemblyApp.module("MembersApp.Show", function(Show, GeneralAssemblyApp, Backbone, Marionette, $) { Show.Controller = { showMember: function(id) { diff --git a/src/scripts/apps/members/show/show_view.js b/src/scripts/apps/members/show/show_view.js index f1a28c3..860776d 100644 --- a/src/scripts/apps/members/show/show_view.js +++ b/src/scripts/apps/members/show/show_view.js @@ -1,4 +1,6 @@ define(["app"], function(GeneralAssemblyApp){ + "use strict"; + GeneralAssemblyApp.module("MembersApp.Show.View", function(View, GeneralAssemblyApp, Backbone, Marionette, $) { View.Layout = Marionette.Layout.extend({ template: "#member-show-layout", diff --git a/src/scripts/apps/watched_bills/list/list_controller.js b/src/scripts/apps/watched_bills/list/list_controller.js index f5eb4db..4d872c2 100644 --- a/src/scripts/apps/watched_bills/list/list_controller.js +++ b/src/scripts/apps/watched_bills/list/list_controller.js @@ -1,4 +1,6 @@ define(["app","apps/watched_bills/list/list_view"], function(GeneralAssemblyApp, View) { + "use strict"; + GeneralAssemblyApp.module("WatchedBillsApp.List", function(List, GeneralAssemblyApp, Backbone, Marionette, $, _) { List.Controller = { listCategories: function() { diff --git a/src/scripts/apps/watched_bills/list/list_view.js b/src/scripts/apps/watched_bills/list/list_view.js index 48627ca..3af0a51 100644 --- a/src/scripts/apps/watched_bills/list/list_view.js +++ b/src/scripts/apps/watched_bills/list/list_view.js @@ -1,4 +1,6 @@ define(["app"], function(GeneralAssemblyApp) { + "use strict"; + GeneralAssemblyApp.module("WatchedBillsApp.List.View", function(View, GeneralAssemblyApp, Backbone, Marionette, $) { View.CategoriesLayout = Marionette.Layout.extend({ template: "#bill-category-layout", diff --git a/src/scripts/apps/watched_bills/show/show_controller.js b/src/scripts/apps/watched_bills/show/show_controller.js index 0d74faf..f673df8 100644 --- a/src/scripts/apps/watched_bills/show/show_controller.js +++ b/src/scripts/apps/watched_bills/show/show_controller.js @@ -1,4 +1,6 @@ define(["app","apps/watched_bills/show/show_view"], function(GeneralAssemblyApp, View) { + "use strict"; + GeneralAssemblyApp.module("WatchedBillsApp.Show", function(Show, GeneralAssemblyApp, Backbone, Marionette, $) { Show.Controller = { showBillsForCategory: function(category) { diff --git a/src/scripts/apps/watched_bills/show/show_view.js b/src/scripts/apps/watched_bills/show/show_view.js index 529e7e5..57b24a7 100644 --- a/src/scripts/apps/watched_bills/show/show_view.js +++ b/src/scripts/apps/watched_bills/show/show_view.js @@ -1,4 +1,6 @@ define(["app"], function(GeneralAssemblyApp) { + "use strict"; + GeneralAssemblyApp.module("WatchedBillsApp.Show.View", function(View, GeneralAssemblyApp, Backbone, Marionette, $) { View.CategoryLayout = Marionette.Layout.extend({ template: "#show-category-layout", diff --git a/src/scripts/apps/watched_bills/watched_bills_app.js b/src/scripts/apps/watched_bills/watched_bills_app.js index 1909314..2b5818c 100644 --- a/src/scripts/apps/watched_bills/watched_bills_app.js +++ b/src/scripts/apps/watched_bills/watched_bills_app.js @@ -1,4 +1,6 @@ define(["app"], function(GeneralAssemblyApp) { + "use strict"; + GeneralAssemblyApp.module("WatchedBillsApp", function(WatchedBillsApp, GeneralAssemblyApp, Backbone, Marionette) { WatchedBillsApp.Router = Marionette.AppRouter.extend({ appRoutes: { diff --git a/src/scripts/apps/welcome/welcome_app.js b/src/scripts/apps/welcome/welcome_app.js index d523b85..12652ec 100644 --- a/src/scripts/apps/welcome/welcome_app.js +++ b/src/scripts/apps/welcome/welcome_app.js @@ -1,4 +1,6 @@ define(["app"], function(GeneralAssemblyApp) { + "use strict"; + GeneralAssemblyApp.module("WelcomeApp", function(WelcomeApp, GeneralAssemblyApp, Backbone, Marionette) { WelcomeApp.Router = Marionette.AppRouter.extend({ appRoutes: { diff --git a/src/scripts/apps/welcome/welcome_controller.js b/src/scripts/apps/welcome/welcome_controller.js index 3e2adfa..7d209fd 100644 --- a/src/scripts/apps/welcome/welcome_controller.js +++ b/src/scripts/apps/welcome/welcome_controller.js @@ -1,4 +1,6 @@ define(["app","apps/welcome/welcome_view"], function(GeneralAssemblyApp, View) { + "use strict"; + GeneralAssemblyApp.module("WelcomeApp", function(WelcomeApp, GeneralAssemblyApp, Backbone, Marionette, $) { WelcomeApp.Controler = { showWelcome: function() { diff --git a/src/scripts/apps/welcome/welcome_view.js b/src/scripts/apps/welcome/welcome_view.js index ce52e2d..e0a0b4e 100644 --- a/src/scripts/apps/welcome/welcome_view.js +++ b/src/scripts/apps/welcome/welcome_view.js @@ -1,4 +1,6 @@ define(["app"], function(GeneralAssemblyApp) { + "use strict"; + GeneralAssemblyApp.module("WelcomeApp.View", function(View, GeneralAssemblyApp, Backbone, Marionette, $) { View.WelcomeLayout = Marionette.Layout.extend({ template: "#welcome-layout", diff --git a/src/scripts/common/app.js b/src/scripts/common/app.js index 4b7e573..754e1bd 100644 --- a/src/scripts/common/app.js +++ b/src/scripts/common/app.js @@ -1,4 +1,6 @@ define(["app"], function(GeneralAssemblyApp) { + "use strict"; + GeneralAssemblyApp.module("Common", function(Common) { Common.tweet = function(d, s, id){ s = typeof s !== "undefined" ? s : "script"; diff --git a/src/scripts/common/views.js b/src/scripts/common/views.js index 459fe36..66f69a4 100644 --- a/src/scripts/common/views.js +++ b/src/scripts/common/views.js @@ -1,4 +1,6 @@ define(["app"], function(GeneralAssemblyApp) { + "use strict"; + GeneralAssemblyApp.module("Common.View", function(View, GeneralAssemblyApp, Backbone, Marionette, $) { View.Loading = Marionette.ItemView.extend({ template: "#loading-template", diff --git a/src/scripts/entities/bill.js b/src/scripts/entities/bill.js index 18c0fc1..a92991d 100644 --- a/src/scripts/entities/bill.js +++ b/src/scripts/entities/bill.js @@ -1,4 +1,6 @@ define(["app"], function(GeneralAssemblyApp) { + "use strict"; + GeneralAssemblyApp.module("Entities", function(Entities, GeneralAssemblyApp, Backbone, Marionette, $, _){ // Bills Entities.bills_url = Entities.api_base + 'bills/'; diff --git a/src/scripts/entities/common.js b/src/scripts/entities/common.js index 13c2e1c..f2a14f7 100644 --- a/src/scripts/entities/common.js +++ b/src/scripts/entities/common.js @@ -1,4 +1,6 @@ define(["app"], function(GeneralAssemblyApp) { + "use strict"; + GeneralAssemblyApp.module("Entities", function(Entities, ContactManager, Backbone, Marionette, $, _){ Entities.api_base = "http://ajcgga-api.herokuapp.com/api/"; // Entities.api_base = "http://gga-api-staging.herokuapp.com/api/"; diff --git a/src/scripts/entities/days_left.js b/src/scripts/entities/days_left.js index 2ff3123..8320f2c 100644 --- a/src/scripts/entities/days_left.js +++ b/src/scripts/entities/days_left.js @@ -1,4 +1,6 @@ define(["app"], function(GeneralAssemblyApp) { + "use strict"; + GeneralAssemblyApp.module("Entities", function(Entities, GeneralAssemblyApp, Backbone, Marionette, $){ Entities.DaysLeft = Backbone.Model.extend({ diff --git a/src/scripts/entities/member.js b/src/scripts/entities/member.js index fbfd189..565f034 100644 --- a/src/scripts/entities/member.js +++ b/src/scripts/entities/member.js @@ -1,4 +1,6 @@ define(["app"], function(GeneralAssemblyApp) { + "use strict"; + GeneralAssemblyApp.module("Entities", function(Entities, GeneralAssemblyApp, Backbone, Marionette, $, _){ Entities.members_url = Entities.api_base + "members/"; diff --git a/src/scripts/entities/news_items.js b/src/scripts/entities/news_items.js index ca091dc..7fd92de 100644 --- a/src/scripts/entities/news_items.js +++ b/src/scripts/entities/news_items.js @@ -1,4 +1,6 @@ define(["app"], function(GeneralAssemblyApp) { + "use strict"; + GeneralAssemblyApp.module("Entities", function(Entities, GeneralAssemblyApp, Backbone){ Entities.NewsItem = Backbone.Model.extend(); Entities.NewsItemsCollection = Backbone.Collection.extend({ diff --git a/src/scripts/entities/top_contributors.js b/src/scripts/entities/top_contributors.js index b5e8894..cf82b6f 100644 --- a/src/scripts/entities/top_contributors.js +++ b/src/scripts/entities/top_contributors.js @@ -1,4 +1,6 @@ define(["app"], function(GeneralAssemblyApp) { + "use strict"; + GeneralAssemblyApp.module("Entities", function(Entities, GeneralAssemblyApp, Backbone, Marionette, $){ Entities.TopContributor = Backbone.Model.extend({}); diff --git a/src/scripts/entities/watched_bill.js b/src/scripts/entities/watched_bill.js index 67281ee..2497eb1 100644 --- a/src/scripts/entities/watched_bill.js +++ b/src/scripts/entities/watched_bill.js @@ -1,4 +1,6 @@ define(["app"], function(GeneralAssemblyApp) { + "use strict"; + GeneralAssemblyApp.module("Entities", function(Entities, GeneralAssemblyApp, Backbone, Marionette, $){ Entities.watched_bills_url = Entities.api_base + 'watched_bills/'; diff --git a/src/scripts/require_main.js b/src/scripts/require_main.js index cec253a..5cf0fbd 100644 --- a/src/scripts/require_main.js +++ b/src/scripts/require_main.js @@ -53,6 +53,8 @@ require.config({ require(["app","jquery-ui","jquery-scrolltofixed","jquery-datatables","datejs","underscore.string", "spin","spin.jquery","tabletop","goog"], function(GeneralAssemblyApp) { + "use strict"; + GeneralAssemblyApp.start(); } );