~ted/lazr-js/annoying-debug-message

« back to all changes in this revision

Viewing changes to src-js/lazrjs/yui/attribute/attribute.js

  • Committer: Launchpad Patch Queue Manager
  • Date: 2010-09-09 14:20:30 UTC
  • mfrom: (182.1.3 yui-3.2)
  • Revision ID: launchpad@pqm.canonical.com-20100909142030-13w6vo0ixfysxc15
[r=beuno] Update lazr-js to yui-3.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
Copyright (c) 2010, Yahoo! Inc. All rights reserved.
3
3
Code licensed under the BSD License:
4
4
http://developer.yahoo.com/yui/license.html
5
 
version: 3.1.2
6
 
build: 56
 
5
version: 3.2.0
 
6
build: 2676
7
7
*/
8
8
YUI.add('attribute-base', function(Y) {
9
9
 
277
277
         *    <dd>
278
278
         *    <p>A function, which will return the initial value to set on the attribute. This is useful
279
279
         *    for cases where the attribute configuration is defined statically, but needs to 
280
 
         *    reference the host instance ("this") to obtain an initial value.
281
 
         *    If defined, valueFn has precedence over the value property.</p>
 
280
         *    reference the host instance ("this") to obtain an initial value. If both the value and valueFn properties are defined, 
 
281
         *    the value returned by the valueFn has precedence over the value property, unless it returns undefined, in which 
 
282
         *    case the value property is used.</p>
282
283
         *
283
284
         *    <p>valueFn can also be set to a string, representing the name of the instance method to be used to retrieve the value.</p>
284
285
         *    </dd>
287
288
         *    <dd>Whether or not the attribute is read only. Attributes having readOnly set to true
288
289
         *        cannot be modified by invoking the set method.</dd>
289
290
         *
290
 
         *    <dt>writeOnce &#60;boolean&#62;</dt>
291
 
         *    <dd>Whether or not the attribute is "write once". Attributes having writeOnce set to true, 
 
291
         *    <dt>writeOnce &#60;boolean&#62; or &#60;string&#62;</dt>
 
292
         *    <dd>
 
293
         *        Whether or not the attribute is "write once". Attributes having writeOnce set to true, 
292
294
         *        can only have their values set once, be it through the default configuration, 
293
 
         *        constructor configuration arguments, or by invoking set.</dd>
 
295
         *        constructor configuration arguments, or by invoking set.
 
296
         *        <p>The writeOnce attribute can also be set to the string "initOnly", in which case the attribute can only be set during initialization
 
297
         *        (when used with Base, this means it can only be set during construction)</p>
 
298
         *    </dd>
294
299
         *
295
300
         *    <dt>setter &#60;Function | String&#62;</dt>
296
301
         *    <dd>
1111
1116
 
1112
1117
 
1113
1118
            return val;
 
1119
        },
 
1120
 
 
1121
        /**
 
1122
         * Returns an object with the configuration properties (and value)
 
1123
         * for the given attrubute. If attrName is not provided, returns the
 
1124
         * configuration properties for all attributes.
 
1125
         *
 
1126
         * @method _getAttrCfg
 
1127
         * @protected
 
1128
         * @param {String} name Optional. The attribute name. If not provided, the method will return the configuration for all attributes.
 
1129
         * @return {Object} The configuration properties for the given attribute, or all attributes.
 
1130
         */
 
1131
        _getAttrCfg : function(name) {
 
1132
            var o,
 
1133
                data = this._state.data;
 
1134
 
 
1135
            if (data) {
 
1136
                o = {};
 
1137
 
 
1138
                Y.each(data, function(cfg, cfgProp) {
 
1139
                    if (name) {
 
1140
                        if(name in cfg) {
 
1141
                            o[cfgProp] = cfg[name];
 
1142
                        }
 
1143
                    } else {
 
1144
                        Y.each(cfg, function(attrCfg, attr) {
 
1145
                           o[attr] = o[attr] || {};
 
1146
                           o[attr][cfgProp] = attrCfg;
 
1147
                        });
 
1148
                    }
 
1149
                });
 
1150
            }
 
1151
 
 
1152
            return o;
1114
1153
        }
1115
1154
    };
1116
1155
 
1120
1159
    Y.Attribute = Attribute;
1121
1160
 
1122
1161
 
1123
 
}, '3.1.2' ,{requires:['event-custom']});
 
1162
}, '3.2.0' ,{requires:['event-custom']});
1124
1163
YUI.add('attribute-complex', function(Y) {
1125
1164
 
1126
1165
    /**
1243
1282
    Y.mix(Y.Attribute, Y.Attribute.Complex, true, null, 1);
1244
1283
 
1245
1284
 
1246
 
}, '3.1.2' ,{requires:['attribute-base']});
1247
 
 
1248
 
 
1249
 
YUI.add('attribute', function(Y){}, '3.1.2' ,{use:['attribute-base', 'attribute-complex']});
 
1285
}, '3.2.0' ,{requires:['attribute-base']});
 
1286
 
 
1287
 
 
1288
YUI.add('attribute', function(Y){}, '3.2.0' ,{use:['attribute-base', 'attribute-complex']});
1250
1289