~canonical-isd-hackers/canonical-identity-provider/yubikey-merged

« back to all changes in this revision

Viewing changes to identityprovider/media/src-js/lazrjs/yui/node/node-deprecated-debug.js

merged in latest trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
Copyright (c) 2010, Yahoo! Inc. All rights reserved.
 
3
Code licensed under the BSD License:
 
4
http://developer.yahoo.com/yui/license.html
 
5
version: 3.3.0
 
6
build: 3167
 
7
*/
 
8
YUI.add('node-deprecated', function(Y) {
 
9
 
 
10
var Y_Node = Y.Node;
 
11
 
 
12
/*
 
13
 * Flat data store for off-DOM usage 
 
14
 * @config data
 
15
 * @type any
 
16
 * @deprecated Use getData/setData
 
17
 */
 
18
Y_Node.ATTRS.data = {
 
19
    getter: function() { 
 
20
        return this._dataVal; 
 
21
    },
 
22
    setter: function(val) { 
 
23
        this._dataVal = val;
 
24
        return val;
 
25
    },
 
26
    value: null
 
27
};
 
28
 
 
29
/**
 
30
 * Returns a single Node instance bound to the node or the
 
31
 * first element matching the given selector.
 
32
 * @method Y.get
 
33
 * @deprecated Use Y.one
 
34
 * @static
 
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. 
 
37
 */
 
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);
 
41
};
 
42
 
 
43
 
 
44
Y.mix(Y_Node.prototype, {
 
45
    /**
 
46
     * Retrieves a Node instance of nodes based on the given CSS selector. 
 
47
     * @method query
 
48
     * @deprecated Use one()
 
49
     * @param {string} selector The CSS selector to test against.
 
50
     * @return {Node} A Node instance for the matching HTMLElement.
 
51
     */
 
52
    query: function(selector) {
 
53
        Y.log('query() is deprecated, use one()', 'warn', 'deprecated');
 
54
        return this.one(selector);
 
55
    },
 
56
 
 
57
    /**
 
58
     * Retrieves a nodeList based on the given CSS selector. 
 
59
     * @method queryAll
 
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.
 
63
     */
 
64
    queryAll: function(selector) {
 
65
        Y.log('queryAll() is deprecated, use all()', 'warn', 'deprecated');
 
66
        return this.all(selector);
 
67
    },
 
68
 
 
69
    /**
 
70
     * Applies the given function to each Node in the NodeList.
 
71
     * @method each
 
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
 
76
     * @chainable
 
77
     */
 
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);
 
82
    },
 
83
 
 
84
    /**
 
85
     * Retrieves the Node instance at the given index. 
 
86
     * @method item
 
87
     * @deprecated Use NodeList
 
88
     *
 
89
     * @param {Number} index The index of the target Node.
 
90
     * @return {Node} The Node instance at the given index.
 
91
     */
 
92
    item: function(index) {
 
93
        Y.log('item is deprecated on Node', 'warn', 'deprecated');
 
94
        return this;
 
95
    },
 
96
 
 
97
    /**
 
98
     * Returns the current number of items in the Node.
 
99
     * @method size
 
100
     * @deprecated Use NodeList
 
101
     * @return {Int} The number of items in the Node. 
 
102
     */
 
103
    size: function() {
 
104
        Y.log('size is deprecated on Node', 'warn', 'deprecated');
 
105
        return this._node ? 1 : 0;
 
106
    }
 
107
 
 
108
});
 
109
 
 
110
 
 
111
 
 
112
 
 
113
}, '3.3.0' ,{requires:['node-base']});