~smagoun/whoopsie/whoopsie-lp1017637

« back to all changes in this revision

Viewing changes to backend/stats/static/js/yui/build/node-deprecated/node-deprecated-debug.js

  • Committer: Evan Dandrea
  • Date: 2012-05-09 05:53:45 UTC
  • Revision ID: evan.dandrea@canonical.com-20120509055345-z2j41tmcbf4as5uf
The backend now lives in lp:daisy and the website (errors.ubuntu.com) now lives in lp:errors.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
YUI 3.5.0 (build 5089)
3
 
Copyright 2012 Yahoo! Inc. All rights reserved.
4
 
Licensed under the BSD License.
5
 
http://yuilibrary.com/license/
6
 
*/
7
 
YUI.add('node-deprecated', function(Y) {
8
 
 
9
 
/**
10
 
 * @module node
11
 
 * @submodule node-deprecated
12
 
 * @deprecated
13
 
 */
14
 
 
15
 
var Y_Node = Y.Node;
16
 
 
17
 
/*
18
 
 * Flat data store for off-DOM usage
19
 
 * @config data
20
 
 * @type any
21
 
 * @deprecated Use getData/setData
22
 
 * @for Node
23
 
 */
24
 
Y_Node.ATTRS.data = {
25
 
    getter: function() {
26
 
        return this._dataVal;
27
 
    },
28
 
    setter: function(val) {
29
 
        this._dataVal = val;
30
 
        return val;
31
 
    },
32
 
    value: null
33
 
};
34
 
 
35
 
/**
36
 
 * Returns a single Node instance bound to the node or the
37
 
 * first element matching the given selector.
38
 
 * @method get
39
 
 * @for YUI
40
 
 * @deprecated Use Y.one
41
 
 * @static
42
 
 * @param {String | HTMLElement} node a node or Selector
43
 
 * @param {Node | HTMLElement} doc an optional document to scan. Defaults to Y.config.doc.
44
 
 */
45
 
 
46
 
/**
47
 
 * Returns a single Node instance bound to the node or the
48
 
 * first element matching the given selector.
49
 
 * @method get
50
 
 * @for Node
51
 
 * @deprecated Use Y.one
52
 
 * @static
53
 
 * @param {String | HTMLElement} node a node or Selector
54
 
 * @param {Node | HTMLElement} doc an optional document to scan. Defaults to Y.config.doc.
55
 
 */
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);
59
 
};
60
 
 
61
 
 
62
 
Y.mix(Y_Node.prototype, {
63
 
    /**
64
 
     * Retrieves a Node instance of nodes based on the given CSS selector.
65
 
     * @method query
66
 
     * @deprecated Use one()
67
 
     * @param {string} selector The CSS selector to test against.
68
 
     * @return {Node} A Node instance for the matching HTMLElement.
69
 
     */
70
 
    query: function(selector) {
71
 
        Y.log('query() is deprecated, use one()', 'warn', 'deprecated');
72
 
        return this.one(selector);
73
 
    },
74
 
 
75
 
    /**
76
 
     * Retrieves a nodeList based on the given CSS selector.
77
 
     * @method queryAll
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.
81
 
     */
82
 
    queryAll: function(selector) {
83
 
        Y.log('queryAll() is deprecated, use all()', 'warn', 'deprecated');
84
 
        return this.all(selector);
85
 
    },
86
 
 
87
 
    /**
88
 
     * Applies the given function to each Node in the NodeList.
89
 
     * @method each
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
94
 
     * @chainable
95
 
     */
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);
100
 
    },
101
 
 
102
 
    /**
103
 
     * Retrieves the Node instance at the given index.
104
 
     * @method item
105
 
     * @deprecated Use NodeList
106
 
     *
107
 
     * @param {Number} index The index of the target Node.
108
 
     * @return {Node} The Node instance at the given index.
109
 
     */
110
 
    item: function(index) {
111
 
        Y.log('item is deprecated on Node', 'warn', 'deprecated');
112
 
        return this;
113
 
    },
114
 
 
115
 
    /**
116
 
     * Returns the current number of items in the Node.
117
 
     * @method size
118
 
     * @deprecated Use NodeList
119
 
     * @return {Int} The number of items in the Node.
120
 
     */
121
 
    size: function() {
122
 
        Y.log('size is deprecated on Node', 'warn', 'deprecated');
123
 
        return this._node ? 1 : 0;
124
 
    }
125
 
 
126
 
});
127
 
 
128
 
 
129
 
 
130
 
 
131
 
}, '3.5.0' ,{requires:['node-base']});