2013-03-18 06:26:24 +00:00
|
|
|
define("dijit/_WidgetBase",["require","dojo/_base/array","dojo/aspect","dojo/_base/config","dojo/_base/connect","dojo/_base/declare","dojo/dom","dojo/dom-attr","dojo/dom-class","dojo/dom-construct","dojo/dom-geometry","dojo/dom-style","dojo/has","dojo/_base/kernel","dojo/_base/lang","dojo/on","dojo/ready","dojo/Stateful","dojo/topic","dojo/_base/window","./Destroyable","./registry"],function(_1,_2,_3,_4,_5,_6,_7,_8,_9,_a,_b,_c,_d,_e,_f,on,_10,_11,_12,win,_13,_14){_d.add("dijit-legacy-requires",!_e.isAsync);if(_d("dijit-legacy-requires")){_10(0,function(){var _15=["dijit/_base/manager"];_1(_15);});}var _16={};function _17(obj){var ret={};for(var _18 in obj){ret[_18.toLowerCase()]=true;}return ret;};function _19(_1a){return function(val){_8[val?"set":"remove"](this.domNode,_1a,val);this._set(_1a,val);};};return _6("dijit._WidgetBase",[_11,_13],{id:"",_setIdAttr:"domNode",lang:"",_setLangAttr:_19("lang"),dir:"",_setDirAttr:_19("dir"),textDir:"","class":"",_setClassAttr:{node:"domNode",type:"class"},style:"",title:"",tooltip:"",baseClass:"",srcNodeRef:null,domNode:null,containerNode:null,ownerDocument:null,_setOwnerDocumentAttr:function(val){this._set("ownerDocument",val);},attributeMap:{},_blankGif:_4.blankGif||_1.toUrl("dojo/resources/blank.gif"),postscript:function(_1b,_1c){this.create(_1b,_1c);},create:function(_1d,_1e){this.srcNodeRef=_7.byId(_1e);this._connects=[];this._supportingWidgets=[];if(this.srcNodeRef&&(typeof this.srcNodeRef.id=="string")){this.id=this.srcNodeRef.id;}if(_1d){this.params=_1d;_f.mixin(this,_1d);}this.postMixInProperties();if(!this.id){this.id=_14.getUniqueId(this.declaredClass.replace(/\./g,"_"));if(this.params){delete this.params.id;}}this.ownerDocument=this.ownerDocument||(this.srcNodeRef?this.srcNodeRef.ownerDocument:win.doc);this.ownerDocumentBody=win.body(this.ownerDocument);_14.add(this);this.buildRendering();var _1f;if(this.domNode){this._applyAttributes();var _20=this.srcNodeRef;if(_20&&_20.parentNode&&this.domNode!==_20){_20.parentNode.replaceChild(this.domNode,_20);_1f=true;}this.domNode.setAttribute("widgetId",this.id);}this.postCreate();if(_1f){delete this.srcNodeRef;}this._created=true;},_applyAttributes:function(){var _21=this.constructor,_22=_21._setterAttrs;if(!_22){_22=(_21._setterAttrs=[]);for(var _23 in this.attributeMap){_22.push(_23);}var _24=_21.prototype;for(var _25 in _24){if(_25 in this.attributeMap){continue;}var _26="_set"+_25.replace(/^[a-z]|-[a-zA-Z]/g,function(c){return c.charAt(c.length-1).toUpperCase();})+"Attr";if(_26 in _24){_22.push(_25);}}}var _27={};for(var key in this.params||{}){_27[key]=this[key];}_2.forEach(_22,function(_28){if(_28 in _27){}else{if(this[_28]){this.set(_28,this[_28]);}}},this);for(key in _27){this.set(key,_27[key]);}},postMixInProperties:function(){},buildRendering:function(){if(!this.domNode){this.domNode=this.srcNodeRef||this.ownerDocument.createElement("div");}if(this.baseClass){var _29=this.baseClass.split(" ");if(!this.isLeftToRight()){_29=_29.concat(_2.map(_29,function(_2a){return _2a+"Rtl";}));}_9.add(this.domNode,_29);}},postCreate:function(){},startup:function(){if(this._started){return;}this._started=true;_2.forEach(this.getChildren(),function(obj){if(!obj._started&&!obj._destroyed&&_f.isFunction(obj.startup)){obj.startup();obj._started=true;}});},destroyRecursive:function(_2b){this._beingDestroyed=true;this.destroyDescendants(_2b);this.destroy(_2b);},destroy:function(_2c){this._beingDestroyed=true;this.uninitialize();function _2d(w){if(w.destroyRecursive){w.destroyRecursive(_2c);}else{if(w.destroy){w.destroy(_2c);}}};_2.forEach(this._connects,_f.hitch(this,"disconnect"));_2.forEach(this._supportingWidgets,_2d);if(this.domNode){_2.forEach(_14.findWidgets(this.domNode,this.containerNode),_2d);}this.destroyRendering(_2c);_14.remove(this.id);this._destroyed=true;},destroyRendering:function(_2e){if(this.bgIframe){this.bgIframe.destroy(_2e);delete this.bgIframe;}if(this.domNode){if(_2e){_8.remove(this.domNode,"widgetId");}else{_a.destroy(this.domNode);}delete this.domNode;}if(this.srcNodeRef){if(!_2e){_a.destroy(this.srcNodeRef);}del
|