Build 0.3.4.
Showing
4 changed files
with
24 additions
and
37 deletions
1 | // rivets.js | 1 | // rivets.js |
2 | // version: 0.3.3 | 2 | // version: 0.3.4 |
3 | // author: Michael Richards | 3 | // author: Michael Richards |
4 | // license: MIT | 4 | // license: MIT |
5 | (function() { | 5 | (function() { |
... | @@ -163,7 +163,7 @@ | ... | @@ -163,7 +163,7 @@ |
163 | }; | 163 | }; |
164 | 164 | ||
165 | View.prototype.build = function() { | 165 | View.prototype.build = function() { |
166 | var bindingRegExp, classRegExp, el, eventRegExp, iterationRegExp, iterator, node, parseNode, skipNodes, _i, _len, _ref, _results, | 166 | var bindingRegExp, classRegExp, el, eventRegExp, iterationRegExp, iterator, node, parseNode, skipNodes, _i, _j, _len, _len1, _ref, _ref1, |
167 | _this = this; | 167 | _this = this; |
168 | this.bindings = []; | 168 | this.bindings = []; |
169 | skipNodes = []; | 169 | skipNodes = []; |
... | @@ -173,7 +173,7 @@ | ... | @@ -173,7 +173,7 @@ |
173 | classRegExp = /^class-/; | 173 | classRegExp = /^class-/; |
174 | iterationRegExp = /^each-/; | 174 | iterationRegExp = /^each-/; |
175 | parseNode = function(node) { | 175 | parseNode = function(node) { |
176 | var a, attribute, binding, context, ctx, dependencies, keypath, model, n, options, path, pipe, pipes, splitPath, type, _i, _j, _k, _l, _len, _len1, _len2, _len3, _ref, _ref1, _ref2, _results; | 176 | var a, attribute, binding, context, ctx, dependencies, keypath, model, n, options, path, pipe, pipes, splitPath, type, _i, _j, _k, _l, _len, _len1, _len2, _len3, _ref, _ref1, _ref2; |
177 | if (__indexOf.call(skipNodes, node) < 0) { | 177 | if (__indexOf.call(skipNodes, node) < 0) { |
178 | _ref = node.attributes; | 178 | _ref = node.attributes; |
179 | for (_i = 0, _len = _ref.length; _i < _len; _i++) { | 179 | for (_i = 0, _len = _ref.length; _i < _len; _i++) { |
... | @@ -193,31 +193,30 @@ | ... | @@ -193,31 +193,30 @@ |
193 | } | 193 | } |
194 | } | 194 | } |
195 | _ref2 = iterator || node.attributes; | 195 | _ref2 = iterator || node.attributes; |
196 | _results = []; | ||
197 | for (_k = 0, _len2 = _ref2.length; _k < _len2; _k++) { | 196 | for (_k = 0, _len2 = _ref2.length; _k < _len2; _k++) { |
198 | attribute = _ref2[_k]; | 197 | attribute = _ref2[_k]; |
199 | if (bindingRegExp.test(attribute.name)) { | 198 | if (bindingRegExp.test(attribute.name)) { |
200 | options = {}; | 199 | options = {}; |
201 | type = attribute.name.replace(bindingRegExp, ''); | 200 | type = attribute.name.replace(bindingRegExp, ''); |
202 | pipes = (function() { | 201 | pipes = (function() { |
203 | var _l, _len3, _ref3, _results1; | 202 | var _l, _len3, _ref3, _results; |
204 | _ref3 = attribute.value.split('|'); | 203 | _ref3 = attribute.value.split('|'); |
205 | _results1 = []; | 204 | _results = []; |
206 | for (_l = 0, _len3 = _ref3.length; _l < _len3; _l++) { | 205 | for (_l = 0, _len3 = _ref3.length; _l < _len3; _l++) { |
207 | pipe = _ref3[_l]; | 206 | pipe = _ref3[_l]; |
208 | _results1.push(pipe.trim()); | 207 | _results.push(pipe.trim()); |
209 | } | 208 | } |
210 | return _results1; | 209 | return _results; |
211 | })(); | 210 | })(); |
212 | context = (function() { | 211 | context = (function() { |
213 | var _l, _len3, _ref3, _results1; | 212 | var _l, _len3, _ref3, _results; |
214 | _ref3 = pipes.shift().split('>'); | 213 | _ref3 = pipes.shift().split('<'); |
215 | _results1 = []; | 214 | _results = []; |
216 | for (_l = 0, _len3 = _ref3.length; _l < _len3; _l++) { | 215 | for (_l = 0, _len3 = _ref3.length; _l < _len3; _l++) { |
217 | ctx = _ref3[_l]; | 216 | ctx = _ref3[_l]; |
218 | _results1.push(ctx.trim()); | 217 | _results.push(ctx.trim()); |
219 | } | 218 | } |
220 | return _results1; | 219 | return _results; |
221 | })(); | 220 | })(); |
222 | path = context.shift(); | 221 | path = context.shift(); |
223 | splitPath = path.split(/\.|:/); | 222 | splitPath = path.split(/\.|:/); |
... | @@ -251,31 +250,21 @@ | ... | @@ -251,31 +250,21 @@ |
251 | a = iterator[_l]; | 250 | a = iterator[_l]; |
252 | node.removeAttribute(a.name); | 251 | node.removeAttribute(a.name); |
253 | } | 252 | } |
254 | _results.push(iterator = null); | 253 | iterator = null; |
255 | } else { | ||
256 | _results.push(void 0); | ||
257 | } | 254 | } |
258 | } | 255 | } |
259 | return _results; | ||
260 | } | 256 | } |
261 | }; | 257 | }; |
262 | _ref = this.els; | 258 | _ref = this.els; |
263 | _results = []; | ||
264 | for (_i = 0, _len = _ref.length; _i < _len; _i++) { | 259 | for (_i = 0, _len = _ref.length; _i < _len; _i++) { |
265 | el = _ref[_i]; | 260 | el = _ref[_i]; |
266 | parseNode(el); | 261 | parseNode(el); |
267 | _results.push((function() { | 262 | _ref1 = el.getElementsByTagName('*'); |
268 | var _j, _len1, _ref1, _results1; | 263 | for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) { |
269 | _ref1 = el.getElementsByTagName('*'); | 264 | node = _ref1[_j]; |
270 | _results1 = []; | 265 | parseNode(node); |
271 | for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) { | 266 | } |
272 | node = _ref1[_j]; | ||
273 | _results1.push(parseNode(node)); | ||
274 | } | ||
275 | return _results1; | ||
276 | })()); | ||
277 | } | 267 | } |
278 | return _results; | ||
279 | }; | 268 | }; |
280 | 269 | ||
281 | View.prototype.bind = function() { | 270 | View.prototype.bind = function() { |
... | @@ -454,16 +443,14 @@ | ... | @@ -454,16 +443,14 @@ |
454 | formatters: Rivets.formatters, | 443 | formatters: Rivets.formatters, |
455 | config: Rivets.config, | 444 | config: Rivets.config, |
456 | configure: function(options) { | 445 | configure: function(options) { |
457 | var property, value, _results; | 446 | var property, value; |
458 | if (options == null) { | 447 | if (options == null) { |
459 | options = {}; | 448 | options = {}; |
460 | } | 449 | } |
461 | _results = []; | ||
462 | for (property in options) { | 450 | for (property in options) { |
463 | value = options[property]; | 451 | value = options[property]; |
464 | _results.push(Rivets.config[property] = value); | 452 | Rivets.config[property] = value; |
465 | } | 453 | } |
466 | return _results; | ||
467 | }, | 454 | }, |
468 | bind: function(el, models) { | 455 | bind: function(el, models) { |
469 | var view; | 456 | var view; | ... | ... |
1 | // rivets.js | 1 | // rivets.js |
2 | // version: 0.3.3 | 2 | // version: 0.3.4 |
3 | // author: Michael Richards | 3 | // author: Michael Richards |
4 | // license: MIT | 4 | // license: MIT |
5 | (function(){var a,b,c,d,e,f,g,h,i,j=function(a,b){return function(){return a.apply(b,arguments)}},k=[].slice,l=[].indexOf||function(a){for(var b=0,c=this.length;b<c;b++)if(b in this&&this[b]===a)return b;return-1};a={},String.prototype.trim||(String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")}),a.Binding=function(){function h(c,f,h,i,k){this.el=c,this.type=f,this.model=h,this.keypath=i,this.options=k!=null?k:{},this.unbind=j(this.unbind,this),this.publish=j(this.publish,this),this.bind=j(this.bind,this),this.set=j(this.set,this),this.formattedValue=j(this.formattedValue,this),this.routine=function(){switch(this.options.special){case"event":return e(this.type);case"class":return d(this.type);case"iteration":return g(this.type);default:return a.routines[this.type]||b(this.type)}}.call(this),this.formatters=this.options.formatters||[]}return h.prototype.bidirectionals=["value","checked","unchecked"],h.prototype.formattedValue=function(b){var c,d,e,f,g,h,i,j;h=this.formatters;for(f=0,g=h.length;f<g;f++)d=h[f],c=d.split(/\s+/),e=c.shift(),b=this.model[e]instanceof Function?(i=this.model)[e].apply(i,[b].concat(k.call(c))):a.formatters[e]?(j=a.formatters)[e].apply(j,[b].concat(k.call(c))):void 0;return b},h.prototype.set=function(a){return a=this.formattedValue(a),this.options.special==="event"?(this.routine(this.el,a,this.currentListener),this.currentListener=a):this.options.special==="iteration"?this.routine(this.el,a,this):(a instanceof Function&&(a=a.call(this.model)),this.routine(this.el,a))},h.prototype.bind=function(){var b,d,e,f,g,h,i,j=this;this.options.bypass?this.set(this.model[this.keypath]):(a.config.adapter.subscribe(this.model,this.keypath,this.set),a.config.preloadData&&this.set(a.config.adapter.read(this.model,this.keypath)));if((g=this.options.dependencies)!=null?g.length:void 0){this.dependencyCallbacks={},h=this.options.dependencies;for(e=0,f=h.length;e<f;e++)d=h[e],b=this.dependencyCallbacks[d]=function(b){return j.set(j.options.bypass?j.model[j.keypath]:a.config.adapter.read(j.model,j.keypath))},a.config.adapter.subscribe(this.model,d,b)}if(i=this.type,l.call(this.bidirectionals,i)>=0)return c(this.el,"change",this.publish)},h.prototype.publish=function(b){var c;return c=b.target||b.srcElement,a.config.adapter.publish(this.model,this.keypath,f(c))},h.prototype.unbind=function(){var b,c,d,e,f,g,h;if(!this.options.bypass){a.config.adapter.unsubscribe(this.model,this.keypath,this.set);if((f=this.options.dependencies)!=null?f.length:void 0){g=this.options.dependencies;for(d=0,e=g.length;d<e;d++)c=g[d],b=this.dependencyCallbacks[c],a.config.adapter.unsubscribe(this.model,c,b)}if(h=this.type,l.call(this.bidirectionals,h)>=0)return this.el.removeEventListener("change",this.publish)}},h}(),a.View=function(){function b(a,b){this.els=a,this.models=b,this.unbind=j(this.unbind,this),this.bind=j(this.bind,this),this.build=j(this.build,this),this.bindingRegExp=j(this.bindingRegExp,this),this.els.jquery||this.els instanceof Array||(this.els=[this.els]),this.build()}return b.prototype.bindingRegExp=function(){var b;return b=a.config.prefix,b?new RegExp("^data-"+b+"-"):/^data-/},b.prototype.build=function(){var b,c,d,e,f,g,h,i,j,k,m,n,o,p=this;this.bindings=[],j=[],g=null,b=this.bindingRegExp(),e=/^on-/,c=/^class-/,f=/^each-/,i=function(d){var h,i,k,m,n,o,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K;if(l.call(j,d)<0){H=d.attributes;for(z=0,D=H.length;z<D;z++){i=H[z];if(b.test(i.name)){y=i.name.replace(b,"");if(f.test(y)&&!p.models[y.replace(f,"")]){I=d.getElementsByTagName("*");for(A=0,E=I.length;A<E;A++)s=I[A],j.push(s);g=[i]}}}J=g||d.attributes,K=[];for(B=0,F=J.length;B<F;B++){i=J[B];if(b.test(i.name)){t={},y=i.name.replace(b,""),w=function(){var a,b,c,d;c=i.value.split("|"),d=[];for(a=0,b=c.length;a<b;a++)v=c[a],d.push(v.trim());return d}(),m=function(){var a,b,c,d;c=w.shift().split(">"),d=[];for(a=0,b=c.length;a<b;a++)n=c[a],d.push(n.trim());return d}(),u=m.shift(),x=u.split(/\.|:/),t.formatters=w,r=p.models[x.shift()],t.bypass=u.indexOf(":")!==-1,q=x.join();if(r){if(o=m.shift())t.dependencies=o.split(/\s+/);e.test(y)&&(y=y.replace(e,""),t.special="event"),c.test(y)&&(y=y.replace(c,""),t.special="class"),f.test(y)&&(y=y.replace(f,""),t.special="iteration"),k=new a.Binding(d,y,r,q,t),k.view=p,p.bindings.push(k)}}if(g){for(C=0,G=g.length;C<G;C++)h=g[C],d.removeAttribute(h.name);K.push(g=null)}else K.push(void 0)}return K}},n=this.els,o=[];for(k=0,m=n.length;k<m;k++)d=n[k],i(d),o.push(function(){var a,b,c,e;c=d.getElementsByTagName("*"),e=[];for(a=0,b=c.length;a<b;a++)h=c[a],e.push(i(h));return e}());return o},b.prototype.bind=function(){var a,b,c,d,e;d=this.bindings,e=[];for(b=0,c=d.length;b<c;b++)a=d[b],e.push(a.bind());return e},b.prototype.unbind=function(){var a,b,c,d,e;d=this.bindings,e=[];for(b=0,c=d.length;b<c;b++)a=d[b],e.push(a.unbind());return e},b}(),c=function(a,b,c){return window.addEventListener?a.addEventListener(b,c,!1):(b="on"+b,a.attachEvent(b,c))},i=function(a,b,c){return window.removeEventListener?a.removeEventListener(b,c,!1):(b="on"+b,a.detachEvent(b,c))},f=function(a){switch(a.type){case"checkbox":return a.checked;default:return a.value}},e=function(a){return function(b,d,e){d&&c(b,a,d);if(e)return i(b,a,e)}},d=function(a){return function(b,c){var d,e;d=" "+b.className+" ",e=d.indexOf(" "+a+" ")!==-1;if(!c===e)return b.className=c?""+b.className+" "+a:d.replace(" "+a+" "," ").trim()}},g=function(a){return function(b,c,d){var e,f,g,i,j,k,l,m,n,o,p,q,r,s;if(d.iterated!=null){q=d.iterated;for(m=0,o=q.length;m<o;m++)i=q[m],i.view.unbind(),i.el.parentNode.removeChild(i.el)}else d.marker=document.createComment(" rivets: each-"+a+" "),b.parentNode.insertBefore(d.marker,b),b.parentNode.removeChild(b);d.iterated=[],s=[];for(n=0,p=c.length;n<p;n++){f=c[n],e={},r=d.view.models;for(k in r)j=r[k],e[k]=j;e[a]=f,g=b.cloneNode(!0),l=d.iterated[d.iterated.length-1]||d.marker,d.marker.parentNode.insertBefore(g,l.nextSibling),s.push(d.iterated.push({el:g,view:h.bind(g,e)}))}return s}},b=function(a){return function(b,c){return c?b.setAttribute(a,c):b.removeAttribute(a)}},a.routines={enabled:function(a,b){return a.disabled=!b},disabled:function(a,b){return a.disabled=!!b},checked:function(a,b){return a.type==="radio"?a.checked=a.value===b:a.checked=!!b},unchecked:function(a,b){return a.type==="radio"?a.checked=a.value!==b:a.checked=!b},show:function(a,b){return a.style.display=b?"":"none"},hide:function(a,b){return a.style.display=b?"none":""},html:function(a,b){return a.innerHTML=b!=null?b:""},value:function(a,b){return a.value=b!=null?b:""},text:function(a,b){return a.innerText!=null?a.innerText=b!=null?b:"":a.textContent=b!=null?b:""}},a.config={preloadData:!0},a.formatters={},h={routines:a.routines,formatters:a.formatters,config:a.config,configure:function(b){var c,d,e;b==null&&(b={}),e=[];for(c in b)d=b[c],e.push(a.config[c]=d);return e},bind:function(b,c){var d;return c==null&&(c={}),d=new a.View(b,c),d.bind(),d}},typeof module!="undefined"&&module!==null?module.exports=h:this.rivets=h}).call(this); | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
5 | (function(){var a,b,c,d,e,f,g,h,i,j=function(a,b){return function(){return a.apply(b,arguments)}},k=[].slice,l=[].indexOf||function(a){for(var b=0,c=this.length;b<c;b++)if(b in this&&this[b]===a)return b;return-1};a={},String.prototype.trim||(String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")}),a.Binding=function(){function h(c,f,h,i,k){this.el=c,this.type=f,this.model=h,this.keypath=i,this.options=k!=null?k:{},this.unbind=j(this.unbind,this),this.publish=j(this.publish,this),this.bind=j(this.bind,this),this.set=j(this.set,this),this.formattedValue=j(this.formattedValue,this),this.routine=function(){switch(this.options.special){case"event":return e(this.type);case"class":return d(this.type);case"iteration":return g(this.type);default:return a.routines[this.type]||b(this.type)}}.call(this),this.formatters=this.options.formatters||[]}return h.prototype.bidirectionals=["value","checked","unchecked"],h.prototype.formattedValue=function(b){var c,d,e,f,g,h,i,j;h=this.formatters;for(f=0,g=h.length;f<g;f++)d=h[f],c=d.split(/\s+/),e=c.shift(),b=this.model[e]instanceof Function?(i=this.model)[e].apply(i,[b].concat(k.call(c))):a.formatters[e]?(j=a.formatters)[e].apply(j,[b].concat(k.call(c))):void 0;return b},h.prototype.set=function(a){return a=this.formattedValue(a),this.options.special==="event"?(this.routine(this.el,a,this.currentListener),this.currentListener=a):this.options.special==="iteration"?this.routine(this.el,a,this):(a instanceof Function&&(a=a.call(this.model)),this.routine(this.el,a))},h.prototype.bind=function(){var b,d,e,f,g,h,i,j=this;this.options.bypass?this.set(this.model[this.keypath]):(a.config.adapter.subscribe(this.model,this.keypath,this.set),a.config.preloadData&&this.set(a.config.adapter.read(this.model,this.keypath)));if((g=this.options.dependencies)!=null?g.length:void 0){this.dependencyCallbacks={},h=this.options.dependencies;for(e=0,f=h.length;e<f;e++)d=h[e],b=this.dependencyCallbacks[d]=function(b){return j.set(j.options.bypass?j.model[j.keypath]:a.config.adapter.read(j.model,j.keypath))},a.config.adapter.subscribe(this.model,d,b)}if(i=this.type,l.call(this.bidirectionals,i)>=0)return c(this.el,"change",this.publish)},h.prototype.publish=function(b){var c;return c=b.target||b.srcElement,a.config.adapter.publish(this.model,this.keypath,f(c))},h.prototype.unbind=function(){var b,c,d,e,f,g,h;if(!this.options.bypass){a.config.adapter.unsubscribe(this.model,this.keypath,this.set);if((f=this.options.dependencies)!=null?f.length:void 0){g=this.options.dependencies;for(d=0,e=g.length;d<e;d++)c=g[d],b=this.dependencyCallbacks[c],a.config.adapter.unsubscribe(this.model,c,b)}if(h=this.type,l.call(this.bidirectionals,h)>=0)return this.el.removeEventListener("change",this.publish)}},h}(),a.View=function(){function b(a,b){this.els=a,this.models=b,this.unbind=j(this.unbind,this),this.bind=j(this.bind,this),this.build=j(this.build,this),this.bindingRegExp=j(this.bindingRegExp,this),this.els.jquery||this.els instanceof Array||(this.els=[this.els]),this.build()}return b.prototype.bindingRegExp=function(){var b;return b=a.config.prefix,b?new RegExp("^data-"+b+"-"):/^data-/},b.prototype.build=function(){var b,c,d,e,f,g,h,i,j,k,m,n,o,p,q,r=this;this.bindings=[],j=[],g=null,b=this.bindingRegExp(),e=/^on-/,c=/^class-/,f=/^each-/,i=function(d){var h,i,k,m,n,o,p,q,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J;if(l.call(j,d)<0){H=d.attributes;for(z=0,D=H.length;z<D;z++){i=H[z];if(b.test(i.name)){y=i.name.replace(b,"");if(f.test(y)&&!r.models[y.replace(f,"")]){I=d.getElementsByTagName("*");for(A=0,E=I.length;A<E;A++)s=I[A],j.push(s);g=[i]}}}J=g||d.attributes;for(B=0,F=J.length;B<F;B++){i=J[B];if(b.test(i.name)){t={},y=i.name.replace(b,""),w=function(){var a,b,c,d;c=i.value.split("|"),d=[];for(a=0,b=c.length;a<b;a++)v=c[a],d.push(v.trim());return d}(),m=function(){var a,b,c,d;c=w.shift().split("<"),d=[];for(a=0,b=c.length;a<b;a++)n=c[a],d.push(n.trim());return d}(),u=m.shift(),x=u.split(/\.|:/),t.formatters=w,q=r.models[x.shift()],t.bypass=u.indexOf(":")!==-1,p=x.join();if(q){if(o=m.shift())t.dependencies=o.split(/\s+/);e.test(y)&&(y=y.replace(e,""),t.special="event"),c.test(y)&&(y=y.replace(c,""),t.special="class"),f.test(y)&&(y=y.replace(f,""),t.special="iteration"),k=new a.Binding(d,y,q,p,t),k.view=r,r.bindings.push(k)}}if(g){for(C=0,G=g.length;C<G;C++)h=g[C],d.removeAttribute(h.name);g=null}}}},p=this.els;for(k=0,n=p.length;k<n;k++){d=p[k],i(d),q=d.getElementsByTagName("*");for(m=0,o=q.length;m<o;m++)h=q[m],i(h)}},b.prototype.bind=function(){var a,b,c,d,e;d=this.bindings,e=[];for(b=0,c=d.length;b<c;b++)a=d[b],e.push(a.bind());return e},b.prototype.unbind=function(){var a,b,c,d,e;d=this.bindings,e=[];for(b=0,c=d.length;b<c;b++)a=d[b],e.push(a.unbind());return e},b}(),c=function(a,b,c){return window.addEventListener?a.addEventListener(b,c,!1):(b="on"+b,a.attachEvent(b,c))},i=function(a,b,c){return window.removeEventListener?a.removeEventListener(b,c,!1):(b="on"+b,a.detachEvent(b,c))},f=function(a){switch(a.type){case"checkbox":return a.checked;default:return a.value}},e=function(a){return function(b,d,e){d&&c(b,a,d);if(e)return i(b,a,e)}},d=function(a){return function(b,c){var d,e;d=" "+b.className+" ",e=d.indexOf(" "+a+" ")!==-1;if(!c===e)return b.className=c?""+b.className+" "+a:d.replace(" "+a+" "," ").trim()}},g=function(a){return function(b,c,d){var e,f,g,i,j,k,l,m,n,o,p,q,r,s;if(d.iterated!=null){q=d.iterated;for(m=0,o=q.length;m<o;m++)i=q[m],i.view.unbind(),i.el.parentNode.removeChild(i.el)}else d.marker=document.createComment(" rivets: each-"+a+" "),b.parentNode.insertBefore(d.marker,b),b.parentNode.removeChild(b);d.iterated=[],s=[];for(n=0,p=c.length;n<p;n++){f=c[n],e={},r=d.view.models;for(k in r)j=r[k],e[k]=j;e[a]=f,g=b.cloneNode(!0),l=d.iterated[d.iterated.length-1]||d.marker,d.marker.parentNode.insertBefore(g,l.nextSibling),s.push(d.iterated.push({el:g,view:h.bind(g,e)}))}return s}},b=function(a){return function(b,c){return c?b.setAttribute(a,c):b.removeAttribute(a)}},a.routines={enabled:function(a,b){return a.disabled=!b},disabled:function(a,b){return a.disabled=!!b},checked:function(a,b){return a.type==="radio"?a.checked=a.value===b:a.checked=!!b},unchecked:function(a,b){return a.type==="radio"?a.checked=a.value!==b:a.checked=!b},show:function(a,b){return a.style.display=b?"":"none"},hide:function(a,b){return a.style.display=b?"none":""},html:function(a,b){return a.innerHTML=b!=null?b:""},value:function(a,b){return a.value=b!=null?b:""},text:function(a,b){return a.innerText!=null?a.innerText=b!=null?b:"":a.textContent=b!=null?b:""}},a.config={preloadData:!0},a.formatters={},h={routines:a.routines,formatters:a.formatters,config:a.config,configure:function(b){var c,d;b==null&&(b={});for(c in b)d=b[c],a.config[c]=d},bind:function(b,c){var d;return c==null&&(c={}),d=new a.View(b,c),d.bind(),d}},typeof module!="undefined"&&module!==null?module.exports=h:this.rivets=h}).call(this); | ||
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
1 | { | 1 | { |
2 | "name" : "rivets", | 2 | "name" : "rivets", |
3 | "description" : "Declarative data binding facility.", | 3 | "description" : "Declarative data binding facility.", |
4 | "version" : "0.3.3", | 4 | "version" : "0.3.4", |
5 | "author" : "Michael Richards", | 5 | "author" : "Michael Richards", |
6 | "url" : "http://rivetsjs.com", | 6 | "url" : "http://rivetsjs.com", |
7 | "main" : "./lib/rivets.js", | 7 | "main" : "./lib/rivets.js", | ... | ... |
-
Please register or sign in to post a comment