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,10 +1,12 @@
|
||||||
/// <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'
|
||||||
|
],
|
||||||
|
function () {
|
||||||
NzbDrone.AddSeries.AddSeriesLayout = Backbone.Marionette.Layout.extend({
|
NzbDrone.AddSeries.AddSeriesLayout = Backbone.Marionette.Layout.extend({
|
||||||
template: 'AddSeries/addSeriesLayoutTemplate',
|
template: 'AddSeries/addSeriesLayoutTemplate',
|
||||||
|
|
||||||
|
@ -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,8 +1,6 @@
|
||||||
'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({
|
||||||
|
@ -147,8 +145,5 @@ NzbDrone.AddSeries.Existing.ImportSeriesView = Backbone.Marionette.CollectionVie
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
/// <reference path="../../app.js" />
|
|
||||||
|
define(['app'], function () {
|
||||||
|
|
||||||
|
|
||||||
NzbDrone.AddSeries.Existing.UnmappedFolderModel = Backbone.Model.extend({
|
NzbDrone.AddSeries.Existing.UnmappedFolderModel = Backbone.Model.extend({
|
||||||
|
|
||||||
|
|
||||||
|
@ -29,6 +32,4 @@ NzbDrone.AddSeries.Existing.UnmappedFolderCollection = Backbone.Collection.exten
|
||||||
}, 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',
|
||||||
|
|
||||||
|
@ -82,3 +80,4 @@ 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',
|
||||||
|
@ -69,3 +66,4 @@ NzbDrone.AddSeries.SearchResultView = Backbone.Marionette.CollectionView.extend(
|
||||||
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,6 +1,6 @@
|
||||||
/// <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 () {
|
||||||
|
@ -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,5 +1,5 @@
|
||||||
/// <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) {
|
||||||
|
@ -32,3 +32,5 @@ _.extend(Marionette.TemplateCache.prototype, {
|
||||||
return Handlebars.compile(rawTemplate);
|
return Handlebars.compile(rawTemplate);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*!
|
/*!
|
||||||
* jQuery JavaScript Library v1.9.0
|
* jQuery JavaScript Library v1.9.1
|
||||||
* http://jquery.com/
|
* http://jquery.com/
|
||||||
*
|
*
|
||||||
* Includes Sizzle.js
|
* Includes Sizzle.js
|
||||||
|
@ -9,16 +9,25 @@
|
||||||
* Released under the MIT license
|
* Released under the MIT license
|
||||||
* http://jquery.org/license
|
* http://jquery.org/license
|
||||||
*
|
*
|
||||||
* Date: 2013-1-14
|
* Date: 2013-2-4
|
||||||
*/
|
*/
|
||||||
(function (window, undefined) {
|
(function (window, undefined) {
|
||||||
"use strict";
|
|
||||||
|
// Can't do this because several apps including ASP.NET trace
|
||||||
|
// the stack via arguments.caller.callee and Firefox dies if
|
||||||
|
// you try to trace through "use strict" call chains. (#13335)
|
||||||
|
// Support: Firefox 18+
|
||||||
|
//"use strict";
|
||||||
var
|
var
|
||||||
|
// The deferred used on DOM ready
|
||||||
|
readyList,
|
||||||
|
|
||||||
// A central reference to the root jQuery(document)
|
// A central reference to the root jQuery(document)
|
||||||
rootjQuery,
|
rootjQuery,
|
||||||
|
|
||||||
// The deferred used on DOM ready
|
// Support: IE<9
|
||||||
readyList,
|
// For `typeof node.method` instead of `node.method !== undefined`
|
||||||
|
core_strundefined = typeof undefined,
|
||||||
|
|
||||||
// Use the correct document accordingly with window argument (sandbox)
|
// Use the correct document accordingly with window argument (sandbox)
|
||||||
document = window.document,
|
document = window.document,
|
||||||
|
@ -36,7 +45,7 @@ var
|
||||||
// List of deleted data cache ids, so we can reuse them
|
// List of deleted data cache ids, so we can reuse them
|
||||||
core_deletedIds = [],
|
core_deletedIds = [],
|
||||||
|
|
||||||
core_version = "1.9.0",
|
core_version = "1.9.1",
|
||||||
|
|
||||||
// Save a reference to some core methods
|
// Save a reference to some core methods
|
||||||
core_concat = core_deletedIds.concat,
|
core_concat = core_deletedIds.concat,
|
||||||
|
@ -85,16 +94,24 @@ var
|
||||||
return letter.toUpperCase();
|
return letter.toUpperCase();
|
||||||
},
|
},
|
||||||
|
|
||||||
// The ready event handler and self cleanup method
|
// The ready event handler
|
||||||
DOMContentLoaded = function() {
|
completed = function (event) {
|
||||||
|
|
||||||
|
// readyState === "complete" is good enough for us to call the dom ready in oldIE
|
||||||
|
if (document.addEventListener || event.type === "load" || document.readyState === "complete") {
|
||||||
|
detach();
|
||||||
|
jQuery.ready();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// Clean-up method for dom ready events
|
||||||
|
detach = function () {
|
||||||
if (document.addEventListener) {
|
if (document.addEventListener) {
|
||||||
document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false );
|
document.removeEventListener("DOMContentLoaded", completed, false);
|
||||||
jQuery.ready();
|
window.removeEventListener("load", completed, false);
|
||||||
} else if ( document.readyState === "complete" ) {
|
|
||||||
// we're here because readyState === "complete" in oldIE
|
} else {
|
||||||
// which is good enough for us to call the dom ready!
|
document.detachEvent("onreadystatechange", completed);
|
||||||
document.detachEvent( "onreadystatechange", DOMContentLoaded );
|
window.detachEvent("onload", completed);
|
||||||
jQuery.ready();
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -299,7 +316,7 @@ jQuery.fn = jQuery.prototype = {
|
||||||
jQuery.fn.init.prototype = jQuery.fn;
|
jQuery.fn.init.prototype = jQuery.fn;
|
||||||
|
|
||||||
jQuery.extend = jQuery.fn.extend = function () {
|
jQuery.extend = jQuery.fn.extend = function () {
|
||||||
var options, name, src, copy, copyIsArray, clone,
|
var src, copyIsArray, copy, name, options, clone,
|
||||||
target = arguments[0] || {},
|
target = arguments[0] || {},
|
||||||
i = 1,
|
i = 1,
|
||||||
length = arguments.length,
|
length = arguments.length,
|
||||||
|
@ -781,7 +798,7 @@ jQuery.extend({
|
||||||
// Bind a function to a context, optionally partially applying any
|
// Bind a function to a context, optionally partially applying any
|
||||||
// arguments.
|
// arguments.
|
||||||
proxy: function (fn, context) {
|
proxy: function (fn, context) {
|
||||||
var tmp, args, proxy;
|
var args, proxy, tmp;
|
||||||
|
|
||||||
if (typeof context === "string") {
|
if (typeof context === "string") {
|
||||||
tmp = fn[context];
|
tmp = fn[context];
|
||||||
|
@ -880,18 +897,18 @@ jQuery.ready.promise = function( obj ) {
|
||||||
// Standards-based browsers support DOMContentLoaded
|
// Standards-based browsers support DOMContentLoaded
|
||||||
} else if (document.addEventListener) {
|
} else if (document.addEventListener) {
|
||||||
// Use the handy event callback
|
// Use the handy event callback
|
||||||
document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false );
|
document.addEventListener("DOMContentLoaded", completed, false);
|
||||||
|
|
||||||
// A fallback to window.onload, that will always work
|
// A fallback to window.onload, that will always work
|
||||||
window.addEventListener( "load", jQuery.ready, false );
|
window.addEventListener("load", completed, false);
|
||||||
|
|
||||||
// If IE event model is used
|
// If IE event model is used
|
||||||
} else {
|
} else {
|
||||||
// Ensure firing before onload, maybe late but safe also for iframes
|
// Ensure firing before onload, maybe late but safe also for iframes
|
||||||
document.attachEvent( "onreadystatechange", DOMContentLoaded );
|
document.attachEvent("onreadystatechange", completed);
|
||||||
|
|
||||||
// A fallback to window.onload, that will always work
|
// A fallback to window.onload, that will always work
|
||||||
window.attachEvent( "onload", jQuery.ready );
|
window.attachEvent("onload", completed);
|
||||||
|
|
||||||
// If IE and not a frame
|
// If IE and not a frame
|
||||||
// continually check to see if the document is ready
|
// continually check to see if the document is ready
|
||||||
|
@ -913,6 +930,9 @@ jQuery.ready.promise = function( obj ) {
|
||||||
return setTimeout(doScrollCheck, 50);
|
return setTimeout(doScrollCheck, 50);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// detach all dom ready events
|
||||||
|
detach();
|
||||||
|
|
||||||
// and execute any waiting functions
|
// and execute any waiting functions
|
||||||
jQuery.ready();
|
jQuery.ready();
|
||||||
}
|
}
|
||||||
|
@ -989,18 +1009,18 @@ jQuery.Callbacks = function( options ) {
|
||||||
(optionsCache[options] || createOptions(options)) :
|
(optionsCache[options] || createOptions(options)) :
|
||||||
jQuery.extend({}, options);
|
jQuery.extend({}, options);
|
||||||
|
|
||||||
var // Last fire value (for non-forgettable lists)
|
var // Flag to know if list is currently firing
|
||||||
|
firing,
|
||||||
|
// Last fire value (for non-forgettable lists)
|
||||||
memory,
|
memory,
|
||||||
// Flag to know if list was already fired
|
// Flag to know if list was already fired
|
||||||
fired,
|
fired,
|
||||||
// Flag to know if list is currently firing
|
|
||||||
firing,
|
|
||||||
// First callback to fire (used internally by add and fireWith)
|
|
||||||
firingStart,
|
|
||||||
// End of the loop when firing
|
// End of the loop when firing
|
||||||
firingLength,
|
firingLength,
|
||||||
// Index of currently firing callback (modified by remove if needed)
|
// Index of currently firing callback (modified by remove if needed)
|
||||||
firingIndex,
|
firingIndex,
|
||||||
|
// First callback to fire (used internally by add and fireWith)
|
||||||
|
firingStart,
|
||||||
// Actual callback list
|
// Actual callback list
|
||||||
list = [],
|
list = [],
|
||||||
// Stack of fire calls for repeatable lists
|
// Stack of fire calls for repeatable lists
|
||||||
|
@ -1086,9 +1106,10 @@ jQuery.Callbacks = function( options ) {
|
||||||
}
|
}
|
||||||
return this;
|
return this;
|
||||||
},
|
},
|
||||||
// Control if a given callback is in the list
|
// Check if a given callback is in the list.
|
||||||
|
// If no argument is given, return whether or not list has callbacks attached.
|
||||||
has: function (fn) {
|
has: function (fn) {
|
||||||
return jQuery.inArray( fn, list ) > -1;
|
return fn ? jQuery.inArray(fn, list) > -1 : !!(list && list.length);
|
||||||
},
|
},
|
||||||
// Remove all callbacks from the list
|
// Remove all callbacks from the list
|
||||||
empty: function () {
|
empty: function () {
|
||||||
|
@ -1285,7 +1306,9 @@ jQuery.extend({
|
||||||
});
|
});
|
||||||
jQuery.support = (function () {
|
jQuery.support = (function () {
|
||||||
|
|
||||||
var support, all, a, select, opt, input, fragment, eventName, isSupported, i,
|
var support, all, a,
|
||||||
|
input, select, fragment,
|
||||||
|
opt, eventName, isSupported, i,
|
||||||
div = document.createElement("div");
|
div = document.createElement("div");
|
||||||
|
|
||||||
// Setup
|
// Setup
|
||||||
|
@ -1486,7 +1509,7 @@ jQuery.support = (function() {
|
||||||
!parseFloat((window.getComputedStyle(marginDiv, null) || {}).marginRight);
|
!parseFloat((window.getComputedStyle(marginDiv, null) || {}).marginRight);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( typeof div.style.zoom !== "undefined" ) {
|
if (typeof div.style.zoom !== core_strundefined) {
|
||||||
// Support: IE<8
|
// Support: IE<8
|
||||||
// Check if natively block-level elements act like inline-block
|
// Check if natively block-level elements act like inline-block
|
||||||
// elements when setting their display to 'inline' and giving
|
// elements when setting their display to 'inline' and giving
|
||||||
|
@ -1502,10 +1525,13 @@ jQuery.support = (function() {
|
||||||
div.firstChild.style.width = "5px";
|
div.firstChild.style.width = "5px";
|
||||||
support.shrinkWrapBlocks = (div.offsetWidth !== 3);
|
support.shrinkWrapBlocks = (div.offsetWidth !== 3);
|
||||||
|
|
||||||
|
if (support.inlineBlockNeedsLayout) {
|
||||||
// Prevent IE 6 from affecting layout for positioned elements #11048
|
// Prevent IE 6 from affecting layout for positioned elements #11048
|
||||||
// Prevent IE from shrinking the body in IE 7 mode #12869
|
// Prevent IE from shrinking the body in IE 7 mode #12869
|
||||||
|
// Support: IE<8
|
||||||
body.style.zoom = 1;
|
body.style.zoom = 1;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
body.removeChild(container);
|
body.removeChild(container);
|
||||||
|
|
||||||
|
@ -1616,13 +1642,12 @@ function internalData( elem, name, data, pvt /* Internal Use Only */ ){
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
function internalRemoveData( elem, name, pvt /* For internal use only */ ){
|
function internalRemoveData(elem, name, pvt) {
|
||||||
if (!jQuery.acceptData(elem)) {
|
if (!jQuery.acceptData(elem)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var thisCache, i, l,
|
var i, l, thisCache,
|
||||||
|
|
||||||
isNode = elem.nodeType,
|
isNode = elem.nodeType,
|
||||||
|
|
||||||
// See jQuery.data for more information
|
// See jQuery.data for more information
|
||||||
|
@ -1726,11 +1751,11 @@ jQuery.extend({
|
||||||
},
|
},
|
||||||
|
|
||||||
data: function (elem, name, data) {
|
data: function (elem, name, data) {
|
||||||
return internalData( elem, name, data, false );
|
return internalData(elem, name, data);
|
||||||
},
|
},
|
||||||
|
|
||||||
removeData: function (elem, name) {
|
removeData: function (elem, name) {
|
||||||
return internalRemoveData( elem, name, false );
|
return internalRemoveData(elem, name);
|
||||||
},
|
},
|
||||||
|
|
||||||
// For internal use only.
|
// For internal use only.
|
||||||
|
@ -1744,6 +1769,11 @@ jQuery.extend({
|
||||||
|
|
||||||
// A method for determining if a DOM node can handle the data expando
|
// A method for determining if a DOM node can handle the data expando
|
||||||
acceptData: function (elem) {
|
acceptData: function (elem) {
|
||||||
|
// Do not set data on non-element because it will not be cleared (#8335).
|
||||||
|
if (elem.nodeType && elem.nodeType !== 1 && elem.nodeType !== 9) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
var noData = elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()];
|
var noData = elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()];
|
||||||
|
|
||||||
// nodes accept data unless otherwise specified; rejection can be conditional
|
// nodes accept data unless otherwise specified; rejection can be conditional
|
||||||
|
@ -1769,7 +1799,7 @@ jQuery.fn.extend({
|
||||||
name = attrs[i].name;
|
name = attrs[i].name;
|
||||||
|
|
||||||
if (!name.indexOf("data-")) {
|
if (!name.indexOf("data-")) {
|
||||||
name = jQuery.camelCase( name.substring(5) );
|
name = jQuery.camelCase(name.slice(5));
|
||||||
|
|
||||||
dataAttr(elem, name, data[name]);
|
dataAttr(elem, name, data[name]);
|
||||||
}
|
}
|
||||||
|
@ -2141,7 +2171,7 @@ jQuery.fn.extend({
|
||||||
}
|
}
|
||||||
|
|
||||||
// Toggle whole class name
|
// Toggle whole class name
|
||||||
} else if ( type === "undefined" || type === "boolean" ) {
|
} else if (type === core_strundefined || type === "boolean") {
|
||||||
if (this.className) {
|
if (this.className) {
|
||||||
// store className if set
|
// store className if set
|
||||||
jQuery._data(this, "__className__", this.className);
|
jQuery._data(this, "__className__", this.className);
|
||||||
|
@ -2170,7 +2200,7 @@ jQuery.fn.extend({
|
||||||
},
|
},
|
||||||
|
|
||||||
val: function (value) {
|
val: function (value) {
|
||||||
var hooks, ret, isFunction,
|
var ret, hooks, isFunction,
|
||||||
elem = this[0];
|
elem = this[0];
|
||||||
|
|
||||||
if (!arguments.length) {
|
if (!arguments.length) {
|
||||||
|
@ -2294,7 +2324,7 @@ jQuery.extend({
|
||||||
},
|
},
|
||||||
|
|
||||||
attr: function (elem, name, value) {
|
attr: function (elem, name, value) {
|
||||||
var ret, hooks, notxml,
|
var hooks, notxml, ret,
|
||||||
nType = elem.nodeType;
|
nType = elem.nodeType;
|
||||||
|
|
||||||
// don't get/set attributes on text, comment and attribute nodes
|
// don't get/set attributes on text, comment and attribute nodes
|
||||||
|
@ -2303,7 +2333,7 @@ jQuery.extend({
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fallback to prop when attributes are not supported
|
// Fallback to prop when attributes are not supported
|
||||||
if ( typeof elem.getAttribute === "undefined" ) {
|
if (typeof elem.getAttribute === core_strundefined) {
|
||||||
return jQuery.prop(elem, name, value);
|
return jQuery.prop(elem, name, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2336,7 +2366,7 @@ jQuery.extend({
|
||||||
|
|
||||||
// In IE9+, Flash objects don't have .getAttribute (#12945)
|
// In IE9+, Flash objects don't have .getAttribute (#12945)
|
||||||
// Support: IE9+
|
// Support: IE9+
|
||||||
if ( typeof elem.getAttribute !== "undefined" ) {
|
if (typeof elem.getAttribute !== core_strundefined) {
|
||||||
ret = elem.getAttribute(name);
|
ret = elem.getAttribute(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2686,13 +2716,12 @@ jQuery.event = {
|
||||||
global: {},
|
global: {},
|
||||||
|
|
||||||
add: function (elem, types, handler, data, selector) {
|
add: function (elem, types, handler, data, selector) {
|
||||||
|
var tmp, events, t, handleObjIn,
|
||||||
|
special, eventHandle, handleObj,
|
||||||
|
handlers, type, namespaces, origType,
|
||||||
|
elemData = jQuery._data(elem);
|
||||||
|
|
||||||
var handleObjIn, eventHandle, tmp,
|
|
||||||
events, t, handleObj,
|
|
||||||
special, handlers, type, namespaces, origType,
|
|
||||||
// Don't attach events to noData or text/comment nodes (but allow plain objects)
|
// Don't attach events to noData or text/comment nodes (but allow plain objects)
|
||||||
elemData = elem.nodeType !== 3 && elem.nodeType !== 8 && jQuery._data( elem );
|
|
||||||
|
|
||||||
if (!elemData) {
|
if (!elemData) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -2717,7 +2746,7 @@ jQuery.event = {
|
||||||
eventHandle = elemData.handle = function (e) {
|
eventHandle = elemData.handle = function (e) {
|
||||||
// Discard the second event of a jQuery.event.trigger() and
|
// Discard the second event of a jQuery.event.trigger() and
|
||||||
// when an event is called after a page has unloaded
|
// when an event is called after a page has unloaded
|
||||||
return typeof jQuery !== "undefined" && (!e || jQuery.event.triggered !== e.type) ?
|
return typeof jQuery !== core_strundefined && (!e || jQuery.event.triggered !== e.type) ?
|
||||||
jQuery.event.dispatch.apply(eventHandle.elem, arguments) :
|
jQuery.event.dispatch.apply(eventHandle.elem, arguments) :
|
||||||
undefined;
|
undefined;
|
||||||
};
|
};
|
||||||
|
@ -2797,10 +2826,10 @@ jQuery.event = {
|
||||||
|
|
||||||
// Detach an event or set of events from an element
|
// Detach an event or set of events from an element
|
||||||
remove: function (elem, types, handler, selector, mappedTypes) {
|
remove: function (elem, types, handler, selector, mappedTypes) {
|
||||||
|
var j, handleObj, tmp,
|
||||||
var j, origCount, tmp,
|
origCount, t, events,
|
||||||
events, t, handleObj,
|
special, handlers, type,
|
||||||
special, handlers, type, namespaces, origType,
|
namespaces, origType,
|
||||||
elemData = jQuery.hasData(elem) && jQuery._data(elem);
|
elemData = jQuery.hasData(elem) && jQuery._data(elem);
|
||||||
|
|
||||||
if (!elemData || !(events = elemData.events)) {
|
if (!elemData || !(events = elemData.events)) {
|
||||||
|
@ -2870,11 +2899,11 @@ jQuery.event = {
|
||||||
},
|
},
|
||||||
|
|
||||||
trigger: function (event, data, elem, onlyHandlers) {
|
trigger: function (event, data, elem, onlyHandlers) {
|
||||||
|
var handle, ontype, cur,
|
||||||
var i, cur, tmp, bubbleType, ontype, handle, special,
|
bubbleType, special, tmp, i,
|
||||||
eventPath = [elem || document],
|
eventPath = [elem || document],
|
||||||
type = event.type || event,
|
type = core_hasOwn.call(event, "type") ? event.type : event,
|
||||||
namespaces = event.namespace ? event.namespace.split(".") : [];
|
namespaces = core_hasOwn.call(event, "namespace") ? event.namespace.split(".") : [];
|
||||||
|
|
||||||
cur = tmp = elem = elem || document;
|
cur = tmp = elem = elem || document;
|
||||||
|
|
||||||
|
@ -3008,7 +3037,7 @@ jQuery.event = {
|
||||||
// Make a writable jQuery.Event from the native event object
|
// Make a writable jQuery.Event from the native event object
|
||||||
event = jQuery.event.fix(event);
|
event = jQuery.event.fix(event);
|
||||||
|
|
||||||
var i, j, ret, matched, handleObj,
|
var i, ret, handleObj, matched, j,
|
||||||
handlerQueue = [],
|
handlerQueue = [],
|
||||||
args = core_slice.call(arguments),
|
args = core_slice.call(arguments),
|
||||||
handlers = (jQuery._data(this, "events") || {})[event.type] || [],
|
handlers = (jQuery._data(this, "events") || {})[event.type] || [],
|
||||||
|
@ -3063,7 +3092,7 @@ jQuery.event = {
|
||||||
},
|
},
|
||||||
|
|
||||||
handlers: function (event, handlers) {
|
handlers: function (event, handlers) {
|
||||||
var i, matches, sel, handleObj,
|
var sel, handleObj, matches, i,
|
||||||
handlerQueue = [],
|
handlerQueue = [],
|
||||||
delegateCount = handlers.delegateCount,
|
delegateCount = handlers.delegateCount,
|
||||||
cur = event.target;
|
cur = event.target;
|
||||||
|
@ -3075,8 +3104,9 @@ jQuery.event = {
|
||||||
|
|
||||||
for (; cur != this; cur = cur.parentNode || this) {
|
for (; cur != this; cur = cur.parentNode || this) {
|
||||||
|
|
||||||
|
// Don't check non-elements (#13208)
|
||||||
// Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)
|
// Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)
|
||||||
if ( cur.disabled !== true || event.type !== "click" ) {
|
if (cur.nodeType === 1 && (cur.disabled !== true || event.type !== "click")) {
|
||||||
matches = [];
|
matches = [];
|
||||||
for (i = 0; i < delegateCount; i++) {
|
for (i = 0; i < delegateCount; i++) {
|
||||||
handleObj = handlers[i];
|
handleObj = handlers[i];
|
||||||
|
@ -3114,9 +3144,17 @@ jQuery.event = {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create a writable copy of the event object and normalize some properties
|
// Create a writable copy of the event object and normalize some properties
|
||||||
var i, prop,
|
var i, prop, copy,
|
||||||
|
type = event.type,
|
||||||
originalEvent = event,
|
originalEvent = event,
|
||||||
fixHook = jQuery.event.fixHooks[ event.type ] || {},
|
fixHook = this.fixHooks[type];
|
||||||
|
|
||||||
|
if (!fixHook) {
|
||||||
|
this.fixHooks[type] = fixHook =
|
||||||
|
rmouseEvent.test(type) ? this.mouseHooks :
|
||||||
|
rkeyEvent.test(type) ? this.keyHooks :
|
||||||
|
{};
|
||||||
|
}
|
||||||
copy = fixHook.props ? this.props.concat(fixHook.props) : this.props;
|
copy = fixHook.props ? this.props.concat(fixHook.props) : this.props;
|
||||||
|
|
||||||
event = new jQuery.Event(originalEvent);
|
event = new jQuery.Event(originalEvent);
|
||||||
|
@ -3167,7 +3205,7 @@ jQuery.event = {
|
||||||
mouseHooks: {
|
mouseHooks: {
|
||||||
props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),
|
props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),
|
||||||
filter: function (event, original) {
|
filter: function (event, original) {
|
||||||
var eventDoc, doc, body,
|
var body, eventDoc, doc,
|
||||||
button = original.button,
|
button = original.button,
|
||||||
fromElement = original.fromElement;
|
fromElement = original.fromElement;
|
||||||
|
|
||||||
|
@ -3254,7 +3292,8 @@ jQuery.event = {
|
||||||
var e = jQuery.extend(
|
var e = jQuery.extend(
|
||||||
new jQuery.Event(),
|
new jQuery.Event(),
|
||||||
event,
|
event,
|
||||||
{ type: type,
|
{
|
||||||
|
type: type,
|
||||||
isSimulated: true,
|
isSimulated: true,
|
||||||
originalEvent: {}
|
originalEvent: {}
|
||||||
}
|
}
|
||||||
|
@ -3283,7 +3322,7 @@ jQuery.removeEvent = document.removeEventListener ?
|
||||||
|
|
||||||
// #8545, #7054, preventing memory leaks for custom events in IE6-8
|
// #8545, #7054, preventing memory leaks for custom events in IE6-8
|
||||||
// detachEvent needed property on element, by name of that event, to properly expose it to GC
|
// detachEvent needed property on element, by name of that event, to properly expose it to GC
|
||||||
if ( typeof elem[ name ] === "undefined" ) {
|
if (typeof elem[name] === core_strundefined) {
|
||||||
elem[name] = null;
|
elem[name] = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3532,7 +3571,7 @@ if ( !jQuery.support.focusinBubbles ) {
|
||||||
jQuery.fn.extend({
|
jQuery.fn.extend({
|
||||||
|
|
||||||
on: function (types, selector, data, fn, /*INTERNAL*/ one) {
|
on: function (types, selector, data, fn, /*INTERNAL*/ one) {
|
||||||
var origFn, type;
|
var type, origFn;
|
||||||
|
|
||||||
// Types can be a map of types/handlers
|
// Types can be a map of types/handlers
|
||||||
if (typeof types === "object") {
|
if (typeof types === "object") {
|
||||||
|
@ -3644,30 +3683,6 @@ jQuery.fn.extend({
|
||||||
if (elem) {
|
if (elem) {
|
||||||
return jQuery.event.trigger(type, data, elem, true);
|
return jQuery.event.trigger(type, data, elem, true);
|
||||||
}
|
}
|
||||||
},
|
|
||||||
|
|
||||||
hover: function( fnOver, fnOut ) {
|
|
||||||
return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " +
|
|
||||||
"mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
|
|
||||||
"change select submit keydown keypress keyup error contextmenu").split(" "), function( i, name ) {
|
|
||||||
|
|
||||||
// Handle event binding
|
|
||||||
jQuery.fn[ name ] = function( data, fn ) {
|
|
||||||
return arguments.length > 0 ?
|
|
||||||
this.on( name, null, data, fn ) :
|
|
||||||
this.trigger( name );
|
|
||||||
};
|
|
||||||
|
|
||||||
if ( rkeyEvent.test( name ) ) {
|
|
||||||
jQuery.event.fixHooks[ name ] = jQuery.event.keyHooks;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( rmouseEvent.test( name ) ) {
|
|
||||||
jQuery.event.fixHooks[ name ] = jQuery.event.mouseHooks;
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
/*!
|
/*!
|
||||||
|
@ -3781,7 +3796,7 @@ var i,
|
||||||
|
|
||||||
rsibling = /[\x20\t\r\n\f]*[+~]/,
|
rsibling = /[\x20\t\r\n\f]*[+~]/,
|
||||||
|
|
||||||
rnative = /\{\s*\[native code\]\s*\}/,
|
rnative = /^[^{]+\{\s*\[native code/,
|
||||||
|
|
||||||
// Easily-parseable/retrievable ID or TAG or CLASS selectors
|
// Easily-parseable/retrievable ID or TAG or CLASS selectors
|
||||||
rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
|
rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
|
||||||
|
@ -3808,12 +3823,12 @@ var i,
|
||||||
|
|
||||||
// Use a stripped-down slice if we can't use a native one
|
// Use a stripped-down slice if we can't use a native one
|
||||||
try {
|
try {
|
||||||
slice.call( docElem.childNodes, 0 )[0].nodeType;
|
slice.call(preferredDoc.documentElement.childNodes, 0)[0].nodeType;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
slice = function (i) {
|
slice = function (i) {
|
||||||
var elem,
|
var elem,
|
||||||
results = [];
|
results = [];
|
||||||
for ( ; (elem = this[i]); i++ ) {
|
while ((elem = this[i++])) {
|
||||||
results.push(elem);
|
results.push(elem);
|
||||||
}
|
}
|
||||||
return results;
|
return results;
|
||||||
|
@ -4132,7 +4147,7 @@ setDocument = Sizzle.setDocument = function( node ) {
|
||||||
|
|
||||||
// Filter out possible comments
|
// Filter out possible comments
|
||||||
if (tag === "*") {
|
if (tag === "*") {
|
||||||
for ( ; (elem = results[i]); i++ ) {
|
while ((elem = results[i++])) {
|
||||||
if (elem.nodeType === 1) {
|
if (elem.nodeType === 1) {
|
||||||
tmp.push(elem);
|
tmp.push(elem);
|
||||||
}
|
}
|
||||||
|
@ -4290,15 +4305,11 @@ setDocument = Sizzle.setDocument = function( node ) {
|
||||||
ap = [a],
|
ap = [a],
|
||||||
bp = [b];
|
bp = [b];
|
||||||
|
|
||||||
// The nodes are identical, we can exit early
|
// Exit early if the nodes are identical
|
||||||
if (a === b) {
|
if (a === b) {
|
||||||
hasDuplicate = true;
|
hasDuplicate = true;
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
// Fallback to using sourceIndex (in IE) if it's available on both nodes
|
|
||||||
} else if ( a.sourceIndex && b.sourceIndex ) {
|
|
||||||
return ( ~b.sourceIndex || MAX_NEGATIVE ) - ( contains( preferredDoc, a ) && ~a.sourceIndex || MAX_NEGATIVE );
|
|
||||||
|
|
||||||
// Parentless nodes are either documents or disconnected
|
// Parentless nodes are either documents or disconnected
|
||||||
} else if (!aup || !bup) {
|
} else if (!aup || !bup) {
|
||||||
return a === doc ? -1 :
|
return a === doc ? -1 :
|
||||||
|
@ -4437,13 +4448,22 @@ Sizzle.uniqueSort = function( results ) {
|
||||||
};
|
};
|
||||||
|
|
||||||
function siblingCheck(a, b) {
|
function siblingCheck(a, b) {
|
||||||
var cur = a && b && a.nextSibling;
|
var cur = b && a,
|
||||||
|
diff = cur && (~b.sourceIndex || MAX_NEGATIVE) - (~a.sourceIndex || MAX_NEGATIVE);
|
||||||
|
|
||||||
for ( ; cur; cur = cur.nextSibling ) {
|
// Use IE sourceIndex if available on both nodes
|
||||||
|
if (diff) {
|
||||||
|
return diff;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check if b follows a
|
||||||
|
if (cur) {
|
||||||
|
while ((cur = cur.nextSibling)) {
|
||||||
if (cur === b) {
|
if (cur === b) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return a ? 1 : -1;
|
return a ? 1 : -1;
|
||||||
}
|
}
|
||||||
|
@ -4651,9 +4671,9 @@ Expr = Sizzle.selectors = {
|
||||||
operator === "!=" ? result !== check :
|
operator === "!=" ? result !== check :
|
||||||
operator === "^=" ? check && result.indexOf(check) === 0 :
|
operator === "^=" ? check && result.indexOf(check) === 0 :
|
||||||
operator === "*=" ? check && result.indexOf(check) > -1 :
|
operator === "*=" ? check && result.indexOf(check) > -1 :
|
||||||
operator === "$=" ? check && result.substr( result.length - check.length ) === check :
|
operator === "$=" ? check && result.slice(-check.length) === check :
|
||||||
operator === "~=" ? (" " + result + " ").indexOf(check) > -1 :
|
operator === "~=" ? (" " + result + " ").indexOf(check) > -1 :
|
||||||
operator === "|=" ? result === check || result.substr( 0, check.length + 1 ) === check + "-" :
|
operator === "|=" ? result === check || result.slice(0, check.length + 1) === check + "-" :
|
||||||
false;
|
false;
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
@ -5071,7 +5091,7 @@ function toSelector( tokens ) {
|
||||||
|
|
||||||
function addCombinator(matcher, combinator, base) {
|
function addCombinator(matcher, combinator, base) {
|
||||||
var dir = combinator.dir,
|
var dir = combinator.dir,
|
||||||
checkNonElements = base && combinator.dir === "parentNode",
|
checkNonElements = base && dir === "parentNode",
|
||||||
doneName = done++;
|
doneName = done++;
|
||||||
|
|
||||||
return combinator.first ?
|
return combinator.first ?
|
||||||
|
@ -5314,8 +5334,8 @@ function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
|
||||||
contextBackup = outermostContext,
|
contextBackup = outermostContext,
|
||||||
// We must always have either seed elements or context
|
// We must always have either seed elements or context
|
||||||
elems = seed || byElement && Expr.find["TAG"]("*", expandContext && context.parentNode || context),
|
elems = seed || byElement && Expr.find["TAG"]("*", expandContext && context.parentNode || context),
|
||||||
// Nested matchers should use non-integer dirruns
|
// Use integer dirruns iff this is the outermost matcher
|
||||||
dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.E);
|
dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1);
|
||||||
|
|
||||||
if (outermost) {
|
if (outermost) {
|
||||||
outermostContext = context !== document && context;
|
outermostContext = context !== document && context;
|
||||||
|
@ -5323,9 +5343,11 @@ function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add elements passing elementMatchers directly to results
|
// Add elements passing elementMatchers directly to results
|
||||||
|
// Keep `i` a string if there are no elements so `matchedCount` will be "00" below
|
||||||
for (; (elem = elems[i]) != null; i++) {
|
for (; (elem = elems[i]) != null; i++) {
|
||||||
if (byElement && elem) {
|
if (byElement && elem) {
|
||||||
for ( j = 0; (matcher = elementMatchers[j]); j++ ) {
|
j = 0;
|
||||||
|
while ((matcher = elementMatchers[j++])) {
|
||||||
if (matcher(elem, context, xml)) {
|
if (matcher(elem, context, xml)) {
|
||||||
results.push(elem);
|
results.push(elem);
|
||||||
break;
|
break;
|
||||||
|
@ -5352,10 +5374,10 @@ function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Apply set filters to unmatched elements
|
// Apply set filters to unmatched elements
|
||||||
// `i` starts as a string, so matchedCount would equal "00" if there are no elements
|
|
||||||
matchedCount += i;
|
matchedCount += i;
|
||||||
if (bySet && i !== matchedCount) {
|
if (bySet && i !== matchedCount) {
|
||||||
for ( j = 0; (matcher = setMatchers[j]); j++ ) {
|
j = 0;
|
||||||
|
while ((matcher = setMatchers[j++])) {
|
||||||
matcher(unmatched, setMatched, context, xml);
|
matcher(unmatched, setMatched, context, xml);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5457,7 +5479,8 @@ function select( selector, context, results, seed ) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fetch a seed set for right-to-left matching
|
// Fetch a seed set for right-to-left matching
|
||||||
for ( i = matchExpr["needsContext"].test( selector ) ? -1 : tokens.length - 1; i >= 0; i-- ) {
|
i = matchExpr["needsContext"].test(selector) ? 0 : tokens.length;
|
||||||
|
while (i--) {
|
||||||
token = tokens[i];
|
token = tokens[i];
|
||||||
|
|
||||||
// Abort if we hit a combinator
|
// Abort if we hit a combinator
|
||||||
|
@ -5535,12 +5558,13 @@ var runtil = /Until$/,
|
||||||
|
|
||||||
jQuery.fn.extend({
|
jQuery.fn.extend({
|
||||||
find: function (selector) {
|
find: function (selector) {
|
||||||
var i, ret, self;
|
var i, ret, self,
|
||||||
|
len = this.length;
|
||||||
|
|
||||||
if (typeof selector !== "string") {
|
if (typeof selector !== "string") {
|
||||||
self = this;
|
self = this;
|
||||||
return this.pushStack(jQuery(selector).filter(function () {
|
return this.pushStack(jQuery(selector).filter(function () {
|
||||||
for ( i = 0; i < self.length; i++ ) {
|
for (i = 0; i < len; i++) {
|
||||||
if (jQuery.contains(self[i], this)) {
|
if (jQuery.contains(self[i], this)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -5549,12 +5573,12 @@ jQuery.fn.extend({
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = [];
|
ret = [];
|
||||||
for ( i = 0; i < this.length; i++ ) {
|
for (i = 0; i < len; i++) {
|
||||||
jQuery.find(selector, this[i], ret);
|
jQuery.find(selector, this[i], ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Needed because $( selector, context ) becomes $( context ).find( selector )
|
// Needed because $( selector, context ) becomes $( context ).find( selector )
|
||||||
ret = this.pushStack( jQuery.unique( ret ) );
|
ret = this.pushStack(len > 1 ? jQuery.unique(ret) : ret);
|
||||||
ret.selector = (this.selector ? this.selector + " " : "") + selector;
|
ret.selector = (this.selector ? this.selector + " " : "") + selector;
|
||||||
return ret;
|
return ret;
|
||||||
},
|
},
|
||||||
|
@ -6066,15 +6090,9 @@ jQuery.fn.extend({
|
||||||
var next = this.nextSibling,
|
var next = this.nextSibling,
|
||||||
parent = this.parentNode;
|
parent = this.parentNode;
|
||||||
|
|
||||||
if ( parent && this.nodeType === 1 || this.nodeType === 11 ) {
|
if (parent) {
|
||||||
|
|
||||||
jQuery(this).remove();
|
jQuery(this).remove();
|
||||||
|
parent.insertBefore(elem, next);
|
||||||
if ( next ) {
|
|
||||||
next.parentNode.insertBefore( elem, next );
|
|
||||||
} else {
|
|
||||||
parent.appendChild( elem );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
@ -6088,7 +6106,8 @@ jQuery.fn.extend({
|
||||||
// Flatten any nested arrays
|
// Flatten any nested arrays
|
||||||
args = core_concat.apply([], args);
|
args = core_concat.apply([], args);
|
||||||
|
|
||||||
var fragment, first, scripts, hasScripts, node, doc,
|
var first, node, hasScripts,
|
||||||
|
scripts, doc, fragment,
|
||||||
i = 0,
|
i = 0,
|
||||||
l = this.length,
|
l = this.length,
|
||||||
set = this,
|
set = this,
|
||||||
|
@ -6239,7 +6258,7 @@ function cloneCopyEvent( src, dest ) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function fixCloneNodeIssues(src, dest) {
|
function fixCloneNodeIssues(src, dest) {
|
||||||
var nodeName, data, e;
|
var nodeName, e, data;
|
||||||
|
|
||||||
// We do not need to do anything for non-Elements
|
// We do not need to do anything for non-Elements
|
||||||
if (dest.nodeType !== 1) {
|
if (dest.nodeType !== 1) {
|
||||||
|
@ -6334,8 +6353,8 @@ jQuery.each({
|
||||||
function getAll(context, tag) {
|
function getAll(context, tag) {
|
||||||
var elems, elem,
|
var elems, elem,
|
||||||
i = 0,
|
i = 0,
|
||||||
found = typeof context.getElementsByTagName !== "undefined" ? context.getElementsByTagName( tag || "*" ) :
|
found = typeof context.getElementsByTagName !== core_strundefined ? context.getElementsByTagName(tag || "*") :
|
||||||
typeof context.querySelectorAll !== "undefined" ? context.querySelectorAll( tag || "*" ) :
|
typeof context.querySelectorAll !== core_strundefined ? context.querySelectorAll(tag || "*") :
|
||||||
undefined;
|
undefined;
|
||||||
|
|
||||||
if (!found) {
|
if (!found) {
|
||||||
|
@ -6362,7 +6381,7 @@ function fixDefaultChecked( elem ) {
|
||||||
|
|
||||||
jQuery.extend({
|
jQuery.extend({
|
||||||
clone: function (elem, dataAndEvents, deepDataAndEvents) {
|
clone: function (elem, dataAndEvents, deepDataAndEvents) {
|
||||||
var destElements, srcElements, node, i, clone,
|
var destElements, node, clone, i, srcElements,
|
||||||
inPage = jQuery.contains(elem.ownerDocument, elem);
|
inPage = jQuery.contains(elem.ownerDocument, elem);
|
||||||
|
|
||||||
if (jQuery.support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test("<" + elem.nodeName + ">")) {
|
if (jQuery.support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test("<" + elem.nodeName + ">")) {
|
||||||
|
@ -6417,7 +6436,8 @@ jQuery.extend({
|
||||||
},
|
},
|
||||||
|
|
||||||
buildFragment: function (elems, context, scripts, selection) {
|
buildFragment: function (elems, context, scripts, selection) {
|
||||||
var contains, elem, tag, tmp, wrap, tbody, j,
|
var j, elem, contains,
|
||||||
|
tmp, tag, tbody, wrap,
|
||||||
l = elems.length,
|
l = elems.length,
|
||||||
|
|
||||||
// Ensure a safe fragment
|
// Ensure a safe fragment
|
||||||
|
@ -6543,7 +6563,7 @@ jQuery.extend({
|
||||||
},
|
},
|
||||||
|
|
||||||
cleanData: function (elems, /* internal */ acceptData) {
|
cleanData: function (elems, /* internal */ acceptData) {
|
||||||
var data, id, elem, type,
|
var elem, type, id, data,
|
||||||
i = 0,
|
i = 0,
|
||||||
internalKey = jQuery.expando,
|
internalKey = jQuery.expando,
|
||||||
cache = jQuery.cache,
|
cache = jQuery.cache,
|
||||||
|
@ -6581,7 +6601,7 @@ jQuery.extend({
|
||||||
if (deleteExpando) {
|
if (deleteExpando) {
|
||||||
delete elem[internalKey];
|
delete elem[internalKey];
|
||||||
|
|
||||||
} else if ( typeof elem.removeAttribute !== "undefined" ) {
|
} else if (typeof elem.removeAttribute !== core_strundefined) {
|
||||||
elem.removeAttribute(internalKey);
|
elem.removeAttribute(internalKey);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
@ -6595,7 +6615,7 @@ jQuery.extend({
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
var curCSS, getStyles, iframe,
|
var iframe, getStyles, curCSS,
|
||||||
ralpha = /alpha\([^)]*\)/i,
|
ralpha = /alpha\([^)]*\)/i,
|
||||||
ropacity = /opacity\s*=\s*([^)]*)/,
|
ropacity = /opacity\s*=\s*([^)]*)/,
|
||||||
rposition = /^(top|right|bottom|left)$/,
|
rposition = /^(top|right|bottom|left)$/,
|
||||||
|
@ -6648,7 +6668,7 @@ function isHidden( elem, el ) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function showHide(elements, show) {
|
function showHide(elements, show) {
|
||||||
var elem,
|
var display, elem, hidden,
|
||||||
values = [],
|
values = [],
|
||||||
index = 0,
|
index = 0,
|
||||||
length = elements.length;
|
length = elements.length;
|
||||||
|
@ -6658,11 +6678,13 @@ function showHide( elements, show ) {
|
||||||
if (!elem.style) {
|
if (!elem.style) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
values[index] = jQuery._data(elem, "olddisplay");
|
values[index] = jQuery._data(elem, "olddisplay");
|
||||||
|
display = elem.style.display;
|
||||||
if (show) {
|
if (show) {
|
||||||
// Reset the inline display of this element to learn if it is
|
// Reset the inline display of this element to learn if it is
|
||||||
// being hidden by cascaded rules or not
|
// being hidden by cascaded rules or not
|
||||||
if ( !values[ index ] && elem.style.display === "none" ) {
|
if (!values[index] && display === "none") {
|
||||||
elem.style.display = "";
|
elem.style.display = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6672,8 +6694,15 @@ function showHide( elements, show ) {
|
||||||
if (elem.style.display === "" && isHidden(elem)) {
|
if (elem.style.display === "" && isHidden(elem)) {
|
||||||
values[index] = jQuery._data(elem, "olddisplay", css_defaultDisplay(elem.nodeName));
|
values[index] = jQuery._data(elem, "olddisplay", css_defaultDisplay(elem.nodeName));
|
||||||
}
|
}
|
||||||
} else if ( !values[ index ] && !isHidden( elem ) ) {
|
} else {
|
||||||
jQuery._data( elem, "olddisplay", jQuery.css( elem, "display" ) );
|
|
||||||
|
if (!values[index]) {
|
||||||
|
hidden = isHidden(elem);
|
||||||
|
|
||||||
|
if (display && display !== "none" || !hidden) {
|
||||||
|
jQuery._data(elem, "olddisplay", hidden ? display : jQuery.css(elem, "display"));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6695,7 +6724,7 @@ function showHide( elements, show ) {
|
||||||
jQuery.fn.extend({
|
jQuery.fn.extend({
|
||||||
css: function (name, value) {
|
css: function (name, value) {
|
||||||
return jQuery.access(this, function (elem, name, value) {
|
return jQuery.access(this, function (elem, name, value) {
|
||||||
var styles, len,
|
var len, styles,
|
||||||
map = {},
|
map = {},
|
||||||
i = 0;
|
i = 0;
|
||||||
|
|
||||||
|
@ -6836,7 +6865,7 @@ jQuery.extend({
|
||||||
},
|
},
|
||||||
|
|
||||||
css: function (elem, name, extra, styles) {
|
css: function (elem, name, extra, styles) {
|
||||||
var val, num, hooks,
|
var num, val, hooks,
|
||||||
origName = jQuery.camelCase(name);
|
origName = jQuery.camelCase(name);
|
||||||
|
|
||||||
// Make sure that we're working with the right name
|
// Make sure that we're working with the right name
|
||||||
|
@ -6862,7 +6891,7 @@ jQuery.extend({
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return, converting to number if forced or a qualifier was provided and val looks numeric
|
// Return, converting to number if forced or a qualifier was provided and val looks numeric
|
||||||
if ( extra ) {
|
if (extra === "" || extra) {
|
||||||
num = parseFloat(val);
|
num = parseFloat(val);
|
||||||
return extra === true || jQuery.isNumeric(num) ? num || 0 : val;
|
return extra === true || jQuery.isNumeric(num) ? num || 0 : val;
|
||||||
}
|
}
|
||||||
|
@ -7227,7 +7256,10 @@ jQuery(function() {
|
||||||
|
|
||||||
if (jQuery.expr && jQuery.expr.filters) {
|
if (jQuery.expr && jQuery.expr.filters) {
|
||||||
jQuery.expr.filters.hidden = function (elem) {
|
jQuery.expr.filters.hidden = function (elem) {
|
||||||
return ( elem.offsetWidth === 0 && elem.offsetHeight === 0 ) || (!jQuery.support.reliableHiddenOffsets && ((elem.style && elem.style.display) || jQuery.css( elem, "display" )) === "none");
|
// Support: Opera <= 12.12
|
||||||
|
// Opera reports offsetWidths and offsetHeights less than zero on some elements
|
||||||
|
return elem.offsetWidth <= 0 && elem.offsetHeight <= 0 ||
|
||||||
|
(!jQuery.support.reliableHiddenOffsets && ((elem.style && elem.style.display) || jQuery.css(elem, "display")) === "none");
|
||||||
};
|
};
|
||||||
|
|
||||||
jQuery.expr.filters.visible = function (elem) {
|
jQuery.expr.filters.visible = function (elem) {
|
||||||
|
@ -7265,7 +7297,7 @@ jQuery.each({
|
||||||
var r20 = /%20/g,
|
var r20 = /%20/g,
|
||||||
rbracket = /\[\]$/,
|
rbracket = /\[\]$/,
|
||||||
rCRLF = /\r?\n/g,
|
rCRLF = /\r?\n/g,
|
||||||
rsubmitterTypes = /^(?:submit|button|image|reset)$/i,
|
rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,
|
||||||
rsubmittable = /^(?:input|select|textarea|keygen)/i;
|
rsubmittable = /^(?:input|select|textarea|keygen)/i;
|
||||||
|
|
||||||
jQuery.fn.extend({
|
jQuery.fn.extend({
|
||||||
|
@ -7361,11 +7393,25 @@ function buildParams( prefix, obj, traditional, add ) {
|
||||||
add(prefix, obj);
|
add(prefix, obj);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
jQuery.each(("blur focus focusin focusout load resize scroll unload click dblclick " +
|
||||||
|
"mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
|
||||||
|
"change select submit keydown keypress keyup error contextmenu").split(" "), function (i, name) {
|
||||||
|
|
||||||
|
// Handle event binding
|
||||||
|
jQuery.fn[name] = function (data, fn) {
|
||||||
|
return arguments.length > 0 ?
|
||||||
|
this.on(name, null, data, fn) :
|
||||||
|
this.trigger(name);
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
jQuery.fn.hover = function (fnOver, fnOut) {
|
||||||
|
return this.mouseenter(fnOver).mouseleave(fnOut || fnOver);
|
||||||
|
};
|
||||||
var
|
var
|
||||||
// Document location
|
// Document location
|
||||||
ajaxLocParts,
|
ajaxLocParts,
|
||||||
ajaxLocation,
|
ajaxLocation,
|
||||||
|
|
||||||
ajax_nonce = jQuery.now(),
|
ajax_nonce = jQuery.now(),
|
||||||
|
|
||||||
ajax_rquery = /\?/,
|
ajax_rquery = /\?/,
|
||||||
|
@ -7478,7 +7524,7 @@ function inspectPrefiltersOrTransports( structure, options, originalOptions, jqX
|
||||||
// that takes "flat" options (not to be deep extended)
|
// that takes "flat" options (not to be deep extended)
|
||||||
// Fixes #9887
|
// Fixes #9887
|
||||||
function ajaxExtend(target, src) {
|
function ajaxExtend(target, src) {
|
||||||
var key, deep,
|
var deep, key,
|
||||||
flatOptions = jQuery.ajaxSettings.flatOptions || {};
|
flatOptions = jQuery.ajaxSettings.flatOptions || {};
|
||||||
|
|
||||||
for (key in src) {
|
for (key in src) {
|
||||||
|
@ -7498,7 +7544,7 @@ jQuery.fn.load = function( url, params, callback ) {
|
||||||
return _load.apply(this, arguments);
|
return _load.apply(this, arguments);
|
||||||
}
|
}
|
||||||
|
|
||||||
var selector, type, response,
|
var selector, response, type,
|
||||||
self = this,
|
self = this,
|
||||||
off = url.indexOf(" ");
|
off = url.indexOf(" ");
|
||||||
|
|
||||||
|
@ -7679,20 +7725,23 @@ jQuery.extend({
|
||||||
// Force options to be an object
|
// Force options to be an object
|
||||||
options = options || {};
|
options = options || {};
|
||||||
|
|
||||||
var transport,
|
var // Cross-domain detection vars
|
||||||
// URL without anti-cache param
|
|
||||||
cacheURL,
|
|
||||||
// Response headers
|
|
||||||
responseHeadersString,
|
|
||||||
responseHeaders,
|
|
||||||
// timeout handle
|
|
||||||
timeoutTimer,
|
|
||||||
// Cross-domain detection vars
|
|
||||||
parts,
|
parts,
|
||||||
// To know if global events are to be dispatched
|
|
||||||
fireGlobals,
|
|
||||||
// Loop variable
|
// Loop variable
|
||||||
i,
|
i,
|
||||||
|
// URL without anti-cache param
|
||||||
|
cacheURL,
|
||||||
|
// Response headers as string
|
||||||
|
responseHeadersString,
|
||||||
|
// timeout handle
|
||||||
|
timeoutTimer,
|
||||||
|
|
||||||
|
// To know if global events are to be dispatched
|
||||||
|
fireGlobals,
|
||||||
|
|
||||||
|
transport,
|
||||||
|
// Response headers
|
||||||
|
responseHeaders,
|
||||||
// Create the final options object
|
// Create the final options object
|
||||||
s = jQuery.ajaxSetup({}, options),
|
s = jQuery.ajaxSetup({}, options),
|
||||||
// Callbacks context
|
// Callbacks context
|
||||||
|
@ -7987,12 +8036,17 @@ jQuery.extend({
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// If not modified
|
// if no content
|
||||||
if ( status === 304 ) {
|
if (status === 204) {
|
||||||
|
isSuccess = true;
|
||||||
|
statusText = "nocontent";
|
||||||
|
|
||||||
|
// if not modified
|
||||||
|
} else if (status === 304) {
|
||||||
isSuccess = true;
|
isSuccess = true;
|
||||||
statusText = "notmodified";
|
statusText = "notmodified";
|
||||||
|
|
||||||
// If we have data
|
// If we have data, let's convert it
|
||||||
} else {
|
} else {
|
||||||
isSuccess = ajaxConvert(s, response);
|
isSuccess = ajaxConvert(s, response);
|
||||||
statusText = isSuccess.state;
|
statusText = isSuccess.state;
|
||||||
|
@ -8062,8 +8116,7 @@ jQuery.extend({
|
||||||
* - returns the corresponding response
|
* - returns the corresponding response
|
||||||
*/
|
*/
|
||||||
function ajaxHandleResponses(s, jqXHR, responses) {
|
function ajaxHandleResponses(s, jqXHR, responses) {
|
||||||
|
var firstDataType, ct, finalDataType, type,
|
||||||
var ct, type, finalDataType, firstDataType,
|
|
||||||
contents = s.contents,
|
contents = s.contents,
|
||||||
dataTypes = s.dataTypes,
|
dataTypes = s.dataTypes,
|
||||||
responseFields = s.responseFields;
|
responseFields = s.responseFields;
|
||||||
|
@ -8124,8 +8177,7 @@ function ajaxHandleResponses( s, jqXHR, responses ) {
|
||||||
|
|
||||||
// Chain conversions given the request and the original response
|
// Chain conversions given the request and the original response
|
||||||
function ajaxConvert(s, response) {
|
function ajaxConvert(s, response) {
|
||||||
|
var conv2, current, conv, tmp,
|
||||||
var conv, conv2, current, tmp,
|
|
||||||
converters = {},
|
converters = {},
|
||||||
i = 0,
|
i = 0,
|
||||||
// Work with a copy of dataTypes in case we need to modify it for conversion
|
// Work with a copy of dataTypes in case we need to modify it for conversion
|
||||||
|
@ -8476,12 +8528,7 @@ if ( xhrSupported ) {
|
||||||
|
|
||||||
// Listener
|
// Listener
|
||||||
callback = function (_, isAbort) {
|
callback = function (_, isAbort) {
|
||||||
|
var status, responseHeaders, statusText, responses;
|
||||||
var status,
|
|
||||||
statusText,
|
|
||||||
responseHeaders,
|
|
||||||
responses,
|
|
||||||
xml;
|
|
||||||
|
|
||||||
// Firefox throws exceptions when accessing properties
|
// Firefox throws exceptions when accessing properties
|
||||||
// of an xhr when a network error occurred
|
// of an xhr when a network error occurred
|
||||||
|
@ -8511,14 +8558,8 @@ if ( xhrSupported ) {
|
||||||
} else {
|
} else {
|
||||||
responses = {};
|
responses = {};
|
||||||
status = xhr.status;
|
status = xhr.status;
|
||||||
xml = xhr.responseXML;
|
|
||||||
responseHeaders = xhr.getAllResponseHeaders();
|
responseHeaders = xhr.getAllResponseHeaders();
|
||||||
|
|
||||||
// Construct response list
|
|
||||||
if ( xml && xml.documentElement /* #4958 */ ) {
|
|
||||||
responses.xml = xml;
|
|
||||||
}
|
|
||||||
|
|
||||||
// When requesting binary data, IE6-9 will throw an exception
|
// When requesting binary data, IE6-9 will throw an exception
|
||||||
// on any attempt to access responseText (#11426)
|
// on any attempt to access responseText (#11426)
|
||||||
if (typeof xhr.responseText === "string") {
|
if (typeof xhr.responseText === "string") {
|
||||||
|
@ -8768,7 +8809,7 @@ function Animation( elem, properties, options ) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function propFilter(props, specialEasing) {
|
function propFilter(props, specialEasing) {
|
||||||
var index, name, easing, value, hooks;
|
var value, name, index, easing, hooks;
|
||||||
|
|
||||||
// camelCase, specialEasing and expand cssHook pass
|
// camelCase, specialEasing and expand cssHook pass
|
||||||
for (index in props) {
|
for (index in props) {
|
||||||
|
@ -8836,7 +8877,9 @@ jQuery.Animation = jQuery.extend( Animation, {
|
||||||
|
|
||||||
function defaultPrefilter(elem, props, opts) {
|
function defaultPrefilter(elem, props, opts) {
|
||||||
/*jshint validthis:true */
|
/*jshint validthis:true */
|
||||||
var index, prop, value, length, dataShow, toggle, tween, hooks, oldfire,
|
var prop, index, length,
|
||||||
|
value, dataShow, toggle,
|
||||||
|
tween, hooks, oldfire,
|
||||||
anim = this,
|
anim = this,
|
||||||
style = elem.style,
|
style = elem.style,
|
||||||
orig = {},
|
orig = {},
|
||||||
|
@ -8896,7 +8939,7 @@ function defaultPrefilter( elem, props, opts ) {
|
||||||
if (opts.overflow) {
|
if (opts.overflow) {
|
||||||
style.overflow = "hidden";
|
style.overflow = "hidden";
|
||||||
if (!jQuery.support.shrinkWrapBlocks) {
|
if (!jQuery.support.shrinkWrapBlocks) {
|
||||||
anim.done(function() {
|
anim.always(function () {
|
||||||
style.overflow = opts.overflow[0];
|
style.overflow = opts.overflow[0];
|
||||||
style.overflowX = opts.overflow[1];
|
style.overflowX = opts.overflow[1];
|
||||||
style.overflowY = opts.overflow[2];
|
style.overflowY = opts.overflow[2];
|
||||||
|
@ -9020,11 +9063,11 @@ Tween.propHooks = {
|
||||||
return tween.elem[tween.prop];
|
return tween.elem[tween.prop];
|
||||||
}
|
}
|
||||||
|
|
||||||
// passing a non empty string as a 3rd parameter to .css will automatically
|
// passing an empty string as a 3rd parameter to .css will automatically
|
||||||
// attempt a parseFloat and fallback to a string if the parse fails
|
// attempt a parseFloat and fallback to a string if the parse fails
|
||||||
// so, simple values such as "10px" are parsed to Float.
|
// so, simple values such as "10px" are parsed to Float.
|
||||||
// complex values such as "rotate(1rad)" are returned as is.
|
// complex values such as "rotate(1rad)" are returned as is.
|
||||||
result = jQuery.css( tween.elem, tween.prop, "auto" );
|
result = jQuery.css(tween.elem, tween.prop, "");
|
||||||
// Empty strings, null, undefined and "auto" are converted to 0.
|
// Empty strings, null, undefined and "auto" are converted to 0.
|
||||||
return !result || result === "auto" ? 0 : result;
|
return !result || result === "auto" ? 0 : result;
|
||||||
},
|
},
|
||||||
|
@ -9346,7 +9389,7 @@ jQuery.fn.offset = function( options ) {
|
||||||
|
|
||||||
// If we don't have gBCR, just use 0,0 rather than error
|
// If we don't have gBCR, just use 0,0 rather than error
|
||||||
// BlackBerry 5, iOS 3 (original iPhone)
|
// BlackBerry 5, iOS 3 (original iPhone)
|
||||||
if ( typeof elem.getBoundingClientRect !== "undefined" ) {
|
if (typeof elem.getBoundingClientRect !== core_strundefined) {
|
||||||
box = elem.getBoundingClientRect();
|
box = elem.getBoundingClientRect();
|
||||||
}
|
}
|
||||||
win = getWindow(doc);
|
win = getWindow(doc);
|
||||||
|
|
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,5 +1,4 @@
|
||||||
/// <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 = {};
|
||||||
|
@ -45,3 +44,5 @@ NzbDrone.Quality.QualityProfileModel = Backbone.Model.extend({
|
||||||
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');
|
||||||
|
@ -46,3 +39,5 @@
|
||||||
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 () {
|
||||||
|
@ -22,3 +23,6 @@
|
||||||
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',
|
||||||
|
},
|
||||||
|
|
||||||
|
shim: {
|
||||||
|
bootstrap: {
|
||||||
|
deps: ["jquery"],
|
||||||
|
},
|
||||||
|
underscore: {
|
||||||
|
exports: '_'
|
||||||
|
},
|
||||||
|
backbone: {
|
||||||
|
deps: ["underscore", "jquery"],
|
||||||
|
exports: "Backbone"
|
||||||
|
},
|
||||||
|
marionette: {
|
||||||
|
deps: ["backbone"],
|
||||||
|
exports: "Marionette"
|
||||||
|
},
|
||||||
|
handlebars: {
|
||||||
|
exports: "Handlebars"
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
NzbDrone = new Backbone.Marionette.Application();
|
define('app', ['jquery', 'JsLibraries/backbone.modelbinder', 'marionette', 'handlebars', 'JsLibraries/backbone.marionette.extend'],
|
||||||
NzbDrone.Series = {};
|
function (jquery, modelBinder, marionette, handlebars) {
|
||||||
NzbDrone.Series.Index = {};
|
|
||||||
NzbDrone.AddSeries = {};
|
|
||||||
NzbDrone.AddSeries.New = {};
|
|
||||||
NzbDrone.AddSeries.Existing = {};
|
|
||||||
NzbDrone.AddSeries.RootFolders = {};
|
|
||||||
NzbDrone.Quality = {};
|
|
||||||
NzbDrone.Shared = {};
|
|
||||||
|
|
||||||
/*
|
|
||||||
_.templateSettings = {
|
|
||||||
interpolate: /\{\{([\s\S]+?)\}\}/g
|
|
||||||
};
|
|
||||||
*/
|
|
||||||
|
|
||||||
NzbDrone.ModelBinder = new Backbone.ModelBinder();
|
window.$ = jquery;
|
||||||
|
window.jquery = jquery;
|
||||||
|
|
||||||
NzbDrone.Constants = {
|
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