yui-rails-asset 2.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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,1576 @@
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
+ * The Connection Manager provides a simplified interface to the XMLHttpRequest
9
+ * object. It handles cross-browser instantiantion of XMLHttpRequest, negotiates the
10
+ * interactive states and server response, returning the results to a pre-defined
11
+ * callback you create.
12
+ *
13
+ * @namespace YAHOO.util
14
+ * @module connection
15
+ * @requires yahoo
16
+ * @requires event
17
+ */
18
+
19
+ /**
20
+ * The Connection Manager singleton provides methods for creating and managing
21
+ * asynchronous transactions.
22
+ *
23
+ * @class Connect
24
+ */
25
+
26
+ YAHOO.util.Connect =
27
+ {
28
+ /**
29
+ * @description Array of MSFT ActiveX ids for XMLHttpRequest.
30
+ * @property _msxml_progid
31
+ * @private
32
+ * @static
33
+ * @type array
34
+ */
35
+ _msxml_progid:[
36
+ 'Microsoft.XMLHTTP',
37
+ 'MSXML2.XMLHTTP.3.0',
38
+ 'MSXML2.XMLHTTP'
39
+ ],
40
+
41
+ /**
42
+ * @description Object literal of HTTP header(s)
43
+ * @property _http_header
44
+ * @private
45
+ * @static
46
+ * @type object
47
+ */
48
+ _http_headers:{},
49
+
50
+ /**
51
+ * @description Determines if HTTP headers are set.
52
+ * @property _has_http_headers
53
+ * @private
54
+ * @static
55
+ * @type boolean
56
+ */
57
+ _has_http_headers:false,
58
+
59
+ /**
60
+ * @description Determines if a default header of
61
+ * Content-Type of 'application/x-www-form-urlencoded'
62
+ * will be added to any client HTTP headers sent for POST
63
+ * transactions.
64
+ * @property _use_default_post_header
65
+ * @private
66
+ * @static
67
+ * @type boolean
68
+ */
69
+ _use_default_post_header:true,
70
+
71
+ /**
72
+ * @description The default header used for POST transactions.
73
+ * @property _default_post_header
74
+ * @private
75
+ * @static
76
+ * @type boolean
77
+ */
78
+ _default_post_header:'application/x-www-form-urlencoded; charset=UTF-8',
79
+
80
+ /**
81
+ * @description The default header used for transactions involving the
82
+ * use of HTML forms.
83
+ * @property _default_form_header
84
+ * @private
85
+ * @static
86
+ * @type boolean
87
+ */
88
+ _default_form_header:'application/x-www-form-urlencoded',
89
+
90
+ /**
91
+ * @description Determines if a default header of
92
+ * 'X-Requested-With: XMLHttpRequest'
93
+ * will be added to each transaction.
94
+ * @property _use_default_xhr_header
95
+ * @private
96
+ * @static
97
+ * @type boolean
98
+ */
99
+ _use_default_xhr_header:true,
100
+
101
+ /**
102
+ * @description The default header value for the label
103
+ * "X-Requested-With". This is sent with each
104
+ * transaction, by default, to identify the
105
+ * request as being made by YUI Connection Manager.
106
+ * @property _default_xhr_header
107
+ * @private
108
+ * @static
109
+ * @type boolean
110
+ */
111
+ _default_xhr_header:'XMLHttpRequest',
112
+
113
+ /**
114
+ * @description Determines if custom, default headers
115
+ * are set for each transaction.
116
+ * @property _has_default_header
117
+ * @private
118
+ * @static
119
+ * @type boolean
120
+ */
121
+ _has_default_headers:true,
122
+
123
+ /**
124
+ * @description Determines if custom, default headers
125
+ * are set for each transaction.
126
+ * @property _has_default_header
127
+ * @private
128
+ * @static
129
+ * @type boolean
130
+ */
131
+ _default_headers:{},
132
+
133
+ /**
134
+ * @description Collection of polling references to the polling mechanism in handleReadyState.
135
+ * @property _poll
136
+ * @private
137
+ * @static
138
+ * @type object
139
+ */
140
+ _poll:{},
141
+
142
+ /**
143
+ * @description Queue of timeout values for each transaction callback with a defined timeout value.
144
+ * @property _timeOut
145
+ * @private
146
+ * @static
147
+ * @type object
148
+ */
149
+ _timeOut:{},
150
+
151
+ /**
152
+ * @description The polling frequency, in milliseconds, for HandleReadyState.
153
+ * when attempting to determine a transaction's XHR readyState.
154
+ * The default is 50 milliseconds.
155
+ * @property _polling_interval
156
+ * @private
157
+ * @static
158
+ * @type int
159
+ */
160
+ _polling_interval:50,
161
+
162
+ /**
163
+ * @description A transaction counter that increments the transaction id for each transaction.
164
+ * @property _transaction_id
165
+ * @private
166
+ * @static
167
+ * @type int
168
+ */
169
+ _transaction_id:0,
170
+
171
+ /**
172
+ * @description Custom event that fires at the start of a transaction
173
+ * @property startEvent
174
+ * @private
175
+ * @static
176
+ * @type CustomEvent
177
+ */
178
+ startEvent: new YAHOO.util.CustomEvent('start'),
179
+
180
+ /**
181
+ * @description Custom event that fires when a transaction response has completed.
182
+ * @property completeEvent
183
+ * @private
184
+ * @static
185
+ * @type CustomEvent
186
+ */
187
+ completeEvent: new YAHOO.util.CustomEvent('complete'),
188
+
189
+ /**
190
+ * @description Custom event that fires when handleTransactionResponse() determines a
191
+ * response in the HTTP 2xx range.
192
+ * @property successEvent
193
+ * @private
194
+ * @static
195
+ * @type CustomEvent
196
+ */
197
+ successEvent: new YAHOO.util.CustomEvent('success'),
198
+
199
+ /**
200
+ * @description Custom event that fires when handleTransactionResponse() determines a
201
+ * response in the HTTP 4xx/5xx range.
202
+ * @property failureEvent
203
+ * @private
204
+ * @static
205
+ * @type CustomEvent
206
+ */
207
+ failureEvent: new YAHOO.util.CustomEvent('failure'),
208
+
209
+ /**
210
+ * @description Custom event that fires when a transaction is successfully aborted.
211
+ * @property abortEvent
212
+ * @private
213
+ * @static
214
+ * @type CustomEvent
215
+ */
216
+ abortEvent: new YAHOO.util.CustomEvent('abort'),
217
+
218
+ /**
219
+ * @description A reference table that maps callback custom events members to its specific
220
+ * event name.
221
+ * @property _customEvents
222
+ * @private
223
+ * @static
224
+ * @type object
225
+ */
226
+ _customEvents:
227
+ {
228
+ onStart:['startEvent', 'start'],
229
+ onComplete:['completeEvent', 'complete'],
230
+ onSuccess:['successEvent', 'success'],
231
+ onFailure:['failureEvent', 'failure'],
232
+ onUpload:['uploadEvent', 'upload'],
233
+ onAbort:['abortEvent', 'abort']
234
+ },
235
+
236
+ /**
237
+ * @description Member to add an ActiveX id to the existing xml_progid array.
238
+ * In the event(unlikely) a new ActiveX id is introduced, it can be added
239
+ * without internal code modifications.
240
+ * @method setProgId
241
+ * @public
242
+ * @static
243
+ * @param {string} id The ActiveX id to be added to initialize the XHR object.
244
+ * @return void
245
+ */
246
+ setProgId:function(id)
247
+ {
248
+ this._msxml_progid.unshift(id);
249
+ YAHOO.log('ActiveX Program Id ' + id + ' added to _msxml_progid.', 'info', 'Connection');
250
+ },
251
+
252
+ /**
253
+ * @description Member to override the default POST header.
254
+ * @method setDefaultPostHeader
255
+ * @public
256
+ * @static
257
+ * @param {boolean} b Set and use default header - true or false .
258
+ * @return void
259
+ */
260
+ setDefaultPostHeader:function(b)
261
+ {
262
+ if(typeof b == 'string'){
263
+ this._default_post_header = b;
264
+ YAHOO.log('Default POST header set to ' + b, 'info', 'Connection');
265
+ }
266
+ else if(typeof b == 'boolean'){
267
+ this._use_default_post_header = b;
268
+ }
269
+ },
270
+
271
+ /**
272
+ * @description Member to override the default transaction header..
273
+ * @method setDefaultXhrHeader
274
+ * @public
275
+ * @static
276
+ * @param {boolean} b Set and use default header - true or false .
277
+ * @return void
278
+ */
279
+ setDefaultXhrHeader:function(b)
280
+ {
281
+ if(typeof b == 'string'){
282
+ this._default_xhr_header = b;
283
+ YAHOO.log('Default XHR header set to ' + b, 'info', 'Connection');
284
+ }
285
+ else{
286
+ this._use_default_xhr_header = b;
287
+ }
288
+ },
289
+
290
+ /**
291
+ * @description Member to modify the default polling interval.
292
+ * @method setPollingInterval
293
+ * @public
294
+ * @static
295
+ * @param {int} i The polling interval in milliseconds.
296
+ * @return void
297
+ */
298
+ setPollingInterval:function(i)
299
+ {
300
+ if(typeof i == 'number' && isFinite(i)){
301
+ this._polling_interval = i;
302
+ YAHOO.log('Default polling interval set to ' + i +'ms', 'info', 'Connection');
303
+ }
304
+ },
305
+
306
+ /**
307
+ * @description Instantiates a XMLHttpRequest object and returns an object with two properties:
308
+ * the XMLHttpRequest instance and the transaction id.
309
+ * @method createXhrObject
310
+ * @private
311
+ * @static
312
+ * @param {int} transactionId Property containing the transaction id for this transaction.
313
+ * @return object
314
+ */
315
+ createXhrObject:function(transactionId)
316
+ {
317
+ var obj,http,i;
318
+ try
319
+ {
320
+ // Instantiates XMLHttpRequest in non-IE browsers and assigns to http.
321
+ http = new XMLHttpRequest();
322
+ // Object literal with http and tId properties
323
+ obj = { conn:http, tId:transactionId, xhr: true };
324
+ YAHOO.log('XHR object created for transaction ' + transactionId, 'info', 'Connection');
325
+ }
326
+ catch(e)
327
+ {
328
+ for(i=0; i<this._msxml_progid.length; ++i){
329
+ try
330
+ {
331
+ // Instantiates XMLHttpRequest for IE and assign to http
332
+ http = new ActiveXObject(this._msxml_progid[i]);
333
+ // Object literal with conn and tId properties
334
+ obj = { conn:http, tId:transactionId, xhr: true };
335
+ YAHOO.log('ActiveX XHR object created for transaction ' + transactionId, 'info', 'Connection');
336
+ break;
337
+ }
338
+ catch(e1){}
339
+ }
340
+ }
341
+ finally
342
+ {
343
+ return obj;
344
+ }
345
+ },
346
+
347
+ /**
348
+ * @description This method is called by asyncRequest to create a
349
+ * valid connection object for the transaction. It also passes a
350
+ * transaction id and increments the transaction id counter.
351
+ * @method getConnectionObject
352
+ * @private
353
+ * @static
354
+ * @return {object}
355
+ */
356
+ getConnectionObject:function(t)
357
+ {
358
+ var o, tId = this._transaction_id;
359
+
360
+ try
361
+ {
362
+ if(!t){
363
+ o = this.createXhrObject(tId);
364
+ }
365
+ else{
366
+ o = {tId:tId};
367
+ if(t==='xdr'){
368
+ o.conn = this._transport;
369
+ o.xdr = true;
370
+ }
371
+ else if(t==='upload'){
372
+ o.upload = true;
373
+ }
374
+ }
375
+
376
+ if(o){
377
+ this._transaction_id++;
378
+ }
379
+ }
380
+ catch(e){}
381
+ return o;
382
+ },
383
+
384
+ /**
385
+ * @description Method for initiating an asynchronous request via the XHR object.
386
+ * @method asyncRequest
387
+ * @public
388
+ * @static
389
+ * @param {string} method HTTP transaction method
390
+ * @param {string} uri Fully qualified path of resource
391
+ * @param {callback} callback User-defined callback function or object
392
+ * @param {string} postData POST body
393
+ * @return {object} Returns the connection object
394
+ */
395
+ asyncRequest:function(method, uri, callback, postData)
396
+ {
397
+ var o,t,args = (callback && callback.argument)?callback.argument:null;
398
+
399
+ if(this._isFileUpload){
400
+ t = 'upload';
401
+ }
402
+ else if(callback.xdr){
403
+ t = 'xdr';
404
+ }
405
+
406
+ o = this.getConnectionObject(t);
407
+ if(!o){
408
+ YAHOO.log('Unable to create connection object.', 'error', 'Connection');
409
+ return null;
410
+ }
411
+ else{
412
+
413
+ // Intialize any transaction-specific custom events, if provided.
414
+ if(callback && callback.customevents){
415
+ this.initCustomEvents(o, callback);
416
+ }
417
+
418
+ if(this._isFormSubmit){
419
+ if(this._isFileUpload){
420
+ this.uploadFile(o, callback, uri, postData);
421
+ return o;
422
+ }
423
+
424
+ // If the specified HTTP method is GET, setForm() will return an
425
+ // encoded string that is concatenated to the uri to
426
+ // create a querystring.
427
+ if(method.toUpperCase() == 'GET'){
428
+ if(this._sFormData.length !== 0){
429
+ // If the URI already contains a querystring, append an ampersand
430
+ // and then concatenate _sFormData to the URI.
431
+ uri += ((uri.indexOf('?') == -1)?'?':'&') + this._sFormData;
432
+ }
433
+ }
434
+ else if(method.toUpperCase() == 'POST'){
435
+ // If POST data exist in addition to the HTML form data,
436
+ // it will be concatenated to the form data.
437
+ postData = postData?this._sFormData + "&" + postData:this._sFormData;
438
+ }
439
+ }
440
+
441
+ if(method.toUpperCase() == 'GET' && (callback && callback.cache === false)){
442
+ // If callback.cache is defined and set to false, a
443
+ // timestamp value will be added to the querystring.
444
+ uri += ((uri.indexOf('?') == -1)?'?':'&') + "rnd=" + new Date().valueOf().toString();
445
+ }
446
+
447
+ // Each transaction will automatically include a custom header of
448
+ // "X-Requested-With: XMLHttpRequest" to identify the request as
449
+ // having originated from Connection Manager.
450
+ if(this._use_default_xhr_header){
451
+ if(!this._default_headers['X-Requested-With']){
452
+ this.initHeader('X-Requested-With', this._default_xhr_header, true);
453
+ YAHOO.log('Initialize transaction header X-Request-Header to XMLHttpRequest.', 'info', 'Connection');
454
+ }
455
+ }
456
+
457
+ //If the transaction method is POST and the POST header value is set to true
458
+ //or a custom value, initalize the Content-Type header to this value.
459
+ if((method.toUpperCase() === 'POST' && this._use_default_post_header) && this._isFormSubmit === false){
460
+ this.initHeader('Content-Type', this._default_post_header);
461
+ YAHOO.log('Initialize header Content-Type to application/x-www-form-urlencoded; UTF-8 for POST transaction.', 'info', 'Connection');
462
+ }
463
+
464
+ if(o.xdr){
465
+ this.xdr(o, method, uri, callback, postData);
466
+ return o;
467
+ }
468
+
469
+ o.conn.open(method, uri, true);
470
+ //Initialize all default and custom HTTP headers,
471
+ if(this._has_default_headers || this._has_http_headers){
472
+ this.setHeader(o);
473
+ }
474
+
475
+ this.handleReadyState(o, callback);
476
+ o.conn.send(postData || '');
477
+ YAHOO.log('Transaction ' + o.tId + ' sent.', 'info', 'Connection');
478
+
479
+ // Reset the HTML form data and state properties as
480
+ // soon as the data are submitted.
481
+ if(this._isFormSubmit === true){
482
+ this.resetFormState();
483
+ }
484
+
485
+ // Fire global custom event -- startEvent
486
+ this.startEvent.fire(o, args);
487
+
488
+ if(o.startEvent){
489
+ // Fire transaction custom event -- startEvent
490
+ o.startEvent.fire(o, args);
491
+ }
492
+
493
+ return o;
494
+ }
495
+ },
496
+
497
+ /**
498
+ * @description This method creates and subscribes custom events,
499
+ * specific to each transaction
500
+ * @method initCustomEvents
501
+ * @private
502
+ * @static
503
+ * @param {object} o The connection object
504
+ * @param {callback} callback The user-defined callback object
505
+ * @return {void}
506
+ */
507
+ initCustomEvents:function(o, callback)
508
+ {
509
+ var prop;
510
+ // Enumerate through callback.customevents members and bind/subscribe
511
+ // events that match in the _customEvents table.
512
+ for(prop in callback.customevents){
513
+ if(this._customEvents[prop][0]){
514
+ // Create the custom event
515
+ o[this._customEvents[prop][0]] = new YAHOO.util.CustomEvent(this._customEvents[prop][1], (callback.scope)?callback.scope:null);
516
+ YAHOO.log('Transaction-specific Custom Event ' + o[this._customEvents[prop][1]] + ' created.', 'info', 'Connection');
517
+
518
+ // Subscribe the custom event
519
+ o[this._customEvents[prop][0]].subscribe(callback.customevents[prop]);
520
+ YAHOO.log('Transaction-specific Custom Event ' + o[this._customEvents[prop][1]] + ' subscribed.', 'info', 'Connection');
521
+ }
522
+ }
523
+ },
524
+
525
+ /**
526
+ * @description This method serves as a timer that polls the XHR object's readyState
527
+ * property during a transaction, instead of binding a callback to the
528
+ * onreadystatechange event. Upon readyState 4, handleTransactionResponse
529
+ * will process the response, and the timer will be cleared.
530
+ * @method handleReadyState
531
+ * @private
532
+ * @static
533
+ * @param {object} o The connection object
534
+ * @param {callback} callback The user-defined callback object
535
+ * @return {void}
536
+ */
537
+
538
+ handleReadyState:function(o, callback)
539
+
540
+ {
541
+ var oConn = this,
542
+ args = (callback && callback.argument)?callback.argument:null;
543
+
544
+ if(callback && callback.timeout){
545
+ this._timeOut[o.tId] = window.setTimeout(function(){ oConn.abort(o, callback, true); }, callback.timeout);
546
+ }
547
+
548
+ this._poll[o.tId] = window.setInterval(
549
+ function(){
550
+ if(o.conn && o.conn.readyState === 4){
551
+
552
+ // Clear the polling interval for the transaction
553
+ // and remove the reference from _poll.
554
+ window.clearInterval(oConn._poll[o.tId]);
555
+ delete oConn._poll[o.tId];
556
+
557
+ if(callback && callback.timeout){
558
+ window.clearTimeout(oConn._timeOut[o.tId]);
559
+ delete oConn._timeOut[o.tId];
560
+ }
561
+
562
+ // Fire global custom event -- completeEvent
563
+ oConn.completeEvent.fire(o, args);
564
+
565
+ if(o.completeEvent){
566
+ // Fire transaction custom event -- completeEvent
567
+ o.completeEvent.fire(o, args);
568
+ }
569
+
570
+ oConn.handleTransactionResponse(o, callback);
571
+ }
572
+ }
573
+ ,this._polling_interval);
574
+ },
575
+
576
+ /**
577
+ * @description This method attempts to interpret the server response and
578
+ * determine whether the transaction was successful, or if an error or
579
+ * exception was encountered.
580
+ * @method handleTransactionResponse
581
+ * @private
582
+ * @static
583
+ * @param {object} o The connection object
584
+ * @param {object} callback The user-defined callback object
585
+ * @param {boolean} isAbort Determines if the transaction was terminated via abort().
586
+ * @return {void}
587
+ */
588
+ handleTransactionResponse:function(o, callback, isAbort)
589
+ {
590
+ var httpStatus, responseObject,
591
+ args = (callback && callback.argument)?callback.argument:null,
592
+ xdrS = (o.r && o.r.statusText === 'xdr:success')?true:false,
593
+ xdrF = (o.r && o.r.statusText === 'xdr:failure')?true:false,
594
+ xdrA = isAbort;
595
+
596
+ try
597
+ {
598
+ if((o.conn.status !== undefined && o.conn.status !== 0) || xdrS){
599
+ // XDR requests will not have HTTP status defined. The
600
+ // statusText property will define the response status
601
+ // set by the Flash transport.
602
+ httpStatus = o.conn.status;
603
+ }
604
+ else if(xdrF && !xdrA){
605
+ // Set XDR transaction failure to a status of 0, which
606
+ // resolves as an HTTP failure, instead of an exception.
607
+ httpStatus = 0;
608
+ }
609
+ else{
610
+ httpStatus = 13030;
611
+ }
612
+ }
613
+ catch(e){
614
+
615
+ // 13030 is a custom code to indicate the condition -- in Mozilla/FF --
616
+ // when the XHR object's status and statusText properties are
617
+ // unavailable, and a query attempt throws an exception.
618
+ httpStatus = 13030;
619
+ }
620
+
621
+ if((httpStatus >= 200 && httpStatus < 300) || httpStatus === 1223 || xdrS){
622
+ responseObject = o.xdr ? o.r : this.createResponseObject(o, args);
623
+ if(callback && callback.success){
624
+ if(!callback.scope){
625
+ callback.success(responseObject);
626
+ YAHOO.log('Success callback. HTTP code is ' + httpStatus, 'info', 'Connection');
627
+ }
628
+ else{
629
+ // If a scope property is defined, the callback will be fired from
630
+ // the context of the object.
631
+ callback.success.apply(callback.scope, [responseObject]);
632
+ YAHOO.log('Success callback with scope. HTTP code is ' + httpStatus, 'info', 'Connection');
633
+ }
634
+ }
635
+
636
+ // Fire global custom event -- successEvent
637
+ this.successEvent.fire(responseObject);
638
+
639
+ if(o.successEvent){
640
+ // Fire transaction custom event -- successEvent
641
+ o.successEvent.fire(responseObject);
642
+ }
643
+ }
644
+ else{
645
+ switch(httpStatus){
646
+ // The following cases are wininet.dll error codes that may be encountered.
647
+ case 12002: // Server timeout
648
+ case 12029: // 12029 to 12031 correspond to dropped connections.
649
+ case 12030:
650
+ case 12031:
651
+ case 12152: // Connection closed by server.
652
+ case 13030: // See above comments for variable status.
653
+ // XDR transactions will not resolve to this case, since the
654
+ // response object is already built in the xdr response.
655
+ responseObject = this.createExceptionObject(o.tId, args, (isAbort?isAbort:false));
656
+ if(callback && callback.failure){
657
+ if(!callback.scope){
658
+ callback.failure(responseObject);
659
+ YAHOO.log('Failure callback. Exception detected. Status code is ' + httpStatus, 'warn', 'Connection');
660
+ }
661
+ else{
662
+ callback.failure.apply(callback.scope, [responseObject]);
663
+ YAHOO.log('Failure callback with scope. Exception detected. Status code is ' + httpStatus, 'warn', 'Connection');
664
+ }
665
+ }
666
+
667
+ break;
668
+ default:
669
+ responseObject = (o.xdr) ? o.response : this.createResponseObject(o, args);
670
+ if(callback && callback.failure){
671
+ if(!callback.scope){
672
+ callback.failure(responseObject);
673
+ YAHOO.log('Failure callback. HTTP status code is ' + httpStatus, 'warn', 'Connection');
674
+ }
675
+ else{
676
+ callback.failure.apply(callback.scope, [responseObject]);
677
+ YAHOO.log('Failure callback with scope. HTTP status code is ' + httpStatus, 'warn', 'Connection');
678
+ }
679
+ }
680
+ }
681
+
682
+ // Fire global custom event -- failureEvent
683
+ this.failureEvent.fire(responseObject);
684
+
685
+ if(o.failureEvent){
686
+ // Fire transaction custom event -- failureEvent
687
+ o.failureEvent.fire(responseObject);
688
+ }
689
+
690
+ }
691
+
692
+ this.releaseObject(o);
693
+ responseObject = null;
694
+ },
695
+
696
+ /**
697
+ * @description This method evaluates the server response, creates and returns the results via
698
+ * its properties. Success and failure cases will differ in the response
699
+ * object's property values.
700
+ * @method createResponseObject
701
+ * @private
702
+ * @static
703
+ * @param {object} o The connection object
704
+ * @param {callbackArg} callbackArg The user-defined argument or arguments to be passed to the callback
705
+ * @return {object}
706
+ */
707
+ createResponseObject:function(o, callbackArg)
708
+ {
709
+ var obj = {}, headerObj = {},
710
+ i, headerStr, header, delimitPos;
711
+
712
+ try
713
+ {
714
+ headerStr = o.conn.getAllResponseHeaders();
715
+ header = headerStr.split('\n');
716
+ for(i=0; i<header.length; i++){
717
+ delimitPos = header[i].indexOf(':');
718
+ if(delimitPos != -1){
719
+ headerObj[header[i].substring(0,delimitPos)] = YAHOO.lang.trim(header[i].substring(delimitPos+2));
720
+ }
721
+ }
722
+ }
723
+ catch(e){}
724
+
725
+ obj.tId = o.tId;
726
+ // Normalize IE's response to HTTP 204 when Win error 1223.
727
+ obj.status = (o.conn.status == 1223)?204:o.conn.status;
728
+ // Normalize IE's statusText to "No Content" instead of "Unknown".
729
+ obj.statusText = (o.conn.status == 1223)?"No Content":o.conn.statusText;
730
+ obj.getResponseHeader = headerObj;
731
+ obj.getAllResponseHeaders = headerStr;
732
+ obj.responseText = o.conn.responseText;
733
+ obj.responseXML = o.conn.responseXML;
734
+
735
+ if(callbackArg){
736
+ obj.argument = callbackArg;
737
+ }
738
+
739
+ return obj;
740
+ },
741
+
742
+ /**
743
+ * @description If a transaction cannot be completed due to dropped or closed connections,
744
+ * there may be not be enough information to build a full response object.
745
+ * The failure callback will be fired and this specific condition can be identified
746
+ * by a status property value of 0.
747
+ *
748
+ * If an abort was successful, the status property will report a value of -1.
749
+ *
750
+ * @method createExceptionObject
751
+ * @private
752
+ * @static
753
+ * @param {int} tId The Transaction Id
754
+ * @param {callbackArg} callbackArg The user-defined argument or arguments to be passed to the callback
755
+ * @param {boolean} isAbort Determines if the exception case is caused by a transaction abort
756
+ * @return {object}
757
+ */
758
+ createExceptionObject:function(tId, callbackArg, isAbort)
759
+ {
760
+ var COMM_CODE = 0,
761
+ COMM_ERROR = 'communication failure',
762
+ ABORT_CODE = -1,
763
+ ABORT_ERROR = 'transaction aborted',
764
+ obj = {};
765
+
766
+ obj.tId = tId;
767
+ if(isAbort){
768
+ obj.status = ABORT_CODE;
769
+ obj.statusText = ABORT_ERROR;
770
+ }
771
+ else{
772
+ obj.status = COMM_CODE;
773
+ obj.statusText = COMM_ERROR;
774
+ }
775
+
776
+ if(callbackArg){
777
+ obj.argument = callbackArg;
778
+ }
779
+
780
+ return obj;
781
+ },
782
+
783
+ /**
784
+ * @description Method that initializes the custom HTTP headers for the each transaction.
785
+ * @method initHeader
786
+ * @public
787
+ * @static
788
+ * @param {string} label The HTTP header label
789
+ * @param {string} value The HTTP header value
790
+ * @param {string} isDefault Determines if the specific header is a default header
791
+ * automatically sent with each transaction.
792
+ * @return {void}
793
+ */
794
+ initHeader:function(label, value, isDefault)
795
+ {
796
+ var headerObj = (isDefault)?this._default_headers:this._http_headers;
797
+
798
+ headerObj[label] = value;
799
+ if(isDefault){
800
+ this._has_default_headers = true;
801
+ }
802
+ else{
803
+ this._has_http_headers = true;
804
+ }
805
+ },
806
+
807
+
808
+ /**
809
+ * @description Accessor that sets the HTTP headers for each transaction.
810
+ * @method setHeader
811
+ * @private
812
+ * @static
813
+ * @param {object} o The connection object for the transaction.
814
+ * @return {void}
815
+ */
816
+ setHeader:function(o)
817
+ {
818
+ var prop;
819
+ if(this._has_default_headers){
820
+ for(prop in this._default_headers){
821
+ if(YAHOO.lang.hasOwnProperty(this._default_headers, prop)){
822
+ o.conn.setRequestHeader(prop, this._default_headers[prop]);
823
+ YAHOO.log('Default HTTP header ' + prop + ' set with value of ' + this._default_headers[prop], 'info', 'Connection');
824
+ }
825
+ }
826
+ }
827
+
828
+ if(this._has_http_headers){
829
+ for(prop in this._http_headers){
830
+ if(YAHOO.lang.hasOwnProperty(this._http_headers, prop)){
831
+ o.conn.setRequestHeader(prop, this._http_headers[prop]);
832
+ YAHOO.log('HTTP header ' + prop + ' set with value of ' + this._http_headers[prop], 'info', 'Connection');
833
+ }
834
+ }
835
+
836
+ this._http_headers = {};
837
+ this._has_http_headers = false;
838
+ }
839
+ },
840
+
841
+ /**
842
+ * @description Resets the default HTTP headers object
843
+ * @method resetDefaultHeaders
844
+ * @public
845
+ * @static
846
+ * @return {void}
847
+ */
848
+ resetDefaultHeaders:function(){
849
+ this._default_headers = {};
850
+ this._has_default_headers = false;
851
+ },
852
+
853
+ /**
854
+ * @description Method to terminate a transaction, if it has not reached readyState 4.
855
+ * @method abort
856
+ * @public
857
+ * @static
858
+ * @param {object} o The connection object returned by asyncRequest.
859
+ * @param {object} callback User-defined callback object.
860
+ * @param {string} isTimeout boolean to indicate if abort resulted from a callback timeout.
861
+ * @return {boolean}
862
+ */
863
+ abort:function(o, callback, isTimeout)
864
+ {
865
+ var abortStatus,
866
+ args = (callback && callback.argument)?callback.argument:null;
867
+ o = o || {};
868
+
869
+ if(o.conn){
870
+ if(o.xhr){
871
+ if(this.isCallInProgress(o)){
872
+ // Issue abort request
873
+ o.conn.abort();
874
+
875
+ window.clearInterval(this._poll[o.tId]);
876
+ delete this._poll[o.tId];
877
+
878
+ if(isTimeout){
879
+ window.clearTimeout(this._timeOut[o.tId]);
880
+ delete this._timeOut[o.tId];
881
+ }
882
+
883
+ abortStatus = true;
884
+ }
885
+ }
886
+ else if(o.xdr){
887
+ o.conn.abort(o.tId);
888
+ abortStatus = true;
889
+ }
890
+ }
891
+ else if(o.upload){
892
+ var frameId = 'yuiIO' + o.tId;
893
+ var io = document.getElementById(frameId);
894
+
895
+ if(io){
896
+ // Remove all listeners on the iframe prior to
897
+ // its destruction.
898
+ YAHOO.util.Event.removeListener(io, "load");
899
+ // Destroy the iframe facilitating the transaction.
900
+ document.body.removeChild(io);
901
+ YAHOO.log('File upload iframe destroyed. Id is:' + frameId, 'info', 'Connection');
902
+
903
+ if(isTimeout){
904
+ window.clearTimeout(this._timeOut[o.tId]);
905
+ delete this._timeOut[o.tId];
906
+ }
907
+
908
+ abortStatus = true;
909
+ }
910
+ }
911
+ else{
912
+ abortStatus = false;
913
+ }
914
+
915
+ if(abortStatus === true){
916
+ // Fire global custom event -- abortEvent
917
+ this.abortEvent.fire(o, args);
918
+
919
+ if(o.abortEvent){
920
+ // Fire transaction custom event -- abortEvent
921
+ o.abortEvent.fire(o, args);
922
+ }
923
+
924
+ this.handleTransactionResponse(o, callback, true);
925
+ YAHOO.log('Transaction ' + o.tId + ' aborted.', 'info', 'Connection');
926
+ }
927
+
928
+ return abortStatus;
929
+ },
930
+
931
+ /**
932
+ * @description Determines if the transaction is still being processed.
933
+ * @method isCallInProgress
934
+ * @public
935
+ * @static
936
+ * @param {object} o The connection object returned by asyncRequest
937
+ * @return {boolean}
938
+ */
939
+ isCallInProgress:function(o)
940
+ {
941
+ o = o || {};
942
+ // if the XHR object assigned to the transaction has not been dereferenced,
943
+ // then check its readyState status. Otherwise, return false.
944
+ if(o.xhr && o.conn){
945
+ return o.conn.readyState !== 4 && o.conn.readyState !== 0;
946
+ }
947
+ else if(o.xdr && o.conn){
948
+ return o.conn.isCallInProgress(o.tId);
949
+ }
950
+ else if(o.upload === true){
951
+ return document.getElementById('yuiIO' + o.tId)?true:false;
952
+ }
953
+ else{
954
+ return false;
955
+ }
956
+ },
957
+
958
+ /**
959
+ * @description Dereference the XHR instance and the connection object after the transaction is completed.
960
+ * @method releaseObject
961
+ * @private
962
+ * @static
963
+ * @param {object} o The connection object
964
+ * @return {void}
965
+ */
966
+ releaseObject:function(o)
967
+ {
968
+ if(o && o.conn){
969
+ //dereference the XHR instance.
970
+ o.conn = null;
971
+
972
+ YAHOO.log('Connection object for transaction ' + o.tId + ' destroyed.', 'info', 'Connection');
973
+
974
+ //dereference the connection object.
975
+ o = null;
976
+ }
977
+ }
978
+ };
979
+
980
+ /**
981
+ * @for Connect
982
+ */
983
+ (function() {
984
+ var YCM = YAHOO.util.Connect, _fn = {};
985
+
986
+ /**
987
+ * @description This method creates and instantiates the Flash transport.
988
+ * @method _swf
989
+ * @private
990
+ * @static
991
+ * @param {string} URI to connection.swf.
992
+ * @return {void}
993
+ */
994
+ function _swf(uri) {
995
+ var o = '<object id="YUIConnectionSwf" type="application/x-shockwave-flash" data="' +
996
+ uri + '" width="0" height="0">' +
997
+ '<param name="movie" value="' + uri + '">' +
998
+ '<param name="allowScriptAccess" value="always">' +
999
+ '</object>',
1000
+ c = document.createElement('div');
1001
+
1002
+ document.body.appendChild(c);
1003
+ c.innerHTML = o;
1004
+ }
1005
+
1006
+ /**
1007
+ * @description This method calls the public method on the
1008
+ * Flash transport to start the XDR transaction. It is analogous
1009
+ * to Connection Manager's asyncRequest method.
1010
+ * @method xdr
1011
+ * @private
1012
+ * @static
1013
+ * @param {object} The transaction object.
1014
+ * @param {string} HTTP request method.
1015
+ * @param {string} URI for the transaction.
1016
+ * @param {object} The transaction's callback object.
1017
+ * @param {object} The JSON object used as HTTP POST data.
1018
+ * @return {void}
1019
+ */
1020
+ function _xdr(o, m, u, c, d) {
1021
+ _fn[parseInt(o.tId)] = { 'o':o, 'c':c };
1022
+ if (d) {
1023
+ c.method = m;
1024
+ c.data = d;
1025
+ }
1026
+
1027
+ o.conn.send(u, c, o.tId);
1028
+ }
1029
+
1030
+ /**
1031
+ * @description This method instantiates the Flash transport and
1032
+ * establishes a static reference to it, used for all XDR requests.
1033
+ * @method transport
1034
+ * @public
1035
+ * @static
1036
+ * @param {string} URI to connection.swf.
1037
+ * @return {void}
1038
+ */
1039
+ function _init(uri) {
1040
+ _swf(uri);
1041
+ YCM._transport = document.getElementById('YUIConnectionSwf');
1042
+ }
1043
+
1044
+ function _xdrReady() {
1045
+ YCM.xdrReadyEvent.fire();
1046
+ }
1047
+
1048
+ /**
1049
+ * @description This method fires the global and transaction start
1050
+ * events.
1051
+ * @method _xdrStart
1052
+ * @private
1053
+ * @static
1054
+ * @param {object} The transaction object.
1055
+ * @param {string} The transaction's callback object.
1056
+ * @return {void}
1057
+ */
1058
+ function _xdrStart(o, cb) {
1059
+ if (o) {
1060
+ // Fire global custom event -- startEvent
1061
+ YCM.startEvent.fire(o, cb.argument);
1062
+
1063
+ if(o.startEvent){
1064
+ // Fire transaction custom event -- startEvent
1065
+ o.startEvent.fire(o, cb.argument);
1066
+ }
1067
+ }
1068
+ }
1069
+
1070
+ /**
1071
+ * @description This method is the initial response handler
1072
+ * for XDR transactions. The Flash transport calls this
1073
+ * function and sends the response payload.
1074
+ * @method handleXdrResponse
1075
+ * @private
1076
+ * @static
1077
+ * @param {object} The response object sent from the Flash transport.
1078
+ * @return {void}
1079
+ */
1080
+ function _handleXdrResponse(r) {
1081
+ var o = _fn[r.tId].o,
1082
+ cb = _fn[r.tId].c;
1083
+
1084
+ if (r.statusText === 'xdr:start') {
1085
+ _xdrStart(o, cb);
1086
+ return;
1087
+ }
1088
+
1089
+ r.responseText = decodeURI(r.responseText);
1090
+ o.r = r;
1091
+ if (cb.argument) {
1092
+ o.r.argument = cb.argument;
1093
+ }
1094
+
1095
+ this.handleTransactionResponse(o, cb, r.statusText === 'xdr:abort' ? true : false);
1096
+ delete _fn[r.tId];
1097
+ }
1098
+
1099
+ // Bind the functions to Connection Manager as static fields.
1100
+ YCM.xdr = _xdr;
1101
+ YCM.swf = _swf;
1102
+ YCM.transport = _init;
1103
+ YCM.xdrReadyEvent = new YAHOO.util.CustomEvent('xdrReady');
1104
+ YCM.xdrReady = _xdrReady;
1105
+ YCM.handleXdrResponse = _handleXdrResponse;
1106
+ })();
1107
+
1108
+ /**
1109
+ * @for Connect
1110
+ */
1111
+ (function(){
1112
+ var YCM = YAHOO.util.Connect,
1113
+ YE = YAHOO.util.Event;
1114
+ /**
1115
+ * @description Property modified by setForm() to determine if the data
1116
+ * should be submitted as an HTML form.
1117
+ * @property _isFormSubmit
1118
+ * @private
1119
+ * @static
1120
+ * @type boolean
1121
+ */
1122
+ YCM._isFormSubmit = false;
1123
+
1124
+ /**
1125
+ * @description Property modified by setForm() to determine if a file(s)
1126
+ * upload is expected.
1127
+ * @property _isFileUpload
1128
+ * @private
1129
+ * @static
1130
+ * @type boolean
1131
+ */
1132
+ YCM._isFileUpload = false;
1133
+
1134
+ /**
1135
+ * @description Property modified by setForm() to set a reference to the HTML
1136
+ * form node if the desired action is file upload.
1137
+ * @property _formNode
1138
+ * @private
1139
+ * @static
1140
+ * @type object
1141
+ */
1142
+ YCM._formNode = null;
1143
+
1144
+ /**
1145
+ * @description Property modified by setForm() to set the HTML form data
1146
+ * for each transaction.
1147
+ * @property _sFormData
1148
+ * @private
1149
+ * @static
1150
+ * @type string
1151
+ */
1152
+ YCM._sFormData = null;
1153
+
1154
+ /**
1155
+ * @description Tracks the name-value pair of the "clicked" submit button if multiple submit
1156
+ * buttons are present in an HTML form; and, if YAHOO.util.Event is available.
1157
+ * @property _submitElementValue
1158
+ * @private
1159
+ * @static
1160
+ * @type string
1161
+ */
1162
+ YCM._submitElementValue = null;
1163
+
1164
+ /**
1165
+ * @description Custom event that fires when handleTransactionResponse() determines a
1166
+ * response in the HTTP 4xx/5xx range.
1167
+ * @property failureEvent
1168
+ * @private
1169
+ * @static
1170
+ * @type CustomEvent
1171
+ */
1172
+ YCM.uploadEvent = new YAHOO.util.CustomEvent('upload'),
1173
+
1174
+ /**
1175
+ * @description Determines whether YAHOO.util.Event is available and returns true or false.
1176
+ * If true, an event listener is bound at the document level to trap click events that
1177
+ * resolve to a target type of "Submit". This listener will enable setForm() to determine
1178
+ * the clicked "Submit" value in a multi-Submit button, HTML form.
1179
+ * @property _hasSubmitListener
1180
+ * @private
1181
+ * @static
1182
+ */
1183
+ YCM._hasSubmitListener = function() {
1184
+ if(YE){
1185
+ YE.addListener(
1186
+ document,
1187
+ 'click',
1188
+ function(e){
1189
+ var obj = YE.getTarget(e),
1190
+ name = obj.nodeName.toLowerCase();
1191
+
1192
+ if((name === 'input' || name === 'button') && (obj.type && obj.type.toLowerCase() == 'submit')){
1193
+ YCM._submitElementValue = encodeURIComponent(obj.name) + "=" + encodeURIComponent(obj.value);
1194
+ }
1195
+ });
1196
+ return true;
1197
+ }
1198
+ return false;
1199
+ }();
1200
+
1201
+ /**
1202
+ * @description This method assembles the form label and value pairs and
1203
+ * constructs an encoded string.
1204
+ * asyncRequest() will automatically initialize the transaction with a
1205
+ * a HTTP header Content-Type of application/x-www-form-urlencoded.
1206
+ * @method setForm
1207
+ * @public
1208
+ * @static
1209
+ * @param {string || object} form id or name attribute, or form object.
1210
+ * @param {boolean} optional enable file upload.
1211
+ * @param {boolean} optional enable file upload over SSL in IE only.
1212
+ * @return {string} string of the HTML form field name and value pairs..
1213
+ */
1214
+ function _setForm(formId, isUpload, secureUri)
1215
+ {
1216
+ var oForm, oElement, oName, oValue, oDisabled,
1217
+ hasSubmit = false,
1218
+ data = [], item = 0,
1219
+ i,len,j,jlen,opt;
1220
+
1221
+ this.resetFormState();
1222
+
1223
+ if(typeof formId == 'string'){
1224
+ // Determine if the argument is a form id or a form name.
1225
+ // Note form name usage is deprecated by supported
1226
+ // here for legacy reasons.
1227
+ oForm = (document.getElementById(formId) || document.forms[formId]);
1228
+ }
1229
+ else if(typeof formId == 'object'){
1230
+ // Treat argument as an HTML form object.
1231
+ oForm = formId;
1232
+ }
1233
+ else{
1234
+ YAHOO.log('Unable to create form object ' + formId, 'warn', 'Connection');
1235
+ return;
1236
+ }
1237
+
1238
+ // If the isUpload argument is true, setForm will call createFrame to initialize
1239
+ // an iframe as the form target.
1240
+ //
1241
+ // The argument secureURI is also required by IE in SSL environments
1242
+ // where the secureURI string is a fully qualified HTTP path, used to set the source
1243
+ // of the iframe, to a stub resource in the same domain.
1244
+ if(isUpload){
1245
+
1246
+ // Create iframe in preparation for file upload.
1247
+ this.createFrame(secureUri?secureUri:null);
1248
+
1249
+ // Set form reference and file upload properties to true.
1250
+ this._isFormSubmit = true;
1251
+ this._isFileUpload = true;
1252
+ this._formNode = oForm;
1253
+
1254
+ return;
1255
+ }
1256
+
1257
+ // Iterate over the form elements collection to construct the
1258
+ // label-value pairs.
1259
+ for (i=0,len=oForm.elements.length; i<len; ++i){
1260
+ oElement = oForm.elements[i];
1261
+ oDisabled = oElement.disabled;
1262
+ oName = oElement.name;
1263
+
1264
+ // Do not submit fields that are disabled or
1265
+ // do not have a name attribute value.
1266
+ if(!oDisabled && oName)
1267
+ {
1268
+ oName = encodeURIComponent(oName)+'=';
1269
+ oValue = encodeURIComponent(oElement.value);
1270
+
1271
+ switch(oElement.type)
1272
+ {
1273
+ // Safari, Opera, FF all default opt.value from .text if
1274
+ // value attribute not specified in markup
1275
+ case 'select-one':
1276
+ if (oElement.selectedIndex > -1) {
1277
+ opt = oElement.options[oElement.selectedIndex];
1278
+ data[item++] = oName + encodeURIComponent(
1279
+ (opt.attributes.value && opt.attributes.value.specified) ? opt.value : opt.text);
1280
+ }
1281
+ break;
1282
+ case 'select-multiple':
1283
+ if (oElement.selectedIndex > -1) {
1284
+ for(j=oElement.selectedIndex, jlen=oElement.options.length; j<jlen; ++j){
1285
+ opt = oElement.options[j];
1286
+ if (opt.selected) {
1287
+ data[item++] = oName + encodeURIComponent(
1288
+ (opt.attributes.value && opt.attributes.value.specified) ? opt.value : opt.text);
1289
+ }
1290
+ }
1291
+ }
1292
+ break;
1293
+ case 'radio':
1294
+ case 'checkbox':
1295
+ if(oElement.checked){
1296
+ data[item++] = oName + oValue;
1297
+ }
1298
+ break;
1299
+ case 'file':
1300
+ // stub case as XMLHttpRequest will only send the file path as a string.
1301
+ case undefined:
1302
+ // stub case for fieldset element which returns undefined.
1303
+ case 'reset':
1304
+ // stub case for input type reset button.
1305
+ case 'button':
1306
+ // stub case for input type button elements.
1307
+ break;
1308
+ case 'submit':
1309
+ if(hasSubmit === false){
1310
+ if(this._hasSubmitListener && this._submitElementValue){
1311
+ data[item++] = this._submitElementValue;
1312
+ }
1313
+ hasSubmit = true;
1314
+ }
1315
+ break;
1316
+ default:
1317
+ data[item++] = oName + oValue;
1318
+ }
1319
+ }
1320
+ }
1321
+
1322
+ this._isFormSubmit = true;
1323
+ this._sFormData = data.join('&');
1324
+
1325
+ YAHOO.log('Form initialized for transaction. HTML form POST message is: ' + this._sFormData, 'info', 'Connection');
1326
+
1327
+ this.initHeader('Content-Type', this._default_form_header);
1328
+ YAHOO.log('Initialize header Content-Type to application/x-www-form-urlencoded for setForm() transaction.', 'info', 'Connection');
1329
+
1330
+ return this._sFormData;
1331
+ }
1332
+
1333
+ /**
1334
+ * @description Resets HTML form properties when an HTML form or HTML form
1335
+ * with file upload transaction is sent.
1336
+ * @method resetFormState
1337
+ * @private
1338
+ * @static
1339
+ * @return {void}
1340
+ */
1341
+ function _resetFormState(){
1342
+ this._isFormSubmit = false;
1343
+ this._isFileUpload = false;
1344
+ this._formNode = null;
1345
+ this._sFormData = "";
1346
+ }
1347
+
1348
+
1349
+ /**
1350
+ * @description Creates an iframe to be used for form file uploads. It is remove from the
1351
+ * document upon completion of the upload transaction.
1352
+ * @method createFrame
1353
+ * @private
1354
+ * @static
1355
+ * @param {string} optional qualified path of iframe resource for SSL in IE.
1356
+ * @return {void}
1357
+ */
1358
+ function _createFrame(secureUri){
1359
+
1360
+ // IE does not allow the setting of id and name attributes as object
1361
+ // properties via createElement(). A different iframe creation
1362
+ // pattern is required for IE.
1363
+ var frameId = 'yuiIO' + this._transaction_id,
1364
+ io;
1365
+ if(YAHOO.env.ua.ie){
1366
+ io = document.createElement('<iframe id="' + frameId + '" name="' + frameId + '" />');
1367
+
1368
+ // IE will throw a security exception in an SSL environment if the
1369
+ // iframe source is undefined.
1370
+ if(typeof secureUri == 'boolean'){
1371
+ io.src = 'javascript:false';
1372
+ }
1373
+ }
1374
+ else{
1375
+ io = document.createElement('iframe');
1376
+ io.id = frameId;
1377
+ io.name = frameId;
1378
+ }
1379
+
1380
+ io.style.position = 'absolute';
1381
+ io.style.top = '-1000px';
1382
+ io.style.left = '-1000px';
1383
+
1384
+ document.body.appendChild(io);
1385
+ YAHOO.log('File upload iframe created. Id is:' + frameId, 'info', 'Connection');
1386
+ }
1387
+
1388
+ /**
1389
+ * @description Parses the POST data and creates hidden form elements
1390
+ * for each key-value, and appends them to the HTML form object.
1391
+ * @method appendPostData
1392
+ * @private
1393
+ * @static
1394
+ * @param {string} postData The HTTP POST data
1395
+ * @return {array} formElements Collection of hidden fields.
1396
+ */
1397
+ function _appendPostData(postData){
1398
+ var formElements = [],
1399
+ postMessage = postData.split('&'),
1400
+ i, delimitPos;
1401
+
1402
+ for(i=0; i < postMessage.length; i++){
1403
+ delimitPos = postMessage[i].indexOf('=');
1404
+ if(delimitPos != -1){
1405
+ formElements[i] = document.createElement('input');
1406
+ formElements[i].type = 'hidden';
1407
+ formElements[i].name = decodeURIComponent(postMessage[i].substring(0,delimitPos));
1408
+ formElements[i].value = decodeURIComponent(postMessage[i].substring(delimitPos+1));
1409
+ this._formNode.appendChild(formElements[i]);
1410
+ }
1411
+ }
1412
+
1413
+ return formElements;
1414
+ }
1415
+
1416
+ /**
1417
+ * @description Uploads HTML form, inclusive of files/attachments, using the
1418
+ * iframe created in createFrame to facilitate the transaction.
1419
+ * @method uploadFile
1420
+ * @private
1421
+ * @static
1422
+ * @param {int} id The transaction id.
1423
+ * @param {object} callback User-defined callback object.
1424
+ * @param {string} uri Fully qualified path of resource.
1425
+ * @param {string} postData POST data to be submitted in addition to HTML form.
1426
+ * @return {void}
1427
+ */
1428
+ function _uploadFile(o, callback, uri, postData){
1429
+ // Each iframe has an id prefix of "yuiIO" followed
1430
+ // by the unique transaction id.
1431
+ var frameId = 'yuiIO' + o.tId,
1432
+ uploadEncoding = 'multipart/form-data',
1433
+ io = document.getElementById(frameId),
1434
+ ie8 = (document.documentMode && document.documentMode === 8) ? true : false,
1435
+ oConn = this,
1436
+ args = (callback && callback.argument)?callback.argument:null,
1437
+ oElements,i,prop,obj, rawFormAttributes, uploadCallback;
1438
+
1439
+ // Track original HTML form attribute values.
1440
+ rawFormAttributes = {
1441
+ action:this._formNode.getAttribute('action'),
1442
+ method:this._formNode.getAttribute('method'),
1443
+ target:this._formNode.getAttribute('target')
1444
+ };
1445
+
1446
+ // Initialize the HTML form properties in case they are
1447
+ // not defined in the HTML form.
1448
+ this._formNode.setAttribute('action', uri);
1449
+ this._formNode.setAttribute('method', 'POST');
1450
+ this._formNode.setAttribute('target', frameId);
1451
+
1452
+ if(YAHOO.env.ua.ie && !ie8){
1453
+ // IE does not respect property enctype for HTML forms.
1454
+ // Instead it uses the property - "encoding".
1455
+ this._formNode.setAttribute('encoding', uploadEncoding);
1456
+ }
1457
+ else{
1458
+ this._formNode.setAttribute('enctype', uploadEncoding);
1459
+ }
1460
+
1461
+ if(postData){
1462
+ oElements = this.appendPostData(postData);
1463
+ }
1464
+
1465
+ // Start file upload.
1466
+ this._formNode.submit();
1467
+
1468
+ // Fire global custom event -- startEvent
1469
+ this.startEvent.fire(o, args);
1470
+
1471
+ if(o.startEvent){
1472
+ // Fire transaction custom event -- startEvent
1473
+ o.startEvent.fire(o, args);
1474
+ }
1475
+
1476
+ // Start polling if a callback is present and the timeout
1477
+ // property has been defined.
1478
+ if(callback && callback.timeout){
1479
+ this._timeOut[o.tId] = window.setTimeout(function(){ oConn.abort(o, callback, true); }, callback.timeout);
1480
+ }
1481
+
1482
+ // Remove HTML elements created by appendPostData
1483
+ if(oElements && oElements.length > 0){
1484
+ for(i=0; i < oElements.length; i++){
1485
+ this._formNode.removeChild(oElements[i]);
1486
+ }
1487
+ }
1488
+
1489
+ // Restore HTML form attributes to their original
1490
+ // values prior to file upload.
1491
+ for(prop in rawFormAttributes){
1492
+ if(YAHOO.lang.hasOwnProperty(rawFormAttributes, prop)){
1493
+ if(rawFormAttributes[prop]){
1494
+ this._formNode.setAttribute(prop, rawFormAttributes[prop]);
1495
+ }
1496
+ else{
1497
+ this._formNode.removeAttribute(prop);
1498
+ }
1499
+ }
1500
+ }
1501
+
1502
+ // Reset HTML form state properties.
1503
+ this.resetFormState();
1504
+
1505
+ // Create the upload callback handler that fires when the iframe
1506
+ // receives the load event. Subsequently, the event handler is detached
1507
+ // and the iframe removed from the document.
1508
+ uploadCallback = function() {
1509
+ if(callback && callback.timeout){
1510
+ window.clearTimeout(oConn._timeOut[o.tId]);
1511
+ delete oConn._timeOut[o.tId];
1512
+ }
1513
+
1514
+ // Fire global custom event -- completeEvent
1515
+ oConn.completeEvent.fire(o, args);
1516
+
1517
+ if(o.completeEvent){
1518
+ // Fire transaction custom event -- completeEvent
1519
+ o.completeEvent.fire(o, args);
1520
+ }
1521
+
1522
+ obj = {
1523
+ tId : o.tId,
1524
+ argument : callback.argument
1525
+ };
1526
+
1527
+ try
1528
+ {
1529
+ // responseText and responseXML will be populated with the same data from the iframe.
1530
+ // Since the HTTP headers cannot be read from the iframe
1531
+ obj.responseText = io.contentWindow.document.body?io.contentWindow.document.body.innerHTML:io.contentWindow.document.documentElement.textContent;
1532
+ obj.responseXML = io.contentWindow.document.XMLDocument?io.contentWindow.document.XMLDocument:io.contentWindow.document;
1533
+ }
1534
+ catch(e){}
1535
+
1536
+ if(callback && callback.upload){
1537
+ if(!callback.scope){
1538
+ callback.upload(obj);
1539
+ YAHOO.log('Upload callback.', 'info', 'Connection');
1540
+ }
1541
+ else{
1542
+ callback.upload.apply(callback.scope, [obj]);
1543
+ YAHOO.log('Upload callback with scope.', 'info', 'Connection');
1544
+ }
1545
+ }
1546
+
1547
+ // Fire global custom event -- uploadEvent
1548
+ oConn.uploadEvent.fire(obj);
1549
+
1550
+ if(o.uploadEvent){
1551
+ // Fire transaction custom event -- uploadEvent
1552
+ o.uploadEvent.fire(obj);
1553
+ }
1554
+
1555
+ YE.removeListener(io, "load", uploadCallback);
1556
+
1557
+ setTimeout(
1558
+ function(){
1559
+ document.body.removeChild(io);
1560
+ oConn.releaseObject(o);
1561
+ YAHOO.log('File upload iframe destroyed. Id is:' + frameId, 'info', 'Connection');
1562
+ }, 100);
1563
+ };
1564
+
1565
+ // Bind the onload handler to the iframe to detect the file upload response.
1566
+ YE.addListener(io, "load", uploadCallback);
1567
+ }
1568
+
1569
+ YCM.setForm = _setForm;
1570
+ YCM.resetFormState = _resetFormState;
1571
+ YCM.createFrame = _createFrame;
1572
+ YCM.appendPostData = _appendPostData;
1573
+ YCM.uploadFile = _uploadFile;
1574
+ })();
1575
+
1576
+ YAHOO.register("connection", YAHOO.util.Connect, {version: "2.8.1", build: "19"});