Utilities for DOM Events.
See Using event utilities for an example of implementating the script on a page. This class participates in the engine library.
This example shows how to use the event buffer and createHandler mechanisms to preserve the event handler context to a specific object instance.
<p id = "oPara">Test paragraph</p>
<script type = "text/javascript">
var oObject = org.cote.js.newObject("DemoType","1.0",true);
// Add the createHandler method for this object with addEventBuffer
org.cote.js.dom.event.addEventBuffer(oObject);
// Create an event handler wrapper with createHandler for an onclick event.
// Specify the event name and the bit to use the ObjectRegistry.
// This creates oObject._prehandle_click which will invoke oObject._handle_click.
oObject.createHandler("click",0,0,1);
oObject._handle_click = function(e){
var oEvent = org.cote.js.dom.event._gevt(e);
var oSource = org.cote.js.dom.event._gevt_src(e);
// The 'this' object refers to the instance of oObject
};
// Add the onclick event to the paragraph element, oPara
var oPara = document.getElementById("oPara");
// Use the _prehandle_click created by the createHandler method.
org.cote.js.dom.event.addEventListener(oPara, "click", oObject._prehandle_click);
</script>The version of the object
String = org.cote.js.dom.event.object_version
Returns the event object, where the specified parameter may or may not be the event object depending on the browser. Method is private and should not be directly referenced.
e = _gevt( o )
e as object: The event object.
Returns the event destination or target object. Method is private and should not be directly referenced.
e = _gevt( o )
e as object: The event destination object.
Cancels the event. Method is private and should not be directly referenced.
void _gevt_cancel( o )
Returns the event origination object. Method is private and should not be directly referenced.
e = _gevt_org( o )
e as object: The event origination or source object.
Returns the event source object. Method is private and should not be directly referenced.
e = _gevt_src( o )
e as object: The event source object.
A developer specified event handler that is invoked after binding an event to the _prehandle_event handler, and which has the context specified by the createHandler method. Method is private and should not be directly referenced.
v = _handle_event( )
v as variant: Returns developer specified value.
Internal event handler used to establish context and to invoke the custom handler. Method is private and should not be directly referenced.
v = _prehandle_event( )
v as variant: Returns value from
Creates the createHandler method on the specified object. Method is private and should not be directly referenced.
void addEventBuffer( e )
Adds an event listener to the specified object
void addEventListener( o, e, f, b )
Creates a custom event handler, _prehandle_event, which invokes _handle_event for the specified object, using the specified context. This method must be created with addEventBuffer. Method is private and should not be directly referenced.
f = createHandler( s, r, x, l )
f as function: Custom event handler function.
Removes motion capture (mousemove and mouseup) from the specified object.
void disableMotionCapture( o )
Enables motion capture (mousemove and mouseup) for the specified object.
void enableMotionCapture( o )
Removes an event listener from the specified object
void removeEventListener( o, e, f, b )