update ejs-utils
This commit is contained in:
25
js/thirdparty/ejs-utils.js
vendored
25
js/thirdparty/ejs-utils.js
vendored
@@ -1,5 +1,6 @@
|
||||
//if this does not work, call Simon. https://github.com/S2-
|
||||
|
||||
//this uses jQuery for now because ie11 support is needed
|
||||
|
||||
(function($) {
|
||||
var uuidv4 = function() {
|
||||
@@ -49,4 +50,28 @@
|
||||
return '<span class="ejs-templateplaceholder" style="display: none;" id="' + r + '"></span>';
|
||||
}
|
||||
};
|
||||
|
||||
ejs.preloadTft = function(templateUrl) {
|
||||
var d = $.Deferred();
|
||||
|
||||
//if the template is already cached, just return.
|
||||
if (ejs.cache.get(templateUrl)) {
|
||||
d.resolve();
|
||||
} else {
|
||||
$.get(templateUrl)
|
||||
.then(function(template) {
|
||||
var templateFn = ejs.compile(template,
|
||||
{
|
||||
cache: true,
|
||||
filename: templateUrl
|
||||
});
|
||||
|
||||
ejs.cache.set(templateUrl, templateFn);
|
||||
|
||||
d.resolve();
|
||||
});
|
||||
}
|
||||
|
||||
return d;
|
||||
}
|
||||
})(jQuery);
|
||||
|
Reference in New Issue
Block a user