This file is included in all pages using the University templates.
It provides mechanisms for adding events to the page, managing the left-hand navigation on pages that include one and allowing default text in search boxes.
These functions are namespace protected in a variable uM and require dot notation to be called (examples of usage below).
Usage: uM.addLoadListener(function_name);
Parameters: function_name - the name of the function to execute once the page has loaded
Effect: Adds an event to the onload event handler. Is mindful of existing events.
Returns: nothing
Hat-tip: Cameron Adams
Processing:
Usage: uM.attachEventListener(target, eventType, functionRef, capture);
Parameters:
Effect: Add the event to the named event listener (or handler)
Returns: true after completion of attachment
Hat-tip: Cameron Adams
Processing:
Usage: uM.detachEventListener(target, eventType, functionRef, capture);
Parameters:
Effect: Remove an existing event from the named event listener (or handler)
Returns: true after completion of detachment
Hat-tip: Cameron Adams
Processing:
Note: browsers that support neither the removeEventListener (W3C) nor the detachEvent (Microsoft) objects will remove all events from the specified handler
Usage: uM.schedule(element_id, function_name);
Parameters:
Effect: Adds an event to the onload event handler. Is mindful of existing events.
Returns: nothing
Hat-tip: Cameron Adams
Processing:
Usage: uM.addClass(target, classValue);
Parameters:
Effect: Adds a class to an element.
Returns: nothing
Hat-tip: Cameron Adams
Processing:
Usage: uM.removeClass(target, classValue);
Parameters:
Effect: Removes a class from an element.
Returns: nothing
Hat-tip: Cameron Adams
Processing:
Usage: uM.hasClass(target, classValue);
Parameters:
Effect: Checks for the existence of a class in an element.
Returns: Boolean
Hat-tip: inspired by removeClass above
Processing:
Usage: uM.getElementsByTagAndAttributes(stem, leaf_tag, leaf_attributes);
Parameters:
Effect: finds elements within the stem that match all the listed attributes
Returns: array of elements
Hat-tip: Patrick Maslen
Processing:
Usage: uM.plainTextChildren(element);
Parameters: element - element reference: the element whose text you want
Effect: removes all html tags from within an element
Returns: string - plain text from within the element
Hat-tip:
Processing:
Usage: uM.debug(text);
Parameters: text - the text you want to see
Effect: adds a paragraph to a debug div
Returns: nothing
Hat-tip:
Processing: