1
0
Fork 0
mirror of https://github.com/lidarr/Lidarr synced 2025-02-04 05:21:41 +00:00
Lidarr/NzbDrone.Web/_backboneApp/JsLibraries/backbone.marionette.extend.js

37 lines
1 KiB
JavaScript
Raw Normal View History


define(['underscore', 'marionette', 'handlebars', 'jquery'], function (_, Marionette, Handlebars, $) {
_.extend(Marionette.TemplateCache.prototype, {
2013-01-27 02:14:42 +00:00
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, {
2013-01-23 05:58:17 +00:00
compileTemplate: function (rawTemplate) {
return Handlebars.compile(rawTemplate);
}
});
});
2013-01-23 05:58:17 +00:00