Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed merge

  • Loading branch information...
commit 0763dd7d48e3e4c6e83f44102e39e3e631f7fb87 2 parents 4410ba2 + 2274a81
@davglass davglass authored
Showing with 1,081 additions and 876 deletions.
  1. +20 −18 build/attribute-base/attribute-base-coverage.js
  2. +5 −3 build/attribute-base/attribute-base-debug.js
  3. +5 −3 build/attribute-base/attribute-base.js
  4. +218 −214 build/attribute-core/attribute-core-coverage.js
  5. +42 −39 build/attribute-core/attribute-core-debug.js
  6. +1 −1  build/attribute-core/attribute-core-min.js
  7. +42 −39 build/attribute-core/attribute-core.js
  8. +27 −26 build/attribute-extras/attribute-extras-coverage.js
  9. +2 −1  build/attribute-extras/attribute-extras-debug.js
  10. +2 −1  build/attribute-extras/attribute-extras.js
  11. +10 −8 build/attribute-observable/attribute-observable-coverage.js
  12. +3 −1 build/attribute-observable/attribute-observable-debug.js
  13. +1 −1  build/attribute-observable/attribute-observable-min.js
  14. +3 −1 build/attribute-observable/attribute-observable.js
  15. +2 −2 build/features/features-coverage.js
  16. +1 −1  build/features/features-debug.js
  17. +1 −1  build/features/features.js
  18. +108 −101 build/io-xdr/io-xdr-coverage.js
  19. +14 −8 build/io-xdr/io-xdr-debug.js
  20. +1 −1  build/io-xdr/io-xdr-min.js
  21. +14 −8 build/io-xdr/io-xdr.js
  22. +2 −2 build/loader-base/loader-base-coverage.js
  23. +1 −1  build/loader-base/loader-base-debug.js
  24. +1 −1  build/loader-base/loader-base-min.js
  25. +1 −1  build/loader-base/loader-base.js
  26. +77 −75 build/loader-yui3/loader-yui3-coverage.js
  27. +5 −4 build/loader-yui3/loader-yui3-debug.js
  28. +1 −1  build/loader-yui3/loader-yui3-min.js
  29. +5 −4 build/loader-yui3/loader-yui3.js
  30. +6 −5 build/loader/loader-debug.js
  31. +1 −1  build/loader/loader-min.js
  32. +6 −5 build/loader/loader.js
  33. +11 −12 build/simpleyui/simpleyui-debug.js
  34. +1 −1  build/simpleyui/simpleyui-min.js
  35. +11 −12 build/simpleyui/simpleyui.js
  36. +1 −1  build/yui-base/yui-base-debug.js
  37. +1 −1  build/yui-base/yui-base.js
  38. +7 −6 build/yui-nodejs/yui-nodejs-debug.js
  39. +1 −1  build/yui-nodejs/yui-nodejs-min.js
  40. +7 −6 build/yui-nodejs/yui-nodejs.js
  41. +7 −6 build/yui/yui-debug.js
  42. +1 −1  build/yui/yui-min.js
  43. +7 −6 build/yui/yui.js
  44. +6 −0 src/attribute/HISTORY.md
  45. +153 −68 src/attribute/docs/index.mustache
  46. +5 −3 src/attribute/js/Attribute.js
  47. +42 −39 src/attribute/js/AttributeCore.js
  48. +2 −1  src/attribute/js/AttributeExtras.js
  49. +3 −1 src/attribute/js/AttributeObservable.js
  50. +35 −0 src/attribute/tests/unit/assets/attribute-core-tests.js
  51. +2 −4 src/common/travis/before.sh
  52. +0 −79 src/common/travis/get_pull_files.js
  53. +0 −15 src/common/travis/gettests.js
  54. +9 −1 src/io/HISTORY.md
  55. +14 −8 src/io/js/io-xdr.js
  56. +95 −0 src/io/tests/unit/js/xdr-tests.js
  57. +8 −2 src/io/tests/unit/modules.js
  58. +5 −5 src/io/tests/unit/urls.js
  59. +2 −2 src/loader/build.json
  60. +5 −4 src/loader/js/yui3.js
  61. +11 −12 src/simpleyui/js/concat.js
  62. +1 −1  src/yui/js/load-tests.js
View
38 build/attribute-base/attribute-base-coverage.js
@@ -26,9 +26,9 @@ _yuitest_coverage["build/attribute-base/attribute-base.js"] = {
path: "build/attribute-base/attribute-base.js",
code: []
};
-_yuitest_coverage["build/attribute-base/attribute-base.js"].code=["YUI.add('attribute-base', 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-base submodule provides core attribute handling support, with everything"," * aside from complex attribute handling in the provider's constructor."," *"," * @module attribute"," * @submodule attribute-base"," */",""," /**"," * <p>"," * Attribute provides configurable attribute support along with attribute change events. 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,"," * along with attribute change events."," * </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><strong>NOTE:</strong> Most implementations will be better off extending the <a href=\"Base.html\">Base</a> class,"," * instead of augmenting Attribute directly. Base augments Attribute and will handle the initial configuration"," * of attributes for derived classes, accounting for values passed into the constructor.</p>"," *"," * @class Attribute"," * @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>)."," * @uses AttributeCore"," * @uses AttributeObservable"," * @uses EventTarget"," * @uses AttributeExtras"," */"," function Attribute() {"," Y.AttributeCore.apply(this, arguments);"," Y.AttributeObservable.apply(this, arguments);"," Y.AttributeExtras.apply(this, arguments);"," }",""," Y.mix(Attribute, Y.AttributeCore, false, null, 1);"," Y.mix(Attribute, Y.AttributeExtras, false, null, 1);",""," // Needs to be \"true\", to overwrite methods from AttributeCore"," Y.mix(Attribute, Y.AttributeObservable, true, null, 1);",""," /**"," * <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"," */"," Attribute.INVALID_VALUE = Y.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"," */"," Attribute._ATTR_CFG = Y.AttributeCore._ATTR_CFG.concat(Y.AttributeObservable._ATTR_CFG);",""," /**"," * 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."," */"," Attribute.protectAttrs = Y.AttributeCore.protectAttrs;",""," Y.Attribute = Attribute;","","","}, '@VERSION@', {\"requires\": [\"attribute-core\", \"attribute-observable\", \"attribute-extras\"]});"];
-_yuitest_coverage["build/attribute-base/attribute-base.js"].lines = {"1":0,"54":0,"55":0,"56":0,"57":0,"60":0,"61":0,"64":0,"78":0,"92":0,"103":0,"105":0};
-_yuitest_coverage["build/attribute-base/attribute-base.js"].functions = {"Attribute:54":0,"(anonymous 1):1":0};
+_yuitest_coverage["build/attribute-base/attribute-base.js"].code=["YUI.add('attribute-base', 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-base submodule provides core attribute handling support, with everything"," * aside from complex attribute handling in the provider's constructor."," *"," * @module attribute"," * @submodule attribute-base"," */",""," /**"," * <p>"," * Attribute provides configurable attribute support along with attribute change events. 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,"," * along with attribute change events."," * </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><strong>NOTE:</strong> Most implementations will be better off extending the <a href=\"Base.html\">Base</a> class,"," * instead of augmenting Attribute directly. Base augments Attribute and will handle the initial configuration"," * of attributes for derived classes, accounting for values passed into the constructor.</p>"," *"," * @class Attribute"," * @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>)."," * @uses AttributeCore"," * @uses AttributeObservable"," * @uses EventTarget"," * @uses AttributeExtras"," */"," function Attribute() {"," Y.AttributeCore.apply(this, arguments);"," Y.AttributeObservable.apply(this, arguments);"," Y.AttributeExtras.apply(this, arguments);"," }",""," Y.mix(Attribute, Y.AttributeCore, false, null, 1);"," Y.mix(Attribute, Y.AttributeExtras, false, null, 1);",""," // Needs to be `true`, to overwrite methods from AttributeCore"," Y.mix(Attribute, Y.AttributeObservable, true, null, 1);",""," /**"," * <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"," */"," Attribute.INVALID_VALUE = Y.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"," */"," Attribute._ATTR_CFG = Y.AttributeCore._ATTR_CFG.concat(Y.AttributeObservable._ATTR_CFG);",""," /**"," * 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."," */"," Attribute.protectAttrs = Y.AttributeCore.protectAttrs;",""," Y.Attribute = Attribute;","","","}, '@VERSION@', {\"requires\": [\"attribute-core\", \"attribute-observable\", \"attribute-extras\"]});"];
+_yuitest_coverage["build/attribute-base/attribute-base.js"].lines = {"1":0,"56":0,"57":0,"58":0,"59":0,"62":0,"63":0,"66":0,"80":0,"94":0,"105":0,"107":0};
+_yuitest_coverage["build/attribute-base/attribute-base.js"].functions = {"Attribute:56":0,"(anonymous 1):1":0};
_yuitest_coverage["build/attribute-base/attribute-base.js"].coveredLines = 12;
_yuitest_coverage["build/attribute-base/attribute-base.js"].coveredFunctions = 2;
_yuitest_coverline("build/attribute-base/attribute-base.js", 1);
@@ -77,8 +77,10 @@ YUI.add('attribute-base', function (Y, NAME) {
* of attributes for derived classes, accounting for values passed into the constructor.</p>
*
* @class Attribute
- * @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 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>).
* @uses AttributeCore
* @uses AttributeObservable
@@ -86,24 +88,24 @@ YUI.add('attribute-base', function (Y, NAME) {
* @uses AttributeExtras
*/
_yuitest_coverfunc("build/attribute-base/attribute-base.js", "(anonymous 1)", 1);
-_yuitest_coverline("build/attribute-base/attribute-base.js", 54);
+_yuitest_coverline("build/attribute-base/attribute-base.js", 56);
function Attribute() {
- _yuitest_coverfunc("build/attribute-base/attribute-base.js", "Attribute", 54);
-_yuitest_coverline("build/attribute-base/attribute-base.js", 55);
+ _yuitest_coverfunc("build/attribute-base/attribute-base.js", "Attribute", 56);
+_yuitest_coverline("build/attribute-base/attribute-base.js", 57);
Y.AttributeCore.apply(this, arguments);
- _yuitest_coverline("build/attribute-base/attribute-base.js", 56);
+ _yuitest_coverline("build/attribute-base/attribute-base.js", 58);
Y.AttributeObservable.apply(this, arguments);
- _yuitest_coverline("build/attribute-base/attribute-base.js", 57);
+ _yuitest_coverline("build/attribute-base/attribute-base.js", 59);
Y.AttributeExtras.apply(this, arguments);
}
- _yuitest_coverline("build/attribute-base/attribute-base.js", 60);
+ _yuitest_coverline("build/attribute-base/attribute-base.js", 62);
Y.mix(Attribute, Y.AttributeCore, false, null, 1);
- _yuitest_coverline("build/attribute-base/attribute-base.js", 61);
+ _yuitest_coverline("build/attribute-base/attribute-base.js", 63);
Y.mix(Attribute, Y.AttributeExtras, false, null, 1);
- // Needs to be "true", to overwrite methods from AttributeCore
- _yuitest_coverline("build/attribute-base/attribute-base.js", 64);
+ // Needs to be `true`, to overwrite methods from AttributeCore
+ _yuitest_coverline("build/attribute-base/attribute-base.js", 66);
Y.mix(Attribute, Y.AttributeObservable, true, null, 1);
/**
@@ -118,7 +120,7 @@ Y.mix(Attribute, Y.AttributeObservable, true, null, 1);
* @static
* @final
*/
- _yuitest_coverline("build/attribute-base/attribute-base.js", 78);
+ _yuitest_coverline("build/attribute-base/attribute-base.js", 80);
Attribute.INVALID_VALUE = Y.AttributeCore.INVALID_VALUE;
/**
@@ -133,7 +135,7 @@ Attribute.INVALID_VALUE = Y.AttributeCore.INVALID_VALUE;
* @static
* @protected
*/
- _yuitest_coverline("build/attribute-base/attribute-base.js", 92);
+ _yuitest_coverline("build/attribute-base/attribute-base.js", 94);
Attribute._ATTR_CFG = Y.AttributeCore._ATTR_CFG.concat(Y.AttributeObservable._ATTR_CFG);
/**
@@ -145,10 +147,10 @@ Attribute._ATTR_CFG = Y.AttributeCore._ATTR_CFG.concat(Y.AttributeObservable._AT
* @param {Object} attrs A hash of attribute to configuration object pairs.
* @return {Object} A protected version of the `attrs` argument.
*/
- _yuitest_coverline("build/attribute-base/attribute-base.js", 103);
+ _yuitest_coverline("build/attribute-base/attribute-base.js", 105);
Attribute.protectAttrs = Y.AttributeCore.protectAttrs;
- _yuitest_coverline("build/attribute-base/attribute-base.js", 105);
+ _yuitest_coverline("build/attribute-base/attribute-base.js", 107);
Y.Attribute = Attribute;
View
8 build/attribute-base/attribute-base-debug.js
@@ -43,8 +43,10 @@ YUI.add('attribute-base', function (Y, NAME) {
* of attributes for derived classes, accounting for values passed into the constructor.</p>
*
* @class Attribute
- * @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 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>).
* @uses AttributeCore
* @uses AttributeObservable
@@ -60,7 +62,7 @@ YUI.add('attribute-base', function (Y, NAME) {
Y.mix(Attribute, Y.AttributeCore, false, null, 1);
Y.mix(Attribute, Y.AttributeExtras, false, null, 1);
- // Needs to be "true", to overwrite methods from AttributeCore
+ // Needs to be `true`, to overwrite methods from AttributeCore
Y.mix(Attribute, Y.AttributeObservable, true, null, 1);
/**
View
8 build/attribute-base/attribute-base.js
@@ -43,8 +43,10 @@ YUI.add('attribute-base', function (Y, NAME) {
* of attributes for derived classes, accounting for values passed into the constructor.</p>
*
* @class Attribute
- * @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 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>).
* @uses AttributeCore
* @uses AttributeObservable
@@ -60,7 +62,7 @@ YUI.add('attribute-base', function (Y, NAME) {
Y.mix(Attribute, Y.AttributeCore, false, null, 1);
Y.mix(Attribute, Y.AttributeExtras, false, null, 1);
- // Needs to be "true", to overwrite methods from AttributeCore
+ // Needs to be `true`, to overwrite methods from AttributeCore
Y.mix(Attribute, Y.AttributeObservable, true, null, 1);
/**
View
432 build/attribute-core/attribute-core-coverage.js
218 additions, 214 deletions not shown
View
81 build/attribute-core/attribute-core-debug.js
@@ -216,8 +216,10 @@ YUI.add('attribute-core', function (Y, NAME) {
* 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 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) {
@@ -288,8 +290,10 @@ YUI.add('attribute-core', function (Y, NAME) {
* 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 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
*/
@@ -330,7 +334,8 @@ YUI.add('attribute-core', function (Y, NAME) {
* 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
+ * <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>
*
@@ -414,7 +419,7 @@ YUI.add('attribute-core', function (Y, NAME) {
added : true
});
} else {
-
+ /*jshint maxlen:200*/
if (host.attrAdded(name) && !state.get(name, IS_LAZY_ADD)) { Y.log('Attribute: ' + name + ' already exists. Cannot add it again without removing it first', 'warn', 'attribute'); }
if (!host.attrAdded(name) || state.get(name, IS_LAZY_ADD)) {
@@ -422,6 +427,7 @@ YUI.add('attribute-core', function (Y, NAME) {
hasValue = (VALUE in config);
if (config.readOnly && !hasValue) { Y.log('readOnly attribute: ' + name + ', added without an initial value. Value will be set on initial call to set', 'warn', 'attribute');}
+ /*jshint maxlen:150*/
if (hasValue) {
// We'll go through set, don't want to set value in config directly
@@ -451,7 +457,8 @@ YUI.add('attribute-core', function (Y, NAME) {
*
* @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.
+ * @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);
@@ -493,7 +500,7 @@ YUI.add('attribute-core', function (Y, NAME) {
* @private
* @param {Object} name The name of the attribute
*/
- _addLazyAttr: function(name, cfg) {
+ _addLazyAttr: function(name) {
var state = this._state,
lazyCfg = state.get(name, LAZY);
@@ -511,13 +518,12 @@ YUI.add('attribute-core', function (Y, NAME) {
* @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) {
- return this._setAttr(name, val);
+ set : function(name, val, opts) {
+ return this._setAttr(name, val, opts);
},
/**
@@ -529,10 +535,11 @@ YUI.add('attribute-core', function (Y, NAME) {
*
* @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) {
- return this._setAttr(name, val, null, true);
+ _set : function(name, val, opts) {
+ return this._setAttr(name, val, opts, true);
},
/**
@@ -546,22 +553,13 @@ YUI.add('attribute-core', function (Y, NAME) {
*
* @param {String} name The name of the attribute.
* @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 is currently a hack. There's no real need for the AttributeCore implementation
- * to support this parameter, but breaking it out into AttributeObservable, results in
- * additional function hops for the critical path.
+ * @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) {
-
- // HACK - no real reason core needs to know about opts, but
- // it adds fn hops if we want to break it out.
- // Not sure it's worth it for this critical path
-
var allowSet = true,
state = this._state,
stateProxy = this._stateProxy,
@@ -629,8 +627,9 @@ YUI.add('attribute-core', function (Y, NAME) {
}
if (allowSet) {
+ opts = opts || {};
if (!this._fireAttrChange || initializing) {
- this._setAttrVal(name, strPath, currVal, val);
+ this._setAttrVal(name, strPath, currVal, val, opts);
} 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
@@ -738,10 +737,11 @@ YUI.add('attribute-core', function (Y, 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.
*
* @return {booolean} true if the new attribute value was stored, false if not.
*/
- _setAttrVal : function(attrName, subAttrName, prevVal, newVal) {
+ _setAttrVal : function(attrName, subAttrName, prevVal, newVal, opts) {
var host = this,
allowSet = true,
@@ -760,7 +760,7 @@ YUI.add('attribute-core', function (Y, NAME) {
validator = this[validator];
}
if (validator) {
- valid = validator.call(host, newVal, name);
+ valid = validator.call(host, newVal, name, opts);
if (!valid && initializing) {
newVal = cfg.defaultValue;
@@ -776,7 +776,7 @@ YUI.add('attribute-core', function (Y, NAME) {
setter = this[setter];
}
if (setter) {
- retVal = setter.call(host, newVal, name);
+ retVal = setter.call(host, newVal, name, opts);
if (retVal === INVALID_VALUE) {
Y.log('Attribute: ' + attrName + ', setter returned Attribute.INVALID_VALUE for value:' + newVal, 'warn', 'attribute');
@@ -814,11 +814,12 @@ YUI.add('attribute-core', function (Y, NAME) {
*
* @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) {
- return this._setAttrs(attrs);
+ setAttrs : function(attrs, opts) {
+ return this._setAttrs(attrs, opts);
},
/**
@@ -827,14 +828,15 @@ YUI.add('attribute-core', function (Y, NAME) {
* @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) {
+ _setAttrs : function(attrs, opts) {
var attr;
for (attr in attrs) {
if ( attrs.hasOwnProperty(attr) ) {
- this.set(attr, attrs[attr]);
+ this.set(attr, attrs[attr], opts);
}
}
return this;
@@ -976,9 +978,8 @@ YUI.add('attribute-core', function (Y, NAME) {
_protectAttrs : AttributeCore.protectAttrs,
/**
- * Utility method to split out simple attribute name/value pairs ("x")
- * from complex attribute name/value pairs ("x.y.z"), so that complex
- * attributes can be keyed by the top level attribute name.
+ * 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
@@ -1034,7 +1035,6 @@ YUI.add('attribute-core', function (Y, NAME) {
* @private
*/
_getAttrInitVal : function(attr, cfg, initValues) {
-
var val = cfg.value,
valFn = cfg.valueFn,
tmpVal,
@@ -1085,12 +1085,15 @@ YUI.add('attribute-core', function (Y, NAME) {
},
/**
- * Utility method to set up initial attributes defined during construction, either through the constructor.ATTRS property, or explicitly passed in.
+ * 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 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) {
View
2  build/attribute-core/attribute-core-min.js
@@ -1 +1 @@
-YUI.add("attribute-core",function(e,t){function E(e,t,n){this._yuievt=null,this._initAttrHost(e,t,n)}e.State=function(){this.data={}},e.State.prototype={add:function(e,t,n){var r=this.data[e];r||(r=this.data[e]={}),r[t]=n},addAll:function(e,t){var n=this.data[e],r;n||(n=this.data[e]={});for(r in t)t.hasOwnProperty(r)&&(n[r]=t[r])},remove:function(e,t){var n=this.data[e];n&&delete n[t]},removeAll:function(t,n){var r;n?e.each(n,function(e,n){this.remove(t,typeof n=="string"?n:e)},this):(r=this.data,t in r&&delete r[t])},get:function(e,t){var n=this.data[e];if(n)return n[t]},getAll:function(e,t){var n=this.data[e],r,i;if(t)i=n;else if(n){i={};for(r in n)n.hasOwnProperty(r)&&(i[r]=n[r])}return i}};var n=e.Object,r=e.Lang,i=".",s="getter",o="setter",u="readOnly",a="writeOnce",f="initOnly",l="validator",c="value",h="valueFn",p="lazyAdd",d="added",v="_bypassProxy",m="initializing",g="initValue",y="lazy",b="isLazyAdd",w;E.INVALID_VALUE={},w=E.INVALID_VALUE,E._ATTR_CFG=[o,s,l,c,h,a,u,p,v],E.protectAttrs=function(t){if(t){t=e.merge(t);for(var n in t)t.hasOwnProperty(n)&&(t[n]=e.merge(t[n]))}return t},E.prototype={_initAttrHost:function(t,n,r){this._state=new e.State,this._initAttrs(t,n,r)},addAttr:function(e,t,n){var r=this,i=r._state,s,o;t=t||{},n=p in t?t[p]:n;if(n&&!r.attrAdded(e))i.addAll(e,{lazy:t,added:!0});else if(!r.attrAdded(e)||i.get(e,b))o=c in t,o&&(s=t.value,delete t.value),t.added=!0,t.initializing=!0,i.addAll(e,t),o&&r.set(e,s),i.remove(e,m);return r},attrAdded:function(e){return!!this._state.get(e,d)},get:function(e){return this._getAttr(e)},_isLazyAttr:function(e){return this._state.get(e,y)},_addLazyAttr:function(e,t){var n=this._state,r=n.get(e,y);n.add(e,b,!0),n.remove(e,y),this.addAttr(e,r)},set:function(e,t){return this._setAttr(e,t)},_set:function(e,t){return this._setAttr(e,t,null,!0)},_setAttr:function(t,r,s,o){var u=!0,a=this._state,l=this._stateProxy,h,p,d,v,m,g,y;return t.indexOf(i)!==-1&&(d=t,v=t.split(i),t=v.shift()),this._isLazyAttr(t)&&this._addLazyAttr(t),h=a.getAll(t,!0)||{},p=!(c in h),l&&t in l&&!h._bypassProxy&&(p=!1),g=h.writeOnce,y=h.initializing,!p&&!o&&(g&&(u=!1),h.readOnly&&(u=!1)),!y&&!o&&g===f&&(u=!1),u&&(p||(m=this.get(t)),v&&(r=n.setValue(e.clone(m),v,r),r===undefined&&(u=!1)),u&&(!this._fireAttrChange||y?this._setAttrVal(t,d,m,r):this._fireAttrChange(t,d,m,r,s))),this},_getAttr:function(e){var t=this,r=e,o=t._state,u,a,f,l;return e.indexOf(i)!==-1&&(u=e.split(i),e=u.shift()),t._tCfgs&&t._tCfgs[e]&&(l={},l[e]=t._tCfgs[e],delete t._tCfgs[e],t._addAttrs(l,t._tVals)),t._isLazyAttr(e)&&t._addLazyAttr(e),f=t._getStateVal(e),a=o.get(e,s),a&&!a.call&&(a=this[a]),f=a?a.call(t,f,r):f,f=u?n.getValue(f,u):f,f},_getStateVal:function(e){var t=this._stateProxy;return t&&e in t&&!this._state.get(e,v)?t[e]:this._state.get(e,c)},_setStateVal:function(e,t){var n=this._stateProxy;n&&e in n&&!this._state.get(e,v)?n[e]=t:this._state.add(e,c,t)},_setAttrVal:function(e,t,n,i){var s=this,o=!0,u=this._state.getAll(e,!0)||{},a=u.validator,f=u.setter,l=u.initializing,c=this._getStateVal(e),h=t||e,p,d;return a&&(a.call||(a=this[a]),a&&(d=a.call(s,i,h),!d&&l&&(i=u.defaultValue,d=!0))),!a||d?(f&&(f.call||(f=this[f]),f&&(p=f.call(s,i,h),p===w?o=!1:p!==undefined&&(i=p))),o&&(!t&&i===c&&!r.isObject(i)?o=!1:(g in u||(u.initValue=i),s._setStateVal(e,i)))):o=!1,o},setAttrs:function(e){return this._setAttrs(e)},_setAttrs:function(e){var t;for(t in e)e.hasOwnProperty(t)&&this.set(t,e[t]);return this},getAttrs:function(e){return this._getAttrs(e)},_getAttrs:function(e){var t={},r,i,s,o=e===!0;if(!e||o)e=n.keys(this._state.data);for(i=0,s=e.length;i<s;i++){r=e[i];if(!o||this._getStateVal(r)!=this._state.get(r,g))t[r]=this.get(r)}return t},addAttrs:function(e,t,n){var r=this;return e&&(r._tCfgs=e,r._tVals=r._normAttrVals(t),r._addAttrs(e,r._tVals,n),r._tCfgs=r._tVals=null),r},_addAttrs:function(e,t,n){var r=this,i,s,o;for(i in e)e.hasOwnProperty(i)&&(s=e[i],s.defaultValue=s.value,o=r._getAttrInitVal(i,s,r._tVals),o!==undefined&&(s.value=o),r._tCfgs[i]&&delete r._tCfgs[i],r.addAttr(i,s,n))},_protectAttrs:E.protectAttrs,_normAttrVals:function(e){var t={},n={},r,s,o,u;if(e){for(u in e)e.hasOwnProperty(u)&&(u.indexOf(i)!==-1?(r=u.split(i),s=r.shift(),o=n[s]=n[s]||[],o[o.length]={path:r,value:e[u]}):t[u]=e[u]);return{simple:t,complex:n}}return null},_getAttrInitVal:function(e,t,r){var i=t.value,s=t.valueFn,o,u=!1,a,f,l,c,h,p,d;!t.readOnly&&r&&(a=r.simple,a&&a.hasOwnProperty(e)&&(i=a[e],u=!0)),s&&!u&&(s.call||(s=this[s]),s&&(o=s.call(this,e),i=o));if(!t.readOnly&&r){f=r.complex;if(f&&f.hasOwnProperty(e)&&i!==undefined&&i!==null){d=f[e];for(l=0,c=d.length;l<c;++l)h=d[l].path,p=d[l].value,n.setValue(i,h,p)}}return i},_initAttrs:function(t,n,r){t=t||this.constructor.ATTRS;var i=e.Base,s=e.BaseCore,o=i&&e.instanceOf(this,i),u=!o&&s&&e.instanceOf(this,s);t&&!o&&!u&&this.addAttrs(e.AttributeCore.protectAttrs(t),n,r)}},e.AttributeCore=E},"@VERSION@",{requires:["oop"]});
+YUI.add("attribute-core",function(e,t){function E(e,t,n){this._yuievt=null,this._initAttrHost(e,t,n)}e.State=function(){this.data={}},e.State.prototype={add:function(e,t,n){var r=this.data[e];r||(r=this.data[e]={}),r[t]=n},addAll:function(e,t){var n=this.data[e],r;n||(n=this.data[e]={});for(r in t)t.hasOwnProperty(r)&&(n[r]=t[r])},remove:function(e,t){var n=this.data[e];n&&delete n[t]},removeAll:function(t,n){var r;n?e.each(n,function(e,n){this.remove(t,typeof n=="string"?n:e)},this):(r=this.data,t in r&&delete r[t])},get:function(e,t){var n=this.data[e];if(n)return n[t]},getAll:function(e,t){var n=this.data[e],r,i;if(t)i=n;else if(n){i={};for(r in n)n.hasOwnProperty(r)&&(i[r]=n[r])}return i}};var n=e.Object,r=e.Lang,i=".",s="getter",o="setter",u="readOnly",a="writeOnce",f="initOnly",l="validator",c="value",h="valueFn",p="lazyAdd",d="added",v="_bypassProxy",m="initializing",g="initValue",y="lazy",b="isLazyAdd",w;E.INVALID_VALUE={},w=E.INVALID_VALUE,E._ATTR_CFG=[o,s,l,c,h,a,u,p,v],E.protectAttrs=function(t){if(t){t=e.merge(t);for(var n in t)t.hasOwnProperty(n)&&(t[n]=e.merge(t[n]))}return t},E.prototype={_initAttrHost:function(t,n,r){this._state=new e.State,this._initAttrs(t,n,r)},addAttr:function(e,t,n){var r=this,i=r._state,s,o;t=t||{},n=p in t?t[p]:n;if(n&&!r.attrAdded(e))i.addAll(e,{lazy:t,added:!0});else if(!r.attrAdded(e)||i.get(e,b))o=c in t,o&&(s=t.value,delete t.value),t.added=!0,t.initializing=!0,i.addAll(e,t),o&&r.set(e,s),i.remove(e,m);return r},attrAdded:function(e){return!!this._state.get(e,d)},get:function(e){return this._getAttr(e)},_isLazyAttr:function(e){return this._state.get(e,y)},_addLazyAttr:function(e){var t=this._state,n=t.get(e,y);t.add(e,b,!0),t.remove(e,y),this.addAttr(e,n)},set:function(e,t,n){return this._setAttr(e,t,n)},_set:function(e,t,n){return this._setAttr(e,t,n,!0)},_setAttr:function(t,r,s,o){var u=!0,a=this._state,l=this._stateProxy,h,p,d,v,m,g,y;return t.indexOf(i)!==-1&&(d=t,v=t.split(i),t=v.shift()),this._isLazyAttr(t)&&this._addLazyAttr(t),h=a.getAll(t,!0)||{},p=!(c in h),l&&t in l&&!h._bypassProxy&&(p=!1),g=h.writeOnce,y=h.initializing,!p&&!o&&(g&&(u=!1),h.readOnly&&(u=!1)),!y&&!o&&g===f&&(u=!1),u&&(p||(m=this.get(t)),v&&(r=n.setValue(e.clone(m),v,r),r===undefined&&(u=!1)),u&&(s=s||{},!this._fireAttrChange||y?this._setAttrVal(t,d,m,r,s):this._fireAttrChange(t,d,m,r,s))),this},_getAttr:function(e){var t=this,r=e,o=t._state,u,a,f,l;return e.indexOf(i)!==-1&&(u=e.split(i),e=u.shift()),t._tCfgs&&t._tCfgs[e]&&(l={},l[e]=t._tCfgs[e],delete t._tCfgs[e],t._addAttrs(l,t._tVals)),t._isLazyAttr(e)&&t._addLazyAttr(e),f=t._getStateVal(e),a=o.get(e,s),a&&!a.call&&(a=this[a]),f=a?a.call(t,f,r):f,f=u?n.getValue(f,u):f,f},_getStateVal:function(e){var t=this._stateProxy;return t&&e in t&&!this._state.get(e,v)?t[e]:this._state.get(e,c)},_setStateVal:function(e,t){var n=this._stateProxy;n&&e in n&&!this._state.get(e,v)?n[e]=t:this._state.add(e,c,t)},_setAttrVal:function(e,t,n,i,s){var o=this,u=!0,a=this._state.getAll(e,!0)||{},f=a.validator,l=a.setter,c=a.initializing,h=this._getStateVal(e),p=t||e,d,v;return f&&(f.call||(f=this[f]),f&&(v=f.call(o,i,p,s),!v&&c&&(i=a.defaultValue,v=!0))),!f||v?(l&&(l.call||(l=this[l]),l&&(d=l.call(o,i,p,s),d===w?u=!1:d!==undefined&&(i=d))),u&&(!t&&i===h&&!r.isObject(i)?u=!1:(g in a||(a.initValue=i),o._setStateVal(e,i)))):u=!1,u},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},getAttrs:function(e){return this._getAttrs(e)},_getAttrs:function(e){var t={},r,i,s,o=e===!0;if(!e||o)e=n.keys(this._state.data);for(i=0,s=e.length;i<s;i++){r=e[i];if(!o||this._getStateVal(r)!=this._state.get(r,g))t[r]=this.get(r)}return t},addAttrs:function(e,t,n){var r=this;return e&&(r._tCfgs=e,r._tVals=r._normAttrVals(t),r._addAttrs(e,r._tVals,n),r._tCfgs=r._tVals=null),r},_addAttrs:function(e,t,n){var r=this,i,s,o;for(i in e)e.hasOwnProperty(i)&&(s=e[i],s.defaultValue=s.value,o=r._getAttrInitVal(i,s,r._tVals),o!==undefined&&(s.value=o),r._tCfgs[i]&&delete r._tCfgs[i],r.addAttr(i,s,n))},_protectAttrs:E.protectAttrs,_normAttrVals:function(e){var t={},n={},r,s,o,u;if(e){for(u in e)e.hasOwnProperty(u)&&(u.indexOf(i)!==-1?(r=u.split(i),s=r.shift(),o=n[s]=n[s]||[],o[o.length]={path:r,value:e[u]}):t[u]=e[u]);return{simple:t,complex:n}}return null},_getAttrInitVal:function(e,t,r){var i=t.value,s=t.valueFn,o,u=!1,a,f,l,c,h,p,d;!t.readOnly&&r&&(a=r.simple,a&&a.hasOwnProperty(e)&&(i=a[e],u=!0)),s&&!u&&(s.call||(s=this[s]),s&&(o=s.call(this,e),i=o));if(!t.readOnly&&r){f=r.complex;if(f&&f.hasOwnProperty(e)&&i!==undefined&&i!==null){d=f[e];for(l=0,c=d.length;l<c;++l)h=d[l].path,p=d[l].value,n.setValue(i,h,p)}}return i},_initAttrs:function(t,n,r){t=t||this.constructor.ATTRS;var i=e.Base,s=e.BaseCore,o=i&&e.instanceOf(this,i),u=!o&&s&&e.instanceOf(this,s);t&&!o&&!u&&this.addAttrs(e.AttributeCore.protectAttrs(t),n,r)}},e.AttributeCore=E},"@VERSION@",{requires:["oop"]});
View
81 build/attribute-core/attribute-core.js
@@ -216,8 +216,10 @@ YUI.add('attribute-core', function (Y, NAME) {
* 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 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) {
@@ -288,8 +290,10 @@ YUI.add('attribute-core', function (Y, NAME) {
* 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 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
*/
@@ -330,7 +334,8 @@ YUI.add('attribute-core', function (Y, NAME) {
* 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
+ * <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>
*
@@ -413,12 +418,13 @@ YUI.add('attribute-core', function (Y, NAME) {
added : true
});
} else {
-
+ /*jshint maxlen:200*/
if (!host.attrAdded(name) || state.get(name, IS_LAZY_ADD)) {
hasValue = (VALUE in config);
+ /*jshint maxlen:150*/
if (hasValue) {
// We'll go through set, don't want to set value in config directly
@@ -448,7 +454,8 @@ YUI.add('attribute-core', function (Y, NAME) {
*
* @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.
+ * @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);
@@ -490,7 +497,7 @@ YUI.add('attribute-core', function (Y, NAME) {
* @private
* @param {Object} name The name of the attribute
*/
- _addLazyAttr: function(name, cfg) {
+ _addLazyAttr: function(name) {
var state = this._state,
lazyCfg = state.get(name, LAZY);
@@ -508,13 +515,12 @@ YUI.add('attribute-core', function (Y, NAME) {
* @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) {
- return this._setAttr(name, val);
+ set : function(name, val, opts) {
+ return this._setAttr(name, val, opts);
},
/**
@@ -526,10 +532,11 @@ YUI.add('attribute-core', function (Y, NAME) {
*
* @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) {
- return this._setAttr(name, val, null, true);
+ _set : function(name, val, opts) {
+ return this._setAttr(name, val, opts, true);
},
/**
@@ -543,22 +550,13 @@ YUI.add('attribute-core', function (Y, NAME) {
*
* @param {String} name The name of the attribute.
* @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 is currently a hack. There's no real need for the AttributeCore implementation
- * to support this parameter, but breaking it out into AttributeObservable, results in
- * additional function hops for the critical path.
+ * @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) {
-
- // HACK - no real reason core needs to know about opts, but
- // it adds fn hops if we want to break it out.
- // Not sure it's worth it for this critical path
-
var allowSet = true,
state = this._state,
stateProxy = this._stateProxy,
@@ -622,8 +620,9 @@ YUI.add('attribute-core', function (Y, NAME) {
}
if (allowSet) {
+ opts = opts || {};
if (!this._fireAttrChange || initializing) {
- this._setAttrVal(name, strPath, currVal, val);
+ this._setAttrVal(name, strPath, currVal, val, opts);
} 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
@@ -731,10 +730,11 @@ YUI.add('attribute-core', function (Y, 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.
*
* @return {booolean} true if the new attribute value was stored, false if not.
*/
- _setAttrVal : function(attrName, subAttrName, prevVal, newVal) {
+ _setAttrVal : function(attrName, subAttrName, prevVal, newVal, opts) {
var host = this,
allowSet = true,
@@ -753,7 +753,7 @@ YUI.add('attribute-core', function (Y, NAME) {
validator = this[validator];
}
if (validator) {
- valid = validator.call(host, newVal, name);
+ valid = validator.call(host, newVal, name, opts);
if (!valid && initializing) {
newVal = cfg.defaultValue;
@@ -769,7 +769,7 @@ YUI.add('attribute-core', function (Y, NAME) {
setter = this[setter];
}
if (setter) {
- retVal = setter.call(host, newVal, name);
+ retVal = setter.call(host, newVal, name, opts);
if (retVal === INVALID_VALUE) {
allowSet = false;
@@ -803,11 +803,12 @@ YUI.add('attribute-core', function (Y, NAME) {
*
* @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) {
- return this._setAttrs(attrs);
+ setAttrs : function(attrs, opts) {
+ return this._setAttrs(attrs, opts);
},
/**
@@ -816,14 +817,15 @@ YUI.add('attribute-core', function (Y, NAME) {
* @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) {
+ _setAttrs : function(attrs, opts) {
var attr;
for (attr in attrs) {
if ( attrs.hasOwnProperty(attr) ) {
- this.set(attr, attrs[attr]);
+ this.set(attr, attrs[attr], opts);
}
}
return this;
@@ -965,9 +967,8 @@ YUI.add('attribute-core', function (Y, NAME) {
_protectAttrs : AttributeCore.protectAttrs,
/**
- * Utility method to split out simple attribute name/value pairs ("x")
- * from complex attribute name/value pairs ("x.y.z"), so that complex
- * attributes can be keyed by the top level attribute name.
+ * 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
@@ -1023,7 +1024,6 @@ YUI.add('attribute-core', function (Y, NAME) {
* @private
*/
_getAttrInitVal : function(attr, cfg, initValues) {
-
var val = cfg.value,
valFn = cfg.valueFn,
tmpVal,
@@ -1074,12 +1074,15 @@ YUI.add('attribute-core', function (Y, NAME) {
},
/**
- * Utility method to set up initial attributes defined during construction, either through the constructor.ATTRS property, or explicitly passed in.
+ * 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 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) {
View
53 build/attribute-extras/attribute-extras-coverage.js
@@ -26,9 +26,9 @@ _yuitest_coverage["build/attribute-extras/attribute-extras.js"] = {
path: "build/attribute-extras/attribute-extras.js",
code: []
};
-_yuitest_coverage["build/attribute-extras/attribute-extras.js"].code=["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: readOnly, writeOnce,"," * broadcast and getter."," * </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);"," }"," }"," }"," }",""," },",""," /**"," * 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.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;","","","}, '@VERSION@', {\"requires\": [\"oop\"]});"];
-_yuitest_coverage["build/attribute-extras/attribute-extras.js"].lines = {"1":0,"20":0,"38":0,"40":0,"55":0,"58":0,"60":0,"61":0,"64":0,"65":0,"66":0,"67":0,"70":0,"71":0,"86":0,"99":0,"101":0,"102":0,"103":0,"105":0,"107":0,"108":0,"111":0,"125":0,"128":0,"129":0,"131":0,"132":0,"133":0,"137":0,"141":0};
-_yuitest_coverage["build/attribute-extras/attribute-extras.js"].functions = {"AttributeExtras:38":0,"modifyAttr:54":0,"removeAttr:85":0,"(anonymous 2):107":0,"reset:98":0,"(anonymous 3):132":0,"_getAttrCfg:124":0,"(anonymous 1):1":0};
+_yuitest_coverage["build/attribute-extras/attribute-extras.js"].code=["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: readOnly, writeOnce,"," * broadcast and getter."," * </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);"," }"," }"," }"," }"," /*jshint maxlen:200*/"," /*jshint maxlen:150 */"," },",""," /**"," * 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.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;","","","}, '@VERSION@', {\"requires\": [\"oop\"]});"];
+_yuitest_coverage["build/attribute-extras/attribute-extras.js"].lines = {"1":0,"20":0,"38":0,"40":0,"55":0,"58":0,"60":0,"61":0,"64":0,"65":0,"66":0,"67":0,"70":0,"71":0,"87":0,"100":0,"102":0,"103":0,"104":0,"106":0,"108":0,"109":0,"112":0,"126":0,"129":0,"130":0,"132":0,"133":0,"134":0,"138":0,"142":0};
+_yuitest_coverage["build/attribute-extras/attribute-extras.js"].functions = {"AttributeExtras:38":0,"modifyAttr:54":0,"removeAttr:86":0,"(anonymous 2):108":0,"reset:99":0,"(anonymous 3):133":0,"_getAttrCfg:125":0,"(anonymous 1):1":0};
_yuitest_coverage["build/attribute-extras/attribute-extras.js"].coveredLines = 31;
_yuitest_coverage["build/attribute-extras/attribute-extras.js"].coveredFunctions = 8;
_yuitest_coverline("build/attribute-extras/attribute-extras.js", 1);
@@ -122,7 +122,8 @@ state.remove(name, PUBLISHED);
}
}
}
-
+ /*jshint maxlen:200*/
+ /*jshint maxlen:150 */
},
/**
@@ -132,8 +133,8 @@ state.remove(name, PUBLISHED);
* @param {String} name The name of the attribute to be removed.
*/
removeAttr: function(name) {
- _yuitest_coverfunc("build/attribute-extras/attribute-extras.js", "removeAttr", 85);
-_yuitest_coverline("build/attribute-extras/attribute-extras.js", 86);
+ _yuitest_coverfunc("build/attribute-extras/attribute-extras.js", "removeAttr", 86);
+_yuitest_coverline("build/attribute-extras/attribute-extras.js", 87);
this._state.removeAll(name);
},
@@ -147,28 +148,28 @@ this._state.removeAll(name);
* @chainable
*/
reset : function(name) {
- _yuitest_coverfunc("build/attribute-extras/attribute-extras.js", "reset", 98);
-_yuitest_coverline("build/attribute-extras/attribute-extras.js", 99);
+ _yuitest_coverfunc("build/attribute-extras/attribute-extras.js", "reset", 99);
+_yuitest_coverline("build/attribute-extras/attribute-extras.js", 100);
var host = this; // help compression
- _yuitest_coverline("build/attribute-extras/attribute-extras.js", 101);
+ _yuitest_coverline("build/attribute-extras/attribute-extras.js", 102);
if (name) {
- _yuitest_coverline("build/attribute-extras/attribute-extras.js", 102);
+ _yuitest_coverline("build/attribute-extras/attribute-extras.js", 103);
if (host._isLazyAttr(name)) {
- _yuitest_coverline("build/attribute-extras/attribute-extras.js", 103);
+ _yuitest_coverline("build/attribute-extras/attribute-extras.js", 104);
host._addLazyAttr(name);
}
- _yuitest_coverline("build/attribute-extras/attribute-extras.js", 105);
+ _yuitest_coverline("build/attribute-extras/attribute-extras.js", 106);
host.set(name, host._state.get(name, INIT_VALUE));
} else {
- _yuitest_coverline("build/attribute-extras/attribute-extras.js", 107);
+ _yuitest_coverline("build/attribute-extras/attribute-extras.js", 108);
Y.each(host._state.data, function(v, n) {
- _yuitest_coverfunc("build/attribute-extras/attribute-extras.js", "(anonymous 2)", 107);
-_yuitest_coverline("build/attribute-extras/attribute-extras.js", 108);
+ _yuitest_coverfunc("build/attribute-extras/attribute-extras.js", "(anonymous 2)", 108);
+_yuitest_coverline("build/attribute-extras/attribute-extras.js", 109);
host.reset(n);
});
}
- _yuitest_coverline("build/attribute-extras/attribute-extras.js", 111);
+ _yuitest_coverline("build/attribute-extras/attribute-extras.js", 112);
return host;
},
@@ -183,32 +184,32 @@ return host;
* @return {Object} The configuration properties for the given attribute, or all attributes.
*/
_getAttrCfg : function(name) {
- _yuitest_coverfunc("build/attribute-extras/attribute-extras.js", "_getAttrCfg", 124);
-_yuitest_coverline("build/attribute-extras/attribute-extras.js", 125);
+ _yuitest_coverfunc("build/attribute-extras/attribute-extras.js", "_getAttrCfg", 125);
+_yuitest_coverline("build/attribute-extras/attribute-extras.js", 126);
var o,
state = this._state;
- _yuitest_coverline("build/attribute-extras/attribute-extras.js", 128);
+ _yuitest_coverline("build/attribute-extras/attribute-extras.js", 129);
if (name) {
- _yuitest_coverline("build/attribute-extras/attribute-extras.js", 129);
+ _yuitest_coverline("build/attribute-extras/attribute-extras.js", 130);
o = state.getAll(name) || {};
} else {
- _yuitest_coverline("build/attribute-extras/attribute-extras.js", 131);
-o = {};
_yuitest_coverline("build/attribute-extras/attribute-extras.js", 132);
+o = {};
+ _yuitest_coverline("build/attribute-extras/attribute-extras.js", 133);
Y.each(state.data, function(v, n) {
- _yuitest_coverfunc("build/attribute-extras/attribute-extras.js", "(anonymous 3)", 132);
-_yuitest_coverline("build/attribute-extras/attribute-extras.js", 133);
+ _yuitest_coverfunc("build/attribute-extras/attribute-extras.js", "(anonymous 3)", 133);
+_yuitest_coverline("build/attribute-extras/attribute-extras.js", 134);
o[n] = state.getAll(n);
});
}
- _yuitest_coverline("build/attribute-extras/attribute-extras.js", 137);
+ _yuitest_coverline("build/attribute-extras/attribute-extras.js", 138);
return o;
}
};
- _yuitest_coverline("build/attribute-extras/attribute-extras.js", 141);
+ _yuitest_coverline("build/attribute-extras/attribute-extras.js", 142);
Y.AttributeExtras = AttributeExtras;
View
3  build/attribute-extras/attribute-extras-debug.js
@@ -73,8 +73,9 @@ YUI.add('attribute-extras', function (Y, NAME) {
}
}
}
-
+ /*jshint maxlen:200*/
if (!host.attrAdded(name)) {Y.log('Attribute modifyAttr:' + name + ' has not been added. Use addAttr to add the attribute', 'warn', 'attribute');}
+ /*jshint maxlen:150 */
},
/**
View
3  build/attribute-extras/attribute-extras.js
@@ -73,7 +73,8 @@ YUI.add('attribute-extras', function (Y, NAME) {
}
}
}
-
+ /*jshint maxlen:200*/
+ /*jshint maxlen:150 */
},
/**
View
18 build/attribute-observable/attribute-observable-coverage.js
@@ -26,8 +26,8 @@ _yuitest_coverage["build/attribute-observable/attribute-observable.js"] = {
path: "build/attribute-observable/attribute-observable.js",
code: []
};
-_yuitest_coverage["build/attribute-observable/attribute-observable.js"].code=["YUI.add('attribute-observable', 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-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\","," PUBLISHED = \"published\";",""," /**"," * 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."," */"," _fireAttrChange : function(attrName, subAttrName, currVal, newVal, opts) {"," var host = this,"," eventName = attrName + CHANGE,"," state = host._state,"," facade,"," broadcast,"," evtCfg;",""," if (!state.get(attrName, PUBLISHED)) {",""," evtCfg = {"," queuable:false,"," defaultTargetOnly: true,"," defaultFn:host._defAttrChangeFn,"," silent:true"," };",""," broadcast = state.get(attrName, BROADCAST);"," if (broadcast !== undefined) {"," evtCfg.broadcast = broadcast;"," }",""," host.publish(eventName, evtCfg);",""," state.add(attrName, PUBLISHED, true);"," }",""," facade = (opts) ? Y.merge(opts) : 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.type = eventName;"," facade.attrName = attrName;"," facade.subAttrName = subAttrName;"," facade.prevVal = currVal;"," facade.newVal = newVal;",""," // host.fire(facade);"," host.fire(eventName, facade);"," },",""," /**"," * Default function for attribute change events."," *"," * @private"," * @method _defAttrChangeFn"," * @param {EventFacade} e The event object for attribute change events."," */"," _defAttrChangeFn : function(e) {"," if (!this._setAttrVal(e.attrName, e.subAttrName, e.prevVal, e.newVal)) {"," // Prevent \"after\" listeners from being invoked since nothing changed."," e.stopImmediatePropagation();"," } else {"," 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;","","","}, '@VERSION@', {\"requires\": [\"event-custom\"]});"];
-_yuitest_coverage["build/attribute-observable/attribute-observable.js"].lines = {"1":0,"20":0,"34":0,"36":0,"38":0,"41":0,"43":0,"66":0,"83":0,"96":0,"110":0,"111":0,"112":0,"113":0,"116":0,"132":0,"139":0,"141":0,"148":0,"149":0,"150":0,"153":0,"155":0,"158":0,"164":0,"165":0,"166":0,"167":0,"170":0,"181":0,"183":0,"185":0,"191":0,"193":0,"205":0};
+_yuitest_coverage["build/attribute-observable/attribute-observable.js"].code=["YUI.add('attribute-observable', 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-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\","," PUBLISHED = \"published\";",""," /**"," * 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."," */"," _fireAttrChange : function(attrName, subAttrName, currVal, newVal, opts) {"," var host = this,"," eventName = attrName + CHANGE,"," state = host._state,"," facade,"," broadcast,"," evtCfg;",""," if (!state.get(attrName, PUBLISHED)) {",""," evtCfg = {"," queuable:false,"," defaultTargetOnly: true,"," defaultFn:host._defAttrChangeFn,"," silent:true"," };",""," broadcast = state.get(attrName, BROADCAST);"," if (broadcast !== undefined) {"," evtCfg.broadcast = broadcast;"," }",""," host.publish(eventName, evtCfg);",""," state.add(attrName, PUBLISHED, true);"," }",""," facade = (opts) ? Y.merge(opts) : 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.type = eventName;"," facade.attrName = attrName;"," facade.subAttrName = subAttrName;"," facade.prevVal = currVal;"," facade.newVal = newVal;",""," // host.fire(facade);"," host.fire(eventName, facade);"," },",""," /**"," * Default function for attribute change events."," *"," * @private"," * @method _defAttrChangeFn"," * @param {EventFacade} e The event object for attribute change events."," */"," _defAttrChangeFn : function(e) {"," if (!this._setAttrVal(e.attrName, e.subAttrName, e.prevVal, e.newVal, e.opts)) {"," /*jshint maxlen:200*/"," /*jshint maxlen:150*/"," // Prevent \"after\" listeners from being invoked since nothing changed."," e.stopImmediatePropagation();"," } else {"," 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;","","","}, '@VERSION@', {\"requires\": [\"event-custom\"]});"];
+_yuitest_coverage["build/attribute-observable/attribute-observable.js"].lines = {"1":0,"20":0,"34":0,"36":0,"38":0,"41":0,"43":0,"66":0,"83":0,"96":0,"110":0,"111":0,"112":0,"113":0,"116":0,"132":0,"139":0,"141":0,"148":0,"149":0,"150":0,"153":0,"155":0,"158":0,"164":0,"165":0,"166":0,"167":0,"170":0,"181":0,"185":0,"187":0,"193":0,"195":0,"207":0};
_yuitest_coverage["build/attribute-observable/attribute-observable.js"].functions = {"AttributeObservable:34":0,"set:65":0,"_set:82":0,"setAttrs:95":0,"_setAttrs:109":0,"_fireAttrChange:131":0,"_defAttrChangeFn:180":0,"(anonymous 1):1":0};
_yuitest_coverage["build/attribute-observable/attribute-observable.js"].coveredLines = 35;
_yuitest_coverage["build/attribute-observable/attribute-observable.js"].coveredFunctions = 8;
@@ -249,22 +249,24 @@ host.fire(eventName, facade);
_defAttrChangeFn : function(e) {
_yuitest_coverfunc("build/attribute-observable/attribute-observable.js", "_defAttrChangeFn", 180);
_yuitest_coverline("build/attribute-observable/attribute-observable.js", 181);
-if (!this._setAttrVal(e.attrName, e.subAttrName, e.prevVal, e.newVal)) {
+if (!this._setAttrVal(e.attrName, e.subAttrName, e.prevVal, e.newVal, e.opts)) {
+ /*jshint maxlen:200*/
+ /*jshint maxlen:150*/
// Prevent "after" listeners from being invoked since nothing changed.
- _yuitest_coverline("build/attribute-observable/attribute-observable.js", 183);
+ _yuitest_coverline("build/attribute-observable/attribute-observable.js", 185);
e.stopImmediatePropagation();
} else {
- _yuitest_coverline("build/attribute-observable/attribute-observable.js", 185);
+ _yuitest_coverline("build/attribute-observable/attribute-observable.js", 187);
e.newVal = this.get(e.attrName);
}
}
};
// Basic prototype augment - no lazy constructor invocation.
- _yuitest_coverline("build/attribute-observable/attribute-observable.js", 191);
+ _yuitest_coverline("build/attribute-observable/attribute-observable.js", 193);
Y.mix(AttributeObservable, EventTarget, false, null, 1);
- _yuitest_coverline("build/attribute-observable/attribute-observable.js", 193);
+ _yuitest_coverline("build/attribute-observable/attribute-observable.js", 195);
Y.AttributeObservable = AttributeObservable;
/**
@@ -277,7 +279,7 @@ Y.AttributeObservable = AttributeObservable;
@deprecated Use `AttributeObservable` instead.
@see AttributeObservable
**/
- _yuitest_coverline("build/attribute-observable/attribute-observable.js", 205);
+ _yuitest_coverline("build/attribute-observable/attribute-observable.js", 207);
Y.AttributeEvents = AttributeObservable;
View
4 build/attribute-observable/attribute-observable-debug.js
@@ -178,8 +178,10 @@ YUI.add('attribute-observable', function (Y, NAME) {
* @param {EventFacade} e The event object for attribute change events.
*/
_defAttrChangeFn : function(e) {
- if (!this._setAttrVal(e.attrName, e.subAttrName, e.prevVal, e.newVal)) {
+ if (!this._setAttrVal(e.attrName, e.subAttrName, e.prevVal, e.newVal, e.opts)) {
+ /*jshint maxlen:200*/
Y.log('State not updated and stopImmediatePropagation called for attribute: ' + e.attrName + ' , value:' + e.newVal, 'warn', 'attribute');
+ /*jshint maxlen:150*/
// Prevent "after" listeners from being invoked since nothing changed.
e.stopImmediatePropagation();
} else {
View
2  build/attribute-observable/attribute-observable-min.js
@@ -1 +1 @@
-YUI.add("attribute-observable",function(e,t){function o(){this._ATTR_E_FACADE={},n.call(this,{emitFacade:!0})}var n=e.EventTarget,r="Change",i="broadcast",s="published";o._ATTR_CFG=[i],o.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,o,u,a){var f=this,l=t+r,c=f._state,h,p,d;c.get(t,s)||(d={queuable:!1,defaultTargetOnly:!0,defaultFn:f._defAttrChangeFn,silent:!0},p=c.get(t,i),p!==undefined&&(d.broadcast=p),f.publish(l,d),c.add(t,s,!0)),h=a?e.merge(a):f._ATTR_E_FACADE,h.attrName=t,h.subAttrName=n,h.prevVal=o,h.newVal=u,f.fire(l,h)},_defAttrChangeFn:function(e){this._setAttrVal(e.attrName,e.subAttrName,e.prevVal,e.newVal)?e.newVal=this.get(e.attrName):e.stopImmediatePropagation()}},e.mix(o,n,!1,null,1),e.AttributeObservable=o,e.AttributeEvents=o},"@VERSION@",{requires:["event-custom"]});
+YUI.add("attribute-observable",function(e,t){function o(){this._ATTR_E_FACADE={},n.call(this,{emitFacade:!0})}var n=e.EventTarget,r="Change",i="broadcast",s="published";o._ATTR_CFG=[i],o.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,o,u,a){var f=this,l=t+r,c=f._state,h,p,d;c.get(t,s)||(d={queuable:!1,defaultTargetOnly:!0,defaultFn:f._defAttrChangeFn,silent:!0},p=c.get(t,i),p!==undefined&&(d.broadcast=p),f.publish(l,d),c.add(t,s,!0)),h=a?e.merge(a):f._ATTR_E_FACADE,h.attrName=t,h.subAttrName=n,h.prevVal=o,h.newVal=u,f.fire(l,h)},_defAttrChangeFn:function(e){this._setAttrVal(e.attrName,e.subAttrName,e.prevVal,e.newVal,e.opts)?e.newVal=this.get(e.attrName):e.stopImmediatePropagation()}},e.mix(o,n,!1,null,1),e.AttributeObservable=o,e.AttributeEvents=o},"@VERSION@",{requires:["event-custom"]});
View
4 build/attribute-observable/attribute-observable.js
@@ -178,7 +178,9 @@ YUI.add('attribute-observable', function (Y, NAME) {
* @param {EventFacade} e The event object for attribute change events.
*/
_defAttrChangeFn : function(e) {
- if (!this._setAttrVal(e.attrName, e.subAttrName, e.prevVal, e.newVal)) {
+ if (!this._setAttrVal(e.attrName, e.subAttrName, e.prevVal, e.newVal, e.opts)) {
+ /*jshint maxlen:200*/
+ /*jshint maxlen:150*/
// Prevent "after" listeners from being invoked since nothing changed.
e.stopImmediatePropagation();
} else {
View
4 build/features/features-coverage.js
@@ -26,7 +26,7 @@ _yuitest_coverage["build/features/features.js"] = {
path: "build/features/features.js",
code: []
};
-_yuitest_coverage["build/features/features.js"].code=["YUI.add('features', function (Y, NAME) {","","var feature_tests = {};","","/**","Contains the core of YUI's feature test architecture.","@module features","*/","","/**","* Feature detection","* @class Features","* @static","*/","","Y.mix(Y.namespace('Features'), {"," "," /**"," * Object hash of all registered feature tests"," * @property tests"," * @type Object"," */"," tests: feature_tests,"," "," /**"," * Add a test to the system"," * "," * ```"," * Y.Features.add(\"load\", \"1\", {});"," * ```"," * "," * @method add"," * @param {String} cat The category, right now only 'load' is supported"," * @param {String} name The number sequence of the test, how it's reported in the URL or config: 1, 2, 3"," * @param {Object} o Object containing test properties"," * @param {String} o.name The name of the test"," * @param {Function} o.test The test function to execute, the only argument to the function is the `Y` instance"," * @param {String} o.trigger The module that triggers this test."," */"," add: function(cat, name, o) {"," feature_tests[cat] = feature_tests[cat] || {};"," feature_tests[cat][name] = o;"," },"," /**"," * Execute all tests of a given category and return the serialized results"," *"," * ```"," * caps=1:1;2:1;3:0"," * ```"," * @method all"," * @param {String} cat The category to execute"," * @param {Array} args The arguments to pass to the test function"," * @return {String} A semi-colon separated string of tests and their success/failure: 1:1;2:1;3:0"," */"," all: function(cat, args) {"," var cat_o = feature_tests[cat],"," // results = {};"," result = [];"," if (cat_o) {"," Y.Object.each(cat_o, function(v, k) {"," result.push(k + ':' + (Y.Features.test(cat, k, args) ? 1 : 0));"," });"," }",""," return (result.length) ? result.join(';') : '';"," },"," /**"," * Run a sepecific test and return a Boolean response."," *"," * ```"," * Y.Features.test(\"load\", \"1\");"," * ```"," *"," * @method test"," * @param {String} cat The category of the test to run"," * @param {String} name The name of the test to run"," * @param {Array} args The arguments to pass to the test function"," * @return {Boolean} True or false if the test passed/failed."," */"," test: function(cat, name, args) {"," args = args || [];"," var result, ua, test,"," cat_o = feature_tests[cat],"," feature = cat_o && cat_o[name];",""," if (!feature) {"," } else {",""," result = feature.result;",""," if (Y.Lang.isUndefined(result)) {",""," ua = feature.ua;"," if (ua) {"," result = (Y.UA[ua]);"," }",""," test = feature.test;"," if (test && ((!ua) || result)) {"," result = test.apply(Y, args);"," }",""," feature.result = result;"," }"," }",""," return result;"," }","});","","// Y.Features.add(\"load\", \"1\", {});","// Y.Features.test(\"load\", \"1\");","// caps=1:1;2:0;3:1;","","/* This file is auto-generated by src/loader/scripts/meta_join.js */","var add = Y.Features.add;","// app-transitions-native","add('load', '0', {"," \"name\": \"app-transitions-native\","," \"test\": function (Y) {"," var doc = Y.config.doc,"," node = doc ? doc.documentElement : null;",""," if (node && node.style) {"," return ('MozTransition' in node.style || 'WebkitTransition' in node.style || 'transition' in node.style);"," }",""," return false;","},"," \"trigger\": \"app-transitions\"","});","// autocomplete-list-keys","add('load', '1', {"," \"name\": \"autocomplete-list-keys\","," \"test\": function (Y) {"," // Only add keyboard support to autocomplete-list if this doesn't appear to"," // be an iOS or Android-based mobile device."," //"," // There's currently no feasible way to actually detect whether a device has"," // a hardware keyboard, so this sniff will have to do. It can easily be"," // overridden by manually loading the autocomplete-list-keys module."," //"," // Worth noting: even though iOS supports bluetooth keyboards, Mobile Safari"," // doesn't fire the keyboard events used by AutoCompleteList, so there's"," // no point loading the -keys module even when a bluetooth keyboard may be"," // available."," return !(Y.UA.ios || Y.UA.android);","},"," \"trigger\": \"autocomplete-list\"","});","// dd-gestures","add('load', '2', {"," \"name\": \"dd-gestures\","," \"trigger\": \"dd-drag\","," \"ua\": \"touchEnabled\"","});","// dom-style-ie","add('load', '3', {"," \"name\": \"dom-style-ie\","," \"test\": function (Y) {",""," var testFeature = Y.Features.test,"," addFeature = Y.Features.add,"," WINDOW = Y.config.win,"," DOCUMENT = Y.config.doc,"," DOCUMENT_ELEMENT = 'documentElement',"," ret = false;",""," addFeature('style', 'computedStyle', {"," test: function() {"," return WINDOW && 'getComputedStyle' in WINDOW;"," }"," });",""," addFeature('style', 'opacity', {"," test: function() {"," return DOCUMENT && 'opacity' in DOCUMENT[DOCUMENT_ELEMENT].style;"," }"," });",""," ret = (!testFeature('style', 'opacity') &&"," !testFeature('style', 'computedStyle'));",""," return ret;","},"," \"trigger\": \"dom-style\"","});","// editor-para-ie","add('load', '4', {"," \"name\": \"editor-para-ie\","," \"trigger\": \"editor-para\","," \"ua\": \"ie\","," \"when\": \"instead\"","});","// event-base-ie","add('load', '5', {"," \"name\": \"event-base-ie\","," \"test\": function(Y) {"," var imp = Y.config.doc && Y.config.doc.implementation;"," return (imp && (!imp.hasFeature('Events', '2.0')));","},"," \"trigger\": \"node-base\"","});","// graphics-canvas","add('load', '6', {"," \"name\": \"graphics-canvas\","," \"test\": function(Y) {"," var DOCUMENT = Y.config.doc,"," useCanvas = Y.config.defaultGraphicEngine && Y.config.defaultGraphicEngine == \"canvas\","," canvas = DOCUMENT && DOCUMENT.createElement(\"canvas\"),"," svg = (DOCUMENT && DOCUMENT.implementation.hasFeature(\"http://www.w3.org/TR/SVG11/feature#BasicStructure\", \"1.1\"));"," return (!svg || useCanvas) && (canvas && canvas.getContext && canvas.getContext(\"2d\"));","},"," \"trigger\": \"graphics\"","});","// graphics-canvas-default","add('load', '7', {"," \"name\": \"graphics-canvas-default\","," \"test\": function(Y) {"," var DOCUMENT = Y.config.doc,"," useCanvas = Y.config.defaultGraphicEngine && Y.config.defaultGraphicEngine == \"canvas\","," canvas = DOCUMENT && DOCUMENT.createElement(\"canvas\"),"," svg = (DOCUMENT && DOCUMENT.implementation.hasFeature(\"http://www.w3.org/TR/SVG11/feature#BasicStructure\", \"1.1\"));"," return (!svg || useCanvas) && (canvas && canvas.getContext && canvas.getContext(\"2d\"));","},"," \"trigger\": \"graphics\"","});","// graphics-svg","add('load', '8', {"," \"name\": \"graphics-svg\","," \"test\": function(Y) {"," var DOCUMENT = Y.config.doc,"," useSVG = !Y.config.defaultGraphicEngine || Y.config.defaultGraphicEngine != \"canvas\","," canvas = DOCUMENT && DOCUMENT.createElement(\"canvas\"),"," svg = (DOCUMENT && DOCUMENT.implementation.hasFeature(\"http://www.w3.org/TR/SVG11/feature#BasicStructure\", \"1.1\"));"," "," return svg && (useSVG || !canvas);","},"," \"trigger\": \"graphics\"","});","// graphics-svg-default","add('load', '9', {"," \"name\": \"graphics-svg-default\","," \"test\": function(Y) {"," var DOCUMENT = Y.config.doc,"," useSVG = !Y.config.defaultGraphicEngine || Y.config.defaultGraphicEngine != \"canvas\","," canvas = DOCUMENT && DOCUMENT.createElement(\"canvas\"),"," svg = (DOCUMENT && DOCUMENT.implementation.hasFeature(\"http://www.w3.org/TR/SVG11/feature#BasicStructure\", \"1.1\"));"," "," return svg && (useSVG || !canvas);","},"," \"trigger\": \"graphics\"","});","// graphics-vml","add('load', '10', {"," \"name\": \"graphics-vml\","," \"test\": function(Y) {"," var DOCUMENT = Y.config.doc,"," canvas = DOCUMENT && DOCUMENT.createElement(\"canvas\");"," return (DOCUMENT && !DOCUMENT.implementation.hasFeature(\"http://www.w3.org/TR/SVG11/feature#BasicStructure\", \"1.1\") && (!canvas || !canvas.getContext || !canvas.getContext(\"2d\")));","},"," \"trigger\": \"graphics\"","});","// graphics-vml-default","add('load', '11', {"," \"name\": \"graphics-vml-default\","," \"test\": function(Y) {"," var DOCUMENT = Y.config.doc,"," canvas = DOCUMENT && DOCUMENT.createElement(\"canvas\");"," return (DOCUMENT && !DOCUMENT.implementation.hasFeature(\"http://www.w3.org/TR/SVG11/feature#BasicStructure\", \"1.1\") && (!canvas || !canvas.getContext || !canvas.getContext(\"2d\")));","},"," \"trigger\": \"graphics\"","});","// history-hash-ie","add('load', '12', {"," \"name\": \"history-hash-ie\","," \"test\": function (Y) {"," var docMode = Y.config.doc && Y.config.doc.documentMode;",""," return Y.UA.ie && (!('onhashchange' in Y.config.win) ||"," !docMode || docMode < 8);","},"," \"trigger\": \"history-hash\"","});","// io-nodejs","add('load', '13', {"," \"name\": \"io-nodejs\","," \"trigger\": \"io-base\","," \"ua\": \"nodejs\"","});","// json-parse-shim","add('load', '14', {"," \"name\": \"json-parse-shim\","," \"test\": function (Y) {"," var _JSON = Y.config.global.JSON,"," Native = Object.prototype.toString.call(_JSON) === '[object JSON]' && _JSON,"," nativeSupport = Y.config.useNativeJSONParse !== false && !!Native;",""," function workingNative( k, v ) {"," return k === \"ok\" ? true : v;"," }"," "," // Double check basic functionality. This is mainly to catch early broken"," // implementations of the JSON API in Firefox 3.1 beta1 and beta2"," if ( nativeSupport ) {"," try {"," nativeSupport = ( Native.parse( '{\"ok\":false}', workingNative ) ).ok;"," }"," catch ( e ) {"," nativeSupport = false;"," }"," }",""," return !nativeSupport;","},"," \"trigger\": \"json-parse\"","});","// json-stringify-shim","add('load', '15', {"," \"name\": \"json-stringify-shim\","," \"test\": function (Y) {"," var _JSON = Y.config.global.JSON,"," Native = Object.prototype.toString.call(_JSON) === '[object JSON]' && _JSON,"," nativeSupport = Y.config.useNativeJSONStringify !== false && !!Native;",""," // Double check basic native functionality. This is primarily to catch broken"," // early JSON API implementations in Firefox 3.1 beta1 and beta2."," if ( nativeSupport ) {"," try {"," nativeSupport = ( '0' === Native.stringify(0) );"," } catch ( e ) {"," nativeSupport = false;"," }"," }","",""," return !nativeSupport;","},"," \"trigger\": \"json-stringify\"","});","// scrollview-base-ie","add('load', '16', {"," \"name\": \"scrollview-base-ie\","," \"trigger\": \"scrollview-base\","," \"ua\": \"ie\"","});","// selector-css2","add('load', '17', {"," \"name\": \"selector-css2\","," \"test\": function (Y) {"," var DOCUMENT = Y.config.doc,"," ret = DOCUMENT && !('querySelectorAll' in DOCUMENT);",""," return ret;","},"," \"trigger\": \"selector\"","});","// transition-timer","add('load', '18', {"," \"name\": \"transition-timer\","," \"test\": function (Y) {"," var DOCUMENT = Y.config.doc,"," node = (DOCUMENT) ? DOCUMENT.documentElement: null,"," ret = true;",""," if (node && node.style) {"," ret = !('MozTransition' in node.style || 'WebkitTransition' in node.style || 'transition' in node.style);"," }",""," return ret;","},"," \"trigger\": \"transition\"","});","// widget-base-ie","add('load', '19', {"," \"name\": \"widget-base-ie\","," \"trigger\": \"widget-base\","," \"ua\": \"ie\"","});","// yql-nodejs","add('load', '20', {"," \"name\": \"yql-nodejs\","," \"trigger\": \"yql\","," \"ua\": \"nodejs\","," \"when\": \"after\"","});","// yql-winjs","add('load', '21', {"," \"name\": \"yql-winjs\","," \"trigger\": \"yql\","," \"ua\": \"winjs\","," \"when\": \"after\"","});","","}, '@VERSION@', {\"requires\": [\"yui-base\"]});"];
+_yuitest_coverage["build/features/features.js"].code=["YUI.add('features', function (Y, NAME) {","","var feature_tests = {};","","/**","Contains the core of YUI's feature test architecture.","@module features","*/","","/**","* Feature detection","* @class Features","* @static","*/","","Y.mix(Y.namespace('Features'), {"," "," /**"," * Object hash of all registered feature tests"," * @property tests"," * @type Object"," */"," tests: feature_tests,"," "," /**"," * Add a test to the system"," * "," * ```"," * Y.Features.add(\"load\", \"1\", {});"," * ```"," * "," * @method add"," * @param {String} cat The category, right now only 'load' is supported"," * @param {String} name The number sequence of the test, how it's reported in the URL or config: 1, 2, 3"," * @param {Object} o Object containing test properties"," * @param {String} o.name The name of the test"," * @param {Function} o.test The test function to execute, the only argument to the function is the `Y` instance"," * @param {String} o.trigger The module that triggers this test."," */"," add: function(cat, name, o) {"," feature_tests[cat] = feature_tests[cat] || {};"," feature_tests[cat][name] = o;"," },"," /**"," * Execute all tests of a given category and return the serialized results"," *"," * ```"," * caps=1:1;2:1;3:0"," * ```"," * @method all"," * @param {String} cat The category to execute"," * @param {Array} args The arguments to pass to the test function"," * @return {String} A semi-colon separated string of tests and their success/failure: 1:1;2:1;3:0"," */"," all: function(cat, args) {"," var cat_o = feature_tests[cat],"," // results = {};"," result = [];"," if (cat_o) {"," Y.Object.each(cat_o, function(v, k) {"," result.push(k + ':' + (Y.Features.test(cat, k, args) ? 1 : 0));"," });"," }",""," return (result.length) ? result.join(';') : '';"," },"," /**"," * Run a sepecific test and return a Boolean response."," *"," * ```"," * Y.Features.test(\"load\", \"1\");"," * ```"," *"," * @method test"," * @param {String} cat The category of the test to run"," * @param {String} name The name of the test to run"," * @param {Array} args The arguments to pass to the test function"," * @return {Boolean} True or false if the test passed/failed."," */"," test: function(cat, name, args) {"," args = args || [];"," var result, ua, test,"," cat_o = feature_tests[cat],"," feature = cat_o && cat_o[name];",""," if (!feature) {"," } else {",""," result = feature.result;",""," if (Y.Lang.isUndefined(result)) {",""," ua = feature.ua;"," if (ua) {"," result = (Y.UA[ua]);"," }",""," test = feature.test;"," if (test && ((!ua) || result)) {"," result = test.apply(Y, args);"," }",""," feature.result = result;"," }"," }",""," return result;"," }","});","","// Y.Features.add(\"load\", \"1\", {});","// Y.Features.test(\"load\", \"1\");","// caps=1:1;2:0;3:1;","","/* This file is auto-generated by (yogi loader --yes --mix --start ../) */","var add = Y.Features.add;","// app-transitions-native","add('load', '0', {"," \"name\": \"app-transitions-native\","," \"test\": function (Y) {"," var doc = Y.config.doc,"," node = doc ? doc.documentElement : null;",""," if (node && node.style) {"," return ('MozTransition' in node.style || 'WebkitTransition' in node.style || 'transition' in node.style);"," }",""," return false;","},"," \"trigger\": \"app-transitions\"","});","// autocomplete-list-keys","add('load', '1', {"," \"name\": \"autocomplete-list-keys\","," \"test\": function (Y) {"," // Only add keyboard support to autocomplete-list if this doesn't appear to"," // be an iOS or Android-based mobile device."," //"," // There's currently no feasible way to actually detect whether a device has"," // a hardware keyboard, so this sniff will have to do. It can easily be"," // overridden by manually loading the autocomplete-list-keys module."," //"," // Worth noting: even though iOS supports bluetooth keyboards, Mobile Safari"," // doesn't fire the keyboard events used by AutoCompleteList, so there's"," // no point loading the -keys module even when a bluetooth keyboard may be"," // available."," return !(Y.UA.ios || Y.UA.android);","},"," \"trigger\": \"autocomplete-list\"","});","// dd-gestures","add('load', '2', {"," \"name\": \"dd-gestures\","," \"trigger\": \"dd-drag\","," \"ua\": \"touchEnabled\"","});","// dom-style-ie","add('load', '3', {"," \"name\": \"dom-style-ie\","," \"test\": function (Y) {",""," var testFeature = Y.Features.test,"," addFeature = Y.Features.add,"," WINDOW = Y.config.win,"," DOCUMENT = Y.config.doc,"," DOCUMENT_ELEMENT = 'documentElement',"," ret = false;",""," addFeature('style', 'computedStyle', {"," test: function() {"," return WINDOW && 'getComputedStyle' in WINDOW;"," }"," });",""," addFeature('style', 'opacity', {"," test: function() {"," return DOCUMENT && 'opacity' in DOCUMENT[DOCUMENT_ELEMENT].style;"," }"," });",""," ret = (!testFeature('style', 'opacity') &&"," !testFeature('style', 'computedStyle'));",""," return ret;","},"," \"trigger\": \"dom-style\"","});","// editor-para-ie","add('load', '4', {"," \"name\": \"editor-para-ie\","," \"trigger\": \"editor-para\","," \"ua\": \"ie\","," \"when\": \"instead\"","});","// event-base-ie","add('load', '5', {"," \"name\": \"event-base-ie\","," \"test\": function(Y) {"," var imp = Y.config.doc && Y.config.doc.implementation;"," return (imp && (!imp.hasFeature('Events', '2.0')));","},"," \"trigger\": \"node-base\"","});","// graphics-canvas","add('load', '6', {"," \"name\": \"graphics-canvas\","," \"test\": function(Y) {"," var DOCUMENT = Y.config.doc,"," useCanvas = Y.config.defaultGraphicEngine && Y.config.defaultGraphicEngine == \"canvas\","," canvas = DOCUMENT && DOCUMENT.createElement(\"canvas\"),"," svg = (DOCUMENT && DOCUMENT.implementation.hasFeature(\"http://www.w3.org/TR/SVG11/feature#BasicStructure\", \"1.1\"));"," return (!svg || useCanvas) && (canvas && canvas.getContext && canvas.getContext(\"2d\"));","},"," \"trigger\": \"graphics\"","});","// graphics-canvas-default","add('load', '7', {"," \"name\": \"graphics-canvas-default\","," \"test\": function(Y) {"," var DOCUMENT = Y.config.doc,"," useCanvas = Y.config.defaultGraphicEngine && Y.config.defaultGraphicEngine == \"canvas\","," canvas = DOCUMENT && DOCUMENT.createElement(\"canvas\"),"," svg = (DOCUMENT && DOCUMENT.implementation.hasFeature(\"http://www.w3.org/TR/SVG11/feature#BasicStructure\", \"1.1\"));"," return (!svg || useCanvas) && (canvas && canvas.getContext && canvas.getContext(\"2d\"));","},"," \"trigger\": \"graphics\"","});","// graphics-svg","add('load', '8', {"," \"name\": \"graphics-svg\","," \"test\": function(Y) {"," var DOCUMENT = Y.config.doc,"," useSVG = !Y.config.defaultGraphicEngine || Y.config.defaultGraphicEngine != \"canvas\","," canvas = DOCUMENT && DOCUMENT.createElement(\"canvas\"),"," svg = (DOCUMENT && DOCUMENT.implementation.hasFeature(\"http://www.w3.org/TR/SVG11/feature#BasicStructure\", \"1.1\"));"," "," return svg && (useSVG || !canvas);","},"," \"trigger\": \"graphics\"","});","// graphics-svg-default","add('load', '9', {"," \"name\": \"graphics-svg-default\","," \"test\": function(Y) {"," var DOCUMENT = Y.config.doc,"," useSVG = !Y.config.defaultGraphicEngine || Y.config.defaultGraphicEngine != \"canvas\","," canvas = DOCUMENT && DOCUMENT.createElement(\"canvas\"),"," svg = (DOCUMENT && DOCUMENT.implementation.hasFeature(\"http://www.w3.org/TR/SVG11/feature#BasicStructure\", \"1.1\"));"," "," return svg && (useSVG || !canvas);","},"," \"trigger\": \"graphics\"","});","// graphics-vml","add('load', '10', {"," \"name\": \"graphics-vml\","," \"test\": function(Y) {"," var DOCUMENT = Y.config.doc,"," canvas = DOCUMENT && DOCUMENT.createElement(\"canvas\");"," return (DOCUMENT && !DOCUMENT.implementation.hasFeature(\"http://www.w3.org/TR/SVG11/feature#BasicStructure\", \"1.1\") && (!canvas || !canvas.getContext || !canvas.getContext(\"2d\")));","},"," \"trigger\": \"graphics\"","});","// graphics-vml-default","add('load', '11', {"," \"name\": \"graphics-vml-default\","," \"test\": function(Y) {"," var DOCUMENT = Y.config.doc,"," canvas = DOCUMENT && DOCUMENT.createElement(\"canvas\");"," return (DOCUMENT && !DOCUMENT.implementation.hasFeature(\"http://www.w3.org/TR/SVG11/feature#BasicStructure\", \"1.1\") && (!canvas || !canvas.getContext || !canvas.getContext(\"2d\")));","},"," \"trigger\": \"graphics\"","});","// history-hash-ie","add('load', '12', {"," \"name\": \"history-hash-ie\","," \"test\": function (Y) {"," var docMode = Y.config.doc && Y.config.doc.documentMode;",""," return Y.UA.ie && (!('onhashchange' in Y.config.win) ||"," !docMode || docMode < 8);","},"," \"trigger\": \"history-hash\"","});","// io-nodejs","add('load', '13', {"," \"name\": \"io-nodejs\","," \"trigger\": \"io-base\","," \"ua\": \"nodejs\"","});","// json-parse-shim","add('load', '14', {"," \"name\": \"json-parse-shim\","," \"test\": function (Y) {"," var _JSON = Y.config.global.JSON,"," Native = Object.prototype.toString.call(_JSON) === '[object JSON]' && _JSON,"," nativeSupport = Y.config.useNativeJSONParse !== false && !!Native;",""," function workingNative( k, v ) {"," return k === \"ok\" ? true : v;"," }"," "," // Double check basic functionality. This is mainly to catch early broken"," // implementations of the JSON API in Firefox 3.1 beta1 and beta2"," if ( nativeSupport ) {"," try {"," nativeSupport = ( Native.parse( '{\"ok\":false}', workingNative ) ).ok;"," }"," catch ( e ) {"," nativeSupport = false;"," }"," }",""," return !nativeSupport;","},"," \"trigger\": \"json-parse\"","});","// json-stringify-shim","add('load', '15', {"," \"name\": \"json-stringify-shim\","," \"test\": function (Y) {"," var _JSON = Y.config.global.JSON,"," Native = Object.prototype.toString.call(_JSON) === '[object JSON]' && _JSON,"," nativeSupport = Y.config.useNativeJSONStringify !== false && !!Native;",""," // Double check basic native functionality. This is primarily to catch broken"," // early JSON API implementations in Firefox 3.1 beta1 and beta2."," if ( nativeSupport ) {"," try {"," nativeSupport = ( '0' === Native.stringify(0) );"," } catch ( e ) {"," nativeSupport = false;"," }"," }","",""," return !nativeSupport;","},"," \"trigger\": \"json-stringify\"","});","// scrollview-base-ie","add('load', '16', {"," \"name\": \"scrollview-base-ie\","," \"trigger\": \"scrollview-base\","," \"ua\": \"ie\"","});","// selector-css2","add('load', '17', {"," \"name\": \"selector-css2\","," \"test\": function (Y) {"," var DOCUMENT = Y.config.doc,"," ret = DOCUMENT && !('querySelectorAll' in DOCUMENT);",""," return ret;","},"," \"trigger\": \"selector\"","});","// transition-timer","add('load', '18', {"," \"name\": \"transition-timer\","," \"test\": function (Y) {"," var DOCUMENT = Y.config.doc,"," node = (DOCUMENT) ? DOCUMENT.documentElement: null,"," ret = true;",""," if (node && node.style) {"," ret = !('MozTransition' in node.style || 'WebkitTransition' in node.style || 'transition' in node.style);"," }",""," return ret;","},"," \"trigger\": \"transition\"","});","// widget-base-ie","add('load', '19', {"," \"name\": \"widget-base-ie\","," \"trigger\": \"widget-base\","," \"ua\": \"ie\"","});","// yql-nodejs","add('load', '20', {"," \"name\": \"yql-nodejs\","," \"trigger\": \"yql\","," \"ua\": \"nodejs\","," \"when\": \"after\"","});","// yql-winjs","add('load', '21', {"," \"name\": \"yql-winjs\","," \"trigger\": \"yql\","," \"ua\": \"winjs\","," \"when\": \"after\"","});","","}, '@VERSION@', {\"requires\": [\"yui-base\"]});"];
_yuitest_coverage["build/features/features.js"].lines = {"1":0,"3":0,"16":0,"41":0,"42":0,"56":0,"59":0,"60":0,"61":0,"65":0,"81":0,"82":0,"86":0,"89":0,"91":0,"93":0,"94":0,"95":0,"98":0,"99":0,"100":0,"103":0,"107":0,"116":0,"118":0,"121":0,"124":0,"125":0,"128":0,"133":0,"147":0,"152":0,"158":0,"162":0,"169":0,"171":0,"175":0,"177":0,"181":0,"184":0,"189":0,"196":0,"199":0,"200":0,"205":0,"208":0,"212":0,"217":0,"220":0,"224":0,"229":0,"232":0,"237":0,"242":0,"245":0,"250":0,"255":0,"258":0,"260":0,"265":0,"268":0,"270":0,"275":0,"278":0,"280":0,"286":0,"292":0,"295":0,"299":0,"300":0,"305":0,"306":0,"307":0,"310":0,"314":0,"319":0,"322":0,"328":0,"329":0,"330":0,"332":0,"337":0,"342":0,"348":0,"351":0,"354":0,"359":0,"362":0,"366":0,"367":0,"370":0,"375":0,"381":0,"388":0};
_yuitest_coverage["build/features/features.js"].functions = {"add:40":0,"(anonymous 2):60":0,"all:55":0,"test:80":0,"\"test\":120":0,"\"test\":135":0,"test:170":0,"test:176":0,"\"test\":160":0,"\"test\":198":0,"\"test\":207":0,"\"test\":219":0,"\"test\":231":0,"\"test\":244":0,"\"test\":257":0,"\"test\":267":0,"\"test\":277":0,"workingNative:299":0,"\"test\":294":0,"\"test\":321":0,"\"test\":350":0,"\"test\":361":0,"(anonymous 1):1":0};
_yuitest_coverage["build/features/features.js"].coveredLines = 94;
@@ -173,7 +173,7 @@ return result;
// Y.Features.test("load", "1");
// caps=1:1;2:0;3:1;
-/* This file is auto-generated by src/loader/scripts/meta_join.js */
+/* This file is auto-generated by (yogi loader --yes --mix --start ../) */
_yuitest_coverline("build/features/features.js", 116);
var add = Y.Features.add;
// app-transitions-native
View
2  build/features/features-debug.js
@@ -113,7 +113,7 @@ Y.mix(Y.namespace('Features'), {
// Y.Features.test("load", "1");
// caps=1:1;2:0;3:1;
-/* This file is auto-generated by src/loader/scripts/meta_join.js */
+/* This file is auto-generated by (yogi loader --yes --mix --start ../) */
var add = Y.Features.add;
// app-transitions-native
add('load', '0', {
View
2  build/features/features.js
@@ -112,7 +112,7 @@ Y.mix(Y.namespace('Features'), {
// Y.Features.test("load", "1");
// caps=1:1;2:0;3:1;
-/* This file is auto-generated by src/loader/scripts/meta_join.js */
+/* This file is auto-generated by (yogi loader --yes --mix --start ../) */
var add = Y.Features.add;
// app-transitions-native
add('load', '0', {
View
209 build/io-xdr/io-xdr-coverage.js
@@ -26,11 +26,11 @@ _yuitest_coverage["build/io-xdr/io-xdr.js"] = {
path: "build/io-xdr/io-xdr.js",
code: []
};
-_yuitest_coverage["build/io-xdr/io-xdr.js"].code=["YUI.add('io-xdr', function (Y, NAME) {","","/**","Extends IO to provide an alternate, Flash transport, for making","cross-domain requests.","@module io","@submodule io-xdr","@for IO","**/","","/**","Fires when the XDR transport is ready for use.","@event io:xdrReady","**/","var E_XDR_READY = Y.publish('io:xdrReady', { fireOnce: true }),","","/**","Map of stored configuration objects when using","Flash as the transport for cross-domain requests.","","@property _cB","@private","@type {Object}","**/","_cB = {},","","/**","Map of transaction simulated readyState values","when XDomainRequest is the transport.","","@property _rS","@private","@type {Object}","**/","_rS = {},","","// Document reference","d = Y.config.doc,","// Window reference","w = Y.config.win,","// XDomainRequest cross-origin request detection","xdr = w && w.XDomainRequest;","","/**","Method that creates the Flash transport swf.","","@method _swf","@private","@param {String} uri - location of io.swf.","@param {String} yid - YUI sandbox id.","@param {String} yid - IO instance id.","**/","function _swf(uri, yid, uid) {"," var o = '<object id=\"io_swf\" type=\"application/x-shockwave-flash\" data=\"' +"," uri + '\" width=\"0\" height=\"0\">' +"," '<param name=\"movie\" value=\"' + uri + '\">' +"," '<param name=\"FlashVars\" value=\"yid=' + yid + '&uid=' + uid + '\">' +"," '<param name=\"allowScriptAccess\" value=\"always\">' +"," '</object>',"," c = d.createElement('div');",""," d.body.appendChild(c);"," c.innerHTML = o;","}","","/**","Creates a response object for XDR transactions, for success","and failure cases.","","@method _data","@private","@param {Object} o - Transaction object generated by _create() in io-base.","@param {Boolean} u - Configuration xdr.use.","@param {Boolean} d - Configuration xdr.dataType.","","@return {Object}","**/","function _data(o, u, d) {"," if (u === 'flash') {"," o.c.responseText = decodeURI(o.c.responseText);"," }"," if (d === 'xml') {"," o.c.responseXML = Y.DataType.XML.parse(o.c.responseText);"," }",""," return o;","}","","/**","Method for intiating an XDR transaction abort.","","@method _abort","@private","@param {Object} o - Transaction object generated by _create() in io-base.","@param {Object} c - configuration object for the transaction.","**/","function _abort(o, c) {"," return o.c.abort(o.id, c);","}","","/**","Method for determining if an XDR transaction has completed","and all data are received.","","@method _isInProgress","@private","@param {Object} o - Transaction object generated by _create() in io-base.","**/","function _isInProgress(o) {"," return xdr ? _rS[o.id] !== 4 : o.c.isInProgress(o.id);","}","","Y.mix(Y.IO.prototype, {",""," /**"," Map of io transports.",""," @property _transport"," @private"," @type {Object}"," **/"," _transport: {},",""," /**"," Sets event handlers for XDomainRequest transactions.",""," @method _ieEvt"," @private"," @static"," @param {Object} o - Transaction object generated by _create() in io-base."," @param {Object} c - configuration object for the transaction."," **/"," _ieEvt: function(o, c) {"," var io = this,"," i = o.id,"," t = 'timeout';",""," o.c.onprogress = function() { _rS[i] = 3; };"," o.c.onload = function() {"," _rS[i] = 4;"," io.xdrResponse('success', o, c);"," };"," o.c.onerror = function() {"," _rS[i] = 4;"," io.xdrResponse('failure', o, c);"," };"," if (c[t]) {"," o.c.ontimeout = function() {"," _rS[i] = 4;"," io.xdrResponse(t, o, c);"," };"," o.c[t] = c[t];"," }"," },",""," /**"," Method for accessing the transport's interface for making a"," cross-domain transaction.",""," @method xdr"," @param {String} uri - qualified path to transaction resource."," @param {Object} o - Transaction object generated by _create() in io-base."," @param {Object} c - configuration object for the transaction."," **/"," xdr: function(uri, o, c) {"," var io = this;",""," if (c.xdr.use === 'flash') {"," // The configuration object cannot be serialized safely"," // across Flash's ExternalInterface."," _cB[o.id] = c;"," w.setTimeout(function() {"," try {"," o.c.send(uri, { id: o.id,"," uid: o.uid,"," method: c.method,"," data: c.data,"," headers: c.headers });"," }"," catch(e) {"," io.xdrResponse('transport error', o, c);"," delete _cB[o.id];"," }"," }, Y.io.xdr.delay);"," }"," else if (xdr) {"," io._ieEvt(o, c);"," o.c.open(c.method || 'GET', uri);"," o.c.send(c.data);"," }"," else {"," o.c.send(uri, o, c);"," }",""," return {"," id: o.id,"," abort: function() {"," return o.c ? _abort(o, c) : false;"," },"," isInProgress: function() {"," return o.c ? _isInProgress(o.id) : false;"," },"," io: io"," };"," },",""," /**"," Response controller for cross-domain requests when using the"," Flash transport or IE8's XDomainRequest object.",""," @method xdrResponse"," @param {String} e Event name"," @param {Object} o Transaction object generated by _create() in io-base."," @param {Object} c Configuration object for the transaction."," @return {Object}"," **/"," xdrResponse: function(e, o, c) {"," c = _cB[o.id] ? _cB[o.id] : c;"," var io = this,"," m = xdr ? _rS : _cB,"," u = c.xdr.use,"," d = c.xdr.dataType;",""," switch (e) {"," case 'start':"," io.start(o, c);"," break;"," //case 'complete':"," //This case is not used by Flash or XDomainRequest."," //io.complete(o, c);"," //break;"," case 'success':"," io.success(_data(o, u, d), c);"," delete m[o.id];"," break;"," case 'timeout':"," case 'abort':"," case 'transport error':"," o.c = { status: 0, statusText: e };"," case 'failure':"," io.failure(_data(o, u, d), c);"," delete m[o.id];"," break;"," }"," },",""," /**"," Fires event \"io:xdrReady\"",""," @method _xdrReady"," @private"," @param {Number} yid - YUI sandbox id."," @param {Number} uid - IO instance id."," **/"," _xdrReady: function(yid, uid) {"," Y.fire(E_XDR_READY, yid, uid);"," },",""," /**"," Initializes the desired transport.",""," @method transport"," @param {Object} o - object of transport configurations."," **/"," transport: function(c) {"," if (c.id === 'flash') {"," _swf(Y.UA.ie ? c.src + '?d=' + new Date().valueOf().toString() : c.src, Y.id, c.uid);"," Y.IO.transports.flash = function() { return d.getElementById('io_swf'); };"," }"," }","});","","/**","Fires event \"io:xdrReady\"","","@method xdrReady","@protected","@static","@param {Number} yid - YUI sandbox id.","@param {Number} uid - IO instance id.","**/","Y.io.xdrReady = function(yid, uid){"," var io = Y.io._map[uid];"," Y.io.xdr.delay = 0;"," io._xdrReady.apply(io, [yid, uid]);","};","","Y.io.xdrResponse = function(e, o, c){"," var io = Y.io._map[o.uid];"," io.xdrResponse.apply(io, [e, o, c]);","};","","Y.io.transport = function(c){"," var io = Y.io._map['io:0'] || new Y.IO();"," c.uid = io._uid;"," io.transport.apply(io, [c]);","};","","/**","Delay value to calling the Flash transport, in the","event io.swf has not finished loading. Once the E_XDR_READY","event is fired, this value will be set to 0.","","@property delay","@static","@type {Number}","**/","Y.io.xdr = { delay : 100 };","","","}, '@VERSION@', {\"requires\": [\"io-base\", \"datatype-xml-parse\"]});"];
-_yuitest_coverage["build/io-xdr/io-xdr.js"].lines = {"1":0,"15":0,"53":0,"54":0,"62":0,"63":0,"78":0,"79":0,"80":0,"82":0,"83":0,"86":0,"97":0,"98":0,"109":0,"110":0,"113":0,"134":0,"138":0,"139":0,"140":0,"141":0,"143":0,"144":0,"145":0,"147":0,"148":0,"149":0,"150":0,"152":0,"166":0,"168":0,"171":0,"172":0,"173":0,"174":0,"181":0,"182":0,"186":0,"187":0,"188":0,"189":0,"192":0,"195":0,"198":0,"201":0,"218":0,"219":0,"224":0,"226":0,"227":0,"233":0,"234":0,"235":0,"239":0,"241":0,"242":0,"243":0,"256":0,"266":0,"267":0,"268":0,"282":0,"283":0,"284":0,"285":0,"288":0,"289":0,"290":0,"293":0,"294":0,"295":0,"296":0,"308":0};
-_yuitest_coverage["build/io-xdr/io-xdr.js"].functions = {"_swf:53":0,"_data:78":0,"_abort:97":0,"_isInProgress:109":0,"onprogress:138":0,"onload:139":0,"onerror:143":0,"ontimeout:148":0,"_ieEvt:133":0,"(anonymous 2):172":0,"abort:197":0,"isInProgress:200":0,"xdr:165":0,"xdrResponse:217":0,"_xdrReady:255":0,"flash:268":0,"transport:265":0,"xdrReady:282":0,"xdrResponse:288":0,"transport:293":0,"(anonymous 1):1":0};
+_yuitest_coverage["build/io-xdr/io-xdr.js"].code=["YUI.add('io-xdr', function (Y, NAME) {","","/**","Extends IO to provide an alternate, Flash transport, for making","cross-domain requests.","@module io","@submodule io-xdr","@for IO","**/","","// Helpful resources when working with the mess that is XDomainRequest:","// http://www.cypressnorth.com/blog/web-programming-and-development/internet-explorer-aborting-ajax-requests-fixed/","// http://blogs.msdn.com/b/ieinternals/archive/2010/05/13/xdomainrequest-restrictions-limitations-and-workarounds.aspx","","/**","Fires when the XDR transport is ready for use.","@event io:xdrReady","**/","var E_XDR_READY = Y.publish('io:xdrReady', { fireOnce: true }),","","/**","Map of stored configuration objects when using","Flash as the transport for cross-domain requests.","","@property _cB","@private","@type {Object}","**/","_cB = {},","","/**","Map of transaction simulated readyState values","when XDomainRequest is the transport.","","@property _rS","@private","@type {Object}","**/","_rS = {},","","// Document reference","d = Y.config.doc,","// Window reference","w = Y.config.win,","// XDomainRequest cross-origin request detection","xdr = w && w.XDomainRequest;","","/**","Method that creates the Flash transport swf.","","@method _swf","@private","@param {String} uri - location of io.swf.","@param {String} yid - YUI sandbox id.","@param {String} yid - IO instance id.","**/","function _swf(uri, yid, uid) {"," var o = '<object id=\"io_swf\" type=\"application/x-shockwave-flash\" data=\"' +"," uri + '\" width=\"0\" height=\"0\">' +"," '<param name=\"movie\" value=\"' + uri + '\">' +"," '<param name=\"FlashVars\" value=\"yid=' + yid + '&uid=' + uid + '\">' +"," '<param name=\"allowScriptAccess\" value=\"always\">' +"," '</object>',"," c = d.createElement('div');",""," d.body.appendChild(c);"," c.innerHTML = o;","}","","/**","Creates a response object for XDR transactions, for success","and failure cases.","","@method _data","@private","@param {Object} o - Transaction object generated by _create() in io-base.","@param {Boolean} u - Configuration xdr.use.","@param {Boolean} d - Configuration xdr.dataType.","","@return {Object}","**/","function _data(o, u, d) {"," if (u === 'flash') {"," o.c.responseText = decodeURI(o.c.responseText);"," }"," if (d === 'xml') {"," o.c.responseXML = Y.DataType.XML.parse(o.c.responseText);"," }",""," return o;","}","","/**","Method for intiating an XDR transaction abort.","","@method _abort","@private","@param {Object} o - Transaction object generated by _create() in io-base.","@param {Object} c - configuration object for the transaction.","**/","function _abort(o, c) {"," return o.c.abort(o.id, c);","}","","/**","Method for determining if an XDR transaction has completed","and all data are received.","","@method _isInProgress","@private","@param {Object} o - Transaction object generated by _create() in io-base.","**/","function _isInProgress(o) {"," return xdr ? _rS[o.id] !== 4 : o.c.isInProgress(o.id);","}","","Y.mix(Y.IO.prototype, {",""," /**"," Map of io transports.",""," @property _transport"," @private"," @type {Object}"," **/"," _transport: {},",""," /**"," Sets event handlers for XDomainRequest transactions.",""," @method _ieEvt"," @private"," @static"," @param {Object} o - Transaction object generated by _create() in io-base."," @param {Object} c - configuration object for the transaction."," **/"," _ieEvt: function(o, c) {"," var io = this,"," i = o.id,"," t = 'timeout';",""," o.c.onprogress = function() { _rS[i] = 3; };"," o.c.onload = function() {"," _rS[i] = 4;"," io.xdrResponse('success', o, c);"," };"," o.c.onerror = function() {"," _rS[i] = 4;"," io.xdrResponse('failure', o, c);"," };"," o.c.ontimeout = function() {"," _rS[i] = 4;"," io.xdrResponse(t, o, c);"," };"," o.c[t] = c[t] || 0;"," },",""," /**"," Method for accessing the transport's interface for making a"," cross-domain transaction.",""," @method xdr"," @param {String} uri - qualified path to transaction resource."," @param {Object} o - Transaction object generated by _create() in io-base."," @param {Object} c - configuration object for the transaction."," **/"," xdr: function(uri, o, c) {"," var io = this;",""," if (c.xdr.use === 'flash') {"," // The configuration object cannot be serialized safely"," // across Flash's ExternalInterface."," _cB[o.id] = c;"," w.setTimeout(function() {"," try {"," o.c.send(uri, { id: o.id,"," uid: o.uid,"," method: c.method,"," data: c.data,"," headers: c.headers });"," }"," catch(e) {"," io.xdrResponse('transport error', o, c);"," delete _cB[o.id];"," }"," }, Y.io.xdr.delay);"," }"," else if (xdr) {"," io._ieEvt(o, c);"," o.c.open(c.method || 'GET', uri);",""," // Make async to protect against IE 8 oddities."," setTimeout(function() {"," o.c.send(c.data);"," }, 0);"," }"," else {"," o.c.send(uri, o, c);"," }",""," return {"," id: o.id,"," abort: function() {"," return o.c ? _abort(o, c) : false;"," },"," isInProgress: function() {"," return o.c ? _isInProgress(o.id) : false;"," },"," io: io"," };"," },",""," /**"," Response controller for cross-domain requests when using the"," Flash transport or IE8's XDomainRequest object.",""," @method xdrResponse"," @param {String} e Event name"," @param {Object} o Transaction object generated by _create() in io-base."," @param {Object} c Configuration object for the transaction."," @return {Object}"," **/"," xdrResponse: function(e, o, c) {"," c = _cB[o.id] ? _cB[o.id] : c;"," var io = this,"," m = xdr ? _rS : _cB,"," u = c.xdr.use,"," d = c.xdr.dataType;",""," switch (e) {"," case 'start':"," io.start(o, c);"," break;"," //case 'complete':"," //This case is not used by Flash or XDomainRequest."," //io.complete(o, c);"," //break;"," case 'success':"," io.success(_data(o, u, d), c);"," delete m[o.id];"," break;"," case 'timeout':"," case 'abort':"," case 'transport error':"," o.c = { status: 0, statusText: e };"," case 'failure':"," io.failure(_data(o, u, d), c);"," delete m[o.id];"," break;"," }"," },",""," /**"," Fires event \"io:xdrReady\"",""," @method _xdrReady"," @private"," @param {Number} yid - YUI sandbox id."," @param {Number} uid - IO instance id."," **/"," _xdrReady: function(yid, uid) {"," Y.fire(E_XDR_READY, yid, uid);"," },",""," /**"," Initializes the desired transport.",""," @method transport"," @param {Object} o - object of transport configurations."," **/"," transport: function(c) {"," if (c.id === 'flash') {"," _swf(Y.UA.ie ? c.src + '?d=' + new Date().valueOf().toString() : c.src, Y.id, c.uid);"," Y.IO.transports.flash = function() { return d.getElementById('io_swf'); };"," }"," }","});","","/**","Fires event \"io:xdrReady\"","","@method xdrReady","@protected","@static","@param {Number} yid - YUI sandbox id.","@param {Number} uid - IO instance id.","**/","Y.io.xdrReady = function(yid, uid){"," var io = Y.io._map[uid];"," Y.io.xdr.delay = 0;"," io._xdrReady.apply(io, [yid, uid]);","};","","Y.io.xdrResponse = function(e, o, c){"," var io = Y.io._map[o.uid];"," io.xdrResponse.apply(io, [e, o, c]);","};","","Y.io.transport = function(c){"," var io = Y.io._map['io:0'] || new Y.IO();"," c.uid = io._uid;"," io.transport.apply(io, [c]);","};","","/**","Delay value to calling the Flash transport, in the","event io.swf has not finished loading. Once the E_XDR_READY","event is fired, this value will be set to 0.","","@property delay","@static","@type {Number}","**/","Y.io.xdr = { delay : 100 };","","","}, '@VERSION@', {\"requires\": [\"io-base\", \"datatype-xml-parse\"]});"];
+_yuitest_coverage["build/io-xdr/io-xdr.js"].lines = {"1":0,"19":0,"57":0,"58":0,"66":0,"67":0,"82":0,"83":0,"84":0,"86":0,"87":0,"90":0,"101":0,"102":0,"113":0,"114":0,"117":0,"138":0,"142":0,"143":0,"144":0,"145":0,"147":0,"148":0,"149":0,"151":0,"152":0,"153":0,"155":0,"168":0,"170":0,"173":0,"174":0,"175":0,"176":0,"183":0,"184":0,"188":0,"189":0,"190":0,"193":0,"194":0,"198":0,"201":0,"204":0,"207":0,"224":0,"225":0,"230":0,"232":0,"233":0,"239":0,"240":0,"241":0,"245":0,"247":0,"248":0,"249":0,"262":0,"272":0,"273":0,"274":0,"288":0,"289":0,"290":0,"291":0,"294":0,"295":0,"296":0,"299":0,"300":0,"301":0,"302":0,"314":0};
+_yuitest_coverage["build/io-xdr/io-xdr.js"].functions = {"_swf:57":0,"_data:82":0,"_abort:101":0,"_isInProgress:113":0,"onprogress:142":0,"onload:143":0,"onerror:147":0,"ontimeout:151":0,"_ieEvt:137":0,"(anonymous 2):174":0,"(anonymous 3):193":0,"abort:203":0,"isInProgress:206":0,"xdr:167":0,"xdrResponse:223":0,"_xdrReady:261":0,"flash:274":0,"transport:271":0,"xdrReady:288":0,"xdrResponse:294":0,"transport:299":0,"(anonymous 1):1":0};
_yuitest_coverage["build/io-xdr/io-xdr.js"].coveredLines = 74;
-_yuitest_coverage["build/io-xdr/io-xdr.js"].coveredFunctions = 21;
+_yuitest_coverage["build/io-xdr/io-xdr.js"].coveredFunctions = 22;
_yuitest_coverline("build/io-xdr/io-xdr.js", 1);
YUI.add('io-xdr', function (Y, NAME) {
@@ -42,12 +42,16 @@ cross-domain requests.
@for IO
**/
+// Helpful resources when working with the mess that is XDomainRequest:
+// http://www.cypressnorth.com/blog/web-programming-and-development/internet-explorer-aborting-ajax-requests-fixed/
+// http://blogs.msdn.com/b/ieinternals/archive/2010/05/13/xdomainrequest-restrictions-limitations-and-workarounds.aspx
+
/**
Fires when the XDR transport is ready for use.
@event io:xdrReady
**/
_yuitest_coverfunc("build/io-xdr/io-xdr.js", "(anonymous 1)", 1);
-_yuitest_coverline("build/io-xdr/io-xdr.js", 15);
+_yuitest_coverline("build/io-xdr/io-xdr.js", 19);
var E_XDR_READY = Y.publish('io:xdrReady', { fireOnce: true }),
/**
@@ -86,10 +90,10 @@ Method that creates the Flash transport swf.
@param {String} yid - YUI sandbox id.
@param {String} yid - IO instance id.
**/
-_yuitest_coverline("build/io-xdr/io-xdr.js", 53);
+_yuitest_coverline("build/io-xdr/io-xdr.js", 57);
function _swf(uri, yid, uid) {
- _yuitest_coverfunc("build/io-xdr/io-xdr.js", "_swf", 53);
-_yuitest_coverline("build/io-xdr/io-xdr.js", 54);
+ _yuitest_coverfunc("build/io-xdr/io-xdr.js", "_swf", 57);
+_yuitest_coverline("build/io-xdr/io-xdr.js", 58);
var o = '<object id="io_swf" type="application/x-shockwave-flash" data="' +
uri + '" width="0" height="0">' +
'<param name="movie" value="' + uri + '">' +
@@ -98,9 +102,9 @@ var o = '<object id="io_swf" type="application/x-shockwave-flash" data="' +
'</object>',
c = d.createElement('div');
- _yuitest_coverline("build/io-xdr/io-xdr.js", 62);
+ _yuitest_coverline("build/io-xdr/io-xdr.js", 66);
d.body.appendChild(c);
- _yuitest_coverline("build/io-xdr/io-xdr.js", 63);
+ _yuitest_coverline("build/io-xdr/io-xdr.js", 67);
c.innerHTML = o;
}
@@ -116,21 +120,21 @@ and failure cases.
@return {Object}
**/
-_yuitest_coverline("build/io-xdr/io-xdr.js", 78);
+_yuitest_coverline("build/io-xdr/io-xdr.js", 82);
function _data(o, u, d) {
- _yuitest_coverfunc("build/io-xdr/io-xdr.js", "_data", 78);
-_yuitest_coverline("build/io-xdr/io-xdr.js", 79);
+ _yuitest_coverfunc("build/io-xdr/io-xdr.js", "_data", 82);
+_yuitest_coverline("build/io-xdr/io-xdr.js", 83);
if (u === 'flash') {
- _yuitest_coverline("build/io-xdr/io-xdr.js", 80);
+ _yuitest_coverline("build/io-xdr/io-xdr.js", 84);
o.c.responseText = decodeURI(o.c.responseText);
}
- _yuitest_coverline("build/io-xdr/io-xdr.js", 82);
+ _yuitest_coverline("build/io-xdr/io-xdr.js", 86);
if (d === 'xml') {
- _yuitest_coverline("build/io-xdr/io-xdr.js", 83);
+ _yuitest_coverline("build/io-xdr/io-xdr.js", 87);
o.c.responseXML = Y.DataType.XML.parse(o.c.responseText);
}
- _yuitest_coverline("build/io-xdr/io-xdr.js", 86);
+ _yuitest_coverline("build/io-xdr/io-xdr.js", 90);
return o;
}
@@ -142,10 +146,10 @@ Method for intiating an XDR transaction abort.
@param {Object} o - Transaction object generated by _create() in io-base.
@param {Object} c - configuration object for the transaction.
**/
-_yuitest_coverline("build/io-xdr/io-xdr.js", 97);
+_yuitest_coverline("build/io-xdr/io-xdr.js", 101);
function _abort(o, c) {
- _yuitest_coverfunc("build/io-xdr/io-xdr.js", "_abort", 97);
-_yuitest_coverline("build/io-xdr/io-xdr.js", 98);
+ _yuitest_coverfunc("build/io-xdr/io-xdr.js", "_abort", 101);
+_yuitest_coverline("build/io-xdr/io-xdr.js", 102);
return o.c.abort(o.id, c);
}
@@ -157,14 +161,14 @@ and all data are received.
@private
@param {Object} o - Transaction object generated by _create() in io-base.
**/
-_yuitest_coverline("build/io-xdr/io-xdr.js", 109);
+_yuitest_coverline("build/io-xdr/io-xdr.js", 113);
function _isInProgress(o) {
- _yuitest_coverfunc("build/io-xdr/io-xdr.js", "_isInProgress", 109);
-_yuitest_coverline("build/io-xdr/io-xdr.js", 110);
+ _yuitest_coverfunc("build/io-xdr/io-xdr.js", "_isInProgress", 113);
+_yuitest_coverline("build/io-xdr/io-xdr.js", 114);
return xdr ? _rS[o.id] !== 4 : o.c.isInProgress(o.id);
}
-_yuitest_coverline("build/io-xdr/io-xdr.js", 113);
+_yuitest_coverline("build/io-xdr/io-xdr.js", 117);
Y.mix(Y.IO.prototype, {
/**
@@ -186,44 +190,41 @@ Y.mix(Y.IO.prototype, {
@param {Object} c - configuration object for the transaction.
**/
_ieEvt: function(o, c) {
- _yuitest_coverfunc("build/io-xdr/io-xdr.js", "_ieEvt", 133);
-_yuitest_coverline("build/io-xdr/io-xdr.js", 134);
+ _yuitest_coverfunc("build/io-xdr/io-xdr.js", "_ieEvt", 137);
+_yuitest_coverline("build/io-xdr/io-xdr.js", 138);
var io = this,
i = o.id,
t = 'timeout';
- _yuitest_coverline("build/io-xdr/io-xdr.js", 138);
-o.c.onprogress = function() { _yuitest_coverfunc("build/io-xdr/io-xdr.js", "onprogress", 138);
+ _yuitest_coverline("build/io-xdr/io-xdr.js", 142);
+o.c.onprogress = function() { _yuitest_coverfunc("build/io-xdr/io-xdr.js", "onprogress", 142);
_rS[i] = 3; };
- _yuitest_coverline("build/io-xdr/io-xdr.js", 139);
+ _yuitest_coverline("build/io-xdr/io-xdr.js", 143);
o.c.onload = function() {
- _yuitest_coverfunc("build/io-xdr/io-xdr.js", "onload", 139);
-_yuitest_coverline("build/io-xdr/io-xdr.js", 140);
+ _yuitest_coverfunc("build/io-xdr/io-xdr.js", "onload", 143);
+_yuitest_coverline("build/io-xdr/io-xdr.js", 144);
_rS[i] = 4;
- _yuitest_coverline("build/io-xdr/io-xdr.js", 141);
+ _yuitest_coverline("build/io-xdr/io-xdr.js", 145);
io.xdrResponse('success', o, c);
};
- _yuitest_coverline("build/io-xdr/io-xdr.js", 143);
+ _yuitest_coverline("build/io-xdr/io-xdr.js", 147);
o.c.onerror = function() {
- _yuitest_coverfunc("build/io-xdr/io-xdr.js", "onerror", 143);
-_yuitest_coverline("build/io-xdr/io-xdr.js", 144);
+ _yuitest_coverfunc("build/io-xdr/io-xdr.js", "onerror", 147);
+_yuitest_coverline("build/io-xdr/io-xdr.js", 148);
_rS[i] = 4;
- _yuitest_coverline("build/io-xdr/io-xdr.js", 145);
+ _yuitest_coverline("build/io-xdr/io-xdr.js", 149);
io.xdrResponse('failure', o, c);
};
- _yuitest_coverline("build/io-xdr/io-xdr.js", 147);
-if (c[t]) {
- _yuitest_coverline("build/io-xdr/io-xdr.js", 148);
+ _yuitest_coverline("build/io-xdr/io-xdr.js", 151);
o.c.ontimeout = function() {
- _yuitest_coverfunc("build/io-xdr/io-xdr.js", "ontimeout", 148);
-_yuitest_coverline("build/io-xdr/io-xdr.js", 149);
+ _yuitest_coverfunc("build/io-xdr/io-xdr.js", "ontimeout", 151);
+_yuitest_coverline("build/io-xdr/io-xdr.js", 152);
_rS[i] = 4;
- _yuitest_coverline("build/io-xdr/io-xdr.js", 150);
+ _yuitest_coverline("build/io-xdr/io-xdr.js", 153);
io.xdrResponse(t, o, c);
- };
- _yuitest_coverline("build/io-xdr/io-xdr.js", 152);
-o.c[t] = c[t];
- }
+ };
+ _yuitest_coverline("build/io-xdr/io-xdr.js", 155);
+o.c[t] = c[t] || 0;
},
/**
@@ -236,22 +237,22 @@ o.c[t] = c[t];
@param {Object} c - configuration object for the transaction.
**/
xdr: function(uri, o, c) {
- _yuitest_coverfunc("build/io-xdr/io-xdr.js", "xdr", 165);
-_yuitest_coverline("build/io-xdr/io-xdr.js", 166);
+ _yuitest_coverfunc("build/io-xdr/io-xdr.js", "xdr", 167);
+_yuitest_coverline("build/io-xdr/io-xdr.js", 168);
var io = this;
- _yuitest_coverline("build/io-xdr/io-xdr.js", 168);
+ _yuitest_coverline("build/io-xdr/io-xdr.js", 170);
if (c.xdr.use === 'flash') {
// The configuration object cannot be serialized safely
// across Flash's ExternalInterface.
- _yuitest_coverline("build/io-xdr/io-xdr.js", 171);
+ _yuitest_coverline("build/io-xdr/io-xdr.js", 173);
_cB[o.id] = c;
- _yuitest_coverline("build/io-xdr/io-xdr.js", 172);
+ _yuitest_coverline("build/io-xdr/io-xdr.js", 174);
w.setTimeout(function() {
- _yuitest_coverfunc("build/io-xdr/io-xdr.js", "(anonymous 2)", 172);
-_yuitest_coverline("build/io-xdr/io-xdr.js", 173);
+ _yuitest_coverfunc("build/io-xdr/io-xdr.js", "(anonymous 2)", 174);
+_yuitest_coverline("build/io-xdr/io-xdr.js", 175);
try {
- _yuitest_coverline("build/io-xdr/io-xdr.js", 174);
+ _yuitest_coverline("build/io-xdr/io-xdr.js", 176);
o.c.send(uri, { id: o.id,
uid: o.uid,
method: c.method,
@@ -259,38 +260,44 @@ o.c.send(uri, { id: o.id,
headers: c.headers });
}
catch(e) {
- _yuitest_coverline("build/io-xdr/io-xdr.js", 181);
+ _yuitest_coverline("build/io-xdr/io-xdr.js", 183);
io.xdrResponse('transport error', o, c);
- _yuitest_coverline("build/io-xdr/io-xdr.js", 182);
+ _yuitest_coverline("build/io-xdr/io-xdr.js", 184);
delete _cB[o.id];
}
}, Y.io.xdr.delay);
}
- else {_yuitest_coverline("build/io-xdr/io-xdr.js", 186);
+ else {_yuitest_coverline("build/io-xdr/io-xdr.js", 188);
if (xdr) {
- _yuitest_coverline("build/io-xdr/io-xdr.js", 187);
+ _yuitest_coverline("build/io-xdr/io-xdr.js", 189);
io._ieEvt(o, c);
- _yuitest_coverline("build/io-xdr/io-xdr.js", 188);
+ _yuitest_coverline("build/io-xdr/io-xdr.js", 190);
o.c.open(c.method || 'GET', uri);
- _yuitest_coverline("build/io-xdr/io-xdr.js", 189);
+
+ // Make async to protect against IE 8 oddities.
+ _yuitest_coverline("build/io-xdr/io-xdr.js", 193);
+setTimeout(function() {
+ _yuitest_coverfunc("build/io-xdr/io-xdr.js", "(anonymous 3)", 193);
+_yuitest_coverline("build/io-xdr/io-xdr.js", 194);
o.c.send(c.data);
+ }, 0);
}
else {
- _yuitest_coverline("build/io-xdr/io-xdr.js", 192);
+ _yuitest_coverline("build/io-xdr/io-xdr.js", 198);
o.c.send(uri, o, c);
}}
- _yuitest_coverline("build/io-xdr/io-xdr.js", 195);
+ _yuitest_coverline("build/io-xdr/io-xdr.js", 201);
return {
id: o.id,
abort: function() {
- _yuitest_coverfunc("build/io-xdr/io-xdr.js", "abort", 197);
-_yuitest_coverline("build/io-xdr/io-xdr.js", 198);
+ _yuitest_coverfunc("build/io-xdr/io-xdr.js", "abort", 203);
+_yuitest_coverline("build/io-xdr/io-xdr.js", 204);
return o.c ? _abort(o, c) : false;
},
isInProgress: function() {
- _yuitest_coverfunc("build/io-xdr/io-xdr.js", "isInProgress", 200);
-_yuitest_coverline("build/io-xdr/io-xdr.js", 201);
+ _yuitest_coverfunc("build/io-xdr/io-xdr.js", "isInProgress", 206);
+_yuitest_coverline("build/io-xdr/io-xdr.js", 207);
return o.c ? _isInProgress(o.id) : false;
},
io: io
@@ -308,44 +315,44 @@ return o.c ? _isInProgress(o.id) : false;
@return {Object}
**/
xdrResponse: function(e, o, c) {
- _yuitest_coverfunc("build/io-xdr/io-xdr.js", "xdrResponse", 217);
-_yuitest_coverline("build/io-xdr/io-xdr.js", 218);
+ _yuitest_coverfunc("build/io-xdr/io-xdr.js", "xdrResponse", 223);
+_yuitest_coverline("build/io-xdr/io-xdr.js", 224);
c = _cB[o.id] ? _cB[o.id] : c;
- _yuitest_coverline("build/io-xdr/io-xdr.js", 219);
+ _yuitest_coverline("build/io-xdr/io-xdr.js", 225);
var io = this,
m = xdr ? _rS : _cB,
u = c.xdr.use,
d = c.xdr.dataType;
- _yuitest_coverline("build/io-xdr/io-xdr.js", 224);
+ _yuitest_coverline("build/io-xdr/io-xdr.js", 230);
switch (e) {
case 'start':
- _yuitest_coverline("build/io-xdr/io-xdr.js", 226);
+ _yuitest_coverline("build/io-xdr/io-xdr.js", 232);
io.start(o, c);
- _yuitest_coverline("build/io-xdr/io-xdr.js", 227);
+ _yuitest_coverline("build/io-xdr/io-xdr.js", 233);
break;
//case 'complete':
//This case is not used by Flash or XDomainRequest.
//io.complete(o, c);
//break;
case 'success':
- _yuitest_coverline("build/io-xdr/io-xdr.js", 233);
+ _yuitest_coverline("build/io-xdr/io-xdr.js", 239);
io.success(_data(o, u, d), c);
- _yuitest_coverline("build/io-xdr/io-xdr.js", 234);
+ _yuitest_coverline("build/io-xdr/io-xdr.js", 240);
delete m[o.id];
- _yuitest_coverline("build/io-xdr/io-xdr.js", 235);
+ _yuitest_coverline("build/io-xdr/io-xdr.js", 241);
break;
case 'timeout':
case 'abort':
case 'transport error':
- _yuitest_coverline("build/io-xdr/io-xdr.js", 239);
+ _yuitest_coverline("build/io-xdr/io-xdr.js", 245);
o.c = { status: 0, statusText: e };
case 'failure':
- _yuitest_coverline("build/io-xdr/io-xdr.js", 241);
+ _yuitest_coverline("build/io-xdr/io-xdr.js", 247);
io.failure(_data(o, u, d), c);
- _yuitest_coverline("build/io-xdr/io-xdr.js", 242);
+ _yuitest_coverline("build/io-xdr/io-xdr.js", 248);
delete m[o.id];
- _yuitest_coverline("build/io-xdr/io-xdr.js", 243);
+ _yuitest_coverline("build/io-xdr/io-xdr.js", 249);
break;
}
},
@@ -359,8 +366,8 @@ break;
@param {Number} uid - IO instance id.
**/
_xdrReady: function(yid, uid) {
- _yuitest_coverfunc("build/io-xdr/io-xdr.js", "_xdrReady", 255);
-_yuitest_coverline("build/io-xdr/io-xdr.js", 256);
+ _yuitest_coverfunc("build/io-xdr/io-xdr.js", "_xdrReady", 261);
+_yuitest_coverline("build/io-xdr/io-xdr.js", 262);
Y.fire(E_XDR_READY, yid, uid);
},
@@ -371,13 +378,13 @@ Y.fire(E_XDR_READY, yid, uid);
@param {Object} o - object of transport configurations.
**/
transport: function(c) {
- _yuitest_coverfunc("build/io-xdr/io-xdr.js", "transport", 265);
-_yuitest_coverline("build/io-xdr/io-xdr.js", 266);
+ _yuitest_coverfunc("build/io-xdr/io-xdr.js", "transport", 271);
+_yuitest_coverline("build/io-xdr/io-xdr.js", 272);
if (c.id === 'flash') {
- _yuitest_coverline("build/io-xdr/io-xdr.js", 267);
+ _yuitest_coverline("build/io-xdr/io-xdr.js", 273);
_swf(Y.UA.ie ? c.src + '?d=' + new Date().valueOf().toString() : c.src, Y.id, c.uid);
- _yuitest_coverline("build/io-xdr/io-xdr.js", 268);
-Y.IO.transports.flash = function() { _yuitest_coverfunc("build/io-xdr/io-xdr.js", "flash", 268);
+ _yuitest_coverline("build/io-xdr/io-xdr.js", 274);
+Y.IO.transports.flash = function() { _yuitest_coverfunc("build/io-xdr/io-xdr.js", "flash", 274);
return d.getElementById('io_swf'); };
}
}
@@ -392,34 +399,34 @@ Fires event "io:xdrReady"
@param {Number} yid - YUI sandbox id.
@param {Number} uid - IO instance id.
**/
-_yuitest_coverline("build/io-xdr/io-xdr.js", 282);
+_yuitest_coverline("build/io-xdr/io-xdr.js", 288);
Y.io.xdrReady = function(yid, uid){
- _yuitest_coverfunc("build/io-xdr/io-xdr.js", "xdrReady", 282);
-_yuitest_coverline("build/io-xdr/io-xdr.js", 283);
+ _yuitest_coverfunc("build/io-xdr/io-xdr.js", "xdrReady", 288);
+_yuitest_coverline("build/io-xdr/io-xdr.js", 289);
var io = Y.io._map[uid];
- _yuitest_coverline("build/io-xdr/io-xdr.js", 284);
+ _yuitest_coverline("build/io-xdr/io-xdr.js", 290);
Y.io.xdr.delay = 0;
- _yuitest_coverline("build/io-xdr/io-xdr.js", 285);
+ _yuitest_coverline("build/io-xdr/io-xdr.js", 291);
io._xdrReady.apply(io, [yid, uid]);
};
-_yuitest_coverline("build/io-xdr/io-xdr.js", 288);
+_yuitest_coverline("build/io-xdr/io-xdr.js", 294);
Y.io.xdrResponse = function(e, o, c){
- _yuitest_coverfunc("build/io-xdr/io-xdr.js", "xdrResponse", 288);
-_yuitest_coverline("build/io-xdr/io-xdr.js", 289);
+ _yuitest_coverfunc("build/io-xdr/io-xdr.js", "xdrResponse", 294);
+_yuitest_coverline("build/io-xdr/io-xdr.js", 295);
var io = Y.io._map[o.uid];
- _yuitest_coverline("build/io-xdr/io-xdr.js", 290);
+ _yuitest_coverline("build/io-xdr/io-xdr.js", 296);
io.xdrResponse.apply(io, [e, o, c]);
};
-_yuitest_coverline("build/io-xdr/io-xdr.js", 293);
+_yuitest_coverline("build/io-xdr/io-xdr.js", 299);
Y.io.transport = function(c){
- _yuitest_coverfunc("build/io-xdr/io-xdr.js", "transport", 293);
-_yuitest_coverline("build/io-xdr/io-xdr.js", 294);
+ _yuitest_coverfunc("build/io-xdr/io-xdr.js", "transport", 299);
+_yuitest_coverline("build/io-xdr/io-xdr.js", 300);
var io = Y.io._map['io:0'] || new Y.IO();
- _yuitest_coverline("build/io-xdr/io-xdr.js", 295);
+ _yuitest_coverline("build/io-xdr/io-xdr.js", 301);
c.uid = io._uid;
- _yuitest_coverline("build/io-xdr/io-xdr.js", 296);
+ _yuitest_coverline("build/io-xdr/io-xdr.js", 302);
io.transport.apply(io, [c]);
};
@@ -432,7 +439,7 @@ event is fired, this value will be set to 0.
@static
@type {Number}
**/
-_yuitest_coverline("build/io-xdr/io-xdr.js", 308);
+_yuitest_coverline("build/io-xdr/io-xdr.js", 314);
Y.io.xdr = { delay : 100 };
View
22 build/io-xdr/io-xdr-debug.js
@@ -8,6 +8,10 @@ cross-domain requests.
@for IO
**/
+// Helpful resources when working with the mess that is XDomainRequest:
+// http://www.cypressnorth.com/blog/web-programming-and-development/internet-explorer-aborting-ajax-requests-fixed/
+// http://blogs.msdn.com/b/ieinternals/archive/2010/05/13/xdomainrequest-restrictions-limitations-and-workarounds.aspx
+
/**
Fires when the XDR transport is ready for use.
@event io:xdrReady
@@ -144,13 +148,11 @@ Y.mix(Y.IO.prototype, {
_rS[i] = 4;
io.xdrResponse('failure', o, c);
};
- if (c[t]) {
- o.c.ontimeout = function() {
- _rS[i] = 4;
- io.xdrResponse(t, o, c);
- };
- o.c[t] = c[t];
- }
+ o.c.ontimeout = function() {
+ _rS[i] = 4;
+ io.xdrResponse(t, o, c);
+ };
+ o.c[t] = c[t] || 0;
},
/**
@@ -186,7 +188,11 @@ Y.mix(Y.IO.prototype, {
else if (xdr) {
io._ieEvt(o, c);
o.c.open(c.method || 'GET', uri);
- o.c.send(c.data);
+
+ // Make async to protect against IE 8 oddities.
+ setTimeout(function() {
+ o.c.send(c.data);
+ }, 0);
}
else {
o.c.send(uri, o, c);
View
2  build/io-xdr/io-xdr-min.js
@@ -1 +1 @@
-YUI.add("io-xdr",function(e,t){function a(e,t,n){var r='<object id="io_swf" type="application/x-shockwave-flash" data="'+e+'" width="0" height="0">'+'<param name="movie" value="'+e+'">'+'<param name="FlashVars" value="yid='+t+"&uid="+n+'">'+'<param name="allowScriptAccess" value="always">'+"</object>",i=s.createElement("div");s.body.appendChild(i),i.innerHTML=r}function f(t,n,r){return n==="flash"&&(t.c.responseText=decodeURI(t.c.responseText)),r==="xml"&&(t.c.responseXML=e.DataType.XML.parse(t.c.responseText)),t}function l(e,t){return e.c.abort(e.id,t)}function c(e){return u?i[e.id]!==4:e.c.isInProgress(e.id)}var n=e.publish("io:xdrReady",{fireOnce:!0}),r={},i={},s=e.config.doc,o=e.config.win,u=o&&o.XDomainRequest;e.mix(e.IO.prototype,{_transport:{},_ieEvt:function(e,t){var n=this,r=e.id,s="timeout";e.c.onprogress=function(){i[r]=3},e.c.onload=function(){i[r]=4,n.xdrResponse("success",e,t)},e.c.onerror=function(){i[r]=4,n.xdrResponse("failure",e,t)},t[s]&&(e.c.ontimeout=function(){i[r]=4,n.xdrResponse(s,e,t)},e.c[s]=t[s])},xdr:function(t,n,i){var s=this;return i.xdr.use==="flash"?(r[n.id]=i,o.setTimeout(function(){try{n.c.send(t,{id:n.id,uid:n.uid,method:i.method,data:i.data,headers:i.headers})}catch(e){s.xdrResponse("transport error",n,i),delete r[n.id]}},e.io.xdr.delay)):u?(s._ieEvt(n,i),n.c.open(i.method||"GET",t),n.c.send(i.data)):n.c.send(t,n,i),{id:n.id,abort:function(){return n.c?l(n,i):!1},isInProgress:function(){return n.c?c(n.id):!1},io:s}},xdrResponse:function(e,t,n){n=r[t.id]?r[t.id]:n;var s=this,o=u?i:r,a=n.xdr.use,l=n.xdr.dataType;switch(e){case"start":s.start(t,n);break;case"success":s.success(f(t,a,l),n),delete o[t.id];break;case"timeout":case"abort":case"transport error":t.c={status:0,statusText:e};case"failure":s.failure(f(t,a,l),n),delete o[t.id]}},_xdrReady:function(t,r){e.fire(n,t,r)},transport:function(t){t.id==="flash"&&(a(e.UA.ie?t.src+"?d="+(new Date).valueOf().toString():t.src,e.id,t.uid),e.IO.transports.flash=function(){return s.getElementById("io_swf")})}}),e.io.xdrReady=function(t,n){var r=e.io._map[n];e.io.xdr.delay=0,r._xdrReady.apply(r,[t,n])},e.io.xdrResponse=function(t,n,r){var i=e.io._map[n.uid];i.xdrResponse.apply(i,[t,n,r])},e.io.transport=function(t){var n=e.io._map["io:0"]||new e.IO;t.uid=n._uid,n.transport.apply(n,[t])},e.io.xdr={delay:100}},"@VERSION@",{requires:["io-base","datatype-xml-parse"]});
+YUI.add("io-xdr",function(e,t){function a(e,t,n){var r='<object id="io_swf" type="application/x-shockwave-flash" data="'+e+'" width="0" height="0">'+'<param name="movie" value="'+e+'">'+'<param name="FlashVars" value="yid='+t+"&uid="+n+'">'+'<param name="allowScriptAccess" value="always">'+"</object>",i=s.createElement("div");s.body.appendChild(i),i.innerHTML=r}function f(t,n,r){return n==="flash"&&(t.c.responseText=decodeURI(t.c.responseText)),r==="xml"&&(t.c.responseXML=e.DataType.XML.parse(t.c.responseText)),t}function l(e,t){return e.c.abort(e.id,t)}function c(e){return u?i[e.id]!==4:e.c.isInProgress(e.id)}var n=e.publish("io:xdrReady",{fireOnce:!0}),r={},i={},s=e.config.doc,o=e.config.win,u=o&&o.XDomainRequest;e.mix(e.IO.prototype,{_transport:{},_ieEvt:function(e,t){var n=this,r=e.id,s="timeout";e.c.onprogress=function(){i[r]=3},e.c.onload=function(){i[r]=4,n.xdrResponse("success",e,t)},e.c.onerror=function(){i[r]=4,n.xdrResponse("failure",e,t)},e.c.ontimeout=function(){i[r]=4,n.xdrResponse(s,e,t)},e.c[s]=t[s]||0},xdr:function(t,n,i){var s=this;return i.xdr.use==="flash"?(r[n.id]=i,o.setTimeout(function(){try{n.c.send(t,{id:n.id,uid:n.uid,method:i.method,data:i.data,headers:i.headers})}catch(e){s.xdrResponse("transport error",n,i),delete r[n.id]}},e.io.xdr.delay)):u?(s._ieEvt(n,i),n.c.open(i.method||"GET",t),setTimeout(function(){n.c.send(i.data)},0)):n.c.send(t,n,i),{id:n.id,abort:function(){return n.c?l(n,i):!1},isInProgress:function(){return n.c?c(n.id):!1},io:s}},xdrResponse:function(e,t,n){n=r[t.id]?r[t.id]:n;var s=this,o=u?i:r,a=n.xdr.use,l=n.xdr.dataType;switch(e){case"start":s.start(t,n);break;case"success":s.success(f(t,a,l),n),delete o[t.id];break;case"timeout":case"abort":case"transport error":t.c={status:0,statusText:e};case"failure":s.failure(f(t,a,l),n),delete o[t.id]}},_xdrReady:function(t,r){e.fire(n,t,r)},transport:function(t){t.id==="flash"&&(a(e.UA.ie?t.src+"?d="+(new Date).valueOf().toString():t.src,e.id,t.uid),e.IO.transports.flash=function(){return s.getElementById("io_swf")})}}),e.io.xdrReady=function(t,n){var r=e.io._map[n];e.io.xdr.delay=0,r._xdrReady.apply(r,[t,n])},e.io.xdrResponse=function(t,n,r){var i=e.io._map[n.uid];i.xdrResponse.apply(i,[t,n,r])},e.io.transport=function(t){var n=e.io._map["io:0"]||new e.IO;t.uid=n._uid,n.transport.apply(n,[t])},e.io.xdr={delay:100}},"@VERSION@",{requires:["io-base","datatype-xml-parse"]});
View
22 build/io-xdr/io-xdr.js
@@ -8,6 +8,10 @@ cross-domain requests.
@for IO
**/
+// Helpful resources when working with the mess that is XDomainRequest:
+// http://www.cypressnorth.com/blog/web-programming-and-development/internet-explorer-aborting-ajax-requests-fixed/
+// http://blogs.msdn.com/b/ieinternals/archive/2010/05/13/xdomainrequest-restrictions-limitations-and-workarounds.aspx
+
/**
Fires when the XDR transport is ready for use.
@event io:xdrReady
@@ -144,13 +148,11 @@ Y.mix(Y.IO.prototype, {
_rS[i] = 4;
io.xdrResponse('failure', o, c);
};
- if (c[t]) {
- o.c.ontimeout = function() {
- _rS[i] = 4;
- io.xdrResponse(t, o, c);
- };
- o.c[t] = c[t];
- }
+ o.c.ontimeout = function() {
+ _rS[i] = 4;
+ io.xdrResponse(t, o, c);
+ };
+ o.c[t] = c[t] || 0;
},
/**
@@ -186,7 +188,11 @@ Y.mix(Y.IO.prototype, {
else if (xdr) {
io._ieEvt(o, c);
o.c.open(c.method || 'GET', uri);
- o.c.send(c.data);
+
+ // Make async to protect against IE 8 oddities.
+ setTimeout(function() {
+ o.c.send(c.data);
+ }, 0);
}
else {
o.c.send(uri, o, c);
View
4 build/loader-base/loader-base-coverage.js
2 additions, 2 deletions not shown
View
2  build/loader-base/loader-base-debug.js
@@ -13,7 +13,7 @@ if (!YUI.Env[Y.version]) {
BUILD = '/build/',
ROOT = VERSION + BUILD,
CDN_BASE = Y.Env.base,
- GALLERY_VERSION = 'gallery-2012.12.12-21-11',
+ GALLERY_VERSION = 'gallery-2012.12.26-20-48',
TNT = '2in3',
TNT_VERSION = '4',
YUI2_VERSION = '2.9.0',
View
2  build/loader-base/loader-base-min.js
@@ -1 +1 @@
-YUI.add("loader-base",function(e,t){YUI.Env[e.version]||function(){var t=e.version,n="/build/",r=t+n,i=e.Env.base,s="gallery-2012.12.12-21-11",o="2in3",u="4",a="2.9.0",f=i+"combo?",l={version:t,root:r,base:e.Env.base,comboBase:f,skin:{defaultSkin:"sam",base:"assets/skins/",path:"skin.css",after:["cssreset","cssfonts","cssgrids","cssbase","cssreset-context","cssfonts-context"]},groups:{},patterns:{}},c=l.groups,h=function(e,t,r){var s=o+"."+(e||u)+"/"+(t||a)+n,l=r&&r.base?r.base:i,h=r&&r.comboBase?r.comboBase:f;c.yui2.base=l+s,c.yui2.root=s,c.yui2.comboBase=h},p=function(e,t){var r=(e||s)+n,o=t&&t.base?t.base:i,u=t&&t.comboBase?t.comboBase:f;c.gallery.base=o+r,c.gallery.root=r,c.gallery.comboBase=u};c[t]={},c.gallery={ext:!1,combine:!0,comboBase:f,update:p,patterns:{"gallery-":{},"lang/gallery-":{},"gallerycss-":{type:"css"}}},c.yui2={combine:!0,ext:!1,comboBase:f,update:h,patterns:{"yui2-":{configFn:function(e){/-skin|reset|fonts|grids|base/.test(e.name)&&(e.type="css",e.path=e.path.replace(/\.js/,".css"),e.path=e.path.replace(/\/yui2-skin/,"/assets/skins/sam/yui2-skin"))}}}},p(),h(),YUI.Env[t]=l}();var n={},r=[],i=1024,s=YUI.Env,o=s._loaded,u="css",a="js",f="intl",l="sam",c=e.version,h="",p=e.Object,d=p.each,v=e.Array,m=s._loaderQueue,g=s[c],y="skin-",b=e.Lang,w=s.mods,E,S=function(e,t,n,r){var i=e+"/"+t;return r||(i+="-min"),i+="."+(n||u),i};YUI.Env._cssLoaded||(YUI.Env._cssLoaded={}),e.Env.meta=g,e.Loader=function(t){var n=this;t=t||{},E=g.md5,n.context=e,n.base=e.Env.meta.base+e.Env.meta.root,n.comboBase=e.Env.meta.comboBase,n.combine=t.base&&t.base.indexOf(n.comboBase.substr(0,20))>-1,n.comboSep="&",n.maxURLLength=i,n.ignoreRegistered=t.ignoreRegistered,n.root=e.Env.meta.root,n.timeout=0,n.forceMap={},n.allowRollup=!1,n.filters={},n.required={},n.patterns={},n.moduleInfo={},n.groups=e.merge(e.Env.meta.groups),n.skin=e.merge(e.Env.meta.skin),n.conditions={},n.config=t,n._internal=!0,n._populateCache(),n.loaded=o[c],n.async=!0,n._inspectPage(),n._internal=!1,n._config(t),n.forceMap=n.force?e.Array.hash(n.force):{},n.testresults=null,e.config.tests&&(n.testresults=e.config.tests),n.sorted=[],n.dirty=!0,n.inserted={},n.skipped={},n.tested={},n.ignoreRegistered&&n._resetModules()},e.Loader.prototype={_populateCache:function(){var t=this,n=g.modules,r=s._renderedMods,i;if(r&&!t.ignoreRegistered){for(i in r)r.hasOwnProperty(i)&&(t.moduleInfo[i]=e.merge(r[i]));r=s._conditions;for(i in r)r.hasOwnProperty(i)&&(t.conditions[i]=e.merge(r[i]))}else for(i in n)n.hasOwnProperty(i)&&t.addModule(n[i],i)},_resetModules:function(){var e=this,t,n,r,i,s;for(t in e.moduleInfo)if(e.moduleInfo.hasOwnProperty(t)){r=e.moduleInfo[t],i=r.name,s=YUI.Env.mods[i]?YUI.Env.mods[i].details:null,s&&(e.moduleInfo[i]._reset=!0,e.moduleInfo[i].requires=s.requires||[],e.moduleInfo[i].optional=s.optional||[],e.moduleInfo[i].supersedes=s.supercedes||[]);if(r.defaults)for(n in r.defaults)r.defaults.hasOwnProperty(n)&&r[n]&&(r[n]=r.defaults[n]);delete r.langCache,delete r.skinCache,r.skinnable&&e._addSkin(e.skin.defaultSkin,r.name)}},REGEX_CSS:/\.css(?:[?;].