b79f37e72ab2ea52195fd4fd466db3676e71bcf1
1 // (c) BenoƮt PIN 2006-2007
5 function ddEventDispatch() {
6 addListener(document
, 'mousedown', raisemousedown
);
7 addListener(document
, 'mousemove', raisemousemove
);
8 addListener(document
, 'mouseup', raisemouseup
);
12 function getRectangleNode() {
13 var docid
= document
.id
;
14 docid
= document
.id
.slice(DocPrefixLength
);
15 var frameId
= IFramePrefix
+ docid
;
16 iframe
= window
.parent
.document
.getElementById(frameId
);
18 iframe
= window
.parent
.document
.getElementById("EpozEditor");
19 return iframe
.parentNode
;
22 var raisemousedown
, raisemousemove
, raisemouseup
;
24 if (browser
.isIE55
|| browser
.isIE6up
) {
25 raisemousedown = function() {
26 var rect
= getRectangleNode();
27 rect
.fireEvent('onmousedown', window
.event
);
30 raisemousemove = function() {
31 var rect
= getRectangleNode();
32 rect
.fireEvent('onmousemove', window
.event
);
33 rect
.fireEvent('onmouseover', window
.event
);
36 raisemouseup = function() {
37 var rect
= getRectangleNode();
38 rect
.fireEvent('onmouseup', window
.event
);
41 else if (browser
.isDOM2Event
) {
42 // initMouseEvent("eventType", bubblesFlas, cancelableFlag, view, detailVal, screenX, screenY, clientX, clientY, ctrlKeyFlag, altKeyFlag, shiftKeyFlag, metaKeyFlag, buttonCode, relatedTargetNodeRef)
44 raisemousedown = function(e
) {
45 var event
= document
.createEvent("MouseEvents");
46 var rect
= getRectangleNode()
47 event
.initMouseEvent("mousedown", true, true, window
.parent
, e
.detail
, e
.screenX
, e
.screenY
, e
.clientX
, e
.clientY
, e
.ctrlKey
, e
.altKey
, e
.shiftKey
, e
.metaKey
, e
.button
, rect
);
48 rect
.dispatchEvent(event
);
52 raisemousemove = function(e
) {
53 var overEvent
= document
.createEvent("MouseEvents");
54 overEvent
.initMouseEvent("mouseover", true, true, window
.parent
, e
.detail
, e
.screenX
, e
.screenY
, e
.clientX
, e
.clientY
, e
.ctrlKey
, e
.altKey
, e
.shiftKey
, e
.metaKey
, e
.button
, rect
);
55 var event
= document
.createEvent("MouseEvents");
56 var rect
= getRectangleNode()
57 event
.initMouseEvent("mousemove", true, true, window
.parent
, e
.detail
, e
.screenX
, e
.screenY
, e
.clientX
, e
.clientY
, e
.ctrlKey
, e
.altKey
, e
.shiftKey
, e
.metaKey
, e
.button
, rect
);
58 rect
.dispatchEvent(event
);
59 rect
.dispatchEvent(overEvent
);
63 raisemouseup = function(e
) {
64 var event
= document
.createEvent("MouseEvents");
65 var rect
= getRectangleNode()
66 event
.initMouseEvent("mouseup", true, true, window
.parent
, e
.detail
, e
.screenX
, e
.screenY
, e
.clientX
, e
.clientY
, e
.ctrlKey
, e
.altKey
, e
.shiftKey
, e
.metaKey
, e
.button
, rect
);
67 rect
.dispatchEvent(event
);