roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gma...@apache.org
Subject svn commit: r1609737 [3/18] - in /roller/trunk/app/src/main/webapp: WEB-INF/jsps/editor/ WEB-INF/jsps/tiles/ roller-ui/yui3/arraylist/ roller-ui/yui3/assets/ roller-ui/yui3/assets/skins/ roller-ui/yui3/assets/skins/sam/ roller-ui/yui3/async-queue/ roll...
Date Fri, 11 Jul 2014 16:23:29 GMT
Added: roller/trunk/app/src/main/webapp/roller-ui/yui3/attribute-core/attribute-core.js
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/webapp/roller-ui/yui3/attribute-core/attribute-core.js?rev=1609737&view=auto
==============================================================================
--- roller/trunk/app/src/main/webapp/roller-ui/yui3/attribute-core/attribute-core.js (added)
+++ roller/trunk/app/src/main/webapp/roller-ui/yui3/attribute-core/attribute-core.js Fri Jul 11 16:23:25 2014
@@ -0,0 +1,1203 @@
+/*
+YUI 3.17.2 (build 9c3c78e)
+Copyright 2014 Yahoo! Inc. All rights reserved.
+Licensed under the BSD License.
+http://yuilibrary.com/license/
+*/
+
+YUI.add('attribute-core', function (Y, NAME) {
+
+    /**
+     * The State class maintains state for a collection of named items, with
+     * a varying number of properties defined.
+     *
+     * It avoids the need to create a separate class for the item, and separate instances
+     * of these classes for each item, by storing the state in a 2 level hash table,
+     * improving performance when the number of items is likely to be large.
+     *
+     * @constructor
+     * @class State
+     */
+    Y.State = function() {
+        /**
+         * Hash of attributes
+         * @property data
+         */
+        this.data = {};
+    };
+
+    Y.State.prototype = {
+
+        /**
+         * Adds a property to an item.
+         *
+         * @method add
+         * @param name {String} The name of the item.
+         * @param key {String} The name of the property.
+         * @param val {Any} The value of the property.
+         */
+        add: function(name, key, val) {
+            var item = this.data[name];
+
+            if (!item) {
+                item = this.data[name] = {};
+            }
+
+            item[key] = val;
+        },
+
+        /**
+         * Adds multiple properties to an item.
+         *
+         * @method addAll
+         * @param name {String} The name of the item.
+         * @param obj {Object} A hash of property/value pairs.
+         */
+        addAll: function(name, obj) {
+            var item = this.data[name],
+                key;
+
+            if (!item) {
+                item = this.data[name] = {};
+            }
+
+            for (key in obj) {
+                if (obj.hasOwnProperty(key)) {
+                    item[key] = obj[key];
+                }
+            }
+        },
+
+        /**
+         * Removes a property from an item.
+         *
+         * @method remove
+         * @param name {String} The name of the item.
+         * @param key {String} The property to remove.
+         */
+        remove: function(name, key) {
+            var item = this.data[name];
+
+            if (item) {
+                delete item[key];
+            }
+        },
+
+        /**
+         * Removes multiple properties from an item, or removes the item completely.
+         *
+         * @method removeAll
+         * @param name {String} The name of the item.
+         * @param obj {Object|Array} Collection of properties to delete. If not provided, the entire item is removed.
+         */
+        removeAll: function(name, obj) {
+            var data;
+
+            if (!obj) {
+                data = this.data;
+
+                if (name in data) {
+                    delete data[name];
+                }
+            } else {
+                Y.each(obj, function(value, key) {
+                    this.remove(name, typeof key === 'string' ? key : value);
+                }, this);
+            }
+        },
+
+        /**
+         * For a given item, returns the value of the property requested, or undefined if not found.
+         *
+         * @method get
+         * @param name {String} The name of the item
+         * @param key {String} Optional. The property value to retrieve.
+         * @return {Any} The value of the supplied property.
+         */
+        get: function(name, key) {
+            var item = this.data[name];
+
+            if (item) {
+                return item[key];
+            }
+        },
+
+        /**
+         * For the given item, returns an object with all of the
+         * item's property/value pairs. By default the object returned
+         * is a shallow copy of the stored data, but passing in true
+         * as the second parameter will return a reference to the stored
+         * data.
+         *
+         * @method getAll
+         * @param name {String} The name of the item
+         * @param reference {boolean} true, if you want a reference to the stored
+         * object
+         * @return {Object} An object with property/value pairs for the item.
+         */
+        getAll : function(name, reference) {
+            var item = this.data[name],
+                key, obj;
+
+            if (reference) {
+                obj = item;
+            } else if (item) {
+                obj = {};
+
+                for (key in item) {
+                    if (item.hasOwnProperty(key)) {
+                        obj[key] = item[key];
+                    }
+                }
+            }
+
+            return obj;
+        }
+    };
+    /*For log lines*/
+    /*jshint maxlen:200*/
+
+    /**
+     * The attribute module provides an augmentable Attribute implementation, which
+     * adds configurable attributes and attribute change events to the class being
+     * augmented. It also provides a State class, which is used internally by Attribute,
+     * but can also be used independently to provide a name/property/value data structure to
+     * store state.
+     *
+     * @module attribute
+     */
+
+    /**
+     * The attribute-core submodule provides the lightest level of attribute handling support
+     * without Attribute change events, or lesser used methods such as reset(), modifyAttrs(),
+     * and removeAttr().
+     *
+     * @module attribute
+     * @submodule attribute-core
+     */
+    var O = Y.Object,
+        Lang = Y.Lang,
+
+        DOT = ".",
+
+        // Externally configurable props
+        GETTER = "getter",
+        SETTER = "setter",
+        READ_ONLY = "readOnly",
+        WRITE_ONCE = "writeOnce",
+        INIT_ONLY = "initOnly",
+        VALIDATOR = "validator",
+        VALUE = "value",
+        VALUE_FN = "valueFn",
+        LAZY_ADD = "lazyAdd",
+
+        // Used for internal state management
+        ADDED = "added",
+        BYPASS_PROXY = "_bypassProxy",
+        INIT_VALUE = "initValue",
+        LAZY = "lazy",
+
+        INVALID_VALUE;
+
+    /**
+     * <p>
+     * AttributeCore provides the lightest level of configurable attribute support. It is designed to be
+     * augmented on to a host class, and provides the host with the ability to configure
+     * attributes to store and retrieve state, <strong>but without support for attribute change events</strong>.
+     * </p>
+     * <p>For example, attributes added to the host can be configured:</p>
+     * <ul>
+     *     <li>As read only.</li>
+     *     <li>As write once.</li>
+     *     <li>With a setter function, which can be used to manipulate
+     *     values passed to Attribute's <a href="#method_set">set</a> method, before they are stored.</li>
+     *     <li>With a getter function, which can be used to manipulate stored values,
+     *     before they are returned by Attribute's <a href="#method_get">get</a> method.</li>
+     *     <li>With a validator function, to validate values before they are stored.</li>
+     * </ul>
+     *
+     * <p>See the <a href="#method_addAttr">addAttr</a> method, for the complete set of configuration
+     * options available for attributes.</p>
+     *
+     * <p>Object/Classes based on AttributeCore can augment <a href="AttributeObservable.html">AttributeObservable</a>
+     * (with true for overwrite) and <a href="AttributeExtras.html">AttributeExtras</a> to add attribute event and
+     * additional, less commonly used attribute methods, such as `modifyAttr`, `removeAttr` and `reset`.</p>
+     *
+     * @class AttributeCore
+     * @param attrs {Object} The attributes to add during construction (passed through to <a href="#method_addAttrs">addAttrs</a>).
+     *        These can also be defined on the constructor being augmented with Attribute by defining the ATTRS property on the constructor.
+     * @param values {Object} The initial attribute values to apply (passed through to <a href="#method_addAttrs">addAttrs</a>).
+     *        These are not merged/cloned. The caller is responsible for isolating user provided values if required.
+     * @param lazy {boolean} Whether or not to add attributes lazily (passed through to <a href="#method_addAttrs">addAttrs</a>).
+     */
+    function AttributeCore(attrs, values, lazy) {
+        // HACK: Fix #2531929
+        // Complete hack, to make sure the first clone of a node value in IE doesn't doesn't hurt state - maintains 3.4.1 behavior.
+        // Too late in the release cycle to do anything about the core problem.
+        // The root issue is that cloning a Y.Node instance results in an object which barfs in IE, when you access it's properties (since 3.3.0).
+        this._yuievt = null;
+
+        this._initAttrHost(attrs, values, lazy);
+    }
+
+    /**
+     * <p>The value to return from an attribute setter in order to prevent the set from going through.</p>
+     *
+     * <p>You can return this value from your setter if you wish to combine validator and setter
+     * functionality into a single setter function, which either returns the massaged value to be stored or
+     * AttributeCore.INVALID_VALUE to prevent invalid values from being stored.</p>
+     *
+     * @property INVALID_VALUE
+     * @type Object
+     * @static
+     * @final
+     */
+    AttributeCore.INVALID_VALUE = {};
+    INVALID_VALUE = AttributeCore.INVALID_VALUE;
+
+    /**
+     * The list of properties which can be configured for
+     * each attribute (e.g. setter, getter, writeOnce etc.).
+     *
+     * This property is used internally as a whitelist for faster
+     * Y.mix operations.
+     *
+     * @property _ATTR_CFG
+     * @type Array
+     * @static
+     * @protected
+     */
+    AttributeCore._ATTR_CFG = [SETTER, GETTER, VALIDATOR, VALUE, VALUE_FN, WRITE_ONCE, READ_ONLY, LAZY_ADD, BYPASS_PROXY];
+
+    /**
+     * Utility method to protect an attribute configuration hash, by merging the
+     * entire object and the individual attr config objects.
+     *
+     * @method protectAttrs
+     * @static
+     * @param {Object} attrs A hash of attribute to configuration object pairs.
+     * @return {Object} A protected version of the `attrs` argument.
+     */
+    AttributeCore.protectAttrs = function (attrs) {
+        if (attrs) {
+            attrs = Y.merge(attrs);
+            for (var attr in attrs) {
+                if (attrs.hasOwnProperty(attr)) {
+                    attrs[attr] = Y.merge(attrs[attr]);
+                }
+            }
+        }
+
+        return attrs;
+    };
+
+    AttributeCore.prototype = {
+
+        /**
+         * Constructor logic for attributes. Initializes the host state, and sets up the inital attributes passed to the
+         * constructor.
+         *
+         * @method _initAttrHost
+         * @param attrs {Object} The attributes to add during construction (passed through to <a href="#method_addAttrs">addAttrs</a>).
+         *        These can also be defined on the constructor being augmented with Attribute by defining the ATTRS property on the constructor.
+         * @param values {Object} The initial attribute values to apply (passed through to <a href="#method_addAttrs">addAttrs</a>).
+         *        These are not merged/cloned. The caller is responsible for isolating user provided values if required.
+         * @param lazy {boolean} Whether or not to add attributes lazily (passed through to <a href="#method_addAttrs">addAttrs</a>).
+         * @private
+         */
+        _initAttrHost : function(attrs, values, lazy) {
+            this._state = new Y.State();
+            this._initAttrs(attrs, values, lazy);
+        },
+
+        /**
+         * <p>
+         * Adds an attribute with the provided configuration to the host object.
+         * </p>
+         * <p>
+         * The config argument object supports the following properties:
+         * </p>
+         *
+         * <dl>
+         *    <dt>value &#60;Any&#62;</dt>
+         *    <dd>The initial value to set on the attribute</dd>
+         *
+         *    <dt>valueFn &#60;Function | String&#62;</dt>
+         *    <dd>
+         *    <p>A function, which will return the initial value to set on the attribute. This is useful
+         *    for cases where the attribute configuration is defined statically, but needs to
+         *    reference the host instance ("this") to obtain an initial value. If both the value and valueFn properties are defined,
+         *    the value returned by the valueFn has precedence over the value property, unless it returns undefined, in which
+         *    case the value property is used.</p>
+         *
+         *    <p>valueFn can also be set to a string, representing the name of the instance method to be used to retrieve the value.</p>
+         *    </dd>
+         *
+         *    <dt>readOnly &#60;boolean&#62;</dt>
+         *    <dd>Whether or not the attribute is read only. Attributes having readOnly set to true
+         *        cannot be modified by invoking the set method.</dd>
+         *
+         *    <dt>writeOnce &#60;boolean&#62; or &#60;string&#62;</dt>
+         *    <dd>
+         *        Whether or not the attribute is "write once". Attributes having writeOnce set to true,
+         *        can only have their values set once, be it through the default configuration,
+         *        constructor configuration arguments, or by invoking set.
+         *        <p>The writeOnce attribute can also be set to the string "initOnly",
+         *         in which case the attribute can only be set during initialization
+         *        (when used with Base, this means it can only be set during construction)</p>
+         *    </dd>
+         *
+         *    <dt>setter &#60;Function | String&#62;</dt>
+         *    <dd>
+         *    <p>The setter function used to massage or normalize the value passed to the set method for the attribute.
+         *    The value returned by the setter will be the final stored value. Returning
+         *    <a href="#property_Attribute.INVALID_VALUE">Attribute.INVALID_VALUE</a>, from the setter will prevent
+         *    the value from being stored.
+         *    </p>
+         *
+         *    <p>setter can also be set to a string, representing the name of the instance method to be used as the setter function.</p>
+         *    </dd>
+         *
+         *    <dt>getter &#60;Function | String&#62;</dt>
+         *    <dd>
+         *    <p>
+         *    The getter function used to massage or normalize the value returned by the get method for the attribute.
+         *    The value returned by the getter function is the value which will be returned to the user when they
+         *    invoke get.
+         *    </p>
+         *
+         *    <p>getter can also be set to a string, representing the name of the instance method to be used as the getter function.</p>
+         *    </dd>
+         *
+         *    <dt>validator &#60;Function | String&#62;</dt>
+         *    <dd>
+         *    <p>
+         *    The validator function invoked prior to setting the stored value. Returning
+         *    false from the validator function will prevent the value from being stored.
+         *    </p>
+         *
+         *    <p>validator can also be set to a string, representing the name of the instance method to be used as the validator function.</p>
+         *    </dd>
+         *
+         *    <dt>lazyAdd &#60;boolean&#62;</dt>
+         *    <dd>Whether or not to delay initialization of the attribute until the first call to get/set it.
+         *    This flag can be used to over-ride lazy initialization on a per attribute basis, when adding multiple attributes through
+         *    the <a href="#method_addAttrs">addAttrs</a> method.</dd>
+         *
+         * </dl>
+         *
+         * <p>The setter, getter and validator are invoked with the value and name passed in as the first and second arguments, and with
+         * the context ("this") set to the host object.</p>
+         *
+         * <p>Configuration properties outside of the list mentioned above are considered private properties used internally by attribute,
+         * and are not intended for public use.</p>
+         *
+         * @method addAttr
+         *
+         * @param {String} name The name of the attribute.
+         * @param {Object} config An object with attribute configuration property/value pairs, specifying the configuration for the attribute.
+         *
+         * <p>
+         * <strong>NOTE:</strong> The configuration object is modified when adding an attribute, so if you need
+         * to protect the original values, you will need to merge the object.
+         * </p>
+         *
+         * @param {boolean} lazy (optional) Whether or not to add this attribute lazily (on the first call to get/set).
+         *
+         * @return {Object} A reference to the host object.
+         *
+         * @chainable
+         */
+        addAttr : function(name, config, lazy) {
+
+
+            var host = this, // help compression
+                state = host._state,
+                data = state.data,
+                value,
+                added,
+                hasValue;
+
+            config = config || {};
+
+            if (LAZY_ADD in config) {
+                lazy = config[LAZY_ADD];
+            }
+
+            added = state.get(name, ADDED);
+
+            if (lazy && !added) {
+                state.data[name] = {
+                    lazy : config,
+                    added : true
+                };
+            } else {
+
+
+                if (!added || config.isLazyAdd) {
+
+                    hasValue = (VALUE in config);
+
+
+                    if (hasValue) {
+
+                        // We'll go through set, don't want to set value in config directly
+
+                        // PERF TODO: VALIDATE: See if setting this to undefined is sufficient. We use to delete before.
+                        // In certain code paths/use cases, undefined may not be the same as not present.
+                        // If not, we can set it to some known fixed value (like INVALID_VALUE, say INITIALIZING_VALUE) for performance,
+                        // to avoid a delete which seems to help a lot.
+
+                        value = config.value;
+                        config.value = undefined;
+                    }
+
+                    config.added = true;
+                    config.initializing = true;
+
+                    data[name] = config;
+
+                    if (hasValue) {
+                        // Go through set, so that raw values get normalized/validated
+                        host.set(name, value);
+                    }
+
+                    config.initializing = false;
+                }
+            }
+
+            return host;
+        },
+
+        /**
+         * Checks if the given attribute has been added to the host
+         *
+         * @method attrAdded
+         * @param {String} name The name of the attribute to check.
+         * @return {boolean} true if an attribute with the given name has been added, false if it hasn't.
+         *         This method will return true for lazily added attributes.
+         */
+        attrAdded: function(name) {
+            return !!(this._state.get(name, ADDED));
+        },
+
+        /**
+         * Returns the current value of the attribute. If the attribute
+         * has been configured with a 'getter' function, this method will delegate
+         * to the 'getter' to obtain the value of the attribute.
+         *
+         * @method get
+         *
+         * @param {String} name The name of the attribute. If the value of the attribute is an Object,
+         * dot notation can be used to obtain the value of a property of the object (e.g. <code>get("x.y.z")</code>)
+         *
+         * @return {Any} The value of the attribute
+         */
+        get : function(name) {
+            return this._getAttr(name);
+        },
+
+        /**
+         * Checks whether or not the attribute is one which has been
+         * added lazily and still requires initialization.
+         *
+         * @method _isLazyAttr
+         * @private
+         * @param {String} name The name of the attribute
+         * @return {boolean} true if it's a lazily added attribute, false otherwise.
+         */
+        _isLazyAttr: function(name) {
+            return this._state.get(name, LAZY);
+        },
+
+        /**
+         * Finishes initializing an attribute which has been lazily added.
+         *
+         * @method _addLazyAttr
+         * @private
+         * @param {Object} name The name of the attribute
+         * @param {Object} [lazyCfg] Optional config hash for the attribute. This is added for performance
+         * along the critical path, where the calling method has already obtained lazy config from state.
+         */
+        _addLazyAttr: function(name, lazyCfg) {
+            var state = this._state;
+
+            lazyCfg = lazyCfg || state.get(name, LAZY);
+
+            if (lazyCfg) {
+
+                // PERF TODO: For App's id override, otherwise wouldn't be
+                // needed. It expects to find it in the cfg for it's
+                // addAttr override. Would like to remove, once App override is
+                // removed.
+                state.data[name].lazy = undefined;
+
+                lazyCfg.isLazyAdd = true;
+
+                this.addAttr(name, lazyCfg);
+            }
+        },
+
+        /**
+         * Sets the value of an attribute.
+         *
+         * @method set
+         * @chainable
+         *
+         * @param {String} name The name of the attribute. If the
+         * current value of the attribute is an Object, dot notation can be used
+         * to set the value of a property within the object (e.g. <code>set("x.y.z", 5)</code>).
+         * @param {Any} value The value to set the attribute to.
+         * @param {Object} [opts] Optional data providing the circumstances for the change.
+         * @return {Object} A reference to the host object.
+         */
+        set : function(name, val, opts) {
+            return this._setAttr(name, val, opts);
+        },
+
+        /**
+         * Allows setting of readOnly/writeOnce attributes. See <a href="#method_set">set</a> for argument details.
+         *
+         * @method _set
+         * @protected
+         * @chainable
+         *
+         * @param {String} name The name of the attribute.
+         * @param {Any} val The value to set the attribute to.
+         * @param {Object} [opts] Optional data providing the circumstances for the change.
+         * @return {Object} A reference to the host object.
+         */
+        _set : function(name, val, opts) {
+            return this._setAttr(name, val, opts, true);
+        },
+
+        /**
+         * Provides the common implementation for the public set and protected _set methods.
+         *
+         * See <a href="#method_set">set</a> for argument details.
+         *
+         * @method _setAttr
+         * @protected
+         * @chainable
+         *
+         * @param {String} name The name of the attribute.
+         * @param {Any} value The value to set the attribute to.
+         * @param {Object} [opts] Optional data providing the circumstances for the change.
+         * @param {boolean} force If true, allows the caller to set values for
+         * readOnly or writeOnce attributes which have already been set.
+         *
+         * @return {Object} A reference to the host object.
+         */
+        _setAttr : function(name, val, opts, force)  {
+            var allowSet = true,
+                state = this._state,
+                stateProxy = this._stateProxy,
+                tCfgs = this._tCfgs,
+                cfg,
+                initialSet,
+                strPath,
+                path,
+                currVal,
+                writeOnce,
+                initializing;
+
+            if (name.indexOf(DOT) !== -1) {
+                strPath = name;
+
+                path = name.split(DOT);
+                name = path.shift();
+            }
+
+            // On Demand - Should be rare - handles out of order valueFn, setter, getter references
+            if (tCfgs && tCfgs[name]) {
+                this._addOutOfOrder(name, tCfgs[name]);
+            }
+
+            cfg = state.data[name] || {};
+
+            if (cfg.lazy) {
+                cfg = cfg.lazy;
+                this._addLazyAttr(name, cfg);
+            }
+
+            initialSet = (cfg.value === undefined);
+
+            if (stateProxy && name in stateProxy && !cfg._bypassProxy) {
+                // TODO: Value is always set for proxy. Can we do any better? Maybe take a snapshot as the initial value for the first call to set?
+                initialSet = false;
+            }
+
+            writeOnce = cfg.writeOnce;
+            initializing = cfg.initializing;
+
+            if (!initialSet && !force) {
+
+                if (writeOnce) {
+                    allowSet = false;
+                }
+
+                if (cfg.readOnly) {
+                    allowSet = false;
+                }
+            }
+
+            if (!initializing && !force && writeOnce === INIT_ONLY) {
+                allowSet = false;
+            }
+
+            if (allowSet) {
+                // Don't need currVal if initialSet (might fail in custom getter if it always expects a non-undefined/non-null value)
+                if (!initialSet) {
+                    currVal =  this.get(name);
+                }
+
+                if (path) {
+                   val = O.setValue(Y.clone(currVal), path, val);
+
+                   if (val === undefined) {
+                       allowSet = false;
+                   }
+                }
+
+                if (allowSet) {
+                    if (!this._fireAttrChange || initializing) {
+                        this._setAttrVal(name, strPath, currVal, val, opts, cfg);
+                    } else {
+                        // HACK - no real reason core needs to know about _fireAttrChange, but
+                        // it adds fn hops if we want to break it out. Not sure it's worth it for this critical path
+                        this._fireAttrChange(name, strPath, currVal, val, opts, cfg);
+                    }
+                }
+            }
+
+            return this;
+        },
+
+        /**
+         * Utility method used by get/set to add attributes
+         * encountered out of order when calling addAttrs().
+         *
+         * For example, if:
+         *
+         *     this.addAttrs({
+         *          foo: {
+         *              setter: function() {
+         *                 // make sure this bar is available when foo is added
+         *                 this.get("bar");
+         *              }
+         *          },
+         *          bar: {
+         *              value: ...
+         *          }
+         *     });
+         *
+         * @method _addOutOfOrder
+         * @private
+         * @param name {String} attribute name
+         * @param cfg {Object} attribute configuration
+         */
+        _addOutOfOrder : function(name, cfg) {
+
+            var attrs = {};
+            attrs[name] = cfg;
+
+            delete this._tCfgs[name];
+
+            // TODO: The original code went through addAttrs, so
+            // sticking with it for this pass. Seems like we could
+            // just jump straight to _addAttr() and get some perf
+            // improvement.
+            this._addAttrs(attrs, this._tVals);
+        },
+
+        /**
+         * Provides the common implementation for the public get method,
+         * allowing Attribute hosts to over-ride either method.
+         *
+         * See <a href="#method_get">get</a> for argument details.
+         *
+         * @method _getAttr
+         * @protected
+         * @chainable
+         *
+         * @param {String} name The name of the attribute.
+         * @return {Any} The value of the attribute.
+         */
+        _getAttr : function(name) {
+            var fullName = name,
+                tCfgs = this._tCfgs,
+                path,
+                getter,
+                val,
+                attrCfg;
+
+            if (name.indexOf(DOT) !== -1) {
+                path = name.split(DOT);
+                name = path.shift();
+            }
+
+            // On Demand - Should be rare - handles out of
+            // order valueFn, setter, getter references
+            if (tCfgs && tCfgs[name]) {
+                this._addOutOfOrder(name, tCfgs[name]);
+            }
+
+            attrCfg = this._state.data[name] || {};
+
+            // Lazy Init
+            if (attrCfg.lazy) {
+                attrCfg = attrCfg.lazy;
+                this._addLazyAttr(name, attrCfg);
+            }
+
+            val = this._getStateVal(name, attrCfg);
+
+            getter = attrCfg.getter;
+
+            if (getter && !getter.call) {
+                getter = this[getter];
+            }
+
+            val = (getter) ? getter.call(this, val, fullName) : val;
+            val = (path) ? O.getValue(val, path) : val;
+
+            return val;
+        },
+
+        /**
+         * Gets the stored value for the attribute, from either the
+         * internal state object, or the state proxy if it exits
+         *
+         * @method _getStateVal
+         * @private
+         * @param {String} name The name of the attribute
+         * @param {Object} [cfg] Optional config hash for the attribute. This is added for performance along the critical path,
+         * where the calling method has already obtained the config from state.
+         *
+         * @return {Any} The stored value of the attribute
+         */
+        _getStateVal : function(name, cfg) {
+            var stateProxy = this._stateProxy;
+
+            if (!cfg) {
+                cfg = this._state.getAll(name) || {};
+            }
+
+            return (stateProxy && (name in stateProxy) && !(cfg._bypassProxy)) ? stateProxy[name] : cfg.value;
+        },
+
+        /**
+         * Sets the stored value for the attribute, in either the
+         * internal state object, or the state proxy if it exits
+         *
+         * @method _setStateVal
+         * @private
+         * @param {String} name The name of the attribute
+         * @param {Any} value The value of the attribute
+         */
+        _setStateVal : function(name, value) {
+            var stateProxy = this._stateProxy;
+            if (stateProxy && (name in stateProxy) && !this._state.get(name, BYPASS_PROXY)) {
+                stateProxy[name] = value;
+            } else {
+                this._state.add(name, VALUE, value);
+            }
+        },
+
+        /**
+         * Updates the stored value of the attribute in the privately held State object,
+         * if validation and setter passes.
+         *
+         * @method _setAttrVal
+         * @private
+         * @param {String} attrName The attribute name.
+         * @param {String} subAttrName The sub-attribute name, if setting a sub-attribute property ("x.y.z").
+         * @param {Any} prevVal The currently stored value of the attribute.
+         * @param {Any} newVal The value which is going to be stored.
+         * @param {Object} [opts] Optional data providing the circumstances for the change.
+         * @param {Object} [attrCfg] Optional config hash for the attribute. This is added for performance along the critical path,
+         * where the calling method has already obtained the config from state.
+         *
+         * @return {Boolean} true if the new attribute value was stored, false if not.
+         */
+        _setAttrVal : function(attrName, subAttrName, prevVal, newVal, opts, attrCfg) {
+
+            var host = this,
+                allowSet = true,
+                cfg = attrCfg || this._state.data[attrName] || {},
+                validator = cfg.validator,
+                setter = cfg.setter,
+                initializing = cfg.initializing,
+                prevRawVal = this._getStateVal(attrName, cfg),
+                name = subAttrName || attrName,
+                retVal,
+                valid;
+
+            if (validator) {
+                if (!validator.call) {
+                    // Assume string - trying to keep critical path tight, so avoiding Lang check
+                    validator = this[validator];
+                }
+                if (validator) {
+                    valid = validator.call(host, newVal, name, opts);
+
+                    if (!valid && initializing) {
+                        newVal = cfg.defaultValue;
+                        valid = true; // Assume it's valid, for perf.
+                    }
+                }
+            }
+
+            if (!validator || valid) {
+                if (setter) {
+                    if (!setter.call) {
+                        // Assume string - trying to keep critical path tight, so avoiding Lang check
+                        setter = this[setter];
+                    }
+                    if (setter) {
+                        retVal = setter.call(host, newVal, name, opts);
+
+                        if (retVal === INVALID_VALUE) {
+                            if (initializing) {
+                                newVal = cfg.defaultValue;
+                            } else {
+                                allowSet = false;
+                            }
+                        } else if (retVal !== undefined){
+                            newVal = retVal;
+                        }
+                    }
+                }
+
+                if (allowSet) {
+                    if(!subAttrName && (newVal === prevRawVal) && !Lang.isObject(newVal)) {
+                        allowSet = false;
+                    } else {
+                        // Store value
+                        if (!(INIT_VALUE in cfg)) {
+                            cfg.initValue = newVal;
+                        }
+                        host._setStateVal(attrName, newVal);
+                    }
+                }
+
+            } else {
+                allowSet = false;
+            }
+
+            return allowSet;
+        },
+
+        /**
+         * Sets multiple attribute values.
+         *
+         * @method setAttrs
+         * @param {Object} attrs  An object with attributes name/value pairs.
+         * @param {Object} [opts] Optional data providing the circumstances for the change.
+         * @return {Object} A reference to the host object.
+         * @chainable
+         */
+        setAttrs : function(attrs, opts) {
+            return this._setAttrs(attrs, opts);
+        },
+
+        /**
+         * Implementation behind the public setAttrs method, to set multiple attribute values.
+         *
+         * @method _setAttrs
+         * @protected
+         * @param {Object} attrs  An object with attributes name/value pairs.
+         * @param {Object} [opts] Optional data providing the circumstances for the change
+         * @return {Object} A reference to the host object.
+         * @chainable
+         */
+        _setAttrs : function(attrs, opts) {
+            var attr;
+            for (attr in attrs) {
+                if ( attrs.hasOwnProperty(attr) ) {
+                    this.set(attr, attrs[attr], opts);
+                }
+            }
+            return this;
+        },
+
+        /**
+         * Gets multiple attribute values.
+         *
+         * @method getAttrs
+         * @param {String[]|Boolean} attrs Optional. An array of attribute names. If omitted, all attribute values are
+         * returned. If set to true, all attributes modified from their initial values are returned.
+         * @return {Object} An object with attribute name/value pairs.
+         */
+        getAttrs : function(attrs) {
+            return this._getAttrs(attrs);
+        },
+
+        /**
+         * Implementation behind the public getAttrs method, to get multiple attribute values.
+         *
+         * @method _getAttrs
+         * @protected
+         * @param {String[]|Boolean} attrs Optional. An array of attribute names. If omitted, all attribute values are
+         * returned. If set to true, all attributes modified from their initial values are returned.
+         * @return {Object} An object with attribute name/value pairs.
+         */
+        _getAttrs : function(attrs) {
+            var obj = {},
+                attr, i, len,
+                modifiedOnly = (attrs === true);
+
+            // TODO - figure out how to get all "added"
+            if (!attrs || modifiedOnly) {
+                attrs = O.keys(this._state.data);
+            }
+
+            for (i = 0, len = attrs.length; i < len; i++) {
+                attr = attrs[i];
+
+                if (!modifiedOnly || this._getStateVal(attr) != this._state.get(attr, INIT_VALUE)) {
+                    // Go through get, to honor cloning/normalization
+                    obj[attr] = this.get(attr);
+                }
+            }
+
+            return obj;
+        },
+
+        /**
+         * Configures a group of attributes, and sets initial values.
+         *
+         * <p>
+         * <strong>NOTE:</strong> This method does not isolate the configuration object by merging/cloning.
+         * The caller is responsible for merging/cloning the configuration object if required.
+         * </p>
+         *
+         * @method addAttrs
+         * @chainable
+         *
+         * @param {Object} cfgs An object with attribute name/configuration pairs.
+         * @param {Object} values An object with attribute name/value pairs, defining the initial values to apply.
+         * Values defined in the cfgs argument will be over-written by values in this argument unless defined as read only.
+         * @param {boolean} lazy Whether or not to delay the intialization of these attributes until the first call to get/set.
+         * Individual attributes can over-ride this behavior by defining a lazyAdd configuration property in their configuration.
+         * See <a href="#method_addAttr">addAttr</a>.
+         *
+         * @return {Object} A reference to the host object.
+         */
+        addAttrs : function(cfgs, values, lazy) {
+            if (cfgs) {
+                this._tCfgs = cfgs;
+                this._tVals = (values) ? this._normAttrVals(values) : null;
+                this._addAttrs(cfgs, this._tVals, lazy);
+                this._tCfgs = this._tVals = null;
+            }
+
+            return this;
+        },
+
+        /**
+         * Implementation behind the public addAttrs method.
+         *
+         * This method is invoked directly by get if it encounters a scenario
+         * in which an attribute's valueFn attempts to obtain the
+         * value an attribute in the same group of attributes, which has not yet
+         * been added (on demand initialization).
+         *
+         * @method _addAttrs
+         * @private
+         * @param {Object} cfgs An object with attribute name/configuration pairs.
+         * @param {Object} values An object with attribute name/value pairs, defining the initial values to apply.
+         * Values defined in the cfgs argument will be over-written by values in this argument unless defined as read only.
+         * @param {boolean} lazy Whether or not to delay the intialization of these attributes until the first call to get/set.
+         * Individual attributes can over-ride this behavior by defining a lazyAdd configuration property in their configuration.
+         * See <a href="#method_addAttr">addAttr</a>.
+         */
+        _addAttrs : function(cfgs, values, lazy) {
+            var tCfgs = this._tCfgs,
+                tVals = this._tVals,
+                attr,
+                attrCfg,
+                value;
+
+            for (attr in cfgs) {
+                if (cfgs.hasOwnProperty(attr)) {
+
+                    // Not Merging. Caller is responsible for isolating configs
+                    attrCfg = cfgs[attr];
+                    attrCfg.defaultValue = attrCfg.value;
+
+                    // Handle simple, complex and user values, accounting for read-only
+                    value = this._getAttrInitVal(attr, attrCfg, tVals);
+
+                    if (value !== undefined) {
+                        attrCfg.value = value;
+                    }
+
+                    if (tCfgs[attr]) {
+                        tCfgs[attr] = undefined;
+                    }
+
+                    this.addAttr(attr, attrCfg, lazy);
+                }
+            }
+        },
+
+        /**
+         * Utility method to protect an attribute configuration
+         * hash, by merging the entire object and the individual
+         * attr config objects.
+         *
+         * @method _protectAttrs
+         * @protected
+         * @param {Object} attrs A hash of attribute to configuration object pairs.
+         * @return {Object} A protected version of the attrs argument.
+         * @deprecated Use `AttributeCore.protectAttrs()` or
+         *   `Attribute.protectAttrs()` which are the same static utility method.
+         */
+        _protectAttrs : AttributeCore.protectAttrs,
+
+        /**
+         * Utility method to normalize attribute values. The base implementation
+         * simply merges the hash to protect the original.
+         *
+         * @method _normAttrVals
+         * @param {Object} valueHash An object with attribute name/value pairs
+         *
+         * @return {Object} An object literal with 2 properties - "simple" and "complex",
+         * containing simple and complex attribute values respectively keyed
+         * by the top level attribute name, or null, if valueHash is falsey.
+         *
+         * @private
+         */
+        _normAttrVals : function(valueHash) {
+            var vals,
+                subvals,
+                path,
+                attr,
+                v, k;
+
+            if (!valueHash) {
+                return null;
+            }
+
+            vals = {};
+
+            for (k in valueHash) {
+                if (valueHash.hasOwnProperty(k)) {
+                    if (k.indexOf(DOT) !== -1) {
+                        path = k.split(DOT);
+                        attr = path.shift();
+
+                        subvals = subvals || {};
+
+                        v = subvals[attr] = subvals[attr] || [];
+                        v[v.length] = {
+                            path : path,
+                            value: valueHash[k]
+                        };
+                    } else {
+                        vals[k] = valueHash[k];
+                    }
+                }
+            }
+
+            return { simple:vals, complex:subvals };
+        },
+
+        /**
+         * Returns the initial value of the given attribute from
+         * either the default configuration provided, or the
+         * over-ridden value if it exists in the set of initValues
+         * provided and the attribute is not read-only.
+         *
+         * @param {String} attr The name of the attribute
+         * @param {Object} cfg The attribute configuration object
+         * @param {Object} initValues The object with simple and complex attribute name/value pairs returned from _normAttrVals
+         *
+         * @return {Any} The initial value of the attribute.
+         *
+         * @method _getAttrInitVal
+         * @private
+         */
+        _getAttrInitVal : function(attr, cfg, initValues) {
+            var val = cfg.value,
+                valFn = cfg.valueFn,
+                tmpVal,
+                initValSet = false,
+                readOnly = cfg.readOnly,
+                simple,
+                complex,
+                i,
+                l,
+                path,
+                subval,
+                subvals;
+
+            if (!readOnly && initValues) {
+                // Simple Attributes
+                simple = initValues.simple;
+                if (simple && simple.hasOwnProperty(attr)) {
+                    val = simple[attr];
+                    initValSet = true;
+                }
+            }
+
+            if (valFn && !initValSet) {
+                if (!valFn.call) {
+                    valFn = this[valFn];
+                }
+                if (valFn) {
+                    tmpVal = valFn.call(this, attr);
+                    val = tmpVal;
+                }
+            }
+
+            if (!readOnly && initValues) {
+
+                // Complex Attributes (complex values applied, after simple, in case both are set)
+                complex = initValues.complex;
+
+                if (complex && complex.hasOwnProperty(attr) && (val !== undefined) && (val !== null)) {
+                    subvals = complex[attr];
+                    for (i = 0, l = subvals.length; i < l; ++i) {
+                        path = subvals[i].path;
+                        subval = subvals[i].value;
+                        O.setValue(val, path, subval);
+                    }
+                }
+            }
+
+            return val;
+        },
+
+        /**
+         * Utility method to set up initial attributes defined during construction,
+         * either through the constructor.ATTRS property, or explicitly passed in.
+         *
+         * @method _initAttrs
+         * @protected
+         * @param attrs {Object} The attributes to add during construction (passed through to <a href="#method_addAttrs">addAttrs</a>).
+         *        These can also be defined on the constructor being augmented with Attribute by defining the ATTRS property on the constructor.
+         * @param values {Object} The initial attribute values to apply (passed through to <a href="#method_addAttrs">addAttrs</a>).
+         *        These are not merged/cloned. The caller is responsible for isolating user provided values if required.
+         * @param lazy {boolean} Whether or not to add attributes lazily (passed through to <a href="#method_addAttrs">addAttrs</a>).
+         */
+        _initAttrs : function(attrs, values, lazy) {
+            // ATTRS support for Node, which is not Base based
+            attrs = attrs || this.constructor.ATTRS;
+
+            var Base = Y.Base,
+                BaseCore = Y.BaseCore,
+                baseInst = (Base && Y.instanceOf(this, Base)),
+                baseCoreInst = (!baseInst && BaseCore && Y.instanceOf(this, BaseCore));
+
+            if (attrs && !baseInst && !baseCoreInst) {
+                this.addAttrs(Y.AttributeCore.protectAttrs(attrs), values, lazy);
+            }
+        }
+    };
+
+    Y.AttributeCore = AttributeCore;
+
+
+}, '3.17.2', {"requires": ["oop"]});

Added: roller/trunk/app/src/main/webapp/roller-ui/yui3/attribute-extras/attribute-extras-min.js
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/webapp/roller-ui/yui3/attribute-extras/attribute-extras-min.js?rev=1609737&view=auto
==============================================================================
--- roller/trunk/app/src/main/webapp/roller-ui/yui3/attribute-extras/attribute-extras-min.js (added)
+++ roller/trunk/app/src/main/webapp/roller-ui/yui3/attribute-extras/attribute-extras-min.js Fri Jul 11 16:23:25 2014
@@ -0,0 +1,8 @@
+/*
+YUI 3.17.2 (build 9c3c78e)
+Copyright 2014 Yahoo! Inc. All rights reserved.
+Licensed under the BSD License.
+http://yuilibrary.com/license/
+*/
+
+YUI.add("attribute-extras",function(e,t){function o(){}var n="broadcast",r="published",i="initValue",s={readOnly:1,writeOnce:1,getter:1,broadcast:1};o.prototype={modifyAttr:function(e,t){var i=this,o,u;if(i.attrAdded(e)){i._isLazyAttr(e)&&i._addLazyAttr(e),u=i._state;for(o in t)s[o]&&t.hasOwnProperty(o)&&(u.add(e,o,t[o]),o===n&&u.remove(e,r))}},removeAttr:function(e){this._state.removeAll(e)},reset:function(t){var n=this;return t?(n._isLazyAttr(t)&&n._addLazyAttr(t),n.set(t,n._state.get(t,i))):e.Object.each(n._state.data,function(e,t){n.reset(t)}),n},_getAttrCfg:function(t){var n,r=this._state;return t?n=r.getAll(t)||{}:(n={},e.each(r.data,function(e,t){n[t]=r.getAll(t)})),n}},e.AttributeExtras=o},"3.17.2",{requires:["oop"]});

Added: roller/trunk/app/src/main/webapp/roller-ui/yui3/attribute-extras/attribute-extras.js
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/webapp/roller-ui/yui3/attribute-extras/attribute-extras.js?rev=1609737&view=auto
==============================================================================
--- roller/trunk/app/src/main/webapp/roller-ui/yui3/attribute-extras/attribute-extras.js (added)
+++ roller/trunk/app/src/main/webapp/roller-ui/yui3/attribute-extras/attribute-extras.js Fri Jul 11 16:23:25 2014
@@ -0,0 +1,163 @@
+/*
+YUI 3.17.2 (build 9c3c78e)
+Copyright 2014 Yahoo! Inc. All rights reserved.
+Licensed under the BSD License.
+http://yuilibrary.com/license/
+*/
+
+YUI.add('attribute-extras', function (Y, NAME) {
+
+    /**
+     * The attribute module provides an augmentable Attribute implementation, which
+     * adds configurable attributes and attribute change events to the class being
+     * augmented. It also provides a State class, which is used internally by Attribute,
+     * but can also be used independently to provide a name/property/value data structure to
+     * store state.
+     *
+     * @module attribute
+     */
+
+    /**
+     * The attribute-extras submodule provides less commonly used attribute methods, and can
+     * be augmented/mixed into an implemention which used attribute-core.
+     *
+     * @module attribute
+     * @submodule attribute-extras
+     */
+    var BROADCAST = "broadcast",
+        PUBLISHED = "published",
+        INIT_VALUE = "initValue",
+
+        MODIFIABLE = {
+            readOnly:1,
+            writeOnce:1,
+            getter:1,
+            broadcast:1
+        };
+
+    /**
+     * A augmentable implementation for AttributeCore, providing less frequently used
+     * methods for Attribute management such as modifyAttrs(), removeAttr and reset()
+     *
+     * @class AttributeExtras
+     * @extensionfor AttributeCore
+     */
+    function AttributeExtras() {}
+
+    AttributeExtras.prototype = {
+
+        /**
+         * Updates the configuration of an attribute which has already been added.
+         * <p>
+         * The properties which can be modified through this interface are limited
+         * to the following subset of attributes, which can be safely modified
+         * after a value has already been set on the attribute:
+         * </p>
+         * <dl>
+         *  <dt>readOnly;</dt>
+         *  <dt>writeOnce;</dt>
+         *  <dt>broadcast; and</dt>
+         *  <dt>getter.</dt>
+         * </dl>
+         * <p>
+         * Note: New attributes cannot be added using this interface. New attributes must be
+         * added using {{#crossLink "AttributeCore/addAttr:method"}}addAttr{{/crossLink}}, or an
+         * appropriate manner for a class which utilises Attributes (e.g. the
+         * {{#crossLink "Base/ATTRS:property"}}ATTRS{{/crossLink}} property in
+         * {{#crossLink "Base"}}Base{{/crossLink}}).
+         * </p>
+         * @method modifyAttr
+         * @param {String} name The name of the attribute whose configuration is to be updated.
+         * @param {Object} config An object with configuration property/value pairs, specifying the configuration properties to modify.
+         */
+        modifyAttr: function(name, config) {
+            var host = this, // help compression
+                prop, state;
+
+            if (host.attrAdded(name)) {
+
+                if (host._isLazyAttr(name)) {
+                    host._addLazyAttr(name);
+                }
+
+                state = host._state;
+                for (prop in config) {
+                    if (MODIFIABLE[prop] && config.hasOwnProperty(prop)) {
+                        state.add(name, prop, config[prop]);
+
+                        // If we reconfigured broadcast, need to republish
+                        if (prop === BROADCAST) {
+                            state.remove(name, PUBLISHED);
+                        }
+                    }
+                }
+            } else {
+            }
+        },
+
+        /**
+         * Removes an attribute from the host object
+         *
+         * @method removeAttr
+         * @param {String} name The name of the attribute to be removed.
+         */
+        removeAttr: function(name) {
+            this._state.removeAll(name);
+        },
+
+        /**
+         * Resets the attribute (or all attributes) to its initial value, as long as
+         * the attribute is not readOnly, or writeOnce.
+         *
+         * @method reset
+         * @param {String} name Optional. The name of the attribute to reset.  If omitted, all attributes are reset.
+         * @return {Object} A reference to the host object.
+         * @chainable
+         */
+        reset : function(name) {
+            var host = this;  // help compression
+
+            if (name) {
+                if (host._isLazyAttr(name)) {
+                    host._addLazyAttr(name);
+                }
+                host.set(name, host._state.get(name, INIT_VALUE));
+            } else {
+                Y.Object.each(host._state.data, function(v, n) {
+                    host.reset(n);
+                });
+            }
+            return host;
+        },
+
+        /**
+         * Returns an object with the configuration properties (and value)
+         * for the given attribute. If attrName is not provided, returns the
+         * configuration properties for all attributes.
+         *
+         * @method _getAttrCfg
+         * @protected
+         * @param {String} name Optional. The attribute name. If not provided, the method will return the configuration for all attributes.
+         * @return {Object} The configuration properties for the given attribute, or all attributes.
+         */
+        _getAttrCfg : function(name) {
+            var o,
+                state = this._state;
+
+            if (name) {
+                o = state.getAll(name) || {};
+            } else {
+                o = {};
+                Y.each(state.data, function(v, n) {
+                    o[n] = state.getAll(n);
+                });
+            }
+
+            return o;
+        }
+    };
+
+    Y.AttributeExtras = AttributeExtras;
+
+
+}, '3.17.2', {"requires": ["oop"]});

Added: roller/trunk/app/src/main/webapp/roller-ui/yui3/attribute-observable/attribute-observable-min.js
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/webapp/roller-ui/yui3/attribute-observable/attribute-observable-min.js?rev=1609737&view=auto
==============================================================================
--- roller/trunk/app/src/main/webapp/roller-ui/yui3/attribute-observable/attribute-observable-min.js (added)
+++ roller/trunk/app/src/main/webapp/roller-ui/yui3/attribute-observable/attribute-observable-min.js Fri Jul 11 16:23:25 2014
@@ -0,0 +1,8 @@
+/*
+YUI 3.17.2 (build 9c3c78e)
+Copyright 2014 Yahoo! Inc. All rights reserved.
+Licensed under the BSD License.
+http://yuilibrary.com/license/
+*/
+
+YUI.add("attribute-observable",function(e,t){function s(){this._ATTR_E_FACADE={},n.call(this,{emitFacade:!0})}var n=e.EventTarget,r="Change",i="broadcast";s._ATTR_CFG=[i],s.prototype={set:function(e,t,n){return this._setAttr(e,t,n)},_set:function(e,t,n){return this._setAttr(e,t,n,!0)},setAttrs:function(e,t){return this._setAttrs(e,t)},_setAttrs:function(e,t){var n;for(n in e)e.hasOwnProperty(n)&&this.set(n,e[n],t);return this},_fireAttrChange:function(t,n,i,s,o,u){var a=this,f=this._getFullType(t+r),l=a._state,c,h,p;u||(u=l.data[t]||{}),u.published||(p=a._publish(f),p.emitFacade=!0,p.defaultTargetOnly=!0,p.defaultFn=a._defAttrChangeFn,h=u.broadcast,h!==undefined&&(p.broadcast=h),u.published=!0),o?(c=e.merge(o),c._attrOpts=o):c=a._ATTR_E_FACADE,c.attrName=t,c.subAttrName=n,c.prevVal=i,c.newVal=s,a._hasPotentialSubscribers(f)?a.fire(f,c):this._setAttrVal(t,n,i,s,o,u)},_defAttrChangeFn:function(e,t){var n=e._attrOpts;n&&delete e._attrOpts,this._setAttrVal(e.attrName,e.subAttrName,e.pre
 vVal,e.newVal,n)?t||(e.newVal=this.get(e.attrName)):t||e.stopImmediatePropagation()}},e.mix(s,n,!1,null,1),e.AttributeObservable=s,e.AttributeEvents=s},"3.17.2",{requires:["event-custom"]});

Added: roller/trunk/app/src/main/webapp/roller-ui/yui3/attribute-observable/attribute-observable.js
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/webapp/roller-ui/yui3/attribute-observable/attribute-observable.js?rev=1609737&view=auto
==============================================================================
--- roller/trunk/app/src/main/webapp/roller-ui/yui3/attribute-observable/attribute-observable.js (added)
+++ roller/trunk/app/src/main/webapp/roller-ui/yui3/attribute-observable/attribute-observable.js Fri Jul 11 16:23:25 2014
@@ -0,0 +1,243 @@
+/*
+YUI 3.17.2 (build 9c3c78e)
+Copyright 2014 Yahoo! Inc. All rights reserved.
+Licensed under the BSD License.
+http://yuilibrary.com/license/
+*/
+
+YUI.add('attribute-observable', function (Y, NAME) {
+
+    /*For log lines*/
+    /*jshint maxlen:200*/
+
+
+    /**
+     * The attribute module provides an augmentable Attribute implementation, which
+     * adds configurable attributes and attribute change events to the class being
+     * augmented. It also provides a State class, which is used internally by Attribute,
+     * but can also be used independently to provide a name/property/value data structure to
+     * store state.
+     *
+     * @module attribute
+     */
+
+    /**
+     * The `attribute-observable` submodule provides augmentable attribute change event support
+     * for AttributeCore based implementations.
+     *
+     * @module attribute
+     * @submodule attribute-observable
+     */
+    var EventTarget = Y.EventTarget,
+
+        CHANGE = "Change",
+        BROADCAST = "broadcast";
+
+    /**
+     * Provides an augmentable implementation of attribute change events for
+     * AttributeCore.
+     *
+     * @class AttributeObservable
+     * @extensionfor AttributeCore
+     * @uses EventTarget
+     */
+    function AttributeObservable() {
+        // Perf tweak - avoid creating event literals if not required.
+        this._ATTR_E_FACADE = {};
+
+        EventTarget.call(this, {emitFacade:true});
+    }
+
+    AttributeObservable._ATTR_CFG = [BROADCAST];
+
+    AttributeObservable.prototype = {
+
+        /**
+         * Sets the value of an attribute.
+         *
+         * @method set
+         * @chainable
+         *
+         * @param {String} name The name of the attribute. If the
+         * current value of the attribute is an Object, dot notation can be used
+         * to set the value of a property within the object (e.g. <code>set("x.y.z", 5)</code>).
+         *
+         * @param {Any} value The value to set the attribute to.
+         *
+         * @param {Object} opts (Optional) Optional event data to be mixed into
+         * the event facade passed to subscribers of the attribute's change event. This
+         * can be used as a flexible way to identify the source of a call to set, allowing
+         * the developer to distinguish between set called internally by the host, vs.
+         * set called externally by the application developer.
+         *
+         * @return {Object} A reference to the host object.
+         */
+        set : function(name, val, opts) {
+            return this._setAttr(name, val, opts);
+        },
+
+        /**
+         * Allows setting of readOnly/writeOnce attributes. See <a href="#method_set">set</a> for argument details.
+         *
+         * @method _set
+         * @protected
+         * @chainable
+         *
+         * @param {String} name The name of the attribute.
+         * @param {Any} val The value to set the attribute to.
+         * @param {Object} opts (Optional) Optional event data to be mixed into
+         * the event facade passed to subscribers of the attribute's change event.
+         * @return {Object} A reference to the host object.
+         */
+        _set : function(name, val, opts) {
+            return this._setAttr(name, val, opts, true);
+        },
+
+        /**
+         * Sets multiple attribute values.
+         *
+         * @method setAttrs
+         * @param {Object} attrs  An object with attributes name/value pairs.
+         * @param {Object} opts  Properties to mix into the event payload. These are shared and mixed into each set
+         * @return {Object} A reference to the host object.
+         * @chainable
+         */
+        setAttrs : function(attrs, opts) {
+            return this._setAttrs(attrs, opts);
+        },
+
+        /**
+         * Implementation behind the public setAttrs method, to set multiple attribute values.
+         *
+         * @method _setAttrs
+         * @protected
+         * @param {Object} attrs  An object with attributes name/value pairs.
+         * @param {Object} opts  Properties to mix into the event payload. These are shared and mixed into each set
+         * @return {Object} A reference to the host object.
+         * @chainable
+         */
+        _setAttrs : function(attrs, opts) {
+            var attr;
+            for (attr in attrs) {
+                if ( attrs.hasOwnProperty(attr) ) {
+                    this.set(attr, attrs[attr], opts);
+                }
+            }
+            return this;
+        },
+
+        /**
+         * Utility method to help setup the event payload and fire the attribute change event.
+         *
+         * @method _fireAttrChange
+         * @private
+         * @param {String} attrName The name of the attribute
+         * @param {String} subAttrName The full path of the property being changed,
+         * if this is a sub-attribute value being change. Otherwise null.
+         * @param {Any} currVal The current value of the attribute
+         * @param {Any} newVal The new value of the attribute
+         * @param {Object} opts Any additional event data to mix into the attribute change event's event facade.
+         * @param {Object} [cfg] The attribute config stored in State, if already available.
+         */
+        _fireAttrChange : function(attrName, subAttrName, currVal, newVal, opts, cfg) {
+            var host = this,
+                eventName = this._getFullType(attrName + CHANGE),
+                state = host._state,
+                facade,
+                broadcast,
+                e;
+
+            if (!cfg) {
+                cfg = state.data[attrName] || {};
+            }
+
+            if (!cfg.published) {
+
+                // PERF: Using lower level _publish() for
+                // critical path performance
+                e = host._publish(eventName);
+
+                e.emitFacade = true;
+                e.defaultTargetOnly = true;
+                e.defaultFn = host._defAttrChangeFn;
+
+                broadcast = cfg.broadcast;
+                if (broadcast !== undefined) {
+                    e.broadcast = broadcast;
+                }
+
+                cfg.published = true;
+            }
+
+            if (opts) {
+                facade = Y.merge(opts);
+                facade._attrOpts = opts;
+            } else {
+                facade = host._ATTR_E_FACADE;
+            }
+
+            // Not using the single object signature for fire({type:..., newVal:...}), since
+            // we don't want to override type. Changed to the fire(type, {newVal:...}) signature.
+
+            facade.attrName = attrName;
+            facade.subAttrName = subAttrName;
+            facade.prevVal = currVal;
+            facade.newVal = newVal;
+
+            if (host._hasPotentialSubscribers(eventName)) {
+                host.fire(eventName, facade);
+            } else {
+                this._setAttrVal(attrName, subAttrName, currVal, newVal, opts, cfg);
+            }
+        },
+
+        /**
+         * Default function for attribute change events.
+         *
+         * @private
+         * @method _defAttrChangeFn
+         * @param {EventFacade} e The event object for attribute change events.
+         * @param {boolean} eventFastPath Whether or not we're using this as a fast path in the case of no listeners or not
+         */
+        _defAttrChangeFn : function(e, eventFastPath) {
+
+            var opts = e._attrOpts;
+            if (opts) {
+                delete e._attrOpts;
+            }
+
+            if (!this._setAttrVal(e.attrName, e.subAttrName, e.prevVal, e.newVal, opts)) {
+
+
+                if (!eventFastPath) {
+                    // Prevent "after" listeners from being invoked since nothing changed.
+                    e.stopImmediatePropagation();
+                }
+
+            } else {
+                if (!eventFastPath) {
+                    e.newVal = this.get(e.attrName);
+                }
+            }
+        }
+    };
+
+    // Basic prototype augment - no lazy constructor invocation.
+    Y.mix(AttributeObservable, EventTarget, false, null, 1);
+
+    Y.AttributeObservable = AttributeObservable;
+
+    /**
+    The `AttributeEvents` class extension was deprecated in YUI 3.8.0 and is now
+    an alias for the `AttributeObservable` class extension. Use that class
+    extnesion instead. This alias will be removed in a future version of YUI.
+
+    @class AttributeEvents
+    @uses EventTarget
+    @deprecated Use `AttributeObservable` instead.
+    @see AttributeObservable
+    **/
+    Y.AttributeEvents = AttributeObservable;
+
+
+}, '3.17.2', {"requires": ["event-custom"]});

Added: roller/trunk/app/src/main/webapp/roller-ui/yui3/base-base/base-base-min.js
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/webapp/roller-ui/yui3/base-base/base-base-min.js?rev=1609737&view=auto
==============================================================================
--- roller/trunk/app/src/main/webapp/roller-ui/yui3/base-base/base-base-min.js (added)
+++ roller/trunk/app/src/main/webapp/roller-ui/yui3/base-base/base-base-min.js Fri Jul 11 16:23:25 2014
@@ -0,0 +1,8 @@
+/*
+YUI 3.17.2 (build 9c3c78e)
+Copyright 2014 Yahoo! Inc. All rights reserved.
+Licensed under the BSD License.
+http://yuilibrary.com/license/
+*/
+
+YUI.add("base-base",function(e,t){function o(){i.apply(this,arguments),s.apply(this,arguments),r.apply(this,arguments)}var n=e.AttributeCore,r=e.AttributeExtras,i=e.BaseCore,s=e.BaseObservable;o._ATTR_CFG=i._ATTR_CFG.concat(s._ATTR_CFG),o._NON_ATTRS_CFG=i._NON_ATTRS_CFG.concat(s._NON_ATTRS_CFG),o.NAME="base",o.ATTRS=n.protectAttrs(i.ATTRS),o.modifyAttrs=i.modifyAttrs,e.mix(o,i,!1,null,1),e.mix(o,r,!1,null,1),e.mix(o,s,!0,null,1),o.prototype.constructor=o,e.Base=o},"3.17.2",{requires:["attribute-base","base-core","base-observable"]});

Added: roller/trunk/app/src/main/webapp/roller-ui/yui3/base-base/base-base.js
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/webapp/roller-ui/yui3/base-base/base-base.js?rev=1609737&view=auto
==============================================================================
--- roller/trunk/app/src/main/webapp/roller-ui/yui3/base-base/base-base.js (added)
+++ roller/trunk/app/src/main/webapp/roller-ui/yui3/base-base/base-base.js Fri Jul 11 16:23:25 2014
@@ -0,0 +1,191 @@
+/*
+YUI 3.17.2 (build 9c3c78e)
+Copyright 2014 Yahoo! Inc. All rights reserved.
+Licensed under the BSD License.
+http://yuilibrary.com/license/
+*/
+
+YUI.add('base-base', function (Y, NAME) {
+
+    /**
+     * The base module provides the Base class, which objects requiring attribute and custom event support can extend.
+     * The module also provides two ways to reuse code - It augments Base with the Plugin.Host interface which provides
+     * plugin support and also provides the BaseCore.build method which provides a way to build custom classes using extensions.
+     *
+     * @module base
+     */
+
+    /**
+     * The base-base submodule provides the Base class without the Plugin support, provided by Plugin.Host,
+     * and without the extension support provided by BaseCore.build.
+     *
+     * @module base
+     * @submodule base-base
+     */
+
+    var AttributeCore   = Y.AttributeCore,
+        AttributeExtras = Y.AttributeExtras,
+        BaseCore        = Y.BaseCore,
+        BaseObservable  = Y.BaseObservable;
+
+    /**
+     * <p>
+     * A base class which objects requiring attributes and custom event support can
+     * extend. Base also handles the chaining of initializer and destructor methods across
+     * the hierarchy as part of object construction and destruction. Additionally, attributes configured
+     * through the static <a href="#property_ATTRS">ATTRS</a> property for each class
+     * in the hierarchy will be initialized by Base.
+     * </p>
+     *
+     * <p>
+     * **NOTE:** Prior to version 3.11.0, ATTRS would get added a class at a time. That is,
+     * Base would loop through each class in the hierarchy, and add the class' ATTRS, and
+     * then call it's initializer, and move on to the subclass' ATTRS and initializer. As of
+     * 3.11.0, ATTRS from all classes in the hierarchy are added in one `addAttrs` call before
+     * any initializers are called. This fixes subtle edge-case issues with subclass ATTRS overriding
+     * superclass `setter`, `getter` or `valueFn` definitions and being unable to get/set attributes
+     * defined by the subclass. This order of operation change may impact `setter`, `getter` or `valueFn`
+     * code which expects a superclass' initializer to have run. This is expected to be rare, but to support
+     * it, Base supports a `_preAddAttrs()`, method hook (same signature as `addAttrs`). Components can
+     * implement this method on their prototype for edge cases which do require finer control over
+     * the order in which attributes are added (see widget-htmlparser).
+     * </p>
+     *
+     * <p>
+     * The static <a href="#property_NAME">NAME</a> property of each class extending
+     * from Base will be used as the identifier for the class, and is used by Base to prefix
+     * all events fired by instances of that class.
+     * </p>
+     *
+     * @class Base
+     * @constructor
+     * @uses BaseCore
+     * @uses BaseObservable
+     * @uses AttributeCore
+     * @uses AttributeObservable
+     * @uses AttributeExtras
+     * @uses EventTarget
+     *
+     * @param {Object} config Object with configuration property name/value pairs. The object can be
+     * used to provide default values for the objects published attributes.
+     *
+     * <p>
+     * The config object can also contain the following non-attribute properties, providing a convenient
+     * way to configure events listeners and plugins for the instance, as part of the constructor call:
+     * </p>
+     *
+     * <dl>
+     *   <dt>on</dt>
+     *   <dd>An event name to listener function map, to register event listeners for the "on" moment of the event.
+     *       A constructor convenience property for the <a href="Base.html#method_on">on</a> method.</dd>
+     *   <dt>after</dt>
+     *   <dd>An event name to listener function map, to register event listeners for the "after" moment of the event.
+     *       A constructor convenience property for the <a href="Base.html#method_after">after</a> method.</dd>
+     *   <dt>bubbleTargets</dt>
+     *   <dd>An object, or array of objects, to register as bubble targets for bubbled events fired by this instance.
+     *       A constructor convenience property for the <a href="EventTarget.html#method_addTarget">addTarget</a> method.</dd>
+     *   <dt>plugins</dt>
+     *   <dd>A plugin, or array of plugins to be plugged into the instance (see PluginHost's plug method for signature details).
+     *       A constructor convenience property for the <a href="Plugin.Host.html#method_plug">plug</a> method.</dd>
+     * </dl>
+     */
+    function Base() {
+        BaseCore.apply(this, arguments);
+        BaseObservable.apply(this, arguments);
+        AttributeExtras.apply(this, arguments);
+    }
+
+    /**
+     * The list of properties which can be configured for
+     * each attribute (e.g. setter, getter, writeOnce, readOnly etc.)
+     *
+     * @property _ATTR_CFG
+     * @type Array
+     * @static
+     * @private
+     */
+    Base._ATTR_CFG = BaseCore._ATTR_CFG.concat(BaseObservable._ATTR_CFG);
+
+    /**
+     * The array of non-attribute configuration properties supported by this class.
+     *
+     * `Base` supports "on", "after", "plugins" and "bubbleTargets" properties,
+     * which are not set up as attributes.
+     *
+     * This property is primarily required so that when
+     * <a href="#property__allowAdHocAttrs">`_allowAdHocAttrs`</a> is enabled by
+     * a class, non-attribute configurations don't get added as ad-hoc attributes.
+     *
+     * @property _NON_ATTRS_CFG
+     * @type Array
+     * @static
+     * @private
+     */
+    Base._NON_ATTRS_CFG = BaseCore._NON_ATTRS_CFG.concat(BaseObservable._NON_ATTRS_CFG);
+
+    /**
+     * <p>
+     * The string to be used to identify instances of
+     * this class, for example in prefixing events.
+     * </p>
+     * <p>
+     * Classes extending Base, should define their own
+     * static NAME property, which should be camelCase by
+     * convention (e.g. MyClass.NAME = "myClass";).
+     * </p>
+     * @property NAME
+     * @type String
+     * @static
+     */
+    Base.NAME = 'base';
+
+    /**
+     * The default set of attributes which will be available for instances of this class, and
+     * their configuration. In addition to the configuration properties listed by
+     * Attribute's <a href="Attribute.html#method_addAttr">addAttr</a> method, the attribute
+     * can also be configured with a "cloneDefaultValue" property, which defines how the statically
+     * defined value field should be protected ("shallow", "deep" and false are supported values).
+     *
+     * By default if the value is an object literal or an array it will be "shallow" cloned, to
+     * protect the default value.
+     *
+     * @property ATTRS
+     * @type Object
+     * @static
+     */
+    Base.ATTRS = AttributeCore.protectAttrs(BaseCore.ATTRS);
+
+    /**
+    Provides a way to safely modify a `Y.Base` subclass' static `ATTRS` after
+    the class has been defined or created.
+
+    Base-based classes cache information about the class hierarchy in order to
+    efficiently create instances. This cache includes includes the aggregated
+    `ATTRS` configs. If the static `ATTRS` configs need to be modified after the
+    class has been defined or create, then use this method which will make sure
+    to clear any cached data before making any modifications.
+
+    @method modifyAttrs
+    @param {Function} [ctor] The constructor function whose `ATTRS` should be
+        modified. If a `ctor` function is not specified, then `this` is assumed
+        to be the constructor which hosts the `ATTRS`.
+    @param {Object} configs The collection of `ATTRS` configs to mix with the
+        existing attribute configurations.
+    @static
+    @since 3.10.0
+    **/
+    Base.modifyAttrs = BaseCore.modifyAttrs;
+
+    Y.mix(Base, BaseCore, false, null, 1);
+    Y.mix(Base, AttributeExtras, false, null, 1);
+
+    // Needs to be `true`, to overwrite methods from `BaseCore`.
+    Y.mix(Base, BaseObservable, true, null, 1);
+
+    // Fix constructor
+    Base.prototype.constructor = Base;
+
+    Y.Base = Base;
+
+
+}, '3.17.2', {"requires": ["attribute-base", "base-core", "base-observable"]});

Added: roller/trunk/app/src/main/webapp/roller-ui/yui3/base-build/base-build-min.js
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/webapp/roller-ui/yui3/base-build/base-build-min.js?rev=1609737&view=auto
==============================================================================
--- roller/trunk/app/src/main/webapp/roller-ui/yui3/base-build/base-build-min.js (added)
+++ roller/trunk/app/src/main/webapp/roller-ui/yui3/base-build/base-build-min.js Fri Jul 11 16:23:25 2014
@@ -0,0 +1,8 @@
+/*
+YUI 3.17.2 (build 9c3c78e)
+Copyright 2014 Yahoo! Inc. All rights reserved.
+Licensed under the BSD License.
+http://yuilibrary.com/license/
+*/
+
+YUI.add("base-build",function(e,t){function f(e,t,n){n[e]&&(t[e]=(t[e]||[]).concat(n[e]))}function l(e,t,n){n._ATTR_CFG&&(t._ATTR_CFG_HASH=null,f.apply(null,arguments))}function c(e,t,r){n.modifyAttrs(t,r.ATTRS)}var n=e.BaseCore,r=e.Base,i=e.Lang,s="initializer",o="destructor",u=["_PLUG","_UNPLUG"],a;r._build=function(t,n,i,u,a,f){var l=r._build,c=l._ctor(n,f),h=l._cfg(n,f,i),p=l._mixCust,d=c._yuibuild.dynamic,v,m,g,y,b,w;for(v=0,m=i.length;v<m;v++)g=i[v],y=g.prototype,b=y[s],w=y[o],delete y[s],delete y[o],e.mix(c,g,!0,null,1),p(c,g,h),b&&(y[s]=b),w&&(y[o]=w),c._yuibuild.exts.push(g);return u&&e.mix(c.prototype,u,!0),a&&(e.mix(c,l._clean(a,h),!0),p(c,a,h)),c.prototype.hasImpl=l._impl,d&&(c.NAME=t,c.prototype.constructor=c,c.modifyAttrs=n.modifyAttrs),c},a=r._build,e.mix(a,{_mixCust:function(t,n,r){var s,o,u,a,f,l;r&&(s=r.aggregates,o=r.custom,u=r.statics),u&&e.mix(t,n,!0,u);if(s)for(l=0,f=s.length;l<f;l++)a=s[l],!t.hasOwnProperty(a)&&n.hasOwnProperty(a)&&(t[a]=i.isArray(n[a])?[]:{})
 ,e.aggregate(t,n,!0,[a]);if(o)for(l in o)o.hasOwnProperty(l)&&o[l](l,t,n)},_tmpl:function(t){function n(){n.superclass.constructor.apply(this,arguments)}return e.extend(n,t),n},_impl:function(e){var t=this._getClasses(),n,r,i,s,o,u;for(n=0,r=t.length;n<r;n++){i=t[n];if(i._yuibuild){s=i._yuibuild.exts,o=s.length;for(u=0;u<o;u++)if(s[u]===e)return!0}}return!1},_ctor:function(e,t){var n=t&&!1===t.dynamic?!1:!0,r=n?a._tmpl(e):e,i=r._yuibuild;return i||(i=r._yuibuild={}),i.id=i.id||null,i.exts=i.exts||[],i.dynamic=n,r},_cfg:function(t,n,r){var i=[],s={},o=[],u,a=n&&n.aggregates,f=n&&n.custom,l=n&&n.statics,c=t,h,p;while(c&&c.prototype)u=c._buildCfg,u&&(u.aggregates&&(i=i.concat(u.aggregates)),u.custom&&e.mix(s,u.custom,!0),u.statics&&(o=o.concat(u.statics))),c=c.superclass?c.superclass.constructor:null;if(r)for(h=0,p=r.length;h<p;h++)c=r[h],u=c._buildCfg,u&&(u.aggregates&&(i=i.concat(u.aggregates)),u.custom&&e.mix(s,u.custom,!0),u.statics&&(o=o.concat(u.statics)));return a&&(i=i.concat(a
 )),f&&e.mix(s,n.cfgBuild,!0),l&&(o=o.concat(l)),{aggregates:i,custom:s,statics:o}},_clean:function(t,n){var r,i,s,o=e.merge(t),u=n.aggregates,a=n.custom;for(r in a)o.hasOwnProperty(r)&&delete o[r];for(i=0,s=u.length;i<s;i++)r=u[i],o.hasOwnProperty(r)&&delete o[r];return o}}),r.build=function(e,t,n,r){return a(e,t,n,null,null,r)},r.create=function(e,t,n,r,i){return a(e,t,n,r,i)},r.mix=function(e,t){return e._CACHED_CLASS_DATA&&(e._CACHED_CLASS_DATA=null),a(null,e,t,null,null,{dynamic:!1})},n._buildCfg={aggregates:u.concat(),custom:{ATTRS:c,_ATTR_CFG:l,_NON_ATTRS_CFG:f}},r._buildCfg={aggregates:u.concat(),custom:{ATTRS:c,_ATTR_CFG:l,_NON_ATTRS_CFG:f}}},"3.17.2",{requires:["base-base"]});



Mime
View raw message