Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Gallery Build Tag: gallery-2012.10.03-20-02

  • Loading branch information...
commit 3bf4de74b9b02d8ff5d0a7c5d9f34d6952b29b5b 1 parent a2fbc6d
YUI Builder authored
Showing with 12,198 additions and 2,684 deletions.
  1. +159 −119 build/gallery-anim-native/gallery-anim-native-coverage.js
  2. +62 −37 build/gallery-anim-native/gallery-anim-native-debug.js
  3. +1 −1  build/gallery-anim-native/gallery-anim-native-min.js
  4. +62 −37 build/gallery-anim-native/gallery-anim-native.js
  5. +6 −0 build/gallery-bottle/assets/gallery-bottle-core.css
  6. +1 −1  build/gallery-bottle/assets/skins/sam/gallery-bottle.css
  7. +115 −63 build/gallery-bottle/gallery-bottle-coverage.js
  8. +50 −13 build/gallery-bottle/gallery-bottle-debug.js
  9. +1 −1  build/gallery-bottle/gallery-bottle-min.js
  10. +50 −13 build/gallery-bottle/gallery-bottle.js
  11. +6 −0 build/gallery-bt-carousel/assets/gallery-bottle-core.css
  12. +81 −60 build/gallery-bt-carousel/gallery-bt-carousel-coverage.js
  13. +22 −6 build/gallery-bt-carousel/gallery-bt-carousel-debug.js
  14. +1 −1  build/gallery-bt-carousel/gallery-bt-carousel-min.js
  15. +22 −6 build/gallery-bt-carousel/gallery-bt-carousel.js
  16. +6 −0 build/gallery-bt-container/assets/gallery-bottle-core.css
  17. +150 −75 build/gallery-bt-container/gallery-bt-container-coverage.js
  18. +64 −10 build/gallery-bt-container/gallery-bt-container-debug.js
  19. +1 −1  build/gallery-bt-container/gallery-bt-container-min.js
  20. +64 −10 build/gallery-bt-container/gallery-bt-container.js
  21. +6 −0 build/gallery-bt-css/assets/gallery-bottle-core.css
  22. +6 −0 build/gallery-bt-device/assets/gallery-bottle-core.css
  23. +89 −49 build/gallery-bt-device/gallery-bt-device-coverage.js
  24. +32 −2 build/gallery-bt-device/gallery-bt-device-debug.js
  25. +1 −1  build/gallery-bt-device/gallery-bt-device-min.js
  26. +32 −2 build/gallery-bt-device/gallery-bt-device.js
  27. +6 −0 build/gallery-bt-loader/assets/gallery-bottle-core.css
  28. +6 −0 build/gallery-bt-overlay/assets/gallery-bottle-core.css
  29. +165 −232 build/gallery-bt-overlay/gallery-bt-overlay-coverage.js
  30. +61 −100 build/gallery-bt-overlay/gallery-bt-overlay-debug.js
  31. +1 −1  build/gallery-bt-overlay/gallery-bt-overlay-min.js
  32. +61 −100 build/gallery-bt-overlay/gallery-bt-overlay.js
  33. +6 −0 build/gallery-bt-page/assets/gallery-bottle-core.css
  34. +116 −26 build/gallery-bt-page/gallery-bt-page-coverage.js
  35. +81 −9 build/gallery-bt-page/gallery-bt-page-debug.js
  36. +1 −1  build/gallery-bt-page/gallery-bt-page-min.js
  37. +81 −9 build/gallery-bt-page/gallery-bt-page.js
  38. +6 −0 build/gallery-bt-photogrid/assets/gallery-bottle-core.css
  39. +83 −86 build/gallery-bt-photogrid/gallery-bt-photogrid-coverage.js
  40. +1 −4 build/gallery-bt-photogrid/gallery-bt-photogrid-debug.js
  41. +1 −1  build/gallery-bt-photogrid/gallery-bt-photogrid-min.js
  42. +1 −4 build/gallery-bt-photogrid/gallery-bt-photogrid.js
  43. +6 −0 build/gallery-bt-pushpop/assets/gallery-bottle-core.css
  44. +186 −138 build/gallery-bt-pushpop/gallery-bt-pushpop-coverage.js
  45. +63 −19 build/gallery-bt-pushpop/gallery-bt-pushpop-debug.js
  46. +1 −1  build/gallery-bt-pushpop/gallery-bt-pushpop-min.js
  47. +63 −19 build/gallery-bt-pushpop/gallery-bt-pushpop.js
  48. +6 −0 build/gallery-bt-shortcut/assets/gallery-bottle-core.css
  49. +227 −176 build/gallery-bt-shortcut/gallery-bt-shortcut-coverage.js
  50. +68 −31 build/gallery-bt-shortcut/gallery-bt-shortcut-debug.js
  51. +1 −1  build/gallery-bt-shortcut/gallery-bt-shortcut-min.js
  52. +68 −31 build/gallery-bt-shortcut/gallery-bt-shortcut.js
  53. +6 −0 build/gallery-bt-slidetab/assets/gallery-bottle-core.css
  54. +73 −61 build/gallery-bt-slidetab/gallery-bt-slidetab-coverage.js
  55. +13 −3 build/gallery-bt-slidetab/gallery-bt-slidetab-debug.js
  56. +1 −1  build/gallery-bt-slidetab/gallery-bt-slidetab-min.js
  57. +13 −3 build/gallery-bt-slidetab/gallery-bt-slidetab.js
  58. +6 −0 build/gallery-bt-syncscroll/assets/gallery-bottle-core.css
  59. +44 −73 build/gallery-bt-syncscroll/gallery-bt-syncscroll-coverage.js
  60. +10 −35 build/gallery-bt-syncscroll/gallery-bt-syncscroll-debug.js
  61. +1 −1  build/gallery-bt-syncscroll/gallery-bt-syncscroll-min.js
  62. +10 −35 build/gallery-bt-syncscroll/gallery-bt-syncscroll.js
  63. +7 −0 build/gallery-bulkedit/assets/gallery-bulkedit-core.css
  64. +1 −1  build/gallery-bulkedit/assets/skins/sam/gallery-bulkedit.css
  65. +3,803 −0 build/gallery-bulkedit/gallery-bulkedit-coverage.js
  66. +207 −19 build/gallery-bulkedit/gallery-bulkedit-debug.js
  67. +4 −4 build/gallery-bulkedit/gallery-bulkedit-min.js
  68. +207 −19 build/gallery-bulkedit/gallery-bulkedit.js
  69. +236 −0 build/gallery-event-selection/gallery-event-selection-coverage.js
  70. +106 −102 build/gallery-event-selection/gallery-event-selection-debug.js
  71. +1 −1  build/gallery-event-selection/gallery-event-selection-min.js
  72. +106 −102 build/gallery-event-selection/gallery-event-selection.js
  73. +1,158 −0 build/gallery-flyweight-tree/gallery-flyweight-tree-coverage.js
  74. +891 −0 build/gallery-flyweight-tree/gallery-flyweight-tree-debug.js
  75. +2 −0  build/gallery-flyweight-tree/gallery-flyweight-tree-min.js
  76. +891 −0 build/gallery-flyweight-tree/gallery-flyweight-tree.js
  77. +17 −0 build/gallery-fwt-treeview/assets/gallery-fwt-treeview-core.css
  78. +76 −0 build/gallery-fwt-treeview/assets/skins/sam/gallery-fwt-treeview-skin.css
  79. +1 −0  build/gallery-fwt-treeview/assets/skins/sam/gallery-fwt-treeview.css
  80. BIN  build/gallery-fwt-treeview/assets/skins/sam/treeview-loading.gif
  81. BIN  build/gallery-fwt-treeview/assets/skins/sam/treeview-sprite.gif
  82. BIN  build/gallery-fwt-treeview/assets/skins/sam/treeview-sprite.png
  83. +402 −0 build/gallery-fwt-treeview/gallery-fwt-treeview-coverage.js
  84. +315 −0 build/gallery-fwt-treeview/gallery-fwt-treeview-debug.js
  85. +1 −0  build/gallery-fwt-treeview/gallery-fwt-treeview-min.js
  86. +315 −0 build/gallery-fwt-treeview/gallery-fwt-treeview.js
  87. +12 −5 build/gallery-itsatoolbar/assets/gallery-itsatoolbar-core.css
  88. +1 −1  build/gallery-itsatoolbar/assets/skins/sam/gallery-itsatoolbar.css
  89. +740 −694 build/gallery-itsatoolbar/gallery-itsatoolbar-coverage.js
  90. +65 −27 build/gallery-itsatoolbar/gallery-itsatoolbar-debug.js
Sorry, we could not display the entire diff because it was too big.
View
278 build/gallery-anim-native/gallery-anim-native-coverage.js
@@ -26,11 +26,11 @@ _yuitest_coverage["/build/gallery-anim-native/gallery-anim-native.js"] = {
path: "/build/gallery-anim-native/gallery-anim-native.js",
code: []
};
-_yuitest_coverage["/build/gallery-anim-native/gallery-anim-native.js"].code=["YUI.add('gallery-anim-native', function(Y) {","","/**","* The Animation Utility provides an API for creating advanced transitions.","*","* W3C CSS Animations:","* http://www.w3.org/TR/css3-animations/","*","* Easing method values from AliceJS:","* http://blackberry.github.com/Alice/","*","* Browser support:","* http://caniuse.com/#feat=css-animation","* IE10+, FF5+, Chrome 4+, Safari/iOS 4+, Android 2.1+","*","* @module anim-native","*/","","/**","* Provides the CSS3 Native Anim class, for animating CSS properties.","*","* @module anim","* @submodule anim-native","*/"," \"use strict\";"," /*global Y:true */"," /*jslint regexp: true*/"," var VENDOR = ['', 'webkit', 'Moz', 'O', 'ms'].filter(function (prefix) {"," return Y.config.doc.body.style.hasOwnProperty(prefix + 'Animation');"," })[0],"," PREFIX = VENDOR ? '-' + VENDOR.toLowerCase() + '-' : VENDOR,"," ANIMATION_END_VENDORS = {"," webkit: 'webkitAnimationEnd',"," O: 'oAnimationEnd'"," },"," ANIMATION_END_EVENT = 'animationend',"," ANIMATION_END = ANIMATION_END_VENDORS[VENDOR] || ANIMATION_END_EVENT,",""," /**"," * A class for constructing animation instances."," * @class Anim"," * @for Anim"," * @constructor"," * @extends Base"," */"," Anim = function () {"," Anim.superclass.constructor.apply(this, arguments);"," };",""," Y.Node.DOM_EVENTS[ANIMATION_END] = 1;",""," Anim.NAME = 'animNative';"," Anim.DIRECTIONS = {"," normal: ['normal', 'reverse'],"," alternate: ['alternate', 'alternate-reverse']"," };"," Anim.EASINGS = {"," easeNone: {p1: 0.250, p2: 0.250, p3: 0.750, p4: 0.750},"," easeIn: {p1: 0.420, p2: 0.000, p3: 1.000, p4: 1.000},"," easeOut: {p1: 0.000, p2: 0.000, p3: 0.580, p4: 1.000},"," easeBoth: {p1: 0.420, p2: 0.000, p3: 0.580, p4: 1.000},"," easeInStrong: {p1: 0.895, p2: 0.030, p3: 0.685, p4: 0.220},"," easeOutStrong: {p1: 0.165, p2: 0.840, p3: 0.440, p4: 1.000},"," easeBothStrong: {p1: 0.770, p2: 0.000, p3: 0.175, p4: 1.000},"," backOut: {p1: 0.175, p2: 0.885, p3: 0.320, p4: 1.275},"," backBoth: {p1: 0.680, p2: -0.550, p3: 0.265, p4: 1.550},",""," // FIXME: Defaulting these to linear"," elasticIn: {p1: 0.250, p2: 0.250, p3: 0.750, p4: 0.750},"," elasticOut: {p1: 0.250, p2: 0.250, p3: 0.750, p4: 0.750},"," elasticBoth: {p1: 0.250, p2: 0.250, p3: 0.750, p4: 0.750},"," backIn: {p1: 0.250, p2: 0.250, p3: 0.750, p4: 0.750},"," bounceIn: {p1: 0.250, p2: 0.250, p3: 0.750, p4: 0.750},"," bounceOut: {p1: 0.250, p2: 0.250, p3: 0.750, p4: 0.750},"," bounceBoth: {p1: 0.250, p2: 0.250, p3: 0.750, p4: 0.750}"," };",""," Anim.RE_UNITS = /^(-?\\d*\\.?\\d*){1}(em|ex|px|in|cm|mm|pt|pc|%)*$/;",""," /**"," * Regex of properties that should use the default unit."," *"," * @property RE_DEFAULT_UNIT"," * @static"," */"," Anim.RE_DEFAULT_UNIT = /^width|height|top|right|bottom|left|margin.*|padding.*|border.*$/i;",""," /**"," * The default unit to use with properties that pass the RE_DEFAULT_UNIT test."," *"," * @property DEFAULT_UNIT"," * @static"," */"," Anim.DEFAULT_UNIT = 'px';",""," Anim._easing = function (name) {"," var e = Anim.EASINGS[name];"," return 'cubic-bezier(' + e.p1 + ', ' + e.p2 + ', ' + e.p3 + ', ' + e.p4 + ')';"," };",""," Anim._toHyphen = function (property) {"," property = property.replace(/([A-Z]?)([a-z]+)([A-Z]?)/g, function (m0, m1, m2, m3) {"," var str = ((m1) ? '-' + m1.toLowerCase() : '') + m2;",""," if (m3) {"," str += '-' + m3.toLowerCase();"," }",""," return str;"," });",""," return property;"," };",""," Anim._insert = function (rule) {"," var doc = Y.config.doc,"," ruleNum,"," style;",""," if (doc.styleSheets && doc.styleSheets.length) {"," ruleNum = 0;"," try {"," if (doc.styleSheets[0].cssRules.length > 0) {"," ruleNum = doc.styleSheets[0].cssRules.length;"," }"," doc.styleSheets[0].insertRule(rule, ruleNum);"," } catch (e) {"," }"," } else {"," style = doc.createElement(\"style\");"," style.innerHTML = rule;"," doc.head.appendChild(style);"," }"," };",""," Anim._delete = function (ruleName) {"," var doc = Y.config.doc,"," cssrules = doc.all ? \"rules\" : \"cssRules\","," i;",""," for (i = 0; i < doc.styleSheets[0][cssrules].length; i += 1) {"," if (doc.styleSheets[0][cssrules][i].name === ruleName) {"," doc.styleSheets[0].deleteRule(i);"," break;"," }"," }"," };",""," Anim.ATTRS = {"," /**"," * The object to be animated."," * @attribute node"," * @type Node"," */"," node: {"," setter: function (node) {"," if (node) {"," if (typeof node === 'string' || node.nodeType) {"," node = Y.one(node);"," }"," }",""," this._node = node;"," if (!node) {"," }"," return node;"," }"," },",""," /**"," * The length of the animation. Defaults to \"1\" (second)."," * @attribute duration"," * @type NUM"," */"," duration: {"," value: 1"," },",""," /**"," * The method that will provide values to the attribute(s) during the animation."," * Defaults to \"easeNone\"."," * @attribute easing"," * @type Function"," */"," easing: {"," value: 'easeNone',"," setter: function (e) {"," return Anim._easing(e);"," }"," },",""," /**"," * The starting values for the animated properties."," *"," * Fields may be strings, numbers, or functions."," * If a function is used, the return value becomes the from value."," * If no from value is specified, the DEFAULT_GETTER will be used."," * Supports any unit, provided it matches the \"to\" (or default)"," * unit (e.g. `{width: '10em', color: 'rgb(0, 0, 0)', borderColor: '#ccc'}`)."," *"," * If using the default ('px' for length-based units), the unit may be omitted"," * (e.g. `{width: 100}, borderColor: 'ccc'}`, which defaults to pixels"," * and hex, respectively)."," *"," * @attribute from"," * @type Object"," */"," from: {"," value: {}"," },",""," /**"," * The keyframes between 0 and 100%."," *"," * Example: {'50%': {"," * width: 200"," * }}"," *"," * @attribute to"," * @type Object"," */"," frames: {"," value: {}"," },",""," /**"," * The ending values for the animated properties."," *"," * Fields may be strings, numbers, or functions."," * Supports any unit, provided it matches the \"from\" (or default)"," * unit (e.g. `{width: '50%', color: 'red', borderColor: '#ccc'}`)."," *"," * If using the default ('px' for length-based units), the unit may be omitted"," * (e.g. `{width: 100, borderColor: 'ccc'}`, which defaults to pixels"," * and hex, respectively)."," *"," * @attribute to"," * @type Object"," */"," to: {"," value: {}"," },",""," /**"," * Date stamp for the first frame of the animation."," * @attribute startTime"," * @type Int"," * @default 0"," * @readOnly"," */"," startTime: {"," value: 0,"," readOnly: true"," },",""," /**"," * Current time the animation has been running."," * @attribute elapsedTime"," * @type Int"," * @default 0"," * @readOnly"," */"," elapsedTime: {"," value: 0,"," readOnly: true"," },",""," /**"," * Whether or not the animation is currently running."," * @attribute running"," * @type Boolean"," * @default false"," * @readOnly"," */"," running: {"," getter: function () {"," return this.get('node').getStyle(VENDOR + \"AnimationName\") !== 'none';"," },"," value: false,"," readOnly: true"," },",""," /**"," * The number of seconds to delay the animation"," * @attribute delay"," * @type Int"," * @default 0"," */"," delay: {"," value: 0"," },",""," /**"," * The number of times the animation should run. 'infinite' or integer."," * @attribute iterations"," * @type Int"," * @default 1"," */"," iterations: {"," value: 1"," },",""," /**"," * The number of iterations that have occurred."," * Resets when an animation ends (reaches iteration count or stop() called)."," *"," * Note: no way to update this mid animation."," *"," * @attribute iterationCount"," * @type Int"," * @default 0"," * @readOnly"," */"," iterationCount: {"," value: 0,"," readOnly: true"," },",""," /**"," * How iterations of the animation should behave."," * Possible values are \"normal\" and \"alternate\"."," * Normal will repeat the animation, alternate will reverse on every other pass."," *"," * @attribute direction"," * @type String"," * @default \"normal\""," */"," direction: {"," value: 'normal' // | alternate (fwd on odd, rev on even per spec)"," },",""," /**"," * Whether or not the animation is currently paused."," * @attribute paused"," * @type Boolean"," * @default false"," * @readOnly"," */"," paused: {"," getter: function () {"," return this.get('node').getStyle(VENDOR + \"AnimationPlayState\") === 'paused';"," },"," readOnly: true,"," value: false"," },",""," /**"," * If true, animation begins from last frame"," * @attribute reverse"," * @type Boolean"," * @default false"," */"," reverse: {"," value: false"," },",""," /**"," * Perspective depth"," * @attribute perspective"," * @type int"," * @default 1000"," */"," perspective: {"," value: 1000"," },",""," /**"," * X/Y axis origin"," * @attribute perspectiveOrigin"," * @type String"," * @default 'center center'"," */"," perspectiveOrigin: {"," value: 'center center'"," },",""," /**"," * If 'visible' the element is show when not facing the screen. If 'hidden' the"," * element will be invisible when not facing the screen."," * @attribute backfaceVisibility"," * @type String"," * @default 'visible'"," */"," backfaceVisibility: {"," value: 'visible'"," }"," };",""," Y.extend(Anim, Y.Base, {"," initializer: function (config) {},",""," /**"," * Starts or resumes an animation."," * @method run"," * @chainable"," */"," run: function () {"," if (this.get('paused')) {"," this._resume();"," } else if (!this.get('running')) {"," this._start();"," }"," return this;"," },",""," /**"," * Pauses the animation and"," * freezes it in its current state and time."," * Calling run() will continue where it left off."," * @method pause"," * @chainable"," */"," pause: function () {"," if (this.get('running')) {"," this.get('node').setStyle(VENDOR + \"AnimationPlayState\", 'paused');"," this.fire('pause');"," }"," return this;"," },",""," /**"," * Stops the animation and resets its time."," * @method stop"," * @param {Boolean} finish If true, the animation will move to the last frame"," * @chainable"," */"," stop: function (finish) {"," this._end();"," return this;"," },",""," _resume: function () {"," this.get('node').setStyle(VENDOR + \"AnimationPlayState\", 'running');"," this.fire('resume');"," },",""," /**"," * Initializes animation. Inserts keyframes into DOM and updates node styles."," */"," _start: function () {"," var node = this.get('node'),"," parent = node.get('parentNode'),"," name = 'anim-' + Y.guid(),"," direction = Anim.DIRECTIONS[this.get('direction')][+this.get('reverse')],"," from = this.get('from'),"," to = this.get('to'),"," frames = this.get('frames'),"," keyframes = {},"," res,"," frame;",""," keyframes['0%'] = from;"," keyframes = Y.merge(keyframes, frames);"," keyframes['100%'] = to;",""," res = this._render(node, name, keyframes);",""," // Apply last animation frame styles"," if (this.get('iterations') !== 'infinite') {"," frame = this.get('iterations') % (2 - this.get('reverse')) * 100;"," node.setStyles(res.styles[frame + '%']);"," }",""," Anim._insert(res.css);",""," this.set('iterationCount', 0);",""," parent.setStyle(VENDOR + \"Perspective\", this.get('perspective') + \"px\");"," parent.setStyle(VENDOR + \"PerspectiveOrigin\", this.get('perspectiveOrigin'));"," node.setStyle(VENDOR + \"AnimationDuration\", this.get('duration') + 's');"," node.setStyle(VENDOR + \"AnimationTimingFunction\", this.get('easing'));"," node.setStyle(VENDOR + \"AnimationDelay\", this.get('delay') + 's');"," node.setStyle(VENDOR + \"AnimationIterationCount\", this.get('iterations'));"," node.setStyle(VENDOR + \"AnimationDirection\", direction);"," node.setStyle(VENDOR + \"AnimationPlayState\", 'running');"," node.setStyle(VENDOR + \"BackfaceVisibility\", this.get('backfaceVisibility'));"," node.setStyle(VENDOR + \"AnimationName\", name);",""," this.fire('start');"," this._sub = node.on(ANIMATION_END, this._end, this);"," },",""," _end: function () {"," var node = this.get('node'),"," name = node.getStyle(VENDOR + \"AnimationName\");",""," node.detach(ANIMATION_END, this._end);",""," node.setStyle(VENDOR + \"AnimationName\", \"none\");"," node.setStyle(VENDOR + \"AnimationDuration\", \"0s\");"," node.setStyle(VENDOR + \"AnimationTimingFunction\", \"ease\");"," node.setStyle(VENDOR + \"AnimationDelay\", \"0s\");"," node.setStyle(VENDOR + \"AnimationIterationCount\", \"1\");"," node.setStyle(VENDOR + \"AnimationDirection\", \"normal\");"," node.setStyle(VENDOR + \"AnimationPlayState\", \"running\");"," node.setStyle(VENDOR + \"BackfaceVisibility\", 'visible');",""," // TODO: Restore parent node perspective?",""," this.set('iterationCount', this.get('iterations'));",""," Anim._delete(name);"," this.fire('end', {elapsed: this.get('elapsedTime')});"," },",""," /**"," * Generate CSS keyframes string and meta data."," */"," _render: function (node, name, keyframes) {"," var css = ['@' + PREFIX + 'keyframes ' + name + ' {'],"," styles = {};",""," Y.Object.each(keyframes, function (props, key) {"," css.push('\\t' + key + ' {');"," styles[key] = {};",""," Y.Object.each(props, function (value, prop) {"," var parsed;",""," if (typeof value === 'function') {"," value = value.call(this, node);"," }",""," if (Anim.RE_DEFAULT_UNIT.test(prop)) {"," parsed = Anim.RE_UNITS.exec(value);",""," if (parsed && !parsed[2]) {"," value += Anim.DEFAULT_UNIT;"," }"," }",""," styles[key][prop] = value;"," css.push('\\t\\t' + Anim._toHyphen(prop) + ': ' + value + ';');"," }, this);",""," css.push('\\t}');"," }, this);",""," css.push('}');"," return {css: css.join('\\n'), styles: styles};"," },",""," destructor: function () {"," this.get('node').detach(ANIMATION_END, this._end);"," }"," });",""," Y.Anim = Anim;"," Y.AnimNative = Anim;","","","}, 'gallery-2012.09.26-20-36' ,{skinnable:false});"];
-_yuitest_coverage["/build/gallery-anim-native/gallery-anim-native.js"].lines = {"1":0,"25":0,"28":0,"29":0,"47":0,"50":0,"52":0,"53":0,"57":0,"78":0,"86":0,"94":0,"96":0,"97":0,"98":0,"101":0,"102":0,"103":0,"105":0,"106":0,"109":0,"112":0,"115":0,"116":0,"120":0,"121":0,"122":0,"123":0,"124":0,"126":0,"130":0,"131":0,"132":0,"136":0,"137":0,"141":0,"142":0,"143":0,"144":0,"149":0,"157":0,"158":0,"159":0,"163":0,"164":0,"166":0,"188":0,"277":0,"341":0,"389":0,"398":0,"399":0,"400":0,"401":0,"403":0,"414":0,"415":0,"416":0,"418":0,"428":0,"429":0,"433":0,"434":0,"441":0,"452":0,"453":0,"454":0,"456":0,"459":0,"460":0,"461":0,"464":0,"466":0,"468":0,"469":0,"470":0,"471":0,"472":0,"473":0,"474":0,"475":0,"476":0,"477":0,"479":0,"480":0,"484":0,"487":0,"489":0,"490":0,"491":0,"492":0,"493":0,"494":0,"495":0,"496":0,"500":0,"502":0,"503":0,"510":0,"513":0,"514":0,"515":0,"517":0,"518":0,"520":0,"521":0,"524":0,"525":0,"527":0,"528":0,"532":0,"533":0,"536":0,"539":0,"540":0,"544":0,"548":0,"549":0};
-_yuitest_coverage["/build/gallery-anim-native/gallery-anim-native.js"].functions = {"(anonymous 2):28":0,"Anim:46":0,"_easing:96":0,"(anonymous 3):102":0,"_toHyphen:101":0,"_insert:115":0,"_delete:136":0,"setter:156":0,"setter:187":0,"getter:276":0,"getter:340":0,"run:397":0,"pause:413":0,"stop:427":0,"_resume:432":0,"_start:440":0,"_end:483":0,"(anonymous 5):517":0,"(anonymous 4):513":0,"_render:509":0,"destructor:543":0,"(anonymous 1):1":0};
-_yuitest_coverage["/build/gallery-anim-native/gallery-anim-native.js"].coveredLines = 118;
-_yuitest_coverage["/build/gallery-anim-native/gallery-anim-native.js"].coveredFunctions = 22;
+_yuitest_coverage["/build/gallery-anim-native/gallery-anim-native.js"].code=["YUI.add('gallery-anim-native', function(Y) {","","/**","* The Animation Utility provides an API for creating advanced transitions.","*","* W3C CSS Animations:","* http://www.w3.org/TR/css3-animations/","*","* Easing method values from AliceJS:","* http://blackberry.github.com/Alice/","*","* Browser support:","* http://caniuse.com/#feat=css-animation","* IE10+, FF5+, Chrome 4+, Safari/iOS 4+, Android 2.1+","*","* @module anim-native","*/","","/**","* Provides the CSS3 Native Anim class, for animating CSS properties.","*","* @module anim","* @submodule anim-native","*/"," \"use strict\";"," /*global Y:true */"," /*jslint regexp: true*/"," var VENDOR = ['', 'Webkit', 'Moz', 'O', 'ms'].filter(function (prefix) {"," return Y.config.doc.body.style.hasOwnProperty(prefix + 'Animation');"," })[0],"," PREFIX = VENDOR ? '-' + VENDOR.toLowerCase() + '-' : VENDOR,"," ANIMATION_END_VENDORS = {"," Webkit: 'webkitAnimationEnd',"," O: 'oAnimationEnd'"," },"," ANIMATION_END_EVENT = 'animationend',"," ANIMATION_END = ANIMATION_END_VENDORS[VENDOR] || ANIMATION_END_EVENT,",""," /**"," * A class for constructing animation instances."," * @class Anim"," * @for Anim"," * @constructor"," * @extends Base"," */"," Anim = function () {"," Anim.superclass.constructor.apply(this, arguments);"," };",""," Y.Node.DOM_EVENTS[ANIMATION_END] = 1;",""," Anim.NAME = 'animNative';"," Anim.DIRECTIONS = {"," normal: ['normal', 'reverse'],"," alternate: ['alternate', 'alternate-reverse']"," };"," Anim.EASINGS = {"," easeNone: {p1: 0.250, p2: 0.250, p3: 0.750, p4: 0.750},"," easeIn: {p1: 0.420, p2: 0.000, p3: 1.000, p4: 1.000},"," easeOut: {p1: 0.000, p2: 0.000, p3: 0.580, p4: 1.000},"," easeBoth: {p1: 0.420, p2: 0.000, p3: 0.580, p4: 1.000},"," easeInStrong: {p1: 0.895, p2: 0.030, p3: 0.685, p4: 0.220},"," easeOutStrong: {p1: 0.165, p2: 0.840, p3: 0.440, p4: 1.000},"," easeBothStrong: {p1: 0.770, p2: 0.000, p3: 0.175, p4: 1.000},"," backIn: {p1: 0.600, p2: -0.280, p3: 0.735, p4: 0.045},"," backOut: {p1: 0.175, p2: 0.885, p3: 0.320, p4: 1.275},"," backBoth: {p1: 0.680, p2: -0.550, p3: 0.265, p4: 1.550},",""," // FIXME: Defaulting these to linear"," elasticIn: {p1: 0.250, p2: 0.250, p3: 0.750, p4: 0.750},"," elasticOut: {p1: 0.250, p2: 0.250, p3: 0.750, p4: 0.750},"," elasticBoth: {p1: 0.250, p2: 0.250, p3: 0.750, p4: 0.750},"," bounceIn: {p1: 0.250, p2: 0.250, p3: 0.750, p4: 0.750},"," bounceOut: {p1: 0.250, p2: 0.250, p3: 0.750, p4: 0.750},"," bounceBoth: {p1: 0.250, p2: 0.250, p3: 0.750, p4: 0.750}"," };",""," Anim.RE_UNITS = /^(-?\\d*\\.?\\d*){1}(em|ex|px|in|cm|mm|pt|pc|%)*$/;",""," /**"," * Regex of properties that should use the default unit."," *"," * @property RE_DEFAULT_UNIT"," * @static"," */"," Anim.RE_DEFAULT_UNIT = /^width|height|top|right|bottom|left|margin.*|padding.*|border.*$/i;",""," /**"," * The default unit to use with properties that pass the RE_DEFAULT_UNIT test."," *"," * @property DEFAULT_UNIT"," * @static"," */"," Anim.DEFAULT_UNIT = 'px';",""," Anim._easing = function (name) {"," var e = Anim.EASINGS[name];"," return 'cubic-bezier(' + e.p1 + ', ' + e.p2 + ', ' + e.p3 + ', ' + e.p4 + ')';"," };",""," Anim._toHyphen = function (property) {"," property = property.replace(/([A-Z]?)([a-z]+)([A-Z]?)/g, function (m0, m1, m2, m3) {"," var str = ((m1) ? '-' + m1.toLowerCase() : '') + m2;",""," if (m3) {"," str += '-' + m3.toLowerCase();"," }",""," return str;"," });",""," return property;"," };",""," Anim._insert = function (rule) {"," var doc = Y.config.doc,"," ruleNum,"," style;",""," if (doc.styleSheets && doc.styleSheets.length) {"," ruleNum = 0;"," try {"," if (doc.styleSheets[0].cssRules.length > 0) {"," ruleNum = doc.styleSheets[0].cssRules.length;"," }"," doc.styleSheets[0].insertRule(rule, ruleNum);"," } catch (e) {"," }"," } else {"," style = doc.createElement('style');"," style.innerHTML = rule;"," doc.head.appendChild(style);"," }"," };",""," Anim._delete = function (ruleName) {"," var doc = Y.config.doc,"," cssrules = doc.all ? 'rules' : 'cssRules',"," i;",""," for (i = 0; i < doc.styleSheets[0][cssrules].length; i += 1) {"," if (doc.styleSheets[0][cssrules][i].name === ruleName) {"," doc.styleSheets[0].deleteRule(i);"," break;"," }"," }"," };",""," Anim.ATTRS = {"," /**"," * The object to be animated."," * @attribute node"," * @type Node"," */"," node: {"," setter: function (node) {"," if (node) {"," if (typeof node === 'string' || node.nodeType) {"," node = Y.one(node);"," }"," }",""," this._node = node;"," if (!node) {"," }"," return node;"," }"," },",""," /**"," * The length of the animation. Defaults to \"1\" (second)."," * @attribute duration"," * @type NUM"," */"," duration: {"," value: 1"," },",""," /**"," * The method that will provide values to the attribute(s) during the animation."," * Defaults to \"easeNone\"."," * @attribute easing"," * @type Function"," */"," easing: {"," value: 'easeNone',"," setter: function (e) {"," return Anim._easing(e);"," }"," },",""," /**"," * The starting values for the animated properties."," *"," * Fields may be strings, numbers, or functions."," * If a function is used, the return value becomes the from value."," * If no from value is specified, the DEFAULT_GETTER will be used."," * Supports any unit, provided it matches the \"to\" (or default)"," * unit (e.g. `{width: '10em', color: 'rgb(0, 0, 0)', borderColor: '#ccc'}`)."," *"," * If using the default ('px' for length-based units), the unit may be omitted"," * (e.g. `{width: 100}, borderColor: 'ccc'}`, which defaults to pixels"," * and hex, respectively)."," *"," * @attribute from"," * @type Object"," */"," from: {"," value: {}"," },",""," /**"," * The keyframes between 0 and 100%."," *"," * Example: {'50%': {"," * width: 200"," * }}"," *"," * @attribute to"," * @type Object"," */"," frames: {"," value: {}"," },",""," /**"," * The ending values for the animated properties."," *"," * Fields may be strings, numbers, or functions."," * Supports any unit, provided it matches the \"from\" (or default)"," * unit (e.g. `{width: '50%', color: 'red', borderColor: '#ccc'}`)."," *"," * If using the default ('px' for length-based units), the unit may be omitted"," * (e.g. `{width: 100, borderColor: 'ccc'}`, which defaults to pixels"," * and hex, respectively)."," *"," * @attribute to"," * @type Object"," */"," to: {"," value: {}"," },",""," /**"," * Date stamp for the first frame of the animation."," * @attribute startTime"," * @type Int"," * @default 0"," * @readOnly"," */"," startTime: {"," value: 0,"," readOnly: true"," },",""," /**"," * Current time the animation has been running."," * @attribute elapsedTime"," * @type Int"," * @default 0"," * @readOnly"," */"," elapsedTime: {"," value: 0,"," readOnly: true"," },",""," /**"," * Whether or not the animation is currently running."," * @attribute running"," * @type Boolean"," * @default false"," * @readOnly"," */"," running: {"," getter: function () {"," return this.get('node').getStyle(VENDOR + 'AnimationName') !== 'none';"," },"," value: false,"," readOnly: true"," },",""," /**"," * The number of seconds to delay the animation"," * @attribute delay"," * @type Int"," * @default 0"," */"," delay: {"," value: 0"," },",""," /**"," * The number of times the animation should run. 'infinite' or integer."," * @attribute iterations"," * @type Int"," * @default 1"," */"," iterations: {"," value: 1"," },",""," /**"," * The number of iterations that have occurred."," * Resets when an animation ends (reaches iteration count or stop() called)."," *"," * Note: no way to update this mid animation."," *"," * @attribute iterationCount"," * @type Int"," * @default 0"," * @readOnly"," */"," iterationCount: {"," value: 0,"," readOnly: true"," },",""," /**"," * How iterations of the animation should behave."," * Possible values are \"normal\" and \"alternate\"."," * Normal will repeat the animation, alternate will reverse on every other pass."," *"," * @attribute direction"," * @type String"," * @default \"normal\""," */"," direction: {"," value: 'normal' // | alternate (fwd on odd, rev on even per spec)"," },",""," /**"," * Whether or not the animation is currently paused."," * @attribute paused"," * @type Boolean"," * @default false"," * @readOnly"," */"," paused: {"," getter: function () {"," return this.get('node').getStyle(VENDOR + 'AnimationPlayState') === 'paused';"," },"," readOnly: true,"," value: false"," },",""," /**"," * If true, animation begins from last frame"," * @attribute reverse"," * @type Boolean"," * @default false"," */"," reverse: {"," value: false"," },",""," /**"," * Perspective depth"," * @attribute perspective"," * @type int"," * @default 1000"," */"," perspective: {"," value: 1000"," },",""," /**"," * X/Y axis origin"," * @attribute perspectiveOrigin"," * @type String"," * @default 'center center'"," */"," perspectiveOrigin: {"," value: 'center center'"," },",""," /**"," * If 'visible' the element is show when not facing the screen. If 'hidden' the"," * element will be invisible when not facing the screen."," * @attribute backfaceVisibility"," * @type String"," * @default 'visible'"," */"," backfaceVisibility: {"," value: 'visible'"," }"," };",""," Y.extend(Anim, Y.Base, {"," initializer: function (config) {"," this._sub = null;"," },",""," /**"," * Starts or resumes an animation."," * @method run"," * @chainable"," */"," run: function () {"," if (this.get('paused')) {"," this._resume();"," } else if (!this.get('running')) {"," this._start();"," }"," return this;"," },",""," /**"," * Pauses the animation and"," * freezes it in its current state and time."," * Calling run() will continue where it left off."," * @method pause"," * @chainable"," */"," pause: function () {"," if (this.get('running')) {"," this.get('node').setStyle(VENDOR + 'AnimationPlayState', 'paused');"," this.fire('pause');"," }"," return this;"," },",""," /**"," * Stops the animation and resets its time."," * @method stop"," * @param {Boolean} finish If true, the animation will move to the last frame"," * @chainable"," */"," stop: function (finish) {"," this._end();"," return this;"," },",""," _resume: function () {"," this.get('node').setStyle(VENDOR + 'AnimationPlayState', 'running');"," this.fire('resume');"," },",""," /**"," * Initializes animation. Inserts keyframes into DOM and updates node styles."," */"," _start: function () {"," var node = this.get('node'),"," parent = node.get('parentNode'),"," name = 'anim-' + Y.guid(),"," direction = Anim.DIRECTIONS[this.get('direction')][+this.get('reverse')],"," from = this.get('from'),"," to = this.get('to'),"," frames = this.get('frames'),"," keyframes = {},"," res,"," frame,"," styles = {},"," parentStyles = {};",""," node.removeAttribute('style');"," node.setAttribute('style', '');",""," keyframes['0%'] = from;"," keyframes = Y.merge(keyframes, frames);"," keyframes['100%'] = to;",""," res = this._render(node, name, keyframes);",""," Anim._insert(res.css);",""," // Apply last animation frame styles"," if (this.get('iterations') !== 'infinite') {"," frame = this.get('iterations') % (2 - this.get('reverse')) * 100;"," Y.Object.each(res.styles[frame + '%'], function (value, prop) {"," styles[prop] = value;"," });"," }",""," this.set('iterationCount', 0);",""," parentStyles[VENDOR + 'Perspective'] = this.get('perspective') + 'px';"," parentStyles[VENDOR + 'PerspectiveOrigin'] = this.get('perspectiveOrigin');"," parent.setStyles(parentStyles);",""," styles[VENDOR + 'AnimationName'] = name;"," styles[VENDOR + 'AnimationDuration'] = this.get('duration') + 's';"," styles[VENDOR + 'AnimationTimingFunction'] = this.get('easing');"," styles[VENDOR + 'AnimationDelay'] = this.get('delay') + 's';"," styles[VENDOR + 'AnimationIterationCount'] = this.get('iterations');"," styles[VENDOR + 'AnimationDirection'] = direction;"," styles[VENDOR + 'AnimationPlayState'] = 'running';"," styles[VENDOR + 'BackfaceVisibility'] = this.get('backfaceVisibility');",""," node.setStyles(styles);",""," this.fire('start');"," this._sub = node.on(ANIMATION_END, Y.bind(this._end, this));"," },",""," _end: function () {"," var node = this.get('node'),"," name = node.getStyle(VENDOR + 'AnimationName'),"," styles = {};",""," if (this._sub) {"," this._sub.detach();"," this._sub = null;"," }",""," styles[VENDOR + 'AnimationName'] = '';"," styles[VENDOR + 'AnimationDuration'] = '';"," styles[VENDOR + 'AnimationTimingFunction'] = '';"," styles[VENDOR + 'AnimationDelay'] = '';"," styles[VENDOR + 'AnimationIterationCount'] = '';"," styles[VENDOR + 'AnimationDirection'] = '';"," styles[VENDOR + 'AnimationPlayState'] = '';"," styles[VENDOR + 'BackfaceVisibility'] = '';"," node.setStyles(styles);",""," // TODO: Restore parent node perspective?",""," this.set('iterationCount', this.get('iterations'));",""," Anim._delete(name);"," this.fire('end', {elapsed: this.get('elapsedTime')});"," },",""," /**"," * Generate CSS keyframes string and meta data."," */"," _render: function (node, name, keyframes) {"," var css = ['@' + PREFIX + 'keyframes ' + name + ' {'],"," styles = {};",""," Y.Object.each(keyframes, function (props, key) {"," css.push('\\t' + key + ' {');"," styles[key] = {};",""," Y.Object.each(props, function (value, prop) {"," var parsed;",""," if (typeof value === 'function') {"," value = value.call(this, node);"," }",""," if (Anim.RE_DEFAULT_UNIT.test(prop)) {"," parsed = Anim.RE_UNITS.exec(value);",""," if (parsed && !parsed[2]) {"," value += Anim.DEFAULT_UNIT;"," }"," }",""," if (prop === 'transform') {"," prop = VENDOR + 'Transform';"," }",""," styles[key][prop] = value;"," css.push('\\t\\t' + Anim._toHyphen(prop) + ': ' + value + ';');"," }, this);",""," css.push('\\t}');"," }, this);",""," css.push('}');"," return {css: css.join('\\n'), styles: styles};"," },",""," destructor: function () {"," if (this._sub) {"," this._sub.detach();"," this._sub = null;"," }"," }"," });",""," Y.Anim = Anim;"," Y.AnimNative = Anim;","","","}, 'gallery-2012.10.03-20-02' ,{skinnable:false});"];
+_yuitest_coverage["/build/gallery-anim-native/gallery-anim-native.js"].lines = {"1":0,"25":0,"28":0,"29":0,"47":0,"50":0,"52":0,"53":0,"57":0,"78":0,"86":0,"94":0,"96":0,"97":0,"98":0,"101":0,"102":0,"103":0,"105":0,"106":0,"109":0,"112":0,"115":0,"116":0,"120":0,"121":0,"122":0,"123":0,"124":0,"126":0,"130":0,"131":0,"132":0,"136":0,"137":0,"141":0,"142":0,"143":0,"144":0,"149":0,"157":0,"158":0,"159":0,"163":0,"164":0,"166":0,"188":0,"277":0,"341":0,"389":0,"391":0,"400":0,"401":0,"402":0,"403":0,"405":0,"416":0,"417":0,"418":0,"420":0,"430":0,"431":0,"435":0,"436":0,"443":0,"456":0,"457":0,"459":0,"460":0,"461":0,"463":0,"465":0,"468":0,"469":0,"470":0,"471":0,"475":0,"477":0,"478":0,"479":0,"481":0,"482":0,"483":0,"484":0,"485":0,"486":0,"487":0,"488":0,"490":0,"492":0,"493":0,"497":0,"501":0,"502":0,"503":0,"506":0,"507":0,"508":0,"509":0,"510":0,"511":0,"512":0,"513":0,"514":0,"518":0,"520":0,"521":0,"528":0,"531":0,"532":0,"533":0,"535":0,"536":0,"538":0,"539":0,"542":0,"543":0,"545":0,"546":0,"550":0,"551":0,"554":0,"555":0,"558":0,"561":0,"562":0,"566":0,"567":0,"568":0,"573":0,"574":0};
+_yuitest_coverage["/build/gallery-anim-native/gallery-anim-native.js"].functions = {"(anonymous 2):28":0,"Anim:46":0,"_easing:96":0,"(anonymous 3):102":0,"_toHyphen:101":0,"_insert:115":0,"_delete:136":0,"setter:156":0,"setter:187":0,"getter:276":0,"getter:340":0,"initializer:390":0,"run:399":0,"pause:415":0,"stop:429":0,"_resume:434":0,"(anonymous 4):470":0,"_start:442":0,"_end:496":0,"(anonymous 6):535":0,"(anonymous 5):531":0,"_render:527":0,"destructor:565":0,"(anonymous 1):1":0};
+_yuitest_coverage["/build/gallery-anim-native/gallery-anim-native.js"].coveredLines = 131;
+_yuitest_coverage["/build/gallery-anim-native/gallery-anim-native.js"].coveredFunctions = 24;
_yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 1);
YUI.add('gallery-anim-native', function(Y) {
@@ -62,14 +62,14 @@ _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 25);
/*global Y:true */
/*jslint regexp: true*/
_yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 28);
-var VENDOR = ['', 'webkit', 'Moz', 'O', 'ms'].filter(function (prefix) {
+var VENDOR = ['', 'Webkit', 'Moz', 'O', 'ms'].filter(function (prefix) {
_yuitest_coverfunc("/build/gallery-anim-native/gallery-anim-native.js", "(anonymous 2)", 28);
_yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 29);
return Y.config.doc.body.style.hasOwnProperty(prefix + 'Animation');
})[0],
PREFIX = VENDOR ? '-' + VENDOR.toLowerCase() + '-' : VENDOR,
ANIMATION_END_VENDORS = {
- webkit: 'webkitAnimationEnd',
+ Webkit: 'webkitAnimationEnd',
O: 'oAnimationEnd'
},
ANIMATION_END_EVENT = 'animationend',
@@ -107,6 +107,7 @@ Anim.EASINGS = {
easeInStrong: {p1: 0.895, p2: 0.030, p3: 0.685, p4: 0.220},
easeOutStrong: {p1: 0.165, p2: 0.840, p3: 0.440, p4: 1.000},
easeBothStrong: {p1: 0.770, p2: 0.000, p3: 0.175, p4: 1.000},
+ backIn: {p1: 0.600, p2: -0.280, p3: 0.735, p4: 0.045},
backOut: {p1: 0.175, p2: 0.885, p3: 0.320, p4: 1.275},
backBoth: {p1: 0.680, p2: -0.550, p3: 0.265, p4: 1.550},
@@ -114,7 +115,6 @@ Anim.EASINGS = {
elasticIn: {p1: 0.250, p2: 0.250, p3: 0.750, p4: 0.750},
elasticOut: {p1: 0.250, p2: 0.250, p3: 0.750, p4: 0.750},
elasticBoth: {p1: 0.250, p2: 0.250, p3: 0.750, p4: 0.750},
- backIn: {p1: 0.250, p2: 0.250, p3: 0.750, p4: 0.750},
bounceIn: {p1: 0.250, p2: 0.250, p3: 0.750, p4: 0.750},
bounceOut: {p1: 0.250, p2: 0.250, p3: 0.750, p4: 0.750},
bounceBoth: {p1: 0.250, p2: 0.250, p3: 0.750, p4: 0.750}
@@ -198,7 +198,7 @@ doc.styleSheets[0].insertRule(rule, ruleNum);
}
} else {
_yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 130);
-style = doc.createElement("style");
+style = doc.createElement('style');
_yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 131);
style.innerHTML = rule;
_yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 132);
@@ -211,7 +211,7 @@ Anim._delete = function (ruleName) {
_yuitest_coverfunc("/build/gallery-anim-native/gallery-anim-native.js", "_delete", 136);
_yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 137);
var doc = Y.config.doc,
- cssrules = doc.all ? "rules" : "cssRules",
+ cssrules = doc.all ? 'rules' : 'cssRules',
i;
_yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 141);
@@ -366,7 +366,7 @@ return Anim._easing(e);
getter: function () {
_yuitest_coverfunc("/build/gallery-anim-native/gallery-anim-native.js", "getter", 276);
_yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 277);
-return this.get('node').getStyle(VENDOR + "AnimationName") !== 'none';
+return this.get('node').getStyle(VENDOR + 'AnimationName') !== 'none';
},
value: false,
readOnly: true
@@ -432,7 +432,7 @@ return this.get('node').getStyle(VENDOR + "AnimationName") !== 'none';
getter: function () {
_yuitest_coverfunc("/build/gallery-anim-native/gallery-anim-native.js", "getter", 340);
_yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 341);
-return this.get('node').getStyle(VENDOR + "AnimationPlayState") === 'paused';
+return this.get('node').getStyle(VENDOR + 'AnimationPlayState') === 'paused';
},
readOnly: true,
value: false
@@ -482,7 +482,11 @@ return this.get('node').getStyle(VENDOR + "AnimationPlayState") === 'paused';
_yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 389);
Y.extend(Anim, Y.Base, {
- initializer: function (config) {},
+ initializer: function (config) {
+ _yuitest_coverfunc("/build/gallery-anim-native/gallery-anim-native.js", "initializer", 390);
+_yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 391);
+this._sub = null;
+ },
/**
* Starts or resumes an animation.
@@ -490,17 +494,17 @@ Y.extend(Anim, Y.Base, {
* @chainable
*/
run: function () {
- _yuitest_coverfunc("/build/gallery-anim-native/gallery-anim-native.js", "run", 397);
-_yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 398);
+ _yuitest_coverfunc("/build/gallery-anim-native/gallery-anim-native.js", "run", 399);
+_yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 400);
if (this.get('paused')) {
- _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 399);
+ _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 401);
this._resume();
- } else {_yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 400);
+ } else {_yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 402);
if (!this.get('running')) {
- _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 401);
+ _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 403);
this._start();
}}
- _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 403);
+ _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 405);
return this;
},
@@ -512,15 +516,15 @@ return this;
* @chainable
*/
pause: function () {
- _yuitest_coverfunc("/build/gallery-anim-native/gallery-anim-native.js", "pause", 413);
-_yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 414);
+ _yuitest_coverfunc("/build/gallery-anim-native/gallery-anim-native.js", "pause", 415);
+_yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 416);
if (this.get('running')) {
- _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 415);
-this.get('node').setStyle(VENDOR + "AnimationPlayState", 'paused');
- _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 416);
+ _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 417);
+this.get('node').setStyle(VENDOR + 'AnimationPlayState', 'paused');
+ _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 418);
this.fire('pause');
}
- _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 418);
+ _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 420);
return this;
},
@@ -531,18 +535,18 @@ return this;
* @chainable
*/
stop: function (finish) {
- _yuitest_coverfunc("/build/gallery-anim-native/gallery-anim-native.js", "stop", 427);
-_yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 428);
+ _yuitest_coverfunc("/build/gallery-anim-native/gallery-anim-native.js", "stop", 429);
+_yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 430);
this._end();
- _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 429);
+ _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 431);
return this;
},
_resume: function () {
- _yuitest_coverfunc("/build/gallery-anim-native/gallery-anim-native.js", "_resume", 432);
-_yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 433);
-this.get('node').setStyle(VENDOR + "AnimationPlayState", 'running');
- _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 434);
+ _yuitest_coverfunc("/build/gallery-anim-native/gallery-anim-native.js", "_resume", 434);
+_yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 435);
+this.get('node').setStyle(VENDOR + 'AnimationPlayState', 'running');
+ _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 436);
this.fire('resume');
},
@@ -550,8 +554,8 @@ this.fire('resume');
* Initializes animation. Inserts keyframes into DOM and updates node styles.
*/
_start: function () {
- _yuitest_coverfunc("/build/gallery-anim-native/gallery-anim-native.js", "_start", 440);
-_yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 441);
+ _yuitest_coverfunc("/build/gallery-anim-native/gallery-anim-native.js", "_start", 442);
+_yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 443);
var node = this.get('node'),
parent = node.get('parentNode'),
name = 'anim-' + Y.guid(),
@@ -561,94 +565,119 @@ var node = this.get('node'),
frames = this.get('frames'),
keyframes = {},
res,
- frame;
+ frame,
+ styles = {},
+ parentStyles = {};
+
+ _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 456);
+node.removeAttribute('style');
+ _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 457);
+node.setAttribute('style', '');
- _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 452);
+ _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 459);
keyframes['0%'] = from;
- _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 453);
+ _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 460);
keyframes = Y.merge(keyframes, frames);
- _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 454);
+ _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 461);
keyframes['100%'] = to;
- _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 456);
+ _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 463);
res = this._render(node, name, keyframes);
+ _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 465);
+Anim._insert(res.css);
+
// Apply last animation frame styles
- _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 459);
+ _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 468);
if (this.get('iterations') !== 'infinite') {
- _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 460);
+ _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 469);
frame = this.get('iterations') % (2 - this.get('reverse')) * 100;
- _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 461);
-node.setStyles(res.styles[frame + '%']);
+ _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 470);
+Y.Object.each(res.styles[frame + '%'], function (value, prop) {
+ _yuitest_coverfunc("/build/gallery-anim-native/gallery-anim-native.js", "(anonymous 4)", 470);
+_yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 471);
+styles[prop] = value;
+ });
}
- _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 464);
-Anim._insert(res.css);
-
- _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 466);
+ _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 475);
this.set('iterationCount', 0);
- _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 468);
-parent.setStyle(VENDOR + "Perspective", this.get('perspective') + "px");
- _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 469);
-parent.setStyle(VENDOR + "PerspectiveOrigin", this.get('perspectiveOrigin'));
- _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 470);
-node.setStyle(VENDOR + "AnimationDuration", this.get('duration') + 's');
- _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 471);
-node.setStyle(VENDOR + "AnimationTimingFunction", this.get('easing'));
- _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 472);
-node.setStyle(VENDOR + "AnimationDelay", this.get('delay') + 's');
- _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 473);
-node.setStyle(VENDOR + "AnimationIterationCount", this.get('iterations'));
- _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 474);
-node.setStyle(VENDOR + "AnimationDirection", direction);
- _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 475);
-node.setStyle(VENDOR + "AnimationPlayState", 'running');
- _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 476);
-node.setStyle(VENDOR + "BackfaceVisibility", this.get('backfaceVisibility'));
_yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 477);
-node.setStyle(VENDOR + "AnimationName", name);
-
+parentStyles[VENDOR + 'Perspective'] = this.get('perspective') + 'px';
+ _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 478);
+parentStyles[VENDOR + 'PerspectiveOrigin'] = this.get('perspectiveOrigin');
_yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 479);
+parent.setStyles(parentStyles);
+
+ _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 481);
+styles[VENDOR + 'AnimationName'] = name;
+ _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 482);
+styles[VENDOR + 'AnimationDuration'] = this.get('duration') + 's';
+ _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 483);
+styles[VENDOR + 'AnimationTimingFunction'] = this.get('easing');
+ _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 484);
+styles[VENDOR + 'AnimationDelay'] = this.get('delay') + 's';
+ _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 485);
+styles[VENDOR + 'AnimationIterationCount'] = this.get('iterations');
+ _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 486);
+styles[VENDOR + 'AnimationDirection'] = direction;
+ _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 487);
+styles[VENDOR + 'AnimationPlayState'] = 'running';
+ _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 488);
+styles[VENDOR + 'BackfaceVisibility'] = this.get('backfaceVisibility');
+
+ _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 490);
+node.setStyles(styles);
+
+ _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 492);
this.fire('start');
- _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 480);
-this._sub = node.on(ANIMATION_END, this._end, this);
+ _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 493);
+this._sub = node.on(ANIMATION_END, Y.bind(this._end, this));
},
_end: function () {
- _yuitest_coverfunc("/build/gallery-anim-native/gallery-anim-native.js", "_end", 483);
-_yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 484);
+ _yuitest_coverfunc("/build/gallery-anim-native/gallery-anim-native.js", "_end", 496);
+_yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 497);
var node = this.get('node'),
- name = node.getStyle(VENDOR + "AnimationName");
+ name = node.getStyle(VENDOR + 'AnimationName'),
+ styles = {};
- _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 487);
-node.detach(ANIMATION_END, this._end);
+ _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 501);
+if (this._sub) {
+ _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 502);
+this._sub.detach();
+ _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 503);
+this._sub = null;
+ }
- _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 489);
-node.setStyle(VENDOR + "AnimationName", "none");
- _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 490);
-node.setStyle(VENDOR + "AnimationDuration", "0s");
- _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 491);
-node.setStyle(VENDOR + "AnimationTimingFunction", "ease");
- _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 492);
-node.setStyle(VENDOR + "AnimationDelay", "0s");
- _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 493);
-node.setStyle(VENDOR + "AnimationIterationCount", "1");
- _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 494);
-node.setStyle(VENDOR + "AnimationDirection", "normal");
- _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 495);
-node.setStyle(VENDOR + "AnimationPlayState", "running");
- _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 496);
-node.setStyle(VENDOR + "BackfaceVisibility", 'visible');
+ _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 506);
+styles[VENDOR + 'AnimationName'] = '';
+ _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 507);
+styles[VENDOR + 'AnimationDuration'] = '';
+ _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 508);
+styles[VENDOR + 'AnimationTimingFunction'] = '';
+ _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 509);
+styles[VENDOR + 'AnimationDelay'] = '';
+ _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 510);
+styles[VENDOR + 'AnimationIterationCount'] = '';
+ _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 511);
+styles[VENDOR + 'AnimationDirection'] = '';
+ _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 512);
+styles[VENDOR + 'AnimationPlayState'] = '';
+ _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 513);
+styles[VENDOR + 'BackfaceVisibility'] = '';
+ _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 514);
+node.setStyles(styles);
// TODO: Restore parent node perspective?
- _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 500);
+ _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 518);
this.set('iterationCount', this.get('iterations'));
- _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 502);
+ _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 520);
Anim._delete(name);
- _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 503);
+ _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 521);
this.fire('end', {elapsed: this.get('elapsedTime')});
},
@@ -656,70 +685,81 @@ this.fire('end', {elapsed: this.get('elapsedTime')});
* Generate CSS keyframes string and meta data.
*/
_render: function (node, name, keyframes) {
- _yuitest_coverfunc("/build/gallery-anim-native/gallery-anim-native.js", "_render", 509);
-_yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 510);
+ _yuitest_coverfunc("/build/gallery-anim-native/gallery-anim-native.js", "_render", 527);
+_yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 528);
var css = ['@' + PREFIX + 'keyframes ' + name + ' {'],
styles = {};
- _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 513);
+ _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 531);
Y.Object.each(keyframes, function (props, key) {
- _yuitest_coverfunc("/build/gallery-anim-native/gallery-anim-native.js", "(anonymous 4)", 513);
-_yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 514);
+ _yuitest_coverfunc("/build/gallery-anim-native/gallery-anim-native.js", "(anonymous 5)", 531);
+_yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 532);
css.push('\t' + key + ' {');
- _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 515);
+ _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 533);
styles[key] = {};
- _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 517);
+ _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 535);
Y.Object.each(props, function (value, prop) {
- _yuitest_coverfunc("/build/gallery-anim-native/gallery-anim-native.js", "(anonymous 5)", 517);
-_yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 518);
+ _yuitest_coverfunc("/build/gallery-anim-native/gallery-anim-native.js", "(anonymous 6)", 535);
+_yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 536);
var parsed;
- _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 520);
+ _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 538);
if (typeof value === 'function') {
- _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 521);
+ _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 539);
value = value.call(this, node);
}
- _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 524);
+ _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 542);
if (Anim.RE_DEFAULT_UNIT.test(prop)) {
- _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 525);
+ _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 543);
parsed = Anim.RE_UNITS.exec(value);
- _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 527);
+ _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 545);
if (parsed && !parsed[2]) {
- _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 528);
+ _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 546);
value += Anim.DEFAULT_UNIT;
}
}
- _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 532);
+ _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 550);
+if (prop === 'transform') {
+ _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 551);
+prop = VENDOR + 'Transform';
+ }
+
+ _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 554);
styles[key][prop] = value;
- _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 533);
+ _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 555);
css.push('\t\t' + Anim._toHyphen(prop) + ': ' + value + ';');
}, this);
- _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 536);
+ _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 558);
css.push('\t}');
}, this);
- _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 539);
+ _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 561);
css.push('}');
- _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 540);
+ _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 562);
return {css: css.join('\n'), styles: styles};
},
destructor: function () {
- _yuitest_coverfunc("/build/gallery-anim-native/gallery-anim-native.js", "destructor", 543);
-_yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 544);
-this.get('node').detach(ANIMATION_END, this._end);
+ _yuitest_coverfunc("/build/gallery-anim-native/gallery-anim-native.js", "destructor", 565);
+_yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 566);
+if (this._sub) {
+ _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 567);
+this._sub.detach();
+ _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 568);
+this._sub = null;
+ }
}
});
- _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 548);
+ _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 573);
Y.Anim = Anim;
- _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 549);
+ _yuitest_coverline("/build/gallery-anim-native/gallery-anim-native.js", 574);
Y.AnimNative = Anim;
-}, 'gallery-2012.09.26-20-36' ,{skinnable:false});
+}, 'gallery-2012.10.03-20-02' ,{skinnable:false});
View
99 build/gallery-anim-native/gallery-anim-native-debug.js
@@ -25,12 +25,12 @@ YUI.add('gallery-anim-native', function(Y) {
"use strict";
/*global Y:true */
/*jslint regexp: true*/
- var VENDOR = ['', 'webkit', 'Moz', 'O', 'ms'].filter(function (prefix) {
+ var VENDOR = ['', 'Webkit', 'Moz', 'O', 'ms'].filter(function (prefix) {
return Y.config.doc.body.style.hasOwnProperty(prefix + 'Animation');
})[0],
PREFIX = VENDOR ? '-' + VENDOR.toLowerCase() + '-' : VENDOR,
ANIMATION_END_VENDORS = {
- webkit: 'webkitAnimationEnd',
+ Webkit: 'webkitAnimationEnd',
O: 'oAnimationEnd'
},
ANIMATION_END_EVENT = 'animationend',
@@ -62,6 +62,7 @@ YUI.add('gallery-anim-native', function(Y) {
easeInStrong: {p1: 0.895, p2: 0.030, p3: 0.685, p4: 0.220},
easeOutStrong: {p1: 0.165, p2: 0.840, p3: 0.440, p4: 1.000},
easeBothStrong: {p1: 0.770, p2: 0.000, p3: 0.175, p4: 1.000},
+ backIn: {p1: 0.600, p2: -0.280, p3: 0.735, p4: 0.045},
backOut: {p1: 0.175, p2: 0.885, p3: 0.320, p4: 1.275},
backBoth: {p1: 0.680, p2: -0.550, p3: 0.265, p4: 1.550},
@@ -69,7 +70,6 @@ YUI.add('gallery-anim-native', function(Y) {
elasticIn: {p1: 0.250, p2: 0.250, p3: 0.750, p4: 0.750},
elasticOut: {p1: 0.250, p2: 0.250, p3: 0.750, p4: 0.750},
elasticBoth: {p1: 0.250, p2: 0.250, p3: 0.750, p4: 0.750},
- backIn: {p1: 0.250, p2: 0.250, p3: 0.750, p4: 0.750},
bounceIn: {p1: 0.250, p2: 0.250, p3: 0.750, p4: 0.750},
bounceOut: {p1: 0.250, p2: 0.250, p3: 0.750, p4: 0.750},
bounceBoth: {p1: 0.250, p2: 0.250, p3: 0.750, p4: 0.750}
@@ -129,7 +129,7 @@ YUI.add('gallery-anim-native', function(Y) {
Y.log(e.message + rule, 'warn');
}
} else {
- style = doc.createElement("style");
+ style = doc.createElement('style');
style.innerHTML = rule;
doc.head.appendChild(style);
}
@@ -137,7 +137,7 @@ YUI.add('gallery-anim-native', function(Y) {
Anim._delete = function (ruleName) {
var doc = Y.config.doc,
- cssrules = doc.all ? "rules" : "cssRules",
+ cssrules = doc.all ? 'rules' : 'cssRules',
i;
for (i = 0; i < doc.styleSheets[0][cssrules].length; i += 1) {
@@ -277,7 +277,7 @@ YUI.add('gallery-anim-native', function(Y) {
*/
running: {
getter: function () {
- return this.get('node').getStyle(VENDOR + "AnimationName") !== 'none';
+ return this.get('node').getStyle(VENDOR + 'AnimationName') !== 'none';
},
value: false,
readOnly: true
@@ -341,7 +341,7 @@ YUI.add('gallery-anim-native', function(Y) {
*/
paused: {
getter: function () {
- return this.get('node').getStyle(VENDOR + "AnimationPlayState") === 'paused';
+ return this.get('node').getStyle(VENDOR + 'AnimationPlayState') === 'paused';
},
readOnly: true,
value: false
@@ -390,7 +390,9 @@ YUI.add('gallery-anim-native', function(Y) {
};
Y.extend(Anim, Y.Base, {
- initializer: function (config) {},
+ initializer: function (config) {
+ this._sub = null;
+ },
/**
* Starts or resumes an animation.
@@ -415,7 +417,7 @@ YUI.add('gallery-anim-native', function(Y) {
*/
pause: function () {
if (this.get('running')) {
- this.get('node').setStyle(VENDOR + "AnimationPlayState", 'paused');
+ this.get('node').setStyle(VENDOR + 'AnimationPlayState', 'paused');
this.fire('pause');
}
return this;
@@ -433,7 +435,7 @@ YUI.add('gallery-anim-native', function(Y) {
},
_resume: function () {
- this.get('node').setStyle(VENDOR + "AnimationPlayState", 'running');
+ this.get('node').setStyle(VENDOR + 'AnimationPlayState', 'running');
this.fire('resume');
},
@@ -450,7 +452,12 @@ YUI.add('gallery-anim-native', function(Y) {
frames = this.get('frames'),
keyframes = {},
res,
- frame;
+ frame,
+ styles = {},
+ parentStyles = {};
+
+ node.removeAttribute('style');
+ node.setAttribute('style', '');
keyframes['0%'] = from;
keyframes = Y.merge(keyframes, frames);
@@ -458,45 +465,56 @@ YUI.add('gallery-anim-native', function(Y) {
res = this._render(node, name, keyframes);
+ Anim._insert(res.css);
+
// Apply last animation frame styles
if (this.get('iterations') !== 'infinite') {
frame = this.get('iterations') % (2 - this.get('reverse')) * 100;
- node.setStyles(res.styles[frame + '%']);
+ Y.Object.each(res.styles[frame + '%'], function (value, prop) {
+ styles[prop] = value;
+ });
}
- Anim._insert(res.css);
-
this.set('iterationCount', 0);
- parent.setStyle(VENDOR + "Perspective", this.get('perspective') + "px");
- parent.setStyle(VENDOR + "PerspectiveOrigin", this.get('perspectiveOrigin'));
- node.setStyle(VENDOR + "AnimationDuration", this.get('duration') + 's');
- node.setStyle(VENDOR + "AnimationTimingFunction", this.get('easing'));
- node.setStyle(VENDOR + "AnimationDelay", this.get('delay') + 's');
- node.setStyle(VENDOR + "AnimationIterationCount", this.get('iterations'));
- node.setStyle(VENDOR + "AnimationDirection", direction);
- node.setStyle(VENDOR + "AnimationPlayState", 'running');
- node.setStyle(VENDOR + "BackfaceVisibility", this.get('backfaceVisibility'));
- node.setStyle(VENDOR + "AnimationName", name);
+ parentStyles[VENDOR + 'Perspective'] = this.get('perspective') + 'px';
+ parentStyles[VENDOR + 'PerspectiveOrigin'] = this.get('perspectiveOrigin');
+ parent.setStyles(parentStyles);
+
+ styles[VENDOR + 'AnimationName'] = name;
+ styles[VENDOR + 'AnimationDuration'] = this.get('duration') + 's';
+ styles[VENDOR + 'AnimationTimingFunction'] = this.get('easing');
+ styles[VENDOR + 'AnimationDelay'] = this.get('delay') + 's';
+ styles[VENDOR + 'AnimationIterationCount'] = this.get('iterations');
+ styles[VENDOR + 'AnimationDirection'] = direction;
+ styles[VENDOR + 'AnimationPlayState'] = 'running';
+ styles[VENDOR + 'BackfaceVisibility'] = this.get('backfaceVisibility');
+
+ node.setStyles(styles);
this.fire('start');
- this._sub = node.on(ANIMATION_END, this._end, this);
+ this._sub = node.on(ANIMATION_END, Y.bind(this._end, this));
},
_end: function () {
var node = this.get('node'),
- name = node.getStyle(VENDOR + "AnimationName");
+ name = node.getStyle(VENDOR + 'AnimationName'),
+ styles = {};
- node.detach(ANIMATION_END, this._end);
+ if (this._sub) {
+ this._sub.detach();
+ this._sub = null;
+ }
- node.setStyle(VENDOR + "AnimationName", "none");
- node.setStyle(VENDOR + "AnimationDuration", "0s");
- node.setStyle(VENDOR + "AnimationTimingFunction", "ease");
- node.setStyle(VENDOR + "AnimationDelay", "0s");
- node.setStyle(VENDOR + "AnimationIterationCount", "1");
- node.setStyle(VENDOR + "AnimationDirection", "normal");
- node.setStyle(VENDOR + "AnimationPlayState", "running");
- node.setStyle(VENDOR + "BackfaceVisibility", 'visible');
+ styles[VENDOR + 'AnimationName'] = '';
+ styles[VENDOR + 'AnimationDuration'] = '';
+ styles[VENDOR + 'AnimationTimingFunction'] = '';
+ styles[VENDOR + 'AnimationDelay'] = '';
+ styles[VENDOR + 'AnimationIterationCount'] = '';
+ styles[VENDOR + 'AnimationDirection'] = '';
+ styles[VENDOR + 'AnimationPlayState'] = '';
+ styles[VENDOR + 'BackfaceVisibility'] = '';
+ node.setStyles(styles);
// TODO: Restore parent node perspective?
@@ -532,6 +550,10 @@ YUI.add('gallery-anim-native', function(Y) {
}
}
+ if (prop === 'transform') {
+ prop = VENDOR + 'Transform';
+ }
+
styles[key][prop] = value;
css.push('\t\t' + Anim._toHyphen(prop) + ': ' + value + ';');
}, this);
@@ -544,7 +566,10 @@ YUI.add('gallery-anim-native', function(Y) {
},
destructor: function () {
- this.get('node').detach(ANIMATION_END, this._end);
+ if (this._sub) {
+ this._sub.detach();
+ this._sub = null;
+ }
}
});
@@ -552,4 +577,4 @@ YUI.add('gallery-anim-native', function(Y) {
Y.AnimNative = Anim;
-}, 'gallery-2012.09.26-20-36' ,{skinnable:false});
+}, 'gallery-2012.10.03-20-02' ,{skinnable:false});
View
2  build/gallery-anim-native/gallery-anim-native-min.js
@@ -1 +1 @@
-YUI.add("gallery-anim-native",function(g){var f=["","webkit","Moz","O","ms"].filter(function(h){return g.config.doc.body.style.hasOwnProperty(h+"Animation");})[0],d=f?"-"+f.toLowerCase()+"-":f,c={webkit:"webkitAnimationEnd",O:"oAnimationEnd"},e="animationend",a=c[f]||e,b=function(){b.superclass.constructor.apply(this,arguments);};g.Node.DOM_EVENTS[a]=1;b.NAME="animNative";b.DIRECTIONS={normal:["normal","reverse"],alternate:["alternate","alternate-reverse"]};b.EASINGS={easeNone:{p1:0.25,p2:0.25,p3:0.75,p4:0.75},easeIn:{p1:0.42,p2:0,p3:1,p4:1},easeOut:{p1:0,p2:0,p3:0.58,p4:1},easeBoth:{p1:0.42,p2:0,p3:0.58,p4:1},easeInStrong:{p1:0.895,p2:0.03,p3:0.685,p4:0.22},easeOutStrong:{p1:0.165,p2:0.84,p3:0.44,p4:1},easeBothStrong:{p1:0.77,p2:0,p3:0.175,p4:1},backOut:{p1:0.175,p2:0.885,p3:0.32,p4:1.275},backBoth:{p1:0.68,p2:-0.55,p3:0.265,p4:1.55},elasticIn:{p1:0.25,p2:0.25,p3:0.75,p4:0.75},elasticOut:{p1:0.25,p2:0.25,p3:0.75,p4:0.75},elasticBoth:{p1:0.25,p2:0.25,p3:0.75,p4:0.75},backIn:{p1:0.25,p2:0.25,p3:0.75,p4:0.75},bounceIn:{p1:0.25,p2:0.25,p3:0.75,p4:0.75},bounceOut:{p1:0.25,p2:0.25,p3:0.75,p4:0.75},bounceBoth:{p1:0.25,p2:0.25,p3:0.75,p4:0.75}};b.RE_UNITS=/^(-?\d*\.?\d*){1}(em|ex|px|in|cm|mm|pt|pc|%)*$/;b.RE_DEFAULT_UNIT=/^width|height|top|right|bottom|left|margin.*|padding.*|border.*$/i;b.DEFAULT_UNIT="px";b._easing=function(h){var i=b.EASINGS[h];return"cubic-bezier("+i.p1+", "+i.p2+", "+i.p3+", "+i.p4+")";};b._toHyphen=function(h){h=h.replace(/([A-Z]?)([a-z]+)([A-Z]?)/g,function(l,k,j,i){var m=((k)?"-"+k.toLowerCase():"")+j;if(i){m+="-"+i.toLowerCase();}return m;});return h;};b._insert=function(l){var k=g.config.doc,h,i;if(k.styleSheets&&k.styleSheets.length){h=0;try{if(k.styleSheets[0].cssRules.length>0){h=k.styleSheets[0].cssRules.length;}k.styleSheets[0].insertRule(l,h);}catch(j){}}else{i=k.createElement("style");i.innerHTML=l;k.head.appendChild(i);}};b._delete=function(j){var l=g.config.doc,k=l.all?"rules":"cssRules",h;for(h=0;h<l.styleSheets[0][k].length;h+=1){if(l.styleSheets[0][k][h].name===j){l.styleSheets[0].deleteRule(h);break;}}};b.ATTRS={node:{setter:function(h){if(h){if(typeof h==="string"||h.nodeType){h=g.one(h);}}this._node=h;if(!h){}return h;}},duration:{value:1},easing:{value:"easeNone",setter:function(h){return b._easing(h);}},from:{value:{}},frames:{value:{}},to:{value:{}},startTime:{value:0,readOnly:true},elapsedTime:{value:0,readOnly:true},running:{getter:function(){return this.get("node").getStyle(f+"AnimationName")!=="none";},value:false,readOnly:true},delay:{value:0},iterations:{value:1},iterationCount:{value:0,readOnly:true},direction:{value:"normal"},paused:{getter:function(){return this.get("node").getStyle(f+"AnimationPlayState")==="paused";},readOnly:true,value:false},reverse:{value:false},perspective:{value:1000},perspectiveOrigin:{value:"center center"},backfaceVisibility:{value:"visible"}};g.extend(b,g.Base,{initializer:function(h){},run:function(){if(this.get("paused")){this._resume();}else{if(!this.get("running")){this._start();}}return this;},pause:function(){if(this.get("running")){this.get("node").setStyle(f+"AnimationPlayState","paused");this.fire("pause");}return this;},stop:function(h){this._end();return this;},_resume:function(){this.get("node").setStyle(f+"AnimationPlayState","running");this.fire("resume");},_start:function(){var j=this.get("node"),q=j.get("parentNode"),h="anim-"+g.guid(),n=b.DIRECTIONS[this.get("direction")][+this.get("reverse")],o=this.get("from"),p=this.get("to"),m=this.get("frames"),k={},l,i;k["0%"]=o;k=g.merge(k,m);k["100%"]=p;l=this._render(j,h,k);if(this.get("iterations")!=="infinite"){i=this.get("iterations")%(2-this.get("reverse"))*100;j.setStyles(l.styles[i+"%"]);}b._insert(l.css);this.set("iterationCount",0);q.setStyle(f+"Perspective",this.get("perspective")+"px");q.setStyle(f+"PerspectiveOrigin",this.get("perspectiveOrigin"));j.setStyle(f+"AnimationDuration",this.get("duration")+"s");j.setStyle(f+"AnimationTimingFunction",this.get("easing"));j.setStyle(f+"AnimationDelay",this.get("delay")+"s");j.setStyle(f+"AnimationIterationCount",this.get("iterations"));j.setStyle(f+"AnimationDirection",n);j.setStyle(f+"AnimationPlayState","running");j.setStyle(f+"BackfaceVisibility",this.get("backfaceVisibility"));j.setStyle(f+"AnimationName",h);this.fire("start");this._sub=j.on(a,this._end,this);},_end:function(){var i=this.get("node"),h=i.getStyle(f+"AnimationName");i.detach(a,this._end);i.setStyle(f+"AnimationName","none");i.setStyle(f+"AnimationDuration","0s");i.setStyle(f+"AnimationTimingFunction","ease");i.setStyle(f+"AnimationDelay","0s");i.setStyle(f+"AnimationIterationCount","1");i.setStyle(f+"AnimationDirection","normal");i.setStyle(f+"AnimationPlayState","running");i.setStyle(f+"BackfaceVisibility","visible");this.set("iterationCount",this.get("iterations"));b._delete(h);this.fire("end",{elapsed:this.get("elapsedTime")});},_render:function(k,h,l){var i=["@"+d+"keyframes "+h+" {"],j={};g.Object.each(l,function(n,m){i.push("\t"+m+" {");j[m]={};g.Object.each(n,function(p,q){var o;if(typeof p==="function"){p=p.call(this,k);}if(b.RE_DEFAULT_UNIT.test(q)){o=b.RE_UNITS.exec(p);if(o&&!o[2]){p+=b.DEFAULT_UNIT;}}j[m][q]=p;i.push("\t\t"+b._toHyphen(q)+": "+p+";");},this);i.push("\t}");},this);i.push("}");return{css:i.join("\n"),styles:j};},destructor:function(){this.get("node").detach(a,this._end);}});g.Anim=b;g.AnimNative=b;},"gallery-2012.09.26-20-36",{skinnable:false});
+YUI.add("gallery-anim-native",function(g){var f=["","Webkit","Moz","O","ms"].filter(function(h){return g.config.doc.body.style.hasOwnProperty(h+"Animation");})[0],d=f?"-"+f.toLowerCase()+"-":f,c={Webkit:"webkitAnimationEnd",O:"oAnimationEnd"},e="animationend",a=c[f]||e,b=function(){b.superclass.constructor.apply(this,arguments);};g.Node.DOM_EVENTS[a]=1;b.NAME="animNative";b.DIRECTIONS={normal:["normal","reverse"],alternate:["alternate","alternate-reverse"]};b.EASINGS={easeNone:{p1:0.25,p2:0.25,p3:0.75,p4:0.75},easeIn:{p1:0.42,p2:0,p3:1,p4:1},easeOut:{p1:0,p2:0,p3:0.58,p4:1},easeBoth:{p1:0.42,p2:0,p3:0.58,p4:1},easeInStrong:{p1:0.895,p2:0.03,p3:0.685,p4:0.22},easeOutStrong:{p1:0.165,p2:0.84,p3:0.44,p4:1},easeBothStrong:{p1:0.77,p2:0,p3:0.175,p4:1},backIn:{p1:0.6,p2:-0.28,p3:0.735,p4:0.045},backOut:{p1:0.175,p2:0.885,p3:0.32,p4:1.275},backBoth:{p1:0.68,p2:-0.55,p3:0.265,p4:1.55},elasticIn:{p1:0.25,p2:0.25,p3:0.75,p4:0.75},elasticOut:{p1:0.25,p2:0.25,p3:0.75,p4:0.75},elasticBoth:{p1:0.25,p2:0.25,p3:0.75,p4:0.75},bounceIn:{p1:0.25,p2:0.25,p3:0.75,p4:0.75},bounceOut:{p1:0.25,p2:0.25,p3:0.75,p4:0.75},bounceBoth:{p1:0.25,p2:0.25,p3:0.75,p4:0.75}};b.RE_UNITS=/^(-?\d*\.?\d*){1}(em|ex|px|in|cm|mm|pt|pc|%)*$/;b.RE_DEFAULT_UNIT=/^width|height|top|right|bottom|left|margin.*|padding.*|border.*$/i;b.DEFAULT_UNIT="px";b._easing=function(h){var i=b.EASINGS[h];return"cubic-bezier("+i.p1+", "+i.p2+", "+i.p3+", "+i.p4+")";};b._toHyphen=function(h){h=h.replace(/([A-Z]?)([a-z]+)([A-Z]?)/g,function(l,k,j,i){var m=((k)?"-"+k.toLowerCase():"")+j;if(i){m+="-"+i.toLowerCase();}return m;});return h;};b._insert=function(l){var k=g.config.doc,h,i;if(k.styleSheets&&k.styleSheets.length){h=0;try{if(k.styleSheets[0].cssRules.length>0){h=k.styleSheets[0].cssRules.length;}k.styleSheets[0].insertRule(l,h);}catch(j){}}else{i=k.createElement("style");i.innerHTML=l;k.head.appendChild(i);}};b._delete=function(j){var l=g.config.doc,k=l.all?"rules":"cssRules",h;for(h=0;h<l.styleSheets[0][k].length;h+=1){if(l.styleSheets[0][k][h].name===j){l.styleSheets[0].deleteRule(h);break;}}};b.ATTRS={node:{setter:function(h){if(h){if(typeof h==="string"||h.nodeType){h=g.one(h);}}this._node=h;if(!h){}return h;}},duration:{value:1},easing:{value:"easeNone",setter:function(h){return b._easing(h);}},from:{value:{}},frames:{value:{}},to:{value:{}},startTime:{value:0,readOnly:true},elapsedTime:{value:0,readOnly:true},running:{getter:function(){return this.get("node").getStyle(f+"AnimationName")!=="none";},value:false,readOnly:true},delay:{value:0},iterations:{value:1},iterationCount:{value:0,readOnly:true},direction:{value:"normal"},paused:{getter:function(){return this.get("node").getStyle(f+"AnimationPlayState")==="paused";},readOnly:true,value:false},reverse:{value:false},perspective:{value:1000},perspectiveOrigin:{value:"center center"},backfaceVisibility:{value:"visible"}};g.extend(b,g.Base,{initializer:function(h){this._sub=null;},run:function(){if(this.get("paused")){this._resume();}else{if(!this.get("running")){this._start();}}return this;},pause:function(){if(this.get("running")){this.get("node").setStyle(f+"AnimationPlayState","paused");this.fire("pause");}return this;},stop:function(h){this._end();return this;},_resume:function(){this.get("node").setStyle(f+"AnimationPlayState","running");this.fire("resume");},_start:function(){var j=this.get("node"),r=j.get("parentNode"),h="anim-"+g.guid(),o=b.DIRECTIONS[this.get("direction")][+this.get("reverse")],p=this.get("from"),q=this.get("to"),n=this.get("frames"),k={},m,i,s={},l={};j.removeAttribute("style");j.setAttribute("style","");k["0%"]=p;k=g.merge(k,n);k["100%"]=q;m=this._render(j,h,k);b._insert(m.css);if(this.get("iterations")!=="infinite"){i=this.get("iterations")%(2-this.get("reverse"))*100;g.Object.each(m.styles[i+"%"],function(t,u){s[u]=t;});}this.set("iterationCount",0);l[f+"Perspective"]=this.get("perspective")+"px";l[f+"PerspectiveOrigin"]=this.get("perspectiveOrigin");r.setStyles(l);s[f+"AnimationName"]=h;s[f+"AnimationDuration"]=this.get("duration")+"s";s[f+"AnimationTimingFunction"]=this.get("easing");s[f+"AnimationDelay"]=this.get("delay")+"s";s[f+"AnimationIterationCount"]=this.get("iterations");s[f+"AnimationDirection"]=o;s[f+"AnimationPlayState"]="running";s[f+"BackfaceVisibility"]=this.get("backfaceVisibility");j.setStyles(s);this.fire("start");this._sub=j.on(a,g.bind(this._end,this));},_end:function(){var j=this.get("node"),h=j.getStyle(f+"AnimationName"),i={};if(this._sub){this._sub.detach();this._sub=null;}i[f+"AnimationName"]="";i[f+"AnimationDuration"]="";i[f+"AnimationTimingFunction"]="";i[f+"AnimationDelay"]="";i[f+"AnimationIterationCount"]="";i[f+"AnimationDirection"]="";i[f+"AnimationPlayState"]="";i[f+"BackfaceVisibility"]="";j.setStyles(i);this.set("iterationCount",this.get("iterations"));b._delete(h);this.fire("end",{elapsed:this.get("elapsedTime")});},_render:function(k,h,l){var i=["@"+d+"keyframes "+h+" {"],j={};g.Object.each(l,function(n,m){i.push("\t"+m+" {");j[m]={};g.Object.each(n,function(p,q){var o;if(typeof p==="function"){p=p.call(this,k);}if(b.RE_DEFAULT_UNIT.test(q)){o=b.RE_UNITS.exec(p);if(o&&!o[2]){p+=b.DEFAULT_UNIT;}}if(q==="transform"){q=f+"Transform";}j[m][q]=p;i.push("\t\t"+b._toHyphen(q)+": "+p+";");},this);i.push("\t}");},this);i.push("}");return{css:i.join("\n"),styles:j};},destructor:function(){if(this._sub){this._sub.detach();this._sub=null;}}});g.Anim=b;g.AnimNative=b;},"gallery-2012.10.03-20-02",{skinnable:false});
View
99 build/gallery-anim-native/gallery-anim-native.js
@@ -25,12 +25,12 @@ YUI.add('gallery-anim-native', function(Y) {
"use strict";
/*global Y:true */
/*jslint regexp: true*/
- var VENDOR = ['', 'webkit', 'Moz', 'O', 'ms'].filter(function (prefix) {
+ var VENDOR = ['', 'Webkit', 'Moz', 'O', 'ms'].filter(function (prefix) {
return Y.config.doc.body.style.hasOwnProperty(prefix + 'Animation');
})[0],
PREFIX = VENDOR ? '-' + VENDOR.toLowerCase() + '-' : VENDOR,
ANIMATION_END_VENDORS = {
- webkit: 'webkitAnimationEnd',
+ Webkit: 'webkitAnimationEnd',
O: 'oAnimationEnd'
},
ANIMATION_END_EVENT = 'animationend',
@@ -62,6 +62,7 @@ YUI.add('gallery-anim-native', function(Y) {
easeInStrong: {p1: 0.895, p2: 0.030, p3: 0.685, p4: 0.220},
easeOutStrong: {p1: 0.165, p2: 0.840, p3: 0.440, p4: 1.000},
easeBothStrong: {p1: 0.770, p2: 0.000, p3: 0.175, p4: 1.000},
+ backIn: {p1: 0.600, p2: -0.280, p3: 0.735, p4: 0.045},
backOut: {p1: 0.175, p2: 0.885, p3: 0.320, p4: 1.275},
backBoth: {p1: 0.680, p2: -0.550, p3: 0.265, p4: 1.550},
@@ -69,7 +70,6 @@ YUI.add('gallery-anim-native', function(Y) {
elasticIn: {p1: 0.250, p2: 0.250, p3: 0.750, p4: 0.750},
elasticOut: {p1: 0.250, p2: 0.250, p3: 0.750, p4: 0.750},
elasticBoth: {p1: 0.250, p2: 0.250, p3: 0.750, p4: 0.750},
- backIn: {p1: 0.250, p2: 0.250, p3: 0.750, p4: 0.750},
bounceIn: {p1: 0.250, p2: 0.250, p3: 0.750, p4: 0.750},
bounceOut: {p1: 0.250, p2: 0.250, p3: 0.750, p4: 0.750},
bounceBoth: {p1: 0.250, p2: 0.250, p3: 0.750, p4: 0.750}
@@ -127,7 +127,7 @@ YUI.add('gallery-anim-native', function(Y) {
} catch (e) {
}
} else {
- style = doc.createElement("style");
+ style = doc.createElement('style');
style.innerHTML = rule;
doc.head.appendChild(style);
}
@@ -135,7 +135,7 @@ YUI.add('gallery-anim-native', function(Y) {
Anim._delete = function (ruleName) {
var doc = Y.config.doc,
- cssrules = doc.all ? "rules" : "cssRules",
+ cssrules = doc.all ? 'rules' : 'cssRules',
i;
for (i = 0; i < doc.styleSheets[0][cssrules].length; i += 1) {
@@ -274,7 +274,7 @@ YUI.add('gallery-anim-native', function(Y) {
*/
running: {
getter: function () {
- return this.get('node').getStyle(VENDOR + "AnimationName") !== 'none';
+ return this.get('node').getStyle(VENDOR + 'AnimationName') !== 'none';
},
value: false,
readOnly: true
@@ -338,7 +338,7 @@ YUI.add('gallery-anim-native', function(Y) {
*/
paused: {
getter: function () {
- return this.get('node').getStyle(VENDOR + "AnimationPlayState") === 'paused';
+ return this.get('node').getStyle(VENDOR + 'AnimationPlayState') === 'paused';
},
readOnly: true,
value: false
@@ -387,7 +387,9 @@ YUI.add('gallery-anim-native', function(Y) {
};
Y.extend(Anim, Y.Base, {
- initializer: function (config) {},
+ initializer: function (config) {
+ this._sub = null;
+ },
/**
* Starts or resumes an animation.
@@ -412,7 +414,7 @@ YUI.add('gallery-anim-native', function(Y) {
*/
pause: function () {
if (this.get('running')) {
- this.get('node').setStyle(VENDOR + "AnimationPlayState", 'paused');
+ this.get('node').setStyle(VENDOR + 'AnimationPlayState', 'paused');
this.fire('pause');
}
return this;
@@ -430,7 +432,7 @@ YUI.add('gallery-anim-native', function(Y) {
},
_resume: function () {
- this.get('node').setStyle(VENDOR + "AnimationPlayState", 'running');
+ this.get('node').setStyle(VENDOR + 'AnimationPlayState', 'running');
this.fire('resume');
},
@@ -447,7 +449,12 @@ YUI.add('gallery-anim-native', function(Y) {
frames = this.get('frames'),
keyframes = {},
res,
- frame;
+ frame,
+ styles = {},
+ parentStyles = {};
+
+ node.removeAttribute('style');
+ node.setAttribute('style', '');
keyframes['0%'] = from;
keyframes = Y.merge(keyframes, frames);
@@ -455,45 +462,56 @@ YUI.add('gallery-anim-native', function(Y) {
res = this._render(node, name, keyframes);
+ Anim._insert(res.css);
+
// Apply last animation frame styles
if (this.get('iterations') !== 'infinite') {
frame = this.get('iterations') % (2 - this.get('reverse')) * 100;
- node.setStyles(res.styles[frame + '%']);
+ Y.Object.each(res.styles[frame + '%'], function (value, prop) {
+ styles[prop] = value;
+ });
}
- Anim._insert(res.css);
-
this.set('iterationCount', 0);
- parent.setStyle(VENDOR + "Perspective", this.get('perspective') + "px");
- parent.setStyle(VENDOR + "PerspectiveOrigin", this.get('perspectiveOrigin'));
- node.setStyle(VENDOR + "AnimationDuration", this.get('duration') + 's');
- node.setStyle(VENDOR + "AnimationTimingFunction", this.get('easing'));
- node.setStyle(VENDOR + "AnimationDelay", this.get('delay') + 's');
- node.setStyle(VENDOR + "AnimationIterationCount", this.get('iterations'));
- node.setStyle(VENDOR + "AnimationDirection", direction);
- node.setStyle(VENDOR + "AnimationPlayState", 'running');
- node.setStyle(VENDOR + "BackfaceVisibility", this.get('backfaceVisibility'));
- node.setStyle(VENDOR + "AnimationName", name);
+ parentStyles[VENDOR + 'Perspective'] = this.get('perspective') + 'px';
+ parentStyles[VENDOR + 'PerspectiveOrigin'] = this.get('perspectiveOrigin');
+ parent.setStyles(parentStyles);
+
+ styles[VENDOR + 'AnimationName'] = name;
+ styles[VENDOR + 'AnimationDuration'] = this.get('duration') + 's';
+ styles[VENDOR + 'AnimationTimingFunction'] = this.get('easing');
+ styles[VENDOR + 'AnimationDelay'] = this.get('delay') + 's';
+ styles[VENDOR + 'AnimationIterationCount'] = this.get('iterations');
+ styles[VENDOR + 'AnimationDirection'] = direction;
+ styles[VENDOR + 'AnimationPlayState'] = 'running';
+ styles[VENDOR + 'BackfaceVisibility'] = this.get('backfaceVisibility');
+
+ node.setStyles(styles);
this.fire('start');
- this._sub = node.on(ANIMATION_END, this._end, this);
+ this._sub = node.on(ANIMATION_END, Y.bind(this._end, this));
},
_end: function () {
var node = this.get('node'),
- name = node.getStyle(VENDOR + "AnimationName");
+ name = node.getStyle(VENDOR + 'AnimationName'),
+ styles = {};
- node.detach(ANIMATION_END, this._end);
+ if (this._sub) {
+ this._sub.detach();
+ this._sub = null;
+ }
- node.setStyle(VENDOR + "AnimationName", "none");
- node.setStyle(VENDOR + "AnimationDuration", "0s");
- node.setStyle(VENDOR + "AnimationTimingFunction", "ease");
- node.setStyle(VENDOR + "AnimationDelay", "0s");
- node.setStyle(VENDOR + "AnimationIterationCount", "1");
- node.setStyle(VENDOR + "AnimationDirection", "normal");
- node.setStyle(VENDOR + "AnimationPlayState", "running");
- node.setStyle(VENDOR + "BackfaceVisibility", 'visible');
+ styles[VENDOR + 'AnimationName'] = '';
+ styles[VENDOR + 'AnimationDuration'] = '';
+ styles[VENDOR + 'AnimationTimingFunction'] = '';
+ styles[VENDOR + 'AnimationDelay'] = '';
+ styles[VENDOR + 'AnimationIterationCount'] = '';
+ styles[VENDOR + 'AnimationDirection'] = '';
+ styles[VENDOR + 'AnimationPlayState'] = '';
+ styles[VENDOR + 'BackfaceVisibility'] = '';
+ node.setStyles(styles);
// TODO: Restore parent node perspective?
@@ -529,6 +547,10 @@ YUI.add('gallery-anim-native', function(Y) {
}
}
+ if (prop === 'transform') {
+ prop = VENDOR + 'Transform';
+ }
+
styles[key][prop] = value;
css.push('\t\t' + Anim._toHyphen(prop) + ': ' + value + ';');
}, this);
@@ -541,7 +563,10 @@ YUI.add('gallery-anim-native', function(Y) {
},
destructor: function () {
- this.get('node').detach(ANIMATION_END, this._end);
+ if (this._sub) {
+ this._sub.detach();
+ this._sub = null;
+ }
}
});
@@ -549,4 +574,4 @@ YUI.add('gallery-anim-native', function(Y) {
Y.AnimNative = Anim;
-}, 'gallery-2012.09.26-20-36' ,{skinnable:false});
+}, 'gallery-2012.10.03-20-02' ,{skinnable:false});
View
6 build/gallery-bottle/assets/gallery-bottle-core.css
@@ -2,10 +2,16 @@ html{height:100%}
body{position:relative}
body.btInit{-webkit-text-size-adjust:100%}
+.bt_posfixed{position:absolute;top:10px;left:0;overflow:scroll;width:30px;height:30px}
+.bt_posfixed div{height:100px;width:100%;position:relative}
+.bt_posfixed span{position:fixed;top:1px}
+
.bt-translate3d{-webkit-transform: translate3d(0, 0, 0)}
.bt-shortcut-mask,
.bt-overlay-mask{position:absolute;top:0;left:0;z-index:150;width:100%;height:100%;display:none}
.yui3-btcontainer{position:absolute;width:100%}
+.btp-native .yui3-btcontainer{position:relative}
+.bt-header, .bt-footer{width:100%;box-sizing:border-box;-moz-box-sizing:border-box}
.yui3-widget-pushpop{overflow:hidden}
View
2  build/gallery-bottle/assets/skins/sam/gallery-bottle.css
@@ -1 +1 @@
-html{height:100%}body{position:relative}body.btInit{-webkit-text-size-adjust:100%}.bt-translate3d{-webkit-transform:translate3d(0,0,0)}.bt-shortcut-mask,.bt-overlay-mask{position:absolute;top:0;left:0;z-index:150;width:100%;height:100%;display:none}.yui3-btcontainer{position:absolute;width:100%}.yui3-widget-pushpop{overflow:hidden}.yui3-btshortcut,.yui3-btoverlay{position:absolute}.yui3-btshortcut-hidden,.yui3-btoverlay-hidden{top:-9999px;left:-9999px}.yui3-btshortcut-disabled,.yui3-btoverlay-disabled{display:none}.yui3-btphotogrid .bpg_column{display:inline-block;overflow:hidden;vertical-align:top}.yui3-btslidetab .bst_slide{white-space:nowrap}.bst_slidebox{overflow:hidden}.bst_slide{position:relative}.bst_slide li{display:inline-block}.bst_tab{position:relative}.bst_tab>*{position:absolute!important;left:-10000px;width:100%}.bst_tab>*.on{position:relative!important;left:auto}.yui3-btcarousel-content{white-space:nowrap}.yui3-btcarousel-content>li{display:inline-block}.bcr_indexbox{position:absolute;bottom:0;width:100%;text-align:center;white-space:nowrap}.bcr_indexitem{display:inline-block;width:8px;height:8px;margin:4px 8px}.bcr_showbtn .bcr_btnl,.bcr_showbtn .bcr_btnr{display:block}.bcr_btnl,.bcr_btnr{display:none;position:absolute;top:45%;cursor:pointer}.bcr_btnr{right:0}.bt-shortcut-mask,.bt-overlay-mask{opacity:.5;background-color:#000}.yui3-btslidetab .bst_index{border:2px solid #444;background:#eee}.bcr_indexitem{border:1px solid #888;border-radius:8px}.bcr_indexitem.bcr_on{background-color:#afc}.bcr_btnl,.bcr_btnr{width:60px;height:30px;background:transparent url(http://yui.yahooapis.com/3.6.0/build/assets/skins/sam/sprite.png) no-repeat 10px -545px}.bcr_btnr{background-position:10px -595px}.bcr_off{opacity:.5}.yui3-btloader-content .blo_loading{background:#fff url(http://yuilibrary.com/yui/docs/assets/widget/img/ajax-loader.gif) no-repeat 50% 50%;min-height:40px}.yui3-btloader-content .blo_loaded{background:#ccc}.yui3-btloader-content .blo_error{color:#f00;background:#fcc}.btHideAll:not(.btReady),.btInPlace:not(.btReady) [data-role=carousel],.btInPlace:not(.btReady) [data-role=shortcut],.btInPlace:not(.btReady) [data-role=overlay],.btInPlace:not(.btReady) [data-role=photogrid],.btInPlace:not(.btReady) [data-role=slidetab]{background:#fff url(http://yuilibrary.com/yui/docs/assets/widget/img/ajax-loader.gif) no-repeat 50% 50%;min-height:50px}.btHideAll:not(.btReady){width:100%;height:100%}.btHideAll:not(.btReady)>*,.btInPlace:not(.btReady) [data-role=carousel]>*,.btInPlace:not(.btReady) [data-role=shortcut]>*,.btInPlace:not(.btReady) [data-role=overlay]>*,.btInPlace:not(.btReady) [data-role=photogrid]>*,.btInPlace:not(.btReady) [data-role=slidetab]>*,.btHideSCO:not(.btReady) [data-role=shortcut],.btHideSCO:not(.btReady) [data-role=overlay]{visibility:hidden}.btHideSCO:not(.btReady) [data-role=shortcut],.btHideSCO:not(.btReady) [data-role=overlay]{position:absolute}#yui3-css-stamp.skin-sam-gallery-bottle{display:none}
+html{height:100%}body{position:relative}body.btInit{-webkit-text-size-adjust:100%}.bt_posfixed{position:absolute;top:10px;left:0;overflow:scroll;width:30px;height:30px}.bt_posfixed div{height:100px;width:100%;position:relative}.bt_posfixed span{position:fixed;top:1px}.bt-translate3d{-webkit-transform:translate3d(0,0,0)}.bt-shortcut-mask,.bt-overlay-mask{position:absolute;top:0;left:0;z-index:150;width:100%;height:100%;display:none}.yui3-btcontainer{position:absolute;width:100%}.btp-native .yui3-btcontainer{position:relative}.bt-header,.bt-footer{width:100%;box-sizing:border-box;-moz-box-sizing:border-box}.yui3-widget-pushpop{overflow:hidden}.yui3-btshortcut,.yui3-btoverlay{position:absolute}.yui3-btshortcut-hidden,.yui3-btoverlay-hidden{top:-9999px;left:-9999px}.yui3-btshortcut-disabled,.yui3-btoverlay-disabled{display:none}.yui3-btphotogrid .bpg_column{display:inline-block;overflow:hidden;vertical-align:top}.yui3-btslidetab .bst_slide{white-space:nowrap}.bst_slidebox{overflow:hidden}.bst_slide{position:relative}.bst_slide li{display:inline-block}.bst_tab{position:relative}.bst_tab>*{position:absolute!important;left:-10000px;width:100%}.bst_tab>*.on{position:relative!important;left:auto}.yui3-btcarousel-content{white-space:nowrap}.yui3-btcarousel-content>li{display:inline-block}.bcr_indexbox{position:absolute;bottom:0;width:100%;text-align:center;white-space:nowrap}.bcr_indexitem{display:inline-block;width:8px;height:8px;margin:4px 8px}.bcr_showbtn .bcr_btnl,.bcr_showbtn .bcr_btnr{display:block}.bcr_btnl,.bcr_btnr{display:none;position:absolute;top:45%;cursor:pointer}.bcr_btnr{right:0}.bt-shortcut-mask,.bt-overlay-mask{opacity:.5;background-color:#000}.yui3-btslidetab .bst_index{border:2px solid #444;background:#eee}.bcr_indexitem{border:1px solid #888;border-radius:8px}.bcr_indexitem.bcr_on{background-color:#afc}.bcr_btnl,.bcr_btnr{width:60px;height:30px;background:transparent url(http://yui.yahooapis.com/3.6.0/build/assets/skins/sam/sprite.png) no-repeat 10px -545px}.bcr_btnr{background-position:10px -595px}.bcr_off{opacity:.5}.yui3-btloader-content .blo_loading{background:#fff url(http://yuilibrary.com/yui/docs/assets/widget/img/ajax-loader.gif) no-repeat 50% 50%;min-height:40px}.yui3-btloader-content .blo_loaded{background:#ccc}.yui3-btloader-content .blo_error{color:#f00;background:#fcc}.btHideAll:not(.btReady),.btInPlace:not(.btReady) [data-role=carousel],.btInPlace:not(.btReady) [data-role=shortcut],.btInPlace:not(.btReady) [data-role=overlay],.btInPlace:not(.btReady) [data-role=photogrid],.btInPlace:not(.btReady) [data-role=slidetab]{background:#fff url(http://yuilibrary.com/yui/docs/assets/widget/img/ajax-loader.gif) no-repeat 50% 50%;min-height:50px}.btHideAll:not(.btReady){width:100%;height:100%}.btHideAll:not(.btReady)>*,.btInPlace:not(.btReady) [data-role=carousel]>*,.btInPlace:not(.btReady) [data-role=shortcut]>*,.btInPlace:not(.btReady) [data-role=overlay]>*,.btInPlace:not(.btReady) [data-role=photogrid]>*,.btInPlace:not(.btReady) [data-role=slidetab]>*,.btHideSCO:not(.btReady) [data-role=shortcut],.btHideSCO:not(.btReady) [data-role=overlay]{visibility:hidden}.btHideSCO:not(.btReady) [data-role=shortcut],.btHideSCO:not(.btReady) [data-role=overlay]{position:absolute}#yui3-css-stamp.skin-sam-gallery-bottle{display:none}
View
178 build/gallery-bottle/gallery-bottle-coverage.js
@@ -26,11 +26,11 @@ _yuitest_coverage["/build/gallery-bottle/gallery-bottle.js"] = {
path: "/build/gallery-bottle/gallery-bottle.js",
code: []
};
-_yuitest_coverage["/build/gallery-bottle/gallery-bottle.js"].code=["YUI.add('gallery-bottle', function(Y) {","","/**"," * The bottle module collects all UI components, and provides initialize functions."," *"," * @module gallery-bottle"," */","","/**"," * Bottle is the base namespace for all Bottle Classes or statuc methods"," *"," * @class Bottle"," */","","//handle body width and height","var BOTTLE_INIT = 'btInit',"," BOTTLE_READY = 'btReady',"," body = Y.one('body'),"," inited = body.hasClass(BOTTLE_INIT),"," hideURL = false,",""," resetBodySize = function () {"," if (hideURL) {"," window.scrollTo(0, 0);"," }",""," body.setStyles({"," width: Y.Bottle.Device.getBrowserWidth(),"," height: Y.Bottle.Device.getBrowserHeight()"," });"," },",""," initWidgets = function(css, cls) {"," Y.all(css).each(function (srcNode) {"," var unused = new cls({"," srcNode: srcNode,"," render: true"," });"," });"," },",""," /**"," * Initialize bottle UI library , create instances with supported data-roles."," *"," * @method init"," * @param hideURL {Boolean} auto hide URL Bar when bottle inited or orientation changed"," */"," init = function (hide) {"," var pageNode = Y.one('[data-role=page]'),"," unused;",""," hideURL = hide;",""," if (inited) {"," return;"," }",""," if (pageNode) {"," Y.one('html').setStyle('overflow', 'hidden');"," body.setStyle('overflow', 'hidden');"," }",""," body.addClass(BOTTLE_INIT);"," inited = true;",""," initWidgets('[data-role=photogrid]', Y.Bottle.PhotoGrid);"," initWidgets('[data-role=carousel]', Y.Bottle.Carousel);"," initWidgets('[data-role=slidetab]', Y.Bottle.SlideTab);"," initWidgets('[data-role=loader]', Y.Bottle.Loader);",""," if (pageNode) {"," resetBodySize();"," unused = (new Y.Bottle.Page({srcNode: pageNode, render: true})).resize();"," }",""," Y.all('[data-role=shortcut]').each(function (shortcutNode) {"," unused = new Y.Bottle.ShortCut({"," srcNode: shortcutNode,"," visible: false,"," disabled: true,"," render: body"," });"," });",""," Y.all('[data-role=overlay]').each(function (overlayNode) {"," unused = new Y.Bottle.Overlay({"," srcNode: overlayNode,"," visible: false,"," disabled: true,"," render: body"," });"," });",""," window.addEventListener((Y.UA.mobile == 'Apple') ? 'orientationchange' : 'resize', function () {"," var scCurrent = Y.Bottle.ShortCut.getCurrent(),"," overlayCurrent = Y.Bottle.Overlay.getCurrent(),"," page = Y.Bottle.Page.getCurrent();",""," if (page) {"," resetBodySize();"," page.resize();"," }",""," if (scCurrent) {"," scCurrent.scResize();"," }",""," if (overlayCurrent) {"," overlayCurrent.olResize();"," }"," }, false);",""," body.addClass(BOTTLE_READY);"," Y.publish(BOTTLE_READY, {fireOnce: true});"," Y.fire(BOTTLE_READY);"," };","","Y.namespace('Bottle').init = init;","","","}, 'gallery-2012.09.19-20-07' ,{skinnable:true, requires:['gallery-bt-device', 'gallery-bt-shortcut', 'gallery-bt-overlay', 'gallery-bt-photogrid', 'gallery-bt-slidetab', 'gallery-bt-carousel', 'gallery-bt-loader']});"];
-_yuitest_coverage["/build/gallery-bottle/gallery-bottle.js"].lines = {"1":0,"16":0,"23":0,"24":0,"27":0,"34":0,"35":0,"49":0,"52":0,"54":0,"55":0,"58":0,"59":0,"60":0,"63":0,"64":0,"66":0,"67":0,"68":0,"69":0,"71":0,"72":0,"73":0,"76":0,"77":0,"85":0,"86":0,"94":0,"95":0,"99":0,"100":0,"101":0,"104":0,"105":0,"108":0,"109":0,"113":0,"114":0,"115":0,"118":0};
-_yuitest_coverage["/build/gallery-bottle/gallery-bottle.js"].functions = {"resetBodySize:22":0,"(anonymous 2):34":0,"initWidgets:33":0,"(anonymous 3):76":0,"(anonymous 4):85":0,"(anonymous 5):94":0,"init:48":0,"(anonymous 1):1":0};
-_yuitest_coverage["/build/gallery-bottle/gallery-bottle.js"].coveredLines = 40;
-_yuitest_coverage["/build/gallery-bottle/gallery-bottle.js"].coveredFunctions = 8;
+_yuitest_coverage["/build/gallery-bottle/gallery-bottle.js"].code=["YUI.add('gallery-bottle', function(Y) {","","/**"," * The bottle module collects all UI components, and provides initialize functions."," *"," * @module gallery-bottle"," */","","/**"," * Bottle is the base namespace for all Bottle Classes or statuc methods"," *"," * @class Bottle"," */","","//handle body width and height","var BOTTLE_INIT = 'btInit',"," BOTTLE_READY = 'btReady',"," BOTTLE_NATIVE = 'btNative',"," SYNC_SCREEN = 'btSyncScreen',"," htmlbody = Y.all('html, body'),"," body = Y.one('body'),"," btRoot = Y.one('.btRoot') || body.appendChild(Y.Node.create('<div class=\"btRoot\"></div>')),"," inited = body.hasClass(BOTTLE_INIT),"," hideURL = false,"," nativeScroll = true,"," styles = {"," hidden: {overflow: 'hidden'},"," scroll: {"," overflow: 'auto',"," overflowX: 'hidden'"," }"," },",""," resetBodySize = function (resize) {"," if (hideURL && !resize) {"," window.scrollTo(0, 1);"," }",""," if (nativeScroll) {"," return;"," }",""," body.setStyles({"," width: Y.Bottle.Device.getBrowserWidth(),"," height: Y.Bottle.Device.getBrowserHeight()"," });"," },",""," initWidgets = function(css, cls) {"," Y.all(css).each(function (srcNode) {"," var unused = new cls({"," srcNode: srcNode,"," render: true"," });"," });"," },",""," /**"," * Initialize bottle UI library , create instances with supported data-roles."," *"," * @method init"," * @param hideURL {Boolean} auto hide URL Bar when bottle inited or orientation changed"," */"," init = function (hide) {"," var pageNode = Y.one('[data-role=page]'),"," pageWidget;",""," hideURL = hide;",""," if (inited) {"," return;"," }",""," if (pageNode) {"," htmlbody.setStyles(styles.hidden);"," }",""," body.addClass(BOTTLE_INIT);"," inited = true;","",""," initWidgets('[data-role=photogrid]', Y.Bottle.PhotoGrid);"," initWidgets('[data-role=carousel]', Y.Bottle.Carousel);"," initWidgets('[data-role=slidetab]', Y.Bottle.SlideTab);"," initWidgets('[data-role=loader]', Y.Bottle.Loader);",""," if (pageNode) {"," resetBodySize();",""," pageWidget = new Y.Bottle.Page({srcNode: pageNode, render: true});"," pageWidget.resize();",""," if (pageWidget.get('nativeScroll')) {"," htmlbody.setStyles(styles.scroll);"," body.addClass(BOTTLE_NATIVE);"," pageWidget.item(0).get('scrollView').disable();"," Y.publish(BOTTLE_NATIVE, {fireOnce: true});"," Y.fire(BOTTLE_NATIVE);"," Y.publish(SYNC_SCREEN);",""," // disable scroll on shortcut and overlay"," btRoot.on('gesturemove', function (E) {"," E.preventDefault();"," }, {standAlone:true, root: btRoot});"," } else {"," nativeScroll = false;"," resetBodySize();"," }"," }",""," Y.all('[data-role=shortcut]').each(function (shortcutNode) {"," var unused = new Y.Bottle.ShortCut({"," srcNode: shortcutNode,"," visible: false,"," disabled: true,"," render: btRoot"," });"," });",""," Y.all('[data-role=overlay]').each(function (overlayNode) {"," var unused = new Y.Bottle.Overlay({"," srcNode: overlayNode,"," visible: false,"," disabled: true,"," render: btRoot"," });"," });",""," window.addEventListener((Y.UA.mobile == 'Apple') ? 'orientationchange' : 'resize', function () {"," var scCurrent = Y.Bottle.ShortCut.getCurrent(),"," overlayCurrent = Y.Bottle.Overlay.getCurrent(),"," page = Y.Bottle.Page.getCurrent();",""," if (page) {"," resetBodySize(true);"," page.resize();"," } else {"," Y.fire(SYNC_SCREEN);"," }",""," if (scCurrent) {"," scCurrent.scResize();"," }",""," if (overlayCurrent) {"," overlayCurrent.olResize();"," }"," }, false);",""," body.addClass(BOTTLE_READY);"," Y.publish(BOTTLE_READY, {fireOnce: true});"," Y.fire(BOTTLE_READY);"," };","","Y.namespace('Bottle').init = init;","","","}, 'gallery-2012.10.03-20-02' ,{skinnable:true, requires:['gallery-bt-shortcut', 'gallery-bt-overlay', 'gallery-bt-photogrid', 'gallery-bt-slidetab', 'gallery-bt-carousel', 'gallery-bt-loader']});"];
+_yuitest_coverage["/build/gallery-bottle/gallery-bottle.js"].lines = {"1":0,"16":0,"35":0,"36":0,"39":0,"40":0,"43":0,"50":0,"51":0,"65":0,"68":0,"70":0,"71":0,"74":0,"75":0,"78":0,"79":0,"82":0,"83":0,"84":0,"85":0,"87":0,"88":0,"90":0,"91":0,"93":0,"94":0,"95":0,"96":0,"97":0,"98":0,"99":0,"102":0,"103":0,"106":0,"107":0,"111":0,"112":0,"120":0,"121":0,"129":0,"130":0,"134":0,"135":0,"136":0,"138":0,"141":0,"142":0,"145":0,"146":0,"150":0,"151":0,"152":0,"155":0};
+_yuitest_coverage["/build/gallery-bottle/gallery-bottle.js"].functions = {"resetBodySize:34":0,"(anonymous 2):50":0,"initWidgets:49":0,"(anonymous 3):102":0,"(anonymous 4):111":0,"(anonymous 5):120":0,"(anonymous 6):129":0,"init:64":0,"(anonymous 1):1":0};
+_yuitest_coverage["/build/gallery-bottle/gallery-bottle.js"].coveredLines = 54;
+_yuitest_coverage["/build/gallery-bottle/gallery-bottle.js"].coveredFunctions = 9;
_yuitest_coverline("/build/gallery-bottle/gallery-bottle.js", 1);
YUI.add('gallery-bottle', function(Y) {
@@ -51,19 +51,37 @@ _yuitest_coverfunc("/build/gallery-bottle/gallery-bottle.js", "(anonymous 1)", 1
_yuitest_coverline("/build/gallery-bottle/gallery-bottle.js", 16);
var BOTTLE_INIT = 'btInit',
BOTTLE_READY = 'btReady',
+ BOTTLE_NATIVE = 'btNative',
+ SYNC_SCREEN = 'btSyncScreen',
+ htmlbody = Y.all('html, body'),
body = Y.one('body'),
+ btRoot = Y.one('.btRoot') || body.appendChild(Y.Node.create('<div class="btRoot"></div>')),
inited = body.hasClass(BOTTLE_INIT),
hideURL = false,
+ nativeScroll = true,
+ styles = {
+ hidden: {overflow: 'hidden'},
+ scroll: {
+ overflow: 'auto',
+ overflowX: 'hidden'
+ }
+ },
+
+ resetBodySize = function (resize) {
+ _yuitest_coverfunc("/build/gallery-bottle/gallery-bottle.js", "resetBodySize", 34);
+_yuitest_coverline("/build/gallery-bottle/gallery-bottle.js", 35);
+if (hideURL && !resize) {
+ _yuitest_coverline("/build/gallery-bottle/gallery-bottle.js", 36);
+window.scrollTo(0, 1);
+ }
- resetBodySize = function () {
- _yuitest_coverfunc("/build/gallery-bottle/gallery-bottle.js", "resetBodySize", 22);
-_yuitest_coverline("/build/gallery-bottle/gallery-bottle.js", 23);
-if (hideURL) {
- _yuitest_coverline("/build/gallery-bottle/gallery-bottle.js", 24);
-window.scrollTo(0, 0);
+ _yuitest_coverline("/build/gallery-bottle/gallery-bottle.js", 39);
+if (nativeScroll) {
+ _yuitest_coverline("/build/gallery-bottle/gallery-bottle.js", 40);
+return;
}
- _yuitest_coverline("/build/gallery-bottle/gallery-bottle.js", 27);
+ _yuitest_coverline("/build/gallery-bottle/gallery-bottle.js", 43);
body.setStyles({
width: Y.Bottle.Device.getBrowserWidth(),
height: Y.Bottle.Device.getBrowserHeight()
@@ -71,11 +89,11 @@ body.setStyles({
},
initWidgets = function(css, cls) {
- _yuitest_coverfunc("/build/gallery-bottle/gallery-bottle.js", "initWidgets", 33);
-_yuitest_coverline("/build/gallery-bottle/gallery-bottle.js", 34);
+ _yuitest_coverfunc("/build/gallery-bottle/gallery-bottle.js", "initWidgets", 49);
+_yuitest_coverline("/build/gallery-bottle/gallery-bottle.js", 50);
Y.all(css).each(function (srcNode) {
- _yuitest_coverfunc("/build/gallery-bottle/gallery-bottle.js", "(anonymous 2)", 34);
-_yuitest_coverline("/build/gallery-bottle/gallery-bottle.js", 35);
+ _yuitest_coverfunc("/build/gallery-bottle/gallery-bottle.js", "(anonymous 2)", 50);
+_yuitest_coverline("/build/gallery-bottle/gallery-bottle.js", 51);
var unused = new cls({
srcNode: srcNode,
render: true
@@ -90,113 +108,147 @@ var unused = new cls({
* @param hideURL {Boolean} auto hide URL Bar when bottle inited or orientation changed
*/
init = function (hide) {
- _yuitest_coverfunc("/build/gallery-bottle/gallery-bottle.js", "init", 48);
-_yuitest_coverline("/build/gallery-bottle/gallery-bottle.js", 49);
+ _yuitest_coverfunc("/build/gallery-bottle/gallery-bottle.js", "init", 64);
+_yuitest_coverline("/build/gallery-bottle/gallery-bottle.js", 65);
var pageNode = Y.one('[data-role=page]'),
- unused;
+ pageWidget;
- _yuitest_coverline("/build/gallery-bottle/gallery-bottle.js", 52);
+ _yuitest_coverline("/build/gallery-bottle/gallery-bottle.js", 68);
hideURL = hide;
- _yuitest_coverline("/build/gallery-bottle/gallery-bottle.js", 54);
+ _yuitest_coverline("/build/gallery-bottle/gallery-bottle.js", 70);
if (inited) {
- _yuitest_coverline("/build/gallery-bottle/gallery-bottle.js", 55);
+ _yuitest_coverline("/build/gallery-bottle/gallery-bottle.js", 71);
return;
}
- _yuitest_coverline("/build/gallery-bottle/gallery-bottle.js", 58);
+ _yuitest_coverline("/build/gallery-bottle/gallery-bottle.js", 74);
if (pageNode) {
- _yuitest_coverline("/build/gallery-bottle/gallery-bottle.js", 59);
-Y.one('html').setStyle('overflow', 'hidden');
- _yuitest_coverline("/build/gallery-bottle/gallery-bottle.js", 60);
-body.setStyle('overflow', 'hidden');
+ _yuitest_coverline("/build/gallery-bottle/gallery-bottle.js", 75);
+htmlbody.setStyles(styles.hidden);
}
- _yuitest_coverline("/build/gallery-bottle/gallery-bottle.js", 63);
+ _yuitest_coverline("/build/gallery-bottle/gallery-bottle.js", 78);
body.addClass(BOTTLE_INIT);
- _yuitest_coverline("/build/gallery-bottle/gallery-bottle.js", 64);
+ _yuitest_coverline("/build/gallery-bottle/gallery-bottle.js", 79);
inited = true;
- _yuitest_coverline("/build/gallery-bottle/gallery-bottle.js", 66);
+
+ _yuitest_coverline("/build/gallery-bottle/gallery-bottle.js", 82);
initWidgets('[data-role=photogrid]', Y.Bottle.PhotoGrid);
- _yuitest_coverline("/build/gallery-bottle/gallery-bottle.js", 67);
+ _yuitest_coverline("/build/gallery-bottle/gallery-bottle.js", 83);
initWidgets('[data-role=carousel]', Y.Bottle.Carousel);
- _yuitest_coverline("/build/gallery-bottle/gallery-bottle.js", 68);
+ _yuitest_coverline("/build/gallery-bottle/gallery-bottle.js", 84);
initWidgets('[data-role=slidetab]', Y.Bottle.SlideTab);
- _yuitest_coverline("/build/gallery-bottle/gallery-bottle.js", 69);
+ _yuitest_coverline("/build/gallery-bottle/gallery-bottle.js", 85);
initWidgets('[data-role=loader]', Y.Bottle.Loader);
- _yuitest_coverline("/build/gallery-bottle/gallery-bottle.js", 71);
+ _yuitest_coverline("/build/gallery-bottle/gallery-bottle.js", 87);
if (pageNode) {
- _yuitest_coverline("/build/gallery-bottle/gallery-bottle.js", 72);
+ _yuitest_coverline("/build/gallery-bottle/gallery-bottle.js", 88);
+resetBodySize();
+
+ _yuitest_coverline("/build/gallery-bottle/gallery-bottle.js", 90);
+pageWidget = new Y.Bottle.Page({srcNode: pageNode, render: true});
+ _yuitest_coverline("/build/gallery-bottle/gallery-bottle.js", 91);
+pageWidget.resize();
+
+ _yuitest_coverline("/build/gallery-bottle/gallery-bottle.js", 93);
+if (pageWidget.get('nativeScroll')) {
+ _yuitest_coverline("/build/gallery-bottle/gallery-bottle.js", 94);
+htmlbody.setStyles(styles.scroll);
+ _yuitest_coverline("/build/gallery-bottle/gallery-bottle.js", 95);
+body.addClass(BOTTLE_NATIVE);
+ _yuitest_coverline("/build/gallery-bottle/gallery-bottle.js", 96);
+pageWidget.item(0).get('scrollView').disable();
+ _yuitest_coverline("/build/gallery-bottle/gallery-bottle.js", 97);
+Y.publish(BOTTLE_NATIVE, {fireOnce: true});
+ _yuitest_coverline("/build/gallery-bottle/gallery-bottle.js", 98);
+Y.fire(BOTTLE_NATIVE);
+ _yuitest_coverline("/build/gallery-bottle/gallery-bottle.js", 99);
+Y.publish(SYNC_SCREEN);
+
+ // disable scroll on shortcut and overlay
+ _yuitest_coverline("/build/gallery-bottle/gallery-bottle.js", 102);
+btRoot.on('gesturemove', function (E) {
+ _yuitest_coverfunc("/build/gallery-bottle/gallery-bottle.js", "(anonymous 3)", 102);
+_yuitest_coverline("/build/gallery-bottle/gallery-bottle.js", 103);
+E.preventDefault();
+ }, {standAlone:true, root: btRoot});
+ } else {
+ _yuitest_coverline("/build/gallery-bottle/gallery-bottle.js", 106);
+nativeScroll = false;
+ _yuitest_coverline("/build/gallery-bottle/gallery-bottle.js", 107);
resetBodySize();
- _yuitest_coverline("/build/gallery-bottle/gallery-bottle.js", 73);
-unused = (new Y.Bottle.Page({srcNode: pageNode, render: true})).resize();
+ }
}
- _yuitest_coverline("/build/gallery-bottle/gallery-bottle.js", 76);
+ _yuitest_coverline("/build/gallery-bottle/gallery-bottle.js", 111);
Y.all('[data-role=shortcut]').each(function (shortcutNode) {
- _yuitest_coverfunc("/build/gallery-bottle/gallery-bottle.js", "(anonymous 3)", 76);
-_yuitest_coverline("/build/gallery-bottle/gallery-bottle.js", 77);
-unused = new Y.Bottle.ShortCut({
+ _yuitest_coverfunc("/build/gallery-bottle/gallery-bottle.js", "(anonymous 4)", 111);
+_yuitest_coverline("/build/gallery-bottle/gallery-bottle.js", 112);
+var unused = new Y.Bottle.ShortCut({
srcNode: shortcutNode,
visible: false,
disabled: true,
- render: body
+ render: btRoot
});
});
- _yuitest_coverline("/build/gallery-bottle/gallery-bottle.js", 85);
+ _yuitest_coverline("/build/gallery-bottle/gallery-bottle.js", 120);
Y.all('[data-role=overlay]').each(function (overlayNode) {
- _yuitest_coverfunc("/build/gallery-bottle/gallery-bottle.js", "(anonymous 4)", 85);
-_yuitest_coverline("/build/gallery-bottle/gallery-bottle.js", 86);
-unused = new Y.Bottle.Overlay({
+ _yuitest_coverfunc("/build/gallery-bottle/gallery-bottle.js", "(anonymous 5)", 120);
+_yuitest_coverline("/build/gallery-bottle/gallery-bottle.js", 121);
+var unused = new Y.Bottle.Overlay({
srcNode: overlayNode,
visible: false,
disabled: true,
- render: body
+ render: btRoot
});
});
- _yuitest_coverline("/build/gallery-bottle/gallery-bottle.js", 94);
+ _yuitest_coverline("/build/gallery-bottle/gallery-bottle.js", 129);
window.addEventListener((Y.UA.mobile == 'Apple') ? 'orientationchange' : 'resize', function () {
- _yuitest_coverfunc("/build/gallery-bottle/gallery-bottle.js", "(anonymous 5)", 94);
-_yuitest_coverline("/build/gallery-bottle/gallery-bottle.js", 95);
+ _yuitest_coverfunc("/build/gallery-bottle/gallery-bottle.js", "(anonymous 6)", 129);
+_yuitest_coverline("/build/gallery-bottle/gallery-bottle.js", 130);
var scCurrent = Y.Bottle.ShortCut.getCurrent(),
overlayCurrent = Y.Bottle.Overlay.getCurrent(),
page = Y.Bottle.Page.getCurrent();
- _yuitest_coverline("/build/gallery-bottle/gallery-bottle.js", 99);
+ _yuitest_coverline("/build/gallery-bottle/gallery-bottle.js", 134);
if (page) {
- _yuitest_coverline("/build/gallery-bottle/gallery-bottle.js", 100);
-resetBodySize();
- _yuitest_coverline("/build/gallery-bottle/gallery-bottle.js", 101);
+ _yuitest_coverline("/build/gallery-bottle/gallery-bottle.js", 135);
+resetBodySize(true);
+ _yuitest_coverline("/build/gallery-bottle/gallery-bottle.js", 136);
page.resize();
+ } else {
+ _yuitest_coverline("/build/gallery-bottle/gallery-bottle.js", 138);
+Y.fire(SYNC_SCREEN);
}
- _yuitest_coverline("/build/gallery-bottle/gallery-bottle.js", 104);
+ _yuitest_coverline("/build/gallery-bottle/gallery-bottle.js", 141);
if (scCurrent) {
- _yuitest_coverline("/build/gallery-bottle/gallery-bottle.js", 105);
+ _yuitest_coverline("/build/gallery-bottle/gallery-bottle.js", 142);
scCurrent.scResize();
}
- _yuitest_coverline("/build/gallery-bottle/gallery-bottle.js", 108);
+ _yuitest_coverline("/build/gallery-bottle/gallery-bottle.js", 145);
if (overlayCurrent) {
- _yuitest_coverline("/build/gallery-bottle/gallery-bottle.js", 109);
+ _yuitest_coverline("/build/gallery-bottle/gallery-bottle.js", 146);
overlayCurrent.olResize();
}
}, false);
- _yuitest_coverline("/build/gallery-bottle/gallery-bottle.js", 113);
+ _yuitest_coverline("/build/gallery-bottle/gallery-bottle.js", 150);
body.addClass(BOTTLE_READY);
- _yuitest_coverline("/build/gallery-bottle/gallery-bottle.js", 114);
+ _yuitest_coverline("/build/gallery-bottle/gallery-bottle.js", 151);
Y.publish(BOTTLE_READY, {fireOnce: true});
- _yuitest_coverline("/build/gallery-bottle/gallery-bottle.js", 115);
+ _yuitest_coverline("/build/gallery-bottle/gallery-bottle.js", 152);
Y.fire(BOTTLE_READY);
};
-_yuitest_coverline("/build/gallery-bottle/gallery-bottle.js", 118);
+_yuitest_coverline("/build/gallery-bottle/gallery-bottle.js", 155);
Y.namespace('Bottle').init = init;
-}, 'gallery-2012.09.19-20-07' ,{skinnable:true, requires:['gallery-bt-device', 'gallery-bt-shortcut', 'gallery-bt-overlay', 'gallery-bt-photogrid', 'gallery-bt-slidetab', 'gallery-bt-carousel', 'gallery-bt-loader']});
+}, 'gallery-2012.10.03-20-02' ,{skinnable:true, requires:['gallery-bt-shortcut', 'gallery-bt-overlay', 'gallery-bt-photogrid', 'gallery-bt-slidetab', 'gallery-bt-carousel', 'gallery-bt-loader']});
View
63 build/gallery-bottle/gallery-bottle-debug.js
@@ -15,13 +15,29 @@ YUI.add('gallery-bottle', function(Y) {
//handle body width and height
var BOTTLE_INIT = 'btInit',
BOTTLE_READY = 'btReady',
+ BOTTLE_NATIVE = 'btNative',
+ SYNC_SCREEN = 'btSyncScreen',
+ htmlbody = Y.all('html, body'),
body = Y.one('body'),
+ btRoot = Y.one('.btRoot') || body.appendChild(Y.Node.create('<div class="btRoot"></div>')),
inited = body.hasClass(BOTTLE_INIT),
hideURL = false,
+ nativeScroll = true,
+ styles = {
+ hidden: {overflow: 'hidden'},
+ scroll: {
+ overflow: 'auto',
+ overflowX: 'hidden'
+ }
+ },
- resetBodySize = function () {
- if (hideURL) {
- window.scrollTo(0, 0);
+ resetBodySize = function (resize) {
+ if (hideURL && !resize) {
+ window.scrollTo(0, 1);
+ }
+
+ if (nativeScroll) {
+ return;
}
body.setStyles({
@@ -47,7 +63,7 @@ var BOTTLE_INIT = 'btInit',
*/
init = function (hide) {
var pageNode = Y.one('[data-role=page]'),
- unused;
+ pageWidget;
hideURL = hide;
@@ -56,13 +72,13 @@ var BOTTLE_INIT = 'btInit',
}
if (pageNode) {
- Y.one('html').setStyle('overflow', 'hidden');
- body.setStyle('overflow', 'hidden');
+ htmlbody.setStyles(styles.hidden);
}
body.addClass(BOTTLE_INIT);
inited = true;
+
initWidgets('[data-role=photogrid]', Y.Bottle.PhotoGrid);
initWidgets('[data-role=carousel]', Y.Bottle.Carousel);
initWidgets('[data-role=slidetab]', Y.Bottle.SlideTab);
@@ -70,24 +86,43 @@ var BOTTLE_INIT = 'btInit',
if (pageNode) {
resetBodySize();
- unused = (new Y.Bottle.Page({srcNode: pageNode, render: true})).resize();
+
+ pageWidget = new Y.Bottle.Page({srcNode: pageNode, render: true});
+ pageWidget.resize();
+
+ if (pageWidget.get('nativeScroll')) {
+ htmlbody.setStyles(styles.scroll);
+ body.addClass(BOTTLE_NATIVE);
+ pageWidget.item(0).get('scrollView').disable();
+ Y.publish(BOTTLE_NATIVE, {fireOnce: true});
+ Y.fire(BOTTLE_NATIVE);
+ Y.publish(SYNC_SCREEN);
+
+ // disable scroll on shortcut and overlay
+ btRoot.on('gesturemove', function (E) {
+ E.preventDefault();
+ }, {standAlone:true, root: btRoot});
+ } else {
+ nativeScroll = false;
+ resetBodySize();
+ }
}
Y.all('[data-role=shortcut]').each(function (shortcutNode) {
- unused = new Y.Bottle.ShortCut({
+ var unused = new Y.Bottle.ShortCut({
srcNode: shortcutNode,
visible: false,
disabled: true,
- render: body
+ render: btRoot
});
});
Y.all('[data-role=overlay]').each(function (overlayNode) {
- unused = new Y.Bottle.Overlay({
+ var unused = new Y.Bottle.Overlay({
srcNode: overlayNode,
visible: false,
disabled: true,
- render: body
+ render: btRoot
});
});
@@ -97,8 +132,10 @@ var BOTTLE_INIT = 'btInit',
page = Y.Bottle.Page.getCurrent();
if (page) {
- resetBodySize();
+ resetBodySize(true);
page.resize();
+ } else {
+ Y.fire(SYNC_SCREEN);
}
if (scCurrent) {
@@ -118,4 +155,4 @@ var BOTTLE_INIT = 'btInit',
Y.namespace('Bottle').init = init;
-}, 'gallery-2012.09.19-20-07' ,{skinnable:true, requires:['gallery-bt-device', 'gallery-bt-shortcut', 'gallery-bt-overlay', 'gallery-bt-photogrid', 'gallery-bt-slidetab', 'gallery-bt-carousel', 'gallery-bt-loader']});
+}, 'gallery-2012.10.03-20-02' ,{skinnable:true, requires:['gallery-bt-shortcut', 'gallery-bt-overlay', 'gallery-bt-photogrid', 'gallery-bt-slidetab', 'gallery-bt-carousel', 'gallery-bt-loader']});
View
2  build/gallery-bottle/gallery-bottle-min.js
@@ -1 +1 @@
-YUI.add("gallery-bottle",function(a){var d="btInit",g="btReady",e=a.one("body"),i=e.hasClass(d),b=false,c=function(){if(b){window.scrollTo(0,0);}e.setStyles({width:a.Bottle.Device.getBrowserWidth(),height:a.Bottle.Device.getBrowserHeight()});},f=function(k,j){a.all(k).each(function(m){var l=new j({srcNode:m,render:true});});},h=function(l){var k=a.one("[data-role=page]"),j;b=l;if(i){return;}if(k){a.one("html").setStyle("overflow","hidden");e.setStyle("overflow","hidden");}e.addClass(d);i=true;f("[data-role=photogrid]",a.Bottle.PhotoGrid);f("[data-role=carousel]",a.Bottle.Carousel);f("[data-role=slidetab]",a.Bottle.SlideTab);f("[data-role=loader]",a.Bottle.Loader);if(k){c();j=(new a.Bottle.Page({srcNode:k,render:true})).resize();}a.all("[data-role=shortcut]").each(function(m){j=new a.Bottle.ShortCut({srcNode:m,visible:false,disabled:true,render:e});});a.all("[data-role=overlay]").each(function(m){j=new a.Bottle.Overlay({srcNode:m,visible:false,disabled:true,render:e});});window.addEventListener((a.UA.mobile=="Apple")?"orientationchange":"resize",function(){var o=a.Bottle.ShortCut.getCurrent(),m=a.Bottle.Overlay.getCurrent(),n=a.Bottle.Page.getCurrent();if(n){c();n.resize();}if(o){o.scResize();}if(m){m.olResize();}},false);e.addClass(g);a.publish(g,{fireOnce:true});a.fire(g);};a.namespace("Bottle").init=h;},"gallery-2012.09.19-20-07",{skinnable:true,requires:["gallery-bt-device","gallery-bt-shortcut","gallery-bt-overlay","gallery-bt-photogrid","gallery-bt-slidetab","gallery-bt-carousel","gallery-bt-loader"]});
+YUI.add("gallery-bottle",function(c){var f="btInit",k="btReady",b="btNative",l="btSyncScreen",i=c.all("html, body"),g=c.one("body"),a=c.one(".btRoot")||g.appendChild(c.Node.create('<div class="btRoot"></div>')),o=g.hasClass(f),d=false,h=true,n={hidden:{overflow:"hidden"},scroll:{overflow:"auto",overflowX:"hidden"}},e=function(p){if(d&&!p){window.scrollTo(0,1);}if(h){return;}g.setStyles({width:c.Bottle.Device.getBrowserWidth(),height:c.Bottle.Device.getBrowserHeight()});},j=function(q,p){c.all(q).each(function(s){var r=new p({srcNode:s,render:true});});},m=function(r){var q=c.one("[data-role=page]"),p;d=r;if(o){return;}if(q){i.setStyles(n.hidden);}g.addClass(f);o=true;j("[data-role=photogrid]",c.Bottle.PhotoGrid);j("[data-role=carousel]",c.Bottle.Carousel);j("[data-role=slidetab]",c.Bottle.SlideTab);j("[data-role=loader]",c.Bottle.Loader);if(q){e();p=new c.Bottle.Page({srcNode:q,render:true});p.resize();if(p.get("nativeScroll")){i.setStyles(n.scroll);g.addClass(b);p.item(0).get("scrollView").disable();c.publish(b,{fireOnce:true});c.fire(b);c.publish(l);a.on("gesturemove",function(s){s.preventDefault();},{standAlone:true,root:a});}else{h=false;e();}}c.all("[data-role=shortcut]").each(function(t){var s=new c.Bottle.ShortCut({srcNode:t,visible:false,disabled:true,render:a});});c.all("[data-role=overlay]").each(function(t){var s=new c.Bottle.Overlay({srcNode:t,visible:false,disabled:true,render:a});});window.addEventListener((c.UA.mobile=="Apple")?"orientationchange":"resize",function(){var u=c.Bottle.ShortCut.getCurrent(),s=c.Bottle.Overlay.getCurrent(),t=c.Bottle.Page.getCurrent();if(t){e(true);t.resize();}else{c.fire(l);}if(u){u.scResize();}if(s){s.olResize();}},false);g.addClass(k);c.publish(k,{fireOnce:true});c.fire(k);};c.namespace("Bottle").init=m;},"gallery-2012.10.03-20-02",{skinnable:true,requires:["gallery-bt-shortcut","gallery-bt-overlay","gallery-bt-photogrid","gallery-bt-slidetab","gallery-bt-carousel","gallery-bt-loader"]});
View
63 build/gallery-bottle/gallery-bottle.js
@@ -15,13 +15,29 @@ YUI.add('gallery-bottle', function(Y) {
//handle body width and height
var BOTTLE_INIT = 'btInit',
BOTTLE_READY = 'btReady',
+ BOTTLE_NATIVE = 'btNative',
+ SYNC_SCREEN = 'btSyncScreen',
+ htmlbody = Y.all('html, body'),
body = Y.one('body'),
+ btRoot = Y.one('.btRoot') || body.appendChild(Y.Node.create('<div class="btRoot"></div>')),
inited = body.hasClass(BOTTLE_INIT),
hideURL = false,
+ nativeScroll = true,
+ styles = {
+ hidden: {overflow: 'hidden'},
+ scroll: {
+ overflow: 'auto',
+ overflowX: 'hidden'
+ }
+ },
- resetBodySize = function () {
- if (hideURL) {
- window.scrollTo(0, 0);
+ resetBodySize = function (resize) {
+ if (hideURL && !resize) {
+ window.scrollTo(0, 1);
+ }
+
+ if (nativeScroll) {
+ return;
}
body.setStyles({
@@ -47,7 +63,7 @@ var BOTTLE_INIT = 'btInit',
*/
init = function (hide) {
var pageNode = Y.one('[data-role=page]'),
- unused;
+ pageWidget;
hideURL = hide;
@@ -56,13 +72,13 @@ var BOTTLE_INIT = 'btInit',
}
if (pageNode) {
- Y.one('html').setStyle('overflow', 'hidden');
- body.setStyle('overflow', 'hidden');
+ htmlbody.setStyles(styles.hidden);
}
body.addClass(BOTTLE_INIT);
inited = true;
+
initWidgets('[data-role=photogrid]', Y.Bottle.PhotoGrid);
initWidgets('[data-role=carousel]', Y.Bottle.Carousel);
initWidgets('[data-role=slidetab]', Y.Bottle.SlideTab);
@@ -70,24 +86,43 @@ var BOTTLE_INIT = 'btInit',
if (pageNode) {
resetBodySize();
- unused = (new Y.Bottle.Page({srcNode: pageNode, render: true})).resize();
+
+ pageWidget = new Y.Bottle.Page({srcNode: pageNode, render: true});
+ pageWidget.resize();
+
+ if (pageWidget.get('nativeScroll')) {
+ htmlbody.setStyles(styles.scroll);
+ body.addClass(BOTTLE_NATIVE);
+ pageWidget.item(0).get('scrollView').disable();
+ Y.publish(BOTTLE_NATIVE, {fireOnce: true});
+ Y.fire(BOTTLE_NATIVE);
+ Y.publish(SYNC_SCREEN);
+
+ // disable scroll on shortcut and overlay
+ btRoot.on('gesturemove', function (E) {
+ E.preventDefault();
+ }, {standAlone:true, root: btRoot});
+ } else {
+ nativeScroll = false;
+ resetBodySize();
+ }
}
Y.all('[data-role=shortcut]').each(function (shortcutNode) {
- unused = new Y.Bottle.ShortCut({
+ var unused = new Y.Bottle.ShortCut({
srcNode: shortcutNode,
visible: false,
disabled: true,
- render: body
+ render: btRoot
});
});
Y.all('[data-role=overlay]').each(function (overlayNode) {
- unused = new Y.Bottle.Overlay({
+ var unused = new Y.Bottle.Overlay({
srcNode: overlayNode,
visible: false,
disabled: true,
- render: body
+ render: btRoot
});
});
@@ -97,8 +132,10 @@ var BOTTLE_INIT = 'btInit',
page = Y.Bottle.Page.getCurrent();
if (page) {
- resetBodySize();
+ resetBodySize(true);
page.resize();
+ } else {
+ Y.fire(SYNC_SCREEN);
}
if (scCurrent) {
@@ -118,4 +155,4 @@ var BOTTLE_INIT = 'btInit',
Y.namespace('Bottle').init = init;
-}, 'gallery-2012.09.19-20-07' ,{skinnable:true, requires:['gallery-bt-device', 'gallery-bt-shortcut', 'gallery-bt-overlay', 'gallery-bt-photogrid', 'gallery-bt-slidetab', 'gallery-bt-carousel', 'gallery-bt-loader']});
+}, 'gallery-2012.10.03-20-02' ,{skinnable:true, requires:['gallery-bt-shortcut', 'gallery-bt-overlay', 'gallery-bt-photogrid', 'gallery-bt-slidetab', 'gallery-bt-carousel', 'gallery-bt-loader']});
View
6 build/gallery-bt-carousel/assets/gallery-bottle-core.css
@@ -2,10 +2,16 @@ html{height:100%}
body{position:relative}
body.btInit{-webkit-text-size-adjust:100%}
+.bt_posfixed{position:absolute;top:10px;left:0;overflow:scroll;width:30px;height:30px}
+.bt_posfixed div{height:100px;width:100%;position:relative}
+.bt_posfixed span{position:fixed;top:1px}
+
.bt-translate3d{-webkit-transform: translate3d(0, 0, 0)}
.bt-shortcut-mask,
.bt-overlay-mask{position:absolute;top:0;left:0;z-index:150;width:100%;height:100%;display:none}
.yui3-btcontainer{position:absolute;width:100%}
+.btp-native .yui3-btcontainer{position:relative}
+.bt-header, .bt-footer{width:100%;box-sizing:border-box;-moz-box-sizing:border-box}
.yui3-widget-pushpop{overflow:hidden}
View
141 build/gallery-bt-carousel/gallery-bt-carousel-coverage.js
@@ -26,11 +26,11 @@ _yuitest_coverage["/build/gallery-bt-carousel/gallery-bt-carousel.js"] = {
path: "/build/gallery-bt-carousel/gallery-bt-carousel.js",
code: []
};
-_yuitest_coverage["/build/gallery-bt-carousel/gallery-bt-carousel.js"].code=["YUI.add('gallery-bt-carousel', function(Y) {","","/**"," * Provide Carousel class to rendering a lot of photo in many kinds of layout"," *"," * @module gallery-bt-carousel"," * @static"," */","","var WIDTH_CHANGE = 'widthChange',",""," PREFIX = 'bcr_',",""," CLASSES = {"," INDEXBOX: PREFIX + 'indexbox',"," INDEXITEM: PREFIX + 'indexitem',"," INDEXON: PREFIX + 'on',"," LEFT: PREFIX + 'btnl',"," RIGHT: PREFIX + 'btnr',"," SHOWBUTTON: PREFIX + 'showbtn',"," BUTTONOFF: PREFIX + 'off'"," },",""," HTMLS = {"," INDEXBOX: '<ol class=\"' + CLASSES.INDEXBOX + '\"></ol>',"," INDEXITEM: '<li class=\"' + CLASSES.INDEXITEM + '\"></li>',"," LEFT: '<div class=\"' + CLASSES.LEFT + '\"></li>',"," RIGHT: '<div class=\"' + CLASSES.RIGHT + '\"></li>'"," },","","/**"," * Carousel is a Widget which can help you to render a lot of photo in different patterns."," *"," * @class Carousel"," * @constructor"," * @namespace Bottle"," * @extends ScrollView"," * @uses Bottle.SyncScroll"," * @uses Y.zui.Attribute"," * @param [config] {Object} Object literal with initial attribute values"," */","Carousel = Y.Base.create('btcarousel', Y.ScrollView, [Y.Bottle.SyncScroll, Y.zui.Attribute], {"," initializer: function () {"," this.set('syncScrollMethod', this._updatePages);"," this.plug(Y.zui.RAScroll);"," },",""," destructor: function () {"," this.unsync('selectedIndex', this.pages, 'index');"," this.unplug(Y.zui.RAScroll);"," this._bpgEventHandlers.detach();"," delete this._bpgEventHandlers;"," },",""," renderUI: function () {"," var parent = this.get('indexNode') || this.get('boundingBox'),"," box = parent.appendChild(HTMLS.INDEXBOX),"," all = this.pages.get('total'),"," index = this.get('contentBox').getData('selected-index') || 0,"," I;",""," this._indexes = [];"," for (I=0;I<all;I++) {"," this._indexes.push(box.appendChild(HTMLS.INDEXITEM));"," }",""," this.unplug(Y.Plugin.ScrollViewScrollbars);"," this._updatePages();"," this.sync('selectedIndex', this.pages, 'index');",""," /**"," * left button Node"," *"," * @property leftButton"," * @type Node"," */"," this.leftButton = parent.appendChild(HTMLS.LEFT).setHTML(this.get('textLeft'));",""," /**"," * right button Node"," *"," * @property rightButton"," * @type Node"," */"," this.rightButton = parent.appendChild(HTMLS.RIGHT).setHTML(this.get('textRight'));",""," /**"," * internal eventhandlers, keep for destructor"," *"," * @property _bpgEventHandlers"," * @type EventHandle"," * @private"," */"," this._bpgEventHandlers = new Y.EventHandle(["," this.after(WIDTH_CHANGE, this._updatePages),"," this.leftButton.on('click', this.pages.prev, this.pages),"," this.rightButton.on('click', this.pages.next, this.pages)"," ]);",""," this.set('selectedIndex', index);"," this._updateButtons(index);"," },",""," /**"," * udpate left/right buttons status"," *"," * @method _updateButtons"," * @protected"," */"," _updateButtons: function (V) {"," if (this.leftButton) {"," this.leftButton.toggleClass(CLASSES.BUTTONOFF, (V === 0));"," this.rightButton.toggleClass(CLASSES.BUTTONOFF, (V === this.pages.get('total') - 1));"," }"," },"," "," /**"," * udpate page nodes width"," *"," * @method _updatePages"," * @protected"," */"," _updatePages: function () {"," this.get('pageNode').set('offsetWidth', Math.floor(this.get('boundingBox').get('offsetWidth') / this.get('pageItems')));"," this._uiDimensionsChange();"," }","}, {"," /**"," * Static property used to define the default attribute configuration."," *"," * @property ATTRS"," * @type Object"," * @static"," * @protected"," */"," ATTRS: {"," /**"," * Default pages node css selector. After the Widget initialized, the attribute will become the NodeList object."," *"," * @attribute pageNode"," * @type {{String|NodeList}}"," * @default '> li'"," */"," pageNode: {"," value: '> li',"," writeOnce: true,"," lazyAdd: false,"," setter: function (V) {"," this._pageCSS = V;"," return this.get('contentBox').all(V);"," }"," },",""," /**"," * Specify how many items in a page."," *"," * @attribute pageItems"," * @type {{Number}}"," * @default 1"," */"," pageItems: {"," value: 1,"," lazyAdd: false,"," writeOnce: true,"," validator: Y.Lang.isNumber,"," setter: function (V) {"," var v = Math.max(1, Math.floor(V));",""," this.plug(Y.zui.ScrollSnapper, {selector: this._pageCSS + ((v > 1) ? (':nth-child(' + v + 'n+1)') : '')});"," return v;"," }"," },",""," /**"," * Specify page indicator parent Node. If the Node can not be found or omitted, the indicator will be appended into the boundingBox."," *"," * @attribute indexNode"," * @type {{String|Node}}"," */"," indexNode: {"," writeOnce: true,"," setter: Y.one"," },",""," /**"," * Specify wording for left button"," *"," * @attribute textRight"," * @type {{String}}"," */"," textRight: {"," value: '',"," writeOnce: true"," },",""," /**"," * Specify wording for left button"," *"," * @attribute textLeft"," * @type {{String}}"," */"," textLeft: {"," value: '',"," writeOnce: true"," },",""," /**"," * Display left button and right botton when set to true."," *"," * @attribute showButtons"," * @type Boolean"," * @default true"," */"," showButtons: {"," value: true,"," lazyAdd: false,"," validator: Y.Lang.isBoolean,"," setter: function (V) {"," this.get('boundingBox').toggleClass(CLASSES.SHOWBUTTON, V);"," return V;"," }"," },",""," /**"," * selectd page index, start from 0."," *"," * @attribute selectedIndex"," * @type Number"," * @default 0"," */"," selectedIndex: {"," setter: function (V) {"," var pages = this._indexes,"," oldV = this.get('selectedIndex'),"," old = pages ? pages[oldV] : undefined,"," O = pages ? pages[V] : undefined;",""," if (O && (old !== O)) {"," if (old) {"," old.removeClass(CLASSES.INDEXON);"," }"," O.addClass(CLASSES.INDEXON);",""," this._updateButtons(V);",""," return V * 1;"," }",""," return oldV;"," }"," }"," },",""," /**"," * Static property used to define the default HTML parsing rules"," *"," * @property HTML_PARSER"," * @static"," * @protected"," * @type Object"," */"," HTML_PARSER: {"," pageItems: function (srcNode) {"," var pi = srcNode.getData('page-items');"," return pi ? pi * 1 : 1;"," },"," pageNode: function (srcNode) {"," try {"," this.setAttrs(Y.JSON.parse(srcNode.getData('cfg-scroll')));"," } catch (e) {"," }"," return srcNode.getData('page-node');"," },"," textLeft: function (srcNode) {"," return srcNode.getData('text-left') || '';"," },"," textRight: function (srcNode) {"," return srcNode.getData('text-right') || '';"," },"," indexNode: function (srcNode) {"," return srcNode.getData('index-node');"," },"," showButtons: function (srcNode) {"," return srcNode.getData('show-buttons') !== 'false';"," }"," }","});","","Y.namespace('Bottle').Carousel = Carousel;","","","}, '@VERSION@' ,{requires:['gallery-bt-syncscroll', 'gallery-zui-rascroll', 'gallery-zui-scrollsnapper', 'gallery-zui-attribute']});"];
-_yuitest_coverage["/build/gallery-bt-carousel/gallery-bt-carousel.js"].lines = {"1":0,"10":0,"44":0,"45":0,"49":0,"50":0,"51":0,"52":0,"56":0,"62":0,"63":0,"64":0,"67":0,"68":0,"69":0,"77":0,"85":0,"94":0,"100":0,"101":0,"111":0,"112":0,"113":0,"124":0,"125":0,"149"