NOBUG: Fixed file access permissions
[moodle.git] / lib / yuilib / 3.13.0 / tree-labelable / tree-labelable-debug.js
blob7a8e94ecd71010318cdf006df978227234dc0ffc
1 /*
2 YUI 3.13.0 (build 508226d)
3 Copyright 2013 Yahoo! Inc. All rights reserved.
4 Licensed under the BSD License.
5 http://yuilibrary.com/license/
6 */
8 YUI.add('tree-labelable', function (Y, NAME) {
10 /*jshint expr:true, onevar:false */
12 /**
13 Extension for `Tree` that adds baked-in support for node labels like you might
14 see in a treeview or menu.
16 @module tree
17 @submodule tree-labelable
18 @main tree-labelable
19 **/
21 /**
22 Extension for `Tree` that adds baked-in support for node labels like you might
23 see in a treeview or menu.
25 @class Tree.Labelable
26 @constructor
27 @extensionfor Tree
28 **/
30 function Labelable() {}
32 Labelable.prototype = {
33     initializer: function () {
34         this.nodeExtensions = this.nodeExtensions.concat(Y.Tree.Node.Labelable);
35     }
38 Y.Tree.Labelable = Labelable;
39 /**
40 @module tree
41 @submodule tree-labelable
42 **/
44 /**
45 `Tree.Node` extension that adds baked in support for labels like you might see
46 in a treeview or menu.
48 **Security note:** The label is stored in raw, unescaped form. If you choose to
49 render the label as HTML, be sure to escape it first with `Y.Escape.html()`
50 unless you actually intend to render raw HTML contained in the label.
52 @class Tree.Node.Labelable
53 @constructor
54 @param {Tree} tree `Tree` instance with which this node should be associated.
55 @param {Object} [config] Configuration hash.
56     @param {String} [config.label=''] Label for this node.
57 @extensionfor Tree.Node
58 **/
60 function NodeLabelable(tree, config) {
61     this._serializable = this._serializable.concat('label');
63     if ('label' in config) {
64         this.label = config.label;
65     }
68 NodeLabelable.prototype = {
69     /**
70     Label for this node.
72     **Security note:** The label is stored in raw, unescaped form. If you choose
73     to render the label as HTML, be sure to escape it first with
74     `Y.Escape.html()` unless you actually intend to render raw HTML contained in
75     the label.
77     @property {String} label
78     @default ''
79     **/
80     label: ''
83 Y.Tree.Node.Labelable = NodeLabelable;
86 }, '3.13.0', {"requires": ["tree"]});