updated cassette registration

This commit is contained in:
Keivan Beigi 2013-01-22 15:58:08 -08:00 committed by kay.one
parent f303c33ed8
commit d110cf2633
8 changed files with 89 additions and 72 deletions

View File

@ -185,7 +185,9 @@
<ItemGroup>
<Compile Include="App_Start\DataTablesMvc.cs" />
<Compile Include="App_Start\MiniProfiler.cs" />
<Content Include="_backboneApp\AddSeries\addNewSeriesTemplate.html" />
<Content Include="_backboneApp\AddSeries\AddNewSeries\AddNewSeriesTemplate.html" />
<Content Include="_backboneApp\AddSeries\AddNewSeries\AddNewSeriesView.js" />
<Content Include="_backboneApp\AddSeries\SeriesSearchModel.js" />
<Content Include="_backboneApp\Content\Intelisense\bootstrap.css" />
<Content Include="_backboneApp\JsLibraries\backbone.marionette.extend.js" />
<Compile Include="_backboneApp\CassetteConfiguration.cs" />
@ -196,7 +198,7 @@
<Compile Include="Helpers\RenderActionHelper.cs" />
<Compile Include="Helpers\Validation\RequiredIfAnyAttribute.cs" />
<Compile Include="Helpers\Validation\RequiredIfAttribute.cs" />
<Content Include="_backboneApp\AddSeries\addSeriesView.js" />
<Content Include="_backboneApp\AddSeries\AddSeriesLayout.js" />
<Content Include="_backboneApp\AddSeries\addSeries.css" />
<Content Include="_backboneApp\app.js" />
<Content Include="_backboneApp\Content\base.css" />

View File

@ -0,0 +1,27 @@
/// <reference path="../../app.js" />
/// <reference path="../SeriesSearchModel.js" />
NzbDrone.AddSeries.AddNewSeriesView = Backbone.Marionette.ItemView.extend({
template: "AddSeries/AddNewSeries/AddNewSeriesTemplate",
ui: {
seriesSearch: '.search input'
},
onRender: function() {
console.log('binding auto complete');
var self = this;
this.ui.seriesSearch
.data('timeout', null)
.keyup(function() {
clearTimeout(self.$el.data('timeout'));
self.$el.data('timeout', setTimeout(self.search, 500, self));
});
},
search: function(context) {
console.log(context.ui.seriesSearch.val());
},
});

View File

@ -0,0 +1,24 @@
/// <reference path="../app.js" />
/// <reference path="AddNewSeries/AddNewSeriesView.js" />
NzbDrone.AddSeries.AddSeriesLayout = Backbone.Marionette.Layout.extend({
template: "AddSeries/addSeriesLayoutTemplate",
regions: {
addNew: "#add-new",
importExisting: "#import-existing",
rootFolders: "#root-folders"
},
onRender: function () {
this.$('#myTab a').click(function (e) {
e.preventDefault();
$(this).tab('show');
});
this.addNew.show(new NzbDrone.AddSeries.AddNewSeriesView());
//this.importExisting.show(new NzbDrone.ImportExistingView());
//this.rootFolders.show(new NzbDrone.RootFoldersView());
},
});

View File

@ -0,0 +1,10 @@
/// <reference path="../app.js" />
NzbDrone.AddSeries.SeriesSearchResultModel = Backbone.Model.extend({
});
NzbDrone.AddSeries.SeriesSearchResultCollection = Backbone.Collection.extend({
});

View File

@ -1,56 +0,0 @@
NzbDrone.AddNewSeriesView = Backbone.Marionette.ItemView.extend({
template: "AddSeries/addNewSeriesTemplate",
ui: {
seriesSearch: '.search input'
},
onRender: function () {
console.log('binding auto complete');
var self = this;
this.ui.seriesSearch
.data('timeout', null)
.keyup(function () {
clearTimeout(self.$el.data('timeout'));
self.$el.data('timeout', setTimeout(self.search, 500, self));
});
},
search: function (context) {
console.log(context.ui.seriesSearch.val());
},
});
NzbDrone.ImportExistingView = Backbone.Marionette.ItemView.extend({
template: "AddSeries/ImportExistingTemplate",
});
NzbDrone.RootFoldersView = Backbone.Marionette.ItemView.extend({
template: "AddSeries/RootFoldersTemplate",
});
NzbDrone.AddSeriesLayout = Backbone.Marionette.Layout.extend({
template: "AddSeries/addSeriesLayoutTemplate",
regions: {
addNew: "#add-new",
importExisting: "#import-existing",
rootFolders: "#root-folders"
},
onRender: function () {
this.$('#myTab a').click(function (e) {
e.preventDefault();
$(this).tab('show');
});
this.addNew.show(new NzbDrone.AddNewSeriesView());
this.importExisting.show(new NzbDrone.ImportExistingView());
this.rootFolders.show(new NzbDrone.RootFoldersView());
},
});

View File

@ -18,7 +18,7 @@ namespace NzbDrone.Web.Backbone.NzbDrone
{
bundles.AddUrlWithAlias<StylesheetBundle>("//fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,400,600,300'", FONTS);
//bundles.AddPerSubDirectory<StylesheetBundle>("Backbone.NzbDrone");
bundles.AddPerIndividualFile<ScriptBundle>(APP_PATH);
bundles.Add<StylesheetBundle>(BASE_STYLE, new[]{
APP_PATH + "\\Content\\Bootstrap\\bootstrap.less",
@ -28,20 +28,20 @@ namespace NzbDrone.Web.Backbone.NzbDrone
},
bundle => bundle.AddReference("/" + FONTS));
bundles.Add<ScriptBundle>(BACKBONE, new[]{
APP_PATH + "\\JsLibraries\\jquery-1.8.2.js",
APP_PATH + "\\JsLibraries\\bootstrap.js",
APP_PATH + "\\JsLibraries\\underscore.js",
APP_PATH + "\\JsLibraries\\backbone.js",
APP_PATH + "\\JsLibraries\\backbone.marionette.js",
APP_PATH + "\\JsLibraries\\backbone.marionette.extend.js",
bundles.Add<ScriptBundle>(NZBDRONE, new[]{
APP_PATH + "\\AddSeries\\AddSeriesLayout.js",
});
bundles.Add<ScriptBundle>(NZBDRONE, new[]{
APP_PATH + "\\app.js",
APP_PATH + "\\AddSeries\\addSeriesView.js"},
bundle => bundle.AddReference("/" + BACKBONE));
/* bundles.Add<ScriptBundle>(NZBDRONE, new[]{
},
bundle => bundle.AddReference("/" + BACKBONE));*/
}
}
}

View File

@ -1,4 +1,14 @@
NzbDrone = new Backbone.Marionette.Application();
/// <reference path="JsLibraries/jquery-1.8.2.js" />
/// <reference path="JsLibraries/underscore.js" />
/// <reference path="JsLibraries/backbone.js" />
/// <reference path="JsLibraries/backbone.marionette.js" />
/// <reference path="JsLibraries/backbone.marionette.extend.js" />
/// <reference path="JsLibraries/bootstrap.js" />
NzbDrone = new Backbone.Marionette.Application();
NzbDrone.AddSeries = NzbDrone.module("AddSeries");
NzbDrone.Constants = {
@ -21,7 +31,7 @@ NzbDrone.Routes = {
NzbDrone.Controller = Backbone.Marionette.Controller.extend({
addSeries: function () {
NzbDrone.mainRegion.show(new NzbDrone.AddSeriesLayout());
NzbDrone.mainRegion.show(new NzbDrone.AddSeries.AddNewSeriesView());
},