From f0cfe83e3725f9a3928da97a6e3085e79cb25309 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Mon, 18 Mar 2013 10:26:24 +0400 Subject: upgrade dojo to 1.8.3 (refs #570) --- lib/dijit/_base/focus.js | 2 +- lib/dijit/_base/focus.js.uncompressed.js | 323 +++++++++++++++++++++++++++ lib/dijit/_base/manager.js | 2 +- lib/dijit/_base/manager.js.uncompressed.js | 35 +++ lib/dijit/_base/place.js | 2 +- lib/dijit/_base/place.js.uncompressed.js | 131 +++++++++++ lib/dijit/_base/popup.js | 2 +- lib/dijit/_base/popup.js.uncompressed.js | 58 +++++ lib/dijit/_base/scroll.js | 2 +- lib/dijit/_base/scroll.js.uncompressed.js | 22 ++ lib/dijit/_base/sniff.js.uncompressed.js | 12 + lib/dijit/_base/typematic.js.uncompressed.js | 10 + lib/dijit/_base/wai.js | 2 +- lib/dijit/_base/wai.js.uncompressed.js | 109 +++++++++ lib/dijit/_base/window.js | 2 +- lib/dijit/_base/window.js.uncompressed.js | 18 ++ 16 files changed, 725 insertions(+), 7 deletions(-) create mode 100644 lib/dijit/_base/focus.js.uncompressed.js create mode 100644 lib/dijit/_base/manager.js.uncompressed.js create mode 100644 lib/dijit/_base/place.js.uncompressed.js create mode 100644 lib/dijit/_base/popup.js.uncompressed.js create mode 100644 lib/dijit/_base/scroll.js.uncompressed.js create mode 100644 lib/dijit/_base/sniff.js.uncompressed.js create mode 100644 lib/dijit/_base/typematic.js.uncompressed.js create mode 100644 lib/dijit/_base/wai.js.uncompressed.js create mode 100644 lib/dijit/_base/window.js.uncompressed.js (limited to 'lib/dijit/_base') diff --git a/lib/dijit/_base/focus.js b/lib/dijit/_base/focus.js index 840329992..0f8a7f92d 100644 --- a/lib/dijit/_base/focus.js +++ b/lib/dijit/_base/focus.js @@ -1,2 +1,2 @@ //>>built -define("dijit/_base/focus",["dojo/_base/array","dojo/dom","dojo/_base/lang","dojo/topic","dojo/_base/window","../focus",".."],function(_1,_2,_3,_4,_5,_6,_7){_3.mixin(_7,{_curFocus:null,_prevFocus:null,isCollapsed:function(){return _7.getBookmark().isCollapsed;},getBookmark:function(){var bm,rg,tg,_8=_5.doc.selection,cf=_6.curNode;if(_5.global.getSelection){_8=_5.global.getSelection();if(_8){if(_8.isCollapsed){tg=cf?cf.tagName:"";if(tg){tg=tg.toLowerCase();if(tg=="textarea"||(tg=="input"&&(!cf.type||cf.type.toLowerCase()=="text"))){_8={start:cf.selectionStart,end:cf.selectionEnd,node:cf,pRange:true};return {isCollapsed:(_8.end<=_8.start),mark:_8};}}bm={isCollapsed:true};if(_8.rangeCount){bm.mark=_8.getRangeAt(0).cloneRange();}}else{rg=_8.getRangeAt(0);bm={isCollapsed:false,mark:rg.cloneRange()};}}}else{if(_8){tg=cf?cf.tagName:"";tg=tg.toLowerCase();if(cf&&tg&&(tg=="button"||tg=="textarea"||tg=="input")){if(_8.type&&_8.type.toLowerCase()=="none"){return {isCollapsed:true,mark:null};}else{rg=_8.createRange();return {isCollapsed:rg.text&&rg.text.length?false:true,mark:{range:rg,pRange:true}};}}bm={};try{rg=_8.createRange();bm.isCollapsed=!(_8.type=="Text"?rg.htmlText.length:rg.length);}catch(e){bm.isCollapsed=true;return bm;}if(_8.type.toUpperCase()=="CONTROL"){if(rg.length){bm.mark=[];var i=0,_9=rg.length;while(i<_9){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(_a){var _b=_5.doc,_c=_a.mark;if(_c){if(_5.global.getSelection){var _d=_5.global.getSelection();if(_d&&_d.removeAllRanges){if(_c.pRange){var n=_c.node;n.selectionStart=_c.start;n.selectionEnd=_c.end;}else{_d.removeAllRanges();_d.addRange(_c);}}else{console.warn("No idea how to restore selection for this browser!");}}else{if(_b.selection&&_c){var rg;if(_c.pRange){rg=_c.range;}else{if(_3.isArray(_c)){rg=_b.body.createControlRange();_1.forEach(_c,function(n){rg.addElement(n);});}else{rg=_b.body.createTextRange();rg.moveToBookmark(_c);}}rg.select();}}}},getFocus:function(_e,_f){var _10=!_6.curNode||(_e&&_2.isDescendant(_6.curNode,_e.domNode))?_7._prevFocus:_6.curNode;return {node:_10,bookmark:_10&&(_10==_6.curNode)&&_5.withGlobal(_f||_5.global,_7.getBookmark),openedForWindow:_f};},_activeStack:[],registerIframe:function(_11){return _6.registerIframe(_11);},unregisterIframe:function(_12){_12&&_12.remove();},registerWin:function(_13,_14){return _6.registerWin(_13,_14);},unregisterWin:function(_15){_15&&_15.remove();}});_6.focus=function(_16){if(!_16){return;}var _17="node" in _16?_16.node:_16,_18=_16.bookmark,_19=_16.openedForWindow,_1a=_18?_18.isCollapsed:false;if(_17){var _1b=(_17.tagName.toLowerCase()=="iframe")?_17.contentWindow:_17;if(_1b&&_1b.focus){try{_1b.focus();}catch(e){}}_6._onFocusNode(_17);}if(_18&&_5.withGlobal(_19||_5.global,_7.isCollapsed)&&!_1a){if(_19){_19.focus();}try{_5.withGlobal(_19||_5.global,_7.moveToBookmark,null,[_18]);}catch(e2){}}};_6.watch("curNode",function(_1c,_1d,_1e){_7._curFocus=_1e;_7._prevFocus=_1d;if(_1e){_4.publish("focusNode",_1e);}});_6.watch("activeStack",function(_1f,_20,_21){_7._activeStack=_21;});_6.on("widget-blur",function(_22,by){_4.publish("widgetBlur",_22,by);});_6.on("widget-focus",function(_23,by){_4.publish("widgetFocus",_23,by);});return _7;}); \ No newline at end of file +define("dijit/_base/focus",["dojo/_base/array","dojo/dom","dojo/_base/lang","dojo/topic","dojo/_base/window","../focus","../main"],function(_1,_2,_3,_4,_5,_6,_7){var _8={_curFocus:null,_prevFocus:null,isCollapsed:function(){return _7.getBookmark().isCollapsed;},getBookmark:function(){var bm,rg,tg,_9=_5.doc.selection,cf=_6.curNode;if(_5.global.getSelection){_9=_5.global.getSelection();if(_9){if(_9.isCollapsed){tg=cf?cf.tagName:"";if(tg){tg=tg.toLowerCase();if(tg=="textarea"||(tg=="input"&&(!cf.type||cf.type.toLowerCase()=="text"))){_9={start:cf.selectionStart,end:cf.selectionEnd,node:cf,pRange:true};return {isCollapsed:(_9.end<=_9.start),mark:_9};}}bm={isCollapsed:true};if(_9.rangeCount){bm.mark=_9.getRangeAt(0).cloneRange();}}else{rg=_9.getRangeAt(0);bm={isCollapsed:false,mark:rg.cloneRange()};}}}else{if(_9){tg=cf?cf.tagName:"";tg=tg.toLowerCase();if(cf&&tg&&(tg=="button"||tg=="textarea"||tg=="input")){if(_9.type&&_9.type.toLowerCase()=="none"){return {isCollapsed:true,mark:null};}else{rg=_9.createRange();return {isCollapsed:rg.text&&rg.text.length?false:true,mark:{range:rg,pRange:true}};}}bm={};try{rg=_9.createRange();bm.isCollapsed=!(_9.type=="Text"?rg.htmlText.length:rg.length);}catch(e){bm.isCollapsed=true;return bm;}if(_9.type.toUpperCase()=="CONTROL"){if(rg.length){bm.mark=[];var i=0,_a=rg.length;while(i<_a){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(_b){var _c=_5.doc,_d=_b.mark;if(_d){if(_5.global.getSelection){var _e=_5.global.getSelection();if(_e&&_e.removeAllRanges){if(_d.pRange){var n=_d.node;n.selectionStart=_d.start;n.selectionEnd=_d.end;}else{_e.removeAllRanges();_e.addRange(_d);}}else{console.warn("No idea how to restore selection for this browser!");}}else{if(_c.selection&&_d){var rg;if(_d.pRange){rg=_d.range;}else{if(_3.isArray(_d)){rg=_c.body.createControlRange();_1.forEach(_d,function(n){rg.addElement(n);});}else{rg=_c.body.createTextRange();rg.moveToBookmark(_d);}}rg.select();}}}},getFocus:function(_f,_10){var _11=!_6.curNode||(_f&&_2.isDescendant(_6.curNode,_f.domNode))?_7._prevFocus:_6.curNode;return {node:_11,bookmark:_11&&(_11==_6.curNode)&&_5.withGlobal(_10||_5.global,_7.getBookmark),openedForWindow:_10};},_activeStack:[],registerIframe:function(_12){return _6.registerIframe(_12);},unregisterIframe:function(_13){_13&&_13.remove();},registerWin:function(_14,_15){return _6.registerWin(_14,_15);},unregisterWin:function(_16){_16&&_16.remove();}};_6.focus=function(_17){if(!_17){return;}var _18="node" in _17?_17.node:_17,_19=_17.bookmark,_1a=_17.openedForWindow,_1b=_19?_19.isCollapsed:false;if(_18){var _1c=(_18.tagName.toLowerCase()=="iframe")?_18.contentWindow:_18;if(_1c&&_1c.focus){try{_1c.focus();}catch(e){}}_6._onFocusNode(_18);}if(_19&&_5.withGlobal(_1a||_5.global,_7.isCollapsed)&&!_1b){if(_1a){_1a.focus();}try{_5.withGlobal(_1a||_5.global,_7.moveToBookmark,null,[_19]);}catch(e2){}}};_6.watch("curNode",function(_1d,_1e,_1f){_7._curFocus=_1f;_7._prevFocus=_1e;if(_1f){_4.publish("focusNode",_1f);}});_6.watch("activeStack",function(_20,_21,_22){_7._activeStack=_22;});_6.on("widget-blur",function(_23,by){_4.publish("widgetBlur",_23,by);});_6.on("widget-focus",function(_24,by){_4.publish("widgetFocus",_24,by);});_3.mixin(_7,_8);return _7;}); \ No newline at end of file diff --git a/lib/dijit/_base/focus.js.uncompressed.js b/lib/dijit/_base/focus.js.uncompressed.js new file mode 100644 index 000000000..5d1e94ea6 --- /dev/null +++ b/lib/dijit/_base/focus.js.uncompressed.js @@ -0,0 +1,323 @@ +define("dijit/_base/focus", [ + "dojo/_base/array", // array.forEach + "dojo/dom", // dom.isDescendant + "dojo/_base/lang", // lang.isArray + "dojo/topic", // publish + "dojo/_base/window", // win.doc win.doc.selection win.global win.global.getSelection win.withGlobal + "../focus", + "../main" // for exporting symbols to dijit +], function(array, dom, lang, topic, win, focus, dijit){ + + // module: + // dijit/_base/focus + + var exports = { + // summary: + // Deprecated module to monitor currently focused node and stack of currently focused widgets. + // New code should access dijit/focus directly. + + // _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 = win.doc.selection, cf = focus.curNode; + + if(win.global.getSelection){ + //W3C Range API for selections. + sel = win.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}; + if(sel.rangeCount){ + bm.mark = sel.getRangeAt(0).cloneRange(); + } + }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` itself. + // description: + // Currently only used by editor. + // returns: + // Handle to pass to unregisterIframe() + return focus.registerIframe(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() + + handle && handle.remove(); + }, + + 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() + + return focus.registerWin(targetWindow, effectiveNode); + }, + + 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. + + handle && handle.remove(); + } + }; + + // Override focus singleton's focus function so that dijit.focus() + // has backwards compatible behavior of restoring selection (although + // probably no one is using that). + focus.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