mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-21 05:53:33 -07:00
removed NzbDrone. namespace, everything is done using require.
This commit is contained in:
parent
ef62af75df
commit
b0bd3f34f1
121 changed files with 2570 additions and 2587 deletions
|
@ -1,30 +1,33 @@
|
|||
'use strict';
|
||||
'use strict';
|
||||
|
||||
define(['templates'], function (Templates) {
|
||||
return function () {
|
||||
this.get = function (templateId) {
|
||||
define(
|
||||
[
|
||||
'templates'
|
||||
], function (Templates) {
|
||||
return function () {
|
||||
this.get = function (templateId) {
|
||||
|
||||
var templateKey = templateId.toLowerCase();
|
||||
var templateKey = templateId.toLowerCase();
|
||||
|
||||
var templateFunction = Templates[templateKey];
|
||||
var templateFunction = Templates[templateKey];
|
||||
|
||||
if (!templateFunction) {
|
||||
throw 'couldn\'t find pre-compiled template ' + templateKey;
|
||||
}
|
||||
|
||||
return function (data) {
|
||||
|
||||
try {
|
||||
return templateFunction(data);
|
||||
}
|
||||
catch (error) {
|
||||
console.error('template render failed for ' + templateKey + ' ' + error);
|
||||
console.error(data);
|
||||
throw error;
|
||||
if (!templateFunction) {
|
||||
throw 'couldn\'t find pre-compiled template ' + templateKey;
|
||||
}
|
||||
|
||||
return function (data) {
|
||||
|
||||
try {
|
||||
return templateFunction(data);
|
||||
}
|
||||
catch (error) {
|
||||
console.error('template render failed for ' + templateKey + ' ' + error);
|
||||
console.error(data);
|
||||
throw error;
|
||||
}
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue