a:17:{s:9:"#provides";s:5:"dijit";s:9:"#resource";s:14:"_base/focus.js";s:15:"dijit._curFocus";a:2:{s:7:"private";b:1;s:7:"summary";s:0:"";}s:16:"dijit._prevFocus";a:2:{s:7:"private";b:1;s:7:"summary";s:0:"";}s:17:"dijit.isCollapsed";a:4:{s:4:"type";s:8:"Function";s:6:"source";s:613:" var _document = dojo.doc; if(_document.selection){ // IE var s=_document.selection; if(s.type=='Text'){ return !s.createRange().htmlText.length; // Boolean }else{ //Control range return !s.createRange().length; // Boolean } }else{ var _window = dojo.global; var selection = _window.getSelection(); if(dojo.isString(selection)){ // Safari // TODO: this is dead code; safari is taking the else branch. remove after 1.3. return !selection; // Boolean }else{ // Mozilla/W3 return !selection || selection.isCollapsed || !selection.toString(); // Boolean } }";s:7:"summary";s:41:"Returns true if there is no text selected";s:7:"returns";s:7:"Boolean";}s:17:"dijit.getBookmark";a:4:{s:4:"type";s:8:"Function";s:6:"source";s:690:" var bookmark, selection = dojo.doc.selection; if(selection){ // IE var range = selection.createRange(); if(selection.type.toUpperCase()=='CONTROL'){ if(range.length){ bookmark=[]; var i=0,len=range.length; while(i 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) if(bookmark && dojo.withGlobal(openedForWindow||dojo.global, dijit.isCollapsed)){ if(openedForWindow){ openedForWindow.focus(); } try{ dojo.withGlobal(openedForWindow||dojo.global, dijit.moveToBookmark, null, [bookmark]); }catch(e){ /*squelch IE internal error, see http://trac.dojotoolkit.org/ticket/1984 */ } }";s:7:"summary";s:126:"Sets the focused node and the selection according to argument. To set focus to an iframe's content, pass in the iframe itself.";}s:18:"dijit._activeStack";a:2:{s:7:"private";b:1;s:7:"summary";s:0:"";}s:20:"dijit.registerIframe";a:5:{s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:6:"iframe";a:1:{s:4:"type";s:7:"DomNode";}}s:6:"source";s:50:" dijit.registerWin(iframe.contentWindow, iframe);";s:7:"summary";s:176:"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.";s:11:"description";s:30:"Currently only used by editor.";}s:17:"dijit.registerWin";a:6:{s:4:"type";s:8:"Function";s:10:"parameters";a:2:{s:12:"targetWindow";a:3:{s:8:"optional";b:1;s:4:"type";s:6:"Window";s:7:"summary";s:86:"If specified this is the window associated with the iframe, i.e. iframe.contentWindow.";}s:13:"effectiveNode";a:2:{s:8:"optional";b:1;s:4:"type";s:7:"DomNode";}}s:6:"source";s:8280:"dojo.provide("dijit._base.focus"); // summary: // These functions are used to query or set the focus and selection. // // Also, they trace when widgets become actived/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 var _document = dojo.doc; if(_document.selection){ // IE var s=_document.selection; if(s.type=='Text'){ return !s.createRange().htmlText.length; // Boolean }else{ //Control range return !s.createRange().length; // Boolean } }else{ var _window = dojo.global; var selection = _window.getSelection(); if(dojo.isString(selection)){ // Safari // TODO: this is dead code; safari is taking the else branch. remove after 1.3. return !selection; // Boolean }else{ // Mozilla/W3 return !selection || selection.isCollapsed || !selection.toString(); // Boolean } } }, getBookmark: function(){ // summary: // Retrieves a bookmark that can be used with moveToBookmark to return to the same range var bookmark, selection = dojo.doc.selection; if(selection){ // IE var range = selection.createRange(); if(selection.type.toUpperCase()=='CONTROL'){ if(range.length){ bookmark=[]; var i=0,len=range.length; while(i 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) if(bookmark && dojo.withGlobal(openedForWindow||dojo.global, dijit.isCollapsed)){ if(openedForWindow){ openedForWindow.focus(); } try{ dojo.withGlobal(openedForWindow||dojo.global, dijit.moveToBookmark, null, [bookmark]); }catch(e){ /*squelch IE internal error, see http://trac.dojotoolkit.org/ticket/1984 */ } } }, // _activeStack: Array // 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