Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

v0.3.6 - minified for browser deploy only (6.7K/2.8K)

Minified with YUI compressor this time, since Uglifyjs broke browser tests
  • Loading branch information...
commit fc800285afcde3e98b69fd77f078f886caae1149 1 parent 82bb656
Bemi Faison authored

Showing 1 changed file with 2 additions and 2 deletions. Show diff stats Hide diff stats

  1. +2 2 panzer-min.js
4 panzer-min.js
... ... @@ -1,3 +1,3 @@
1   -/* Panzer v0.4.0 + genData v2.1.0 | github.com/bemson | (c) 2012, MIT */
  1 +/* Panzer v0.3.6 + genData v3.1.0 | github.com/bemson | (c) 2012, MIT */
2 2 ;!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);
3   -!function(inAMD,inCJS,Array,Object,RegExp,scope,undefined){function initPanzer(require){var Panzer={create:function(){var panzer={pkgs:[],pkgsIdx:{},KlassProxy:function(){},Klass:Klass};function Klass(rawtree,klassConfig){if(!(this instanceof Klass)){throw new Error("Missing new operator.")}new Tree(panzer,this,rawtree,typeof klassConfig==="object"?klassConfig:{})}Klass.prototype=panzer.KlassProxy.prototype;Klass.pkg=function(){return ResolveOrRegisterKlassPackage.apply(panzer,arguments)};return Klass},version:"0.4.0"},genData=inCJS||inAMD?require("genData"):scope.genData,panzerInstanceCount=0,postCallbackCount=0,ObjecttoStringResult={}.toString(),genNodes=genData.spawn(function(name,value,parent,flags){var node=this,panzer=flags.args[0],keyTestMap=flags.args[1],nodes=flags.returns,isBadKey=keyTestMap&&name&&(keyTestMap.nf.some(passKeyFnc)||keyTestMap.nr.some(passKeyRxp)),isAttrKey=keyTestMap&&name&&(keyTestMap.af.some(passKeyFnc)||keyTestMap.ar.some(passKeyRxp));function passKeyFnc(badFnc){return badFnc.call(scope,name,value)}function passKeyRxp(badRxp){return badRxp.test(name)}if(isBadKey||isAttrKey){flags.source=0;if(isAttrKey){parent.attrs[name]=value}}else{node.parentIndex=node.previousIndex=node.nextIndex=node.firstChildIndex=node.lastChildIndex=node.childIndex=node.ctx=node.lte=-1;node.index=nodes.push(node);node.depth=parent?parent.depth+1:1;node.name=name||"PROOT";node.attrs={};node.path=parent?parent.path+name+"/":"//";node.children=[];if(parent){node.parentIndex=parent.index;if(!parent.children.length){parent.firstChildIndex=node.index}node.childIndex=parent.children.push(node.index)-1;parent.lastChildIndex=node.index;if(node.childIndex){node.previousIndex=parent.children[node.childIndex-1];nodes[node.previousIndex-1].nextIndex=node.index}}else{flags.tree=value}if(parent&&panzer&&panzer.pkgs.length){panzer.pkgs.forEach(function(pkg){var prepNodeFnc=pkg.def.prepNode,alternateSourceObject;if(typeof prepNodeFnc==="function"&&typeof(alternateSourceObject=prepNodeFnc.call(scope,flags.source,flags.tree))!=="undefined"){flags.source=alternateSourceObject}})}}}),genCloneNodes=genData.spawn(function(name,originalNode,parent,flags){var node=this,member;if(parent){flags.source=0;for(member in originalNode){if(originalNode.hasOwnProperty(member)&&member!=="lte"&&member!=="ctx"){node[member]=originalNode[member]}}return node}}),r_hasAlphanumeric=/\w/;function Tree(panzer,proxyInst,rawtree,klassConfig){var tree=this,pkgProxyIdx={},pkgInstIdx={},keyTestMap={af:[],ar:[],nf:[],nr:[]};function proxyToStringMethod(platform,pkgIdx){if(platform===panzer&&pkgIdx<tree.pkgs.length){return tree.pkgs[pkgIdx].inst}return ObjecttoStringResult}panzer.pkgs.forEach(function(pkg){var pkgAttrTest=pkg.def.attrKey,pkgNodeTest=pkg.def.badKey,prepTreeFnc=pkg.def.prepTree,alternateTreeObject;if(typeof pkgAttrTest==="function"){keyTestMap.af.push(pkgAttrTest)}else if(pkgAttrTest instanceof RegExp){keyTestMap.ar.push(pkgAttrTest)}if(typeof pkgNodeTest==="function"){keyTestMap.nf.push(pkgNodeTest)}else if(pkgNodeTest instanceof RegExp){keyTestMap.nr.push(pkgNodeTest)}if(typeof prepTreeFnc==="function"&&typeof(alternateTreeObject=prepTreeFnc.call(scope,rawtree))!=="undefined"){rawtree=alternateTreeObject}});tree.nodes=genNodes(rawtree,panzer,keyTestMap);tree.nodes[0].parentIndex=tree.nodes[0].childIndex=0;tree.nodes.unshift(genNodes()[0]);tree.nodes[0].children.push(1);tree.nodes[0].name="PNULL";tree.nodes[0].index=tree.nodes[0].depth=tree.nodes[0].lte=0;tree.nodes[0].path="..//";tree.nodes[0].firstChildIndex=tree.nodes[0].lastChildIndex=1;tree.nodes[0].ctx=1;tree.tank={id:panzerInstanceCount++,currentIndex:0,targetIndex:-1,go:function(tgtIndex){var tgtNode=tree.nodes[tgtIndex];if(tgtNode){tree.target=tgtNode;tree.tank.targetIndex=tgtNode.index}tree.stop=0;return tree.go()},stop:function(){tree.stop=1;return!!tree.loop},post:function(param){var paramType=typeof param;if(tree.loop){if(paramType==="function"){tree.posts[++postCallbackCount]=param;return postCallbackCount}else if(paramType==="number"){if(tree.posts.hasOwnProperty(param)){delete tree.posts[param];return true}}}return false}};tree.posts={};tree.current=tree.nodes[0];tree.target=tree.loop=0;tree.pkgs=panzer.pkgs.map(function(pkg){var pkgName=pkg.name,pkgDef=pkg.def,pkgEntry={name:pkgName,idx:pkg.idx,pkg:pkg,inst:new pkgDef};function pkgProxy(){}pkgProxy.prototype=pkg.proxy.prototype;pkgProxyIdx[pkgName]=pkgEntry.proxy=new pkgProxy;pkgInstIdx[pkgName]=pkgEntry.inst;pkgEntry.proxy.pkgs=pkgProxyIdx;pkgEntry.proxy.toString=proxyToStringMethod;pkgEntry.inst.pkgs=pkgInstIdx;pkgEntry.inst.tank=tree.tank;pkgEntry.inst.nodes=genCloneNodes.call(pkg.node,tree.nodes);return pkgEntry});tree.fire=goodForNothinFunction;tree.pkgs.forEach(function(pkgEntry){var customInit=pkgEntry.pkg.def.init,pkgInst=pkgEntry.inst;if(typeof customInit==="function"){customInit.call(pkgInst,klassConfig)}});delete tree.fire;tree.pkgs.forEach(function(pkgEntry){pkgEntry.inst.proxy=proxyInst});proxyInst.pkgs=pkgProxyIdx;proxyInst.toString=proxyToStringMethod}Tree.prototype={go:function(){var tree=this,nodes=tree.nodes,tank=tree.tank,postId,dir,inCurrentNode,traversalCount=0,resuming=tree.stopped,curNode=tree.current,nextPhase=resuming?curNode.lte:-1,nextNodeIndex=-1,lastTargetIndex=resuming?tree.target.index:null,nodeEngaged,endEventFired;if(tree.loop){return!!tree.target}tree.posts={};tree.loop=1;tree.fire("begin");while(tree.loop){if(tree.target&&!tree.stop){endEventFired=0;if(lastTargetIndex!=tree.target.index||!(~nextPhase|~nextNodeIndex)){inCurrentNode=curNode.ctx===1;nextPhase=nextNodeIndex=-1;lastTargetIndex=tree.target.index;dir=lastTargetIndex-curNode.index;if(dir){if(dir>0&&curNode.index<2||!tree.target.path.indexOf(curNode.path)){if(inCurrentNode){nextNodeIndex=curNode.firstChildIndex}else{nextPhase=1}}else{if(inCurrentNode){nextPhase=2}else{if(tree.target.path.indexOf(nodes[curNode.parentIndex].path)){dir=-1}if(dir>0){if(curNode.lte==3||curNode.lte==2){nextNodeIndex=curNode.nextIndex}else{nextPhase=3}}else{if(curNode.lte==4||curNode.lte==2){nextNodeIndex=~curNode.previousIndex?curNode.previousIndex:curNode.parentIndex}else{nextPhase=4}}}}}else{nextPhase=inCurrentNode?0:1}}else if(~nextNodeIndex){if(nodeEngaged){nodeEngaged=0;tree.fire("release")}else{tank.currentIndex=nextNodeIndex;tree.fire("node",nextNodeIndex,curNode.index);curNode.lte=0;curNode=tree.current=nodes[nextNodeIndex];nextNodeIndex=-1}}else if(!nodeEngaged){nodeEngaged=1;tree.fire("engage")}else if(!inCurrentNode&&(nextPhase==1||nextPhase==2)){if(nextPhase==2){nextPhase=-1}else{inCurrentNode=curNode.ctx=1}tree.fire("scope",curNode.ctx)}else{if(resuming){tree.fire("traversing",nextPhase)}else{curNode.lte=nextPhase;if(!nextPhase){tree.target=0;tank.targetIndex=-1}tree.fire("traverse",nextPhase)}traversalCount++;if(!tree.stop){tree.fire("traversed",nextPhase);tree.stopped=0}resuming=tree.stopped=tree.stop;if(nextPhase==2){inCurrentNode=curNode.ctx=0}else{nextPhase=-1}}}else if(nodeEngaged){nodeEngaged=0;tree.fire("release")}else if(!endEventFired){endEventFired=1;tree.fire("end")}else{tree.loop=0}}for(postId in tree.posts){if(tree.posts.hasOwnProperty(postId)){tree.posts[postId].call(scope)}}return traversalCount},fire:function(eventName){var handlerName="on"+eventName.charAt(0).toUpperCase()+eventName.substr(1),handlerArgs=arguments;this.pkgs.forEach(function(pkgEntry){var callback=pkgEntry.pkg.def[handlerName];if(typeof callback=="function"){callback.apply(pkgEntry.inst,handlerArgs)}})}};function GetSuperMethodFromKlassPackage(pkgIdx,name){var pkg=this.pkgs[pkgIdx-1],pkgInst;if(pkg&&name&&typeof name==="string"){pkgInst=new pkg.proxy;if(typeof pkgInst[name]==="function"){return pkgInst[name]}}return goodForNothinFunction}function ResolveOrRegisterKlassPackage(pkgName){var panzer=this,pkgIdx;if(arguments.length){if(typeof pkgName==="string"&&r_hasAlphanumeric.test(pkgName)){if(!panzer.pkgsIdx.hasOwnProperty(pkgName)){function Pkg(proxyInst){if(proxyInst){return proxyInst instanceof panzer.pkgs[pkgIdx].proxy&&proxyInst.toString(panzer,pkgIdx)}}Pkg.getSuper=function(methodName){return GetSuperMethodFromKlassPackage.call(panzer,pkgIdx,methodName)};Pkg.init=Pkg.attrKey=Pkg.badKey=Pkg.onBegin=Pkg.onEnd=Pkg.onNode=Pkg.onEngage=Pkg.onRelease=Pkg.onScope=Pkg.onTraverse=Pkg.onTraversing=Pkg.onTraversed=Pkg.prepTree=Pkg.prepNode=0;Pkg.label=pkgName;function PkgProxyForKlass(){}PkgProxyForKlass.prototype=new panzer.KlassProxy;panzer.Klass.prototype=Pkg.proxy=PkgProxyForKlass.prototype;panzer.KlassProxy=PkgProxyForKlass;function PkgNodeModel(){}Pkg.node=PkgNodeModel.prototype;pkgIdx=Pkg.index=panzer.pkgsIdx[pkgName]=panzer.pkgs.push({name:pkgName,idx:panzer.pkgs.length,def:Pkg,proxy:PkgProxyForKlass,node:PkgNodeModel})-1}return panzer.pkgs[panzer.pkgsIdx[pkgName]].def}return false}return panzer.pkgs.map(function(pkgCfg){return pkgCfg.name})}function goodForNothinFunction(){}return Panzer}if(inAMD){define(initPanzer)}else if(inCJS){module.exports=initPanzer(require)}else if(!scope.Panzer){scope.Panzer=initPanzer()}}(typeof define=="function",typeof exports!="undefined",Array,Object,RegExp,this);
  3 +!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);

0 comments on commit fc80028

Please sign in to comment.
Something went wrong with that request. Please try again.