liuyg
2021-07-02 25ce610f6ecca7325e7a743dc032c4a76559c63d
1
2
3
4
5
6
7
//>>built
define("dojo/_base/kernel dojo/_base/lang dojo/_base/connect dojo/dom-style dojo/dom-construct ../_base ../dom".split(" "),function(l,d,c,m,n,k,q){var f=d.getObject("contrib.dom",!0,k),p={render:function(){return this.contents}};f.StyleNode=d.extend(function(b){this.contents={};this._current={};this._styles=b;for(var a in b){if(-1!=b[a].indexOf("{{"))var e=new k.Template(b[a]);else e=d.delegate(p),e.contents=b[a];this.contents[a]=e}},{render:function(b,a){for(var e in this.contents){var c=this.contents[e].render(b);
this._current[e]!=c&&m.set(a.getParent(),e,this._current[e]=c)}return a},unrender:function(b,a){this._current={};return a},clone:function(b){return new this.constructor(this._styles)}});f.BufferNode=d.extend(function(b,a){this.nodelist=b;this.options=a},{_swap:function(b,a){if(!this.swapped&&this.parent.parentNode){if("node"==b){if(3==a.nodeType&&!this.options.text||1==a.nodeType&&!this.options.node)return}else if("class"==b&&"class"!=b)return;this.onAddNode&&c.disconnect(this.onAddNode);this.onRemoveNode&&
c.disconnect(this.onRemoveNode);this.onChangeAttribute&&c.disconnect(this.onChangeAttribute);this.onChangeData&&c.disconnect(this.onChangeData);this.swapped=this.parent.cloneNode(!0);this.parent.parentNode.replaceChild(this.swapped,this.parent)}},render:function(b,a){this.parent=a.getParent();this.options.node&&(this.onAddNode=c.connect(a,"onAddNode",d.hitch(this,"_swap","node")),this.onRemoveNode=c.connect(a,"onRemoveNode",d.hitch(this,"_swap","node")));this.options.text&&(this.onChangeData=c.connect(a,
"onChangeData",d.hitch(this,"_swap","node")));this.options["class"]&&(this.onChangeAttribute=c.connect(a,"onChangeAttribute",d.hitch(this,"_swap","class")));a=this.nodelist.render(b,a);this.swapped?(this.swapped.parentNode.replaceChild(this.parent,this.swapped),n.destroy(this.swapped)):(this.onAddNode&&c.disconnect(this.onAddNode),this.onRemoveNode&&c.disconnect(this.onRemoveNode),this.onChangeAttribute&&c.disconnect(this.onChangeAttribute),this.onChangeData&&c.disconnect(this.onChangeData));delete this.parent;
delete this.swapped;return a},unrender:function(b,a){return this.nodelist.unrender(b,a)},clone:function(b){return new this.constructor(this.nodelist.clone(b),this.options)}});d.mixin(f,{buffer:function(b,a){var e=a.contents.split().slice(1);a={};for(var c=!1,d=e.length;d--;)c=!0,a[e[d]]=!0;c||(a.node=!0);e=b.parse(["endbuffer"]);b.next_token();return new f.BufferNode(e,a)},html:function(b,a){l.deprecated("{% html someVariable %}","Use {{ someVariable|safe }} instead");return b.create_variable_node(a.contents.slice(5)+
"|safe")},style_:function(b,a){b={};a=a.contents.replace(/^style\s+/,"");a=a.split(/\s*;\s*/g);for(var c=0,g;g=a[c];c++){var h=g.split(/\s*:\s*/g);g=h[0];(h=d.trim(h[1]))&&(b[g]=h)}return new f.StyleNode(b)}});k.register.tags("dojox.dtl.contrib",{dom:["html","attr:style","buffer"]});return f});