src/cm/media/js/lib/yui/yui_3.10.3/build/attribute-complex/attribute-complex.js
author Yves-Marie Haussonne <ymh.work+github@gmail.com>
Fri, 09 May 2014 18:35:26 +0200
changeset 656 a84519031134
parent 525 89ef5ed3c48b
permissions -rw-r--r--
add link to "privacy policy" in the header test
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
525
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
     1
/*
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
     2
YUI 3.10.3 (build 2fb5187)
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
     3
Copyright 2013 Yahoo! Inc. All rights reserved.
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
     4
Licensed under the BSD License.
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
     5
http://yuilibrary.com/license/
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
     6
*/
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
     7
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
     8
YUI.add('attribute-complex', function (Y, NAME) {
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
     9
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    10
    /**
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    11
     * Adds support for attribute providers to handle complex attributes in the constructor
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    12
     *
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    13
     * @module attribute
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    14
     * @submodule attribute-complex
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    15
     * @for Attribute
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    16
     * @deprecated AttributeComplex's overrides are now part of AttributeCore.
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    17
     */
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    18
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    19
    var Attribute = Y.Attribute;
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    20
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    21
    Attribute.Complex = function() {};
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    22
    Attribute.Complex.prototype = {
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    23
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    24
        /**
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    25
         * Utility method to split out simple attribute name/value pairs ("x")
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    26
         * from complex attribute name/value pairs ("x.y.z"), so that complex
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    27
         * attributes can be keyed by the top level attribute name.
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    28
         *
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    29
         * @method _normAttrVals
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    30
         * @param {Object} valueHash An object with attribute name/value pairs
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    31
         *
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    32
         * @return {Object} An object literal with 2 properties - "simple" and "complex",
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    33
         * containing simple and complex attribute values respectively keyed
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    34
         * by the top level attribute name, or null, if valueHash is falsey.
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    35
         *
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    36
         * @private
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    37
         */
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    38
        _normAttrVals : Attribute.prototype._normAttrVals,
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    39
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    40
        /**
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    41
         * Returns the initial value of the given attribute from
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    42
         * either the default configuration provided, or the
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    43
         * over-ridden value if it exists in the set of initValues
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    44
         * provided and the attribute is not read-only.
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    45
         *
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    46
         * @param {String} attr The name of the attribute
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    47
         * @param {Object} cfg The attribute configuration object
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    48
         * @param {Object} initValues The object with simple and complex attribute name/value pairs returned from _normAttrVals
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    49
         *
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    50
         * @return {Any} The initial value of the attribute.
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    51
         *
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    52
         * @method _getAttrInitVal
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    53
         * @private
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    54
         */
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    55
        _getAttrInitVal : Attribute.prototype._getAttrInitVal
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    56
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    57
    };
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    58
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    59
    // Consistency with the rest of the Attribute addons for now.
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    60
    Y.AttributeComplex = Attribute.Complex;
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    61
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    62
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    63
}, '3.10.3', {"requires": ["attribute-base"]});