Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

transparency

Package Overview
Dependencies
Maintainers
1
Versions
50
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

transparency - npm Package Compare versions

Comparing version 0.8.1 to 0.8.2

spec/model_references.spec.coffee

2

component.json
{
"name": "transparency",
"version": "0.8.1",
"version": "0.8.2",
"main": "./dist/transparency.js"
}

@@ -38,2 +38,7 @@ (function() {

instance = instances[index];
_ref = instance.elements;
for (_j = 0, _len1 = _ref.length; _j < _len1; _j++) {
e = _ref[_j];
data(e).model = model;
}
if (isDomElement(model) && (element = instance.elements[0])) {

@@ -47,5 +52,5 @@ empty(element).appendChild(model);

if (isPlainValue(value)) {
_ref = matchingElements(instance, key);
for (_j = 0, _len1 = _ref.length; _j < _len1; _j++) {
element = _ref[_j];
_ref1 = matchingElements(instance, key);
for (_k = 0, _len2 = _ref1.length; _k < _len2; _k++) {
element = _ref1[_k];
nodeName = element.nodeName.toLowerCase();

@@ -67,7 +72,2 @@ if (nodeName === 'input') {

renderDirectives(instance, model, index, directives);
_ref1 = instance.elements;
for (_k = 0, _len2 = _ref1.length; _k < _len2; _k++) {
e = _ref1[_k];
data(e).model = model;
}
for (_l = 0, _len3 = children.length; _l < _len3; _l++) {

@@ -74,0 +74,0 @@ key = children[_l];

@@ -1,4 +0,4 @@

/*! transparency - v0.8.0 - 2013-02-04
/*! transparency - v0.8.1 - 2013-02-09
* https://github.com/leonidas/transparency
* Copyright (c) 2013 Jarno Keskikangas <jarno.keskikangas@leonidasoy.fi>; Licensed MIT */
(function(){var e,t,n,r,i,s,o,u,a,f,l,c,h,p,d,v,m,g,y,b,w,E,S,x,T,N,C,k,L,A,O,M={}.hasOwnProperty,_=[].slice;r=this.Transparency={},r.render=function(e,t,n,i){var o,l,c,h,p,d,m,g,w,E,C,k,L,A,O,_,D,P,H,B,j,F,I,q,R,U;t==null&&(t=[]),n==null&&(n={}),i==null&&(i={}),g=i.debug&&console?u:x,g("Transparency.render:",e,t,n,i);if(!e)return;v(t)||(t=[t]),C=e.parentNode,C&&(k=e.nextSibling,C.removeChild(e)),T(e,t),d=a(e).instances;for(h=A=0,P=t.length;A<P;h=++A){w=t[h],o=[],p=d[h];if(y(w)&&(c=p.elements[0]))f(c).appendChild(w);else if(typeof w=="object")for(m in w){if(!M.call(w,m))continue;L=w[m];if(L!=null)if(b(L)){q=S(p,m);for(O=0,H=q.length;O<H;O++)c=q[O],E=c.nodeName.toLowerCase(),E==="input"?s(c,"value",L):E==="select"?s(c,"selected",L):s(c,"text",L)}else typeof L=="object"&&o.push(m)}N(p,w,h,n),R=p.elements;for(_=0,B=R.length;_<B;_++)l=R[_],a(l).model=w;for(D=0,j=o.length;D<j;D++){m=o[D],U=S(p,m);for(I=0,F=U.length;I<F;I++)c=U[I],r.render(c,w[m],n[m],i)}}return C&&(k?C.insertBefore(e,k):C.appendChild(e)),e},r.jQueryPlugin=function(e,t,n){var i,s,o;for(s=0,o=this.length;s<o;s++)i=this[s],r.render(i,e,t,n);return this},r.matcher=function(e,t){return e.id===t||d(e.className.split(" "),t)>-1||e.name===t||e.getAttribute("data-bind")===t},r.clone=function(e){var t;return typeof (t=jQuery||Zepto)=="function"?t(e).clone()[0]:void 0},t=function(){function e(e){this.template=e,this.queryCache={},this.elements=[],this.childNodes=[],c(this.template,this.elements,this.childNodes)}return e}(),T=function(e,n){var r,i,u,f,l,c,h,p,d,v,m,g,y,b,w,S;E("PrepareContext:",e,n),i=a(e),i.template||(i.template=o(e),i.instanceCache=[],i.instances=[new t(e)]);while(n.length>i.instances.length){f=i.instanceCache.pop()||new t(o(i.template)),y=f.childNodes;for(h=0,v=y.length;h<v;h++)l=y[h],e.appendChild(l);i.instances.push(f)}while(n.length<i.instances.length){i.instanceCache.push(f=i.instances.pop()),b=f.childNodes;for(p=0,m=b.length;p<m;p++)l=b[p],l.parentNode.removeChild(l)}w=i.instances,S=[];for(d=0,g=w.length;d<g;d++)f=w[d],S.push(function(){var e,t,n,i;n=f.elements,i=[];for(e=0,t=n.length;e<t;e++)u=n[e],i.push(function(){var e,t;e=a(u).originalAttributes,t=[];for(r in e)c=e[r],t.push(s(u,r,c));return t}());return i}());return S},c=function(t,n,r){var i,s,o;i=t.firstChild,o=[];while(i)r!=null&&r.push(i),i.nodeType===e&&((s=a(i)).originalAttributes||(s.originalAttributes={}),n.push(i),c(i,n)),o.push(i=i.nextSibling);return o},N=function(e,t,n,r){var i,o,u,a,f,l,c;if(!r)return;t=typeof t=="object"?t:{value:t},c=[];for(f in r){if(!M.call(r,f))continue;o=r[f],typeof o=="object"&&c.push(function(){var r,c,h,p;h=S(e,f),p=[];for(r=0,c=h.length;r<c;r++)a=h[r],p.push(function(){var e;e=[];for(i in o){u=o[i];if(typeof u!="function")continue;l=u.call(t,{element:a,index:n,value:s(a,i)}),e.push(s(a,i,l))}return e}());return p}())}return c},C=function(t,n){var r,i,s,o,u,l,c;i=a(t);if(i.html===n)return;i.html=n,i.children||(i.children=function(){var n,r,i,o;i=t.childNodes,o=[];for(n=0,r=i.length;n<r;n++)s=i[n],s.nodeType===e&&o.push(s);return o}()),f(t),t.innerHTML=n,l=i.children,c=[];for(o=0,u=l.length;o<u;o++)r=l[o],c.push(t.appendChild(r));return c},L=function(e,t){var r,i;r=a(e);if(t==null||r.text===t)return;return r.text=t,i=e.firstChild,i?i.nodeType!==n?e.insertBefore(e.ownerDocument.createTextNode(t),i):i.nodeValue=t:e.appendChild(e.ownerDocument.createTextNode(t))},h=function(e){var t;return function(){var r,i,s,o;s=e.childNodes,o=[];for(r=0,i=s.length;r<i;r++)t=s[r],t.nodeType===n&&o.push(t.nodeValue);return o}().join("")},k=function(e,t){var n,r,i,s,o;t=t.toString(),r=[],c(e,r),o=[];for(i=0,s=r.length;i<s;i++)n=r[i],n.nodeName.toLowerCase()==="option"?n.value===t?o.push(n.selected=!0):o.push(n.selected=!1):o.push(void 0);return o},s=function(e,t,n){var r,i,s,o,u,f,l,c,p,d,v;r=a(e);if(n==null)return r.originalAttributes[t];if(e.nodeName.toLowerCase()==="select"&&t==="selected")return k(e,n);switch(t){case"text":if(!w(e))return(l=(i=r.originalAttributes)["text"])==null&&(i.text=h(e)),L(e,n);break;case"html":return(c=(s=r.originalAttributes)["html"])==null&&(s.html=e.innerHTML),C(e,n);case"class":return(p=(o=r.originalAttributes)["class"])==null&&(o["class"]=e.className),e.className=n;default:return e[t]=n,m(n)?((d=(u=r.originalAttributes)[t])==null&&(u[t]=e.getAttribute(t)||!1),n?e.setAttribute(t,t):e.removeAttribute(t)):((v=(f=r.originalAttributes)[t])==null&&(f[t]=e.getAttribute(t)||""),e.setAttribute(t,n.toString()))}},S=function(e,t){var n,i,s;return i=(s=e.queryCache)[t]||(s[t]=function(){var i,s,o,u;o=e.elements,u=[];for(i=0,s=o.length;i<s;i++)n=o[i],r.matcher(n,t)&&u.push(n);return u}()),E("Matching elements for '"+t+"':",i),i},f=function(e){var t;while(t=e.firstChild)e.removeChild(t);return e},e=1,n=3,i=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],p=function(){return document.createElement("nav").cloneNode(!0).outerHTML!=="<:nav></:nav>"},o=typeof document=="undefined"||document===null||p()?function(e){return e.cloneNode(!0)}:function(t){var n,i,s,o,u;n=r.clone(t);if(n.nodeType===e){n.removeAttribute(l),u=n.getElementsByTagName("*");for(s=0,o=u.length;s<o;s++)i=u[s],i.removeAttribute(l)}return n},l="transparency",a=function(e){return e[l]||(e[l]={})},x=function(){},u=function(){var e;return e=1<=arguments.length?_.call(arguments,0):[],console.log.apply(console,e)},E=x,A=Object.prototype.toString,g=function(e){return A.call(e)==="[object Date]"},y=function(t){return t.nodeType===e},w=function(e){return d(i,e.nodeName.toLowerCase())>-1},b=function(e){return g(e)||typeof e!="object"&&typeof e!="function"},m=function(e){return e===!0||e===!1},v=Array.isArray||function(e){return A.call(e)==="[object Array]"},d=function(e,t){var n,r,i,s;if(e.indexOf)return e.indexOf(t);for(n=i=0,s=e.length;i<s;n=++i){r=e[n];if(r===t)return n}return-1},(O=jQuery||Zepto)!=null&&(O.fn.render=r.jQueryPlugin),(typeof define!="undefined"&&define!==null?define.amd:void 0)&&define(function(){return r})}).call(this);
(function(){var e,t,n,r,i,s,o,u,a,f,l,c,h,p,d,v,m,g,y,b,w,E,S,x,T,N,C,k,L,A,O,M={}.hasOwnProperty,_=[].slice;r=this.Transparency={},r.render=function(e,t,n,i){var o,l,c,h,p,d,m,g,w,E,C,k,L,A,O,_,D,P,H,B,j,F,I,q,R,U;t==null&&(t=[]),n==null&&(n={}),i==null&&(i={}),g=i.debug&&console?u:x,g("Transparency.render:",e,t,n,i);if(!e)return;v(t)||(t=[t]),C=e.parentNode,C&&(k=e.nextSibling,C.removeChild(e)),T(e,t),d=a(e).instances;for(h=A=0,P=t.length;A<P;h=++A){w=t[h],o=[],p=d[h],q=p.elements;for(O=0,H=q.length;O<H;O++)l=q[O],a(l).model=w;if(y(w)&&(c=p.elements[0]))f(c).appendChild(w);else if(typeof w=="object")for(m in w){if(!M.call(w,m))continue;L=w[m];if(L!=null)if(b(L)){R=S(p,m);for(_=0,B=R.length;_<B;_++)c=R[_],E=c.nodeName.toLowerCase(),E==="input"?s(c,"value",L):E==="select"?s(c,"selected",L):s(c,"text",L)}else typeof L=="object"&&o.push(m)}N(p,w,h,n);for(D=0,j=o.length;D<j;D++){m=o[D],U=S(p,m);for(I=0,F=U.length;I<F;I++)c=U[I],r.render(c,w[m],n[m],i)}}return C&&(k?C.insertBefore(e,k):C.appendChild(e)),e},r.jQueryPlugin=function(e,t,n){var i,s,o;for(s=0,o=this.length;s<o;s++)i=this[s],r.render(i,e,t,n);return this},r.matcher=function(e,t){return e.id===t||d(e.className.split(" "),t)>-1||e.name===t||e.getAttribute("data-bind")===t},r.clone=function(e){var t;return typeof (t=jQuery||Zepto)=="function"?t(e).clone()[0]:void 0},t=function(){function e(e){this.template=e,this.queryCache={},this.elements=[],this.childNodes=[],c(this.template,this.elements,this.childNodes)}return e}(),T=function(e,n){var r,i,u,f,l,c,h,p,d,v,m,g,y,b,w,S;E("PrepareContext:",e,n),i=a(e),i.template||(i.template=o(e),i.instanceCache=[],i.instances=[new t(e)]);while(n.length>i.instances.length){f=i.instanceCache.pop()||new t(o(i.template)),y=f.childNodes;for(h=0,v=y.length;h<v;h++)l=y[h],e.appendChild(l);i.instances.push(f)}while(n.length<i.instances.length){i.instanceCache.push(f=i.instances.pop()),b=f.childNodes;for(p=0,m=b.length;p<m;p++)l=b[p],l.parentNode.removeChild(l)}w=i.instances,S=[];for(d=0,g=w.length;d<g;d++)f=w[d],S.push(function(){var e,t,n,i;n=f.elements,i=[];for(e=0,t=n.length;e<t;e++)u=n[e],i.push(function(){var e,t;e=a(u).originalAttributes,t=[];for(r in e)c=e[r],t.push(s(u,r,c));return t}());return i}());return S},c=function(t,n,r){var i,s,o;i=t.firstChild,o=[];while(i)r!=null&&r.push(i),i.nodeType===e&&((s=a(i)).originalAttributes||(s.originalAttributes={}),n.push(i),c(i,n)),o.push(i=i.nextSibling);return o},N=function(e,t,n,r){var i,o,u,a,f,l,c;if(!r)return;t=typeof t=="object"?t:{value:t},c=[];for(f in r){if(!M.call(r,f))continue;o=r[f],typeof o=="object"&&c.push(function(){var r,c,h,p;h=S(e,f),p=[];for(r=0,c=h.length;r<c;r++)a=h[r],p.push(function(){var e;e=[];for(i in o){u=o[i];if(typeof u!="function")continue;l=u.call(t,{element:a,index:n,value:s(a,i)}),e.push(s(a,i,l))}return e}());return p}())}return c},C=function(t,n){var r,i,s,o,u,l,c;i=a(t);if(i.html===n)return;i.html=n,i.children||(i.children=function(){var n,r,i,o;i=t.childNodes,o=[];for(n=0,r=i.length;n<r;n++)s=i[n],s.nodeType===e&&o.push(s);return o}()),f(t),t.innerHTML=n,l=i.children,c=[];for(o=0,u=l.length;o<u;o++)r=l[o],c.push(t.appendChild(r));return c},L=function(e,t){var r,i;r=a(e);if(t==null||r.text===t)return;return r.text=t,i=e.firstChild,i?i.nodeType!==n?e.insertBefore(e.ownerDocument.createTextNode(t),i):i.nodeValue=t:e.appendChild(e.ownerDocument.createTextNode(t))},h=function(e){var t;return function(){var r,i,s,o;s=e.childNodes,o=[];for(r=0,i=s.length;r<i;r++)t=s[r],t.nodeType===n&&o.push(t.nodeValue);return o}().join("")},k=function(e,t){var n,r,i,s,o;t=t.toString(),r=[],c(e,r),o=[];for(i=0,s=r.length;i<s;i++)n=r[i],n.nodeName.toLowerCase()==="option"?n.value===t?o.push(n.selected=!0):o.push(n.selected=!1):o.push(void 0);return o},s=function(e,t,n){var r,i,s,o,u,f,l,c,p,d,v;r=a(e);if(n==null)return r.originalAttributes[t];if(e.nodeName.toLowerCase()==="select"&&t==="selected")return k(e,n);switch(t){case"text":if(!w(e))return(l=(i=r.originalAttributes)["text"])==null&&(i.text=h(e)),L(e,n);break;case"html":return(c=(s=r.originalAttributes)["html"])==null&&(s.html=e.innerHTML),C(e,n);case"class":return(p=(o=r.originalAttributes)["class"])==null&&(o["class"]=e.className),e.className=n;default:return e[t]=n,m(n)?((d=(u=r.originalAttributes)[t])==null&&(u[t]=e.getAttribute(t)||!1),n?e.setAttribute(t,t):e.removeAttribute(t)):((v=(f=r.originalAttributes)[t])==null&&(f[t]=e.getAttribute(t)||""),e.setAttribute(t,n.toString()))}},S=function(e,t){var n,i,s;return i=(s=e.queryCache)[t]||(s[t]=function(){var i,s,o,u;o=e.elements,u=[];for(i=0,s=o.length;i<s;i++)n=o[i],r.matcher(n,t)&&u.push(n);return u}()),E("Matching elements for '"+t+"':",i),i},f=function(e){var t;while(t=e.firstChild)e.removeChild(t);return e},e=1,n=3,i=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],p=function(){return document.createElement("nav").cloneNode(!0).outerHTML!=="<:nav></:nav>"},o=typeof document=="undefined"||document===null||p()?function(e){return e.cloneNode(!0)}:function(t){var n,i,s,o,u;n=r.clone(t);if(n.nodeType===e){n.removeAttribute(l),u=n.getElementsByTagName("*");for(s=0,o=u.length;s<o;s++)i=u[s],i.removeAttribute(l)}return n},l="transparency",a=function(e){return e[l]||(e[l]={})},x=function(){},u=function(){var e;return e=1<=arguments.length?_.call(arguments,0):[],console.log.apply(console,e)},E=x,A=Object.prototype.toString,g=function(e){return A.call(e)==="[object Date]"},y=function(t){return t.nodeType===e},w=function(e){return d(i,e.nodeName.toLowerCase())>-1},b=function(e){return g(e)||typeof e!="object"&&typeof e!="function"},m=function(e){return e===!0||e===!1},v=Array.isArray||function(e){return A.call(e)==="[object Array]"},d=function(e,t){var n,r,i,s;if(e.indexOf)return e.indexOf(t);for(n=i=0,s=e.length;i<s;n=++i){r=e[n];if(r===t)return n}return-1},(O=jQuery||Zepto)!=null&&(O.fn.render=r.jQueryPlugin),(typeof define!="undefined"&&define!==null?define.amd:void 0)&&define(function(){return r})}).call(this);
{
"name": "transparency",
"version": "0.8.1",
"version": "0.8.2",
"main": "dist/transparency",

@@ -5,0 +5,0 @@ "description": "Transparency is a minimal template engine for browsers. It maps JSON objects to DOM elements with zero configuration.",

@@ -102,3 +102,3 @@ # Synopsis

By default, Transparency binds JavaScript objects to DOM a element by `id`, `class`,`name` attribute and
By default, Transparency binds JavaScript objects to a DOM element by `id`, `class`,`name` attribute and
`data-bind` attribute. Default behavior can be changed by providing a custom matcher function, as explained in section

@@ -105,0 +105,0 @@ [Configuration](https://github.com/leonidas/transparency#configuration). Values are escaped before rendering.

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc