+1
-1
| { | ||
| "name": "Panzer", | ||
| "version": "0.3.6", | ||
| "version": "0.3.7", | ||
| "description": "A comprehensive node-tree solution, for smart data.", | ||
@@ -5,0 +5,0 @@ "author": { |
+2
-2
@@ -1,3 +0,3 @@ | ||
| /* Panzer v0.3.6 + genData v3.1.0 | github.com/bemson | (c) 2012, MIT */ | ||
| /* Panzer v0.3.7 + genData v3.1.0 | github.com/bemson | (c) 2012, MIT */ | ||
| ;!function(a,b,c){function f(a){return"function"==typeof a}function g(a){return"function"!=typeof a}function h(a){function w(a,b){this.name=a,this.value=b}if(this instanceof h)return this;var e,i,l,m,o,p,q,r,s,t,b=[["",a]],j=d.call(arguments),k=j.slice(1),n=k.filter(f),u=[],v=n.length;if(!v)return[];for(w.prototype=("function"==typeof this?this:h).prototype,l={returns:u,args:k.filter(g),params:j,loop:0,queued:0};b.length;){for(i=b.shift(),q=new w(i[0],i[1]),r=t=0,p=[i[0],i[1],i[2],l],l.continues=0,l.breaks=0,l.source=i[1];!l.continues&&v>r;)l.allowUndefined=0,o=n[r++].apply(q,p),(o!==c||l.allowUndefined)&&(m=o,t=1);if(t&&u.push(m),l.breaks)break;if("object"==typeof l.source){e=[];for(s in l.source)l.source.hasOwnProperty(s)&&e.push([s,l.source[s],q]);b=e.concat(b)}l.loop++,l.queued=b.length-1}return l.hasOwnProperty("returns")?l.returns:u}var d=a.prototype.slice;a.isArray||function(b){return b instanceof a},h.spawn=function i(){function c(e){return this instanceof c?this:a.apply("function"==typeof this?this:c,[e].concat(b,d.call(arguments).slice(1)))}var a=this,b=d.call(arguments).filter(f);return c.prototype=new a,c.spawn=i,c},h.version="3.1.0",b.genData=h}(Array,this); | ||
| !function(c,g,e,b,a,d,h){function f(k){var r={create:function(){var v={pkgs:[],pkgsIdx:{},KlassProxy:function(){},Klass:w};function w(y,x){if(!(this instanceof w)){throw new Error("Missing new operator.")}new m(v,this,y,typeof x==="object"?x:{})}w.prototype=v.KlassProxy.prototype;w.pkg=function(){return u.apply(v,arguments)};return w},version:"0.3.6"},s=(g||c)?k("genData"):d.genData,n=0,l=0,i=({}).toString(),o=s.spawn(function(w,F,G,z){var A=this,C=z.args[0],B=z.args[1],x=z.returns,v=B&&w&&(B.nf.some(y)||B.nr.some(D)),E=B&&w&&(B.af.some(y)||B.ar.some(D));function y(H){return H.call(d,w,F)}function D(H){return H.test(w)}if(v||E){z.source=0;if(E){G.attrs[w]=F}}else{A.parentIndex=A.previousIndex=A.nextIndex=A.firstChildIndex=A.lastChildIndex=A.childIndex=A.ctx=A.lte=-1;A.index=x.push(A);A.depth=G?G.depth+1:1;A.name=w||"PROOT";A.attrs={};A.path=G?G.path+w+"/":"//";A.children=[];if(G){A.parentIndex=G.index;if(!G.children.length){G.firstChildIndex=A.index}A.childIndex=G.children.push(A.index)-1;G.lastChildIndex=A.index;if(A.childIndex){A.previousIndex=G.children[A.childIndex-1];x[A.previousIndex-1].nextIndex=A.index}}else{z.tree=F}if(G&&C&&C.pkgs.length){C.pkgs.forEach(function(H){var J=H.def.prepNode,I;if(typeof J==="function"&&typeof(I=J.call(d,z.source,z.tree))!=="undefined"){z.source=I}})}}}),t=s.spawn(function(w,z,x,v){var y=this,A;if(x){v.source=0;for(A in z){if(z.hasOwnProperty(A)&&A!=="lte"&&A!=="ctx"){y[A]=z[A]}}return y}}),q=/\w/;function m(B,x,w,z){var D=this,C={},A={},y={af:[],ar:[],nf:[],nr:[]};function v(E,F){if(E===B&&F<D.pkgs.length){return D.pkgs[F].inst}return i}B.pkgs.forEach(function(F){var G=F.def.attrKey,E=F.def.badKey,I=F.def.prepTree,H;if(typeof G==="function"){y.af.push(G)}else{if(G instanceof a){y.ar.push(G)}}if(typeof E==="function"){y.nf.push(E)}else{if(E instanceof a){y.nr.push(E)}}if(typeof I==="function"&&typeof(H=I.call(d,w))!=="undefined"){w=H}});D.nodes=o(w,B,y);D.nodes[0].parentIndex=D.nodes[0].childIndex=0;D.nodes.unshift(o()[0]);D.nodes[0].children.push(1);D.nodes[0].name="PNULL";D.nodes[0].index=D.nodes[0].depth=D.nodes[0].lte=0;D.nodes[0].path="..//";D.nodes[0].firstChildIndex=D.nodes[0].lastChildIndex=1;D.nodes[0].ctx=1;D.tank={id:n++,currentIndex:0,targetIndex:-1,go:function(E){var F=D.nodes[E];if(F){D.target=F;D.tank.targetIndex=F.index}D.stop=0;return D.go()},stop:function(){D.stop=1;return !!D.loop},post:function(E){var F=typeof E;if(D.loop){if(F==="function"){D.posts[++l]=E;return l}else{if(F==="number"){if(D.posts.hasOwnProperty(E)){delete D.posts[E];return true}}}}return false}};D.posts={};D.current=D.nodes[0];D.target=D.loop=0;D.pkgs=B.pkgs.map(function(E){var G=E.name,I=E.def,H={name:G,idx:E.idx,pkg:E,inst:new I()};function F(){}F.prototype=E.proxy.prototype;C[G]=H.proxy=new F();A[G]=H.inst;H.proxy.pkgs=C;H.proxy.toString=v;H.inst.pkgs=A;H.inst.tank=D.tank;H.inst.nodes=t.call(E.node,D.nodes);return H});D.fire=j;D.pkgs.forEach(function(F){var E=F.pkg.def.init,G=F.inst;if(typeof E==="function"){E.call(G,z)}});delete D.fire;D.pkgs.forEach(function(E){E.inst.proxy=x});x.pkgs=C;x.toString=v}m.prototype={go:function(){var I=this,v=I.nodes,G=I.tank,w,z,B,y=0,H=I.stopped,A=I.current,E=H?A.lte:-1,F=-1,C=H?I.target.index:null,D,x;if(I.loop){return !!I.target}I.posts={};I.loop=1;I.fire("begin");while(I.loop){if(I.target&&!I.stop){x=0;if(C!=I.target.index||!(~E|~F)){B=A.ctx===1;E=F=-1;C=I.target.index;z=C-A.index;if(z){if((z>0&&A.index<2)||!I.target.path.indexOf(A.path)){if(B){F=A.firstChildIndex}else{E=1}}else{if(B){E=2}else{if(I.target.path.indexOf(v[A.parentIndex].path)){z=-1}if(z>0){if(A.lte==3||A.lte==2){F=A.nextIndex}else{E=3}}else{if(A.lte==4||A.lte==2){F=~A.previousIndex?A.previousIndex:A.parentIndex}else{E=4}}}}}else{E=B?0:1}}else{if(~F){if(D){D=0;I.fire("release")}else{G.currentIndex=F;I.fire("node",F,A.index);A.lte=0;A=I.current=v[F];F=-1}}else{if(!D){D=1;I.fire("engage")}else{if(!B&&(E==1||E==2)){if(E==2){E=-1}else{B=A.ctx=1}I.fire("scope",A.ctx)}else{if(H){I.fire("traversing",E)}else{A.lte=E;if(!E){I.target=0;G.targetIndex=-1}I.fire("traverse",E)}y++;if(!I.stop){I.fire("traversed",E);I.stopped=0}H=I.stopped=I.stop;if(E==2){B=A.ctx=0}else{E=-1}}}}}}else{if(D){D=0;I.fire("release")}else{if(!x){x=1;I.fire("end")}else{I.loop=0}}}}for(w in I.posts){if(I.posts.hasOwnProperty(w)){I.posts[w].call(d)}}return y},fire:function(v){var x="on"+v.charAt(0).toUpperCase()+v.substr(1),w=arguments;this.pkgs.forEach(function(y){var z=y.pkg.def[x];if(typeof z=="function"){z.apply(y.inst,w)}})}};function p(y,w){var v=this.pkgs[y-1],x;if(v&&w&&typeof w==="string"){x=new v.proxy();if(typeof x[w]==="function"){return x[w]}}return j}function u(w){var x=this,A;if(arguments.length){if(typeof w==="string"&&q.test(w)){if(!x.pkgsIdx.hasOwnProperty(w)){function z(B){if(B){return B instanceof x.pkgs[A].proxy&&B.toString(x,A)}}z.getSuper=function(B){return p.call(x,A,B)};z.init=z.attrKey=z.badKey=z.onBegin=z.onEnd=z.onNode=z.onEngage=z.onRelease=z.onScope=z.onTraverse=z.onTraversing=z.onTraversed=z.prepTree=z.prepNode=0;z.label=w;function v(){}v.prototype=new x.KlassProxy();x.Klass.prototype=z.proxy=v.prototype;x.KlassProxy=v;function y(){}z.node=y.prototype;A=z.index=x.pkgsIdx[w]=x.pkgs.push({name:w,idx:x.pkgs.length,def:z,proxy:v,node:y})-1}return x.pkgs[x.pkgsIdx[w]].def}return false}return x.pkgs.map(function(B){return B.name})}function j(){}return r}if(c){define(f)}else{if(g){module.exports=f(require)}else{if(!d.Panzer){d.Panzer=f()}}}}(typeof define=="function",typeof exports!="undefined",Array,Object,RegExp,this); | ||
| !function(c,g,e,b,a,d,h){function f(k){var r={create:function(){var v={pkgs:[],pkgsIdx:{},KlassProxy:function(){},Klass:w};function w(y,x){if(!(this instanceof w)){throw new Error("Missing new operator.")}new m(v,this,y,typeof x==="object"?x:{})}w.prototype=v.KlassProxy.prototype;w.pkg=function(){return u.apply(v,arguments)};return w},version:"0.3.7"},s=(g||c)?k("genData"):d.genData,n=0,l=0,i=({}).toString(),o=s.spawn(function(w,F,G,z){var A=this,C=z.args[0],B=z.args[1],x=z.returns,v=B&&w&&(B.nf.some(y)||B.nr.some(D)),E=B&&w&&(B.af.some(y)||B.ar.some(D));function y(H){return H.call(d,w,F)}function D(H){return H.test(w)}if(v||E){z.source=0;if(E){G.attrs[w]=F}}else{A.parentIndex=A.previousIndex=A.nextIndex=A.firstChildIndex=A.lastChildIndex=A.childIndex=A.ctx=A.lte=-1;A.index=x.push(A);A.depth=G?G.depth+1:1;A.name=w||"PROOT";A.attrs={};A.path=G?G.path+w+"/":"//";A.children=[];if(G){A.parentIndex=G.index;if(!G.children.length){G.firstChildIndex=A.index}A.childIndex=G.children.push(A.index)-1;G.lastChildIndex=A.index;if(A.childIndex){A.previousIndex=G.children[A.childIndex-1];x[A.previousIndex-1].nextIndex=A.index}}else{z.tree=F}if(G&&C&&C.pkgs.length){C.pkgs.forEach(function(H){var J=H.def.prepNode,I;if(typeof J==="function"&&typeof(I=J.call(d,z.source,z.tree))!=="undefined"){z.source=I}})}}}),t=s.spawn(function(w,z,x,v){var y=this,A;if(x){v.source=0;for(A in z){if(z.hasOwnProperty(A)&&A!=="lte"&&A!=="ctx"){y[A]=z[A]}}return y}}),q=/\w/;function m(B,x,w,z){var D=this,C={},A={},y={af:[],ar:[],nf:[],nr:[]};function v(E,F){if(E===B&&F<D.pkgs.length){return D.pkgs[F].inst}return i}B.pkgs.forEach(function(F){var G=F.def.attrKey,E=F.def.badKey,I=F.def.prepTree,H;if(typeof G==="function"){y.af.push(G)}else{if(G instanceof a){y.ar.push(G)}}if(typeof E==="function"){y.nf.push(E)}else{if(E instanceof a){y.nr.push(E)}}if(typeof I==="function"&&typeof(H=I.call(d,w))!=="undefined"){w=H}});D.nodes=o(w,B,y);D.nodes[0].parentIndex=D.nodes[0].childIndex=0;D.nodes.unshift(o()[0]);D.nodes[0].children.push(1);D.nodes[0].name="PNULL";D.nodes[0].index=D.nodes[0].depth=D.nodes[0].lte=0;D.nodes[0].path="..//";D.nodes[0].firstChildIndex=D.nodes[0].lastChildIndex=1;D.nodes[0].ctx=1;D.tank={id:n++,currentIndex:0,targetIndex:-1,go:function(E){var F=D.nodes[E];if(F){D.target=F;D.tank.targetIndex=F.index}D.stop=0;return D.go()},stop:function(){D.stop=1;return !!D.loop},post:function(E){var F=typeof E;if(D.loop){if(F==="function"){D.posts[++l]=E;return l}else{if(F==="number"){if(D.posts.hasOwnProperty(E)){delete D.posts[E];return true}}}}return false}};D.posts={};D.current=D.nodes[0];D.target=D.loop=0;D.pkgs=B.pkgs.map(function(E){var G=E.name,I=E.def,H={name:G,idx:E.idx,pkg:E,inst:new I()};function F(){}F.prototype=E.proxy.prototype;C[G]=H.proxy=new F();A[G]=H.inst;H.proxy.pkgs=C;H.proxy.toString=v;H.inst.pkgs=A;H.inst.tank=D.tank;H.inst.nodes=t.call(E.node,D.nodes);return H});D.pkgs.forEach(function(E){E.inst.proxy=x});x.pkgs=C;x.toString=v;D.fire=j;D.pkgs.forEach(function(F){var E=F.pkg.def.init,G=F.inst;if(typeof E==="function"){E.call(G,z)}});delete D.fire}m.prototype={go:function(){var I=this,v=I.nodes,G=I.tank,w,z,B,y=0,H=I.stopped,A=I.current,E=H?A.lte:-1,F=-1,C=H?I.target.index:null,D,x;if(I.loop){return !!I.target}I.posts={};I.loop=1;I.fire("begin");while(I.loop){if(I.target&&!I.stop){x=0;if(C!=I.target.index||!(~E|~F)){B=A.ctx===1;E=F=-1;C=I.target.index;z=C-A.index;if(z){if((z>0&&A.index<2)||!I.target.path.indexOf(A.path)){if(B){F=A.firstChildIndex}else{E=1}}else{if(B){E=2}else{if(I.target.path.indexOf(v[A.parentIndex].path)){z=-1}if(z>0){if(A.lte==3||A.lte==2){F=A.nextIndex}else{E=3}}else{if(A.lte==4||A.lte==2){F=~A.previousIndex?A.previousIndex:A.parentIndex}else{E=4}}}}}else{E=B?0:1}}else{if(~F){if(D){D=0;I.fire("release")}else{G.currentIndex=F;I.fire("node",F,A.index);A.lte=0;A=I.current=v[F];F=-1}}else{if(!D){D=1;I.fire("engage")}else{if(!B&&(E==1||E==2)){if(E==2){E=-1}else{B=A.ctx=1}I.fire("scope",A.ctx)}else{if(H){I.fire("traversing",E)}else{A.lte=E;if(!E){I.target=0;G.targetIndex=-1}I.fire("traverse",E)}y++;if(!I.stop){I.fire("traversed",E);I.stopped=0}H=I.stopped=I.stop;if(E==2){B=A.ctx=0}else{E=-1}}}}}}else{if(D){D=0;I.fire("release")}else{if(!x){x=1;I.fire("end")}else{I.loop=0}}}}for(w in I.posts){if(I.posts.hasOwnProperty(w)){I.posts[w].call(d)}}return y},fire:function(v){var x="on"+v.charAt(0).toUpperCase()+v.substr(1),w=arguments;this.pkgs.forEach(function(y){var z=y.pkg.def[x];if(typeof z=="function"){z.apply(y.inst,w)}})}};function p(y,w){var v=this.pkgs[y-1],x;if(v&&w&&typeof w==="string"){x=new v.proxy();if(typeof x[w]==="function"){return x[w]}}return j}function u(w){var x=this,A;if(arguments.length){if(typeof w==="string"&&q.test(w)){if(!x.pkgsIdx.hasOwnProperty(w)){function z(B){if(B){return B instanceof x.pkgs[A].proxy&&B.toString(x,A)}}z.getSuper=function(B){return p.call(x,A,B)};z.init=z.attrKey=z.badKey=z.onBegin=z.onEnd=z.onNode=z.onEngage=z.onRelease=z.onScope=z.onTraverse=z.onTraversing=z.onTraversed=z.prepTree=z.prepNode=0;z.label=w;function v(){}v.prototype=new x.KlassProxy();x.Klass.prototype=z.proxy=v.prototype;x.KlassProxy=v;function y(){}z.node=y.prototype;A=z.index=x.pkgsIdx[w]=x.pkgs.push({name:w,idx:x.pkgs.length,def:z,proxy:v,node:y})-1}return x.pkgs[x.pkgsIdx[w]].def}return false}return x.pkgs.map(function(B){return B.name})}function j(){}return r}if(c){define(f)}else{if(g){module.exports=f(require)}else{if(!d.Panzer){d.Panzer=f()}}}}(typeof define=="function",typeof exports!="undefined",Array,Object,RegExp,this); |
+8
-6
| # Panzer | ||
| (2/24/13) | ||
| version 0.3.6 | ||
| [](https://travis-ci.org/bemson/Panzer) | ||
| (3/26/13) | ||
| version 0.3.7 | ||
| by Bemi Faison | ||
@@ -108,8 +110,8 @@ | ||
| * src/ - Directory containing the source code | ||
| * test/ - [Qunit](http://docs.jquery.com/QUnit) tests of minified source files | ||
| * test/ - [Mocha](http://visionmedia.github.com/mocha) test suite | ||
| * README.md - This readme file | ||
| * LICENSE - The legal terms and conditions under which this software may be used | ||
| * panzer-min.js - The Panzer platform, including dependencies, minified and geared for browser environments | ||
| * panzer-min.js - The Panzer platform, including dependencies, minified for browser environments | ||
| Source files minified with [UglifyJS](http://marijnhaverbeke.nl/uglifyjs) | ||
| Source files minified with both [UglifyJS](http://marijnhaverbeke.nl/uglifyjs) and [Yahoo! Compressor](http://developer.yahoo.com/yui/compressor/). | ||
@@ -120,2 +122,2 @@ ## LICENSE | ||
| Copyright 2012, Bemi Faison | ||
| Copyright 2012, Bemi Faison |
+11
-12
| /*! | ||
| * Panzer v0.3.6 by Bemi Faison | ||
| * Panzer v0.3.7 by Bemi Faison | ||
| * http://github.com/bemson/Panzer | ||
@@ -44,3 +44,3 @@ * | ||
| }, | ||
| version: '0.3.6' | ||
| version: '0.3.7' | ||
| }, | ||
@@ -316,2 +316,11 @@ genData = (inCJS || inAMD) ? require('genData') : scope.genData, | ||
| // expose public proxy to package-instances | ||
| tree.pkgs.forEach(function (pkgEntry) { | ||
| pkgEntry.inst.proxy = proxyInst; | ||
| }); | ||
| // compose public proxy instance | ||
| proxyInst.pkgs = pkgProxyIdx; | ||
| proxyInst.toString = proxyToStringMethod; | ||
| // disable tank events while initializing | ||
@@ -329,12 +338,2 @@ tree.fire = goodForNothinFunction; | ||
| delete tree.fire; | ||
| // expose public proxy to package-instances | ||
| tree.pkgs.forEach(function (pkgEntry) { | ||
| pkgEntry.inst.proxy = proxyInst; | ||
| }); | ||
| // compose public proxy instance | ||
| proxyInst.pkgs = pkgProxyIdx; | ||
| proxyInst.toString = proxyToStringMethod; | ||
| } | ||
@@ -341,0 +340,0 @@ Tree.prototype = { |
@@ -22,3 +22,3 @@ describe( 'Package initialization', function () { | ||
| it( 'should allow directing the tank', function () { | ||
| it( 'should move the tank without firing events', function () { | ||
| var pkgInst; | ||
@@ -28,22 +28,22 @@ pkgDef.init = function () { | ||
| }; | ||
| pkgInst = pkgDef(new Klass()); | ||
| pkgInst.tank.currentIndex.should.equal(1); | ||
| }); | ||
| it( 'should allow directing the tank', function () { | ||
| var pkgInst; | ||
| pkgDef.init = function () { | ||
| this.tank.go(1); | ||
| }; | ||
| pkgDef.onBegin = sinon.spy(); | ||
| pkgDef.onEnd = sinon.spy(); | ||
| pkgInst = pkgDef(new Klass()); | ||
| pkgInst.tank.currentIndex.should.equal(1); | ||
| pkgDef.onBegin.should.not.have.been.called; | ||
| pkgDef.onEnd.should.not.have.been.called; | ||
| pkgInst.tank.go(0); | ||
| pkgDef.onBegin.should.have.been.calledOnce; | ||
| }); | ||
| it( 'should not reference the proxy (Klass instance)', function () { | ||
| it( 'should reference the public proxy (the Klass instance)', function () { | ||
| var initProxy, publicProxy; | ||
| pkgDef.init = function () { | ||
| this.should.not.include.key('proxy'); | ||
| this.should.include.key('proxy'); | ||
| initProxy = this.proxy; | ||
| }; | ||
| pkgDef(new Klass()).should.include.key('proxy'); | ||
| publicProxy = new Klass(); | ||
| pkgDef(publicProxy).should.include.key('proxy'); | ||
| publicProxy.should.equal(initProxy); | ||
| }); | ||
@@ -50,0 +50,0 @@ |
+1
-1
@@ -9,3 +9,3 @@ <html> | ||
| <h1>Panzer Test Suite</h1> | ||
| <p>Testing version 0.3.6, by <a href="mailto:bemson@gmail.com">Bemi Faison</a>. Source files on <a href="https://github.com/bemson/Panzer">github.com</a></p> | ||
| <p>Testing version 0.3.7, by <a href="mailto:bemson@gmail.com">Bemi Faison</a>. Source files on <a href="https://github.com/bemson/Panzer">github.com</a></p> | ||
| <hr /> | ||
@@ -12,0 +12,0 @@ <div id="mocha"></div> |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
66499
0.34%122
2.52%0
-100%