Changeset 12184

Show
Ignore:
Timestamp:
01/28/08 15:46:34 (12 months ago)
Author:
doughays
Message:

Fixes #5711 !strict. Did a global find of "document" object references in dijit/ and replaced with "dojo.doc".

Location:
dijit/trunk
Files:
21 modified

Legend:

Unmodified
Added
Removed
  • dijit/trunk/ColorPalette.js

    r11519 r12184  
    113113                for(var row=0; row < choices.length; row++){ 
    114114                        for(var col=0; col < choices[row].length; col++) { 
    115                 var highlightNode = document.createElement("img"); 
     115                var highlightNode = dojo.doc.createElement("img"); 
    116116                highlightNode.src = url; 
    117117                dojo.addClass(highlightNode, "dijitPaletteImg"); 
  • dijit/trunk/Dialog.js

    r12179 r12184  
    310310 
    311311                        this._modalconnects.push(dojo.connect(window, "onscroll", this, "layout")); 
    312                         this._modalconnects.push(dojo.connect(document.documentElement, "onkeypress", this, "_onKey")); 
     312                        this._modalconnects.push(dojo.connect(dojo.doc.documentElement, "onkeypress", this, "_onKey")); 
    313313 
    314314                        dojo.style(this.domNode, "opacity", 0); 
  • dijit/trunk/form/ComboBox.js

    r12149 r12184  
    102102                        }else if(dojo.isIE){ 
    103103                                // in the case of a mouse click in a popup being handled, 
    104                                 // then the document.selection is not the textarea, but the popup 
    105                                 // var r = document.selection.createRange(); 
     104                                // then the dojo.doc.selection is not the textarea, but the popup 
     105                                // var r = dojo.doc.selection.createRange(); 
    106106                                // hack to get IE 6 to play nice. What a POS browser. 
    107                                 var tr = document.selection.createRange().duplicate(); 
     107                                var tr = dojo.doc.selection.createRange().duplicate(); 
    108108                                var ntr = element.createTextRange(); 
    109109                                tr.move("character",0); 
     
    154154                                var tcc = tchar.charCodeAt(0); 
    155155                                for(var x = 0; x < dist; x++){ 
    156                                         var te = document.createEvent("KeyEvents"); 
     156                                        var te = dojo.doc.createEvent("KeyEvents"); 
    157157                                        te.initKeyEvent("keypress", true, true, null, false, false, false, false, tcc, tcc); 
    158158                                        element.dispatchEvent(te); 
     
    733733 
    734734                        var labelObject = labelFunc(item); 
    735                         var menuitem = document.createElement("div"); 
     735                        var menuitem = dojo.doc.createElement("div"); 
    736736                        if(labelObject.html){ 
    737737                                menuitem.innerHTML = labelObject.label; 
    738738                        }else{ 
    739739                                menuitem.appendChild( 
    740                                         document.createTextNode(labelObject.label) 
     740                                        dojo.doc.createTextNode(labelObject.label) 
    741741                                ); 
    742742                        } 
  • dijit/trunk/form/Textarea.js

    r11994 r12184  
    6565                                        if(isFirst){ isFirst = false; } 
    6666                                        else{ 
    67                                                 editNode.appendChild(document.createElement("BR")); // preserve line breaks 
     67                                                editNode.appendChild(dojo.doc.createElement("BR")); // preserve line breaks 
    6868                                        } 
    6969                                        if(line){ 
    70                                                 editNode.appendChild(document.createTextNode(line)); // use text nodes so that imbedded tags can be edited 
     70                                                editNode.appendChild(dojo.doc.createTextNode(line)); // use text nodes so that imbedded tags can be edited 
    7171                                        } 
    7272                                }); 
    7373                        }else if(value){ 
    74                                 editNode.appendChild(document.createTextNode(value)); 
     74                                editNode.appendChild(dojo.doc.createTextNode(value)); 
    7575                        } 
    7676                        if(!dojo.isIE){ 
    77                                 editNode.appendChild(document.createElement("BR")); // so that you see a cursor 
     77                                editNode.appendChild(dojo.doc.createElement("BR")); // so that you see a cursor 
    7878                        } 
    7979                }else{ 
     
    9393                this.value = this.formValueNode.value = value; 
    9494                if(this.iframe){ 
    95                         var sizeNode = document.createElement('div'); 
     95                        var sizeNode = dojo.doc.createElement('div'); 
    9696                        editNode.appendChild(sizeNode); 
    9797                        var newHeight = sizeNode.offsetTop; 
     
    149149                                this._iframeEditTitle = label[0].innerHTML + " " + this._iframeEditTitle; 
    150150                        } 
    151                         var body = this.focusNode = this.editNode = document.createElement('BODY'); 
     151                        var body = this.focusNode = this.editNode = dojo.doc.createElement('BODY'); 
    152152                        body.style.margin="0px"; 
    153153                        body.style.padding="0px"; 
     
    236236                        // it will not hear anything. 
    237237                        // Create an equivalent event so everyone else knows what is going on. 
    238                         var te = document.createEvent("KeyEvents"); 
     238                        var te = dojo.doc.createEvent("KeyEvents"); 
    239239                        te.initKeyEvent("keypress", true, true, null, e.ctrlKey, e.altKey, e.shiftKey, e.metaKey, e.keyCode, e.charCode); 
    240240                        this.iframe.dispatchEvent(te); 
  • dijit/trunk/form/ValidationTextBox.js

    r12072 r12184  
    192192                postCreate: function(){ 
    193193                        var textbox = this.textbox; 
    194                         var valueNode = (this.valueNode = document.createElement("input")); 
     194                        var valueNode = (this.valueNode = dojo.doc.createElement("input")); 
    195195                        valueNode.setAttribute("type", textbox.type); 
    196196                        valueNode.setAttribute("value", this.toString()); 
  • dijit/trunk/InlineEditBox.js

    r12030 r12184  
    138138                // Put place holder (and eventually editWidget) before the display node so that it's positioned correctly 
    139139                // when Calendar dropdown appears, which happens automatically on focus. 
    140                 var placeholder = document.createElement("span"); 
     140                var placeholder = dojo.doc.createElement("span"); 
    141141                dojo.place(placeholder, this.domNode, "before"); 
    142142 
  • dijit/trunk/layout/BorderContainer.js

    r12175 r12184  
    244244                        if(this._right){ borderBox(this._right, {h: sidebarHeight}); } 
    245245 
    246                         if(dojo.isIE && (document.compatMode == "BackCompat" || dojo.isIE < 7)){ 
     246                        if(dojo.isIE && (dojo.doc.compatMode == "BackCompat" || dojo.isIE < 7)){ 
    247247//TODO: use dojo.marginBox instead of dojo.style? 
    248248/* 
  • dijit/trunk/layout/SplitContainer.js

    r11924 r12184  
    6060                        }catch(e){ this.sizerWidth = 7; } 
    6161                } 
    62                 var sizer = this.virtualSizer = document.createElement('div'); 
     62                var sizer = this.virtualSizer = dojo.doc.createElement('div'); 
    6363                sizer.style.position = 'relative'; 
    6464 
     
    110110 
    111111                // TODO: use a template for this!!! 
    112                 var sizer = this.sizers[i] = document.createElement('div'); 
     112                var sizer = this.sizers[i] = dojo.doc.createElement('div'); 
    113113                this.domNode.appendChild(sizer); 
    114114 
     
    116116 
    117117                // add the thumb div 
    118                 var thumb = document.createElement('div'); 
     118                var thumb = dojo.doc.createElement('div'); 
    119119                thumb.className = 'thumb'; 
    120120                sizer.appendChild(thumb); 
     
    386386                // 
    387387                this._ownconnects = []; 
    388                 this._ownconnects.push(dojo.connect(document.documentElement, "onmousemove", this, "changeSizing")); 
    389                 this._ownconnects.push(dojo.connect(document.documentElement, "onmouseup", this, "endSizing")); 
     388                this._ownconnects.push(dojo.connect(dojo.doc.documentElement, "onmousemove", this, "changeSizing")); 
     389                this._ownconnects.push(dojo.connect(dojo.doc.documentElement, "onmouseup", this, "endSizing")); 
    390390 
    391391                dojo.stopEvent(e); 
  • dijit/trunk/layout/StackContainer.js

    r11982 r12184  
    276276 
    277277                        // add a node that will be promoted to the button widget 
    278                         var refNode = document.createElement("span"); 
     278                        var refNode = dojo.doc.createElement("span"); 
    279279                        this.domNode.appendChild(refNode); 
    280280                        // create an instance of the button widget 
  • dijit/trunk/layout/_LayoutWidget.js

    r12157 r12184  
    2020                        // summary: 
    2121                        //              Called after all the widgets have been instantiated and their 
    22                         //              dom nodes have been inserted somewhere under document.body. 
     22                        //              dom nodes have been inserted somewhere under dojo.doc.body. 
    2323                        // 
    2424                        //              Widgets should override this method to do any initialization 
  • dijit/trunk/Menu.js

    r12029 r12184  
    151151                        // Moz. TODO: is this available when defaultView isn't? 
    152152                        dijit.Menu._iframeContentDocument(iframe_el)['__parent__'] || 
    153                         (iframe_el.name && document.frames[iframe_el.name]) || null; 
     153                        (iframe_el.name && dojo.doc.frames[iframe_el.name]) || null; 
    154154                return win;     //      Window 
    155155        }, 
     
    160160                var doc = iframe_el.contentDocument // W3 
    161161                        || (iframe_el.contentWindow && iframe_el.contentWindow.document) // IE 
    162                         || (iframe_el.name && document.frames[iframe_el.name] && document.frames[iframe_el.name].document) 
     162                        || (iframe_el.name && dojo.doc.frames[iframe_el.name] && dojo.doc.frames[iframe_el.name].document) 
    163163                        || null; 
    164164                return doc;     //      HTMLDocument 
     
    427427 
    428428                // we didn't copy the dropdown widget from the this.srcNodeRef, so it's in no-man's 
    429                 // land now.  move it to document.body. 
     429                // land now.  move it to dojo.doc.body. 
    430430                if(!this.popup){ 
    431431                        var node = dojo.query("[widgetId]", this.dropDownContainer)[0]; 
  • dijit/trunk/Tree.js

    r12118 r12184  
    140140        setLabelNode: function(label){ 
    141141                this.labelNode.innerHTML=""; 
    142                 this.labelNode.appendChild(document.createTextNode(label)); 
     142                this.labelNode.appendChild(dojo.doc.createTextNode(label)); 
    143143        }, 
    144144 
     
    341341                // make template for container node (we will clone this and insert it into 
    342342                // any nodes that have children) 
    343                 var div = document.createElement('div'); 
     343                var div = dojo.doc.createElement('div'); 
    344344                div.style.display = 'none'; 
    345345                div.className = "dijitTreeContainer";    
  • dijit/trunk/_base/place.js

    r12145 r12184  
    102102 
    103103        // This won't work if the node is inside a <div style="position: relative">, 
    104         // so reattach it to document.body.   (Otherwise, the positioning will be wrong 
     104        // so reattach it to dojo.doc.body.   (Otherwise, the positioning will be wrong 
    105105        // and also it might get cutoff) 
    106106        if(!node.parentNode || String(node.parentNode.tagName).toLowerCase() != "body"){ 
  • dijit/trunk/_base/popup.js

    r12162 r12184  
    1919                // 
    2020                // description: 
    21                 //              Attaches node to document.body, and 
     21                //              Attaches node to dojo.doc.body, and 
    2222                //              positions it off screen, but not display:none, so that 
    2323                //              the widget doesn't appear in the page flow and/or cause a blank 
     
    246246                node.appendChild(iframe); 
    247247                if(dojo.isIE){ 
    248                         iframe.style.setExpression("width", "document.getElementById('" + node.id + "').offsetWidth"); 
    249                         iframe.style.setExpression("height", "document.getElementById('" + node.id + "').offsetHeight"); 
     248                        iframe.style.setExpression("width", "dojo.doc.getElementById('" + node.id + "').offsetWidth"); 
     249                        iframe.style.setExpression("height", "dojo.doc.getElementById('" + node.id + "').offsetHeight"); 
    250250                } 
    251251                this.iframe = iframe; 
  • dijit/trunk/_base/wai.js

    r12048 r12184  
    1414                var div; 
    1515                // create div for testing if high contrast mode is on or images are turned off 
    16                 div = document.createElement("div"); 
     16                div = dojo.doc.createElement("div"); 
    1717                div.id = "a11yTestNode"; 
    1818                div.style.cssText = 'border: 1px solid;' 
  • dijit/trunk/_base/window.js

    r9728 r12184  
    2020        } 
    2121 
    22         //In some IE versions (at least 6.0), document.parentWindow does not return a 
     22        //In some IE versions (at least 6.0), dojo.doc.parentWindow does not return a 
    2323        //reference to the real window object (maybe a copy), so we must fix it as well 
    2424        //We use IE specific execScript to attach the real window reference to 
    2525        //document._parentWindow for later use 
    26         if(dojo.isIE && window !== document.parentWindow && !doc._parentWindow){ 
     26        if(dojo.isIE && window !== dojo.doc.parentWindow && !doc._parentWindow){ 
    2727                /* 
    2828                In IE 6, only the variable "window" can be used to connect events (others 
    2929                may be only copies). 
    3030                */ 
    31                 doc.parentWindow.execScript("document._parentWindow = window;", "Javascript"); 
     31                doc.parentWindow.execScript("dojo.doc._parentWindow = window;", "Javascript"); 
    3232                //to prevent memory leak, unset it after use 
    3333                //another possibility is to add an onUnload handler which seems overkill to me (liucougar) 
  • dijit/trunk/_Calendar.js

    r11897 r12184  
    6161                                node.removeChild(node.firstChild); 
    6262                        } 
    63                         node.appendChild(document.createTextNode(text)); 
     63                        node.appendChild(dojo.doc.createTextNode(text)); 
    6464                }, 
    6565 
  • dijit/trunk/_editor/range.js

    r11966 r12184  
    187187dijit.range.create = function(){ 
    188188        if(dijit.range._w3c){ 
    189                 return document.createRange(); 
     189                return dojo.doc.createRange(); 
    190190        }else{//IE 
    191191                return new dijit.range.W3CRange; 
  • dijit/trunk/_editor/RichText.js

    r12169 r12184  
    77 
    88// used to restore content when user leaves this page then comes back 
    9 // but do not try doing document.write if we are using xd loading. 
    10 // document.write will only work if RichText.js is included in the dojo.js 
     9// but do not try doing dojo.doc.write if we are using xd loading. 
     10// dojo.doc.write will only work if RichText.js is included in the dojo.js 
    1111// file. If it is included in dojo.js and you want to allow rich text saving 
    1212// for back/forward actions, then set dojo.config.allowXdRichTextSave = true. 
     
    206206                } 
    207207                //queryCommandValue returns empty if we hide editNode, so move it out of screen temporary 
    208                 var div=document.createElement('div'); 
     208                var div=dojo.doc.createElement('div'); 
    209209                div.style.position = "absolute"; 
    210210                div.style.left = "-2000px"; 
    211211                div.style.top = "-2000px"; 
    212                 document.body.appendChild(div); 
     212                dojo.doc.body.appendChild(div); 
    213213                div.innerHTML = localhtml; 
    214214                var node = div.firstChild; 
     
    217217                        dojo.withGlobal(this.window, "selectElement", dijit._editor.selection, [node.firstChild]); 
    218218                        var nativename = node.tagName.toLowerCase(); 
    219                         this._local2NativeFormatNames[nativename] = document.queryCommandValue("formatblock");//this.queryCommandValue("formatblock"); 
     219                        this._local2NativeFormatNames[nativename] = dojo.doc.queryCommandValue("formatblock");//this.queryCommandValue("formatblock"); 
    220220                        this._native2LocalFormatNames[this._local2NativeFormatNames[nativename]] = nativename; 
    221221                        node = node.nextSibling; 
    222222                } 
    223                 document.body.removeChild(div); 
     223                dojo.doc.body.removeChild(div); 
    224224        }, 
    225225 
     
    328328                // Safari's selections go all out of whack if we do it inline, 
    329329                // so for now IE is our only hero 
    330                 //if (typeof document.body.contentEditable != "undefined") { 
     330                //if (typeof dojo.doc.body.contentEditable != "undefined") { 
    331331                if(dojo.isIE || dojo.isSafari || dojo.isOpera){ // contentEditable, easy 
    332332                        var ifr = this.iframe = dojo.doc.createElement('iframe'); 
     
    433433                        ifr.id=this.id; 
    434434                        // this.iframe.src = "about:blank"; 
    435                         // document.body.appendChild(this.iframe); 
     435                        // dojo.doc.body.appendChild(this.iframe); 
    436436                        // console.debug(this.iframe.contentDocument.open()); 
    437437                        // dojo.body().appendChild(this.iframe); 
  • dijit/trunk/_editor/selection.js

    r11964 r12184  
    88dojo.mixin(dijit._editor.selection, { 
    99        getType: function(){ 
    10                 // summary: Get the selection type (like document.select.type in IE). 
     10                // summary: Get the selection type (like dojo.doc.select.type in IE). 
    1111                if(dojo.doc.selection){ //IE 
    1212                        return dojo.doc.selection.type.toLowerCase(); 
     
    6262                        if(selection && selection.rangeCount){ 
    6363                                var frag = selection.getRangeAt(0).cloneContents(); 
    64                                 var div = document.createElement("div"); 
     64                                var div = dojo.doc.createElement("div"); 
    6565                                div.appendChild(frag); 
    6666                                return div.innerHTML; 
     
    167167                           selection.collapse(beginning); 
    168168                  } 
    169           }else if(document.selection){ // IE 
     169          }else if(dojo.doc.selection){ // IE 
    170170                  var range = dojo.doc.selection.createRange(); 
    171171                  range.collapse(beginning); 
  • dijit/trunk/_TimePicker.js

    r11920 r12184  
    137137                _createOption:function(/*Number*/ index){ 
    138138                        // summary: creates a clickable time option 
    139                         var div=document.createElement("div"); 
     139                        var div=dojo.doc.createElement("div"); 
    140140                        var date = (div.date = new Date(this._refDate)); 
    141141                        div.index=index; 
     
    145145                                date.getSeconds()+incrementDate.getSeconds()*index); 
    146146 
    147                         var innerDiv = document.createElement('div'); 
     147                        var innerDiv = dojo.doc.createElement('div'); 
    148148                        dojo.addClass(div,this.baseClass+"Item"); 
    149149                        dojo.addClass(innerDiv,this.baseClass+"ItemInner");