~ubuntu-branches/ubuntu/utopic/moodle/utopic

« back to all changes in this revision

Viewing changes to lib/yuilib/3.9.1/build/node-deprecated/node-deprecated-debug.js

  • Committer: Package Import Robot
  • Author(s): Thijs Kinkhorst
  • Date: 2014-05-12 16:10:38 UTC
  • mfrom: (36.1.3 sid)
  • Revision ID: package-import@ubuntu.com-20140512161038-puyqf65k4e0s8ytz
Tags: 2.6.3-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* YUI 3.9.1 (build 5852) Copyright 2013 Yahoo! Inc. http://yuilibrary.com/license/ */
2
 
YUI.add('node-deprecated', function (Y, NAME) {
3
 
 
4
 
/**
5
 
 * @module node
6
 
 * @submodule node-deprecated
7
 
 * @deprecated
8
 
 */
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
 
 * @for Node
18
 
 */
19
 
Y_Node.ATTRS.data = {
20
 
    getter: function() {
21
 
        return this._dataVal;
22
 
    },
23
 
    setter: function(val) {
24
 
        this._dataVal = val;
25
 
        return val;
26
 
    },
27
 
    value: null
28
 
};
29
 
 
30
 
/**
31
 
 * Returns a single Node instance bound to the node or the
32
 
 * first element matching the given selector.
33
 
 * @method get
34
 
 * @for YUI
35
 
 * @deprecated Use Y.one
36
 
 * @static
37
 
 * @param {String | HTMLElement} node a node or Selector
38
 
 * @param {Node | HTMLElement} doc an optional document to scan. Defaults to Y.config.doc.
39
 
 */
40
 
 
41
 
/**
42
 
 * Returns a single Node instance bound to the node or the
43
 
 * first element matching the given selector.
44
 
 * @method get
45
 
 * @for Node
46
 
 * @deprecated Use Y.one
47
 
 * @static
48
 
 * @param {String | HTMLElement} node a node or Selector
49
 
 * @param {Node | HTMLElement} doc an optional document to scan. Defaults to Y.config.doc.
50
 
 */
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);
54
 
};
55
 
 
56
 
 
57
 
Y.mix(Y_Node.prototype, {
58
 
    /**
59
 
     * Retrieves a Node instance of nodes based on the given CSS selector.
60
 
     * @method query
61
 
     * @deprecated Use one()
62
 
     * @param {string} selector The CSS selector to test against.
63
 
     * @return {Node} A Node instance for the matching HTMLElement.
64
 
     */
65
 
    query: function(selector) {
66
 
        Y.log('query() is deprecated, use one()', 'warn', 'deprecated');
67
 
        return this.one(selector);
68
 
    },
69
 
 
70
 
    /**
71
 
     * Retrieves a nodeList based on the given CSS selector.
72
 
     * @method queryAll
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.
76
 
     */
77
 
    queryAll: function(selector) {
78
 
        Y.log('queryAll() is deprecated, use all()', 'warn', 'deprecated');
79
 
        return this.all(selector);
80
 
    },
81
 
 
82
 
    /**
83
 
     * Applies the given function to each Node in the NodeList.
84
 
     * @method each
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
89
 
     * @chainable
90
 
     */
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);
95
 
    },
96
 
 
97
 
    /**
98
 
     * Retrieves the Node instance at the given index.
99
 
     * @method item
100
 
     * @deprecated Use NodeList
101
 
     *
102
 
     * @param {Number} index The index of the target Node.
103
 
     * @return {Node} The Node instance at the given index.
104
 
     */
105
 
    item: function(index) {
106
 
        Y.log('item is deprecated on Node', 'warn', 'deprecated');
107
 
        return this;
108
 
    },
109
 
 
110
 
    /**
111
 
     * Returns the current number of items in the Node.
112
 
     * @method size
113
 
     * @deprecated Use NodeList
114
 
     * @return {Int} The number of items in the Node.
115
 
     */
116
 
    size: function() {
117
 
        Y.log('size is deprecated on Node', 'warn', 'deprecated');
118
 
        return this._node ? 1 : 0;
119
 
    }
120
 
 
121
 
});
122
 
 
123
 
 
124
 
 
125
 
 
126
 
}, '3.9.1', {"requires": ["node-base"]});