removed NzbDrone. namespace, everything is done using require.

This commit is contained in:
Keivan Beigi 2013-06-24 16:41:59 -07:00
parent ef62af75df
commit b0bd3f34f1
121 changed files with 2570 additions and 2587 deletions

View File

@ -10,8 +10,6 @@ module.exports = function (grunt) {
'UI/JsLibraries/backbone.modelbinder.js' : 'http://raw.github.com/theironcook/Backbone.ModelBinder/master/Backbone.ModelBinder.js', 'UI/JsLibraries/backbone.modelbinder.js' : 'http://raw.github.com/theironcook/Backbone.ModelBinder/master/Backbone.ModelBinder.js',
'UI/JsLibraries/backbone.mutators.js' : 'http://raw.github.com/asciidisco/Backbone.Mutators/master/backbone.mutators.js', 'UI/JsLibraries/backbone.mutators.js' : 'http://raw.github.com/asciidisco/Backbone.Mutators/master/backbone.mutators.js',
'UI/JsLibraries/backbone.shortcuts.js' : 'http://raw.github.com/bry4n/backbone-shortcuts/master/backbone.shortcuts.js', 'UI/JsLibraries/backbone.shortcuts.js' : 'http://raw.github.com/bry4n/backbone-shortcuts/master/backbone.shortcuts.js',
'UI/JsLibraries/backbone.relational.js' : 'http://raw.github.com/PaulUithol/Backbone-relational/0.8.5/backbone-relational.js',
'UI/JsLibraries/backbone.associations.js' : 'http://raw.github.com/dhruvaray/backbone-associations/master/backbone-associations.js',
'UI/JsLibraries/backbone.pageable.js' : 'http://raw.github.com/wyuenho/backbone-pageable/master/lib/backbone-pageable.js', 'UI/JsLibraries/backbone.pageable.js' : 'http://raw.github.com/wyuenho/backbone-pageable/master/lib/backbone-pageable.js',
'UI/JsLibraries/backbone.backgrid.js' : 'http://raw.github.com/wyuenho/backgrid/master/lib/backgrid.js', 'UI/JsLibraries/backbone.backgrid.js' : 'http://raw.github.com/wyuenho/backgrid/master/lib/backgrid.js',
@ -28,6 +26,7 @@ module.exports = function (grunt) {
'UI/JsLibraries/require.js' : 'http://raw.github.com/jrburke/requirejs/master/require.js', 'UI/JsLibraries/require.js' : 'http://raw.github.com/jrburke/requirejs/master/require.js',
'UI/JsLibraries/sugar.js' : 'http://raw.github.com/andrewplummer/Sugar/master/release/sugar-full.development.js', 'UI/JsLibraries/sugar.js' : 'http://raw.github.com/andrewplummer/Sugar/master/release/sugar-full.development.js',
'UI/JsLibraries/underscore.js' : 'http://underscorejs.org/underscore.js', 'UI/JsLibraries/underscore.js' : 'http://underscorejs.org/underscore.js',
'UI/JsLibraries/lodash.underscore.js' : 'http://raw.github.com/bestiejs/lodash/master/dist/lodash.underscore.js',
'UI/JsLibraries/lunr.js' : 'http://raw.github.com/olivernn/lunr.js/master/lunr.js', 'UI/JsLibraries/lunr.js' : 'http://raw.github.com/olivernn/lunr.js/master/lunr.js',
'UI/JsLibraries/messenger.js' : 'http://raw.github.com/HubSpot/messenger/master/build/js/messenger.js', 'UI/JsLibraries/messenger.js' : 'http://raw.github.com/HubSpot/messenger/master/build/js/messenger.js',
@ -36,6 +35,7 @@ module.exports = function (grunt) {
'UI/Content/bootstrap.toggle-switch.css' : 'http://raw.github.com/ghinda/css-toggle-switch/gh-pages/toggle-switch.css', 'UI/Content/bootstrap.toggle-switch.css' : 'http://raw.github.com/ghinda/css-toggle-switch/gh-pages/toggle-switch.css',
/*
'UI/Content/FontAwesome/fontawesome.otf' : 'http://github.com/FortAwesome/Font-Awesome/blob/master/build/assets/font-awesome/font/FontAwesome.otf?raw=true', 'UI/Content/FontAwesome/fontawesome.otf' : 'http://github.com/FortAwesome/Font-Awesome/blob/master/build/assets/font-awesome/font/FontAwesome.otf?raw=true',
'UI/Content/FontAwesome/fontawesome-webfont.eot' : 'http://github.com/FortAwesome/Font-Awesome/blob/master/build/assets/font-awesome/font/fontawesome-webfont.eot?raw=true', 'UI/Content/FontAwesome/fontawesome-webfont.eot' : 'http://github.com/FortAwesome/Font-Awesome/blob/master/build/assets/font-awesome/font/fontawesome-webfont.eot?raw=true',
'UI/Content/FontAwesome/fontawesome-webfont.svg' : 'http://github.com/FortAwesome/Font-Awesome/blob/master/build/assets/font-awesome/font/fontawesome-webfont.svg?raw=true', 'UI/Content/FontAwesome/fontawesome-webfont.svg' : 'http://github.com/FortAwesome/Font-Awesome/blob/master/build/assets/font-awesome/font/fontawesome-webfont.svg?raw=true',
@ -51,6 +51,7 @@ module.exports = function (grunt) {
'UI/Content/FontAwesome/mixins.less' : 'http://raw.github.com/FortAwesome/Font-Awesome/master/build/assets/font-awesome/less/mixins.less', 'UI/Content/FontAwesome/mixins.less' : 'http://raw.github.com/FortAwesome/Font-Awesome/master/build/assets/font-awesome/less/mixins.less',
'UI/Content/FontAwesome/path.less' : 'http://raw.github.com/FortAwesome/Font-Awesome/master/build/assets/font-awesome/less/path.less', 'UI/Content/FontAwesome/path.less' : 'http://raw.github.com/FortAwesome/Font-Awesome/master/build/assets/font-awesome/less/path.less',
'UI/Content/FontAwesome/variables.less' : 'http://raw.github.com/FortAwesome/Font-Awesome/master/build/assets/font-awesome/less/variables.less' 'UI/Content/FontAwesome/variables.less' : 'http://raw.github.com/FortAwesome/Font-Awesome/master/build/assets/font-awesome/less/variables.less'
*/
}, },
clean: { clean: {
@ -125,6 +126,9 @@ module.exports = function (grunt) {
}, },
watch: { watch: {
options: {
nospawn: false,
},
bootstrap : { bootstrap : {
files: ['UI/**/Bootstrap/**', 'UI/**/FontAwesome/**'], files: ['UI/**/Bootstrap/**', 'UI/**/FontAwesome/**'],
tasks: ['less:bootstrap'] tasks: ['less:bootstrap']

View File

@ -5,7 +5,6 @@
<orderEntry type="inheritedJdk" /> <orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" /> <orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="jQuery-1.9.1" level="application" /> <orderEntry type="library" name="jQuery-1.9.1" level="application" />
<orderEntry type="library" name="libraries" level="project" />
</component> </component>
</module> </module>

View File

@ -35,10 +35,7 @@
<option name="FINALLY_ON_NEW_LINE" value="true" /> <option name="FINALLY_ON_NEW_LINE" value="true" />
<option name="ALIGN_MULTILINE_PARAMETERS" value="false" /> <option name="ALIGN_MULTILINE_PARAMETERS" value="false" />
<option name="SPACE_AFTER_COLON" value="false" /> <option name="SPACE_AFTER_COLON" value="false" />
<option name="CALL_PARAMETERS_LPAREN_ON_NEXT_LINE" value="true" /> <option name="METHOD_PARAMETERS_WRAP" value="5" />
<option name="CALL_PARAMETERS_RPAREN_ON_NEXT_LINE" value="true" />
<option name="METHOD_PARAMETERS_LPAREN_ON_NEXT_LINE" value="true" />
<option name="METHOD_PARAMETERS_RPAREN_ON_NEXT_LINE" value="true" />
<option name="ARRAY_INITIALIZER_WRAP" value="2" /> <option name="ARRAY_INITIALIZER_WRAP" value="2" />
<option name="IF_BRACE_FORCE" value="3" /> <option name="IF_BRACE_FORCE" value="3" />
<option name="DOWHILE_BRACE_FORCE" value="3" /> <option name="DOWHILE_BRACE_FORCE" value="3" />

View File

@ -4,6 +4,7 @@
<w>backgrid</w> <w>backgrid</w>
<w>bnzbd</w> <w>bnzbd</w>
<w>clickable</w> <w>clickable</w>
<w>couldn</w>
<w>mouseenter</w> <w>mouseenter</w>
<w>mouseleave</w> <w>mouseleave</w>
</words> </words>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="JavaScriptLibraryMappings"> <component name="JavaScriptLibraryMappings">
<file url="PROJECT" libraries="{libraries}" /> <file url="PROJECT" libraries="{jQuery-1.9.1}" />
</component> </component>
</project> </project>

View File

@ -63,7 +63,7 @@
<option passfail="false" /> <option passfail="false" />
<option white="false" /> <option white="false" />
<option maxerr="50" /> <option maxerr="50" />
<option predef="NzbDrone, define, Backbone, _, window,Handlebars,require,$,Marionette, Backgrid, jQuery, signalR" /> <option predef="window, define, require ,$" />
</component> </component>
</project> </project>

View File

@ -1,51 +0,0 @@
<component name="libraryTable">
<library name="libraries" type="javaScript">
<properties>
<sourceFilesUrls>
<item url="file://$PROJECT_DIR$/JsLibraries/bootstrap.js" />
<item url="file://$PROJECT_DIR$/JsLibraries/backbone.debug.js" />
<item url="file://$PROJECT_DIR$/JsLibraries/jquery.js" />
<item url="file://$PROJECT_DIR$/JsLibraries/sugar.js" />
<item url="file://$PROJECT_DIR$/JsLibraries/backbone.shortcuts.js" />
<item url="file://$PROJECT_DIR$/JsLibraries/jquery.tablesorter.pager.js" />
<item url="file://$PROJECT_DIR$/JsLibraries/handlebars.runtime.js" />
<item url="file://$PROJECT_DIR$/JsLibraries/jquery.tablesorter.bootstrap.js" />
<item url="file://$PROJECT_DIR$/JsLibraries/backbone.modelbinder.js" />
<item url="file://$PROJECT_DIR$/JsLibraries/jquery.tablesorter.js" />
<item url="file://$PROJECT_DIR$/JsLibraries/fullcalendar.js" />
<item url="file://$PROJECT_DIR$/JsLibraries/backbone.collectionbinder.js" />
<item url="file://$PROJECT_DIR$/JsLibraries/underscore.js" />
<item url="file://$PROJECT_DIR$/JsLibraries/backbone.marionette.js" />
<item url="file://$PROJECT_DIR$/JsLibraries/bootstrap.slider.js" />
<item url="file://$PROJECT_DIR$/JsLibraries/backbone.marionette.viewswapper.js" />
<item url="file://$PROJECT_DIR$/JsLibraries/backbone.js" />
<item url="file://$PROJECT_DIR$/JsLibraries/require.js" />
<item url="file://$PROJECT_DIR$/JsLibraries/backbone.mutators.js" />
</sourceFilesUrls>
</properties>
<CLASSES>
<root url="file://$PROJECT_DIR$/JsLibraries/bootstrapSwitch.js" />
<root url="file://$PROJECT_DIR$/JsLibraries/toastr-1.1.5.js" />
<root url="file://$PROJECT_DIR$/JsLibraries/bootstrap.js" />
<root url="file://$PROJECT_DIR$/JsLibraries/backbone.debug.js" />
<root url="file://$PROJECT_DIR$/JsLibraries/jquery.js" />
<root url="file://$PROJECT_DIR$/JsLibraries/sugar.js" />
<root url="file://$PROJECT_DIR$/JsLibraries/backbone.shortcuts.js" />
<root url="file://$PROJECT_DIR$/JsLibraries/jquery.tablesorter.pager.js" />
<root url="file://$PROJECT_DIR$/JsLibraries/handlebars.runtime.js" />
<root url="file://$PROJECT_DIR$/JsLibraries/jquery.tablesorter.bootstrap.js" />
<root url="file://$PROJECT_DIR$/JsLibraries/jquery.tablesorter.js" />
<root url="file://$PROJECT_DIR$/JsLibraries/backbone.modelbinder.js" />
<root url="file://$PROJECT_DIR$/JsLibraries/backbone.collectionbinder.js" />
<root url="file://$PROJECT_DIR$/JsLibraries/fullcalendar.js" />
<root url="file://$PROJECT_DIR$/JsLibraries/underscore.js" />
<root url="file://$PROJECT_DIR$/JsLibraries/backbone.marionette.js" />
<root url="file://$PROJECT_DIR$/JsLibraries/bootstrap.slider.js" />
<root url="file://$PROJECT_DIR$/JsLibraries/backbone.marionette.viewswapper.js" />
<root url="file://$PROJECT_DIR$/JsLibraries/backbone.js" />
<root url="file://$PROJECT_DIR$/JsLibraries/backbone.mutators.js" />
<root url="file://$PROJECT_DIR$/JsLibraries/require.js" />
</CLASSES>
<SOURCES />
</library>
</component>

View File

@ -1,13 +1,9 @@
'use strict'; 'use strict';
define( define(
[ [
'marionette', 'marionette',
'AddSeries/Collection', 'AddSeries/Collection',
'AddSeries/SearchResultCollectionView', 'AddSeries/SearchResultCollectionView',
'Shared/SpinnerView',
'app',
'AddSeries/RootFolders/Collection',
'AddSeries/SearchResultView',
'Shared/SpinnerView' 'Shared/SpinnerView'
], function (Marionette, AddSeriesCollection, SearchResultCollectionView, SpinnerView) { ], function (Marionette, AddSeriesCollection, SearchResultCollectionView, SpinnerView) {
return Marionette.Layout.extend({ return Marionette.Layout.extend({

View File

@ -1,12 +1,11 @@
'use strict'; 'use strict';
define( define(
[ [
'app',
'backbone', 'backbone',
'Series/SeriesModel' 'Series/SeriesModel'
], function (App, Backbone, SeriesModel) { ], function (Backbone, SeriesModel) {
return Backbone.Collection.extend({ return Backbone.Collection.extend({
url : Constants.ApiRoot + '/series/lookup', url : window.ApiRoot + '/series/lookup',
model: SeriesModel, model: SeriesModel,
parse: function (response) { parse: function (response) {

View File

@ -1,4 +1,4 @@
'use strict'; 'use strict';
define( define(
[ [
'backbone', 'backbone',
@ -6,12 +6,12 @@ define(
'mixins/backbone.signalr.mixin' 'mixins/backbone.signalr.mixin'
], function (Backbone, RootFolderModel) { ], function (Backbone, RootFolderModel) {
var rootFolderCollection = Backbone.Collection.extend({ var RootFolderCollection = Backbone.Collection.extend({
url : NzbDrone.Constants.ApiRoot + '/rootfolder', url : window.ApiRoot + '/rootfolder',
model: RootFolderModel model: RootFolderModel
}); });
var collection = new rootFolderCollection().BindSignalR(); var collection = new RootFolderCollection().BindSignalR();
return collection; return collection;
}); });

View File

@ -1,12 +1,12 @@
'use strict'; 'use strict';
define([ define(
'app', [
'marionette',
'Calendar/UpcomingCollection',
'Calendar/UpcomingCollectionView', 'Calendar/UpcomingCollectionView',
'Calendar/CalendarView', 'Calendar/CalendarView',
'Shared/Toolbar/ToolbarLayout' ], function (Marionette, UpcomingCollection, UpcomingCollectionView, CalendarView) {
], return Marionette.Layout.extend({
function () {
NzbDrone.Calendar.CalendarLayout = Backbone.Marionette.Layout.extend({
template: 'Calendar/CalendarLayoutTemplate', template: 'Calendar/CalendarLayoutTemplate',
regions: { regions: {
@ -15,7 +15,7 @@ define([
}, },
initialize: function () { initialize: function () {
this.upcomingCollection = new NzbDrone.Calendar.UpcomingCollection(); this.upcomingCollection = new UpcomingCollection();
this.upcomingCollection.fetch(); this.upcomingCollection.fetch();
}, },
@ -25,13 +25,13 @@ define([
}, },
_showUpcoming: function () { _showUpcoming: function () {
this.upcoming.show(new NzbDrone.Calendar.UpcomingCollectionView({ this.upcoming.show(new UpcomingCollectionView({
collection: this.upcomingCollection collection: this.upcomingCollection
})); }));
}, },
_showCalendar: function () { _showCalendar: function () {
this.calendar.show(new NzbDrone.Calendar.CalendarView()); this.calendar.show(new CalendarView());
} }
}); });
}); });

View File

@ -1,9 +1,17 @@
'use strict'; 'use strict';
define(['app', 'Calendar/Collection','fullcalendar'], function () { define(
NzbDrone.Calendar.CalendarView = Backbone.Marionette.ItemView.extend({ [
'marionette',
'Calendar/Collection',
'fullcalendar'
], function (Marionette, CalendarCollection) {
var _instance;
return Marionette.ItemView.extend({
initialize: function () { initialize: function () {
this.collection = new NzbDrone.Calendar.Collection(); this.collection = new CalendarCollection();
}, },
render : function () { render : function () {
$(this.$el).empty().fullCalendar({ $(this.$el).empty().fullCalendar({
@ -46,7 +54,7 @@ define(['app', 'Calendar/Collection','fullcalendar'], function () {
} }
}); });
NzbDrone.Calendar.CalendarView.Instance = this; _instance = this;
}, },
onShow: function () { onShow: function () {
@ -54,12 +62,10 @@ define(['app', 'Calendar/Collection','fullcalendar'], function () {
}, },
getEvents: function (start, end, callback) { getEvents: function (start, end, callback) {
var bbView = NzbDrone.Calendar.CalendarView.Instance;
var startDate = Date.create(start).format(Date.ISO8601_DATETIME); var startDate = Date.create(start).format(Date.ISO8601_DATETIME);
var endDate = Date.create(end).format(Date.ISO8601_DATETIME); var endDate = Date.create(end).format(Date.ISO8601_DATETIME);
bbView.collection.fetch({ _instance.collection.fetch({
data : { start: startDate, end: endDate }, data : { start: startDate, end: endDate },
success: function (calendarCollection) { success: function (calendarCollection) {
_.each(calendarCollection.models, function (element) { _.each(calendarCollection.models, function (element) {

View File

@ -1,8 +1,12 @@
'use strict'; 'use strict';
define(['app', 'Series/EpisodeModel'], function () { define(
NzbDrone.Calendar.Collection = Backbone.Collection.extend({ [
url : NzbDrone.Constants.ApiRoot + '/calendar', 'backbone',
model : NzbDrone.Series.EpisodeModel, 'Series/EpisodeModel'
], function (Backbone, EpisodeModel) {
return Backbone.Collection.extend({
url : window.ApiRoot + '/calendar',
model: EpisodeModel,
comparator: function (model) { comparator: function (model) {
var date = new Date(model.get('airDate')); var date = new Date(model.get('airDate'));

View File

@ -1,8 +1,12 @@
'use strict'; 'use strict';
define(['app', 'Series/EpisodeModel'], function () { define(
NzbDrone.Calendar.UpcomingCollection = Backbone.Collection.extend({ [
url : NzbDrone.Constants.ApiRoot + '/calendar', 'backbone',
model : NzbDrone.Series.EpisodeModel, 'Series/EpisodeModel'
], function (Backbone, EpisodeModel) {
return Backbone.Collection.extend({
url : window.ApiRoot + '/calendar',
model: EpisodeModel,
comparator: function (model) { comparator: function (model) {
var date = new Date(model.get('airDate')); var date = new Date(model.get('airDate'));

View File

@ -1,7 +1,11 @@
'use strict'; 'use strict';
define(['app', 'Calendar/UpcomingItemView'], function () { define(
NzbDrone.Calendar.UpcomingCollectionView = Backbone.Marionette.CollectionView.extend({ [
itemView: NzbDrone.Calendar.UpcomingItemView 'marionette',
'Calendar/UpcomingItemView'
], function (Marionette, UpcomingItemView) {
return Marionette.CollectionView.extend({
itemView: UpcomingItemView
}); });
}); });

View File

@ -1,11 +1,10 @@
'use strict'; 'use strict';
define([ define(
'app', [
'Calendar/UpcomingCollection' 'marionette'
], function (Marionette) {
], function () { return Marionette.ItemView.extend({
NzbDrone.Calendar.UpcomingItemView = Backbone.Marionette.ItemView.extend({
template: 'Calendar/UpcomingItemTemplate', template: 'Calendar/UpcomingItemTemplate',
tagName : 'div' tagName : 'div'
}); });

View File

@ -1,13 +1,17 @@
'use strict'; 'use strict';
define(['app', 'Shared/FormatHelpers', 'Cells/NzbDroneCell'], function () { define(
return NzbDrone.Cells.NzbDroneCell.extend({ [
'backgrid',
'Shared/FormatHelpers'
], function (Backgrid, FormatHelpers) {
return Backgrid.Cell.extend({
className: 'air-date-cell', className: 'air-date-cell',
render: function () { render: function () {
this.$el.empty(); this.$el.empty();
var airDate = this.model.get(this.column.get('name')); var airDate = this.model.get(this.column.get('name'));
this.$el.html(NzbDrone.Shared.FormatHelpers.DateHelper(airDate)); this.$el.html(FormatHelpers.DateHelper(airDate));
return this; return this;
} }

View File

@ -1,7 +1,10 @@
'use strict'; 'use strict';
define(['app', 'Cells/NzbDroneCell'], function () { define(
return NzbDrone.Cells.NzbDroneCell.extend({ [
'Cells/NzbDroneCell'
], function (NzbDroneCell) {
return NzbDroneCell.extend({
className: 'episode-number-cell', className: 'episode-number-cell',

View File

@ -1,7 +1,10 @@
'use strict'; 'use strict';
define(['app','cells/nzbdronecell' ], function () { define(
return NzbDrone.Cells.NzbDroneCell.extend({ [
'backgrid'
], function (Backgrid) {
return Backgrid.Cell.extend({
className: 'episode-status-cell', className: 'episode-status-cell',

View File

@ -1,7 +1,12 @@
'use strict'; 'use strict';
define(['app', 'Cells/NzbDroneCell'], function () { define(
return NzbDrone.Cells.NzbDroneCell.extend({ [
'app',
'Cells/NzbDroneCell',
'Episode/Layout'
], function (App, NzbDroneCell, EpisodeLayout) {
return NzbDroneCell.extend({
className: 'episode-title-cell', className: 'episode-title-cell',
@ -10,8 +15,8 @@ define(['app', 'Cells/NzbDroneCell'], function () {
}, },
showDetails: function () { showDetails: function () {
var view = new NzbDrone.Episode.Layout({ model: this.cellValue }); var view = new EpisodeLayout({ model: this.cellValue });
NzbDrone.modalRegion.show(view); App.modalRegion.show(view);
}, },
render: function () { render: function () {

View File

@ -1,13 +1,17 @@
'use strict'; 'use strict';
define(['app', 'Shared/FormatHelpers','backgrid'], function () { define(
NzbDrone.Cells.FileSizeCell = Backgrid.Cell.extend({ [
'backgrid',
'Shared/FormatHelpers'
], function (Backgrid, FormatHelpers) {
return Backgrid.Cell.extend({
className: 'file-size-cell', className: 'file-size-cell',
render: function () { render: function () {
var size = this.model.get(this.column.get('name')); var size = this.model.get(this.column.get('name'));
this.$el.html(NzbDrone.Shared.FormatHelpers.FileSizeHelper(size)); this.$el.html(FormatHelpers.FileSizeHelper(size));
this.delegateEvents(); this.delegateEvents();
return this; return this;
} }

View File

@ -1,6 +1,9 @@
'use strict'; 'use strict';
define(['app','backgrid'], function () { define(
NzbDrone.Cells.IndexerCell = Backgrid.Cell.extend({ [
'backgrid'
], function (Backgrid) {
return Backgrid.Cell.extend({
class : 'indexer-cell', class : 'indexer-cell',

View File

@ -1,7 +1,10 @@
'use strict'; 'use strict';
define(['app','backgrid'], function () { define(
NzbDrone.Cells.NzbDroneCell = Backgrid.Cell.extend({ [
'backgrid'
], function (Backgrid) {
return Backgrid.Cell.extend({
_originalInit: Backgrid.Cell.prototype.initialize, _originalInit: Backgrid.Cell.prototype.initialize,

View File

@ -1,5 +1,8 @@
'use strict'; 'use strict';
define(['app', 'Cells/TemplatedCell'], function (App, TemplatedCell) { define(
[
'Cells/TemplatedCell'
], function (TemplatedCell) {
return TemplatedCell.extend({ return TemplatedCell.extend({
className: 'quality-cell', className: 'quality-cell',

View File

@ -1,6 +1,9 @@
'use strict'; 'use strict';
define(['app','Cells/NzbDroneCell'], function () { define(
return NzbDrone.Cells.NzbDroneCell.extend({ [
'Cells/NzbDroneCell'
], function (NzbDroneCell) {
return NzbDroneCell.extend({
className: 'relative-date-cell', className: 'relative-date-cell',

View File

@ -1,25 +0,0 @@
'use strict';
define(['app','cells/nzbdronecell'], function () {
return NzbDrone.Cells.NzbDroneCell.extend({
className: 'series-status-cell',
render: function () {
this.$el.empty();
var monitored = this.model.get('monitored');
var status = this.model.get('status');
if (!monitored) {
this.$el.html('<i class="icon-pause grid-icon" title="Not Monitored"></i>');
}
else if (status === 'continuing') {
this.$el.html('<i class="icon-play grid-icon" title="Continuing"></i>');
}
else {
this.$el.html('<i class="icon-stop grid-icon" title="Ended"></i>');
}
return this;
}
});
});

View File

@ -1,5 +1,8 @@
'use strict'; 'use strict';
define(['app', 'Cells/TemplatedCell'], function (App, TemplatedCell) { define(
[
'Cells/TemplatedCell'
], function (TemplatedCell) {
return TemplatedCell.extend({ return TemplatedCell.extend({
className: 'series-title', className: 'series-title',

View File

@ -1,7 +1,13 @@
'use strict'; 'use strict';
define(['app','Cells/NzbDroneCell'], function () { define(
return NzbDrone.Cells.NzbDroneCell.extend({ [
'marionette',
'Cells/NzbDroneCell'
], function (Marionette, NzbDroneCell) {
return NzbDroneCell.extend({
render: function () { render: function () {
var templateName = this.column.get('template') || this.template; var templateName = this.column.get('template') || this.template;

View File

@ -1,6 +1,9 @@
'use strict'; 'use strict';
define(['app', 'Episode/Layout'], function () { define(
[
'backgrid'
], function (Backgrid) {
return Backgrid.Cell.extend({ return Backgrid.Cell.extend({
className: 'toggle-cell clickable', className: 'toggle-cell clickable',

View File

@ -1,7 +1,6 @@
'use strict'; 'use strict';
define(['app'], function () { define({
Execute: function (name, properties) {
NzbDrone.Commands.Execute = function (name, properties) {
var data = { command: name }; var data = { command: name };
if (properties) { if (properties) {
@ -10,8 +9,8 @@ define(['app'], function () {
return $.ajax({ return $.ajax({
type: 'POST', type: 'POST',
url : NzbDrone.Constants.ApiRoot + '/command', url : window.ApiRoot + '/command',
data: JSON.stringify(data) data: JSON.stringify(data)
}); });
}; }
}); });

View File

@ -2,18 +2,16 @@
define( define(
[ [
'app' 'app'
], function () { ], function (App) {
return {
NzbDrone.Config = {
Events: { Events: {
ConfigUpdatedEvent: 'ConfigUpdatedEvent' ConfigUpdatedEvent: 'ConfigUpdatedEvent'
}, },
Keys : { Keys : {
DefaultQualityProfileId: 'DefaultQualityProfileId' DefaultQualityProfileId: 'DefaultQualityProfileId'
} },
};
NzbDrone.Config.GetValue = function (key, defaultValue) { GetValue: function (key, defaultValue) {
var storeValue = localStorage.getItem(key); var storeValue = localStorage.getItem(key);
@ -22,21 +20,20 @@ define(
} }
return storeValue.toString(); return storeValue.toString();
}; },
NzbDrone.Config.SetValue = function (key, value) { SetValue: function (key, value) {
console.log('Config: [{0}] => [{1}] '.format(key, value)); console.log('Config: [{0}] => [{1}] '.format(key, value));
if (NzbDrone.Config.GetValue(key) === value.toString()) { if (this.GetValue(key) === value.toString()) {
return; return;
} }
localStorage.setItem(key, value); localStorage.setItem(key, value);
NzbDrone.vent.trigger(NzbDrone.Config.Events.ConfigUpdatedEvent, {key: key, value: value}); App.vent.trigger(this.Events.ConfigUpdatedEvent, {key: key, value: value});
}
}; };
return NzbDrone.Config;
}); });

View File

@ -244,10 +244,6 @@ ul.messenger-theme-future {
-ms-border-radius: 4px; -ms-border-radius: 4px;
-o-border-radius: 4px; -o-border-radius: 4px;
border-radius: 4px; border-radius: 4px;
-moz-user-select: none;
-webkit-user-select: none;
-o-user-select: none;
user-select: none;
background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #5c5b5b), color-stop(100%, #353535)); background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #5c5b5b), color-stop(100%, #353535));
background-image: -webkit-linear-gradient(#5c5b5b, #353535); background-image: -webkit-linear-gradient(#5c5b5b, #353535);
background-image: -moz-linear-gradient(#5c5b5b, #353535); background-image: -moz-linear-gradient(#5c5b5b, #353535);

View File

@ -1,4 +1,4 @@
.control-group { .control-group {
.controls { .controls {
i.danger { i.danger {
color: #b94a48; color: #b94a48;
@ -19,6 +19,14 @@
margin-bottom: 0px; margin-bottom: 0px;
} }
.help-inline-checkbox { .help-inline-checkbox {
padding-left: 5px; padding-left: 5px;
display: inline-block; display: inline-block;
@ -35,6 +43,8 @@
font-size: 12px; font-size: 12px;
} }
textarea.nzb-restrictions { textarea.nzb-restrictions {
width: 260px; width: 260px;
} }

View File

@ -1,40 +1,36 @@
'use strict'; 'use strict';
define( define(
[ [
'app', 'app',
'marionette',
'History/HistoryLayout',
'Settings/SettingsLayout', 'Settings/SettingsLayout',
'AddSeries/AddSeriesLayout', 'AddSeries/AddSeriesLayout',
'Missing/MissingLayout',
'History/HistoryLayout',
'Form/FormBuilder',
'Series/Index/SeriesIndexLayout', 'Series/Index/SeriesIndexLayout',
'Calendar/CalendarLayout',
'Shared/NotificationView',
'Shared/NotFoundView',
'MainMenuView',
'Series/Details/SeriesDetailsLayout', 'Series/Details/SeriesDetailsLayout',
'Series/EpisodeCollection', 'Missing/MissingLayout',
'Series/SeriesModel',
'Calendar/CalendarLayout',
'Logs/Layout', 'Logs/Layout',
'Release/Layout', 'Release/Layout',
'Shared/FormatHelpers', 'Shared/NotFoundView'
'Shared/TemplateHelpers', ], function (App, Marionette, HistoryLayout, SettingsLayout, AddSeriesLayout, SeriesIndexLayout, SeriesDetailsLayout, MissingLayout, SeriesModel, CalendarLayout, NotFoundView,
'Shared/Footer/View' LogsLayout, ReleaseLayout) {
], function (App, SettingsLayout, AddSeriesLayout, MissingLayout, HistoryLayout) { return Marionette.Controller.extend({
var controller = Backbone.Marionette.Controller.extend({
series : function () { series : function () {
this._setTitle('NzbDrone'); this._setTitle('NzbDrone');
App.mainRegion.show(new NzbDrone.Series.Index.SeriesIndexLayout()); App.mainRegion.show(new SeriesIndexLayout());
}, },
seriesDetails: function (query) { seriesDetails: function (query) {
var self = this; var self = this;
this._setTitle('Loading Series'); this._setTitle('Loading Series');
var series = new NzbDrone.Series.SeriesModel({ id: query }); var series = new SeriesModel({ id: query });
series.fetch({ series.fetch({
success: function (seriesModel) { success: function (seriesModel) {
self._setTitle(seriesModel.get('title')); self._setTitle(seriesModel.get('title'));
App.mainRegion.show(new NzbDrone.Series.Details.SeriesDetailsLayout({ model: seriesModel })); App.mainRegion.show(new SeriesDetailsLayout({ model: seriesModel }));
} }
}); });
}, },
@ -46,7 +42,7 @@ define(
calendar: function () { calendar: function () {
this._setTitle('Calendar'); this._setTitle('Calendar');
App.mainRegion.show(new NzbDrone.Calendar.CalendarLayout()); App.mainRegion.show(new CalendarLayout());
}, },
@ -69,17 +65,17 @@ define(
rss: function () { rss: function () {
this._setTitle('RSS'); this._setTitle('RSS');
App.mainRegion.show(new NzbDrone.Release.Layout()); App.mainRegion.show(new ReleaseLayout());
}, },
logs: function () { logs: function () {
this._setTitle('logs'); this._setTitle('logs');
App.mainRegion.show(new NzbDrone.Logs.Layout()); App.mainRegion.show(new LogsLayout());
}, },
notFound: function () { notFound: function () {
this._setTitle('Not Found'); this._setTitle('Not Found');
App.mainRegion.show(new NzbDrone.Shared.NotFoundView(this)); App.mainRegion.show(new NotFoundView(this));
}, },
@ -112,8 +108,5 @@ define(
} }
} }
}); });
return new controller();
}); });

View File

@ -1,7 +1,14 @@
'use strict'; 'use strict';
define(['app', 'Shared/SpinnerView', 'Episode/Summary/View', 'Episode/Search/Layout', 'Release/Collection'], function () { define(
[
'marionette',
'Episode/Summary/View',
'Episode/Search/Layout',
'Release/Collection',
'Shared/SpinnerView'
], function (Marionette, SummaryView, SearchLayout, ReleaseCollection, SpinnerView) {
NzbDrone.Episode.Layout = Backbone.Marionette.Layout.extend({ return Marionette.Layout.extend({
template: 'Episode/LayoutTemplate', template: 'Episode/LayoutTemplate',
@ -37,7 +44,7 @@ define(['app', 'Shared/SpinnerView', 'Episode/Summary/View', 'Episode/Search/Lay
} }
this.ui.summary.tab('show'); this.ui.summary.tab('show');
this.summary.show(new NzbDrone.Episode.Summary.View({model: this.model})); this.summary.show(new SummaryView({model: this.model}));
}, },
@ -61,14 +68,14 @@ define(['app', 'Shared/SpinnerView', 'Episode/Summary/View', 'Episode/Search/Lay
var self = this; var self = this;
this.ui.search.tab('show'); this.ui.search.tab('show');
this.search.show(new NzbDrone.Shared.SpinnerView()); this.search.show(new SpinnerView());
var releases = new NzbDrone.Release.Collection(); var releases = new ReleaseCollection();
var promise = releases.fetchEpisodeReleases(this.model.id); var promise = releases.fetchEpisodeReleases(this.model.id);
promise.done(function () { promise.done(function () {
if (!self.isClosed) { if (!self.isClosed) {
self.search.show(new NzbDrone.Episode.Search.Layout({collection: releases})); self.search.show(new SearchLayout({collection: releases}));
} }
}); });
} }

View File

@ -1,20 +1,23 @@
'use strict'; 'use strict';
define([ define(
'app', [
'marionette',
'backgrid',
'Cells/FileSizeCell', 'Cells/FileSizeCell',
'Cells/QualityCell', 'Cells/QualityCell',
'Release/ApprovalStatusCell', 'Release/ApprovalStatusCell',
'Release/DownloadReportCell' 'Release/DownloadReportCell'
], function () { ], function (Marionette, Backgrid, FileSizeCell, QualityCell, ApprovalStatusCell, DownloadReportCell) {
NzbDrone.Episode.Search.Layout = Backbone.Marionette.Layout.extend({ return Marionette.Layout.extend({
template: 'Episode/Search/LayoutTemplate', template: 'Episode/Search/LayoutTemplate',
regions: { regions: {
grid: '#episode-release-grid' grid: '#episode-release-grid'
}, },
columns: [ columns:
[
{ {
name : 'age', name : 'age',
label : 'Age', label : 'Age',
@ -31,31 +34,30 @@ define([
name : 'size', name : 'size',
label : 'Size', label : 'Size',
sortable: true, sortable: true,
cell : NzbDrone.Cells.FileSizeCell cell : FileSizeCell
}, },
{ {
name : 'quality', name : 'quality',
label : 'Quality', label : 'Quality',
sortable: true, sortable: true,
cell : NzbDrone.Cells.QualityCell cell : QualityCell
}, },
{ {
name : 'rejections', name : 'rejections',
label: 'decision', label: 'decision',
cell : NzbDrone.Release.ApprovalStatusCell cell : ApprovalStatusCell
}, },
{ {
name : 'download', name : 'download',
label: '', label: '',
cell : NzbDrone.Release.DownloadReportCell cell : DownloadReportCell
} }
], ],
onShow: function () { onShow: function () {
if (!this.isClosed) { if (!this.isClosed) {
this.grid.show(new Backgrid.Grid( this.grid.show(new Backgrid.Grid({
{
row : Backgrid.Row, row : Backgrid.Row,
columns : this.columns, columns : this.columns,
collection: this.collection, collection: this.collection,

View File

@ -1,7 +1,10 @@
'use strict'; 'use strict';
define(['app'], function () { define(
[
'marionette'
], function (Marionette) {
NzbDrone.Episode.Summary.View = Backbone.Marionette.ItemView.extend({ return Marionette.ItemView.extend({
template: 'Episode/Summary/ViewTemplate' template: 'Episode/Summary/ViewTemplate'
}); });

View File

@ -1,31 +1,50 @@
'use strict'; 'use strict';
define(['app', 'handlebars'], function (App,Handlebars) { define(
[
'handlebars'
], function (Handlebars) {
var formBuilder = function (field) {
if (!field.type) {
return Handlebars.helpers.partial.apply(field,
[
'Form/TextboxTemplate'
]);
}
if (field.type === 'password') {
return Handlebars.helpers.partial.apply(field,
[
'Form/PasswordTemplate'
]);
}
if (field.type === 'checkbox') {
return Handlebars.helpers.partial.apply(field,
[
'Form/CheckboxTemplate'
]);
}
if (field.type === 'select') {
return Handlebars.helpers.partial.apply(field,
[
'Form/SelectTemplate'
]);
}
return Handlebars.helpers.partial.apply(field,
[
'Form/TextboxTemplate'
]);
};
Handlebars.registerHelper('formBuilder', function () { Handlebars.registerHelper('formBuilder', function () {
var ret = ''; var ret = '';
_.each(this.fields, function (field) { _.each(this.fields, function (field) {
ret += NzbDrone.Form.FieldBuilder(field); ret += this.FieldBuilder(field);
}); });
return new Handlebars.SafeString(ret); return new Handlebars.SafeString(ret);
}); });
NzbDrone.Form.FieldBuilder = function (field) {
if (!field.type) {
return Handlebars.helpers.partial.apply(field, ['Form/TextboxTemplate']);
}
if (field.type === 'password') {
return Handlebars.helpers.partial.apply(field, ['Form/PasswordTemplate']);
}
if (field.type === 'checkbox') {
return Handlebars.helpers.partial.apply(field, ['Form/CheckboxTemplate']);
}
if (field.type === 'select') {
return Handlebars.helpers.partial.apply(field, ['Form/SelectTemplate']);
}
return Handlebars.helpers.partial.apply(field, ['Form/TextboxTemplate']);
};
}); });

View File

@ -1,6 +1,9 @@
'use strict'; 'use strict';
define(['templates'], function (Templates) { define(
[
'templates'
], function (Templates) {
return function () { return function () {
this.get = function (templateId) { this.get = function (templateId) {

View File

@ -1,8 +1,12 @@
'use strict'; 'use strict';
define(['app', 'History/Model', 'backbone.pageable'], function (App, HistoryModel, PageableCollection) { define(
[
'History/Model',
'backbone.pageable'
], function ( HistoryModel, PageableCollection) {
return PageableCollection.extend({ return PageableCollection.extend({
url : NzbDrone.Constants.ApiRoot + '/history', url : window.ApiRoot + '/history',
model : NzbDrone.History.Model, model: HistoryModel,
state: { state: {
pageSize: 15, pageSize: 15,
@ -22,7 +26,7 @@ define(['app', 'History/Model', 'backbone.pageable'], function (App, HistoryMode
} }
}, },
parseState: function (resp, queryParams, state) { parseState: function (resp) {
return {totalRecords: resp.totalRecords}; return {totalRecords: resp.totalRecords};
}, },

View File

@ -1,7 +1,10 @@
'use strict'; 'use strict';
define(['app', 'Cells/NzbDroneCell' ], function () { define(
return NzbDrone.Cells.NzbDroneCell.extend({ [
'Cells/NzbDroneCell'
], function (NzbDroneCell) {
return NzbDroneCell.extend({
className: 'history-event-type-cell', className: 'history-event-type-cell',

View File

@ -1,33 +1,19 @@
'use strict'; 'use strict';
define([ define(
'app', [
'marionette',
'backgrid',
'History/Collection', 'History/Collection',
'History/EventTypeCell', 'History/EventTypeCell',
'Cells/RelativeDateCell',
'Cells/TemplatedCell',
'Cells/SeriesTitleCell', 'Cells/SeriesTitleCell',
'Cells/EpisodeNumberCell', 'Cells/EpisodeNumberCell',
'Cells/EpisodeTitleCell', 'Cells/EpisodeTitleCell',
'Cells/QualityCell', 'Cells/QualityCell',
'Shared/Toolbar/ToolbarLayout', 'Cells/RelativeDateCell',
'Shared/Grid/Pager', 'Shared/Grid/Pager',
'Shared/Grid/HeaderCell',
'Shared/LoadingView' 'Shared/LoadingView'
], ], function (Marionette, Backgrid, HistoryCollection, EventTypeCell, SeriesTitleCell, EpisodeNumberCell, EpisodeTitleCell, QualityCell, RelativeDateCell, GridPager, LoadingView) {
function (App, return Marionette.Layout.extend({
HistoryCollection,
EventTypeCell,
RelativeDateCell,
TemplatedCell,
SeriesTitleCell,
EpisodeNumberCell,
EpisodeTitleCell,
QualityCell,
ToolbarLayout,
Pager,
HeaderCell,
LoadingView) {
return Backbone.Marionette.Layout.extend({
template: 'History/HistoryLayoutTemplate', template: 'History/HistoryLayoutTemplate',
regions: { regions: {
@ -36,7 +22,8 @@ define([
pager : '#x-pager' pager : '#x-pager'
}, },
columns: [ columns:
[
{ {
name : 'eventType', name : 'eventType',
label: '', label: '',
@ -71,19 +58,17 @@ define([
} }
], ],
_showTable: function () { _showTable: function (collection) {
this.history.show(new Backgrid.Grid( this.history.show(new Backgrid.Grid({
{
row : NzbDrone.History.Row,
columns : this.columns, columns : this.columns,
collection: this.historyCollection, collection: collection,
className : 'table table-hover' className : 'table table-hover'
})); }));
this.pager.show(new Pager({ this.pager.show(new GridPager({
columns : this.columns, columns : this.columns,
collection: this.historyCollection collection: collection
})); }));
}, },
@ -92,16 +77,11 @@ define([
this.history.show(new LoadingView()); this.history.show(new LoadingView());
this.historyCollection = new HistoryCollection(); var collection = new HistoryCollection();
this.historyCollection.fetch() collection.fetch().done(function () {
.done(function () { self._showTable(collection);
self._showTable();
}); });
//this.toolbar.show(new NzbDrone.Shared.Toolbar.ToolbarLayout({right: [ viewButtons], context: this}));
} }
}) });
; });
})
;

View File

@ -1,6 +1,11 @@
'use strict'; 'use strict';
define(['app','Series/SeriesModel', 'Series/EpisodeModel'], function () { define(
NzbDrone.History.Model = Backbone.Model.extend({ [
'backbone',
'Series/SeriesModel',
'Series/EpisodeModel'
], function (Backbone, SeriesModel, EpisodeModel) {
return Backbone.Model.extend({
mutators: { mutators: {
seasonNumber: function () { seasonNumber: function () {
return this.get('episode').seasonNumber; return this.get('episode').seasonNumber;
@ -12,11 +17,9 @@ define(['app','Series/SeriesModel', 'Series/EpisodeModel'], function () {
}, },
parse: function (model) { parse: function (model) {
model.series = new NzbDrone.Series.SeriesModel(model.series); model.series = new SeriesModel(model.series);
model.episode = new NzbDrone.Series.EpisodeModel(model.episode); model.episode = new EpisodeModel(model.episode);
return model; return model;
} }
}); });
}); });

View File

@ -1,28 +1,28 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"> <html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server"> <head runat="server">
<title>NzbDrone</title> <title>NzbDrone</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/> <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<link href="/content/font.css" rel='stylesheet' type='text/css'/> <link href="/Content/Font.css" rel='stylesheet' type='text/css'/>
<link href="/content/bootstrap.css" rel='stylesheet' type='text/css'/> <link href="/Content/Bootstrap.css" rel='stylesheet' type='text/css'/>
<link href="/content/bootstrap.slider.css" rel='stylesheet' type='text/css'/> <link href="/Content/bootstrap.slider.css" rel='stylesheet' type='text/css'/>
<link href="/Content/Messenger/messenger.css" rel='stylesheet' type='text/css'/> <link href="/Content/Messenger/messenger.css" rel='stylesheet' type='text/css'/>
<link href="/Content/Messenger/messenger.future.css" rel='stylesheet' type='text/css'/> <link href="/Content/Messenger/messenger.future.css" rel='stylesheet' type='text/css'/>
<link href="/content/theme.css" rel='stylesheet' type='text/css'> <link href="/Content/Theme.css" rel='stylesheet' type='text/css'>
<link href="/Cells/cells.css" rel='stylesheet' type='text/css'> <link href="/Cells/Cells.css" rel='stylesheet' type='text/css'>
<link href="/content/fullcalendar.css" rel='stylesheet' type='text/css'> <link href="/Content/fullcalendar.css" rel='stylesheet' type='text/css'>
<link href="/content/backbone.css" rel='stylesheet' type='text/css'/> <link href="/Content/Backbone.css" rel='stylesheet' type='text/css'/>
<link href="/content/backbone.backgrid.filter.css" rel='stylesheet' type='text/css'/> <link href="/Content/backbone.backgrid.filter.css" rel='stylesheet' type='text/css'/>
<link href="/content/bootstrap.toggle-switch.css" rel='stylesheet' type='text/css'/> <link href="/Content/bootstrap.toggle-switch.css" rel='stylesheet' type='text/css'/>
<link href="/AddSeries/addseries.css" rel='stylesheet' type='text/css'/> <link href="/AddSeries/Addseries.css" rel='stylesheet' type='text/css'/>
<link href="/content/menu.css" rel='stylesheet' type='text/css'/> <link href="/Content/menu.css" rel='stylesheet' type='text/css'/>
<link href="/content/form.css" rel='stylesheet' type='text/css'/> <link href="/Content/form.css" rel='stylesheet' type='text/css'/>
<link href="/series/series.css" rel='stylesheet' type='text/css'/> <link href="/Series/Series.css" rel='stylesheet' type='text/css'/>
<link href="/series/details.css" rel='stylesheet' type='text/css'/> <link href="/Series/Details.css" rel='stylesheet' type='text/css'/>
<link href="/content/base.css" rel='stylesheet' type='text/css'/> <link href="/Content/Base.css" rel='stylesheet' type='text/css'/>
<link href="/settings/notifications/notifications.css" rel='stylesheet' type='text/css'/> <link href="/Settings/Notifications/notifications.css" rel='stylesheet' type='text/css'/>
<link href="/settings/indexers/indexers.css" rel='stylesheet' type='text/css'/> <link href="/Settings/Indexers/indexers.css" rel='stylesheet' type='text/css'/>
<link href="/calendar/calendar.css" rel='stylesheet' type='text/css'/> <link href="/Calendar/Calendar.css" rel='stylesheet' type='text/css'/>
</head> </head>
<body> <body>
<div id="in-sub-nav"> <div id="in-sub-nav">

View File

@ -1,14 +1,6 @@
'use strict'; 'use strict';
(function () { (function () {
/* var model = new NzbDrone.Shared.NotificationModel();
model.set('title','test notification');
model.set('message','test message');
model.set('level', 'error');
this.push(model);
*/
if (!window.console) { if (!window.console) {
window.console = {}; window.console = {};
} }

View File

@ -1,8 +1,8 @@
'use strict'; 'use strict';
define(['app', 'Logs/Model', 'backbone.pageable'], function (app, SeriesModel, PagableCollection) { define(['backbone.pageable', 'Logs/Model', ], function (PagableCollection, LogsModel) {
NzbDrone.Logs.Collection = PagableCollection.extend({ return PagableCollection.extend({
url : NzbDrone.Constants.ApiRoot + '/log', url : window.ApiRoot + '/log',
model: NzbDrone.Logs.Model, model: LogsModel,
state: { state: {
pageSize: 50, pageSize: 50,

View File

@ -1,12 +1,12 @@
'use strict'; 'use strict';
define([ define([
'app', 'marionette',
'Logs/Collection', 'backgrid',
'Shared/Toolbar/ToolbarLayout', 'Shared/Grid/Pager',
'Shared/Grid/Pager' 'Logs/Collection'
], ],
function () { function (Marionette,Backgrid, GridPager, LogCollection) {
NzbDrone.Logs.Layout = Backbone.Marionette.Layout.extend({ return Marionette.Layout.extend({
template: 'Logs/LayoutTemplate', template: 'Logs/LayoutTemplate',
regions: { regions: {
@ -51,20 +51,19 @@ define([
className : 'table table-hover' className : 'table table-hover'
})); }));
this.pager.show(new NzbDrone.Shared.Grid.Pager({ this.pager.show(new GridPager({
columns : this.columns, columns : this.columns,
collection: this.collection collection: this.collection
})); }));
}, },
initialize: function () { initialize: function () {
this.collection = new NzbDrone.Logs.Collection(); this.collection = new LogCollection();
this.collection.fetch(); this.collection.fetch();
}, },
onShow: function () { onShow: function () {
this.showTable(); this.showTable();
//this.toolbar.show(new NzbDrone.Shared.Toolbar.ToolbarLayout({right: [ viewButtons], context: this}));
} }
}) })

View File

@ -1,14 +1,8 @@
'use strict'; 'use strict';
define(['app'], function (app) { define(
NzbDrone.Logs.Model = Backbone.Model.extend({ [
/* mutators: { 'backbone'
seasonNumber: function () { ], function (Backbone) {
return this.get('episode').seasonNumber; return Backbone.Model.extend({
},
paddedEpisodeNumber: function () {
return this.get('episode').episodeNumber.pad(2);
}
}*/
}); });
}); });

View File

@ -1,6 +1,6 @@
'use strict'; 'use strict';
define(['app'], function () { define(['marionette'], function (Marionette) {
var MainMenuView = Backbone.Marionette.ItemView.extend({ var MainMenuView = Marionette.ItemView.extend({
events: { events: {
'click a': 'onClick' 'click a': 'onClick'
}, },

View File

@ -1,8 +1,12 @@
'use strict'; 'use strict';
define(['app', 'Series/EpisodeModel', 'backbone.pageable'], function (app, EpisodeModel, PagableCollection) { define(
[
'Series/EpisodeModel',
'backbone.pageable'
], function (EpisodeModel, PagableCollection) {
return PagableCollection.extend({ return PagableCollection.extend({
url : NzbDrone.Constants.ApiRoot + '/missing', url : window.ApiRoot + '/missing',
model: NzbDrone.Series.EpisodeModel, model: EpisodeModel,
state: { state: {
pageSize: 15, pageSize: 15,
@ -22,7 +26,7 @@ define(['app', 'Series/EpisodeModel', 'backbone.pageable'], function (app, Episo
} }
}, },
parseState: function (resp, queryParams, state) { parseState: function (resp) {
return {totalRecords: resp.totalRecords}; return {totalRecords: resp.totalRecords};
}, },

View File

@ -1,29 +1,17 @@
'use strict'; 'use strict';
define( define(
[ [
'app', 'marionette',
'Missing/Row', 'backgrid',
'Missing/Collection', 'Missing/Collection',
'Cells/AirDateCell',
'Series/Index/Table/SeriesStatusCell',
'Shared/Toolbar/ToolbarLayout',
'Cells/SeriesTitleCell', 'Cells/SeriesTitleCell',
'Cells/EpisodeNumberCell', 'Cells/EpisodeNumberCell',
'Cells/EpisodeTitleCell', 'Cells/EpisodeTitleCell',
'Cells/AirDateCell',
'Shared/Grid/Pager', 'Shared/Grid/Pager',
'Shared/LoadingView' 'Shared/LoadingView'
], function (App, ], function (Marionette, Backgrid, MissingCollection, SeriesTitleCell, EpisodeNumberCell, EpisodeTitleCell, AirDateCell, GridPager, LoadingView) {
MissingRow, return Marionette.Layout.extend({
MissingCollection,
AirDateCell,
SeriesStatusCell,
ToolbarLayout,
SeriesTitleCell,
EpisodeNumberCell,
EpisodeTitleCell,
Pager,
LoadingView) {
return Backbone.Marionette.Layout.extend({
template: 'Missing/MissingLayoutTemplate', template: 'Missing/MissingLayoutTemplate',
regions: { regions: {
@ -61,13 +49,12 @@ define(
_showTable: function () { _showTable: function () {
this.missing.show(new Backgrid.Grid({ this.missing.show(new Backgrid.Grid({
row : MissingRow,
columns : this.columns, columns : this.columns,
collection: this.missingCollection, collection: this.missingCollection,
className : 'table table-hover' className : 'table table-hover'
})); }));
this.pager.show(new NzbDrone.Shared.Grid.Pager({ this.pager.show(new GridPager({
columns : this.columns, columns : this.columns,
collection: this.missingCollection collection: this.missingCollection
})); }));

View File

@ -1,12 +1,12 @@
'use strict'; 'use strict';
define(['app'], function () { define(function () {
$.fn.autoComplete = function (resource) { $.fn.autoComplete = function (resource) {
$(this).typeahead({ $(this).typeahead({
source : function (filter, callback) { source : function (filter, callback) {
$.ajax({ $.ajax({
url : NzbDrone.Constants.ApiRoot + resource, url : window.ApiRoot + resource,
dataType: 'json', dataType: 'json',
type : 'GET', type : 'GET',
data : { query: filter }, data : { query: filter },

View File

@ -1,5 +1,8 @@
'use strict'; 'use strict';
define(['app', 'signalR'], function () { define(
[
'signalR'
], function () {
_.extend(Backbone.Collection.prototype, {BindSignalR: function (options) { _.extend(Backbone.Collection.prototype, {BindSignalR: function (options) {
@ -40,7 +43,10 @@ define(['app', 'signalR'], function () {
self.fetch(); self.fetch();
}); });
connection.start({ transport: ['longPolling'] }); connection.start({ transport:
[
'longPolling'
] });
return this; return this;
}}); }});

View File

@ -1,9 +1,10 @@
'use strict'; 'use strict';
define(['app', 'Quality/QualitySizeModel'], function () { define(
NzbDrone.Quality.QualitySizeCollection = Backbone.Collection.extend({ [
model: NzbDrone.Quality.QualitySizeModel, 'Quality/QualitySizeModel'
url : NzbDrone.Constants.ApiRoot + '/qualitysize' ], function (QualitySizeModel) {
return Backbone.Collection.extend({
model: QualitySizeModel,
url : window.ApiRoot + '/qualitysize'
}); });
return NzbDrone.Quality.QualitySizeCollection;
}); });

View File

@ -1,10 +1,9 @@
'use strict'; 'use strict';
define(['app'], function () { define(
NzbDrone.Quality.QualitySizeModel = Backbone.Model.extend({ [
'backbone'
initialize: function () { ], function (Backbone) {
this.validators = {}; return Backbone.Model.extend({
},
mutators: { mutators: {
thirtyMinuteSize: function () { thirtyMinuteSize: function () {

View File

@ -1,12 +1,16 @@
'use strict'; 'use strict';
define(['app', 'Quality/QualityProfileModel'], function () { define(
[
'backbone',
'Quality/QualityProfileModel'
], function (Backbone, QualityProfileModel) {
var qualityProfileCollection = Backbone.Collection.extend({ var QualityProfileCollection = Backbone.Collection.extend({
model: NzbDrone.Quality.QualityProfileModel, model: QualityProfileModel,
url : NzbDrone.Constants.ApiRoot + '/qualityprofiles' url : window.ApiRoot + '/qualityprofiles'
}); });
var profiles = new qualityProfileCollection(); var profiles = new QualityProfileCollection();
profiles.fetch(); profiles.fetch();

View File

@ -1,7 +1,9 @@
'use strict'; 'use strict';
define(['app', 'backbone.deepmodel'], function (App, DeepModel) { define(
NzbDrone.Quality.QualityProfileModel = DeepModel.DeepModel.extend({ [
'backbone.deepmodel'
], function (DeepModel) {
return DeepModel.DeepModel.extend({
defaults: { defaults: {
id : null, id : null,
name : '', name : '',

View File

@ -1,7 +1,11 @@
'use strict'; 'use strict';
define(
[
'backgrid'
], function (Backgrid) {
require(['app', 'backgrid'], function () {
NzbDrone.Release.ApprovalStatusCell = Backgrid.Cell.extend({ return Backgrid.Cell.extend({
className: 'approval-status-cell', className: 'approval-status-cell',

View File

@ -1,8 +1,12 @@
'use strict'; 'use strict';
define(['app', 'Release/Model', 'backbone.pageable'], function (app, SeriesModel, PagableCollection) { define(
NzbDrone.Release.Collection = PagableCollection.extend({ [
url : NzbDrone.Constants.ApiRoot + '/release', 'Release/Model',
model: NzbDrone.Release.Model, 'backbone.pageable'
], function (ReleaseModel, PagableCollection) {
return PagableCollection.extend({
url : window.ApiRoot + '/release',
model: ReleaseModel,
mode: 'client', mode: 'client',

View File

@ -1,7 +1,10 @@
'use strict'; 'use strict';
define(['app','backgrid'], function () { define(
NzbDrone.Release.DownloadReportCell = Backgrid.Cell.extend({ [
'backgrid'
], function (Backgrid) {
return Backgrid.Cell.extend({
className: 'download-report-cell', className: 'download-report-cell',
@ -14,8 +17,7 @@ define(['app','backgrid'], function () {
var self = this; var self = this;
this.$el.html('<i class =\'icon-spinner icon-spin\' />'); this.$el.html('<i class =\'icon-spinner icon-spin\' />');
this.model.save() this.model.save().always(function () {
.always(function () {
self.$el.html('<i class =\'icon-download-alt\' />'); self.$el.html('<i class =\'icon-download-alt\' />');
}); });
}, },
@ -27,7 +29,4 @@ define(['app','backgrid'], function () {
} }
}); });
return NzbDrone.Release.DownloadReportCell;
}); });

View File

@ -1,17 +1,17 @@
'use strict'; 'use strict';
define([ define(
'app', [
'marionette',
'backgrid',
'Release/Collection', 'Release/Collection',
'Release/ApprovalStatusCell', 'Cells/IndexerCell',
'Shared/SpinnerView',
'Shared/Toolbar/ToolbarLayout',
'Cells/EpisodeNumberCell', 'Cells/EpisodeNumberCell',
'Cells/FileSizeCell', 'Cells/FileSizeCell',
'Cells/IndexerCell', 'Cells/QualityCell',
'Cells/QualityCell' 'Release/ApprovalStatusCell',
], 'Shared/SpinnerView'
function () { ], function (Marionette, Backgrid, ReleaseCollection, IndexerCell, EpisodeNumberCell, FileSizeCell, QualityCell, ApprovalStatusCell, SpinnerView) {
NzbDrone.Release.Layout = Backbone.Marionette.Layout.extend({ return Marionette.Layout.extend({
template: 'Release/LayoutTemplate', template: 'Release/LayoutTemplate',
regions: { regions: {
@ -19,12 +19,13 @@ define([
toolbar: '#x-toolbar' toolbar: '#x-toolbar'
}, },
columns: [ columns:
[
{ {
name : 'indexer', name : 'indexer',
label : 'Indexer', label : 'Indexer',
sortable: true, sortable: true,
cell : NzbDrone.Cells.IndexerCell cell : IndexerCell
}, },
{ {
@ -37,32 +38,31 @@ define([
name : 'episodeNumbers', name : 'episodeNumbers',
episodes: 'episodeNumbers', episodes: 'episodeNumbers',
label : 'season', label : 'season',
cell : NzbDrone.Cells.EpisodeNumberCell cell : EpisodeNumberCell
}, },
{ {
name : 'size', name : 'size',
label : 'Size', label : 'Size',
sortable: true, sortable: true,
cell : NzbDrone.Cells.FileSizeCell cell : FileSizeCell
}, },
{ {
name : 'quality', name : 'quality',
label : 'Quality', label : 'Quality',
sortable: true, sortable: true,
cell : NzbDrone.Cells.QualityCell cell : QualityCell
}, },
{ {
name : 'rejections', name : 'rejections',
label: 'decision', label: 'decision',
cell : NzbDrone.Release.ApprovalStatusCell cell : ApprovalStatusCell
} }
], ],
showTable: function () { showTable: function () {
if (!this.isClosed) { if (!this.isClosed) {
this.grid.show(new Backgrid.Grid( this.grid.show(new Backgrid.Grid({
{
row : Backgrid.Row, row : Backgrid.Row,
columns : this.columns, columns : this.columns,
collection: this.collection, collection: this.collection,
@ -72,7 +72,7 @@ define([
}, },
initialize: function () { initialize: function () {
this.collection = new NzbDrone.Release.Collection(); this.collection = new ReleaseCollection();
this.fetchPromise = this.collection.fetch(); this.fetchPromise = this.collection.fetch();
}, },
@ -80,12 +80,11 @@ define([
var self = this; var self = this;
this.grid.show(new NzbDrone.Shared.SpinnerView()); this.grid.show(new SpinnerView());
this.fetchPromise.done(function () { this.fetchPromise.done(function () {
self.showTable(); self.showTable();
}); });
//this.toolbar.show(new NzbDrone.Shared.Toolbar.ToolbarLayout({right: [ viewButtons], context: this}));
} }
}); });

View File

@ -1,6 +1,6 @@
'use strict'; 'use strict';
define(['app'], function () { define(['backbone'], function (Backbone) {
NzbDrone.Release.Model = Backbone.Model.extend({ return Backbone.Model.extend({
/* mutators: { /* mutators: {
seasonNumber: function () { seasonNumber: function () {
return this.get('episode').seasonNumber; return this.get('episode').seasonNumber;

View File

@ -1,4 +1,4 @@
'use strict'; 'use strict';
require( require(
[ [
'app', 'app',
@ -7,9 +7,9 @@ require(
'jQuery/RouteBinder' 'jQuery/RouteBinder'
], function (App, Marionette, Controller, RouterBinder) { ], function (App, Marionette, Controller, RouterBinder) {
NzbDrone.Router = Marionette.AppRouter.extend({ var Router = Marionette.AppRouter.extend({
controller: Controller, controller: new Controller(),
appRoutes : { appRoutes : {
'' : 'series', '' : 'series',
'series' : 'series', 'series' : 'series',
@ -28,17 +28,16 @@ require(
} }
}); });
NzbDrone.addInitializer(function () { App.addInitializer(function () {
NzbDrone.Router = new NzbDrone.Router(); App.Router = new Router();
Backbone.history.start({ pushState: true }); Backbone.history.start({ pushState: true });
RouterBinder.bind(NzbDrone.Router); RouterBinder.bind(App.Router);
// NzbDrone.footerRegion.show(new FooterView());
}); });
return NzbDrone.Router; return App.Router;
}); });

View File

@ -2,10 +2,10 @@
define( define(
[ [
'app', 'app',
'Series/SeriesModel' 'marionette'
], function () { ], function (App, Marionette) {
NzbDrone.Series.Delete.DeleteSeriesView = Backbone.Marionette.ItemView.extend({ return Marionette.ItemView.extend({
template: 'Series/Delete/DeleteSeriesTemplate', template: 'Series/Delete/DeleteSeriesTemplate',
events: { events: {
@ -24,11 +24,8 @@ define(
data: { 'deleteFiles': deleteFiles }, data: { 'deleteFiles': deleteFiles },
wait: true wait: true
}).done(function () { }).done(function () {
NzbDrone.modalRegion.close(); App.modalRegion.close();
}); });
} }
}); });
return NzbDrone.Series.Delete.DeleteSeriesView;
}); });

View File

@ -1,10 +1,10 @@
'use strict'; 'use strict';
define(['app', define(
'Series/Details/SeasonLayout', [
'Series/SeasonCollection', 'marionette',
'Series/EpisodeCollection'], 'Series/Details/SeasonLayout'
function (App, SeasonLayout, SeasonCollection, EpisodeCollection) { ], function (Marionette, SeasonLayout) {
NzbDrone.Series.Details.SeasonCollectionView = Backbone.Marionette.CollectionView.extend({ return Marionette.CollectionView.extend({
itemView: SeasonLayout, itemView: SeasonLayout,

View File

@ -1,13 +1,17 @@
'use strict'; 
define([ 'use strict';
'app', define(
'Cells/EpisodeStatusCell', [
'marionette',
'backgrid',
'Cells/ToggleCell',
'Cells/EpisodeTitleCell', 'Cells/EpisodeTitleCell',
'Cells/AirDateCell', 'Cells/AirDateCell',
'Cells/ToggleCell', 'Cells/EpisodeStatusCell',
'Shared/Messenger'], 'Commands/CommandController',
function (App, EpisodeStatusCell, EpisodeTitleCell, AirDateCell, ToggleCell, Messenger) { 'Shared/Messenger'
return Backbone.Marionette.Layout.extend({ ], function ( Marionette, Backgrid, ToggleCell, EpisodeTitleCell, AirDateCell, EpisodeStatusCell, CommandController, Messenger) {
return Marionette.Layout.extend({
template: 'Series/Details/SeasonLayoutTemplate', template: 'Series/Details/SeasonLayoutTemplate',
ui: { ui: {
@ -22,8 +26,8 @@ define([
episodeGrid: '#x-episode-grid' episodeGrid: '#x-episode-grid'
}, },
columns: [ columns:
[
{ {
name : 'ignored', name : 'ignored',
label : '', label : '',
@ -38,7 +42,6 @@ define([
className: 'episode-number-cell' className: 'episode-number-cell'
}) })
}, },
{ {
name : 'this', name : 'this',
label: 'Title', label: 'Title',
@ -66,8 +69,7 @@ define([
}, },
onShow: function () { onShow: function () {
this.episodeGrid.show(new Backgrid.Grid( this.episodeGrid.show(new Backgrid.Grid({
{
columns : this.columns, columns : this.columns,
collection: this.episodeCollection, collection: this.episodeCollection,
className : 'table table-hover season-grid' className : 'table table-hover season-grid'
@ -87,7 +89,7 @@ define([
}; };
var self = this; var self = this;
var commandPromise = App.Commands.Execute(command, properties); var commandPromise = CommandController.Execute(command, properties);
commandPromise.fail(function (options) { commandPromise.fail(function (options) {
if (options.readyState === 0 || options.status === 0) { if (options.readyState === 0 || options.status === 0) {

View File

@ -1,6 +1,14 @@
'use strict'; 'use strict';
define(['app', 'Series/Details/SeasonCollectionView', 'Shared/LoadingView','backstrech'], function () { define(
NzbDrone.Series.Details.SeriesDetailsLayout = Backbone.Marionette.Layout.extend({ [
'marionette',
'Series/EpisodeCollection',
'Series/SeasonCollection',
'Series/Details/SeasonCollectionView',
'Shared/LoadingView',
'backstrech'
], function (Marionette, EpisodeCollection, SeasonCollection, SeasonCollectionView, LoadingView) {
return Marionette.Layout.extend({
itemViewContainer: '.x-series-seasons', itemViewContainer: '.x-series-seasons',
template : 'Series/Details/SeriesDetailsTemplate', template : 'Series/Details/SeriesDetailsTemplate',
@ -27,19 +35,17 @@ define(['app', 'Series/Details/SeasonCollectionView', 'Shared/LoadingView','back
$('body').removeClass('backdrop'); $('body').removeClass('backdrop');
} }
this.seasons.show(new NzbDrone.Shared.LoadingView()); this.seasons.show(new LoadingView());
this.seasonCollection = new NzbDrone.Series.SeasonCollection(); this.seasonCollection = new SeasonCollection();
this.episodeCollection = new NzbDrone.Series.EpisodeCollection(); this.episodeCollection = new EpisodeCollection();
$.when(this.episodeCollection.fetch({data: { seriesId: this.model.id }}), this.seasonCollection.fetch({data: { seriesId: this.model.id }})) $.when(this.episodeCollection.fetch({data: { seriesId: this.model.id }}), this.seasonCollection.fetch({data: { seriesId: this.model.id }})).done(function () {
.done(function () { self.seasons.show(new SeasonCollectionView({
self.seasons.show(new NzbDrone.Series.Details.SeasonCollectionView({
collection : self.seasonCollection, collection : self.seasonCollection,
episodeCollection: self.episodeCollection episodeCollection: self.episodeCollection
})); }));
} });
);
}, },
onClose: function () { onClose: function () {
@ -47,5 +53,4 @@ define(['app', 'Series/Details/SeasonCollectionView', 'Shared/LoadingView','back
$('body').removeClass('backdrop'); $('body').removeClass('backdrop');
} }
}); });
} });
);

View File

@ -1,7 +1,14 @@
'use strict'; 'use strict';
define(['app', 'Series/SeriesModel', 'Series/Delete/DeleteSeriesView', 'Quality/QualityProfileCollection'], function (app, seriesModel, deleteSeriesView, qualityProfiles) { define(
[
'App',
'marionette',
'Series/Delete/DeleteSeriesView',
'Quality/QualityProfileCollection',
'Mixins/AsModelBoundView'
], function (App, Marionette, DeleteSeriesView, QualityProfiles, AsModelBoundView) {
NzbDrone.Series.Edit.EditSeriesView = Backbone.Marionette.ItemView.extend({ var view = Marionette.ItemView.extend({
template: 'Series/Edit/EditSeriesTemplate', template: 'Series/Edit/EditSeriesTemplate',
ui: { ui: {
@ -17,9 +24,7 @@ define(['app', 'Series/SeriesModel', 'Series/Delete/DeleteSeriesView', 'Quality/
initialize: function () { initialize: function () {
this.model.set('qualityProfiles', QualityProfiles);
this.model.set('qualityProfiles',qualityProfiles);
}, },
@ -33,13 +38,13 @@ define(['app', 'Series/SeriesModel', 'Series/Delete/DeleteSeriesView', 'Quality/
this.model.save(); this.model.save();
this.trigger('saved'); this.trigger('saved');
NzbDrone.modalRegion.closeModal(); App.modalRegion.closeModal();
}, },
removeSeries: function () { removeSeries: function () {
var view = new NzbDrone.Series.Delete.DeleteSeriesView({ model: this.model }); var view = new DeleteSeriesView({ model: this.model });
NzbDrone.modalRegion.show(view); App.modalRegion.show(view);
} }
}); });
return AsModelBoundView.apply(view);
}); });

View File

@ -1,18 +1,21 @@
'use strict'; 'use strict';
define(['app', 'Series/EpisodeModel'], function () { define(
NzbDrone.Series.EpisodeCollection = Backbone.Collection.extend({ [
url : NzbDrone.Constants.ApiRoot + '/episodes', 'backbone',
model: NzbDrone.Series.EpisodeModel, 'Series/EpisodeModel'
], function (Backbone, EpisodeModel) {
return Backbone.Collection.extend({
url : window.ApiRoot + '/episodes',
model: EpisodeModel,
bySeason: function (season) { bySeason: function (season) {
var filtered = this.filter(function (episode) { var filtered = this.filter(function (episode) {
return episode.get('seasonNumber') === season; return episode.get('seasonNumber') === season;
}); });
return new NzbDrone.Series.EpisodeCollection(filtered); var EpisodeCollection = require('Series/EpisodeCollection');
return new EpisodeCollection(filtered);
} }
}); });
return NzbDrone.Series.EpisodeCollection;
}); });

View File

@ -1,10 +1,13 @@
'use strict'; 'use strict';
define(['app', 'Series/SeriesModel'], function () { define(
NzbDrone.Series.EpisodeModel = Backbone.Model.extend({ [
'backbone',
'Series/SeriesModel'
], function (Backbone, SeriesModel) {
return Backbone.Model.extend({
mutators: { mutators: {
paddedEpisodeNumber: function () { paddedEpisodeNumber: function () {
var test = this.get('episodeNumber');
return this.get('episodeNumber').pad(2); return this.get('episodeNumber').pad(2);
}, },
day : function () { day : function () {
@ -30,6 +33,8 @@ define(['app', 'Series/SeriesModel'], function () {
return start.addMinutes(runtime); return start.addMinutes(runtime);
} }
return undefined;
}, },
statusLevel : function () { statusLevel : function () {
var episodeFileId = this.get('episodeFileId'); var episodeFileId = this.get('episodeFileId');
@ -58,7 +63,7 @@ define(['app', 'Series/SeriesModel'], function () {
parse: function (model) { parse: function (model) {
model.series = new NzbDrone.Series.SeriesModel(model.series); model.series = new SeriesModel(model.series);
return model; return model;
}, },
@ -70,13 +75,13 @@ define(['app', 'Series/SeriesModel'], function () {
// check if we have some getter mutations // check if we have some getter mutations
if (_.isObject(this.mutators[name]) === true && _.isFunction(this.mutators[name].get)) { if (_.isObject(this.mutators[name]) === true && _.isFunction(this.mutators[name].get)) {
json[name] = _.bind(this.mutators[name].get, this)(); json[name] = _.bind(this.mutators[name].get, this)();
} else { }
else {
json[name] = _.bind(this.mutators[name], this)(); json[name] = _.bind(this.mutators[name], this)();
} }
}, this)); }, this));
if (this.has('series')) if (this.has('series')) {
{
json.series = this.get('series').toJSON(); json.series = this.get('series').toJSON();
} }
return json; return json;
@ -87,6 +92,4 @@ define(['app', 'Series/SeriesModel'], function () {
status : 0 status : 0
} }
}); });
return NzbDrone.Series.EpisodeModel;
}); });

View File

@ -1,8 +1,9 @@
'use strict'; 'use strict';
define(['app'], function () { define(
NzbDrone.Series.Index.EmptySeriesCollectionView = Backbone.Marionette.CompositeView.extend({ [
'marionette'
], function (Marionette) {
return Marionette.CompositeView.extend({
template: 'Series/Index/EmptySeriesIndexTemplate' template: 'Series/Index/EmptySeriesIndexTemplate'
}); });
return NzbDrone.Series.Index.EmptySeriesCollectionView;
}); });

View File

@ -1,10 +1,11 @@
'use strict'; 'use strict';
define(['app'], function () { define(
[
'marionette'
], function (Marionette) {
NzbDrone.Series.Index.EmptyView = Backbone.Marionette.CompositeView.extend({ return Marionette.CompositeView.extend({
template: 'Series/Index/EmptyTemplate' template: 'Series/Index/EmptyTemplate'
}); });
return NzbDrone.Series.Index.EmptyView;
}); });

View File

@ -1,12 +1,14 @@
'use strict'; 'use strict';
define(['app', 'Series/Index/List/ItemView', 'Config'], function () { define(
[
'marionette',
'Series/Index/List/ItemView'
], function (Marionette, ListItemView) {
NzbDrone.Series.Index.List.CollectionView = Backbone.Marionette.CompositeView.extend({ return Marionette.CompositeView.extend({
itemView : NzbDrone.Series.Index.List.ItemView, itemView : ListItemView,
itemViewContainer: '#x-series-list', itemViewContainer: '#x-series-list',
template : 'Series/Index/List/CollectionTemplate' template : 'Series/Index/List/CollectionTemplate'
}); });
return NzbDrone.Series.Index.List.CollectionView;
}); });

View File

@ -1,15 +1,14 @@
'use strict'; 'use strict';
define([ define(
[
'app', 'app',
'Quality/QualityProfileCollection', 'marionette',
'Series/SeriesCollection',
'Series/Edit/EditSeriesView', 'Series/Edit/EditSeriesView',
'Series/Delete/DeleteSeriesView', 'Series/Delete/DeleteSeriesView'
'Shared/FormatHelpers'
], function () { ], function (App, Marionette, EditSeriesView, DeleteSeriesView) {
NzbDrone.Series.Index.List.ItemView = Backbone.Marionette.ItemView.extend({ return Marionette.ItemView.extend({
template: 'Series/Index/List/ItemTemplate', template: 'Series/Index/List/ItemTemplate',
ui: { ui: {
@ -22,15 +21,13 @@ define([
}, },
editSeries: function () { editSeries: function () {
var view = new NzbDrone.Series.Edit.EditSeriesView({ model: this.model}); var view = new EditSeriesView({ model: this.model});
NzbDrone.modalRegion.show(view); App.modalRegion.show(view);
}, },
removeSeries: function () { removeSeries: function () {
var view = new NzbDrone.Series.Delete.DeleteSeriesView({ model: this.model }); var view = new DeleteSeriesView({ model: this.model });
NzbDrone.modalRegion.show(view); App.modalRegion.show(view);
} }
}); });
return NzbDrone.Series.Index.List.ItemView;
}); });

View File

@ -1,12 +1,14 @@
'use strict'; 'use strict';
define(['app', 'Series/Index/Posters/ItemView', 'Config'], function () { define(
[
'marionette',
'Series/Index/Posters/ItemView'
], function (Marionette, PosterItemView) {
NzbDrone.Series.Index.Posters.CollectionView = Backbone.Marionette.CompositeView.extend({ return Marionette.CompositeView.extend({
itemView : NzbDrone.Series.Index.Posters.ItemView, itemView : PosterItemView,
itemViewContainer: '#x-series-posters', itemViewContainer: '#x-series-posters',
template : 'Series/Index/Posters/CollectionTemplate' template : 'Series/Index/Posters/CollectionTemplate'
}); });
return NzbDrone.Series.Index.Posters.CollectionView;
}); });

View File

@ -1,14 +1,15 @@
'use strict'; 'use strict';
define([ define(
[
'app', 'app',
'Series/SeriesCollection', 'marionette',
'Series/Edit/EditSeriesView', 'Series/Edit/EditSeriesView',
'Series/Delete/DeleteSeriesView' 'Series/Delete/DeleteSeriesView'
], function () { ], function (App, Marionette, EditSeriesView, DeleteSeriesView) {
NzbDrone.Series.Index.Posters.ItemView = Backbone.Marionette.ItemView.extend({ return Marionette.ItemView.extend({
tagName : 'li', tagName : 'li',
template: 'Series/Index/Posters/ItemTemplate', template: 'Series/Index/Posters/ItemTemplate',
@ -27,19 +28,17 @@ define([
editSeries: function () { editSeries: function () {
var view = new NzbDrone.Series.Edit.EditSeriesView({ model: this.model}); var view = new EditSeriesView({ model: this.model});
NzbDrone.modalRegion.show(view); App.modalRegion.show(view);
}, },
removeSeries: function () { removeSeries: function () {
var view = new NzbDrone.Series.Delete.DeleteSeriesView({ model: this.model }); var view = new DeleteSeriesView({ model: this.model });
NzbDrone.modalRegion.show(view); App.modalRegion.show(view);
}, },
posterHoverAction: function () { posterHoverAction: function () {
this.ui.controls.slideToggle(); this.ui.controls.slideToggle();
} }
}); });
return NzbDrone.Series.Index.Posters.ItemView;
}); });

View File

@ -1,33 +1,22 @@
'use strict'; 'use strict';
define([ define(
'app', [
'Series/Index/List/CollectionView', 'marionette',
'Series/Index/Posters/CollectionView', 'Series/Index/Posters/CollectionView',
'Series/Index/List/CollectionView',
'Series/Index/EmptyView', 'Series/Index/EmptyView',
'Series/SeriesCollection', 'Series/SeriesCollection',
'Cells/AirDateCell', 'Cells/AirDateCell',
'Cells/SeriesTitleCell', 'Cells/SeriesTitleCell',
'Cells/SeriesStatusCell',
'Cells/TemplatedCell', 'Cells/TemplatedCell',
'Series/Index/Table/SeriesStatusCell',
'Series/Index/Table/Row',
'Shared/Toolbar/ToolbarLayout', 'Shared/Toolbar/ToolbarLayout',
'Config', 'Config',
'Shared/LoadingView' 'Shared/LoadingView'
], ], function (Marionette, PosterCollectionView, ListCollectionView, EmptyView, SeriesCollection, AirDateCell, SeriesTitleCell, TemplatedCell, SeriesStatusCell, SeriesIndexRow,
function ( ToolbarLayout, Config, LoadingView) {
App, return Marionette.Layout.extend({
ListCollectionView,
PosterCollectionView,
EmptyView,
SeriesCollection,
AirDateCell,
SeriesTitleCell,
SeriesStatusCell,
TemplatedCell,
ToolbarLayout,
Config,
LoadingView)
{
NzbDrone.Series.Index.SeriesIndexLayout = Backbone.Marionette.Layout.extend({
template: 'Series/Index/SeriesIndexLayoutTemplate', template: 'Series/Index/SeriesIndexLayoutTemplate',
regions: { regions: {
@ -35,7 +24,8 @@ define([
toolbar: '#x-toolbar' toolbar: '#x-toolbar'
}, },
columns: [ columns:
[
{ {
name : 'status', name : 'status',
label: '', label: '',
@ -85,7 +75,8 @@ define([
leftSideButtons: { leftSideButtons: {
type : 'default', type : 'default',
storeState: false, storeState: false,
items : [ items :
[
{ {
title: 'Add Series', title: 'Add Series',
icon : 'icon-plus', icon : 'icon-plus',
@ -109,9 +100,8 @@ define([
}, },
_showTable: function () { _showTable: function () {
var view = new Backgrid.Grid( var view = new Backgrid.Grid({
{ row : SeriesIndexRow,
row : NzbDrone.Series.Index.Table.Row,
columns : this.columns, columns : this.columns,
collection: this.seriesCollection, collection: this.seriesCollection,
className : 'table table-hover' className : 'table table-hover'
@ -140,8 +130,7 @@ define([
if (this.seriesCollection.models.length === 0) { if (this.seriesCollection.models.length === 0) {
this.series.show(new LoadingView()); this.series.show(new LoadingView());
this.seriesCollection.fetch() this.seriesCollection.fetch().done(function () {
.done(function () {
if (self.seriesCollection.models.length === 0) { if (self.seriesCollection.models.length === 0) {
self._showEmpty(); self._showEmpty();
} }
@ -170,7 +159,8 @@ define([
storeState : true, storeState : true,
menuKey : 'seriesViewMode', menuKey : 'seriesViewMode',
defaultAction: 'listView', defaultAction: 'listView',
items : [ items :
[
{ {
key : 'tableView', key : 'tableView',
title : '', title : '',
@ -193,12 +183,16 @@ define([
}; };
this.toolbar.show(new ToolbarLayout({ this.toolbar.show(new ToolbarLayout({
right : [ viewButtons], right :
left : [ this.leftSideButtons], [
viewButtons
],
left :
[
this.leftSideButtons
],
context: this context: this
})); }));
} }
}); });
return NzbDrone.Series.Index.SeriesIndexLayou;
}); });

View File

@ -1,22 +1,26 @@
'use strict'; 'use strict';
define(['app','backgrid'], function () { define(
NzbDrone.Series.Index.Table.Row = Backgrid.Row.extend({ [
'app',
'backgrid',
'Series/Edit/EditSeriesView',
'Series/Delete/DeleteSeriesView'
], function (App, Backgrid, EditSeriesView, DeleteSeriesView) {
return Backgrid.Row.extend({
events: { events: {
'click .x-edit' : 'editSeries', 'click .x-edit' : 'editSeries',
'click .x-remove': 'removeSeries' 'click .x-remove': 'removeSeries'
}, },
editSeries: function () { editSeries: function () {
var view = new NzbDrone.Series.Edit.EditSeriesView({ model: this.model}); var view = new EditSeriesView({ model: this.model});
NzbDrone.modalRegion.show(view); App.modalRegion.show(view);
}, },
removeSeries: function () { removeSeries: function () {
var view = new NzbDrone.Series.Delete.DeleteSeriesView({ model: this.model }); var view = new DeleteSeriesView({ model: this.model });
NzbDrone.modalRegion.show(view); App.modalRegion.show(view);
} }
}); });
return NzbDrone.Series.Table.Row;
}); });

View File

@ -0,0 +1,28 @@
'use strict';
define(
[
'backgrid'
], function (Backgrid) {
return Backgrid.Cell.extend({
className: 'series-status-cell',
render: function () {
this.$el.empty();
var monitored = this.model.get('monitored');
var status = this.model.get('status');
if (!monitored) {
this.$el.html('<i class="icon-pause grid-icon" title="Not Monitored"></i>');
}
else if (status === 'continuing') {
this.$el.html('<i class="icon-play grid-icon" title="Continuing"></i>');
}
else {
this.$el.html('<i class="icon-stop grid-icon" title="Ended"></i>');
}
return this;
}
});
});

View File

@ -1,8 +1,12 @@
'use strict'; 'use strict';
define(['app', 'Series/SeasonModel', 'backbone.pageable'], function (App, SeasonModel, PageAbleCollection) { define(
NzbDrone.Series.SeasonCollection = PageAbleCollection.extend({ [
url : NzbDrone.Constants.ApiRoot + '/season', 'Series/SeasonModel',
model: NzbDrone.Series.SeasonModel, 'backbone.pageable'
], function (SeasonModel, PageAbleCollection) {
return PageAbleCollection.extend({
url : window.ApiRoot + '/season',
model: SeasonModel,
mode: 'client', mode: 'client',
@ -17,7 +21,4 @@ define(['app', 'Series/SeasonModel', 'backbone.pageable'], function (App, Season
order : null order : null
} }
}); });
return NzbDrone.Series.SeasonCollection;
}); });

View File

@ -1,6 +1,9 @@
'use strict'; 'use strict';
define(['app'], function () { define(
NzbDrone.Series.SeasonModel = Backbone.Model.extend({ [
'backbone'
], function (Backbone) {
return Backbone.Model.extend({
mutators: { mutators: {
seasonTitle: function () { seasonTitle: function () {
@ -18,7 +21,5 @@ define(['app'], function () {
seasonNumber: 0 seasonNumber: 0
} }
}); });
return NzbDrone.Series.SeasonModel;
}); });

View File

@ -1,8 +1,12 @@
'use strict'; 'use strict';
define(['app', 'Series/SeriesModel'], function () { define(
NzbDrone.Series.SeriesCollection = Backbone.Collection.extend({ [
url : NzbDrone.Constants.ApiRoot + '/series', 'backbone',
model: NzbDrone.Series.SeriesModel, 'Series/SeriesModel'
], function (Backbone, SeriesModel) {
return Backbone.Collection.extend({
url : window.ApiRoot + '/series',
model: SeriesModel,
comparator: function (model) { comparator: function (model) {
return model.get('title'); return model.get('title');
@ -13,6 +17,4 @@ define(['app', 'Series/SeriesModel'], function () {
order : -1 order : -1
} }
}); });
return NzbDrone.Series.SeriesCollection;
}); });

View File

@ -1,8 +1,12 @@
'use strict'; 'use strict';
define(['app', 'Quality/QualityProfileCollection'], function (app, qualityProfiles) { define(
NzbDrone.Series.SeriesModel = Backbone.Model.extend({ [
'backbone',
'Quality/QualityProfileCollection',
], function (Backbone, QualityProfileCollection) {
return Backbone.Model.extend({
urlRoot: NzbDrone.Constants.ApiRoot + '/series', urlRoot: Constants.ApiRoot + '/series',
mutators: { mutators: {
percentOfEpisodes: function () { percentOfEpisodes: function () {
@ -64,7 +68,7 @@ define(['app', 'Quality/QualityProfileCollection'], function (app, qualityProfil
qualityProfile: function () { qualityProfile: function () {
var profile = qualityProfiles.get(this.get('qualityProfileId')); var profile = QualityProfileCollection.get(this.get('qualityProfileId'));
if (profile) { if (profile) {
return profile.toJSON(); return profile.toJSON();
@ -81,7 +85,4 @@ define(['app', 'Quality/QualityProfileCollection'], function (app, qualityProfil
status : 0 status : 0
} }
}); });
return NzbDrone.Series.SeriesModel;
}); });

View File

@ -1,6 +1,8 @@
window.ApiRoot = '/api';
var statusText = $.ajax({ var statusText = $.ajax({
type : 'GET', type : 'GET',
url : '/api/system/status', url : window.ApiRoot + '/system/status',
async: false async: false
}).responseText; }).responseText;

View File

@ -1,9 +1,11 @@
'use strict'; 'use strict';
define([ define(
'app', 'marionette', 'Mixins/AsModelBoundView', 'bootstrap' [
'marionette',
], function (App, Marionette, AsModelBoundView) { 'Mixins/AsModelBoundView',
'bootstrap'
], function (Marionette, AsModelBoundView) {
var view = Marionette.ItemView.extend({ var view = Marionette.ItemView.extend({
template : 'Settings/DownloadClient/DownloadClientTemplate', template : 'Settings/DownloadClient/DownloadClientTemplate',

View File

@ -1,8 +1,12 @@
'use strict'; 'use strict';
define(['app', 'backbone', 'Mixins/AsChangeTrackingModel'], function (App, Backbone, AsChangeTrackingModel) { define(
[
'backbone',
'Mixins/AsChangeTrackingModel'
], function (Backbone, AsChangeTrackingModel) {
var model = Backbone.Model.extend({ var model = Backbone.Model.extend({
url: App.Constants.ApiRoot + '/settings/host', url: window.ApiRoot + '/settings/host',
initialize: function () { initialize: function () {
this.on('change', function () { this.on('change', function () {

View File

@ -1,7 +1,10 @@
'use strict'; 'use strict';
define(['app', 'Settings/Indexers/Model'], function (App, IndexerModel) { define(
[
'Settings/Indexers/Model'
], function (IndexerModel) {
return Backbone.Collection.extend({ return Backbone.Collection.extend({
url : App.Constants.ApiRoot + '/indexer', url : window.ApiRoot + '/indexer',
model: IndexerModel model: IndexerModel
}); });
}); });

View File

@ -1,10 +1,10 @@
'use strict'; 'use strict';
define([ define(
'app', [
'marionette', 'marionette',
'Mixins/AsModelBoundView' 'Mixins/AsModelBoundView'
], function (App, Marionette, AsModelBoundView) { ], function (Marionette, AsModelBoundView) {
var view = Marionette.ItemView.extend({ var view = Marionette.ItemView.extend({
template: 'Settings/Indexers/EditTemplate', template: 'Settings/Indexers/EditTemplate',

View File

@ -1,8 +1,10 @@
'use strict'; 'use strict';
define(['app', define(
'Settings/SettingsModelBase'], function (App, ModelBase) { [
'Settings/SettingsModelBase'
], function (ModelBase) {
return ModelBase.extend({ return ModelBase.extend({
url : App.Constants.ApiRoot + '/config/naming', url : window.ApiRoot + '/config/naming',
successMessage: 'Naming settings saved', successMessage: 'Naming settings saved',
errorMessage : 'Couldn\'t save naming settings' errorMessage : 'Couldn\'t save naming settings'
}); });

View File

@ -1,8 +1,10 @@
'use strict'; 'use strict';
define(['app', define(
[
'marionette', 'marionette',
'Settings/Naming/NamingModel', 'Settings/Naming/NamingModel',
'Mixins/AsModelBoundView'], function (App, Marionette, NamingModel, AsModelBoundView) { 'Mixins/AsModelBoundView'
], function (Marionette, NamingModel, AsModelBoundView) {
var view = Marionette.ItemView.extend({ var view = Marionette.ItemView.extend({
template: 'Settings/Naming/NamingTemplate', template: 'Settings/Naming/NamingTemplate',

View File

@ -1,7 +1,10 @@
'use strict'; 'use strict';
define(['app', 'Settings/Notifications/Model'], function (App, NotificationModel) { define(
[
'Settings/Notifications/Model'
], function (NotificationModel) {
return Backbone.Collection.extend({ return Backbone.Collection.extend({
url : App.Constants.ApiRoot + '/notification', url : window.ApiRoot + '/notification',
model: NotificationModel model: NotificationModel
}); });
}); });

View File

@ -1,5 +1,8 @@
'use strict'; 'use strict';
define(['app', 'backbone.deepmodel'], function (App, DeepModel) { define(
[
'backbone.deepmodel'
], function (DeepModel) {
return DeepModel.DeepModel.extend({ return DeepModel.DeepModel.extend({
}); });
}); });

View File

@ -0,0 +1,11 @@
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h3>Delete: {{name}}</h3>
</div>
<div class="modal-body">
<p>Are you sure you want to delete '{{name}}'?</p>
</div>
<div class="modal-footer">
<button class="btn" data-dismiss="modal">cancel</button>
<button class="btn btn-danger x-confirm-delete">delete</button>
</div>

View File

@ -0,0 +1,24 @@
'use strict';
define(
[
'app',
'marionette'
], function (App, Marionette) {
return Marionette.ItemView.extend({
template: 'Quality/Profile/DeleteTemplate',
events: {
'click .x-confirm-delete': '_removeProfile'
},
_removeProfile: function () {
this.model.destroy({
wait: true
}).done(function () {
App.modalRegion.close();
});
}
});
});

View File

@ -1,11 +1,15 @@
'use strict'; 
'use strict';
define([ define(
[
'app', 'app',
'marionette', 'marionette',
'Settings/Quality/Profile/EditQualityProfileView', 'Settings/Quality/Profile/EditQualityProfileView',
'Settings/Quality/Profile/DeleteView',
'Mixins/AsModelBoundView' 'Mixins/AsModelBoundView'
], function (App, Marionette, EditProfileView, AsModelBoundView) {
], function (App, Marionette, EditProfileView, DeleteProfileView, AsModelBoundView) {
var view = Marionette.ItemView.extend({ var view = Marionette.ItemView.extend({
template: 'Settings/Quality/Profile/QualityProfileTemplate', template: 'Settings/Quality/Profile/QualityProfileTemplate',
@ -26,10 +30,11 @@ define([
}, },
removeQuality: function () { removeQuality: function () {
var view = new NzbDrone.Series.Delete.DeleteSeriesView({ model: this.model }); var view = new DeleteProfileView({ model: this.model });
NzbDrone.modalRegion.show(view); App.modalRegion.show(view);
} }
}); });
return AsModelBoundView.call(view); return AsModelBoundView.call(view);
}); });

View File

@ -1,13 +1,12 @@
'use strict'; 'use strict';
define([ define(
'app', [
'marionette', 'marionette',
'Quality/QualityProfileCollection', 'Quality/QualityProfileCollection',
'Settings/Quality/Profile/QualityProfileCollectionView', 'Settings/Quality/Profile/QualityProfileCollectionView',
'Quality/QualitySizeCollection', 'Quality/QualitySizeCollection',
'Settings/Quality/Size/QualitySizeCollectionView' 'Settings/Quality/Size/QualitySizeCollectionView'
], ], function (Marionette, QualityProfileCollection, QualityProfileCollectionView, QualitySizeCollection, QualitySizeCollectionView) {
function (App, Marionette, QualityProfileCollection, QualityProfileCollectionView, QualitySizeCollection, QualitySizeCollectionView) {
return Marionette.Layout.extend({ return Marionette.Layout.extend({
template: 'Settings/Quality/QualityLayoutTemplate', template: 'Settings/Quality/QualityLayoutTemplate',

View File

@ -1,11 +1,12 @@
'use strict'; 'use strict';
define([ define(
[
'app', 'app',
'marionette', 'marionette',
'Settings/SettingsModel', 'Settings/SettingsModel',
'Settings/General/GeneralSettingsModel', 'Settings/General/GeneralSettingsModel',
'Settings/Naming/NamingView',
'Settings/Naming/NamingModel', 'Settings/Naming/NamingModel',
'Settings/Naming/NamingView',
'Settings/Quality/QualityLayout', 'Settings/Quality/QualityLayout',
'Settings/Indexers/CollectionView', 'Settings/Indexers/CollectionView',
'Settings/Indexers/Collection', 'Settings/Indexers/Collection',
@ -14,8 +15,8 @@ define([
'Settings/Notifications/Collection', 'Settings/Notifications/Collection',
'Settings/General/GeneralView', 'Settings/General/GeneralView',
'Settings/Misc/MiscView' 'Settings/Misc/MiscView'
], ], function (App, Marionette, SettingsModel, GeneralSettingsModel,NamingModel, NamingView, QualityLayout, IndexerCollectionView, IndexerCollection, DownloadClientView,
function (App, Marionette, SettingsModel, GeneralSettingsModel, NamingView, NamingModel, QualityLayout, IndexerCollectionView, IndexerCollection, DownloadClientView, NotificationCollectionView, NotificationCollection, GeneralView, MiscView) { NotificationCollectionView, NotificationCollection, GeneralView, MiscView) {
return Marionette.Layout.extend({ return Marionette.Layout.extend({
template: 'Settings/SettingsLayoutTemplate', template: 'Settings/SettingsLayoutTemplate',
@ -56,7 +57,7 @@ define([
} }
this.ui.namingTab.tab('show'); this.ui.namingTab.tab('show');
App.Router.navigate('settings/naming'); this._navigate('settings/naming');
}, },
showQuality: function (e) { showQuality: function (e) {
@ -65,7 +66,7 @@ define([
} }
this.ui.qualityTab.tab('show'); this.ui.qualityTab.tab('show');
App.Router.navigate('settings/quality'); this._navigate('settings/quality');
}, },
showIndexers: function (e) { showIndexers: function (e) {
@ -74,7 +75,7 @@ define([
} }
this.ui.indexersTab.tab('show'); this.ui.indexersTab.tab('show');
App.Router.navigate('settings/indexers'); this._navigate('settings/indexers');
}, },
showDownloadClient: function (e) { showDownloadClient: function (e) {
@ -83,7 +84,7 @@ define([
} }
this.ui.downloadClientTab.tab('show'); this.ui.downloadClientTab.tab('show');
App.Router.navigate('settings/downloadclient'); this._navigate('settings/downloadclient');
}, },
showNotifications: function (e) { showNotifications: function (e) {
@ -92,7 +93,7 @@ define([
} }
this.ui.notificationsTab.tab('show'); this.ui.notificationsTab.tab('show');
App.Router.navigate('settings/notifications'); this._navigate('settings/notifications');
}, },
showGeneral: function (e) { showGeneral: function (e) {
@ -101,7 +102,7 @@ define([
} }
this.ui.generalTab.tab('show'); this.ui.generalTab.tab('show');
App.Router.navigate('settings/general'); this._navigate('settings/general');
}, },
showMisc: function (e) { showMisc: function (e) {
@ -110,7 +111,13 @@ define([
} }
this.ui.miscTab.tab('show'); this.ui.miscTab.tab('show');
App.Router.navigate('settings/misc'); this._navigate('settings/misc');
},
_navigate:function(route){
require(['Router'], function(){
App.Router.navigate(route);
});
}, },
initialize: function (options) { initialize: function (options) {

View File

@ -1,8 +1,8 @@
'use strict'; 'use strict';
define(['app', define(['app',
'Settings/SettingsModelBase'], function (App, SettingsModelBase) { 'Settings/SettingsModelBase'], function (App, SettingsModelBase) {
return SettingsModelBase.extend({ return SettingsModelBase.extend({
url : App.Constants.ApiRoot + '/settings', url : window.ApiRoot + '/settings',
successMessage: 'Settings saved', successMessage: 'Settings saved',
errorMessage : 'Failed to save settings' errorMessage : 'Failed to save settings'
}); });

View File

@ -1,12 +1,15 @@
'use strict'; 'use strict';
define(['app'], function () { define(
NzbDrone.Shared.FormatHelpers.FileSizeHelper = function (sourceSize) { [
'sugar'
], {
FileSizeHelper: function (sourceSize) {
var size = Number(sourceSize); var size = Number(sourceSize);
return size.bytes(1); return size.bytes(1);
}; },
NzbDrone.Shared.FormatHelpers.DateHelper = function (sourceDate) { DateHelper: function (sourceDate) {
if (!sourceDate) { if (!sourceDate) {
return ''; return '';
} }
@ -31,7 +34,5 @@ define(['app'], function () {
} }
return date.format('{MM}/{dd}/{yyyy}'); return date.format('{MM}/{dd}/{yyyy}');
}; }
return NzbDrone.Shared.FormatHelpers;
}); });

View File

@ -1,7 +1,9 @@
'use strict'; 'use strict';
define(['app','backgrid'], function () { define(
[
'backgrid'
], function (Backgrid) {
Backgrid.NzbDroneHeaderCell = Backgrid.HeaderCell.extend({ Backgrid.NzbDroneHeaderCell = Backgrid.HeaderCell.extend({
events: { events: {

Some files were not shown because too many files have changed in this diff Show More