created add series layout.

pull/4/head
Keivan Beigi 12 years ago committed by kay.one
parent 74a5939c96
commit f303c33ed8

@ -185,6 +185,7 @@
<ItemGroup>
<Compile Include="App_Start\DataTablesMvc.cs" />
<Compile Include="App_Start\MiniProfiler.cs" />
<Content Include="_backboneApp\AddSeries\addNewSeriesTemplate.html" />
<Content Include="_backboneApp\Content\Intelisense\bootstrap.css" />
<Content Include="_backboneApp\JsLibraries\backbone.marionette.extend.js" />
<Compile Include="_backboneApp\CassetteConfiguration.cs" />
@ -373,7 +374,7 @@
<Compile Include="Properties\AssemblyInfo.cs" />
<Content Include="_backboneApp\JsLibraries\backbone.js" />
<Content Include="_backboneApp\JsLibraries\backbone.marionette.js" />
<Content Include="_backboneApp\AddSeries\addSeriesTemplate.html" />
<Content Include="_backboneApp\AddSeries\addSeriesLayoutTemplate.html" />
<Content Include="Cassette.targets" />
<None Include="_backboneApp\JsLibraries\jquery-1.8.2.intellisense.js" />
<Content Include="_backboneApp\JsLibraries\jquery-1.8.2.js" />

@ -0,0 +1,6 @@
<div class="tab-pane" id="add-new">
<div class="input-prepend search">
<i class="add-on icon-search"></i>
<input type="text" class="span10" placeholder="Start typing the name of series you want to add ...">
</div>
</div>

@ -4,12 +4,7 @@
<li><a href="#root-folders">Root Folders</a></li>
</ul>
<div class="tab-content">
<div class="tab-pane active" id="add-new">
<div class="input-prepend search">
<i class="add-on icon-search"></i>
<input type="text" class="span10" placeholder="Start typing the name of series you want to add ...">
</div>
</div>
<div class="tab-pane active" id="add-new">Add new series.</div>
<div class="tab-pane" id="import-existing">Import existing.</div>
<div class="tab-pane" id="root-folders">Manage root folders</div>
</div>

@ -1,80 +1,56 @@
NzbDrone.AddSeriesView = Backbone.Marionette.ItemView.extend({
template: "AddSeries/addSeriesTemplate",
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",
NzbDrone.AddNewSeriesView = Backbone.Marionette.ItemView.extend({
template: "AddSeries/addNewSeriesTemplate",
ui: {
seriesSearch: '#series-search'
seriesSearch: '.search input'
},
onRender: function () {
console.log('binding auto complete');
var self = this;
this.ui.seriesSearch
.autocomplete({
source: "http://localhost:1232/api/series/lookup",
minLength: 1,
delay: 500,
select: function (event, ui) {
$(this).val(ui.item.Title);
$(this).siblings('.seriesId').val(ui.item.Id);
return false;
.data('timeout', null)
.keyup(function () {
clearTimeout(self.$el.data('timeout'));
self.$el.data('timeout', setTimeout(self.search, 500, self));
});
},
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');
}
});
})
.data("autocomplete")._renderItem = function (ul, item) {
NzbDrone.ImportExistingView = Backbone.Marionette.ItemView.extend({
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({
template: "#add-existing-series",
NzbDrone.RootFoldersView = Backbone.Marionette.ItemView.extend({
template: "AddSeries/RootFoldersTemplate",
events: {
'click #single': 'single',
'click #multiple': 'multiple'
},
});
NzbDrone.AddSeriesLayout = Backbone.Marionette.Layout.extend({
template: "AddSeries/addSeriesLayoutTemplate",
single: function () {
NzbDrone.Router.navigate(NzbDrone.Routes.Series.AddExistingSingle, { trigger: true });
regions: {
addNew: "#add-new",
importExisting: "#import-existing",
rootFolders: "#root-folders"
},
multiple: function () {
NzbDrone.Router.navigate(NzbDrone.Routes.Series.AddExistingMultiple, { trigger: true });
}
onRender: function () {
this.$('#myTab a').click(function (e) {
e.preventDefault();
$(this).tab('show');
});
NzbDrone.AddExistingSeriesSingleView = Backbone.Marionette.ItemView.extend({
template: "#add-existing-series-single"
});
this.addNew.show(new NzbDrone.AddNewSeriesView());
this.importExisting.show(new NzbDrone.ImportExistingView());
this.rootFolders.show(new NzbDrone.RootFoldersView());
},
NzbDrone.AddExistingSeriesMultipleView = Backbone.Marionette.ItemView.extend({
template: "#add-existing-series-multiple"
})
});

@ -21,7 +21,7 @@ NzbDrone.Routes = {
NzbDrone.Controller = Backbone.Marionette.Controller.extend({
addSeries: function () {
NzbDrone.mainRegion.show(new NzbDrone.AddSeriesView());
NzbDrone.mainRegion.show(new NzbDrone.AddSeriesLayout());
},

Loading…
Cancel
Save