moved most of addseries to use require.js
This commit is contained in:
parent
5e26596623
commit
52d815b1d4
|
@ -0,0 +1,2 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<ClassDiagram />
|
|
@ -204,12 +204,14 @@
|
||||||
<Content Include="_backboneApp\AddSeries\Existing\ImportSeriesView.js" />
|
<Content Include="_backboneApp\AddSeries\Existing\ImportSeriesView.js" />
|
||||||
<Content Include="_backboneApp\AddSeries\Existing\UnmappedFolderModel.js" />
|
<Content Include="_backboneApp\AddSeries\Existing\UnmappedFolderModel.js" />
|
||||||
<Content Include="_backboneApp\AddSeries\Existing\RootFolderCompositeViewTemplate.html" />
|
<Content Include="_backboneApp\AddSeries\Existing\RootFolderCompositeViewTemplate.html" />
|
||||||
<Content Include="_backboneApp\AddSeries\RootFolders\RootDirTemplate.html" />
|
<Content Include="_backboneApp\AddSeries\RootFolders\RootFolderTemplate.html" />
|
||||||
<Content Include="_backboneApp\AddSeries\RootFolders\RootDirView.js" />
|
<Content Include="_backboneApp\AddSeries\RootFolders\RootFolderView.js" />
|
||||||
<Content Include="_backboneApp\AddSeries\RootFolders\RootDirItemTemplate.html" />
|
<Content Include="_backboneApp\AddSeries\RootFolders\RootFolderItemTemplate.html" />
|
||||||
<Content Include="_backboneApp\AddSeries\RootFolders\RootDirModel.js" />
|
<Content Include="_backboneApp\AddSeries\RootFolders\RootFolderModel.js" />
|
||||||
<Content Include="_backboneApp\AddSeries\RootFolders\RootDirCollection.js" />
|
<Content Include="_backboneApp\AddSeries\RootFolders\RootFolderCollection.js" />
|
||||||
<Content Include="_backboneApp\Content\jquery.dataTables.bootstrap.css" />
|
<Content Include="_backboneApp\Content\jquery.dataTables.bootstrap.css" />
|
||||||
|
<Content Include="_backboneApp\JsLibraries\jquery.js" />
|
||||||
|
<Content Include="_backboneApp\Routing.js" />
|
||||||
<Content Include="_backboneApp\JsLibraries\backbone.modelbinder.js" />
|
<Content Include="_backboneApp\JsLibraries\backbone.modelbinder.js" />
|
||||||
<Content Include="_backboneApp\AddSeries\New\AddNewSeriesTemplate.html" />
|
<Content Include="_backboneApp\AddSeries\New\AddNewSeriesTemplate.html" />
|
||||||
<Content Include="_backboneApp\AddSeries\New\AddNewSeriesView.js" />
|
<Content Include="_backboneApp\AddSeries\New\AddNewSeriesView.js" />
|
||||||
|
@ -220,6 +222,7 @@
|
||||||
<Content Include="_backboneApp\JsLibraries\jquery.dataTables.extensions.js" />
|
<Content Include="_backboneApp\JsLibraries\jquery.dataTables.extensions.js" />
|
||||||
<Content Include="_backboneApp\JsLibraries\jquery.dataTables-1.10.0-dev.js" />
|
<Content Include="_backboneApp\JsLibraries\jquery.dataTables-1.10.0-dev.js" />
|
||||||
<Content Include="_backboneApp\JsLibraries\jquery.dataTables.bootstrap.pagination.js" />
|
<Content Include="_backboneApp\JsLibraries\jquery.dataTables.bootstrap.pagination.js" />
|
||||||
|
<Content Include="_backboneApp\JsLibraries\require-jquery.js" />
|
||||||
<Content Include="_backboneApp\Quality\qualityProfileModel.js" />
|
<Content Include="_backboneApp\Quality\qualityProfileModel.js" />
|
||||||
<Content Include="_backboneApp\Quality\qualityProfileCollection.js" />
|
<Content Include="_backboneApp\Quality\qualityProfileCollection.js" />
|
||||||
<Content Include="_backboneApp\Quality\qualityTypeModel.js" />
|
<Content Include="_backboneApp\Quality\qualityTypeModel.js" />
|
||||||
|
@ -432,11 +435,11 @@
|
||||||
<Content Include="_backboneApp\Shared\SpinnerTemplate.html" />
|
<Content Include="_backboneApp\Shared\SpinnerTemplate.html" />
|
||||||
<Content Include="_backboneApp\Shared\SpinnerView.js" />
|
<Content Include="_backboneApp\Shared\SpinnerView.js" />
|
||||||
<Content Include="Eloquera.config" />
|
<Content Include="Eloquera.config" />
|
||||||
|
<Content Include="ClassDiagram1.cd" />
|
||||||
<None Include="_backboneApp\JsLibraries\jquery-1.8.2.intellisense.js" />
|
<None Include="_backboneApp\JsLibraries\jquery-1.8.2.intellisense.js" />
|
||||||
<Content Include="_backboneApp\JsLibraries\backbone.collectionbinder.js" />
|
<Content Include="_backboneApp\JsLibraries\backbone.collectionbinder.js" />
|
||||||
<Content Include="_backboneApp\JsLibraries\backbone.debug.js" />
|
<Content Include="_backboneApp\JsLibraries\backbone.debug.js" />
|
||||||
<Content Include="_backboneApp\JsLibraries\handlebars.js" />
|
<Content Include="_backboneApp\JsLibraries\handlebars.js" />
|
||||||
<Content Include="_backboneApp\JsLibraries\jquery.js" />
|
|
||||||
<Content Include="_backboneApp\JsLibraries\jquery-ui-1.9.0.js" />
|
<Content Include="_backboneApp\JsLibraries\jquery-ui-1.9.0.js" />
|
||||||
<Content Include="_backboneApp\JsLibraries\backbone.marionette.viewswapper.js" />
|
<Content Include="_backboneApp\JsLibraries\backbone.marionette.viewswapper.js" />
|
||||||
<Content Include="_backboneApp\JsLibraries\sugar.js" />
|
<Content Include="_backboneApp\JsLibraries\sugar.js" />
|
||||||
|
|
|
@ -4,12 +4,10 @@
|
||||||
|
|
||||||
@using Cassette.Scripts
|
@using Cassette.Scripts
|
||||||
@using Cassette.Stylesheets
|
@using Cassette.Stylesheets
|
||||||
@using NzbDrone.Web
|
|
||||||
@using NzbDrone.Web.Backbone.NzbDrone
|
@using NzbDrone.Web.Backbone.NzbDrone
|
||||||
@using NzbDrone.Web.Helpers
|
@using NzbDrone.Web.Helpers
|
||||||
@{
|
@{
|
||||||
Bundles.Reference<StylesheetBundle>(CassetteBundleConfiguration.BASE_STYLE);
|
Bundles.Reference<StylesheetBundle>(CassetteBundleConfiguration.BASE_STYLE);
|
||||||
Bundles.Reference<ScriptBundle>(CassetteBundleConfiguration.NZBDRONE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
<!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">
|
||||||
|
@ -65,9 +63,7 @@
|
||||||
<div id="footer-region" class="span20"></div>
|
<div id="footer-region" class="span20"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@Bundles.RenderScripts()
|
<script data-main="/_backboneApp/app" src="/_backboneApp/JsLibraries/require-jquery.js"></script>
|
||||||
<script type="text/javascript">
|
<script src="/_backboneApp/Routing.js"></script>
|
||||||
NzbDrone.start();
|
|
||||||
</script>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -1,11 +1,13 @@
|
||||||
/// <reference path="../app.js" />
|
define([
|
||||||
/// <reference path="New/AddNewSeriesView.js" />
|
'app',
|
||||||
/// <reference path="RootFolders/RootDirView.js" />
|
'AddSeries/RootFolders/RootFolderView',
|
||||||
/// <reference path="../Quality/qualityProfileCollection.js" />
|
'AddSeries/RootFolders/RootFolderCollection',
|
||||||
/// <reference path="../Shared/SpinnerView.js" />
|
'AddSeries/New/AddNewSeriesView',
|
||||||
/// <reference path="Existing/ImportSeriesView.js" />
|
'AddSeries/Existing/ImportSeriesView',
|
||||||
|
'Quality/QualityProfileCollection'
|
||||||
NzbDrone.AddSeries.AddSeriesLayout = Backbone.Marionette.Layout.extend({
|
],
|
||||||
|
function () {
|
||||||
|
NzbDrone.AddSeries.AddSeriesLayout = Backbone.Marionette.Layout.extend({
|
||||||
template: 'AddSeries/addSeriesLayoutTemplate',
|
template: 'AddSeries/addSeriesLayoutTemplate',
|
||||||
|
|
||||||
regions: {
|
regions: {
|
||||||
|
@ -20,7 +22,6 @@ NzbDrone.AddSeries.AddSeriesLayout = Backbone.Marionette.Layout.extend({
|
||||||
rootFoldersTab: '.x-root-folders-tab'
|
rootFoldersTab: '.x-root-folders-tab'
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
events: {
|
events: {
|
||||||
'click .x-add-new-tab': 'showAddNew',
|
'click .x-add-new-tab': 'showAddNew',
|
||||||
'click .x-import-existing-tab': 'showImport',
|
'click .x-import-existing-tab': 'showImport',
|
||||||
|
@ -55,10 +56,9 @@ NzbDrone.AddSeries.AddSeriesLayout = Backbone.Marionette.Layout.extend({
|
||||||
NzbDrone.Router.navigate('series/add/rootfolders');
|
NzbDrone.Router.navigate('series/add/rootfolders');
|
||||||
},
|
},
|
||||||
|
|
||||||
rootFolderCollection: new NzbDrone.AddSeries.RootDirCollection(),
|
rootFolderCollection: new NzbDrone.AddSeries.RootFolders.RootFolderCollection(),
|
||||||
qualityProfileCollection: new NzbDrone.Quality.QualityProfileCollection(),
|
qualityProfileCollection: new NzbDrone.Quality.QualityProfileCollection(),
|
||||||
|
|
||||||
|
|
||||||
initialize: function (context, action, query) {
|
initialize: function (context, action, query) {
|
||||||
if (action) {
|
if (action) {
|
||||||
this.action = action.toLowerCase();
|
this.action = action.toLowerCase();
|
||||||
|
@ -74,7 +74,7 @@ NzbDrone.AddSeries.AddSeriesLayout = Backbone.Marionette.Layout.extend({
|
||||||
this.qualityProfileCollection.fetch();
|
this.qualityProfileCollection.fetch();
|
||||||
this.rootFolderCollection.fetch();
|
this.rootFolderCollection.fetch();
|
||||||
|
|
||||||
this.addNew.show(new NzbDrone.AddSeries.AddNewSeriesView({ rootFolders: this.rootFolderCollection, qualityProfiles: this.qualityProfileCollection }));
|
this.addNew.show(new NzbDrone.AddSeries.New.AddNewSeriesView({ rootFolders: this.rootFolderCollection, qualityProfiles: this.qualityProfileCollection }));
|
||||||
this.importExisting.show(new NzbDrone.AddSeries.Existing.ImportSeriesView({ collection: this.rootFolderCollection, quality: this.qualityProfileCollection }));
|
this.importExisting.show(new NzbDrone.AddSeries.Existing.ImportSeriesView({ collection: this.rootFolderCollection, quality: this.qualityProfileCollection }));
|
||||||
this.rootFolders.show(new NzbDrone.AddSeries.RootDirView({ collection: this.rootFolderCollection }));
|
this.rootFolders.show(new NzbDrone.AddSeries.RootDirView({ collection: this.rootFolderCollection }));
|
||||||
|
|
||||||
|
@ -106,6 +106,6 @@ NzbDrone.AddSeries.AddSeriesLayout = Backbone.Marionette.Layout.extend({
|
||||||
this.ui.importExistingTab.show();
|
this.ui.importExistingTab.show();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
});
|
|
|
@ -1,11 +1,9 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
/// <reference path="../../app.js" />
|
|
||||||
/// <reference path="UnmappedFolderModel.js" />
|
define(['app', 'AddSeries/Existing/UnmappedFolderModel', 'AddSeries/SearchResultCollection', 'Series/SeriesModel'], function () {
|
||||||
/// <reference path="../../Series/SeriesModel.js" />
|
|
||||||
/// <reference path="../SearchResultCollection.js" />
|
|
||||||
|
|
||||||
|
|
||||||
NzbDrone.AddSeries.Existing.FolderMatchResultView = Backbone.Marionette.ItemView.extend({
|
NzbDrone.AddSeries.Existing.FolderMatchResultView = Backbone.Marionette.ItemView.extend({
|
||||||
template: 'AddSeries/Existing/FolderMatchResultViewTemplatate',
|
template: 'AddSeries/Existing/FolderMatchResultViewTemplatate',
|
||||||
|
|
||||||
events: {
|
events: {
|
||||||
|
@ -42,9 +40,9 @@ NzbDrone.AddSeries.Existing.FolderMatchResultView = Backbone.Marionette.ItemView
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
NzbDrone.AddSeries.Existing.UnmappedFolderCompositeView = Backbone.Marionette.CompositeView.extend({
|
NzbDrone.AddSeries.Existing.UnmappedFolderCompositeView = Backbone.Marionette.CompositeView.extend({
|
||||||
|
|
||||||
template: 'AddSeries/Existing/UnmappedFolderCompositeViewTemplatate',
|
template: 'AddSeries/Existing/UnmappedFolderCompositeViewTemplatate',
|
||||||
itemViewContainer: '.x-folder-name-match-results',
|
itemViewContainer: '.x-folder-name-match-results',
|
||||||
|
@ -93,9 +91,9 @@ NzbDrone.AddSeries.Existing.UnmappedFolderCompositeView = Backbone.Marionette.Co
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
NzbDrone.AddSeries.Existing.RootFolderCompositeView = Backbone.Marionette.CompositeView.extend({
|
NzbDrone.AddSeries.Existing.RootFolderCompositeView = Backbone.Marionette.CompositeView.extend({
|
||||||
|
|
||||||
template: "AddSeries/Existing/RootFolderCompositeViewTemplate",
|
template: "AddSeries/Existing/RootFolderCompositeViewTemplate",
|
||||||
itemViewContainer: ".x-existing-folder-container",
|
itemViewContainer: ".x-existing-folder-container",
|
||||||
|
@ -123,9 +121,9 @@ NzbDrone.AddSeries.Existing.RootFolderCompositeView = Backbone.Marionette.Compos
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
NzbDrone.AddSeries.Existing.ImportSeriesView = Backbone.Marionette.CollectionView.extend({
|
NzbDrone.AddSeries.Existing.ImportSeriesView = Backbone.Marionette.CollectionView.extend({
|
||||||
|
|
||||||
itemView: NzbDrone.AddSeries.Existing.RootFolderCompositeView,
|
itemView: NzbDrone.AddSeries.Existing.RootFolderCompositeView,
|
||||||
|
|
||||||
|
@ -147,8 +145,5 @@ NzbDrone.AddSeries.Existing.ImportSeriesView = Backbone.Marionette.CollectionVie
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,11 +1,14 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
/// <reference path="../../app.js" />
|
|
||||||
NzbDrone.AddSeries.Existing.UnmappedFolderModel = Backbone.Model.extend({
|
define(['app'], function () {
|
||||||
|
|
||||||
|
|
||||||
});
|
NzbDrone.AddSeries.Existing.UnmappedFolderModel = Backbone.Model.extend({
|
||||||
|
|
||||||
NzbDrone.AddSeries.Existing.UnmappedFolderCollection = Backbone.Collection.extend({
|
|
||||||
|
});
|
||||||
|
|
||||||
|
NzbDrone.AddSeries.Existing.UnmappedFolderCollection = Backbone.Collection.extend({
|
||||||
model: NzbDrone.AddSeries.Existing.UnmappedFolderModel,
|
model: NzbDrone.AddSeries.Existing.UnmappedFolderModel,
|
||||||
|
|
||||||
|
|
||||||
|
@ -25,10 +28,8 @@ NzbDrone.AddSeries.Existing.UnmappedFolderCollection = Backbone.Collection.exten
|
||||||
var rootFolder = rootFolderModel.get('path');
|
var rootFolder = rootFolderModel.get('path');
|
||||||
|
|
||||||
_.each(rootFolderModel.get('unmappedFolders'), function (folder) {
|
_.each(rootFolderModel.get('unmappedFolders'), function (folder) {
|
||||||
this.push(new NzbDrone.AddSeries.Existing.UnmappedFolderModel({rootFolder:rootFolder, folder: folder, quality: qualityCollection }));
|
this.push(new NzbDrone.AddSeries.Existing.UnmappedFolderModel({ rootFolder: rootFolder, folder: folder, quality: qualityCollection }));
|
||||||
}, this);
|
}, this);
|
||||||
}
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
'use strict;'
|
define(['app', 'AddSeries/New/SearchResultView'], function () {
|
||||||
/// <reference path="../../app.js" />
|
|
||||||
/// <reference path="SearchResultView.js" />
|
|
||||||
|
|
||||||
NzbDrone.AddSeries.AddNewSeriesView = Backbone.Marionette.Layout.extend({
|
NzbDrone.AddSeries.New.AddNewSeriesView = Backbone.Marionette.Layout.extend({
|
||||||
template: 'AddSeries/New/AddNewSeriesTemplate',
|
template: 'AddSeries/New/AddNewSeriesTemplate',
|
||||||
route: 'Series/add/new',
|
route: 'Series/add/new',
|
||||||
|
|
||||||
|
@ -65,7 +63,7 @@ NzbDrone.AddSeries.AddNewSeriesView = Backbone.Marionette.Layout.extend({
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
abortExistingRequest : function () {
|
abortExistingRequest: function () {
|
||||||
if (this.currentSearchRequest && this.currentSearchRequest.readyState > 0 && this.currentSearchRequest.readyState < 4) {
|
if (this.currentSearchRequest && this.currentSearchRequest.readyState > 0 && this.currentSearchRequest.readyState < 4) {
|
||||||
console.log('aborting previous pending search request.');
|
console.log('aborting previous pending search request.');
|
||||||
this.currentSearchRequest.abort();
|
this.currentSearchRequest.abort();
|
||||||
|
@ -81,4 +79,5 @@ NzbDrone.AddSeries.AddNewSeriesView = Backbone.Marionette.Layout.extend({
|
||||||
|
|
||||||
context.searchResult.show(context.resultView);
|
context.searchResult.show(context.resultView);
|
||||||
}
|
}
|
||||||
|
});
|
||||||
});
|
});
|
|
@ -1,11 +1,8 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
/*global NzbDrone, Backbone*/
|
|
||||||
/// <reference path="../../app.js" />
|
|
||||||
/// <reference path="../SearchResultModel.js" />
|
|
||||||
/// <reference path="../../Series/SeriesModel.js" />
|
|
||||||
/// <reference path="../SearchResultCollection.js" />
|
|
||||||
|
|
||||||
NzbDrone.AddSeries.SearchItemView = Backbone.Marionette.ItemView.extend({
|
define(['app', 'AddSeries/SearchResultCollection', 'AddSeries/SearchResultModel', 'Series/SeriesModel'], function () {
|
||||||
|
|
||||||
|
NzbDrone.AddSeries.New.SearchItemView = Backbone.Marionette.ItemView.extend({
|
||||||
|
|
||||||
template: "AddSeries/New/SearchResultTemplate",
|
template: "AddSeries/New/SearchResultTemplate",
|
||||||
className: 'search-item',
|
className: 'search-item',
|
||||||
|
@ -57,9 +54,9 @@ NzbDrone.AddSeries.SearchItemView = Backbone.Marionette.ItemView.extend({
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
NzbDrone.AddSeries.SearchResultView = Backbone.Marionette.CollectionView.extend({
|
NzbDrone.AddSeries.SearchResultView = Backbone.Marionette.CollectionView.extend({
|
||||||
|
|
||||||
itemView: NzbDrone.AddSeries.SearchItemView,
|
itemView: NzbDrone.AddSeries.SearchItemView,
|
||||||
|
|
||||||
|
@ -68,4 +65,5 @@ NzbDrone.AddSeries.SearchResultView = Backbone.Marionette.CollectionView.extend(
|
||||||
initialize: function () {
|
initialize: function () {
|
||||||
this.listenTo(this.collection, 'reset', this.render);
|
this.listenTo(this.collection, 'reset', this.render);
|
||||||
}
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,8 +0,0 @@
|
||||||
/// <reference path="../../app.js" />
|
|
||||||
/// <reference path="RootDirModel.js" />
|
|
||||||
|
|
||||||
NzbDrone.AddSeries.RootDirCollection = Backbone.Collection.extend({
|
|
||||||
url: NzbDrone.Constants.ApiRoot + '/rootdir',
|
|
||||||
model: NzbDrone.AddSeries.RootDirModel,
|
|
||||||
});
|
|
||||||
|
|
|
@ -1,13 +0,0 @@
|
||||||
/// <reference path="../../app.js" />
|
|
||||||
NzbDrone.AddSeries.RootDirModel = Backbone.Model.extend({
|
|
||||||
|
|
||||||
mutators: {
|
|
||||||
freeSpaceString: function () {
|
|
||||||
return this.get('freeSpace').bytes(2) + " Free";
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
defaults: {
|
|
||||||
freeSpace: 0,
|
|
||||||
}
|
|
||||||
});
|
|
|
@ -1,90 +0,0 @@
|
||||||
'use strict;'
|
|
||||||
/// <reference path="../../app.js" />
|
|
||||||
/// <reference path="RootDirModel.js" />
|
|
||||||
/// <reference path="RootDirCollection.js" />
|
|
||||||
/// <reference path="../../Shared/AutoComplete.js" />
|
|
||||||
|
|
||||||
NzbDrone.AddSeries.RootDirItemView = Backbone.Marionette.ItemView.extend({
|
|
||||||
|
|
||||||
template: 'AddSeries/RootFolders/RootDirItemTemplate',
|
|
||||||
tagName: 'tr',
|
|
||||||
|
|
||||||
events: {
|
|
||||||
'click .x-remove': 'removeFolder',
|
|
||||||
},
|
|
||||||
|
|
||||||
onRender: function () {
|
|
||||||
NzbDrone.ModelBinder.bind(this.model, this.el);
|
|
||||||
},
|
|
||||||
|
|
||||||
removeFolder: function () {
|
|
||||||
this.model.destroy({ wait: true });
|
|
||||||
this.model.collection.remove(this.model);
|
|
||||||
},
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
NzbDrone.AddSeries.RootDirListView = Backbone.Marionette.CollectionView.extend({
|
|
||||||
itemView: NzbDrone.AddSeries.RootDirItemView,
|
|
||||||
|
|
||||||
tagName: 'table',
|
|
||||||
className: 'table table-hover',
|
|
||||||
});
|
|
||||||
|
|
||||||
NzbDrone.AddSeries.RootDirView = Backbone.Marionette.Layout.extend({
|
|
||||||
template: 'AddSeries/RootFolders/RootDirTemplate',
|
|
||||||
route: 'series/add/rootdir',
|
|
||||||
|
|
||||||
ui: {
|
|
||||||
pathInput: '.x-path input'
|
|
||||||
},
|
|
||||||
|
|
||||||
regions: {
|
|
||||||
currentDirs: '#current-dirs',
|
|
||||||
},
|
|
||||||
|
|
||||||
events: {
|
|
||||||
'click .x-add': 'addFolder',
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
collection: new NzbDrone.AddSeries.RootDirCollection(),
|
|
||||||
|
|
||||||
onRender: function () {
|
|
||||||
|
|
||||||
this.currentDirs.show(new NzbDrone.AddSeries.RootDirListView({ collection: this.collection }));
|
|
||||||
this.collection.fetch();
|
|
||||||
|
|
||||||
this.ui.pathInput.folderAutoComplete();
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
addFolder: function () {
|
|
||||||
var newDir = new NzbDrone.AddSeries.RootDirModel(
|
|
||||||
{
|
|
||||||
Path: this.ui.pathInput.val()
|
|
||||||
});
|
|
||||||
|
|
||||||
var self = this;
|
|
||||||
|
|
||||||
this.collection.create(newDir, {
|
|
||||||
wait: true, success: function () {
|
|
||||||
self.collection.fetch();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
search: function (context) {
|
|
||||||
|
|
||||||
var term = context.ui.seriesSearch.val();
|
|
||||||
|
|
||||||
if (term === "") {
|
|
||||||
context.collection.reset();
|
|
||||||
} else {
|
|
||||||
console.log(term);
|
|
||||||
context.collection.fetch({ data: $.param({ term: term }) });
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
},
|
|
||||||
});
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
define(['app', 'AddSeries/RootFolders/RootFolderModel'], function () {
|
||||||
|
|
||||||
|
NzbDrone.AddSeries.RootFolders.RootFolderCollection = Backbone.Collection.extend({
|
||||||
|
url: NzbDrone.Constants.ApiRoot + '/rootdir',
|
||||||
|
model: NzbDrone.AddSeries.RootFolders.RootFolderModel,
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,13 @@
|
||||||
|
define(['app'], function () {
|
||||||
|
NzbDrone.AddSeries.RootFolders.RootFolderModel = Backbone.Model.extend({
|
||||||
|
mutators: {
|
||||||
|
freeSpaceString: function () {
|
||||||
|
return this.get('freeSpace').bytes(2) + " Free";
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
defaults: {
|
||||||
|
freeSpace: 0,
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
|
@ -0,0 +1,91 @@
|
||||||
|
'use strict;'
|
||||||
|
|
||||||
|
define(['app', 'AddSeries/RootFolders/RootFolderCollection', 'Shared/AutoComplete'], function () {
|
||||||
|
|
||||||
|
|
||||||
|
NzbDrone.AddSeries.RootFolderItemView = Backbone.Marionette.ItemView.extend({
|
||||||
|
|
||||||
|
template: 'AddSeries/RootFolders/RootFolderItemTemplate',
|
||||||
|
tagName: 'tr',
|
||||||
|
|
||||||
|
events: {
|
||||||
|
'click .x-remove': 'removeFolder',
|
||||||
|
},
|
||||||
|
|
||||||
|
onRender: function () {
|
||||||
|
NzbDrone.ModelBinder.bind(this.model, this.el);
|
||||||
|
},
|
||||||
|
|
||||||
|
removeFolder: function () {
|
||||||
|
this.model.destroy({ wait: true });
|
||||||
|
this.model.collection.remove(this.model);
|
||||||
|
},
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
NzbDrone.AddSeries.RootDirListView = Backbone.Marionette.CollectionView.extend({
|
||||||
|
itemView: NzbDrone.AddSeries.RootFolderItemView,
|
||||||
|
|
||||||
|
tagName: 'table',
|
||||||
|
className: 'table table-hover',
|
||||||
|
});
|
||||||
|
|
||||||
|
NzbDrone.AddSeries.RootDirView = Backbone.Marionette.Layout.extend({
|
||||||
|
template: 'AddSeries/RootFolders/RootFolderTemplate',
|
||||||
|
route: 'series/add/rootdir',
|
||||||
|
|
||||||
|
ui: {
|
||||||
|
pathInput: '.x-path input'
|
||||||
|
},
|
||||||
|
|
||||||
|
regions: {
|
||||||
|
currentDirs: '#current-dirs',
|
||||||
|
},
|
||||||
|
|
||||||
|
events: {
|
||||||
|
'click .x-add': 'addFolder',
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
collection: new NzbDrone.AddSeries.RootFolders.RootFolderCollection(),
|
||||||
|
|
||||||
|
onRender: function () {
|
||||||
|
|
||||||
|
this.currentDirs.show(new NzbDrone.AddSeries.RootDirListView({ collection: this.collection }));
|
||||||
|
this.collection.fetch();
|
||||||
|
|
||||||
|
this.ui.pathInput.folderAutoComplete();
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
addFolder: function () {
|
||||||
|
var newDir = new NzbDrone.AddSeries.RootFolders.RootFolderModel(
|
||||||
|
{
|
||||||
|
Path: this.ui.pathInput.val()
|
||||||
|
});
|
||||||
|
|
||||||
|
var self = this;
|
||||||
|
|
||||||
|
this.collection.create(newDir, {
|
||||||
|
wait: true, success: function () {
|
||||||
|
self.collection.fetch();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
search: function (context) {
|
||||||
|
|
||||||
|
var term = context.ui.seriesSearch.val();
|
||||||
|
|
||||||
|
if (term === "") {
|
||||||
|
context.collection.reset();
|
||||||
|
} else {
|
||||||
|
console.log(term);
|
||||||
|
context.collection.fetch({ data: $.param({ term: term }) });
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
|
@ -1,10 +1,10 @@
|
||||||
/// <reference path="../app.js" />
|
"use strict";
|
||||||
/// <reference path="SearchResultModel.js" />
|
define(['app', 'AddSeries/SearchResultModel'], function () {
|
||||||
"use strict";
|
NzbDrone.AddSeries.SearchResultCollection = Backbone.Collection.extend({
|
||||||
|
|
||||||
NzbDrone.AddSeries.SearchResultCollection = Backbone.Collection.extend({
|
|
||||||
url: NzbDrone.Constants.ApiRoot + '/series/lookup',
|
url: NzbDrone.Constants.ApiRoot + '/series/lookup',
|
||||||
model: NzbDrone.AddSeries.SearchResultModel
|
model: NzbDrone.AddSeries.SearchResultModel
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/// <reference path="../app.js" />
|
define(['app', 'AddSeries/RootFolders/RootFolderCollection', 'Quality/QualityProfileCollection'], function () {
|
||||||
/// <reference path="RootFolders/RootDirCollection.js" />
|
|
||||||
/// <reference path="../Quality/qualityProfileCollection.js" />
|
|
||||||
NzbDrone.AddSeries.SearchResultModel = Backbone.Model.extend({
|
NzbDrone.AddSeries.SearchResultModel = Backbone.Model.extend({
|
||||||
mutators: {
|
mutators: {
|
||||||
seriesYear: function () {
|
seriesYear: function () {
|
||||||
var date = Date.utc.create(this.get('firstAired')).format('({yyyy})');
|
var date = Date.utc.create(this.get('firstAired')).format('({yyyy})');
|
||||||
|
@ -17,7 +17,9 @@ NzbDrone.AddSeries.SearchResultModel = Backbone.Model.extend({
|
||||||
|
|
||||||
defaults: {
|
defaults: {
|
||||||
qualityProfiles: new NzbDrone.Quality.QualityProfileCollection(),
|
qualityProfiles: new NzbDrone.Quality.QualityProfileCollection(),
|
||||||
rootFolders: new NzbDrone.AddSeries.RootDirCollection()
|
rootFolders: new NzbDrone.AddSeries.RootFolders.RootFolderModel()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -8,7 +8,7 @@ namespace NzbDrone.Web.Backbone.NzbDrone
|
||||||
public class CassetteBundleConfiguration : IConfiguration<BundleCollection>
|
public class CassetteBundleConfiguration : IConfiguration<BundleCollection>
|
||||||
{
|
{
|
||||||
public const string BASE_STYLE = "BASE_STYLE";
|
public const string BASE_STYLE = "BASE_STYLE";
|
||||||
public const string NZBDRONE = "NZBDRONE";
|
//public const string NZBDRONE = "NZBDRONE";
|
||||||
internal const string FONTS = "FONTS";
|
internal const string FONTS = "FONTS";
|
||||||
|
|
||||||
private const string APP_PATH = "_backboneApp";
|
private const string APP_PATH = "_backboneApp";
|
||||||
|
@ -17,7 +17,7 @@ namespace NzbDrone.Web.Backbone.NzbDrone
|
||||||
{
|
{
|
||||||
bundles.AddUrlWithAlias<StylesheetBundle>("//fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,400,600,300'", FONTS);
|
bundles.AddUrlWithAlias<StylesheetBundle>("//fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,400,600,300'", FONTS);
|
||||||
|
|
||||||
bundles.AddPerIndividualFile<ScriptBundle>(APP_PATH);
|
//bundles.AddPerIndividualFile<ScriptBundle>(APP_PATH);
|
||||||
|
|
||||||
bundles.Add<StylesheetBundle>(BASE_STYLE, new[]{
|
bundles.Add<StylesheetBundle>(BASE_STYLE, new[]{
|
||||||
APP_PATH + "\\Content\\Bootstrap\\bootstrap.less",
|
APP_PATH + "\\Content\\Bootstrap\\bootstrap.less",
|
||||||
|
@ -28,15 +28,17 @@ namespace NzbDrone.Web.Backbone.NzbDrone
|
||||||
},
|
},
|
||||||
bundle => bundle.AddReference("/" + FONTS));
|
bundle => bundle.AddReference("/" + FONTS));
|
||||||
|
|
||||||
bundles.Add<ScriptBundle>("~/_backboneApp/JsLibraries/backbone.js");
|
/* bundles.Add<ScriptBundle>("~/_backboneApp/JsLibraries/backbone.js");
|
||||||
|
|
||||||
bundles.Add<ScriptBundle>(NZBDRONE, new[]{
|
bundles.Add<ScriptBundle>(NZBDRONE, new[]{
|
||||||
|
APP_PATH + "\\app.js",
|
||||||
|
APP_PATH + "\\routing.js",
|
||||||
APP_PATH + "\\Series\\Index\\IndexLayout.js",
|
APP_PATH + "\\Series\\Index\\IndexLayout.js",
|
||||||
APP_PATH + "\\AddSeries\\AddSeriesLayout.js",
|
APP_PATH + "\\AddSeries\\AddSeriesLayout.js",
|
||||||
APP_PATH + "\\Shared\\NotificationView.js",
|
APP_PATH + "\\Shared\\NotificationView.js",
|
||||||
|
|
||||||
|
|
||||||
});
|
});*/
|
||||||
|
|
||||||
/* bundles.Add<ScriptBundle>(NZBDRONE, new[]{
|
/* bundles.Add<ScriptBundle>(NZBDRONE, new[]{
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/// <reference path="handlebars.js" />
|
|
||||||
|
define(['underscore', 'marionette', 'handlebars', 'jquery'], function (_, Marionette, Handlebars, $) {
|
||||||
_.extend(Marionette.TemplateCache.prototype, {
|
_.extend(Marionette.TemplateCache.prototype, {
|
||||||
|
|
||||||
loadTemplate: function (templateId) {
|
loadTemplate: function (templateId) {
|
||||||
|
|
||||||
|
@ -11,7 +11,7 @@ _.extend(Marionette.TemplateCache.prototype, {
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: '_backboneApp//' + templateId + '.html',
|
url: '_backboneApp//' + templateId + '.html',
|
||||||
cache:false,
|
cache: false,
|
||||||
async: false
|
async: false
|
||||||
|
|
||||||
}).done(function (data) {
|
}).done(function (data) {
|
||||||
|
@ -24,11 +24,13 @@ _.extend(Marionette.TemplateCache.prototype, {
|
||||||
|
|
||||||
return template;
|
return template;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
_.extend(Marionette.TemplateCache.prototype, {
|
_.extend(Marionette.TemplateCache.prototype, {
|
||||||
|
|
||||||
compileTemplate: function (rawTemplate) {
|
compileTemplate: function (rawTemplate) {
|
||||||
return Handlebars.compile(rawTemplate);
|
return Handlebars.compile(rawTemplate);
|
||||||
}
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -1,7 +1,8 @@
|
||||||
/// <reference path="../app.js" />
|
define(['app', 'Quality/QualityProfileModel'], function () {
|
||||||
/// <reference path="qualityProfileModel.js" />
|
|
||||||
|
|
||||||
NzbDrone.Quality.QualityProfileCollection = Backbone.Collection.extend({
|
NzbDrone.Quality.QualityProfileCollection = Backbone.Collection.extend({
|
||||||
model: NzbDrone.Quality.QualityProfileModel,
|
model: NzbDrone.Quality.QualityProfileModel,
|
||||||
url: NzbDrone.Constants.ApiRoot + '/qualityprofiles'
|
url: NzbDrone.Constants.ApiRoot + '/qualityprofiles'
|
||||||
|
});
|
||||||
|
|
||||||
});
|
});
|
|
@ -1,6 +1,5 @@
|
||||||
/// <reference path="../app.js" />
|
define(['app'], function () {
|
||||||
|
NzbDrone.Quality.QualityProfileModel = Backbone.Model.extend({
|
||||||
NzbDrone.Quality.QualityProfileModel = Backbone.Model.extend({
|
|
||||||
initialize: function () {
|
initialize: function () {
|
||||||
this.validators = {};
|
this.validators = {};
|
||||||
|
|
||||||
|
@ -44,4 +43,6 @@ NzbDrone.Quality.QualityProfileModel = Backbone.Model.extend({
|
||||||
//allowed: {},
|
//allowed: {},
|
||||||
Cutoff: null
|
Cutoff: null
|
||||||
}
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,38 @@
|
||||||
|
require(['app', 'AddSeries/AddSeriesLayout'], function () {
|
||||||
|
|
||||||
|
NzbDrone.Controller = Backbone.Marionette.Controller.extend({
|
||||||
|
|
||||||
|
addSeries: function (action, query) {
|
||||||
|
NzbDrone.mainRegion.show(new NzbDrone.AddSeries.AddSeriesLayout(this, action, query));
|
||||||
|
},
|
||||||
|
|
||||||
|
series: function (action, query) {
|
||||||
|
NzbDrone.mainRegion.show(new NzbDrone.Series.IndexLayout(this, action, query));
|
||||||
|
},
|
||||||
|
|
||||||
|
notFound: function () {
|
||||||
|
alert('route not found');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
NzbDrone.Router = Backbone.Marionette.AppRouter.extend({
|
||||||
|
|
||||||
|
controller: new NzbDrone.Controller(),
|
||||||
|
appRoutes: {
|
||||||
|
'series': 'series',
|
||||||
|
'series/index': 'series',
|
||||||
|
'series/add': 'addSeries',
|
||||||
|
'series/add/:action(/:query)': 'addSeries',
|
||||||
|
':whatever': 'notFound'
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
NzbDrone.addInitializer(function () {
|
||||||
|
|
||||||
|
NzbDrone.Router = new NzbDrone.Router();
|
||||||
|
Backbone.history.start();
|
||||||
|
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
/*global NzbDrone, Backbone*/
|
/*global NzbDrone, Backbone*/
|
||||||
/// <reference path="../app.js" />
|
|
||||||
/// <reference path="SeriesModel.js" />
|
/// <reference path="SeriesModel.js" />
|
||||||
|
|
||||||
NzbDrone.Series.DeleteSeriesView = Backbone.Marionette.ItemView.extend({
|
NzbDrone.Series.DeleteSeriesView = Backbone.Marionette.ItemView.extend({
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
/*global NzbDrone, Backbone*/
|
/*global NzbDrone, Backbone*/
|
||||||
/// <reference path="../app.js" />
|
|
||||||
/// <reference path="SeriesModel.js" />
|
/// <reference path="SeriesModel.js" />
|
||||||
/// <reference path="DeleteSeriesView.js" />
|
/// <reference path="DeleteSeriesView.js" />
|
||||||
/// <reference path="../Quality/qualityProfileCollection.js" />
|
/// <reference path="../Quality/qualityProfileCollection.js" />
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
'use strict;'
|
'use strict;'
|
||||||
/// <reference path="../../app.js" />
|
|
||||||
/// <reference path="../SeriesCollection.js" />
|
/// <reference path="../SeriesCollection.js" />
|
||||||
/// <reference path="SeriesItemView.js" />
|
/// <reference path="SeriesItemView.js" />
|
||||||
/// <reference path="../../JsLibraries/jquery.dataTables.bootstrap.pagination.js" />
|
/// <reference path="../../JsLibraries/jquery.dataTables.bootstrap.pagination.js" />
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
/*global NzbDrone, Backbone*/
|
/*global NzbDrone, Backbone*/
|
||||||
/// <reference path="../../app.js" />
|
|
||||||
/// <reference path="../SeriesModel.js" />
|
/// <reference path="../SeriesModel.js" />
|
||||||
/// <reference path="../SeriesCollection.js" />
|
/// <reference path="../SeriesCollection.js" />
|
||||||
/// <reference path="../EditSeriesView.js" />
|
/// <reference path="../EditSeriesView.js" />
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/// <reference path="../app.js" />
|
|
||||||
/// <reference path="SeriesModel.js" />
|
/// <reference path="SeriesModel.js" />
|
||||||
|
|
||||||
NzbDrone.Series.SeriesCollection = Backbone.Collection.extend({
|
NzbDrone.Series.SeriesCollection = Backbone.Collection.extend({
|
||||||
|
|
|
@ -1,4 +1,7 @@
|
||||||
NzbDrone.Series.SeriesModel = Backbone.Model.extend({
|
define(['app'], function () {
|
||||||
|
|
||||||
|
|
||||||
|
NzbDrone.Series.SeriesModel = Backbone.Model.extend({
|
||||||
url: NzbDrone.Constants.ApiRoot + '/series',
|
url: NzbDrone.Constants.ApiRoot + '/series',
|
||||||
|
|
||||||
mutators: {
|
mutators: {
|
||||||
|
@ -18,16 +21,6 @@
|
||||||
return date.format('{MM}/{dd}/{yyyy}');
|
return date.format('{MM}/{dd}/{yyyy}');
|
||||||
},
|
},
|
||||||
|
|
||||||
formatedDateString: function () {
|
|
||||||
var dateSource = this.get('nextAiring');
|
|
||||||
|
|
||||||
if (!dateSource) return '';
|
|
||||||
|
|
||||||
var date = Date.create(dateSource);
|
|
||||||
|
|
||||||
return date.format('{Weekday} {Month} {dd}, {yyyy} {12hr}:{mm} {TT}');
|
|
||||||
},
|
|
||||||
|
|
||||||
percentOfEpisodes: function () {
|
percentOfEpisodes: function () {
|
||||||
var episodeCount = this.get('episodeCount');
|
var episodeCount = this.get('episodeCount');
|
||||||
var episodeFileCount = this.get('episodeFileCount');
|
var episodeFileCount = this.get('episodeFileCount');
|
||||||
|
@ -45,4 +38,6 @@
|
||||||
episodeFileCount: 0,
|
episodeFileCount: 0,
|
||||||
episodeCount: 0
|
episodeCount: 0
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
|
||||||
});
|
});
|
|
@ -1,4 +1,6 @@
|
||||||
$.fn.folderAutoComplete = function () {
|
define(['bootstrap'], function () {
|
||||||
|
|
||||||
|
$.fn.folderAutoComplete = function () {
|
||||||
$(this).typeahead({
|
$(this).typeahead({
|
||||||
source: function (query, process) {
|
source: function (query, process) {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
|
@ -13,4 +15,6 @@
|
||||||
},
|
},
|
||||||
minLength: 3
|
minLength: 3
|
||||||
});
|
});
|
||||||
}
|
};
|
||||||
|
|
||||||
|
});
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
ModalRegion = Backbone.Marionette.Region.extend({
|
define('modalRegion', ['Marionette'], function (Marionette) {
|
||||||
|
return Marionette.Region.extend({
|
||||||
el: "#modal-region",
|
el: "#modal-region",
|
||||||
|
|
||||||
constructor: function () {
|
constructor: function () {
|
||||||
|
@ -21,4 +22,7 @@
|
||||||
hideModal: function () {
|
hideModal: function () {
|
||||||
this.$el.modal('hide');
|
this.$el.modal('hide');
|
||||||
}
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
/// <reference path="../app.js" />
|
|
||||||
|
|
||||||
NzbDrone.Shared.NotificationModel = Backbone.Model.extend({
|
NzbDrone.Shared.NotificationModel = Backbone.Model.extend({
|
||||||
|
|
||||||
mutators: {
|
mutators: {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/// <reference path="../app.js" />
|
|
||||||
/// <reference path="NotificationModel.js" />
|
/// <reference path="NotificationModel.js" />
|
||||||
|
|
||||||
NzbDrone.Shared.NotificationItemView = Backbone.Marionette.ItemView.extend({
|
NzbDrone.Shared.NotificationItemView = Backbone.Marionette.ItemView.extend({
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
/// <reference path="../app.js" />
|
NzbDrone.Shared.SpinnerView = Backbone.Marionette.ItemView.extend({
|
||||||
|
|
||||||
NzbDrone.Shared.SpinnerView = Backbone.Marionette.ItemView.extend({
|
|
||||||
|
|
||||||
template: 'Shared/SpinnerTemplate',
|
template: 'Shared/SpinnerTemplate',
|
||||||
className: 'nz-spinner row',
|
className: 'nz-spinner row',
|
||||||
|
|
|
@ -1,97 +1,85 @@
|
||||||
/// <reference path="JsLibraries/jquery.js" />
|
require.config({
|
||||||
/// <reference path="JsLibraries/underscore.js" />
|
|
||||||
/// <reference path="JsLibraries/sugar.js" />
|
|
||||||
/// <reference path="JsLibraries/backbone.js" />
|
|
||||||
/// <reference path="JsLibraries/handlebars.js" />
|
|
||||||
/// <reference path="JsLibraries/backbone.modelbinder.js" />
|
|
||||||
/// <reference path="JsLibraries/backbone.mutators.js" />
|
|
||||||
/// <reference path="JsLibraries/backbone.shortcuts.js" />
|
|
||||||
/// <reference path="JsLibraries/backbone.marionette.js" />
|
|
||||||
/// <reference path="JsLibraries/backbone.marionette.extend.js" />
|
|
||||||
/// <reference path="JsLibraries/backbone.marionette.viewswapper.js" />
|
|
||||||
/// <reference path="JsLibraries/backbone.modelbinder.js" />
|
|
||||||
/// <reference path="JsLibraries/bootstrap.js" />
|
|
||||||
/// <reference path="Shared/ModalRegion.js" />
|
|
||||||
|
|
||||||
if (typeof console === undefined) {
|
paths: {
|
||||||
window.console = { log: function () { } };
|
'backbone': 'JsLibraries/backbone',
|
||||||
}
|
'underscore': 'JsLibraries/underscore',
|
||||||
|
'marionette': 'JsLibraries/backbone.marionette',
|
||||||
|
'handlebars': 'JsLibraries/handlebars',
|
||||||
|
'bootstrap': 'JsLibraries/bootstrap',
|
||||||
|
},
|
||||||
|
|
||||||
NzbDrone = new Backbone.Marionette.Application();
|
shim: {
|
||||||
NzbDrone.Series = {};
|
bootstrap: {
|
||||||
NzbDrone.Series.Index = {};
|
deps: ["jquery"],
|
||||||
NzbDrone.AddSeries = {};
|
},
|
||||||
NzbDrone.AddSeries.New = {};
|
underscore: {
|
||||||
NzbDrone.AddSeries.Existing = {};
|
exports: '_'
|
||||||
NzbDrone.AddSeries.RootFolders = {};
|
},
|
||||||
NzbDrone.Quality = {};
|
backbone: {
|
||||||
NzbDrone.Shared = {};
|
deps: ["underscore", "jquery"],
|
||||||
|
exports: "Backbone"
|
||||||
|
},
|
||||||
|
marionette: {
|
||||||
|
deps: ["backbone"],
|
||||||
|
exports: "Marionette"
|
||||||
|
},
|
||||||
|
handlebars: {
|
||||||
|
exports: "Handlebars"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
/*
|
define('app', ['jquery', 'JsLibraries/backbone.modelbinder', 'marionette', 'handlebars', 'JsLibraries/backbone.marionette.extend'],
|
||||||
_.templateSettings = {
|
function (jquery, modelBinder, marionette, handlebars) {
|
||||||
interpolate: /\{\{([\s\S]+?)\}\}/g
|
|
||||||
};
|
|
||||||
*/
|
|
||||||
|
|
||||||
NzbDrone.ModelBinder = new Backbone.ModelBinder();
|
|
||||||
|
|
||||||
NzbDrone.Constants = {
|
window.$ = jquery;
|
||||||
|
window.jquery = jquery;
|
||||||
|
|
||||||
|
window.Backbone.ModelBinder = modelBinder;
|
||||||
|
window.Backbone.Marionette = marionette;
|
||||||
|
window.Handlebars = handlebars;
|
||||||
|
|
||||||
|
window.NzbDrone = new Backbone.Marionette.Application();
|
||||||
|
window.NzbDrone.Series = {};
|
||||||
|
window.NzbDrone.Series.Index = {};
|
||||||
|
window.NzbDrone.AddSeries = {};
|
||||||
|
window.NzbDrone.AddSeries.New = {};
|
||||||
|
window.NzbDrone.AddSeries.Existing = {};
|
||||||
|
window.NzbDrone.AddSeries.RootFolders = {};
|
||||||
|
window.NzbDrone.Quality = {};
|
||||||
|
window.NzbDrone.Shared = {};
|
||||||
|
|
||||||
|
window.NzbDrone.Constants = {
|
||||||
ApiRoot: '/api'
|
ApiRoot: '/api'
|
||||||
};
|
};
|
||||||
|
|
||||||
NzbDrone.Events = {
|
|
||||||
DisplayInMainRegion: 'DisplayInMainRegion'
|
|
||||||
};
|
|
||||||
|
|
||||||
NzbDrone.Controller = Backbone.Marionette.Controller.extend({
|
window.NzbDrone.addInitializer(function (options) {
|
||||||
|
|
||||||
addSeries: function (action, query) {
|
|
||||||
NzbDrone.mainRegion.show(new NzbDrone.AddSeries.AddSeriesLayout(this, action, query));
|
|
||||||
},
|
|
||||||
|
|
||||||
series: function (action, query) {
|
|
||||||
NzbDrone.mainRegion.show(new NzbDrone.Series.IndexLayout(this, action, query));
|
|
||||||
},
|
|
||||||
|
|
||||||
notFound: function () {
|
|
||||||
alert('route not found');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
NzbDrone.Router = Backbone.Marionette.AppRouter.extend({
|
|
||||||
|
|
||||||
controller: new NzbDrone.Controller(),
|
|
||||||
// "someMethod" must exist at controller.someMethod
|
|
||||||
appRoutes: {
|
|
||||||
'series': 'series',
|
|
||||||
'series/index': 'series',
|
|
||||||
'series/add': 'addSeries',
|
|
||||||
'series/add/:action(/:query)': 'addSeries',
|
|
||||||
':whatever': 'notFound'
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
NzbDrone.addInitializer(function (options) {
|
|
||||||
|
|
||||||
console.log('starting application');
|
console.log('starting application');
|
||||||
|
|
||||||
NzbDrone.registerHelpers();
|
NzbDrone.ModelBinder = new Backbone.ModelBinder();
|
||||||
|
|
||||||
NzbDrone.addRegions({
|
//TODO: move this out of here
|
||||||
mainRegion: '#main-region',
|
|
||||||
notificationRegion: '#notification-region',
|
|
||||||
modalRegion: ModalRegion
|
|
||||||
});
|
|
||||||
|
|
||||||
NzbDrone.Router = new NzbDrone.Router();
|
|
||||||
Backbone.history.start();
|
|
||||||
});
|
|
||||||
|
|
||||||
NzbDrone.registerHelpers = function() {
|
|
||||||
Handlebars.registerHelper("formatStatus", function (status, monitored) {
|
Handlebars.registerHelper("formatStatus", function (status, monitored) {
|
||||||
if (!monitored) return '<i class="icon-pause grid-icon" title="Not Monitored"></i>';
|
if (!monitored) return '<i class="icon-pause grid-icon" title="Not Monitored"></i>';
|
||||||
if (status === 'Continuing') return '<i class="icon-play grid-icon" title="Continuing"></i>';
|
if (status === 'Continuing') return '<i class="icon-play grid-icon" title="Continuing"></i>';
|
||||||
|
|
||||||
return '<i class="icon-stop grid-icon" title="Ended"></i>';
|
return '<i class="icon-stop grid-icon" title="Ended"></i>';
|
||||||
});
|
});
|
||||||
}
|
|
||||||
|
NzbDrone.addRegions({
|
||||||
|
mainRegion: '#main-region',
|
||||||
|
notificationRegion: '#notification-region',
|
||||||
|
modalRegion: '#modal-region'
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
window.NzbDrone.start();
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
<FileVersion>1</FileVersion>
|
<FileVersion>1</FileVersion>
|
||||||
<AutoEnableOnStartup>False</AutoEnableOnStartup>
|
<AutoEnableOnStartup>False</AutoEnableOnStartup>
|
||||||
<AllowParallelTestExecution>true</AllowParallelTestExecution>
|
<AllowParallelTestExecution>true</AllowParallelTestExecution>
|
||||||
|
<AllowTestsToRunInParallelWithThemselves>true</AllowTestsToRunInParallelWithThemselves>
|
||||||
<FrameworkUtilisationTypeForNUnit>UseDynamicAnalysis</FrameworkUtilisationTypeForNUnit>
|
<FrameworkUtilisationTypeForNUnit>UseDynamicAnalysis</FrameworkUtilisationTypeForNUnit>
|
||||||
<FrameworkUtilisationTypeForGallio>Disabled</FrameworkUtilisationTypeForGallio>
|
<FrameworkUtilisationTypeForGallio>Disabled</FrameworkUtilisationTypeForGallio>
|
||||||
<FrameworkUtilisationTypeForMSpec>Disabled</FrameworkUtilisationTypeForMSpec>
|
<FrameworkUtilisationTypeForMSpec>Disabled</FrameworkUtilisationTypeForMSpec>
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
|
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
|
||||||
|
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=JS_005FPARAMETER/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb"><ExtraRule Prefix="" Suffix="" Style="AaBb" /></Policy></s:String>
|
||||||
<s:String x:Key="/Default/Environment/Editor/MatchingBraceHighlighting/Position/@EntryValue">BOTH_SIDES</s:String>
|
<s:String x:Key="/Default/Environment/Editor/MatchingBraceHighlighting/Position/@EntryValue">BOTH_SIDES</s:String>
|
||||||
<s:String x:Key="/Default/Environment/Editor/MatchingBraceHighlighting/Style/@EntryValue">OUTLINE</s:String>
|
<s:String x:Key="/Default/Environment/Editor/MatchingBraceHighlighting/Style/@EntryValue">OUTLINE</s:String>
|
||||||
<s:Boolean x:Key="/Default/Environment/InjectedLayers/FileInjectedLayer/=5C7F3FB135E52A44B9447C48B2EEEE92/@KeyIndexDefined">True</s:Boolean>
|
<s:Boolean x:Key="/Default/Environment/InjectedLayers/FileInjectedLayer/=5C7F3FB135E52A44B9447C48B2EEEE92/@KeyIndexDefined">True</s:Boolean>
|
||||||
|
|
Loading…
Reference in New Issue