1
/* YUI 3.9.1 (build 5852) Copyright 2013 Yahoo! Inc. http://yuilibrary.com/license/ */
2
YUI.add('node-deprecated', function (Y, NAME) {
6
* @submodule node-deprecated
13
* Flat data store for off-DOM usage
16
* @deprecated Use getData/setData
23
setter: function(val) {
31
* Returns a single Node instance bound to the node or the
32
* first element matching the given selector.
35
* @deprecated Use Y.one
37
* @param {String | HTMLElement} node a node or Selector
38
* @param {Node | HTMLElement} doc an optional document to scan. Defaults to Y.config.doc.
42
* Returns a single Node instance bound to the node or the
43
* first element matching the given selector.
46
* @deprecated Use Y.one
48
* @param {String | HTMLElement} node a node or Selector
49
* @param {Node | HTMLElement} doc an optional document to scan. Defaults to Y.config.doc.
51
Y.get = Y_Node.get = function() {
52
Y.log('Y.get is deprecated, use Y.one', 'warn', 'deprecated');
53
return Y_Node.one.apply(Y_Node, arguments);
57
Y.mix(Y_Node.prototype, {
59
* Retrieves a Node instance of nodes based on the given CSS selector.
61
* @deprecated Use one()
62
* @param {string} selector The CSS selector to test against.
63
* @return {Node} A Node instance for the matching HTMLElement.
65
query: function(selector) {
66
Y.log('query() is deprecated, use one()', 'warn', 'deprecated');
67
return this.one(selector);
71
* Retrieves a nodeList based on the given CSS selector.
73
* @deprecated Use all()
74
* @param {string} selector The CSS selector to test against.
75
* @return {NodeList} A NodeList instance for the matching HTMLCollection/Array.
77
queryAll: function(selector) {
78
Y.log('queryAll() is deprecated, use all()', 'warn', 'deprecated');
79
return this.all(selector);
83
* Applies the given function to each Node in the NodeList.
85
* @deprecated Use NodeList
86
* @param {Function} fn The function to apply
87
* @param {Object} context optional An optional context to apply the function with
88
* Default context is the NodeList instance
91
each: function(fn, context) {
92
context = context || this;
93
Y.log('each is deprecated on Node', 'warn', 'deprecated');
94
return fn.call(context, this);
98
* Retrieves the Node instance at the given index.
100
* @deprecated Use NodeList
102
* @param {Number} index The index of the target Node.
103
* @return {Node} The Node instance at the given index.
105
item: function(index) {
106
Y.log('item is deprecated on Node', 'warn', 'deprecated');
111
* Returns the current number of items in the Node.
113
* @deprecated Use NodeList
114
* @return {Int} The number of items in the Node.
117
Y.log('size is deprecated on Node', 'warn', 'deprecated');
118
return this._node ? 1 : 0;
126
}, '3.9.1', {"requires": ["node-base"]});