1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-10-06 08:07:20 +02:00
Radarr/NzbDrone.Web/_backboneApp/JsLibraries/backbone.marionette.extend.js

34 lines
886 B
JavaScript
Raw Normal View History

2013-01-27 03:14:42 +01:00
/// <reference path="handlebars.js" />
_.extend(Marionette.TemplateCache.prototype, {
loadTemplate: function (templateId) {
2013-01-22 06:43:47 +01:00
var template;
console.log("Loading template '" + templateId + "'");
2013-01-28 19:06:54 +01:00
$.ajax({
url: '_backboneApp//' + templateId + '.html',
2013-01-25 18:54:45 +01:00
cache:false,
async: false
}).done(function (data) {
template = data;
}).fail(function (data) {
console.log("couldn't load template " + this.templateId + " Error: " + data.statusText);
2013-01-22 06:43:47 +01:00
template = "<div class='alert alert-error'>Couldn't load template '" + templateId + "'. Status: " + data.statusText + "</div>";
});
return template;
}
2013-01-23 06:58:17 +01:00
});
2013-01-27 03:14:42 +01:00
_.extend(Marionette.TemplateCache.prototype, {
2013-01-23 06:58:17 +01:00
2013-01-27 03:14:42 +01:00
compileTemplate: function (rawTemplate) {
return Handlebars.compile(rawTemplate);
}
});