3
Copyright 2012 Yahoo! Inc. All rights reserved.
4
Licensed under the BSD License.
5
http://yuilibrary.com/license/
7
YUI.add('node-deprecated', function(Y) {
11
* @submodule node-deprecated
18
* Flat data store for off-DOM usage
21
* @deprecated Use getData/setData
28
setter: function(val) {
36
* Returns a single Node instance bound to the node or the
37
* first element matching the given selector.
40
* @deprecated Use Y.one
42
* @param {String | HTMLElement} node a node or Selector
43
* @param {Node | HTMLElement} doc an optional document to scan. Defaults to Y.config.doc.
47
* Returns a single Node instance bound to the node or the
48
* first element matching the given selector.
51
* @deprecated Use Y.one
53
* @param {String | HTMLElement} node a node or Selector
54
* @param {Node | HTMLElement} doc an optional document to scan. Defaults to Y.config.doc.
56
Y.get = Y_Node.get = function() {
57
Y.log('Y.get is deprecated, use Y.one', 'warn', 'deprecated');
58
return Y_Node.one.apply(Y_Node, arguments);
62
Y.mix(Y_Node.prototype, {
64
* Retrieves a Node instance of nodes based on the given CSS selector.
66
* @deprecated Use one()
67
* @param {string} selector The CSS selector to test against.
68
* @return {Node} A Node instance for the matching HTMLElement.
70
query: function(selector) {
71
Y.log('query() is deprecated, use one()', 'warn', 'deprecated');
72
return this.one(selector);
76
* Retrieves a nodeList based on the given CSS selector.
78
* @deprecated Use all()
79
* @param {string} selector The CSS selector to test against.
80
* @return {NodeList} A NodeList instance for the matching HTMLCollection/Array.
82
queryAll: function(selector) {
83
Y.log('queryAll() is deprecated, use all()', 'warn', 'deprecated');
84
return this.all(selector);
88
* Applies the given function to each Node in the NodeList.
90
* @deprecated Use NodeList
91
* @param {Function} fn The function to apply
92
* @param {Object} context optional An optional context to apply the function with
93
* Default context is the NodeList instance
96
each: function(fn, context) {
97
context = context || this;
98
Y.log('each is deprecated on Node', 'warn', 'deprecated');
99
return fn.call(context, this);
103
* Retrieves the Node instance at the given index.
105
* @deprecated Use NodeList
107
* @param {Number} index The index of the target Node.
108
* @return {Node} The Node instance at the given index.
110
item: function(index) {
111
Y.log('item is deprecated on Node', 'warn', 'deprecated');
116
* Returns the current number of items in the Node.
118
* @deprecated Use NodeList
119
* @return {Int} The number of items in the Node.
122
Y.log('size is deprecated on Node', 'warn', 'deprecated');
123
return this._node ? 1 : 0;
131
}, '3.5.0' ,{requires:['node-base']});