node-base-debug.js revision 1909339da3105dc509908ff39ecc298f2f94f446
0N/A * Determines whether each node has the given className. 0N/A * @param {String} className the class name to search for 0N/A * @return {Boolean} Whether or not the element has the specified class 0N/A * Adds a class name to each node. 0N/A * @param {String} className the class name to add to the node's class attribute 0N/A * Removes a class name from each node. 0N/A * @method removeClass 0N/A * @param {String} className the class name to remove from the node's class attribute 0N/A * Replace a class with another class for each node. 156N/A * If no oldClassName is present, the newClassName is simply added. 0N/A * @param {String} oldClassName the class name to be replaced 0N/A * @param {String} newClassName the class name that will be replacing the old class name 156N/A * If the className exists on the node it is removed, if it doesn't exist it is added. 0N/A * @method toggleClass 0N/A * @param {String} className the class name to be toggled 156N/A * @param {Boolean} force Option to force adding or removing the class. 156N/A * Determines whether each node has the given className. 0N/A * @see Node.hasClass 0N/A * @param {String} className the class name to search for 156N/A * @return {Array} An array of booleans for each node bound to the NodeList. 156N/A * Adds a class name to each node. 0N/A * @param {String} className the class name to add to the node's class attribute 156N/A * Removes a class name from each node. 0N/A * @see Node.removeClass 0N/A * @param {String} className the class name to remove from the node's class attribute 0N/A * Replace a class with another class for each node. 0N/A * If no oldClassName is present, the newClassName is simply added. 0N/A * @method replaceClass 0N/A * @see Node.replaceClass 0N/A * @param {String} oldClassName the class name to be replaced 156N/A * @param {String} newClassName the class name that will be replacing the old class name 0N/A * If the className exists on the node it is removed, if it doesn't exist it is added. 0N/A * @method toggleClass 0N/A * @see Node.toggleClass 0N/A * @param {String} className the class name to be toggled 0N/A * @submodule node-base 175N/A * Returns a new dom node using the provided markup string. 175N/A * @param {String} html The markup used to create the element 0N/A * @param {HTMLDocument} doc An optional document context 0N/A * @return {Node} A Node instance bound to a DOM node or fragment 0N/A * Creates a new Node using the provided markup string. 0N/A * @param {String} html The markup used to create the element 0N/A * @param {HTMLDocument} doc An optional document context 0N/A * @return {Node} A Node instance bound to a DOM node or fragment 0N/A * Inserts the content before the reference node. 0N/A * @param {String | Y.Node | HTMLElement | Y.NodeList | HTMLCollection} content The content to insert 0N/A * @param {Int | Y.Node | HTMLElement | String} where The position to insert at. 0N/A * Possible "where" arguments 172N/A * <dd>The Node to insert before</dd> 172N/A * <dd>The element to insert before</dd> 156N/A * <dd>The index of the child element to insert before</dd> 156N/A * <dd>Replaces the existing HTML</dd> 156N/A * <dd>Inserts before the existing HTML</dd> 0N/A * <dd>Inserts content before the node</dd> 221N/A * <dd>Inserts content after the node</dd> * Inserts the content as the firstChild of the node. * @param {String | Y.Node | HTMLElement} content The content to insert * Inserts the content as the lastChild of the node. * @param {String | Y.Node | HTMLElement} content The content to insert * @param {String | HTMLElement | Node} node Node to be appended * @return {Node} The appended node * @param {String | HTMLElement | Node} newNode Node to be appended * @param {HTMLElement | Node} refNode Node to be inserted before * @return {Node} The inserted node * Appends the node to the given node. * @param {Y.Node | HTMLElement} node The node to append to * Replaces the node's current content with the content. * @param {String | Y.Node | HTMLElement | Y.NodeList | HTMLCollection} content The content to insert * Returns the node's current content (e.g. innerHTML) * @return {String} The current content return this.
get(
'innerHTML');
* Called on each Node instance /** Called on each Node instance * Called on each Node instance /** Called on each Node instance /** Called on each Node instance /** Called on each Node instance /** Called on each Node instance * Static collection of configuration attributes for special handling * Allows for getting and setting the text of an element. * Formatting is preserved and special characters are treated literally. * Allows for getting and setting the text of an element. * Formatting is preserved and special characters are treated literally. * Returns a NodeList instance of all HTMLElement children. * Allows setting attributes on DOM nodes, normalizing in some cases. * This passes through to the DOM node, allowing for custom attributes. * @param {string} name The attribute name * @param {string} value The value to set * Allows getting attributes on DOM nodes, normalizing in some cases. * This passes through to the DOM node, allowing for custom attributes. * @param {string} name The attribute name * @return {string} The attribute value * List of events that route to DOM events // Add custom event adaptors to this list. This will make it so // that delegate, key, available, contentready, etc all will // be available through Node.on * Removes event listeners from the node and (optionally) its subtree * @param {Boolean} recurse (optional) Whether or not to remove listeners from the * @param {String} type (optional) Only remove listeners of the specified type // map to Y.on/after signature (type, fn, nodes, context, arg1, arg2, etc) if (
args.
length <
2) {
// type only (event hash) just add nodes args[
3] =
context ||
this;
// default to NodeList instance as context * Applies an event listener to each Node bound to the NodeList. * @param {String} type The event being listened for * @param {Function} fn The handler to call when the event fires * @param {Object} context The context to call the handler with. * Default is the NodeList instance. * @param {Object} context The context to call the handler with. * param {mixed} arg* 0..n additional arguments to supply to the subscriber * @return {Object} Returns an event handle that can later be use to detach(). * Applies an one-time event listener to each Node bound to the NodeList. * @param {String} type The event being listened for * @param {Function} fn The handler to call when the event fires * @param {Object} context The context to call the handler with. * Default is the NodeList instance. * @return {Object} Returns an event handle that can later be use to detach(). * Applies an event listener to each Node bound to the NodeList. * The handler is called only after all on() handlers are called * and the event is not prevented. * @param {String} type The event being listened for * @param {Function} fn The handler to call when the event fires * @param {Object} context The context to call the handler with. * Default is the NodeList instance. * @return {Object} Returns an event handle that can later be use to detach(). * Applies an one-time event listener to each Node bound to the NodeList * that will be called only after all on() handlers are called and the * event is not prevented. * @param {String} type The event being listened for * @param {Function} fn The handler to call when the event fires * @param {Object} context The context to call the handler with. * Default is the NodeList instance. * @return {Object} Returns an event handle that can later be use to detach(). * Called on each Node instance /** Called on each Node instance * Makes the node visible. * If the "transition" module is loaded, show optionally * animates the showing of the node using either the default * transition effect ('fadeIn'), or the given named effect. * @param {String} name A named Transition effect to use as the show effect. * @param {Object} config Options to use with the transition. * @param {Function} callback An optional function to run after the transition completes. * The implementation for showing nodes. * Default is to toggle the style.display property. // base on current state if not forcing if (
typeof on !=
'boolean') {
* If the "transition" module is loaded, hide optionally * animates the hiding of the node using either the default * transition effect ('fadeOut'), or the given named effect. * @param {String} name A named Transition effect to use as the show effect. * @param {Object} config Options to use with the transition. * @param {Function} callback An optional function to run after the transition completes. * The implementation for hiding nodes. * Default is to toggle the style.display property. * Makes each node visible. * If the "transition" module is loaded, show optionally * animates the showing of the node using either the default * transition effect ('fadeIn'), or the given named effect. * @param {String} name A named Transition effect to use as the show effect. * @param {Object} config Options to use with the transition. * @param {Function} callback An optional function to run after the transition completes. * If the "transition" module is loaded, hide optionally * animates the hiding of the node using either the default * transition effect ('fadeOut'), or the given named effect. * @param {String} name A named Transition effect to use as the show effect. * @param {Object} config Options to use with the transition. * @param {Function} callback An optional function to run after the transition completes. if (
this.
get(
'value') !==
"") {
// IE < 8 fails to populate specified when set in HTML // IE throws an error when calling focus() on an element that's invisible, not // displayed, or disabled. Y.
log(
'error focusing node: ' + e.
toString(),
'error',
'node');
// IE throws error when setting input.type = 'hidden', // input.setAttribute('type', 'hidden') and input.attributes.type.value = 'hidden' try {
// IE errors when changing the type from "hidden' Y.
log(
'error setting type: ' +
val,
'info',
'node');
_bypassProxy:
true // don't update DOM when using with Attribute // IE: elements collection is also FORM node which trips up scrubVal. return this.
all(
'input, textarea, button, select');
},
'@VERSION@' ,{
requires:[
'dom-base',
'node-core',
'event-base']});