1
0
mirror of https://github.com/S2-/ejs-render-remote synced 2025-08-04 05:20:04 +02:00

7 Commits

Author SHA1 Message Date
SSantoro
936d5c1d94 v1.0.6 2019-04-18 16:22:44 +02:00
SSantoro
ef5fc54946 use $.extend 2019-04-18 16:06:07 +02:00
SSantoro
df262d40f4 v1.0.5 2019-04-18 15:47:37 +02:00
SSantoro
cd74e87dd3 allow options to be passed in 2019-04-18 15:47:25 +02:00
SSantoro
672b80f5a3 v1.0.4 2019-04-18 12:40:03 +02:00
SSantoro
2cde5f1226 clean up cache right after render 2019-04-18 12:39:51 +02:00
s2
37a2512f4b v1.0.3 2019-04-14 22:05:08 +02:00
3 changed files with 10 additions and 24 deletions

View File

@@ -40,15 +40,11 @@
getTemplateFn.then(function(template) {
var templateOptions = overwriteWithCacheOptions(options, templateUrl);
try {
$('#' + r).replaceWith(ejs.render(
template,
data,
templateOptions
));
} catch(ex) {
console.error(templateUrl, ex);
}
//clean up the getFnFor
if (ejs.cache.remove && ejs.cache.get('getFnFor' + templateUrl)) {
@@ -65,18 +61,12 @@
//if the template is already cached, just return.
if (ejs.cache.get(templateUrl)) {
d.resolve(templateUrl);
d.resolve();
} else {
$.get(templateUrl)
.then(function(template) {
var templateOptions = overwriteWithCacheOptions(options, templateUrl);
try {
var templateFn = ejs.compile(template, templateOptions);
} catch(ex) {
console.error(templateUrl, ex);
d.reject(ex);
throw ex;
}
ejs.cache.set(templateUrl, templateFn);
d.resolve(templateUrl);

View File

@@ -1,6 +1,6 @@
{
"name": "ejs-render-remote",
"version": "1.0.9",
"version": "1.0.6",
"description": "",
"main": "index.js",
"homepage": "https://github.com/S2-/ejs-render-remote",
@@ -9,9 +9,5 @@
},
"author": "s2 <s2@31337.it>",
"license": "ISC",
"keywords": [
"ejs",
"templating",
"client-side"
]
"keywords": ["ejs", "templating", "client-side"]
}