yui-rails-asset 2.8.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (398) hide show
  1. data/LICENSE +21 -0
  2. data/README +17 -0
  3. data/lib/yui/rails.rb +29 -0
  4. data/lib/yui/rails/engine.rb +10 -0
  5. data/lib/yui/rails/version.rb +6 -0
  6. data/vendor/assets/javascripts/yui-2.8.1/build/animation/animation-debug.js +1396 -0
  7. data/vendor/assets/javascripts/yui-2.8.1/build/animation/animation-min.js +23 -0
  8. data/vendor/assets/javascripts/yui-2.8.1/build/animation/animation.js +1392 -0
  9. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/ajax-loader.gif +0 -0
  10. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/asc.gif +0 -0
  11. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/autocomplete.css +7 -0
  12. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/back-h.png +0 -0
  13. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/back-v.png +0 -0
  14. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/bar-h.png +0 -0
  15. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/bar-v.png +0 -0
  16. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/bg-h.gif +0 -0
  17. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/bg-v.gif +0 -0
  18. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/blankimage.png +0 -0
  19. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/button.css +7 -0
  20. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/calendar.css +8 -0
  21. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/carousel.css +7 -0
  22. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/check0.gif +0 -0
  23. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/check1.gif +0 -0
  24. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/check2.gif +0 -0
  25. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/colorpicker.css +7 -0
  26. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/container.css +7 -0
  27. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/datatable.css +8 -0
  28. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/desc.gif +0 -0
  29. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/dt-arrow-dn.png +0 -0
  30. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/dt-arrow-up.png +0 -0
  31. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/editor-knob.gif +0 -0
  32. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/editor-sprite-active.gif +0 -0
  33. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/editor-sprite.gif +0 -0
  34. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/editor.css +10 -0
  35. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/header_background.png +0 -0
  36. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/hue_bg.png +0 -0
  37. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/imagecropper.css +7 -0
  38. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/layout.css +7 -0
  39. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/layout_sprite.png +0 -0
  40. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/loading.gif +0 -0
  41. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/logger.css +7 -0
  42. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/menu-button-arrow-disabled.png +0 -0
  43. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/menu-button-arrow.png +0 -0
  44. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/menu.css +7 -0
  45. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/menubaritem_submenuindicator.png +0 -0
  46. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/menubaritem_submenuindicator_disabled.png +0 -0
  47. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/menuitem_checkbox.png +0 -0
  48. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/menuitem_checkbox_disabled.png +0 -0
  49. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/menuitem_submenuindicator.png +0 -0
  50. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/menuitem_submenuindicator_disabled.png +0 -0
  51. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/paginator.css +7 -0
  52. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/picker_mask.png +0 -0
  53. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/profilerviewer.css +7 -0
  54. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/progressbar.css +7 -0
  55. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/resize.css +7 -0
  56. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/simpleeditor.css +10 -0
  57. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/skin.css +36 -0
  58. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/slider.css +7 -0
  59. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/split-button-arrow-active.png +0 -0
  60. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/split-button-arrow-disabled.png +0 -0
  61. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/split-button-arrow-focus.png +0 -0
  62. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/split-button-arrow-hover.png +0 -0
  63. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/split-button-arrow.png +0 -0
  64. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/sprite.png +0 -0
  65. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/sprite.psd +0 -0
  66. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/tabview.css +8 -0
  67. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/treeview-loading.gif +0 -0
  68. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/treeview-sprite.gif +0 -0
  69. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/treeview.css +7 -0
  70. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/wait.gif +0 -0
  71. data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/yuitest.css +7 -0
  72. data/vendor/assets/javascripts/yui-2.8.1/build/autocomplete/assets/autocomplete-core.css +7 -0
  73. data/vendor/assets/javascripts/yui-2.8.1/build/autocomplete/assets/skins/sam/autocomplete-skin.css +57 -0
  74. data/vendor/assets/javascripts/yui-2.8.1/build/autocomplete/assets/skins/sam/autocomplete.css +7 -0
  75. data/vendor/assets/javascripts/yui-2.8.1/build/autocomplete/autocomplete-debug.js +3009 -0
  76. data/vendor/assets/javascripts/yui-2.8.1/build/autocomplete/autocomplete-min.js +12 -0
  77. data/vendor/assets/javascripts/yui-2.8.1/build/autocomplete/autocomplete.js +2966 -0
  78. data/vendor/assets/javascripts/yui-2.8.1/build/base/base-min.css +7 -0
  79. data/vendor/assets/javascripts/yui-2.8.1/build/base/base.css +131 -0
  80. data/vendor/assets/javascripts/yui-2.8.1/build/button/assets/button-core.css +44 -0
  81. data/vendor/assets/javascripts/yui-2.8.1/build/button/assets/skins/sam/button-skin.css +219 -0
  82. data/vendor/assets/javascripts/yui-2.8.1/build/button/assets/skins/sam/button.css +7 -0
  83. data/vendor/assets/javascripts/yui-2.8.1/build/button/assets/skins/sam/menu-button-arrow-disabled.png +0 -0
  84. data/vendor/assets/javascripts/yui-2.8.1/build/button/assets/skins/sam/menu-button-arrow.png +0 -0
  85. data/vendor/assets/javascripts/yui-2.8.1/build/button/assets/skins/sam/split-button-arrow-active.png +0 -0
  86. data/vendor/assets/javascripts/yui-2.8.1/build/button/assets/skins/sam/split-button-arrow-disabled.png +0 -0
  87. data/vendor/assets/javascripts/yui-2.8.1/build/button/assets/skins/sam/split-button-arrow-focus.png +0 -0
  88. data/vendor/assets/javascripts/yui-2.8.1/build/button/assets/skins/sam/split-button-arrow-hover.png +0 -0
  89. data/vendor/assets/javascripts/yui-2.8.1/build/button/assets/skins/sam/split-button-arrow.png +0 -0
  90. data/vendor/assets/javascripts/yui-2.8.1/build/button/button-debug.js +4694 -0
  91. data/vendor/assets/javascripts/yui-2.8.1/build/button/button-min.js +11 -0
  92. data/vendor/assets/javascripts/yui-2.8.1/build/button/button.js +4633 -0
  93. data/vendor/assets/javascripts/yui-2.8.1/build/calendar/assets/calendar-core.css +132 -0
  94. data/vendor/assets/javascripts/yui-2.8.1/build/calendar/assets/calendar.css +320 -0
  95. data/vendor/assets/javascripts/yui-2.8.1/build/calendar/assets/calgrad.png +0 -0
  96. data/vendor/assets/javascripts/yui-2.8.1/build/calendar/assets/callt.gif +0 -0
  97. data/vendor/assets/javascripts/yui-2.8.1/build/calendar/assets/calrt.gif +0 -0
  98. data/vendor/assets/javascripts/yui-2.8.1/build/calendar/assets/calx.gif +0 -0
  99. data/vendor/assets/javascripts/yui-2.8.1/build/calendar/assets/skins/sam/calendar-skin.css +361 -0
  100. data/vendor/assets/javascripts/yui-2.8.1/build/calendar/assets/skins/sam/calendar.css +8 -0
  101. data/vendor/assets/javascripts/yui-2.8.1/build/calendar/calendar-debug.js +7324 -0
  102. data/vendor/assets/javascripts/yui-2.8.1/build/calendar/calendar-min.js +18 -0
  103. data/vendor/assets/javascripts/yui-2.8.1/build/calendar/calendar.js +7294 -0
  104. data/vendor/assets/javascripts/yui-2.8.1/build/carousel/assets/ajax-loader.gif +0 -0
  105. data/vendor/assets/javascripts/yui-2.8.1/build/carousel/assets/carousel-core.css +88 -0
  106. data/vendor/assets/javascripts/yui-2.8.1/build/carousel/assets/skins/sam/ajax-loader.gif +0 -0
  107. data/vendor/assets/javascripts/yui-2.8.1/build/carousel/assets/skins/sam/carousel-skin.css +142 -0
  108. data/vendor/assets/javascripts/yui-2.8.1/build/carousel/assets/skins/sam/carousel.css +7 -0
  109. data/vendor/assets/javascripts/yui-2.8.1/build/carousel/carousel-debug.js +4390 -0
  110. data/vendor/assets/javascripts/yui-2.8.1/build/carousel/carousel-min.js +12 -0
  111. data/vendor/assets/javascripts/yui-2.8.1/build/carousel/carousel.js +4349 -0
  112. data/vendor/assets/javascripts/yui-2.8.1/build/charts/assets/charts.swf +0 -0
  113. data/vendor/assets/javascripts/yui-2.8.1/build/charts/charts-debug.js +2061 -0
  114. data/vendor/assets/javascripts/yui-2.8.1/build/charts/charts-min.js +9 -0
  115. data/vendor/assets/javascripts/yui-2.8.1/build/charts/charts.js +2060 -0
  116. data/vendor/assets/javascripts/yui-2.8.1/build/colorpicker/assets/colorpicker-core.css +6 -0
  117. data/vendor/assets/javascripts/yui-2.8.1/build/colorpicker/assets/hue_thumb.png +0 -0
  118. data/vendor/assets/javascripts/yui-2.8.1/build/colorpicker/assets/picker_mask.png +0 -0
  119. data/vendor/assets/javascripts/yui-2.8.1/build/colorpicker/assets/picker_thumb.png +0 -0
  120. data/vendor/assets/javascripts/yui-2.8.1/build/colorpicker/assets/skins/sam/colorpicker-skin.css +105 -0
  121. data/vendor/assets/javascripts/yui-2.8.1/build/colorpicker/assets/skins/sam/colorpicker.css +7 -0
  122. data/vendor/assets/javascripts/yui-2.8.1/build/colorpicker/assets/skins/sam/hue_bg.png +0 -0
  123. data/vendor/assets/javascripts/yui-2.8.1/build/colorpicker/assets/skins/sam/picker_mask.png +0 -0
  124. data/vendor/assets/javascripts/yui-2.8.1/build/colorpicker/colorpicker-debug.js +1783 -0
  125. data/vendor/assets/javascripts/yui-2.8.1/build/colorpicker/colorpicker-min.js +9 -0
  126. data/vendor/assets/javascripts/yui-2.8.1/build/colorpicker/colorpicker.js +1763 -0
  127. data/vendor/assets/javascripts/yui-2.8.1/build/connection/connection-debug.js +1576 -0
  128. data/vendor/assets/javascripts/yui-2.8.1/build/connection/connection-min.js +9 -0
  129. data/vendor/assets/javascripts/yui-2.8.1/build/connection/connection.js +1546 -0
  130. data/vendor/assets/javascripts/yui-2.8.1/build/connection/connection.swf +0 -0
  131. data/vendor/assets/javascripts/yui-2.8.1/build/connection/connection_core-debug.js +980 -0
  132. data/vendor/assets/javascripts/yui-2.8.1/build/connection/connection_core-min.js +8 -0
  133. data/vendor/assets/javascripts/yui-2.8.1/build/connection/connection_core.js +957 -0
  134. data/vendor/assets/javascripts/yui-2.8.1/build/container/assets/alrt16_1.gif +0 -0
  135. data/vendor/assets/javascripts/yui-2.8.1/build/container/assets/blck16_1.gif +0 -0
  136. data/vendor/assets/javascripts/yui-2.8.1/build/container/assets/close12_1.gif +0 -0
  137. data/vendor/assets/javascripts/yui-2.8.1/build/container/assets/container-core.css +176 -0
  138. data/vendor/assets/javascripts/yui-2.8.1/build/container/assets/container.css +324 -0
  139. data/vendor/assets/javascripts/yui-2.8.1/build/container/assets/hlp16_1.gif +0 -0
  140. data/vendor/assets/javascripts/yui-2.8.1/build/container/assets/info16_1.gif +0 -0
  141. data/vendor/assets/javascripts/yui-2.8.1/build/container/assets/skins/sam/container-skin.css +242 -0
  142. data/vendor/assets/javascripts/yui-2.8.1/build/container/assets/skins/sam/container.css +7 -0
  143. data/vendor/assets/javascripts/yui-2.8.1/build/container/assets/tip16_1.gif +0 -0
  144. data/vendor/assets/javascripts/yui-2.8.1/build/container/assets/warn16_1.gif +0 -0
  145. data/vendor/assets/javascripts/yui-2.8.1/build/container/container-debug.js +9076 -0
  146. data/vendor/assets/javascripts/yui-2.8.1/build/container/container-min.js +19 -0
  147. data/vendor/assets/javascripts/yui-2.8.1/build/container/container.js +9052 -0
  148. data/vendor/assets/javascripts/yui-2.8.1/build/container/container_core-debug.js +5136 -0
  149. data/vendor/assets/javascripts/yui-2.8.1/build/container/container_core-min.js +14 -0
  150. data/vendor/assets/javascripts/yui-2.8.1/build/container/container_core.js +5126 -0
  151. data/vendor/assets/javascripts/yui-2.8.1/build/cookie/cookie-debug.js +482 -0
  152. data/vendor/assets/javascripts/yui-2.8.1/build/cookie/cookie-min.js +7 -0
  153. data/vendor/assets/javascripts/yui-2.8.1/build/cookie/cookie.js +482 -0
  154. data/vendor/assets/javascripts/yui-2.8.1/build/datasource/datasource-debug.js +3067 -0
  155. data/vendor/assets/javascripts/yui-2.8.1/build/datasource/datasource-min.js +12 -0
  156. data/vendor/assets/javascripts/yui-2.8.1/build/datasource/datasource.js +2996 -0
  157. data/vendor/assets/javascripts/yui-2.8.1/build/datatable/assets/datatable-core.css +93 -0
  158. data/vendor/assets/javascripts/yui-2.8.1/build/datatable/assets/datatable.css +49 -0
  159. data/vendor/assets/javascripts/yui-2.8.1/build/datatable/assets/skins/sam/datatable-skin.css +240 -0
  160. data/vendor/assets/javascripts/yui-2.8.1/build/datatable/assets/skins/sam/datatable.css +8 -0
  161. data/vendor/assets/javascripts/yui-2.8.1/build/datatable/assets/skins/sam/dt-arrow-dn.png +0 -0
  162. data/vendor/assets/javascripts/yui-2.8.1/build/datatable/assets/skins/sam/dt-arrow-up.png +0 -0
  163. data/vendor/assets/javascripts/yui-2.8.1/build/datatable/datatable-debug.js +17360 -0
  164. data/vendor/assets/javascripts/yui-2.8.1/build/datatable/datatable-min.js +29 -0
  165. data/vendor/assets/javascripts/yui-2.8.1/build/datatable/datatable.js +17122 -0
  166. data/vendor/assets/javascripts/yui-2.8.1/build/datemath/datemath-debug.js +408 -0
  167. data/vendor/assets/javascripts/yui-2.8.1/build/datemath/datemath-min.js +7 -0
  168. data/vendor/assets/javascripts/yui-2.8.1/build/datemath/datemath.js +408 -0
  169. data/vendor/assets/javascripts/yui-2.8.1/build/dom/dom-debug.js +1872 -0
  170. data/vendor/assets/javascripts/yui-2.8.1/build/dom/dom-min.js +9 -0
  171. data/vendor/assets/javascripts/yui-2.8.1/build/dom/dom.js +1832 -0
  172. data/vendor/assets/javascripts/yui-2.8.1/build/dragdrop/dragdrop-debug.js +3710 -0
  173. data/vendor/assets/javascripts/yui-2.8.1/build/dragdrop/dragdrop-min.js +10 -0
  174. data/vendor/assets/javascripts/yui-2.8.1/build/dragdrop/dragdrop.js +3601 -0
  175. data/vendor/assets/javascripts/yui-2.8.1/build/editor/assets/editor-core.css +602 -0
  176. data/vendor/assets/javascripts/yui-2.8.1/build/editor/assets/simpleeditor-core.css +602 -0
  177. data/vendor/assets/javascripts/yui-2.8.1/build/editor/assets/skins/sam/blankimage.png +0 -0
  178. data/vendor/assets/javascripts/yui-2.8.1/build/editor/assets/skins/sam/editor-knob.gif +0 -0
  179. data/vendor/assets/javascripts/yui-2.8.1/build/editor/assets/skins/sam/editor-skin.css +711 -0
  180. data/vendor/assets/javascripts/yui-2.8.1/build/editor/assets/skins/sam/editor-sprite-active.gif +0 -0
  181. data/vendor/assets/javascripts/yui-2.8.1/build/editor/assets/skins/sam/editor-sprite.gif +0 -0
  182. data/vendor/assets/javascripts/yui-2.8.1/build/editor/assets/skins/sam/editor.css +10 -0
  183. data/vendor/assets/javascripts/yui-2.8.1/build/editor/assets/skins/sam/simpleeditor-skin.css +711 -0
  184. data/vendor/assets/javascripts/yui-2.8.1/build/editor/assets/skins/sam/simpleeditor.css +10 -0
  185. data/vendor/assets/javascripts/yui-2.8.1/build/editor/editor-debug.js +9557 -0
  186. data/vendor/assets/javascripts/yui-2.8.1/build/editor/editor-min.js +30 -0
  187. data/vendor/assets/javascripts/yui-2.8.1/build/editor/editor.js +9447 -0
  188. data/vendor/assets/javascripts/yui-2.8.1/build/editor/simpleeditor-debug.js +7493 -0
  189. data/vendor/assets/javascripts/yui-2.8.1/build/editor/simpleeditor-min.js +24 -0
  190. data/vendor/assets/javascripts/yui-2.8.1/build/editor/simpleeditor.js +7406 -0
  191. data/vendor/assets/javascripts/yui-2.8.1/build/element-delegate/element-delegate-debug.js +141 -0
  192. data/vendor/assets/javascripts/yui-2.8.1/build/element-delegate/element-delegate-min.js +7 -0
  193. data/vendor/assets/javascripts/yui-2.8.1/build/element-delegate/element-delegate.js +138 -0
  194. data/vendor/assets/javascripts/yui-2.8.1/build/element/element-debug.js +1106 -0
  195. data/vendor/assets/javascripts/yui-2.8.1/build/element/element-min.js +8 -0
  196. data/vendor/assets/javascripts/yui-2.8.1/build/element/element.js +1090 -0
  197. data/vendor/assets/javascripts/yui-2.8.1/build/event-delegate/event-delegate-debug.js +283 -0
  198. data/vendor/assets/javascripts/yui-2.8.1/build/event-delegate/event-delegate-min.js +7 -0
  199. data/vendor/assets/javascripts/yui-2.8.1/build/event-delegate/event-delegate.js +281 -0
  200. data/vendor/assets/javascripts/yui-2.8.1/build/event-mouseenter/event-mouseenter-debug.js +219 -0
  201. data/vendor/assets/javascripts/yui-2.8.1/build/event-mouseenter/event-mouseenter-min.js +7 -0
  202. data/vendor/assets/javascripts/yui-2.8.1/build/event-mouseenter/event-mouseenter.js +219 -0
  203. data/vendor/assets/javascripts/yui-2.8.1/build/event-simulate/event-simulate-debug.js +622 -0
  204. data/vendor/assets/javascripts/yui-2.8.1/build/event-simulate/event-simulate-min.js +7 -0
  205. data/vendor/assets/javascripts/yui-2.8.1/build/event-simulate/event-simulate.js +622 -0
  206. data/vendor/assets/javascripts/yui-2.8.1/build/event/event-debug.js +2524 -0
  207. data/vendor/assets/javascripts/yui-2.8.1/build/event/event-min.js +11 -0
  208. data/vendor/assets/javascripts/yui-2.8.1/build/event/event.js +2500 -0
  209. data/vendor/assets/javascripts/yui-2.8.1/build/fonts/fonts-min.css +7 -0
  210. data/vendor/assets/javascripts/yui-2.8.1/build/fonts/fonts.css +56 -0
  211. data/vendor/assets/javascripts/yui-2.8.1/build/get/get-debug.js +773 -0
  212. data/vendor/assets/javascripts/yui-2.8.1/build/get/get-min.js +7 -0
  213. data/vendor/assets/javascripts/yui-2.8.1/build/get/get.js +755 -0
  214. data/vendor/assets/javascripts/yui-2.8.1/build/grids/grids-min.css +7 -0
  215. data/vendor/assets/javascripts/yui-2.8.1/build/grids/grids.css +467 -0
  216. data/vendor/assets/javascripts/yui-2.8.1/build/history/assets/blank.html +1 -0
  217. data/vendor/assets/javascripts/yui-2.8.1/build/history/history-debug.js +808 -0
  218. data/vendor/assets/javascripts/yui-2.8.1/build/history/history-min.js +7 -0
  219. data/vendor/assets/javascripts/yui-2.8.1/build/history/history.js +808 -0
  220. data/vendor/assets/javascripts/yui-2.8.1/build/imagecropper/assets/imagecropper-core.css +33 -0
  221. data/vendor/assets/javascripts/yui-2.8.1/build/imagecropper/assets/skins/sam/imagecropper-skin.css +16 -0
  222. data/vendor/assets/javascripts/yui-2.8.1/build/imagecropper/assets/skins/sam/imagecropper.css +7 -0
  223. data/vendor/assets/javascripts/yui-2.8.1/build/imagecropper/imagecropper-debug.js +907 -0
  224. data/vendor/assets/javascripts/yui-2.8.1/build/imagecropper/imagecropper-min.js +8 -0
  225. data/vendor/assets/javascripts/yui-2.8.1/build/imagecropper/imagecropper.js +889 -0
  226. data/vendor/assets/javascripts/yui-2.8.1/build/imageloader/imageloader-debug.js +487 -0
  227. data/vendor/assets/javascripts/yui-2.8.1/build/imageloader/imageloader-min.js +7 -0
  228. data/vendor/assets/javascripts/yui-2.8.1/build/imageloader/imageloader.js +481 -0
  229. data/vendor/assets/javascripts/yui-2.8.1/build/json/json-debug.js +538 -0
  230. data/vendor/assets/javascripts/yui-2.8.1/build/json/json-min.js +7 -0
  231. data/vendor/assets/javascripts/yui-2.8.1/build/json/json.js +538 -0
  232. data/vendor/assets/javascripts/yui-2.8.1/build/layout/assets/layout-core.css +158 -0
  233. data/vendor/assets/javascripts/yui-2.8.1/build/layout/assets/skins/sam/layout-skin.css +207 -0
  234. data/vendor/assets/javascripts/yui-2.8.1/build/layout/assets/skins/sam/layout.css +7 -0
  235. data/vendor/assets/javascripts/yui-2.8.1/build/layout/assets/skins/sam/layout_sprite.png +0 -0
  236. data/vendor/assets/javascripts/yui-2.8.1/build/layout/layout-debug.js +2305 -0
  237. data/vendor/assets/javascripts/yui-2.8.1/build/layout/layout-min.js +11 -0
  238. data/vendor/assets/javascripts/yui-2.8.1/build/layout/layout.js +2290 -0
  239. data/vendor/assets/javascripts/yui-2.8.1/build/logger/assets/logger-core.css +7 -0
  240. data/vendor/assets/javascripts/yui-2.8.1/build/logger/assets/logger.css +57 -0
  241. data/vendor/assets/javascripts/yui-2.8.1/build/logger/assets/skins/sam/logger-skin.css +55 -0
  242. data/vendor/assets/javascripts/yui-2.8.1/build/logger/assets/skins/sam/logger.css +7 -0
  243. data/vendor/assets/javascripts/yui-2.8.1/build/logger/logger-debug.js +2104 -0
  244. data/vendor/assets/javascripts/yui-2.8.1/build/logger/logger-min.js +9 -0
  245. data/vendor/assets/javascripts/yui-2.8.1/build/logger/logger.js +2104 -0
  246. data/vendor/assets/javascripts/yui-2.8.1/build/menu/assets/menu-core.css +242 -0
  247. data/vendor/assets/javascripts/yui-2.8.1/build/menu/assets/menu.css +503 -0
  248. data/vendor/assets/javascripts/yui-2.8.1/build/menu/assets/menu_down_arrow.png +0 -0
  249. data/vendor/assets/javascripts/yui-2.8.1/build/menu/assets/menu_down_arrow_disabled.png +0 -0
  250. data/vendor/assets/javascripts/yui-2.8.1/build/menu/assets/menu_up_arrow.png +0 -0
  251. data/vendor/assets/javascripts/yui-2.8.1/build/menu/assets/menu_up_arrow_disabled.png +0 -0
  252. data/vendor/assets/javascripts/yui-2.8.1/build/menu/assets/menubaritem_submenuindicator.png +0 -0
  253. data/vendor/assets/javascripts/yui-2.8.1/build/menu/assets/menubaritem_submenuindicator_disabled.png +0 -0
  254. data/vendor/assets/javascripts/yui-2.8.1/build/menu/assets/menubaritem_submenuindicator_selected.png +0 -0
  255. data/vendor/assets/javascripts/yui-2.8.1/build/menu/assets/menuitem_checkbox.png +0 -0
  256. data/vendor/assets/javascripts/yui-2.8.1/build/menu/assets/menuitem_checkbox_disabled.png +0 -0
  257. data/vendor/assets/javascripts/yui-2.8.1/build/menu/assets/menuitem_checkbox_selected.png +0 -0
  258. data/vendor/assets/javascripts/yui-2.8.1/build/menu/assets/menuitem_submenuindicator.png +0 -0
  259. data/vendor/assets/javascripts/yui-2.8.1/build/menu/assets/menuitem_submenuindicator_disabled.png +0 -0
  260. data/vendor/assets/javascripts/yui-2.8.1/build/menu/assets/menuitem_submenuindicator_selected.png +0 -0
  261. data/vendor/assets/javascripts/yui-2.8.1/build/menu/assets/skins/sam/menu-skin.css +339 -0
  262. data/vendor/assets/javascripts/yui-2.8.1/build/menu/assets/skins/sam/menu.css +7 -0
  263. data/vendor/assets/javascripts/yui-2.8.1/build/menu/assets/skins/sam/menubaritem_submenuindicator.png +0 -0
  264. data/vendor/assets/javascripts/yui-2.8.1/build/menu/assets/skins/sam/menubaritem_submenuindicator_disabled.png +0 -0
  265. data/vendor/assets/javascripts/yui-2.8.1/build/menu/assets/skins/sam/menuitem_checkbox.png +0 -0
  266. data/vendor/assets/javascripts/yui-2.8.1/build/menu/assets/skins/sam/menuitem_checkbox_disabled.png +0 -0
  267. data/vendor/assets/javascripts/yui-2.8.1/build/menu/assets/skins/sam/menuitem_submenuindicator.png +0 -0
  268. data/vendor/assets/javascripts/yui-2.8.1/build/menu/assets/skins/sam/menuitem_submenuindicator_disabled.png +0 -0
  269. data/vendor/assets/javascripts/yui-2.8.1/build/menu/menu-debug.js +9870 -0
  270. data/vendor/assets/javascripts/yui-2.8.1/build/menu/menu-min.js +16 -0
  271. data/vendor/assets/javascripts/yui-2.8.1/build/menu/menu.js +9823 -0
  272. data/vendor/assets/javascripts/yui-2.8.1/build/paginator/assets/paginator-core.css +6 -0
  273. data/vendor/assets/javascripts/yui-2.8.1/build/paginator/assets/skins/sam/paginator-skin.css +78 -0
  274. data/vendor/assets/javascripts/yui-2.8.1/build/paginator/assets/skins/sam/paginator.css +7 -0
  275. data/vendor/assets/javascripts/yui-2.8.1/build/paginator/paginator-debug.js +2393 -0
  276. data/vendor/assets/javascripts/yui-2.8.1/build/paginator/paginator-min.js +10 -0
  277. data/vendor/assets/javascripts/yui-2.8.1/build/paginator/paginator.js +2393 -0
  278. data/vendor/assets/javascripts/yui-2.8.1/build/profiler/profiler-debug.js +557 -0
  279. data/vendor/assets/javascripts/yui-2.8.1/build/profiler/profiler-min.js +7 -0
  280. data/vendor/assets/javascripts/yui-2.8.1/build/profiler/profiler.js +557 -0
  281. data/vendor/assets/javascripts/yui-2.8.1/build/profilerviewer/assets/profilerviewer-core.css +6 -0
  282. data/vendor/assets/javascripts/yui-2.8.1/build/profilerviewer/assets/skins/sam/asc.gif +0 -0
  283. data/vendor/assets/javascripts/yui-2.8.1/build/profilerviewer/assets/skins/sam/desc.gif +0 -0
  284. data/vendor/assets/javascripts/yui-2.8.1/build/profilerviewer/assets/skins/sam/header_background.png +0 -0
  285. data/vendor/assets/javascripts/yui-2.8.1/build/profilerviewer/assets/skins/sam/profilerviewer-skin.css +167 -0
  286. data/vendor/assets/javascripts/yui-2.8.1/build/profilerviewer/assets/skins/sam/profilerviewer.css +7 -0
  287. data/vendor/assets/javascripts/yui-2.8.1/build/profilerviewer/assets/skins/sam/wait.gif +0 -0
  288. data/vendor/assets/javascripts/yui-2.8.1/build/profilerviewer/profilerviewer-debug.js +1229 -0
  289. data/vendor/assets/javascripts/yui-2.8.1/build/profilerviewer/profilerviewer-min.js +9 -0
  290. data/vendor/assets/javascripts/yui-2.8.1/build/profilerviewer/profilerviewer.js +1192 -0
  291. data/vendor/assets/javascripts/yui-2.8.1/build/progressbar/assets/progressbar-core.css +85 -0
  292. data/vendor/assets/javascripts/yui-2.8.1/build/progressbar/assets/skins/sam/back-h.png +0 -0
  293. data/vendor/assets/javascripts/yui-2.8.1/build/progressbar/assets/skins/sam/back-v.png +0 -0
  294. data/vendor/assets/javascripts/yui-2.8.1/build/progressbar/assets/skins/sam/bar-h.png +0 -0
  295. data/vendor/assets/javascripts/yui-2.8.1/build/progressbar/assets/skins/sam/bar-v.png +0 -0
  296. data/vendor/assets/javascripts/yui-2.8.1/build/progressbar/assets/skins/sam/progressbar-skin.css +56 -0
  297. data/vendor/assets/javascripts/yui-2.8.1/build/progressbar/assets/skins/sam/progressbar.css +7 -0
  298. data/vendor/assets/javascripts/yui-2.8.1/build/progressbar/progressbar-debug.js +691 -0
  299. data/vendor/assets/javascripts/yui-2.8.1/build/progressbar/progressbar-min.js +8 -0
  300. data/vendor/assets/javascripts/yui-2.8.1/build/progressbar/progressbar.js +677 -0
  301. data/vendor/assets/javascripts/yui-2.8.1/build/reset-fonts-grids/reset-fonts-grids.css +7 -0
  302. data/vendor/assets/javascripts/yui-2.8.1/build/reset-fonts/reset-fonts.css +7 -0
  303. data/vendor/assets/javascripts/yui-2.8.1/build/reset/reset-min.css +7 -0
  304. data/vendor/assets/javascripts/yui-2.8.1/build/reset/reset.css +142 -0
  305. data/vendor/assets/javascripts/yui-2.8.1/build/resize/assets/resize-core.css +173 -0
  306. data/vendor/assets/javascripts/yui-2.8.1/build/resize/assets/skins/sam/layout_sprite.png +0 -0
  307. data/vendor/assets/javascripts/yui-2.8.1/build/resize/assets/skins/sam/resize-skin.css +142 -0
  308. data/vendor/assets/javascripts/yui-2.8.1/build/resize/assets/skins/sam/resize.css +7 -0
  309. data/vendor/assets/javascripts/yui-2.8.1/build/resize/resize-debug.js +1749 -0
  310. data/vendor/assets/javascripts/yui-2.8.1/build/resize/resize-min.js +10 -0
  311. data/vendor/assets/javascripts/yui-2.8.1/build/resize/resize.js +1689 -0
  312. data/vendor/assets/javascripts/yui-2.8.1/build/selector/selector-debug.js +651 -0
  313. data/vendor/assets/javascripts/yui-2.8.1/build/selector/selector-min.js +8 -0
  314. data/vendor/assets/javascripts/yui-2.8.1/build/selector/selector.js +644 -0
  315. data/vendor/assets/javascripts/yui-2.8.1/build/slider/assets/bg-fader.gif +0 -0
  316. data/vendor/assets/javascripts/yui-2.8.1/build/slider/assets/bg-h.gif +0 -0
  317. data/vendor/assets/javascripts/yui-2.8.1/build/slider/assets/bg-v-e.gif +0 -0
  318. data/vendor/assets/javascripts/yui-2.8.1/build/slider/assets/bg-v.gif +0 -0
  319. data/vendor/assets/javascripts/yui-2.8.1/build/slider/assets/left-thumb.png +0 -0
  320. data/vendor/assets/javascripts/yui-2.8.1/build/slider/assets/right-thumb.png +0 -0
  321. data/vendor/assets/javascripts/yui-2.8.1/build/slider/assets/skins/sam/bg-h.gif +0 -0
  322. data/vendor/assets/javascripts/yui-2.8.1/build/slider/assets/skins/sam/bg-v.gif +0 -0
  323. data/vendor/assets/javascripts/yui-2.8.1/build/slider/assets/skins/sam/slider-skin.css +24 -0
  324. data/vendor/assets/javascripts/yui-2.8.1/build/slider/assets/skins/sam/slider.css +7 -0
  325. data/vendor/assets/javascripts/yui-2.8.1/build/slider/assets/slider-core.css +17 -0
  326. data/vendor/assets/javascripts/yui-2.8.1/build/slider/assets/slider-skin.css +20 -0
  327. data/vendor/assets/javascripts/yui-2.8.1/build/slider/assets/thumb-bar.gif +0 -0
  328. data/vendor/assets/javascripts/yui-2.8.1/build/slider/assets/thumb-e.gif +0 -0
  329. data/vendor/assets/javascripts/yui-2.8.1/build/slider/assets/thumb-fader.gif +0 -0
  330. data/vendor/assets/javascripts/yui-2.8.1/build/slider/assets/thumb-n.gif +0 -0
  331. data/vendor/assets/javascripts/yui-2.8.1/build/slider/assets/thumb-s.gif +0 -0
  332. data/vendor/assets/javascripts/yui-2.8.1/build/slider/assets/thumb-w.gif +0 -0
  333. data/vendor/assets/javascripts/yui-2.8.1/build/slider/slider-debug.js +2114 -0
  334. data/vendor/assets/javascripts/yui-2.8.1/build/slider/slider-min.js +9 -0
  335. data/vendor/assets/javascripts/yui-2.8.1/build/slider/slider.js +2068 -0
  336. data/vendor/assets/javascripts/yui-2.8.1/build/storage/storage-debug.js +1185 -0
  337. data/vendor/assets/javascripts/yui-2.8.1/build/storage/storage-min.js +8 -0
  338. data/vendor/assets/javascripts/yui-2.8.1/build/storage/storage.js +1183 -0
  339. data/vendor/assets/javascripts/yui-2.8.1/build/stylesheet/stylesheet-debug.js +648 -0
  340. data/vendor/assets/javascripts/yui-2.8.1/build/stylesheet/stylesheet-min.js +7 -0
  341. data/vendor/assets/javascripts/yui-2.8.1/build/stylesheet/stylesheet.js +645 -0
  342. data/vendor/assets/javascripts/yui-2.8.1/build/swf/swf-debug.js +269 -0
  343. data/vendor/assets/javascripts/yui-2.8.1/build/swf/swf-min.js +7 -0
  344. data/vendor/assets/javascripts/yui-2.8.1/build/swf/swf.js +268 -0
  345. data/vendor/assets/javascripts/yui-2.8.1/build/swfdetect/swfdetect-debug.js +93 -0
  346. data/vendor/assets/javascripts/yui-2.8.1/build/swfdetect/swfdetect-min.js +7 -0
  347. data/vendor/assets/javascripts/yui-2.8.1/build/swfdetect/swfdetect.js +93 -0
  348. data/vendor/assets/javascripts/yui-2.8.1/build/swfstore/swf.js +238 -0
  349. data/vendor/assets/javascripts/yui-2.8.1/build/swfstore/swfstore-debug.js +470 -0
  350. data/vendor/assets/javascripts/yui-2.8.1/build/swfstore/swfstore-min.js +7 -0
  351. data/vendor/assets/javascripts/yui-2.8.1/build/swfstore/swfstore.js +453 -0
  352. data/vendor/assets/javascripts/yui-2.8.1/build/swfstore/swfstore.swf +0 -0
  353. data/vendor/assets/javascripts/yui-2.8.1/build/tabview/assets/border_tabs.css +54 -0
  354. data/vendor/assets/javascripts/yui-2.8.1/build/tabview/assets/loading.gif +0 -0
  355. data/vendor/assets/javascripts/yui-2.8.1/build/tabview/assets/skin-sam.css +77 -0
  356. data/vendor/assets/javascripts/yui-2.8.1/build/tabview/assets/skins/sam/tabview-skin.css +186 -0
  357. data/vendor/assets/javascripts/yui-2.8.1/build/tabview/assets/skins/sam/tabview.css +8 -0
  358. data/vendor/assets/javascripts/yui-2.8.1/build/tabview/assets/tabview-core.css +133 -0
  359. data/vendor/assets/javascripts/yui-2.8.1/build/tabview/assets/tabview.css +77 -0
  360. data/vendor/assets/javascripts/yui-2.8.1/build/tabview/tabview-debug.js +995 -0
  361. data/vendor/assets/javascripts/yui-2.8.1/build/tabview/tabview-min.js +8 -0
  362. data/vendor/assets/javascripts/yui-2.8.1/build/tabview/tabview.js +987 -0
  363. data/vendor/assets/javascripts/yui-2.8.1/build/treeview/assets/skins/sam/check0.gif +0 -0
  364. data/vendor/assets/javascripts/yui-2.8.1/build/treeview/assets/skins/sam/check1.gif +0 -0
  365. data/vendor/assets/javascripts/yui-2.8.1/build/treeview/assets/skins/sam/check2.gif +0 -0
  366. data/vendor/assets/javascripts/yui-2.8.1/build/treeview/assets/skins/sam/loading.gif +0 -0
  367. data/vendor/assets/javascripts/yui-2.8.1/build/treeview/assets/skins/sam/treeview-loading.gif +0 -0
  368. data/vendor/assets/javascripts/yui-2.8.1/build/treeview/assets/skins/sam/treeview-skin.css +249 -0
  369. data/vendor/assets/javascripts/yui-2.8.1/build/treeview/assets/skins/sam/treeview-sprite.gif +0 -0
  370. data/vendor/assets/javascripts/yui-2.8.1/build/treeview/assets/skins/sam/treeview.css +7 -0
  371. data/vendor/assets/javascripts/yui-2.8.1/build/treeview/assets/treeview-core.css +6 -0
  372. data/vendor/assets/javascripts/yui-2.8.1/build/treeview/treeview-debug.js +4058 -0
  373. data/vendor/assets/javascripts/yui-2.8.1/build/treeview/treeview-min.js +12 -0
  374. data/vendor/assets/javascripts/yui-2.8.1/build/treeview/treeview.js +3989 -0
  375. data/vendor/assets/javascripts/yui-2.8.1/build/uploader/assets/uploader.swf +0 -0
  376. data/vendor/assets/javascripts/yui-2.8.1/build/uploader/uploader-debug.js +1072 -0
  377. data/vendor/assets/javascripts/yui-2.8.1/build/uploader/uploader-min.js +15 -0
  378. data/vendor/assets/javascripts/yui-2.8.1/build/uploader/uploader.js +1069 -0
  379. data/vendor/assets/javascripts/yui-2.8.1/build/utilities/utilities.js +39 -0
  380. data/vendor/assets/javascripts/yui-2.8.1/build/yahoo-dom-event/yahoo-dom-event.js +14 -0
  381. data/vendor/assets/javascripts/yui-2.8.1/build/yahoo/yahoo-debug.js +1075 -0
  382. data/vendor/assets/javascripts/yui-2.8.1/build/yahoo/yahoo-min.js +7 -0
  383. data/vendor/assets/javascripts/yui-2.8.1/build/yahoo/yahoo.js +1075 -0
  384. data/vendor/assets/javascripts/yui-2.8.1/build/yuiloader-dom-event/yuiloader-dom-event.js +17 -0
  385. data/vendor/assets/javascripts/yui-2.8.1/build/yuiloader/yuiloader-debug.js +3879 -0
  386. data/vendor/assets/javascripts/yui-2.8.1/build/yuiloader/yuiloader-min.js +10 -0
  387. data/vendor/assets/javascripts/yui-2.8.1/build/yuiloader/yuiloader.js +3879 -0
  388. data/vendor/assets/javascripts/yui-2.8.1/build/yuitest/assets/skins/sam/yuitest-skin.css +7 -0
  389. data/vendor/assets/javascripts/yui-2.8.1/build/yuitest/assets/skins/sam/yuitest.css +7 -0
  390. data/vendor/assets/javascripts/yui-2.8.1/build/yuitest/assets/testlogger.css +7 -0
  391. data/vendor/assets/javascripts/yui-2.8.1/build/yuitest/assets/yuitest-core.css +7 -0
  392. data/vendor/assets/javascripts/yui-2.8.1/build/yuitest/yuitest-debug.js +2741 -0
  393. data/vendor/assets/javascripts/yui-2.8.1/build/yuitest/yuitest-min.js +10 -0
  394. data/vendor/assets/javascripts/yui-2.8.1/build/yuitest/yuitest.js +2741 -0
  395. data/vendor/assets/javascripts/yui-2.8.1/build/yuitest/yuitest_core-debug.js +1976 -0
  396. data/vendor/assets/javascripts/yui-2.8.1/build/yuitest/yuitest_core-min.js +9 -0
  397. data/vendor/assets/javascripts/yui-2.8.1/build/yuitest/yuitest_core.js +1976 -0
  398. metadata +470 -0
@@ -0,0 +1,11 @@
1
+ /*
2
+ Copyright (c) 2010, Yahoo! Inc. All rights reserved.
3
+ Code licensed under the BSD License:
4
+ http://developer.yahoo.com/yui/license.html
5
+ version: 2.8.1
6
+ */
7
+ YAHOO.util.CustomEvent=function(D,C,B,A,E){this.type=D;this.scope=C||window;this.silent=B;this.fireOnce=E;this.fired=false;this.firedWith=null;this.signature=A||YAHOO.util.CustomEvent.LIST;this.subscribers=[];if(!this.silent){}var F="_YUICEOnSubscribe";if(D!==F){this.subscribeEvent=new YAHOO.util.CustomEvent(F,this,true);}this.lastError=null;};YAHOO.util.CustomEvent.LIST=0;YAHOO.util.CustomEvent.FLAT=1;YAHOO.util.CustomEvent.prototype={subscribe:function(B,C,D){if(!B){throw new Error("Invalid callback for subscriber to '"+this.type+"'");}if(this.subscribeEvent){this.subscribeEvent.fire(B,C,D);}var A=new YAHOO.util.Subscriber(B,C,D);if(this.fireOnce&&this.fired){this.notify(A,this.firedWith);}else{this.subscribers.push(A);}},unsubscribe:function(D,F){if(!D){return this.unsubscribeAll();}var E=false;for(var B=0,A=this.subscribers.length;B<A;++B){var C=this.subscribers[B];if(C&&C.contains(D,F)){this._delete(B);E=true;}}return E;},fire:function(){this.lastError=null;var H=[],A=this.subscribers.length;var D=[].slice.call(arguments,0),C=true,F,B=false;if(this.fireOnce){if(this.fired){return true;}else{this.firedWith=D;}}this.fired=true;if(!A&&this.silent){return true;}if(!this.silent){}var E=this.subscribers.slice();for(F=0;F<A;++F){var G=E[F];if(!G){B=true;}else{C=this.notify(G,D);if(false===C){if(!this.silent){}break;}}}return(C!==false);},notify:function(F,C){var B,H=null,E=F.getScope(this.scope),A=YAHOO.util.Event.throwErrors;if(!this.silent){}if(this.signature==YAHOO.util.CustomEvent.FLAT){if(C.length>0){H=C[0];}try{B=F.fn.call(E,H,F.obj);}catch(G){this.lastError=G;if(A){throw G;}}}else{try{B=F.fn.call(E,this.type,C,F.obj);}catch(D){this.lastError=D;if(A){throw D;}}}return B;},unsubscribeAll:function(){var A=this.subscribers.length,B;for(B=A-1;B>-1;B--){this._delete(B);}this.subscribers=[];return A;},_delete:function(A){var B=this.subscribers[A];if(B){delete B.fn;delete B.obj;}this.subscribers.splice(A,1);},toString:function(){return"CustomEvent: "+"'"+this.type+"', "+"context: "+this.scope;}};YAHOO.util.Subscriber=function(A,B,C){this.fn=A;this.obj=YAHOO.lang.isUndefined(B)?null:B;this.overrideContext=C;};YAHOO.util.Subscriber.prototype.getScope=function(A){if(this.overrideContext){if(this.overrideContext===true){return this.obj;}else{return this.overrideContext;}}return A;};YAHOO.util.Subscriber.prototype.contains=function(A,B){if(B){return(this.fn==A&&this.obj==B);}else{return(this.fn==A);}};YAHOO.util.Subscriber.prototype.toString=function(){return"Subscriber { obj: "+this.obj+", overrideContext: "+(this.overrideContext||"no")+" }";};if(!YAHOO.util.Event){YAHOO.util.Event=function(){var G=false,H=[],J=[],A=0,E=[],B=0,C={63232:38,63233:40,63234:37,63235:39,63276:33,63277:34,25:9},D=YAHOO.env.ua.ie,F="focusin",I="focusout";return{POLL_RETRYS:500,POLL_INTERVAL:40,EL:0,TYPE:1,FN:2,WFN:3,UNLOAD_OBJ:3,ADJ_SCOPE:4,OBJ:5,OVERRIDE:6,CAPTURE:7,lastError:null,isSafari:YAHOO.env.ua.webkit,webkit:YAHOO.env.ua.webkit,isIE:D,_interval:null,_dri:null,_specialTypes:{focusin:(D?"focusin":"focus"),focusout:(D?"focusout":"blur")},DOMReady:false,throwErrors:false,startInterval:function(){if(!this._interval){this._interval=YAHOO.lang.later(this.POLL_INTERVAL,this,this._tryPreloadAttach,null,true);}},onAvailable:function(Q,M,O,P,N){var K=(YAHOO.lang.isString(Q))?[Q]:Q;for(var L=0;L<K.length;L=L+1){E.push({id:K[L],fn:M,obj:O,overrideContext:P,checkReady:N});}A=this.POLL_RETRYS;this.startInterval();},onContentReady:function(N,K,L,M){this.onAvailable(N,K,L,M,true);},onDOMReady:function(){this.DOMReadyEvent.subscribe.apply(this.DOMReadyEvent,arguments);},_addListener:function(M,K,V,P,T,Y){if(!V||!V.call){return false;}if(this._isValidCollection(M)){var W=true;for(var Q=0,S=M.length;Q<S;++Q){W=this.on(M[Q],K,V,P,T)&&W;}return W;}else{if(YAHOO.lang.isString(M)){var O=this.getEl(M);if(O){M=O;}else{this.onAvailable(M,function(){YAHOO.util.Event._addListener(M,K,V,P,T,Y);});return true;}}}if(!M){return false;}if("unload"==K&&P!==this){J[J.length]=[M,K,V,P,T];return true;}var L=M;if(T){if(T===true){L=P;}else{L=T;}}var N=function(Z){return V.call(L,YAHOO.util.Event.getEvent(Z,M),P);};var X=[M,K,V,N,L,P,T,Y];var R=H.length;H[R]=X;try{this._simpleAdd(M,K,N,Y);}catch(U){this.lastError=U;this.removeListener(M,K,V);return false;}return true;},_getType:function(K){return this._specialTypes[K]||K;},addListener:function(M,P,L,N,O){var K=((P==F||P==I)&&!YAHOO.env.ua.ie)?true:false;return this._addListener(M,this._getType(P),L,N,O,K);},addFocusListener:function(L,K,M,N){return this.on(L,F,K,M,N);},removeFocusListener:function(L,K){return this.removeListener(L,F,K);},addBlurListener:function(L,K,M,N){return this.on(L,I,K,M,N);},removeBlurListener:function(L,K){return this.removeListener(L,I,K);},removeListener:function(L,K,R){var M,P,U;K=this._getType(K);if(typeof L=="string"){L=this.getEl(L);}else{if(this._isValidCollection(L)){var S=true;for(M=L.length-1;M>-1;M--){S=(this.removeListener(L[M],K,R)&&S);}return S;}}if(!R||!R.call){return this.purgeElement(L,false,K);}if("unload"==K){for(M=J.length-1;M>-1;M--){U=J[M];if(U&&U[0]==L&&U[1]==K&&U[2]==R){J.splice(M,1);return true;}}return false;}var N=null;var O=arguments[3];if("undefined"===typeof O){O=this._getCacheIndex(H,L,K,R);}if(O>=0){N=H[O];}if(!L||!N){return false;}var T=N[this.CAPTURE]===true?true:false;try{this._simpleRemove(L,K,N[this.WFN],T);}catch(Q){this.lastError=Q;return false;}delete H[O][this.WFN];delete H[O][this.FN];H.splice(O,1);return true;},getTarget:function(M,L){var K=M.target||M.srcElement;return this.resolveTextNode(K);},resolveTextNode:function(L){try{if(L&&3==L.nodeType){return L.parentNode;}}catch(K){}return L;},getPageX:function(L){var K=L.pageX;if(!K&&0!==K){K=L.clientX||0;if(this.isIE){K+=this._getScrollLeft();}}return K;},getPageY:function(K){var L=K.pageY;if(!L&&0!==L){L=K.clientY||0;if(this.isIE){L+=this._getScrollTop();}}return L;},getXY:function(K){return[this.getPageX(K),this.getPageY(K)];},getRelatedTarget:function(L){var K=L.relatedTarget;if(!K){if(L.type=="mouseout"){K=L.toElement;
8
+ }else{if(L.type=="mouseover"){K=L.fromElement;}}}return this.resolveTextNode(K);},getTime:function(M){if(!M.time){var L=new Date().getTime();try{M.time=L;}catch(K){this.lastError=K;return L;}}return M.time;},stopEvent:function(K){this.stopPropagation(K);this.preventDefault(K);},stopPropagation:function(K){if(K.stopPropagation){K.stopPropagation();}else{K.cancelBubble=true;}},preventDefault:function(K){if(K.preventDefault){K.preventDefault();}else{K.returnValue=false;}},getEvent:function(M,K){var L=M||window.event;if(!L){var N=this.getEvent.caller;while(N){L=N.arguments[0];if(L&&Event==L.constructor){break;}N=N.caller;}}return L;},getCharCode:function(L){var K=L.keyCode||L.charCode||0;if(YAHOO.env.ua.webkit&&(K in C)){K=C[K];}return K;},_getCacheIndex:function(M,P,Q,O){for(var N=0,L=M.length;N<L;N=N+1){var K=M[N];if(K&&K[this.FN]==O&&K[this.EL]==P&&K[this.TYPE]==Q){return N;}}return -1;},generateId:function(K){var L=K.id;if(!L){L="yuievtautoid-"+B;++B;K.id=L;}return L;},_isValidCollection:function(L){try{return(L&&typeof L!=="string"&&L.length&&!L.tagName&&!L.alert&&typeof L[0]!=="undefined");}catch(K){return false;}},elCache:{},getEl:function(K){return(typeof K==="string")?document.getElementById(K):K;},clearCache:function(){},DOMReadyEvent:new YAHOO.util.CustomEvent("DOMReady",YAHOO,0,0,1),_load:function(L){if(!G){G=true;var K=YAHOO.util.Event;K._ready();K._tryPreloadAttach();}},_ready:function(L){var K=YAHOO.util.Event;if(!K.DOMReady){K.DOMReady=true;K.DOMReadyEvent.fire();K._simpleRemove(document,"DOMContentLoaded",K._ready);}},_tryPreloadAttach:function(){if(E.length===0){A=0;if(this._interval){this._interval.cancel();this._interval=null;}return;}if(this.locked){return;}if(this.isIE){if(!this.DOMReady){this.startInterval();return;}}this.locked=true;var Q=!G;if(!Q){Q=(A>0&&E.length>0);}var P=[];var R=function(T,U){var S=T;if(U.overrideContext){if(U.overrideContext===true){S=U.obj;}else{S=U.overrideContext;}}U.fn.call(S,U.obj);};var L,K,O,N,M=[];for(L=0,K=E.length;L<K;L=L+1){O=E[L];if(O){N=this.getEl(O.id);if(N){if(O.checkReady){if(G||N.nextSibling||!Q){M.push(O);E[L]=null;}}else{R(N,O);E[L]=null;}}else{P.push(O);}}}for(L=0,K=M.length;L<K;L=L+1){O=M[L];R(this.getEl(O.id),O);}A--;if(Q){for(L=E.length-1;L>-1;L--){O=E[L];if(!O||!O.id){E.splice(L,1);}}this.startInterval();}else{if(this._interval){this._interval.cancel();this._interval=null;}}this.locked=false;},purgeElement:function(O,P,R){var M=(YAHOO.lang.isString(O))?this.getEl(O):O;var Q=this.getListeners(M,R),N,K;if(Q){for(N=Q.length-1;N>-1;N--){var L=Q[N];this.removeListener(M,L.type,L.fn);}}if(P&&M&&M.childNodes){for(N=0,K=M.childNodes.length;N<K;++N){this.purgeElement(M.childNodes[N],P,R);}}},getListeners:function(M,K){var P=[],L;if(!K){L=[H,J];}else{if(K==="unload"){L=[J];}else{K=this._getType(K);L=[H];}}var R=(YAHOO.lang.isString(M))?this.getEl(M):M;for(var O=0;O<L.length;O=O+1){var T=L[O];if(T){for(var Q=0,S=T.length;Q<S;++Q){var N=T[Q];if(N&&N[this.EL]===R&&(!K||K===N[this.TYPE])){P.push({type:N[this.TYPE],fn:N[this.FN],obj:N[this.OBJ],adjust:N[this.OVERRIDE],scope:N[this.ADJ_SCOPE],index:Q});}}}}return(P.length)?P:null;},_unload:function(R){var L=YAHOO.util.Event,O,N,M,Q,P,S=J.slice(),K;for(O=0,Q=J.length;O<Q;++O){M=S[O];if(M){K=window;if(M[L.ADJ_SCOPE]){if(M[L.ADJ_SCOPE]===true){K=M[L.UNLOAD_OBJ];}else{K=M[L.ADJ_SCOPE];}}M[L.FN].call(K,L.getEvent(R,M[L.EL]),M[L.UNLOAD_OBJ]);S[O]=null;}}M=null;K=null;J=null;if(H){for(N=H.length-1;N>-1;N--){M=H[N];if(M){L.removeListener(M[L.EL],M[L.TYPE],M[L.FN],N);}}M=null;}L._simpleRemove(window,"unload",L._unload);},_getScrollLeft:function(){return this._getScroll()[1];},_getScrollTop:function(){return this._getScroll()[0];},_getScroll:function(){var K=document.documentElement,L=document.body;if(K&&(K.scrollTop||K.scrollLeft)){return[K.scrollTop,K.scrollLeft];}else{if(L){return[L.scrollTop,L.scrollLeft];}else{return[0,0];}}},regCE:function(){},_simpleAdd:function(){if(window.addEventListener){return function(M,N,L,K){M.addEventListener(N,L,(K));};}else{if(window.attachEvent){return function(M,N,L,K){M.attachEvent("on"+N,L);};}else{return function(){};}}}(),_simpleRemove:function(){if(window.removeEventListener){return function(M,N,L,K){M.removeEventListener(N,L,(K));};}else{if(window.detachEvent){return function(L,M,K){L.detachEvent("on"+M,K);};}else{return function(){};}}}()};}();(function(){var EU=YAHOO.util.Event;EU.on=EU.addListener;EU.onFocus=EU.addFocusListener;EU.onBlur=EU.addBlurListener;
9
+ /* DOMReady: based on work by: Dean Edwards/John Resig/Matthias Miller/Diego Perini */
10
+ if(EU.isIE){if(self!==self.top){document.onreadystatechange=function(){if(document.readyState=="complete"){document.onreadystatechange=null;EU._ready();}};}else{YAHOO.util.Event.onDOMReady(YAHOO.util.Event._tryPreloadAttach,YAHOO.util.Event,true);var n=document.createElement("p");EU._dri=setInterval(function(){try{n.doScroll("left");clearInterval(EU._dri);EU._dri=null;EU._ready();n=null;}catch(ex){}},EU.POLL_INTERVAL);}}else{if(EU.webkit&&EU.webkit<525){EU._dri=setInterval(function(){var rs=document.readyState;if("loaded"==rs||"complete"==rs){clearInterval(EU._dri);EU._dri=null;EU._ready();}},EU.POLL_INTERVAL);}else{EU._simpleAdd(document,"DOMContentLoaded",EU._ready);}}EU._simpleAdd(window,"load",EU._load);EU._simpleAdd(window,"unload",EU._unload);EU._tryPreloadAttach();})();}YAHOO.util.EventProvider=function(){};YAHOO.util.EventProvider.prototype={__yui_events:null,__yui_subscribers:null,subscribe:function(A,C,F,E){this.__yui_events=this.__yui_events||{};var D=this.__yui_events[A];if(D){D.subscribe(C,F,E);}else{this.__yui_subscribers=this.__yui_subscribers||{};var B=this.__yui_subscribers;if(!B[A]){B[A]=[];}B[A].push({fn:C,obj:F,overrideContext:E});}},unsubscribe:function(C,E,G){this.__yui_events=this.__yui_events||{};var A=this.__yui_events;if(C){var F=A[C];if(F){return F.unsubscribe(E,G);}}else{var B=true;for(var D in A){if(YAHOO.lang.hasOwnProperty(A,D)){B=B&&A[D].unsubscribe(E,G);}}return B;}return false;},unsubscribeAll:function(A){return this.unsubscribe(A);
11
+ },createEvent:function(B,G){this.__yui_events=this.__yui_events||{};var E=G||{},D=this.__yui_events,F;if(D[B]){}else{F=new YAHOO.util.CustomEvent(B,E.scope||this,E.silent,YAHOO.util.CustomEvent.FLAT,E.fireOnce);D[B]=F;if(E.onSubscribeCallback){F.subscribeEvent.subscribe(E.onSubscribeCallback);}this.__yui_subscribers=this.__yui_subscribers||{};var A=this.__yui_subscribers[B];if(A){for(var C=0;C<A.length;++C){F.subscribe(A[C].fn,A[C].obj,A[C].overrideContext);}}}return D[B];},fireEvent:function(B){this.__yui_events=this.__yui_events||{};var D=this.__yui_events[B];if(!D){return null;}var A=[];for(var C=1;C<arguments.length;++C){A.push(arguments[C]);}return D.fire.apply(D,A);},hasEvent:function(A){if(this.__yui_events){if(this.__yui_events[A]){return true;}}return false;}};(function(){var A=YAHOO.util.Event,C=YAHOO.lang;YAHOO.util.KeyListener=function(D,I,E,F){if(!D){}else{if(!I){}else{if(!E){}}}if(!F){F=YAHOO.util.KeyListener.KEYDOWN;}var G=new YAHOO.util.CustomEvent("keyPressed");this.enabledEvent=new YAHOO.util.CustomEvent("enabled");this.disabledEvent=new YAHOO.util.CustomEvent("disabled");if(C.isString(D)){D=document.getElementById(D);}if(C.isFunction(E)){G.subscribe(E);}else{G.subscribe(E.fn,E.scope,E.correctScope);}function H(O,N){if(!I.shift){I.shift=false;}if(!I.alt){I.alt=false;}if(!I.ctrl){I.ctrl=false;}if(O.shiftKey==I.shift&&O.altKey==I.alt&&O.ctrlKey==I.ctrl){var J,M=I.keys,L;if(YAHOO.lang.isArray(M)){for(var K=0;K<M.length;K++){J=M[K];L=A.getCharCode(O);if(J==L){G.fire(L,O);break;}}}else{L=A.getCharCode(O);if(M==L){G.fire(L,O);}}}}this.enable=function(){if(!this.enabled){A.on(D,F,H);this.enabledEvent.fire(I);}this.enabled=true;};this.disable=function(){if(this.enabled){A.removeListener(D,F,H);this.disabledEvent.fire(I);}this.enabled=false;};this.toString=function(){return"KeyListener ["+I.keys+"] "+D.tagName+(D.id?"["+D.id+"]":"");};};var B=YAHOO.util.KeyListener;B.KEYDOWN="keydown";B.KEYUP="keyup";B.KEY={ALT:18,BACK_SPACE:8,CAPS_LOCK:20,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,META:224,NUM_LOCK:144,PAGE_DOWN:34,PAGE_UP:33,PAUSE:19,PRINTSCREEN:44,RIGHT:39,SCROLL_LOCK:145,SHIFT:16,SPACE:32,TAB:9,UP:38};})();YAHOO.register("event",YAHOO.util.Event,{version:"2.8.1",build:"19"});
@@ -0,0 +1,2500 @@
1
+ /*
2
+ Copyright (c) 2010, Yahoo! Inc. All rights reserved.
3
+ Code licensed under the BSD License:
4
+ http://developer.yahoo.com/yui/license.html
5
+ version: 2.8.1
6
+ */
7
+
8
+ /**
9
+ * The CustomEvent class lets you define events for your application
10
+ * that can be subscribed to by one or more independent component.
11
+ *
12
+ * @param {String} type The type of event, which is passed to the callback
13
+ * when the event fires
14
+ * @param {Object} context The context the event will fire from. "this" will
15
+ * refer to this object in the callback. Default value:
16
+ * the window object. The listener can override this.
17
+ * @param {boolean} silent pass true to prevent the event from writing to
18
+ * the debugsystem
19
+ * @param {int} signature the signature that the custom event subscriber
20
+ * will receive. YAHOO.util.CustomEvent.LIST or
21
+ * YAHOO.util.CustomEvent.FLAT. The default is
22
+ * YAHOO.util.CustomEvent.LIST.
23
+ * @param fireOnce {boolean} If configured to fire once, the custom event
24
+ * will only notify subscribers a single time regardless of how many times
25
+ * the event is fired. In addition, new subscribers will be notified
26
+ * immediately if the event has already been fired.
27
+ * @namespace YAHOO.util
28
+ * @class CustomEvent
29
+ * @constructor
30
+ */
31
+ YAHOO.util.CustomEvent = function(type, context, silent, signature, fireOnce) {
32
+
33
+ /**
34
+ * The type of event, returned to subscribers when the event fires
35
+ * @property type
36
+ * @type string
37
+ */
38
+ this.type = type;
39
+
40
+ /**
41
+ * The context the event will fire from by default. Defaults to the window obj.
42
+ * @property scope
43
+ * @type object
44
+ */
45
+ this.scope = context || window;
46
+
47
+ /**
48
+ * By default all custom events are logged in the debug build. Set silent to true
49
+ * to disable debug output for this event.
50
+ * @property silent
51
+ * @type boolean
52
+ */
53
+ this.silent = silent;
54
+
55
+ /**
56
+ * If configured to fire once, the custom event will only notify subscribers
57
+ * a single time regardless of how many times the event is fired. In addition,
58
+ * new subscribers will be notified immediately if the event has already been
59
+ * fired.
60
+ * @property fireOnce
61
+ * @type boolean
62
+ * @default false
63
+ */
64
+ this.fireOnce = fireOnce;
65
+
66
+ /**
67
+ * Indicates whether or not this event has ever been fired.
68
+ * @property fired
69
+ * @type boolean
70
+ * @default false
71
+ */
72
+ this.fired = false;
73
+
74
+ /**
75
+ * For fireOnce events the arguments the event was fired with are stored
76
+ * so that new subscribers get the proper payload.
77
+ * @property firedWith
78
+ * @type Array
79
+ */
80
+ this.firedWith = null;
81
+
82
+ /**
83
+ * Custom events support two styles of arguments provided to the event
84
+ * subscribers.
85
+ * <ul>
86
+ * <li>YAHOO.util.CustomEvent.LIST:
87
+ * <ul>
88
+ * <li>param1: event name</li>
89
+ * <li>param2: array of arguments sent to fire</li>
90
+ * <li>param3: <optional> a custom object supplied by the subscriber</li>
91
+ * </ul>
92
+ * </li>
93
+ * <li>YAHOO.util.CustomEvent.FLAT
94
+ * <ul>
95
+ * <li>param1: the first argument passed to fire. If you need to
96
+ * pass multiple parameters, use and array or object literal</li>
97
+ * <li>param2: <optional> a custom object supplied by the subscriber</li>
98
+ * </ul>
99
+ * </li>
100
+ * </ul>
101
+ * @property signature
102
+ * @type int
103
+ */
104
+ this.signature = signature || YAHOO.util.CustomEvent.LIST;
105
+
106
+ /**
107
+ * The subscribers to this event
108
+ * @property subscribers
109
+ * @type Subscriber[]
110
+ */
111
+ this.subscribers = [];
112
+
113
+ if (!this.silent) {
114
+ }
115
+
116
+ var onsubscribeType = "_YUICEOnSubscribe";
117
+
118
+ // Only add subscribe events for events that are not generated by
119
+ // CustomEvent
120
+ if (type !== onsubscribeType) {
121
+
122
+ /**
123
+ * Custom events provide a custom event that fires whenever there is
124
+ * a new subscriber to the event. This provides an opportunity to
125
+ * handle the case where there is a non-repeating event that has
126
+ * already fired has a new subscriber.
127
+ *
128
+ * @event subscribeEvent
129
+ * @type YAHOO.util.CustomEvent
130
+ * @param fn {Function} The function to execute
131
+ * @param obj <Object> An object to be passed along when the event fires.
132
+ * Defaults to the custom event.
133
+ * @param override <boolean|Object> If true, the obj passed in becomes the
134
+ * execution context of the listener. If an object, that object becomes
135
+ * the execution context. Defaults to the custom event.
136
+ */
137
+ this.subscribeEvent =
138
+ new YAHOO.util.CustomEvent(onsubscribeType, this, true);
139
+
140
+ }
141
+
142
+
143
+ /**
144
+ * In order to make it possible to execute the rest of the subscriber
145
+ * stack when one thows an exception, the subscribers exceptions are
146
+ * caught. The most recent exception is stored in this property
147
+ * @property lastError
148
+ * @type Error
149
+ */
150
+ this.lastError = null;
151
+ };
152
+
153
+ /**
154
+ * Subscriber listener sigature constant. The LIST type returns three
155
+ * parameters: the event type, the array of args passed to fire, and
156
+ * the optional custom object
157
+ * @property YAHOO.util.CustomEvent.LIST
158
+ * @static
159
+ * @type int
160
+ */
161
+ YAHOO.util.CustomEvent.LIST = 0;
162
+
163
+ /**
164
+ * Subscriber listener sigature constant. The FLAT type returns two
165
+ * parameters: the first argument passed to fire and the optional
166
+ * custom object
167
+ * @property YAHOO.util.CustomEvent.FLAT
168
+ * @static
169
+ * @type int
170
+ */
171
+ YAHOO.util.CustomEvent.FLAT = 1;
172
+
173
+ YAHOO.util.CustomEvent.prototype = {
174
+
175
+ /**
176
+ * Subscribes the caller to this event
177
+ * @method subscribe
178
+ * @param {Function} fn The function to execute
179
+ * @param {Object} obj An object to be passed along when the event fires.
180
+ * overrideContext <boolean|Object> If true, the obj passed in becomes the execution
181
+ * context of the listener. If an object, that object becomes the execution context.
182
+ */
183
+ subscribe: function(fn, obj, overrideContext) {
184
+
185
+ if (!fn) {
186
+ throw new Error("Invalid callback for subscriber to '" + this.type + "'");
187
+ }
188
+
189
+ if (this.subscribeEvent) {
190
+ this.subscribeEvent.fire(fn, obj, overrideContext);
191
+ }
192
+
193
+ var s = new YAHOO.util.Subscriber(fn, obj, overrideContext);
194
+
195
+ if (this.fireOnce && this.fired) {
196
+ this.notify(s, this.firedWith);
197
+ } else {
198
+ this.subscribers.push(s);
199
+ }
200
+ },
201
+
202
+ /**
203
+ * Unsubscribes subscribers.
204
+ * @method unsubscribe
205
+ * @param {Function} fn The subscribed function to remove, if not supplied
206
+ * all will be removed
207
+ * @param {Object} obj The custom object passed to subscribe. This is
208
+ * optional, but if supplied will be used to
209
+ * disambiguate multiple listeners that are the same
210
+ * (e.g., you subscribe many object using a function
211
+ * that lives on the prototype)
212
+ * @return {boolean} True if the subscriber was found and detached.
213
+ */
214
+ unsubscribe: function(fn, obj) {
215
+
216
+ if (!fn) {
217
+ return this.unsubscribeAll();
218
+ }
219
+
220
+ var found = false;
221
+ for (var i=0, len=this.subscribers.length; i<len; ++i) {
222
+ var s = this.subscribers[i];
223
+ if (s && s.contains(fn, obj)) {
224
+ this._delete(i);
225
+ found = true;
226
+ }
227
+ }
228
+
229
+ return found;
230
+ },
231
+
232
+ /**
233
+ * Notifies the subscribers. The callback functions will be executed
234
+ * from the context specified when the event was created, and with the
235
+ * following parameters:
236
+ * <ul>
237
+ * <li>The type of event</li>
238
+ * <li>All of the arguments fire() was executed with as an array</li>
239
+ * <li>The custom object (if any) that was passed into the subscribe()
240
+ * method</li>
241
+ * </ul>
242
+ * @method fire
243
+ * @param {Object*} arguments an arbitrary set of parameters to pass to
244
+ * the handler.
245
+ * @return {boolean} false if one of the subscribers returned false,
246
+ * true otherwise
247
+ */
248
+ fire: function() {
249
+
250
+ this.lastError = null;
251
+
252
+ var errors = [],
253
+ len=this.subscribers.length;
254
+
255
+
256
+ var args=[].slice.call(arguments, 0), ret=true, i, rebuild=false;
257
+
258
+ if (this.fireOnce) {
259
+ if (this.fired) {
260
+ return true;
261
+ } else {
262
+ this.firedWith = args;
263
+ }
264
+ }
265
+
266
+ this.fired = true;
267
+
268
+ if (!len && this.silent) {
269
+ return true;
270
+ }
271
+
272
+ if (!this.silent) {
273
+ }
274
+
275
+ // make a copy of the subscribers so that there are
276
+ // no index problems if one subscriber removes another.
277
+ var subs = this.subscribers.slice();
278
+
279
+ for (i=0; i<len; ++i) {
280
+ var s = subs[i];
281
+ if (!s) {
282
+ rebuild=true;
283
+ } else {
284
+
285
+ ret = this.notify(s, args);
286
+
287
+ if (false === ret) {
288
+ if (!this.silent) {
289
+ }
290
+
291
+ break;
292
+ }
293
+ }
294
+ }
295
+
296
+ return (ret !== false);
297
+ },
298
+
299
+ notify: function(s, args) {
300
+
301
+ var ret, param=null, scope = s.getScope(this.scope),
302
+ throwErrors = YAHOO.util.Event.throwErrors;
303
+
304
+ if (!this.silent) {
305
+ }
306
+
307
+ if (this.signature == YAHOO.util.CustomEvent.FLAT) {
308
+
309
+ if (args.length > 0) {
310
+ param = args[0];
311
+ }
312
+
313
+ try {
314
+ ret = s.fn.call(scope, param, s.obj);
315
+ } catch(e) {
316
+ this.lastError = e;
317
+ // errors.push(e);
318
+ if (throwErrors) {
319
+ throw e;
320
+ }
321
+ }
322
+ } else {
323
+ try {
324
+ ret = s.fn.call(scope, this.type, args, s.obj);
325
+ } catch(ex) {
326
+ this.lastError = ex;
327
+ if (throwErrors) {
328
+ throw ex;
329
+ }
330
+ }
331
+ }
332
+
333
+ return ret;
334
+ },
335
+
336
+ /**
337
+ * Removes all listeners
338
+ * @method unsubscribeAll
339
+ * @return {int} The number of listeners unsubscribed
340
+ */
341
+ unsubscribeAll: function() {
342
+ var l = this.subscribers.length, i;
343
+ for (i=l-1; i>-1; i--) {
344
+ this._delete(i);
345
+ }
346
+
347
+ this.subscribers=[];
348
+
349
+ return l;
350
+ },
351
+
352
+ /**
353
+ * @method _delete
354
+ * @private
355
+ */
356
+ _delete: function(index) {
357
+ var s = this.subscribers[index];
358
+ if (s) {
359
+ delete s.fn;
360
+ delete s.obj;
361
+ }
362
+
363
+ // this.subscribers[index]=null;
364
+ this.subscribers.splice(index, 1);
365
+ },
366
+
367
+ /**
368
+ * @method toString
369
+ */
370
+ toString: function() {
371
+ return "CustomEvent: " + "'" + this.type + "', " +
372
+ "context: " + this.scope;
373
+
374
+ }
375
+ };
376
+
377
+ /////////////////////////////////////////////////////////////////////
378
+
379
+ /**
380
+ * Stores the subscriber information to be used when the event fires.
381
+ * @param {Function} fn The function to execute
382
+ * @param {Object} obj An object to be passed along when the event fires
383
+ * @param {boolean} overrideContext If true, the obj passed in becomes the execution
384
+ * context of the listener
385
+ * @class Subscriber
386
+ * @constructor
387
+ */
388
+ YAHOO.util.Subscriber = function(fn, obj, overrideContext) {
389
+
390
+ /**
391
+ * The callback that will be execute when the event fires
392
+ * @property fn
393
+ * @type function
394
+ */
395
+ this.fn = fn;
396
+
397
+ /**
398
+ * An optional custom object that will passed to the callback when
399
+ * the event fires
400
+ * @property obj
401
+ * @type object
402
+ */
403
+ this.obj = YAHOO.lang.isUndefined(obj) ? null : obj;
404
+
405
+ /**
406
+ * The default execution context for the event listener is defined when the
407
+ * event is created (usually the object which contains the event).
408
+ * By setting overrideContext to true, the execution context becomes the custom
409
+ * object passed in by the subscriber. If overrideContext is an object, that
410
+ * object becomes the context.
411
+ * @property overrideContext
412
+ * @type boolean|object
413
+ */
414
+ this.overrideContext = overrideContext;
415
+
416
+ };
417
+
418
+ /**
419
+ * Returns the execution context for this listener. If overrideContext was set to true
420
+ * the custom obj will be the context. If overrideContext is an object, that is the
421
+ * context, otherwise the default context will be used.
422
+ * @method getScope
423
+ * @param {Object} defaultScope the context to use if this listener does not
424
+ * override it.
425
+ */
426
+ YAHOO.util.Subscriber.prototype.getScope = function(defaultScope) {
427
+ if (this.overrideContext) {
428
+ if (this.overrideContext === true) {
429
+ return this.obj;
430
+ } else {
431
+ return this.overrideContext;
432
+ }
433
+ }
434
+ return defaultScope;
435
+ };
436
+
437
+ /**
438
+ * Returns true if the fn and obj match this objects properties.
439
+ * Used by the unsubscribe method to match the right subscriber.
440
+ *
441
+ * @method contains
442
+ * @param {Function} fn the function to execute
443
+ * @param {Object} obj an object to be passed along when the event fires
444
+ * @return {boolean} true if the supplied arguments match this
445
+ * subscriber's signature.
446
+ */
447
+ YAHOO.util.Subscriber.prototype.contains = function(fn, obj) {
448
+ if (obj) {
449
+ return (this.fn == fn && this.obj == obj);
450
+ } else {
451
+ return (this.fn == fn);
452
+ }
453
+ };
454
+
455
+ /**
456
+ * @method toString
457
+ */
458
+ YAHOO.util.Subscriber.prototype.toString = function() {
459
+ return "Subscriber { obj: " + this.obj +
460
+ ", overrideContext: " + (this.overrideContext || "no") + " }";
461
+ };
462
+
463
+ /**
464
+ * The Event Utility provides utilities for managing DOM Events and tools
465
+ * for building event systems
466
+ *
467
+ * @module event
468
+ * @title Event Utility
469
+ * @namespace YAHOO.util
470
+ * @requires yahoo
471
+ */
472
+
473
+ // The first instance of Event will win if it is loaded more than once.
474
+ // @TODO this needs to be changed so that only the state data that needs to
475
+ // be preserved is kept, while methods are overwritten/added as needed.
476
+ // This means that the module pattern can't be used.
477
+ if (!YAHOO.util.Event) {
478
+
479
+ /**
480
+ * The event utility provides functions to add and remove event listeners,
481
+ * event cleansing. It also tries to automatically remove listeners it
482
+ * registers during the unload event.
483
+ *
484
+ * @class Event
485
+ * @static
486
+ */
487
+ YAHOO.util.Event = function() {
488
+
489
+ /**
490
+ * True after the onload event has fired
491
+ * @property loadComplete
492
+ * @type boolean
493
+ * @static
494
+ * @private
495
+ */
496
+ var loadComplete = false,
497
+
498
+ /**
499
+ * Cache of wrapped listeners
500
+ * @property listeners
501
+ * @type array
502
+ * @static
503
+ * @private
504
+ */
505
+ listeners = [],
506
+
507
+
508
+ /**
509
+ * User-defined unload function that will be fired before all events
510
+ * are detached
511
+ * @property unloadListeners
512
+ * @type array
513
+ * @static
514
+ * @private
515
+ */
516
+ unloadListeners = [],
517
+
518
+ /**
519
+ * The number of times to poll after window.onload. This number is
520
+ * increased if additional late-bound handlers are requested after
521
+ * the page load.
522
+ * @property retryCount
523
+ * @static
524
+ * @private
525
+ */
526
+ retryCount = 0,
527
+
528
+ /**
529
+ * onAvailable listeners
530
+ * @property onAvailStack
531
+ * @static
532
+ * @private
533
+ */
534
+ onAvailStack = [],
535
+
536
+ /**
537
+ * Counter for auto id generation
538
+ * @property counter
539
+ * @static
540
+ * @private
541
+ */
542
+ counter = 0,
543
+
544
+ /**
545
+ * Normalized keycodes for webkit/safari
546
+ * @property webkitKeymap
547
+ * @type {int: int}
548
+ * @private
549
+ * @static
550
+ * @final
551
+ */
552
+ webkitKeymap = {
553
+ 63232: 38, // up
554
+ 63233: 40, // down
555
+ 63234: 37, // left
556
+ 63235: 39, // right
557
+ 63276: 33, // page up
558
+ 63277: 34, // page down
559
+ 25: 9 // SHIFT-TAB (Safari provides a different key code in
560
+ // this case, even though the shiftKey modifier is set)
561
+ },
562
+
563
+ isIE = YAHOO.env.ua.ie,
564
+
565
+ // String constants used by the addFocusListener and removeFocusListener methods
566
+
567
+ FOCUSIN = "focusin",
568
+ FOCUSOUT = "focusout";
569
+
570
+ return {
571
+
572
+ /**
573
+ * The number of times we should look for elements that are not
574
+ * in the DOM at the time the event is requested after the document
575
+ * has been loaded. The default is 500@amp;40 ms, so it will poll
576
+ * for 20 seconds or until all outstanding handlers are bound
577
+ * (whichever comes first).
578
+ * @property POLL_RETRYS
579
+ * @type int
580
+ * @static
581
+ * @final
582
+ */
583
+ POLL_RETRYS: 500,
584
+
585
+ /**
586
+ * The poll interval in milliseconds
587
+ * @property POLL_INTERVAL
588
+ * @type int
589
+ * @static
590
+ * @final
591
+ */
592
+ POLL_INTERVAL: 40,
593
+
594
+ /**
595
+ * Element to bind, int constant
596
+ * @property EL
597
+ * @type int
598
+ * @static
599
+ * @final
600
+ */
601
+ EL: 0,
602
+
603
+ /**
604
+ * Type of event, int constant
605
+ * @property TYPE
606
+ * @type int
607
+ * @static
608
+ * @final
609
+ */
610
+ TYPE: 1,
611
+
612
+ /**
613
+ * Function to execute, int constant
614
+ * @property FN
615
+ * @type int
616
+ * @static
617
+ * @final
618
+ */
619
+ FN: 2,
620
+
621
+ /**
622
+ * Function wrapped for context correction and cleanup, int constant
623
+ * @property WFN
624
+ * @type int
625
+ * @static
626
+ * @final
627
+ */
628
+ WFN: 3,
629
+
630
+ /**
631
+ * Object passed in by the user that will be returned as a
632
+ * parameter to the callback, int constant. Specific to
633
+ * unload listeners
634
+ * @property OBJ
635
+ * @type int
636
+ * @static
637
+ * @final
638
+ */
639
+ UNLOAD_OBJ: 3,
640
+
641
+ /**
642
+ * Adjusted context, either the element we are registering the event
643
+ * on or the custom object passed in by the listener, int constant
644
+ * @property ADJ_SCOPE
645
+ * @type int
646
+ * @static
647
+ * @final
648
+ */
649
+ ADJ_SCOPE: 4,
650
+
651
+ /**
652
+ * The original obj passed into addListener
653
+ * @property OBJ
654
+ * @type int
655
+ * @static
656
+ * @final
657
+ */
658
+ OBJ: 5,
659
+
660
+ /**
661
+ * The original context parameter passed into addListener
662
+ * @property OVERRIDE
663
+ * @type int
664
+ * @static
665
+ * @final
666
+ */
667
+ OVERRIDE: 6,
668
+
669
+ /**
670
+ * The original capture parameter passed into addListener
671
+ * @property CAPTURE
672
+ * @type int
673
+ * @static
674
+ * @final
675
+ */
676
+ CAPTURE: 7,
677
+
678
+ /**
679
+ * addListener/removeListener can throw errors in unexpected scenarios.
680
+ * These errors are suppressed, the method returns false, and this property
681
+ * is set
682
+ * @property lastError
683
+ * @static
684
+ * @type Error
685
+ */
686
+ lastError: null,
687
+
688
+ /**
689
+ * Safari detection
690
+ * @property isSafari
691
+ * @private
692
+ * @static
693
+ * @deprecated use YAHOO.env.ua.webkit
694
+ */
695
+ isSafari: YAHOO.env.ua.webkit,
696
+
697
+ /**
698
+ * webkit version
699
+ * @property webkit
700
+ * @type string
701
+ * @private
702
+ * @static
703
+ * @deprecated use YAHOO.env.ua.webkit
704
+ */
705
+ webkit: YAHOO.env.ua.webkit,
706
+
707
+ /**
708
+ * IE detection
709
+ * @property isIE
710
+ * @private
711
+ * @static
712
+ * @deprecated use YAHOO.env.ua.ie
713
+ */
714
+ isIE: isIE,
715
+
716
+ /**
717
+ * poll handle
718
+ * @property _interval
719
+ * @static
720
+ * @private
721
+ */
722
+ _interval: null,
723
+
724
+ /**
725
+ * document readystate poll handle
726
+ * @property _dri
727
+ * @static
728
+ * @private
729
+ */
730
+ _dri: null,
731
+
732
+
733
+ /**
734
+ * Map of special event types
735
+ * @property _specialTypes
736
+ * @static
737
+ * @private
738
+ */
739
+ _specialTypes: {
740
+ focusin: (isIE ? "focusin" : "focus"),
741
+ focusout: (isIE ? "focusout" : "blur")
742
+ },
743
+
744
+
745
+ /**
746
+ * True when the document is initially usable
747
+ * @property DOMReady
748
+ * @type boolean
749
+ * @static
750
+ */
751
+ DOMReady: false,
752
+
753
+ /**
754
+ * Errors thrown by subscribers of custom events are caught
755
+ * and the error message is written to the debug console. If
756
+ * this property is set to true, it will also re-throw the
757
+ * error.
758
+ * @property throwErrors
759
+ * @type boolean
760
+ * @default false
761
+ */
762
+ throwErrors: false,
763
+
764
+
765
+ /**
766
+ * @method startInterval
767
+ * @static
768
+ * @private
769
+ */
770
+ startInterval: function() {
771
+ if (!this._interval) {
772
+ // var self = this;
773
+ // var callback = function() { self._tryPreloadAttach(); };
774
+ // this._interval = setInterval(callback, this.POLL_INTERVAL);
775
+ this._interval = YAHOO.lang.later(this.POLL_INTERVAL, this, this._tryPreloadAttach, null, true);
776
+ }
777
+ },
778
+
779
+ /**
780
+ * Executes the supplied callback when the item with the supplied
781
+ * id is found. This is meant to be used to execute behavior as
782
+ * soon as possible as the page loads. If you use this after the
783
+ * initial page load it will poll for a fixed time for the element.
784
+ * The number of times it will poll and the frequency are
785
+ * configurable. By default it will poll for 10 seconds.
786
+ *
787
+ * <p>The callback is executed with a single parameter:
788
+ * the custom object parameter, if provided.</p>
789
+ *
790
+ * @method onAvailable
791
+ *
792
+ * @param {string||string[]} id the id of the element, or an array
793
+ * of ids to look for.
794
+ * @param {function} fn what to execute when the element is found.
795
+ * @param {object} obj an optional object to be passed back as
796
+ * a parameter to fn.
797
+ * @param {boolean|object} overrideContext If set to true, fn will execute
798
+ * in the context of obj, if set to an object it
799
+ * will execute in the context of that object
800
+ * @param checkContent {boolean} check child node readiness (onContentReady)
801
+ * @static
802
+ */
803
+ onAvailable: function(id, fn, obj, overrideContext, checkContent) {
804
+
805
+ var a = (YAHOO.lang.isString(id)) ? [id] : id;
806
+
807
+ for (var i=0; i<a.length; i=i+1) {
808
+ onAvailStack.push({id: a[i],
809
+ fn: fn,
810
+ obj: obj,
811
+ overrideContext: overrideContext,
812
+ checkReady: checkContent });
813
+ }
814
+
815
+ retryCount = this.POLL_RETRYS;
816
+
817
+ this.startInterval();
818
+ },
819
+
820
+ /**
821
+ * Works the same way as onAvailable, but additionally checks the
822
+ * state of sibling elements to determine if the content of the
823
+ * available element is safe to modify.
824
+ *
825
+ * <p>The callback is executed with a single parameter:
826
+ * the custom object parameter, if provided.</p>
827
+ *
828
+ * @method onContentReady
829
+ *
830
+ * @param {string} id the id of the element to look for.
831
+ * @param {function} fn what to execute when the element is ready.
832
+ * @param {object} obj an optional object to be passed back as
833
+ * a parameter to fn.
834
+ * @param {boolean|object} overrideContext If set to true, fn will execute
835
+ * in the context of obj. If an object, fn will
836
+ * exectute in the context of that object
837
+ *
838
+ * @static
839
+ */
840
+ onContentReady: function(id, fn, obj, overrideContext) {
841
+ this.onAvailable(id, fn, obj, overrideContext, true);
842
+ },
843
+
844
+ /**
845
+ * Executes the supplied callback when the DOM is first usable. This
846
+ * will execute immediately if called after the DOMReady event has
847
+ * fired. @todo the DOMContentReady event does not fire when the
848
+ * script is dynamically injected into the page. This means the
849
+ * DOMReady custom event will never fire in FireFox or Opera when the
850
+ * library is injected. It _will_ fire in Safari, and the IE
851
+ * implementation would allow for us to fire it if the defered script
852
+ * is not available. We want this to behave the same in all browsers.
853
+ * Is there a way to identify when the script has been injected
854
+ * instead of included inline? Is there a way to know whether the
855
+ * window onload event has fired without having had a listener attached
856
+ * to it when it did so?
857
+ *
858
+ * <p>The callback is a CustomEvent, so the signature is:</p>
859
+ * <p>type &lt;string&gt;, args &lt;array&gt;, customobject &lt;object&gt;</p>
860
+ * <p>For DOMReady events, there are no fire argments, so the
861
+ * signature is:</p>
862
+ * <p>"DOMReady", [], obj</p>
863
+ *
864
+ *
865
+ * @method onDOMReady
866
+ *
867
+ * @param {function} fn what to execute when the element is found.
868
+ * @param {object} obj an optional object to be passed back as
869
+ * a parameter to fn.
870
+ * @param {boolean|object} overrideContext If set to true, fn will execute
871
+ * in the context of obj, if set to an object it
872
+ * will execute in the context of that object
873
+ *
874
+ * @static
875
+ */
876
+ // onDOMReady: function(fn, obj, overrideContext) {
877
+ onDOMReady: function() {
878
+ this.DOMReadyEvent.subscribe.apply(this.DOMReadyEvent, arguments);
879
+ },
880
+
881
+
882
+ /**
883
+ * Appends an event handler
884
+ *
885
+ * @method _addListener
886
+ *
887
+ * @param {String|HTMLElement|Array|NodeList} el An id, an element
888
+ * reference, or a collection of ids and/or elements to assign the
889
+ * listener to.
890
+ * @param {String} sType The type of event to append
891
+ * @param {Function} fn The method the event invokes
892
+ * @param {Object} obj An arbitrary object that will be
893
+ * passed as a parameter to the handler
894
+ * @param {Boolean|object} overrideContext If true, the obj passed in becomes
895
+ * the execution context of the listener. If an
896
+ * object, this object becomes the execution
897
+ * context.
898
+ * @param {boolen} capture capture or bubble phase
899
+ * @return {Boolean} True if the action was successful or defered,
900
+ * false if one or more of the elements
901
+ * could not have the listener attached,
902
+ * or if the operation throws an exception.
903
+ * @private
904
+ * @static
905
+ */
906
+ _addListener: function(el, sType, fn, obj, overrideContext, bCapture) {
907
+
908
+ if (!fn || !fn.call) {
909
+ return false;
910
+ }
911
+
912
+ // The el argument can be an array of elements or element ids.
913
+ if ( this._isValidCollection(el)) {
914
+ var ok = true;
915
+ for (var i=0,len=el.length; i<len; ++i) {
916
+ ok = this.on(el[i],
917
+ sType,
918
+ fn,
919
+ obj,
920
+ overrideContext) && ok;
921
+ }
922
+ return ok;
923
+
924
+ } else if (YAHOO.lang.isString(el)) {
925
+ var oEl = this.getEl(el);
926
+ // If the el argument is a string, we assume it is
927
+ // actually the id of the element. If the page is loaded
928
+ // we convert el to the actual element, otherwise we
929
+ // defer attaching the event until onload event fires
930
+
931
+ // check to see if we need to delay hooking up the event
932
+ // until after the page loads.
933
+ if (oEl) {
934
+ el = oEl;
935
+ } else {
936
+ // defer adding the event until the element is available
937
+ this.onAvailable(el, function() {
938
+ YAHOO.util.Event._addListener(el, sType, fn, obj, overrideContext, bCapture);
939
+ });
940
+
941
+ return true;
942
+ }
943
+ }
944
+
945
+ // Element should be an html element or an array if we get
946
+ // here.
947
+ if (!el) {
948
+ return false;
949
+ }
950
+
951
+ // we need to make sure we fire registered unload events
952
+ // prior to automatically unhooking them. So we hang on to
953
+ // these instead of attaching them to the window and fire the
954
+ // handles explicitly during our one unload event.
955
+ if ("unload" == sType && obj !== this) {
956
+ unloadListeners[unloadListeners.length] =
957
+ [el, sType, fn, obj, overrideContext];
958
+ return true;
959
+ }
960
+
961
+
962
+ // if the user chooses to override the context, we use the custom
963
+ // object passed in, otherwise the executing context will be the
964
+ // HTML element that the event is registered on
965
+ var context = el;
966
+ if (overrideContext) {
967
+ if (overrideContext === true) {
968
+ context = obj;
969
+ } else {
970
+ context = overrideContext;
971
+ }
972
+ }
973
+
974
+ // wrap the function so we can return the obj object when
975
+ // the event fires;
976
+ var wrappedFn = function(e) {
977
+ return fn.call(context, YAHOO.util.Event.getEvent(e, el),
978
+ obj);
979
+ };
980
+
981
+ var li = [el, sType, fn, wrappedFn, context, obj, overrideContext, bCapture];
982
+ var index = listeners.length;
983
+ // cache the listener so we can try to automatically unload
984
+ listeners[index] = li;
985
+
986
+ try {
987
+ this._simpleAdd(el, sType, wrappedFn, bCapture);
988
+ } catch(ex) {
989
+ // handle an error trying to attach an event. If it fails
990
+ // we need to clean up the cache
991
+ this.lastError = ex;
992
+ this.removeListener(el, sType, fn);
993
+ return false;
994
+ }
995
+
996
+ return true;
997
+
998
+ },
999
+
1000
+ /**
1001
+ * Checks to see if the type requested is a special type
1002
+ * (as defined by the _specialTypes hash), and (if so) returns
1003
+ * the special type name.
1004
+ *
1005
+ * @method _getType
1006
+ *
1007
+ * @param {String} sType The type to look up
1008
+ * @private
1009
+ */
1010
+ _getType: function (type) {
1011
+
1012
+ return this._specialTypes[type] || type;
1013
+
1014
+ },
1015
+
1016
+
1017
+ /**
1018
+ * Appends an event handler
1019
+ *
1020
+ * @method addListener
1021
+ *
1022
+ * @param {String|HTMLElement|Array|NodeList} el An id, an element
1023
+ * reference, or a collection of ids and/or elements to assign the
1024
+ * listener to.
1025
+ * @param {String} sType The type of event to append
1026
+ * @param {Function} fn The method the event invokes
1027
+ * @param {Object} obj An arbitrary object that will be
1028
+ * passed as a parameter to the handler
1029
+ * @param {Boolean|object} overrideContext If true, the obj passed in becomes
1030
+ * the execution context of the listener. If an
1031
+ * object, this object becomes the execution
1032
+ * context.
1033
+ * @return {Boolean} True if the action was successful or defered,
1034
+ * false if one or more of the elements
1035
+ * could not have the listener attached,
1036
+ * or if the operation throws an exception.
1037
+ * @static
1038
+ */
1039
+ addListener: function (el, sType, fn, obj, overrideContext) {
1040
+
1041
+ var capture = ((sType == FOCUSIN || sType == FOCUSOUT) && !YAHOO.env.ua.ie) ? true : false;
1042
+
1043
+ return this._addListener(el, this._getType(sType), fn, obj, overrideContext, capture);
1044
+
1045
+ },
1046
+
1047
+
1048
+ /**
1049
+ * Attaches a focusin event listener to the specified element for
1050
+ * the purpose of listening for the focus event on the element's
1051
+ * descendants.
1052
+ * @method addFocusListener
1053
+ *
1054
+ * @param {String|HTMLElement|Array|NodeList} el An id, an element
1055
+ * reference, or a collection of ids and/or elements to assign the
1056
+ * listener to.
1057
+ * @param {Function} fn The method the event invokes
1058
+ * @param {Object} obj An arbitrary object that will be
1059
+ * passed as a parameter to the handler
1060
+ * @param {Boolean|object} overrideContext If true, the obj passed in becomes
1061
+ * the execution context of the listener. If an
1062
+ * object, this object becomes the execution
1063
+ * context.
1064
+ * @return {Boolean} True if the action was successful or defered,
1065
+ * false if one or more of the elements
1066
+ * could not have the listener attached,
1067
+ * or if the operation throws an exception.
1068
+ * @static
1069
+ * @deprecated use YAHOO.util.Event.on and specify "focusin" as the event type.
1070
+ */
1071
+ addFocusListener: function (el, fn, obj, overrideContext) {
1072
+ return this.on(el, FOCUSIN, fn, obj, overrideContext);
1073
+ },
1074
+
1075
+
1076
+ /**
1077
+ * Removes a focusin event listener to the specified element for
1078
+ * the purpose of listening for the focus event on the element's
1079
+ * descendants.
1080
+ *
1081
+ * @method removeFocusListener
1082
+ *
1083
+ * @param {String|HTMLElement|Array|NodeList} el An id, an element
1084
+ * reference, or a collection of ids and/or elements to remove
1085
+ * the listener from.
1086
+ * @param {Function} fn the method the event invokes. If fn is
1087
+ * undefined, then all event handlers for the type of event are
1088
+ * removed.
1089
+ * @return {boolean} true if the unbind was successful, false
1090
+ * otherwise.
1091
+ * @static
1092
+ * @deprecated use YAHOO.util.Event.removeListener and specify "focusin" as the event type.
1093
+ */
1094
+ removeFocusListener: function (el, fn) {
1095
+ return this.removeListener(el, FOCUSIN, fn);
1096
+ },
1097
+
1098
+ /**
1099
+ * Attaches a focusout event listener to the specified element for
1100
+ * the purpose of listening for the blur event on the element's
1101
+ * descendants.
1102
+ *
1103
+ * @method addBlurListener
1104
+ *
1105
+ * @param {String|HTMLElement|Array|NodeList} el An id, an element
1106
+ * reference, or a collection of ids and/or elements to assign the
1107
+ * listener to.
1108
+ * @param {Function} fn The method the event invokes
1109
+ * @param {Object} obj An arbitrary object that will be
1110
+ * passed as a parameter to the handler
1111
+ * @param {Boolean|object} overrideContext If true, the obj passed in becomes
1112
+ * the execution context of the listener. If an
1113
+ * object, this object becomes the execution
1114
+ * context.
1115
+ * @return {Boolean} True if the action was successful or defered,
1116
+ * false if one or more of the elements
1117
+ * could not have the listener attached,
1118
+ * or if the operation throws an exception.
1119
+ * @static
1120
+ * @deprecated use YAHOO.util.Event.on and specify "focusout" as the event type.
1121
+ */
1122
+ addBlurListener: function (el, fn, obj, overrideContext) {
1123
+ return this.on(el, FOCUSOUT, fn, obj, overrideContext);
1124
+ },
1125
+
1126
+ /**
1127
+ * Removes a focusout event listener to the specified element for
1128
+ * the purpose of listening for the blur event on the element's
1129
+ * descendants.
1130
+ *
1131
+ * @method removeBlurListener
1132
+ *
1133
+ * @param {String|HTMLElement|Array|NodeList} el An id, an element
1134
+ * reference, or a collection of ids and/or elements to remove
1135
+ * the listener from.
1136
+ * @param {Function} fn the method the event invokes. If fn is
1137
+ * undefined, then all event handlers for the type of event are
1138
+ * removed.
1139
+ * @return {boolean} true if the unbind was successful, false
1140
+ * otherwise.
1141
+ * @static
1142
+ * @deprecated use YAHOO.util.Event.removeListener and specify "focusout" as the event type.
1143
+ */
1144
+ removeBlurListener: function (el, fn) {
1145
+ return this.removeListener(el, FOCUSOUT, fn);
1146
+ },
1147
+
1148
+ /**
1149
+ * Removes an event listener
1150
+ *
1151
+ * @method removeListener
1152
+ *
1153
+ * @param {String|HTMLElement|Array|NodeList} el An id, an element
1154
+ * reference, or a collection of ids and/or elements to remove
1155
+ * the listener from.
1156
+ * @param {String} sType the type of event to remove.
1157
+ * @param {Function} fn the method the event invokes. If fn is
1158
+ * undefined, then all event handlers for the type of event are
1159
+ * removed.
1160
+ * @return {boolean} true if the unbind was successful, false
1161
+ * otherwise.
1162
+ * @static
1163
+ */
1164
+ removeListener: function(el, sType, fn) {
1165
+ var i, len, li;
1166
+
1167
+ sType = this._getType(sType);
1168
+
1169
+ // The el argument can be a string
1170
+ if (typeof el == "string") {
1171
+ el = this.getEl(el);
1172
+ // The el argument can be an array of elements or element ids.
1173
+ } else if ( this._isValidCollection(el)) {
1174
+ var ok = true;
1175
+ for (i=el.length-1; i>-1; i--) {
1176
+ ok = ( this.removeListener(el[i], sType, fn) && ok );
1177
+ }
1178
+ return ok;
1179
+ }
1180
+
1181
+ if (!fn || !fn.call) {
1182
+ //return false;
1183
+ return this.purgeElement(el, false, sType);
1184
+ }
1185
+
1186
+ if ("unload" == sType) {
1187
+
1188
+ for (i=unloadListeners.length-1; i>-1; i--) {
1189
+ li = unloadListeners[i];
1190
+ if (li &&
1191
+ li[0] == el &&
1192
+ li[1] == sType &&
1193
+ li[2] == fn) {
1194
+ unloadListeners.splice(i, 1);
1195
+ // unloadListeners[i]=null;
1196
+ return true;
1197
+ }
1198
+ }
1199
+
1200
+ return false;
1201
+ }
1202
+
1203
+ var cacheItem = null;
1204
+
1205
+ // The index is a hidden parameter; needed to remove it from
1206
+ // the method signature because it was tempting users to
1207
+ // try and take advantage of it, which is not possible.
1208
+ var index = arguments[3];
1209
+
1210
+ if ("undefined" === typeof index) {
1211
+ index = this._getCacheIndex(listeners, el, sType, fn);
1212
+ }
1213
+
1214
+ if (index >= 0) {
1215
+ cacheItem = listeners[index];
1216
+ }
1217
+
1218
+ if (!el || !cacheItem) {
1219
+ return false;
1220
+ }
1221
+
1222
+
1223
+ var bCapture = cacheItem[this.CAPTURE] === true ? true : false;
1224
+
1225
+ try {
1226
+ this._simpleRemove(el, sType, cacheItem[this.WFN], bCapture);
1227
+ } catch(ex) {
1228
+ this.lastError = ex;
1229
+ return false;
1230
+ }
1231
+
1232
+ // removed the wrapped handler
1233
+ delete listeners[index][this.WFN];
1234
+ delete listeners[index][this.FN];
1235
+ listeners.splice(index, 1);
1236
+ // listeners[index]=null;
1237
+
1238
+ return true;
1239
+
1240
+ },
1241
+
1242
+ /**
1243
+ * Returns the event's target element. Safari sometimes provides
1244
+ * a text node, and this is automatically resolved to the text
1245
+ * node's parent so that it behaves like other browsers.
1246
+ * @method getTarget
1247
+ * @param {Event} ev the event
1248
+ * @param {boolean} resolveTextNode when set to true the target's
1249
+ * parent will be returned if the target is a
1250
+ * text node. @deprecated, the text node is
1251
+ * now resolved automatically
1252
+ * @return {HTMLElement} the event's target
1253
+ * @static
1254
+ */
1255
+ getTarget: function(ev, resolveTextNode) {
1256
+ var t = ev.target || ev.srcElement;
1257
+ return this.resolveTextNode(t);
1258
+ },
1259
+
1260
+ /**
1261
+ * In some cases, some browsers will return a text node inside
1262
+ * the actual element that was targeted. This normalizes the
1263
+ * return value for getTarget and getRelatedTarget.
1264
+ * @method resolveTextNode
1265
+ * @param {HTMLElement} node node to resolve
1266
+ * @return {HTMLElement} the normized node
1267
+ * @static
1268
+ */
1269
+ resolveTextNode: function(n) {
1270
+ try {
1271
+ if (n && 3 == n.nodeType) {
1272
+ return n.parentNode;
1273
+ }
1274
+ } catch(e) { }
1275
+
1276
+ return n;
1277
+ },
1278
+
1279
+ /**
1280
+ * Returns the event's pageX
1281
+ * @method getPageX
1282
+ * @param {Event} ev the event
1283
+ * @return {int} the event's pageX
1284
+ * @static
1285
+ */
1286
+ getPageX: function(ev) {
1287
+ var x = ev.pageX;
1288
+ if (!x && 0 !== x) {
1289
+ x = ev.clientX || 0;
1290
+
1291
+ if ( this.isIE ) {
1292
+ x += this._getScrollLeft();
1293
+ }
1294
+ }
1295
+
1296
+ return x;
1297
+ },
1298
+
1299
+ /**
1300
+ * Returns the event's pageY
1301
+ * @method getPageY
1302
+ * @param {Event} ev the event
1303
+ * @return {int} the event's pageY
1304
+ * @static
1305
+ */
1306
+ getPageY: function(ev) {
1307
+ var y = ev.pageY;
1308
+ if (!y && 0 !== y) {
1309
+ y = ev.clientY || 0;
1310
+
1311
+ if ( this.isIE ) {
1312
+ y += this._getScrollTop();
1313
+ }
1314
+ }
1315
+
1316
+
1317
+ return y;
1318
+ },
1319
+
1320
+ /**
1321
+ * Returns the pageX and pageY properties as an indexed array.
1322
+ * @method getXY
1323
+ * @param {Event} ev the event
1324
+ * @return {[x, y]} the pageX and pageY properties of the event
1325
+ * @static
1326
+ */
1327
+ getXY: function(ev) {
1328
+ return [this.getPageX(ev), this.getPageY(ev)];
1329
+ },
1330
+
1331
+ /**
1332
+ * Returns the event's related target
1333
+ * @method getRelatedTarget
1334
+ * @param {Event} ev the event
1335
+ * @return {HTMLElement} the event's relatedTarget
1336
+ * @static
1337
+ */
1338
+ getRelatedTarget: function(ev) {
1339
+ var t = ev.relatedTarget;
1340
+ if (!t) {
1341
+ if (ev.type == "mouseout") {
1342
+ t = ev.toElement;
1343
+ } else if (ev.type == "mouseover") {
1344
+ t = ev.fromElement;
1345
+ }
1346
+ }
1347
+
1348
+ return this.resolveTextNode(t);
1349
+ },
1350
+
1351
+ /**
1352
+ * Returns the time of the event. If the time is not included, the
1353
+ * event is modified using the current time.
1354
+ * @method getTime
1355
+ * @param {Event} ev the event
1356
+ * @return {Date} the time of the event
1357
+ * @static
1358
+ */
1359
+ getTime: function(ev) {
1360
+ if (!ev.time) {
1361
+ var t = new Date().getTime();
1362
+ try {
1363
+ ev.time = t;
1364
+ } catch(ex) {
1365
+ this.lastError = ex;
1366
+ return t;
1367
+ }
1368
+ }
1369
+
1370
+ return ev.time;
1371
+ },
1372
+
1373
+ /**
1374
+ * Convenience method for stopPropagation + preventDefault
1375
+ * @method stopEvent
1376
+ * @param {Event} ev the event
1377
+ * @static
1378
+ */
1379
+ stopEvent: function(ev) {
1380
+ this.stopPropagation(ev);
1381
+ this.preventDefault(ev);
1382
+ },
1383
+
1384
+ /**
1385
+ * Stops event propagation
1386
+ * @method stopPropagation
1387
+ * @param {Event} ev the event
1388
+ * @static
1389
+ */
1390
+ stopPropagation: function(ev) {
1391
+ if (ev.stopPropagation) {
1392
+ ev.stopPropagation();
1393
+ } else {
1394
+ ev.cancelBubble = true;
1395
+ }
1396
+ },
1397
+
1398
+ /**
1399
+ * Prevents the default behavior of the event
1400
+ * @method preventDefault
1401
+ * @param {Event} ev the event
1402
+ * @static
1403
+ */
1404
+ preventDefault: function(ev) {
1405
+ if (ev.preventDefault) {
1406
+ ev.preventDefault();
1407
+ } else {
1408
+ ev.returnValue = false;
1409
+ }
1410
+ },
1411
+
1412
+ /**
1413
+ * Finds the event in the window object, the caller's arguments, or
1414
+ * in the arguments of another method in the callstack. This is
1415
+ * executed automatically for events registered through the event
1416
+ * manager, so the implementer should not normally need to execute
1417
+ * this function at all.
1418
+ * @method getEvent
1419
+ * @param {Event} e the event parameter from the handler
1420
+ * @param {HTMLElement} boundEl the element the listener is attached to
1421
+ * @return {Event} the event
1422
+ * @static
1423
+ */
1424
+ getEvent: function(e, boundEl) {
1425
+ var ev = e || window.event;
1426
+
1427
+ if (!ev) {
1428
+ var c = this.getEvent.caller;
1429
+ while (c) {
1430
+ ev = c.arguments[0];
1431
+ if (ev && Event == ev.constructor) {
1432
+ break;
1433
+ }
1434
+ c = c.caller;
1435
+ }
1436
+ }
1437
+
1438
+ return ev;
1439
+ },
1440
+
1441
+ /**
1442
+ * Returns the charcode for an event
1443
+ * @method getCharCode
1444
+ * @param {Event} ev the event
1445
+ * @return {int} the event's charCode
1446
+ * @static
1447
+ */
1448
+ getCharCode: function(ev) {
1449
+ var code = ev.keyCode || ev.charCode || 0;
1450
+
1451
+ // webkit key normalization
1452
+ if (YAHOO.env.ua.webkit && (code in webkitKeymap)) {
1453
+ code = webkitKeymap[code];
1454
+ }
1455
+ return code;
1456
+ },
1457
+
1458
+ /**
1459
+ * Locating the saved event handler data by function ref
1460
+ *
1461
+ * @method _getCacheIndex
1462
+ * @static
1463
+ * @private
1464
+ */
1465
+ _getCacheIndex: function(a, el, sType, fn) {
1466
+ for (var i=0, l=a.length; i<l; i=i+1) {
1467
+ var li = a[i];
1468
+ if ( li &&
1469
+ li[this.FN] == fn &&
1470
+ li[this.EL] == el &&
1471
+ li[this.TYPE] == sType ) {
1472
+ return i;
1473
+ }
1474
+ }
1475
+
1476
+ return -1;
1477
+ },
1478
+
1479
+ /**
1480
+ * Generates an unique ID for the element if it does not already
1481
+ * have one.
1482
+ * @method generateId
1483
+ * @param el the element to create the id for
1484
+ * @return {string} the resulting id of the element
1485
+ * @static
1486
+ */
1487
+ generateId: function(el) {
1488
+ var id = el.id;
1489
+
1490
+ if (!id) {
1491
+ id = "yuievtautoid-" + counter;
1492
+ ++counter;
1493
+ el.id = id;
1494
+ }
1495
+
1496
+ return id;
1497
+ },
1498
+
1499
+
1500
+ /**
1501
+ * We want to be able to use getElementsByTagName as a collection
1502
+ * to attach a group of events to. Unfortunately, different
1503
+ * browsers return different types of collections. This function
1504
+ * tests to determine if the object is array-like. It will also
1505
+ * fail if the object is an array, but is empty.
1506
+ * @method _isValidCollection
1507
+ * @param o the object to test
1508
+ * @return {boolean} true if the object is array-like and populated
1509
+ * @static
1510
+ * @private
1511
+ */
1512
+ _isValidCollection: function(o) {
1513
+ try {
1514
+ return ( o && // o is something
1515
+ typeof o !== "string" && // o is not a string
1516
+ o.length && // o is indexed
1517
+ !o.tagName && // o is not an HTML element
1518
+ !o.alert && // o is not a window
1519
+ typeof o[0] !== "undefined" );
1520
+ } catch(ex) {
1521
+ return false;
1522
+ }
1523
+
1524
+ },
1525
+
1526
+ /**
1527
+ * @private
1528
+ * @property elCache
1529
+ * DOM element cache
1530
+ * @static
1531
+ * @deprecated Elements are not cached due to issues that arise when
1532
+ * elements are removed and re-added
1533
+ */
1534
+ elCache: {},
1535
+
1536
+ /**
1537
+ * We cache elements bound by id because when the unload event
1538
+ * fires, we can no longer use document.getElementById
1539
+ * @method getEl
1540
+ * @static
1541
+ * @private
1542
+ * @deprecated Elements are not cached any longer
1543
+ */
1544
+ getEl: function(id) {
1545
+ return (typeof id === "string") ? document.getElementById(id) : id;
1546
+ },
1547
+
1548
+ /**
1549
+ * Clears the element cache
1550
+ * @deprecated Elements are not cached any longer
1551
+ * @method clearCache
1552
+ * @static
1553
+ * @private
1554
+ */
1555
+ clearCache: function() { },
1556
+
1557
+ /**
1558
+ * Custom event the fires when the dom is initially usable
1559
+ * @event DOMReadyEvent
1560
+ */
1561
+ DOMReadyEvent: new YAHOO.util.CustomEvent("DOMReady", YAHOO, 0, 0, 1),
1562
+
1563
+ /**
1564
+ * hook up any deferred listeners
1565
+ * @method _load
1566
+ * @static
1567
+ * @private
1568
+ */
1569
+ _load: function(e) {
1570
+
1571
+ if (!loadComplete) {
1572
+ loadComplete = true;
1573
+ var EU = YAHOO.util.Event;
1574
+
1575
+ // Just in case DOMReady did not go off for some reason
1576
+ EU._ready();
1577
+
1578
+ // Available elements may not have been detected before the
1579
+ // window load event fires. Try to find them now so that the
1580
+ // the user is more likely to get the onAvailable notifications
1581
+ // before the window load notification
1582
+ EU._tryPreloadAttach();
1583
+
1584
+ }
1585
+ },
1586
+
1587
+ /**
1588
+ * Fires the DOMReady event listeners the first time the document is
1589
+ * usable.
1590
+ * @method _ready
1591
+ * @static
1592
+ * @private
1593
+ */
1594
+ _ready: function(e) {
1595
+ var EU = YAHOO.util.Event;
1596
+ if (!EU.DOMReady) {
1597
+ EU.DOMReady=true;
1598
+
1599
+ // Fire the content ready custom event
1600
+ EU.DOMReadyEvent.fire();
1601
+
1602
+ // Remove the DOMContentLoaded (FF/Opera)
1603
+ EU._simpleRemove(document, "DOMContentLoaded", EU._ready);
1604
+ }
1605
+ },
1606
+
1607
+ /**
1608
+ * Polling function that runs before the onload event fires,
1609
+ * attempting to attach to DOM Nodes as soon as they are
1610
+ * available
1611
+ * @method _tryPreloadAttach
1612
+ * @static
1613
+ * @private
1614
+ */
1615
+ _tryPreloadAttach: function() {
1616
+
1617
+ if (onAvailStack.length === 0) {
1618
+ retryCount = 0;
1619
+ if (this._interval) {
1620
+ // clearInterval(this._interval);
1621
+ this._interval.cancel();
1622
+ this._interval = null;
1623
+ }
1624
+ return;
1625
+ }
1626
+
1627
+ if (this.locked) {
1628
+ return;
1629
+ }
1630
+
1631
+ if (this.isIE) {
1632
+ // Hold off if DOMReady has not fired and check current
1633
+ // readyState to protect against the IE operation aborted
1634
+ // issue.
1635
+ if (!this.DOMReady) {
1636
+ this.startInterval();
1637
+ return;
1638
+ }
1639
+ }
1640
+
1641
+ this.locked = true;
1642
+
1643
+
1644
+ // keep trying until after the page is loaded. We need to
1645
+ // check the page load state prior to trying to bind the
1646
+ // elements so that we can be certain all elements have been
1647
+ // tested appropriately
1648
+ var tryAgain = !loadComplete;
1649
+ if (!tryAgain) {
1650
+ tryAgain = (retryCount > 0 && onAvailStack.length > 0);
1651
+ }
1652
+
1653
+ // onAvailable
1654
+ var notAvail = [];
1655
+
1656
+ var executeItem = function (el, item) {
1657
+ var context = el;
1658
+ if (item.overrideContext) {
1659
+ if (item.overrideContext === true) {
1660
+ context = item.obj;
1661
+ } else {
1662
+ context = item.overrideContext;
1663
+ }
1664
+ }
1665
+ item.fn.call(context, item.obj);
1666
+ };
1667
+
1668
+ var i, len, item, el, ready=[];
1669
+
1670
+ // onAvailable onContentReady
1671
+ for (i=0, len=onAvailStack.length; i<len; i=i+1) {
1672
+ item = onAvailStack[i];
1673
+ if (item) {
1674
+ el = this.getEl(item.id);
1675
+ if (el) {
1676
+ if (item.checkReady) {
1677
+ if (loadComplete || el.nextSibling || !tryAgain) {
1678
+ ready.push(item);
1679
+ onAvailStack[i] = null;
1680
+ }
1681
+ } else {
1682
+ executeItem(el, item);
1683
+ onAvailStack[i] = null;
1684
+ }
1685
+ } else {
1686
+ notAvail.push(item);
1687
+ }
1688
+ }
1689
+ }
1690
+
1691
+ // make sure onContentReady fires after onAvailable
1692
+ for (i=0, len=ready.length; i<len; i=i+1) {
1693
+ item = ready[i];
1694
+ executeItem(this.getEl(item.id), item);
1695
+ }
1696
+
1697
+
1698
+ retryCount--;
1699
+
1700
+ if (tryAgain) {
1701
+ for (i=onAvailStack.length-1; i>-1; i--) {
1702
+ item = onAvailStack[i];
1703
+ if (!item || !item.id) {
1704
+ onAvailStack.splice(i, 1);
1705
+ }
1706
+ }
1707
+
1708
+ this.startInterval();
1709
+ } else {
1710
+ if (this._interval) {
1711
+ // clearInterval(this._interval);
1712
+ this._interval.cancel();
1713
+ this._interval = null;
1714
+ }
1715
+ }
1716
+
1717
+ this.locked = false;
1718
+
1719
+ },
1720
+
1721
+ /**
1722
+ * Removes all listeners attached to the given element via addListener.
1723
+ * Optionally, the node's children can also be purged.
1724
+ * Optionally, you can specify a specific type of event to remove.
1725
+ * @method purgeElement
1726
+ * @param {HTMLElement} el the element to purge
1727
+ * @param {boolean} recurse recursively purge this element's children
1728
+ * as well. Use with caution.
1729
+ * @param {string} sType optional type of listener to purge. If
1730
+ * left out, all listeners will be removed
1731
+ * @static
1732
+ */
1733
+ purgeElement: function(el, recurse, sType) {
1734
+ var oEl = (YAHOO.lang.isString(el)) ? this.getEl(el) : el;
1735
+ var elListeners = this.getListeners(oEl, sType), i, len;
1736
+ if (elListeners) {
1737
+ for (i=elListeners.length-1; i>-1; i--) {
1738
+ var l = elListeners[i];
1739
+ this.removeListener(oEl, l.type, l.fn);
1740
+ }
1741
+ }
1742
+
1743
+ if (recurse && oEl && oEl.childNodes) {
1744
+ for (i=0,len=oEl.childNodes.length; i<len ; ++i) {
1745
+ this.purgeElement(oEl.childNodes[i], recurse, sType);
1746
+ }
1747
+ }
1748
+ },
1749
+
1750
+ /**
1751
+ * Returns all listeners attached to the given element via addListener.
1752
+ * Optionally, you can specify a specific type of event to return.
1753
+ * @method getListeners
1754
+ * @param el {HTMLElement|string} the element or element id to inspect
1755
+ * @param sType {string} optional type of listener to return. If
1756
+ * left out, all listeners will be returned
1757
+ * @return {Object} the listener. Contains the following fields:
1758
+ * &nbsp;&nbsp;type: (string) the type of event
1759
+ * &nbsp;&nbsp;fn: (function) the callback supplied to addListener
1760
+ * &nbsp;&nbsp;obj: (object) the custom object supplied to addListener
1761
+ * &nbsp;&nbsp;adjust: (boolean|object) whether or not to adjust the default context
1762
+ * &nbsp;&nbsp;scope: (boolean) the derived context based on the adjust parameter
1763
+ * &nbsp;&nbsp;index: (int) its position in the Event util listener cache
1764
+ * @static
1765
+ */
1766
+ getListeners: function(el, sType) {
1767
+ var results=[], searchLists;
1768
+ if (!sType) {
1769
+ searchLists = [listeners, unloadListeners];
1770
+ } else if (sType === "unload") {
1771
+ searchLists = [unloadListeners];
1772
+ } else {
1773
+ sType = this._getType(sType);
1774
+ searchLists = [listeners];
1775
+ }
1776
+
1777
+ var oEl = (YAHOO.lang.isString(el)) ? this.getEl(el) : el;
1778
+
1779
+ for (var j=0;j<searchLists.length; j=j+1) {
1780
+ var searchList = searchLists[j];
1781
+ if (searchList) {
1782
+ for (var i=0,len=searchList.length; i<len ; ++i) {
1783
+ var l = searchList[i];
1784
+ if ( l && l[this.EL] === oEl &&
1785
+ (!sType || sType === l[this.TYPE]) ) {
1786
+ results.push({
1787
+ type: l[this.TYPE],
1788
+ fn: l[this.FN],
1789
+ obj: l[this.OBJ],
1790
+ adjust: l[this.OVERRIDE],
1791
+ scope: l[this.ADJ_SCOPE],
1792
+ index: i
1793
+ });
1794
+ }
1795
+ }
1796
+ }
1797
+ }
1798
+
1799
+ return (results.length) ? results : null;
1800
+ },
1801
+
1802
+ /**
1803
+ * Removes all listeners registered by pe.event. Called
1804
+ * automatically during the unload event.
1805
+ * @method _unload
1806
+ * @static
1807
+ * @private
1808
+ */
1809
+ _unload: function(e) {
1810
+
1811
+ var EU = YAHOO.util.Event, i, j, l, len, index,
1812
+ ul = unloadListeners.slice(), context;
1813
+
1814
+ // execute and clear stored unload listeners
1815
+ for (i=0, len=unloadListeners.length; i<len; ++i) {
1816
+ l = ul[i];
1817
+ if (l) {
1818
+ context = window;
1819
+ if (l[EU.ADJ_SCOPE]) {
1820
+ if (l[EU.ADJ_SCOPE] === true) {
1821
+ context = l[EU.UNLOAD_OBJ];
1822
+ } else {
1823
+ context = l[EU.ADJ_SCOPE];
1824
+ }
1825
+ }
1826
+ l[EU.FN].call(context, EU.getEvent(e, l[EU.EL]), l[EU.UNLOAD_OBJ] );
1827
+ ul[i] = null;
1828
+ }
1829
+ }
1830
+
1831
+ l = null;
1832
+ context = null;
1833
+ unloadListeners = null;
1834
+
1835
+ // Remove listeners to handle IE memory leaks
1836
+ // 2.5.0 listeners are removed for all browsers again. FireFox preserves
1837
+ // at least some listeners between page refreshes, potentially causing
1838
+ // errors during page load (mouseover listeners firing before they
1839
+ // should if the user moves the mouse at the correct moment).
1840
+ if (listeners) {
1841
+ for (j=listeners.length-1; j>-1; j--) {
1842
+ l = listeners[j];
1843
+ if (l) {
1844
+ EU.removeListener(l[EU.EL], l[EU.TYPE], l[EU.FN], j);
1845
+ }
1846
+ }
1847
+ l=null;
1848
+ }
1849
+
1850
+ EU._simpleRemove(window, "unload", EU._unload);
1851
+
1852
+ },
1853
+
1854
+ /**
1855
+ * Returns scrollLeft
1856
+ * @method _getScrollLeft
1857
+ * @static
1858
+ * @private
1859
+ */
1860
+ _getScrollLeft: function() {
1861
+ return this._getScroll()[1];
1862
+ },
1863
+
1864
+ /**
1865
+ * Returns scrollTop
1866
+ * @method _getScrollTop
1867
+ * @static
1868
+ * @private
1869
+ */
1870
+ _getScrollTop: function() {
1871
+ return this._getScroll()[0];
1872
+ },
1873
+
1874
+ /**
1875
+ * Returns the scrollTop and scrollLeft. Used to calculate the
1876
+ * pageX and pageY in Internet Explorer
1877
+ * @method _getScroll
1878
+ * @static
1879
+ * @private
1880
+ */
1881
+ _getScroll: function() {
1882
+ var dd = document.documentElement, db = document.body;
1883
+ if (dd && (dd.scrollTop || dd.scrollLeft)) {
1884
+ return [dd.scrollTop, dd.scrollLeft];
1885
+ } else if (db) {
1886
+ return [db.scrollTop, db.scrollLeft];
1887
+ } else {
1888
+ return [0, 0];
1889
+ }
1890
+ },
1891
+
1892
+ /**
1893
+ * Used by old versions of CustomEvent, restored for backwards
1894
+ * compatibility
1895
+ * @method regCE
1896
+ * @private
1897
+ * @static
1898
+ * @deprecated still here for backwards compatibility
1899
+ */
1900
+ regCE: function() {},
1901
+
1902
+ /**
1903
+ * Adds a DOM event directly without the caching, cleanup, context adj, etc
1904
+ *
1905
+ * @method _simpleAdd
1906
+ * @param {HTMLElement} el the element to bind the handler to
1907
+ * @param {string} sType the type of event handler
1908
+ * @param {function} fn the callback to invoke
1909
+ * @param {boolen} capture capture or bubble phase
1910
+ * @static
1911
+ * @private
1912
+ */
1913
+ _simpleAdd: function () {
1914
+ if (window.addEventListener) {
1915
+ return function(el, sType, fn, capture) {
1916
+ el.addEventListener(sType, fn, (capture));
1917
+ };
1918
+ } else if (window.attachEvent) {
1919
+ return function(el, sType, fn, capture) {
1920
+ el.attachEvent("on" + sType, fn);
1921
+ };
1922
+ } else {
1923
+ return function(){};
1924
+ }
1925
+ }(),
1926
+
1927
+ /**
1928
+ * Basic remove listener
1929
+ *
1930
+ * @method _simpleRemove
1931
+ * @param {HTMLElement} el the element to bind the handler to
1932
+ * @param {string} sType the type of event handler
1933
+ * @param {function} fn the callback to invoke
1934
+ * @param {boolen} capture capture or bubble phase
1935
+ * @static
1936
+ * @private
1937
+ */
1938
+ _simpleRemove: function() {
1939
+ if (window.removeEventListener) {
1940
+ return function (el, sType, fn, capture) {
1941
+ el.removeEventListener(sType, fn, (capture));
1942
+ };
1943
+ } else if (window.detachEvent) {
1944
+ return function (el, sType, fn) {
1945
+ el.detachEvent("on" + sType, fn);
1946
+ };
1947
+ } else {
1948
+ return function(){};
1949
+ }
1950
+ }()
1951
+ };
1952
+
1953
+ }();
1954
+
1955
+ (function() {
1956
+ var EU = YAHOO.util.Event;
1957
+
1958
+ /**
1959
+ * YAHOO.util.Event.on is an alias for addListener
1960
+ * @method on
1961
+ * @see addListener
1962
+ * @static
1963
+ */
1964
+ EU.on = EU.addListener;
1965
+
1966
+ /**
1967
+ * YAHOO.util.Event.onFocus is an alias for addFocusListener
1968
+ * @method onFocus
1969
+ * @see addFocusListener
1970
+ * @static
1971
+ * @deprecated use YAHOO.util.Event.on and specify "focusin" as the event type.
1972
+ */
1973
+ EU.onFocus = EU.addFocusListener;
1974
+
1975
+ /**
1976
+ * YAHOO.util.Event.onBlur is an alias for addBlurListener
1977
+ * @method onBlur
1978
+ * @see addBlurListener
1979
+ * @static
1980
+ * @deprecated use YAHOO.util.Event.on and specify "focusout" as the event type.
1981
+ */
1982
+ EU.onBlur = EU.addBlurListener;
1983
+
1984
+ /*! DOMReady: based on work by: Dean Edwards/John Resig/Matthias Miller/Diego Perini */
1985
+
1986
+ // Internet Explorer: use the readyState of a defered script.
1987
+ // This isolates what appears to be a safe moment to manipulate
1988
+ // the DOM prior to when the document's readyState suggests
1989
+ // it is safe to do so.
1990
+ if (EU.isIE) {
1991
+ if (self !== self.top) {
1992
+ document.onreadystatechange = function() {
1993
+ if (document.readyState == 'complete') {
1994
+ document.onreadystatechange = null;
1995
+ EU._ready();
1996
+ }
1997
+ };
1998
+ } else {
1999
+
2000
+ // Process onAvailable/onContentReady items when the
2001
+ // DOM is ready.
2002
+ YAHOO.util.Event.onDOMReady(
2003
+ YAHOO.util.Event._tryPreloadAttach,
2004
+ YAHOO.util.Event, true);
2005
+
2006
+ var n = document.createElement('p');
2007
+
2008
+ EU._dri = setInterval(function() {
2009
+ try {
2010
+ // throws an error if doc is not ready
2011
+ n.doScroll('left');
2012
+ clearInterval(EU._dri);
2013
+ EU._dri = null;
2014
+ EU._ready();
2015
+ n = null;
2016
+ } catch (ex) {
2017
+ }
2018
+ }, EU.POLL_INTERVAL);
2019
+ }
2020
+
2021
+ // The document's readyState in Safari currently will
2022
+ // change to loaded/complete before images are loaded.
2023
+ } else if (EU.webkit && EU.webkit < 525) {
2024
+
2025
+ EU._dri = setInterval(function() {
2026
+ var rs=document.readyState;
2027
+ if ("loaded" == rs || "complete" == rs) {
2028
+ clearInterval(EU._dri);
2029
+ EU._dri = null;
2030
+ EU._ready();
2031
+ }
2032
+ }, EU.POLL_INTERVAL);
2033
+
2034
+ // FireFox and Opera: These browsers provide a event for this
2035
+ // moment. The latest WebKit releases now support this event.
2036
+ } else {
2037
+
2038
+ EU._simpleAdd(document, "DOMContentLoaded", EU._ready);
2039
+
2040
+ }
2041
+ /////////////////////////////////////////////////////////////
2042
+
2043
+
2044
+ EU._simpleAdd(window, "load", EU._load);
2045
+ EU._simpleAdd(window, "unload", EU._unload);
2046
+ EU._tryPreloadAttach();
2047
+ })();
2048
+
2049
+ }
2050
+ /**
2051
+ * EventProvider is designed to be used with YAHOO.augment to wrap
2052
+ * CustomEvents in an interface that allows events to be subscribed to
2053
+ * and fired by name. This makes it possible for implementing code to
2054
+ * subscribe to an event that either has not been created yet, or will
2055
+ * not be created at all.
2056
+ *
2057
+ * @Class EventProvider
2058
+ */
2059
+ YAHOO.util.EventProvider = function() { };
2060
+
2061
+ YAHOO.util.EventProvider.prototype = {
2062
+
2063
+ /**
2064
+ * Private storage of custom events
2065
+ * @property __yui_events
2066
+ * @type Object[]
2067
+ * @private
2068
+ */
2069
+ __yui_events: null,
2070
+
2071
+ /**
2072
+ * Private storage of custom event subscribers
2073
+ * @property __yui_subscribers
2074
+ * @type Object[]
2075
+ * @private
2076
+ */
2077
+ __yui_subscribers: null,
2078
+
2079
+ /**
2080
+ * Subscribe to a CustomEvent by event type
2081
+ *
2082
+ * @method subscribe
2083
+ * @param p_type {string} the type, or name of the event
2084
+ * @param p_fn {function} the function to exectute when the event fires
2085
+ * @param p_obj {Object} An object to be passed along when the event
2086
+ * fires
2087
+ * @param overrideContext {boolean} If true, the obj passed in becomes the
2088
+ * execution scope of the listener
2089
+ */
2090
+ subscribe: function(p_type, p_fn, p_obj, overrideContext) {
2091
+
2092
+ this.__yui_events = this.__yui_events || {};
2093
+ var ce = this.__yui_events[p_type];
2094
+
2095
+ if (ce) {
2096
+ ce.subscribe(p_fn, p_obj, overrideContext);
2097
+ } else {
2098
+ this.__yui_subscribers = this.__yui_subscribers || {};
2099
+ var subs = this.__yui_subscribers;
2100
+ if (!subs[p_type]) {
2101
+ subs[p_type] = [];
2102
+ }
2103
+ subs[p_type].push(
2104
+ { fn: p_fn, obj: p_obj, overrideContext: overrideContext } );
2105
+ }
2106
+ },
2107
+
2108
+ /**
2109
+ * Unsubscribes one or more listeners the from the specified event
2110
+ * @method unsubscribe
2111
+ * @param p_type {string} The type, or name of the event. If the type
2112
+ * is not specified, it will attempt to remove
2113
+ * the listener from all hosted events.
2114
+ * @param p_fn {Function} The subscribed function to unsubscribe, if not
2115
+ * supplied, all subscribers will be removed.
2116
+ * @param p_obj {Object} The custom object passed to subscribe. This is
2117
+ * optional, but if supplied will be used to
2118
+ * disambiguate multiple listeners that are the same
2119
+ * (e.g., you subscribe many object using a function
2120
+ * that lives on the prototype)
2121
+ * @return {boolean} true if the subscriber was found and detached.
2122
+ */
2123
+ unsubscribe: function(p_type, p_fn, p_obj) {
2124
+ this.__yui_events = this.__yui_events || {};
2125
+ var evts = this.__yui_events;
2126
+ if (p_type) {
2127
+ var ce = evts[p_type];
2128
+ if (ce) {
2129
+ return ce.unsubscribe(p_fn, p_obj);
2130
+ }
2131
+ } else {
2132
+ var ret = true;
2133
+ for (var i in evts) {
2134
+ if (YAHOO.lang.hasOwnProperty(evts, i)) {
2135
+ ret = ret && evts[i].unsubscribe(p_fn, p_obj);
2136
+ }
2137
+ }
2138
+ return ret;
2139
+ }
2140
+
2141
+ return false;
2142
+ },
2143
+
2144
+ /**
2145
+ * Removes all listeners from the specified event. If the event type
2146
+ * is not specified, all listeners from all hosted custom events will
2147
+ * be removed.
2148
+ * @method unsubscribeAll
2149
+ * @param p_type {string} The type, or name of the event
2150
+ */
2151
+ unsubscribeAll: function(p_type) {
2152
+ return this.unsubscribe(p_type);
2153
+ },
2154
+
2155
+ /**
2156
+ * Creates a new custom event of the specified type. If a custom event
2157
+ * by that name already exists, it will not be re-created. In either
2158
+ * case the custom event is returned.
2159
+ *
2160
+ * @method createEvent
2161
+ *
2162
+ * @param p_type {string} the type, or name of the event
2163
+ * @param p_config {object} optional config params. Valid properties are:
2164
+ *
2165
+ * <ul>
2166
+ * <li>
2167
+ * scope: defines the default execution scope. If not defined
2168
+ * the default scope will be this instance.
2169
+ * </li>
2170
+ * <li>
2171
+ * silent: if true, the custom event will not generate log messages.
2172
+ * This is false by default.
2173
+ * </li>
2174
+ * <li>
2175
+ * fireOnce: if true, the custom event will only notify subscribers
2176
+ * once regardless of the number of times the event is fired. In
2177
+ * addition, new subscribers will be executed immediately if the
2178
+ * event has already fired.
2179
+ * This is false by default.
2180
+ * </li>
2181
+ * <li>
2182
+ * onSubscribeCallback: specifies a callback to execute when the
2183
+ * event has a new subscriber. This will fire immediately for
2184
+ * each queued subscriber if any exist prior to the creation of
2185
+ * the event.
2186
+ * </li>
2187
+ * </ul>
2188
+ *
2189
+ * @return {CustomEvent} the custom event
2190
+ *
2191
+ */
2192
+ createEvent: function(p_type, p_config) {
2193
+
2194
+ this.__yui_events = this.__yui_events || {};
2195
+ var opts = p_config || {},
2196
+ events = this.__yui_events, ce;
2197
+
2198
+ if (events[p_type]) {
2199
+ } else {
2200
+
2201
+ ce = new YAHOO.util.CustomEvent(p_type, opts.scope || this, opts.silent,
2202
+ YAHOO.util.CustomEvent.FLAT, opts.fireOnce);
2203
+
2204
+ events[p_type] = ce;
2205
+
2206
+ if (opts.onSubscribeCallback) {
2207
+ ce.subscribeEvent.subscribe(opts.onSubscribeCallback);
2208
+ }
2209
+
2210
+ this.__yui_subscribers = this.__yui_subscribers || {};
2211
+ var qs = this.__yui_subscribers[p_type];
2212
+
2213
+ if (qs) {
2214
+ for (var i=0; i<qs.length; ++i) {
2215
+ ce.subscribe(qs[i].fn, qs[i].obj, qs[i].overrideContext);
2216
+ }
2217
+ }
2218
+ }
2219
+
2220
+ return events[p_type];
2221
+ },
2222
+
2223
+
2224
+ /**
2225
+ * Fire a custom event by name. The callback functions will be executed
2226
+ * from the scope specified when the event was created, and with the
2227
+ * following parameters:
2228
+ * <ul>
2229
+ * <li>The first argument fire() was executed with</li>
2230
+ * <li>The custom object (if any) that was passed into the subscribe()
2231
+ * method</li>
2232
+ * </ul>
2233
+ * @method fireEvent
2234
+ * @param p_type {string} the type, or name of the event
2235
+ * @param arguments {Object*} an arbitrary set of parameters to pass to
2236
+ * the handler.
2237
+ * @return {boolean} the return value from CustomEvent.fire
2238
+ *
2239
+ */
2240
+ fireEvent: function(p_type) {
2241
+
2242
+ this.__yui_events = this.__yui_events || {};
2243
+ var ce = this.__yui_events[p_type];
2244
+
2245
+ if (!ce) {
2246
+ return null;
2247
+ }
2248
+
2249
+ var args = [];
2250
+ for (var i=1; i<arguments.length; ++i) {
2251
+ args.push(arguments[i]);
2252
+ }
2253
+ return ce.fire.apply(ce, args);
2254
+ },
2255
+
2256
+ /**
2257
+ * Returns true if the custom event of the provided type has been created
2258
+ * with createEvent.
2259
+ * @method hasEvent
2260
+ * @param type {string} the type, or name of the event
2261
+ */
2262
+ hasEvent: function(type) {
2263
+ if (this.__yui_events) {
2264
+ if (this.__yui_events[type]) {
2265
+ return true;
2266
+ }
2267
+ }
2268
+ return false;
2269
+ }
2270
+
2271
+ };
2272
+
2273
+ (function() {
2274
+
2275
+ var Event = YAHOO.util.Event, Lang = YAHOO.lang;
2276
+
2277
+ /**
2278
+ * KeyListener is a utility that provides an easy interface for listening for
2279
+ * keydown/keyup events fired against DOM elements.
2280
+ * @namespace YAHOO.util
2281
+ * @class KeyListener
2282
+ * @constructor
2283
+ * @param {HTMLElement} attachTo The element or element ID to which the key
2284
+ * event should be attached
2285
+ * @param {String} attachTo The element or element ID to which the key
2286
+ * event should be attached
2287
+ * @param {Object} keyData The object literal representing the key(s)
2288
+ * to detect. Possible attributes are
2289
+ * shift(boolean), alt(boolean), ctrl(boolean)
2290
+ * and keys(either an int or an array of ints
2291
+ * representing keycodes).
2292
+ * @param {Function} handler The CustomEvent handler to fire when the
2293
+ * key event is detected
2294
+ * @param {Object} handler An object literal representing the handler.
2295
+ * @param {String} event Optional. The event (keydown or keyup) to
2296
+ * listen for. Defaults automatically to keydown.
2297
+ *
2298
+ * @knownissue the "keypress" event is completely broken in Safari 2.x and below.
2299
+ * the workaround is use "keydown" for key listening. However, if
2300
+ * it is desired to prevent the default behavior of the keystroke,
2301
+ * that can only be done on the keypress event. This makes key
2302
+ * handling quite ugly.
2303
+ * @knownissue keydown is also broken in Safari 2.x and below for the ESC key.
2304
+ * There currently is no workaround other than choosing another
2305
+ * key to listen for.
2306
+ */
2307
+ YAHOO.util.KeyListener = function(attachTo, keyData, handler, event) {
2308
+ if (!attachTo) {
2309
+ } else if (!keyData) {
2310
+ } else if (!handler) {
2311
+ }
2312
+
2313
+ if (!event) {
2314
+ event = YAHOO.util.KeyListener.KEYDOWN;
2315
+ }
2316
+
2317
+ /**
2318
+ * The CustomEvent fired internally when a key is pressed
2319
+ * @event keyEvent
2320
+ * @private
2321
+ * @param {Object} keyData The object literal representing the key(s) to
2322
+ * detect. Possible attributes are shift(boolean),
2323
+ * alt(boolean), ctrl(boolean) and keys(either an
2324
+ * int or an array of ints representing keycodes).
2325
+ */
2326
+ var keyEvent = new YAHOO.util.CustomEvent("keyPressed");
2327
+
2328
+ /**
2329
+ * The CustomEvent fired when the KeyListener is enabled via the enable()
2330
+ * function
2331
+ * @event enabledEvent
2332
+ * @param {Object} keyData The object literal representing the key(s) to
2333
+ * detect. Possible attributes are shift(boolean),
2334
+ * alt(boolean), ctrl(boolean) and keys(either an
2335
+ * int or an array of ints representing keycodes).
2336
+ */
2337
+ this.enabledEvent = new YAHOO.util.CustomEvent("enabled");
2338
+
2339
+ /**
2340
+ * The CustomEvent fired when the KeyListener is disabled via the
2341
+ * disable() function
2342
+ * @event disabledEvent
2343
+ * @param {Object} keyData The object literal representing the key(s) to
2344
+ * detect. Possible attributes are shift(boolean),
2345
+ * alt(boolean), ctrl(boolean) and keys(either an
2346
+ * int or an array of ints representing keycodes).
2347
+ */
2348
+ this.disabledEvent = new YAHOO.util.CustomEvent("disabled");
2349
+
2350
+ if (Lang.isString(attachTo)) {
2351
+ attachTo = document.getElementById(attachTo); // No Dom util
2352
+ }
2353
+
2354
+ if (Lang.isFunction(handler)) {
2355
+ keyEvent.subscribe(handler);
2356
+ } else {
2357
+ keyEvent.subscribe(handler.fn, handler.scope, handler.correctScope);
2358
+ }
2359
+
2360
+ /**
2361
+ * Handles the key event when a key is pressed.
2362
+ * @method handleKeyPress
2363
+ * @param {DOMEvent} e The keypress DOM event
2364
+ * @param {Object} obj The DOM event scope object
2365
+ * @private
2366
+ */
2367
+ function handleKeyPress(e, obj) {
2368
+ if (! keyData.shift) {
2369
+ keyData.shift = false;
2370
+ }
2371
+ if (! keyData.alt) {
2372
+ keyData.alt = false;
2373
+ }
2374
+ if (! keyData.ctrl) {
2375
+ keyData.ctrl = false;
2376
+ }
2377
+
2378
+ // check held down modifying keys first
2379
+ if (e.shiftKey == keyData.shift &&
2380
+ e.altKey == keyData.alt &&
2381
+ e.ctrlKey == keyData.ctrl) { // if we pass this, all modifiers match
2382
+
2383
+ var dataItem, keys = keyData.keys, key;
2384
+
2385
+ if (YAHOO.lang.isArray(keys)) {
2386
+ for (var i=0;i<keys.length;i++) {
2387
+ dataItem = keys[i];
2388
+ key = Event.getCharCode(e);
2389
+
2390
+ if (dataItem == key) {
2391
+ keyEvent.fire(key, e);
2392
+ break;
2393
+ }
2394
+ }
2395
+ } else {
2396
+ key = Event.getCharCode(e);
2397
+ if (keys == key ) {
2398
+ keyEvent.fire(key, e);
2399
+ }
2400
+ }
2401
+ }
2402
+ }
2403
+
2404
+ /**
2405
+ * Enables the KeyListener by attaching the DOM event listeners to the
2406
+ * target DOM element
2407
+ * @method enable
2408
+ */
2409
+ this.enable = function() {
2410
+ if (! this.enabled) {
2411
+ Event.on(attachTo, event, handleKeyPress);
2412
+ this.enabledEvent.fire(keyData);
2413
+ }
2414
+ /**
2415
+ * Boolean indicating the enabled/disabled state of the Tooltip
2416
+ * @property enabled
2417
+ * @type Boolean
2418
+ */
2419
+ this.enabled = true;
2420
+ };
2421
+
2422
+ /**
2423
+ * Disables the KeyListener by removing the DOM event listeners from the
2424
+ * target DOM element
2425
+ * @method disable
2426
+ */
2427
+ this.disable = function() {
2428
+ if (this.enabled) {
2429
+ Event.removeListener(attachTo, event, handleKeyPress);
2430
+ this.disabledEvent.fire(keyData);
2431
+ }
2432
+ this.enabled = false;
2433
+ };
2434
+
2435
+ /**
2436
+ * Returns a String representation of the object.
2437
+ * @method toString
2438
+ * @return {String} The string representation of the KeyListener
2439
+ */
2440
+ this.toString = function() {
2441
+ return "KeyListener [" + keyData.keys + "] " + attachTo.tagName +
2442
+ (attachTo.id ? "[" + attachTo.id + "]" : "");
2443
+ };
2444
+
2445
+ };
2446
+
2447
+ var KeyListener = YAHOO.util.KeyListener;
2448
+
2449
+ /**
2450
+ * Constant representing the DOM "keydown" event.
2451
+ * @property YAHOO.util.KeyListener.KEYDOWN
2452
+ * @static
2453
+ * @final
2454
+ * @type String
2455
+ */
2456
+ KeyListener.KEYDOWN = "keydown";
2457
+
2458
+ /**
2459
+ * Constant representing the DOM "keyup" event.
2460
+ * @property YAHOO.util.KeyListener.KEYUP
2461
+ * @static
2462
+ * @final
2463
+ * @type String
2464
+ */
2465
+ KeyListener.KEYUP = "keyup";
2466
+
2467
+ /**
2468
+ * keycode constants for a subset of the special keys
2469
+ * @property KEY
2470
+ * @static
2471
+ * @final
2472
+ */
2473
+ KeyListener.KEY = {
2474
+ ALT : 18,
2475
+ BACK_SPACE : 8,
2476
+ CAPS_LOCK : 20,
2477
+ CONTROL : 17,
2478
+ DELETE : 46,
2479
+ DOWN : 40,
2480
+ END : 35,
2481
+ ENTER : 13,
2482
+ ESCAPE : 27,
2483
+ HOME : 36,
2484
+ LEFT : 37,
2485
+ META : 224,
2486
+ NUM_LOCK : 144,
2487
+ PAGE_DOWN : 34,
2488
+ PAGE_UP : 33,
2489
+ PAUSE : 19,
2490
+ PRINTSCREEN : 44,
2491
+ RIGHT : 39,
2492
+ SCROLL_LOCK : 145,
2493
+ SHIFT : 16,
2494
+ SPACE : 32,
2495
+ TAB : 9,
2496
+ UP : 38
2497
+ };
2498
+
2499
+ })();
2500
+ YAHOO.register("event", YAHOO.util.Event, {version: "2.8.1", build: "19"});