diff --git a/jsrender-node.js b/jsrender-node.js index 64115c2..6d5068c 100644 --- a/jsrender-node.js +++ b/jsrender-node.js @@ -1,4 +1,4 @@ -/*! JsRender v0.9.91 (Beta): http://jsviews.com/#jsrender */ +/*! JsRender v1.0.0: 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,7 +19,7 @@ if (typeof exports !== 'object' ) { //========================== Top-level vars ========================== -var versionNumber = "v0.9.91", +var versionNumber = "v1.0.0", // global var is the this object, which is window when running in the usual browser environment @@ -104,7 +104,7 @@ var versionNumber = "v0.9.91", template: function(name, item) { if (item === null) { delete $render[name]; - } else { + } else if (name) { $render[name] = item; } } @@ -228,22 +228,40 @@ function $extend(target, source) { // views.delimiters //=================== + /** + * Set the tag opening and closing delimiters and 'link' character. Default is "{{", "}}" and "^" + * openChars, closeChars: opening and closing strings, each with two characters + * $.views.settings.delimiters(...) + * + * @param {string} openChars + * @param {string} [closeChars] + * @param {string} [link] + * @returns {Settings} + * + * Get delimiters + * delimsArray = $.views.settings.delimiters() + * + * @returns {string[]} + */ function $viewsDelimiters(openChars, closeChars, link) { - // Set the tag opening and closing delimiters and 'link' character. Default is "{{", "}}" and "^" - // openChars, closeChars: opening and closing strings, each with two characters if (!openChars) { return $subSettings.delimiters; } if ($isArray(openChars)) { return $viewsDelimiters.apply($views, openChars); } + linkChar = link ? link[0] : linkChar; + if (!/^(\W|_){5}$/.test(openChars + closeChars + linkChar)) { + error("Invalid delimiters"); // Must be non-word characters, and openChars and closeChars must each be length 2 + } + delimOpenChar0 = openChars[0]; + delimOpenChar1 = openChars[1]; + delimCloseChar0 = closeChars[0]; + delimCloseChar1 = closeChars[1]; - $subSettings.delimiters = [openChars, closeChars, linkChar = link ? link.charAt(0) : linkChar]; + $subSettings.delimiters = [delimOpenChar0 + delimOpenChar1, delimCloseChar0 + delimCloseChar1, linkChar]; - delimOpenChar0 = openChars.charAt(0); // Escape the characters - since they could be regex special characters - delimOpenChar1 = openChars.charAt(1); - delimCloseChar0 = closeChars.charAt(0); - delimCloseChar1 = closeChars.charAt(1); + // Escape the characters - since they could be regex special characters openChars = "\\" + delimOpenChar0 + "(\\" + linkChar + ")?\\" + delimOpenChar1; // Default is "{^{" closeChars = "\\" + delimCloseChar0 + "\\" + delimCloseChar1; // Default is "}}" // Build regex with new delimiters @@ -278,8 +296,8 @@ function getView(inner, type) { //view.get(inner, type) var views, i, l, found, view = this, - root = !type || type === "root"; - // If type is undefined, returns root view (view under top view). + root = type === "root"; + // view.get("root") returns view.root, view.get() returns view.parent, view.get(true) returns view.views[0]. if (inner) { // Go through views - this one, and all nested ones, depth-first - and return first one with given type. @@ -302,14 +320,16 @@ function getView(inner, type) { //view.get(inner, type) } else if (root) { // Find root view. (view whose parent is top view) found = view.root; - } else { + } else if (type) { while (view && !found) { // Go through views - this one, and all parent ones - and return first one with given type. found = view.type === type ? view : undefined; view = view.parent; } + } else { + found = view.parent; } - return found; + return found || undefined; } function getNestedIndex() { @@ -327,11 +347,13 @@ function getIndex() { getIndex.depends = "index"; -//========== -// View.hlp -//========== +//================== +// View.ctxPrm, etc. +//================== -function getPathObject(ob, path, ltOb, fn) { // Iterate through path to late paths: @a.b.c paths +/* Internal private: view._getOb() */ +function getPathObject(ob, path, ltOb, fn) { + // Iterate through path to late paths: @a.b.c paths // Return "" (or noop if leaf is a function @a.b.c(...) ) if intermediate object not yet available var prevOb, tokens, l, i = 0; @@ -365,7 +387,6 @@ function contextParameter(key, value, get) { storeView = this, isUpdate = !isRenderCall && arguments.length > 1, store = storeView.ctx; - if (key) { if (!storeView._) { // tagCtx.ctxPrm() call tagElse = storeView.index; @@ -380,7 +401,7 @@ function contextParameter(key, value, get) { } else { store = undefined; } - if (storeView.tagCtx || storeView.linked) { // Data-linked view, or tag instance + if (!isRenderCall && storeView.tagCtx || storeView.linked) { // Data-linked view, or tag instance if (!res || !res._cxp) { // Not a contextual parameter // Set storeView to tag (if this is a tag.ctxPrm() call) or to root view ("data" view of linked template) @@ -426,7 +447,7 @@ function contextParameter(key, value, get) { tagElse = obsCtxPrm.tagElse; newRes = res[1] // linkFn for compiled expression ? obsCtxPrm.tag && obsCtxPrm.tag.cvtArgs - ? obsCtxPrm.tag.cvtArgs(1, tagElse)[obsCtxPrm.ind] // = tag.bndArgs() - for tag contextual parameter + ? 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[0]._ocp; // Observable contextual parameter (uninitialized, or initialized as static expression, so no path dependencies) if (isUpdate) { @@ -453,6 +474,7 @@ function contextParameter(key, value, get) { } } +/* Internal private: view._getTmpl() */ function getTemplate(tmpl) { return tmpl && (tmpl.fn ? tmpl @@ -469,7 +491,7 @@ function convertVal(converter, view, tagCtx, onError) { var tag, value, argsLen, bindTo, // If tagCtx is an integer, then it is the key for the compiled function to return the boundTag tagCtx boundTag = typeof tagCtx === "number" && view.tmpl.bnds[tagCtx-1], - linkCtx = view.linkCtx; // For data-link="{cvt:...}"... + linkCtx = view._lc; // For data-link="{cvt:...}"... if (onError === undefined && boundTag && boundTag._lr) { // lateRender onError = ""; @@ -528,13 +550,16 @@ function convertVal(converter, view, tagCtx, onError) { return value != undefined ? value : ""; } -function convertArgs(bound, tagElse) { // tag.cvtArgs() or tag.cvtArgs(trueOrFalse, tagElse) +function convertArgs(tagElse, bound) { // tag.cvtArgs() or tag.cvtArgs(tagElse?, true?) var l, key, boundArgs, args, bindFrom, tag, converter, tagCtx = this; if (tagCtx.tagName) { tag = tagCtx; - tagCtx = tag.tagCtxs ? tag.tagCtxs[tagElse || 0] : tag.tagCtx; + tagCtx = (tag.tagCtxs || [tagCtx])[tagElse||0]; + if (!tagCtx) { + return; + } } else { tag = tagCtx.tag; } @@ -594,13 +619,14 @@ function argOrProp(context, key) { } function convertBoundArgs(tagElse) { // tag.bndArgs() - return this.cvtArgs(1, tagElse); + return this.cvtArgs(tagElse, 1); } //============= -// views._tag +// views.tag //============= +/* view.getRsc() */ function getResource(resourceType, itemName) { var res, store, view = this; @@ -637,7 +663,7 @@ function renderTag(tagName, parentView, tmpl, tagCtxs, isUpdate, onError) { content, callInit, mapDef, thisMap, args, bdArgs, props, tagDataMap, contentCtx, key, bindFromLength, bindToLength, linkedElement, defaultCtx, i = 0, ret = "", - linkCtx = parentView.linkCtx || 0, + linkCtx = parentView._lc || false, ctx = parentView.ctx, parentTmpl = tmpl || parentView.tmpl, // If tagCtxs is an integer, then it is the key for the compiled function to return the boundTag tagCtxs @@ -682,7 +708,7 @@ function renderTag(tagName, parentView, tmpl, tagCtxs, isUpdate, onError) { } if (tmpl = tagCtx.props.tmpl) { // If the tmpl property is overridden, set the value (when initializing, or, in case of binding: ^tmpl=..., when updating) - tagCtx.tmpl = parentView.getTmpl(tmpl); + tagCtx.tmpl = parentView._getTmpl(tmpl); tagCtx.content = tagCtx.content || tagCtx.tmpl; } @@ -700,8 +726,8 @@ function renderTag(tagName, parentView, tmpl, tagCtxs, isUpdate, onError) { if (linkCtx) { tag.inline = false; linkCtx.tag = tag; - tag.linkCtx = linkCtx; } + tag.linkCtx = linkCtx; if (tag._.bnd = boundTag || linkCtx.fn) { // Bound if {^{tag...}} or data-link="{tag...}" tag._.ths = tagCtx.params.props.this; // Tag has a this=expr binding, to get javascript reference to tag instance @@ -807,9 +833,9 @@ function renderTag(tagName, parentView, tmpl, tagCtxs, isUpdate, onError) { attr = tag.attr; tag._.noVws = attr && attr !== HTML; } - args = tag.cvtArgs(undefined, i); + args = tag.cvtArgs(i); if (tag.linkedCtxParam) { - bdArgs = tag.cvtArgs(1, i); + bdArgs = tag.cvtArgs(i, 1); m = bindFromLength; defaultCtx = tag.constructor.prototype.ctx; while (m--) { @@ -865,8 +891,11 @@ function renderTag(tagName, parentView, tmpl, tagCtxs, isUpdate, onError) { } itemRet = tagCtx.render(contentCtx, true) || (isUpdate ? undefined : ""); } - // No return value from render, and no template/content tagCtx.render(...), so return undefined - ret = ret ? ret + (itemRet || "") : itemRet; // If no rendered content, this will be undefined + ret = ret + ? ret + (itemRet || "") + : itemRet !== undefined + ? "" + itemRet + : undefined; // If no return value from render, and no template/content tagCtx.render(...), return undefined } tag.rendering = tag.rendering.rndr; // Remove tag.rendering object (if this is outermost render call. (In case of nested calls) } @@ -940,10 +969,10 @@ function View(context, type, parentView, data, template, key, onRender, contentT View.prototype = { get: getView, getIndex: getIndex, - getRsc: getResource, - getTmpl: getTemplate, ctxPrm: contextParameter, - getOb: getPathObject, + getRsc: getResource, + _getTmpl: getTemplate, + _getOb: getPathObject, _is: "view" }; @@ -1219,7 +1248,7 @@ function compileViewModel(name, type) { arr.push(ob); }); - ob = this.apply(this, arr); // Insantiate this View Model, passing getters args array to constructor + ob = this.apply(this, arr); // Instantiate this View Model, passing getters args array to constructor for (prop in data) { // Copy over any other properties. that are not get/set properties if (!getterNames[prop]) { ob[prop] = data[prop]; @@ -1392,14 +1421,27 @@ function tmplObject(markup, options) { // registerStore //============== +/** +* Internal. Register a store type (used for template, tags, helpers, converters) +*/ function registerStore(storeName, storeSettings) { +/** +* Generic store() function to register item, named item, or hash of items +* Also used as hash to store the registered items +* Used as implementation of $.templates(), $.views.templates(), $.views.tags(), $.views.helpers() and $.views.converters() +* +* @param {string|hash} name name - or selector, in case of $.templates(). Or hash of items +* @param {any} [item] (e.g. markup for named template) +* @param {template} [parentTmpl] For item being registered as private resource of template +* @returns {any|$.views} item, e.g. compiled template - or $.views in case of registering hash of items +*/ function theStore(name, item, parentTmpl) { // The store is also the function used to add items to the store. e.g. $.templates, or $.views.tags // For store of name 'thing', Call as: // $.views.things(items[, parentTmpl]), - // or $.views.things(name, item[, parentTmpl]) + // or $.views.things(name[, item, parentTmpl]) var compile, itemName, thisStore, cnt, onStore = $sub.onStore[storeName]; @@ -1456,6 +1498,15 @@ function registerStore(storeName, storeSettings) { $views[storeNames] = theStore; } +/** +* Add settings such as: +* $.views.settings.allowCode(true) +* @param {boolean} value +* @returns {Settings} +* +* allowCode = $.views.settings.allowCode() +* @returns {boolean} +*/ function addSetting(st) { $viewsSettings[st] = function(value) { return arguments.length @@ -1495,6 +1546,17 @@ function dataMap(mapDef) { // renderContent //============== +/** Render the template as a string, using the specified data and helpers/context +* $("#tmpl").render(), tmpl.render(), tagCtx.render(), $.render.namedTmpl() +* +* @param {any} data +* @param {hash} [context] helpers or context +* @param {boolean} [noIteration] +* @param {View} [parentView] internal +* @param {string} [key] internal +* @param {function} [onRender] internal +* @returns {string} rendered template internal +*/ function renderContent(data, context, noIteration, parentView, key, onRender) { var i, l, tag, tmpl, tagCtx, isTopRenderCall, prevData, prevIndex, view = parentView, @@ -1511,7 +1573,7 @@ function renderContent(data, context, noIteration, parentView, key, onRender) { // This is a call from renderTag or tagCtx.render(...) tagCtx = this; view = view || tagCtx.view; - tmpl = view.getTmpl(tag.template || tagCtx.tmpl); + tmpl = view._getTmpl(tag.template || tagCtx.tmpl); if (!arguments.length) { data = tag.contentCtx && $isFunction(tag.contentCtx) ? data = tag.contentCtx(data) @@ -1614,7 +1676,7 @@ function renderWithViews(tmpl, data, context, noIteration, view, key, onRender, context.link = false; } if (itemVar = tagCtx.props.itemVar) { - if (itemVar.charAt(0) !== "~") { + if (itemVar[0] !== "~") { syntaxError("Use itemVar='~myItem'"); } itemVar = itemVar.slice(1); @@ -1715,7 +1777,7 @@ function onRenderError(e, view, fallback) { message = fallback; // There is a settings.debugMode(handler) onError override. Call it, and use return value (if any) to replace message } - return view && !view.linkCtx ? $converters.html(message) : message; + return view && !view._lc ? $converters.html(message) : message; } function error(message) { @@ -1837,7 +1899,7 @@ function tmplFn(markup, tmpl, isLinkExpr, convertBack, hasElse) { keyValue = "undefined"; // this=some.path is always a to parameter (one-way), so don't need to compile/evaluate some.path initialization } if (param) { - isLateOb = isLateOb || param.charAt(0) === "@"; + isLateOb = isLateOb || param[0] === "@"; } key = "'" + keyToken + "':"; if (arg) { @@ -1995,7 +2057,7 @@ function parseParams(params, pathBindings, tmpl, isLinkExpr) { syntaxError(allPath); } if (!subPath) { - allPath = (late // late path @a.b.c: not throw on 'property of undefined' if a undefined, and will use getOb() after linking to resolve late. + allPath = (late // late path @a.b.c: not throw on 'property of undefined' if a undefined, and will use _getOb() after linking to resolve late. ? (isLinkExpr ? '' : '(ltOb.lt=ltOb.lt||') + '(ob=' : "" ) @@ -2005,7 +2067,7 @@ function parseParams(params, pathBindings, tmpl, isLinkExpr) { ? "view" : "data") + (late - ? ')===undefined' + (isLinkExpr ? '' : ')') + '?"":view.getOb(ob,"' + ? ')===undefined' + (isLinkExpr ? '' : ')') + '?"":view._getOb(ob,"' : "" ) + (leafToken @@ -2037,7 +2099,7 @@ function parseParams(params, pathBindings, tmpl, isLinkExpr) { path = "^" + path.slice(1); } theOb.sb = path; - theOb.bnd = theOb.bnd || path.charAt(0) === "^"; + theOb.bnd = theOb.bnd || path[0] === "^"; } } else { binds.push(path); @@ -2056,7 +2118,7 @@ function parseParams(params, pathBindings, tmpl, isLinkExpr) { lftPrn = lftPrn || lftPrn0 || lftPrn2; path = path || path2; - if (late && (late = !/\)|]/.test(full.charAt(index-1)))) { + if (late && (late = !/\)|]/.test(full[index-1]))) { path = path.slice(1).split(".").join("^"); // Late path @z.b.c. Use "^" rather than "." to ensure that deep binding will be used } // Could do this - but not worth perf cost?? :- @@ -2177,7 +2239,7 @@ function parseParams(params, pathBindings, tmpl, isLinkExpr) { pathStart = {}, // tracks the start of the current path such as c^d() in the above example result; - if (params.charAt(0) === "@") { + if (params[0] === "@") { params = params.replace(rBracketQuote, "."); } result = (params + (tmpl ? " " : "")).replace(rParams, parseTokens); @@ -2320,8 +2382,8 @@ function buildCode(ast, tmpl, isLinkExpr) { : (getsVal = true, "((v=" + params[0] + ')!=null?v:' + (isLinkExpr ? 'null)' : '"")')) // Non strict equality so data-link="title{:expr}" with expr=null/undefined removes title attribute ) - : (hasTag = true, "\n{view:view,tmpl:" // Add this tagCtx to the compiled code for the tagCtxs to be passed to renderTag() - + (content ? nestedTmpls.length : "0") + "," // For block tags, pass in the key (nestedTmpls.length) to the nested content template + : (hasTag = true, "\n{view:view,content:false,tmpl:" // Add this tagCtx to the compiled code for the tagCtxs to be passed to renderTag() + + (content ? nestedTmpls.length : "false") + "," // For block tags, pass in the key (nestedTmpls.length) to the nested content template + tagCtx + "},")); if (tagAndElses && !nextIsElse) { @@ -2502,6 +2564,14 @@ function getTargetSorted(value, tagCtx) { return value; } +/** Render the template as a string, using the specified data and helpers/context +* $("#tmpl").render() +* +* @param {any} data +* @param {hash} [helpersOrContext] +* @param {boolean} [noIteration] +* @returns {string} rendered template +*/ function $fnRender(data, context, noIteration) { var tmplElem = this.jquery && (this[0] || error('Unknown template')), // Targeted element not found for jQuery template selector such as "#myTmpl" tmpl = tmplElem.getAttribute(tmplAttr); @@ -2591,6 +2661,14 @@ $viewsSettings = $views.settings; addSetting(setting); } + /** + * $.views.settings.debugMode(true) + * @param {boolean} debugMode + * @returns {Settings} + * + * debugMode = $.views.settings.debugMode() + * @returns {boolean} + */ ($viewsSettings.debugMode = function(debugMode) { return debugMode === undefined ? $subSettings.debugMode diff --git a/jsrender.js b/jsrender.js index a77d4df..9d36d36 100644 --- a/jsrender.js +++ b/jsrender.js @@ -1,4 +1,4 @@ -/*! JsRender v0.9.91 (Beta): http://jsviews.com/#jsrender */ +/*! JsRender v1.0.0: 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,7 +44,7 @@ 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 = "v0.9.91", +var versionNumber = "v1.0.0", jsvStoreName, rTag, rTmplString, topView, $views, $expando, _ocp = "_ocp", // Observable contextual parameter @@ -129,7 +129,7 @@ var versionNumber = "v0.9.91", template: function(name, item) { if (item === null) { delete $render[name]; - } else { + } else if (name) { $render[name] = item; } } @@ -253,22 +253,40 @@ function $extend(target, source) { // views.delimiters //=================== + /** + * Set the tag opening and closing delimiters and 'link' character. Default is "{{", "}}" and "^" + * openChars, closeChars: opening and closing strings, each with two characters + * $.views.settings.delimiters(...) + * + * @param {string} openChars + * @param {string} [closeChars] + * @param {string} [link] + * @returns {Settings} + * + * Get delimiters + * delimsArray = $.views.settings.delimiters() + * + * @returns {string[]} + */ function $viewsDelimiters(openChars, closeChars, link) { - // Set the tag opening and closing delimiters and 'link' character. Default is "{{", "}}" and "^" - // openChars, closeChars: opening and closing strings, each with two characters if (!openChars) { return $subSettings.delimiters; } if ($isArray(openChars)) { return $viewsDelimiters.apply($views, openChars); } + linkChar = link ? link[0] : linkChar; + if (!/^(\W|_){5}$/.test(openChars + closeChars + linkChar)) { + error("Invalid delimiters"); // Must be non-word characters, and openChars and closeChars must each be length 2 + } + delimOpenChar0 = openChars[0]; + delimOpenChar1 = openChars[1]; + delimCloseChar0 = closeChars[0]; + delimCloseChar1 = closeChars[1]; - $subSettings.delimiters = [openChars, closeChars, linkChar = link ? link.charAt(0) : linkChar]; + $subSettings.delimiters = [delimOpenChar0 + delimOpenChar1, delimCloseChar0 + delimCloseChar1, linkChar]; - delimOpenChar0 = openChars.charAt(0); // Escape the characters - since they could be regex special characters - delimOpenChar1 = openChars.charAt(1); - delimCloseChar0 = closeChars.charAt(0); - delimCloseChar1 = closeChars.charAt(1); + // Escape the characters - since they could be regex special characters openChars = "\\" + delimOpenChar0 + "(\\" + linkChar + ")?\\" + delimOpenChar1; // Default is "{^{" closeChars = "\\" + delimCloseChar0 + "\\" + delimCloseChar1; // Default is "}}" // Build regex with new delimiters @@ -303,8 +321,8 @@ function getView(inner, type) { //view.get(inner, type) var views, i, l, found, view = this, - root = !type || type === "root"; - // If type is undefined, returns root view (view under top view). + root = type === "root"; + // view.get("root") returns view.root, view.get() returns view.parent, view.get(true) returns view.views[0]. if (inner) { // Go through views - this one, and all nested ones, depth-first - and return first one with given type. @@ -327,14 +345,16 @@ function getView(inner, type) { //view.get(inner, type) } else if (root) { // Find root view. (view whose parent is top view) found = view.root; - } else { + } else if (type) { while (view && !found) { // Go through views - this one, and all parent ones - and return first one with given type. found = view.type === type ? view : undefined; view = view.parent; } + } else { + found = view.parent; } - return found; + return found || undefined; } function getNestedIndex() { @@ -352,11 +372,13 @@ function getIndex() { getIndex.depends = "index"; -//========== -// View.hlp -//========== +//================== +// View.ctxPrm, etc. +//================== -function getPathObject(ob, path, ltOb, fn) { // Iterate through path to late paths: @a.b.c paths +/* Internal private: view._getOb() */ +function getPathObject(ob, path, ltOb, fn) { + // Iterate through path to late paths: @a.b.c paths // Return "" (or noop if leaf is a function @a.b.c(...) ) if intermediate object not yet available var prevOb, tokens, l, i = 0; @@ -390,7 +412,6 @@ function contextParameter(key, value, get) { storeView = this, isUpdate = !isRenderCall && arguments.length > 1, store = storeView.ctx; - if (key) { if (!storeView._) { // tagCtx.ctxPrm() call tagElse = storeView.index; @@ -405,7 +426,7 @@ function contextParameter(key, value, get) { } else { store = undefined; } - if (storeView.tagCtx || storeView.linked) { // Data-linked view, or tag instance + if (!isRenderCall && storeView.tagCtx || storeView.linked) { // Data-linked view, or tag instance if (!res || !res._cxp) { // Not a contextual parameter // Set storeView to tag (if this is a tag.ctxPrm() call) or to root view ("data" view of linked template) @@ -451,7 +472,7 @@ function contextParameter(key, value, get) { tagElse = obsCtxPrm.tagElse; newRes = res[1] // linkFn for compiled expression ? obsCtxPrm.tag && obsCtxPrm.tag.cvtArgs - ? obsCtxPrm.tag.cvtArgs(1, tagElse)[obsCtxPrm.ind] // = tag.bndArgs() - for tag contextual parameter + ? 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[0]._ocp; // Observable contextual parameter (uninitialized, or initialized as static expression, so no path dependencies) if (isUpdate) { @@ -478,6 +499,7 @@ function contextParameter(key, value, get) { } } +/* Internal private: view._getTmpl() */ function getTemplate(tmpl) { return tmpl && (tmpl.fn ? tmpl @@ -494,7 +516,7 @@ function convertVal(converter, view, tagCtx, onError) { var tag, value, argsLen, bindTo, // If tagCtx is an integer, then it is the key for the compiled function to return the boundTag tagCtx boundTag = typeof tagCtx === "number" && view.tmpl.bnds[tagCtx-1], - linkCtx = view.linkCtx; // For data-link="{cvt:...}"... + linkCtx = view._lc; // For data-link="{cvt:...}"... if (onError === undefined && boundTag && boundTag._lr) { // lateRender onError = ""; @@ -553,13 +575,16 @@ function convertVal(converter, view, tagCtx, onError) { return value != undefined ? value : ""; } -function convertArgs(bound, tagElse) { // tag.cvtArgs() or tag.cvtArgs(trueOrFalse, tagElse) +function convertArgs(tagElse, bound) { // tag.cvtArgs() or tag.cvtArgs(tagElse?, true?) var l, key, boundArgs, args, bindFrom, tag, converter, tagCtx = this; if (tagCtx.tagName) { tag = tagCtx; - tagCtx = tag.tagCtxs ? tag.tagCtxs[tagElse || 0] : tag.tagCtx; + tagCtx = (tag.tagCtxs || [tagCtx])[tagElse||0]; + if (!tagCtx) { + return; + } } else { tag = tagCtx.tag; } @@ -619,13 +644,14 @@ function argOrProp(context, key) { } function convertBoundArgs(tagElse) { // tag.bndArgs() - return this.cvtArgs(1, tagElse); + return this.cvtArgs(tagElse, 1); } //============= -// views._tag +// views.tag //============= +/* view.getRsc() */ function getResource(resourceType, itemName) { var res, store, view = this; @@ -662,7 +688,7 @@ function renderTag(tagName, parentView, tmpl, tagCtxs, isUpdate, onError) { content, callInit, mapDef, thisMap, args, bdArgs, props, tagDataMap, contentCtx, key, bindFromLength, bindToLength, linkedElement, defaultCtx, i = 0, ret = "", - linkCtx = parentView.linkCtx || 0, + linkCtx = parentView._lc || false, ctx = parentView.ctx, parentTmpl = tmpl || parentView.tmpl, // If tagCtxs is an integer, then it is the key for the compiled function to return the boundTag tagCtxs @@ -707,7 +733,7 @@ function renderTag(tagName, parentView, tmpl, tagCtxs, isUpdate, onError) { } if (tmpl = tagCtx.props.tmpl) { // If the tmpl property is overridden, set the value (when initializing, or, in case of binding: ^tmpl=..., when updating) - tagCtx.tmpl = parentView.getTmpl(tmpl); + tagCtx.tmpl = parentView._getTmpl(tmpl); tagCtx.content = tagCtx.content || tagCtx.tmpl; } @@ -725,8 +751,8 @@ function renderTag(tagName, parentView, tmpl, tagCtxs, isUpdate, onError) { if (linkCtx) { tag.inline = false; linkCtx.tag = tag; - tag.linkCtx = linkCtx; } + tag.linkCtx = linkCtx; if (tag._.bnd = boundTag || linkCtx.fn) { // Bound if {^{tag...}} or data-link="{tag...}" tag._.ths = tagCtx.params.props.this; // Tag has a this=expr binding, to get javascript reference to tag instance @@ -832,9 +858,9 @@ function renderTag(tagName, parentView, tmpl, tagCtxs, isUpdate, onError) { attr = tag.attr; tag._.noVws = attr && attr !== HTML; } - args = tag.cvtArgs(undefined, i); + args = tag.cvtArgs(i); if (tag.linkedCtxParam) { - bdArgs = tag.cvtArgs(1, i); + bdArgs = tag.cvtArgs(i, 1); m = bindFromLength; defaultCtx = tag.constructor.prototype.ctx; while (m--) { @@ -890,8 +916,11 @@ function renderTag(tagName, parentView, tmpl, tagCtxs, isUpdate, onError) { } itemRet = tagCtx.render(contentCtx, true) || (isUpdate ? undefined : ""); } - // No return value from render, and no template/content tagCtx.render(...), so return undefined - ret = ret ? ret + (itemRet || "") : itemRet; // If no rendered content, this will be undefined + ret = ret + ? ret + (itemRet || "") + : itemRet !== undefined + ? "" + itemRet + : undefined; // If no return value from render, and no template/content tagCtx.render(...), return undefined } tag.rendering = tag.rendering.rndr; // Remove tag.rendering object (if this is outermost render call. (In case of nested calls) } @@ -965,10 +994,10 @@ function View(context, type, parentView, data, template, key, onRender, contentT View.prototype = { get: getView, getIndex: getIndex, - getRsc: getResource, - getTmpl: getTemplate, ctxPrm: contextParameter, - getOb: getPathObject, + getRsc: getResource, + _getTmpl: getTemplate, + _getOb: getPathObject, _is: "view" }; @@ -1267,7 +1296,7 @@ function compileViewModel(name, type) { arr.push(ob); }); - ob = this.apply(this, arr); // Insantiate this View Model, passing getters args array to constructor + ob = this.apply(this, arr); // Instantiate this View Model, passing getters args array to constructor for (prop in data) { // Copy over any other properties. that are not get/set properties if (prop !== $expando && !getterNames[prop]) { ob[prop] = data[prop]; @@ -1440,14 +1469,27 @@ function tmplObject(markup, options) { // registerStore //============== +/** +* Internal. Register a store type (used for template, tags, helpers, converters) +*/ function registerStore(storeName, storeSettings) { +/** +* Generic store() function to register item, named item, or hash of items +* Also used as hash to store the registered items +* Used as implementation of $.templates(), $.views.templates(), $.views.tags(), $.views.helpers() and $.views.converters() +* +* @param {string|hash} name name - or selector, in case of $.templates(). Or hash of items +* @param {any} [item] (e.g. markup for named template) +* @param {template} [parentTmpl] For item being registered as private resource of template +* @returns {any|$.views} item, e.g. compiled template - or $.views in case of registering hash of items +*/ function theStore(name, item, parentTmpl) { // The store is also the function used to add items to the store. e.g. $.templates, or $.views.tags // For store of name 'thing', Call as: // $.views.things(items[, parentTmpl]), - // or $.views.things(name, item[, parentTmpl]) + // or $.views.things(name[, item, parentTmpl]) var compile, itemName, thisStore, cnt, onStore = $sub.onStore[storeName]; @@ -1504,6 +1546,15 @@ function registerStore(storeName, storeSettings) { $views[storeNames] = theStore; } +/** +* Add settings such as: +* $.views.settings.allowCode(true) +* @param {boolean} value +* @returns {Settings} +* +* allowCode = $.views.settings.allowCode() +* @returns {boolean} +*/ function addSetting(st) { $viewsSettings[st] = function(value) { return arguments.length @@ -1543,6 +1594,17 @@ function dataMap(mapDef) { // renderContent //============== +/** Render the template as a string, using the specified data and helpers/context +* $("#tmpl").render(), tmpl.render(), tagCtx.render(), $.render.namedTmpl() +* +* @param {any} data +* @param {hash} [context] helpers or context +* @param {boolean} [noIteration] +* @param {View} [parentView] internal +* @param {string} [key] internal +* @param {function} [onRender] internal +* @returns {string} rendered template internal +*/ function renderContent(data, context, noIteration, parentView, key, onRender) { var i, l, tag, tmpl, tagCtx, isTopRenderCall, prevData, prevIndex, view = parentView, @@ -1559,7 +1621,7 @@ function renderContent(data, context, noIteration, parentView, key, onRender) { // This is a call from renderTag or tagCtx.render(...) tagCtx = this; view = view || tagCtx.view; - tmpl = view.getTmpl(tag.template || tagCtx.tmpl); + tmpl = view._getTmpl(tag.template || tagCtx.tmpl); if (!arguments.length) { data = tag.contentCtx && $isFunction(tag.contentCtx) ? data = tag.contentCtx(data) @@ -1662,7 +1724,7 @@ function renderWithViews(tmpl, data, context, noIteration, view, key, onRender, context.link = false; } if (itemVar = tagCtx.props.itemVar) { - if (itemVar.charAt(0) !== "~") { + if (itemVar[0] !== "~") { syntaxError("Use itemVar='~myItem'"); } itemVar = itemVar.slice(1); @@ -1763,7 +1825,7 @@ function onRenderError(e, view, fallback) { message = fallback; // There is a settings.debugMode(handler) onError override. Call it, and use return value (if any) to replace message } - return view && !view.linkCtx ? $converters.html(message) : message; + return view && !view._lc ? $converters.html(message) : message; } function error(message) { @@ -1885,7 +1947,7 @@ function tmplFn(markup, tmpl, isLinkExpr, convertBack, hasElse) { keyValue = "undefined"; // this=some.path is always a to parameter (one-way), so don't need to compile/evaluate some.path initialization } if (param) { - isLateOb = isLateOb || param.charAt(0) === "@"; + isLateOb = isLateOb || param[0] === "@"; } key = "'" + keyToken + "':"; if (arg) { @@ -2043,7 +2105,7 @@ function parseParams(params, pathBindings, tmpl, isLinkExpr) { syntaxError(allPath); } if (!subPath) { - allPath = (late // late path @a.b.c: not throw on 'property of undefined' if a undefined, and will use getOb() after linking to resolve late. + allPath = (late // late path @a.b.c: not throw on 'property of undefined' if a undefined, and will use _getOb() after linking to resolve late. ? (isLinkExpr ? '' : '(ltOb.lt=ltOb.lt||') + '(ob=' : "" ) @@ -2053,7 +2115,7 @@ function parseParams(params, pathBindings, tmpl, isLinkExpr) { ? "view" : "data") + (late - ? ')===undefined' + (isLinkExpr ? '' : ')') + '?"":view.getOb(ob,"' + ? ')===undefined' + (isLinkExpr ? '' : ')') + '?"":view._getOb(ob,"' : "" ) + (leafToken @@ -2085,7 +2147,7 @@ function parseParams(params, pathBindings, tmpl, isLinkExpr) { path = "^" + path.slice(1); } theOb.sb = path; - theOb.bnd = theOb.bnd || path.charAt(0) === "^"; + theOb.bnd = theOb.bnd || path[0] === "^"; } } else { binds.push(path); @@ -2104,7 +2166,7 @@ function parseParams(params, pathBindings, tmpl, isLinkExpr) { lftPrn = lftPrn || lftPrn0 || lftPrn2; path = path || path2; - if (late && (late = !/\)|]/.test(full.charAt(index-1)))) { + if (late && (late = !/\)|]/.test(full[index-1]))) { path = path.slice(1).split(".").join("^"); // Late path @z.b.c. Use "^" rather than "." to ensure that deep binding will be used } // Could do this - but not worth perf cost?? :- @@ -2225,7 +2287,7 @@ function parseParams(params, pathBindings, tmpl, isLinkExpr) { pathStart = {}, // tracks the start of the current path such as c^d() in the above example result; - if (params.charAt(0) === "@") { + if (params[0] === "@") { params = params.replace(rBracketQuote, "."); } result = (params + (tmpl ? " " : "")).replace(rParams, parseTokens); @@ -2362,8 +2424,8 @@ function buildCode(ast, tmpl, isLinkExpr) { : (getsVal = true, "((v=" + params[0] + ')!=null?v:' + (isLinkExpr ? 'null)' : '"")')) // Non strict equality so data-link="title{:expr}" with expr=null/undefined removes title attribute ) - : (hasTag = true, "\n{view:view,tmpl:" // Add this tagCtx to the compiled code for the tagCtxs to be passed to renderTag() - + (content ? nestedTmpls.length : "0") + "," // For block tags, pass in the key (nestedTmpls.length) to the nested content template + : (hasTag = true, "\n{view:view,content:false,tmpl:" // Add this tagCtx to the compiled code for the tagCtxs to be passed to renderTag() + + (content ? nestedTmpls.length : "false") + "," // For block tags, pass in the key (nestedTmpls.length) to the nested content template + tagCtx + "},")); if (tagAndElses && !nextIsElse) { @@ -2544,6 +2606,14 @@ function getTargetSorted(value, tagCtx) { return value; } +/** Render the template as a string, using the specified data and helpers/context +* $("#tmpl").render() +* +* @param {any} data +* @param {hash} [helpersOrContext] +* @param {boolean} [noIteration] +* @returns {string} rendered template +*/ function $fnRender(data, context, noIteration) { var tmplElem = this.jquery && (this[0] || error('Unknown template')), // Targeted element not found for jQuery template selector such as "#myTmpl" tmpl = tmplElem.getAttribute(tmplAttr); @@ -2666,6 +2736,14 @@ if (!(jsr || $ && $.render)) { addSetting(setting); } + /** + * $.views.settings.debugMode(true) + * @param {boolean} debugMode + * @returns {Settings} + * + * debugMode = $.views.settings.debugMode() + * @returns {boolean} + */ ($viewsSettings.debugMode = function(debugMode) { return debugMode === undefined ? $subSettings.debugMode diff --git a/jsrender.min.js b/jsrender.min.js index 0ffdf8d..661eea4 100644 --- a/jsrender.min.js +++ b/jsrender.min.js @@ -1,4 +1,4 @@ -/*! JsRender v0.9.91 (Beta): http://jsviews.com/#jsrender */ +/*! JsRender v1.0.0: 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)!Ot.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 d(t){this.name=(e.link?"JsViews":"JsRender")+" Error",this.message=t||this.name}function l(t,e){if(t){for(var n in e)t[n]=e[n];return t}}function p(t,e,n){return t?dt(t)?p.apply(ot,t):(gt.delimiters=[t,e,wt=n?n.charAt(0):wt],mt=t.charAt(0),xt=t.charAt(1),_t=e.charAt(0),bt=e.charAt(1),t="\\"+mt+"(\\"+wt+")?\\"+xt,e="\\"+_t+"\\"+bt,rt="(?:(\\w+(?=[\\/\\s\\"+_t+"]))|(\\w+)?(:)|(>)|(\\*))\\s*((?:[^\\"+_t+"]|\\"+_t+"(?!\\"+bt+"))*?)",ft.rTag="(?:"+rt+")",rt=new RegExp("(?:"+t+rt+"(\\/)?|\\"+mt+"(\\"+wt+")?\\"+xt+"(?:(?:\\/(\\w+))\\s*|!--[\\s\\S]*?--))"+e,"g"),ft.rTmpl=new RegExp("^\\s|\\s$|<.*>|([^\\\\]|^)[{}]|"+t+".*"+e),ht):gt.delimiters}function c(t,e){e||t===!0||(e=t,t=void 0);var n,r,i,o,a=this,s=!e||"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),c=f,v&&v.hasOwnProperty(n)||(v=ct).hasOwnProperty(n)){if(s=v[n],"tag"===n||"tagCtx"===n||"root"===n||"parentTags"===n||f._.it===n)return s}else v=void 0;if((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:c,_key:n}],s._cxp={path:Tt,ind:0,updateValue:function(t,n){return e.observable(s[0]).setProperty(Tt,t),this}})),d=s&&s._cxp)){if(arguments.length>2)return a=s[1]?ft._ceo(s[1].deps):[Tt],a.unshift(s[0]),a._cxp=d,a;if(p=d.tagElse,u=s[1]?d.tag&&d.tag.cvtArgs?d.tag.cvtArgs(1,p)[d.ind]:s[1](s[0].data,s[0],ft):s[0]._ocp,g)return s&&u!==r&&ft._ucp(n,r,f,d),f;s=u}return s&&st(s)&&(o=function(){return s.apply(this&&this!==t?this:c,arguments)},l(o,s),o._vw=c),o||s}}function h(t){return t&&(t.fn?t:this.getRsc("templates",t)||lt(t))}function m(t,e,n,r){var o,a,s,d,p="number"==typeof n&&e.tmpl.bnds[n-1],c=e.linkCtx;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(o=c&&c.tag,n.view=e,!o){if(o=l(new ft._tg,{_:{bnd:p,unlinked:!0,lt:n.lt},inline:!c,tagName:":",convert:t,flow:!0,tagCtx:n,tagCtxs:[n],_is:"tag"}),s=n.args.length,s>1)for(d=o.bindTo=[];s--;)d.unshift(s);c&&(c.tag=o,o.linkCtx=c),n.ctx=Q(n.ctx,(c?c.view:e).ctx),i(o,n)}o._er=r&&a,o.ctx=n.ctx||o.ctx||{},n.ctx=void 0,a=o.cvtArgs()[0],o._er=r&&a}else a=n.args[0];return a=p&&e._.onRender?e._.onRender(a,e,o):a,void 0!=a?a:""}function x(t,e){var n,r,i,o,a,s,d,l=this;if(l.tagName?(s=l,l=s.tagCtxs?s.tagCtxs[e||0]:s.tagCtx):s=l.tag,a=s.bindFrom,o=l.args,(d=s.convert)&&""+d===d&&(d="true"===d?void 0:l.view.getRsc("converters",d)||S("Unknown converter: '"+d+"'")),d&&!t&&(o=o.slice()),a){for(i=[],n=a.length;n--;)r=a[n],i.unshift(_(l,r));t&&(o=i)}if(d){if(d=d.apply(s,i||o),void 0===d)return o;if(a=a||[0],n=a.length,dt(d)&&d.length===n||(d=[d],a=[0],n=1),t)o=d;else for(;n--;)r=a[n],+r===r&&(o[r]=d[n])}return o}function _(t,e){return t=t[+e===e?"args":"props"],t&&t[e]}function b(t){return this.cvtArgs(1,t)}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=d[t];if(void 0!==e)for(e=dt(e)?e:[e],h=e.length;h--;)J=e[h],isNaN(parseInt(J))||(e[h]=parseInt(J));return e||[0]}e=e||it;var d,l,p,c,u,f,g,h,m,w,y,k,C,T,j,A,N,R,F,V,M,$,E,I,D,J,U,q,K,L,B=0,H="",Z=e.linkCtx||0,z=e.ctx,G=n||e.tmpl,W="number"==typeof r&&e.tmpl.bnds[r-1];for("tag"===t._is?(d=t,t=d.tagName,r=d.tagCtxs,p=d.template):(l=e.getRsc("tags",t)||S("Unknown tag: {{"+t+"}} "),p=l.template),void 0===a&&W&&(W._lr=l.lateRender&&W._lr!==!1||W._lr)&&(a=""),void 0!==a?(H+=a,r=a=[{props:{},args:[],params:{props:{}}}]):W&&(r=W(e.data,e,ft)),g=r.length;B0&&(a=n)){if(!a)if(/^\.\/[^\\:*?"<>]*$/.test(n))(s=lt[t=t||n])?n=s:a=document.getElementById(n);else if(e.fn&&!ft.rTmpl.test(n))try{a=e(n,document)[0]}catch(d){}a&&("SCRIPT"!==a.tagName&&S(n+": Use script block, not "+a.tagName),i?n=a.innerHTML:(o=a.getAttribute(Ht),o&&(o!==Zt?(n=lt[o],delete lt[o]):e.fn&&(n=e.data(a)[Zt])),o&&n||(t=t||(e.fn?Zt:n),n=A(t,a.innerHTML,r,i)),n.tmplName=t=t||o,t!==Zt&&(lt[t]=n),a.setAttribute(Ht,t),e.fn&&e.data(a,Zt,n))),a=void 0}else n.fn||(n=void 0);return n}var a,s,d=n=n||"";if(ft._html=pt.html,0===i&&(i=void 0,d=o(d)),i=i||(n.markup?n.bnds?l({},n):n:{}),i.tmplName=i.tmplName||t||"unnamed",r&&(i._parentTmpl=r),!d&&n.markup&&(d=o(n.markup))&&d.fn&&(d=d.markup),void 0!==d)return d.render||n.render?d.tmpls&&(s=d):(n=V(d,i),J(d.replace(Ft,"\\$&"),n)),s||(s=l(function(){return s.render.apply(s,arguments)},n),C(s)),s}function N(t,e){return st(t)?t.call(e):t}function R(t){for(var e=[],n=0,r=t.length;nO-(U||0))){if(U=I.slice(U,O+i.length),q!==!0)if(K=a||f[h-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()});$=xt+":"+U+" onerror=''"+_t,q=v[$],q||(v[$]=!0,v[$]=q=J($,n,!0)),q!==!0&&B&&(B._cpfn=q,B.prm=u.bd,B.bnd=B.bnd||B.path&&B.path.indexOf("^")>=0)}return l?(l=!F,l?i:R+'"'):d?(d=!V,d?i:R+'"'):(_?(x[h]=O++,u=f[++h]={bd:[]},_):"")+(P?h?"":(g=I.slice(g,O),(o?(o=s=a=!1,"\b"):"\b,")+g+(g=O+i.length,c&&e.push(u.bd=[]),"\b")):C?(h&&D(t),c&&e.pop(),o="_"+w,s=b,g=O+i.length,c&&(c=u.bd=e[o]=[],c.skp=!b),w+":"):w?w.split("^").join(".").replace(jt,S)+(A?(u=f[++h]={bd:[]},m[h]=Q,A):y):y?y:M?(M=m[h]||M,m[h]=!1,u=f[--h],M+(A?(u=f[++h],m[h]=Q,A):"")):N?(m[h]||D(t),","):p?"":(l=F,d=V,'"'))}D(t)}var o,a,s,d,l,p,c=e&&e[0],u={bd:c},f={0:u},g=0,v=(n?n.links:c&&(c.links=c.links||{}))||it.tmpl.links,h=0,m={},x={};return"@"===t.charAt(0)&&(t=t.replace(Ut,".")),p=(t+(n?" ":"")).replace(At,i),!h&&p||D(t)}function B(t,e,n){var r,i,o,a,s,d,l,p,c,u,f,g,v,h,m,x,_,b,w,y,k,C,T,j,A,N,R,F,M,$,E,P,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(Nt," ").slice(1,-1)+'"':e,e=0):(b=e.tmplName||"unnamed",e.allowCode&&(q.allowCode=!0),e.debug&&(q.debug=!0),f=e.bnds,_=e.tmpls),r=0;r":a+o):(k&&(w=V(C,q),w.tmplName=b+"/"+o,w.useViews=w.useViews||S,B(k,w),S=w.useViews,_.push(w)),A||(y=o,S=S||o&&(!ut[o]||!ut[o].flow),j=J,J=""),T=t[r+1],T=T&&"else"===T[0]),M=F?";\ntry{\nret+=":"\n+",h="",m="",N&&(g||$||a&&a!==Bt||E)){if(R=new Function("data,view,j,u","// "+b+" "+ ++I+" "+o+P+"{"+s+"};"+O),R._er=F,R._tag=o,R._bd=!!g,R._lr=E,n)return R;U(R,g),x='c("'+a+'",view,',u=!0,h=x+I+",",m=")"}if(J+=N?(n?(F?"try{\n":"")+"return ":M)+(u?(u=void 0,S=c=!0,x+(R?(f[I-1]=R,I):"{"+s+"}")+")"):">"===o?(l=!0,"h("+v[0]+")"):(p=!0,"((v="+v[0]+")!=null?v:"+(n?"null)":'"")'))):(d=!0,"\n{view:view,tmpl:"+(k?_.length:"0")+","+s+"},"),y&&!T){if(J="["+J.slice(0,-1)+"]",x='t("'+y+'",view,this,',n||g){if(J=new Function("data,view,j,u"," // "+b+" "+I+" "+y+P+J+O),J._er=F,J._tag=y,g&&U(f[I-1]=J,g),J._lr=E,n)return J;h=x+I+",undefined,",m=")"}J=j+M+x+(g&&I||J)+")",g=0,y=0}F&&!T&&(S=!0,J+=";\n}catch(e){ret"+(n?"urn ":"+=")+h+"j._err(e,view,"+F+")"+m+";}"+(n?"":"ret=ret"))}J="// "+b+(q.debug?"\ndebugger;":"")+"\nvar v"+(d?",t=j._tag":"")+(c?",c=j._cnvt":"")+(l?",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?l(l({},e),t):t:e&&l({},e)}function H(t,n){var r,i,o=[];if(typeof t===Qt||st(t))for(r in t)i=t[r],r===at||!t.hasOwnProperty(r)||n.props.noFunctions&&e.isFunction(i)||o.push({key:r,prop:i});return Z(o,n)}function Z(t,n){var r,i,o,a=n.tag,s=n.props,d=n.params.props,l=s.filter,p=s.sort,c=p===!0,u=parseInt(s.step),f=s.reverse?-1:1;if(!dt(t))return t;if(c||p&&""+p===p?(r=t.map(function(t,e){return t=c?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)),u>1){for(i=0,o=t.length,r=[];i=|[<>%*:?\/]|(=))\s*|(!*?(@)?[#~]?[\w$.^]+)([([])?)|(,\s*)|(\(?)\\?(?:(')|("))|(?:\s*(([)\]])(?=[.^]|\s*$|[^([])|[)\]])([([]?))|(\s+)/g,Nt=/[ \t]*(\r\n|\n|\r)/g,Rt=/\\(['"])/g,Ft=/['"\\]/g,Vt=/(?:\x08|^)(onerror:)?(?:(~?)(([\w$_\.]+):)?([^\x08]+))\x08(,)?([^\x08]+)/gi,Mt=/^if\s/,$t=/<(\w+)[>\s]/,Et=/[\x00`><"'&=]/g,Pt=/[\x00`><\"'&=]/,Ot=/^on[A-Z]|^convert(Back)?$/,It=/^\#\d+_`[\s\S]*\/\d+_`$/,St=Et,Dt=/[&<>]/g,Jt=/&(amp|gt|lt);/g,Ut=/\[['"]?|['"]?\]/g,qt=0,Kt={"&":"&","<":"<",">":">","\0":"�","'":"'",'"':""","`":"`","=":"="},Lt={amp:"&",gt:">",lt:"<"},Bt="html",Qt="object",Ht="data-jsv-tmpl",Zt="jsvTmpl",zt="For #index in nested block use #getIndex().",Gt={},Wt=t.jsrender,Xt=Wt&&e&&!e.render,Yt={template:{compile:A},tag:{compile:T},viewModel:{compile:F},helper:{},converter:{}};if(ot={jsviews:Ct,sub:{View:k,Err:d,tmplFn:J,parse:L,extend:l,extendCtx:Q,syntaxErr:D,onStore:{template:function(t,e){null===e?delete Gt[t]:Gt[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:p,advanced:function(t){return t?(l(vt,t),ft.advSet(),ht):vt}},map:E},(d.prototype=new Error).constructor=d,u.depends=function(){return[this.get("item"),"index"]},f.depends="index",k.prototype={get:c,getIndex:f,getRsc:w,getTmpl:h,ctxPrm:v,getOb:g,_is:"view"},ft=ot.sub,ht=ot.settings,!(Wt||e&&e.render)){for(nt in Yt)M(nt,Yt[nt]);if(pt=ot.converters,ct=ot.helpers,ut=ot.tags,ft._tg.prototype={baseApply:j,cvtArgs:x,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;l(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&&(l(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=Gt,e.views=ot,e.templates=lt=ot.templates;for(yt in gt)$(yt);(ht.debugMode=function(t){return void 0===t?gt.debugMode:(gt.debugMode=t,gt.onError=t+""===t?function(){return t}:st(t)?t:void 0,ht)})(!1),vt=gt.advanced={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:E(Z),init:function(t,e){var n,r,i,o=this,a=o.tagCtxs;for(n=a.length;n--;)r=a[n],i=r.props,r.argDefault=void 0===i.end||r.args.length>0,r.argDefault!==!1&&dt(r.args[0])&&(void 0!==i.sort||r.params.props.start||r.params.props.end||void 0!==i.step||i.filter||i.reverse)&&(i.dataMap=o.sortDataMap)},render:function(t){var e,n,r,i,o,a=this,s=a.tagCtx,d=s.argDefault===!1,l=s.props,p=d||s.args.length,c="",u=0;if(!a.rendering.done){if(e=p?t:s.view.data,d)for(d=l.reverse?"unshift":"push",i=+l.end,o=+l.step||1,e=[],r=+l.start||0;(i-r)*o>0;r+=o)e[d](r);void 0!==e&&(n=dt(e),c+=s.render(e,!p||l.noIteration),u+=n?e.length:1),(a.rendering.done=u)&&(a.selected=s.index)}return c},flow:!0},props:{baseTag:"for",dataMap:E(H),init:a,flow:!0},include:{flow:!0},"*":{render:o,flow:!0},":*":{render:o,flow:!0},dbg:ct.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,dt=(e||Wt).isArray,ht.delimiters("{{","}}","^"),Xt&&Wt.views.sub._jq(e),e||Wt},window); +!function(e,t){var n=t.jQuery;"object"==typeof exports?module.exports=n?e(t,n):function(n){if(n&&!n.fn)throw"Provide jQuery or null";return e(t,n)}:"function"==typeof define&&define.amd?define(function(){return e(t)}):e(t,!1)}(function(e,t){"use strict";function n(e,t){return function(){var n,r=this,i=r.base;return r.base=e,n=t.apply(r,arguments),r.base=i,n}}function r(e,t){return ae(t)&&(t=n(e?e._d?e:n(s,e):s,t),t._d=(e&&e._d||0)+1),t}function i(e,t){var n,i=t.props;for(n in i)!Oe.test(n)||e[n]&&e[n].fix||(e[n]="convert"!==n?r(e.constructor.prototype[n],i[n]):i[n])}function o(e){return e}function s(){return""}function a(e){try{throw console.log("JsRender dbg breakpoint: "+e),"dbg breakpoint"}catch(t){}return this.base?this.baseApply(arguments):e}function d(e){this.name=(t.link?"JsViews":"JsRender")+" Error",this.message=e||this.name}function l(e,t){if(e){for(var n in t)e[n]=t[n];return e}}function p(e,t,n){return e?de(e)?p.apply(oe,e):(we=n?n[0]:we,/^(\W|_){5}$/.test(e+t+we)||S("Invalid delimiters"),he=e[0],_e=e[1],be=t[0],xe=t[1],ge.delimiters=[he+_e,be+xe,we],e="\\"+he+"(\\"+we+")?\\"+_e,t="\\"+be+"\\"+xe,re="(?:(\\w+(?=[\\/\\s\\"+be+"]))|(\\w+)?(:)|(>)|(\\*))\\s*((?:[^\\"+be+"]|\\"+be+"(?!\\"+xe+"))*?)",fe.rTag="(?:"+re+")",re=new RegExp("(?:"+e+re+"(\\/)?|\\"+he+"(\\"+we+")?\\"+_e+"(?:(?:\\/(\\w+))\\s*|!--[\\s\\S]*?--))"+t,"g"),fe.rTmpl=new RegExp("^\\s|\\s$|<.*>|([^\\\\]|^)[{}]|"+e+".*"+t),me):ge.delimiters}function u(e,t){t||e===!0||(t=e,e=void 0);var n,r,i,o,s=this,a="root"===t;if(e){if(o=t&&s.type===t&&s,!o)if(n=s.views,s._.useKey){for(r in n)if(o=t?n[r].get(e,t):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=ue).hasOwnProperty(n)){if(a=v[n],"tag"===n||"tagCtx"===n||"root"===n||"parentTags"===n||f._.it===n)return a}else v=void 0;if((!ke&&f.tagCtx||f.linked)&&(a&&a._cxp||(f=f.tagCtx||ae(a)?f:(f=f.scope||f,!f.isTop&&f.ctx.tag||f),void 0!==a&&f.tagCtx&&(f=f.tagCtx.view.scope),v=f._ocps,a=v&&v.hasOwnProperty(n)&&v[n]||a,a&&a._cxp||!i&&!g||((v||(f._ocps=f._ocps||{}))[n]=a=[{_ocp:a,_vw:u,_key:n}],a._cxp={path:Te,ind:0,updateValue:function(e,n){return t.observable(a[0]).setProperty(Te,e),this}})),d=a&&a._cxp)){if(arguments.length>2)return s=a[1]?fe._ceo(a[1].deps):[Te],s.unshift(a[0]),s._cxp=d,s;if(p=d.tagElse,c=a[1]?d.tag&&d.tag.cvtArgs?d.tag.cvtArgs(p,1)[d.ind]:a[1](a[0].data,a[0],fe):a[0]._ocp,g)return a&&c!==r&&fe._ucp(n,r,f,d),f;a=c}return a&&ae(a)&&(o=function(){return a.apply(this&&this!==e?this:u,arguments)},l(o,a),o._vw=u),o||a}}function m(e){return e&&(e.fn?e:this.getRsc("templates",e)||le(e))}function h(e,t,n,r){var o,s,a,d,p="number"==typeof n&&t.tmpl.bnds[n-1],u=t._lc;if(void 0===r&&p&&p._lr&&(r=""),void 0!==r?n=r={props:{},args:[r]}:p&&(n=p(t.data,t,fe)),p=p._bd&&p,e||p){if(o=u&&u.tag,n.view=t,!o){if(o=l(new fe._tg,{_:{bnd:p,unlinked:!0,lt:n.lt},inline:!u,tagName:":",convert:e,flow:!0,tagCtx:n,tagCtxs:[n],_is:"tag"}),a=n.args.length,a>1)for(d=o.bindTo=[];a--;)d.unshift(a);u&&(u.tag=o,o.linkCtx=u),n.ctx=Q(n.ctx,(u?u.view:t).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&&t._.onRender?t._.onRender(s,t,o):s,void 0!=s?s:""}function _(e,t){var n,r,i,o,s,a,d,l=this;if(l.tagName){if(a=l,l=(a.tagCtxs||[l])[e||0],!l)return}else a=l.tag;if(s=a.bindFrom,o=l.args,(d=a.convert)&&""+d===d&&(d="true"===d?void 0:l.view.getRsc("converters",d)||S("Unknown converter: '"+d+"'")),d&&!t&&(o=o.slice()),s){for(i=[],n=s.length;n--;)r=s[n],i.unshift(b(l,r));t&&(o=i)}if(d){if(d=d.apply(a,i||o),void 0===d)return o;if(s=s||[0],n=s.length,de(d)&&d.length===n||(d=[d],s=[0],n=1),t)o=d;else for(;n--;)r=s[n],+r===r&&(o[r]=d[n])}return o}function b(e,t){return e=e[+t===t?"args":"props"],e&&e[t]}function x(e){return this.cvtArgs(e,1)}function w(e,t){var n,r,i=this;if(""+t===t){for(;void 0===n&&i;)r=i.tmpl&&i.tmpl[e],n=r&&r[t],i=i.parent;return n||oe[e][t]}}function y(e,t,n,r,o,s){function a(e){var t=d[e];if(void 0!==t)for(t=de(t)?t:[t],m=t.length;m--;)J=t[m],isNaN(parseInt(J))||(t[m]=parseInt(J));return t||[0]}t=t||ie;var d,l,p,u,c,f,g,m,h,w,y,k,C,T,j,A,N,R,F,V,$,M,E,I,D,J,U,q,K,L,B=0,H="",W=t._lc||!1,Z=t.ctx,z=n||t.tmpl,G="number"==typeof r&&t.tmpl.bnds[r-1];for("tag"===e._is?(d=e,e=d.tagName,r=d.tagCtxs,p=d.template):(l=t.getRsc("tags",e)||S("Unknown tag: {{"+e+"}} "),p=l.template),void 0===s&&G&&(G._lr=l.lateRender&&G._lr!==!1||G._lr)&&(s=""),void 0!==s?(H+=s,r=s=[{props:{},args:[],params:{props:{}}}]):G&&(r=G(t.data,t,fe)),g=r.length;B0&&(s=n)){if(!s)if(/^\.\/[^\\:*?"<>]*$/.test(n))(a=le[e=e||n])?n=a:s=document.getElementById(n);else if(t.fn&&!fe.rTmpl.test(n))try{s=t(n,document)[0]}catch(d){}s&&("SCRIPT"!==s.tagName&&S(n+": Use script block, not "+s.tagName),i?n=s.innerHTML:(o=s.getAttribute(He),o&&(o!==We?(n=le[o],delete le[o]):t.fn&&(n=t.data(s)[We])),o&&n||(e=e||(t.fn?We:n),n=A(e,s.innerHTML,r,i)),n.tmplName=e=e||o,e!==We&&(le[e]=n),s.setAttribute(He,e),t.fn&&t.data(s,We,n))),s=void 0}else n.fn||(n=void 0);return n}var s,a,d=n=n||"";if(fe._html=pe.html,0===i&&(i=void 0,d=o(d)),i=i||(n.markup?n.bnds?l({},n):n:{}),i.tmplName=i.tmplName||e||"unnamed",r&&(i._parentTmpl=r),!d&&n.markup&&(d=o(n.markup))&&d.fn&&(d=d.markup),void 0!==d)return d.render||n.render?d.tmpls&&(a=d):(n=V(d,i),J(d.replace(Fe,"\\$&"),n)),a||(a=l(function(){return a.render.apply(a,arguments)},n),C(a)),a}function N(e,t){return ae(e)?e.call(t):e}function R(e){for(var t=[],n=0,r=e.length;nO-(U||0))){if(U=I.slice(U,O+i.length),q!==!0)if(K=s||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()});M=_e+":"+U+" onerror=''"+be,q=v[M],q||(v[M]=!0,v[M]=q=J(M,n,!0)),q!==!0&&B&&(B._cpfn=q,B.prm=c.bd,B.bnd=B.bnd||B.path&&B.path.indexOf("^")>=0)}return l?(l=!F,l?i:R+'"'):d?(d=!V,d?i:R+'"'):(b?(_[m]=O++,c=f[++m]={bd:[]},b):"")+(P?m?"":(g=I.slice(g,O),(o?(o=a=s=!1,"\b"):"\b,")+g+(g=O+i.length,u&&t.push(c.bd=[]),"\b")):C?(m&&D(e),u&&t.pop(),o="_"+w,a=x,g=O+i.length,u&&(u=c.bd=t[o]=[],u.skp=!x),w+":"):w?w.split("^").join(".").replace(je,S)+(A?(c=f[++m]={bd:[]},h[m]=Q,A):y):y?y:$?($=h[m]||$,h[m]=!1,c=f[--m],$+(A?(c=f[++m],h[m]=Q,A):"")):N?(h[m]||D(e),","):p?"":(l=F,d=V,'"'))}D(e)}var o,s,a,d,l,p,u=t&&t[0],c={bd:u},f={0:c},g=0,v=(n?n.links:u&&(u.links=u.links||{}))||ie.tmpl.links,m=0,h={},_={};return"@"===e[0]&&(e=e.replace(Ue,".")),p=(e+(n?" ":"")).replace(Ae,i),!m&&p||D(e)}function B(e,t,n){var r,i,o,s,a,d,l,p,u,c,f,g,v,m,h,_,b,x,w,y,k,C,T,j,A,N,R,F,$,M,E,P,O,I=0,S=ve.useViews||t.useViews||t.tags||t.templates||t.helpers||t.converters,J="",q={},L=e.length;for(""+t===t?(x=n?'data-link="'+t.replace(Ne," ").slice(1,-1)+'"':t,t=0):(x=t.tmplName||"unnamed",t.allowCode&&(q.allowCode=!0),t.debug&&(q.debug=!0),f=t.bnds,b=t.tmpls),r=0;r":s+o):(k&&(w=V(C,q),w.tmplName=x+"/"+o,w.useViews=w.useViews||S,B(k,w),S=w.useViews,b.push(w)),A||(y=o,S=S||o&&(!ce[o]||!ce[o].flow),j=J,J=""),T=e[r+1],T=T&&"else"===T[0]),$=F?";\ntry{\nret+=":"\n+",m="",h="",N&&(g||M||s&&s!==Be||E)){if(R=new Function("data,view,j,u","// "+x+" "+ ++I+" "+o+P+"{"+a+"};"+O),R._er=F,R._tag=o,R._bd=!!g,R._lr=E,n)return R;U(R,g),_='c("'+s+'",view,',c=!0,m=_+I+",",h=")"}if(J+=N?(n?(F?"try{\n":"")+"return ":$)+(c?(c=void 0,S=u=!0,_+(R?(f[I-1]=R,I):"{"+a+"}")+")"):">"===o?(l=!0,"h("+v[0]+")"):(p=!0,"((v="+v[0]+")!=null?v:"+(n?"null)":'"")'))):(d=!0,"\n{view:view,content:false,tmpl:"+(k?b.length:"false")+","+a+"},"),y&&!T){if(J="["+J.slice(0,-1)+"]",_='t("'+y+'",view,this,',n||g){if(J=new Function("data,view,j,u"," // "+x+" "+I+" "+y+P+J+O),J._er=F,J._tag=y,g&&U(f[I-1]=J,g),J._lr=E,n)return J;m=_+I+",undefined,",h=")"}J=j+$+_+(g&&I||J)+")",g=0,y=0}F&&!T&&(S=!0,J+=";\n}catch(e){ret"+(n?"urn ":"+=")+m+"j._err(e,view,"+F+")"+h+";}"+(n?"":"ret=ret"))}J="// "+x+(q.debug?"\ndebugger;":"")+"\nvar v"+(d?",t=j._tag":"")+(u?",c=j._cnvt":"")+(l?",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 t&&(t.fn=J,t.useViews=!!S),J}function Q(e,t){return e&&e!==t?t?l(l({},t),e):e:t&&l({},t)}function H(e,n){var r,i,o=[];if(typeof e===Qe||ae(e))for(r in e)i=e[r],r===se||!e.hasOwnProperty(r)||n.props.noFunctions&&t.isFunction(i)||o.push({key:r,prop:i});return W(o,n)}function W(e,n){var r,i,o,s=n.tag,a=n.props,d=n.params.props,l=a.filter,p=a.sort,u=p===!0,c=parseInt(a.step),f=a.reverse?-1:1;if(!de(e))return e;if(u||p&&""+p===p?(r=e.map(function(e,t){return e=u?e:g(e,p),{i:t,v:""+e===e?e.toLowerCase():e}}),r.sort(function(e,t){return e.v>t.v?f:e.ve.length?e.length:+o,e=e.slice(i,o)),c>1){for(i=0,o=e.length,r=[];i=|[<>%*:?\/]|(=))\s*|(!*?(@)?[#~]?[\w$.^]+)([([])?)|(,\s*)|(\(?)\\?(?:(')|("))|(?:\s*(([)\]])(?=[.^]|\s*$|[^([])|[)\]])([([]?))|(\s+)/g,Ne=/[ \t]*(\r\n|\n|\r)/g,Re=/\\(['"])/g,Fe=/['"\\]/g,Ve=/(?:\x08|^)(onerror:)?(?:(~?)(([\w$_\.]+):)?([^\x08]+))\x08(,)?([^\x08]+)/gi,$e=/^if\s/,Me=/<(\w+)[>\s]/,Ee=/[\x00`><"'&=]/g,Pe=/[\x00`><\"'&=]/,Oe=/^on[A-Z]|^convert(Back)?$/,Ie=/^\#\d+_`[\s\S]*\/\d+_`$/,Se=Ee,De=/[&<>]/g,Je=/&(amp|gt|lt);/g,Ue=/\[['"]?|['"]?\]/g,qe=0,Ke={"&":"&","<":"<",">":">","\0":"�","'":"'",'"':""","`":"`","=":"="},Le={amp:"&",gt:">",lt:"<"},Be="html",Qe="object",He="data-jsv-tmpl",We="jsvTmpl",Ze="For #index in nested block use #getIndex().",ze={},Ge=e.jsrender,Xe=Ge&&t&&!t.render,Ye={template:{compile:A},tag:{compile:T},viewModel:{compile:F},helper:{},converter:{}};if(oe={jsviews:Ce,sub:{View:k,Err:d,tmplFn:J,parse:L,extend:l,extendCtx:Q,syntaxErr:D,onStore:{template:function(e,t){null===t?delete ze[e]:e&&(ze[e]=t)}},addSetting:M,settings:{allowCode:!1},advSet:s,_thp:i,_gm:r,_tg:function(){},_cnvt:h,_tag:y,_er:S,_err:I,_cp:o,_sq:function(e){return"constructor"===e&&D(""),e}},settings:{delimiters:p,advanced:function(e){return e?(l(ve,e),fe.advSet(),me):ve}},map:E},(d.prototype=new Error).constructor=d,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"},fe=oe.sub,me=oe.settings,!(Ge||t&&t.render)){for(ne in Ye)$(ne,Ye[ne]);if(pe=oe.converters,ue=oe.helpers,ce=oe.tags,fe._tg.prototype={baseApply:j,cvtArgs:_,bndArgs:x,ctxPrm:v},ie=fe.topView=new k,t){if(t.fn.render=Z,se=t.expando,t.observable){if(Ce!==(Ce=t.views.jsviews))throw"JsObservable requires JsRender "+Ce;l(fe,t.views.sub),oe.map=t.views.map}}else t={},te&&(e.jsrender=t),t.renderFile=t.__express=t.compile=function(){throw"Node.js: use npm jsrender, or jsrender-node.js"},t.isFunction=function(e){return"function"==typeof e},t.isArray=Array.isArray||function(e){return"[object Array]"==={}.toString.call(e)},fe._jq=function(e){e!==t&&(l(e,t),t=e,t.fn.render=Z,delete t.jsrender,se=t.expando)},t.jsrender=Ce;ge=fe.settings,ge.allowCode=!1,ae=t.isFunction,t.render=ze,t.views=oe,t.templates=le=oe.templates;for(ye in ge)M(ye);(me.debugMode=function(e){return void 0===e?ge.debugMode:(ge.debugMode=e,ge.onError=e+""===e?function(){return e}:ae(e)?e:void 0,me)})(!1),ve=ge.advanced={useViews:!1,_jsv:!1},ce({"if":{render:function(e){var t=this,n=t.tagCtx,r=t.rendering.done||!e&&(n.args.length||!n.index)?"":(t.rendering.done=!0,void(t.selected=n.index));return r},contentCtx:!0,flow:!0},"for":{sortDataMap:E(W),init:function(e,t){var n,r,i,o=this,s=o.tagCtxs;for(n=s.length;n--;)r=s[n],i=r.props,r.argDefault=void 0===i.end||r.args.length>0,r.argDefault!==!1&&de(r.args[0])&&(void 0!==i.sort||r.params.props.start||r.params.props.end||void 0!==i.step||i.filter||i.reverse)&&(i.dataMap=o.sortDataMap)},render:function(e){var t,n,r,i,o,s=this,a=s.tagCtx,d=a.argDefault===!1,l=a.props,p=d||a.args.length,u="",c=0;if(!s.rendering.done){if(t=p?e:a.view.data,d)for(d=l.reverse?"unshift":"push",i=+l.end,o=+l.step||1,t=[],r=+l.start||0;(i-r)*o>0;r+=o)t[d](r);void 0!==t&&(n=de(t),u+=a.render(t,!p||l.noIteration),c+=n?t.length:1),(s.rendering.done=c)&&(s.selected=a.index)}return u},flow:!0},props:{baseTag:"for",dataMap:E(H),init:s,flow:!0},include:{flow:!0},"*":{render:o,flow:!0},":*":{render:o,flow:!0},dbg:ue.dbg=pe.dbg=a}),pe({html:X,attr:X,encode:Y,unencode:ee,url:function(e){return void 0!=e?encodeURI(""+e):null===e?e:""}})}return ge=fe.settings,de=(t||Ge).isArray,me.delimiters("{{","}}","^"),Xe&&Ge.views.sub._jq(t),t||Ge},window); //# sourceMappingURL=jsrender.min.js.map diff --git a/jsrender.min.js.map b/jsrender.min.js.map index 785ed52..31ea519 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","$subSettings","delimiters","linkChar","charAt","delimOpenChar0","delimOpenChar1","delimCloseChar0","delimCloseChar1","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","it","linked","_cxp","scope","isTop","_ocps","_ocp","_vw","_key","ind","updateValue","observable","setProperty","_ceo","unshift","cvtArgs","data","_ucp","getTemplate","tmpl","getRsc","$templates","convertVal","converter","onError","argsLen","bindTo","boundTag","bnds","linkCtx","_lr","args","_bd","_tg","bnd","unlinked","inline","tagName","convert","flow","tagCtxs","_is","extendCtx","_er","onRender","convertArgs","bound","boundArgs","bindFrom","error","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","unmapArray","modelArr","arr","compileViewModel","GetNew","vm","iterate","action","getterType","j","g","getters","getter","viewModels","JSON","parse","merge","viewModel","$expando","getterNames","mod","assigned","newModArr","k","model","$observable","refresh","concat","extend","proto","body","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","setItemVar","newCtx","itemVar","newView","childView","itemResult","swapContent","outerOnRender","noLinking","_wrp","syntaxError","nl","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","boundName","bndStack","prm","tmplLinks","indexOf","paramIndex","rPath","fnCall","0","rBracketQuote","rParams","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","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","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,EAAiBa,EAAMZ,GAHxBY,EAIHX,GAEFA,EAAOU,IAAMX,GAAcA,EAAWW,IAAM,GAAK,GAE3CV,EAGR,QAASY,GAAqBV,EAAKW,GAClC,GAAIC,GACHC,EAAQF,EAAOE,KAChB,KAAKD,IAAQC,IACRC,GAAaC,KAAKH,IAAWZ,EAAIY,IAASZ,EAAIY,GAAMI,MACvDhB,EAAIY,GAAiB,YAATA,EAAqBN,EAAUN,EAAIiB,YAAYC,UAAUN,GAAOC,EAAMD,IAASC,EAAMD,IAOpG,QAASO,GAAOC,GAC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S,GACT+O,EAAO,CAER,KAAKxV,EAAKvB,UAAU+W,KAAM,CAGzB,GAFAre,EAAQgM,EAAU3P,EAAMT,EAAOgD,KAAKmD,KAEhC2c,EAKH,IAJAA,EAAQ5iB,EAAMoe,QAAU,UAAY,OACpCN,GAAO9d,EAAM8d,IACbK,GAAQne,EAAMme,MAAQ,EACtBja,KACKvB,GAAK3C,EAAM6d,OAAS,GAAIC,EAAMnb,GAAKwb,EAAO,EAAGxb,GAAKwb,EACtDja,EAAM0e,GAAOjgB,EAGDF,UAAVyB,IACH8I,EAAUzL,GAAS2C,GACnBsP,GAAU1T,EAAO6K,OAAOzG,GAAQgM,GAAWlQ,EAAMoT,aAGjDmP,GAAQvV,EAAU9I,EAAMf,OAAS,IAE9B4J,EAAKvB,UAAU+W,KAAOA,KACzBxV,EAAKyV,SAAW1iB,EAAOwD,OAIzB,MAAOkQ,IAERhM,MAAM,GAEPxH,OACC8N,QAAS,MACT1C,QAASA,EAAQoS,GACjBzS,KAAMnL,EACN4H,MAAM,GAEPqb,SACCrb,MAAM,GAEPsb,KAECnY,OAAQrK,EACRkH,MAAM,GAEPub,MAECpY,OAAQrK,EACRkH,MAAM,GAEPwb,IAAKhe,GAASge,IAAMvW,GAAYuW,IAAMxiB,IAGvCiM,IACCC,KAAM4S,EACNjW,KAAMiW,EACN2D,OAAQvD,EACRwD,SAAUtD,GACVuD,IAAK,SAAS5D,GAEb,MAAe9c,SAAR8c,EAAoB6D,UAAU,GAAK7D,GAAiB,OAATA,EAAgBA,EAAO,MAY5E,MAPA9d,IAAeS,GAAKkf,SACpB7f,IAAY/C,GAAGsiB,IAAK9T,QACpB3K,GAAeX,WAAW,KAAM,KAAM,KAElCsf,IACHF,GAAIpe,MAAMwe,IAAIiB,IAAI3jB,GAEZA,GAAKsiB,IACTuC","file":"jsrender.min.js","sourcesContent":["/*! JsRender v0.9.91 (Beta): 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 2018, 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 "); - equal($("#tmpl").render([null,undefined,1], {foo:"foovalue"}, true), (isIE8 ? "\n" : "") + "Content012foovalue", 'render(array, helpers, true) renders an array without iteration, while passing in helpers'); + assert.equal($("#tmpl").render([null,undefined,1], {foo:"foovalue"}, true), (isIE8 ? "\n" : "") + "Content012foovalue", 'render(array, helpers, true) renders an array without iteration, while passing in helpers'); $("#result").html(""); - equal($("#tmpl").render([null, undefined, 1], true), (isIE8 ? "\n" : "") + "Content012", 'render(array, true) renders an array without iteration'); + assert.equal($("#tmpl").render([null, undefined, 1], true), (isIE8 ? "\n" : "") + "Content012", 'render(array, true) renders an array without iteration'); $("#result").empty(); }); -test("converters", 3, function() { +QUnit.test("converters", function(assert) { function loc(data) { switch (data) {case "desktop": return "bureau"; } } $.views.converters({loc: loc}); - equal($.templates("{{loc:#data}}:{{loc:'desktop'}}").render("desktop"), "bureau:bureau", "$.views.converters({loc: locFunction})"); + assert.equal($.templates("{{loc:#data}}:{{loc:'desktop'}}").render("desktop"), "bureau:bureau", "$.views.converters({loc: locFunction})"); $.views.converters("loc2", loc); - equal($.views.converters.loc2 === loc, true, 'locFunction === $.views.converters.loc'); + assert.equal($.views.converters.loc2 === loc, true, 'locFunction === $.views.converters.loc'); $.views.converters({loc2: null}); - equal($.views.converters.loc2, undefined, 'Remove a registered converter: $.views.converters({loc: null})'); + assert.equal($.views.converters.loc2, undefined, 'Remove a registered converter: $.views.converters({loc: null})'); }); -test("tags", 3, function() { +QUnit.test("tags", function(assert) { $.views.tags({sort1: sort}); - equal($.templates("{{sort1 people reverse=true}}{{:name}}{{/sort1}}").render({people: people}), "BillJo", "$.views.tags({sort: sortFunction})"); + assert.equal($.templates("{{sort1 people reverse=true}}{{:name}}{{/sort1}}").render({people: people}), "BillJo", "$.views.tags({sort: sortFunction})"); $.views.tags("sort2", sort); - equal($.views.tags.sort1.render === sort, true, 'sortFunction === $.views.tags.sort'); + assert.equal($.views.tags.sort1.render === sort, true, 'sortFunction === $.views.tags.sort'); $.views.tags("sort2", null); - equal($.views.tags.sort2, undefined, 'Remove a registered tag: $.views.tag({sor: null})'); + assert.equal($.views.tags.sort2, undefined, 'Remove a registered tag: $.views.tag({sor: null})'); }); -test("helpers", 3, function() { +QUnit.test("helpers", function(assert) { function concat() { return "".concat.apply("", arguments); } @@ -232,17 +232,17 @@ test("helpers", 3, function() { }, concat: concat }); - equal($.templates("{{:~concat(a, 'b', ~not(false))}}").render({a: "aVal"}), "aValbtrue", "$.views.helpers({concat: concatFunction})"); + assert.equal($.templates("{{:~concat(a, 'b', ~not(false))}}").render({a: "aVal"}), "aValbtrue", "$.views.helpers({concat: concatFunction})"); $.views.helpers({concat2: concat}); - equal($.views.helpers.concat === concat, true, 'concatFunction === $.views.helpers.concat'); + assert.equal($.views.helpers.concat === concat, true, 'concatFunction === $.views.helpers.concat'); $.views.helpers("concat2", null); - equal($.views.helpers.concat2, undefined, 'Remove a registered helper: $.views.helpers({concat: null})'); + assert.equal($.views.helpers.concat2, undefined, 'Remove a registered helper: $.views.helpers({concat: null})'); }); -test("template encapsulation", 1, function() { +QUnit.test("template encapsulation", function(assert) { $.templates({ myTmpl6: { markup: "{{sort reverse=true people}}{{:name}}{{/sort}}", @@ -251,10 +251,10 @@ test("template encapsulation", 1, function() { } } }); - equal($.render.myTmpl6({people: people}), "BillJo", '$.templates("my_tmpl", tmplObjWithNestedItems);'); + assert.equal($.render.myTmpl6({people: people}), "BillJo", '$.templates("my_tmpl", tmplObjWithNestedItems);'); }); -test("$.views.viewModels", function() { +QUnit.test("$.views.viewModels", function(assert) { // =============================== Arrange =============================== var Constr = $.views.viewModels({getters: ["a", "b"]}); // ................................ Act .................................. @@ -264,7 +264,7 @@ test("$.views.viewModels", function() { vm.b("b2 "); result += vm.a() + vm.b(); // ............................... Assert ................................. - equal(result, "a1 b1 a2 b2 ", "viewModels, two getters, no methods"); + assert.equal(result, "a1 b1 a2 b2 ", "viewModels, two getters, no methods"); // =============================== Arrange =============================== Constr = $.views.viewModels({getters: ["a", "b", "c"], extend: {add: function(val) { @@ -275,7 +275,7 @@ test("$.views.viewModels", function() { vm.add("before "); result = vm.c(); // ............................... Assert ................................. - equal(result, "before a1 b1 c1 ", "viewModels, two getters, one method"); + assert.equal(result, "before a1 b1 c1 ", "viewModels, two getters, one method"); // =============================== Arrange =============================== Constr = $.views.viewModels({extend: {add: function(val) { @@ -286,7 +286,7 @@ test("$.views.viewModels", function() { vm.add("before"); result = vm.foo; // ............................... Assert ................................. - equal(result, "before", "viewModels, no getters, one method"); + assert.equal(result, "before", "viewModels, no getters, one method"); // =============================== Arrange =============================== Constr = $.views.viewModels({getters: []}); @@ -294,7 +294,7 @@ test("$.views.viewModels", function() { vm = Constr(); result = JSON.stringify(vm); // ............................... Assert ................................. - equal(result, "{}", "viewModels, no getters, no methods"); + assert.equal(result, "{}", "viewModels, no getters, no methods"); // =============================== Arrange =============================== $.views.viewModels({ @@ -311,7 +311,7 @@ test("$.views.viewModels", function() { result += vm.a() + vm.b(); // ............................... Assert ................................. - equal(result, "a1 b1 a2 b2 ", "viewModels, two getters, no methods"); + assert.equal(result, "a1 b1 a2 b2 ", "viewModels, two getters, no methods"); // ................................ Act .................................. vm.merge({a: "a3 ", b: "b3 "}); @@ -319,14 +319,14 @@ test("$.views.viewModels", function() { result = vm.a() + vm.b(); // ............................... Assert ................................. - equal(result, "a3 b3 ", "viewModels merge, two getters, no methods"); + assert.equal(result, "a3 b3 ", "viewModels merge, two getters, no methods"); // ................................ Act .................................. result = vm.unmap(); result = JSON.stringify(result); // ............................... Assert ................................. - equal(result, '{"a":"a3 ","b":"b3 "}', "viewModels unmap, two getters, no methods"); + assert.equal(result, '{"a":"a3 ","b":"b3 "}', "viewModels unmap, two getters, no methods"); // =============================== Arrange =============================== var viewModels = $.views.viewModels({ @@ -341,7 +341,7 @@ test("$.views.viewModels", function() { vm.b("b2 "); result += vm.a() + vm.b(); // ............................... Assert ................................. - equal(result, "a1 b1 c1 d1 e1 f1 g1 h1 a2 b2 ", + assert.equal(result, "a1 b1 c1 d1 e1 f1 g1 h1 a2 b2 ", "viewModels, multiple unmapped getters, no methods"); // ................................ Act .................................. @@ -350,7 +350,7 @@ test("$.views.viewModels", function() { result = vm.a() + vm.b() + vm.c() + vm.d() + vm.e() + vm.f() + vm.g() + vm.h(); // ............................... Assert ................................. - equal(result, "a3 b3 c3 d3 e3 f3 g3 h3 ", + assert.equal(result, "a3 b3 c3 d3 e3 f3 g3 h3 ", "viewModels merge, multiple unmapped getters, no methods"); // ................................ Act .................................. @@ -358,7 +358,7 @@ test("$.views.viewModels", function() { result = JSON.stringify(result); // ............................... Assert ................................. - equal(result, '{"a":"a3 ","b":"b3 ","c":"c3 ","d":"d3 ","e":"e3 ","f":"f3 ","g":"g3 ","h":"h3 "}', + assert.equal(result, '{"a":"a3 ","b":"b3 ","c":"c3 ","d":"d3 ","e":"e3 ","f":"f3 ","g":"g3 ","h":"h3 "}', "viewModels unmap, multiple unmapped getters, no methods"); // =============================== Arrange =============================== @@ -380,7 +380,7 @@ test("$.views.viewModels", function() { result = vm.c(); // ............................... Assert ................................. - equal(result, "before a1 b1 c1 ", "viewModels, getters and one method"); + assert.equal(result, "before a1 b1 c1 ", "viewModels, getters and one method"); // ................................ Act .................................. vm.merge({a: "a3 ", b: "b3 ", c: "c3 "}); @@ -388,14 +388,14 @@ test("$.views.viewModels", function() { result = vm.c(); // ............................... Assert ................................. - equal(result, "updated a3 b3 c3 ", "viewModels merge, getters and one method"); + assert.equal(result, "updated a3 b3 c3 ", "viewModels merge, getters and one method"); // ................................ Act .................................. result = vm.unmap(); result = JSON.stringify(result); // ............................... Assert ................................. - equal(result, '{"a":"a3 ","b":"b3 ","c":"updated a3 b3 c3 "}', "viewModels unmap, getters and one method"); + assert.equal(result, '{"a":"a3 ","b":"b3 ","c":"updated a3 b3 c3 "}', "viewModels unmap, getters and one method"); // =============================== Arrange =============================== $.views.viewModels({ @@ -414,7 +414,7 @@ test("$.views.viewModels", function() { result = JSON.stringify(t2.unmap()); // ............................... Assert ................................. - equal(result, '{"t1":{"a":"a3 ","b":"b3 "},"t1Arr":[{"a":"a1 ","b":"b1 "},{"a":"a2 ","b":"b2 "}],"t1OrNull":null}', + assert.equal(result, '{"t1":{"a":"a3 ","b":"b3 "},"t1Arr":[{"a":"a1 ","b":"b1 "},{"a":"a2 ","b":"b2 "}],"t1OrNull":null}', "viewModels, hierarchy"); // ................................ Act .................................. @@ -422,7 +422,7 @@ test("$.views.viewModels", function() { result = JSON.stringify(t2.unmap()); // ............................... Assert ................................. - equal(result, '{"t1":{"a":"a3 ","b":"b3 "},"t1Arr":[{"a":"a1x ","b":"b1x "},{"a":"a2 ","b":"b2 "}],"t1OrNull":null}', + assert.equal(result, '{"t1":{"a":"a3 ","b":"b3 "},"t1Arr":[{"a":"a1x ","b":"b1x "},{"a":"a2 ","b":"b2 "}],"t1OrNull":null}', "viewModels, merge deep node"); // ................................ Act .................................. @@ -431,7 +431,7 @@ test("$.views.viewModels", function() { result = JSON.stringify(t2FromArr.unmap()); // ............................... Assert ................................. - equal(result, '{"t1":{"a":"a3 ","b":"b3 "},"t1Arr":[{"a":"a1 ","b":"b1 "},{"a":"a2 ","b":"b2 "}],"t1OrNull":null}', + assert.equal(result, '{"t1":{"a":"a3 ","b":"b3 "},"t1Arr":[{"a":"a1 ","b":"b1 "},{"a":"a2 ","b":"b2 "}],"t1OrNull":null}', "viewModels, hierarchy"); // ................................ Act .................................. @@ -441,7 +441,7 @@ test("$.views.viewModels", function() { result = JSON.stringify(t2FromArr.unmap()); // ............................... Assert ................................. - equal(result, '{"t1":{"a":"a4 ","b":"b4 "},"t1Arr":[{"a":"a1 ","b":"b1 "},{"a":"a2 ","b":"b2 "},{"a":"a3 ","b":"b3 "}],"t1OrNull":null}', + assert.equal(result, '{"t1":{"a":"a4 ","b":"b4 "},"t1Arr":[{"a":"a1 ","b":"b1 "},{"a":"a2 ","b":"b2 "},{"a":"a3 ","b":"b3 "}],"t1OrNull":null}', "viewModels, hierarchy"); // ................................ Act .................................. @@ -449,7 +449,7 @@ test("$.views.viewModels", function() { result = JSON.stringify(t2new.unmap()); // ............................... Assert ................................. - equal(result, '{"t1":{"a":"a3 ","b":"b3 "},"t1Arr":[{"a":"a1 ","b":"b1 "},{"a":"a2 ","b":"b2 "}],"t1OrNull":{"a":"a4 ","b":"b4 "}}', + assert.equal(result, '{"t1":{"a":"a3 ","b":"b3 "},"t1Arr":[{"a":"a1 ","b":"b1 "},{"a":"a2 ","b":"b2 "}],"t1OrNull":{"a":"a4 ","b":"b4 "}}', "viewModels, hierarchy"); });