/usr/share/javascript/jsrender/jsrender.min.js is in libjs-jsrender 1.0~pre21-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 | /*! JsRender v1.0pre: http://github.com/BorisMoore/jsrender *//*
* Optimized version of jQuery Templates, for rendering to string.
* Does not require jQuery, or HTML DOM
* Integrates with JsViews (http://github.com/BorisMoore/jsviews)
* Copyright 2012, Boris Moore
* Released under the MIT License.
*/// informal pre beta commit counter: 21
(function(a,b,c){function E(a){this.name="JsRender Error",this.message=a||"JsRender error"}function F(a,b,c){if(!D.rTag||arguments.length)i=a?"\\"+a.charAt(0):i,j=a?"\\"+a.charAt(1):j,k=b?"\\"+b.charAt(0):k,l=b?"\\"+b.charAt(0):l,c=c?"\\"+c:m,D.rTag=f="(\\w*"+c+")?(?:(?:(\\w+(?=[\\/\\s"+k+"]))|(?:(\\w+)?(:)|(>)|(\\*)))"+"\\s*((?:[^"+k+"]|"+k+"(?!"+l+"))*?)",f=new RegExp(i+j+f+"(\\/)?|(?:\\/(\\w+)))"+k+l,"g"),g=new RegExp("<.*>|([^\\\\]|^)[{}]|"+i+j+".*"+k+l);return[i,j,k,l,m]}function G(a){var b=this,d=b.tmpl.helpers||{};return a=(b.dynCtx&&b.dynCtx[a]!==c?b.dynCtx:b.ctx[a]!==c?b.ctx:d[a]!==c?d:O[a]!==c?O:{})[a],typeof a!="function"?a:function(){return a.apply(b,arguments)}}function H(a,b,d,e){var f=!d.markup&&d||c,g=b.tmpl.converters;return g=g&&g[a]||P[a],g?g.call(b,e,f):(S("Unknown converter: {{"+a+":"),e)}function I(a,b,d,e,f){var g,h=!d.markup&&d,i=h?h.view.tmpl:d,j=i.tags,k=i.templates,l=f.props=f.props||{},m=l.tmpl,n=arguments.length>5?B.call(arguments,5):[],o=j&&j[a]||N[a];return o?(e=e&&i.tmpls[e-1],m=m||e||o.template||c,f.view=b,m=f.tmpl=""+m===m?k&&k[m]||M[m]||M(m):m,f.attr=d.attr=d.attr||o.attr,f.tagName=a,f.renderContent=Q,h&&(h.tagCtx={args:n,props:l,path:f.path,tag:o}),o.render&&(g=o.render.apply(f,n)),g||(g==c?m?f.renderContent(n[0],c,b):"":g.toString())):(S("Unknown tag: {{"+a+"}}"),"")}function J(a,b,d,e,f,g,h,i){var j,k={data:e,tmpl:f,views:i?[]:{},parent:d,ctx:a,path:b,_useKey:i?0:1,_onRender:h,_hlp:G,renderLink:function(b){var c=this.tmpl.tmpls[b];return c.render(e,a,this)}};return d&&(j=d.views,d._useKey?(j[k.key="_"+d._useKey++]=k,k.index=d.index):j.splice(k.key=k.index=g!==c?g:j.length,0,k)),k}function K(a,b,d,e,f){var g,h;if(d&&typeof d=="object"&&!d.nodeType){for(g in d)b(g,d[g]);return a}e===c&&(e=d,d=c);if(h=n.onBeforeStoreItem)f=h(b,d,e,f)||f;return d?""+d===d&&(e===null?delete b[d]:b[d]=f?e=f(e,d):e):e=f?f(e):e,(h=n.onStoreItem)&&h(b,d,e,f),e}function L(a,b){return a=typeof a=="function"?{render:a}:a,a.name=b,a.is="tag",a}function M(a,b){return K(this,M,a,b,Y)}function N(a,b){return K(this,N,a,b,L)}function O(a,b){return K(this,O,a,b)}function P(a,b){return K(this,P,a,b)}function Q(a,b,d,f,g,i,j){var k,l,m,n,q,r,s,t,u,v,w,x,y=this,z="";f===p&&(u=p,f=0);if(y.tagName){s=y.tmpl;if(b||y.ctx)v={},y.ctx&&h(v,y.ctx),b&&h(v,b);b=v,t=y.props,t&&t.link===o&&(b=b||{},b.link=o),d=d||y.view,i=i||y.path,f=f||y.key,j=d&&d._onRender}else s=y.jquery&&(y[0]||S('Unknown template: "'+y.selector+'"'))||y,j=j||d&&d._onRender;if(s){d?(r=d.ctx,w=d.dynCtx,a===d&&(a=d.data,g=p)):r=O,x=b&&b!==r;if(w||x)r=h({},r),x&&h(r,b),w&&h(r,w);b=r,s.fn||(s=M[s]||M(s));if(s){j=b.link!==o&&j;if(e.isArray(a)&&!g){n=u?d:f!==c&&d||J(b,i,d,a,s,f,j,p);for(k=0,l=a.length;k<l;k++)m=a[k],q=s.fn(m,J(b,i,n,m,s,(f||0)+k,j),D),z+=j?j(q,s,t):q}else n=u?d:J(b,i,d,a,s,f,j),n._onRender=j,z+=s.fn(a,n,D,R);return j?j(z,s,t,n.key,i):z}}return S("No template found"),""}function R(a){return a}function S(a){if(D.debugMode)throw new D.Error(a)}function T(a){S("Syntax error\n"+a)}function U(a,b,c){function l(b){b-=h,b&&j.push(a.substr(h,b).replace(s,"\\n"))}function m(b){b&&T('Unmatched or missing tag: "{{/'+b+'}}" in template:\n'+a)}function n(b,f,g,n,o,q,r,s,u,w,x){q&&(o=":",n="html");var y,z="",A="",B=!u&&!o&&!c;g=g||o,l(x),h=x+b.length,r?e&&j.push(["*",s.replace(t,"$1")]):g?(g==="else"?(k[5]=a.substring(k[5],x),k=i.pop(),j=k[3],B=p):f&&(i.push(k),k=["!",,,[],,x],j.push(k),j=k[3]),s=s?W(s,c,f).replace(v,function(a,b,c){return b?A+=c+",":z+=c+",",""}):"",z=z.slice(0,-1),s=s.slice(0,-1),d=[g,n||"",s,B&&[],"{"+(z?"props:{"+z+"},":"")+"data: data"+(A?",ctx:{"+A.slice(0,-1)+"}":"")+"}"],j.push(d),B?(i.push(k),k=d,k[5]=h):f&&(k[5]=a.substring(k[5],h),k=i.pop())):w&&(y=k[0],m(w!==y&&(w!=="if"||y!=="else")&&y),k[5]=a.substring(k[5],x),y==="!"&&(k[5]=a.substring(k[5],h),k=i.pop()),k=i.pop()),m(!k&&w),j=k[3]}var d,e=b&&b.allowCode,g=[],h=0,i=[],j=g,k=[,,,g];return a=a.replace(u,"\\$1"),m(i[0]&&i[0][3].pop()[0]),a.replace(f,n),l(a.length),V(g,b)}function V(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,q,r,s,t,u,v=b?{allowCode:r=b.allowCode,debug:b.debug}:{},w=b&&b.tmpls;e=a.length,f=e?"":'"";';for(d=0;d<e;d++)c=a[d],""+c===c?f+='"'+c+'"+':(l=c[0],l==="*"?f=f.slice(0,d?-1:-3)+";"+c[1]+(d+1<e?"ret+=":""):(m=c[1],n=c[2],s=c[3],o=c[4],markup=c[5],l.slice(-1)==="!"?(q=Z(markup,v,b,w.length),V(s,q),(t=/\s+[\w-]*\s*\=\s*\\['"]$/.exec(a[d-1]))&&S("'{{!' in attribute:\n..."+a[d-1]+"{{!...\nUse data-link"),f+="view.renderLink("+w.length+")+",q.bound=p,q.fn.attr=t||"leaf",w.push(q)):(s&&(q=Z(markup,v,b,w.length),V(s,q),w.push(q)),k=k||o.indexOf("view")>-1,f+=(l===":"?m==="html"?(h=p,"h("+n):m?(j=p,'c("'+m+'",view,this,'+n):(i=p,"((v="+n+')!=u?v:""'):(g=p,'t("'+l+'",view,this,'+(s?w.length:'""')+","+o+(n?",":"")+n))+")+")));f=z+(i?"v,":"")+(g?"t=j._tag,":"")+(j?"c=j._convert,":"")+(h?"h=j.converters.html,":"")+"ret; try{\n\n"+(v.debug?"debugger;":"")+(r?"ret=":"return ")+f.slice(0,-1)+";\n\n"+(r?"return ret;":"")+"}catch(e){return j._err(e);}";try{f=new Function("data, view, j, b, u",f)}catch(x){T("Compiled template code:\n\n"+f,x)}return b&&(b.fn=f),f}function W(a,b,c){function i(i,j,k,l,m,n,r,s,t,u,v,w,x,y,z,A){function C(a,b,c,d,e,f,g){if(b){var h,i=(c?'view._hlp("'+c+'")':d?"view":"data")+(g?(e?"."+e:c?"":d?"":"."+b)+(f||""):(g=c?"":d?e||"":b,""));return h=g?"."+g:"",B||(i+=h),i=i.slice(0,9)==="view.data"?i.slice(5):i,B&&(i="b("+i+',"'+g+'")'+h),i}return a}m=m||"",k=k||j||v,l=l||s,t=t||z||"",m=m||"";var B=(b||c)&&t!=="(";if(!n)return h?(h=!w,h?i:'"'):g?(g=!x,g?i:'"'):(k?(f++,k):"")+(A?f?"":d?(d=o,"\b"):",":r?(f&&T(a),d=p,"\b"+l+":"):l?l.replace(q,C)+(t?(e[++f]=p,t):m):m?m:y?(e[f--]=o,y)+(t?(e[++f]=p,t):""):u?(e[f]||T(a),","):j?"":(h=w,g=x,'"'));T(a)}var d,e={},f=0,g=o,h=o;return a=(a+" ").replace(r,i),a}function X(a,b,c){var d,e;if(a)for(d in a)e=a[d],e.is||(a[d]=b(e,d,c))}function Y(a,d,e,f){function k(a){if(""+a===a||a.nodeType>0){try{j=a.nodeType>0?a:!g.test(a)&&b&&b(a)[0]}catch(c){}return j&&(a=M[j.getAttribute(y)],a||(d=d||"_"+w++,j.setAttribute(y,d),a=Y(j.innerHTML,d,e,f),M[d]=a)),a}}var i,j;a=a||"",i=k(a),f=f||(a.markup?a:{}),f.name=d,f.is="tmpl",!i&&a.markup&&(i=k(a.markup))&&i.fn&&(i.debug!==a.debug||i.allowCode!==a.allowCode)&&(i=i.markup);if(i!==c)return d&&!e&&(C[d]=function(){return a.render.apply(a,arguments)}),i.fn||a.fn?i.fn&&(d&&d!==i.name?a=h(h({},i),f):a=i):(a=Z(i,f,e,0),U(i,a)),X(f.templates,Y,a),X(f.tags,L),a}function Z(a,b,c,d){function e(a){c[a]&&(f[a]=h(h({},c[a]),b[a]))}b=b||{};var f={markup:a,tmpls:[],links:[],render:Q};return c&&(c.templates&&(f.templates=h(h({},c.templates),b.templates)),f.parent=c,f.name=c.name+"["+d+"]",f.key=d),h(f,b),c&&(e("templates"),e("tags"),e("helpers"),e("converters")),f}function $(a){return x[a]||(x[a]="&#"+a.charCodeAt(0)+";")}if(b&&b.views||a.jsviews)return;var d="v1.0pre",e,f,g,h,i="{",j="{",k="}",l="}",m="!",n={},o=!1,p=!0,q=/^(?:null|true|false|\d[\d.]*|([\w$]+|~([\w$]+)|#(view|([\w$]+))?)([\w$.]*?)(?:[.[]([\w$]+)\]?)?|(['"]).*\8)$/g,r=/(\()(?=|\s*\()|(?:([([])\s*)?(?:([#~]?[\w$.]+)?\s*((\+\+|--)|\+|-|&&|\|\||===|!==|==|!=|<=|>=|[<>%*!:?\/]|(=))\s*|([#~]?[\w$.]+)([([])?)|(,\s*)|(\(?)\\?(?:(')|("))|(?:\s*([)\]])([([]?))|(\s+)/g,s=/\r?\n/g,t=/\\(['"])/g,u=/\\?(['"])/g,v=/\x08(~)?([^\x08]+)\x08/g,w=0,x={"&":"&","<":"<",">":">"},y="data-jsv-tmpl",z="var j=j||"+(b?"jQuery.":"js")+"views,",A=/[\x00"&'<>]/g,B=Array.prototype.slice,C={},D={jsviews:d,sub:n,debugMode:p,render:C,templates:M,tags:N,helpers:O,converters:P,delimiters:F,View:J,_convert:H,_err:function(a){return D.debugMode?"Error: "+(a.message||a)+". ":""},_tmplFn:U,_tag:I,error:S,Error:E};(E.prototype=new Error).constructor=E,b?(e=b,e.templates=M,e.render=C,e.views=D,e.fn.render=Q):(e=a.jsviews=D,e.extend=function(a,b){var c;a=a||{};for(c in b)a[c]=b[c];return a},e.isArray=Array&&Array.isArray||function(a){return Object.prototype.toString.call(a)==="[object Array]"}),h=e.extend,N({"if":function(){var a=this,b=a.view;return b.onElse=function(a,d){var e=0,f=d.length;while(f&&!d[e++])if(e===f)return"";return b.onElse=c,a.path="",a.renderContent(b)},b.onElse(this,arguments)},"else":function(){var a=this.view;return a.onElse?a.onElse(this,arguments):""},"for":function(){var a,b=this,c="",d=arguments,e=d.length;e===0&&(e=1);for(a=0;a<e;a++)c+=b.renderContent(d[a]);return c},"*":function(a){return a}}),P({html:function(a){return a!=c?String(a).replace(A,$):""}}),F()})(this,this.jQuery);
|