|
|
@ -1,80 +1,56 @@
|
|
|
|
NzbDrone.AddSeriesView = Backbone.Marionette.ItemView.extend({
|
|
|
|
NzbDrone.AddNewSeriesView = Backbone.Marionette.ItemView.extend({
|
|
|
|
template: "AddSeries/addSeriesTemplate",
|
|
|
|
template: "AddSeries/addNewSeriesTemplate",
|
|
|
|
|
|
|
|
|
|
|
|
initialise: function () {
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
onRender: function () {
|
|
|
|
|
|
|
|
this.$el.find('#myTab a').click(function (e) {
|
|
|
|
|
|
|
|
e.preventDefault();
|
|
|
|
|
|
|
|
$(this).tab('show');
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
NzbDrone.AddNewSeriesView = Backbone.Marionette.ItemView.extend({
|
|
|
|
|
|
|
|
template: "#add-new-series",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ui: {
|
|
|
|
ui: {
|
|
|
|
seriesSearch: '#series-search'
|
|
|
|
seriesSearch: '.search input'
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
onRender: function () {
|
|
|
|
onRender: function () {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
console.log('binding auto complete');
|
|
|
|
console.log('binding auto complete');
|
|
|
|
var self = this;
|
|
|
|
var self = this;
|
|
|
|
|
|
|
|
|
|
|
|
this.ui.seriesSearch
|
|
|
|
this.ui.seriesSearch
|
|
|
|
.autocomplete({
|
|
|
|
.data('timeout', null)
|
|
|
|
source: "http://localhost:1232/api/series/lookup",
|
|
|
|
.keyup(function () {
|
|
|
|
minLength: 1,
|
|
|
|
clearTimeout(self.$el.data('timeout'));
|
|
|
|
delay: 500,
|
|
|
|
self.$el.data('timeout', setTimeout(self.search, 500, self));
|
|
|
|
select: function (event, ui) {
|
|
|
|
});
|
|
|
|
$(this).val(ui.item.Title);
|
|
|
|
|
|
|
|
$(this).siblings('.seriesId').val(ui.item.Id);
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
open: function (event, ui) {
|
|
|
|
|
|
|
|
$('.ui-autocomplete').addClass('seriesLookupResults');
|
|
|
|
search: function (context) {
|
|
|
|
|
|
|
|
console.log(context.ui.seriesSearch.val());
|
|
|
|
},
|
|
|
|
},
|
|
|
|
close: function (event, ui) {
|
|
|
|
});
|
|
|
|
$('.ui-autocomplete').removeClass('seriesLookupResults');
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
NzbDrone.ImportExistingView = Backbone.Marionette.ItemView.extend({
|
|
|
|
.data("autocomplete")._renderItem = function (ul, item) {
|
|
|
|
template: "AddSeries/ImportExistingTemplate",
|
|
|
|
|
|
|
|
|
|
|
|
return $("<li></li>")
|
|
|
|
|
|
|
|
.data("item.autocomplete", item)
|
|
|
|
|
|
|
|
.append("<a>" + item.SeriesName + "<img src='../../Content/Images/thetvdb.png' class='tvDbLink' title='Click to see series details from TheTVDB' rel='" + item.Url + "' /></a>")
|
|
|
|
|
|
|
|
.appendTo(ul);
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
NzbDrone.AddExistingSeriesView = Backbone.Marionette.ItemView.extend({
|
|
|
|
NzbDrone.RootFoldersView = Backbone.Marionette.ItemView.extend({
|
|
|
|
template: "#add-existing-series",
|
|
|
|
template: "AddSeries/RootFoldersTemplate",
|
|
|
|
|
|
|
|
|
|
|
|
events: {
|
|
|
|
});
|
|
|
|
'click #single': 'single',
|
|
|
|
|
|
|
|
'click #multiple': 'multiple'
|
|
|
|
NzbDrone.AddSeriesLayout = Backbone.Marionette.Layout.extend({
|
|
|
|
},
|
|
|
|
template: "AddSeries/addSeriesLayoutTemplate",
|
|
|
|
|
|
|
|
|
|
|
|
single: function () {
|
|
|
|
regions: {
|
|
|
|
NzbDrone.Router.navigate(NzbDrone.Routes.Series.AddExistingSingle, { trigger: true });
|
|
|
|
addNew: "#add-new",
|
|
|
|
|
|
|
|
importExisting: "#import-existing",
|
|
|
|
|
|
|
|
rootFolders: "#root-folders"
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
multiple: function () {
|
|
|
|
onRender: function () {
|
|
|
|
NzbDrone.Router.navigate(NzbDrone.Routes.Series.AddExistingMultiple, { trigger: true });
|
|
|
|
this.$('#myTab a').click(function (e) {
|
|
|
|
}
|
|
|
|
e.preventDefault();
|
|
|
|
|
|
|
|
$(this).tab('show');
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
NzbDrone.AddExistingSeriesSingleView = Backbone.Marionette.ItemView.extend({
|
|
|
|
this.addNew.show(new NzbDrone.AddNewSeriesView());
|
|
|
|
template: "#add-existing-series-single"
|
|
|
|
this.importExisting.show(new NzbDrone.ImportExistingView());
|
|
|
|
});
|
|
|
|
this.rootFolders.show(new NzbDrone.RootFoldersView());
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
NzbDrone.AddExistingSeriesMultipleView = Backbone.Marionette.ItemView.extend({
|
|
|
|
});
|
|
|
|
template: "#add-existing-series-multiple"
|
|
|
|
|
|
|
|
})
|
|
|
|
|