added first region,view and routes.

pull/23/head
Keivan Beigi 12 years ago committed by kay.one
parent 9f304b7be5
commit 85fa96f436

@ -0,0 +1,3 @@
NzbDrone.AddSeriesView = Backbone.Marionette.ItemView.extend({
template: "#add-series-template"
});

@ -38,7 +38,10 @@
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Content Include="AddSeries\Views\addSeriesView.js" />
<Content Include="app.js" /> <Content Include="app.js" />
<Content Include="bootstrap.js" />
<Content Include="index.html" />
<Content Include="JsLibraries\backbone.js" /> <Content Include="JsLibraries\backbone.js" />
<None Include="JsLibraries\jquery-1.8.2.intellisense.js" /> <None Include="JsLibraries\jquery-1.8.2.intellisense.js" />
<Content Include="JsLibraries\backbone.marionette.js" /> <Content Include="JsLibraries\backbone.marionette.js" />
@ -64,6 +67,7 @@
<Reference Include="System.Web" /> <Reference Include="System.Web" />
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
</ItemGroup> </ItemGroup>
<ItemGroup />
<PropertyGroup> <PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion> <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath> <VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>

@ -1,7 +1,27 @@
NzbDrone = new Backbone.Marionette.Application(); NzbDrone = new Backbone.Marionette.Application();
NzbDrone.Controller = {
AddSeries: function () {
var view = new NzbDrone.AddSeriesView();
NzbDrone.mainRegion.show(view);
},
AddNewSeries: function () {
alert("AddNewSeries");
},
AddExistingSeries: function () {
alert("AddExistingSeries");
}
};
NzbDrone.MyRouter = Backbone.Marionette.AppRouter.extend({ NzbDrone.MyRouter = Backbone.Marionette.AppRouter.extend({
controller: NzbDrone.Controller,
// "someMethod" must exist at controller.someMethod // "someMethod" must exist at controller.someMethod
appRoutes: { appRoutes: {
"add": "AddSeries", "add": "AddSeries",
@ -12,6 +32,16 @@ NzbDrone.MyRouter = Backbone.Marionette.AppRouter.extend({
}); });
NzbDrone.addInitializer(function (options) { NzbDrone.addInitializer(function (options) {
new NzbDrone.MyRouter();
console.log("starting application");
NzbDrone.addRegions({
mainRegion: "#main-region",
});
NzbDrone.Router = new NzbDrone.MyRouter();
Backbone.history.start(); Backbone.history.start();
}); });

@ -0,0 +1 @@
NzbDrone.start();

@ -0,0 +1,27 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
<div style="display: none">
<div id="add-series-template">
<h1>Add new series</h1>
</div>
</div>
<div id="main-region"></div>
<script src="JsLibraries/jquery-1.8.2.js" type="text/javascript"></script>
<script src="JsLibraries/underscore.js" type="text/javascript"></script>
<script src="JsLibraries/backbone.js" type="text/javascript"></script>
<script src="JsLibraries/backbone.marionette.js" type="text/javascript"></script>
<script src="app.js" type="text/javascript"></script>
<script src="AddSeries/Views/addSeriesView.js" type="text/javascript"></script>
<script src="bootstrap.js" type="text/javascript"></script>
</body>
</html>
Loading…
Cancel
Save