updated external library registrations.

pull/23/head
kay.one 12 years ago
parent c01f982698
commit 258977f262

1
.gitignore vendored

@ -129,3 +129,4 @@ UpdateLogs/
*//Bootstrap/*.css
NzbDrone.Web/cassette-cache/*
*.eq
NzbDrone.Web/_backboneApp/.idea/workspace.xml

@ -212,6 +212,8 @@
<Content Include="_backboneApp\Content\jquery.dataTables.bootstrap.css" />
<Content Include="_backboneApp\JsLibraries\jquery.js" />
<Content Include="_backboneApp\JsLibraries\require.js" />
<Content Include="_backboneApp\Mixins\backbone.marionette.templates.js" />
<Content Include="_backboneApp\Mixins\backbone.xhr.js" />
<Content Include="_backboneApp\Routing.js" />
<Content Include="_backboneApp\JsLibraries\backbone.modelbinder.js" />
<Content Include="_backboneApp\AddSeries\New\AddNewSeriesTemplate.html" />
@ -227,7 +229,6 @@
<Content Include="_backboneApp\Quality\qualityProfileCollection.js" />
<Content Include="_backboneApp\Quality\qualityTypeModel.js" />
<Content Include="_backboneApp\Quality\qualityTypeCollection.js" />
<Content Include="_backboneApp\JsLibraries\backbone.marionette.extend.js" />
<Compile Include="_backboneApp\CassetteConfiguration.cs" />
<Compile Include="Controllers\ImageController.cs" />
<Compile Include="Controllers\SearchHistoryController.cs" />

@ -63,17 +63,22 @@
<div id="footer-region" class="span20"></div>
</div>
</div>
<script src="../../_backboneApp/JsLibraries/jquery.js"></script>
<script src="../../_backboneApp/JsLibraries/bootstrap.js"></script>
<script src="../../_backboneApp/JsLibraries/underscore.js"></script>
<script src="../../_backboneApp/JsLibraries/handlebars.js"></script>
<script src="../../_backboneApp/JsLibraries/backbone.js"></script>
<script src="../../_backboneApp/JsLibraries/backbone.modelbinder.js"></script>
<script src="../../_backboneApp/JsLibraries/backbone.mutators.js"></script>
<script src="../../_backboneApp/JsLibraries/backbone.marionette.js"></script>
<script src="../../_backboneApp/JsLibraries/jquery.dataTables.js"></script>
<script src="../../_backboneApp/JsLibraries/jquery.dataTables.extensions.js"></script>
<script src="../../_backboneApp/JsLibraries/jquery.dataTables.bootstrap.pagination.js"></script>
<script src="/_backboneApp/JsLibraries/jquery.js"></script>
<script src="/_backboneApp/JsLibraries/bootstrap.js"></script>
<script src="/_backboneApp/JsLibraries/jquery.dataTables.js"></script>
<script src="/_backboneApp/JsLibraries/jquery.dataTables.extensions.js"></script>
<script src="/_backboneApp/JsLibraries/jquery.dataTables.bootstrap.pagination.js"></script>
<script src="/_backboneApp/JsLibraries/underscore.js"></script>
<script src="/_backboneApp/JsLibraries/handlebars.js"></script>
<script src="/_backboneApp/JsLibraries/backbone.js"></script>
<script src="/_backboneApp/JsLibraries/backbone.modelbinder.js"></script>
<script src="/_backboneApp/JsLibraries/backbone.mutators.js"></script>
<script src="/_backboneApp/JsLibraries/backbone.marionette.js"></script>
<script src="/_backboneApp/JsLibraries/sugar.js"></script>
<script src="/_backboneApp/Mixins/backbone.marionette.templates.js"></script>
<script src="/_backboneApp/Mixins/backbone.xhr.js"></script>
<script data-main="/_backboneApp/app" src="/_backboneApp/JsLibraries/require.js"></script>
<script src="/_backboneApp/Routing.js"></script>

@ -1,36 +0,0 @@

define(['underscore', 'marionette', 'handlebars', 'jquery'], function (_, Marionette, Handlebars, $) {
_.extend(Marionette.TemplateCache.prototype, {
loadTemplate: function (templateId) {
var template;
console.log("Loading template '" + templateId + "'");
$.ajax({
url: '_backboneApp//' + templateId + '.html',
cache: false,
async: false
}).done(function (data) {
template = data;
}).fail(function (data) {
console.log("couldn't load template " + this.templateId + " Error: " + data.statusText);
template = "<div class='alert alert-error'>Couldn't load template '" + templateId + "'. Status: " + data.statusText + "</div>";
});
return template;
}
});
_.extend(Marionette.TemplateCache.prototype, {
compileTemplate: function (rawTemplate) {
return Handlebars.compile(rawTemplate);
}
});
});

@ -0,0 +1,33 @@
_.extend(Marionette.TemplateCache.prototype, {
loadTemplate:function (templateId) {
var template;
console.log("Loading template '" + templateId + "'");
$.ajax({
url:'_backboneApp//' + templateId + '.html',
cache:false,
async:false
}).done(function (data) {
template = data;
}).fail(function (data) {
console.log("couldn't load template " + this.templateId + " Error: " + data.statusText);
template = "<div class='alert alert-error'>Couldn't load template '" + templateId + "'. Status: " + data.statusText + "</div>";
});
return template;
}
});
_.extend(Marionette.TemplateCache.prototype, {
compileTemplate:function (rawTemplate) {
return Handlebars.compile(rawTemplate);
}
});

@ -1,16 +1,21 @@
define(['app'], function () {
NzbDrone.Shared.NotificationModel = Backbone.Model.extend({
mutators: {
pre: function () {
if (this.get('message')) {
return this.get('message').lines().lenght > 1;
mutators:{
pre:function () {
try {
if (this.get('message')) {
return this.get('message').lines().lenght > 1;
}
} catch (error) {
return false;
}
},
iconClass: function () {
iconClass:function () {
if (this.has('icon')) {
return "icon";
return 'icon';
}
if (this.get('level') === 'info') {
@ -25,10 +30,10 @@
}
},
defaults: {
"level": "info",
"title": "",
"message": "",
defaults:{
"level":'info',
"title":'',
"message":''
}
});
});

@ -4,19 +4,15 @@
'backbone': 'JsLibraries/backbone',
'underscore': 'JsLibraries/underscore',
'marionette': 'JsLibraries/backbone.marionette',
'handlebars': 'JsLibraries/handlebars',
'jquery': 'JsLibraries/jquery'
'handlebars': 'JsLibraries/handlebars'
},
shim: {
jquery:{
exports:'$'
},
underscore: {
exports: '_'
},
backbone: {
deps: ['underscore', 'jquery'],
deps: ['underscore'],
exports: 'Backbone'
},
marionette: {
@ -25,23 +21,18 @@
},
handlebars: {
exports: 'Handlebars'
},
dataTable: {
deps: ['jquery']
}
}
});
define('app', ['jquery', 'JsLibraries/backbone.modelbinder', 'marionette', 'handlebars', 'JsLibraries/backbone.marionette.extend'],
function (jquery, modelBinder, marionette, handlebars) {
window.$ = jquery;
window.jquery = jquery;
define('app', function () {
//window.$ = jquery;
//window.jquery = jquery;
window.Backbone.ModelBinder = modelBinder;
window.Backbone.Marionette = marionette;
window.Handlebars = handlebars;
//window.Backbone.ModelBinder = modelBinder;
//window.Backbone.Marionette = marionette;
//window.Handlebars = handlebars;
window.NzbDrone = new Backbone.Marionette.Application();
window.NzbDrone.Series = {};

Loading…
Cancel
Save