mirror of
https://github.com/S2-/ejs-render-remote
synced 2025-08-02 20:50:04 +02:00
Compare commits
7 Commits
Author | SHA1 | Date | |
---|---|---|---|
2701eb3060 | |||
ad9d3b9be9 | |||
21d9319f97 | |||
371d16bc2e | |||
d53c239f90 | |||
6635965706 | |||
dfcf1a4b6f |
@@ -28,6 +28,7 @@
|
|||||||
"dot-notation": 0,
|
"dot-notation": 0,
|
||||||
"no-multi-str": 2,
|
"no-multi-str": 2,
|
||||||
"key-spacing": [2, {"afterColon": true}],
|
"key-spacing": [2, {"afterColon": true}],
|
||||||
"func-call-spacing": [2, "never"]
|
"func-call-spacing": [2, "never"],
|
||||||
|
"no-console": "warn"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -25,12 +25,7 @@
|
|||||||
|
|
||||||
//if the template is already cached, return it and we are done
|
//if the template is already cached, return it and we are done
|
||||||
if (templateFn) {
|
if (templateFn) {
|
||||||
try {
|
return templateFn(data);
|
||||||
return templateFn(data);
|
|
||||||
} catch(ex) {
|
|
||||||
console.error(ex);
|
|
||||||
throw ex;
|
|
||||||
}
|
|
||||||
|
|
||||||
} else { //if the template is not cached, we need to get it and render it later once we have it. remember: this happens only if the template is not already cached
|
} else { //if the template is not cached, we need to get it and render it later once we have it. remember: this happens only if the template is not already cached
|
||||||
|
|
||||||
@@ -42,7 +37,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
var r = uuidv4();
|
var r = uuidv4();
|
||||||
getTemplateFn.then(function(template) {
|
getTemplateFn.done(function(template) {
|
||||||
var templateOptions = overwriteWithCacheOptions(options, templateUrl);
|
var templateOptions = overwriteWithCacheOptions(options, templateUrl);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -52,7 +47,7 @@
|
|||||||
templateOptions
|
templateOptions
|
||||||
));
|
));
|
||||||
} catch(ex) {
|
} catch(ex) {
|
||||||
console.error(templateUrl, ex);
|
$.readyException(ex);
|
||||||
}
|
}
|
||||||
|
|
||||||
//clean up the getFnFor
|
//clean up the getFnFor
|
||||||
@@ -73,16 +68,15 @@
|
|||||||
d.resolve(templateUrl);
|
d.resolve(templateUrl);
|
||||||
} else {
|
} else {
|
||||||
$.get(templateUrl)
|
$.get(templateUrl)
|
||||||
.then(function(template) {
|
.done(function(template) {
|
||||||
try {
|
try {
|
||||||
var templateOptions = overwriteWithCacheOptions(options, templateUrl);
|
var templateOptions = overwriteWithCacheOptions(options, templateUrl);
|
||||||
var templateFn = ejs.compile(template, templateOptions);
|
var templateFn = ejs.compile(template, templateOptions);
|
||||||
ejs.cache.set(templateUrl, templateFn);
|
ejs.cache.set(templateUrl, templateFn);
|
||||||
d.resolve(templateUrl);
|
d.resolve(templateUrl);
|
||||||
} catch(ex) {
|
} catch(ex) {
|
||||||
console.error(templateUrl, ex);
|
$.readyException(ex);
|
||||||
d.reject(ex);
|
d.reject(ex);
|
||||||
throw ex;
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "ejs-render-remote",
|
"name": "ejs-render-remote",
|
||||||
"version": "1.0.10",
|
"version": "1.0.13",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"homepage": "https://github.com/S2-/ejs-render-remote",
|
"homepage": "https://github.com/S2-/ejs-render-remote",
|
||||||
|
Reference in New Issue
Block a user