summaryrefslogtreecommitdiff
path: root/js/dojo-1.6/dijit/dijit.xd.js
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--js/dojo-1.6/dijit/dijit.xd.js14
-rw-r--r--js/dojo-1.6/dijit/dijit.xd.js.uncompressed.js6469
2 files changed, 6483 insertions, 0 deletions
diff --git a/js/dojo-1.6/dijit/dijit.xd.js b/js/dojo-1.6/dijit/dijit.xd.js
new file mode 100644
index 0000000..18fe851
--- /dev/null
+++ b/js/dojo-1.6/dijit/dijit.xd.js
@@ -0,0 +1,14 @@
+/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+/*
+ This is an optimized version of Dojo, built for deployment and not for
+ development. To get sources and documentation, please visit:
+
+ http://dojotoolkit.org
+*/
+
+dojo._xdResourceLoaded(function(_1,_2,_3){return {depends:[["provide","dojo.window"],["provide","dijit._base.manager"],["provide","dijit._base.focus"],["provide","dojo.AdapterRegistry"],["provide","dijit._base.place"],["provide","dijit._base.window"],["provide","dijit._base.popup"],["provide","dijit._base.scroll"],["provide","dojo.uacss"],["provide","dijit._base.sniff"],["provide","dijit._base.typematic"],["provide","dijit._base.wai"],["provide","dijit._base"],["provide","dojo.date.stamp"],["provide","dojo.parser"],["provide","dojo.Stateful"],["provide","dijit._WidgetBase"],["provide","dijit._Widget"],["provide","dojo.string"],["provide","dojo.cache"],["provide","dijit._Templated"],["provide","dijit._Container"],["provide","dijit._Contained"],["provide","dijit.layout._LayoutWidget"],["provide","dijit._CssStateMixin"],["provide","dijit.form._FormWidget"],["provide","dijit.dijit"]],defineResource:function(_4,_5,_6){if(!_4._hasResource["dojo.window"]){_4._hasResource["dojo.window"]=true;_4.provide("dojo.window");_4.getObject("window",true,_4);_4.window.getBox=function(){var _7=(_4.doc.compatMode=="BackCompat")?_4.body():_4.doc.documentElement;var _8=_4._docScroll();return {w:_7.clientWidth,h:_7.clientHeight,l:_8.x,t:_8.y};};_4.window.get=function(_9){if(_4.isIE&&window!==document.parentWindow){_9.parentWindow.execScript("document._parentWindow = window;","Javascript");var _a=_9._parentWindow;_9._parentWindow=null;return _a;}return _9.parentWindow||_9.defaultView;};_4.window.scrollIntoView=function(_b,_c){try{_b=_4.byId(_b);var _d=_b.ownerDocument||_4.doc,_e=_d.body||_4.body(),_f=_d.documentElement||_e.parentNode,_10=_4.isIE,_11=_4.isWebKit;if((!(_4.isMoz||_10||_11||_4.isOpera)||_b==_e||_b==_f)&&(typeof _b.scrollIntoView!="undefined")){_b.scrollIntoView(false);return;}var _12=_d.compatMode=="BackCompat",_13=_12?_e:_f,_14=_11?_e:_13,_15=_13.clientWidth,_16=_13.clientHeight,rtl=!_4._isBodyLtr(),_17=_c||_4.position(_b),el=_b.parentNode,_18=function(el){return ((_10<=6||(_10&&_12))?false:(_4.style(el,"position").toLowerCase()=="fixed"));};if(_18(_b)){return;}while(el){if(el==_e){el=_14;}var _19=_4.position(el),_1a=_18(el);if(el==_14){_19.w=_15;_19.h=_16;if(_14==_f&&_10&&rtl){_19.x+=_14.offsetWidth-_19.w;}if(_19.x<0||!_10){_19.x=0;}if(_19.y<0||!_10){_19.y=0;}}else{var pb=_4._getPadBorderExtents(el);_19.w-=pb.w;_19.h-=pb.h;_19.x+=pb.l;_19.y+=pb.t;}if(el!=_14){var _1b=el.clientWidth,_1c=_19.w-_1b;if(_1b>0&&_1c>0){_19.w=_1b;if(_10&&rtl){_19.x+=_1c;}}_1b=el.clientHeight;_1c=_19.h-_1b;if(_1b>0&&_1c>0){_19.h=_1b;}}if(_1a){if(_19.y<0){_19.h+=_19.y;_19.y=0;}if(_19.x<0){_19.w+=_19.x;_19.x=0;}if(_19.y+_19.h>_16){_19.h=_16-_19.y;}if(_19.x+_19.w>_15){_19.w=_15-_19.x;}}var l=_17.x-_19.x,t=_17.y-Math.max(_19.y,0),r=l+_17.w-_19.w,bot=t+_17.h-_19.h;if(r*l>0){var s=Math[l<0?"max":"min"](l,r);_17.x+=el.scrollLeft;el.scrollLeft+=(_10>=8&&!_12&&rtl)?-s:s;_17.x-=el.scrollLeft;}if(bot*t>0){_17.y+=el.scrollTop;el.scrollTop+=Math[t<0?"max":"min"](t,bot);_17.y-=el.scrollTop;}el=(el!=_14)&&!_1a&&el.parentNode;}}catch(error){console.error("scrollIntoView: "+error);_b.scrollIntoView(false);}};}if(!_4._hasResource["dijit._base.manager"]){_4._hasResource["dijit._base.manager"]=true;_4.provide("dijit._base.manager");_4.declare("dijit.WidgetSet",null,{constructor:function(){this._hash={};this.length=0;},add:function(_1d){if(this._hash[_1d.id]){throw new Error("Tried to register widget with id=="+_1d.id+" but that id is already registered");}this._hash[_1d.id]=_1d;this.length++;},remove:function(id){if(this._hash[id]){delete this._hash[id];this.length--;}},forEach:function(_1e,_1f){_1f=_1f||_4.global;var i=0,id;for(id in this._hash){_1e.call(_1f,this._hash[id],i++,this._hash);}return this;},filter:function(_20,_21){_21=_21||_4.global;var res=new _5.WidgetSet(),i=0,id;for(id in this._hash){var w=this._hash[id];if(_20.call(_21,w,i++,this._hash)){res.add(w);}}return res;},byId:function(id){return this._hash[id];},byClass:function(cls){var res=new _5.WidgetSet(),id,_22;for(id in this._hash){_22=this._hash[id];if(_22.declaredClass==cls){res.add(_22);}}return res;},toArray:function(){var ar=[];for(var id in this._hash){ar.push(this._hash[id]);}return ar;},map:function(_23,_24){return _4.map(this.toArray(),_23,_24);},every:function(_25,_26){_26=_26||_4.global;var x=0,i;for(i in this._hash){if(!_25.call(_26,this._hash[i],x++,this._hash)){return false;}}return true;},some:function(_27,_28){_28=_28||_4.global;var x=0,i;for(i in this._hash){if(_27.call(_28,this._hash[i],x++,this._hash)){return true;}}return false;}});(function(){_5.registry=new _5.WidgetSet();var _29=_5.registry._hash,_2a=_4.attr,_2b=_4.hasAttr,_2c=_4.style;_5.byId=function(id){return typeof id=="string"?_29[id]:id;};var _2d={};_5.getUniqueId=function(_2e){var id;do{id=_2e+"_"+(_2e in _2d?++_2d[_2e]:_2d[_2e]=0);}while(_29[id]);return _5._scopeName=="dijit"?id:_5._scopeName+"_"+id;};_5.findWidgets=function(_2f){var _30=[];function _31(_32){for(var _33=_32.firstChild;_33;_33=_33.nextSibling){if(_33.nodeType==1){var _34=_33.getAttribute("widgetId");if(_34){var _35=_29[_34];if(_35){_30.push(_35);}}else{_31(_33);}}}};_31(_2f);return _30;};_5._destroyAll=function(){_5._curFocus=null;_5._prevFocus=null;_5._activeStack=[];_4.forEach(_5.findWidgets(_4.body()),function(_36){if(!_36._destroyed){if(_36.destroyRecursive){_36.destroyRecursive();}else{if(_36.destroy){_36.destroy();}}}});};if(_4.isIE){_4.addOnWindowUnload(function(){_5._destroyAll();});}_5.byNode=function(_37){return _29[_37.getAttribute("widgetId")];};_5.getEnclosingWidget=function(_38){while(_38){var id=_38.getAttribute&&_38.getAttribute("widgetId");if(id){return _29[id];}_38=_38.parentNode;}return null;};var _39=(_5._isElementShown=function(_3a){var s=_2c(_3a);return (s.visibility!="hidden")&&(s.visibility!="collapsed")&&(s.display!="none")&&(_2a(_3a,"type")!="hidden");});_5.hasDefaultTabStop=function(_3b){switch(_3b.nodeName.toLowerCase()){case "a":return _2b(_3b,"href");case "area":case "button":case "input":case "object":case "select":case "textarea":return true;case "iframe":var _3c;try{var _3d=_3b.contentDocument;if("designMode" in _3d&&_3d.designMode=="on"){return true;}_3c=_3d.body;}catch(e1){try{_3c=_3b.contentWindow.document.body;}catch(e2){return false;}}return _3c.contentEditable=="true"||(_3c.firstChild&&_3c.firstChild.contentEditable=="true");default:return _3b.contentEditable=="true";}};var _3e=(_5.isTabNavigable=function(_3f){if(_2a(_3f,"disabled")){return false;}else{if(_2b(_3f,"tabIndex")){return _2a(_3f,"tabIndex")>=0;}else{return _5.hasDefaultTabStop(_3f);}}});_5._getTabNavigable=function(_40){var _41,_42,_43,_44,_45,_46,_47={};function _48(_49){return _49&&_49.tagName.toLowerCase()=="input"&&_49.type&&_49.type.toLowerCase()=="radio"&&_49.name&&_49.name.toLowerCase();};var _4a=function(_4b){_4.query("> *",_4b).forEach(function(_4c){if((_4.isIE&&_4c.scopeName!=="HTML")||!_39(_4c)){return;}if(_3e(_4c)){var _4d=_2a(_4c,"tabIndex");if(!_2b(_4c,"tabIndex")||_4d==0){if(!_41){_41=_4c;}_42=_4c;}else{if(_4d>0){if(!_43||_4d<_44){_44=_4d;_43=_4c;}if(!_45||_4d>=_46){_46=_4d;_45=_4c;}}}var rn=_48(_4c);if(_4.attr(_4c,"checked")&&rn){_47[rn]=_4c;}}if(_4c.nodeName.toUpperCase()!="SELECT"){_4a(_4c);}});};if(_39(_40)){_4a(_40);}function rs(_4e){return _47[_48(_4e)]||_4e;};return {first:rs(_41),last:rs(_42),lowest:rs(_43),highest:rs(_45)};};_5.getFirstInTabbingOrder=function(_4f){var _50=_5._getTabNavigable(_4.byId(_4f));return _50.lowest?_50.lowest:_50.first;};_5.getLastInTabbingOrder=function(_51){var _52=_5._getTabNavigable(_4.byId(_51));return _52.last?_52.last:_52.highest;};_5.defaultDuration=_4.config["defaultDuration"]||200;})();}if(!_4._hasResource["dijit._base.focus"]){_4._hasResource["dijit._base.focus"]=true;_4.provide("dijit._base.focus");_4.mixin(_5,{_curFocus:null,_prevFocus:null,isCollapsed:function(){return _5.getBookmark().isCollapsed;},getBookmark:function(){var bm,rg,tg,sel=_4.doc.selection,cf=_5._curFocus;if(_4.global.getSelection){sel=_4.global.getSelection();if(sel){if(sel.isCollapsed){tg=cf?cf.tagName:"";if(tg){tg=tg.toLowerCase();if(tg=="textarea"||(tg=="input"&&(!cf.type||cf.type.toLowerCase()=="text"))){sel={start:cf.selectionStart,end:cf.selectionEnd,node:cf,pRange:true};return {isCollapsed:(sel.end<=sel.start),mark:sel};}}bm={isCollapsed:true};}else{rg=sel.getRangeAt(0);bm={isCollapsed:false,mark:rg.cloneRange()};}}}else{if(sel){tg=cf?cf.tagName:"";tg=tg.toLowerCase();if(cf&&tg&&(tg=="button"||tg=="textarea"||tg=="input")){if(sel.type&&sel.type.toLowerCase()=="none"){return {isCollapsed:true,mark:null};}else{rg=sel.createRange();return {isCollapsed:rg.text&&rg.text.length?false:true,mark:{range:rg,pRange:true}};}}bm={};try{rg=sel.createRange();bm.isCollapsed=!(sel.type=="Text"?rg.htmlText.length:rg.length);}catch(e){bm.isCollapsed=true;return bm;}if(sel.type.toUpperCase()=="CONTROL"){if(rg.length){bm.mark=[];var i=0,len=rg.length;while(i<len){bm.mark.push(rg.item(i++));}}else{bm.isCollapsed=true;bm.mark=null;}}else{bm.mark=rg.getBookmark();}}else{console.warn("No idea how to store the current selection for this browser!");}}return bm;},moveToBookmark:function(_53){var _54=_4.doc,_55=_53.mark;if(_55){if(_4.global.getSelection){var sel=_4.global.getSelection();if(sel&&sel.removeAllRanges){if(_55.pRange){var r=_55;var n=r.node;n.selectionStart=r.start;n.selectionEnd=r.end;}else{sel.removeAllRanges();sel.addRange(_55);}}else{console.warn("No idea how to restore selection for this browser!");}}else{if(_54.selection&&_55){var rg;if(_55.pRange){rg=_55.range;}else{if(_4.isArray(_55)){rg=_54.body.createControlRange();_4.forEach(_55,function(n){rg.addElement(n);});}else{rg=_54.body.createTextRange();rg.moveToBookmark(_55);}}rg.select();}}}},getFocus:function(_56,_57){var _58=!_5._curFocus||(_56&&_4.isDescendant(_5._curFocus,_56.domNode))?_5._prevFocus:_5._curFocus;return {node:_58,bookmark:(_58==_5._curFocus)&&_4.withGlobal(_57||_4.global,_5.getBookmark),openedForWindow:_57};},focus:function(_59){if(!_59){return;}var _5a="node" in _59?_59.node:_59,_5b=_59.bookmark,_5c=_59.openedForWindow,_5d=_5b?_5b.isCollapsed:false;if(_5a){var _5e=(_5a.tagName.toLowerCase()=="iframe")?_5a.contentWindow:_5a;if(_5e&&_5e.focus){try{_5e.focus();}catch(e){}}_5._onFocusNode(_5a);}if(_5b&&_4.withGlobal(_5c||_4.global,_5.isCollapsed)&&!_5d){if(_5c){_5c.focus();}try{_4.withGlobal(_5c||_4.global,_5.moveToBookmark,null,[_5b]);}catch(e2){}}},_activeStack:[],registerIframe:function(_5f){return _5.registerWin(_5f.contentWindow,_5f);},unregisterIframe:function(_60){_5.unregisterWin(_60);},registerWin:function(_61,_62){var _63=function(evt){_5._justMouseDowned=true;setTimeout(function(){_5._justMouseDowned=false;},0);if(_4.isIE&&evt&&evt.srcElement&&evt.srcElement.parentNode==null){return;}_5._onTouchNode(_62||evt.target||evt.srcElement,"mouse");};var doc=_4.isIE?_61.document.documentElement:_61.document;if(doc){if(_4.isIE){_61.document.body.attachEvent("onmousedown",_63);var _64=function(evt){if(evt.srcElement.tagName.toLowerCase()!="#document"&&_5.isTabNavigable(evt.srcElement)){_5._onFocusNode(_62||evt.srcElement);}else{_5._onTouchNode(_62||evt.srcElement);}};doc.attachEvent("onactivate",_64);var _65=function(evt){_5._onBlurNode(_62||evt.srcElement);};doc.attachEvent("ondeactivate",_65);return function(){_61.document.detachEvent("onmousedown",_63);doc.detachEvent("onactivate",_64);doc.detachEvent("ondeactivate",_65);doc=null;};}else{doc.body.addEventListener("mousedown",_63,true);var _66=function(evt){_5._onFocusNode(_62||evt.target);};doc.addEventListener("focus",_66,true);var _67=function(evt){_5._onBlurNode(_62||evt.target);};doc.addEventListener("blur",_67,true);return function(){doc.body.removeEventListener("mousedown",_63,true);doc.removeEventListener("focus",_66,true);doc.removeEventListener("blur",_67,true);doc=null;};}}},unregisterWin:function(_68){_68&&_68();},_onBlurNode:function(_69){_5._prevFocus=_5._curFocus;_5._curFocus=null;if(_5._justMouseDowned){return;}if(_5._clearActiveWidgetsTimer){clearTimeout(_5._clearActiveWidgetsTimer);}_5._clearActiveWidgetsTimer=setTimeout(function(){delete _5._clearActiveWidgetsTimer;_5._setStack([]);_5._prevFocus=null;},100);},_onTouchNode:function(_6a,by){if(_5._clearActiveWidgetsTimer){clearTimeout(_5._clearActiveWidgetsTimer);delete _5._clearActiveWidgetsTimer;}var _6b=[];try{while(_6a){var _6c=_4.attr(_6a,"dijitPopupParent");if(_6c){_6a=_5.byId(_6c).domNode;}else{if(_6a.tagName&&_6a.tagName.toLowerCase()=="body"){if(_6a===_4.body()){break;}_6a=_4.window.get(_6a.ownerDocument).frameElement;}else{var id=_6a.getAttribute&&_6a.getAttribute("widgetId"),_6d=id&&_5.byId(id);if(_6d&&!(by=="mouse"&&_6d.get("disabled"))){_6b.unshift(id);}_6a=_6a.parentNode;}}}}catch(e){}_5._setStack(_6b,by);},_onFocusNode:function(_6e){if(!_6e){return;}if(_6e.nodeType==9){return;}_5._onTouchNode(_6e);if(_6e==_5._curFocus){return;}if(_5._curFocus){_5._prevFocus=_5._curFocus;}_5._curFocus=_6e;_4.publish("focusNode",[_6e]);},_setStack:function(_6f,by){var _70=_5._activeStack;_5._activeStack=_6f;for(var _71=0;_71<Math.min(_70.length,_6f.length);_71++){if(_70[_71]!=_6f[_71]){break;}}var _72;for(var i=_70.length-1;i>=_71;i--){_72=_5.byId(_70[i]);if(_72){_72._focused=false;_72.set("focused",false);_72._hasBeenBlurred=true;if(_72._onBlur){_72._onBlur(by);}_4.publish("widgetBlur",[_72,by]);}}for(i=_71;i<_6f.length;i++){_72=_5.byId(_6f[i]);if(_72){_72._focused=true;_72.set("focused",true);if(_72._onFocus){_72._onFocus(by);}_4.publish("widgetFocus",[_72,by]);}}}});_4.addOnLoad(function(){var _73=_5.registerWin(window);if(_4.isIE){_4.addOnWindowUnload(function(){_5.unregisterWin(_73);_73=null;});}});}if(!_4._hasResource["dojo.AdapterRegistry"]){_4._hasResource["dojo.AdapterRegistry"]=true;_4.provide("dojo.AdapterRegistry");_4.AdapterRegistry=function(_74){this.pairs=[];this.returnWrappers=_74||false;};_4.extend(_4.AdapterRegistry,{register:function(_75,_76,_77,_78,_79){this.pairs[((_79)?"unshift":"push")]([_75,_76,_77,_78]);},match:function(){for(var i=0;i<this.pairs.length;i++){var _7a=this.pairs[i];if(_7a[1].apply(this,arguments)){if((_7a[3])||(this.returnWrappers)){return _7a[2];}else{return _7a[2].apply(this,arguments);}}}throw new Error("No match found");},unregister:function(_7b){for(var i=0;i<this.pairs.length;i++){var _7c=this.pairs[i];if(_7c[0]==_7b){this.pairs.splice(i,1);return true;}}return false;}});}if(!_4._hasResource["dijit._base.place"]){_4._hasResource["dijit._base.place"]=true;_4.provide("dijit._base.place");_5.getViewport=function(){return _4.window.getBox();};_5.placeOnScreen=function(_7d,pos,_7e,_7f){var _80=_4.map(_7e,function(_81){var c={corner:_81,pos:{x:pos.x,y:pos.y}};if(_7f){c.pos.x+=_81.charAt(1)=="L"?_7f.x:-_7f.x;c.pos.y+=_81.charAt(0)=="T"?_7f.y:-_7f.y;}return c;});return _5._place(_7d,_80);};_5._place=function(_82,_83,_84,_85){var _86=_4.window.getBox();if(!_82.parentNode||String(_82.parentNode.tagName).toLowerCase()!="body"){_4.body().appendChild(_82);}var _87=null;_4.some(_83,function(_88){var _89=_88.corner;var pos=_88.pos;var _8a=0;var _8b={w:_89.charAt(1)=="L"?(_86.l+_86.w)-pos.x:pos.x-_86.l,h:_89.charAt(1)=="T"?(_86.t+_86.h)-pos.y:pos.y-_86.t};if(_84){var res=_84(_82,_88.aroundCorner,_89,_8b,_85);_8a=typeof res=="undefined"?0:res;}var _8c=_82.style;var _8d=_8c.display;var _8e=_8c.visibility;_8c.visibility="hidden";_8c.display="";var mb=_4.marginBox(_82);_8c.display=_8d;_8c.visibility=_8e;var _8f=Math.max(_86.l,_89.charAt(1)=="L"?pos.x:(pos.x-mb.w)),_90=Math.max(_86.t,_89.charAt(0)=="T"?pos.y:(pos.y-mb.h)),_91=Math.min(_86.l+_86.w,_89.charAt(1)=="L"?(_8f+mb.w):pos.x),_92=Math.min(_86.t+_86.h,_89.charAt(0)=="T"?(_90+mb.h):pos.y),_93=_91-_8f,_94=_92-_90;_8a+=(mb.w-_93)+(mb.h-_94);if(_87==null||_8a<_87.overflow){_87={corner:_89,aroundCorner:_88.aroundCorner,x:_8f,y:_90,w:_93,h:_94,overflow:_8a,spaceAvailable:_8b};}return !_8a;});if(_87.overflow&&_84){_84(_82,_87.aroundCorner,_87.corner,_87.spaceAvailable,_85);}var l=_4._isBodyLtr(),s=_82.style;s.top=_87.y+"px";s[l?"left":"right"]=(l?_87.x:_86.w-_87.x-_87.w)+"px";return _87;};_5.placeOnScreenAroundNode=function(_95,_96,_97,_98){_96=_4.byId(_96);var _99=_4.position(_96,true);return _5._placeOnScreenAroundRect(_95,_99.x,_99.y,_99.w,_99.h,_97,_98);};_5.placeOnScreenAroundRectangle=function(_9a,_9b,_9c,_9d){return _5._placeOnScreenAroundRect(_9a,_9b.x,_9b.y,_9b.width,_9b.height,_9c,_9d);};_5._placeOnScreenAroundRect=function(_9e,x,y,_9f,_a0,_a1,_a2){var _a3=[];for(var _a4 in _a1){_a3.push({aroundCorner:_a4,corner:_a1[_a4],pos:{x:x+(_a4.charAt(1)=="L"?0:_9f),y:y+(_a4.charAt(0)=="T"?0:_a0)}});}return _5._place(_9e,_a3,_a2,{w:_9f,h:_a0});};_5.placementRegistry=new _4.AdapterRegistry();_5.placementRegistry.register("node",function(n,x){return typeof x=="object"&&typeof x.offsetWidth!="undefined"&&typeof x.offsetHeight!="undefined";},_5.placeOnScreenAroundNode);_5.placementRegistry.register("rect",function(n,x){return typeof x=="object"&&"x" in x&&"y" in x&&"width" in x&&"height" in x;},_5.placeOnScreenAroundRectangle);_5.placeOnScreenAroundElement=function(_a5,_a6,_a7,_a8){return _5.placementRegistry.match.apply(_5.placementRegistry,arguments);};_5.getPopupAroundAlignment=function(_a9,_aa){var _ab={};_4.forEach(_a9,function(pos){switch(pos){case "after":_ab[_aa?"BR":"BL"]=_aa?"BL":"BR";break;case "before":_ab[_aa?"BL":"BR"]=_aa?"BR":"BL";break;case "below-alt":_aa=!_aa;case "below":_ab[_aa?"BL":"BR"]=_aa?"TL":"TR";_ab[_aa?"BR":"BL"]=_aa?"TR":"TL";break;case "above-alt":_aa=!_aa;case "above":default:_ab[_aa?"TL":"TR"]=_aa?"BL":"BR";_ab[_aa?"TR":"TL"]=_aa?"BR":"BL";break;}});return _ab;};}if(!_4._hasResource["dijit._base.window"]){_4._hasResource["dijit._base.window"]=true;_4.provide("dijit._base.window");_5.getDocumentWindow=function(doc){return _4.window.get(doc);};}if(!_4._hasResource["dijit._base.popup"]){_4._hasResource["dijit._base.popup"]=true;_4.provide("dijit._base.popup");_5.popup={_stack:[],_beginZIndex:1000,_idGen:1,_createWrapper:function(_ac){var _ad=_ac.declaredClass?_ac._popupWrapper:(_4.hasClass(_ac.parentNode,"dijitPopup")&&_ac.parentNode),_ae=_ac.domNode||_ac;if(!_ad){_ad=_4.create("div",{"class":"dijitPopup",style:{display:"none"},role:"presentation"},_4.body());_ad.appendChild(_ae);var s=_ae.style;s.display="";s.visibility="";s.position="";s.top="0px";if(_ac.declaredClass){_ac._popupWrapper=_ad;_4.connect(_ac,"destroy",function(){_4.destroy(_ad);delete _ac._popupWrapper;});}}return _ad;},moveOffScreen:function(_af){var _b0=this._createWrapper(_af);_4.style(_b0,{visibility:"hidden",top:"-9999px",display:""});},hide:function(_b1){var _b2=this._createWrapper(_b1);_4.style(_b2,"display","none");},getTopPopup:function(){var _b3=this._stack;for(var pi=_b3.length-1;pi>0&&_b3[pi].parent===_b3[pi-1].widget;pi--){}return _b3[pi];},open:function(_b4){var _b5=this._stack,_b6=_b4.popup,_b7=_b4.orient||((_b4.parent?_b4.parent.isLeftToRight():_4._isBodyLtr())?{"BL":"TL","BR":"TR","TL":"BL","TR":"BR"}:{"BR":"TR","BL":"TL","TR":"BR","TL":"BL"}),_b8=_b4.around,id=(_b4.around&&_b4.around.id)?(_b4.around.id+"_dropdown"):("popup_"+this._idGen++);while(_b5.length&&(!_b4.parent||!_4.isDescendant(_b4.parent.domNode,_b5[_b5.length-1].widget.domNode))){_5.popup.close(_b5[_b5.length-1].widget);}var _b9=this._createWrapper(_b6);_4.attr(_b9,{id:id,style:{zIndex:this._beginZIndex+_b5.length},"class":"dijitPopup "+(_b6.baseClass||_b6["class"]||"").split(" ")[0]+"Popup",dijitPopupParent:_b4.parent?_b4.parent.id:""});if(_4.isIE||_4.isMoz){if(!_b6.bgIframe){_b6.bgIframe=new _5.BackgroundIframe(_b9);}}var _ba=_b8?_5.placeOnScreenAroundElement(_b9,_b8,_b7,_b6.orient?_4.hitch(_b6,"orient"):null):_5.placeOnScreen(_b9,_b4,_b7=="R"?["TR","BR","TL","BL"]:["TL","BL","TR","BR"],_b4.padding);_b9.style.display="";_b9.style.visibility="visible";_b6.domNode.style.visibility="visible";var _bb=[];_bb.push(_4.connect(_b9,"onkeypress",this,function(evt){if(evt.charOrCode==_4.keys.ESCAPE&&_b4.onCancel){_4.stopEvent(evt);_b4.onCancel();}else{if(evt.charOrCode===_4.keys.TAB){_4.stopEvent(evt);var _bc=this.getTopPopup();if(_bc&&_bc.onCancel){_bc.onCancel();}}}}));if(_b6.onCancel){_bb.push(_4.connect(_b6,"onCancel",_b4.onCancel));}_bb.push(_4.connect(_b6,_b6.onExecute?"onExecute":"onChange",this,function(){var _bd=this.getTopPopup();if(_bd&&_bd.onExecute){_bd.onExecute();}}));_b5.push({widget:_b6,parent:_b4.parent,onExecute:_b4.onExecute,onCancel:_b4.onCancel,onClose:_b4.onClose,handlers:_bb});if(_b6.onOpen){_b6.onOpen(_ba);}return _ba;},close:function(_be){var _bf=this._stack;while((_be&&_4.some(_bf,function(_c0){return _c0.widget==_be;}))||(!_be&&_bf.length)){var top=_bf.pop(),_c1=top.widget,_c2=top.onClose;if(_c1.onClose){_c1.onClose();}_4.forEach(top.handlers,_4.disconnect);if(_c1&&_c1.domNode){this.hide(_c1);}if(_c2){_c2();}}}};_5._frames=new function(){var _c3=[];this.pop=function(){var _c4;if(_c3.length){_c4=_c3.pop();_c4.style.display="";}else{if(_4.isIE<9){var _c5=_4.config["dojoBlankHtmlUrl"]||(_4.moduleUrl("dojo","resources/blank.html")+"")||"javascript:\"\"";var _c6="<iframe src='"+_c5+"'"+" style='position: absolute; left: 0px; top: 0px;"+"z-index: -1; filter:Alpha(Opacity=\"0\");'>";_c4=_4.doc.createElement(_c6);}else{_c4=_4.create("iframe");_c4.src="javascript:\"\"";_c4.className="dijitBackgroundIframe";_4.style(_c4,"opacity",0.1);}_c4.tabIndex=-1;_5.setWaiRole(_c4,"presentation");}return _c4;};this.push=function(_c7){_c7.style.display="none";_c3.push(_c7);};}();_5.BackgroundIframe=function(_c8){if(!_c8.id){throw new Error("no id");}if(_4.isIE||_4.isMoz){var _c9=(this.iframe=_5._frames.pop());_c8.appendChild(_c9);if(_4.isIE<7||_4.isQuirks){this.resize(_c8);this._conn=_4.connect(_c8,"onresize",this,function(){this.resize(_c8);});}else{_4.style(_c9,{width:"100%",height:"100%"});}}};_4.extend(_5.BackgroundIframe,{resize:function(_ca){if(this.iframe){_4.style(this.iframe,{width:_ca.offsetWidth+"px",height:_ca.offsetHeight+"px"});}},destroy:function(){if(this._conn){_4.disconnect(this._conn);this._conn=null;}if(this.iframe){_5._frames.push(this.iframe);delete this.iframe;}}});}if(!_4._hasResource["dijit._base.scroll"]){_4._hasResource["dijit._base.scroll"]=true;_4.provide("dijit._base.scroll");_5.scrollIntoView=function(_cb,pos){_4.window.scrollIntoView(_cb,pos);};}if(!_4._hasResource["dojo.uacss"]){_4._hasResource["dojo.uacss"]=true;_4.provide("dojo.uacss");(function(){var d=_4,_cc=d.doc.documentElement,ie=d.isIE,_cd=d.isOpera,maj=Math.floor,ff=d.isFF,_ce=d.boxModel.replace(/-/,""),_cf={dj_ie:ie,dj_ie6:maj(ie)==6,dj_ie7:maj(ie)==7,dj_ie8:maj(ie)==8,dj_ie9:maj(ie)==9,dj_quirks:d.isQuirks,dj_iequirks:ie&&d.isQuirks,dj_opera:_cd,dj_khtml:d.isKhtml,dj_webkit:d.isWebKit,dj_safari:d.isSafari,dj_chrome:d.isChrome,dj_gecko:d.isMozilla,dj_ff3:maj(ff)==3};_cf["dj_"+_ce]=true;var _d0="";for(var clz in _cf){if(_cf[clz]){_d0+=clz+" ";}}_cc.className=d.trim(_cc.className+" "+_d0);_4._loaders.unshift(function(){if(!_4._isBodyLtr()){var _d1="dj_rtl dijitRtl "+_d0.replace(/ /g,"-rtl ");_cc.className=d.trim(_cc.className+" "+_d1);}});})();}if(!_4._hasResource["dijit._base.sniff"]){_4._hasResource["dijit._base.sniff"]=true;_4.provide("dijit._base.sniff");}if(!_4._hasResource["dijit._base.typematic"]){_4._hasResource["dijit._base.typematic"]=true;_4.provide("dijit._base.typematic");_5.typematic={_fireEventAndReload:function(){this._timer=null;this._callback(++this._count,this._node,this._evt);this._currentTimeout=Math.max(this._currentTimeout<0?this._initialDelay:(this._subsequentDelay>1?this._subsequentDelay:Math.round(this._currentTimeout*this._subsequentDelay)),this._minDelay);this._timer=setTimeout(_4.hitch(this,"_fireEventAndReload"),this._currentTimeout);},trigger:function(evt,_d2,_d3,_d4,obj,_d5,_d6,_d7){if(obj!=this._obj){this.stop();this._initialDelay=_d6||500;this._subsequentDelay=_d5||0.9;this._minDelay=_d7||10;this._obj=obj;this._evt=evt;this._node=_d3;this._currentTimeout=-1;this._count=-1;this._callback=_4.hitch(_d2,_d4);this._fireEventAndReload();this._evt=_4.mixin({faux:true},evt);}},stop:function(){if(this._timer){clearTimeout(this._timer);this._timer=null;}if(this._obj){this._callback(-1,this._node,this._evt);this._obj=null;}},addKeyListener:function(_d8,_d9,_da,_db,_dc,_dd,_de){if(_d9.keyCode){_d9.charOrCode=_d9.keyCode;_4.deprecated("keyCode attribute parameter for dijit.typematic.addKeyListener is deprecated. Use charOrCode instead.","","2.0");}else{if(_d9.charCode){_d9.charOrCode=String.fromCharCode(_d9.charCode);_4.deprecated("charCode attribute parameter for dijit.typematic.addKeyListener is deprecated. Use charOrCode instead.","","2.0");}}return [_4.connect(_d8,"onkeypress",this,function(evt){if(evt.charOrCode==_d9.charOrCode&&(_d9.ctrlKey===undefined||_d9.ctrlKey==evt.ctrlKey)&&(_d9.altKey===undefined||_d9.altKey==evt.altKey)&&(_d9.metaKey===undefined||_d9.metaKey==(evt.metaKey||false))&&(_d9.shiftKey===undefined||_d9.shiftKey==evt.shiftKey)){_4.stopEvent(evt);_5.typematic.trigger(evt,_da,_d8,_db,_d9,_dc,_dd,_de);}else{if(_5.typematic._obj==_d9){_5.typematic.stop();}}}),_4.connect(_d8,"onkeyup",this,function(evt){if(_5.typematic._obj==_d9){_5.typematic.stop();}})];},addMouseListener:function(_df,_e0,_e1,_e2,_e3,_e4){var dc=_4.connect;return [dc(_df,"mousedown",this,function(evt){_4.stopEvent(evt);_5.typematic.trigger(evt,_e0,_df,_e1,_df,_e2,_e3,_e4);}),dc(_df,"mouseup",this,function(evt){_4.stopEvent(evt);_5.typematic.stop();}),dc(_df,"mouseout",this,function(evt){_4.stopEvent(evt);_5.typematic.stop();}),dc(_df,"mousemove",this,function(evt){evt.preventDefault();}),dc(_df,"dblclick",this,function(evt){_4.stopEvent(evt);if(_4.isIE){_5.typematic.trigger(evt,_e0,_df,_e1,_df,_e2,_e3,_e4);setTimeout(_4.hitch(this,_5.typematic.stop),50);}})];},addListener:function(_e5,_e6,_e7,_e8,_e9,_ea,_eb,_ec){return this.addKeyListener(_e6,_e7,_e8,_e9,_ea,_eb,_ec).concat(this.addMouseListener(_e5,_e8,_e9,_ea,_eb,_ec));}};}if(!_4._hasResource["dijit._base.wai"]){_4._hasResource["dijit._base.wai"]=true;_4.provide("dijit._base.wai");_5.wai={onload:function(){var div=_4.create("div",{id:"a11yTestNode",style:{cssText:"border: 1px solid;"+"border-color:red green;"+"position: absolute;"+"height: 5px;"+"top: -999px;"+"background-image: url(\""+(_4.config.blankGif||_4.moduleUrl("dojo","resources/blank.gif"))+"\");"}},_4.body());var cs=_4.getComputedStyle(div);if(cs){var _ed=cs.backgroundImage;var _ee=(cs.borderTopColor==cs.borderRightColor)||(_ed!=null&&(_ed=="none"||_ed=="url(invalid-url:)"));_4[_ee?"addClass":"removeClass"](_4.body(),"dijit_a11y");if(_4.isIE){div.outerHTML="";}else{_4.body().removeChild(div);}}}};if(_4.isIE||_4.isMoz){_4._loaders.unshift(_5.wai.onload);}_4.mixin(_5,{hasWaiRole:function(_ef,_f0){var _f1=this.getWaiRole(_ef);return _f0?(_f1.indexOf(_f0)>-1):(_f1.length>0);},getWaiRole:function(_f2){return _4.trim((_4.attr(_f2,"role")||"").replace("wairole:",""));},setWaiRole:function(_f3,_f4){_4.attr(_f3,"role",_f4);},removeWaiRole:function(_f5,_f6){var _f7=_4.attr(_f5,"role");if(!_f7){return;}if(_f6){var t=_4.trim((" "+_f7+" ").replace(" "+_f6+" "," "));_4.attr(_f5,"role",t);}else{_f5.removeAttribute("role");}},hasWaiState:function(_f8,_f9){return _f8.hasAttribute?_f8.hasAttribute("aria-"+_f9):!!_f8.getAttribute("aria-"+_f9);},getWaiState:function(_fa,_fb){return _fa.getAttribute("aria-"+_fb)||"";},setWaiState:function(_fc,_fd,_fe){_fc.setAttribute("aria-"+_fd,_fe);},removeWaiState:function(_ff,_100){_ff.removeAttribute("aria-"+_100);}});}if(!_4._hasResource["dijit._base"]){_4._hasResource["dijit._base"]=true;_4.provide("dijit._base");}if(!_4._hasResource["dojo.date.stamp"]){_4._hasResource["dojo.date.stamp"]=true;_4.provide("dojo.date.stamp");_4.getObject("date.stamp",true,_4);_4.date.stamp.fromISOString=function(_101,_102){if(!_4.date.stamp._isoRegExp){_4.date.stamp._isoRegExp=/^(?:(\d{4})(?:-(\d{2})(?:-(\d{2}))?)?)?(?:T(\d{2}):(\d{2})(?::(\d{2})(.\d+)?)?((?:[+-](\d{2}):(\d{2}))|Z)?)?$/;}var _103=_4.date.stamp._isoRegExp.exec(_101),_104=null;if(_103){_103.shift();if(_103[1]){_103[1]--;}if(_103[6]){_103[6]*=1000;}if(_102){_102=new Date(_102);_4.forEach(_4.map(["FullYear","Month","Date","Hours","Minutes","Seconds","Milliseconds"],function(prop){return _102["get"+prop]();}),function(_105,_106){_103[_106]=_103[_106]||_105;});}_104=new Date(_103[0]||1970,_103[1]||0,_103[2]||1,_103[3]||0,_103[4]||0,_103[5]||0,_103[6]||0);if(_103[0]<100){_104.setFullYear(_103[0]||1970);}var _107=0,_108=_103[7]&&_103[7].charAt(0);if(_108!="Z"){_107=((_103[8]||0)*60)+(Number(_103[9])||0);if(_108!="-"){_107*=-1;}}if(_108){_107-=_104.getTimezoneOffset();}if(_107){_104.setTime(_104.getTime()+_107*60000);}}return _104;};_4.date.stamp.toISOString=function(_109,_10a){var _10b=function(n){return (n<10)?"0"+n:n;};_10a=_10a||{};var _10c=[],_10d=_10a.zulu?"getUTC":"get",date="";if(_10a.selector!="time"){var year=_109[_10d+"FullYear"]();date=["0000".substr((year+"").length)+year,_10b(_109[_10d+"Month"]()+1),_10b(_109[_10d+"Date"]())].join("-");}_10c.push(date);if(_10a.selector!="date"){var time=[_10b(_109[_10d+"Hours"]()),_10b(_109[_10d+"Minutes"]()),_10b(_109[_10d+"Seconds"]())].join(":");var _10e=_109[_10d+"Milliseconds"]();if(_10a.milliseconds){time+="."+(_10e<100?"0":"")+_10b(_10e);}if(_10a.zulu){time+="Z";}else{if(_10a.selector!="time"){var _10f=_109.getTimezoneOffset();var _110=Math.abs(_10f);time+=(_10f>0?"-":"+")+_10b(Math.floor(_110/60))+":"+_10b(_110%60);}}_10c.push(time);}return _10c.join("T");};}if(!_4._hasResource["dojo.parser"]){_4._hasResource["dojo.parser"]=true;_4.provide("dojo.parser");new Date("X");_4.parser=new function(){var d=_4;function _111(_112){if(d.isString(_112)){return "string";}if(typeof _112=="number"){return "number";}if(typeof _112=="boolean"){return "boolean";}if(d.isFunction(_112)){return "function";}if(d.isArray(_112)){return "array";}if(_112 instanceof Date){return "date";}if(_112 instanceof d._Url){return "url";}return "object";};function _113(_114,type){switch(type){case "string":return _114;case "number":return _114.length?Number(_114):NaN;case "boolean":return typeof _114=="boolean"?_114:!(_114.toLowerCase()=="false");case "function":if(d.isFunction(_114)){_114=_114.toString();_114=d.trim(_114.substring(_114.indexOf("{")+1,_114.length-1));}try{if(_114===""||_114.search(/[^\w\.]+/i)!=-1){return new Function(_114);}else{return d.getObject(_114,false)||new Function(_114);}}catch(e){return new Function();}case "array":return _114?_114.split(/\s*,\s*/):[];case "date":switch(_114){case "":return new Date("");case "now":return new Date();default:return d.date.stamp.fromISOString(_114);}case "url":return d.baseUrl+_114;default:return d.fromJson(_114);}};var _115={},_116={};d.connect(d,"extend",function(){_116={};});function _117(cls,_118){for(var name in cls){if(name.charAt(0)=="_"){continue;}if(name in _115){continue;}_118[name]=_111(cls[name]);}return _118;};function _119(_11a,_11b){var c=_116[_11a];if(!c){var cls=d.getObject(_11a),_11c=null;if(!cls){return null;}if(!_11b){_11c=_117(cls.prototype,{});}c={cls:cls,params:_11c};}else{if(!_11b&&!c.params){c.params=_117(c.cls.prototype,{});}}return c;};this._functionFromScript=function(_11d,_11e){var _11f="";var _120="";var _121=(_11d.getAttribute(_11e+"args")||_11d.getAttribute("args"));if(_121){d.forEach(_121.split(/\s*,\s*/),function(part,idx){_11f+="var "+part+" = arguments["+idx+"]; ";});}var _122=_11d.getAttribute("with");if(_122&&_122.length){d.forEach(_122.split(/\s*,\s*/),function(part){_11f+="with("+part+"){";_120+="}";});}return new Function(_11f+_11d.innerHTML+_120);};this.instantiate=function(_123,_124,args){var _125=[],_124=_124||{};args=args||{};var _126=(args.scope||d._scopeName)+"Type",_127="data-"+(args.scope||d._scopeName)+"-";d.forEach(_123,function(obj){if(!obj){return;}var node,type,_128,_129,_12a,_12b;if(obj.node){node=obj.node;type=obj.type;_12b=obj.fastpath;_128=obj.clsInfo||(type&&_119(type,_12b));_129=_128&&_128.cls;_12a=obj.scripts;}else{node=obj;type=_126 in _124?_124[_126]:node.getAttribute(_126);_128=type&&_119(type);_129=_128&&_128.cls;_12a=(_129&&(_129._noScript||_129.prototype._noScript)?[]:d.query("> script[type^='dojo/']",node));}if(!_128){throw new Error("Could not load class '"+type);}var _12c={};if(args.defaults){d._mixin(_12c,args.defaults);}if(obj.inherited){d._mixin(_12c,obj.inherited);}if(_12b){var _12d=node.getAttribute(_127+"props");if(_12d&&_12d.length){try{_12d=d.fromJson.call(args.propsThis,"{"+_12d+"}");d._mixin(_12c,_12d);}catch(e){throw new Error(e.toString()+" in data-dojo-props='"+_12d+"'");}}var _12e=node.getAttribute(_127+"attach-point");if(_12e){_12c.dojoAttachPoint=_12e;}var _12f=node.getAttribute(_127+"attach-event");if(_12f){_12c.dojoAttachEvent=_12f;}_4.mixin(_12c,_124);}else{var _130=node.attributes;for(var name in _128.params){var item=name in _124?{value:_124[name],specified:true}:_130.getNamedItem(name);if(!item||(!item.specified&&(!_4.isIE||name.toLowerCase()!="value"))){continue;}var _131=item.value;switch(name){case "class":_131="className" in _124?_124.className:node.className;break;case "style":_131="style" in _124?_124.style:(node.style&&node.style.cssText);}var _132=_128.params[name];if(typeof _131=="string"){_12c[name]=_113(_131,_132);}else{_12c[name]=_131;}}}var _133=[],_134=[];d.forEach(_12a,function(_135){node.removeChild(_135);var _136=(_135.getAttribute(_127+"event")||_135.getAttribute("event")),type=_135.getAttribute("type"),nf=d.parser._functionFromScript(_135,_127);if(_136){if(type=="dojo/connect"){_133.push({event:_136,func:nf});}else{_12c[_136]=nf;}}else{_134.push(nf);}});var _137=_129.markupFactory||_129.prototype&&_129.prototype.markupFactory;var _138=_137?_137(_12c,node,_129):new _129(_12c,node);_125.push(_138);var _139=(node.getAttribute(_127+"id")||node.getAttribute("jsId"));if(_139){d.setObject(_139,_138);}d.forEach(_133,function(_13a){d.connect(_138,_13a.event,null,_13a.func);});d.forEach(_134,function(func){func.call(_138);});});if(!_124._started){d.forEach(_125,function(_13b){if(!args.noStart&&_13b&&_4.isFunction(_13b.startup)&&!_13b._started&&(!_13b.getParent||!_13b.getParent())){_13b.startup();}});}return _125;};this.parse=function(_13c,args){var root;if(!args&&_13c&&_13c.rootNode){args=_13c;root=args.rootNode;}else{root=_13c;}args=args||{};var _13d=(args.scope||d._scopeName)+"Type",_13e="data-"+(args.scope||d._scopeName)+"-";function scan(_13f,list){var _140=_4.clone(_13f.inherited);_4.forEach(["dir","lang"],function(name){var val=_13f.node.getAttribute(name);if(val){_140[name]=val;}});var _141=_13f.clsInfo&&!_13f.clsInfo.cls.prototype._noScript?_13f.scripts:null;var _142=(!_13f.clsInfo||!_13f.clsInfo.cls.prototype.stopParser)||(args&&args.template);for(var _143=_13f.node.firstChild;_143;_143=_143.nextSibling){if(_143.nodeType==1){var type,_144=_142&&_143.getAttribute(_13e+"type");if(_144){type=_144;}else{type=_142&&_143.getAttribute(_13d);}var _145=_144==type;if(type){var _146={"type":type,fastpath:_145,clsInfo:_119(type,_145),node:_143,scripts:[],inherited:_140};list.push(_146);scan(_146,list);}else{if(_141&&_143.nodeName.toLowerCase()=="script"){type=_143.getAttribute("type");if(type&&/^dojo\/\w/i.test(type)){_141.push(_143);}}else{if(_142){scan({node:_143,inherited:_140},list);}}}}}};var list=[];scan({node:root?_4.byId(root):_4.body(),inherited:(args&&args.inherited)||{dir:_4._isBodyLtr()?"ltr":"rtl"}},list);var _147=args&&args.template?{template:true}:null;return this.instantiate(list,_147,args);};}();(function(){var _148=function(){if(_4.config.parseOnLoad){_4.parser.parse();}};if(_4.getObject("dijit.wai.onload")===_4._loaders[0]){_4._loaders.splice(1,0,_148);}else{_4._loaders.unshift(_148);}})();}if(!_4._hasResource["dojo.Stateful"]){_4._hasResource["dojo.Stateful"]=true;_4.provide("dojo.Stateful");_4.declare("dojo.Stateful",null,{postscript:function(_149){if(_149){_4.mixin(this,_149);}},get:function(name){return this[name];},set:function(name,_14a){if(typeof name==="object"){for(var x in name){this.set(x,name[x]);}return this;}var _14b=this[name];this[name]=_14a;if(this._watchCallbacks){this._watchCallbacks(name,_14b,_14a);}return this;},watch:function(name,_14c){var _14d=this._watchCallbacks;if(!_14d){var self=this;_14d=this._watchCallbacks=function(name,_14e,_14f,_150){var _151=function(_152){if(_152){_152=_152.slice();for(var i=0,l=_152.length;i<l;i++){try{_152[i].call(self,name,_14e,_14f);}catch(e){console.error(e);}}}};_151(_14d["_"+name]);if(!_150){_151(_14d["*"]);}};}if(!_14c&&typeof name==="function"){_14c=name;name="*";}else{name="_"+name;}var _153=_14d[name];if(typeof _153!=="object"){_153=_14d[name]=[];}_153.push(_14c);return {unwatch:function(){_153.splice(_4.indexOf(_153,_14c),1);}};}});}if(!_4._hasResource["dijit._WidgetBase"]){_4._hasResource["dijit._WidgetBase"]=true;_4.provide("dijit._WidgetBase");(function(){_4.declare("dijit._WidgetBase",_4.Stateful,{id:"",lang:"",dir:"","class":"",style:"",title:"",tooltip:"",baseClass:"",srcNodeRef:null,domNode:null,containerNode:null,attributeMap:{id:"",dir:"",lang:"","class":"",style:"",title:""},_blankGif:(_4.config.blankGif||_4.moduleUrl("dojo","resources/blank.gif")).toString(),postscript:function(_154,_155){this.create(_154,_155);},create:function(_156,_157){this.srcNodeRef=_4.byId(_157);this._connects=[];this._subscribes=[];if(this.srcNodeRef&&(typeof this.srcNodeRef.id=="string")){this.id=this.srcNodeRef.id;}if(_156){this.params=_156;_4._mixin(this,_156);}this.postMixInProperties();if(!this.id){this.id=_5.getUniqueId(this.declaredClass.replace(/\./g,"_"));}_5.registry.add(this);this.buildRendering();if(this.domNode){this._applyAttributes();var _158=this.srcNodeRef;if(_158&&_158.parentNode&&this.domNode!==_158){_158.parentNode.replaceChild(this.domNode,_158);}}if(this.domNode){this.domNode.setAttribute("widgetId",this.id);}this.postCreate();if(this.srcNodeRef&&!this.srcNodeRef.parentNode){delete this.srcNodeRef;}this._created=true;},_applyAttributes:function(){var _159=function(attr,_15a){if((_15a.params&&attr in _15a.params)||_15a[attr]){_15a.set(attr,_15a[attr]);}};for(var attr in this.attributeMap){_159(attr,this);}_4.forEach(this._getSetterAttributes(),function(a){if(!(a in this.attributeMap)){_159(a,this);}},this);},_getSetterAttributes:function(){var ctor=this.constructor;if(!ctor._setterAttrs){var r=(ctor._setterAttrs=[]),_15b,_15c=ctor.prototype;for(var _15d in _15c){if(_4.isFunction(_15c[_15d])&&(_15b=_15d.match(/^_set([a-zA-Z]*)Attr$/))&&_15b[1]){r.push(_15b[1].charAt(0).toLowerCase()+_15b[1].substr(1));}}}return ctor._setterAttrs;},postMixInProperties:function(){},buildRendering:function(){if(!this.domNode){this.domNode=this.srcNodeRef||_4.create("div");}if(this.baseClass){var _15e=this.baseClass.split(" ");if(!this.isLeftToRight()){_15e=_15e.concat(_4.map(_15e,function(name){return name+"Rtl";}));}_4.addClass(this.domNode,_15e);}},postCreate:function(){},startup:function(){this._started=true;},destroyRecursive:function(_15f){this._beingDestroyed=true;this.destroyDescendants(_15f);this.destroy(_15f);},destroy:function(_160){this._beingDestroyed=true;this.uninitialize();var d=_4,dfe=d.forEach,dun=d.unsubscribe;dfe(this._connects,function(_161){dfe(_161,d.disconnect);});dfe(this._subscribes,function(_162){dun(_162);});dfe(this._supportingWidgets||[],function(w){if(w.destroyRecursive){w.destroyRecursive();}else{if(w.destroy){w.destroy();}}});this.destroyRendering(_160);_5.registry.remove(this.id);this._destroyed=true;},destroyRendering:function(_163){if(this.bgIframe){this.bgIframe.destroy(_163);delete this.bgIframe;}if(this.domNode){if(_163){_4.removeAttr(this.domNode,"widgetId");}else{_4.destroy(this.domNode);}delete this.domNode;}if(this.srcNodeRef){if(!_163){_4.destroy(this.srcNodeRef);}delete this.srcNodeRef;}},destroyDescendants:function(_164){_4.forEach(this.getChildren(),function(_165){if(_165.destroyRecursive){_165.destroyRecursive(_164);}});},uninitialize:function(){return false;},_setClassAttr:function(_166){var _167=this[this.attributeMap["class"]||"domNode"];_4.replaceClass(_167,_166,this["class"]);this._set("class",_166);},_setStyleAttr:function(_168){var _169=this[this.attributeMap.style||"domNode"];if(_4.isObject(_168)){_4.style(_169,_168);}else{if(_169.style.cssText){_169.style.cssText+="; "+_168;}else{_169.style.cssText=_168;}}this._set("style",_168);},_attrToDom:function(attr,_16a){var _16b=this.attributeMap[attr];_4.forEach(_4.isArray(_16b)?_16b:[_16b],function(_16c){var _16d=this[_16c.node||_16c||"domNode"];var type=_16c.type||"attribute";switch(type){case "attribute":if(_4.isFunction(_16a)){_16a=_4.hitch(this,_16a);}var _16e=_16c.attribute?_16c.attribute:(/^on[A-Z][a-zA-Z]*$/.test(attr)?attr.toLowerCase():attr);_4.attr(_16d,_16e,_16a);break;case "innerText":_16d.innerHTML="";_16d.appendChild(_4.doc.createTextNode(_16a));break;case "innerHTML":_16d.innerHTML=_16a;break;case "class":_4.replaceClass(_16d,_16a,this[attr]);break;}},this);},get:function(name){var _16f=this._getAttrNames(name);return this[_16f.g]?this[_16f.g]():this[name];},set:function(name,_170){if(typeof name==="object"){for(var x in name){this.set(x,name[x]);}return this;}var _171=this._getAttrNames(name);if(this[_171.s]){var _172=this[_171.s].apply(this,Array.prototype.slice.call(arguments,1));}else{if(name in this.attributeMap){this._attrToDom(name,_170);}this._set(name,_170);}return _172||this;},_attrPairNames:{},_getAttrNames:function(name){var apn=this._attrPairNames;if(apn[name]){return apn[name];}var uc=name.charAt(0).toUpperCase()+name.substr(1);return (apn[name]={n:name+"Node",s:"_set"+uc+"Attr",g:"_get"+uc+"Attr"});},_set:function(name,_173){var _174=this[name];this[name]=_173;if(this._watchCallbacks&&this._created&&_173!==_174){this._watchCallbacks(name,_174,_173);}},toString:function(){return "[Widget "+this.declaredClass+", "+(this.id||"NO ID")+"]";},getDescendants:function(){return this.containerNode?_4.query("[widgetId]",this.containerNode).map(_5.byNode):[];},getChildren:function(){return this.containerNode?_5.findWidgets(this.containerNode):[];},connect:function(obj,_175,_176){var _177=[_4._connect(obj,_175,this,_176)];this._connects.push(_177);return _177;},disconnect:function(_178){for(var i=0;i<this._connects.length;i++){if(this._connects[i]==_178){_4.forEach(_178,_4.disconnect);this._connects.splice(i,1);return;}}},subscribe:function(_179,_17a){var _17b=_4.subscribe(_179,this,_17a);this._subscribes.push(_17b);return _17b;},unsubscribe:function(_17c){for(var i=0;i<this._subscribes.length;i++){if(this._subscribes[i]==_17c){_4.unsubscribe(_17c);this._subscribes.splice(i,1);return;}}},isLeftToRight:function(){return this.dir?(this.dir=="ltr"):_4._isBodyLtr();},placeAt:function(_17d,_17e){if(_17d.declaredClass&&_17d.addChild){_17d.addChild(this,_17e);}else{_4.place(this.domNode,_17d,_17e);}return this;}});})();}if(!_4._hasResource["dijit._Widget"]){_4._hasResource["dijit._Widget"]=true;_4.provide("dijit._Widget");_4.connect(_4,"_connect",function(_17f,_180){if(_17f&&_4.isFunction(_17f._onConnect)){_17f._onConnect(_180);}});_5._connectOnUseEventHandler=function(_181){};_5._lastKeyDownNode=null;if(_4.isIE){(function(){var _182=function(evt){_5._lastKeyDownNode=evt.srcElement;};_4.doc.attachEvent("onkeydown",_182);_4.addOnWindowUnload(function(){_4.doc.detachEvent("onkeydown",_182);});})();}else{_4.doc.addEventListener("keydown",function(evt){_5._lastKeyDownNode=evt.target;},true);}(function(){_4.declare("dijit._Widget",_5._WidgetBase,{_deferredConnects:{onClick:"",onDblClick:"",onKeyDown:"",onKeyPress:"",onKeyUp:"",onMouseMove:"",onMouseDown:"",onMouseOut:"",onMouseOver:"",onMouseLeave:"",onMouseEnter:"",onMouseUp:""},onClick:_5._connectOnUseEventHandler,onDblClick:_5._connectOnUseEventHandler,onKeyDown:_5._connectOnUseEventHandler,onKeyPress:_5._connectOnUseEventHandler,onKeyUp:_5._connectOnUseEventHandler,onMouseDown:_5._connectOnUseEventHandler,onMouseMove:_5._connectOnUseEventHandler,onMouseOut:_5._connectOnUseEventHandler,onMouseOver:_5._connectOnUseEventHandler,onMouseLeave:_5._connectOnUseEventHandler,onMouseEnter:_5._connectOnUseEventHandler,onMouseUp:_5._connectOnUseEventHandler,create:function(_183,_184){this._deferredConnects=_4.clone(this._deferredConnects);for(var attr in this.attributeMap){delete this._deferredConnects[attr];}for(attr in this._deferredConnects){if(this[attr]!==_5._connectOnUseEventHandler){delete this._deferredConnects[attr];}}this.inherited(arguments);if(this.domNode){for(attr in this.params){this._onConnect(attr);}}},_onConnect:function(_185){if(_185 in this._deferredConnects){var _186=this[this._deferredConnects[_185]||"domNode"];this.connect(_186,_185.toLowerCase(),_185);delete this._deferredConnects[_185];}},focused:false,isFocusable:function(){return this.focus&&(_4.style(this.domNode,"display")!="none");},onFocus:function(){},onBlur:function(){},_onFocus:function(e){this.onFocus();},_onBlur:function(){this.onBlur();},setAttribute:function(attr,_187){_4.deprecated(this.declaredClass+"::setAttribute(attr, value) is deprecated. Use set() instead.","","2.0");this.set(attr,_187);},attr:function(name,_188){if(_4.config.isDebug){var _189=arguments.callee._ach||(arguments.callee._ach={}),_18a=(arguments.callee.caller||"unknown caller").toString();if(!_189[_18a]){_4.deprecated(this.declaredClass+"::attr() is deprecated. Use get() or set() instead, called from "+_18a,"","2.0");_189[_18a]=true;}}var args=arguments.length;if(args>=2||typeof name==="object"){return this.set.apply(this,arguments);}else{return this.get(name);}},nodesWithKeyClick:["input","button"],connect:function(obj,_18b,_18c){var d=_4,dc=d._connect,_18d=this.inherited(arguments,[obj,_18b=="ondijitclick"?"onclick":_18b,_18c]);if(_18b=="ondijitclick"){if(d.indexOf(this.nodesWithKeyClick,obj.nodeName.toLowerCase())==-1){var m=d.hitch(this,_18c);_18d.push(dc(obj,"onkeydown",this,function(e){if((e.keyCode==d.keys.ENTER||e.keyCode==d.keys.SPACE)&&!e.ctrlKey&&!e.shiftKey&&!e.altKey&&!e.metaKey){_5._lastKeyDownNode=e.target;if(!("openDropDown" in this&&obj==this._buttonNode)){e.preventDefault();}}}),dc(obj,"onkeyup",this,function(e){if((e.keyCode==d.keys.ENTER||e.keyCode==d.keys.SPACE)&&e.target==_5._lastKeyDownNode&&!e.ctrlKey&&!e.shiftKey&&!e.altKey&&!e.metaKey){_5._lastKeyDownNode=null;return m(e);}}));}}return _18d;},_onShow:function(){this.onShow();},onShow:function(){},onHide:function(){},onClose:function(){return true;}});})();}if(!_4._hasResource["dojo.string"]){_4._hasResource["dojo.string"]=true;_4.provide("dojo.string");_4.getObject("string",true,_4);_4.string.rep=function(str,num){if(num<=0||!str){return "";}var buf=[];for(;;){if(num&1){buf.push(str);}if(!(num>>=1)){break;}str+=str;}return buf.join("");};_4.string.pad=function(text,size,ch,end){if(!ch){ch="0";}var out=String(text),pad=_4.string.rep(ch,Math.ceil((size-out.length)/ch.length));return end?out+pad:pad+out;};_4.string.substitute=function(_18e,map,_18f,_190){_190=_190||_4.global;_18f=_18f?_4.hitch(_190,_18f):function(v){return v;};return _18e.replace(/\$\{([^\s\:\}]+)(?:\:([^\s\:\}]+))?\}/g,function(_191,key,_192){var _193=_4.getObject(key,false,map);if(_192){_193=_4.getObject(_192,false,_190).call(_190,_193,key);}return _18f(_193,key).toString();});};_4.string.trim=String.prototype.trim?_4.trim:function(str){str=str.replace(/^\s+/,"");for(var i=str.length-1;i>=0;i--){if(/\S/.test(str.charAt(i))){str=str.substring(0,i+1);break;}}return str;};}if(!_4._hasResource["dojo.cache"]){_4._hasResource["dojo.cache"]=true;_4.provide("dojo.cache");var _194={};_4.cache=function(_195,url,_196){if(typeof _195=="string"){var _197=_4.moduleUrl(_195,url);}else{_197=_195;_196=url;}var key=_197.toString();var val=_196;if(_196!=undefined&&!_4.isString(_196)){val=("value" in _196?_196.value:undefined);}var _198=_196&&_196.sanitize?true:false;if(typeof val=="string"){val=_194[key]=_198?_4.cache._sanitize(val):val;}else{if(val===null){delete _194[key];}else{if(!(key in _194)){val=_4._getText(key);_194[key]=_198?_4.cache._sanitize(val):val;}val=_194[key];}}return val;};_4.cache._sanitize=function(val){if(val){val=val.replace(/^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im,"");var _199=val.match(/<body[^>]*>\s*([\s\S]+)\s*<\/body>/im);if(_199){val=_199[1];}}else{val="";}return val;};}if(!_4._hasResource["dijit._Templated"]){_4._hasResource["dijit._Templated"]=true;_4.provide("dijit._Templated");_4.declare("dijit._Templated",null,{templateString:null,templatePath:null,widgetsInTemplate:false,_skipNodeCache:false,_earlyTemplatedStartup:false,constructor:function(){this._attachPoints=[];this._attachEvents=[];},_stringRepl:function(tmpl){var _19a=this.declaredClass,_19b=this;return _4.string.substitute(tmpl,this,function(_19c,key){if(key.charAt(0)=="!"){_19c=_4.getObject(key.substr(1),false,_19b);}if(typeof _19c=="undefined"){throw new Error(_19a+" template:"+key);}if(_19c==null){return "";}return key.charAt(0)=="!"?_19c:_19c.toString().replace(/"/g,"&quot;");},this);},buildRendering:function(){var _19d=_5._Templated.getCachedTemplate(this.templatePath,this.templateString,this._skipNodeCache);var node;if(_4.isString(_19d)){node=_4._toDom(this._stringRepl(_19d));if(node.nodeType!=1){throw new Error("Invalid template: "+_19d);}}else{node=_19d.cloneNode(true);}this.domNode=node;this.inherited(arguments);this._attachTemplateNodes(node);if(this.widgetsInTemplate){var cw=(this._startupWidgets=_4.parser.parse(node,{noStart:!this._earlyTemplatedStartup,template:true,inherited:{dir:this.dir,lang:this.lang},propsThis:this,scope:"dojo"}));this._supportingWidgets=_5.findWidgets(node);this._attachTemplateNodes(cw,function(n,p){return n[p];});}this._fillContent(this.srcNodeRef);},_fillContent:function(_19e){var dest=this.containerNode;if(_19e&&dest){while(_19e.hasChildNodes()){dest.appendChild(_19e.firstChild);}}},_attachTemplateNodes:function(_19f,_1a0){_1a0=_1a0||function(n,p){return n.getAttribute(p);};var _1a1=_4.isArray(_19f)?_19f:(_19f.all||_19f.getElementsByTagName("*"));var x=_4.isArray(_19f)?0:-1;for(;x<_1a1.length;x++){var _1a2=(x==-1)?_19f:_1a1[x];if(this.widgetsInTemplate&&(_1a0(_1a2,"dojoType")||_1a0(_1a2,"data-dojo-type"))){continue;}var _1a3=_1a0(_1a2,"dojoAttachPoint")||_1a0(_1a2,"data-dojo-attach-point");if(_1a3){var _1a4,_1a5=_1a3.split(/\s*,\s*/);while((_1a4=_1a5.shift())){if(_4.isArray(this[_1a4])){this[_1a4].push(_1a2);}else{this[_1a4]=_1a2;}this._attachPoints.push(_1a4);}}var _1a6=_1a0(_1a2,"dojoAttachEvent")||_1a0(_1a2,"data-dojo-attach-event");if(_1a6){var _1a7,_1a8=_1a6.split(/\s*,\s*/);var trim=_4.trim;while((_1a7=_1a8.shift())){if(_1a7){var _1a9=null;if(_1a7.indexOf(":")!=-1){var _1aa=_1a7.split(":");_1a7=trim(_1aa[0]);_1a9=trim(_1aa[1]);}else{_1a7=trim(_1a7);}if(!_1a9){_1a9=_1a7;}this._attachEvents.push(this.connect(_1a2,_1a7,_1a9));}}}var role=_1a0(_1a2,"waiRole");if(role){_5.setWaiRole(_1a2,role);}var _1ab=_1a0(_1a2,"waiState");if(_1ab){_4.forEach(_1ab.split(/\s*,\s*/),function(_1ac){if(_1ac.indexOf("-")!=-1){var pair=_1ac.split("-");_5.setWaiState(_1a2,pair[0],pair[1]);}});}}},startup:function(){_4.forEach(this._startupWidgets,function(w){if(w&&!w._started&&w.startup){w.startup();}});this.inherited(arguments);},destroyRendering:function(){_4.forEach(this._attachPoints,function(_1ad){delete this[_1ad];},this);this._attachPoints=[];_4.forEach(this._attachEvents,this.disconnect,this);this._attachEvents=[];this.inherited(arguments);}});_5._Templated._templateCache={};_5._Templated.getCachedTemplate=function(_1ae,_1af,_1b0){var _1b1=_5._Templated._templateCache;var key=_1af||_1ae;var _1b2=_1b1[key];if(_1b2){try{if(!_1b2.ownerDocument||_1b2.ownerDocument==_4.doc){return _1b2;}}catch(e){}_4.destroy(_1b2);}if(!_1af){_1af=_4.cache(_1ae,{sanitize:true});}_1af=_4.string.trim(_1af);if(_1b0||_1af.match(/\$\{([^\}]+)\}/g)){return (_1b1[key]=_1af);}else{var node=_4._toDom(_1af);if(node.nodeType!=1){throw new Error("Invalid template: "+_1af);}return (_1b1[key]=node);}};if(_4.isIE){_4.addOnWindowUnload(function(){var _1b3=_5._Templated._templateCache;for(var key in _1b3){var _1b4=_1b3[key];if(typeof _1b4=="object"){_4.destroy(_1b4);}delete _1b3[key];}});}_4.extend(_5._Widget,{dojoAttachEvent:"",dojoAttachPoint:"",waiRole:"",waiState:""});}if(!_4._hasResource["dijit._Container"]){_4._hasResource["dijit._Container"]=true;_4.provide("dijit._Container");_4.declare("dijit._Container",null,{isContainer:true,buildRendering:function(){this.inherited(arguments);if(!this.containerNode){this.containerNode=this.domNode;}},addChild:function(_1b5,_1b6){var _1b7=this.containerNode;if(_1b6&&typeof _1b6=="number"){var _1b8=this.getChildren();if(_1b8&&_1b8.length>=_1b6){_1b7=_1b8[_1b6-1].domNode;_1b6="after";}}_4.place(_1b5.domNode,_1b7,_1b6);if(this._started&&!_1b5._started){_1b5.startup();}},removeChild:function(_1b9){if(typeof _1b9=="number"){_1b9=this.getChildren()[_1b9];}if(_1b9){var node=_1b9.domNode;if(node&&node.parentNode){node.parentNode.removeChild(node);}}},hasChildren:function(){return this.getChildren().length>0;},destroyDescendants:function(_1ba){_4.forEach(this.getChildren(),function(_1bb){_1bb.destroyRecursive(_1ba);});},_getSiblingOfChild:function(_1bc,dir){var node=_1bc.domNode,_1bd=(dir>0?"nextSibling":"previousSibling");do{node=node[_1bd];}while(node&&(node.nodeType!=1||!_5.byNode(node)));return node&&_5.byNode(node);},getIndexOfChild:function(_1be){return _4.indexOf(this.getChildren(),_1be);},startup:function(){if(this._started){return;}_4.forEach(this.getChildren(),function(_1bf){_1bf.startup();});this.inherited(arguments);}});}if(!_4._hasResource["dijit._Contained"]){_4._hasResource["dijit._Contained"]=true;_4.provide("dijit._Contained");_4.declare("dijit._Contained",null,{getParent:function(){var _1c0=_5.getEnclosingWidget(this.domNode.parentNode);return _1c0&&_1c0.isContainer?_1c0:null;},_getSibling:function(_1c1){var node=this.domNode;do{node=node[_1c1+"Sibling"];}while(node&&node.nodeType!=1);return node&&_5.byNode(node);},getPreviousSibling:function(){return this._getSibling("previous");},getNextSibling:function(){return this._getSibling("next");},getIndexInParent:function(){var p=this.getParent();if(!p||!p.getIndexOfChild){return -1;}return p.getIndexOfChild(this);}});}if(!_4._hasResource["dijit.layout._LayoutWidget"]){_4._hasResource["dijit.layout._LayoutWidget"]=true;_4.provide("dijit.layout._LayoutWidget");_4.declare("dijit.layout._LayoutWidget",[_5._Widget,_5._Container,_5._Contained],{baseClass:"dijitLayoutContainer",isLayoutContainer:true,buildRendering:function(){this.inherited(arguments);_4.addClass(this.domNode,"dijitContainer");},startup:function(){if(this._started){return;}this.inherited(arguments);var _1c2=this.getParent&&this.getParent();if(!(_1c2&&_1c2.isLayoutContainer)){this.resize();this.connect(_4.isIE?this.domNode:_4.global,"onresize",function(){this.resize();});}},resize:function(_1c3,_1c4){var node=this.domNode;if(_1c3){_4.marginBox(node,_1c3);if(_1c3.t){node.style.top=_1c3.t+"px";}if(_1c3.l){node.style.left=_1c3.l+"px";}}var mb=_1c4||{};_4.mixin(mb,_1c3||{});if(!("h" in mb)||!("w" in mb)){mb=_4.mixin(_4.marginBox(node),mb);}var cs=_4.getComputedStyle(node);var me=_4._getMarginExtents(node,cs);var be=_4._getBorderExtents(node,cs);var bb=(this._borderBox={w:mb.w-(me.w+be.w),h:mb.h-(me.h+be.h)});var pe=_4._getPadExtents(node,cs);this._contentBox={l:_4._toPixelValue(node,cs.paddingLeft),t:_4._toPixelValue(node,cs.paddingTop),w:bb.w-pe.w,h:bb.h-pe.h};this.layout();},layout:function(){},_setupChild:function(_1c5){var cls=this.baseClass+"-child "+(_1c5.baseClass?this.baseClass+"-"+_1c5.baseClass:"");_4.addClass(_1c5.domNode,cls);},addChild:function(_1c6,_1c7){this.inherited(arguments);if(this._started){this._setupChild(_1c6);}},removeChild:function(_1c8){var cls=this.baseClass+"-child"+(_1c8.baseClass?" "+this.baseClass+"-"+_1c8.baseClass:"");_4.removeClass(_1c8.domNode,cls);this.inherited(arguments);}});_5.layout.marginBox2contentBox=function(node,mb){var cs=_4.getComputedStyle(node);var me=_4._getMarginExtents(node,cs);var pb=_4._getPadBorderExtents(node,cs);return {l:_4._toPixelValue(node,cs.paddingLeft),t:_4._toPixelValue(node,cs.paddingTop),w:mb.w-(me.w+pb.w),h:mb.h-(me.h+pb.h)};};(function(){var _1c9=function(word){return word.substring(0,1).toUpperCase()+word.substring(1);};var size=function(_1ca,dim){_1ca.resize?_1ca.resize(dim):_4.marginBox(_1ca.domNode,dim);_4.mixin(_1ca,_4.marginBox(_1ca.domNode));_4.mixin(_1ca,dim);};_5.layout.layoutChildren=function(_1cb,dim,_1cc,_1cd,_1ce){dim=_4.mixin({},dim);_4.addClass(_1cb,"dijitLayoutContainer");_1cc=_4.filter(_1cc,function(item){return item.region!="center"&&item.layoutAlign!="client";}).concat(_4.filter(_1cc,function(item){return item.region=="center"||item.layoutAlign=="client";}));_4.forEach(_1cc,function(_1cf){var elm=_1cf.domNode,pos=(_1cf.region||_1cf.layoutAlign);var _1d0=elm.style;_1d0.left=dim.l+"px";_1d0.top=dim.t+"px";_1d0.bottom=_1d0.right="auto";_4.addClass(elm,"dijitAlign"+_1c9(pos));var _1d1={};if(_1cd&&_1cd==_1cf.id){_1d1[_1cf.region=="top"||_1cf.region=="bottom"?"h":"w"]=_1ce;}if(pos=="top"||pos=="bottom"){_1d1.w=dim.w;size(_1cf,_1d1);dim.h-=_1cf.h;if(pos=="top"){dim.t+=_1cf.h;}else{_1d0.top=dim.t+dim.h+"px";}}else{if(pos=="left"||pos=="right"){_1d1.h=dim.h;size(_1cf,_1d1);dim.w-=_1cf.w;if(pos=="left"){dim.l+=_1cf.w;}else{_1d0.left=dim.l+dim.w+"px";}}else{if(pos=="client"||pos=="center"){size(_1cf,dim);}}}});};})();}if(!_4._hasResource["dijit._CssStateMixin"]){_4._hasResource["dijit._CssStateMixin"]=true;_4.provide("dijit._CssStateMixin");_4.declare("dijit._CssStateMixin",[],{cssStateNodes:{},hovering:false,active:false,_applyAttributes:function(){this.inherited(arguments);_4.forEach(["onmouseenter","onmouseleave","onmousedown"],function(e){this.connect(this.domNode,e,"_cssMouseEvent");},this);_4.forEach(["disabled","readOnly","checked","selected","focused","state","hovering","active"],function(attr){this.watch(attr,_4.hitch(this,"_setStateClass"));},this);for(var ap in this.cssStateNodes){this._trackMouseState(this[ap],this.cssStateNodes[ap]);}this._setStateClass();},_cssMouseEvent:function(_1d2){if(!this.disabled){switch(_1d2.type){case "mouseenter":case "mouseover":this._set("hovering",true);this._set("active",this._mouseDown);break;case "mouseleave":case "mouseout":this._set("hovering",false);this._set("active",false);break;case "mousedown":this._set("active",true);this._mouseDown=true;var _1d3=this.connect(_4.body(),"onmouseup",function(){this._mouseDown=false;this._set("active",false);this.disconnect(_1d3);});break;}}},_setStateClass:function(){var _1d4=this.baseClass.split(" ");function _1d5(_1d6){_1d4=_1d4.concat(_4.map(_1d4,function(c){return c+_1d6;}),"dijit"+_1d6);};if(!this.isLeftToRight()){_1d5("Rtl");}if(this.checked){_1d5("Checked");}if(this.state){_1d5(this.state);}if(this.selected){_1d5("Selected");}if(this.disabled){_1d5("Disabled");}else{if(this.readOnly){_1d5("ReadOnly");}else{if(this.active){_1d5("Active");}else{if(this.hovering){_1d5("Hover");}}}}if(this._focused){_1d5("Focused");}var tn=this.stateNode||this.domNode,_1d7={};_4.forEach(tn.className.split(" "),function(c){_1d7[c]=true;});if("_stateClasses" in this){_4.forEach(this._stateClasses,function(c){delete _1d7[c];});}_4.forEach(_1d4,function(c){_1d7[c]=true;});var _1d8=[];for(var c in _1d7){_1d8.push(c);}tn.className=_1d8.join(" ");this._stateClasses=_1d4;},_trackMouseState:function(node,_1d9){var _1da=false,_1db=false,_1dc=false;var self=this,cn=_4.hitch(this,"connect",node);function _1dd(){var _1de=("disabled" in self&&self.disabled)||("readonly" in self&&self.readonly);_4.toggleClass(node,_1d9+"Hover",_1da&&!_1db&&!_1de);_4.toggleClass(node,_1d9+"Active",_1db&&!_1de);_4.toggleClass(node,_1d9+"Focused",_1dc&&!_1de);};cn("onmouseenter",function(){_1da=true;_1dd();});cn("onmouseleave",function(){_1da=false;_1db=false;_1dd();});cn("onmousedown",function(){_1db=true;_1dd();});cn("onmouseup",function(){_1db=false;_1dd();});cn("onfocus",function(){_1dc=true;_1dd();});cn("onblur",function(){_1dc=false;_1dd();});this.watch("disabled",_1dd);this.watch("readOnly",_1dd);}});}if(!_4._hasResource["dijit.form._FormWidget"]){_4._hasResource["dijit.form._FormWidget"]=true;_4.provide("dijit.form._FormWidget");_4.declare("dijit.form._FormWidget",[_5._Widget,_5._Templated,_5._CssStateMixin],{name:"",alt:"",value:"",type:"text",tabIndex:"0",disabled:false,intermediateChanges:false,scrollOnFocus:true,attributeMap:_4.delegate(_5._Widget.prototype.attributeMap,{value:"focusNode",id:"focusNode",tabIndex:"focusNode",alt:"focusNode",title:"focusNode"}),postMixInProperties:function(){this.nameAttrSetting=this.name?("name=\""+this.name.replace(/'/g,"&quot;")+"\""):"";this.inherited(arguments);},postCreate:function(){this.inherited(arguments);this.connect(this.domNode,"onmousedown","_onMouseDown");},_setDisabledAttr:function(_1df){this._set("disabled",_1df);_4.attr(this.focusNode,"disabled",_1df);if(this.valueNode){_4.attr(this.valueNode,"disabled",_1df);}_5.setWaiState(this.focusNode,"disabled",_1df);if(_1df){this._set("hovering",false);this._set("active",false);var _1e0="tabIndex" in this.attributeMap?this.attributeMap.tabIndex:"focusNode";_4.forEach(_4.isArray(_1e0)?_1e0:[_1e0],function(_1e1){var node=this[_1e1];if(_4.isWebKit||_5.hasDefaultTabStop(node)){node.setAttribute("tabIndex","-1");}else{node.removeAttribute("tabIndex");}},this);}else{if(this.tabIndex!=""){this.focusNode.setAttribute("tabIndex",this.tabIndex);}}},setDisabled:function(_1e2){_4.deprecated("setDisabled("+_1e2+") is deprecated. Use set('disabled',"+_1e2+") instead.","","2.0");this.set("disabled",_1e2);},_onFocus:function(e){if(this.scrollOnFocus){_4.window.scrollIntoView(this.domNode);}this.inherited(arguments);},isFocusable:function(){return !this.disabled&&this.focusNode&&(_4.style(this.domNode,"display")!="none");},focus:function(){if(!this.disabled){_5.focus(this.focusNode);}},compare:function(val1,val2){if(typeof val1=="number"&&typeof val2=="number"){return (isNaN(val1)&&isNaN(val2))?0:val1-val2;}else{if(val1>val2){return 1;}else{if(val1<val2){return -1;}else{return 0;}}}},onChange:function(_1e3){},_onChangeActive:false,_handleOnChange:function(_1e4,_1e5){if(this._lastValueReported==undefined&&(_1e5===null||!this._onChangeActive)){this._resetValue=this._lastValueReported=_1e4;}this._pendingOnChange=this._pendingOnChange||(typeof _1e4!=typeof this._lastValueReported)||(this.compare(_1e4,this._lastValueReported)!=0);if((this.intermediateChanges||_1e5||_1e5===undefined)&&this._pendingOnChange){this._lastValueReported=_1e4;this._pendingOnChange=false;if(this._onChangeActive){if(this._onChangeHandle){clearTimeout(this._onChangeHandle);}this._onChangeHandle=setTimeout(_4.hitch(this,function(){this._onChangeHandle=null;this.onChange(_1e4);}),0);}}},create:function(){this.inherited(arguments);this._onChangeActive=true;},destroy:function(){if(this._onChangeHandle){clearTimeout(this._onChangeHandle);this.onChange(this._lastValueReported);}this.inherited(arguments);},setValue:function(_1e6){_4.deprecated("dijit.form._FormWidget:setValue("+_1e6+") is deprecated. Use set('value',"+_1e6+") instead.","","2.0");this.set("value",_1e6);},getValue:function(){_4.deprecated(this.declaredClass+"::getValue() is deprecated. Use get('value') instead.","","2.0");return this.get("value");},_onMouseDown:function(e){if(!e.ctrlKey&&_4.mouseButtons.isLeft(e)&&this.isFocusable()){var _1e7=this.connect(_4.body(),"onmouseup",function(){if(this.isFocusable()){this.focus();}this.disconnect(_1e7);});}}});_4.declare("dijit.form._FormValueWidget",_5.form._FormWidget,{readOnly:false,attributeMap:_4.delegate(_5.form._FormWidget.prototype.attributeMap,{value:"",readOnly:"focusNode"}),_setReadOnlyAttr:function(_1e8){_4.attr(this.focusNode,"readOnly",_1e8);_5.setWaiState(this.focusNode,"readonly",_1e8);this._set("readOnly",_1e8);},postCreate:function(){this.inherited(arguments);if(_4.isIE){this.connect(this.focusNode||this.domNode,"onkeydown",this._onKeyDown);}if(this._resetValue===undefined){this._lastValueReported=this._resetValue=this.value;}},_setValueAttr:function(_1e9,_1ea){this._handleOnChange(_1e9,_1ea);},_handleOnChange:function(_1eb,_1ec){this._set("value",_1eb);this.inherited(arguments);},undo:function(){this._setValueAttr(this._lastValueReported,false);},reset:function(){this._hasBeenBlurred=false;this._setValueAttr(this._resetValue,true);},_onKeyDown:function(e){if(e.keyCode==_4.keys.ESCAPE&&!(e.ctrlKey||e.altKey||e.metaKey)){var te;if(_4.isIE){e.preventDefault();te=document.createEventObject();te.keyCode=_4.keys.ESCAPE;te.shiftKey=e.shiftKey;e.srcElement.fireEvent("onkeypress",te);}}},_layoutHackIE7:function(){if(_4.isIE==7){var _1ed=this.domNode;var _1ee=_1ed.parentNode;var _1ef=_1ed.firstChild||_1ed;var _1f0=_1ef.style.filter;var _1f1=this;while(_1ee&&_1ee.clientHeight==0){(function ping(){var _1f2=_1f1.connect(_1ee,"onscroll",function(e){_1f1.disconnect(_1f2);_1ef.style.filter=(new Date()).getMilliseconds();setTimeout(function(){_1ef.style.filter=_1f0;},0);});})();_1ee=_1ee.parentNode;}}}});}if(!_4._hasResource["dijit.dijit"]){_4._hasResource["dijit.dijit"]=true;_4.provide("dijit.dijit");}}};});
diff --git a/js/dojo-1.6/dijit/dijit.xd.js.uncompressed.js b/js/dojo-1.6/dijit/dijit.xd.js.uncompressed.js
new file mode 100644
index 0000000..e2227b1
--- /dev/null
+++ b/js/dojo-1.6/dijit/dijit.xd.js.uncompressed.js
@@ -0,0 +1,6469 @@
+dojo._xdResourceLoaded(function(dojo, dijit, dojox){
+return {depends: [["provide", "dojo.window"],
+["provide", "dijit._base.manager"],
+["provide", "dijit._base.focus"],
+["provide", "dojo.AdapterRegistry"],
+["provide", "dijit._base.place"],
+["provide", "dijit._base.window"],
+["provide", "dijit._base.popup"],
+["provide", "dijit._base.scroll"],
+["provide", "dojo.uacss"],
+["provide", "dijit._base.sniff"],
+["provide", "dijit._base.typematic"],
+["provide", "dijit._base.wai"],
+["provide", "dijit._base"],
+["provide", "dojo.date.stamp"],
+["provide", "dojo.parser"],
+["provide", "dojo.Stateful"],
+["provide", "dijit._WidgetBase"],
+["provide", "dijit._Widget"],
+["provide", "dojo.string"],
+["provide", "dojo.cache"],
+["provide", "dijit._Templated"],
+["provide", "dijit._Container"],
+["provide", "dijit._Contained"],
+["provide", "dijit.layout._LayoutWidget"],
+["provide", "dijit._CssStateMixin"],
+["provide", "dijit.form._FormWidget"],
+["provide", "dijit.dijit"]],
+defineResource: function(dojo, dijit, dojox){/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+/*
+ This is an optimized version of Dojo, built for deployment and not for
+ development. To get sources and documentation, please visit:
+
+ http://dojotoolkit.org
+*/
+
+if(!dojo._hasResource["dojo.window"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojo.window"] = true;
+dojo.provide("dojo.window");
+
+
+dojo.getObject("window", true, dojo);
+
+dojo.window.getBox = function(){
+ // summary:
+ // Returns the dimensions and scroll position of the viewable area of a browser window
+
+ var scrollRoot = (dojo.doc.compatMode == 'BackCompat') ? dojo.body() : dojo.doc.documentElement;
+
+ // get scroll position
+ var scroll = dojo._docScroll(); // scrollRoot.scrollTop/Left should work
+ return { w: scrollRoot.clientWidth, h: scrollRoot.clientHeight, l: scroll.x, t: scroll.y };
+};
+
+dojo.window.get = function(doc){
+ // summary:
+ // Get window object associated with document doc
+
+ // In some IE versions (at least 6.0), document.parentWindow does not return a
+ // reference to the real window object (maybe a copy), so we must fix it as well
+ // We use IE specific execScript to attach the real window reference to
+ // document._parentWindow for later use
+ if(dojo.isIE && window !== document.parentWindow){
+ /*
+ In IE 6, only the variable "window" can be used to connect events (others
+ may be only copies).
+ */
+ doc.parentWindow.execScript("document._parentWindow = window;", "Javascript");
+ //to prevent memory leak, unset it after use
+ //another possibility is to add an onUnload handler which seems overkill to me (liucougar)
+ var win = doc._parentWindow;
+ doc._parentWindow = null;
+ return win; // Window
+ }
+
+ return doc.parentWindow || doc.defaultView; // Window
+};
+
+dojo.window.scrollIntoView = function(/*DomNode*/ node, /*Object?*/ pos){
+ // summary:
+ // Scroll the passed node into view, if it is not already.
+
+ // don't rely on node.scrollIntoView working just because the function is there
+
+ try{ // catch unexpected/unrecreatable errors (#7808) since we can recover using a semi-acceptable native method
+ node = dojo.byId(node);
+ var doc = node.ownerDocument || dojo.doc,
+ body = doc.body || dojo.body(),
+ html = doc.documentElement || body.parentNode,
+ isIE = dojo.isIE, isWK = dojo.isWebKit;
+ // if an untested browser, then use the native method
+ if((!(dojo.isMoz || isIE || isWK || dojo.isOpera) || node == body || node == html) && (typeof node.scrollIntoView != "undefined")){
+ node.scrollIntoView(false); // short-circuit to native if possible
+ return;
+ }
+ var backCompat = doc.compatMode == 'BackCompat',
+ clientAreaRoot = backCompat? body : html,
+ scrollRoot = isWK ? body : clientAreaRoot,
+ rootWidth = clientAreaRoot.clientWidth,
+ rootHeight = clientAreaRoot.clientHeight,
+ rtl = !dojo._isBodyLtr(),
+ nodePos = pos || dojo.position(node),
+ el = node.parentNode,
+ isFixed = function(el){
+ return ((isIE <= 6 || (isIE && backCompat))? false : (dojo.style(el, 'position').toLowerCase() == "fixed"));
+ };
+ if(isFixed(node)){ return; } // nothing to do
+
+ while(el){
+ if(el == body){ el = scrollRoot; }
+ var elPos = dojo.position(el),
+ fixedPos = isFixed(el);
+
+ if(el == scrollRoot){
+ elPos.w = rootWidth; elPos.h = rootHeight;
+ if(scrollRoot == html && isIE && rtl){ elPos.x += scrollRoot.offsetWidth-elPos.w; } // IE workaround where scrollbar causes negative x
+ if(elPos.x < 0 || !isIE){ elPos.x = 0; } // IE can have values > 0
+ if(elPos.y < 0 || !isIE){ elPos.y = 0; }
+ }else{
+ var pb = dojo._getPadBorderExtents(el);
+ elPos.w -= pb.w; elPos.h -= pb.h; elPos.x += pb.l; elPos.y += pb.t;
+ }
+
+ if(el != scrollRoot){ // body, html sizes already have the scrollbar removed
+ var clientSize = el.clientWidth,
+ scrollBarSize = elPos.w - clientSize;
+ if(clientSize > 0 && scrollBarSize > 0){
+ elPos.w = clientSize;
+ if(isIE && rtl){ elPos.x += scrollBarSize; }
+ }
+ clientSize = el.clientHeight;
+ scrollBarSize = elPos.h - clientSize;
+ if(clientSize > 0 && scrollBarSize > 0){
+ elPos.h = clientSize;
+ }
+ }
+ if(fixedPos){ // bounded by viewport, not parents
+ if(elPos.y < 0){
+ elPos.h += elPos.y; elPos.y = 0;
+ }
+ if(elPos.x < 0){
+ elPos.w += elPos.x; elPos.x = 0;
+ }
+ if(elPos.y + elPos.h > rootHeight){
+ elPos.h = rootHeight - elPos.y;
+ }
+ if(elPos.x + elPos.w > rootWidth){
+ elPos.w = rootWidth - elPos.x;
+ }
+ }
+ // calculate overflow in all 4 directions
+ var l = nodePos.x - elPos.x, // beyond left: < 0
+ t = nodePos.y - Math.max(elPos.y, 0), // beyond top: < 0
+ r = l + nodePos.w - elPos.w, // beyond right: > 0
+ bot = t + nodePos.h - elPos.h; // beyond bottom: > 0
+ if(r * l > 0){
+ var s = Math[l < 0? "max" : "min"](l, r);
+ nodePos.x += el.scrollLeft;
+ el.scrollLeft += (isIE >= 8 && !backCompat && rtl)? -s : s;
+ nodePos.x -= el.scrollLeft;
+ }
+ if(bot * t > 0){
+ nodePos.y += el.scrollTop;
+ el.scrollTop += Math[t < 0? "max" : "min"](t, bot);
+ nodePos.y -= el.scrollTop;
+ }
+ el = (el != scrollRoot) && !fixedPos && el.parentNode;
+ }
+ }catch(error){
+ console.error('scrollIntoView: ' + error);
+ node.scrollIntoView(false);
+ }
+};
+
+}
+
+if(!dojo._hasResource["dijit._base.manager"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dijit._base.manager"] = true;
+dojo.provide("dijit._base.manager");
+
+
+
+dojo.declare("dijit.WidgetSet", null, {
+ // summary:
+ // A set of widgets indexed by id. A default instance of this class is
+ // available as `dijit.registry`
+ //
+ // example:
+ // Create a small list of widgets:
+ // | var ws = new dijit.WidgetSet();
+ // | ws.add(dijit.byId("one"));
+ // | ws.add(dijit.byId("two"));
+ // | // destroy both:
+ // | ws.forEach(function(w){ w.destroy(); });
+ //
+ // example:
+ // Using dijit.registry:
+ // | dijit.registry.forEach(function(w){ /* do something */ });
+
+ constructor: function(){
+ this._hash = {};
+ this.length = 0;
+ },
+
+ add: function(/*dijit._Widget*/ widget){
+ // summary:
+ // Add a widget to this list. If a duplicate ID is detected, a error is thrown.
+ //
+ // widget: dijit._Widget
+ // Any dijit._Widget subclass.
+ if(this._hash[widget.id]){
+ throw new Error("Tried to register widget with id==" + widget.id + " but that id is already registered");
+ }
+ this._hash[widget.id] = widget;
+ this.length++;
+ },
+
+ remove: function(/*String*/ id){
+ // summary:
+ // Remove a widget from this WidgetSet. Does not destroy the widget; simply
+ // removes the reference.
+ if(this._hash[id]){
+ delete this._hash[id];
+ this.length--;
+ }
+ },
+
+ forEach: function(/*Function*/ func, /* Object? */thisObj){
+ // summary:
+ // Call specified function for each widget in this set.
+ //
+ // func:
+ // A callback function to run for each item. Is passed the widget, the index
+ // in the iteration, and the full hash, similar to `dojo.forEach`.
+ //
+ // thisObj:
+ // An optional scope parameter
+ //
+ // example:
+ // Using the default `dijit.registry` instance:
+ // | dijit.registry.forEach(function(widget){
+ // | console.log(widget.declaredClass);
+ // | });
+ //
+ // returns:
+ // Returns self, in order to allow for further chaining.
+
+ thisObj = thisObj || dojo.global;
+ var i = 0, id;
+ for(id in this._hash){
+ func.call(thisObj, this._hash[id], i++, this._hash);
+ }
+ return this; // dijit.WidgetSet
+ },
+
+ filter: function(/*Function*/ filter, /* Object? */thisObj){
+ // summary:
+ // Filter down this WidgetSet to a smaller new WidgetSet
+ // Works the same as `dojo.filter` and `dojo.NodeList.filter`
+ //
+ // filter:
+ // Callback function to test truthiness. Is passed the widget
+ // reference and the pseudo-index in the object.
+ //
+ // thisObj: Object?
+ // Option scope to use for the filter function.
+ //
+ // example:
+ // Arbitrary: select the odd widgets in this list
+ // | dijit.registry.filter(function(w, i){
+ // | return i % 2 == 0;
+ // | }).forEach(function(w){ /* odd ones */ });
+
+ thisObj = thisObj || dojo.global;
+ var res = new dijit.WidgetSet(), i = 0, id;
+ for(id in this._hash){
+ var w = this._hash[id];
+ if(filter.call(thisObj, w, i++, this._hash)){
+ res.add(w);
+ }
+ }
+ return res; // dijit.WidgetSet
+ },
+
+ byId: function(/*String*/ id){
+ // summary:
+ // Find a widget in this list by it's id.
+ // example:
+ // Test if an id is in a particular WidgetSet
+ // | var ws = new dijit.WidgetSet();
+ // | ws.add(dijit.byId("bar"));
+ // | var t = ws.byId("bar") // returns a widget
+ // | var x = ws.byId("foo"); // returns undefined
+
+ return this._hash[id]; // dijit._Widget
+ },
+
+ byClass: function(/*String*/ cls){
+ // summary:
+ // Reduce this widgetset to a new WidgetSet of a particular `declaredClass`
+ //
+ // cls: String
+ // The Class to scan for. Full dot-notated string.
+ //
+ // example:
+ // Find all `dijit.TitlePane`s in a page:
+ // | dijit.registry.byClass("dijit.TitlePane").forEach(function(tp){ tp.close(); });
+
+ var res = new dijit.WidgetSet(), id, widget;
+ for(id in this._hash){
+ widget = this._hash[id];
+ if(widget.declaredClass == cls){
+ res.add(widget);
+ }
+ }
+ return res; // dijit.WidgetSet
+},
+
+ toArray: function(){
+ // summary:
+ // Convert this WidgetSet into a true Array
+ //
+ // example:
+ // Work with the widget .domNodes in a real Array
+ // | dojo.map(dijit.registry.toArray(), function(w){ return w.domNode; });
+
+ var ar = [];
+ for(var id in this._hash){
+ ar.push(this._hash[id]);
+ }
+ return ar; // dijit._Widget[]
+},
+
+ map: function(/* Function */func, /* Object? */thisObj){
+ // summary:
+ // Create a new Array from this WidgetSet, following the same rules as `dojo.map`
+ // example:
+ // | var nodes = dijit.registry.map(function(w){ return w.domNode; });
+ //
+ // returns:
+ // A new array of the returned values.
+ return dojo.map(this.toArray(), func, thisObj); // Array
+ },
+
+ every: function(func, thisObj){
+ // summary:
+ // A synthetic clone of `dojo.every` acting explicitly on this WidgetSet
+ //
+ // func: Function
+ // A callback function run for every widget in this list. Exits loop
+ // when the first false return is encountered.
+ //
+ // thisObj: Object?
+ // Optional scope parameter to use for the callback
+
+ thisObj = thisObj || dojo.global;
+ var x = 0, i;
+ for(i in this._hash){
+ if(!func.call(thisObj, this._hash[i], x++, this._hash)){
+ return false; // Boolean
+ }
+ }
+ return true; // Boolean
+ },
+
+ some: function(func, thisObj){
+ // summary:
+ // A synthetic clone of `dojo.some` acting explictly on this WidgetSet
+ //
+ // func: Function
+ // A callback function run for every widget in this list. Exits loop
+ // when the first true return is encountered.
+ //
+ // thisObj: Object?
+ // Optional scope parameter to use for the callback
+
+ thisObj = thisObj || dojo.global;
+ var x = 0, i;
+ for(i in this._hash){
+ if(func.call(thisObj, this._hash[i], x++, this._hash)){
+ return true; // Boolean
+ }
+ }
+ return false; // Boolean
+ }
+
+});
+
+(function(){
+
+ /*=====
+ dijit.registry = {
+ // summary:
+ // A list of widgets on a page.
+ // description:
+ // Is an instance of `dijit.WidgetSet`
+ };
+ =====*/
+ dijit.registry = new dijit.WidgetSet();
+
+ var hash = dijit.registry._hash,
+ attr = dojo.attr,
+ hasAttr = dojo.hasAttr,
+ style = dojo.style;
+
+ dijit.byId = function(/*String|dijit._Widget*/ id){
+ // summary:
+ // Returns a widget by it's id, or if passed a widget, no-op (like dojo.byId())
+ return typeof id == "string" ? hash[id] : id; // dijit._Widget
+ };
+
+ var _widgetTypeCtr = {};
+ dijit.getUniqueId = function(/*String*/widgetType){
+ // summary:
+ // Generates a unique id for a given widgetType
+
+ var id;
+ do{
+ id = widgetType + "_" +
+ (widgetType in _widgetTypeCtr ?
+ ++_widgetTypeCtr[widgetType] : _widgetTypeCtr[widgetType] = 0);
+ }while(hash[id]);
+ return dijit._scopeName == "dijit" ? id : dijit._scopeName + "_" + id; // String
+ };
+
+ dijit.findWidgets = function(/*DomNode*/ root){
+ // summary:
+ // Search subtree under root returning widgets found.
+ // Doesn't search for nested widgets (ie, widgets inside other widgets).
+
+ var outAry = [];
+
+ function getChildrenHelper(root){
+ for(var node = root.firstChild; node; node = node.nextSibling){
+ if(node.nodeType == 1){
+ var widgetId = node.getAttribute("widgetId");
+ if(widgetId){
+ var widget = hash[widgetId];
+ if(widget){ // may be null on page w/multiple dojo's loaded
+ outAry.push(widget);
+ }
+ }else{
+ getChildrenHelper(node);
+ }
+ }
+ }
+ }
+
+ getChildrenHelper(root);
+ return outAry;
+ };
+
+ dijit._destroyAll = function(){
+ // summary:
+ // Code to destroy all widgets and do other cleanup on page unload
+
+ // Clean up focus manager lingering references to widgets and nodes
+ dijit._curFocus = null;
+ dijit._prevFocus = null;
+ dijit._activeStack = [];
+
+ // Destroy all the widgets, top down
+ dojo.forEach(dijit.findWidgets(dojo.body()), function(widget){
+ // Avoid double destroy of widgets like Menu that are attached to <body>
+ // even though they are logically children of other widgets.
+ if(!widget._destroyed){
+ if(widget.destroyRecursive){
+ widget.destroyRecursive();
+ }else if(widget.destroy){
+ widget.destroy();
+ }
+ }
+ });
+ };
+
+ if(dojo.isIE){
+ // Only run _destroyAll() for IE because we think it's only necessary in that case,
+ // and because it causes problems on FF. See bug #3531 for details.
+ dojo.addOnWindowUnload(function(){
+ dijit._destroyAll();
+ });
+ }
+
+ dijit.byNode = function(/*DOMNode*/ node){
+ // summary:
+ // Returns the widget corresponding to the given DOMNode
+ return hash[node.getAttribute("widgetId")]; // dijit._Widget
+ };
+
+ dijit.getEnclosingWidget = function(/*DOMNode*/ node){
+ // summary:
+ // Returns the widget whose DOM tree contains the specified DOMNode, or null if
+ // the node is not contained within the DOM tree of any widget
+ while(node){
+ var id = node.getAttribute && node.getAttribute("widgetId");
+ if(id){
+ return hash[id];
+ }
+ node = node.parentNode;
+ }
+ return null;
+ };
+
+ var shown = (dijit._isElementShown = function(/*Element*/ elem){
+ var s = style(elem);
+ return (s.visibility != "hidden")
+ && (s.visibility != "collapsed")
+ && (s.display != "none")
+ && (attr(elem, "type") != "hidden");
+ });
+
+ dijit.hasDefaultTabStop = function(/*Element*/ elem){
+ // summary:
+ // Tests if element is tab-navigable even without an explicit tabIndex setting
+
+ // No explicit tabIndex setting, need to investigate node type
+ switch(elem.nodeName.toLowerCase()){
+ case "a":
+ // An <a> w/out a tabindex is only navigable if it has an href
+ return hasAttr(elem, "href");
+ case "area":
+ case "button":
+ case "input":
+ case "object":
+ case "select":
+ case "textarea":
+ // These are navigable by default
+ return true;
+ case "iframe":
+ // If it's an editor <iframe> then it's tab navigable.
+ var body;
+ try{
+ // non-IE
+ var contentDocument = elem.contentDocument;
+ if("designMode" in contentDocument && contentDocument.designMode == "on"){
+ return true;
+ }
+ body = contentDocument.body;
+ }catch(e1){
+ // contentWindow.document isn't accessible within IE7/8
+ // if the iframe.src points to a foreign url and this
+ // page contains an element, that could get focus
+ try{
+ body = elem.contentWindow.document.body;
+ }catch(e2){
+ return false;
+ }
+ }
+ return body.contentEditable == 'true' || (body.firstChild && body.firstChild.contentEditable == 'true');
+ default:
+ return elem.contentEditable == 'true';
+ }
+ };
+
+ var isTabNavigable = (dijit.isTabNavigable = function(/*Element*/ elem){
+ // summary:
+ // Tests if an element is tab-navigable
+
+ // TODO: convert (and rename method) to return effective tabIndex; will save time in _getTabNavigable()
+ if(attr(elem, "disabled")){
+ return false;
+ }else if(hasAttr(elem, "tabIndex")){
+ // Explicit tab index setting
+ return attr(elem, "tabIndex") >= 0; // boolean
+ }else{
+ // No explicit tabIndex setting, so depends on node type
+ return dijit.hasDefaultTabStop(elem);
+ }
+ });
+
+ dijit._getTabNavigable = function(/*DOMNode*/ root){
+ // summary:
+ // Finds descendants of the specified root node.
+ //
+ // description:
+ // Finds the following descendants of the specified root node:
+ // * the first tab-navigable element in document order
+ // without a tabIndex or with tabIndex="0"
+ // * the last tab-navigable element in document order
+ // without a tabIndex or with tabIndex="0"
+ // * the first element in document order with the lowest
+ // positive tabIndex value
+ // * the last element in document order with the highest
+ // positive tabIndex value
+ var first, last, lowest, lowestTabindex, highest, highestTabindex, radioSelected = {};
+ function radioName(node) {
+ // If this element is part of a radio button group, return the name for that group.
+ return node && node.tagName.toLowerCase() == "input" &&
+ node.type && node.type.toLowerCase() == "radio" &&
+ node.name && node.name.toLowerCase();
+ }
+ var walkTree = function(/*DOMNode*/parent){
+ dojo.query("> *", parent).forEach(function(child){
+ // Skip hidden elements, and also non-HTML elements (those in custom namespaces) in IE,
+ // since show() invokes getAttribute("type"), which crash on VML nodes in IE.
+ if((dojo.isIE && child.scopeName!=="HTML") || !shown(child)){
+ return;
+ }
+
+ if(isTabNavigable(child)){
+ var tabindex = attr(child, "tabIndex");
+ if(!hasAttr(child, "tabIndex") || tabindex == 0){
+ if(!first){ first = child; }
+ last = child;
+ }else if(tabindex > 0){
+ if(!lowest || tabindex < lowestTabindex){
+ lowestTabindex = tabindex;
+ lowest = child;
+ }
+ if(!highest || tabindex >= highestTabindex){
+ highestTabindex = tabindex;
+ highest = child;
+ }
+ }
+ var rn = radioName(child);
+ if(dojo.attr(child, "checked") && rn) {
+ radioSelected[rn] = child;
+ }
+ }
+ if(child.nodeName.toUpperCase() != 'SELECT'){
+ walkTree(child);
+ }
+ });
+ };
+ if(shown(root)){ walkTree(root) }
+ function rs(node) {
+ // substitute checked radio button for unchecked one, if there is a checked one with the same name.
+ return radioSelected[radioName(node)] || node;
+ }
+ return { first: rs(first), last: rs(last), lowest: rs(lowest), highest: rs(highest) };
+ }
+ dijit.getFirstInTabbingOrder = function(/*String|DOMNode*/ root){
+ // summary:
+ // Finds the descendant of the specified root node
+ // that is first in the tabbing order
+ var elems = dijit._getTabNavigable(dojo.byId(root));
+ return elems.lowest ? elems.lowest : elems.first; // DomNode
+ };
+
+ dijit.getLastInTabbingOrder = function(/*String|DOMNode*/ root){
+ // summary:
+ // Finds the descendant of the specified root node
+ // that is last in the tabbing order
+ var elems = dijit._getTabNavigable(dojo.byId(root));
+ return elems.last ? elems.last : elems.highest; // DomNode
+ };
+
+ /*=====
+ dojo.mixin(dijit, {
+ // defaultDuration: Integer
+ // The default animation speed (in ms) to use for all Dijit
+ // transitional animations, unless otherwise specified
+ // on a per-instance basis. Defaults to 200, overrided by
+ // `djConfig.defaultDuration`
+ defaultDuration: 200
+ });
+ =====*/
+
+ dijit.defaultDuration = dojo.config["defaultDuration"] || 200;
+
+})();
+
+}
+
+if(!dojo._hasResource["dijit._base.focus"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dijit._base.focus"] = true;
+dojo.provide("dijit._base.focus");
+
+
+
+
+
+// summary:
+// These functions are used to query or set the focus and selection.
+//
+// Also, they trace when widgets become activated/deactivated,
+// so that the widget can fire _onFocus/_onBlur events.
+// "Active" here means something similar to "focused", but
+// "focus" isn't quite the right word because we keep track of
+// a whole stack of "active" widgets. Example: ComboButton --> Menu -->
+// MenuItem. The onBlur event for ComboButton doesn't fire due to focusing
+// on the Menu or a MenuItem, since they are considered part of the
+// ComboButton widget. It only happens when focus is shifted
+// somewhere completely different.
+
+dojo.mixin(dijit, {
+ // _curFocus: DomNode
+ // Currently focused item on screen
+ _curFocus: null,
+
+ // _prevFocus: DomNode
+ // Previously focused item on screen
+ _prevFocus: null,
+
+ isCollapsed: function(){
+ // summary:
+ // Returns true if there is no text selected
+ return dijit.getBookmark().isCollapsed;
+ },
+
+ getBookmark: function(){
+ // summary:
+ // Retrieves a bookmark that can be used with moveToBookmark to return to the same range
+ var bm, rg, tg, sel = dojo.doc.selection, cf = dijit._curFocus;
+
+ if(dojo.global.getSelection){
+ //W3C Range API for selections.
+ sel = dojo.global.getSelection();
+ if(sel){
+ if(sel.isCollapsed){
+ tg = cf? cf.tagName : "";
+ if(tg){
+ //Create a fake rangelike item to restore selections.
+ tg = tg.toLowerCase();
+ if(tg == "textarea" ||
+ (tg == "input" && (!cf.type || cf.type.toLowerCase() == "text"))){
+ sel = {
+ start: cf.selectionStart,
+ end: cf.selectionEnd,
+ node: cf,
+ pRange: true
+ };
+ return {isCollapsed: (sel.end <= sel.start), mark: sel}; //Object.
+ }
+ }
+ bm = {isCollapsed:true};
+ }else{
+ rg = sel.getRangeAt(0);
+ bm = {isCollapsed: false, mark: rg.cloneRange()};
+ }
+ }
+ }else if(sel){
+ // If the current focus was a input of some sort and no selection, don't bother saving
+ // a native bookmark. This is because it causes issues with dialog/page selection restore.
+ // So, we need to create psuedo bookmarks to work with.
+ tg = cf ? cf.tagName : "";
+ tg = tg.toLowerCase();
+ if(cf && tg && (tg == "button" || tg == "textarea" || tg == "input")){
+ if(sel.type && sel.type.toLowerCase() == "none"){
+ return {
+ isCollapsed: true,
+ mark: null
+ }
+ }else{
+ rg = sel.createRange();
+ return {
+ isCollapsed: rg.text && rg.text.length?false:true,
+ mark: {
+ range: rg,
+ pRange: true
+ }
+ };
+ }
+ }
+ bm = {};
+
+ //'IE' way for selections.
+ try{
+ // createRange() throws exception when dojo in iframe
+ //and nothing selected, see #9632
+ rg = sel.createRange();
+ bm.isCollapsed = !(sel.type == 'Text' ? rg.htmlText.length : rg.length);
+ }catch(e){
+ bm.isCollapsed = true;
+ return bm;
+ }
+ if(sel.type.toUpperCase() == 'CONTROL'){
+ if(rg.length){
+ bm.mark=[];
+ var i=0,len=rg.length;
+ while(i<len){
+ bm.mark.push(rg.item(i++));
+ }
+ }else{
+ bm.isCollapsed = true;
+ bm.mark = null;
+ }
+ }else{
+ bm.mark = rg.getBookmark();
+ }
+ }else{
+ console.warn("No idea how to store the current selection for this browser!");
+ }
+ return bm; // Object
+ },
+
+ moveToBookmark: function(/*Object*/bookmark){
+ // summary:
+ // Moves current selection to a bookmark
+ // bookmark:
+ // This should be a returned object from dijit.getBookmark()
+
+ var _doc = dojo.doc,
+ mark = bookmark.mark;
+ if(mark){
+ if(dojo.global.getSelection){
+ //W3C Rangi API (FF, WebKit, Opera, etc)
+ var sel = dojo.global.getSelection();
+ if(sel && sel.removeAllRanges){
+ if(mark.pRange){
+ var r = mark;
+ var n = r.node;
+ n.selectionStart = r.start;
+ n.selectionEnd = r.end;
+ }else{
+ sel.removeAllRanges();
+ sel.addRange(mark);
+ }
+ }else{
+ console.warn("No idea how to restore selection for this browser!");
+ }
+ }else if(_doc.selection && mark){
+ //'IE' way.
+ var rg;
+ if(mark.pRange){
+ rg = mark.range;
+ }else if(dojo.isArray(mark)){
+ rg = _doc.body.createControlRange();
+ //rg.addElement does not have call/apply method, so can not call it directly
+ //rg is not available in "range.addElement(item)", so can't use that either
+ dojo.forEach(mark, function(n){
+ rg.addElement(n);
+ });
+ }else{
+ rg = _doc.body.createTextRange();
+ rg.moveToBookmark(mark);
+ }
+ rg.select();
+ }
+ }
+ },
+
+ getFocus: function(/*Widget?*/ menu, /*Window?*/ openedForWindow){
+ // summary:
+ // Called as getFocus(), this returns an Object showing the current focus
+ // and selected text.
+ //
+ // Called as getFocus(widget), where widget is a (widget representing) a button
+ // that was just pressed, it returns where focus was before that button
+ // was pressed. (Pressing the button may have either shifted focus to the button,
+ // or removed focus altogether.) In this case the selected text is not returned,
+ // since it can't be accurately determined.
+ //
+ // menu: dijit._Widget or {domNode: DomNode} structure
+ // The button that was just pressed. If focus has disappeared or moved
+ // to this button, returns the previous focus. In this case the bookmark
+ // information is already lost, and null is returned.
+ //
+ // openedForWindow:
+ // iframe in which menu was opened
+ //
+ // returns:
+ // A handle to restore focus/selection, to be passed to `dijit.focus`
+ var node = !dijit._curFocus || (menu && dojo.isDescendant(dijit._curFocus, menu.domNode)) ? dijit._prevFocus : dijit._curFocus;
+ return {
+ node: node,
+ bookmark: (node == dijit._curFocus) && dojo.withGlobal(openedForWindow || dojo.global, dijit.getBookmark),
+ openedForWindow: openedForWindow
+ }; // Object
+ },
+
+ focus: function(/*Object || DomNode */ handle){
+ // summary:
+ // Sets the focused node and the selection according to argument.
+ // To set focus to an iframe's content, pass in the iframe itself.
+ // handle:
+ // object returned by get(), or a DomNode
+
+ if(!handle){ return; }
+
+ var node = "node" in handle ? handle.node : handle, // because handle is either DomNode or a composite object
+ bookmark = handle.bookmark,
+ openedForWindow = handle.openedForWindow,
+ collapsed = bookmark ? bookmark.isCollapsed : false;
+
+ // Set the focus
+ // Note that for iframe's we need to use the <iframe> to follow the parentNode chain,
+ // but we need to set focus to iframe.contentWindow
+ if(node){
+ var focusNode = (node.tagName.toLowerCase() == "iframe") ? node.contentWindow : node;
+ if(focusNode && focusNode.focus){
+ try{
+ // Gecko throws sometimes if setting focus is impossible,
+ // node not displayed or something like that
+ focusNode.focus();
+ }catch(e){/*quiet*/}
+ }
+ dijit._onFocusNode(node);
+ }
+
+ // set the selection
+ // do not need to restore if current selection is not empty
+ // (use keyboard to select a menu item) or if previous selection was collapsed
+ // as it may cause focus shift (Esp in IE).
+ if(bookmark && dojo.withGlobal(openedForWindow || dojo.global, dijit.isCollapsed) && !collapsed){
+ if(openedForWindow){
+ openedForWindow.focus();
+ }
+ try{
+ dojo.withGlobal(openedForWindow || dojo.global, dijit.moveToBookmark, null, [bookmark]);
+ }catch(e2){
+ /*squelch IE internal error, see http://trac.dojotoolkit.org/ticket/1984 */
+ }
+ }
+ },
+
+ // _activeStack: dijit._Widget[]
+ // List of currently active widgets (focused widget and it's ancestors)
+ _activeStack: [],
+
+ registerIframe: function(/*DomNode*/ iframe){
+ // summary:
+ // Registers listeners on the specified iframe so that any click
+ // or focus event on that iframe (or anything in it) is reported
+ // as a focus/click event on the <iframe> itself.
+ // description:
+ // Currently only used by editor.
+ // returns:
+ // Handle to pass to unregisterIframe()
+ return dijit.registerWin(iframe.contentWindow, iframe);
+ },
+
+ unregisterIframe: function(/*Object*/ handle){
+ // summary:
+ // Unregisters listeners on the specified iframe created by registerIframe.
+ // After calling be sure to delete or null out the handle itself.
+ // handle:
+ // Handle returned by registerIframe()
+
+ dijit.unregisterWin(handle);
+ },
+
+ registerWin: function(/*Window?*/targetWindow, /*DomNode?*/ effectiveNode){
+ // summary:
+ // Registers listeners on the specified window (either the main
+ // window or an iframe's window) to detect when the user has clicked somewhere
+ // or focused somewhere.
+ // description:
+ // Users should call registerIframe() instead of this method.
+ // targetWindow:
+ // If specified this is the window associated with the iframe,
+ // i.e. iframe.contentWindow.
+ // effectiveNode:
+ // If specified, report any focus events inside targetWindow as
+ // an event on effectiveNode, rather than on evt.target.
+ // returns:
+ // Handle to pass to unregisterWin()
+
+ // TODO: make this function private in 2.0; Editor/users should call registerIframe(),
+
+ var mousedownListener = function(evt){
+ dijit._justMouseDowned = true;
+ setTimeout(function(){ dijit._justMouseDowned = false; }, 0);
+
+ // workaround weird IE bug where the click is on an orphaned node
+ // (first time clicking a Select/DropDownButton inside a TooltipDialog)
+ if(dojo.isIE && evt && evt.srcElement && evt.srcElement.parentNode == null){
+ return;
+ }
+
+ dijit._onTouchNode(effectiveNode || evt.target || evt.srcElement, "mouse");
+ };
+ //dojo.connect(targetWindow, "onscroll", ???);
+
+ // Listen for blur and focus events on targetWindow's document.
+ // IIRC, I'm using attachEvent() rather than dojo.connect() because focus/blur events don't bubble
+ // through dojo.connect(), and also maybe to catch the focus events early, before onfocus handlers
+ // fire.
+ // Connect to <html> (rather than document) on IE to avoid memory leaks, but document on other browsers because
+ // (at least for FF) the focus event doesn't fire on <html> or <body>.
+ var doc = dojo.isIE ? targetWindow.document.documentElement : targetWindow.document;
+ if(doc){
+ if(dojo.isIE){
+ targetWindow.document.body.attachEvent('onmousedown', mousedownListener);
+ var activateListener = function(evt){
+ // IE reports that nodes like <body> have gotten focus, even though they have tabIndex=-1,
+ // Should consider those more like a mouse-click than a focus....
+ if(evt.srcElement.tagName.toLowerCase() != "#document" &&
+ dijit.isTabNavigable(evt.srcElement)){
+ dijit._onFocusNode(effectiveNode || evt.srcElement);
+ }else{
+ dijit._onTouchNode(effectiveNode || evt.srcElement);
+ }
+ };
+ doc.attachEvent('onactivate', activateListener);
+ var deactivateListener = function(evt){
+ dijit._onBlurNode(effectiveNode || evt.srcElement);
+ };
+ doc.attachEvent('ondeactivate', deactivateListener);
+
+ return function(){
+ targetWindow.document.detachEvent('onmousedown', mousedownListener);
+ doc.detachEvent('onactivate', activateListener);
+ doc.detachEvent('ondeactivate', deactivateListener);
+ doc = null; // prevent memory leak (apparent circular reference via closure)
+ };
+ }else{
+ doc.body.addEventListener('mousedown', mousedownListener, true);
+ var focusListener = function(evt){
+ dijit._onFocusNode(effectiveNode || evt.target);
+ };
+ doc.addEventListener('focus', focusListener, true);
+ var blurListener = function(evt){
+ dijit._onBlurNode(effectiveNode || evt.target);
+ };
+ doc.addEventListener('blur', blurListener, true);
+
+ return function(){
+ doc.body.removeEventListener('mousedown', mousedownListener, true);
+ doc.removeEventListener('focus', focusListener, true);
+ doc.removeEventListener('blur', blurListener, true);
+ doc = null; // prevent memory leak (apparent circular reference via closure)
+ };
+ }
+ }
+ },
+
+ unregisterWin: function(/*Handle*/ handle){
+ // summary:
+ // Unregisters listeners on the specified window (either the main
+ // window or an iframe's window) according to handle returned from registerWin().
+ // After calling be sure to delete or null out the handle itself.
+
+ // Currently our handle is actually a function
+ handle && handle();
+ },
+
+ _onBlurNode: function(/*DomNode*/ node){
+ // summary:
+ // Called when focus leaves a node.
+ // Usually ignored, _unless_ it *isn't* follwed by touching another node,
+ // which indicates that we tabbed off the last field on the page,
+ // in which case every widget is marked inactive
+ dijit._prevFocus = dijit._curFocus;
+ dijit._curFocus = null;
+
+ if(dijit._justMouseDowned){
+ // the mouse down caused a new widget to be marked as active; this blur event
+ // is coming late, so ignore it.
+ return;
+ }
+
+ // if the blur event isn't followed by a focus event then mark all widgets as inactive.
+ if(dijit._clearActiveWidgetsTimer){
+ clearTimeout(dijit._clearActiveWidgetsTimer);
+ }
+ dijit._clearActiveWidgetsTimer = setTimeout(function(){
+ delete dijit._clearActiveWidgetsTimer;
+ dijit._setStack([]);
+ dijit._prevFocus = null;
+ }, 100);
+ },
+
+ _onTouchNode: function(/*DomNode*/ node, /*String*/ by){
+ // summary:
+ // Callback when node is focused or mouse-downed
+ // node:
+ // The node that was touched.
+ // by:
+ // "mouse" if the focus/touch was caused by a mouse down event
+
+ // ignore the recent blurNode event
+ if(dijit._clearActiveWidgetsTimer){
+ clearTimeout(dijit._clearActiveWidgetsTimer);
+ delete dijit._clearActiveWidgetsTimer;
+ }
+
+ // compute stack of active widgets (ex: ComboButton --> Menu --> MenuItem)
+ var newStack=[];
+ try{
+ while(node){
+ var popupParent = dojo.attr(node, "dijitPopupParent");
+ if(popupParent){
+ node=dijit.byId(popupParent).domNode;
+ }else if(node.tagName && node.tagName.toLowerCase() == "body"){
+ // is this the root of the document or just the root of an iframe?
+ if(node === dojo.body()){
+ // node is the root of the main document
+ break;
+ }
+ // otherwise, find the iframe this node refers to (can't access it via parentNode,
+ // need to do this trick instead). window.frameElement is supported in IE/FF/Webkit
+ node=dojo.window.get(node.ownerDocument).frameElement;
+ }else{
+ // if this node is the root node of a widget, then add widget id to stack,
+ // except ignore clicks on disabled widgets (actually focusing a disabled widget still works,
+ // to support MenuItem)
+ var id = node.getAttribute && node.getAttribute("widgetId"),
+ widget = id && dijit.byId(id);
+ if(widget && !(by == "mouse" && widget.get("disabled"))){
+ newStack.unshift(id);
+ }
+ node=node.parentNode;
+ }
+ }
+ }catch(e){ /* squelch */ }
+
+ dijit._setStack(newStack, by);
+ },
+
+ _onFocusNode: function(/*DomNode*/ node){
+ // summary:
+ // Callback when node is focused
+
+ if(!node){
+ return;
+ }
+
+ if(node.nodeType == 9){
+ // Ignore focus events on the document itself. This is here so that
+ // (for example) clicking the up/down arrows of a spinner
+ // (which don't get focus) won't cause that widget to blur. (FF issue)
+ return;
+ }
+
+ dijit._onTouchNode(node);
+
+ if(node == dijit._curFocus){ return; }
+ if(dijit._curFocus){
+ dijit._prevFocus = dijit._curFocus;
+ }
+ dijit._curFocus = node;
+ dojo.publish("focusNode", [node]);
+ },
+
+ _setStack: function(/*String[]*/ newStack, /*String*/ by){
+ // summary:
+ // The stack of active widgets has changed. Send out appropriate events and records new stack.
+ // newStack:
+ // array of widget id's, starting from the top (outermost) widget
+ // by:
+ // "mouse" if the focus/touch was caused by a mouse down event
+
+ var oldStack = dijit._activeStack;
+ dijit._activeStack = newStack;
+
+ // compare old stack to new stack to see how many elements they have in common
+ for(var nCommon=0; nCommon<Math.min(oldStack.length, newStack.length); nCommon++){
+ if(oldStack[nCommon] != newStack[nCommon]){
+ break;
+ }
+ }
+
+ var widget;
+ // for all elements that have gone out of focus, send blur event
+ for(var i=oldStack.length-1; i>=nCommon; i--){
+ widget = dijit.byId(oldStack[i]);
+ if(widget){
+ widget._focused = false;
+ widget.set("focused", false);
+ widget._hasBeenBlurred = true;
+ if(widget._onBlur){
+ widget._onBlur(by);
+ }
+ dojo.publish("widgetBlur", [widget, by]);
+ }
+ }
+
+ // for all element that have come into focus, send focus event
+ for(i=nCommon; i<newStack.length; i++){
+ widget = dijit.byId(newStack[i]);
+ if(widget){
+ widget._focused = true;
+ widget.set("focused", true);
+ if(widget._onFocus){
+ widget._onFocus(by);
+ }
+ dojo.publish("widgetFocus", [widget, by]);
+ }
+ }
+ }
+});
+
+// register top window and all the iframes it contains
+dojo.addOnLoad(function(){
+ var handle = dijit.registerWin(window);
+ if(dojo.isIE){
+ dojo.addOnWindowUnload(function(){
+ dijit.unregisterWin(handle);
+ handle = null;
+ })
+ }
+});
+
+}
+
+if(!dojo._hasResource["dojo.AdapterRegistry"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojo.AdapterRegistry"] = true;
+dojo.provide("dojo.AdapterRegistry");
+
+
+
+dojo.AdapterRegistry = function(/*Boolean?*/ returnWrappers){
+ // summary:
+ // A registry to make contextual calling/searching easier.
+ // description:
+ // Objects of this class keep list of arrays in the form [name, check,
+ // wrap, directReturn] that are used to determine what the contextual
+ // result of a set of checked arguments is. All check/wrap functions
+ // in this registry should be of the same arity.
+ // example:
+ // | // create a new registry
+ // | var reg = new dojo.AdapterRegistry();
+ // | reg.register("handleString",
+ // | dojo.isString,
+ // | function(str){
+ // | // do something with the string here
+ // | }
+ // | );
+ // | reg.register("handleArr",
+ // | dojo.isArray,
+ // | function(arr){
+ // | // do something with the array here
+ // | }
+ // | );
+ // |
+ // | // now we can pass reg.match() *either* an array or a string and
+ // | // the value we pass will get handled by the right function
+ // | reg.match("someValue"); // will call the first function
+ // | reg.match(["someValue"]); // will call the second
+
+ this.pairs = [];
+ this.returnWrappers = returnWrappers || false; // Boolean
+};
+
+dojo.extend(dojo.AdapterRegistry, {
+ register: function(/*String*/ name, /*Function*/ check, /*Function*/ wrap, /*Boolean?*/ directReturn, /*Boolean?*/ override){
+ // summary:
+ // register a check function to determine if the wrap function or
+ // object gets selected
+ // name:
+ // a way to identify this matcher.
+ // check:
+ // a function that arguments are passed to from the adapter's
+ // match() function. The check function should return true if the
+ // given arguments are appropriate for the wrap function.
+ // directReturn:
+ // If directReturn is true, the value passed in for wrap will be
+ // returned instead of being called. Alternately, the
+ // AdapterRegistry can be set globally to "return not call" using
+ // the returnWrappers property. Either way, this behavior allows
+ // the registry to act as a "search" function instead of a
+ // function interception library.
+ // override:
+ // If override is given and true, the check function will be given
+ // highest priority. Otherwise, it will be the lowest priority
+ // adapter.
+ this.pairs[((override) ? "unshift" : "push")]([name, check, wrap, directReturn]);
+ },
+
+ match: function(/* ... */){
+ // summary:
+ // Find an adapter for the given arguments. If no suitable adapter
+ // is found, throws an exception. match() accepts any number of
+ // arguments, all of which are passed to all matching functions
+ // from the registered pairs.
+ for(var i = 0; i < this.pairs.length; i++){
+ var pair = this.pairs[i];
+ if(pair[1].apply(this, arguments)){
+ if((pair[3])||(this.returnWrappers)){
+ return pair[2];
+ }else{
+ return pair[2].apply(this, arguments);
+ }
+ }
+ }
+ throw new Error("No match found");
+ },
+
+ unregister: function(name){
+ // summary: Remove a named adapter from the registry
+
+ // FIXME: this is kind of a dumb way to handle this. On a large
+ // registry this will be slow-ish and we can use the name as a lookup
+ // should we choose to trade memory for speed.
+ for(var i = 0; i < this.pairs.length; i++){
+ var pair = this.pairs[i];
+ if(pair[0] == name){
+ this.pairs.splice(i, 1);
+ return true;
+ }
+ }
+ return false;
+ }
+});
+
+}
+
+if(!dojo._hasResource["dijit._base.place"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dijit._base.place"] = true;
+dojo.provide("dijit._base.place");
+
+
+
+
+
+dijit.getViewport = function(){
+ // summary:
+ // Returns the dimensions and scroll position of the viewable area of a browser window
+
+ return dojo.window.getBox();
+};
+
+/*=====
+dijit.__Position = function(){
+ // x: Integer
+ // horizontal coordinate in pixels, relative to document body
+ // y: Integer
+ // vertical coordinate in pixels, relative to document body
+
+ thix.x = x;
+ this.y = y;
+}
+=====*/
+
+
+dijit.placeOnScreen = function(
+ /* DomNode */ node,
+ /* dijit.__Position */ pos,
+ /* String[] */ corners,
+ /* dijit.__Position? */ padding){
+ // summary:
+ // Positions one of the node's corners at specified position
+ // such that node is fully visible in viewport.
+ // description:
+ // NOTE: node is assumed to be absolutely or relatively positioned.
+ // pos:
+ // Object like {x: 10, y: 20}
+ // corners:
+ // Array of Strings representing order to try corners in, like ["TR", "BL"].
+ // Possible values are:
+ // * "BL" - bottom left
+ // * "BR" - bottom right
+ // * "TL" - top left
+ // * "TR" - top right
+ // padding:
+ // set padding to put some buffer around the element you want to position.
+ // example:
+ // Try to place node's top right corner at (10,20).
+ // If that makes node go (partially) off screen, then try placing
+ // bottom left corner at (10,20).
+ // | placeOnScreen(node, {x: 10, y: 20}, ["TR", "BL"])
+
+ var choices = dojo.map(corners, function(corner){
+ var c = { corner: corner, pos: {x:pos.x,y:pos.y} };
+ if(padding){
+ c.pos.x += corner.charAt(1) == 'L' ? padding.x : -padding.x;
+ c.pos.y += corner.charAt(0) == 'T' ? padding.y : -padding.y;
+ }
+ return c;
+ });
+
+ return dijit._place(node, choices);
+}
+
+dijit._place = function(/*DomNode*/ node, choices, layoutNode, /*Object*/ aroundNodeCoords){
+ // summary:
+ // Given a list of spots to put node, put it at the first spot where it fits,
+ // of if it doesn't fit anywhere then the place with the least overflow
+ // choices: Array
+ // Array of elements like: {corner: 'TL', pos: {x: 10, y: 20} }
+ // Above example says to put the top-left corner of the node at (10,20)
+ // layoutNode: Function(node, aroundNodeCorner, nodeCorner, size)
+ // for things like tooltip, they are displayed differently (and have different dimensions)
+ // based on their orientation relative to the parent. This adjusts the popup based on orientation.
+ // It also passes in the available size for the popup, which is useful for tooltips to
+ // tell them that their width is limited to a certain amount. layoutNode() may return a value expressing
+ // how much the popup had to be modified to fit into the available space. This is used to determine
+ // what the best placement is.
+ // aroundNodeCoords: Object
+ // Size of aroundNode, ex: {w: 200, h: 50}
+
+ // get {x: 10, y: 10, w: 100, h:100} type obj representing position of
+ // viewport over document
+ var view = dojo.window.getBox();
+
+ // This won't work if the node is inside a <div style="position: relative">,
+ // so reattach it to dojo.doc.body. (Otherwise, the positioning will be wrong
+ // and also it might get cutoff)
+ if(!node.parentNode || String(node.parentNode.tagName).toLowerCase() != "body"){
+ dojo.body().appendChild(node);
+ }
+
+ var best = null;
+ dojo.some(choices, function(choice){
+ var corner = choice.corner;
+ var pos = choice.pos;
+ var overflow = 0;
+
+ // calculate amount of space available given specified position of node
+ var spaceAvailable = {
+ w: corner.charAt(1) == 'L' ? (view.l + view.w) - pos.x : pos.x - view.l,
+ h: corner.charAt(1) == 'T' ? (view.t + view.h) - pos.y : pos.y - view.t
+ };
+
+ // configure node to be displayed in given position relative to button
+ // (need to do this in order to get an accurate size for the node, because
+ // a tooltip's size changes based on position, due to triangle)
+ if(layoutNode){
+ var res = layoutNode(node, choice.aroundCorner, corner, spaceAvailable, aroundNodeCoords);
+ overflow = typeof res == "undefined" ? 0 : res;
+ }
+
+ // get node's size
+ var style = node.style;
+ var oldDisplay = style.display;
+ var oldVis = style.visibility;
+ style.visibility = "hidden";
+ style.display = "";
+ var mb = dojo.marginBox(node);
+ style.display = oldDisplay;
+ style.visibility = oldVis;
+
+ // coordinates and size of node with specified corner placed at pos,
+ // and clipped by viewport
+ var startX = Math.max(view.l, corner.charAt(1) == 'L' ? pos.x : (pos.x - mb.w)),
+ startY = Math.max(view.t, corner.charAt(0) == 'T' ? pos.y : (pos.y - mb.h)),
+ endX = Math.min(view.l + view.w, corner.charAt(1) == 'L' ? (startX + mb.w) : pos.x),
+ endY = Math.min(view.t + view.h, corner.charAt(0) == 'T' ? (startY + mb.h) : pos.y),
+ width = endX - startX,
+ height = endY - startY;
+
+ overflow += (mb.w - width) + (mb.h - height);
+
+ if(best == null || overflow < best.overflow){
+ best = {
+ corner: corner,
+ aroundCorner: choice.aroundCorner,
+ x: startX,
+ y: startY,
+ w: width,
+ h: height,
+ overflow: overflow,
+ spaceAvailable: spaceAvailable
+ };
+ }
+
+ return !overflow;
+ });
+
+ // In case the best position is not the last one we checked, need to call
+ // layoutNode() again.
+ if(best.overflow && layoutNode){
+ layoutNode(node, best.aroundCorner, best.corner, best.spaceAvailable, aroundNodeCoords);
+ }
+
+ // And then position the node. Do this last, after the layoutNode() above
+ // has sized the node, due to browser quirks when the viewport is scrolled
+ // (specifically that a Tooltip will shrink to fit as though the window was
+ // scrolled to the left).
+ //
+ // In RTL mode, set style.right rather than style.left so in the common case,
+ // window resizes move the popup along with the aroundNode.
+ var l = dojo._isBodyLtr(),
+ s = node.style;
+ s.top = best.y + "px";
+ s[l ? "left" : "right"] = (l ? best.x : view.w - best.x - best.w) + "px";
+
+ return best;
+}
+
+dijit.placeOnScreenAroundNode = function(
+ /* DomNode */ node,
+ /* DomNode */ aroundNode,
+ /* Object */ aroundCorners,
+ /* Function? */ layoutNode){
+
+ // summary:
+ // Position node adjacent or kitty-corner to aroundNode
+ // such that it's fully visible in viewport.
+ //
+ // description:
+ // Place node such that corner of node touches a corner of
+ // aroundNode, and that node is fully visible.
+ //
+ // aroundCorners:
+ // Ordered list of pairs of corners to try matching up.
+ // Each pair of corners is represented as a key/value in the hash,
+ // where the key corresponds to the aroundNode's corner, and
+ // the value corresponds to the node's corner:
+ //
+ // | { aroundNodeCorner1: nodeCorner1, aroundNodeCorner2: nodeCorner2, ...}
+ //
+ // The following strings are used to represent the four corners:
+ // * "BL" - bottom left
+ // * "BR" - bottom right
+ // * "TL" - top left
+ // * "TR" - top right
+ //
+ // layoutNode: Function(node, aroundNodeCorner, nodeCorner)
+ // For things like tooltip, they are displayed differently (and have different dimensions)
+ // based on their orientation relative to the parent. This adjusts the popup based on orientation.
+ //
+ // example:
+ // | dijit.placeOnScreenAroundNode(node, aroundNode, {'BL':'TL', 'TR':'BR'});
+ // This will try to position node such that node's top-left corner is at the same position
+ // as the bottom left corner of the aroundNode (ie, put node below
+ // aroundNode, with left edges aligned). If that fails it will try to put
+ // the bottom-right corner of node where the top right corner of aroundNode is
+ // (ie, put node above aroundNode, with right edges aligned)
+ //
+
+ // get coordinates of aroundNode
+ aroundNode = dojo.byId(aroundNode);
+ var aroundNodePos = dojo.position(aroundNode, true);
+
+ // place the node around the calculated rectangle
+ return dijit._placeOnScreenAroundRect(node,
+ aroundNodePos.x, aroundNodePos.y, aroundNodePos.w, aroundNodePos.h, // rectangle
+ aroundCorners, layoutNode);
+};
+
+/*=====
+dijit.__Rectangle = function(){
+ // x: Integer
+ // horizontal offset in pixels, relative to document body
+ // y: Integer
+ // vertical offset in pixels, relative to document body
+ // width: Integer
+ // width in pixels
+ // height: Integer
+ // height in pixels
+
+ this.x = x;
+ this.y = y;
+ this.width = width;
+ this.height = height;
+}
+=====*/
+
+
+dijit.placeOnScreenAroundRectangle = function(
+ /* DomNode */ node,
+ /* dijit.__Rectangle */ aroundRect,
+ /* Object */ aroundCorners,
+ /* Function */ layoutNode){
+
+ // summary:
+ // Like dijit.placeOnScreenAroundNode(), except that the "around"
+ // parameter is an arbitrary rectangle on the screen (x, y, width, height)
+ // instead of a dom node.
+
+ return dijit._placeOnScreenAroundRect(node,
+ aroundRect.x, aroundRect.y, aroundRect.width, aroundRect.height, // rectangle
+ aroundCorners, layoutNode);
+};
+
+dijit._placeOnScreenAroundRect = function(
+ /* DomNode */ node,
+ /* Number */ x,
+ /* Number */ y,
+ /* Number */ width,
+ /* Number */ height,
+ /* Object */ aroundCorners,
+ /* Function */ layoutNode){
+
+ // summary:
+ // Like dijit.placeOnScreenAroundNode(), except it accepts coordinates
+ // of a rectangle to place node adjacent to.
+
+ // TODO: combine with placeOnScreenAroundRectangle()
+
+ // Generate list of possible positions for node
+ var choices = [];
+ for(var nodeCorner in aroundCorners){
+ choices.push( {
+ aroundCorner: nodeCorner,
+ corner: aroundCorners[nodeCorner],
+ pos: {
+ x: x + (nodeCorner.charAt(1) == 'L' ? 0 : width),
+ y: y + (nodeCorner.charAt(0) == 'T' ? 0 : height)
+ }
+ });
+ }
+
+ return dijit._place(node, choices, layoutNode, {w: width, h: height});
+};
+
+dijit.placementRegistry= new dojo.AdapterRegistry();
+dijit.placementRegistry.register("node",
+ function(n, x){
+ return typeof x == "object" &&
+ typeof x.offsetWidth != "undefined" && typeof x.offsetHeight != "undefined";
+ },
+ dijit.placeOnScreenAroundNode);
+dijit.placementRegistry.register("rect",
+ function(n, x){
+ return typeof x == "object" &&
+ "x" in x && "y" in x && "width" in x && "height" in x;
+ },
+ dijit.placeOnScreenAroundRectangle);
+
+dijit.placeOnScreenAroundElement = function(
+ /* DomNode */ node,
+ /* Object */ aroundElement,
+ /* Object */ aroundCorners,
+ /* Function */ layoutNode){
+
+ // summary:
+ // Like dijit.placeOnScreenAroundNode(), except it accepts an arbitrary object
+ // for the "around" argument and finds a proper processor to place a node.
+
+ return dijit.placementRegistry.match.apply(dijit.placementRegistry, arguments);
+};
+
+dijit.getPopupAroundAlignment = function(/*Array*/ position, /*Boolean*/ leftToRight){
+ // summary:
+ // Transforms the passed array of preferred positions into a format suitable for passing as the aroundCorners argument to dijit.placeOnScreenAroundElement.
+ //
+ // position: String[]
+ // This variable controls the position of the drop down.
+ // It's an array of strings with the following values:
+ //
+ // * before: places drop down to the left of the target node/widget, or to the right in
+ // the case of RTL scripts like Hebrew and Arabic
+ // * after: places drop down to the right of the target node/widget, or to the left in
+ // the case of RTL scripts like Hebrew and Arabic
+ // * above: drop down goes above target node
+ // * below: drop down goes below target node
+ //
+ // The list is positions is tried, in order, until a position is found where the drop down fits
+ // within the viewport.
+ //
+ // leftToRight: Boolean
+ // Whether the popup will be displaying in leftToRight mode.
+ //
+ var align = {};
+ dojo.forEach(position, function(pos){
+ switch(pos){
+ case "after":
+ align[leftToRight ? "BR" : "BL"] = leftToRight ? "BL" : "BR";
+ break;
+ case "before":
+ align[leftToRight ? "BL" : "BR"] = leftToRight ? "BR" : "BL";
+ break;
+ case "below-alt":
+ leftToRight = !leftToRight;
+ // fall through
+ case "below":
+ // first try to align left borders, next try to align right borders (or reverse for RTL mode)
+ align[leftToRight ? "BL" : "BR"] = leftToRight ? "TL" : "TR";
+ align[leftToRight ? "BR" : "BL"] = leftToRight ? "TR" : "TL";
+ break;
+ case "above-alt":
+ leftToRight = !leftToRight;
+ // fall through
+ case "above":
+ default:
+ // first try to align left borders, next try to align right borders (or reverse for RTL mode)
+ align[leftToRight ? "TL" : "TR"] = leftToRight ? "BL" : "BR";
+ align[leftToRight ? "TR" : "TL"] = leftToRight ? "BR" : "BL";
+ break;
+ }
+ });
+ return align;
+};
+
+}
+
+if(!dojo._hasResource["dijit._base.window"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dijit._base.window"] = true;
+dojo.provide("dijit._base.window");
+
+
+
+
+dijit.getDocumentWindow = function(doc){
+ return dojo.window.get(doc);
+};
+
+}
+
+if(!dojo._hasResource["dijit._base.popup"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dijit._base.popup"] = true;
+dojo.provide("dijit._base.popup");
+
+
+
+
+
+
+/*=====
+dijit.popup.__OpenArgs = function(){
+ // popup: Widget
+ // widget to display
+ // parent: Widget
+ // the button etc. that is displaying this popup
+ // around: DomNode
+ // DOM node (typically a button); place popup relative to this node. (Specify this *or* "x" and "y" parameters.)
+ // x: Integer
+ // Absolute horizontal position (in pixels) to place node at. (Specify this *or* "around" parameter.)
+ // y: Integer
+ // Absolute vertical position (in pixels) to place node at. (Specify this *or* "around" parameter.)
+ // orient: Object|String
+ // When the around parameter is specified, orient should be an
+ // ordered list of tuples of the form (around-node-corner, popup-node-corner).
+ // dijit.popup.open() tries to position the popup according to each tuple in the list, in order,
+ // until the popup appears fully within the viewport.
+ //
+ // The default value is {BL:'TL', TL:'BL'}, which represents a list of two tuples:
+ // 1. (BL, TL)
+ // 2. (TL, BL)
+ // where BL means "bottom left" and "TL" means "top left".
+ // So by default, it first tries putting the popup below the around node, left-aligning them,
+ // and then tries to put it above the around node, still left-aligning them. Note that the
+ // default is horizontally reversed when in RTL mode.
+ //
+ // When an (x,y) position is specified rather than an around node, orient is either
+ // "R" or "L". R (for right) means that it tries to put the popup to the right of the mouse,
+ // specifically positioning the popup's top-right corner at the mouse position, and if that doesn't
+ // fit in the viewport, then it tries, in order, the bottom-right corner, the top left corner,
+ // and the top-right corner.
+ // onCancel: Function
+ // callback when user has canceled the popup by
+ // 1. hitting ESC or
+ // 2. by using the popup widget's proprietary cancel mechanism (like a cancel button in a dialog);
+ // i.e. whenever popupWidget.onCancel() is called, args.onCancel is called
+ // onClose: Function
+ // callback whenever this popup is closed
+ // onExecute: Function
+ // callback when user "executed" on the popup/sub-popup by selecting a menu choice, etc. (top menu only)
+ // padding: dijit.__Position
+ // adding a buffer around the opening position. This is only useful when around is not set.
+ this.popup = popup;
+ this.parent = parent;
+ this.around = around;
+ this.x = x;
+ this.y = y;
+ this.orient = orient;
+ this.onCancel = onCancel;
+ this.onClose = onClose;
+ this.onExecute = onExecute;
+ this.padding = padding;
+}
+=====*/
+
+dijit.popup = {
+ // summary:
+ // This singleton is used to show/hide widgets as popups.
+
+ // _stack: dijit._Widget[]
+ // Stack of currently popped up widgets.
+ // (someone opened _stack[0], and then it opened _stack[1], etc.)
+ _stack: [],
+
+ // _beginZIndex: Number
+ // Z-index of the first popup. (If first popup opens other
+ // popups they get a higher z-index.)
+ _beginZIndex: 1000,
+
+ _idGen: 1,
+
+ _createWrapper: function(/*Widget || DomNode*/ widget){
+ // summary:
+ // Initialization for widgets that will be used as popups.
+ // Puts widget inside a wrapper DIV (if not already in one),
+ // and returns pointer to that wrapper DIV.
+
+ var wrapper = widget.declaredClass ? widget._popupWrapper : (dojo.hasClass(widget.parentNode, "dijitPopup") && widget.parentNode),
+ node = widget.domNode || widget;
+
+ if(!wrapper){
+ // Create wrapper <div> for when this widget [in the future] will be used as a popup.
+ // This is done early because of IE bugs where creating/moving DOM nodes causes focus
+ // to go wonky, see tests/robot/Toolbar.html to reproduce
+ wrapper = dojo.create("div",{
+ "class":"dijitPopup",
+ style:{ display: "none"},
+ role: "presentation"
+ }, dojo.body());
+ wrapper.appendChild(node);
+
+ var s = node.style;
+ s.display = "";
+ s.visibility = "";
+ s.position = "";
+ s.top = "0px";
+
+ if(widget.declaredClass){ // TODO: in 2.0 change signature to always take widget, then remove if()
+ widget._popupWrapper = wrapper;
+ dojo.connect(widget, "destroy", function(){
+ dojo.destroy(wrapper);
+ delete widget._popupWrapper;
+ });
+ }
+ }
+
+ return wrapper;
+ },
+
+ moveOffScreen: function(/*Widget || DomNode*/ widget){
+ // summary:
+ // Moves the popup widget off-screen.
+ // Do not use this method to hide popups when not in use, because
+ // that will create an accessibility issue: the offscreen popup is
+ // still in the tabbing order.
+
+ // Create wrapper if not already there
+ var wrapper = this._createWrapper(widget);
+
+ dojo.style(wrapper, {
+ visibility: "hidden",
+ top: "-9999px", // prevent transient scrollbar causing misalign (#5776), and initial flash in upper left (#10111)
+ display: ""
+ });
+ },
+
+ hide: function(/*dijit._Widget*/ widget){
+ // summary:
+ // Hide this popup widget (until it is ready to be shown).
+ // Initialization for widgets that will be used as popups
+ //
+ // Also puts widget inside a wrapper DIV (if not already in one)
+ //
+ // If popup widget needs to layout it should
+ // do so when it is made visible, and popup._onShow() is called.
+
+ // Create wrapper if not already there
+ var wrapper = this._createWrapper(widget);
+
+ dojo.style(wrapper, "display", "none");
+ },
+
+ getTopPopup: function(){
+ // summary:
+ // Compute the closest ancestor popup that's *not* a child of another popup.
+ // Ex: For a TooltipDialog with a button that spawns a tree of menus, find the popup of the button.
+ var stack = this._stack;
+ for(var pi=stack.length-1; pi > 0 && stack[pi].parent === stack[pi-1].widget; pi--){
+ /* do nothing, just trying to get right value for pi */
+ }
+ return stack[pi];
+ },
+
+ open: function(/*dijit.popup.__OpenArgs*/ args){
+ // summary:
+ // Popup the widget at the specified position
+ //
+ // example:
+ // opening at the mouse position
+ // | dijit.popup.open({popup: menuWidget, x: evt.pageX, y: evt.pageY});
+ //
+ // example:
+ // opening the widget as a dropdown
+ // | dijit.popup.open({parent: this, popup: menuWidget, around: this.domNode, onClose: function(){...}});
+ //
+ // Note that whatever widget called dijit.popup.open() should also listen to its own _onBlur callback
+ // (fired from _base/focus.js) to know that focus has moved somewhere else and thus the popup should be closed.
+
+ var stack = this._stack,
+ widget = args.popup,
+ orient = args.orient || (
+ (args.parent ? args.parent.isLeftToRight() : dojo._isBodyLtr()) ?
+ {'BL':'TL', 'BR':'TR', 'TL':'BL', 'TR':'BR'} :
+ {'BR':'TR', 'BL':'TL', 'TR':'BR', 'TL':'BL'}
+ ),
+ around = args.around,
+ id = (args.around && args.around.id) ? (args.around.id+"_dropdown") : ("popup_"+this._idGen++);
+
+ // If we are opening a new popup that isn't a child of a currently opened popup, then
+ // close currently opened popup(s). This should happen automatically when the old popups
+ // gets the _onBlur() event, except that the _onBlur() event isn't reliable on IE, see [22198].
+ while(stack.length && (!args.parent || !dojo.isDescendant(args.parent.domNode, stack[stack.length-1].widget.domNode))){
+ dijit.popup.close(stack[stack.length-1].widget);
+ }
+
+ // Get pointer to popup wrapper, and create wrapper if it doesn't exist
+ var wrapper = this._createWrapper(widget);
+
+
+ dojo.attr(wrapper, {
+ id: id,
+ style: {
+ zIndex: this._beginZIndex + stack.length
+ },
+ "class": "dijitPopup " + (widget.baseClass || widget["class"] || "").split(" ")[0] +"Popup",
+ dijitPopupParent: args.parent ? args.parent.id : ""
+ });
+
+ if(dojo.isIE || dojo.isMoz){
+ if(!widget.bgIframe){
+ // setting widget.bgIframe triggers cleanup in _Widget.destroy()
+ widget.bgIframe = new dijit.BackgroundIframe(wrapper);
+ }
+ }
+
+ // position the wrapper node and make it visible
+ var best = around ?
+ dijit.placeOnScreenAroundElement(wrapper, around, orient, widget.orient ? dojo.hitch(widget, "orient") : null) :
+ dijit.placeOnScreen(wrapper, args, orient == 'R' ? ['TR','BR','TL','BL'] : ['TL','BL','TR','BR'], args.padding);
+
+ wrapper.style.display = "";
+ wrapper.style.visibility = "visible";
+ widget.domNode.style.visibility = "visible"; // counteract effects from _HasDropDown
+
+ var handlers = [];
+
+ // provide default escape and tab key handling
+ // (this will work for any widget, not just menu)
+ handlers.push(dojo.connect(wrapper, "onkeypress", this, function(evt){
+ if(evt.charOrCode == dojo.keys.ESCAPE && args.onCancel){
+ dojo.stopEvent(evt);
+ args.onCancel();
+ }else if(evt.charOrCode === dojo.keys.TAB){
+ dojo.stopEvent(evt);
+ var topPopup = this.getTopPopup();
+ if(topPopup && topPopup.onCancel){
+ topPopup.onCancel();
+ }
+ }
+ }));
+
+ // watch for cancel/execute events on the popup and notify the caller
+ // (for a menu, "execute" means clicking an item)
+ if(widget.onCancel){
+ handlers.push(dojo.connect(widget, "onCancel", args.onCancel));
+ }
+
+ handlers.push(dojo.connect(widget, widget.onExecute ? "onExecute" : "onChange", this, function(){
+ var topPopup = this.getTopPopup();
+ if(topPopup && topPopup.onExecute){
+ topPopup.onExecute();
+ }
+ }));
+
+ stack.push({
+ widget: widget,
+ parent: args.parent,
+ onExecute: args.onExecute,
+ onCancel: args.onCancel,
+ onClose: args.onClose,
+ handlers: handlers
+ });
+
+ if(widget.onOpen){
+ // TODO: in 2.0 standardize onShow() (used by StackContainer) and onOpen() (used here)
+ widget.onOpen(best);
+ }
+
+ return best;
+ },
+
+ close: function(/*dijit._Widget?*/ popup){
+ // summary:
+ // Close specified popup and any popups that it parented.
+ // If no popup is specified, closes all popups.
+
+ var stack = this._stack;
+
+ // Basically work backwards from the top of the stack closing popups
+ // until we hit the specified popup, but IIRC there was some issue where closing
+ // a popup would cause others to close too. Thus if we are trying to close B in [A,B,C]
+ // closing C might close B indirectly and then the while() condition will run where stack==[A]...
+ // so the while condition is constructed defensively.
+ while((popup && dojo.some(stack, function(elem){return elem.widget == popup;})) ||
+ (!popup && stack.length)){
+ var top = stack.pop(),
+ widget = top.widget,
+ onClose = top.onClose;
+
+ if(widget.onClose){
+ // TODO: in 2.0 standardize onHide() (used by StackContainer) and onClose() (used here)
+ widget.onClose();
+ }
+ dojo.forEach(top.handlers, dojo.disconnect);
+
+ // Hide the widget and it's wrapper unless it has already been destroyed in above onClose() etc.
+ if(widget && widget.domNode){
+ this.hide(widget);
+ }
+
+ if(onClose){
+ onClose();
+ }
+ }
+ }
+};
+
+// TODO: remove dijit._frames, it isn't being used much, since popups never release their
+// iframes (see [22236])
+dijit._frames = new function(){
+ // summary:
+ // cache of iframes
+
+ var queue = [];
+
+ this.pop = function(){
+ var iframe;
+ if(queue.length){
+ iframe = queue.pop();
+ iframe.style.display="";
+ }else{
+ if(dojo.isIE < 9){
+ var burl = dojo.config["dojoBlankHtmlUrl"] || (dojo.moduleUrl("dojo", "resources/blank.html")+"") || "javascript:\"\"";
+ var html="<iframe src='" + burl + "'"
+ + " style='position: absolute; left: 0px; top: 0px;"
+ + "z-index: -1; filter:Alpha(Opacity=\"0\");'>";
+ iframe = dojo.doc.createElement(html);
+ }else{
+ iframe = dojo.create("iframe");
+ iframe.src = 'javascript:""';
+ iframe.className = "dijitBackgroundIframe";
+ dojo.style(iframe, "opacity", 0.1);
+ }
+ iframe.tabIndex = -1; // Magic to prevent iframe from getting focus on tab keypress - as style didn't work.
+ dijit.setWaiRole(iframe,"presentation");
+ }
+ return iframe;
+ };
+
+ this.push = function(iframe){
+ iframe.style.display="none";
+ queue.push(iframe);
+ }
+}();
+
+
+dijit.BackgroundIframe = function(/*DomNode*/ node){
+ // summary:
+ // For IE/FF z-index schenanigans. id attribute is required.
+ //
+ // description:
+ // new dijit.BackgroundIframe(node)
+ // Makes a background iframe as a child of node, that fills
+ // area (and position) of node
+
+ if(!node.id){ throw new Error("no id"); }
+ if(dojo.isIE || dojo.isMoz){
+ var iframe = (this.iframe = dijit._frames.pop());
+ node.appendChild(iframe);
+ if(dojo.isIE<7 || dojo.isQuirks){
+ this.resize(node);
+ this._conn = dojo.connect(node, 'onresize', this, function(){
+ this.resize(node);
+ });
+ }else{
+ dojo.style(iframe, {
+ width: '100%',
+ height: '100%'
+ });
+ }
+ }
+};
+
+dojo.extend(dijit.BackgroundIframe, {
+ resize: function(node){
+ // summary:
+ // Resize the iframe so it's the same size as node.
+ // Needed on IE6 and IE/quirks because height:100% doesn't work right.
+ if(this.iframe){
+ dojo.style(this.iframe, {
+ width: node.offsetWidth + 'px',
+ height: node.offsetHeight + 'px'
+ });
+ }
+ },
+ destroy: function(){
+ // summary:
+ // destroy the iframe
+ if(this._conn){
+ dojo.disconnect(this._conn);
+ this._conn = null;
+ }
+ if(this.iframe){
+ dijit._frames.push(this.iframe);
+ delete this.iframe;
+ }
+ }
+});
+
+}
+
+if(!dojo._hasResource["dijit._base.scroll"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dijit._base.scroll"] = true;
+dojo.provide("dijit._base.scroll");
+
+
+
+
+dijit.scrollIntoView = function(/*DomNode*/ node, /*Object?*/ pos){
+ // summary:
+ // Scroll the passed node into view, if it is not already.
+ // Deprecated, use `dojo.window.scrollIntoView` instead.
+
+ dojo.window.scrollIntoView(node, pos);
+};
+
+}
+
+if(!dojo._hasResource["dojo.uacss"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojo.uacss"] = true;
+dojo.provide("dojo.uacss");
+
+
+
+(function(){
+ // summary:
+ // Applies pre-set CSS classes to the top-level HTML node, based on:
+ // - browser (ex: dj_ie)
+ // - browser version (ex: dj_ie6)
+ // - box model (ex: dj_contentBox)
+ // - text direction (ex: dijitRtl)
+ //
+ // In addition, browser, browser version, and box model are
+ // combined with an RTL flag when browser text is RTL. ex: dj_ie-rtl.
+
+ var d = dojo,
+ html = d.doc.documentElement,
+ ie = d.isIE,
+ opera = d.isOpera,
+ maj = Math.floor,
+ ff = d.isFF,
+ boxModel = d.boxModel.replace(/-/,''),
+
+ classes = {
+ dj_ie: ie,
+ dj_ie6: maj(ie) == 6,
+ dj_ie7: maj(ie) == 7,
+ dj_ie8: maj(ie) == 8,
+ dj_ie9: maj(ie) == 9,
+ dj_quirks: d.isQuirks,
+ dj_iequirks: ie && d.isQuirks,
+
+ // NOTE: Opera not supported by dijit
+ dj_opera: opera,
+
+ dj_khtml: d.isKhtml,
+
+ dj_webkit: d.isWebKit,
+ dj_safari: d.isSafari,
+ dj_chrome: d.isChrome,
+
+ dj_gecko: d.isMozilla,
+ dj_ff3: maj(ff) == 3
+ }; // no dojo unsupported browsers
+
+ classes["dj_" + boxModel] = true;
+
+ // apply browser, browser version, and box model class names
+ var classStr = "";
+ for(var clz in classes){
+ if(classes[clz]){
+ classStr += clz + " ";
+ }
+ }
+ html.className = d.trim(html.className + " " + classStr);
+
+ // If RTL mode, then add dj_rtl flag plus repeat existing classes with -rtl extension.
+ // We can't run the code below until the <body> tag has loaded (so we can check for dir=rtl).
+ // Unshift() is to run sniff code before the parser.
+ dojo._loaders.unshift(function(){
+ if(!dojo._isBodyLtr()){
+ var rtlClassStr = "dj_rtl dijitRtl " + classStr.replace(/ /g, "-rtl ")
+ html.className = d.trim(html.className + " " + rtlClassStr);
+ }
+ });
+})();
+
+}
+
+if(!dojo._hasResource["dijit._base.sniff"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dijit._base.sniff"] = true;
+dojo.provide("dijit._base.sniff");
+
+
+
+
+// summary:
+// Applies pre-set CSS classes to the top-level HTML node, see
+// `dojo.uacss` for details.
+//
+// Simply doing a require on this module will
+// establish this CSS. Modified version of Morris' CSS hack.
+
+}
+
+if(!dojo._hasResource["dijit._base.typematic"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dijit._base.typematic"] = true;
+dojo.provide("dijit._base.typematic");
+
+
+
+dijit.typematic = {
+ // summary:
+ // These functions are used to repetitively call a user specified callback
+ // method when a specific key or mouse click over a specific DOM node is
+ // held down for a specific amount of time.
+ // Only 1 such event is allowed to occur on the browser page at 1 time.
+
+ _fireEventAndReload: function(){
+ this._timer = null;
+ this._callback(++this._count, this._node, this._evt);
+
+ // Schedule next event, timer is at most minDelay (default 10ms) to avoid
+ // browser overload (particularly avoiding starving DOH robot so it never gets to send a mouseup)
+ this._currentTimeout = Math.max(
+ this._currentTimeout < 0 ? this._initialDelay :
+ (this._subsequentDelay > 1 ? this._subsequentDelay : Math.round(this._currentTimeout * this._subsequentDelay)),
+ this._minDelay);
+ this._timer = setTimeout(dojo.hitch(this, "_fireEventAndReload"), this._currentTimeout);
+ },
+
+ trigger: function(/*Event*/ evt, /*Object*/ _this, /*DOMNode*/ node, /*Function*/ callback, /*Object*/ obj, /*Number*/ subsequentDelay, /*Number*/ initialDelay, /*Number?*/ minDelay){
+ // summary:
+ // Start a timed, repeating callback sequence.
+ // If already started, the function call is ignored.
+ // This method is not normally called by the user but can be
+ // when the normal listener code is insufficient.
+ // evt:
+ // key or mouse event object to pass to the user callback
+ // _this:
+ // pointer to the user's widget space.
+ // node:
+ // the DOM node object to pass the the callback function
+ // callback:
+ // function to call until the sequence is stopped called with 3 parameters:
+ // count:
+ // integer representing number of repeated calls (0..n) with -1 indicating the iteration has stopped
+ // node:
+ // the DOM node object passed in
+ // evt:
+ // key or mouse event object
+ // obj:
+ // user space object used to uniquely identify each typematic sequence
+ // subsequentDelay (optional):
+ // if > 1, the number of milliseconds until the 3->n events occur
+ // or else the fractional time multiplier for the next event's delay, default=0.9
+ // initialDelay (optional):
+ // the number of milliseconds until the 2nd event occurs, default=500ms
+ // minDelay (optional):
+ // the maximum delay in milliseconds for event to fire, default=10ms
+ if(obj != this._obj){
+ this.stop();
+ this._initialDelay = initialDelay || 500;
+ this._subsequentDelay = subsequentDelay || 0.90;
+ this._minDelay = minDelay || 10;
+ this._obj = obj;
+ this._evt = evt;
+ this._node = node;
+ this._currentTimeout = -1;
+ this._count = -1;
+ this._callback = dojo.hitch(_this, callback);
+ this._fireEventAndReload();
+ this._evt = dojo.mixin({faux: true}, evt);
+ }
+ },
+
+ stop: function(){
+ // summary:
+ // Stop an ongoing timed, repeating callback sequence.
+ if(this._timer){
+ clearTimeout(this._timer);
+ this._timer = null;
+ }
+ if(this._obj){
+ this._callback(-1, this._node, this._evt);
+ this._obj = null;
+ }
+ },
+
+ addKeyListener: function(/*DOMNode*/ node, /*Object*/ keyObject, /*Object*/ _this, /*Function*/ callback, /*Number*/ subsequentDelay, /*Number*/ initialDelay, /*Number?*/ minDelay){
+ // summary:
+ // Start listening for a specific typematic key.
+ // See also the trigger method for other parameters.
+ // keyObject:
+ // an object defining the key to listen for:
+ // charOrCode:
+ // the printable character (string) or keyCode (number) to listen for.
+ // keyCode:
+ // (deprecated - use charOrCode) the keyCode (number) to listen for (implies charCode = 0).
+ // charCode:
+ // (deprecated - use charOrCode) the charCode (number) to listen for.
+ // ctrlKey:
+ // desired ctrl key state to initiate the callback sequence:
+ // - pressed (true)
+ // - released (false)
+ // - either (unspecified)
+ // altKey:
+ // same as ctrlKey but for the alt key
+ // shiftKey:
+ // same as ctrlKey but for the shift key
+ // returns:
+ // an array of dojo.connect handles
+ if(keyObject.keyCode){
+ keyObject.charOrCode = keyObject.keyCode;
+ dojo.deprecated("keyCode attribute parameter for dijit.typematic.addKeyListener is deprecated. Use charOrCode instead.", "", "2.0");
+ }else if(keyObject.charCode){
+ keyObject.charOrCode = String.fromCharCode(keyObject.charCode);
+ dojo.deprecated("charCode attribute parameter for dijit.typematic.addKeyListener is deprecated. Use charOrCode instead.", "", "2.0");
+ }
+ return [
+ dojo.connect(node, "onkeypress", this, function(evt){
+ if(evt.charOrCode == keyObject.charOrCode &&
+ (keyObject.ctrlKey === undefined || keyObject.ctrlKey == evt.ctrlKey) &&
+ (keyObject.altKey === undefined || keyObject.altKey == evt.altKey) &&
+ (keyObject.metaKey === undefined || keyObject.metaKey == (evt.metaKey || false)) && // IE doesn't even set metaKey
+ (keyObject.shiftKey === undefined || keyObject.shiftKey == evt.shiftKey)){
+ dojo.stopEvent(evt);
+ dijit.typematic.trigger(evt, _this, node, callback, keyObject, subsequentDelay, initialDelay, minDelay);
+ }else if(dijit.typematic._obj == keyObject){
+ dijit.typematic.stop();
+ }
+ }),
+ dojo.connect(node, "onkeyup", this, function(evt){
+ if(dijit.typematic._obj == keyObject){
+ dijit.typematic.stop();
+ }
+ })
+ ];
+ },
+
+ addMouseListener: function(/*DOMNode*/ node, /*Object*/ _this, /*Function*/ callback, /*Number*/ subsequentDelay, /*Number*/ initialDelay, /*Number?*/ minDelay){
+ // summary:
+ // Start listening for a typematic mouse click.
+ // See the trigger method for other parameters.
+ // returns:
+ // an array of dojo.connect handles
+ var dc = dojo.connect;
+ return [
+ dc(node, "mousedown", this, function(evt){
+ dojo.stopEvent(evt);
+ dijit.typematic.trigger(evt, _this, node, callback, node, subsequentDelay, initialDelay, minDelay);
+ }),
+ dc(node, "mouseup", this, function(evt){
+ dojo.stopEvent(evt);
+ dijit.typematic.stop();
+ }),
+ dc(node, "mouseout", this, function(evt){
+ dojo.stopEvent(evt);
+ dijit.typematic.stop();
+ }),
+ dc(node, "mousemove", this, function(evt){
+ evt.preventDefault();
+ }),
+ dc(node, "dblclick", this, function(evt){
+ dojo.stopEvent(evt);
+ if(dojo.isIE){
+ dijit.typematic.trigger(evt, _this, node, callback, node, subsequentDelay, initialDelay, minDelay);
+ setTimeout(dojo.hitch(this, dijit.typematic.stop), 50);
+ }
+ })
+ ];
+ },
+
+ addListener: function(/*Node*/ mouseNode, /*Node*/ keyNode, /*Object*/ keyObject, /*Object*/ _this, /*Function*/ callback, /*Number*/ subsequentDelay, /*Number*/ initialDelay, /*Number?*/ minDelay){
+ // summary:
+ // Start listening for a specific typematic key and mouseclick.
+ // This is a thin wrapper to addKeyListener and addMouseListener.
+ // See the addMouseListener and addKeyListener methods for other parameters.
+ // mouseNode:
+ // the DOM node object to listen on for mouse events.
+ // keyNode:
+ // the DOM node object to listen on for key events.
+ // returns:
+ // an array of dojo.connect handles
+ return this.addKeyListener(keyNode, keyObject, _this, callback, subsequentDelay, initialDelay, minDelay).concat(
+ this.addMouseListener(mouseNode, _this, callback, subsequentDelay, initialDelay, minDelay));
+ }
+};
+
+}
+
+if(!dojo._hasResource["dijit._base.wai"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dijit._base.wai"] = true;
+dojo.provide("dijit._base.wai");
+
+
+
+dijit.wai = {
+ onload: function(){
+ // summary:
+ // Detects if we are in high-contrast mode or not
+
+ // This must be a named function and not an anonymous
+ // function, so that the widget parsing code can make sure it
+ // registers its onload function after this function.
+ // DO NOT USE "this" within this function.
+
+ // create div for testing if high contrast mode is on or images are turned off
+ var div = dojo.create("div",{
+ id: "a11yTestNode",
+ style:{
+ cssText:'border: 1px solid;'
+ + 'border-color:red green;'
+ + 'position: absolute;'
+ + 'height: 5px;'
+ + 'top: -999px;'
+ + 'background-image: url("' + (dojo.config.blankGif || dojo.moduleUrl("dojo", "resources/blank.gif")) + '");'
+ }
+ }, dojo.body());
+
+ // test it
+ var cs = dojo.getComputedStyle(div);
+ if(cs){
+ var bkImg = cs.backgroundImage;
+ var needsA11y = (cs.borderTopColor == cs.borderRightColor) || (bkImg != null && (bkImg == "none" || bkImg == "url(invalid-url:)" ));
+ dojo[needsA11y ? "addClass" : "removeClass"](dojo.body(), "dijit_a11y");
+ if(dojo.isIE){
+ div.outerHTML = ""; // prevent mixed-content warning, see http://support.microsoft.com/kb/925014
+ }else{
+ dojo.body().removeChild(div);
+ }
+ }
+ }
+};
+
+// Test if computer is in high contrast mode.
+// Make sure the a11y test runs first, before widgets are instantiated.
+if(dojo.isIE || dojo.isMoz){ // NOTE: checking in Safari messes things up
+ dojo._loaders.unshift(dijit.wai.onload);
+}
+
+dojo.mixin(dijit, {
+ hasWaiRole: function(/*Element*/ elem, /*String?*/ role){
+ // summary:
+ // Determines if an element has a particular role.
+ // returns:
+ // True if elem has the specific role attribute and false if not.
+ // For backwards compatibility if role parameter not provided,
+ // returns true if has a role
+ var waiRole = this.getWaiRole(elem);
+ return role ? (waiRole.indexOf(role) > -1) : (waiRole.length > 0);
+ },
+
+ getWaiRole: function(/*Element*/ elem){
+ // summary:
+ // Gets the role for an element (which should be a wai role).
+ // returns:
+ // The role of elem or an empty string if elem
+ // does not have a role.
+ return dojo.trim((dojo.attr(elem, "role") || "").replace("wairole:",""));
+ },
+
+ setWaiRole: function(/*Element*/ elem, /*String*/ role){
+ // summary:
+ // Sets the role on an element.
+ // description:
+ // Replace existing role attribute with new role.
+
+ dojo.attr(elem, "role", role);
+ },
+
+ removeWaiRole: function(/*Element*/ elem, /*String*/ role){
+ // summary:
+ // Removes the specified role from an element.
+ // Removes role attribute if no specific role provided (for backwards compat.)
+
+ var roleValue = dojo.attr(elem, "role");
+ if(!roleValue){ return; }
+ if(role){
+ var t = dojo.trim((" " + roleValue + " ").replace(" " + role + " ", " "));
+ dojo.attr(elem, "role", t);
+ }else{
+ elem.removeAttribute("role");
+ }
+ },
+
+ hasWaiState: function(/*Element*/ elem, /*String*/ state){
+ // summary:
+ // Determines if an element has a given state.
+ // description:
+ // Checks for an attribute called "aria-"+state.
+ // returns:
+ // true if elem has a value for the given state and
+ // false if it does not.
+
+ return elem.hasAttribute ? elem.hasAttribute("aria-"+state) : !!elem.getAttribute("aria-"+state);
+ },
+
+ getWaiState: function(/*Element*/ elem, /*String*/ state){
+ // summary:
+ // Gets the value of a state on an element.
+ // description:
+ // Checks for an attribute called "aria-"+state.
+ // returns:
+ // The value of the requested state on elem
+ // or an empty string if elem has no value for state.
+
+ return elem.getAttribute("aria-"+state) || "";
+ },
+
+ setWaiState: function(/*Element*/ elem, /*String*/ state, /*String*/ value){
+ // summary:
+ // Sets a state on an element.
+ // description:
+ // Sets an attribute called "aria-"+state.
+
+ elem.setAttribute("aria-"+state, value);
+ },
+
+ removeWaiState: function(/*Element*/ elem, /*String*/ state){
+ // summary:
+ // Removes a state from an element.
+ // description:
+ // Sets an attribute called "aria-"+state.
+
+ elem.removeAttribute("aria-"+state);
+ }
+});
+
+}
+
+if(!dojo._hasResource["dijit._base"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dijit._base"] = true;
+dojo.provide("dijit._base");
+
+
+
+
+
+
+
+
+
+
+
+
+}
+
+if(!dojo._hasResource["dojo.date.stamp"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojo.date.stamp"] = true;
+dojo.provide("dojo.date.stamp");
+
+
+dojo.getObject("date.stamp", true, dojo);
+
+// Methods to convert dates to or from a wire (string) format using well-known conventions
+
+dojo.date.stamp.fromISOString = function(/*String*/formattedString, /*Number?*/defaultTime){
+ // summary:
+ // Returns a Date object given a string formatted according to a subset of the ISO-8601 standard.
+ //
+ // description:
+ // Accepts a string formatted according to a profile of ISO8601 as defined by
+ // [RFC3339](http://www.ietf.org/rfc/rfc3339.txt), except that partial input is allowed.
+ // Can also process dates as specified [by the W3C](http://www.w3.org/TR/NOTE-datetime)
+ // The following combinations are valid:
+ //
+ // * dates only
+ // | * yyyy
+ // | * yyyy-MM
+ // | * yyyy-MM-dd
+ // * times only, with an optional time zone appended
+ // | * THH:mm
+ // | * THH:mm:ss
+ // | * THH:mm:ss.SSS
+ // * and "datetimes" which could be any combination of the above
+ //
+ // timezones may be specified as Z (for UTC) or +/- followed by a time expression HH:mm
+ // Assumes the local time zone if not specified. Does not validate. Improperly formatted
+ // input may return null. Arguments which are out of bounds will be handled
+ // by the Date constructor (e.g. January 32nd typically gets resolved to February 1st)
+ // Only years between 100 and 9999 are supported.
+ //
+ // formattedString:
+ // A string such as 2005-06-30T08:05:00-07:00 or 2005-06-30 or T08:05:00
+ //
+ // defaultTime:
+ // Used for defaults for fields omitted in the formattedString.
+ // Uses 1970-01-01T00:00:00.0Z by default.
+
+ if(!dojo.date.stamp._isoRegExp){
+ dojo.date.stamp._isoRegExp =
+//TODO: could be more restrictive and check for 00-59, etc.
+ /^(?:(\d{4})(?:-(\d{2})(?:-(\d{2}))?)?)?(?:T(\d{2}):(\d{2})(?::(\d{2})(.\d+)?)?((?:[+-](\d{2}):(\d{2}))|Z)?)?$/;
+ }
+
+ var match = dojo.date.stamp._isoRegExp.exec(formattedString),
+ result = null;
+
+ if(match){
+ match.shift();
+ if(match[1]){match[1]--;} // Javascript Date months are 0-based
+ if(match[6]){match[6] *= 1000;} // Javascript Date expects fractional seconds as milliseconds
+
+ if(defaultTime){
+ // mix in defaultTime. Relatively expensive, so use || operators for the fast path of defaultTime === 0
+ defaultTime = new Date(defaultTime);
+ dojo.forEach(dojo.map(["FullYear", "Month", "Date", "Hours", "Minutes", "Seconds", "Milliseconds"], function(prop){
+ return defaultTime["get" + prop]();
+ }), function(value, index){
+ match[index] = match[index] || value;
+ });
+ }
+ result = new Date(match[0]||1970, match[1]||0, match[2]||1, match[3]||0, match[4]||0, match[5]||0, match[6]||0); //TODO: UTC defaults
+ if(match[0] < 100){
+ result.setFullYear(match[0] || 1970);
+ }
+
+ var offset = 0,
+ zoneSign = match[7] && match[7].charAt(0);
+ if(zoneSign != 'Z'){
+ offset = ((match[8] || 0) * 60) + (Number(match[9]) || 0);
+ if(zoneSign != '-'){ offset *= -1; }
+ }
+ if(zoneSign){
+ offset -= result.getTimezoneOffset();
+ }
+ if(offset){
+ result.setTime(result.getTime() + offset * 60000);
+ }
+ }
+
+ return result; // Date or null
+};
+
+/*=====
+ dojo.date.stamp.__Options = function(){
+ // selector: String
+ // "date" or "time" for partial formatting of the Date object.
+ // Both date and time will be formatted by default.
+ // zulu: Boolean
+ // if true, UTC/GMT is used for a timezone
+ // milliseconds: Boolean
+ // if true, output milliseconds
+ this.selector = selector;
+ this.zulu = zulu;
+ this.milliseconds = milliseconds;
+ }
+=====*/
+
+dojo.date.stamp.toISOString = function(/*Date*/dateObject, /*dojo.date.stamp.__Options?*/options){
+ // summary:
+ // Format a Date object as a string according a subset of the ISO-8601 standard
+ //
+ // description:
+ // When options.selector is omitted, output follows [RFC3339](http://www.ietf.org/rfc/rfc3339.txt)
+ // The local time zone is included as an offset from GMT, except when selector=='time' (time without a date)
+ // Does not check bounds. Only years between 100 and 9999 are supported.
+ //
+ // dateObject:
+ // A Date object
+
+ var _ = function(n){ return (n < 10) ? "0" + n : n; };
+ options = options || {};
+ var formattedDate = [],
+ getter = options.zulu ? "getUTC" : "get",
+ date = "";
+ if(options.selector != "time"){
+ var year = dateObject[getter+"FullYear"]();
+ date = ["0000".substr((year+"").length)+year, _(dateObject[getter+"Month"]()+1), _(dateObject[getter+"Date"]())].join('-');
+ }
+ formattedDate.push(date);
+ if(options.selector != "date"){
+ var time = [_(dateObject[getter+"Hours"]()), _(dateObject[getter+"Minutes"]()), _(dateObject[getter+"Seconds"]())].join(':');
+ var millis = dateObject[getter+"Milliseconds"]();
+ if(options.milliseconds){
+ time += "."+ (millis < 100 ? "0" : "") + _(millis);
+ }
+ if(options.zulu){
+ time += "Z";
+ }else if(options.selector != "time"){
+ var timezoneOffset = dateObject.getTimezoneOffset();
+ var absOffset = Math.abs(timezoneOffset);
+ time += (timezoneOffset > 0 ? "-" : "+") +
+ _(Math.floor(absOffset/60)) + ":" + _(absOffset%60);
+ }
+ formattedDate.push(time);
+ }
+ return formattedDate.join('T'); // String
+};
+
+}
+
+if(!dojo._hasResource["dojo.parser"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojo.parser"] = true;
+dojo.provide("dojo.parser");
+
+
+
+
+new Date("X"); // workaround for #11279, new Date("") == NaN
+
+dojo.parser = new function(){
+ // summary:
+ // The Dom/Widget parsing package
+
+ var d = dojo;
+
+ function val2type(/*Object*/ value){
+ // summary:
+ // Returns name of type of given value.
+
+ if(d.isString(value)){ return "string"; }
+ if(typeof value == "number"){ return "number"; }
+ if(typeof value == "boolean"){ return "boolean"; }
+ if(d.isFunction(value)){ return "function"; }
+ if(d.isArray(value)){ return "array"; } // typeof [] == "object"
+ if(value instanceof Date) { return "date"; } // assume timestamp
+ if(value instanceof d._Url){ return "url"; }
+ return "object";
+ }
+
+ function str2obj(/*String*/ value, /*String*/ type){
+ // summary:
+ // Convert given string value to given type
+ switch(type){
+ case "string":
+ return value;
+ case "number":
+ return value.length ? Number(value) : NaN;
+ case "boolean":
+ // for checked/disabled value might be "" or "checked". interpret as true.
+ return typeof value == "boolean" ? value : !(value.toLowerCase()=="false");
+ case "function":
+ if(d.isFunction(value)){
+ // IE gives us a function, even when we say something like onClick="foo"
+ // (in which case it gives us an invalid function "function(){ foo }").
+ // Therefore, convert to string
+ value=value.toString();
+ value=d.trim(value.substring(value.indexOf('{')+1, value.length-1));
+ }
+ try{
+ if(value === "" || value.search(/[^\w\.]+/i) != -1){
+ // The user has specified some text for a function like "return x+5"
+ return new Function(value);
+ }else{
+ // The user has specified the name of a function like "myOnClick"
+ // or a single word function "return"
+ return d.getObject(value, false) || new Function(value);
+ }
+ }catch(e){ return new Function(); }
+ case "array":
+ return value ? value.split(/\s*,\s*/) : [];
+ case "date":
+ switch(value){
+ case "": return new Date(""); // the NaN of dates
+ case "now": return new Date(); // current date
+ default: return d.date.stamp.fromISOString(value);
+ }
+ case "url":
+ return d.baseUrl + value;
+ default:
+ return d.fromJson(value);
+ }
+ }
+
+ var dummyClass = {}, instanceClasses = {
+ // map from fully qualified name (like "dijit.Button") to structure like
+ // { cls: dijit.Button, params: {label: "string", disabled: "boolean"} }
+ };
+
+ // Widgets like BorderContainer add properties to _Widget via dojo.extend().
+ // If BorderContainer is loaded after _Widget's parameter list has been cached,
+ // we need to refresh that parameter list (for _Widget and all widgets that extend _Widget).
+ // TODO: remove this in 2.0, when we stop caching parameters.
+ d.connect(d, "extend", function(){
+ instanceClasses = {};
+ });
+
+ function getProtoInfo(cls, params){
+ // cls: A prototype
+ // The prototype of the class to check props on
+ // params: Object
+ // The parameters object to mix found parameters onto.
+ for(var name in cls){
+ if(name.charAt(0)=="_"){ continue; } // skip internal properties
+ if(name in dummyClass){ continue; } // skip "constructor" and "toString"
+ params[name] = val2type(cls[name]);
+ }
+ return params;
+ }
+
+ function getClassInfo(/*String*/ className, /*Boolean*/ skipParamsLookup){
+ // summary:
+ // Maps a widget name string like "dijit.form.Button" to the widget constructor itself,
+ // and a list of that widget's parameters and their types
+ // className:
+ // fully qualified name (like "dijit.form.Button")
+ // returns:
+ // structure like
+ // {
+ // cls: dijit.Button,
+ // params: { label: "string", disabled: "boolean"}
+ // }
+
+ var c = instanceClasses[className];
+ if(!c){
+ // get pointer to widget class
+ var cls = d.getObject(className), params = null;
+ if(!cls){ return null; } // class not defined [yet]
+ if(!skipParamsLookup){ // from fastpath, we don't need to lookup the attrs on the proto because they are explicit
+ params = getProtoInfo(cls.prototype, {})
+ }
+ c = { cls: cls, params: params };
+
+ }else if(!skipParamsLookup && !c.params){
+ // if we're calling getClassInfo and have a cls proto, but no params info, scan that cls for params now
+ // and update the pointer in instanceClasses[className]. This happens when a widget appears in another
+ // widget's template which still uses dojoType, but an instance of the widget appears prior with a data-dojo-type,
+ // skipping this lookup the first time.
+ c.params = getProtoInfo(c.cls.prototype, {});
+ }
+
+ return c;
+ }
+
+ this._functionFromScript = function(script, attrData){
+ // summary:
+ // Convert a <script type="dojo/method" args="a, b, c"> ... </script>
+ // into a function
+ // script: DOMNode
+ // The <script> DOMNode
+ // attrData: String
+ // For HTML5 compliance, searches for attrData + "args" (typically
+ // "data-dojo-args") instead of "args"
+ var preamble = "";
+ var suffix = "";
+ var argsStr = (script.getAttribute(attrData + "args") || script.getAttribute("args"));
+ if(argsStr){
+ d.forEach(argsStr.split(/\s*,\s*/), function(part, idx){
+ preamble += "var "+part+" = arguments["+idx+"]; ";
+ });
+ }
+ var withStr = script.getAttribute("with");
+ if(withStr && withStr.length){
+ d.forEach(withStr.split(/\s*,\s*/), function(part){
+ preamble += "with("+part+"){";
+ suffix += "}";
+ });
+ }
+ return new Function(preamble+script.innerHTML+suffix);
+ };
+
+ this.instantiate = function(/* Array */nodes, /* Object? */mixin, /* Object? */args){
+ // summary:
+ // Takes array of nodes, and turns them into class instances and
+ // potentially calls a startup method to allow them to connect with
+ // any children.
+ // nodes: Array
+ // Array of nodes or objects like
+ // | {
+ // | type: "dijit.form.Button",
+ // | node: DOMNode,
+ // | scripts: [ ... ], // array of <script type="dojo/..."> children of node
+ // | inherited: { ... } // settings inherited from ancestors like dir, theme, etc.
+ // | }
+ // mixin: Object?
+ // An object that will be mixed in with each node in the array.
+ // Values in the mixin will override values in the node, if they
+ // exist.
+ // args: Object?
+ // An object used to hold kwArgs for instantiation.
+ // See parse.args argument for details.
+
+ var thelist = [],
+ mixin = mixin||{};
+ args = args||{};
+
+ // TODO: for 2.0 default to data-dojo- regardless of scopeName (or maybe scopeName won't exist in 2.0)
+ var attrName = (args.scope || d._scopeName) + "Type", // typically "dojoType"
+ attrData = "data-" + (args.scope || d._scopeName) + "-"; // typically "data-dojo-"
+
+ d.forEach(nodes, function(obj){
+ if(!obj){ return; }
+
+ // Get pointers to DOMNode, dojoType string, and clsInfo (metadata about the dojoType), etc.
+ var node, type, clsInfo, clazz, scripts, fastpath;
+ if(obj.node){
+ // new format of nodes[] array, object w/lots of properties pre-computed for me
+ node = obj.node;
+ type = obj.type;
+ fastpath = obj.fastpath;
+ clsInfo = obj.clsInfo || (type && getClassInfo(type, fastpath));
+ clazz = clsInfo && clsInfo.cls;
+ scripts = obj.scripts;
+ }else{
+ // old (backwards compatible) format of nodes[] array, simple array of DOMNodes. no fastpath/data-dojo-type support here.
+ node = obj;
+ type = attrName in mixin ? mixin[attrName] : node.getAttribute(attrName);
+ clsInfo = type && getClassInfo(type);
+ clazz = clsInfo && clsInfo.cls;
+ scripts = (clazz && (clazz._noScript || clazz.prototype._noScript) ? [] :
+ d.query("> script[type^='dojo/']", node));
+ }
+ if(!clsInfo){
+ throw new Error("Could not load class '" + type);
+ }
+
+ // Setup hash to hold parameter settings for this widget. Start with the parameter
+ // settings inherited from ancestors ("dir" and "lang").
+ // Inherited setting may later be overridden by explicit settings on node itself.
+ var params = {};
+
+ if(args.defaults){
+ // settings for the document itself (or whatever subtree is being parsed)
+ d._mixin(params, args.defaults);
+ }
+ if(obj.inherited){
+ // settings from dir=rtl or lang=... on a node above this node
+ d._mixin(params, obj.inherited);
+ }
+
+ // mix things found in data-dojo-props into the params
+ if(fastpath){
+ var extra = node.getAttribute(attrData + "props");
+ if(extra && extra.length){
+ try{
+ extra = d.fromJson.call(args.propsThis, "{" + extra + "}");
+ d._mixin(params, extra);
+ }catch(e){
+ // give the user a pointer to their invalid parameters. FIXME: can we kill this in production?
+ throw new Error(e.toString() + " in data-dojo-props='" + extra + "'");
+ }
+ }
+
+ // For the benefit of _Templated, check if node has data-dojo-attach-point/data-dojo-attach-event
+ // and mix those in as though they were parameters
+ var attachPoint = node.getAttribute(attrData + "attach-point");
+ if(attachPoint){
+ params.dojoAttachPoint = attachPoint;
+ }
+ var attachEvent = node.getAttribute(attrData + "attach-event");
+ if(attachEvent){
+ params.dojoAttachEvent = attachEvent;
+ }
+ dojo.mixin(params, mixin);
+ }else{
+ // FIXME: we need something like "deprecateOnce()" to throw dojo.deprecation for something.
+ // remove this logic in 2.0
+ // read parameters (ie, attributes) specified on DOMNode
+
+ var attributes = node.attributes;
+
+ // clsInfo.params lists expected params like {"checked": "boolean", "n": "number"}
+ for(var name in clsInfo.params){
+ var item = name in mixin ? { value:mixin[name], specified:true } : attributes.getNamedItem(name);
+ if(!item || (!item.specified && (!dojo.isIE || name.toLowerCase()!="value"))){ continue; }
+ var value = item.value;
+ // Deal with IE quirks for 'class' and 'style'
+ switch(name){
+ case "class":
+ value = "className" in mixin ? mixin.className : node.className;
+ break;
+ case "style":
+ value = "style" in mixin ? mixin.style : (node.style && node.style.cssText); // FIXME: Opera?
+ }
+ var _type = clsInfo.params[name];
+ if(typeof value == "string"){
+ params[name] = str2obj(value, _type);
+ }else{
+ params[name] = value;
+ }
+ }
+ }
+
+ // Process <script type="dojo/*"> script tags
+ // <script type="dojo/method" event="foo"> tags are added to params, and passed to
+ // the widget on instantiation.
+ // <script type="dojo/method"> tags (with no event) are executed after instantiation
+ // <script type="dojo/connect" event="foo"> tags are dojo.connected after instantiation
+ // note: dojo/* script tags cannot exist in self closing widgets, like <input />
+ var connects = [], // functions to connect after instantiation
+ calls = []; // functions to call after instantiation
+
+ d.forEach(scripts, function(script){
+ node.removeChild(script);
+ // FIXME: drop event="" support in 2.0. use data-dojo-event="" instead
+ var event = (script.getAttribute(attrData + "event") || script.getAttribute("event")),
+ type = script.getAttribute("type"),
+ nf = d.parser._functionFromScript(script, attrData);
+ if(event){
+ if(type == "dojo/connect"){
+ connects.push({event: event, func: nf});
+ }else{
+ params[event] = nf;
+ }
+ }else{
+ calls.push(nf);
+ }
+ });
+
+ var markupFactory = clazz.markupFactory || clazz.prototype && clazz.prototype.markupFactory;
+ // create the instance
+ var instance = markupFactory ? markupFactory(params, node, clazz) : new clazz(params, node);
+ thelist.push(instance);
+
+ // map it to the JS namespace if that makes sense
+ // FIXME: in 2.0, drop jsId support. use data-dojo-id instead
+ var jsname = (node.getAttribute(attrData + "id") || node.getAttribute("jsId"));
+ if(jsname){
+ d.setObject(jsname, instance);
+ }
+
+ // process connections and startup functions
+ d.forEach(connects, function(connect){
+ d.connect(instance, connect.event, null, connect.func);
+ });
+ d.forEach(calls, function(func){
+ func.call(instance);
+ });
+ });
+
+ // Call startup on each top level instance if it makes sense (as for
+ // widgets). Parent widgets will recursively call startup on their
+ // (non-top level) children
+ if(!mixin._started){
+ // TODO: for 2.0, when old instantiate() API is desupported, store parent-child
+ // relationships in the nodes[] array so that no getParent() call is needed.
+ // Note that will require a parse() call from ContentPane setting a param that the
+ // ContentPane is the parent widget (so that the parse doesn't call startup() on the
+ // ContentPane's children)
+ d.forEach(thelist, function(instance){
+ if( !args.noStart && instance &&
+ dojo.isFunction(instance.startup) &&
+ !instance._started &&
+ (!instance.getParent || !instance.getParent())
+ ){
+ instance.startup();
+ }
+ });
+ }
+ return thelist;
+ };
+
+ this.parse = function(rootNode, args){
+ // summary:
+ // Scan the DOM for class instances, and instantiate them.
+ //
+ // description:
+ // Search specified node (or root node) recursively for class instances,
+ // and instantiate them. Searches for either data-dojo-type="Class" or
+ // dojoType="Class" where "Class" is a a fully qualified class name,
+ // like `dijit.form.Button`
+ //
+ // Using `data-dojo-type`:
+ // Attributes using can be mixed into the parameters used to instantitate the
+ // Class by using a `data-dojo-props` attribute on the node being converted.
+ // `data-dojo-props` should be a string attribute to be converted from JSON.
+ //
+ // Using `dojoType`:
+ // Attributes are read from the original domNode and converted to appropriate
+ // types by looking up the Class prototype values. This is the default behavior
+ // from Dojo 1.0 to Dojo 1.5. `dojoType` support is deprecated, and will
+ // go away in Dojo 2.0.
+ //
+ // rootNode: DomNode?
+ // A default starting root node from which to start the parsing. Can be
+ // omitted, defaulting to the entire document. If omitted, the `args`
+ // object can be passed in this place. If the `args` object has a
+ // `rootNode` member, that is used.
+ //
+ // args: Object
+ // a kwArgs object passed along to instantiate()
+ //
+ // * noStart: Boolean?
+ // when set will prevent the parser from calling .startup()
+ // when locating the nodes.
+ // * rootNode: DomNode?
+ // identical to the function's `rootNode` argument, though
+ // allowed to be passed in via this `args object.
+ // * template: Boolean
+ // If true, ignores ContentPane's stopParser flag and parses contents inside of
+ // a ContentPane inside of a template. This allows dojoAttachPoint on widgets/nodes
+ // nested inside the ContentPane to work.
+ // * inherited: Object
+ // Hash possibly containing dir and lang settings to be applied to
+ // parsed widgets, unless there's another setting on a sub-node that overrides
+ // * scope: String
+ // Root for attribute names to search for. If scopeName is dojo,
+ // will search for data-dojo-type (or dojoType). For backwards compatibility
+ // reasons defaults to dojo._scopeName (which is "dojo" except when
+ // multi-version support is used, when it will be something like dojo16, dojo20, etc.)
+ // * propsThis: Object
+ // If specified, "this" referenced from data-dojo-props will refer to propsThis.
+ // Intended for use from the widgets-in-template feature of `dijit._Templated`
+ //
+ // example:
+ // Parse all widgets on a page:
+ // | dojo.parser.parse();
+ //
+ // example:
+ // Parse all classes within the node with id="foo"
+ // | dojo.parser.parse(dojo.byId('foo'));
+ //
+ // example:
+ // Parse all classes in a page, but do not call .startup() on any
+ // child
+ // | dojo.parser.parse({ noStart: true })
+ //
+ // example:
+ // Parse all classes in a node, but do not call .startup()
+ // | dojo.parser.parse(someNode, { noStart:true });
+ // | // or
+ // | dojo.parser.parse({ noStart:true, rootNode: someNode });
+
+ // determine the root node based on the passed arguments.
+ var root;
+ if(!args && rootNode && rootNode.rootNode){
+ args = rootNode;
+ root = args.rootNode;
+ }else{
+ root = rootNode;
+ }
+ args = args || {};
+
+ var attrName = (args.scope || d._scopeName) + "Type", // typically "dojoType"
+ attrData = "data-" + (args.scope || d._scopeName) + "-"; // typically "data-dojo-"
+
+ function scan(parent, list){
+ // summary:
+ // Parent is an Object representing a DOMNode, with or without a dojoType specified.
+ // Scan parent's children looking for nodes with dojoType specified, storing in list[].
+ // If parent has a dojoType, also collects <script type=dojo/*> children and stores in parent.scripts[].
+ // parent: Object
+ // Object representing the parent node, like
+ // | {
+ // | node: DomNode, // scan children of this node
+ // | inherited: {dir: "rtl"}, // dir/lang setting inherited from above node
+ // |
+ // | // attributes only set if node has dojoType specified
+ // | scripts: [], // empty array, put <script type=dojo/*> in here
+ // | clsInfo: { cls: dijit.form.Button, ...}
+ // | }
+ // list: DomNode[]
+ // Output array of objects (same format as parent) representing nodes to be turned into widgets
+
+ // Effective dir and lang settings on parent node, either set directly or inherited from grandparent
+ var inherited = dojo.clone(parent.inherited);
+ dojo.forEach(["dir", "lang"], function(name){
+ // TODO: what if this is a widget and dir/lang are declared in data-dojo-props?
+ var val = parent.node.getAttribute(name);
+ if(val){
+ inherited[name] = val;
+ }
+ });
+
+ // if parent is a widget, then search for <script type=dojo/*> tags and put them in scripts[].
+ var scripts = parent.clsInfo && !parent.clsInfo.cls.prototype._noScript ? parent.scripts : null;
+
+ // unless parent is a widget with the stopParser flag set, continue search for dojoType, recursively
+ var recurse = (!parent.clsInfo || !parent.clsInfo.cls.prototype.stopParser) || (args && args.template);
+
+ // scan parent's children looking for dojoType and <script type=dojo/*>
+ for(var child = parent.node.firstChild; child; child = child.nextSibling){
+ if(child.nodeType == 1){
+ // FIXME: desupport dojoType in 2.0. use data-dojo-type instead
+ var type, html5 = recurse && child.getAttribute(attrData + "type");
+ if(html5){
+ type = html5;
+ }else{
+ // fallback to backward compatible mode, using dojoType. remove in 2.0
+ type = recurse && child.getAttribute(attrName);
+ }
+
+ var fastpath = html5 == type;
+
+ if(type){
+ // if dojoType/data-dojo-type specified, add to output array of nodes to instantiate
+ var params = {
+ "type": type,
+ fastpath: fastpath,
+ clsInfo: getClassInfo(type, fastpath), // note: won't find classes declared via dojo.Declaration
+ node: child,
+ scripts: [], // <script> nodes that are parent's children
+ inherited: inherited // dir & lang attributes inherited from parent
+ };
+ list.push(params);
+
+ // Recurse, collecting <script type="dojo/..."> children, and also looking for
+ // descendant nodes with dojoType specified (unless the widget has the stopParser flag),
+ scan(params, list);
+ }else if(scripts && child.nodeName.toLowerCase() == "script"){
+ // if <script type="dojo/...">, save in scripts[]
+ type = child.getAttribute("type");
+ if (type && /^dojo\/\w/i.test(type)) {
+ scripts.push(child);
+ }
+ }else if(recurse){
+ // Recurse, looking for grandchild nodes with dojoType specified
+ scan({
+ node: child,
+ inherited: inherited
+ }, list);
+ }
+ }
+ }
+ }
+
+ // Make list of all nodes on page w/dojoType specified
+ var list = [];
+ scan({
+ node: root ? dojo.byId(root) : dojo.body(),
+ inherited: (args && args.inherited) || {
+ dir: dojo._isBodyLtr() ? "ltr" : "rtl"
+ }
+ }, list);
+
+ // go build the object instances
+ var mixin = args && args.template ? {template: true} : null;
+ return this.instantiate(list, mixin, args); // Array
+ };
+}();
+
+//Register the parser callback. It should be the first callback
+//after the a11y test.
+
+(function(){
+ var parseRunner = function(){
+ if(dojo.config.parseOnLoad){
+ dojo.parser.parse();
+ }
+ };
+
+ // FIXME: need to clobber cross-dependency!!
+ if(dojo.getObject("dijit.wai.onload") === dojo._loaders[0]){
+ dojo._loaders.splice(1, 0, parseRunner);
+ }else{
+ dojo._loaders.unshift(parseRunner);
+ }
+})();
+
+}
+
+if(!dojo._hasResource["dojo.Stateful"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojo.Stateful"] = true;
+dojo.provide("dojo.Stateful");
+
+
+
+dojo.declare("dojo.Stateful", null, {
+ // summary:
+ // Base class for objects that provide named properties with optional getter/setter
+ // control and the ability to watch for property changes
+ // example:
+ // | var obj = new dojo.Stateful();
+ // | obj.watch("foo", function(){
+ // | console.log("foo changed to " + this.get("foo"));
+ // | });
+ // | obj.set("foo","bar");
+ postscript: function(mixin){
+ if(mixin){
+ dojo.mixin(this, mixin);
+ }
+ },
+
+ get: function(/*String*/name){
+ // summary:
+ // Get a property on a Stateful instance.
+ // name:
+ // The property to get.
+ // description:
+ // Get a named property on a Stateful object. The property may
+ // potentially be retrieved via a getter method in subclasses. In the base class
+ // this just retrieves the object's property.
+ // For example:
+ // | stateful = new dojo.Stateful({foo: 3});
+ // | stateful.get("foo") // returns 3
+ // | stateful.foo // returns 3
+
+ return this[name];
+ },
+ set: function(/*String*/name, /*Object*/value){
+ // summary:
+ // Set a property on a Stateful instance
+ // name:
+ // The property to set.
+ // value:
+ // The value to set in the property.
+ // description:
+ // Sets named properties on a stateful object and notifies any watchers of
+ // the property. A programmatic setter may be defined in subclasses.
+ // For example:
+ // | stateful = new dojo.Stateful();
+ // | stateful.watch(function(name, oldValue, value){
+ // | // this will be called on the set below
+ // | }
+ // | stateful.set(foo, 5);
+ //
+ // set() may also be called with a hash of name/value pairs, ex:
+ // | myObj.set({
+ // | foo: "Howdy",
+ // | bar: 3
+ // | })
+ // This is equivalent to calling set(foo, "Howdy") and set(bar, 3)
+ if(typeof name === "object"){
+ for(var x in name){
+ this.set(x, name[x]);
+ }
+ return this;
+ }
+ var oldValue = this[name];
+ this[name] = value;
+ if(this._watchCallbacks){
+ this._watchCallbacks(name, oldValue, value);
+ }
+ return this;
+ },
+ watch: function(/*String?*/name, /*Function*/callback){
+ // summary:
+ // Watches a property for changes
+ // name:
+ // Indicates the property to watch. This is optional (the callback may be the
+ // only parameter), and if omitted, all the properties will be watched
+ // returns:
+ // An object handle for the watch. The unwatch method of this object
+ // can be used to discontinue watching this property:
+ // | var watchHandle = obj.watch("foo", callback);
+ // | watchHandle.unwatch(); // callback won't be called now
+ // callback:
+ // The function to execute when the property changes. This will be called after
+ // the property has been changed. The callback will be called with the |this|
+ // set to the instance, the first argument as the name of the property, the
+ // second argument as the old value and the third argument as the new value.
+
+ var callbacks = this._watchCallbacks;
+ if(!callbacks){
+ var self = this;
+ callbacks = this._watchCallbacks = function(name, oldValue, value, ignoreCatchall){
+ var notify = function(propertyCallbacks){
+ if(propertyCallbacks){
+ propertyCallbacks = propertyCallbacks.slice();
+ for(var i = 0, l = propertyCallbacks.length; i < l; i++){
+ try{
+ propertyCallbacks[i].call(self, name, oldValue, value);
+ }catch(e){
+ console.error(e);
+ }
+ }
+ }
+ };
+ notify(callbacks['_' + name]);
+ if(!ignoreCatchall){
+ notify(callbacks["*"]); // the catch-all
+ }
+ }; // we use a function instead of an object so it will be ignored by JSON conversion
+ }
+ if(!callback && typeof name === "function"){
+ callback = name;
+ name = "*";
+ }else{
+ // prepend with dash to prevent name conflicts with function (like "name" property)
+ name = '_' + name;
+ }
+ var propertyCallbacks = callbacks[name];
+ if(typeof propertyCallbacks !== "object"){
+ propertyCallbacks = callbacks[name] = [];
+ }
+ propertyCallbacks.push(callback);
+ return {
+ unwatch: function(){
+ propertyCallbacks.splice(dojo.indexOf(propertyCallbacks, callback), 1);
+ }
+ };
+ }
+
+});
+
+}
+
+if(!dojo._hasResource["dijit._WidgetBase"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dijit._WidgetBase"] = true;
+dojo.provide("dijit._WidgetBase");
+
+
+
+
+
+(function(){
+
+dojo.declare("dijit._WidgetBase", dojo.Stateful, {
+ // summary:
+ // Future base class for all Dijit widgets.
+ // _Widget extends this class adding support for various features needed by desktop.
+
+ // id: [const] String
+ // A unique, opaque ID string that can be assigned by users or by the
+ // system. If the developer passes an ID which is known not to be
+ // unique, the specified ID is ignored and the system-generated ID is
+ // used instead.
+ id: "",
+
+ // lang: [const] String
+ // Rarely used. Overrides the default Dojo locale used to render this widget,
+ // as defined by the [HTML LANG](http://www.w3.org/TR/html401/struct/dirlang.html#adef-lang) attribute.
+ // Value must be among the list of locales specified during by the Dojo bootstrap,
+ // formatted according to [RFC 3066](http://www.ietf.org/rfc/rfc3066.txt) (like en-us).
+ lang: "",
+
+ // dir: [const] String
+ // Bi-directional support, as defined by the [HTML DIR](http://www.w3.org/TR/html401/struct/dirlang.html#adef-dir)
+ // attribute. Either left-to-right "ltr" or right-to-left "rtl". If undefined, widgets renders in page's
+ // default direction.
+ dir: "",
+
+ // class: String
+ // HTML class attribute
+ "class": "",
+
+ // style: String||Object
+ // HTML style attributes as cssText string or name/value hash
+ style: "",
+
+ // title: String
+ // HTML title attribute.
+ //
+ // For form widgets this specifies a tooltip to display when hovering over
+ // the widget (just like the native HTML title attribute).
+ //
+ // For TitlePane or for when this widget is a child of a TabContainer, AccordionContainer,
+ // etc., it's used to specify the tab label, accordion pane title, etc.
+ title: "",
+
+ // tooltip: String
+ // When this widget's title attribute is used to for a tab label, accordion pane title, etc.,
+ // this specifies the tooltip to appear when the mouse is hovered over that text.
+ tooltip: "",
+
+ // baseClass: [protected] String
+ // Root CSS class of the widget (ex: dijitTextBox), used to construct CSS classes to indicate
+ // widget state.
+ baseClass: "",
+
+ // srcNodeRef: [readonly] DomNode
+ // pointer to original DOM node
+ srcNodeRef: null,
+
+ // domNode: [readonly] DomNode
+ // This is our visible representation of the widget! Other DOM
+ // Nodes may by assigned to other properties, usually through the
+ // template system's dojoAttachPoint syntax, but the domNode
+ // property is the canonical "top level" node in widget UI.
+ domNode: null,
+
+ // containerNode: [readonly] DomNode
+ // Designates where children of the source DOM node will be placed.
+ // "Children" in this case refers to both DOM nodes and widgets.
+ // For example, for myWidget:
+ //
+ // | <div dojoType=myWidget>
+ // | <b> here's a plain DOM node
+ // | <span dojoType=subWidget>and a widget</span>
+ // | <i> and another plain DOM node </i>
+ // | </div>
+ //
+ // containerNode would point to:
+ //
+ // | <b> here's a plain DOM node
+ // | <span dojoType=subWidget>and a widget</span>
+ // | <i> and another plain DOM node </i>
+ //
+ // In templated widgets, "containerNode" is set via a
+ // dojoAttachPoint assignment.
+ //
+ // containerNode must be defined for any widget that accepts innerHTML
+ // (like ContentPane or BorderContainer or even Button), and conversely
+ // is null for widgets that don't, like TextBox.
+ containerNode: null,
+
+/*=====
+ // _started: Boolean
+ // startup() has completed.
+ _started: false,
+=====*/
+
+ // attributeMap: [protected] Object
+ // attributeMap sets up a "binding" between attributes (aka properties)
+ // of the widget and the widget's DOM.
+ // Changes to widget attributes listed in attributeMap will be
+ // reflected into the DOM.
+ //
+ // For example, calling set('title', 'hello')
+ // on a TitlePane will automatically cause the TitlePane's DOM to update
+ // with the new title.
+ //
+ // attributeMap is a hash where the key is an attribute of the widget,
+ // and the value reflects a binding to a:
+ //
+ // - DOM node attribute
+ // | focus: {node: "focusNode", type: "attribute"}
+ // Maps this.focus to this.focusNode.focus
+ //
+ // - DOM node innerHTML
+ // | title: { node: "titleNode", type: "innerHTML" }
+ // Maps this.title to this.titleNode.innerHTML
+ //
+ // - DOM node innerText
+ // | title: { node: "titleNode", type: "innerText" }
+ // Maps this.title to this.titleNode.innerText
+ //
+ // - DOM node CSS class
+ // | myClass: { node: "domNode", type: "class" }
+ // Maps this.myClass to this.domNode.className
+ //
+ // If the value is an array, then each element in the array matches one of the
+ // formats of the above list.
+ //
+ // There are also some shorthands for backwards compatibility:
+ // - string --> { node: string, type: "attribute" }, for example:
+ // | "focusNode" ---> { node: "focusNode", type: "attribute" }
+ // - "" --> { node: "domNode", type: "attribute" }
+ attributeMap: {id:"", dir:"", lang:"", "class":"", style:"", title:""},
+
+ // _blankGif: [protected] String
+ // Path to a blank 1x1 image.
+ // Used by <img> nodes in templates that really get their image via CSS background-image.
+ _blankGif: (dojo.config.blankGif || dojo.moduleUrl("dojo", "resources/blank.gif")).toString(),
+
+ //////////// INITIALIZATION METHODS ///////////////////////////////////////
+
+ postscript: function(/*Object?*/params, /*DomNode|String*/srcNodeRef){
+ // summary:
+ // Kicks off widget instantiation. See create() for details.
+ // tags:
+ // private
+ this.create(params, srcNodeRef);
+ },
+
+ create: function(/*Object?*/params, /*DomNode|String?*/srcNodeRef){
+ // summary:
+ // Kick off the life-cycle of a widget
+ // params:
+ // Hash of initialization parameters for widget, including
+ // scalar values (like title, duration etc.) and functions,
+ // typically callbacks like onClick.
+ // srcNodeRef:
+ // If a srcNodeRef (DOM node) is specified:
+ // - use srcNodeRef.innerHTML as my contents
+ // - if this is a behavioral widget then apply behavior
+ // to that srcNodeRef
+ // - otherwise, replace srcNodeRef with my generated DOM
+ // tree
+ // description:
+ // Create calls a number of widget methods (postMixInProperties, buildRendering, postCreate,
+ // etc.), some of which of you'll want to override. See http://docs.dojocampus.org/dijit/_Widget
+ // for a discussion of the widget creation lifecycle.
+ //
+ // Of course, adventurous developers could override create entirely, but this should
+ // only be done as a last resort.
+ // tags:
+ // private
+
+ // store pointer to original DOM tree
+ this.srcNodeRef = dojo.byId(srcNodeRef);
+
+ // For garbage collection. An array of handles returned by Widget.connect()
+ // Each handle returned from Widget.connect() is an array of handles from dojo.connect()
+ this._connects = [];
+
+ // For garbage collection. An array of handles returned by Widget.subscribe()
+ // The handle returned from Widget.subscribe() is the handle returned from dojo.subscribe()
+ this._subscribes = [];
+
+ // mix in our passed parameters
+ if(this.srcNodeRef && (typeof this.srcNodeRef.id == "string")){ this.id = this.srcNodeRef.id; }
+ if(params){
+ this.params = params;
+ dojo._mixin(this, params);
+ }
+ this.postMixInProperties();
+
+ // generate an id for the widget if one wasn't specified
+ // (be sure to do this before buildRendering() because that function might
+ // expect the id to be there.)
+ if(!this.id){
+ this.id = dijit.getUniqueId(this.declaredClass.replace(/\./g,"_"));
+ }
+ dijit.registry.add(this);
+
+ this.buildRendering();
+
+ if(this.domNode){
+ // Copy attributes listed in attributeMap into the [newly created] DOM for the widget.
+ // Also calls custom setters for all attributes with custom setters.
+ this._applyAttributes();
+
+ // If srcNodeRef was specified, then swap out original srcNode for this widget's DOM tree.
+ // For 2.0, move this after postCreate(). postCreate() shouldn't depend on the
+ // widget being attached to the DOM since it isn't when a widget is created programmatically like
+ // new MyWidget({}). See #11635.
+ var source = this.srcNodeRef;
+ if(source && source.parentNode && this.domNode !== source){
+ source.parentNode.replaceChild(this.domNode, source);
+ }
+ }
+
+ if(this.domNode){
+ // Note: for 2.0 may want to rename widgetId to dojo._scopeName + "_widgetId",
+ // assuming that dojo._scopeName even exists in 2.0
+ this.domNode.setAttribute("widgetId", this.id);
+ }
+ this.postCreate();
+
+ // If srcNodeRef has been processed and removed from the DOM (e.g. TemplatedWidget) then delete it to allow GC.
+ if(this.srcNodeRef && !this.srcNodeRef.parentNode){
+ delete this.srcNodeRef;
+ }
+
+ this._created = true;
+ },
+
+ _applyAttributes: function(){
+ // summary:
+ // Step during widget creation to copy all widget attributes to the
+ // DOM as per attributeMap and _setXXXAttr functions.
+ // description:
+ // Skips over blank/false attribute values, unless they were explicitly specified
+ // as parameters to the widget, since those are the default anyway,
+ // and setting tabIndex="" is different than not setting tabIndex at all.
+ //
+ // It processes the attributes in the attribute map first, and then
+ // it goes through and processes the attributes for the _setXXXAttr
+ // functions that have been specified
+ // tags:
+ // private
+ var condAttrApply = function(attr, scope){
+ if((scope.params && attr in scope.params) || scope[attr]){
+ scope.set(attr, scope[attr]);
+ }
+ };
+
+ // Do the attributes in attributeMap
+ for(var attr in this.attributeMap){
+ condAttrApply(attr, this);
+ }
+
+ // And also any attributes with custom setters
+ dojo.forEach(this._getSetterAttributes(), function(a){
+ if(!(a in this.attributeMap)){
+ condAttrApply(a, this);
+ }
+ }, this);
+ },
+
+ _getSetterAttributes: function(){
+ // summary:
+ // Returns list of attributes with custom setters for this widget
+ var ctor = this.constructor;
+ if(!ctor._setterAttrs){
+ var r = (ctor._setterAttrs = []),
+ attrs,
+ proto = ctor.prototype;
+ for(var fxName in proto){
+ if(dojo.isFunction(proto[fxName]) && (attrs = fxName.match(/^_set([a-zA-Z]*)Attr$/)) && attrs[1]){
+ r.push(attrs[1].charAt(0).toLowerCase() + attrs[1].substr(1));
+ }
+ }
+ }
+ return ctor._setterAttrs; // String[]
+ },
+
+ postMixInProperties: function(){
+ // summary:
+ // Called after the parameters to the widget have been read-in,
+ // but before the widget template is instantiated. Especially
+ // useful to set properties that are referenced in the widget
+ // template.
+ // tags:
+ // protected
+ },
+
+ buildRendering: function(){
+ // summary:
+ // Construct the UI for this widget, setting this.domNode
+ // description:
+ // Most widgets will mixin `dijit._Templated`, which implements this
+ // method.
+ // tags:
+ // protected
+
+ if(!this.domNode){
+ // Create root node if it wasn't created by _Templated
+ this.domNode = this.srcNodeRef || dojo.create('div');
+ }
+
+ // baseClass is a single class name or occasionally a space-separated list of names.
+ // Add those classes to the DOMNode. If RTL mode then also add with Rtl suffix.
+ // TODO: make baseClass custom setter
+ if(this.baseClass){
+ var classes = this.baseClass.split(" ");
+ if(!this.isLeftToRight()){
+ classes = classes.concat( dojo.map(classes, function(name){ return name+"Rtl"; }));
+ }
+ dojo.addClass(this.domNode, classes);
+ }
+ },
+
+ postCreate: function(){
+ // summary:
+ // Processing after the DOM fragment is created
+ // description:
+ // Called after the DOM fragment has been created, but not necessarily
+ // added to the document. Do not include any operations which rely on
+ // node dimensions or placement.
+ // tags:
+ // protected
+ },
+
+ startup: function(){
+ // summary:
+ // Processing after the DOM fragment is added to the document
+ // description:
+ // Called after a widget and its children have been created and added to the page,
+ // and all related widgets have finished their create() cycle, up through postCreate().
+ // This is useful for composite widgets that need to control or layout sub-widgets.
+ // Many layout widgets can use this as a wiring phase.
+ this._started = true;
+ },
+
+ //////////// DESTROY FUNCTIONS ////////////////////////////////
+
+ destroyRecursive: function(/*Boolean?*/ preserveDom){
+ // summary:
+ // Destroy this widget and its descendants
+ // description:
+ // This is the generic "destructor" function that all widget users
+ // should call to cleanly discard with a widget. Once a widget is
+ // destroyed, it is removed from the manager object.
+ // preserveDom:
+ // If true, this method will leave the original DOM structure
+ // alone of descendant Widgets. Note: This will NOT work with
+ // dijit._Templated widgets.
+
+ this._beingDestroyed = true;
+ this.destroyDescendants(preserveDom);
+ this.destroy(preserveDom);
+ },
+
+ destroy: function(/*Boolean*/ preserveDom){
+ // summary:
+ // Destroy this widget, but not its descendants.
+ // This method will, however, destroy internal widgets such as those used within a template.
+ // preserveDom: Boolean
+ // If true, this method will leave the original DOM structure alone.
+ // Note: This will not yet work with _Templated widgets
+
+ this._beingDestroyed = true;
+ this.uninitialize();
+ var d = dojo,
+ dfe = d.forEach,
+ dun = d.unsubscribe;
+ dfe(this._connects, function(array){
+ dfe(array, d.disconnect);
+ });
+ dfe(this._subscribes, function(handle){
+ dun(handle);
+ });
+
+ // destroy widgets created as part of template, etc.
+ dfe(this._supportingWidgets || [], function(w){
+ if(w.destroyRecursive){
+ w.destroyRecursive();
+ }else if(w.destroy){
+ w.destroy();
+ }
+ });
+
+ this.destroyRendering(preserveDom);
+ dijit.registry.remove(this.id);
+ this._destroyed = true;
+ },
+
+ destroyRendering: function(/*Boolean?*/ preserveDom){
+ // summary:
+ // Destroys the DOM nodes associated with this widget
+ // preserveDom:
+ // If true, this method will leave the original DOM structure alone
+ // during tear-down. Note: this will not work with _Templated
+ // widgets yet.
+ // tags:
+ // protected
+
+ if(this.bgIframe){
+ this.bgIframe.destroy(preserveDom);
+ delete this.bgIframe;
+ }
+
+ if(this.domNode){
+ if(preserveDom){
+ dojo.removeAttr(this.domNode, "widgetId");
+ }else{
+ dojo.destroy(this.domNode);
+ }
+ delete this.domNode;
+ }
+
+ if(this.srcNodeRef){
+ if(!preserveDom){
+ dojo.destroy(this.srcNodeRef);
+ }
+ delete this.srcNodeRef;
+ }
+ },
+
+ destroyDescendants: function(/*Boolean?*/ preserveDom){
+ // summary:
+ // Recursively destroy the children of this widget and their
+ // descendants.
+ // preserveDom:
+ // If true, the preserveDom attribute is passed to all descendant
+ // widget's .destroy() method. Not for use with _Templated
+ // widgets.
+
+ // get all direct descendants and destroy them recursively
+ dojo.forEach(this.getChildren(), function(widget){
+ if(widget.destroyRecursive){
+ widget.destroyRecursive(preserveDom);
+ }
+ });
+ },
+
+ uninitialize: function(){
+ // summary:
+ // Stub function. Override to implement custom widget tear-down
+ // behavior.
+ // tags:
+ // protected
+ return false;
+ },
+
+ ////////////////// GET/SET, CUSTOM SETTERS, ETC. ///////////////////
+
+ _setClassAttr: function(/*String*/ value){
+ // summary:
+ // Custom setter for the CSS "class" attribute
+ // tags:
+ // protected
+ var mapNode = this[this.attributeMap["class"] || 'domNode'];
+ dojo.replaceClass(mapNode, value, this["class"]);
+ this._set("class", value);
+ },
+
+ _setStyleAttr: function(/*String||Object*/ value){
+ // summary:
+ // Sets the style attribute of the widget according to value,
+ // which is either a hash like {height: "5px", width: "3px"}
+ // or a plain string
+ // description:
+ // Determines which node to set the style on based on style setting
+ // in attributeMap.
+ // tags:
+ // protected
+
+ var mapNode = this[this.attributeMap.style || 'domNode'];
+
+ // Note: technically we should revert any style setting made in a previous call
+ // to his method, but that's difficult to keep track of.
+
+ if(dojo.isObject(value)){
+ dojo.style(mapNode, value);
+ }else{
+ if(mapNode.style.cssText){
+ mapNode.style.cssText += "; " + value;
+ }else{
+ mapNode.style.cssText = value;
+ }
+ }
+
+ this._set("style", value);
+ },
+
+ _attrToDom: function(/*String*/ attr, /*String*/ value){
+ // summary:
+ // Reflect a widget attribute (title, tabIndex, duration etc.) to
+ // the widget DOM, as specified in attributeMap.
+ // Note some attributes like "type"
+ // cannot be processed this way as they are not mutable.
+ //
+ // tags:
+ // private
+
+ var commands = this.attributeMap[attr];
+ dojo.forEach(dojo.isArray(commands) ? commands : [commands], function(command){
+
+ // Get target node and what we are doing to that node
+ var mapNode = this[command.node || command || "domNode"]; // DOM node
+ var type = command.type || "attribute"; // class, innerHTML, innerText, or attribute
+
+ switch(type){
+ case "attribute":
+ if(dojo.isFunction(value)){ // functions execute in the context of the widget
+ value = dojo.hitch(this, value);
+ }
+
+ // Get the name of the DOM node attribute; usually it's the same
+ // as the name of the attribute in the widget (attr), but can be overridden.
+ // Also maps handler names to lowercase, like onSubmit --> onsubmit
+ var attrName = command.attribute ? command.attribute :
+ (/^on[A-Z][a-zA-Z]*$/.test(attr) ? attr.toLowerCase() : attr);
+
+ dojo.attr(mapNode, attrName, value);
+ break;
+ case "innerText":
+ mapNode.innerHTML = "";
+ mapNode.appendChild(dojo.doc.createTextNode(value));
+ break;
+ case "innerHTML":
+ mapNode.innerHTML = value;
+ break;
+ case "class":
+ dojo.replaceClass(mapNode, value, this[attr]);
+ break;
+ }
+ }, this);
+ },
+
+ get: function(name){
+ // summary:
+ // Get a property from a widget.
+ // name:
+ // The property to get.
+ // description:
+ // Get a named property from a widget. The property may
+ // potentially be retrieved via a getter method. If no getter is defined, this
+ // just retrieves the object's property.
+ // For example, if the widget has a properties "foo"
+ // and "bar" and a method named "_getFooAttr", calling:
+ // | myWidget.get("foo");
+ // would be equivalent to writing:
+ // | widget._getFooAttr();
+ // and:
+ // | myWidget.get("bar");
+ // would be equivalent to writing:
+ // | widget.bar;
+ var names = this._getAttrNames(name);
+ return this[names.g] ? this[names.g]() : this[name];
+ },
+
+ set: function(name, value){
+ // summary:
+ // Set a property on a widget
+ // name:
+ // The property to set.
+ // value:
+ // The value to set in the property.
+ // description:
+ // Sets named properties on a widget which may potentially be handled by a
+ // setter in the widget.
+ // For example, if the widget has a properties "foo"
+ // and "bar" and a method named "_setFooAttr", calling:
+ // | myWidget.set("foo", "Howdy!");
+ // would be equivalent to writing:
+ // | widget._setFooAttr("Howdy!");
+ // and:
+ // | myWidget.set("bar", 3);
+ // would be equivalent to writing:
+ // | widget.bar = 3;
+ //
+ // set() may also be called with a hash of name/value pairs, ex:
+ // | myWidget.set({
+ // | foo: "Howdy",
+ // | bar: 3
+ // | })
+ // This is equivalent to calling set(foo, "Howdy") and set(bar, 3)
+
+ if(typeof name === "object"){
+ for(var x in name){
+ this.set(x, name[x]);
+ }
+ return this;
+ }
+ var names = this._getAttrNames(name);
+ if(this[names.s]){
+ // use the explicit setter
+ var result = this[names.s].apply(this, Array.prototype.slice.call(arguments, 1));
+ }else{
+ // if param is specified as DOM node attribute, copy it
+ if(name in this.attributeMap){
+ this._attrToDom(name, value);
+ }
+ this._set(name, value);
+ }
+ return result || this;
+ },
+
+ _attrPairNames: {}, // shared between all widgets
+ _getAttrNames: function(name){
+ // summary:
+ // Helper function for get() and set().
+ // Caches attribute name values so we don't do the string ops every time.
+ // tags:
+ // private
+
+ var apn = this._attrPairNames;
+ if(apn[name]){ return apn[name]; }
+ var uc = name.charAt(0).toUpperCase() + name.substr(1);
+ return (apn[name] = {
+ n: name+"Node",
+ s: "_set"+uc+"Attr",
+ g: "_get"+uc+"Attr"
+ });
+ },
+
+ _set: function(/*String*/ name, /*anything*/ value){
+ // summary:
+ // Helper function to set new value for specified attribute, and call handlers
+ // registered with watch() if the value has changed.
+ var oldValue = this[name];
+ this[name] = value;
+ if(this._watchCallbacks && this._created && value !== oldValue){
+ this._watchCallbacks(name, oldValue, value);
+ }
+ },
+
+ toString: function(){
+ // summary:
+ // Returns a string that represents the widget
+ // description:
+ // When a widget is cast to a string, this method will be used to generate the
+ // output. Currently, it does not implement any sort of reversible
+ // serialization.
+ return '[Widget ' + this.declaredClass + ', ' + (this.id || 'NO ID') + ']'; // String
+ },
+
+ getDescendants: function(){
+ // summary:
+ // Returns all the widgets contained by this, i.e., all widgets underneath this.containerNode.
+ // This method should generally be avoided as it returns widgets declared in templates, which are
+ // supposed to be internal/hidden, but it's left here for back-compat reasons.
+
+ return this.containerNode ? dojo.query('[widgetId]', this.containerNode).map(dijit.byNode) : []; // dijit._Widget[]
+ },
+
+ getChildren: function(){
+ // summary:
+ // Returns all the widgets contained by this, i.e., all widgets underneath this.containerNode.
+ // Does not return nested widgets, nor widgets that are part of this widget's template.
+ return this.containerNode ? dijit.findWidgets(this.containerNode) : []; // dijit._Widget[]
+ },
+
+ connect: function(
+ /*Object|null*/ obj,
+ /*String|Function*/ event,
+ /*String|Function*/ method){
+ // summary:
+ // Connects specified obj/event to specified method of this object
+ // and registers for disconnect() on widget destroy.
+ // description:
+ // Provide widget-specific analog to dojo.connect, except with the
+ // implicit use of this widget as the target object.
+ // Events connected with `this.connect` are disconnected upon
+ // destruction.
+ // returns:
+ // A handle that can be passed to `disconnect` in order to disconnect before
+ // the widget is destroyed.
+ // example:
+ // | var btn = new dijit.form.Button();
+ // | // when foo.bar() is called, call the listener we're going to
+ // | // provide in the scope of btn
+ // | btn.connect(foo, "bar", function(){
+ // | console.debug(this.toString());
+ // | });
+ // tags:
+ // protected
+
+ var handles = [dojo._connect(obj, event, this, method)];
+ this._connects.push(handles);
+ return handles; // _Widget.Handle
+ },
+
+ disconnect: function(/* _Widget.Handle */ handles){
+ // summary:
+ // Disconnects handle created by `connect`.
+ // Also removes handle from this widget's list of connects.
+ // tags:
+ // protected
+ for(var i=0; i<this._connects.length; i++){
+ if(this._connects[i] == handles){
+ dojo.forEach(handles, dojo.disconnect);
+ this._connects.splice(i, 1);
+ return;
+ }
+ }
+ },
+
+ subscribe: function(
+ /*String*/ topic,
+ /*String|Function*/ method){
+ // summary:
+ // Subscribes to the specified topic and calls the specified method
+ // of this object and registers for unsubscribe() on widget destroy.
+ // description:
+ // Provide widget-specific analog to dojo.subscribe, except with the
+ // implicit use of this widget as the target object.
+ // example:
+ // | var btn = new dijit.form.Button();
+ // | // when /my/topic is published, this button changes its label to
+ // | // be the parameter of the topic.
+ // | btn.subscribe("/my/topic", function(v){
+ // | this.set("label", v);
+ // | });
+ var handle = dojo.subscribe(topic, this, method);
+
+ // return handles for Any widget that may need them
+ this._subscribes.push(handle);
+ return handle;
+ },
+
+ unsubscribe: function(/*Object*/ handle){
+ // summary:
+ // Unsubscribes handle created by this.subscribe.
+ // Also removes handle from this widget's list of subscriptions
+ for(var i=0; i<this._subscribes.length; i++){
+ if(this._subscribes[i] == handle){
+ dojo.unsubscribe(handle);
+ this._subscribes.splice(i, 1);
+ return;
+ }
+ }
+ },
+
+ isLeftToRight: function(){
+ // summary:
+ // Return this widget's explicit or implicit orientation (true for LTR, false for RTL)
+ // tags:
+ // protected
+ return this.dir ? (this.dir == "ltr") : dojo._isBodyLtr(); //Boolean
+ },
+
+ placeAt: function(/* String|DomNode|_Widget */reference, /* String?|Int? */position){
+ // summary:
+ // Place this widget's domNode reference somewhere in the DOM based
+ // on standard dojo.place conventions, or passing a Widget reference that
+ // contains and addChild member.
+ //
+ // description:
+ // A convenience function provided in all _Widgets, providing a simple
+ // shorthand mechanism to put an existing (or newly created) Widget
+ // somewhere in the dom, and allow chaining.
+ //
+ // reference:
+ // The String id of a domNode, a domNode reference, or a reference to a Widget posessing
+ // an addChild method.
+ //
+ // position:
+ // If passed a string or domNode reference, the position argument
+ // accepts a string just as dojo.place does, one of: "first", "last",
+ // "before", or "after".
+ //
+ // If passed a _Widget reference, and that widget reference has an ".addChild" method,
+ // it will be called passing this widget instance into that method, supplying the optional
+ // position index passed.
+ //
+ // returns:
+ // dijit._Widget
+ // Provides a useful return of the newly created dijit._Widget instance so you
+ // can "chain" this function by instantiating, placing, then saving the return value
+ // to a variable.
+ //
+ // example:
+ // | // create a Button with no srcNodeRef, and place it in the body:
+ // | var button = new dijit.form.Button({ label:"click" }).placeAt(dojo.body());
+ // | // now, 'button' is still the widget reference to the newly created button
+ // | dojo.connect(button, "onClick", function(e){ console.log('click'); });
+ //
+ // example:
+ // | // create a button out of a node with id="src" and append it to id="wrapper":
+ // | var button = new dijit.form.Button({},"src").placeAt("wrapper");
+ //
+ // example:
+ // | // place a new button as the first element of some div
+ // | var button = new dijit.form.Button({ label:"click" }).placeAt("wrapper","first");
+ //
+ // example:
+ // | // create a contentpane and add it to a TabContainer
+ // | var tc = dijit.byId("myTabs");
+ // | new dijit.layout.ContentPane({ href:"foo.html", title:"Wow!" }).placeAt(tc)
+
+ if(reference.declaredClass && reference.addChild){
+ reference.addChild(this, position);
+ }else{
+ dojo.place(this.domNode, reference, position);
+ }
+ return this;
+ }
+});
+
+})();
+
+}
+
+if(!dojo._hasResource["dijit._Widget"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dijit._Widget"] = true;
+dojo.provide("dijit._Widget");
+
+
+
+
+
+
+////////////////// DEFERRED CONNECTS ///////////////////
+
+// This code is to assist deferring dojo.connect() calls in widgets (connecting to events on the widgets'
+// DOM nodes) until someone actually needs to monitor that event.
+dojo.connect(dojo, "_connect",
+ function(/*dijit._Widget*/ widget, /*String*/ event){
+ if(widget && dojo.isFunction(widget._onConnect)){
+ widget._onConnect(event);
+ }
+ });
+
+dijit._connectOnUseEventHandler = function(/*Event*/ event){};
+
+////////////////// ONDIJITCLICK SUPPORT ///////////////////
+
+// Keep track of where the last keydown event was, to help avoid generating
+// spurious ondijitclick events when:
+// 1. focus is on a <button> or <a>
+// 2. user presses then releases the ENTER key
+// 3. onclick handler fires and shifts focus to another node, with an ondijitclick handler
+// 4. onkeyup event fires, causing the ondijitclick handler to fire
+dijit._lastKeyDownNode = null;
+if(dojo.isIE){
+ (function(){
+ var keydownCallback = function(evt){
+ dijit._lastKeyDownNode = evt.srcElement;
+ };
+ dojo.doc.attachEvent('onkeydown', keydownCallback);
+ dojo.addOnWindowUnload(function(){
+ dojo.doc.detachEvent('onkeydown', keydownCallback);
+ });
+ })();
+}else{
+ dojo.doc.addEventListener('keydown', function(evt){
+ dijit._lastKeyDownNode = evt.target;
+ }, true);
+}
+
+(function(){
+
+dojo.declare("dijit._Widget", dijit._WidgetBase, {
+ // summary:
+ // Base class for all Dijit widgets.
+ //
+ // Extends _WidgetBase, adding support for:
+ // - deferred connections
+ // A call like dojo.connect(myWidget, "onMouseMove", func)
+ // will essentially do a dojo.connect(myWidget.domNode, "onMouseMove", func)
+ // - ondijitclick
+ // Support new dojoAttachEvent="ondijitclick: ..." that is triggered by a mouse click or a SPACE/ENTER keypress
+ // - focus related functions
+ // In particular, the onFocus()/onBlur() callbacks. Driven internally by
+ // dijit/_base/focus.js.
+ // - deprecated methods
+ // - onShow(), onHide(), onClose()
+ //
+ // Also, by loading code in dijit/_base, turns on:
+ // - browser sniffing (putting browser id like .dj_ie on <html> node)
+ // - high contrast mode sniffing (add .dijit_a11y class to <body> if machine is in high contrast mode)
+
+
+ ////////////////// DEFERRED CONNECTS ///////////////////
+
+ // _deferredConnects: [protected] Object
+ // attributeMap addendum for event handlers that should be connected only on first use
+ _deferredConnects: {
+ onClick: "",
+ onDblClick: "",
+ onKeyDown: "",
+ onKeyPress: "",
+ onKeyUp: "",
+ onMouseMove: "",
+ onMouseDown: "",
+ onMouseOut: "",
+ onMouseOver: "",
+ onMouseLeave: "",
+ onMouseEnter: "",
+ onMouseUp: ""
+ },
+
+ onClick: dijit._connectOnUseEventHandler,
+ /*=====
+ onClick: function(event){
+ // summary:
+ // Connect to this function to receive notifications of mouse click events.
+ // event:
+ // mouse Event
+ // tags:
+ // callback
+ },
+ =====*/
+ onDblClick: dijit._connectOnUseEventHandler,
+ /*=====
+ onDblClick: function(event){
+ // summary:
+ // Connect to this function to receive notifications of mouse double click events.
+ // event:
+ // mouse Event
+ // tags:
+ // callback
+ },
+ =====*/
+ onKeyDown: dijit._connectOnUseEventHandler,
+ /*=====
+ onKeyDown: function(event){
+ // summary:
+ // Connect to this function to receive notifications of keys being pressed down.
+ // event:
+ // key Event
+ // tags:
+ // callback
+ },
+ =====*/
+ onKeyPress: dijit._connectOnUseEventHandler,
+ /*=====
+ onKeyPress: function(event){
+ // summary:
+ // Connect to this function to receive notifications of printable keys being typed.
+ // event:
+ // key Event
+ // tags:
+ // callback
+ },
+ =====*/
+ onKeyUp: dijit._connectOnUseEventHandler,
+ /*=====
+ onKeyUp: function(event){
+ // summary:
+ // Connect to this function to receive notifications of keys being released.
+ // event:
+ // key Event
+ // tags:
+ // callback
+ },
+ =====*/
+ onMouseDown: dijit._connectOnUseEventHandler,
+ /*=====
+ onMouseDown: function(event){
+ // summary:
+ // Connect to this function to receive notifications of when the mouse button is pressed down.
+ // event:
+ // mouse Event
+ // tags:
+ // callback
+ },
+ =====*/
+ onMouseMove: dijit._connectOnUseEventHandler,
+ /*=====
+ onMouseMove: function(event){
+ // summary:
+ // Connect to this function to receive notifications of when the mouse moves over nodes contained within this widget.
+ // event:
+ // mouse Event
+ // tags:
+ // callback
+ },
+ =====*/
+ onMouseOut: dijit._connectOnUseEventHandler,
+ /*=====
+ onMouseOut: function(event){
+ // summary:
+ // Connect to this function to receive notifications of when the mouse moves off of nodes contained within this widget.
+ // event:
+ // mouse Event
+ // tags:
+ // callback
+ },
+ =====*/
+ onMouseOver: dijit._connectOnUseEventHandler,
+ /*=====
+ onMouseOver: function(event){
+ // summary:
+ // Connect to this function to receive notifications of when the mouse moves onto nodes contained within this widget.
+ // event:
+ // mouse Event
+ // tags:
+ // callback
+ },
+ =====*/
+ onMouseLeave: dijit._connectOnUseEventHandler,
+ /*=====
+ onMouseLeave: function(event){
+ // summary:
+ // Connect to this function to receive notifications of when the mouse moves off of this widget.
+ // event:
+ // mouse Event
+ // tags:
+ // callback
+ },
+ =====*/
+ onMouseEnter: dijit._connectOnUseEventHandler,
+ /*=====
+ onMouseEnter: function(event){
+ // summary:
+ // Connect to this function to receive notifications of when the mouse moves onto this widget.
+ // event:
+ // mouse Event
+ // tags:
+ // callback
+ },
+ =====*/
+ onMouseUp: dijit._connectOnUseEventHandler,
+ /*=====
+ onMouseUp: function(event){
+ // summary:
+ // Connect to this function to receive notifications of when the mouse button is released.
+ // event:
+ // mouse Event
+ // tags:
+ // callback
+ },
+ =====*/
+
+ create: function(/*Object?*/params, /*DomNode|String?*/srcNodeRef){
+ // To avoid double-connects, remove entries from _deferredConnects
+ // that have been setup manually by a subclass (ex, by dojoAttachEvent).
+ // If a subclass has redefined a callback (ex: onClick) then assume it's being
+ // connected to manually.
+ this._deferredConnects = dojo.clone(this._deferredConnects);
+ for(var attr in this.attributeMap){
+ delete this._deferredConnects[attr]; // can't be in both attributeMap and _deferredConnects
+ }
+ for(attr in this._deferredConnects){
+ if(this[attr] !== dijit._connectOnUseEventHandler){
+ delete this._deferredConnects[attr]; // redefined, probably dojoAttachEvent exists
+ }
+ }
+
+ this.inherited(arguments);
+
+ if(this.domNode){
+ // If the developer has specified a handler as a widget parameter
+ // (ex: new Button({onClick: ...})
+ // then naturally need to connect from DOM node to that handler immediately,
+ for(attr in this.params){
+ this._onConnect(attr);
+ }
+ }
+ },
+
+ _onConnect: function(/*String*/ event){
+ // summary:
+ // Called when someone connects to one of my handlers.
+ // "Turn on" that handler if it isn't active yet.
+ //
+ // This is also called for every single initialization parameter
+ // so need to do nothing for parameters like "id".
+ // tags:
+ // private
+ if(event in this._deferredConnects){
+ var mapNode = this[this._deferredConnects[event] || 'domNode'];
+ this.connect(mapNode, event.toLowerCase(), event);
+ delete this._deferredConnects[event];
+ }
+ },
+
+ ////////////////// FOCUS RELATED ///////////////////
+ // _onFocus() and _onBlur() are called by the focus manager
+
+ // focused: [readonly] Boolean
+ // This widget or a widget it contains has focus, or is "active" because
+ // it was recently clicked.
+ focused: false,
+
+ isFocusable: function(){
+ // summary:
+ // Return true if this widget can currently be focused
+ // and false if not
+ return this.focus && (dojo.style(this.domNode, "display") != "none");
+ },
+
+ onFocus: function(){
+ // summary:
+ // Called when the widget becomes "active" because
+ // it or a widget inside of it either has focus, or has recently
+ // been clicked.
+ // tags:
+ // callback
+ },
+
+ onBlur: function(){
+ // summary:
+ // Called when the widget stops being "active" because
+ // focus moved to something outside of it, or the user
+ // clicked somewhere outside of it, or the widget was
+ // hidden.
+ // tags:
+ // callback
+ },
+
+ _onFocus: function(e){
+ // summary:
+ // This is where widgets do processing for when they are active,
+ // such as changing CSS classes. See onFocus() for more details.
+ // tags:
+ // protected
+ this.onFocus();
+ },
+
+ _onBlur: function(){
+ // summary:
+ // This is where widgets do processing for when they stop being active,
+ // such as changing CSS classes. See onBlur() for more details.
+ // tags:
+ // protected
+ this.onBlur();
+ },
+
+ ////////////////// DEPRECATED METHODS ///////////////////
+
+ setAttribute: function(/*String*/ attr, /*anything*/ value){
+ // summary:
+ // Deprecated. Use set() instead.
+ // tags:
+ // deprecated
+ dojo.deprecated(this.declaredClass+"::setAttribute(attr, value) is deprecated. Use set() instead.", "", "2.0");
+ this.set(attr, value);
+ },
+
+ attr: function(/*String|Object*/name, /*Object?*/value){
+ // summary:
+ // Set or get properties on a widget instance.
+ // name:
+ // The property to get or set. If an object is passed here and not
+ // a string, its keys are used as names of attributes to be set
+ // and the value of the object as values to set in the widget.
+ // value:
+ // Optional. If provided, attr() operates as a setter. If omitted,
+ // the current value of the named property is returned.
+ // description:
+ // This method is deprecated, use get() or set() directly.
+
+ // Print deprecation warning but only once per calling function
+ if(dojo.config.isDebug){
+ var alreadyCalledHash = arguments.callee._ach || (arguments.callee._ach = {}),
+ caller = (arguments.callee.caller || "unknown caller").toString();
+ if(!alreadyCalledHash[caller]){
+ dojo.deprecated(this.declaredClass + "::attr() is deprecated. Use get() or set() instead, called from " +
+ caller, "", "2.0");
+ alreadyCalledHash[caller] = true;
+ }
+ }
+
+ var args = arguments.length;
+ if(args >= 2 || typeof name === "object"){ // setter
+ return this.set.apply(this, arguments);
+ }else{ // getter
+ return this.get(name);
+ }
+ },
+
+ ////////////////// ONDIJITCLICK SUPPORT ///////////////////
+
+ // nodesWithKeyClick: [private] String[]
+ // List of nodes that correctly handle click events via native browser support,
+ // and don't need dijit's help
+ nodesWithKeyClick: ["input", "button"],
+
+ connect: function(
+ /*Object|null*/ obj,
+ /*String|Function*/ event,
+ /*String|Function*/ method){
+ // summary:
+ // Connects specified obj/event to specified method of this object
+ // and registers for disconnect() on widget destroy.
+ // description:
+ // Provide widget-specific analog to dojo.connect, except with the
+ // implicit use of this widget as the target object.
+ // This version of connect also provides a special "ondijitclick"
+ // event which triggers on a click or space or enter keyup.
+ // Events connected with `this.connect` are disconnected upon
+ // destruction.
+ // returns:
+ // A handle that can be passed to `disconnect` in order to disconnect before
+ // the widget is destroyed.
+ // example:
+ // | var btn = new dijit.form.Button();
+ // | // when foo.bar() is called, call the listener we're going to
+ // | // provide in the scope of btn
+ // | btn.connect(foo, "bar", function(){
+ // | console.debug(this.toString());
+ // | });
+ // tags:
+ // protected
+
+ var d = dojo,
+ dc = d._connect,
+ handles = this.inherited(arguments, [obj, event == "ondijitclick" ? "onclick" : event, method]);
+
+ if(event == "ondijitclick"){
+ // add key based click activation for unsupported nodes.
+ // do all processing onkey up to prevent spurious clicks
+ // for details see comments at top of this file where _lastKeyDownNode is defined
+ if(d.indexOf(this.nodesWithKeyClick, obj.nodeName.toLowerCase()) == -1){ // is NOT input or button
+ var m = d.hitch(this, method);
+ handles.push(
+ dc(obj, "onkeydown", this, function(e){
+ //console.log(this.id + ": onkeydown, e.target = ", e.target, ", lastKeyDownNode was ", dijit._lastKeyDownNode, ", equality is ", (e.target === dijit._lastKeyDownNode));
+ if((e.keyCode == d.keys.ENTER || e.keyCode == d.keys.SPACE) &&
+ !e.ctrlKey && !e.shiftKey && !e.altKey && !e.metaKey){
+ // needed on IE for when focus changes between keydown and keyup - otherwise dropdown menus do not work
+ dijit._lastKeyDownNode = e.target;
+
+ // Stop event to prevent scrolling on space key in IE.
+ // But don't do this for _HasDropDown because it surpresses the onkeypress
+ // event needed to open the drop down when the user presses the SPACE key.
+ if(!("openDropDown" in this && obj == this._buttonNode)){
+ e.preventDefault();
+ }
+ }
+ }),
+ dc(obj, "onkeyup", this, function(e){
+ //console.log(this.id + ": onkeyup, e.target = ", e.target, ", lastKeyDownNode was ", dijit._lastKeyDownNode, ", equality is ", (e.target === dijit._lastKeyDownNode));
+ if( (e.keyCode == d.keys.ENTER || e.keyCode == d.keys.SPACE) &&
+ e.target == dijit._lastKeyDownNode && // === breaks greasemonkey
+ !e.ctrlKey && !e.shiftKey && !e.altKey && !e.metaKey){
+ //need reset here or have problems in FF when focus returns to trigger element after closing popup/alert
+ dijit._lastKeyDownNode = null;
+ return m(e);
+ }
+ })
+ );
+ }
+ }
+
+ return handles; // _Widget.Handle
+ },
+
+ ////////////////// MISCELLANEOUS METHODS ///////////////////
+
+ _onShow: function(){
+ // summary:
+ // Internal method called when this widget is made visible.
+ // See `onShow` for details.
+ this.onShow();
+ },
+
+ onShow: function(){
+ // summary:
+ // Called when this widget becomes the selected pane in a
+ // `dijit.layout.TabContainer`, `dijit.layout.StackContainer`,
+ // `dijit.layout.AccordionContainer`, etc.
+ //
+ // Also called to indicate display of a `dijit.Dialog`, `dijit.TooltipDialog`, or `dijit.TitlePane`.
+ // tags:
+ // callback
+ },
+
+ onHide: function(){
+ // summary:
+ // Called when another widget becomes the selected pane in a
+ // `dijit.layout.TabContainer`, `dijit.layout.StackContainer`,
+ // `dijit.layout.AccordionContainer`, etc.
+ //
+ // Also called to indicate hide of a `dijit.Dialog`, `dijit.TooltipDialog`, or `dijit.TitlePane`.
+ // tags:
+ // callback
+ },
+
+ onClose: function(){
+ // summary:
+ // Called when this widget is being displayed as a popup (ex: a Calendar popped
+ // up from a DateTextBox), and it is hidden.
+ // This is called from the dijit.popup code, and should not be called directly.
+ //
+ // Also used as a parameter for children of `dijit.layout.StackContainer` or subclasses.
+ // Callback if a user tries to close the child. Child will be closed if this function returns true.
+ // tags:
+ // extension
+
+ return true; // Boolean
+ }
+});
+
+})();
+
+}
+
+if(!dojo._hasResource["dojo.string"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojo.string"] = true;
+dojo.provide("dojo.string");
+
+
+dojo.getObject("string", true, dojo);
+
+/*=====
+dojo.string = {
+ // summary: String utilities for Dojo
+};
+=====*/
+
+dojo.string.rep = function(/*String*/str, /*Integer*/num){
+ // summary:
+ // Efficiently replicate a string `n` times.
+ // str:
+ // the string to replicate
+ // num:
+ // number of times to replicate the string
+
+ if(num <= 0 || !str){ return ""; }
+
+ var buf = [];
+ for(;;){
+ if(num & 1){
+ buf.push(str);
+ }
+ if(!(num >>= 1)){ break; }
+ str += str;
+ }
+ return buf.join(""); // String
+};
+
+dojo.string.pad = function(/*String*/text, /*Integer*/size, /*String?*/ch, /*Boolean?*/end){
+ // summary:
+ // Pad a string to guarantee that it is at least `size` length by
+ // filling with the character `ch` at either the start or end of the
+ // string. Pads at the start, by default.
+ // text:
+ // the string to pad
+ // size:
+ // length to provide padding
+ // ch:
+ // character to pad, defaults to '0'
+ // end:
+ // adds padding at the end if true, otherwise pads at start
+ // example:
+ // | // Fill the string to length 10 with "+" characters on the right. Yields "Dojo++++++".
+ // | dojo.string.pad("Dojo", 10, "+", true);
+
+ if(!ch){
+ ch = '0';
+ }
+ var out = String(text),
+ pad = dojo.string.rep(ch, Math.ceil((size - out.length) / ch.length));
+ return end ? out + pad : pad + out; // String
+};
+
+dojo.string.substitute = function( /*String*/ template,
+ /*Object|Array*/map,
+ /*Function?*/ transform,
+ /*Object?*/ thisObject){
+ // summary:
+ // Performs parameterized substitutions on a string. Throws an
+ // exception if any parameter is unmatched.
+ // template:
+ // a string with expressions in the form `${key}` to be replaced or
+ // `${key:format}` which specifies a format function. keys are case-sensitive.
+ // map:
+ // hash to search for substitutions
+ // transform:
+ // a function to process all parameters before substitution takes
+ // place, e.g. mylib.encodeXML
+ // thisObject:
+ // where to look for optional format function; default to the global
+ // namespace
+ // example:
+ // Substitutes two expressions in a string from an Array or Object
+ // | // returns "File 'foo.html' is not found in directory '/temp'."
+ // | // by providing substitution data in an Array
+ // | dojo.string.substitute(
+ // | "File '${0}' is not found in directory '${1}'.",
+ // | ["foo.html","/temp"]
+ // | );
+ // |
+ // | // also returns "File 'foo.html' is not found in directory '/temp'."
+ // | // but provides substitution data in an Object structure. Dotted
+ // | // notation may be used to traverse the structure.
+ // | dojo.string.substitute(
+ // | "File '${name}' is not found in directory '${info.dir}'.",
+ // | { name: "foo.html", info: { dir: "/temp" } }
+ // | );
+ // example:
+ // Use a transform function to modify the values:
+ // | // returns "file 'foo.html' is not found in directory '/temp'."
+ // | dojo.string.substitute(
+ // | "${0} is not found in ${1}.",
+ // | ["foo.html","/temp"],
+ // | function(str){
+ // | // try to figure out the type
+ // | var prefix = (str.charAt(0) == "/") ? "directory": "file";
+ // | return prefix + " '" + str + "'";
+ // | }
+ // | );
+ // example:
+ // Use a formatter
+ // | // returns "thinger -- howdy"
+ // | dojo.string.substitute(
+ // | "${0:postfix}", ["thinger"], null, {
+ // | postfix: function(value, key){
+ // | return value + " -- howdy";
+ // | }
+ // | }
+ // | );
+
+ thisObject = thisObject || dojo.global;
+ transform = transform ?
+ dojo.hitch(thisObject, transform) : function(v){ return v; };
+
+ return template.replace(/\$\{([^\s\:\}]+)(?:\:([^\s\:\}]+))?\}/g,
+ function(match, key, format){
+ var value = dojo.getObject(key, false, map);
+ if(format){
+ value = dojo.getObject(format, false, thisObject).call(thisObject, value, key);
+ }
+ return transform(value, key).toString();
+ }); // String
+};
+
+/*=====
+dojo.string.trim = function(str){
+ // summary:
+ // Trims whitespace from both sides of the string
+ // str: String
+ // String to be trimmed
+ // returns: String
+ // Returns the trimmed string
+ // description:
+ // This version of trim() was taken from [Steven Levithan's blog](http://blog.stevenlevithan.com/archives/faster-trim-javascript).
+ // The short yet performant version of this function is dojo.trim(),
+ // which is part of Dojo base. Uses String.prototype.trim instead, if available.
+ return ""; // String
+}
+=====*/
+
+dojo.string.trim = String.prototype.trim ?
+ dojo.trim : // aliasing to the native function
+ function(str){
+ str = str.replace(/^\s+/, '');
+ for(var i = str.length - 1; i >= 0; i--){
+ if(/\S/.test(str.charAt(i))){
+ str = str.substring(0, i + 1);
+ break;
+ }
+ }
+ return str;
+ };
+
+}
+
+if(!dojo._hasResource["dojo.cache"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojo.cache"] = true;
+dojo.provide("dojo.cache");
+
+
+
+/*=====
+dojo.cache = {
+ // summary:
+ // A way to cache string content that is fetchable via `dojo.moduleUrl`.
+};
+=====*/
+
+ var cache = {};
+ dojo.cache = function(/*String||Object*/module, /*String*/url, /*String||Object?*/value){
+ // summary:
+ // A getter and setter for storing the string content associated with the
+ // module and url arguments.
+ // description:
+ // module and url are used to call `dojo.moduleUrl()` to generate a module URL.
+ // If value is specified, the cache value for the moduleUrl will be set to
+ // that value. Otherwise, dojo.cache will fetch the moduleUrl and store it
+ // in its internal cache and return that cached value for the URL. To clear
+ // a cache value pass null for value. Since XMLHttpRequest (XHR) is used to fetch the
+ // the URL contents, only modules on the same domain of the page can use this capability.
+ // The build system can inline the cache values though, to allow for xdomain hosting.
+ // module: String||Object
+ // If a String, the module name to use for the base part of the URL, similar to module argument
+ // to `dojo.moduleUrl`. If an Object, something that has a .toString() method that
+ // generates a valid path for the cache item. For example, a dojo._Url object.
+ // url: String
+ // The rest of the path to append to the path derived from the module argument. If
+ // module is an object, then this second argument should be the "value" argument instead.
+ // value: String||Object?
+ // If a String, the value to use in the cache for the module/url combination.
+ // If an Object, it can have two properties: value and sanitize. The value property
+ // should be the value to use in the cache, and sanitize can be set to true or false,
+ // to indicate if XML declarations should be removed from the value and if the HTML
+ // inside a body tag in the value should be extracted as the real value. The value argument
+ // or the value property on the value argument are usually only used by the build system
+ // as it inlines cache content.
+ // example:
+ // To ask dojo.cache to fetch content and store it in the cache (the dojo["cache"] style
+ // of call is used to avoid an issue with the build system erroneously trying to intern
+ // this example. To get the build system to intern your dojo.cache calls, use the
+ // "dojo.cache" style of call):
+ // | //If template.html contains "<h1>Hello</h1>" that will be
+ // | //the value for the text variable.
+ // | var text = dojo["cache"]("my.module", "template.html");
+ // example:
+ // To ask dojo.cache to fetch content and store it in the cache, and sanitize the input
+ // (the dojo["cache"] style of call is used to avoid an issue with the build system
+ // erroneously trying to intern this example. To get the build system to intern your
+ // dojo.cache calls, use the "dojo.cache" style of call):
+ // | //If template.html contains "<html><body><h1>Hello</h1></body></html>", the
+ // | //text variable will contain just "<h1>Hello</h1>".
+ // | var text = dojo["cache"]("my.module", "template.html", {sanitize: true});
+ // example:
+ // Same example as previous, but demostrates how an object can be passed in as
+ // the first argument, then the value argument can then be the second argument.
+ // | //If template.html contains "<html><body><h1>Hello</h1></body></html>", the
+ // | //text variable will contain just "<h1>Hello</h1>".
+ // | var text = dojo["cache"](new dojo._Url("my/module/template.html"), {sanitize: true});
+
+ //Module could be a string, or an object that has a toString() method
+ //that will return a useful path. If it is an object, then the "url" argument
+ //will actually be the value argument.
+ if(typeof module == "string"){
+ var pathObj = dojo.moduleUrl(module, url);
+ }else{
+ pathObj = module;
+ value = url;
+ }
+ var key = pathObj.toString();
+
+ var val = value;
+ if(value != undefined && !dojo.isString(value)){
+ val = ("value" in value ? value.value : undefined);
+ }
+
+ var sanitize = value && value.sanitize ? true : false;
+
+ if(typeof val == "string"){
+ //We have a string, set cache value
+ val = cache[key] = sanitize ? dojo.cache._sanitize(val) : val;
+ }else if(val === null){
+ //Remove cached value
+ delete cache[key];
+ }else{
+ //Allow cache values to be empty strings. If key property does
+ //not exist, fetch it.
+ if(!(key in cache)){
+ val = dojo._getText(key);
+ cache[key] = sanitize ? dojo.cache._sanitize(val) : val;
+ }
+ val = cache[key];
+ }
+ return val; //String
+ };
+
+ dojo.cache._sanitize = function(/*String*/val){
+ // summary:
+ // Strips <?xml ...?> declarations so that external SVG and XML
+ // documents can be added to a document without worry. Also, if the string
+ // is an HTML document, only the part inside the body tag is returned.
+ // description:
+ // Copied from dijit._Templated._sanitizeTemplateString.
+ if(val){
+ val = val.replace(/^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im, "");
+ var matches = val.match(/<body[^>]*>\s*([\s\S]+)\s*<\/body>/im);
+ if(matches){
+ val = matches[1];
+ }
+ }else{
+ val = "";
+ }
+ return val; //String
+ };
+
+}
+
+if(!dojo._hasResource["dijit._Templated"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dijit._Templated"] = true;
+dojo.provide("dijit._Templated");
+
+
+
+
+
+
+
+dojo.declare("dijit._Templated",
+ null,
+ {
+ // summary:
+ // Mixin for widgets that are instantiated from a template
+
+ // templateString: [protected] String
+ // A string that represents the widget template. Pre-empts the
+ // templatePath. In builds that have their strings "interned", the
+ // templatePath is converted to an inline templateString, thereby
+ // preventing a synchronous network call.
+ //
+ // Use in conjunction with dojo.cache() to load from a file.
+ templateString: null,
+
+ // templatePath: [protected deprecated] String
+ // Path to template (HTML file) for this widget relative to dojo.baseUrl.
+ // Deprecated: use templateString with dojo.cache() instead.
+ templatePath: null,
+
+ // widgetsInTemplate: [protected] Boolean
+ // Should we parse the template to find widgets that might be
+ // declared in markup inside it? False by default.
+ widgetsInTemplate: false,
+
+ // skipNodeCache: [protected] Boolean
+ // If using a cached widget template node poses issues for a
+ // particular widget class, it can set this property to ensure
+ // that its template is always re-built from a string
+ _skipNodeCache: false,
+
+ // _earlyTemplatedStartup: Boolean
+ // A fallback to preserve the 1.0 - 1.3 behavior of children in
+ // templates having their startup called before the parent widget
+ // fires postCreate. Defaults to 'false', causing child widgets to
+ // have their .startup() called immediately before a parent widget
+ // .startup(), but always after the parent .postCreate(). Set to
+ // 'true' to re-enable to previous, arguably broken, behavior.
+ _earlyTemplatedStartup: false,
+
+/*=====
+ // _attachPoints: [private] String[]
+ // List of widget attribute names associated with dojoAttachPoint=... in the
+ // template, ex: ["containerNode", "labelNode"]
+ _attachPoints: [],
+ =====*/
+
+/*=====
+ // _attachEvents: [private] Handle[]
+ // List of connections associated with dojoAttachEvent=... in the
+ // template
+ _attachEvents: [],
+ =====*/
+
+ constructor: function(){
+ this._attachPoints = [];
+ this._attachEvents = [];
+ },
+
+ _stringRepl: function(tmpl){
+ // summary:
+ // Does substitution of ${foo} type properties in template string
+ // tags:
+ // private
+ var className = this.declaredClass, _this = this;
+ // Cache contains a string because we need to do property replacement
+ // do the property replacement
+ return dojo.string.substitute(tmpl, this, function(value, key){
+ if(key.charAt(0) == '!'){ value = dojo.getObject(key.substr(1), false, _this); }
+ if(typeof value == "undefined"){ throw new Error(className+" template:"+key); } // a debugging aide
+ if(value == null){ return ""; }
+
+ // Substitution keys beginning with ! will skip the transform step,
+ // in case a user wishes to insert unescaped markup, e.g. ${!foo}
+ return key.charAt(0) == "!" ? value :
+ // Safer substitution, see heading "Attribute values" in
+ // http://www.w3.org/TR/REC-html40/appendix/notes.html#h-B.3.2
+ value.toString().replace(/"/g,"&quot;"); //TODO: add &amp? use encodeXML method?
+ }, this);
+ },
+
+ buildRendering: function(){
+ // summary:
+ // Construct the UI for this widget from a template, setting this.domNode.
+ // tags:
+ // protected
+
+ // Lookup cached version of template, and download to cache if it
+ // isn't there already. Returns either a DomNode or a string, depending on
+ // whether or not the template contains ${foo} replacement parameters.
+ var cached = dijit._Templated.getCachedTemplate(this.templatePath, this.templateString, this._skipNodeCache);
+
+ var node;
+ if(dojo.isString(cached)){
+ node = dojo._toDom(this._stringRepl(cached));
+ if(node.nodeType != 1){
+ // Flag common problems such as templates with multiple top level nodes (nodeType == 11)
+ throw new Error("Invalid template: " + cached);
+ }
+ }else{
+ // if it's a node, all we have to do is clone it
+ node = cached.cloneNode(true);
+ }
+
+ this.domNode = node;
+
+ // Call down to _Widget.buildRendering() to get base classes assigned
+ // TODO: change the baseClass assignment to attributeMap
+ this.inherited(arguments);
+
+ // recurse through the node, looking for, and attaching to, our
+ // attachment points and events, which should be defined on the template node.
+ this._attachTemplateNodes(node);
+
+ if(this.widgetsInTemplate){
+ // Store widgets that we need to start at a later point in time
+ var cw = (this._startupWidgets = dojo.parser.parse(node, {
+ noStart: !this._earlyTemplatedStartup,
+ template: true,
+ inherited: {dir: this.dir, lang: this.lang},
+ propsThis: this, // so data-dojo-props of widgets in the template can reference "this" to refer to me
+ scope: "dojo" // even in multi-version mode templates use dojoType/data-dojo-type
+ }));
+
+ this._supportingWidgets = dijit.findWidgets(node);
+
+ this._attachTemplateNodes(cw, function(n,p){
+ return n[p];
+ });
+ }
+
+ this._fillContent(this.srcNodeRef);
+ },
+
+ _fillContent: function(/*DomNode*/ source){
+ // summary:
+ // Relocate source contents to templated container node.
+ // this.containerNode must be able to receive children, or exceptions will be thrown.
+ // tags:
+ // protected
+ var dest = this.containerNode;
+ if(source && dest){
+ while(source.hasChildNodes()){
+ dest.appendChild(source.firstChild);
+ }
+ }
+ },
+
+ _attachTemplateNodes: function(rootNode, getAttrFunc){
+ // summary:
+ // Iterate through the template and attach functions and nodes accordingly.
+ // Alternately, if rootNode is an array of widgets, then will process dojoAttachPoint
+ // etc. for those widgets.
+ // description:
+ // Map widget properties and functions to the handlers specified in
+ // the dom node and it's descendants. This function iterates over all
+ // nodes and looks for these properties:
+ // * dojoAttachPoint
+ // * dojoAttachEvent
+ // * waiRole
+ // * waiState
+ // rootNode: DomNode|Array[Widgets]
+ // the node to search for properties. All children will be searched.
+ // getAttrFunc: Function?
+ // a function which will be used to obtain property for a given
+ // DomNode/Widget
+ // tags:
+ // private
+
+ getAttrFunc = getAttrFunc || function(n,p){ return n.getAttribute(p); };
+
+ var nodes = dojo.isArray(rootNode) ? rootNode : (rootNode.all || rootNode.getElementsByTagName("*"));
+ var x = dojo.isArray(rootNode) ? 0 : -1;
+ for(; x<nodes.length; x++){
+ var baseNode = (x == -1) ? rootNode : nodes[x];
+ if(this.widgetsInTemplate && (getAttrFunc(baseNode, "dojoType") || getAttrFunc(baseNode, "data-dojo-type"))){
+ continue;
+ }
+ // Process dojoAttachPoint
+ var attachPoint = getAttrFunc(baseNode, "dojoAttachPoint") || getAttrFunc(baseNode, "data-dojo-attach-point");
+ if(attachPoint){
+ var point, points = attachPoint.split(/\s*,\s*/);
+ while((point = points.shift())){
+ if(dojo.isArray(this[point])){
+ this[point].push(baseNode);
+ }else{
+ this[point]=baseNode;
+ }
+ this._attachPoints.push(point);
+ }
+ }
+
+ // Process dojoAttachEvent
+ var attachEvent = getAttrFunc(baseNode, "dojoAttachEvent") || getAttrFunc(baseNode, "data-dojo-attach-event");;
+ if(attachEvent){
+ // NOTE: we want to support attributes that have the form
+ // "domEvent: nativeEvent; ..."
+ var event, events = attachEvent.split(/\s*,\s*/);
+ var trim = dojo.trim;
+ while((event = events.shift())){
+ if(event){
+ var thisFunc = null;
+ if(event.indexOf(":") != -1){
+ // oh, if only JS had tuple assignment
+ var funcNameArr = event.split(":");
+ event = trim(funcNameArr[0]);
+ thisFunc = trim(funcNameArr[1]);
+ }else{
+ event = trim(event);
+ }
+ if(!thisFunc){
+ thisFunc = event;
+ }
+ this._attachEvents.push(this.connect(baseNode, event, thisFunc));
+ }
+ }
+ }
+
+ // waiRole, waiState
+ // TODO: remove this in 2.0, templates are now using role=... and aria-XXX=... attributes directicly
+ var role = getAttrFunc(baseNode, "waiRole");
+ if(role){
+ dijit.setWaiRole(baseNode, role);
+ }
+ var values = getAttrFunc(baseNode, "waiState");
+ if(values){
+ dojo.forEach(values.split(/\s*,\s*/), function(stateValue){
+ if(stateValue.indexOf('-') != -1){
+ var pair = stateValue.split('-');
+ dijit.setWaiState(baseNode, pair[0], pair[1]);
+ }
+ });
+ }
+ }
+ },
+
+ startup: function(){
+ dojo.forEach(this._startupWidgets, function(w){
+ if(w && !w._started && w.startup){
+ w.startup();
+ }
+ });
+ this.inherited(arguments);
+ },
+
+ destroyRendering: function(){
+ // Delete all attach points to prevent IE6 memory leaks.
+ dojo.forEach(this._attachPoints, function(point){
+ delete this[point];
+ }, this);
+ this._attachPoints = [];
+
+ // And same for event handlers
+ dojo.forEach(this._attachEvents, this.disconnect, this);
+ this._attachEvents = [];
+
+ this.inherited(arguments);
+ }
+ }
+);
+
+// key is either templatePath or templateString; object is either string or DOM tree
+dijit._Templated._templateCache = {};
+
+dijit._Templated.getCachedTemplate = function(templatePath, templateString, alwaysUseString){
+ // summary:
+ // Static method to get a template based on the templatePath or
+ // templateString key
+ // templatePath: String||dojo.uri.Uri
+ // The URL to get the template from.
+ // templateString: String?
+ // a string to use in lieu of fetching the template from a URL. Takes precedence
+ // over templatePath
+ // returns: Mixed
+ // Either string (if there are ${} variables that need to be replaced) or just
+ // a DOM tree (if the node can be cloned directly)
+
+ // is it already cached?
+ var tmplts = dijit._Templated._templateCache;
+ var key = templateString || templatePath;
+ var cached = tmplts[key];
+ if(cached){
+ try{
+ // if the cached value is an innerHTML string (no ownerDocument) or a DOM tree created within the current document, then use the current cached value
+ if(!cached.ownerDocument || cached.ownerDocument == dojo.doc){
+ // string or node of the same document
+ return cached;
+ }
+ }catch(e){ /* squelch */ } // IE can throw an exception if cached.ownerDocument was reloaded
+ dojo.destroy(cached);
+ }
+
+ // If necessary, load template string from template path
+ if(!templateString){
+ templateString = dojo.cache(templatePath, {sanitize: true});
+ }
+ templateString = dojo.string.trim(templateString);
+
+ if(alwaysUseString || templateString.match(/\$\{([^\}]+)\}/g)){
+ // there are variables in the template so all we can do is cache the string
+ return (tmplts[key] = templateString); //String
+ }else{
+ // there are no variables in the template so we can cache the DOM tree
+ var node = dojo._toDom(templateString);
+ if(node.nodeType != 1){
+ throw new Error("Invalid template: " + templateString);
+ }
+ return (tmplts[key] = node); //Node
+ }
+};
+
+if(dojo.isIE){
+ dojo.addOnWindowUnload(function(){
+ var cache = dijit._Templated._templateCache;
+ for(var key in cache){
+ var value = cache[key];
+ if(typeof value == "object"){ // value is either a string or a DOM node template
+ dojo.destroy(value);
+ }
+ delete cache[key];
+ }
+ });
+}
+
+// These arguments can be specified for widgets which are used in templates.
+// Since any widget can be specified as sub widgets in template, mix it
+// into the base widget class. (This is a hack, but it's effective.)
+dojo.extend(dijit._Widget,{
+ dojoAttachEvent: "",
+ dojoAttachPoint: "",
+ waiRole: "",
+ waiState:""
+});
+
+}
+
+if(!dojo._hasResource["dijit._Container"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dijit._Container"] = true;
+dojo.provide("dijit._Container");
+
+
+
+dojo.declare("dijit._Container",
+ null,
+ {
+ // summary:
+ // Mixin for widgets that contain a set of widget children.
+ // description:
+ // Use this mixin for widgets that needs to know about and
+ // keep track of their widget children. Suitable for widgets like BorderContainer
+ // and TabContainer which contain (only) a set of child widgets.
+ //
+ // It's not suitable for widgets like ContentPane
+ // which contains mixed HTML (plain DOM nodes in addition to widgets),
+ // and where contained widgets are not necessarily directly below
+ // this.containerNode. In that case calls like addChild(node, position)
+ // wouldn't make sense.
+
+ // isContainer: [protected] Boolean
+ // Indicates that this widget acts as a "parent" to the descendant widgets.
+ // When the parent is started it will call startup() on the child widgets.
+ // See also `isLayoutContainer`.
+ isContainer: true,
+
+ buildRendering: function(){
+ this.inherited(arguments);
+ if(!this.containerNode){
+ // all widgets with descendants must set containerNode
+ this.containerNode = this.domNode;
+ }
+ },
+
+ addChild: function(/*dijit._Widget*/ widget, /*int?*/ insertIndex){
+ // summary:
+ // Makes the given widget a child of this widget.
+ // description:
+ // Inserts specified child widget's dom node as a child of this widget's
+ // container node, and possibly does other processing (such as layout).
+
+ var refNode = this.containerNode;
+ if(insertIndex && typeof insertIndex == "number"){
+ var children = this.getChildren();
+ if(children && children.length >= insertIndex){
+ refNode = children[insertIndex-1].domNode;
+ insertIndex = "after";
+ }
+ }
+ dojo.place(widget.domNode, refNode, insertIndex);
+
+ // If I've been started but the child widget hasn't been started,
+ // start it now. Make sure to do this after widget has been
+ // inserted into the DOM tree, so it can see that it's being controlled by me,
+ // so it doesn't try to size itself.
+ if(this._started && !widget._started){
+ widget.startup();
+ }
+ },
+
+ removeChild: function(/*Widget or int*/ widget){
+ // summary:
+ // Removes the passed widget instance from this widget but does
+ // not destroy it. You can also pass in an integer indicating
+ // the index within the container to remove
+
+ if(typeof widget == "number"){
+ widget = this.getChildren()[widget];
+ }
+
+ if(widget){
+ var node = widget.domNode;
+ if(node && node.parentNode){
+ node.parentNode.removeChild(node); // detach but don't destroy
+ }
+ }
+ },
+
+ hasChildren: function(){
+ // summary:
+ // Returns true if widget has children, i.e. if this.containerNode contains something.
+ return this.getChildren().length > 0; // Boolean
+ },
+
+ destroyDescendants: function(/*Boolean*/ preserveDom){
+ // summary:
+ // Destroys all the widgets inside this.containerNode,
+ // but not this widget itself
+ dojo.forEach(this.getChildren(), function(child){ child.destroyRecursive(preserveDom); });
+ },
+
+ _getSiblingOfChild: function(/*dijit._Widget*/ child, /*int*/ dir){
+ // summary:
+ // Get the next or previous widget sibling of child
+ // dir:
+ // if 1, get the next sibling
+ // if -1, get the previous sibling
+ // tags:
+ // private
+ var node = child.domNode,
+ which = (dir>0 ? "nextSibling" : "previousSibling");
+ do{
+ node = node[which];
+ }while(node && (node.nodeType != 1 || !dijit.byNode(node)));
+ return node && dijit.byNode(node); // dijit._Widget
+ },
+
+ getIndexOfChild: function(/*dijit._Widget*/ child){
+ // summary:
+ // Gets the index of the child in this container or -1 if not found
+ return dojo.indexOf(this.getChildren(), child); // int
+ },
+
+ startup: function(){
+ // summary:
+ // Called after all the widgets have been instantiated and their
+ // dom nodes have been inserted somewhere under dojo.doc.body.
+ //
+ // Widgets should override this method to do any initialization
+ // dependent on other widgets existing, and then call
+ // this superclass method to finish things off.
+ //
+ // startup() in subclasses shouldn't do anything
+ // size related because the size of the widget hasn't been set yet.
+
+ if(this._started){ return; }
+
+ // Startup all children of this widget
+ dojo.forEach(this.getChildren(), function(child){ child.startup(); });
+
+ this.inherited(arguments);
+ }
+ }
+);
+
+}
+
+if(!dojo._hasResource["dijit._Contained"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dijit._Contained"] = true;
+dojo.provide("dijit._Contained");
+
+
+
+dojo.declare("dijit._Contained",
+ null,
+ {
+ // summary:
+ // Mixin for widgets that are children of a container widget
+ //
+ // example:
+ // | // make a basic custom widget that knows about it's parents
+ // | dojo.declare("my.customClass",[dijit._Widget,dijit._Contained],{});
+
+ getParent: function(){
+ // summary:
+ // Returns the parent widget of this widget, assuming the parent
+ // specifies isContainer
+ var parent = dijit.getEnclosingWidget(this.domNode.parentNode);
+ return parent && parent.isContainer ? parent : null;
+ },
+
+ _getSibling: function(/*String*/ which){
+ // summary:
+ // Returns next or previous sibling
+ // which:
+ // Either "next" or "previous"
+ // tags:
+ // private
+ var node = this.domNode;
+ do{
+ node = node[which+"Sibling"];
+ }while(node && node.nodeType != 1);
+ return node && dijit.byNode(node); // dijit._Widget
+ },
+
+ getPreviousSibling: function(){
+ // summary:
+ // Returns null if this is the first child of the parent,
+ // otherwise returns the next element sibling to the "left".
+
+ return this._getSibling("previous"); // dijit._Widget
+ },
+
+ getNextSibling: function(){
+ // summary:
+ // Returns null if this is the last child of the parent,
+ // otherwise returns the next element sibling to the "right".
+
+ return this._getSibling("next"); // dijit._Widget
+ },
+
+ getIndexInParent: function(){
+ // summary:
+ // Returns the index of this widget within its container parent.
+ // It returns -1 if the parent does not exist, or if the parent
+ // is not a dijit._Container
+
+ var p = this.getParent();
+ if(!p || !p.getIndexOfChild){
+ return -1; // int
+ }
+ return p.getIndexOfChild(this); // int
+ }
+ }
+ );
+
+}
+
+if(!dojo._hasResource["dijit.layout._LayoutWidget"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dijit.layout._LayoutWidget"] = true;
+dojo.provide("dijit.layout._LayoutWidget");
+
+
+
+
+
+
+dojo.declare("dijit.layout._LayoutWidget",
+ [dijit._Widget, dijit._Container, dijit._Contained],
+ {
+ // summary:
+ // Base class for a _Container widget which is responsible for laying out its children.
+ // Widgets which mixin this code must define layout() to manage placement and sizing of the children.
+
+ // baseClass: [protected extension] String
+ // This class name is applied to the widget's domNode
+ // and also may be used to generate names for sub nodes,
+ // for example dijitTabContainer-content.
+ baseClass: "dijitLayoutContainer",
+
+ // isLayoutContainer: [protected] Boolean
+ // Indicates that this widget is going to call resize() on its
+ // children widgets, setting their size, when they become visible.
+ isLayoutContainer: true,
+
+ buildRendering: function(){
+ this.inherited(arguments);
+ dojo.addClass(this.domNode, "dijitContainer");
+ },
+
+ startup: function(){
+ // summary:
+ // Called after all the widgets have been instantiated and their
+ // dom nodes have been inserted somewhere under dojo.doc.body.
+ //
+ // Widgets should override this method to do any initialization
+ // dependent on other widgets existing, and then call
+ // this superclass method to finish things off.
+ //
+ // startup() in subclasses shouldn't do anything
+ // size related because the size of the widget hasn't been set yet.
+
+ if(this._started){ return; }
+
+ // Need to call inherited first - so that child widgets get started
+ // up correctly
+ this.inherited(arguments);
+
+ // If I am a not being controlled by a parent layout widget...
+ var parent = this.getParent && this.getParent()
+ if(!(parent && parent.isLayoutContainer)){
+ // Do recursive sizing and layout of all my descendants
+ // (passing in no argument to resize means that it has to glean the size itself)
+ this.resize();
+
+ // Since my parent isn't a layout container, and my style *may be* width=height=100%
+ // or something similar (either set directly or via a CSS class),
+ // monitor when my size changes so that I can re-layout.
+ // For browsers where I can't directly monitor when my size changes,
+ // monitor when the viewport changes size, which *may* indicate a size change for me.
+ this.connect(dojo.isIE ? this.domNode : dojo.global, 'onresize', function(){
+ // Using function(){} closure to ensure no arguments to resize.
+ this.resize();
+ });
+ }
+ },
+
+ resize: function(changeSize, resultSize){
+ // summary:
+ // Call this to resize a widget, or after its size has changed.
+ // description:
+ // Change size mode:
+ // When changeSize is specified, changes the marginBox of this widget
+ // and forces it to relayout its contents accordingly.
+ // changeSize may specify height, width, or both.
+ //
+ // If resultSize is specified it indicates the size the widget will
+ // become after changeSize has been applied.
+ //
+ // Notification mode:
+ // When changeSize is null, indicates that the caller has already changed
+ // the size of the widget, or perhaps it changed because the browser
+ // window was resized. Tells widget to relayout its contents accordingly.
+ //
+ // If resultSize is also specified it indicates the size the widget has
+ // become.
+ //
+ // In either mode, this method also:
+ // 1. Sets this._borderBox and this._contentBox to the new size of
+ // the widget. Queries the current domNode size if necessary.
+ // 2. Calls layout() to resize contents (and maybe adjust child widgets).
+ //
+ // changeSize: Object?
+ // Sets the widget to this margin-box size and position.
+ // May include any/all of the following properties:
+ // | {w: int, h: int, l: int, t: int}
+ //
+ // resultSize: Object?
+ // The margin-box size of this widget after applying changeSize (if
+ // changeSize is specified). If caller knows this size and
+ // passes it in, we don't need to query the browser to get the size.
+ // | {w: int, h: int}
+
+ var node = this.domNode;
+
+ // set margin box size, unless it wasn't specified, in which case use current size
+ if(changeSize){
+ dojo.marginBox(node, changeSize);
+
+ // set offset of the node
+ if(changeSize.t){ node.style.top = changeSize.t + "px"; }
+ if(changeSize.l){ node.style.left = changeSize.l + "px"; }
+ }
+
+ // If either height or width wasn't specified by the user, then query node for it.
+ // But note that setting the margin box and then immediately querying dimensions may return
+ // inaccurate results, so try not to depend on it.
+ var mb = resultSize || {};
+ dojo.mixin(mb, changeSize || {}); // changeSize overrides resultSize
+ if( !("h" in mb) || !("w" in mb) ){
+ mb = dojo.mixin(dojo.marginBox(node), mb); // just use dojo.marginBox() to fill in missing values
+ }
+
+ // Compute and save the size of my border box and content box
+ // (w/out calling dojo.contentBox() since that may fail if size was recently set)
+ var cs = dojo.getComputedStyle(node);
+ var me = dojo._getMarginExtents(node, cs);
+ var be = dojo._getBorderExtents(node, cs);
+ var bb = (this._borderBox = {
+ w: mb.w - (me.w + be.w),
+ h: mb.h - (me.h + be.h)
+ });
+ var pe = dojo._getPadExtents(node, cs);
+ this._contentBox = {
+ l: dojo._toPixelValue(node, cs.paddingLeft),
+ t: dojo._toPixelValue(node, cs.paddingTop),
+ w: bb.w - pe.w,
+ h: bb.h - pe.h
+ };
+
+ // Callback for widget to adjust size of its children
+ this.layout();
+ },
+
+ layout: function(){
+ // summary:
+ // Widgets override this method to size and position their contents/children.
+ // When this is called this._contentBox is guaranteed to be set (see resize()).
+ //
+ // This is called after startup(), and also when the widget's size has been
+ // changed.
+ // tags:
+ // protected extension
+ },
+
+ _setupChild: function(/*dijit._Widget*/child){
+ // summary:
+ // Common setup for initial children and children which are added after startup
+ // tags:
+ // protected extension
+
+ var cls = this.baseClass + "-child "
+ + (child.baseClass ? this.baseClass + "-" + child.baseClass : "");
+ dojo.addClass(child.domNode, cls);
+ },
+
+ addChild: function(/*dijit._Widget*/ child, /*Integer?*/ insertIndex){
+ // Overrides _Container.addChild() to call _setupChild()
+ this.inherited(arguments);
+ if(this._started){
+ this._setupChild(child);
+ }
+ },
+
+ removeChild: function(/*dijit._Widget*/ child){
+ // Overrides _Container.removeChild() to remove class added by _setupChild()
+ var cls = this.baseClass + "-child"
+ + (child.baseClass ?
+ " " + this.baseClass + "-" + child.baseClass : "");
+ dojo.removeClass(child.domNode, cls);
+
+ this.inherited(arguments);
+ }
+ }
+);
+
+dijit.layout.marginBox2contentBox = function(/*DomNode*/ node, /*Object*/ mb){
+ // summary:
+ // Given the margin-box size of a node, return its content box size.
+ // Functions like dojo.contentBox() but is more reliable since it doesn't have
+ // to wait for the browser to compute sizes.
+ var cs = dojo.getComputedStyle(node);
+ var me = dojo._getMarginExtents(node, cs);
+ var pb = dojo._getPadBorderExtents(node, cs);
+ return {
+ l: dojo._toPixelValue(node, cs.paddingLeft),
+ t: dojo._toPixelValue(node, cs.paddingTop),
+ w: mb.w - (me.w + pb.w),
+ h: mb.h - (me.h + pb.h)
+ };
+};
+
+(function(){
+ var capitalize = function(word){
+ return word.substring(0,1).toUpperCase() + word.substring(1);
+ };
+
+ var size = function(widget, dim){
+ // size the child
+ widget.resize ? widget.resize(dim) : dojo.marginBox(widget.domNode, dim);
+
+ // record child's size, but favor our own numbers when we have them.
+ // the browser lies sometimes
+ dojo.mixin(widget, dojo.marginBox(widget.domNode));
+ dojo.mixin(widget, dim);
+ };
+
+ dijit.layout.layoutChildren = function(/*DomNode*/ container, /*Object*/ dim, /*Widget[]*/ children,
+ /*String?*/ changedRegionId, /*Number?*/ changedRegionSize){
+ // summary
+ // Layout a bunch of child dom nodes within a parent dom node
+ // container:
+ // parent node
+ // dim:
+ // {l, t, w, h} object specifying dimensions of container into which to place children
+ // children:
+ // an array of Widgets or at least objects containing:
+ // * domNode: pointer to DOM node to position
+ // * region or layoutAlign: position to place DOM node
+ // * resize(): (optional) method to set size of node
+ // * id: (optional) Id of widgets, referenced from resize object, below.
+ // changedRegionId:
+ // If specified, the slider for the region with the specified id has been dragged, and thus
+ // the region's height or width should be adjusted according to changedRegionSize
+ // changedRegionSize:
+ // See changedRegionId.
+
+ // copy dim because we are going to modify it
+ dim = dojo.mixin({}, dim);
+
+ dojo.addClass(container, "dijitLayoutContainer");
+
+ // Move "client" elements to the end of the array for layout. a11y dictates that the author
+ // needs to be able to put them in the document in tab-order, but this algorithm requires that
+ // client be last. TODO: move these lines to LayoutContainer? Unneeded other places I think.
+ children = dojo.filter(children, function(item){ return item.region != "center" && item.layoutAlign != "client"; })
+ .concat(dojo.filter(children, function(item){ return item.region == "center" || item.layoutAlign == "client"; }));
+
+ // set positions/sizes
+ dojo.forEach(children, function(child){
+ var elm = child.domNode,
+ pos = (child.region || child.layoutAlign);
+
+ // set elem to upper left corner of unused space; may move it later
+ var elmStyle = elm.style;
+ elmStyle.left = dim.l+"px";
+ elmStyle.top = dim.t+"px";
+ elmStyle.bottom = elmStyle.right = "auto";
+
+ dojo.addClass(elm, "dijitAlign" + capitalize(pos));
+
+ // Size adjustments to make to this child widget
+ var sizeSetting = {};
+
+ // Check for optional size adjustment due to splitter drag (height adjustment for top/bottom align
+ // panes and width adjustment for left/right align panes.
+ if(changedRegionId && changedRegionId == child.id){
+ sizeSetting[child.region == "top" || child.region == "bottom" ? "h" : "w"] = changedRegionSize;
+ }
+
+ // set size && adjust record of remaining space.
+ // note that setting the width of a <div> may affect its height.
+ if(pos == "top" || pos == "bottom"){
+ sizeSetting.w = dim.w;
+ size(child, sizeSetting);
+ dim.h -= child.h;
+ if(pos == "top"){
+ dim.t += child.h;
+ }else{
+ elmStyle.top = dim.t + dim.h + "px";
+ }
+ }else if(pos == "left" || pos == "right"){
+ sizeSetting.h = dim.h;
+ size(child, sizeSetting);
+ dim.w -= child.w;
+ if(pos == "left"){
+ dim.l += child.w;
+ }else{
+ elmStyle.left = dim.l + dim.w + "px";
+ }
+ }else if(pos == "client" || pos == "center"){
+ size(child, dim);
+ }
+ });
+ };
+
+})();
+
+}
+
+if(!dojo._hasResource["dijit._CssStateMixin"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dijit._CssStateMixin"] = true;
+dojo.provide("dijit._CssStateMixin");
+
+
+
+dojo.declare("dijit._CssStateMixin", [], {
+ // summary:
+ // Mixin for widgets to set CSS classes on the widget DOM nodes depending on hover/mouse press/focus
+ // state changes, and also higher-level state changes such becoming disabled or selected.
+ //
+ // description:
+ // By mixing this class into your widget, and setting the this.baseClass attribute, it will automatically
+ // maintain CSS classes on the widget root node (this.domNode) depending on hover,
+ // active, focus, etc. state. Ex: with a baseClass of dijitButton, it will apply the classes
+ // dijitButtonHovered and dijitButtonActive, as the user moves the mouse over the widget and clicks it.
+ //
+ // It also sets CSS like dijitButtonDisabled based on widget semantic state.
+ //
+ // By setting the cssStateNodes attribute, a widget can also track events on subnodes (like buttons
+ // within the widget).
+
+ // cssStateNodes: [protected] Object
+ // List of sub-nodes within the widget that need CSS classes applied on mouse hover/press and focus
+ //.
+ // Each entry in the hash is a an attachpoint names (like "upArrowButton") mapped to a CSS class names
+ // (like "dijitUpArrowButton"). Example:
+ // | {
+ // | "upArrowButton": "dijitUpArrowButton",
+ // | "downArrowButton": "dijitDownArrowButton"
+ // | }
+ // The above will set the CSS class dijitUpArrowButton to the this.upArrowButton DOMNode when it
+ // is hovered, etc.
+ cssStateNodes: {},
+
+ // hovering: [readonly] Boolean
+ // True if cursor is over this widget
+ hovering: false,
+
+ // active: [readonly] Boolean
+ // True if mouse was pressed while over this widget, and hasn't been released yet
+ active: false,
+
+ _applyAttributes: function(){
+ // This code would typically be in postCreate(), but putting in _applyAttributes() for
+ // performance: so the class changes happen before DOM is inserted into the document.
+ // Change back to postCreate() in 2.0. See #11635.
+
+ this.inherited(arguments);
+
+ // Automatically monitor mouse events (essentially :hover and :active) on this.domNode
+ dojo.forEach(["onmouseenter", "onmouseleave", "onmousedown"], function(e){
+ this.connect(this.domNode, e, "_cssMouseEvent");
+ }, this);
+
+ // Monitoring changes to disabled, readonly, etc. state, and update CSS class of root node
+ dojo.forEach(["disabled", "readOnly", "checked", "selected", "focused", "state", "hovering", "active"], function(attr){
+ this.watch(attr, dojo.hitch(this, "_setStateClass"));
+ }, this);
+
+ // Events on sub nodes within the widget
+ for(var ap in this.cssStateNodes){
+ this._trackMouseState(this[ap], this.cssStateNodes[ap]);
+ }
+ // Set state initially; there's probably no hover/active/focus state but widget might be
+ // disabled/readonly/checked/selected so we want to set CSS classes for those conditions.
+ this._setStateClass();
+ },
+
+ _cssMouseEvent: function(/*Event*/ event){
+ // summary:
+ // Sets hovering and active properties depending on mouse state,
+ // which triggers _setStateClass() to set appropriate CSS classes for this.domNode.
+
+ if(!this.disabled){
+ switch(event.type){
+ case "mouseenter":
+ case "mouseover": // generated on non-IE browsers even though we connected to mouseenter
+ this._set("hovering", true);
+ this._set("active", this._mouseDown);
+ break;
+
+ case "mouseleave":
+ case "mouseout": // generated on non-IE browsers even though we connected to mouseleave
+ this._set("hovering", false);
+ this._set("active", false);
+ break;
+
+ case "mousedown" :
+ this._set("active", true);
+ this._mouseDown = true;
+ // Set a global event to handle mouseup, so it fires properly
+ // even if the cursor leaves this.domNode before the mouse up event.
+ // Alternately could set active=false on mouseout.
+ var mouseUpConnector = this.connect(dojo.body(), "onmouseup", function(){
+ this._mouseDown = false;
+ this._set("active", false);
+ this.disconnect(mouseUpConnector);
+ });
+ break;
+ }
+ }
+ },
+
+ _setStateClass: function(){
+ // summary:
+ // Update the visual state of the widget by setting the css classes on this.domNode
+ // (or this.stateNode if defined) by combining this.baseClass with
+ // various suffixes that represent the current widget state(s).
+ //
+ // description:
+ // In the case where a widget has multiple
+ // states, it sets the class based on all possible
+ // combinations. For example, an invalid form widget that is being hovered
+ // will be "dijitInput dijitInputInvalid dijitInputHover dijitInputInvalidHover".
+ //
+ // The widget may have one or more of the following states, determined
+ // by this.state, this.checked, this.valid, and this.selected:
+ // - Error - ValidationTextBox sets this.state to "Error" if the current input value is invalid
+ // - Incomplete - ValidationTextBox sets this.state to "Incomplete" if the current input value is not finished yet
+ // - Checked - ex: a checkmark or a ToggleButton in a checked state, will have this.checked==true
+ // - Selected - ex: currently selected tab will have this.selected==true
+ //
+ // In addition, it may have one or more of the following states,
+ // based on this.disabled and flags set in _onMouse (this.active, this.hovering) and from focus manager (this.focused):
+ // - Disabled - if the widget is disabled
+ // - Active - if the mouse (or space/enter key?) is being pressed down
+ // - Focused - if the widget has focus
+ // - Hover - if the mouse is over the widget
+
+ // Compute new set of classes
+ var newStateClasses = this.baseClass.split(" ");
+
+ function multiply(modifier){
+ newStateClasses = newStateClasses.concat(dojo.map(newStateClasses, function(c){ return c+modifier; }), "dijit"+modifier);
+ }
+
+ if(!this.isLeftToRight()){
+ // For RTL mode we need to set an addition class like dijitTextBoxRtl.
+ multiply("Rtl");
+ }
+
+ if(this.checked){
+ multiply("Checked");
+ }
+ if(this.state){
+ multiply(this.state);
+ }
+ if(this.selected){
+ multiply("Selected");
+ }
+
+ if(this.disabled){
+ multiply("Disabled");
+ }else if(this.readOnly){
+ multiply("ReadOnly");
+ }else{
+ if(this.active){
+ multiply("Active");
+ }else if(this.hovering){
+ multiply("Hover");
+ }
+ }
+
+ if(this._focused){
+ multiply("Focused");
+ }
+
+ // Remove old state classes and add new ones.
+ // For performance concerns we only write into domNode.className once.
+ var tn = this.stateNode || this.domNode,
+ classHash = {}; // set of all classes (state and otherwise) for node
+
+ dojo.forEach(tn.className.split(" "), function(c){ classHash[c] = true; });
+
+ if("_stateClasses" in this){
+ dojo.forEach(this._stateClasses, function(c){ delete classHash[c]; });
+ }
+
+ dojo.forEach(newStateClasses, function(c){ classHash[c] = true; });
+
+ var newClasses = [];
+ for(var c in classHash){
+ newClasses.push(c);
+ }
+ tn.className = newClasses.join(" ");
+
+ this._stateClasses = newStateClasses;
+ },
+
+ _trackMouseState: function(/*DomNode*/ node, /*String*/ clazz){
+ // summary:
+ // Track mouse/focus events on specified node and set CSS class on that node to indicate
+ // current state. Usually not called directly, but via cssStateNodes attribute.
+ // description:
+ // Given class=foo, will set the following CSS class on the node
+ // - fooActive: if the user is currently pressing down the mouse button while over the node
+ // - fooHover: if the user is hovering the mouse over the node, but not pressing down a button
+ // - fooFocus: if the node is focused
+ //
+ // Note that it won't set any classes if the widget is disabled.
+ // node: DomNode
+ // Should be a sub-node of the widget, not the top node (this.domNode), since the top node
+ // is handled specially and automatically just by mixing in this class.
+ // clazz: String
+ // CSS class name (ex: dijitSliderUpArrow).
+
+ // Current state of node (initially false)
+ // NB: setting specifically to false because dojo.toggleClass() needs true boolean as third arg
+ var hovering=false, active=false, focused=false;
+
+ var self = this,
+ cn = dojo.hitch(this, "connect", node);
+
+ function setClass(){
+ var disabled = ("disabled" in self && self.disabled) || ("readonly" in self && self.readonly);
+ dojo.toggleClass(node, clazz+"Hover", hovering && !active && !disabled);
+ dojo.toggleClass(node, clazz+"Active", active && !disabled);
+ dojo.toggleClass(node, clazz+"Focused", focused && !disabled);
+ }
+
+ // Mouse
+ cn("onmouseenter", function(){
+ hovering = true;
+ setClass();
+ });
+ cn("onmouseleave", function(){
+ hovering = false;
+ active = false;
+ setClass();
+ });
+ cn("onmousedown", function(){
+ active = true;
+ setClass();
+ });
+ cn("onmouseup", function(){
+ active = false;
+ setClass();
+ });
+
+ // Focus
+ cn("onfocus", function(){
+ focused = true;
+ setClass();
+ });
+ cn("onblur", function(){
+ focused = false;
+ setClass();
+ });
+
+ // Just in case widget is enabled/disabled while it has focus/hover/active state.
+ // Maybe this is overkill.
+ this.watch("disabled", setClass);
+ this.watch("readOnly", setClass);
+ }
+});
+
+}
+
+if(!dojo._hasResource["dijit.form._FormWidget"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dijit.form._FormWidget"] = true;
+dojo.provide("dijit.form._FormWidget");
+
+
+
+
+
+
+
+dojo.declare("dijit.form._FormWidget", [dijit._Widget, dijit._Templated, dijit._CssStateMixin],
+ {
+ // summary:
+ // Base class for widgets corresponding to native HTML elements such as <checkbox> or <button>,
+ // which can be children of a <form> node or a `dijit.form.Form` widget.
+ //
+ // description:
+ // Represents a single HTML element.
+ // All these widgets should have these attributes just like native HTML input elements.
+ // You can set them during widget construction or afterwards, via `dijit._Widget.attr`.
+ //
+ // They also share some common methods.
+
+ // name: [const] String
+ // Name used when submitting form; same as "name" attribute or plain HTML elements
+ name: "",
+
+ // alt: String
+ // Corresponds to the native HTML <input> element's attribute.
+ alt: "",
+
+ // value: String
+ // Corresponds to the native HTML <input> element's attribute.
+ value: "",
+
+ // type: String
+ // Corresponds to the native HTML <input> element's attribute.
+ type: "text",
+
+ // tabIndex: Integer
+ // Order fields are traversed when user hits the tab key
+ tabIndex: "0",
+
+ // disabled: Boolean
+ // Should this widget respond to user input?
+ // In markup, this is specified as "disabled='disabled'", or just "disabled".
+ disabled: false,
+
+ // intermediateChanges: Boolean
+ // Fires onChange for each value change or only on demand
+ intermediateChanges: false,
+
+ // scrollOnFocus: Boolean
+ // On focus, should this widget scroll into view?
+ scrollOnFocus: true,
+
+ // These mixins assume that the focus node is an INPUT, as many but not all _FormWidgets are.
+ attributeMap: dojo.delegate(dijit._Widget.prototype.attributeMap, {
+ value: "focusNode",
+ id: "focusNode",
+ tabIndex: "focusNode",
+ alt: "focusNode",
+ title: "focusNode"
+ }),
+
+ postMixInProperties: function(){
+ // Setup name=foo string to be referenced from the template (but only if a name has been specified)
+ // Unfortunately we can't use attributeMap to set the name due to IE limitations, see #8660
+ // Regarding escaping, see heading "Attribute values" in
+ // http://www.w3.org/TR/REC-html40/appendix/notes.html#h-B.3.2
+ this.nameAttrSetting = this.name ? ('name="' + this.name.replace(/'/g, "&quot;") + '"') : '';
+ this.inherited(arguments);
+ },
+
+ postCreate: function(){
+ this.inherited(arguments);
+ this.connect(this.domNode, "onmousedown", "_onMouseDown");
+ },
+
+ _setDisabledAttr: function(/*Boolean*/ value){
+ this._set("disabled", value);
+ dojo.attr(this.focusNode, 'disabled', value);
+ if(this.valueNode){
+ dojo.attr(this.valueNode, 'disabled', value);
+ }
+ dijit.setWaiState(this.focusNode, "disabled", value);
+
+ if(value){
+ // reset these, because after the domNode is disabled, we can no longer receive
+ // mouse related events, see #4200
+ this._set("hovering", false);
+ this._set("active", false);
+
+ // clear tab stop(s) on this widget's focusable node(s) (ComboBox has two focusable nodes)
+ var attachPointNames = "tabIndex" in this.attributeMap ? this.attributeMap.tabIndex : "focusNode";
+ dojo.forEach(dojo.isArray(attachPointNames) ? attachPointNames : [attachPointNames], function(attachPointName){
+ var node = this[attachPointName];
+ // complex code because tabIndex=-1 on a <div> doesn't work on FF
+ if(dojo.isWebKit || dijit.hasDefaultTabStop(node)){ // see #11064 about webkit bug
+ node.setAttribute('tabIndex', "-1");
+ }else{
+ node.removeAttribute('tabIndex');
+ }
+ }, this);
+ }else{
+ if(this.tabIndex != ""){
+ this.focusNode.setAttribute('tabIndex', this.tabIndex);
+ }
+ }
+ },
+
+ setDisabled: function(/*Boolean*/ disabled){
+ // summary:
+ // Deprecated. Use set('disabled', ...) instead.
+ dojo.deprecated("setDisabled("+disabled+") is deprecated. Use set('disabled',"+disabled+") instead.", "", "2.0");
+ this.set('disabled', disabled);
+ },
+
+ _onFocus: function(e){
+ if(this.scrollOnFocus){
+ dojo.window.scrollIntoView(this.domNode);
+ }
+ this.inherited(arguments);
+ },
+
+ isFocusable: function(){
+ // summary:
+ // Tells if this widget is focusable or not. Used internally by dijit.
+ // tags:
+ // protected
+ return !this.disabled && this.focusNode && (dojo.style(this.domNode, "display") != "none");
+ },
+
+ focus: function(){
+ // summary:
+ // Put focus on this widget
+ if(!this.disabled){
+ dijit.focus(this.focusNode);
+ }
+ },
+
+ compare: function(/*anything*/ val1, /*anything*/ val2){
+ // summary:
+ // Compare 2 values (as returned by get('value') for this widget).
+ // tags:
+ // protected
+ if(typeof val1 == "number" && typeof val2 == "number"){
+ return (isNaN(val1) && isNaN(val2)) ? 0 : val1 - val2;
+ }else if(val1 > val2){
+ return 1;
+ }else if(val1 < val2){
+ return -1;
+ }else{
+ return 0;
+ }
+ },
+
+ onChange: function(newValue){
+ // summary:
+ // Callback when this widget's value is changed.
+ // tags:
+ // callback
+ },
+
+ // _onChangeActive: [private] Boolean
+ // Indicates that changes to the value should call onChange() callback.
+ // This is false during widget initialization, to avoid calling onChange()
+ // when the initial value is set.
+ _onChangeActive: false,
+
+ _handleOnChange: function(/*anything*/ newValue, /*Boolean?*/ priorityChange){
+ // summary:
+ // Called when the value of the widget is set. Calls onChange() if appropriate
+ // newValue:
+ // the new value
+ // priorityChange:
+ // For a slider, for example, dragging the slider is priorityChange==false,
+ // but on mouse up, it's priorityChange==true. If intermediateChanges==false,
+ // onChange is only called form priorityChange=true events.
+ // tags:
+ // private
+ if(this._lastValueReported == undefined && (priorityChange === null || !this._onChangeActive)){
+ // this block executes not for a change, but during initialization,
+ // and is used to store away the original value (or for ToggleButton, the original checked state)
+ this._resetValue = this._lastValueReported = newValue;
+ }
+ this._pendingOnChange = this._pendingOnChange
+ || (typeof newValue != typeof this._lastValueReported)
+ || (this.compare(newValue, this._lastValueReported) != 0);
+ if((this.intermediateChanges || priorityChange || priorityChange === undefined) && this._pendingOnChange){
+ this._lastValueReported = newValue;
+ this._pendingOnChange = false;
+ if(this._onChangeActive){
+ if(this._onChangeHandle){
+ clearTimeout(this._onChangeHandle);
+ }
+ // setTimout allows hidden value processing to run and
+ // also the onChange handler can safely adjust focus, etc
+ this._onChangeHandle = setTimeout(dojo.hitch(this,
+ function(){
+ this._onChangeHandle = null;
+ this.onChange(newValue);
+ }), 0); // try to collapse multiple onChange's fired faster than can be processed
+ }
+ }
+ },
+
+ create: function(){
+ // Overrides _Widget.create()
+ this.inherited(arguments);
+ this._onChangeActive = true;
+ },
+
+ destroy: function(){
+ if(this._onChangeHandle){ // destroy called before last onChange has fired
+ clearTimeout(this._onChangeHandle);
+ this.onChange(this._lastValueReported);
+ }
+ this.inherited(arguments);
+ },
+
+ setValue: function(/*String*/ value){
+ // summary:
+ // Deprecated. Use set('value', ...) instead.
+ dojo.deprecated("dijit.form._FormWidget:setValue("+value+") is deprecated. Use set('value',"+value+") instead.", "", "2.0");
+ this.set('value', value);
+ },
+
+ getValue: function(){
+ // summary:
+ // Deprecated. Use get('value') instead.
+ dojo.deprecated(this.declaredClass+"::getValue() is deprecated. Use get('value') instead.", "", "2.0");
+ return this.get('value');
+ },
+
+ _onMouseDown: function(e){
+ // If user clicks on the button, even if the mouse is released outside of it,
+ // this button should get focus (to mimics native browser buttons).
+ // This is also needed on chrome because otherwise buttons won't get focus at all,
+ // which leads to bizarre focus restore on Dialog close etc.
+ if(!e.ctrlKey && dojo.mouseButtons.isLeft(e) && this.isFocusable()){ // !e.ctrlKey to ignore right-click on mac
+ // Set a global event to handle mouseup, so it fires properly
+ // even if the cursor leaves this.domNode before the mouse up event.
+ var mouseUpConnector = this.connect(dojo.body(), "onmouseup", function(){
+ if (this.isFocusable()) {
+ this.focus();
+ }
+ this.disconnect(mouseUpConnector);
+ });
+ }
+ }
+});
+
+dojo.declare("dijit.form._FormValueWidget", dijit.form._FormWidget,
+{
+ // summary:
+ // Base class for widgets corresponding to native HTML elements such as <input> or <select> that have user changeable values.
+ // description:
+ // Each _FormValueWidget represents a single input value, and has a (possibly hidden) <input> element,
+ // to which it serializes it's input value, so that form submission (either normal submission or via FormBind?)
+ // works as expected.
+
+ // Don't attempt to mixin the 'type', 'name' attributes here programatically -- they must be declared
+ // directly in the template as read by the parser in order to function. IE is known to specifically
+ // require the 'name' attribute at element creation time. See #8484, #8660.
+ // TODO: unclear what that {value: ""} is for; FormWidget.attributeMap copies value to focusNode,
+ // so maybe {value: ""} is so the value *doesn't* get copied to focusNode?
+ // Seems like we really want value removed from attributeMap altogether
+ // (although there's no easy way to do that now)
+
+ // readOnly: Boolean
+ // Should this widget respond to user input?
+ // In markup, this is specified as "readOnly".
+ // Similar to disabled except readOnly form values are submitted.
+ readOnly: false,
+
+ attributeMap: dojo.delegate(dijit.form._FormWidget.prototype.attributeMap, {
+ value: "",
+ readOnly: "focusNode"
+ }),
+
+ _setReadOnlyAttr: function(/*Boolean*/ value){
+ dojo.attr(this.focusNode, 'readOnly', value);
+ dijit.setWaiState(this.focusNode, "readonly", value);
+ this._set("readOnly", value);
+ },
+
+ postCreate: function(){
+ this.inherited(arguments);
+
+ if(dojo.isIE){ // IE won't stop the event with keypress
+ this.connect(this.focusNode || this.domNode, "onkeydown", this._onKeyDown);
+ }
+ // Update our reset value if it hasn't yet been set (because this.set()
+ // is only called when there *is* a value)
+ if(this._resetValue === undefined){
+ this._lastValueReported = this._resetValue = this.value;
+ }
+ },
+
+ _setValueAttr: function(/*anything*/ newValue, /*Boolean?*/ priorityChange){
+ // summary:
+ // Hook so set('value', value) works.
+ // description:
+ // Sets the value of the widget.
+ // If the value has changed, then fire onChange event, unless priorityChange
+ // is specified as null (or false?)
+ this._handleOnChange(newValue, priorityChange);
+ },
+
+ _handleOnChange: function(/*anything*/ newValue, /*Boolean?*/ priorityChange){
+ // summary:
+ // Called when the value of the widget has changed. Saves the new value in this.value,
+ // and calls onChange() if appropriate. See _FormWidget._handleOnChange() for details.
+ this._set("value", newValue);
+ this.inherited(arguments);
+ },
+
+ undo: function(){
+ // summary:
+ // Restore the value to the last value passed to onChange
+ this._setValueAttr(this._lastValueReported, false);
+ },
+
+ reset: function(){
+ // summary:
+ // Reset the widget's value to what it was at initialization time
+ this._hasBeenBlurred = false;
+ this._setValueAttr(this._resetValue, true);
+ },
+
+ _onKeyDown: function(e){
+ if(e.keyCode == dojo.keys.ESCAPE && !(e.ctrlKey || e.altKey || e.metaKey)){
+ var te;
+ if(dojo.isIE){
+ e.preventDefault(); // default behavior needs to be stopped here since keypress is too late
+ te = document.createEventObject();
+ te.keyCode = dojo.keys.ESCAPE;
+ te.shiftKey = e.shiftKey;
+ e.srcElement.fireEvent('onkeypress', te);
+ }
+ }
+ },
+
+ _layoutHackIE7: function(){
+ // summary:
+ // Work around table sizing bugs on IE7 by forcing redraw
+
+ if(dojo.isIE == 7){ // fix IE7 layout bug when the widget is scrolled out of sight
+ var domNode = this.domNode;
+ var parent = domNode.parentNode;
+ var pingNode = domNode.firstChild || domNode; // target node most unlikely to have a custom filter
+ var origFilter = pingNode.style.filter; // save custom filter, most likely nothing
+ var _this = this;
+ while(parent && parent.clientHeight == 0){ // search for parents that haven't rendered yet
+ (function ping(){
+ var disconnectHandle = _this.connect(parent, "onscroll",
+ function(e){
+ _this.disconnect(disconnectHandle); // only call once
+ pingNode.style.filter = (new Date()).getMilliseconds(); // set to anything that's unique
+ setTimeout(function(){ pingNode.style.filter = origFilter }, 0); // restore custom filter, if any
+ }
+ );
+ })();
+ parent = parent.parentNode;
+ }
+ }
+ }
+});
+
+}
+
+if(!dojo._hasResource["dijit.dijit"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dijit.dijit"] = true;
+dojo.provide("dijit.dijit");
+
+
+
+
+
+
+
+
+
+
+/*=====
+dijit.dijit = {
+ // summary:
+ // A roll-up for common dijit methods
+ // description:
+ // A rollup file for the build system including the core and common
+ // dijit files.
+ //
+ // example:
+ // | <script type="text/javascript" src="js/dojo/dijit/dijit.js"></script>
+ //
+};
+=====*/
+
+// All the stuff in _base (these are the function that are guaranteed available without an explicit dojo.require)
+
+// And some other stuff that we tend to pull in all the time anyway
+
+}
+
+
+}};});