diff options
author | Barak Korren <[email protected]> | 2013-04-02 20:38:07 +0300 |
---|---|---|
committer | Barak Korren <[email protected]> | 2013-04-02 20:38:07 +0300 |
commit | 58a2577d48790c79adfd44bcfd662c980ce6cfe4 (patch) | |
tree | 523d814ea0b7b6f617fe515b186099c6e83fed72 /lib/dojo/mouse.js.uncompressed.js | |
parent | e470a273cf09562fb2f9c0c899002303f19c8d16 (diff) | |
parent | cc332603431102a682feda22b9cf0093a29f0176 (diff) |
Merge branch 'master' of https://github.com/gothfox/Tiny-Tiny-RSS.git
Diffstat (limited to 'lib/dojo/mouse.js.uncompressed.js')
-rw-r--r-- | lib/dojo/mouse.js.uncompressed.js | 171 |
1 files changed, 0 insertions, 171 deletions
diff --git a/lib/dojo/mouse.js.uncompressed.js b/lib/dojo/mouse.js.uncompressed.js deleted file mode 100644 index 473345b14..000000000 --- a/lib/dojo/mouse.js.uncompressed.js +++ /dev/null @@ -1,171 +0,0 @@ -define("dojo/mouse", ["./_base/kernel", "./on", "./has", "./dom", "./_base/window"], function(dojo, on, has, dom, win){ - - // module: - // dojo/mouse - - has.add("dom-quirks", win.doc && win.doc.compatMode == "BackCompat"); - has.add("events-mouseenter", win.doc && "onmouseenter" in win.doc.createElement("div")); - has.add("events-mousewheel", win.doc && 'onmousewheel' in win.doc); - - var mouseButtons; - if((has("dom-quirks") && has("ie")) || !has("dom-addeventlistener")){ - mouseButtons = { - LEFT: 1, - MIDDLE: 4, - RIGHT: 2, - // helper functions - isButton: function(e, button){ return e.button & button; }, - isLeft: function(e){ return e.button & 1; }, - isMiddle: function(e){ return e.button & 4; }, - isRight: function(e){ return e.button & 2; } - }; - }else{ - mouseButtons = { - LEFT: 0, - MIDDLE: 1, - RIGHT: 2, - // helper functions - isButton: function(e, button){ return e.button == button; }, - isLeft: function(e){ return e.button == 0; }, - isMiddle: function(e){ return e.button == 1; }, - isRight: function(e){ return e.button == 2; } - }; - } - dojo.mouseButtons = mouseButtons; - -/*===== - dojo.mouseButtons = { - // LEFT: Number - // Numeric value of the left mouse button for the platform. - LEFT: 0, - // MIDDLE: Number - // Numeric value of the middle mouse button for the platform. - MIDDLE: 1, - // RIGHT: Number - // Numeric value of the right mouse button for the platform. - RIGHT: 2, - - isButton: function(e, button){ - // summary: - // Checks an event object for a pressed button - // e: Event - // Event object to examine - // button: Number - // The button value (example: dojo.mouseButton.LEFT) - return e.button == button; // Boolean - }, - isLeft: function(e){ - // summary: - // Checks an event object for the pressed left button - // e: Event - // Event object to examine - return e.button == 0; // Boolean - }, - isMiddle: function(e){ - // summary: - // Checks an event object for the pressed middle button - // e: Event - // Event object to examine - return e.button == 1; // Boolean - }, - isRight: function(e){ - // summary: - // Checks an event object for the pressed right button - // e: Event - // Event object to examine - return e.button == 2; // Boolean - } - }; -=====*/ - - function eventHandler(type, selectHandler){ - // emulation of mouseenter/leave with mouseover/out using descendant checking - var handler = function(node, listener){ - return on(node, type, function(evt){ - if(selectHandler){ - return selectHandler(evt, listener); - } - if(!dom.isDescendant(evt.relatedTarget, node)){ - return listener.call(this, evt); - } - }); - }; - handler.bubble = function(select){ - return eventHandler(type, function(evt, listener){ - // using a selector, use the select function to determine if the mouse moved inside the selector and was previously outside the selector - var target = select(evt.target); - var relatedTarget = evt.relatedTarget; - if(target && (target != (relatedTarget && relatedTarget.nodeType == 1 && select(relatedTarget)))){ - return listener.call(target, evt); - } - }); - }; - return handler; - } - var wheel; - if(has("events-mousewheel")){ - wheel = 'mousewheel'; - }else{ //firefox - wheel = function(node, listener){ - return on(node, 'DOMMouseScroll', function(evt){ - evt.wheelDelta = -evt.detail; - listener.call(this, evt); - }); - }; - } - return { - // summary: - // This module provide mouse event handling utility functions and exports - // mouseenter and mouseleave event emulation. - // example: - // To use these events, you register a mouseenter like this: - // | define(["dojo/on", dojo/mouse"], function(on, mouse){ - // | on(targetNode, mouse.enter, function(event){ - // | dojo.addClass(targetNode, "highlighted"); - // | }); - // | on(targetNode, mouse.leave, function(event){ - // | dojo.removeClass(targetNode, "highlighted"); - // | }); - - _eventHandler: eventHandler, // for dojo/touch - - // enter: Synthetic Event - // This is an extension event for the mouseenter that IE provides, emulating the - // behavior on other browsers. - enter: eventHandler("mouseover"), - - // leave: Synthetic Event - // This is an extension event for the mouseleave that IE provides, emulating the - // behavior on other browsers. - leave: eventHandler("mouseout"), - - // wheel: Normalized Mouse Wheel Event - // This is an extension event for the mousewheel that non-Mozilla browsers provide, - // emulating the behavior on Mozilla based browsers. - wheel: wheel, - - isLeft: mouseButtons.isLeft, - /*===== - isLeft: function(){ - // summary: - // Test an event object (from a mousedown event) to see if the left button was pressed. - }, - =====*/ - - isMiddle: mouseButtons.isMiddle, - /*===== - isMiddle: function(){ - // summary: - // Test an event object (from a mousedown event) to see if the middle button was pressed. - }, - =====*/ - - isRight: mouseButtons.isRight - /*===== - , isRight: function(){ - // summary: - // Test an event object (from a mousedown event) to see if the right button was pressed. - } - =====*/ - }; -}); |