Changeset 7994

Show
Ignore:
Timestamp:
04/07/07 16:49:10 (20 months ago)
Author:
alex
Message:

API location refacotoring, style updates, and reformatting. Refs #2641

Location:
dojo/trunk/_base
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • dojo/trunk/_base/connect.js

    r7988 r7994  
    1 /*  
    2  * Copyright © 2007 TurboAjax Group (http://www.turboajax.com) 
    3  * Licensed under the Dojo Foundation Contributor License Agreement (http://dojotoolkit.org/icla.txt) 
    4  */ 
    5  
    61dojo.provide("dojo._base.connect"); 
    72dojo.require("dojo._base.lang"); 
    83 
    9 (function(){ 
    10                                          
    11 // arbitrary method delegation (knows nothing about DOM) 
     4// this file courtesy of the TurboAjax group, licensed under a Dojo CLA 
    125 
    13 dojo.connect = function(/*Object|null*/ obj, /*String*/ event, /*Object|null*/ context, /*String|Function*/ method){ 
    14         // support for 3 argument invocation depends on hitch 
    15         return dl.add(obj, event, dojo.hitch(context, method)); /*Handle*/ 
    16 } 
     6// FIXME: needs in-code docs in the worst way!! 
    177 
    18 dojo.disconnect = function(/*Object|null*/ obj ,/*String*/ event, /*Handle*/ handle){ 
    19         dl.remove(obj, event, handle); 
    20 } 
    21  
    22 // topic publish/subscribe 
    23  
    24 dojo.topic = { 
    25         topics: {}, 
    26         subscribe: function(/*String*/ topic, /*Object|null*/ context, /*String|Function*/ method){ 
    27                 // support for 3 argument invocation depends on hitch 
    28                 return dl.add(dojo.topic.topics, topic, dojo.hitch(context, method)); /*Handle*/ 
    29         }, 
    30         unsubscribe: function(/*String*/ topic, /*Handle*/ handle){ 
    31                 dl.remove(dojo.topic.topics, topic, handle); 
    32         }, 
    33         publish: function(/*String*/ topic, /*Array*/ args){ 
    34                 // Note that args is an array. This is more efficient vs variable length argument list. 
    35                 // Ideally, by convention, var args are implemented via Array throughout the APIs. 
    36                 var f = dojo.topic.topics[topic]; 
    37                 (f)&&(f.apply(this, args||[])); 
    38         } 
    39 } 
    40  
    41 // low-level delegation machinery 
    42  
    43 dojo.listener = { 
     8dojo._listener = { 
     9        // low-level delegation machinery 
    4410        dispatchers: [ ], 
    4511        dispatcher: function(source, method, f) { 
     
    5622                d.listeners = (f ? [f] : []); 
    5723                source[method] = d; 
    58                 dl.dispatchers.push(d); 
     24                dojo._listener.dispatchers.push(d); 
    5925                return d; 
    6026        }, 
     
    7339                // Ensure a dispatcher 
    7440                if (!d||!d.listeners) { 
    75                         d = dl.dispatcher(source, method, d); 
     41                        d = dojo._listener.dispatcher(source, method, d); 
    7642                } 
    7743                // The contract is that a 'handle' is returned that is suitable for  
     
    9359                this.dispatchers = []; 
    9460        } 
     61}; 
     62// arbitrary method delegation (knows nothing about DOM) 
     63 
     64dojo.connect = function(/*Object|null*/ obj,  
     65                                                /*String*/ event,  
     66                                                /*Object|null*/ context,  
     67                                                /*String|Function*/ method){ 
     68        // support for 3 argument invocation depends on hitch 
     69        return dojo._listener.add(obj, event, dojo.hitch(context, method)); /*Handle*/ 
    9570} 
    9671 
    97 var dl = dojo.listener; 
     72dojo.disconnect = function(     /*Object|null*/ obj, 
     73                                                        /*String*/ event,  
     74                                                        /*Handle*/ handle){ 
     75        dojo._listener.remove(obj, event, handle); 
     76} 
    9877 
    99 })(); 
     78// topic publish/subscribe 
     79 
     80dojo._topics = {}; 
     81dojo.subscribe = function(      /*String*/ topic,  
     82                                                        /*Object|null*/ context,  
     83                                                        /*String|Function*/ method){ 
     84        // support for 3 argument invocation depends on hitch 
     85        return dojo._listener.add(dojo._topics, topic, dojo.hitch(context, method)); /*Handle*/ 
     86} 
     87dojo.unsubscribe = function(/*String*/ topic, /*Handle*/ handle){ 
     88        dojo._listener.remove(dojo._topics, topic, handle); 
     89} 
     90dojo.publish = function(/*String*/ topic, /*Array*/ args){ 
     91        // Note that args is an array. This is more efficient vs variable length argument list. 
     92        // Ideally, by convention, var args are implemented via Array throughout the APIs. 
     93        var f = dojo._topics[topic]; 
     94        (f)&&(f.apply(this, args||[])); 
     95} 
  • dojo/trunk/_base/declare.js

    r7988 r7994  
    167167                } 
    168168        } 
    169 } 
     169}; 
  • dojo/trunk/_base/event.js

    r7988 r7994  
    1 /*  
    2  * Copyright © 2007 TurboAjax Group (http://www.turboajax.com) 
    3  * Licensed under the Dojo Foundation Contributor License Agreement (http://dojotoolkit.org/icla.txt) 
    4  */ 
    5   
    61dojo.provide("dojo._base.event"); 
    72dojo.require("dojo._base.connect"); 
    83 
     4// this file courtesy of the TurboAjax group, licensed under a Dojo CLA 
     5 
    96(function(){ 
    10                                          
    11 // DOM events 
    12  
    13 dojo.addListener = function(node, event, context, method) { 
    14         return de.addListener(node, event, dojo.hitch(context, method)); // Handle 
    15 } 
    16  
    17 dojo.removeListener = function(node, event, handle) { 
    18         de.removeListener(node, event, handle); 
    19 } 
    20  
    21 // prefer these remain public, but could be confusing in top level docs 
    22  
    23 dojo.addConnection = dojo.connect;  
    24 dojo.removeConnection = dojo.disconnect; 
    25  
    26 // unify add/removeListener with connect/disconnect 
    27  
    28 dojo.connect = function(/*Object*/ obj, /*String*/ event, /*Object|null*/ context, /*String|Function*/ method){ 
    29         return (!obj||isNaN(obj.nodeType) ? dojo.addConnection : dojo.addListener).apply(de, arguments); 
    30 }                                                                                        
    31  
    32 dojo.disconnect = function(/*Object*/ obj, /*String*/ event, /*Handle*/ handle){ 
    33         return (!obj||isNaN(obj.nodeType) ? dojo.removeConnection : dojo.removeListener).apply(de, arguments); 
    34 }                                                                                        
    35  
    36 // DOM event machinery 
    37          
    38 dojo.event = { 
    39         addListener: function(/*DOMNode*/node, /*String*/event, /*Function*/fp){ 
    40                 if(!node){ return; }  
    41                 event = de.normalizeEventName(event); 
    42                 fp = (!de._fixCallback ? fp : de._fixCallback(fp)); 
    43                 if(node.addEventListener){  
    44                         node.addEventListener(event.slice(2), fp, false); 
    45                         return fp; /*Handle*/ 
    46                 }else{ 
    47                         return dojo.listener.add(node, event, fp); /*Handle*/ 
    48                 } 
    49         }, 
    50         removeListener: function(/*DOMNode*/node, /*String*/event, /*Handle*/handle){ 
    51                 // summary: 
    52                 //              clobbers the listener from the node 
    53                 // evtName: 
    54                 //              the name of the handler to remove the function from 
    55                 // node: 
    56                 //              DOM node to attach the event to 
    57                 // fp: 
    58                 //              the function to register 
    59                 event = de.normalizeEventName(event); 
    60                 if(node.removeEventListener){ 
    61                         node.removeEventListener(event.slice(2), handle, false); 
    62                 }else{ 
    63                         dojo.listener.remove(node, event, handle); 
    64                 } 
    65         }, 
    66         normalizeEventName: function(/*String*/eventName){ 
    67                 // Generally, eventName should be lower case, unless it is special somehow (e.g. a Mozilla event) 
    68                 if(eventName.slice(0,2)!="on"){ eventName = "on"+eventName; } 
    69                 if(eventName=="onkey"){ eventName = (d.isIE ? "onkeydown" : "onkeypress");      } 
    70                 return eventName; 
    71         }, 
    72         // hosts can override to fix events as needed 
    73         _fixCallback: null, 
    74         // public fixEvent 
    75         fixEvent: function(/*Event*/evt, /*DOMNode*/sender){ 
    76                 // summary: 
    77                 //              normalizes properties on the event object including event 
    78                 //              bubbling methods, keystroke normalization, and x/y positions 
    79                 // evt: native event object 
    80                 // sender: node to treat as "currentTarget" 
    81                 var f = de._fixEvent; 
    82                 return (f ? f(evt, sender) : evt); 
    83         }, 
    84         stopEvent: function(/*Event*/evt){ 
    85                 // summary: 
    86                 //              prevents propagation and clobbers the default action of the 
    87                 //              passed event 
    88                 // evt: Optional for IE. The native event object. 
    89                 evt.preventDefault(); 
    90                 evt.stopPropagation(); 
    91         } 
    92 }; 
    93  
    94 var de = dojo.event; 
    95  
    96 // Constants 
    97  
    98 dojo.keys = { 
    99         BACKSPACE: 8, 
    100         TAB: 9, 
    101         CLEAR: 12, 
    102         ENTER: 13, 
    103         SHIFT: 16, 
    104         CTRL: 17, 
    105         ALT: 18, 
    106         PAUSE: 19, 
    107         CAPS_LOCK: 20, 
    108         ESCAPE: 27, 
    109         SPACE: 32, 
    110         PAGE_UP: 33, 
    111         PAGE_DOWN: 34, 
    112         END: 35, 
    113         HOME: 36, 
    114         LEFT_ARROW: 37, 
    115         UP_ARROW: 38, 
    116         RIGHT_ARROW: 39, 
    117         DOWN_ARROW: 40, 
    118         INSERT: 45, 
    119         DELETE: 46, 
    120         HELP: 47, 
    121         LEFT_WINDOW: 91, 
    122         RIGHT_WINDOW: 92, 
    123         SELECT: 93, 
    124         NUMPAD_0: 96, 
    125         NUMPAD_1: 97, 
    126         NUMPAD_2: 98, 
    127         NUMPAD_3: 99, 
    128         NUMPAD_4: 100, 
    129         NUMPAD_5: 101, 
    130         NUMPAD_6: 102, 
    131         NUMPAD_7: 103, 
    132         NUMPAD_8: 104, 
    133         NUMPAD_9: 105, 
    134         NUMPAD_MULTIPLY: 106, 
    135         NUMPAD_PLUS: 107, 
    136         NUMPAD_ENTER: 108, 
    137         NUMPAD_MINUS: 109, 
    138         NUMPAD_PERIOD: 110, 
    139         NUMPAD_DIVIDE: 111, 
    140         F1: 112, 
    141         F2: 113, 
    142         F3: 114, 
    143         F4: 115, 
    144         F5: 116, 
    145         F6: 117, 
    146         F7: 118, 
    147         F8: 119, 
    148         F9: 120, 
    149         F10: 121, 
    150         F11: 122, 
    151         F12: 123, 
    152         F13: 124, 
    153         F14: 125, 
    154         F15: 126, 
    155         NUM_LOCK: 144, 
    156         SCROLL_LOCK: 145 
    157 }; 
    158  
    159 dojo.isAsciiPrintable = function(charCode) { 
    160         return (charCode>31&&charCode<128)||(charCode>127&&charCode<255); 
    161 } 
    162  
    163 // IE event normalization 
    164 if (dojo.isIE) {  
    165         de.baseAddListener = de.addListener; 
    166         dojo.mixin(de, { 
     7 
     8        // DOM event machinery 
     9        var de = { 
    16710                addListener: function(/*DOMNode*/node, /*String*/event, /*Function*/fp){ 
    168                         if (node && (event=="keypress" || event=="onkeypress")){ de.baseAddListener(node, "onkeydown", dojo.nop); } 
    169                         return de.baseAddListener(node, event, fp); 
    170                 }, 
    171                 _fixCallback: function(fp) { 
    172                         return function(e){  
    173                                 var e = de._fixEvent(e, this); 
    174                                 var r = fp(e); 
    175                                 de._postFixEvent(e); 
    176                                 return r; 
    177                         }; 
    178                 }, 
    179                 _fixEvent: function(/*Event*/evt, /*DOMNode*/sender){ 
     11                        if(!node){ return; }  
     12                        event = de.normalizeEventName(event); 
     13                        fp = (!de._fixCallback ? fp : de._fixCallback(fp)); 
     14                        if(node.addEventListener){  
     15                                node.addEventListener(event.slice(2), fp, false); 
     16                                return fp; /*Handle*/ 
     17                        }else{ 
     18                                return dojo._listener.add(node, event, fp); /*Handle*/ 
     19                        } 
     20                }, 
     21                removeListener: function(/*DOMNode*/node, /*String*/event, /*Handle*/handle){ 
    18022                        // summary: 
    181                         //   normalizes properties on the event object including event 
    182                         //   bubbling methods, keystroke normalization, and x/y positions 
     23                        //              clobbers the listener from the node 
     24                        // evtName: 
     25                        //              the name of the handler to remove the function from 
     26                        // node: 
     27                        //              DOM node to attach the event to 
     28                        // fp: 
     29                        //              the function to register 
     30                        event = de.normalizeEventName(event); 
     31                        if(node.removeEventListener){ 
     32                                node.removeEventListener(event.slice(2), handle, false); 
     33                        }else{ 
     34                                dojo.listener.remove(node, event, handle); 
     35                        } 
     36                }, 
     37                normalizeEventName: function(/*String*/eventName){ 
     38                        // Generally, eventName should be lower case, unless it is special somehow (e.g. a Mozilla event) 
     39                        if(eventName.slice(0,2)!="on"){ eventName = "on"+eventName; } 
     40                        if(eventName=="onkey"){ eventName = (d.isIE ? "onkeydown" : "onkeypress");      } 
     41                        return eventName; 
     42                }, 
     43                // hosts can override to fix events as needed 
     44                _fixCallback: null, 
     45                // public fixEvent 
     46                fixEvent: function(/*Event*/evt, /*DOMNode*/sender){ 
     47                        // summary: 
     48                        //              normalizes properties on the event object including event 
     49                        //              bubbling methods, keystroke normalization, and x/y positions 
    18350                        // evt: native event object 
    18451                        // sender: node to treat as "currentTarget" 
    185                         evt = evt || window.event;  
    186                         evt.target = evt.srcElement;  
    187                         evt.currentTarget = (sender || evt.srcElement);  
    188                         evt.layerX = evt.offsetX; 
    189                         evt.layerY = evt.offsetY; 
    190                         // FIXME: scroll position query is duped from dojo.html to avoid dependency on that entire module 
    191                         var se = evt.srcElement, doc = (se && se.ownerDocument) || document; 
    192                         // DO NOT replace the following to use dojo.body(), in IE, document.documentElement should be used 
    193                         // here rather than document.body 
    194                         //var docBody = ((dojo.render.html.ie55)||(doc["compatMode"] == "BackCompat")) ? doc.body : doc.documentElement; 
    195                         var docBody = doc.documentElement; 
    196                         evt.pageX = evt.clientX + (docBody.scrollLeft || 0); 
    197                         evt.pageY = evt.clientY + (docBody.scrollTop || 0); 
    198                         if(evt.type == "mouseover"){ evt.relatedTarget = evt.fromElement; } 
    199                         if(evt.type == "mouseout"){ evt.relatedTarget = evt.toElement; } 
    200                         evt.stopPropagation = this._stopPropagation; 
    201                         evt.preventDefault = this._preventDefault; 
    202                         return this._fixKeys(evt); 
    203                 }, 
    204                 _fixKeys: function(evt) { 
    205                         switch (evt.type) { 
    206                                 case "keydown": 
    207                                 case "keypress": 
    208                                 case "keyup": 
    209                                         evt.charCode = evt.keyCode; 
    210                                         break; 
    211                         } 
    212                         return evt; 
    213                 }, 
    214                 _postFixEvent: function(evt) { 
    215                         switch (evt.type) { 
    216                                 case "keydown": 
    217                                         // IE doesn't fire keypress for non-printable characters 
    218                                         // other browsers do, we simulate it here. 
    219                                         // 
    220                                         // FIXME: cannot trap numpad keys unless numlock is down 
    221                                         // unless we can determine the state of numlock ourselves. 
    222                                         var c = evt.keyCode; 
    223                                         if((evt.ctrlKey)||(c!=32)&&(c<48||c>90)&&(c<106||c>111)&&(c<186||c>191)){ 
    224                                                 var faux = document.createEventObject(evt); 
    225                                                 evt.target.fireEvent("onkeypress", faux); 
    226                                                 evt.returnValue = faux.returnValue; 
    227                                         } 
    228                                         break; 
    229                         } 
    230                 }, 
    231                 stopEvent: function(){ 
    232                         with(window.event){ 
    233                                 cancelBubble = true; 
    234                                 returnValue = false; 
    235                         } 
    236                 }, 
    237                 _stopPropagation: function(){ 
    238                         this.cancelBubble = true;  
    239                 }, 
    240                 _preventDefault: function(){ 
    241                         this.returnValue = false; 
     52                        var f = de._fixEvent; 
     53                        return (f ? f(evt, sender) : evt); 
     54                }, 
     55                stopEvent: function(/*Event*/evt){ 
     56                        // summary: 
     57                        //              prevents propagation and clobbers the default action of the 
     58                        //              passed event 
     59                        // evt: Optional for IE. The native event object. 
     60                        evt.preventDefault(); 
     61                        evt.stopPropagation(); 
    24262                } 
    243         }); 
    244 } 
    245  
    246 // Opera event normalization 
    247 if (dojo.isOpera) { 
    248         dojo.mixin(de, { 
    249                 _fixEvent: function(evt, sender){ 
    250                         switch (evt.type) { 
    251                                 case "keypress": 
    252                                         evt.charCode = evt.keyCode; 
    253                                         break; 
    254                         } 
    255                         return evt; 
    256                 } 
    257         }); 
    258 } 
    259  
    260 // Safari event normalization 
    261 if (dojo.isSafari) {  
    262         dojo.mixin(dojo.keys, { 
    263                 SHIFT_TAB: 25,           
    264                 UP_ARROW: 63232, 
    265                 DOWN_ARROW: 63233, 
    266                 LEFT_ARROW: 63234, 
    267                 RIGHT_ARROW: 63235, 
    268                 F1: 63236, 
    269                 F2: 63237, 
    270                 F3: 63238, 
    271                 F4: 63239, 
    272                 F5: 63240, 
    273                 F6: 63241, 
    274                 F7: 63242, 
    275                 F8: 63243, 
    276                 F9: 63244, 
    277                 F10: 63245, 
    278                 F11: 63246, 
    279                 F12: 63247, 
    280                 PAUSE: 63250, 
    281                 DELETE: 63272, 
    282                 HOME: 63273, 
    283                 END: 63275, 
    284                 PAGE_UP: 63276, 
    285                 PAGE_DOWN: 63277, 
    286                 INSERT: 63302, 
    287                 PRINT_SCREEN: 63248, 
    288                 SCROLL_LOCK: 63249, 
    289                 NUM_LOCK: 63289 
    290         }); 
    291 } 
    292  
     63        }; 
     64 
     65        // DOM events 
     66        dojo.addListener = function(node, event, context, method) { 
     67                return de.addListener(node, event, dojo.hitch(context, method)); // Handle 
     68        } 
     69 
     70        dojo.removeListener = function(node, event, handle) { 
     71                de.removeListener(node, event, handle); 
     72        } 
     73 
     74        // prefer these remain public, but could be confusing in top level docs 
     75 
     76        // dojo.addConnection = dojo.connect;  
     77        // dojo.removeConnection = dojo.disconnect; 
     78 
     79        var dc = dojo.connect; 
     80        var dd = dojo.disconnect; 
     81 
     82        // unify add/removeListener with connect/disconnect 
     83 
     84        dojo.connect = function(        /*Object*/ obj,  
     85                                                                /*String*/ event,  
     86                                                                /*Object|null*/ context,  
     87                                                                /*String|Function*/ method){ 
     88                return (!obj||isNaN(obj.nodeType) ? dc: dojo.addListener).apply(de, arguments); 
     89        }                                                                                        
     90 
     91        dojo.disconnect = function(/*Object*/ obj, /*String*/ event, /*Handle*/ handle){ 
     92                return (!obj||isNaN(obj.nodeType) ? dd: dojo.removeListener).apply(de, arguments); 
     93        }                                                                                        
     94 
     95 
     96        // Constants 
     97 
     98        dojo._keys = { 
     99                BACKSPACE: 8, 
     100                TAB: 9, 
     101                CLEAR: 12, 
     102                ENTER: 13, 
     103                SHIFT: 16, 
     104                CTRL: 17, 
     105                ALT: 18, 
     106                PAUSE: 19, 
     107                CAPS_LOCK: 20, 
     108                ESCAPE: 27, 
     109                SPACE: 32, 
     110                PAGE_UP: 33, 
     111                PAGE_DOWN: 34, 
     112                END: 35, 
     113                HOME: 36, 
     114                LEFT_ARROW: 37, 
     115                UP_ARROW: 38, 
     116                RIGHT_ARROW: 39, 
     117                DOWN_ARROW: 40, 
     118                INSERT: 45, 
     119                DELETE: 46, 
     120                HELP: 47, 
     121                LEFT_WINDOW: 91, 
     122                RIGHT_WINDOW: 92, 
     123                SELECT: 93, 
     124                NUMPAD_0: 96, 
     125                NUMPAD_1: 97, 
     126                NUMPAD_2: 98, 
     127                NUMPAD_3: 99, 
     128                NUMPAD_4: 100, 
     129                NUMPAD_5: 101, 
     130                NUMPAD_6: 102, 
     131                NUMPAD_7: 103, 
     132                NUMPAD_8: 104, 
     133                NUMPAD_9: 105, 
     134                NUMPAD_MULTIPLY: 106, 
     135                NUMPAD_PLUS: 107, 
     136                NUMPAD_ENTER: 108, 
     137                NUMPAD_MINUS: 109, 
     138                NUMPAD_PERIOD: 110, 
     139                NUMPAD_DIVIDE: 111, 
     140                F1: 112, 
     141                F2: 113, 
     142                F3: 114, 
     143                F4: 115, 
     144                F5: 116, 
     145                F6: 117, 
     146                F7: 118, 
     147                F8: 119, 
     148                F9: 120, 
     149                F10: 121, 
     150                F11: 122, 
     151                F12: 123, 
     152                F13: 124, 
     153                F14: 125, 
     154                F15: 126, 
     155                NUM_LOCK: 144, 
     156                SCROLL_LOCK: 145 
     157        }; 
     158 
     159        dojo.isAsciiPrintable = function(charCode) { 
     160                return (charCode>31&&charCode<128)||(charCode>127&&charCode<255); 
     161        } 
     162 
     163        // IE event normalization 
     164        if(dojo.isIE){  
     165                de.baseAddListener = de.addListener; 
     166                dojo.mixin(de, { 
     167                        addListener: function(/*DOMNode*/node, /*String*/event, /*Function*/fp){ 
     168                                if(node && (event == "keypress" || event == "onkeypress")){  
     169                                        // FIXME: do we even have a dojo.nop? 
     170                                        de.baseAddListener(node, "onkeydown", dojo.nop); 
     171                                } 
     172                                return de.baseAddListener(node, event, fp); 
     173                        }, 
     174                        _fixCallback: function(fp){ 
     175                                return function(e){  
     176                                        var e = de._fixEvent(e, this); 
     177                                        var r = fp(e); 
     178                                        de._postFixEvent(e); 
     179                                        return r; 
     180                                }; 
     181                        }, 
     182                        _fixEvent: function(/*Event*/evt, /*DOMNode*/sender){ 
     183                                // summary: 
     184                                //   normalizes properties on the event object including event 
     185                                //   bubbling methods, keystroke normalization, and x/y positions 
     186                                // evt: native event object 
     187                                // sender: node to treat as "currentTarget" 
     188                                evt = evt || window.event;  
     189                                evt.target = evt.srcElement;  
     190                                evt.currentTarget = (sender || evt.srcElement);  
     191                                evt.layerX = evt.offsetX; 
     192                                evt.layerY = evt.offsetY; 
     193                                // FIXME: scroll position query is duped from dojo.html to 
     194                                // avoid dependency on that entire module. Now that HTML is in 
     195                                // Base, we should convert back to something similar there. 
     196 
     197                                var se = evt.srcElement, doc = (se && se.ownerDocument) || document; 
     198                                // DO NOT replace the following to use dojo.body(), in IE, document.documentElement should be used 
     199                                // here rather than document.body 
     200                                //var docBody = ((dojo.render.html.ie55)||(doc["compatMode"] == "BackCompat")) ? doc.body : doc.documentElement; 
     201                                var docBody = doc.documentElement; 
     202                                evt.pageX = evt.clientX + (docBody.scrollLeft || 0); 
     203                                evt.pageY = evt.clientY + (docBody.scrollTop || 0); 
     204                                if(evt.type == "mouseover"){ evt.relatedTarget = evt.fromElement; } 
     205                                if(evt.type == "mouseout"){ evt.relatedTarget = evt.toElement; } 
     206                                evt.stopPropagation = this._stopPropagation; 
     207                                evt.preventDefault = this._preventDefault; 
     208                                return this._fixKeys(evt); 
     209                        }, 
     210                        _fixKeys: function(evt){ 
     211                                switch(evt.type){ 
     212