Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix linting errors #8

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 15 additions & 11 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use strict";

module.exports = function(grunt) {
// Project configuration
grunt.initConfig({
Expand Down Expand Up @@ -34,21 +36,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/**/*'
]
}
},
Expand Down
11 changes: 6 additions & 5 deletions src/scripts/app.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
define(["marionette"], function(Marionette) {
"use strict";

var GeneralAssemblyApp = new Marionette.Application();

GeneralAssemblyApp.addRegions({
mainRegion: "#main-region"
});

GeneralAssemblyApp.navigate = function(route, options) {
options || (options = {});
options = options || {};
Backbone.history.navigate(route, options);
};

Expand All @@ -23,14 +25,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;
}
});
Expand Down
4 changes: 3 additions & 1 deletion src/scripts/apps/about/about_app.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
define(["app"], function(GeneralAssemblyApp) {
GeneralAssemblyApp.module("AboutApp", function(AboutApp, GeneralAssemblyApp, Backbone, Marionette, $, _) {
"use strict";

GeneralAssemblyApp.module("AboutApp", function(AboutApp, GeneralAssemblyApp, Backbone, Marionette) {
AboutApp.Router = Marionette.AppRouter.extend({
appRoutes: {
"about": "about"
Expand Down
4 changes: 3 additions & 1 deletion src/scripts/apps/about/about_controller.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
define(["app","apps/about/about_view"], function(GeneralAssemblyApp, View) {
GeneralAssemblyApp.module("AboutApp", function(AboutApp, GeneralAssemblyApp, Backbone, Marionette, $, _) {
"use strict";

GeneralAssemblyApp.module("AboutApp", function(AboutApp, GeneralAssemblyApp) {
AboutApp.Controler = {
showAbout: function() {
var aboutView = new View.AboutView();
Expand Down
4 changes: 3 additions & 1 deletion src/scripts/apps/about/about_view.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
define(["app"], function(GeneralAssemblyApp) {
GeneralAssemblyApp.module("AboutApp.View", function(View, GeneralAssemblyApp, Backbone, Marionette, $, _) {
"use strict";

GeneralAssemblyApp.module("AboutApp.View", function(View, GeneralAssemblyApp, Backbone, Marionette, $) {
View.AboutView = Marionette.ItemView.extend({
template: "#about-template",
onShow: function() {
Expand Down
9 changes: 6 additions & 3 deletions src/scripts/apps/bills/bills_app.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
define(["app"], function(GeneralAssemblyApp) {
GeneralAssemblyApp.module("BillsApp", function(BillsApp, GeneralAssemblyApp, Backbone, Marionette, $, _) {
"use strict";

GeneralAssemblyApp.module("BillsApp", function(BillsApp, GeneralAssemblyApp, Backbone, Marionette) {
BillsApp.Router = Marionette.AppRouter.extend({
appRoutes: {
"bills(?:query)": "listBills",
Expand All @@ -9,8 +11,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) {
Expand Down
12 changes: 8 additions & 4 deletions src/scripts/apps/bills/list/list_controller.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
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) {
"use strict";

// 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;
Expand Down
9 changes: 6 additions & 3 deletions src/scripts/apps/bills/list/list_view.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
define(["app"], function(GeneralAssemblyApp) {
GeneralAssemblyApp.module("BillsApp.List.View", function(View, GeneralAssemblyApp, Backbone, Marionette, $, _) {
View.BillView = Marrionette.ItemView,extend({
"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({
template: "bill-item-template"
});

view.BillListView = Marrinonette.CompositView.extend({
View.BillListView = Marionette.CompositView.extend({
template: "bill-search-list-template",
itemView: View.BillView,
tagName: "tr",
Expand Down
26 changes: 14 additions & 12 deletions src/scripts/apps/bills/show/show_controller.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
define(["app","apps/bills/show/show_view"], function(GeneralAssemblyApp, View) {
GeneralAssemblyApp.module("BillsApp.Show", function(Show, GeneralAssemblyApp, Backbone, Marionette, $, _) {
"use strict";

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
Expand All @@ -11,24 +13,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);
Expand Down
8 changes: 5 additions & 3 deletions src/scripts/apps/bills/show/show_view.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
define(["app"], function(GeneralAssemblyApp) {
GeneralAssemblyApp.module("BillsApp.Show.View", function(View, GeneralAssemblyApp, Backbone, Marionette, $, _) {
"use strict";

GeneralAssemblyApp.module("BillsApp.Show.View", function(View, GeneralAssemblyApp, Backbone, Marionette, $) {
View.BillLayout = Marionette.Layout.extend({
template: "#bill-detail-layout",
className: "container",
Expand Down Expand Up @@ -34,7 +36,7 @@ define(["app"], function(GeneralAssemblyApp) {
});

if (crossover_status === -1) {
var billnum = $(".billnumhed")
var billnum = $(".billnumhed");
$(billnum).addClass("red");
}
}
Expand All @@ -44,7 +46,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"
});
Expand Down
6 changes: 4 additions & 2 deletions src/scripts/apps/members/list/list_controller.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
define(["app","apps/members/list/list_view"], function(GeneralAssemblyApp, View) {
GeneralAssemblyApp.module("MembersApp.List", function(List, GeneralAssemblyApp, Backbone, Marionette, $, _) {
"use strict";

GeneralAssemblyApp.module("MembersApp.List", function(List, GeneralAssemblyApp, Backbone, Marionette, $) {
List.Controller = {
listMembers: function(criterion) {
require(["entities/member"], function() {
Expand All @@ -9,7 +11,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
});
Expand Down
7 changes: 5 additions & 2 deletions src/scripts/apps/members/list/list_view.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
define(["app"], function(GeneralAssemblyApp) {
GeneralAssemblyApp.module("MembersApp.List.View", function(View, GeneralAssemblyApp, Backbone, Marionette, $, _) {
"use strict";

GeneralAssemblyApp.module("MembersApp.List.View", function(View, GeneralAssemblyApp, Backbone, Marionette, $) {
View.MemberLayout = Marionette.Layout.extend({
template: "#member-list-layout",
regions: {
Expand Down Expand Up @@ -63,7 +65,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');
}
Expand Down
2 changes: 2 additions & 0 deletions src/scripts/apps/members/members_app.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
define(["app"], function(GeneralAssemblyApp) {
"use strict";

GeneralAssemblyApp.module("MembersApp", function(MembersApp, GeneralAssemblyApp, Backbone, Marionette, $, _) {
MembersApp.Router = Marionette.AppRouter.extend({
appRoutes: {
Expand Down
4 changes: 3 additions & 1 deletion src/scripts/apps/members/show/show_controller.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
define(["app","apps/members/show/show_view"], function(GeneralAssemblyApp, View) {
GeneralAssemblyApp.module("MembersApp.Show", function(Show, GeneralAssemblyApp, Backbone, Marionette, $, _) {
"use strict";

GeneralAssemblyApp.module("MembersApp.Show", function(Show, GeneralAssemblyApp, Backbone, Marionette, $) {
Show.Controller = {
showMember: function(id) {
require(["entities/member","entities/top_contributors"], function() {
Expand Down
4 changes: 3 additions & 1 deletion src/scripts/apps/members/show/show_view.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
define(["app"], function(GeneralAssemblyApp){
GeneralAssemblyApp.module("MembersApp.Show.View", function(View, GeneralAssemblyApp, Backbone, Marionette, $, _) {
"use strict";

GeneralAssemblyApp.module("MembersApp.Show.View", function(View, GeneralAssemblyApp, Backbone, Marionette, $) {
View.Layout = Marionette.Layout.extend({
template: "#member-show-layout",
regions: {
Expand Down
17 changes: 9 additions & 8 deletions src/scripts/apps/watched_bills/list/list_controller.js
Original file line number Diff line number Diff line change
@@ -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() {
Expand All @@ -8,20 +10,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"
});
Expand All @@ -35,9 +36,9 @@ define(["app","apps/watched_bills/list/list_view"], function(GeneralAssemblyApp,
});
});
},
listWatchedBills: function(category) {
listWatchedBills: function() {
}
}
};
});
return GeneralAssemblyApp.WatchedBillsApp.List.Controller;
});
6 changes: 4 additions & 2 deletions src/scripts/apps/watched_bills/list/list_view.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
define(["app"], function(GeneralAssemblyApp) {
GeneralAssemblyApp.module("WatchedBillsApp.List.View", function(View, GeneralAssemblyApp, Backbone, Marionette, $, _) {
"use strict";

GeneralAssemblyApp.module("WatchedBillsApp.List.View", function(View, GeneralAssemblyApp, Backbone, Marionette, $) {
View.CategoriesLayout = Marionette.Layout.extend({
template: "#bill-category-layout",
regions: {
Expand Down Expand Up @@ -27,7 +29,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"));
}
});

Expand Down
14 changes: 8 additions & 6 deletions src/scripts/apps/watched_bills/show/show_controller.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
define(["app","apps/watched_bills/show/show_view"], function(GeneralAssemblyApp, View) {
GeneralAssemblyApp.module("WatchedBillsApp.Show", function(Show, GeneralAssemblyApp, Backbone, Marionette, $, _) {
"use strict";

GeneralAssemblyApp.module("WatchedBillsApp.Show", function(Show, GeneralAssemblyApp, Backbone, Marionette, $) {
Show.Controller = {
showBillsForCategory: function(category) {
require(["entities/watched_bill"], function() {
var fetchingWatchedBills = GeneralAssemblyApp.request("watched_bills:collection");
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
});

Expand All @@ -37,5 +39,5 @@ define(["app","apps/watched_bills/show/show_view"], function(GeneralAssemblyApp,
}
};
});
return GeneralAssemblyApp.WatchedBillsApp.Show.Controller;
return GeneralAssemblyApp.WatchedBillsApp.Show.Controller;
});
Loading