2 Copyright (c) 2010, Yahoo! Inc. All rights reserved.
3 Code licensed under the BSD License:
4 http://developer.yahoo.com/yui/license.html
8 YUI.add('node-deprecated', function(Y) {
13 * Flat data store for off-DOM usage
16 * @deprecated Use getData/setData
22 setter: function(val) {
30 * Returns a single Node instance bound to the node or the
31 * first element matching the given selector.
33 * @deprecated Use Y.one
35 * @param {String | HTMLElement} node a node or Selector
36 * @param {Y.Node || HTMLElement} doc an optional document to scan. Defaults to Y.config.doc.
38 Y.get = Y_Node.get = function() {
39 return Y_Node.one.apply(Y_Node, arguments);
43 Y.mix(Y_Node.prototype, {
45 * Retrieves a Node instance of nodes based on the given CSS selector.
47 * @deprecated Use one()
48 * @param {string} selector The CSS selector to test against.
49 * @return {Node} A Node instance for the matching HTMLElement.
51 query: function(selector) {
52 return this.one(selector);
56 * Retrieves a nodeList based on the given CSS selector.
58 * @deprecated Use all()
59 * @param {string} selector The CSS selector to test against.
60 * @return {NodeList} A NodeList instance for the matching HTMLCollection/Array.
62 queryAll: function(selector) {
63 return this.all(selector);
67 * Applies the given function to each Node in the NodeList.
69 * @deprecated Use NodeList
70 * @param {Function} fn The function to apply
71 * @param {Object} context optional An optional context to apply the function with
72 * Default context is the NodeList instance
75 each: function(fn, context) {
76 context = context || this;
77 return fn.call(context, this);
81 * Retrieves the Node instance at the given index.
83 * @deprecated Use NodeList
85 * @param {Number} index The index of the target Node.
86 * @return {Node} The Node instance at the given index.
88 item: function(index) {
93 * Returns the current number of items in the Node.
95 * @deprecated Use NodeList
96 * @return {Int} The number of items in the Node.
99 return this._node ? 1 : 0;
107 }, '3.3.0' ,{requires:['node-base']});