// – Sammy – /plugins/sammy.tmpl.js // code.quirkey.com/sammy // Version: 0.6.2 // Built: Mon Oct 11 12:41:50 -0700 2010 (function(i,f){var t=i.fn.domManip,h=“_tmplitem”,u=/^*(<[”>wW]+>)*$|{{! /,p={},e={},y,x={key:0,data:{}},w=0,q=0,g=[];function k(B,A,D,E){var C={data:E||(A?A.data:{}),_wrap:A?A._wrap:null,tmpl:null,parent:A||null,nodes:[],calls:c,nest:b,wrap:n,html:r,update:z};if(B){i.extend(C,B,{nodes:,parent:A})}if(D){C.tmpl=D;C._ctnt=C._ctnt||C.tmpl(i,C);C.key=++w;(g.length?e:p)=C}return C}i.each({appendTo:“append”,prependTo:“prepend”,insertBefore:“before”,insertAfter:“after”,replaceAll:“replaceWith”},function(A,B){i.fn=function(C){var F=[],I=i(C),E,G,D,J,H=this.length===1&&this.parentNode;y=p||{};if(H&&H.nodeType===11&&H.childNodes.length===1&&I.length===1){I(this);F=this}else{for(G=0,D=I.length;G<D;G++){q=G;E=(G>0?this.clone(true):this).get();i.fn.apply(i(I),E);F=F.concat(E)}q=0;F=this.pushStack(F,A,I.selector)}J=y;y=null;i.tmpl.complete(J);return F}});i.fn.extend({tmpl:function(C,B,A){return i.tmpl(this,C,B,A)},tmplItem:function(){return i.tmplItem(this)},template:function(A){return i.template(A,this)},domManip:function(C,G,H,B){if(C&&C.nodeType){var F=i.makeArray(arguments),E=C.length,D=0,A;while(Dh
'=”'A.key
'“ $2'):F):m(F,A,F._ctnt)}):A;if(E){return B}B=B.join(”“);B.replace(/^s*([^<]*)?(<[“>wW]+>)(*[^>s])?s*$/,function(G,H,F,I){D=i(F).get();o(D);if(H){D=a(H).concat(D)}if(I){D=D.concat(a(I))}});return D?D:a(B)}function a(B){var A=document.createElement(”div“);A.innerHTML=B;return i.makeArray(A.childNodes)}function l(A){return new Function(”jQuery“,”$item“,”var $=jQuery,call,_=[],$data=$item.data;with($data){_.push(‘“+i.trim(A).replace(/()/g,”\$1“).replace(//g,” “).replace(/${([^}]*)}/g,”{{= $1}}“).replace(/{{(/?)(w+|.)(?:(((?:[^}]|}(?!}))*?)?))?(?:s+(.*?)?)?((((?:|}(?!}))*?)))?s*}}/g,function(I,C,G,D,E,J,F){var L=i.tmpl.tag,B,H,K;if(!L){throw”Template command not found: “+G}B=L._default||[];if(J&&!/w$/.test(E)){E+=J;J=”“}if(E){E=j(E);F=F?(”,“+j(F)+”)“):(J?”)“:”“);H=J?(E.indexOf(”.“)>-1?E+J:(”(“E
”).call($item“+F)):E;K=J?H:”(typeof(“E
”)===’function’?(“E
”).call($item):(“E
”))“}else{K=H=B.$1||”null“}D=j(D);return”‘);“+L.split(”$notnull_1“).join(E?”typeof(“E
”)!=='undefined' && (“E
”)!=null“:”true“).split(”$1a“).join(K).split(”$1“).join(H).split(”$2“).join(D?D.replace(/s*(+)s*(((.*?)))?/g,function(N,M,O,P){P=P?(”,“P
”)“):(O?”)“:”“);return P?(”(“M
”).call($item“+P):N}):(B.$2||”“))+”_.push('“})+”');}return _;“)}function s(B,A){B._wrap=m(B,true,i.isArray(A)?A:).join(”“)}function j(A){return A?A.replace(/\'/g,”'“).replace(/\\/g,”\“):null}function d(A){var B=document.createElement(”div“);B.appendChild(A.cloneNode(true));return B.innerHTML}function o(G){var I=”_“+q,B,A,E={},F,D,C;for(F=0,D=G.length;F<D;F++){if((B=G).nodeType!==1){continue}A=B.getElementsByTagName(”*“);for(C=A.length-1;C>=0;C–){H(A)}H(B)}function H(O){var L,N=O,M,J,K;if((K=O.getAttribute(h))){while(N.parentNode&&(N=N.parentNode).nodeType===1&&!(L=N.getAttribute(h))){}if(L!==K){N=N.parentNode?(N.nodeType===11?0:(N.getAttribute(h)||0)):0;if(!(J=p)){J=e;J=k(J,p||e,null,true);J.key=++w;p=J}if(q){P(K)}}O.removeAttribute(h)}else{if(q&&(J=i.data(O,”tmplItem“))){P(J.key);p=J;N=i.data(O.parentNode,”tmplItem“);N=N?N.key:0}}if(J){M=J;while(M&&M.key!=N){M.nodes.push(O);M=M.parent}delete J._ctnt;delete J._wrap;i.data(O,”tmplItem“,J)}function P(Q){Q=Q+I;J=E=(E||k(J,p||J.parent,null,true))}}}function c(C,A,D,B){if(!C){return g.pop()}g.push({_:C,tmpl:A,item:this,data:D,options:B})}function b(A,C,B){return i.tmpl(i.template(A),C,B,this)}function n(C,A){var B=C.options||{};B.wrapped=A;return i.tmpl(i.template(C.tmpl),C.data,B,C.item)}function r(B,C){var A=this._wrap;return i.map(i(i.isArray(A)?A.join(”“):A).filter(B||”*“),function(D){return C?D.innerText||D.textContent:D.outerHTML||d(D)})}function z(){var A=this.nodes;i.tmpl(null,null,null,this).insertBefore(A);i(A).remove()}Sammy=Sammy||{};Sammy.Tmpl=function(C,A){var B=function(E,F,D){if(typeof D==”undefined“){D=E}if(!i.template){i.template(D,E)}return i.tmpl(D,i.extend({},this,F))};if(!A){A=”tmpl“}C.helper(A,B)}})(jQuery);