diff options
author | Paul Duncan <pabs@pablotron.org> | 2018-09-09 11:02:08 -0400 |
---|---|---|
committer | Paul Duncan <pabs@pablotron.org> | 2018-09-09 11:02:08 -0400 |
commit | c0f4d9a505ab1a94e6b0993582c9827f5a681e05 (patch) | |
tree | 250ed30d37b8a775153acfd5514dd76229a1f1fb /js/luigi-template.js | |
parent | b4e1f4906a27619b3edffd791361694f00f38662 (diff) | |
download | luigi-template-c0f4d9a505ab1a94e6b0993582c9827f5a681e05.tar.bz2 luigi-template-c0f4d9a505ab1a94e6b0993582c9827f5a681e05.zip |
js: add to Usage, fix cache test, add support for cache custom filters
Diffstat (limited to 'js/luigi-template.js')
-rw-r--r-- | js/luigi-template.js | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/js/luigi-template.js b/js/luigi-template.js index 473938f..f01d976 100644 --- a/js/luigi-template.js +++ b/js/luigi-template.js @@ -288,8 +288,9 @@ LuigiTemplate = (function() { T.prototype.run = run; // declare cache constructor - T.Cache = function(templates, try_dom) { + T.Cache = function(templates, filters, try_dom) { this.templates = templates; + this.filters = filters || FILTERS; this.try_dom = !!try_dom; this.cache = {}; }; @@ -310,15 +311,15 @@ LuigiTemplate = (function() { } // cache template - this.cache[key] = new T(s); + this.cache[key] = new T(s, this.filters); } // run template return this.cache[key].run(args); }; - T.cache = function(args) { - return new T.Cache(args); + T.cache = function(args, filters) { + return new T.Cache(args, filters || FILTERS); } // declare domcache constructor |