rem: MochiKit.Signal.Event.prototype.mouse = function () {  var m = {}; if (this.type() && ( this.type().indexOf('mouse') === 0 || this.type().indexOf('click') != -1 || this.type() == 'contextmenu')) {  m.client = new MochiKit.DOM.Coordinates(0, 0); if (this._event.clientX || this._event.clientY) { m.client.x = this._fixPoint(this._event.clientX); m.client.y = this._fixPoint(this._event.clientY); }  m.page = new MochiKit.DOM.Coordinates(0, 0); if (this._event.pageX || this._event.pageY) { m.page.x = this._fixPoint(this._event.pageX); m.page.y = this._fixPoint(this._event.pageY); } else {        m.page.x = (this._event.clientX + (document.documentElement.scrollLeft || document.body.scrollLeft) - document.documentElement.clientLeft); m.page.y = (this._event.clientY + (document.documentElement.scrollTop || document.body.scrollTop) - document.documentElement.clientTop); } if (this.type() != 'mousemove') { m.button = {}; m.button.left = false; m.button.right = false; m.button.middle = false;   if (this._event.which) { m.button.left = (this._event.which == 1); m.button.middle = (this._event.which == 2); m.button.right = (this._event.which == 3);         } else { m.button.left = !!(this._event.button & 1); m.button.right = !!(this._event.button & 2); m.button.middle = !!(this._event.button & 4); } } return m; }  return undefined; 
add: MochiKit.Signal.Event.prototype.mouse=function(){ var m={}; if(this.type()&&(this.type().indexOf("mouse")===0||this.type().indexOf("click")!=-1||this.type()=="contextmenu")){ m.client=new MochiKit.DOM.Coordinates(0,0); if(this._event.clientX||this._event.clientY){ m.client.x=this._fixPoint(this._event.clientX); m.client.y=this._fixPoint(this._event.clientY); } m.page=new MochiKit.DOM.Coordinates(0,0); if(this._event.pageX||this._event.pageY){ m.page.x=this._fixPoint(this._event.pageX); m.page.y=this._fixPoint(this._event.pageY); }else{ m.page.x=(this._event.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft)-document.documentElement.clientLeft); m.page.y=(this._event.clientY+(document.documentElement.scrollTop||document.body.scrollTop)-document.documentElement.clientTop); } if(this.type()!="mousemove"){ m.button={}; m.button.left=false; m.button.right=false; m.button.middle=false; if(this._event.which){ m.button.left=(this._event.which==1); m.button.middle=(this._event.which==2); m.button.right=(this._event.which==3); }else{ m.button.left=!!(this._event.button&1); m.button.right=!!(this._event.button&2); m.button.middle=!!(this._event.button&4); } } return m; } throw new Error("This is not a mouse event"); 
context: MochiKit.Signal.Event.prototype.mouse = function () {    // mouse events    var m = {};    if (this.type() && (        this.type().indexOf('mouse') === 0 ||        this.type().indexOf('click') != -1 ||        this.type() == 'contextmenu')) {        m.client = new MochiKit.DOM.Coordinates(0, 0);        if (this._event.clientX || this._event.clientY) {            m.client.x = this._fixPoint(this._event.clientX);            m.client.y = this._fixPoint(this._event.clientY);        }        m.page = new MochiKit.DOM.Coordinates(0, 0);        if (this._event.pageX || this._event.pageY) {            m.page.x = this._fixPoint(this._event.pageX);            m.page.y = this._fixPoint(this._event.pageY);        } else {            // IE keeps its document offset in            // document.documentElement.clientTop            // see http://msdn.microsoft.com/workshop/author/dhtml/reference/            //     methods/getboundingclientrect.asp            // the offset is (2,2) in standards mode and (0,0) in quirks mode            m.page.x = (this._event.clientX +                (document.documentElement.scrollLeft ||                document.body.scrollLeft) -                document.documentElement.clientLeft);            m.page.y = (this._event.clientY +                (document.documentElement.scrollTop ||                document.body.scrollTop) -                document.documentElement.clientTop);        }        if (this.type() != 'mousemove') {            m.button = {};            m.button.left = false;            m.button.right = false;            m.button.middle = false;            // we could check this._event.button, but which is more consistent            if (this._event.which) {                m.button.left = (this._event.which == 1);                m.button.middle = (this._event.which == 2);                m.button.right = (this._event.which == 3);                // mac browsers and right click:                // safari doesn't fire any click events on a right click                // firefox fires the event, and sets ctrlKey = true                // opera fires the event, and sets metaKey = true                // oncontextmenu can detect right clicks between browsers and                // across platforms            } else {                m.button.left = !!(this._event.button & 1);                m.button.right = !!(this._event.button & 2);                m.button.middle = !!(this._event.button & 4);            }        }        return m;    }    // FIXME: throw an exception instead?    return undefined;};
meta: 8607	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/8607/ad067b3f5d648d6df90ec6fb2b79f0027612a307/MochiKit.js/buggy/trunk/lib/MochiKit.js