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
Y.log('Y.get is deprecated, use Y.one', 'warn', 'deprecated');
40
return Y_Node.one.apply(Y_Node, arguments);
44
Y.mix(Y_Node.prototype, {
46
* Retrieves a Node instance of nodes based on the given CSS selector.
48
* @deprecated Use one()
49
* @param {string} selector The CSS selector to test against.
50
* @return {Node} A Node instance for the matching HTMLElement.
52
query: function(selector) {
53
Y.log('query() is deprecated, use one()', 'warn', 'deprecated');
54
return this.one(selector);
58
* Retrieves a nodeList based on the given CSS selector.
60
* @deprecated Use all()
61
* @param {string} selector The CSS selector to test against.
62
* @return {NodeList} A NodeList instance for the matching HTMLCollection/Array.
64
queryAll: function(selector) {
65
Y.log('queryAll() is deprecated, use all()', 'warn', 'deprecated');
66
return this.all(selector);
70
* Applies the given function to each Node in the NodeList.
72
* @deprecated Use NodeList
73
* @param {Function} fn The function to apply
74
* @param {Object} context optional An optional context to apply the function with
75
* Default context is the NodeList instance
78
each: function(fn, context) {
79
context = context || this;
80
Y.log('each is deprecated on Node', 'warn', 'deprecated');
81
return fn.call(context, this);
85
* Retrieves the Node instance at the given index.
87
* @deprecated Use NodeList
89
* @param {Number} index The index of the target Node.
90
* @return {Node} The Node instance at the given index.
92
item: function(index) {
93
Y.log('item is deprecated on Node', 'warn', 'deprecated');
98
* Returns the current number of items in the Node.
100
* @deprecated Use NodeList
101
* @return {Int} The number of items in the Node.
104
Y.log('size is deprecated on Node', 'warn', 'deprecated');
105
return this._node ? 1 : 0;
113
}, '3.3.0' ,{requires:['node-base']});