From 3c0b14b61fd173462640d66f4997239c11e8e3b4 Mon Sep 17 00:00:00 2001 From: BorisMoore Date: Sun, 12 Jul 2020 12:59:36 -0700 Subject: [PATCH] v1.0.7 release Feature improvements for JsRender on Node.js: (See issue https://github.com/BorisMoore/jsrender/issues/357) - File based templates for JsRender on Node.js now allow absolute paths See the updated documentation topic: https://www.jsviews.com/#node/filetmpls@htmlfile - The renderFile() method for JsRender on Node.js now allows passing of context and helpers as well as data See the new documentation topic: https://www.jsviews.com/#node/filetmpls@renderfilehlelpers Bug fix: - https://github.com/BorisMoore/jsviews/issues/445 jsrender.min.js.map truncated Additional small corrections or improvements to documentation and some additional unit tests... --- .../scenarios/01_default-values-scenario.html | 2 +- demos/scenarios/02_separators-scenario.html | 2 +- .../03_iterating-through-fields-scenario.html | 2 +- .../04_assigning-variables-scenario.html | 2 +- .../05_arrays-plus-headers-and-footers.html | 2 +- demos/step-by-step/01_inserting-data.html | 2 +- ...ompiling-named-templates-from-strings.html | 2 +- .../03_converters-and-encoding.html | 2 +- demos/step-by-step/04_if-else-tag.html | 2 +- demos/step-by-step/05_for-tag.html | 2 +- .../step-by-step/06_template-composition.html | 2 +- demos/step-by-step/07_paths.html | 2 +- demos/step-by-step/08_custom-tags.html | 2 +- demos/step-by-step/09_helper-functions.html | 2 +- demos/step-by-step/10_comparison-tests.html | 2 +- .../11_accessing-parent-data.html | 2 +- demos/step-by-step/12_passing-in-context.html | 2 +- ...13_associating-helpers-with-templates.html | 2 +- ...mpiling-template-objects-from-strings.html | 2 +- ...amed-template-from-script-declaration.html | 2 +- ...plate-objects-from-script-declaration.html | 2 +- .../04_template-composition-subtemplates.html | 2 +- ..._template-composition-templateobjects.html | 2 +- jsrender-node.js | 391 +++++++++++------- jsrender.js | 379 ++++++++++------- jsrender.min.js | 4 +- jsrender.min.js.map | 2 +- package.json | 2 +- test/browserify/bundles/1-bundle.js | 383 ++++++++++------- test/browserify/bundles/12-nested-bundle.js | 383 ++++++++++------- test/browserify/bundles/2-bundle.js | 383 ++++++++++------- test/browserify/bundles/3-bundle.js | 383 ++++++++++------- .../bundles/htm-jsrender-tmpl-bundle.js | 379 ++++++++++------- .../bundles/html-jsr-tmpl-bundle.js | 379 ++++++++++------- test/index.html | 4 +- test/perf-compare.html | 2 +- test/unit-tests-amd-scriptloader.html | 5 +- test/unit-tests-browserify.html | 2 +- test/unit-tests-jsrender-no-jquery.html | 2 +- test/unit-tests-jsrender-with-jquery.html | 2 +- test/unit-tests/requirejs-config.js | 11 +- test/unit-tests/tests-node.js | 4 +- typescript/jsrender/index.d.ts | 2 +- typescript/jsrender/test/tests.html | 2 +- 44 files changed, 1914 insertions(+), 1236 deletions(-) diff --git a/demos/scenarios/01_default-values-scenario.html b/demos/scenarios/01_default-values-scenario.html index f71f65e..c51b82b 100644 --- a/demos/scenarios/01_default-values-scenario.html +++ b/demos/scenarios/01_default-values-scenario.html @@ -1,7 +1,7 @@  - + diff --git a/demos/scenarios/02_separators-scenario.html b/demos/scenarios/02_separators-scenario.html index 78e8bb0..358464e 100644 --- a/demos/scenarios/02_separators-scenario.html +++ b/demos/scenarios/02_separators-scenario.html @@ -1,7 +1,7 @@  - + diff --git a/demos/scenarios/03_iterating-through-fields-scenario.html b/demos/scenarios/03_iterating-through-fields-scenario.html index ea5cd13..4033a73 100644 --- a/demos/scenarios/03_iterating-through-fields-scenario.html +++ b/demos/scenarios/03_iterating-through-fields-scenario.html @@ -1,7 +1,7 @@  - + diff --git a/demos/scenarios/04_assigning-variables-scenario.html b/demos/scenarios/04_assigning-variables-scenario.html index c8be55b..d3bc599 100644 --- a/demos/scenarios/04_assigning-variables-scenario.html +++ b/demos/scenarios/04_assigning-variables-scenario.html @@ -1,7 +1,7 @@  - + diff --git a/demos/scenarios/05_arrays-plus-headers-and-footers.html b/demos/scenarios/05_arrays-plus-headers-and-footers.html index 43b8efc..1face02 100644 --- a/demos/scenarios/05_arrays-plus-headers-and-footers.html +++ b/demos/scenarios/05_arrays-plus-headers-and-footers.html @@ -1,7 +1,7 @@  - + diff --git a/demos/step-by-step/01_inserting-data.html b/demos/step-by-step/01_inserting-data.html index f50b8d9..47bafb7 100644 --- a/demos/step-by-step/01_inserting-data.html +++ b/demos/step-by-step/01_inserting-data.html @@ -1,7 +1,7 @@  - + diff --git a/demos/step-by-step/02_compiling-named-templates-from-strings.html b/demos/step-by-step/02_compiling-named-templates-from-strings.html index f73a2d2..78ff383 100644 --- a/demos/step-by-step/02_compiling-named-templates-from-strings.html +++ b/demos/step-by-step/02_compiling-named-templates-from-strings.html @@ -1,7 +1,7 @@ - + diff --git a/demos/step-by-step/03_converters-and-encoding.html b/demos/step-by-step/03_converters-and-encoding.html index 968f733..6a2b319 100644 --- a/demos/step-by-step/03_converters-and-encoding.html +++ b/demos/step-by-step/03_converters-and-encoding.html @@ -1,7 +1,7 @@  - + diff --git a/demos/step-by-step/04_if-else-tag.html b/demos/step-by-step/04_if-else-tag.html index 62a6d5a..4fafc68 100644 --- a/demos/step-by-step/04_if-else-tag.html +++ b/demos/step-by-step/04_if-else-tag.html @@ -1,7 +1,7 @@  - + diff --git a/demos/step-by-step/05_for-tag.html b/demos/step-by-step/05_for-tag.html index 7b32fc3..e132bf2 100644 --- a/demos/step-by-step/05_for-tag.html +++ b/demos/step-by-step/05_for-tag.html @@ -1,7 +1,7 @@  - + diff --git a/demos/step-by-step/06_template-composition.html b/demos/step-by-step/06_template-composition.html index 52b2df8..b9e54c6 100644 --- a/demos/step-by-step/06_template-composition.html +++ b/demos/step-by-step/06_template-composition.html @@ -1,7 +1,7 @@ - + diff --git a/demos/step-by-step/07_paths.html b/demos/step-by-step/07_paths.html index f26b016..760b8a3 100644 --- a/demos/step-by-step/07_paths.html +++ b/demos/step-by-step/07_paths.html @@ -1,7 +1,7 @@  - + diff --git a/demos/step-by-step/08_custom-tags.html b/demos/step-by-step/08_custom-tags.html index a5f29cc..229b371 100644 --- a/demos/step-by-step/08_custom-tags.html +++ b/demos/step-by-step/08_custom-tags.html @@ -1,7 +1,7 @@  - + diff --git a/demos/step-by-step/09_helper-functions.html b/demos/step-by-step/09_helper-functions.html index 5b3b284..eeb2de8 100644 --- a/demos/step-by-step/09_helper-functions.html +++ b/demos/step-by-step/09_helper-functions.html @@ -1,7 +1,7 @@  - + diff --git a/demos/step-by-step/10_comparison-tests.html b/demos/step-by-step/10_comparison-tests.html index 813a0bc..e8f320c 100644 --- a/demos/step-by-step/10_comparison-tests.html +++ b/demos/step-by-step/10_comparison-tests.html @@ -1,7 +1,7 @@  - + diff --git a/demos/step-by-step/11_accessing-parent-data.html b/demos/step-by-step/11_accessing-parent-data.html index 576226c..78bcc88 100644 --- a/demos/step-by-step/11_accessing-parent-data.html +++ b/demos/step-by-step/11_accessing-parent-data.html @@ -1,7 +1,7 @@  - + diff --git a/demos/step-by-step/12_passing-in-context.html b/demos/step-by-step/12_passing-in-context.html index cbc1f08..2276c23 100644 --- a/demos/step-by-step/12_passing-in-context.html +++ b/demos/step-by-step/12_passing-in-context.html @@ -1,7 +1,7 @@  - + diff --git a/demos/step-by-step/13_associating-helpers-with-templates.html b/demos/step-by-step/13_associating-helpers-with-templates.html index af9b717..12c209a 100644 --- a/demos/step-by-step/13_associating-helpers-with-templates.html +++ b/demos/step-by-step/13_associating-helpers-with-templates.html @@ -1,7 +1,7 @@  - + diff --git a/demos/variants/accessing-templates/01_compiling-template-objects-from-strings.html b/demos/variants/accessing-templates/01_compiling-template-objects-from-strings.html index 6459d48..24fc450 100644 --- a/demos/variants/accessing-templates/01_compiling-template-objects-from-strings.html +++ b/demos/variants/accessing-templates/01_compiling-template-objects-from-strings.html @@ -1,7 +1,7 @@ - + diff --git a/demos/variants/accessing-templates/02_registering-named-template-from-script-declaration.html b/demos/variants/accessing-templates/02_registering-named-template-from-script-declaration.html index 65f2595..1b8045e 100644 --- a/demos/variants/accessing-templates/02_registering-named-template-from-script-declaration.html +++ b/demos/variants/accessing-templates/02_registering-named-template-from-script-declaration.html @@ -1,7 +1,7 @@ - + diff --git a/demos/variants/accessing-templates/03_getting-template-objects-from-script-declaration.html b/demos/variants/accessing-templates/03_getting-template-objects-from-script-declaration.html index d9e206a..5359587 100644 --- a/demos/variants/accessing-templates/03_getting-template-objects-from-script-declaration.html +++ b/demos/variants/accessing-templates/03_getting-template-objects-from-script-declaration.html @@ -1,7 +1,7 @@ - + diff --git a/demos/variants/accessing-templates/04_template-composition-subtemplates.html b/demos/variants/accessing-templates/04_template-composition-subtemplates.html index 55a0a52..2d14e12 100644 --- a/demos/variants/accessing-templates/04_template-composition-subtemplates.html +++ b/demos/variants/accessing-templates/04_template-composition-subtemplates.html @@ -1,7 +1,7 @@ - + diff --git a/demos/variants/accessing-templates/05_template-composition-templateobjects.html b/demos/variants/accessing-templates/05_template-composition-templateobjects.html index da72069..b8cd019 100644 --- a/demos/variants/accessing-templates/05_template-composition-templateobjects.html +++ b/demos/variants/accessing-templates/05_template-composition-templateobjects.html @@ -1,7 +1,7 @@ - + diff --git a/jsrender-node.js b/jsrender-node.js index efca429..1a5e9f2 100644 --- a/jsrender-node.js +++ b/jsrender-node.js @@ -1,4 +1,4 @@ -/*! JsRender v1.0.6: http://jsviews.com/#jsrender */ +/*! JsRender v1.0.7: http://jsviews.com/#jsrender */ /*! **VERSION FOR NODE.JS** (For WEB see http://jsviews.com/download/jsrender.js) */ /* * Best-of-breed templating in browser or on Node.js. @@ -19,20 +19,17 @@ if (typeof exports !== 'object' ) { //========================== Top-level vars ========================== -var versionNumber = "v1.0.6", - // global var is the this object, which is window when running in the usual browser environment - +var versionNumber = "v1.0.7", $, jsvStoreName, rTag, rTmplString, topView, $views, - _ocp = "_ocp", // Observable contextual parameter + _ocp = "_ocp", // Observable contextual parameter -//TODO tmplFnsCache = {}, $isFunction, $isArray, $templates, $converters, $helpers, $tags, $sub, $subSettings, $subSettingsAdvanced, $viewsSettings, delimOpenChar0, delimOpenChar1, delimCloseChar0, delimCloseChar1, linkChar, setting, baseOnError, isRenderCall, rNewLine = /[ \t]*(\r\n|\n|\r)/g, - rUnescapeQuotes = /\\(['"])/g, + rUnescapeQuotes = /\\(['"\\])/g, // Unescape quotes and trim rEscapeQuotes = /['"\\]/g, // Escape quotes and \ character rBuildHash = /(?:\x08|^)(onerror:)?(?:(~?)(([\w$.]+):)?([^\x08]+))\x08(,)?([^\x08]+)/gi, rTestElseIf = /^if\s/, @@ -56,7 +53,7 @@ var versionNumber = "v1.0.6", "`": "`", "=": "=" }, - charsFromEntities = { + charsFromEntities = { amp: "&", gt: ">", lt: "<" @@ -66,6 +63,7 @@ var versionNumber = "v1.0.6", tmplAttr = "data-jsv-tmpl", jsvTmpl = "jsvTmpl", indexStr = "For #index in nested block use #getIndex().", + cpFnStore = {}, // Compiled furnctions for computed values in template expressions (properties, methods, helpers) $render = {}, jsvStores = { @@ -90,8 +88,8 @@ var versionNumber = "v1.0.6", rPath: /^(!*?)(?:null|true|false|\d[\d.]*|([\w$]+|\.|~([\w$]+)|#(view|([\w$]+))?)([\w$.^]*?)(?:[.[^]([\w$]+)\]?)?)$/g, // not object helper view viewProperty pathTokens leafToken - rPrm: /(\()(?=\s*\()|(?:([([])\s*)?(?:(\^?)(~?[\w$.^]+)?\s*((\+\+|--)|\+|-|~(?![\w$])|&&|\|\||===|!==|==|!=|<=|>=|[<>%*:?\/]|(=))\s*|(!*?(@)?[#~]?[\w$.^]+)([([])?)|(,\s*)|(\(?)\\?(?:(')|("))|(?:\s*(([)\]])(?=[.^]|\s*$|[^([])|[)\]])([([]?))|(\s+)/g, - // lftPrn0 lftPrn bound path operator err eq path2 late prn comma lftPrn2 apos quot rtPrn rtPrnDot prn2 space + rPrm: /(\()(?=\s*\()|(?:([([])\s*)?(?:(\^?)(~?[\w$.^]+)?\s*((\+\+|--)|\+|-|~(?![\w$])|&&|\|\||===|!==|==|!=|<=|>=|[<>%*:?\/]|(=))\s*|(!*?(@)?[#~]?[\w$.^]+)([([])?)|(,\s*)|(?:(\()\s*)?\\?(?:(')|("))|(?:\s*(([)\]])(?=[.^]|\s*$|[^([])|[)\]])([([]?))|(\s+)/g, + // lftPrn0 lftPrn bound path operator err eq path2 late prn comma lftPrn2 apos quot rtPrn rtPrnDot prn2 space View: View, Err: JsViewsError, @@ -141,7 +139,7 @@ var versionNumber = "v1.0.6", : $subSettingsAdvanced; } }, - map: dataMap // If jsObservable loaded first, use that definition of dataMap + map: dataMap // If jsObservable loaded first, use that definition of dataMap }; function getDerivedMethod(baseMethod, method) { @@ -412,7 +410,7 @@ function contextParameter(key, value, get) { || storeView); if (res !== undefined && storeView.tagCtx) { // If storeView is a tag, but the contextual parameter has been set at at higher level (e.g. helpers)... - storeView = storeView.tagCtx.view.scope; // then move storeView to the outer level (scope of tag container view) + storeView = storeView.tagCtx.view.scope; // then move storeView to the outer level (scope of tag container view) } store = storeView._ocps; res = store && store.hasOwnProperty(key) && store[key] || res; @@ -441,14 +439,14 @@ function contextParameter(key, value, get) { deps = res[1] ? $sub._ceo(res[1].deps) : [_ocp]; // fn deps (with any exprObs cloned using $sub._ceo) deps.unshift(res[0]); // view deps._cxp = obsCtxPrm; - // In a context callback for a contextual param, we set get = true, to get ctxPrm [view, dependencies...] array - needed for observe call + // In a context callback for a contextual param, we set get = true, to get ctxPrm [view, dependencies...] array - needed for observe call return deps; } tagElse = obsCtxPrm.tagElse; newRes = res[1] // linkFn for compiled expression ? obsCtxPrm.tag && obsCtxPrm.tag.cvtArgs ? obsCtxPrm.tag.cvtArgs(tagElse, 1)[obsCtxPrm.ind] // = tag.bndArgs() - for tag contextual parameter - : res[1](res[0].data, res[0], $sub) // = fn(data, view, $sub) for compiled binding expression + : res[1](res[0].data, res[0], $sub) // = fn(data, view, $sub) for compiled binding expression : res[0]._ocp; // Observable contextual parameter (uninitialized, or initialized as static expression, so no path dependencies) if (isUpdate) { $sub._ucp(key, value, storeView, obsCtxPrm); // Update observable contextual parameter @@ -648,7 +646,7 @@ function renderTag(tagName, parentView, tmpl, tagCtxs, isUpdate, onError) { while (m--) { key = bindArray[m]; if (!isNaN(parseInt(key))) { - bindArray[m] = parseInt(key); // Convert "0" to 0, etc. + bindArray[m] = parseInt(key); // Convert "0" to 0, etc. } } } @@ -868,7 +866,7 @@ function renderTag(tagName, parentView, tmpl, tagCtxs, isUpdate, onError) { if (parentView.linked && itemRet && !rWrappedInViewMarker.test(itemRet)) { // When a tag renders content from the render method, with data linking then we need to wrap with view markers, if absent, // to provide a contentView for the tag, which will correctly dispose bindings if deleted. The 'tmpl' for this view will - // be a dumbed-down template which will always return the itemRet string (no matter what the data is). The itemRet string + // be a dumbed-down template which will always return the itemRet string (no matter what the data is). The itemRet string // is not compiled as template markup, so can include "{{" or "}}" without triggering syntax errors tmpl = { // 'Dumbed-down' template which always renders 'static' itemRet string links: [] @@ -938,6 +936,9 @@ function View(context, type, parentView, data, template, key, onRender, contentT }; self.linked = !!onRender; self.type = type || "top"; + if (type) { + self.cache = {_ct: $subSettings._cchCt}; // Used for caching results of computed properties and helpers (view.getCache) + } if (!parentView || parentView.type === "top") { (self.ctx = context || {}).root = self.data; @@ -976,6 +977,12 @@ View.prototype = { getRsc: getResource, _getTmpl: getTemplate, _getOb: getPathObject, + getCache: function(key) { // Get cached value of computed value + if ($subSettings._cchCt > this.cache._ct) { + this.cache = {_ct: $subSettings._cchCt}; + } + return this.cache[key] || (this.cache[key] = cpFnStore[key](this.data, this, $sub)); + }, _is: "view" }; @@ -988,7 +995,7 @@ function compileChildResources(parentTmpl) { for (storeName in jsvStores) { storeNames = storeName + "s"; if (parentTmpl[storeNames]) { - resources = parentTmpl[storeNames]; // Resources not yet compiled + resources = parentTmpl[storeNames]; // Resources not yet compiled parentTmpl[storeNames] = {}; // Remove uncompiled resources $views[storeNames](resources, parentTmpl); // Add back in the compiled resources } @@ -1062,7 +1069,7 @@ function baseApply(args) { //=============== function compileTmpl(name, tmpl, parentTmpl, options) { - // tmpl is either a template object, a selector for a template script block, the name of a compiled template, or a template object + // tmpl is either a template object, a selector for a template script block, or the name of a compiled template //==== nested functions ==== function lookupTemplate(value) { @@ -1071,8 +1078,8 @@ function compileTmpl(name, tmpl, parentTmpl, options) { var currentName, tmpl; if (("" + value === value) || value.nodeType > 0 && (elem = value)) { if (!elem) { - if (/^\.\/[^\\:*?"<>]*$/.test(value)) { - // tmpl="./some/file.html" + if (/^\.?\/[^\\:*?"<>]*$/.test(value)) { + // value="./some/file.html" (or "/some/file.html") // If the template is not named, use "./some/file.html" as name. if (tmpl = $templates[name = name || value]) { value = tmpl; @@ -1367,7 +1374,7 @@ function compileViewModel(name, type) { : value; } for (prop in model) { - if (model.hasOwnProperty(prop) && (prop.charAt(0) !== "_" || !getterNames[prop.slice(1)]) && prop !== $expando && !$isFunction(model[prop])) { + if (model.hasOwnProperty(prop) && (prop.charAt(0) !== "_" || !getterNames[prop.slice(1)]) && prop !== $expando && !$isFunction(model[prop])) { ob[prop] = model[prop]; } } @@ -1540,7 +1547,7 @@ function registerStore(storeName, storeSettings) { /** * Add settings such as: * $.views.settings.allowCode(true) -* @param {boolean} value +* @param {boolean} value * @returns {Settings} * * allowCode = $.views.settings.allowCode() @@ -1635,7 +1642,7 @@ function renderContent(data, context, noIteration, parentView, key, onRender) { isTopRenderCall = !view; isRenderCall = isRenderCall || isTopRenderCall; - if (!view) { + if (isTopRenderCall) { (context = context || {}).root = data; // Provide ~root as shortcut to top-level data. } if (!isRenderCall || $subSettingsAdvanced.useViews || tmpl.useViews || view && view !== topView) { @@ -2067,26 +2074,25 @@ function parsedParam(args, props, ctx) { return [args.slice(0, -1), props.slice(0, -1), ctx.slice(0, -1)]; } -function paramStructure(parts, type) { - return '\n\t' - + (type - ? type + ':{' - : '') - + 'args:[' + parts[0] + '],\n\tprops:{' + parts[1] + '}' - + (parts[2] ? ',\n\tctx:{' + parts[2] + '}' : ""); +function paramStructure(paramCode, paramVals) { + return '\n\tparams:{args:[' + paramCode[0] + '],\n\tprops:{' + paramCode[1] + '}' + + (paramCode[2] ? ',\n\tctx:{' + paramCode[2] + '}' : "") + + '},\n\targs:[' + paramVals[0] + '],\n\tprops:{' + paramVals[1] + '}' + + (paramVals[2] ? ',\n\tctx:{' + paramVals[2] + '}' : ""); } function parseParams(params, pathBindings, tmpl, isLinkExpr) { - function parseTokens(all, lftPrn0, lftPrn, bound, path, operator, err, eq, path2, late, prn, comma, lftPrn2, apos, quot, rtPrn, rtPrnDot, prn2, space, index, full) { - // /(\()(?=\s*\()|(?:([([])\s*)?(?:(\^?)(~?[\w$.^]+)?\s*((\+\+|--)|\+|-|~(?![\w$])|&&|\|\||===|!==|==|!=|<=|>=|[<>%*:?\/]|(=))\s*|(!*?(@)?[#~]?[\w$.^]+)([([])?)|(,\s*)|(\(?)\\?(?:(')|("))|(?:\s*(([)\]])(?=[.^]|\s*$|[^([])|[)\]])([([]?))|(\s+)/g, - //lftPrn0 lftPrn bound path operator err eq path2 late prn comma lftPrn2 apos quot rtPrn rtPrnDot prn2 space + function parseTokens(all, lftPrn0, lftPrn, bound, path, operator, err, eq, path2, late, prn, + comma, lftPrn2, apos, quot, rtPrn, rtPrnDot, prn2, space, index, full) { + // /(\()(?=\s*\()|(?:([([])\s*)?(?:(\^?)(~?[\w$.^]+)?\s*((\+\+|--)|\+|-|~(?![\w$])|&&|\|\||===|!==|==|!=|<=|>=|[<>%*:?\/]|(=))\s*|(!*?(@)?[#~]?[\w$.^]+)([([])?)|(,\s*)|(?:(\()\s*)?\\?(?:(')|("))|(?:\s*(([)\]])(?=[.^]|\s*$|[^([])|[)\]])([([]?))|(\s+)/g, + //lftPrn0 lftPrn bound path operator err eq path2 late prn comma lftPrn2 apos quot rtPrn rtPrnDot prn2 space // (left paren? followed by (path? followed by operator) or (path followed by paren?)) or comma or apos or quot or right paren or space function parsePath(allPath, not, object, helper, view, viewProperty, pathTokens, leafToken) { // /^(!*?)(?:null|true|false|\d[\d.]*|([\w$]+|\.|~([\w$]+)|#(view|([\w$]+))?)([\w$.^]*?)(?:[.[^]([\w$]+)\]?)?)$/g, // not object helper view viewProperty pathTokens leafToken - var subPath = object === "."; + subPath = object === "."; if (object) { path = path.slice(not.length); if (/^\.?constructor$/.test(leafToken||path)) { @@ -2131,16 +2137,21 @@ function parseParams(params, pathBindings, tmpl, isLinkExpr) { while (theOb.sb) { theOb = theOb.sb; } - if (theOb.bnd) { - path = "^" + path.slice(1); + if (theOb.prm) { + if (theOb.bnd) { + path = "^" + path.slice(1); + } + theOb.sb = path; + theOb.bnd = theOb.bnd || path[0] === "^"; } - theOb.sb = path; - theOb.bnd = theOb.bnd || path[0] === "^"; } } else { binds.push(path); } - pathStart[parenDepth] = index + (subPath ? 1 : 0); + if (prn && !subPath) { + pathStart[fnDp] = ind; + compiledPathStart[fnDp] = compiledPath[fnDp].length; + } } } return allPath; @@ -2151,6 +2162,7 @@ function parseParams(params, pathBindings, tmpl, isLinkExpr) { path = bound + path; // e.g. some.fn(...)^some.path - so here path is "^some.path" } operator = operator || ""; + lftPrn2 = lftPrn2 || ""; lftPrn = lftPrn || lftPrn0 || lftPrn2; path = path || path2; @@ -2160,127 +2172,196 @@ function parseParams(params, pathBindings, tmpl, isLinkExpr) { // Could do this - but not worth perf cost?? :- // if (!path.lastIndexOf("#data.", 0)) { path = path.slice(6); } // If path starts with "#data.", remove that. prn = prn || prn2 || ""; + var expr, binds, theOb, newOb, subPath, lftPrnFCall, ret, + ind = index; - var expr, exprFn, binds, theOb, newOb, - rtSq = ")"; - - if (prn === "[") { - prn = "[j._sq("; - rtSq = ")]"; - } - - if (err && !aposed && !quoted) { - syntaxError(params); - } else { - if (bindings && rtPrnDot && !aposed && !quoted) { + if (!aposed && !quoted) { + if (err) { + syntaxError(params); + } + if (rtPrnDot && bindings) { // This is a binding to a path in which an object is returned by a helper/data function/expression, e.g. foo()^x.y or (a?b:c)^x.y // We create a compiled function to get the object instance (which will be called when the dependent data of the subexpression changes, to return the new object, and trigger re-binding of the subsequent path) - if (parenDepth) { - expr = pathStart[parenDepth - 1]; - if (full.length - 1 > index - (expr || 0)) { // We need to compile a subexpression - expr = full.slice(expr, index + all.length); - if (exprFn !== true) { // If not reentrant call during compilation - binds = bindto || bndStack[parenDepth-1].bd; - // Insert exprOb object, to be used during binding to return the computed object - theOb = binds[binds.length-1]; - if (theOb && theOb.prm) { - while (theOb.sb && theOb.sb.prm) { - theOb = theOb.sb; - } - newOb = theOb.sb = {path: theOb.sb, bnd: theOb.bnd}; - } else { - binds.push(newOb = {path: binds.pop()}); // Insert exprOb object, to be used during binding to return the computed object - } // (e.g. "some.object()" in "some.object().a.b" - to be used as context for binding the following tokens "a.b") - } - rtPrnDot = delimOpenChar1 + ":" + expr // The parameter or function subexpression - + " onerror=''" // set onerror='' in order to wrap generated code with a try catch - returning '' as object instance if there is an error/missing parent - + delimCloseChar0; - exprFn = tmplLinks[rtPrnDot]; - if (!exprFn) { - tmplLinks[rtPrnDot] = true; // Flag that this exprFn (for rtPrnDot) is being compiled - tmplLinks[rtPrnDot] = exprFn = tmplFn(rtPrnDot, tmpl, true); // Compile the expression (or use cached copy already in tmpl.links) - } - if (exprFn !== true && newOb) { - // If not reentrant call during compilation - newOb._cpfn = exprFn; - newOb.prm = bndCtx.bd; - newOb.bnd = newOb.bnd || newOb.path && newOb.path.indexOf("^") >= 0; + expr = pathStart[fnDp-1]; + if (full.length - 1 > ind - (expr || 0)) { // We need to compile a subexpression + expr = $.trim(full.slice(expr, ind + all.length)); + binds = bindto || bndStack[fnDp-1].bd; + // Insert exprOb object, to be used during binding to return the computed object + theOb = binds[binds.length-1]; + if (theOb && theOb.prm) { + while (theOb.sb && theOb.sb.prm) { + theOb = theOb.sb; } + newOb = theOb.sb = {path: theOb.sb, bnd: theOb.bnd}; + } else { + binds.push(newOb = {path: binds.pop()}); // Insert exprOb object, to be used during binding to return the computed object } + if (theOb && theOb.sb === newOb) { + compiledPath[fnDp] = compiledPath[fnDp-1].slice(theOb._cpPthSt) + compiledPath[fnDp]; + compiledPath[fnDp-1] = compiledPath[fnDp-1].slice(0, theOb._cpPthSt); + } + newOb._cpPthSt = compiledPathStart[fnDp-1]; + newOb._cpKey = expr; + + compiledPath[fnDp] += full.slice(prevIndex, index); + prevIndex = index; + + newOb._cpfn = cpFnStore[expr] = cpFnStore[expr] || // Compiled function for computed value: get from store, or compile and store + new Function("data,view,j", // Compiled function for computed value in template + "//" + expr + "\nvar v;\nreturn ((v=" + compiledPath[fnDp] + (rtPrn === "]" ? ")]" : rtPrn) + ")!=null?v:null);"); + + compiledPath[fnDp-1] += (fnCall[prnDp] && $subSettingsAdvanced.cache ? "view.getCache(\"" + expr.replace(rEscapeQuotes, "\\$&") + "\"" : compiledPath[fnDp]); + + newOb.prm = bndCtx.bd; + newOb.bnd = newOb.bnd || newOb.path && newOb.path.indexOf("^") >= 0; } + compiledPath[fnDp] = ""; + } + if (prn === "[") { + prn = "[j._sq("; + } + if (lftPrn === "[") { + lftPrn = "[j._sq("; } - return (aposed - // within single-quoted string - ? (aposed = !apos, (aposed ? all : lftPrn2 + '"')) - : quoted - // within double-quoted string - ? (quoted = !quot, (quoted ? all : lftPrn2 + '"')) - : - ( - (lftPrn - ? (pathStart[parenDepth] = index++, bndCtx = bndStack[++parenDepth] = {bd: []}, lftPrn) - : "") - + (space - ? (parenDepth - ? "" - // New arg or prop - so insert backspace \b (\x08) as separator for named params, used subsequently by rBuildHash, and prepare new bindings array - : (paramIndex = full.slice(paramIndex, index), named - ? (named = boundName = bindto = false, "\b") - : "\b,") + paramIndex + (paramIndex = index + all.length, bindings && pathBindings.push(bndCtx.bd = []), "\b") - ) - : eq - // named param. Remove bindings for arg and create instead bindings array for prop - ? (parenDepth && syntaxError(params), bindings && pathBindings.pop(), named = "_" + path, boundName = bound, paramIndex = index + all.length, - bindings && ((bindings = bndCtx.bd = pathBindings[named] = []), bindings.skp = !bound), path + ':') - : path - // path - ? (path.split("^").join(".").replace($sub.rPath, parsePath) - + (prn - // some.fncall( - ? (bndCtx = bndStack[++parenDepth] = {bd: []}, fnCall[parenDepth] = rtSq, prn) - : operator) - ) - : operator - // operator - ? operator - : rtPrn - // function - ? ((rtPrn = fnCall[parenDepth] || rtPrn, fnCall[parenDepth] = false, bndCtx = bndStack[--parenDepth], rtPrn) - + (prn // rtPrn and prn, e.g )( in (a)() or a()(), or )[ in a()[] - ? (bndCtx = bndStack[++parenDepth], fnCall[parenDepth] = rtSq, prn) - : "") - ) - : comma - ? (fnCall[parenDepth] || syntaxError(params), ",") // We don't allow top-level literal arrays or objects - : lftPrn0 - ? "" - : (aposed = apos, quoted = quot, '"') - )) - ); } + ret = (aposed + // within single-quoted string + ? (aposed = !apos, (aposed ? all : lftPrn2 + '"')) + : quoted + // within double-quoted string + ? (quoted = !quot, (quoted ? all : lftPrn2 + '"')) + : + ( + (lftPrn + ? ( + prnStack[++prnDp] = true, + prnInd[prnDp] = 0, + bindings && ( + pathStart[fnDp++] = ind++, + bndCtx = bndStack[fnDp] = {bd: []}, + compiledPath[fnDp] = "", + compiledPathStart[fnDp] = 1 + ), + lftPrn) // Left paren, (not a function call paren) + : "") + + (space + ? (prnDp + ? "" // A space within parens or within function call parens, so not a separator for tag args + // New arg or prop - so insert backspace \b (\x08) as separator for named params, used subsequently by rBuildHash, and prepare new bindings array + : (paramIndex = full.slice(paramIndex, ind), named + ? (named = boundName = bindto = false, "\b") + : "\b,") + paramIndex + (paramIndex = ind + all.length, bindings && pathBindings.push(bndCtx.bd = []), "\b") + ) + : eq + // named param. Remove bindings for arg and create instead bindings array for prop + ? (fnDp && syntaxError(params), bindings && pathBindings.pop(), named = "_" + path, boundName = bound, paramIndex = ind + all.length, + bindings && ((bindings = bndCtx.bd = pathBindings[named] = []), bindings.skp = !bound), path + ':') + : path + // path + ? (path.split("^").join(".").replace($sub.rPath, parsePath) + + (prn || operator) + ) + : operator + // operator + ? operator + : rtPrn + // function + ? rtPrn === "]" ? ")]" : ")" + : comma + ? (fnCall[prnDp] || syntaxError(params), ",") // We don't allow top-level literal arrays or objects + : lftPrn0 + ? "" + : (aposed = apos, quoted = quot, '"') + )) + ); + + if (!aposed && !quoted) { + if (rtPrn) { + fnCall[prnDp] = false; + prnDp--; + } + } + + if (bindings) { + if (!aposed && !quoted) { + if (rtPrn) { + if (prnStack[prnDp+1]) { + bndCtx = bndStack[--fnDp]; + prnStack[prnDp+1] = false; + } + prnStart = prnInd[prnDp+1]; + } + if (prn) { + prnInd[prnDp+1] = compiledPath[fnDp].length + (lftPrn ? 1 : 0); + if (path || rtPrn) { + bndCtx = bndStack[++fnDp] = {bd: []}; + prnStack[prnDp+1] = true; + } + } + } + + compiledPath[fnDp] = (compiledPath[fnDp]||"") + full.slice(prevIndex, index); + prevIndex = index+all.length; + + if (!aposed && !quoted) { + if (lftPrnFCall = lftPrn && prnStack[prnDp+1]) { + compiledPath[fnDp-1] += lftPrn; + compiledPathStart[fnDp-1]++; + } + if (prn === "(" && subPath && !newOb) { + compiledPath[fnDp] = compiledPath[fnDp-1].slice(prnStart) + compiledPath[fnDp]; + compiledPath[fnDp-1] = compiledPath[fnDp-1].slice(0, prnStart); + } + } + compiledPath[fnDp] += lftPrnFCall ? ret.slice(1) : ret; + } + + if (!aposed && !quoted && prn) { + prnDp++; + if (path && prn === "(") { + fnCall[prnDp] = true; + } + } + + if (!aposed && !quoted && prn2) { + if (bindings) { + compiledPath[fnDp] += prn; + } + ret += prn; + } + return ret; } - var named, bindto, boundName, + var named, bindto, boundName, result, quoted, // boolean for string content in double quotes aposed, // or in single quotes bindings = pathBindings && pathBindings[0], // bindings array for the first arg bndCtx = {bd: bindings}, bndStack = {0: bndCtx}, paramIndex = 0, // list, - tmplLinks = (tmpl ? tmpl.links : bindings && (bindings.links = bindings.links || {})) || topView.tmpl.links, // The following are used for tracking path parsing including nested paths, such as "a.b(c^d + (e))^f", and chained computed paths such as // "a.b().c^d().e.f().g" - which has four chained paths, "a.b()", "^c.d()", ".e.f()" and ".g" - parenDepth = 0, - fnCall = {}, // We are in a function call - pathStart = {}, // tracks the start of the current path such as c^d() in the above example - result; + prnDp = 0, // For tracking paren depth (not function call parens) + fnDp = 0, // For tracking depth of function call parens + prnInd = {}, // We are in a function call + prnStart = 0, // tracks the start of the current path such as c^d() in the above example + prnStack = {}, // tracks parens which are not function calls, and so are associated with new bndStack contexts + fnCall = {}, // We are in a function call + pathStart = {},// tracks the start of the current path such as c^d() in the above example + compiledPathStart = {0: 0}, + compiledPath = {0:""}, + prevIndex = 0; if (params[0] === "@") { params = params.replace(rBracketQuote, "."); } result = (params + (tmpl ? " " : "")).replace($sub.rPrm, parseTokens); - return !parenDepth && result || syntaxError(params); // Syntax error if unbalanced parens in params expression + if (bindings) { + result = compiledPath[0]; + } + + return !prnDp && result || syntaxError(params); // Syntax error if unbalanced parens in params expression } function buildCode(ast, tmpl, isLinkExpr) { @@ -2316,7 +2397,7 @@ function buildCode(ast, tmpl, isLinkExpr) { // Add newline for each callout to t() c() etc. and each markup string if ("" + node === node) { // a markup string to be inserted - code += '\n+"' + node + '"'; + code += '+"' + node + '"'; } else { // a compiled tag expression to be inserted tagName = node[0]; @@ -2326,7 +2407,7 @@ function buildCode(ast, tmpl, isLinkExpr) { } else { converter = node[1]; content = !isLinkExpr && node[2]; - tagCtx = paramStructure(node[3], 'params') + '},' + paramStructure(params = node[4]); + tagCtx = paramStructure(node[3], params = node[4]); // NODE.JS-SPECIFIC CODE: var prm = params[1]; if (prm && /^'tmpl':"\.\/[^\:*?"<>]*"$/.test(prm)) { @@ -2391,7 +2472,7 @@ function buildCode(ast, tmpl, isLinkExpr) { if (isGetVal && (pathBindings || trigger || converter && converter !== HTML || lateRender)) { // For convertVal we need a compiled function to return the new tagCtx(s) - tagCtxFn = new Function("data,view,j,u", "// " + tmplName + " " + (++tmplBindingKey) + " " + tagName + tagCtxFn = new Function("data,view,j", "// " + tmplName + " " + (++tmplBindingKey) + " " + tagName + retStrOpen + "{" + tagCtx + "};" + retStrClose); tagCtxFn._er = onError; tagCtxFn._tag = tagName; @@ -2429,7 +2510,7 @@ function buildCode(ast, tmpl, isLinkExpr) { tagRender = 't("' + tagAndElses + '",view,this,'; if (isLinkExpr || pathBindings) { // This is a bound tag (data-link expression or inline bound tag {^{tag ...}}) so we store a compiled tagCtxs function in tmp.bnds - code = new Function("data,view,j,u", " // " + tmplName + " " + tmplBindingKey + " " + tagAndElses + retStrOpen + code + code = new Function("data,view,j", " // " + tmplName + " " + tmplBindingKey + " " + tagAndElses + retStrOpen + code + retStrClose); code._er = onError; code._tag = tagAndElses; @@ -2453,7 +2534,7 @@ function buildCode(ast, tmpl, isLinkExpr) { } if (onError && !nextIsElse) { useViews = true; - code += ';\n}catch(e){ret' + (isLinkExpr ? "urn " : "+=") + boundOnErrStart + 'j._err(e,view,' + onError + ')' + boundOnErrEnd + ';}' + (isLinkExpr ? "" : 'ret=ret'); + code += ';\n}catch(e){ret' + (isLinkExpr ? "urn " : "+=") + boundOnErrStart + 'j._err(e,view,' + onError + ')' + boundOnErrEnd + ';}' + (isLinkExpr ? "" : '\nret=ret'); } } } @@ -2466,7 +2547,7 @@ function buildCode(ast, tmpl, isLinkExpr) { + (hasCnvt ? ",c=j._cnvt" : "") // converter + (hasEncoder ? ",h=j._html" : "") // html converter + (isLinkExpr - ? (node[8] // late @... path? + ? (node[8] // late @... path? ? ", ob" : "" ) + ";\n" @@ -2475,7 +2556,7 @@ function buildCode(ast, tmpl, isLinkExpr) { + (isLinkExpr ? "\n" : ";\nreturn ret;"); try { - code = new Function("data,view,j,u", code); + code = new Function("data,view,j", code); } catch (e) { syntaxError("Compiled template code:\n\n" + code + '\n: "' + (e.message||e) + '"'); } @@ -2582,7 +2663,7 @@ function getTargetSorted(value, tagCtx) { } } - start = props.start; // Get current value - after possible changes triggered by tag.sorted refresh() above + start = props.start; // Get current value - after possible changes triggered by tag.sorted refresh() above end = props.end; if (propParams.start && start === undefined || propParams.end && end === undefined) { start = end = 0; @@ -2657,7 +2738,7 @@ $sub = $views.sub; $viewsSettings = $views.settings; { - // JsRender not already loaded, or loaded without jQuery, and we are now moving from jsrender namespace to jQuery namepace + // JsRender/JsViews not already loaded (or loaded without jQuery, and we are now moving from jsrender namespace to jQuery namepace) for (jsvStoreName in jsvStores) { registerStore(jsvStoreName, jsvStores[jsvStoreName]); } @@ -2707,7 +2788,7 @@ $viewsSettings = $views.settings; /** * $.views.settings.debugMode(true) - * @param {boolean} debugMode + * @param {boolean} debugMode * @returns {Settings} * * debugMode = $.views.settings.debugMode() @@ -2717,6 +2798,7 @@ $viewsSettings = $views.settings; return debugMode === undefined ? $subSettings.debugMode : ( + $subSettings._clFns && $subSettings._clFns(), // Clear linkExprStore (cached compiled expressions), since debugMode setting affects compilation for expressions $subSettings.debugMode = debugMode, $subSettings.onError = debugMode + "" === debugMode ? function() { return debugMode; } @@ -2727,6 +2809,7 @@ $viewsSettings = $views.settings; })(false); // jshint ignore:line $subSettingsAdvanced = $subSettings.advanced = { + cache: true, // By default use cached values of computed values (Otherwise, set advanced cache setting to false) useViews: false, _jsv: false // For global access to JsViews store }; @@ -2765,7 +2848,7 @@ $viewsSettings = $views.settings; tagCtx = self.tagCtx, range = tagCtx.argDefault === false, props = tagCtx.props, - iterate = range || tagCtx.args.length, // Not final else and not auto-create range + iterate = range || tagCtx.args.length, // Not final else and not auto-create range result = "", done = 0; @@ -2859,12 +2942,16 @@ var nodeFs = require('fs'), // Support for rendering templates from file system in Node.js Node, and for Express template engine integration, // using app.engine('html', jsrender.__express); -$.renderFile = $.__express = function(filepath, data, callback) { - filepath = './' + nodeFs.realpathSync(filepath).slice(rootDirPathLen).split(nodePathSep).join('/'); // Normalize to ./some/file.html - var html = $templates(filepath).render(data); - if (callback) { - callback(null, html); +$.renderFile = $.__express = function(filepath, data, context, callback) { + filepath = "/" + nodeFs.realpathSync(filepath).split(nodePathSep).slice(1).join("/"); // Normalize to /some/file.html + if (typeof context === "function") { + callback = context; + context = undefined; } + var html = $templates(filepath).render(data, context); + if (callback) { // If a callback is provided, we call it. Note that this is undocumented. + callback(null, html); // The call is still synchronous (with realpathSync and readFileSync) rather + } // than making async calls to realpath readFile. Also it does not return errors. return html; }; diff --git a/jsrender.js b/jsrender.js index c6c6c1b..40ab7de 100644 --- a/jsrender.js +++ b/jsrender.js @@ -1,4 +1,4 @@ -/*! JsRender v1.0.6: http://jsviews.com/#jsrender */ +/*! JsRender v1.0.7: http://jsviews.com/#jsrender */ /*! **VERSION FOR WEB** (For NODE.JS see http://jsviews.com/download/jsrender-node.js) */ /* * Best-of-breed templating in browser or on Node.js. @@ -44,17 +44,16 @@ var setGlobals = $ === false; // Only set globals if script block in browser (no $ = $ && $.fn ? $ : global.jQuery; // $ is jQuery passed in by CommonJS loader (Browserify), or global jQuery. -var versionNumber = "v1.0.6", +var versionNumber = "v1.0.7", jsvStoreName, rTag, rTmplString, topView, $views, $expando, - _ocp = "_ocp", // Observable contextual parameter + _ocp = "_ocp", // Observable contextual parameter -//TODO tmplFnsCache = {}, $isFunction, $isArray, $templates, $converters, $helpers, $tags, $sub, $subSettings, $subSettingsAdvanced, $viewsSettings, delimOpenChar0, delimOpenChar1, delimCloseChar0, delimCloseChar1, linkChar, setting, baseOnError, isRenderCall, rNewLine = /[ \t]*(\r\n|\n|\r)/g, - rUnescapeQuotes = /\\(['"])/g, + rUnescapeQuotes = /\\(['"\\])/g, // Unescape quotes and trim rEscapeQuotes = /['"\\]/g, // Escape quotes and \ character rBuildHash = /(?:\x08|^)(onerror:)?(?:(~?)(([\w$.]+):)?([^\x08]+))\x08(,)?([^\x08]+)/gi, rTestElseIf = /^if\s/, @@ -78,7 +77,7 @@ var versionNumber = "v1.0.6", "`": "`", "=": "=" }, - charsFromEntities = { + charsFromEntities = { amp: "&", gt: ">", lt: "<" @@ -88,6 +87,7 @@ var versionNumber = "v1.0.6", tmplAttr = "data-jsv-tmpl", jsvTmpl = "jsvTmpl", indexStr = "For #index in nested block use #getIndex().", + cpFnStore = {}, // Compiled furnctions for computed values in template expressions (properties, methods, helpers) $render = {}, jsr = global.jsrender, @@ -115,8 +115,8 @@ var versionNumber = "v1.0.6", rPath: /^(!*?)(?:null|true|false|\d[\d.]*|([\w$]+|\.|~([\w$]+)|#(view|([\w$]+))?)([\w$.^]*?)(?:[.[^]([\w$]+)\]?)?)$/g, // not object helper view viewProperty pathTokens leafToken - rPrm: /(\()(?=\s*\()|(?:([([])\s*)?(?:(\^?)(~?[\w$.^]+)?\s*((\+\+|--)|\+|-|~(?![\w$])|&&|\|\||===|!==|==|!=|<=|>=|[<>%*:?\/]|(=))\s*|(!*?(@)?[#~]?[\w$.^]+)([([])?)|(,\s*)|(\(?)\\?(?:(')|("))|(?:\s*(([)\]])(?=[.^]|\s*$|[^([])|[)\]])([([]?))|(\s+)/g, - // lftPrn0 lftPrn bound path operator err eq path2 late prn comma lftPrn2 apos quot rtPrn rtPrnDot prn2 space + rPrm: /(\()(?=\s*\()|(?:([([])\s*)?(?:(\^?)(~?[\w$.^]+)?\s*((\+\+|--)|\+|-|~(?![\w$])|&&|\|\||===|!==|==|!=|<=|>=|[<>%*:?\/]|(=))\s*|(!*?(@)?[#~]?[\w$.^]+)([([])?)|(,\s*)|(?:(\()\s*)?\\?(?:(')|("))|(?:\s*(([)\]])(?=[.^]|\s*$|[^([])|[)\]])([([]?))|(\s+)/g, + // lftPrn0 lftPrn bound path operator err eq path2 late prn comma lftPrn2 apos quot rtPrn rtPrnDot prn2 space View: View, Err: JsViewsError, @@ -166,7 +166,7 @@ var versionNumber = "v1.0.6", : $subSettingsAdvanced; } }, - map: dataMap // If jsObservable loaded first, use that definition of dataMap + map: dataMap // If jsObservable loaded first, use that definition of dataMap }; function getDerivedMethod(baseMethod, method) { @@ -437,7 +437,7 @@ function contextParameter(key, value, get) { || storeView); if (res !== undefined && storeView.tagCtx) { // If storeView is a tag, but the contextual parameter has been set at at higher level (e.g. helpers)... - storeView = storeView.tagCtx.view.scope; // then move storeView to the outer level (scope of tag container view) + storeView = storeView.tagCtx.view.scope; // then move storeView to the outer level (scope of tag container view) } store = storeView._ocps; res = store && store.hasOwnProperty(key) && store[key] || res; @@ -466,14 +466,14 @@ function contextParameter(key, value, get) { deps = res[1] ? $sub._ceo(res[1].deps) : [_ocp]; // fn deps (with any exprObs cloned using $sub._ceo) deps.unshift(res[0]); // view deps._cxp = obsCtxPrm; - // In a context callback for a contextual param, we set get = true, to get ctxPrm [view, dependencies...] array - needed for observe call + // In a context callback for a contextual param, we set get = true, to get ctxPrm [view, dependencies...] array - needed for observe call return deps; } tagElse = obsCtxPrm.tagElse; newRes = res[1] // linkFn for compiled expression ? obsCtxPrm.tag && obsCtxPrm.tag.cvtArgs ? obsCtxPrm.tag.cvtArgs(tagElse, 1)[obsCtxPrm.ind] // = tag.bndArgs() - for tag contextual parameter - : res[1](res[0].data, res[0], $sub) // = fn(data, view, $sub) for compiled binding expression + : res[1](res[0].data, res[0], $sub) // = fn(data, view, $sub) for compiled binding expression : res[0]._ocp; // Observable contextual parameter (uninitialized, or initialized as static expression, so no path dependencies) if (isUpdate) { $sub._ucp(key, value, storeView, obsCtxPrm); // Update observable contextual parameter @@ -673,7 +673,7 @@ function renderTag(tagName, parentView, tmpl, tagCtxs, isUpdate, onError) { while (m--) { key = bindArray[m]; if (!isNaN(parseInt(key))) { - bindArray[m] = parseInt(key); // Convert "0" to 0, etc. + bindArray[m] = parseInt(key); // Convert "0" to 0, etc. } } } @@ -893,7 +893,7 @@ function renderTag(tagName, parentView, tmpl, tagCtxs, isUpdate, onError) { if (parentView.linked && itemRet && !rWrappedInViewMarker.test(itemRet)) { // When a tag renders content from the render method, with data linking then we need to wrap with view markers, if absent, // to provide a contentView for the tag, which will correctly dispose bindings if deleted. The 'tmpl' for this view will - // be a dumbed-down template which will always return the itemRet string (no matter what the data is). The itemRet string + // be a dumbed-down template which will always return the itemRet string (no matter what the data is). The itemRet string // is not compiled as template markup, so can include "{{" or "}}" without triggering syntax errors tmpl = { // 'Dumbed-down' template which always renders 'static' itemRet string links: [] @@ -963,6 +963,9 @@ function View(context, type, parentView, data, template, key, onRender, contentT }; self.linked = !!onRender; self.type = type || "top"; + if (type) { + self.cache = {_ct: $subSettings._cchCt}; // Used for caching results of computed properties and helpers (view.getCache) + } if (!parentView || parentView.type === "top") { (self.ctx = context || {}).root = self.data; @@ -1001,6 +1004,12 @@ View.prototype = { getRsc: getResource, _getTmpl: getTemplate, _getOb: getPathObject, + getCache: function(key) { // Get cached value of computed value + if ($subSettings._cchCt > this.cache._ct) { + this.cache = {_ct: $subSettings._cchCt}; + } + return this.cache[key] || (this.cache[key] = cpFnStore[key](this.data, this, $sub)); + }, _is: "view" }; @@ -1013,7 +1022,7 @@ function compileChildResources(parentTmpl) { for (storeName in jsvStores) { storeNames = storeName + "s"; if (parentTmpl[storeNames]) { - resources = parentTmpl[storeNames]; // Resources not yet compiled + resources = parentTmpl[storeNames]; // Resources not yet compiled parentTmpl[storeNames] = {}; // Remove uncompiled resources $views[storeNames](resources, parentTmpl); // Add back in the compiled resources } @@ -1087,7 +1096,7 @@ function baseApply(args) { //=============== function compileTmpl(name, tmpl, parentTmpl, options) { - // tmpl is either a template object, a selector for a template script block, the name of a compiled template, or a template object + // tmpl is either a template object, a selector for a template script block, or the name of a compiled template //==== nested functions ==== function lookupTemplate(value) { @@ -1096,8 +1105,8 @@ function compileTmpl(name, tmpl, parentTmpl, options) { var currentName, tmpl; if (("" + value === value) || value.nodeType > 0 && (elem = value)) { if (!elem) { - if (/^\.\/[^\\:*?"<>]*$/.test(value)) { - // tmpl="./some/file.html" + if (/^\.?\/[^\\:*?"<>]*$/.test(value)) { + // value="./some/file.html" (or "/some/file.html") // If the template is not named, use "./some/file.html" as name. if (tmpl = $templates[name = name || value]) { value = tmpl; @@ -1108,7 +1117,7 @@ function compileTmpl(name, tmpl, parentTmpl, options) { } } else if ($.fn && !$sub.rTmpl.test(value)) { try { - elem = $ (value, document)[0]; // if jQuery is loaded, test for selector returning elements, and get first element + elem = $(value, document)[0]; // if jQuery is loaded, test for selector returning elements, and get first element } catch (e) {} }// END BROWSER-SPECIFIC CODE } //BROWSER-SPECIFIC CODE @@ -1415,7 +1424,7 @@ function compileViewModel(name, type) { : value; } for (prop in model) { - if (model.hasOwnProperty(prop) && (prop.charAt(0) !== "_" || !getterNames[prop.slice(1)]) && prop !== $expando && !$isFunction(model[prop])) { + if (model.hasOwnProperty(prop) && (prop.charAt(0) !== "_" || !getterNames[prop.slice(1)]) && prop !== $expando && !$isFunction(model[prop])) { ob[prop] = model[prop]; } } @@ -1588,7 +1597,7 @@ function registerStore(storeName, storeSettings) { /** * Add settings such as: * $.views.settings.allowCode(true) -* @param {boolean} value +* @param {boolean} value * @returns {Settings} * * allowCode = $.views.settings.allowCode() @@ -1683,7 +1692,7 @@ function renderContent(data, context, noIteration, parentView, key, onRender) { isTopRenderCall = !view; isRenderCall = isRenderCall || isTopRenderCall; - if (!view) { + if (isTopRenderCall) { (context = context || {}).root = data; // Provide ~root as shortcut to top-level data. } if (!isRenderCall || $subSettingsAdvanced.useViews || tmpl.useViews || view && view !== topView) { @@ -2115,26 +2124,25 @@ function parsedParam(args, props, ctx) { return [args.slice(0, -1), props.slice(0, -1), ctx.slice(0, -1)]; } -function paramStructure(parts, type) { - return '\n\t' - + (type - ? type + ':{' - : '') - + 'args:[' + parts[0] + '],\n\tprops:{' + parts[1] + '}' - + (parts[2] ? ',\n\tctx:{' + parts[2] + '}' : ""); +function paramStructure(paramCode, paramVals) { + return '\n\tparams:{args:[' + paramCode[0] + '],\n\tprops:{' + paramCode[1] + '}' + + (paramCode[2] ? ',\n\tctx:{' + paramCode[2] + '}' : "") + + '},\n\targs:[' + paramVals[0] + '],\n\tprops:{' + paramVals[1] + '}' + + (paramVals[2] ? ',\n\tctx:{' + paramVals[2] + '}' : ""); } function parseParams(params, pathBindings, tmpl, isLinkExpr) { - function parseTokens(all, lftPrn0, lftPrn, bound, path, operator, err, eq, path2, late, prn, comma, lftPrn2, apos, quot, rtPrn, rtPrnDot, prn2, space, index, full) { - // /(\()(?=\s*\()|(?:([([])\s*)?(?:(\^?)(~?[\w$.^]+)?\s*((\+\+|--)|\+|-|~(?![\w$])|&&|\|\||===|!==|==|!=|<=|>=|[<>%*:?\/]|(=))\s*|(!*?(@)?[#~]?[\w$.^]+)([([])?)|(,\s*)|(\(?)\\?(?:(')|("))|(?:\s*(([)\]])(?=[.^]|\s*$|[^([])|[)\]])([([]?))|(\s+)/g, - //lftPrn0 lftPrn bound path operator err eq path2 late prn comma lftPrn2 apos quot rtPrn rtPrnDot prn2 space + function parseTokens(all, lftPrn0, lftPrn, bound, path, operator, err, eq, path2, late, prn, + comma, lftPrn2, apos, quot, rtPrn, rtPrnDot, prn2, space, index, full) { + // /(\()(?=\s*\()|(?:([([])\s*)?(?:(\^?)(~?[\w$.^]+)?\s*((\+\+|--)|\+|-|~(?![\w$])|&&|\|\||===|!==|==|!=|<=|>=|[<>%*:?\/]|(=))\s*|(!*?(@)?[#~]?[\w$.^]+)([([])?)|(,\s*)|(?:(\()\s*)?\\?(?:(')|("))|(?:\s*(([)\]])(?=[.^]|\s*$|[^([])|[)\]])([([]?))|(\s+)/g, + //lftPrn0 lftPrn bound path operator err eq path2 late prn comma lftPrn2 apos quot rtPrn rtPrnDot prn2 space // (left paren? followed by (path? followed by operator) or (path followed by paren?)) or comma or apos or quot or right paren or space function parsePath(allPath, not, object, helper, view, viewProperty, pathTokens, leafToken) { // /^(!*?)(?:null|true|false|\d[\d.]*|([\w$]+|\.|~([\w$]+)|#(view|([\w$]+))?)([\w$.^]*?)(?:[.[^]([\w$]+)\]?)?)$/g, // not object helper view viewProperty pathTokens leafToken - var subPath = object === "."; + subPath = object === "."; if (object) { path = path.slice(not.length); if (/^\.?constructor$/.test(leafToken||path)) { @@ -2179,16 +2187,21 @@ function parseParams(params, pathBindings, tmpl, isLinkExpr) { while (theOb.sb) { theOb = theOb.sb; } - if (theOb.bnd) { - path = "^" + path.slice(1); + if (theOb.prm) { + if (theOb.bnd) { + path = "^" + path.slice(1); + } + theOb.sb = path; + theOb.bnd = theOb.bnd || path[0] === "^"; } - theOb.sb = path; - theOb.bnd = theOb.bnd || path[0] === "^"; } } else { binds.push(path); } - pathStart[parenDepth] = index + (subPath ? 1 : 0); + if (prn && !subPath) { + pathStart[fnDp] = ind; + compiledPathStart[fnDp] = compiledPath[fnDp].length; + } } } return allPath; @@ -2199,6 +2212,7 @@ function parseParams(params, pathBindings, tmpl, isLinkExpr) { path = bound + path; // e.g. some.fn(...)^some.path - so here path is "^some.path" } operator = operator || ""; + lftPrn2 = lftPrn2 || ""; lftPrn = lftPrn || lftPrn0 || lftPrn2; path = path || path2; @@ -2208,127 +2222,196 @@ function parseParams(params, pathBindings, tmpl, isLinkExpr) { // Could do this - but not worth perf cost?? :- // if (!path.lastIndexOf("#data.", 0)) { path = path.slice(6); } // If path starts with "#data.", remove that. prn = prn || prn2 || ""; + var expr, binds, theOb, newOb, subPath, lftPrnFCall, ret, + ind = index; - var expr, exprFn, binds, theOb, newOb, - rtSq = ")"; - - if (prn === "[") { - prn = "[j._sq("; - rtSq = ")]"; - } - - if (err && !aposed && !quoted) { - syntaxError(params); - } else { - if (bindings && rtPrnDot && !aposed && !quoted) { + if (!aposed && !quoted) { + if (err) { + syntaxError(params); + } + if (rtPrnDot && bindings) { // This is a binding to a path in which an object is returned by a helper/data function/expression, e.g. foo()^x.y or (a?b:c)^x.y // We create a compiled function to get the object instance (which will be called when the dependent data of the subexpression changes, to return the new object, and trigger re-binding of the subsequent path) - if (parenDepth) { - expr = pathStart[parenDepth - 1]; - if (full.length - 1 > index - (expr || 0)) { // We need to compile a subexpression - expr = full.slice(expr, index + all.length); - if (exprFn !== true) { // If not reentrant call during compilation - binds = bindto || bndStack[parenDepth-1].bd; - // Insert exprOb object, to be used during binding to return the computed object - theOb = binds[binds.length-1]; - if (theOb && theOb.prm) { - while (theOb.sb && theOb.sb.prm) { - theOb = theOb.sb; - } - newOb = theOb.sb = {path: theOb.sb, bnd: theOb.bnd}; - } else { - binds.push(newOb = {path: binds.pop()}); // Insert exprOb object, to be used during binding to return the computed object - } // (e.g. "some.object()" in "some.object().a.b" - to be used as context for binding the following tokens "a.b") - } - rtPrnDot = delimOpenChar1 + ":" + expr // The parameter or function subexpression - + " onerror=''" // set onerror='' in order to wrap generated code with a try catch - returning '' as object instance if there is an error/missing parent - + delimCloseChar0; - exprFn = tmplLinks[rtPrnDot]; - if (!exprFn) { - tmplLinks[rtPrnDot] = true; // Flag that this exprFn (for rtPrnDot) is being compiled - tmplLinks[rtPrnDot] = exprFn = tmplFn(rtPrnDot, tmpl, true); // Compile the expression (or use cached copy already in tmpl.links) - } - if (exprFn !== true && newOb) { - // If not reentrant call during compilation - newOb._cpfn = exprFn; - newOb.prm = bndCtx.bd; - newOb.bnd = newOb.bnd || newOb.path && newOb.path.indexOf("^") >= 0; + expr = pathStart[fnDp-1]; + if (full.length - 1 > ind - (expr || 0)) { // We need to compile a subexpression + expr = $.trim(full.slice(expr, ind + all.length)); + binds = bindto || bndStack[fnDp-1].bd; + // Insert exprOb object, to be used during binding to return the computed object + theOb = binds[binds.length-1]; + if (theOb && theOb.prm) { + while (theOb.sb && theOb.sb.prm) { + theOb = theOb.sb; } + newOb = theOb.sb = {path: theOb.sb, bnd: theOb.bnd}; + } else { + binds.push(newOb = {path: binds.pop()}); // Insert exprOb object, to be used during binding to return the computed object + } + if (theOb && theOb.sb === newOb) { + compiledPath[fnDp] = compiledPath[fnDp-1].slice(theOb._cpPthSt) + compiledPath[fnDp]; + compiledPath[fnDp-1] = compiledPath[fnDp-1].slice(0, theOb._cpPthSt); } + newOb._cpPthSt = compiledPathStart[fnDp-1]; + newOb._cpKey = expr; + + compiledPath[fnDp] += full.slice(prevIndex, index); + prevIndex = index; + + newOb._cpfn = cpFnStore[expr] = cpFnStore[expr] || // Compiled function for computed value: get from store, or compile and store + new Function("data,view,j", // Compiled function for computed value in template + "//" + expr + "\nvar v;\nreturn ((v=" + compiledPath[fnDp] + (rtPrn === "]" ? ")]" : rtPrn) + ")!=null?v:null);"); + + compiledPath[fnDp-1] += (fnCall[prnDp] && $subSettingsAdvanced.cache ? "view.getCache(\"" + expr.replace(rEscapeQuotes, "\\$&") + "\"" : compiledPath[fnDp]); + + newOb.prm = bndCtx.bd; + newOb.bnd = newOb.bnd || newOb.path && newOb.path.indexOf("^") >= 0; } + compiledPath[fnDp] = ""; + } + if (prn === "[") { + prn = "[j._sq("; + } + if (lftPrn === "[") { + lftPrn = "[j._sq("; } - return (aposed - // within single-quoted string - ? (aposed = !apos, (aposed ? all : lftPrn2 + '"')) - : quoted - // within double-quoted string - ? (quoted = !quot, (quoted ? all : lftPrn2 + '"')) - : - ( - (lftPrn - ? (pathStart[parenDepth] = index++, bndCtx = bndStack[++parenDepth] = {bd: []}, lftPrn) - : "") - + (space - ? (parenDepth - ? "" - // New arg or prop - so insert backspace \b (\x08) as separator for named params, used subsequently by rBuildHash, and prepare new bindings array - : (paramIndex = full.slice(paramIndex, index), named - ? (named = boundName = bindto = false, "\b") - : "\b,") + paramIndex + (paramIndex = index + all.length, bindings && pathBindings.push(bndCtx.bd = []), "\b") - ) - : eq - // named param. Remove bindings for arg and create instead bindings array for prop - ? (parenDepth && syntaxError(params), bindings && pathBindings.pop(), named = "_" + path, boundName = bound, paramIndex = index + all.length, - bindings && ((bindings = bndCtx.bd = pathBindings[named] = []), bindings.skp = !bound), path + ':') - : path - // path - ? (path.split("^").join(".").replace($sub.rPath, parsePath) - + (prn - // some.fncall( - ? (bndCtx = bndStack[++parenDepth] = {bd: []}, fnCall[parenDepth] = rtSq, prn) - : operator) - ) - : operator - // operator - ? operator - : rtPrn - // function - ? ((rtPrn = fnCall[parenDepth] || rtPrn, fnCall[parenDepth] = false, bndCtx = bndStack[--parenDepth], rtPrn) - + (prn // rtPrn and prn, e.g )( in (a)() or a()(), or )[ in a()[] - ? (bndCtx = bndStack[++parenDepth], fnCall[parenDepth] = rtSq, prn) - : "") - ) - : comma - ? (fnCall[parenDepth] || syntaxError(params), ",") // We don't allow top-level literal arrays or objects - : lftPrn0 - ? "" - : (aposed = apos, quoted = quot, '"') - )) - ); } + ret = (aposed + // within single-quoted string + ? (aposed = !apos, (aposed ? all : lftPrn2 + '"')) + : quoted + // within double-quoted string + ? (quoted = !quot, (quoted ? all : lftPrn2 + '"')) + : + ( + (lftPrn + ? ( + prnStack[++prnDp] = true, + prnInd[prnDp] = 0, + bindings && ( + pathStart[fnDp++] = ind++, + bndCtx = bndStack[fnDp] = {bd: []}, + compiledPath[fnDp] = "", + compiledPathStart[fnDp] = 1 + ), + lftPrn) // Left paren, (not a function call paren) + : "") + + (space + ? (prnDp + ? "" // A space within parens or within function call parens, so not a separator for tag args + // New arg or prop - so insert backspace \b (\x08) as separator for named params, used subsequently by rBuildHash, and prepare new bindings array + : (paramIndex = full.slice(paramIndex, ind), named + ? (named = boundName = bindto = false, "\b") + : "\b,") + paramIndex + (paramIndex = ind + all.length, bindings && pathBindings.push(bndCtx.bd = []), "\b") + ) + : eq + // named param. Remove bindings for arg and create instead bindings array for prop + ? (fnDp && syntaxError(params), bindings && pathBindings.pop(), named = "_" + path, boundName = bound, paramIndex = ind + all.length, + bindings && ((bindings = bndCtx.bd = pathBindings[named] = []), bindings.skp = !bound), path + ':') + : path + // path + ? (path.split("^").join(".").replace($sub.rPath, parsePath) + + (prn || operator) + ) + : operator + // operator + ? operator + : rtPrn + // function + ? rtPrn === "]" ? ")]" : ")" + : comma + ? (fnCall[prnDp] || syntaxError(params), ",") // We don't allow top-level literal arrays or objects + : lftPrn0 + ? "" + : (aposed = apos, quoted = quot, '"') + )) + ); + + if (!aposed && !quoted) { + if (rtPrn) { + fnCall[prnDp] = false; + prnDp--; + } + } + + if (bindings) { + if (!aposed && !quoted) { + if (rtPrn) { + if (prnStack[prnDp+1]) { + bndCtx = bndStack[--fnDp]; + prnStack[prnDp+1] = false; + } + prnStart = prnInd[prnDp+1]; + } + if (prn) { + prnInd[prnDp+1] = compiledPath[fnDp].length + (lftPrn ? 1 : 0); + if (path || rtPrn) { + bndCtx = bndStack[++fnDp] = {bd: []}; + prnStack[prnDp+1] = true; + } + } + } + + compiledPath[fnDp] = (compiledPath[fnDp]||"") + full.slice(prevIndex, index); + prevIndex = index+all.length; + + if (!aposed && !quoted) { + if (lftPrnFCall = lftPrn && prnStack[prnDp+1]) { + compiledPath[fnDp-1] += lftPrn; + compiledPathStart[fnDp-1]++; + } + if (prn === "(" && subPath && !newOb) { + compiledPath[fnDp] = compiledPath[fnDp-1].slice(prnStart) + compiledPath[fnDp]; + compiledPath[fnDp-1] = compiledPath[fnDp-1].slice(0, prnStart); + } + } + compiledPath[fnDp] += lftPrnFCall ? ret.slice(1) : ret; + } + + if (!aposed && !quoted && prn) { + prnDp++; + if (path && prn === "(") { + fnCall[prnDp] = true; + } + } + + if (!aposed && !quoted && prn2) { + if (bindings) { + compiledPath[fnDp] += prn; + } + ret += prn; + } + return ret; } - var named, bindto, boundName, + var named, bindto, boundName, result, quoted, // boolean for string content in double quotes aposed, // or in single quotes bindings = pathBindings && pathBindings[0], // bindings array for the first arg bndCtx = {bd: bindings}, bndStack = {0: bndCtx}, paramIndex = 0, // list, - tmplLinks = (tmpl ? tmpl.links : bindings && (bindings.links = bindings.links || {})) || topView.tmpl.links, // The following are used for tracking path parsing including nested paths, such as "a.b(c^d + (e))^f", and chained computed paths such as // "a.b().c^d().e.f().g" - which has four chained paths, "a.b()", "^c.d()", ".e.f()" and ".g" - parenDepth = 0, - fnCall = {}, // We are in a function call - pathStart = {}, // tracks the start of the current path such as c^d() in the above example - result; + prnDp = 0, // For tracking paren depth (not function call parens) + fnDp = 0, // For tracking depth of function call parens + prnInd = {}, // We are in a function call + prnStart = 0, // tracks the start of the current path such as c^d() in the above example + prnStack = {}, // tracks parens which are not function calls, and so are associated with new bndStack contexts + fnCall = {}, // We are in a function call + pathStart = {},// tracks the start of the current path such as c^d() in the above example + compiledPathStart = {0: 0}, + compiledPath = {0:""}, + prevIndex = 0; if (params[0] === "@") { params = params.replace(rBracketQuote, "."); } result = (params + (tmpl ? " " : "")).replace($sub.rPrm, parseTokens); - return !parenDepth && result || syntaxError(params); // Syntax error if unbalanced parens in params expression + if (bindings) { + result = compiledPath[0]; + } + + return !prnDp && result || syntaxError(params); // Syntax error if unbalanced parens in params expression } function buildCode(ast, tmpl, isLinkExpr) { @@ -2364,7 +2447,7 @@ function buildCode(ast, tmpl, isLinkExpr) { // Add newline for each callout to t() c() etc. and each markup string if ("" + node === node) { // a markup string to be inserted - code += '\n+"' + node + '"'; + code += '+"' + node + '"'; } else { // a compiled tag expression to be inserted tagName = node[0]; @@ -2374,7 +2457,7 @@ function buildCode(ast, tmpl, isLinkExpr) { } else { converter = node[1]; content = !isLinkExpr && node[2]; - tagCtx = paramStructure(node[3], 'params') + '},' + paramStructure(params = node[4]); + tagCtx = paramStructure(node[3], params = node[4]); trigger = node[6]; lateRender = node[7]; if (node[8]) { // latePath @a.b.c or @~a.b.c @@ -2433,7 +2516,7 @@ function buildCode(ast, tmpl, isLinkExpr) { if (isGetVal && (pathBindings || trigger || converter && converter !== HTML || lateRender)) { // For convertVal we need a compiled function to return the new tagCtx(s) - tagCtxFn = new Function("data,view,j,u", "// " + tmplName + " " + (++tmplBindingKey) + " " + tagName + tagCtxFn = new Function("data,view,j", "// " + tmplName + " " + (++tmplBindingKey) + " " + tagName + retStrOpen + "{" + tagCtx + "};" + retStrClose); tagCtxFn._er = onError; tagCtxFn._tag = tagName; @@ -2471,7 +2554,7 @@ function buildCode(ast, tmpl, isLinkExpr) { tagRender = 't("' + tagAndElses + '",view,this,'; if (isLinkExpr || pathBindings) { // This is a bound tag (data-link expression or inline bound tag {^{tag ...}}) so we store a compiled tagCtxs function in tmp.bnds - code = new Function("data,view,j,u", " // " + tmplName + " " + tmplBindingKey + " " + tagAndElses + retStrOpen + code + code = new Function("data,view,j", " // " + tmplName + " " + tmplBindingKey + " " + tagAndElses + retStrOpen + code + retStrClose); code._er = onError; code._tag = tagAndElses; @@ -2495,7 +2578,7 @@ function buildCode(ast, tmpl, isLinkExpr) { } if (onError && !nextIsElse) { useViews = true; - code += ';\n}catch(e){ret' + (isLinkExpr ? "urn " : "+=") + boundOnErrStart + 'j._err(e,view,' + onError + ')' + boundOnErrEnd + ';}' + (isLinkExpr ? "" : 'ret=ret'); + code += ';\n}catch(e){ret' + (isLinkExpr ? "urn " : "+=") + boundOnErrStart + 'j._err(e,view,' + onError + ')' + boundOnErrEnd + ';}' + (isLinkExpr ? "" : '\nret=ret'); } } } @@ -2508,7 +2591,7 @@ function buildCode(ast, tmpl, isLinkExpr) { + (hasCnvt ? ",c=j._cnvt" : "") // converter + (hasEncoder ? ",h=j._html" : "") // html converter + (isLinkExpr - ? (node[8] // late @... path? + ? (node[8] // late @... path? ? ", ob" : "" ) + ";\n" @@ -2517,7 +2600,7 @@ function buildCode(ast, tmpl, isLinkExpr) { + (isLinkExpr ? "\n" : ";\nreturn ret;"); try { - code = new Function("data,view,j,u", code); + code = new Function("data,view,j", code); } catch (e) { syntaxError("Compiled template code:\n\n" + code + '\n: "' + (e.message||e) + '"'); } @@ -2624,7 +2707,7 @@ function getTargetSorted(value, tagCtx) { } } - start = props.start; // Get current value - after possible changes triggered by tag.sorted refresh() above + start = props.start; // Get current value - after possible changes triggered by tag.sorted refresh() above end = props.end; if (propParams.start && start === undefined || propParams.end && end === undefined) { start = end = 0; @@ -2699,7 +2782,7 @@ $sub = $views.sub; $viewsSettings = $views.settings; if (!(jsr || $ && $.render)) { - // JsRender not already loaded, or loaded without jQuery, and we are now moving from jsrender namespace to jQuery namepace + // JsRender/JsViews not already loaded (or loaded without jQuery, and we are now moving from jsrender namespace to jQuery namepace) for (jsvStoreName in jsvStores) { registerStore(jsvStoreName, jsvStores[jsvStoreName]); } @@ -2728,7 +2811,7 @@ if (!(jsr || $ && $.render)) { if ($.observable) { if (versionNumber !== (versionNumber = $.views.jsviews)) { // Different version of jsRender was loaded - throw "JsObservable requires JsRender " + versionNumber; + throw "jquery.observable.js requires jsrender.js " + versionNumber; } $extend($sub, $.views.sub); // jquery.observable.js was loaded before jsrender.js $views.map = $.views.map; @@ -2782,7 +2865,7 @@ if (!(jsr || $ && $.render)) { /** * $.views.settings.debugMode(true) - * @param {boolean} debugMode + * @param {boolean} debugMode * @returns {Settings} * * debugMode = $.views.settings.debugMode() @@ -2792,6 +2875,7 @@ if (!(jsr || $ && $.render)) { return debugMode === undefined ? $subSettings.debugMode : ( + $subSettings._clFns && $subSettings._clFns(), // Clear linkExprStore (cached compiled expressions), since debugMode setting affects compilation for expressions $subSettings.debugMode = debugMode, $subSettings.onError = debugMode + "" === debugMode ? function() { return debugMode; } @@ -2802,6 +2886,7 @@ if (!(jsr || $ && $.render)) { })(false); // jshint ignore:line $subSettingsAdvanced = $subSettings.advanced = { + cache: true, // By default use cached values of computed values (Otherwise, set advanced cache setting to false) useViews: false, _jsv: false // For global access to JsViews store }; @@ -2840,7 +2925,7 @@ if (!(jsr || $ && $.render)) { tagCtx = self.tagCtx, range = tagCtx.argDefault === false, props = tagCtx.props, - iterate = range || tagCtx.args.length, // Not final else and not auto-create range + iterate = range || tagCtx.args.length, // Not final else and not auto-create range result = "", done = 0; diff --git a/jsrender.min.js b/jsrender.min.js index f2d596d..b4bc5ac 100644 --- a/jsrender.min.js +++ b/jsrender.min.js @@ -1,4 +1,4 @@ -/*! JsRender v1.0.6: http://jsviews.com/#jsrender */ +/*! JsRender v1.0.7: http://jsviews.com/#jsrender */ /*! **VERSION FOR WEB** (For NODE.JS see http://jsviews.com/download/jsrender-node.js) */ -!function(t,e){var n=e.jQuery;"object"==typeof exports?module.exports=n?t(e,n):function(n){if(n&&!n.fn)throw"Provide jQuery or null";return t(e,n)}:"function"==typeof define&&define.amd?define(function(){return t(e)}):t(e,!1)}(function(t,e){"use strict";function n(t,e){return function(){var n,r=this,i=r.base;return r.base=t,n=e.apply(r,arguments),r.base=i,n}}function r(t,e){return st(e)&&(e=n(t?t._d?t:n(a,t):a,e),e._d=(t&&t._d||0)+1),e}function i(t,e){var n,i=e.props;for(n in i)!$t.test(n)||t[n]&&t[n].fix||(t[n]="convert"!==n?r(t.constructor.prototype[n],i[n]):i[n])}function o(t){return t}function a(){return""}function s(t){try{throw console.log("JsRender dbg breakpoint: "+t),"dbg breakpoint"}catch(e){}return this.base?this.baseApply(arguments):t}function l(t){this.name=(e.link?"JsViews":"JsRender")+" Error",this.message=t||this.name}function d(t,e){if(t){for(var n in e)t[n]=e[n];return t}}function p(t,e,n){return t?lt(t)?p.apply(ot,t):(wt=n?n[0]:wt,/^(\W|_){5}$/.test(t+e+wt)||S("Invalid delimiters"),ht=t[0],_t=t[1],xt=e[0],bt=e[1],gt.delimiters=[ht+_t,xt+bt,wt],t="\\"+ht+"(\\"+wt+")?\\"+_t,e="\\"+xt+"\\"+bt,rt="(?:(\\w+(?=[\\/\\s\\"+xt+"]))|(\\w+)?(:)|(>)|(\\*))\\s*((?:[^\\"+xt+"]|\\"+xt+"(?!\\"+bt+"))*?)",ft.rTag="(?:"+rt+")",rt=new RegExp("(?:"+t+rt+"(\\/)?|\\"+ht+"(\\"+wt+")?\\"+_t+"(?:(?:\\/(\\w+))\\s*|!--[\\s\\S]*?--))"+e,"g"),ft.rTmpl=new RegExp("^\\s|\\s$|<.*>|([^\\\\]|^)[{}]|"+t+".*"+e),mt):gt.delimiters}function u(t,e){e||t===!0||(e=t,t=void 0);var n,r,i,o,a=this,s="root"===e;if(t){if(o=e&&a.type===e&&a,!o)if(n=a.views,a._.useKey){for(r in n)if(o=e?n[r].get(t,e):n[r])break}else for(r=0,i=n.length;!o&&r1,v=f.ctx;if(n){if(f._||(p=f.index,f=f.tag),u=f,v&&v.hasOwnProperty(n)||(v=ut).hasOwnProperty(n)){if(s=v[n],"tag"===n||"tagCtx"===n||"root"===n||"parentTags"===n)return s}else v=void 0;if((!kt&&f.tagCtx||f.linked)&&(s&&s._cxp||(f=f.tagCtx||st(s)?f:(f=f.scope||f,!f.isTop&&f.ctx.tag||f),void 0!==s&&f.tagCtx&&(f=f.tagCtx.view.scope),v=f._ocps,s=v&&v.hasOwnProperty(n)&&v[n]||s,s&&s._cxp||!i&&!g||((v||(f._ocps=f._ocps||{}))[n]=s=[{_ocp:s,_vw:u,_key:n}],s._cxp={path:Tt,ind:0,updateValue:function(t,n){return e.observable(s[0]).setProperty(Tt,t),this}})),l=s&&s._cxp)){if(arguments.length>2)return a=s[1]?ft._ceo(s[1].deps):[Tt],a.unshift(s[0]),a._cxp=l,a;if(p=l.tagElse,c=s[1]?l.tag&&l.tag.cvtArgs?l.tag.cvtArgs(p,1)[l.ind]:s[1](s[0].data,s[0],ft):s[0]._ocp,g)return ft._ucp(n,r,f,l),f;s=c}return s&&st(s)&&(o=function(){return s.apply(this&&this!==t?this:u,arguments)},d(o,s)),o||s}}function m(t){return t&&(t.fn?t:this.getRsc("templates",t)||dt(t))}function h(t,e,n,r){var o,a,s,l,p,u="number"==typeof n&&e.tmpl.bnds[n-1];if(void 0===r&&u&&u._lr&&(r=""),void 0!==r?n=r={props:{},args:[r]}:u&&(n=u(e.data,e,ft)),u=u._bd&&u,t||u){if(a=e._lc,o=a&&a.tag,n.view=e,!o){if(o=d(new ft._tg,{_:{bnd:u,unlinked:!0,lt:n.lt},inline:!a,tagName:":",convert:t,onArrayChange:!0,flow:!0,tagCtx:n,tagCtxs:[n],_is:"tag"}),l=n.args.length,l>1)for(p=o.bindTo=[];l--;)p.unshift(l);a&&(a.tag=o,o.linkCtx=a),n.ctx=Q(n.ctx,(a?a.view:e).ctx),i(o,n)}o._er=r&&s,o.ctx=n.ctx||o.ctx||{},n.ctx=void 0,s=o.cvtArgs()[0],o._er=r&&s}else s=n.args[0];return s=u&&e._.onRender?e._.onRender(s,e,o):s,void 0!=s?s:""}function _(t,e){var n,r,i,o,a,s,l,d=this;if(d.tagName){if(s=d,d=(s.tagCtxs||[d])[t||0],!d)return}else s=d.tag;if(a=s.bindFrom,o=d.args,(l=s.convert)&&""+l===l&&(l="true"===l?void 0:d.view.getRsc("converters",l)||S("Unknown converter: '"+l+"'")),l&&!e&&(o=o.slice()),a){for(i=[],n=a.length;n--;)r=a[n],i.unshift(x(d,r));e&&(o=i)}if(l){if(l=l.apply(s,i||o),void 0===l)return o;if(a=a||[0],n=a.length,lt(l)&&l.length===n||(l=[l],a=[0],n=1),e)o=l;else for(;n--;)r=a[n],+r===r&&(o[r]=l[n])}return o}function x(t,e){return t=t[+e===e?"args":"props"],t&&t[e]}function b(t){return this.cvtArgs(t,1)}function w(t,e){var n,r,i=this;if(""+e===e){for(;void 0===n&&i;)r=i.tmpl&&i.tmpl[t],n=r&&r[e],i=i.parent;return n||ot[t][e]}}function y(t,e,n,r,o,a){function s(t){var e=l[t];if(void 0!==e)for(e=lt(e)?e:[e],m=e.length;m--;)J=e[m],isNaN(parseInt(J))||(e[m]=parseInt(J));return e||[0]}e=e||it;var l,d,p,u,c,f,g,m,h,w,y,k,C,T,j,A,P,R,N,M,F,V,$,I,D,J,U,q,K,L,B=0,H="",W=e._lc||!1,Z=e.ctx,z=n||e.tmpl,G="number"==typeof r&&e.tmpl.bnds[r-1];for("tag"===t._is?(l=t,t=l.tagName,r=l.tagCtxs,p=l.template):(d=e.getRsc("tags",t)||S("Unknown tag: {{"+t+"}} "),p=d.template),void 0===a&&G&&(G._lr=d.lateRender&&G._lr!==!1||G._lr)&&(a=""),void 0!==a?(H+=a,r=a=[{props:{},args:[],params:{props:{}}}]):G&&(r=G(e.data,e,ft)),g=r.length;B0&&(a=n)){if(!a)if(/^\.\/[^\\:*?"<>]*$/.test(n))(s=dt[t=t||n])?n=s:a=document.getElementById(n);else if(e.fn&&!ft.rTmpl.test(n))try{a=e(n,document)[0]}catch(l){}a&&("SCRIPT"!==a.tagName&&S(n+": Use script block, not "+a.tagName),i?n=a.innerHTML:(o=a.getAttribute(Bt),o&&(o!==Qt?(n=dt[o],delete dt[o]):e.fn&&(n=e.data(a)[Qt])),o&&n||(t=t||(e.fn?Qt:n),n=A(t,a.innerHTML,r,i)),n.tmplName=t=t||o,t!==Qt&&(dt[t]=n),a.setAttribute(Bt,t),e.fn&&e.data(a,Qt,n))),a=void 0}else n.fn||(n=void 0);return n}var a,s,l=n=n||"";if(ft._html=pt.html,0===i&&(i=void 0,l=o(l)),i=i||(n.markup?n.bnds?d({},n):n:{}),i.tmplName=i.tmplName||t||"unnamed",r&&(i._parentTmpl=r),!l&&n.markup&&(l=o(n.markup))&&l.fn&&(l=l.markup),void 0!==l)return l.render||n.render?l.tmpls&&(s=l):(n=M(l,i),J(l.replace(Pt,"\\$&"),n)),s||(s=d(function(){return s.render.apply(s,arguments)},n),C(s)),s}function P(t,e){return st(t)?t.call(e):t}function R(t,e,n){Object.defineProperty(t,e,{value:n,configurable:!0})}function N(t,n){function r(t){p.apply(this,t)}function i(){return new r(arguments)}function o(t,e){for(var n,r,i,o,a,s=0;sO-(U||0))){if(U=I.slice(U,O+i.length),q!==!0)if(K=a||f[m-1].bd,L=K[K.length-1],L&&L.prm){for(;L.sb&&L.sb.prm;)L=L.sb;B=L.sb={path:L.sb,bnd:L.bnd}}else K.push(B={path:K.pop()});V=_t+":"+U+" onerror=''"+xt,q=v[V],q||(v[V]=!0,v[V]=q=J(V,n,!0)),q!==!0&&B&&(B._cpfn=q,B.prm=c.bd,B.bnd=B.bnd||B.path&&B.path.indexOf("^")>=0)}return d?(d=!N,d?i:R+'"'):l?(l=!M,l?i:R+'"'):(x?(_[m]=O++,c=f[++m]={bd:[]},x):"")+(E?m?"":(g=I.slice(g,O),(o?(o=s=a=!1,"\b"):"\b,")+g+(g=O+i.length,u&&e.push(c.bd=[]),"\b")):C?(m&&D(t),u&&e.pop(),o="_"+w,s=b,g=O+i.length,u&&(u=c.bd=e[o]=[],u.skp=!b),w+":"):w?w.split("^").join(".").replace(ft.rPath,S)+(A?(c=f[++m]={bd:[]},h[m]=Q,A):y):y?y:F?(F=h[m]||F,h[m]=!1,c=f[--m],F+(A?(c=f[++m],h[m]=Q,A):"")):P?(h[m]||D(t),","):p?"":(d=N,l=M,'"'))}D(t)}var o,a,s,l,d,p,u=e&&e[0],c={bd:u},f={0:c},g=0,v=(n?n.links:u&&(u.links=u.links||{}))||it.tmpl.links,m=0,h={},_={};return"@"===t[0]&&(t=t.replace(Dt,".")),p=(t+(n?" ":"")).replace(ft.rPrm,i),!m&&p||D(t)}function B(t,e,n){var r,i,o,a,s,l,d,p,u,c,f,g,v,m,h,_,x,b,w,y,k,C,T,j,A,P,R,N,F,V,$,E,O,I=0,S=vt.useViews||e.useViews||e.tags||e.templates||e.helpers||e.converters,J="",q={},L=t.length;for(""+e===e?(b=n?'data-link="'+e.replace(jt," ").slice(1,-1)+'"':e,e=0):(b=e.tmplName||"unnamed",e.allowCode&&(q.allowCode=!0),e.debug&&(q.debug=!0),f=e.bnds,x=e.tmpls),r=0;r":a+o):(k&&(w=M(C,q),w.tmplName=b+"/"+o,w.useViews=w.useViews||S,B(k,w),S=w.useViews,x.push(w)),A||(y=o,S=S||o&&(!ct[o]||!ct[o].flow),j=J,J=""),T=t[r+1],T=T&&"else"===T[0]),F=N?";\ntry{\nret+=":"\n+",m="",h="",P&&(g||V||a&&a!==Kt||$)){if(R=new Function("data,view,j,u","// "+b+" "+ ++I+" "+o+E+"{"+s+"};"+O),R._er=N,R._tag=o,R._bd=!!g,R._lr=$,n)return R;U(R,g),_='c("'+a+'",view,',c=!0,m=_+I+",",h=")"}if(J+=P?(n?(N?"try{\n":"")+"return ":F)+(c?(c=void 0,S=u=!0,_+(R?(f[I-1]=R,I):"{"+s+"}")+")"):">"===o?(d=!0,"h("+v[0]+")"):(p=!0,"((v="+v[0]+")!=null?v:"+(n?"null)":'"")'))):(l=!0,"\n{view:view,content:false,tmpl:"+(k?x.length:"false")+","+s+"},"),y&&!T){if(J="["+J.slice(0,-1)+"]",_='t("'+y+'",view,this,',n||g){if(J=new Function("data,view,j,u"," // "+b+" "+I+" "+y+E+J+O),J._er=N,J._tag=y,g&&U(f[I-1]=J,g),J._lr=$,n)return J;m=_+I+",undefined,",h=")"}J=j+F+_+(g&&I||J)+")",g=0,y=0}N&&!T&&(S=!0,J+=";\n}catch(e){ret"+(n?"urn ":"+=")+m+"j._err(e,view,"+N+")"+h+";}"+(n?"":"ret=ret"))}J="// "+b+(q.debug?"\ndebugger;":"")+"\nvar v"+(l?",t=j._tag":"")+(u?",c=j._cnvt":"")+(d?",h=j._html":"")+(n?(i[8]?", ob":"")+";\n":',ret=""')+J+(n?"\n":";\nreturn ret;");try{J=new Function("data,view,j,u",J)}catch(Q){D("Compiled template code:\n\n"+J+'\n: "'+(Q.message||Q)+'"')}return e&&(e.fn=J,e.useViews=!!S),J}function Q(t,e){return t&&t!==e?e?d(d({},e),t):t:e&&d({},e)}function H(t,n){var r,i,o=n.map,a=o&&o.propsArr;if(!a){if(a=[],typeof t===Lt||st(t))for(r in t)i=t[r],r===at||!t.hasOwnProperty(r)||n.props.noFunctions&&e.isFunction(i)||a.push({key:r,prop:i});o&&(o.propsArr=o.options&&a)}return W(a,n)}function W(t,n){var r,i,o,a=n.tag,s=n.props,l=n.params.props,d=s.filter,p=s.sort,u=p===!0,c=parseInt(s.step),f=s.reverse?-1:1;if(!lt(t))return t;if(u||p&&""+p===p?(r=t.map(function(t,e){return t=u?t:g(t,p),{i:e,v:""+t===t?t.toLowerCase():t}}),r.sort(function(t,e){return t.v>e.v?f:t.vt.length?t.length:+o,t=t.slice(i,o)),c>1){for(i=0,o=t.length,r=[];i\s]/,Ft=/[\x00`><"'&=]/g,Vt=/[\x00`><\"'&=]/,$t=/^on[A-Z]|^convert(Back)?$/,Et=/^\#\d+_`[\s\S]*\/\d+_`$/,Ot=Ft,It=/[&<>]/g,St=/&(amp|gt|lt);/g,Dt=/\[['"]?|['"]?\]/g,Jt=0,Ut={"&":"&","<":"<",">":">","\0":"�","'":"'",'"':""","`":"`","=":"="},qt={amp:"&",gt:">",lt:"<"},Kt="html",Lt="object",Bt="data-jsv-tmpl",Qt="jsvTmpl",Ht="For #index in nested block use #getIndex().",Wt={},Zt=t.jsrender,zt=Zt&&e&&!e.render,Gt={template:{compile:A},tag:{compile:T},viewModel:{compile:N},helper:{},converter:{}};if(ot={jsviews:Ct,sub:{rPath:/^(!*?)(?:null|true|false|\d[\d.]*|([\w$]+|\.|~([\w$]+)|#(view|([\w$]+))?)([\w$.^]*?)(?:[.[^]([\w$]+)\]?)?)$/g,rPrm:/(\()(?=\s*\()|(?:([([])\s*)?(?:(\^?)(~?[\w$.^]+)?\s*((\+\+|--)|\+|-|~(?![\w$])|&&|\|\||===|!==|==|!=|<=|>=|[<>%*:?\/]|(=))\s*|(!*?(@)?[#~]?[\w$.^]+)([([])?)|(,\s*)|(\(?)\\?(?:(')|("))|(?:\s*(([)\]])(?=[.^]|\s*$|[^([])|[)\]])([([]?))|(\s+)/g,View:k,Err:l,tmplFn:J,parse:L,extend:d,extendCtx:Q,syntaxErr:D,onStore:{template:function(t,e){null===e?delete Wt[t]:t&&(Wt[t]=e)}},addSetting:V,settings:{allowCode:!1},advSet:a,_thp:i,_gm:r,_tg:function(){},_cnvt:h,_tag:y,_er:S,_err:I,_cp:o,_sq:function(t){return"constructor"===t&&D(""),t}},settings:{delimiters:p,advanced:function(t){return t?(d(vt,t),ft.advSet(),mt):vt}},map:$},(l.prototype=new Error).constructor=l,c.depends=function(){return[this.get("item"),"index"]},f.depends="index",k.prototype={get:u,getIndex:f,ctxPrm:v,getRsc:w,_getTmpl:m,_getOb:g,_is:"view"},ft=ot.sub,mt=ot.settings,!(Zt||e&&e.render)){for(nt in Gt)F(nt,Gt[nt]);if(pt=ot.converters,ut=ot.helpers,ct=ot.tags,ft._tg.prototype={baseApply:j,cvtArgs:_,bndArgs:b,ctxPrm:v},it=ft.topView=new k,e){if(e.fn.render=Z,at=e.expando,e.observable){if(Ct!==(Ct=e.views.jsviews))throw"JsObservable requires JsRender "+Ct;d(ft,e.views.sub),ot.map=e.views.map}}else e={},et&&(t.jsrender=e),e.renderFile=e.__express=e.compile=function(){throw"Node.js: use npm jsrender, or jsrender-node.js"},e.isFunction=function(t){return"function"==typeof t},e.isArray=Array.isArray||function(t){return"[object Array]"==={}.toString.call(t)},ft._jq=function(t){t!==e&&(d(t,e),e=t,e.fn.render=Z,delete e.jsrender,at=e.expando)},e.jsrender=Ct;gt=ft.settings,gt.allowCode=!1,st=e.isFunction,e.render=Wt,e.views=ot,e.templates=dt=ot.templates;for(yt in gt)V(yt);(mt.debugMode=function(t){return void 0===t?gt.debugMode:(gt.debugMode=t,gt.onError=t+""===t?function(){return t}:st(t)?t:void 0,mt)})(!1),vt=gt.advanced={useViews:!1,_jsv:!1},ct({"if":{render:function(t){var e=this,n=e.tagCtx,r=e.rendering.done||!t&&(n.args.length||!n.index)?"":(e.rendering.done=!0,void(e.selected=n.index));return r},contentCtx:!0,flow:!0},"for":{sortDataMap:$(W),init:function(t,e){this.setDataMap(this.tagCtxs)},render:function(t){var e,n,r,i,o,a=this,s=a.tagCtx,l=s.argDefault===!1,d=s.props,p=l||s.args.length,u="",c=0;if(!a.rendering.done){if(e=p?t:s.view.data,l)for(l=d.reverse?"unshift":"push",i=+d.end,o=+d.step||1,e=[],r=+d.start||0;(i-r)*o>0;r+=o)e[l](r);void 0!==e&&(n=lt(e),u+=s.render(e,!p||d.noIteration),c+=n?e.length:1),(a.rendering.done=c)&&(a.selected=s.index)}return u},setDataMap:function(t){for(var e,n,r,i=this,o=t.length;o--;)e=t[o],n=e.props,r=e.params.props,e.argDefault=void 0===n.end||e.args.length>0,n.dataMap=e.argDefault!==!1&<(e.args[0])&&(r.sort||r.start||r.end||r.step||r.filter||r.reverse||n.sort||n.start||n.end||n.step||n.filter||n.reverse)&&i.sortDataMap},flow:!0},props:{baseTag:"for",dataMap:$(H),init:a,flow:!0},include:{flow:!0},"*":{render:o,flow:!0},":*":{render:o,flow:!0},dbg:ut.dbg=pt.dbg=s}),pt({html:X,attr:X,encode:Y,unencode:tt,url:function(t){return void 0!=t?encodeURI(""+t):null===t?t:""}})}return gt=ft.settings,lt=(e||Zt).isArray,mt.delimiters("{{","}}","^"),zt&&Zt.views.sub._jq(e),e||Zt},window); +!function(t,e){var n=e.jQuery;"object"==typeof exports?module.exports=n?t(e,n):function(n){if(n&&!n.fn)throw"Provide jQuery or null";return t(e,n)}:"function"==typeof define&&define.amd?define(function(){return t(e)}):t(e,!1)}(function(t,e){"use strict";function n(t,e){return function(){var n,r=this,i=r.base;return r.base=t,n=e.apply(r,arguments),r.base=i,n}}function r(t,e){return st(e)&&(e=n(t?t._d?t:n(a,t):a,e),e._d=(t&&t._d||0)+1),e}function i(t,e){var n,i=e.props;for(n in i)!Vt.test(n)||t[n]&&t[n].fix||(t[n]="convert"!==n?r(t.constructor.prototype[n],i[n]):i[n])}function o(t){return t}function a(){return""}function s(t){try{throw console.log("JsRender dbg breakpoint: "+t),"dbg breakpoint"}catch(e){}return this.base?this.baseApply(arguments):t}function l(t){this.name=(e.link?"JsViews":"JsRender")+" Error",this.message=t||this.name}function d(t,e){if(t){for(var n in e)t[n]=e[n];return t}}function c(t,e,n){return t?lt(t)?c.apply(ot,t):(wt=n?n[0]:wt,/^(\W|_){5}$/.test(t+e+wt)||S("Invalid delimiters"),mt=t[0],_t=t[1],xt=e[0],bt=e[1],gt.delimiters=[mt+_t,xt+bt,wt],t="\\"+mt+"(\\"+wt+")?\\"+_t,e="\\"+xt+"\\"+bt,rt="(?:(\\w+(?=[\\/\\s\\"+xt+"]))|(\\w+)?(:)|(>)|(\\*))\\s*((?:[^\\"+xt+"]|\\"+xt+"(?!\\"+bt+"))*?)",ft.rTag="(?:"+rt+")",rt=new RegExp("(?:"+t+rt+"(\\/)?|\\"+mt+"(\\"+wt+")?\\"+_t+"(?:(?:\\/(\\w+))\\s*|!--[\\s\\S]*?--))"+e,"g"),ft.rTmpl=new RegExp("^\\s|\\s$|<.*>|([^\\\\]|^)[{}]|"+t+".*"+e),ht):gt.delimiters}function p(t,e){e||t===!0||(e=t,t=void 0);var n,r,i,o,a=this,s="root"===e;if(t){if(o=e&&a.type===e&&a,!o)if(n=a.views,a._.useKey){for(r in n)if(o=e?n[r].get(t,e):n[r])break}else for(r=0,i=n.length;!o&&r1,v=f.ctx;if(n){if(f._||(c=f.index,f=f.tag),p=f,v&&v.hasOwnProperty(n)||(v=pt).hasOwnProperty(n)){if(s=v[n],"tag"===n||"tagCtx"===n||"root"===n||"parentTags"===n)return s}else v=void 0;if((!Ct&&f.tagCtx||f.linked)&&(s&&s._cxp||(f=f.tagCtx||st(s)?f:(f=f.scope||f,!f.isTop&&f.ctx.tag||f),void 0!==s&&f.tagCtx&&(f=f.tagCtx.view.scope),v=f._ocps,s=v&&v.hasOwnProperty(n)&&v[n]||s,s&&s._cxp||!i&&!g||((v||(f._ocps=f._ocps||{}))[n]=s=[{_ocp:s,_vw:p,_key:n}],s._cxp={path:jt,ind:0,updateValue:function(t,n){return e.observable(s[0]).setProperty(jt,t),this}})),l=s&&s._cxp)){if(arguments.length>2)return a=s[1]?ft._ceo(s[1].deps):[jt],a.unshift(s[0]),a._cxp=l,a;if(c=l.tagElse,u=s[1]?l.tag&&l.tag.cvtArgs?l.tag.cvtArgs(c,1)[l.ind]:s[1](s[0].data,s[0],ft):s[0]._ocp,g)return ft._ucp(n,r,f,l),f;s=u}return s&&st(s)&&(o=function(){return s.apply(this&&this!==t?this:p,arguments)},d(o,s)),o||s}}function h(t){return t&&(t.fn?t:this.getRsc("templates",t)||dt(t))}function m(t,e,n,r){var o,a,s,l,c,p="number"==typeof n&&e.tmpl.bnds[n-1];if(void 0===r&&p&&p._lr&&(r=""),void 0!==r?n=r={props:{},args:[r]}:p&&(n=p(e.data,e,ft)),p=p._bd&&p,t||p){if(a=e._lc,o=a&&a.tag,n.view=e,!o){if(o=d(new ft._tg,{_:{bnd:p,unlinked:!0,lt:n.lt},inline:!a,tagName:":",convert:t,onArrayChange:!0,flow:!0,tagCtx:n,tagCtxs:[n],_is:"tag"}),l=n.args.length,l>1)for(c=o.bindTo=[];l--;)c.unshift(l);a&&(a.tag=o,o.linkCtx=a),n.ctx=Q(n.ctx,(a?a.view:e).ctx),i(o,n)}o._er=r&&s,o.ctx=n.ctx||o.ctx||{},n.ctx=void 0,s=o.cvtArgs()[0],o._er=r&&s}else s=n.args[0];return s=p&&e._.onRender?e._.onRender(s,e,o):s,void 0!=s?s:""}function _(t,e){var n,r,i,o,a,s,l,d=this;if(d.tagName){if(s=d,d=(s.tagCtxs||[d])[t||0],!d)return}else s=d.tag;if(a=s.bindFrom,o=d.args,(l=s.convert)&&""+l===l&&(l="true"===l?void 0:d.view.getRsc("converters",l)||S("Unknown converter: '"+l+"'")),l&&!e&&(o=o.slice()),a){for(i=[],n=a.length;n--;)r=a[n],i.unshift(x(d,r));e&&(o=i)}if(l){if(l=l.apply(s,i||o),void 0===l)return o;if(a=a||[0],n=a.length,lt(l)&&l.length===n||(l=[l],a=[0],n=1),e)o=l;else for(;n--;)r=a[n],+r===r&&(o[r]=l[n])}return o}function x(t,e){return t=t[+e===e?"args":"props"],t&&t[e]}function b(t){return this.cvtArgs(t,1)}function w(t,e){var n,r,i=this;if(""+e===e){for(;void 0===n&&i;)r=i.tmpl&&i.tmpl[t],n=r&&r[e],i=i.parent;return n||ot[t][e]}}function y(t,e,n,r,o,a){function s(t){var e=l[t];if(void 0!==e)for(e=lt(e)?e:[e],h=e.length;h--;)q=e[h],isNaN(parseInt(q))||(e[h]=parseInt(q));return e||[0]}e=e||it;var l,d,c,p,u,f,g,h,m,w,y,C,k,j,T,A,P,F,N,R,M,$,V,I,D,q,U,K,J,L,B=0,H="",W=e._lc||!1,Z=e.ctx,z=n||e.tmpl,G="number"==typeof r&&e.tmpl.bnds[r-1];for("tag"===t._is?(l=t,t=l.tagName,r=l.tagCtxs,c=l.template):(d=e.getRsc("tags",t)||S("Unknown tag: {{"+t+"}} "),c=d.template),void 0===a&&G&&(G._lr=d.lateRender&&G._lr!==!1||G._lr)&&(a=""),void 0!==a?(H+=a,r=a=[{props:{},args:[],params:{props:{}}}]):G&&(r=G(e.data,e,ft)),g=r.length;B0&&(a=n)){if(!a)if(/^\.?\/[^\\:*?"<>]*$/.test(n))(s=dt[t=t||n])?n=s:a=document.getElementById(n);else if(e.fn&&!ft.rTmpl.test(n))try{a=e(n,document)[0]}catch(l){}a&&("SCRIPT"!==a.tagName&&S(n+": Use script block, not "+a.tagName),i?n=a.innerHTML:(o=a.getAttribute(Bt),o&&(o!==Qt?(n=dt[o],delete dt[o]):e.fn&&(n=e.data(a)[Qt])),o&&n||(t=t||(e.fn?Qt:n),n=A(t,a.innerHTML,r,i)),n.tmplName=t=t||o,t!==Qt&&(dt[t]=n),a.setAttribute(Bt,t),e.fn&&e.data(a,Qt,n))),a=void 0}else n.fn||(n=void 0);return n}var a,s,l=n=n||"";if(ft._html=ct.html,0===i&&(i=void 0,l=o(l)),i=i||(n.markup?n.bnds?d({},n):n:{}),i.tmplName=i.tmplName||t||"unnamed",r&&(i._parentTmpl=r),!l&&n.markup&&(l=o(n.markup))&&l.fn&&(l=l.markup),void 0!==l)return l.render||n.render?l.tmpls&&(s=l):(n=R(l,i),q(l.replace(Pt,"\\$&"),n)),s||(s=d(function(){return s.render.apply(s,arguments)},n),k(s)),s}function P(t,e){return st(t)?t.call(e):t}function F(t,e,n){Object.defineProperty(t,e,{value:n,configurable:!0})}function N(t,n){function r(t){c.apply(this,t)}function i(){return new r(arguments)}function o(t,e){for(var n,r,i,o,a,s=0;sY-(Q||0)){if(Q=e.trim(L.slice(Q,Y+r.length)),H=s||g[m-1].bd,W=H[H.length-1],W&&W.prm){for(;W.sb&&W.sb.prm;)W=W.sb;Z=W.sb={path:W.sb,bnd:W.bnd}}else H.push(Z={path:H.pop()});W&&W.sb===Z&&(k[m]=k[m-1].slice(W._cpPthSt)+k[m],k[m-1]=k[m-1].slice(0,W._cpPthSt)),Z._cpPthSt=C[m-1],Z._cpKey=Q,k[m]+=L.slice(j,J),j=J,Z._cpfn=Wt[Q]=Wt[Q]||new Function("data,view,j","//"+Q+"\nvar v;\nreturn ((v="+k[m]+("]"===S?")]":S)+")!=null?v:null);"),k[m-1]+=w[h]&&vt.cache?'view.getCache("'+Q.replace(Pt,"\\$&")+'"':k[m],Z.prm=f.bd,Z.bnd=Z.bnd||Z.path&&Z.path.indexOf("^")>=0}k[m]=""}"["===$&&($="[j._sq("),"["===d&&(d="[j._sq(")}return X=p?(p=!O,p?r:E+'"'):c?(c=!I,c?r:E+'"'):(d?(b[++h]=!0,_[h]=0,u&&(y[m++]=Y++,f=g[m]={bd:[]},k[m]="",C[m]=1),d):"")+(K?h?"":(v=L.slice(v,Y),(a?(a=l=s=!1,"\b"):"\b,")+v+(v=Y+r.length,u&&n.push(f.bd=[]),"\b")):N?(m&&D(t),u&&n.pop(),a="_"+A,l=T,v=Y+r.length,u&&(u=f.bd=n[a]=[],u.skp=!T),A+":"):A?A.split("^").join(".").replace(ft.rPath,B)+($||P):P?P:S?"]"===S?")]":")":V?(w[h]||D(t),","):o?"":(p=O,c=I,'"')),p||c||S&&(w[h]=!1,h--),u&&(p||c||(S&&(b[h+1]&&(f=g[--m],b[h+1]=!1),x=_[h+1]),$&&(_[h+1]=k[m].length+(d?1:0),(A||S)&&(f=g[++m]={bd:[]},b[h+1]=!0))),k[m]=(k[m]||"")+L.slice(j,J),j=J+r.length,p||c||((G=d&&b[h+1])&&(k[m-1]+=d,C[m-1]++),"("===$&&z&&!Z&&(k[m]=k[m-1].slice(x)+k[m],k[m-1]=k[m-1].slice(0,x))),k[m]+=G?X.slice(1):X),p||c||!$||(h++,A&&"("===$&&(w[h]=!0)),p||c||!U||(u&&(k[m]+=$),X+=$),X}var a,s,l,d,c,p,u=n&&n[0],f={bd:u},g={0:f},v=0,h=0,m=0,_={},x=0,b={},w={},y={},C={0:0},k={0:""},j=0;return"@"===t[0]&&(t=t.replace(Dt,".")),d=(t+(r?" ":"")).replace(ft.rPrm,o),u&&(d=k[0]),!h&&d||D(t)}function B(t,e,n){var r,i,o,a,s,l,d,c,p,u,f,g,v,h,m,_,x,b,w,y,C,k,j,T,A,P,F,N,M,$,V,E,O,I=0,S=vt.useViews||e.useViews||e.tags||e.templates||e.helpers||e.converters,q="",K={},L=t.length;for(""+e===e?(b=n?'data-link="'+e.replace(Tt," ").slice(1,-1)+'"':e,e=0):(b=e.tmplName||"unnamed",e.allowCode&&(K.allowCode=!0),e.debug&&(K.debug=!0),f=e.bnds,x=e.tmpls),r=0;r":a+o):(C&&(w=R(k,K),w.tmplName=b+"/"+o,w.useViews=w.useViews||S,B(C,w),S=w.useViews,x.push(w)),A||(y=o,S=S||o&&(!ut[o]||!ut[o].flow),T=q,q=""),j=t[r+1],j=j&&"else"===j[0]),M=N?";\ntry{\nret+=":"\n+",h="",m="",P&&(g||$||a&&a!==Jt||V)){if(F=new Function("data,view,j","// "+b+" "+ ++I+" "+o+E+"{"+s+"};"+O),F._er=N,F._tag=o,F._bd=!!g,F._lr=V,n)return F;U(F,g),_='c("'+a+'",view,',u=!0,h=_+I+",",m=")"}if(q+=P?(n?(N?"try{\n":"")+"return ":M)+(u?(u=void 0,S=p=!0,_+(F?(f[I-1]=F,I):"{"+s+"}")+")"):">"===o?(d=!0,"h("+v[0]+")"):(c=!0,"((v="+v[0]+")!=null?v:"+(n?"null)":'"")'))):(l=!0,"\n{view:view,content:false,tmpl:"+(C?x.length:"false")+","+s+"},"),y&&!j){if(q="["+q.slice(0,-1)+"]",_='t("'+y+'",view,this,',n||g){if(q=new Function("data,view,j"," // "+b+" "+I+" "+y+E+q+O),q._er=N,q._tag=y,g&&U(f[I-1]=q,g),q._lr=V,n)return q;h=_+I+",undefined,",m=")"}q=T+M+_+(g&&I||q)+")",g=0,y=0}N&&!j&&(S=!0,q+=";\n}catch(e){ret"+(n?"urn ":"+=")+h+"j._err(e,view,"+N+")"+m+";}"+(n?"":"\nret=ret"))}q="// "+b+(K.debug?"\ndebugger;":"")+"\nvar v"+(l?",t=j._tag":"")+(p?",c=j._cnvt":"")+(d?",h=j._html":"")+(n?(i[8]?", ob":"")+";\n":',ret=""')+q+(n?"\n":";\nreturn ret;");try{q=new Function("data,view,j",q)}catch(Q){D("Compiled template code:\n\n"+q+'\n: "'+(Q.message||Q)+'"')}return e&&(e.fn=q,e.useViews=!!S),q}function Q(t,e){return t&&t!==e?e?d(d({},e),t):t:e&&d({},e)}function H(t,n){var r,i,o=n.map,a=o&&o.propsArr;if(!a){if(a=[],typeof t===Lt||st(t))for(r in t)i=t[r],r===at||!t.hasOwnProperty(r)||n.props.noFunctions&&e.isFunction(i)||a.push({key:r,prop:i});o&&(o.propsArr=o.options&&a)}return W(a,n)}function W(t,n){var r,i,o,a=n.tag,s=n.props,l=n.params.props,d=s.filter,c=s.sort,p=c===!0,u=parseInt(s.step),f=s.reverse?-1:1;if(!lt(t))return t;if(p||c&&""+c===c?(r=t.map(function(t,e){return t=p?t:g(t,c),{i:e,v:""+t===t?t.toLowerCase():t}}),r.sort(function(t,e){return t.v>e.v?f:t.vt.length?t.length:+o,t=t.slice(i,o)),u>1){for(i=0,o=t.length,r=[];i\s]/,Mt=/[\x00`><"'&=]/g,$t=/[\x00`><\"'&=]/,Vt=/^on[A-Z]|^convert(Back)?$/,Et=/^\#\d+_`[\s\S]*\/\d+_`$/,Ot=Mt,It=/[&<>]/g,St=/&(amp|gt|lt);/g,Dt=/\[['"]?|['"]?\]/g,qt=0,Ut={"&":"&","<":"<",">":">","\0":"�","'":"'",'"':""","`":"`","=":"="},Kt={amp:"&",gt:">",lt:"<"},Jt="html",Lt="object",Bt="data-jsv-tmpl",Qt="jsvTmpl",Ht="For #index in nested block use #getIndex().",Wt={},Zt={},zt=t.jsrender,Gt=zt&&e&&!e.render,Xt={template:{compile:A},tag:{compile:j},viewModel:{compile:N},helper:{},converter:{}};if(ot={jsviews:kt,sub:{rPath:/^(!*?)(?:null|true|false|\d[\d.]*|([\w$]+|\.|~([\w$]+)|#(view|([\w$]+))?)([\w$.^]*?)(?:[.[^]([\w$]+)\]?)?)$/g,rPrm:/(\()(?=\s*\()|(?:([([])\s*)?(?:(\^?)(~?[\w$.^]+)?\s*((\+\+|--)|\+|-|~(?![\w$])|&&|\|\||===|!==|==|!=|<=|>=|[<>%*:?\/]|(=))\s*|(!*?(@)?[#~]?[\w$.^]+)([([])?)|(,\s*)|(?:(\()\s*)?\\?(?:(')|("))|(?:\s*(([)\]])(?=[.^]|\s*$|[^([])|[)\]])([([]?))|(\s+)/g,View:C,Err:l,tmplFn:q,parse:L,extend:d,extendCtx:Q,syntaxErr:D,onStore:{template:function(t,e){null===e?delete Zt[t]:t&&(Zt[t]=e)}},addSetting:$,settings:{allowCode:!1},advSet:a,_thp:i,_gm:r,_tg:function(){},_cnvt:m,_tag:y,_er:S,_err:I,_cp:o,_sq:function(t){return"constructor"===t&&D(""),t}},settings:{delimiters:c,advanced:function(t){return t?(d(vt,t),ft.advSet(),ht):vt}},map:V},(l.prototype=new Error).constructor=l,u.depends=function(){return[this.get("item"),"index"]},f.depends="index",C.prototype={get:p,getIndex:f,ctxPrm:v,getRsc:w,_getTmpl:h,_getOb:g,getCache:function(t){return gt._cchCt>this.cache._ct&&(this.cache={_ct:gt._cchCt}),this.cache[t]||(this.cache[t]=Wt[t](this.data,this,ft))},_is:"view"},ft=ot.sub,ht=ot.settings,!(zt||e&&e.render)){for(nt in Xt)M(nt,Xt[nt]);if(ct=ot.converters,pt=ot.helpers,ut=ot.tags,ft._tg.prototype={baseApply:T,cvtArgs:_,bndArgs:b,ctxPrm:v},it=ft.topView=new C,e){if(e.fn.render=Z,at=e.expando,e.observable){if(kt!==(kt=e.views.jsviews))throw"jquery.observable.js requires jsrender.js "+kt;d(ft,e.views.sub),ot.map=e.views.map}}else e={},et&&(t.jsrender=e),e.renderFile=e.__express=e.compile=function(){throw"Node.js: use npm jsrender, or jsrender-node.js"},e.isFunction=function(t){return"function"==typeof t},e.isArray=Array.isArray||function(t){return"[object Array]"==={}.toString.call(t)},ft._jq=function(t){t!==e&&(d(t,e),e=t,e.fn.render=Z,delete e.jsrender,at=e.expando)},e.jsrender=kt;gt=ft.settings,gt.allowCode=!1,st=e.isFunction,e.render=Zt,e.views=ot,e.templates=dt=ot.templates;for(yt in gt)$(yt);(ht.debugMode=function(t){return void 0===t?gt.debugMode:(gt._clFns&>._clFns(),gt.debugMode=t,gt.onError=t+""===t?function(){return t}:st(t)?t:void 0,ht)})(!1),vt=gt.advanced={cache:!0,useViews:!1,_jsv:!1},ut({"if":{render:function(t){var e=this,n=e.tagCtx,r=e.rendering.done||!t&&(n.args.length||!n.index)?"":(e.rendering.done=!0,void(e.selected=n.index));return r},contentCtx:!0,flow:!0},"for":{sortDataMap:V(W),init:function(t,e){this.setDataMap(this.tagCtxs)},render:function(t){var e,n,r,i,o,a=this,s=a.tagCtx,l=s.argDefault===!1,d=s.props,c=l||s.args.length,p="",u=0;if(!a.rendering.done){if(e=c?t:s.view.data,l)for(l=d.reverse?"unshift":"push",i=+d.end,o=+d.step||1,e=[],r=+d.start||0;(i-r)*o>0;r+=o)e[l](r);void 0!==e&&(n=lt(e),p+=s.render(e,!c||d.noIteration),u+=n?e.length:1),(a.rendering.done=u)&&(a.selected=s.index)}return p},setDataMap:function(t){for(var e,n,r,i=this,o=t.length;o--;)e=t[o],n=e.props,r=e.params.props,e.argDefault=void 0===n.end||e.args.length>0,n.dataMap=e.argDefault!==!1&<(e.args[0])&&(r.sort||r.start||r.end||r.step||r.filter||r.reverse||n.sort||n.start||n.end||n.step||n.filter||n.reverse)&&i.sortDataMap},flow:!0},props:{baseTag:"for",dataMap:V(H),init:a,flow:!0},include:{flow:!0},"*":{render:o,flow:!0},":*":{render:o,flow:!0},dbg:pt.dbg=ct.dbg=s}),ct({html:X,attr:X,encode:Y,unencode:tt,url:function(t){return void 0!=t?encodeURI(""+t):null===t?t:""}})}return gt=ft.settings,lt=(e||zt).isArray,ht.delimiters("{{","}}","^"),Gt&&zt.views.sub._jq(e),e||zt},window); //# sourceMappingURL=jsrender.min.js.map diff --git a/jsrender.min.js.map b/jsrender.min.js.map index d30ba4e..efc808d 100644 --- a/jsrender.min.js.map +++ b/jsrender.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["jsrender.js"],"names":["factory","global","$","jQuery","exports","module","fn","define","amd","getDerivedMethod","baseMethod","method","ret","tag","this","prevBase","base","apply","arguments","getMethod","$isFunction","_d","noop","tagHandlersFromProps","tagCtx","prop","props","rHasHandlers","test","fix","constructor","prototype","retVal","val","dbgBreak","console","log","e","baseApply","JsViewsError","message","name","link","$extend","target","source","$viewsDelimiters","openChars","closeChars","$isArray","$views","linkChar","error","delimOpenChar0","delimOpenChar1","delimCloseChar0","delimCloseChar1","$subSettings","delimiters","rTag","$sub","RegExp","rTmpl","$viewsSettings","getView","inner","type","undefined","views","i","l","found","view","root","_","useKey","get","length","parent","getNestedIndex","index","getIndex","getPathObject","ob","path","ltOb","prevOb","tokens","split","lt","contextParameter","key","value","wrapped","deps","res","obsCtxPrm","tagElse","callView","newRes","storeView","isUpdate","isRenderCall","store","ctx","hasOwnProperty","$helpers","linked","_cxp","scope","isTop","_ocps","_ocp","_vw","_key","ind","updateValue","observable","setProperty","_ceo","unshift","cvtArgs","data","_ucp","getTemplate","tmpl","getRsc","$templates","convertVal","converter","onError","linkCtx","argsLen","bindTo","boundTag","bnds","_lr","args","_bd","_lc","_tg","bnd","unlinked","inline","tagName","convert","onArrayChange","flow","tagCtxs","_is","extendCtx","_er","onRender","convertArgs","bound","boundArgs","bindFrom","slice","argOrProp","context","convertBoundArgs","getResource","resourceType","itemName","renderTag","parentView","bindToOrBindFrom","bindArray","m","isNaN","parseInt","topView","tagDef","template","tags","attr","parentTag","n","itemRet","tagCtxCtx","ctxPrm","initVal","content","callInit","mapDef","thisMap","bdArgs","tagDataMap","contentCtx","bindFromLength","bindToLength","linkedElement","defaultCtx","parentTmpl","lateRender","params","tmpls","render","renderContent","bndArgs","_getTmpl","init","_ctr","ths","arrVws","dataBoundOnly","dataMap","map","parents","parentTags","rendering","rndr","argDefault","linkedCtxParam","fromIndex","toIndex","_dfAt","noVws","HTML","_cp","cvt","src","unmap","tgt","rWrappedInViewMarker","links","renderWithViews","$converters","html","View","contentTmpl","parentView_","self_","self","isArray","id","viewId","scp","indexStr","push","splice","compileChildResources","storeName","storeNames","resources","jsvStores","compileTag","Tag","baseTag","compiledDef","depends","$tags","_parentTmpl","compileTmpl","options","lookupTemplate","currentName","nodeType","elem","document","getElementById","innerHTML","getAttribute","tmplAttr","jsvTmpl","tmplName","setAttribute","compiledTmpl","tmplOrMarkup","_html","markup","tmplObject","tmplFn","replace","rEscapeQuotes","getDefaultVal","defaultVal","call","addParentRef","ref","Object","defineProperty","configurable","compileViewModel","JsvVm","vm","iterate","action","getterType","parentRef","j","getterCount","getters","getter","viewModels","JSON","parse","childOb","arr","merge","viewModel","$expando","getterNames","mod","assigned","newModArr","k","model","$observable","refresh","concat","unmapArray","modelArr","charAt","extend","proto","cnstr","privField","set","Function","htmlTag","wrapMap","$subSettingsAdvanced","_wm","rFirstElem","exec","toLowerCase","div","trim","registerStore","storeSettings","theStore","item","compile","thisStore","onStore","OBJECT","getTgt","addSetting","st","Map","baseMap","noIteration","isTopRenderCall","prevData","prevIndex","result","useViews","newView","childView","itemResult","swapContent","outerOnRender","itemVar","newCtx","noLinking","_wrp","nl","syntaxError","helpers","contentView","onRenderError","fallback","Err","isLinkExpr","convertBack","hasElse","pushprecedingContent","shift","loc","substr","rNewLine","blockTagCheck","block","parseTag","all","bind","colon","codeTag","slash","bind2","closeBlock","late","openTagName","isLateOb","pathBindings","ctxProps","paramsArgs","paramsProps","paramsCtxProps","useTrigger","allowCode","rUnescapeQuotes","rTestElseIf","current","substring","stack","pop","parseParams","rBuildHash","onerror","isCtxPrm","keyToken","keyValue","arg","param","hasHandlers","newNode","parsedParam","bindings","astTop","buildCode","setPaths","pathsArr","paths","skp","paramStructure","parts","parseTokens","lftPrn0","lftPrn","operator","err","eq","path2","prn","comma","lftPrn2","apos","quot","rtPrn","rtPrnDot","prn2","space","full","parsePath","allPath","not","object","helper","viewProperty","pathTokens","leafToken","subPath","binds","named","bindto","_jsvto","bndCtx","bd","theOb","_cpfn","sb","pathStart","parenDepth","join","expr","exprFn","newOb","rtSq","aposed","quoted","bndStack","prm","tmplLinks","indexOf","paramIndex","boundName","rPath","fnCall","0","rBracketQuote","rPrm","ast","node","hasTag","hasEncoder","getsVal","hasCnvt","useCnvt","tmplBindings","boundOnErrStart","boundOnErrEnd","tagRender","nestedTmpls","nestedTmpl","tagAndElses","nextIsElse","oldCode","isElse","isGetVal","tagCtxFn","tagStart","trigger","retStrOpen","retStrClose","tmplBindingKey","templates","converters","code","tmplOptions","debug","debugMode","_tag","parentContext","getTargetProps","propsArr","noFunctions","isFunction","getTargetSorted","mapped","start","end","propParams","filter","sort","directSort","step","reverse","v","a","b","onFilter","sorted","paged","$fnRender","tmplElem","jquery","getCharEntity","ch","charEntities","charCodeAt","getCharFromEntity","match","token","charsFromEntities","htmlEncode","text","rIsHtml","rHtmlEncode","dataEncode","rDataEncode","dataUnencode","rDataUnencode","setGlobals","jsvStoreName","setting","versionNumber","rAttrEncode","&","<",">","\u0000","'","\"","`","=","amp","gt","$render","jsr","jsrender","jsrToJq","jsviews","sub","syntaxErr","settings","advSet","_thp","_gm","_cnvt","_err","_sq","advanced","Error","_getOb","expando","renderFile","__express","Array","obj","_jq","jq","_jsv","if","done","selected","for","sortDataMap","cloned","setDataMap","range","include","*",":*","dbg","encode","unencode","url","encodeURI","window"],"mappings":";;CAaC,SAASA,EAASC,GAElB,GAAIC,GAAID,EAAOE,MAEQ,iBAAZC,SACVC,OAAOD,QAAUF,EACdF,EAAQC,EAAQC,GAChB,SAASA,GACV,GAAIA,IAAMA,EAAEI,GACX,KAAM,wBAEP,OAAON,GAAQC,EAAQC,IAEG,kBAAXK,SAAyBA,OAAOC,IACjDD,OAAO,WACN,MAAOP,GAAQC,KAGhBD,EAAQC,GAAQ,IAKlB,SAASA,EAAQC,GACjB,YAsIA,SAASO,GAAiBC,EAAYC,GACrC,MAAO,YACN,GAAIC,GACHC,EAAMC,KACNC,EAAWF,EAAIG,IAKhB,OAHAH,GAAIG,KAAON,EACXE,EAAMD,EAAOM,MAAMJ,EAAKK,WACxBL,EAAIG,KAAOD,EACJH,GAIT,QAASO,GAAUT,EAAYC,GAc9B,MAXIS,IAAYT,KACfA,EAASF,EACNC,EAEEA,EAAWW,GACVX,EACAD,E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AM,KAAM,KAElCwf,IACHF,GAAI5e,MAAMgf,IAAIiB,IAAInkB,GAEZA,GAAK8iB,IACTwC","file":"jsrender.min.js","sourcesContent":["/*! JsRender v1.0.6: http://jsviews.com/#jsrender */\n/*! **VERSION FOR WEB** (For NODE.JS see http://jsviews.com/download/jsrender-node.js) */\n/*\n * Best-of-breed templating in browser or on Node.js.\n * Does not require jQuery, or HTML DOM\n * Integrates with JsViews (http://jsviews.com/#jsviews)\n *\n * Copyright 2020, Boris Moore\n * Released under the MIT License.\n */\n\n//jshint -W018, -W041, -W120\n\n(function(factory, global) {\n\t// global var is the this object, which is window when running in the usual browser environment\n\tvar $ = global.jQuery;\n\n\tif (typeof exports === \"object\") { // CommonJS e.g. Browserify\n\t\tmodule.exports = $\n\t\t\t? factory(global, $)\n\t\t\t: function($) { // If no global jQuery, take optional jQuery passed as parameter: require('jsrender')(jQuery)\n\t\t\t\tif ($ && !$.fn) {\n\t\t\t\t\tthrow \"Provide jQuery or null\";\n\t\t\t\t}\n\t\t\t\treturn factory(global, $);\n\t\t\t};\n\t} else if (typeof define === \"function\" && define.amd) { // AMD script loader, e.g. RequireJS\n\t\tdefine(function() {\n\t\t\treturn factory(global);\n\t\t});\n\t} else { // Browser using plain + diff --git a/test/unit-tests-amd-scriptloader.html b/test/unit-tests-amd-scriptloader.html index 4f517fe..6b0dc05 100644 --- a/test/unit-tests-amd-scriptloader.html +++ b/test/unit-tests-amd-scriptloader.html @@ -3,17 +3,16 @@ - + -
-

JsViews AMD QUnit Tests

+

JsRender AMD QUnit Tests

diff --git a/test/unit-tests-browserify.html b/test/unit-tests-browserify.html index 1f0a965..0014f10 100644 --- a/test/unit-tests-browserify.html +++ b/test/unit-tests-browserify.html @@ -2,7 +2,7 @@ - + diff --git a/test/unit-tests-jsrender-no-jquery.html b/test/unit-tests-jsrender-no-jquery.html index d93b2e8..38ff244 100644 --- a/test/unit-tests-jsrender-no-jquery.html +++ b/test/unit-tests-jsrender-no-jquery.html @@ -5,7 +5,7 @@ - + diff --git a/test/unit-tests-jsrender-with-jquery.html b/test/unit-tests-jsrender-with-jquery.html index b28e419..1d28d26 100644 --- a/test/unit-tests-jsrender-with-jquery.html +++ b/test/unit-tests-jsrender-with-jquery.html @@ -3,7 +3,7 @@ - + diff --git a/test/unit-tests/requirejs-config.js b/test/unit-tests/requirejs-config.js index 3a8a639..a6ff99d 100644 --- a/test/unit-tests/requirejs-config.js +++ b/test/unit-tests/requirejs-config.js @@ -1,12 +1,9 @@ // Configure loading modules from the download directory, requirejs.config({ - "baseUrl": "//www.jsviews.com/download", // Or point to correct local path on your system: "baseUrl": "/download", -// "baseUrl": "../../download", // Or point to correct local path on your system: "baseUrl": "/download", + "baseUrl": "//www.jsviews.com/download", // Or point to correct local path on your system: "baseUrl": "/", +// "baseUrl": "../../", // Or point to correct local path on your system: "baseUrl": "/", "paths": { - "jquery": "//code.jquery.com/jquery-3.4.1", - "jsrender": "./jsrender", - "jquery.observable": "./jquery.observable", - "jquery.views": "./jquery.views", - "jsviews": "./jsviews" + "jquery": "//code.jquery.com/jquery-3.5.1", + "jsrender": "./jsrender" } }); diff --git a/test/unit-tests/tests-node.js b/test/unit-tests/tests-node.js index 2069507..46db903 100644 --- a/test/unit-tests/tests-node.js +++ b/test/unit-tests/tests-node.js @@ -43,7 +43,7 @@ QUnit.test("jsrender.compile", function(assert) { QUnit.test("jsrender.tags.clientTemplate", function(assert) { jsrender.views.settings.delimiters("<%", "%>"); var tmpl = jsrender.compile( - '\n' + '\n' + '\n' + '<%clientTemplate "./test/templates/outer.html"/%>\n' + '<%clientTemplate "./test/templates/inner.html"/%>\n' @@ -52,7 +52,7 @@ QUnit.test("jsrender.tags.clientTemplate", function(assert) { + ''); var html = tmpl({name: "Jo"}); assert.equal(html, - '\n' + '\n' + '\n' + '\n' + '\n' diff --git a/typescript/jsrender/index.d.ts b/typescript/jsrender/index.d.ts index b926ef8..e546810 100644 --- a/typescript/jsrender/index.d.ts +++ b/typescript/jsrender/index.d.ts @@ -1,5 +1,5 @@ // Type definitions for JsRender 1.0 -// Version: "v1.0.6" +// Version: "v1.0.7" // Project: http://www.jsviews.com/#jsrender // Definitions by: Boris Moore // Definitions: https://www.jsviews.com/download/typescript/jsrender/index.d.ts diff --git a/typescript/jsrender/test/tests.html b/typescript/jsrender/test/tests.html index 345f6b9..99d05f2 100644 --- a/typescript/jsrender/test/tests.html +++ b/typescript/jsrender/test/tests.html @@ -4,7 +4,7 @@ body { font-family: 'Helvetica Neue', HelveticaNeue, Helvetica, Arial, sans-serif; font-size: 15px;} code { font-size: 12px; } - +