transparency
Advanced tools
Comparing version 0.7.5 to 0.7.7
@@ -1,2 +0,2 @@ | ||
// Generated by CoffeeScript 1.3.3 | ||
// Generated by CoffeeScript 1.4.0 | ||
(function() { | ||
@@ -3,0 +3,0 @@ |
@@ -1,2 +0,2 @@ | ||
// Generated by CoffeeScript 1.3.3 | ||
// Generated by CoffeeScript 1.4.0 | ||
(function() { | ||
@@ -3,0 +3,0 @@ |
@@ -1,2 +0,2 @@ | ||
// Generated by CoffeeScript 1.3.3 | ||
// Generated by CoffeeScript 1.4.0 | ||
(function() { | ||
@@ -3,0 +3,0 @@ |
@@ -1,2 +0,2 @@ | ||
// Generated by CoffeeScript 1.3.3 | ||
// Generated by CoffeeScript 1.4.0 | ||
(function() { | ||
@@ -3,0 +3,0 @@ var Transparency; |
@@ -1,2 +0,2 @@ | ||
// Generated by CoffeeScript 1.3.3 | ||
// Generated by CoffeeScript 1.4.0 | ||
(function() { | ||
@@ -193,5 +193,6 @@ var Transparency; | ||
}); | ||
it("should throw an error unless directives are syntactically correct", function() { | ||
var data, directives, template; | ||
it("should skip directives which syntactically incorrect", function() { | ||
var data, directives, expected, template; | ||
template = $("<div id=\"template\">\n <div class=\"name\"></div>\n</div>"); | ||
expected = $("<div id=\"template\">\n <div class=\"name\">World</div>\n</div>"); | ||
data = { | ||
@@ -201,11 +202,10 @@ name: "World" | ||
directives = { | ||
name: function() { | ||
return "" + this.name + "!"; | ||
invalid: function() { | ||
return "Invalid!"; | ||
} | ||
}; | ||
return expect(function() { | ||
return template.render(data, directives); | ||
}).toThrow(new Error("Directive syntax is directive[element][attribute] = function(params)")); | ||
template.render(data, directives); | ||
return expect(template).toBeEqual(expected); | ||
}); | ||
return it("should use directive return value even if data value is null", function() { | ||
it("should use directive return value even if data value is null", function() { | ||
var data, directives, expected, template; | ||
@@ -227,4 +227,23 @@ template = $("<div id=\"template\">\n <div class=\"name\"></div>\n</div>"); | ||
}); | ||
return it("should allow rendering directives to the parent elements", function() { | ||
var data, directives, expected, template; | ||
template = $("<div class=\"container\">\n <a class=\"link\">\n <span class=\"name\"/>\n <span class=\"description\"/>\n </a>\n</div>"); | ||
expected = $("<div class=\"container\">\n <a class=\"link\" href=\"http://does-it-render.com/\">\n <span class=\"name\">MyLink</span>\n <span class=\"description>takes me somewhere</span>\n </a>\n</div>"); | ||
data = { | ||
link: { | ||
name: "MyLink", | ||
description: "takes me somewhere" | ||
} | ||
}; | ||
directives = { | ||
link: { | ||
href: function() { | ||
return "http://does-it-render.com/"; | ||
} | ||
} | ||
}; | ||
return $(".container").render(data, directives); | ||
}); | ||
}); | ||
}).call(this); |
@@ -1,2 +0,2 @@ | ||
// Generated by CoffeeScript 1.3.3 | ||
// Generated by CoffeeScript 1.4.0 | ||
(function() { | ||
@@ -50,2 +50,34 @@ var Transparency; | ||
}); | ||
it("should render list of options and set the selected", function() { | ||
var data, directives, expected, template; | ||
template = $("<select class=\"foo\" multiple>\n <option class=\"bar\"></option>\n</select>"); | ||
data = [ | ||
{ | ||
id: 1, | ||
name: "First" | ||
}, { | ||
id: 2, | ||
name: "Second" | ||
}, { | ||
id: 3, | ||
name: "Third" | ||
} | ||
]; | ||
directives = { | ||
bar: { | ||
value: function() { | ||
return this.id; | ||
}, | ||
text: function() { | ||
return this.name; | ||
}, | ||
selected: function() { | ||
return true; | ||
} | ||
} | ||
}; | ||
expected = $("<select class=\"foo\" multiple>\n <option class=\"bar\" value=\"1\" selected=\"selected\">First</option>\n <option class=\"bar\" value=\"2\">Second</option>\n <option class=\"bar\" value=\"3\">Third</option>\n</select>"); | ||
template.render(data, directives); | ||
return expect(template).toBeEqual(expected); | ||
}); | ||
it("should set the matching option to 'selected' in case the target element is 'select'", function() { | ||
@@ -52,0 +84,0 @@ var data, expected, template; |
@@ -1,2 +0,2 @@ | ||
// Generated by CoffeeScript 1.3.3 | ||
// Generated by CoffeeScript 1.4.0 | ||
(function() { | ||
@@ -3,0 +3,0 @@ var expectModelObjects; |
@@ -1,2 +0,2 @@ | ||
// Generated by CoffeeScript 1.3.3 | ||
// Generated by CoffeeScript 1.4.0 | ||
(function() { | ||
@@ -3,0 +3,0 @@ var Transparency; |
@@ -1,2 +0,2 @@ | ||
// Generated by CoffeeScript 1.3.3 | ||
// Generated by CoffeeScript 1.4.0 | ||
(function() { | ||
@@ -3,0 +3,0 @@ var isEqualDom, trim; |
{ | ||
"name": "transparency", | ||
"version": "0.7.4", | ||
"version": "0.7.7", | ||
"main": "./lib/transparency.js" | ||
} |
@@ -1,2 +0,2 @@ | ||
// Generated by CoffeeScript 1.3.3 | ||
// Generated by CoffeeScript 1.4.0 | ||
(function() { | ||
@@ -15,3 +15,3 @@ var __slice = [].slice, | ||
})(this, function() { | ||
var $, ELEMENT_NODE, Instance, TEXT_NODE, attr, cloneNode, consoleLogger, data, empty, expando, exports, getElementsAndChildNodes, getText, html5Clone, isDate, isDomElement, isPlainValue, log, matcher, matchingElements, nullLogger, prepareContext, register, render, renderDirectives, setHtml, setSelected, setText, _base, _ref, _ref1; | ||
var $, ELEMENT_NODE, Instance, TEXT_NODE, attr, cloneNode, consoleLogger, data, empty, expando, exports, getElementsAndChildNodes, getText, html5Clone, isBoolean, isDate, isDomElement, isPlainValue, log, matcher, matchingElements, nullLogger, prepareContext, register, render, renderDirectives, setHtml, setSelected, setText, _base, _ref, _ref1; | ||
register = function($) { | ||
@@ -37,10 +37,5 @@ return $.fn.render = function(models, directives, config) { | ||
consoleLogger = function() { | ||
var m, messages, _i, _len, _results; | ||
var messages; | ||
messages = 1 <= arguments.length ? __slice.call(arguments, 0) : []; | ||
_results = []; | ||
for (_i = 0, _len = messages.length; _i < _len; _i++) { | ||
m = messages[_i]; | ||
_results.push(console.log(m)); | ||
} | ||
return _results; | ||
return console.log.apply(console, messages); | ||
}; | ||
@@ -197,31 +192,30 @@ log = nullLogger; | ||
attributes = directives[key]; | ||
if (typeof attributes !== 'object') { | ||
throw new Error("Directive syntax is directive[element][attribute] = function(params)"); | ||
if (typeof attributes === 'object') { | ||
_results.push((function() { | ||
var _i, _len, _ref, _results1; | ||
_ref = matchingElements(instance, key); | ||
_results1 = []; | ||
for (_i = 0, _len = _ref.length; _i < _len; _i++) { | ||
element = _ref[_i]; | ||
_results1.push((function() { | ||
var _results2; | ||
_results2 = []; | ||
for (attribute in attributes) { | ||
directive = attributes[attribute]; | ||
if (!(typeof directive === 'function')) { | ||
continue; | ||
} | ||
value = directive.call(model, { | ||
element: element, | ||
index: index, | ||
value: attr(element, attribute) | ||
}); | ||
_results2.push(attr(element, attribute, value)); | ||
} | ||
return _results2; | ||
})()); | ||
} | ||
return _results1; | ||
})()); | ||
} | ||
_results.push((function() { | ||
var _i, _len, _ref, _results1; | ||
_ref = matchingElements(instance, key); | ||
_results1 = []; | ||
for (_i = 0, _len = _ref.length; _i < _len; _i++) { | ||
element = _ref[_i]; | ||
_results1.push((function() { | ||
var _results2; | ||
_results2 = []; | ||
for (attribute in attributes) { | ||
directive = attributes[attribute]; | ||
if (!(typeof directive === 'function')) { | ||
continue; | ||
} | ||
value = directive.call(model, { | ||
element: element, | ||
index: index, | ||
value: attr(element, attribute) | ||
}); | ||
_results2.push(attr(element, attribute, value)); | ||
} | ||
return _results2; | ||
})()); | ||
} | ||
return _results1; | ||
})()); | ||
} | ||
@@ -311,36 +305,47 @@ return _results; | ||
var elementData, _base, _base1, _base2, _base3; | ||
if ((value != null) && typeof value !== 'string') { | ||
value = value.toString(); | ||
} | ||
elementData = data(element); | ||
elementData.originalAttributes || (elementData.originalAttributes = {}); | ||
switch (attribute) { | ||
case 'text': | ||
(_base = elementData.originalAttributes)['text'] || (_base['text'] = getText(element)); | ||
if (value != null) { | ||
setText(element, value); | ||
} | ||
break; | ||
case 'html': | ||
(_base1 = elementData.originalAttributes)['html'] || (_base1['html'] = element.innerHTML); | ||
if (value != null) { | ||
setHtml(element, value); | ||
} | ||
break; | ||
case 'class': | ||
(_base2 = elementData.originalAttributes)['class'] || (_base2['class'] = element.className); | ||
if (value != null) { | ||
element.className = value; | ||
} | ||
break; | ||
case 'selected': | ||
if (value != null) { | ||
setSelected(element, value); | ||
} | ||
break; | ||
default: | ||
(_base3 = elementData.originalAttributes)[attribute] || (_base3[attribute] = element.getAttribute(attribute)); | ||
if (value != null) { | ||
element.setAttribute(attribute, value); | ||
} | ||
if (element.nodeName.toLowerCase() === 'select' && attribute === 'selected') { | ||
if ((value != null) && typeof value !== 'string') { | ||
value = value.toString(); | ||
} | ||
if (value != null) { | ||
setSelected(element, value); | ||
} | ||
} else { | ||
switch (attribute) { | ||
case 'text': | ||
if ((value != null) && typeof value !== 'string') { | ||
value = value.toString(); | ||
} | ||
(_base = elementData.originalAttributes)['text'] || (_base['text'] = getText(element)); | ||
if (value != null) { | ||
setText(element, value); | ||
} | ||
break; | ||
case 'html': | ||
if ((value != null) && typeof value !== 'string') { | ||
value = value.toString(); | ||
} | ||
(_base1 = elementData.originalAttributes)['html'] || (_base1['html'] = element.innerHTML); | ||
if (value != null) { | ||
setHtml(element, value); | ||
} | ||
break; | ||
case 'class': | ||
(_base2 = elementData.originalAttributes)['class'] || (_base2['class'] = element.className); | ||
if (value != null) { | ||
element.className = value; | ||
} | ||
break; | ||
default: | ||
(_base3 = elementData.originalAttributes)[attribute] || (_base3[attribute] = element.getAttribute(attribute)); | ||
if (isBoolean(value)) { | ||
element[attribute] = value; | ||
} else { | ||
if (value != null) { | ||
element.setAttribute(attribute, value); | ||
} | ||
} | ||
} | ||
} | ||
@@ -419,2 +424,5 @@ if (value != null) { | ||
}; | ||
isBoolean = function(obj) { | ||
return obj === true || obj === false; | ||
}; | ||
return exports = { | ||
@@ -421,0 +429,0 @@ render: render, |
@@ -1,2 +0,2 @@ | ||
// Generated by CoffeeScript 1.3.3 | ||
(function(){var e=[].slice,t={}.hasOwnProperty;(function(e,t){return(typeof define!="undefined"&&define!==null?define.amd:void 0)?define(t):(typeof module!="undefined"&&module!==null?module.exports:void 0)?module.exports=t():e.Transparency=t()})(this,function(){var 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,_;T=function(e){return e.fn.render=function(e,t,n){var r,i,s;for(i=0,s=this.length;i<s;i++)r=this[i],N(r,e,t,n);return this}};if(this.jQuery!=null||this.Zepto!=null)n=this.jQuery||this.Zepto,T(n);return c="transparency",f=function(e){return e[c]||(e[c]={})},S=function(){},a=function(){var t,n,r,i,s;n=1<=arguments.length?e.call(arguments,0):[],s=[];for(r=0,i=n.length;r<i;r++)t=n[r],s.push(console.log(t));return s},b=S,N=function(e,n,r,i){var s,u,c,h,p,d,v,m,w,T,k,L,A,O,M,_,D,P,H,B,j,F,I,q,R;b=(i!=null?i.debug:void 0)&&typeof console!="undefined"&&console!==null?a:S,b("Context:",e,"Models:",n,"Directives:",r,"Config:",i);if(!e)return;n||(n=[]),r||(r={}),Array.isArray(n)||(n=[n]),T=e.parentNode,T&&(k=e.nextSibling,T.removeChild(e)),x(e,n),u=f(e);for(p=A=0,D=n.length;A<D;p=++A){m=n[p],s=[],d=u.instances[p],b("Model:",m,"Template instance for the model:",d),I=d.elements;for(O=0,P=I.length;O<P;O++)c=I[O],f(c).model=m;if(g(m)&&(h=d.elements[0]))l(h).appendChild(m);else if(typeof m=="object")for(v in m){if(!t.call(m,v))continue;L=m[v];if(L!=null)if(y(L)){q=E(d,v);for(M=0,H=q.length;M<H;M++)h=q[M],w=h.nodeName.toLowerCase(),w==="input"?o(h,"value",L):w==="select"?o(h,"selected",L):o(h,"text",L)}else typeof L=="object"&&s.push(v)}C(d,m,p,r);for(_=0,B=s.length;_<B;_++){v=s[_],R=E(d,v);for(F=0,j=R.length;F<j;F++)h=R[F],N(h,m[v],r[v],i)}}return T&&(k?T.insertBefore(e,k):T.appendChild(e)),e},x=function(e,t){var n,r,s,o,a,l,c;n=f(e),n.template||(n.template=u(e),n.instanceCache=[],n.instances=[new i(e)]),b("Template",n.template);while(t.length>n.instances.length){r=n.instanceCache.pop()||new i(u(n.template)),l=r.childNodes;for(o=0,a=l.length;o<a;o++)s=l[o],e.appendChild(s);n.instances.push(r)}c=[];while(t.length<n.instances.length)n.instanceCache.push(r=n.instances.pop()),c.push(function(){var e,t,n,i;n=r.childNodes,i=[];for(e=0,t=n.length;e<t;e++)s=n[e],i.push(s.parentNode.removeChild(s));return i}());return c},i=function(){function e(e){this.template=e,this.queryCache={},this.elements=[],this.childNodes=[],p(this.template,this.elements,this.childNodes)}return e}(),p=function(e,t,n){var i,s;i=e.firstChild,s=[];while(i)n!=null&&n.push(i),i.nodeType===r&&(t.push(i),p(i,t)),s.push(i=i.nextSibling);return s},C=function(e,n,r,i){var s,u,a,f,l,c,h;if(!i)return;n=typeof n=="object"?n:{value:n},h=[];for(l in i){if(!t.call(i,l))continue;u=i[l];if(typeof u!="object")throw new Error("Directive syntax is directive[element][attribute] = function(params)");h.push(function(){var t,i,h,p;h=E(e,l),p=[];for(t=0,i=h.length;t<i;t++)f=h[t],p.push(function(){var e;e=[];for(s in u){a=u[s];if(typeof a!="function")continue;c=a.call(n,{element:f,index:r,value:o(f,s)}),e.push(o(f,s,c))}return e}());return p}())}return h},k=function(e,t){var n,i,s,o,u,a,c;i=f(e);if(i.html===t)return;i.html=t,i.children||(i.children=function(){var t,n,i,o;i=e.childNodes,o=[];for(t=0,n=i.length;t<n;t++)s=i[t],s.nodeType===r&&o.push(s);return o}()),l(e),e.innerHTML=t,a=i.children,c=[];for(o=0,u=a.length;o<u;o++)n=a[o],c.push(e.appendChild(n));return c},A=function(e,t){var n,r;n=f(e);if(t==null||n.text===t)return;return n.text=t,r=e.firstChild,r?r.nodeType!==s?e.insertBefore(e.ownerDocument.createTextNode(t),r):r.nodeValue=t:e.appendChild(e.ownerDocument.createTextNode(t))},d=function(e){var t;return function(){var n,r,i,o;i=e.childNodes,o=[];for(n=0,r=i.length;n<r;n++)t=i[n],t.nodeType===s&&o.push(t.nodeValue);return o}().join("")},L=function(e,t){var n,r,i,s,o;r=[],p(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},o=function(e,t,n){var r,i,s,o,u;n!=null&&typeof n!="string"&&(n=n.toString()),r=f(e),r.originalAttributes||(r.originalAttributes={});switch(t){case"text":(i=r.originalAttributes).text||(i.text=d(e)),n!=null&&A(e,n);break;case"html":(s=r.originalAttributes).html||(s.html=e.innerHTML),n!=null&&k(e,n);break;case"class":(o=r.originalAttributes)["class"]||(o["class"]=e.className),n!=null&&(e.className=n);break;case"selected":n!=null&&L(e,n);break;default:(u=r.originalAttributes)[t]||(u[t]=e.getAttribute(t)),n!=null&&e.setAttribute(t,n)}return n!=null?n:r.originalAttributes[t]},E=function(e,t){var n,r,i;return r=(i=e.queryCache)[t]||(i[t]=function(){var r,i,s,o;s=e.elements,o=[];for(r=0,i=s.length;r<i;r++)n=s[r],h.matcher(n,t)&&o.push(n);return o}()),b("Matching elements for '"+t+"':",r),r},w=function(e,t){return e.id===t||e.className.split(" ").indexOf(t)>-1||e.name===t||e.getAttribute("data-bind")===t},l=function(e){var t;while(t=e.firstChild)e.removeChild(t);return e},r=1,s=3,v=function(){return document.createElement("nav").cloneNode(!0).outerHTML!=="<:nav></:nav>"},u=typeof document=="undefined"||document===null||v()?function(e){return e.cloneNode(!0)}:function(e){var t,i,s,o,u;t=n(e).clone()[0];if(t.nodeType===r){t.removeAttribute(c),u=t.getElementsByTagName("*");for(s=0,o=u.length;s<o;s++)i=u[s],i.removeAttribute(c)}return t},(M=Array.isArray)==null&&(Array.isArray=function(e){return n.isArray(e)}),(_=(O=Array.prototype).indexOf)==null&&(O.indexOf=function(e){return n.inArray(e,this)}),m=function(e){return Object.prototype.toString.call(e)==="[object Date]"},g=function(e){return(e!=null?e.nodeType:void 0)===r},y=function(e){return m(e)||typeof e!="object"&&typeof e!="function"},h={render:N,register:T,matcher:w}})}).call(this); | ||
// Generated by CoffeeScript 1.4.0 | ||
(function(){var e=[].slice,t={}.hasOwnProperty;(function(e,t){return(typeof define!="undefined"&&define!==null?define.amd:void 0)?define(t):(typeof module!="undefined"&&module!==null?module.exports:void 0)?module.exports=t():e.Transparency=t()})(this,function(){var 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,_,D;N=function(e){return e.fn.render=function(e,t,n){var r,i,s;for(i=0,s=this.length;i<s;i++)r=this[i],C(r,e,t,n);return this}};if(this.jQuery!=null||this.Zepto!=null)n=this.jQuery||this.Zepto,N(n);return c="transparency",f=function(e){return e[c]||(e[c]={})},x=function(){},a=function(){var t;return t=1<=arguments.length?e.call(arguments,0):[],console.log.apply(console,t)},w=x,C=function(e,n,r,i){var s,u,c,h,p,d,v,m,g,E,N,L,A,O,M,_,D,P,H,B,j,F,I,q,R;w=(i!=null?i.debug:void 0)&&typeof console!="undefined"&&console!==null?a:x,w("Context:",e,"Models:",n,"Directives:",r,"Config:",i);if(!e)return;n||(n=[]),r||(r={}),Array.isArray(n)||(n=[n]),E=e.parentNode,E&&(N=e.nextSibling,E.removeChild(e)),T(e,n),u=f(e);for(p=A=0,D=n.length;A<D;p=++A){m=n[p],s=[],d=u.instances[p],w("Model:",m,"Template instance for the model:",d),I=d.elements;for(O=0,P=I.length;O<P;O++)c=I[O],f(c).model=m;if(y(m)&&(h=d.elements[0]))l(h).appendChild(m);else if(typeof m=="object")for(v in m){if(!t.call(m,v))continue;L=m[v];if(L!=null)if(b(L)){q=S(d,v);for(M=0,H=q.length;M<H;M++)h=q[M],g=h.nodeName.toLowerCase(),g==="input"?o(h,"value",L):g==="select"?o(h,"selected",L):o(h,"text",L)}else typeof L=="object"&&s.push(v)}k(d,m,p,r);for(_=0,B=s.length;_<B;_++){v=s[_],R=S(d,v);for(F=0,j=R.length;F<j;F++)h=R[F],C(h,m[v],r[v],i)}}return E&&(N?E.insertBefore(e,N):E.appendChild(e)),e},T=function(e,t){var n,r,s,o,a,l,c;n=f(e),n.template||(n.template=u(e),n.instanceCache=[],n.instances=[new i(e)]),w("Template",n.template);while(t.length>n.instances.length){r=n.instanceCache.pop()||new i(u(n.template)),l=r.childNodes;for(o=0,a=l.length;o<a;o++)s=l[o],e.appendChild(s);n.instances.push(r)}c=[];while(t.length<n.instances.length)n.instanceCache.push(r=n.instances.pop()),c.push(function(){var e,t,n,i;n=r.childNodes,i=[];for(e=0,t=n.length;e<t;e++)s=n[e],i.push(s.parentNode.removeChild(s));return i}());return c},i=function(){function e(e){this.template=e,this.queryCache={},this.elements=[],this.childNodes=[],p(this.template,this.elements,this.childNodes)}return e}(),p=function(e,t,n){var i,s;i=e.firstChild,s=[];while(i)n!=null&&n.push(i),i.nodeType===r&&(t.push(i),p(i,t)),s.push(i=i.nextSibling);return s},k=function(e,n,r,i){var s,u,a,f,l,c,h;if(!i)return;n=typeof n=="object"?n:{value:n},h=[];for(l in i){if(!t.call(i,l))continue;u=i[l],typeof u=="object"&&h.push(function(){var t,i,h,p;h=S(e,l),p=[];for(t=0,i=h.length;t<i;t++)f=h[t],p.push(function(){var e;e=[];for(s in u){a=u[s];if(typeof a!="function")continue;c=a.call(n,{element:f,index:r,value:o(f,s)}),e.push(o(f,s,c))}return e}());return p}())}return h},L=function(e,t){var n,i,s,o,u,a,c;i=f(e);if(i.html===t)return;i.html=t,i.children||(i.children=function(){var t,n,i,o;i=e.childNodes,o=[];for(t=0,n=i.length;t<n;t++)s=i[t],s.nodeType===r&&o.push(s);return o}()),l(e),e.innerHTML=t,a=i.children,c=[];for(o=0,u=a.length;o<u;o++)n=a[o],c.push(e.appendChild(n));return c},O=function(e,t){var n,r;n=f(e);if(t==null||n.text===t)return;return n.text=t,r=e.firstChild,r?r.nodeType!==s?e.insertBefore(e.ownerDocument.createTextNode(t),r):r.nodeValue=t:e.appendChild(e.ownerDocument.createTextNode(t))},d=function(e){var t;return function(){var n,r,i,o;i=e.childNodes,o=[];for(n=0,r=i.length;n<r;n++)t=i[n],t.nodeType===s&&o.push(t.nodeValue);return o}().join("")},A=function(e,t){var n,r,i,s,o;r=[],p(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},o=function(e,t,n){var r,i,s,o,u;r=f(e),r.originalAttributes||(r.originalAttributes={});if(e.nodeName.toLowerCase()==="select"&&t==="selected")n!=null&&typeof n!="string"&&(n=n.toString()),n!=null&&A(e,n);else switch(t){case"text":n!=null&&typeof n!="string"&&(n=n.toString()),(i=r.originalAttributes).text||(i.text=d(e)),n!=null&&O(e,n);break;case"html":n!=null&&typeof n!="string"&&(n=n.toString()),(s=r.originalAttributes).html||(s.html=e.innerHTML),n!=null&&L(e,n);break;case"class":(o=r.originalAttributes)["class"]||(o["class"]=e.className),n!=null&&(e.className=n);break;default:(u=r.originalAttributes)[t]||(u[t]=e.getAttribute(t)),m(n)?e[t]=n:n!=null&&e.setAttribute(t,n)}return n!=null?n:r.originalAttributes[t]},S=function(e,t){var n,r,i;return r=(i=e.queryCache)[t]||(i[t]=function(){var r,i,s,o;s=e.elements,o=[];for(r=0,i=s.length;r<i;r++)n=s[r],h.matcher(n,t)&&o.push(n);return o}()),w("Matching elements for '"+t+"':",r),r},E=function(e,t){return e.id===t||e.className.split(" ").indexOf(t)>-1||e.name===t||e.getAttribute("data-bind")===t},l=function(e){var t;while(t=e.firstChild)e.removeChild(t);return e},r=1,s=3,v=function(){return document.createElement("nav").cloneNode(!0).outerHTML!=="<:nav></:nav>"},u=typeof document=="undefined"||document===null||v()?function(e){return e.cloneNode(!0)}:function(e){var t,i,s,o,u;t=n(e).clone()[0];if(t.nodeType===r){t.removeAttribute(c),u=t.getElementsByTagName("*");for(s=0,o=u.length;s<o;s++)i=u[s],i.removeAttribute(c)}return t},(_=Array.isArray)==null&&(Array.isArray=function(e){return n.isArray(e)}),(D=(M=Array.prototype).indexOf)==null&&(M.indexOf=function(e){return n.inArray(e,this)}),g=function(e){return Object.prototype.toString.call(e)==="[object Date]"},y=function(e){return(e!=null?e.nodeType:void 0)===r},b=function(e){return g(e)||typeof e!="object"&&typeof e!="function"},m=function(e){return e===!0||e===!1},h={render:C,register:N,matcher:E}})}).call(this); |
{ | ||
"name" : "transparency", | ||
"version" : "0.7.5", | ||
"version" : "0.7.7", | ||
"main" : "lib/transparency", | ||
@@ -20,3 +20,3 @@ "description" : "Transparency is a minimal template engine for browsers. It maps JSON objects to DOM elements with zero configuration.", | ||
"dependencies" : {"jsdom" : ">=0.2.10"}, | ||
"devDependencies": {"jasmine-node" : ">=1.0.x", | ||
"devDependencies": {"jasmine-node" : "=1.0.26", | ||
"coffee-script": ">=1.2.x", | ||
@@ -23,0 +23,0 @@ "jquery" : ">=1.6.x", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4124265
15139