client side code webstorm code cleanup.

This commit is contained in:
kay.one 2013-03-29 16:28:58 -07:00
commit 445ea4f344
94 changed files with 4355 additions and 4243 deletions

View file

@ -1,6 +1,6 @@
define(['app', 'Upcoming/UpcomingModel'], function () {
NzbDrone.Upcoming.UpcomingCollection = Backbone.Collection.extend({
url: NzbDrone.Constants.ApiRoot + '/upcoming',
url : NzbDrone.Constants.ApiRoot + '/upcoming',
model: NzbDrone.Upcoming.UpcomingModel
});
});

View file

@ -1,24 +1,24 @@
<table class="table table-striped">
<thead>
<tr>
<th>Series Title</th>
<th>Episode</th>
<th>Episode Title</th>
<th>Air Time</th>
<th>Status</th>
</tr>
<tr>
<th>Series Title</th>
<th>Episode</th>
<th>Episode Title</th>
<th>Air Time</th>
<th>Status</th>
</tr>
</thead>
<tbody id="yesterday">
<tr>
<td colspan="5">Yesterday</td>
</tr>
<tr>
<td colspan="5">Yesterday</td>
</tr>
</tbody>
<tbody id="today">
<tr>
<td colspan="5">Today</td>
</tr>
<tr>
<td colspan="5">Today</td>
</tr>
</tbody>
<tbody id="tomorrow">

View file

@ -2,20 +2,20 @@
define(['app', 'Upcoming/UpcomingItemView'], function (app) {
NzbDrone.Upcoming.UpcomingCollectionView = Backbone.Marionette.CompositeView.extend({
itemView: NzbDrone.Upcoming.UpcomingItemView,
template: 'Upcoming/UpcomingCollectionTemplate',
itemView : NzbDrone.Upcoming.UpcomingItemView,
template : 'Upcoming/UpcomingCollectionTemplate',
itemViewContainer: 'table',
ui: {
yesterday: 'tbody#yesterday',
today: 'tbody#today',
tomorrow: 'tbody#tomorrow',
two_days: 'tbody#two_days',
yesterday : 'tbody#yesterday',
today : 'tbody#today',
tomorrow : 'tbody#tomorrow',
two_days : 'tbody#two_days',
three_days: 'tbody#three_days',
four_days: 'tbody#four_days',
five_days: 'tbody#five_days',
six_days: 'tbody#six_days',
later: 'tbody#later'
four_days : 'tbody#four_days',
five_days : 'tbody#five_days',
six_days : 'tbody#six_days',
later : 'tbody#later'
},
initialize: function () {
@ -23,7 +23,7 @@ define(['app', 'Upcoming/UpcomingItemView'], function (app) {
this.collection.fetch();
},
serializeData: function() {
serializeData: function () {
var viewData = {};
viewData.two_days = Date.create().addDays(2).format('{Weekday}');
viewData.three_days = Date.create().addDays(3).format('{Weekday}');
@ -33,45 +33,45 @@ define(['app', 'Upcoming/UpcomingItemView'], function (app) {
return viewData;
},
appendHtml: function(collectionView, itemView, index){
appendHtml: function (collectionView, itemView, index) {
var date = Date.create(itemView.model.get('airTime'));
if (date.isYesterday()){
if (date.isYesterday()) {
collectionView.$(this.ui.yesterday).append(itemView.el);
return;
}
if (date.isToday()){
if (date.isToday()) {
collectionView.$(this.ui.today).append(itemView.el);
return;
}
if (date.isTomorrow()){
if (date.isTomorrow()) {
collectionView.$(this.ui.tomorrow).append(itemView.el);
return;
}
if (date.is(Date.create().addDays(2).short())){
if (date.is(Date.create().addDays(2).short())) {
collectionView.$(this.ui.two_days).append(itemView.el);
return;
}
if (date.is(Date.create().addDays(3).short())){
if (date.is(Date.create().addDays(3).short())) {
collectionView.$(this.ui.three_days).append(itemView.el);
return;
}
if (date.is(Date.create().addDays(4).short())){
if (date.is(Date.create().addDays(4).short())) {
collectionView.$(this.ui.four_days).append(itemView.el);
return;
}
if (date.is(Date.create().addDays(5).short())){
if (date.is(Date.create().addDays(5).short())) {
collectionView.$(this.ui.five_days).append(itemView.el);
return;
}
if (date.is(Date.create().addDays(6).short())){
if (date.is(Date.create().addDays(6).short())) {
collectionView.$(this.ui.six_days).append(itemView.el);
return;
}
@ -81,8 +81,7 @@ define(['app', 'Upcoming/UpcomingItemView'], function (app) {
//if (date.isBefore(Date.create().addDays(7))) return date.format('{Weekday}');
},
onCompositeCollectionRendered: function()
{
onCompositeCollectionRendered: function () {
//Might not need this :D
}
});

View file

@ -1,13 +1,13 @@
'use strict';
define([
'app',
'Upcoming/UpcomingCollection'
'app',
'Upcoming/UpcomingCollection'
], function () {
NzbDrone.Upcoming.UpcomingItemView = Backbone.Marionette.ItemView.extend({
template: 'Upcoming/UpcomingItemTemplate',
tagName: 'tr',
tagName : 'tr',
onRender: function () {
NzbDrone.ModelBinder.bind(this.model, this.el);