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,9 @@
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.widget.LogMsg=function(A){this.msg=this.time=this.category=this.source=this.sourceDetail=null;if(A&&(A.constructor==Object)){for(var B in A){if(A.hasOwnProperty(B)){this[B]=A[B];}}}};YAHOO.widget.LogWriter=function(A){if(!A){YAHOO.log("Could not instantiate LogWriter due to invalid source.","error","LogWriter");return;}this._source=A;};YAHOO.widget.LogWriter.prototype.toString=function(){return"LogWriter "+this._sSource;};YAHOO.widget.LogWriter.prototype.log=function(A,B){YAHOO.widget.Logger.log(A,B,this._source);};YAHOO.widget.LogWriter.prototype.getSource=function(){return this._source;};YAHOO.widget.LogWriter.prototype.setSource=function(A){if(!A){YAHOO.log("Could not set source due to invalid source.","error",this.toString());return;}else{this._source=A;}};YAHOO.widget.LogWriter.prototype._source=null;if(!YAHOO.widget.Logger){YAHOO.widget.Logger={loggerEnabled:true,_browserConsoleEnabled:false,categories:["info","warn","error","time","window"],sources:["global"],_stack:[],maxStackEntries:2500,_startTime:new Date().getTime(),_lastTime:null,_windowErrorsHandled:false,_origOnWindowError:null};YAHOO.widget.Logger.log=function(B,F,G){if(this.loggerEnabled){if(!F){F="info";}else{F=F.toLocaleLowerCase();if(this._isNewCategory(F)){this._createNewCategory(F);}}var C="global";var A=null;if(G){var D=G.indexOf(" ");if(D>0){C=G.substring(0,D);A=G.substring(D,G.length);}else{C=G;}if(this._isNewSource(C)){this._createNewSource(C);}}var H=new Date();var J=new YAHOO.widget.LogMsg({msg:B,time:H,category:F,source:C,sourceDetail:A});var I=this._stack;var E=this.maxStackEntries;if(E&&!isNaN(E)&&(I.length>=E)){I.shift();}I.push(J);this.newLogEvent.fire(J);if(this._browserConsoleEnabled){this._printToBrowserConsole(J);}return true;}else{return false;}};YAHOO.widget.Logger.reset=function(){this._stack=[];this._startTime=new Date().getTime();this.loggerEnabled=true;this.log("Logger reset");this.logResetEvent.fire();};YAHOO.widget.Logger.getStack=function(){return this._stack;};YAHOO.widget.Logger.getStartTime=function(){return this._startTime;};YAHOO.widget.Logger.disableBrowserConsole=function(){YAHOO.log("Logger output to the function console.log() has been disabled.");this._browserConsoleEnabled=false;};YAHOO.widget.Logger.enableBrowserConsole=function(){this._browserConsoleEnabled=true;YAHOO.log("Logger output to the function console.log() has been enabled.");};YAHOO.widget.Logger.handleWindowErrors=function(){if(!YAHOO.widget.Logger._windowErrorsHandled){if(window.error){YAHOO.widget.Logger._origOnWindowError=window.onerror;}window.onerror=YAHOO.widget.Logger._onWindowError;YAHOO.widget.Logger._windowErrorsHandled=true;YAHOO.log("Logger handling of window.onerror has been enabled.");}else{YAHOO.log("Logger handling of window.onerror had already been enabled.");}};YAHOO.widget.Logger.unhandleWindowErrors=function(){if(YAHOO.widget.Logger._windowErrorsHandled){if(YAHOO.widget.Logger._origOnWindowError){window.onerror=YAHOO.widget.Logger._origOnWindowError;YAHOO.widget.Logger._origOnWindowError=null;}else{window.onerror=null;}YAHOO.widget.Logger._windowErrorsHandled=false;YAHOO.log("Logger handling of window.onerror has been disabled.");}else{YAHOO.log("Logger handling of window.onerror had already been disabled.");}};YAHOO.widget.Logger.categoryCreateEvent=new YAHOO.util.CustomEvent("categoryCreate",this,true);YAHOO.widget.Logger.sourceCreateEvent=new YAHOO.util.CustomEvent("sourceCreate",this,true);YAHOO.widget.Logger.newLogEvent=new YAHOO.util.CustomEvent("newLog",this,true);YAHOO.widget.Logger.logResetEvent=new YAHOO.util.CustomEvent("logReset",this,true);YAHOO.widget.Logger._createNewCategory=function(A){this.categories.push(A);this.categoryCreateEvent.fire(A);};YAHOO.widget.Logger._isNewCategory=function(B){for(var A=0;A<this.categories.length;A++){if(B==this.categories[A]){return false;}}return true;};YAHOO.widget.Logger._createNewSource=function(A){this.sources.push(A);this.sourceCreateEvent.fire(A);};YAHOO.widget.Logger._isNewSource=function(A){if(A){for(var B=0;B<this.sources.length;B++){if(A==this.sources[B]){return false;}}return true;}};YAHOO.widget.Logger._printToBrowserConsole=function(C){if(window.console&&console.log){var E=C.category;var D=C.category.substring(0,4).toUpperCase();var G=C.time;var F;if(G.toLocaleTimeString){F=G.toLocaleTimeString();}else{F=G.toString();}var H=G.getTime();var B=(YAHOO.widget.Logger._lastTime)?(H-YAHOO.widget.Logger._lastTime):0;YAHOO.widget.Logger._lastTime=H;var A=F+" ("+B+"ms): "+C.source+": ";if(YAHOO.env.ua.webkit){A+=C.msg;}console.log(A,C.msg);}};YAHOO.widget.Logger._onWindowError=function(A,C,B){try{YAHOO.widget.Logger.log(A+" ("+C+", line "+B+")","window");if(YAHOO.widget.Logger._origOnWindowError){YAHOO.widget.Logger._origOnWindowError();}}catch(D){return false;}};YAHOO.widget.Logger.log("Logger initialized");}(function(){var C=YAHOO.widget.Logger,D=YAHOO.util,E=D.Dom,A=D.Event,G=document;function B(I,H){I=G.createElement(I);if(H){for(var J in H){if(H.hasOwnProperty(J)){I[J]=H[J];}}}return I;}function F(I,H){this._sName=F._index;F._index++;this._init.apply(this,arguments);if(this.autoRender!==false){this.render();}}YAHOO.lang.augmentObject(F,{_index:0,ENTRY_TEMPLATE:(function(){return B("pre",{className:"yui-log-entry"});})(),VERBOSE_TEMPLATE:"<p><span class='{category}'>{label}</span> {totalTime}ms (+{elapsedTime}) {localTime}:</p><p>{sourceAndDetail}</p><p>{message}</p>",BASIC_TEMPLATE:"<p><span class='{category}'>{label}</span> {totalTime}ms (+{elapsedTime}) {localTime}: {sourceAndDetail}: {message}</p>"});F.prototype={logReaderEnabled:true,width:null,height:null,top:null,left:null,right:null,bottom:null,fontSize:null,footerEnabled:true,verboseOutput:true,entryFormat:null,newestOnTop:true,outputBuffer:100,thresholdMax:500,thresholdMin:100,isCollapsed:false,isPaused:false,draggable:true,toString:function(){return"LogReader instance"+this._sName;},pause:function(){this.isPaused=true;this._timeout=null;this.logReaderEnabled=false;if(this._btnPause){this._btnPause.value="Resume";
8
+ }},resume:function(){this.isPaused=false;this.logReaderEnabled=true;this._printBuffer();if(this._btnPause){this._btnPause.value="Pause";}},render:function(){if(this.rendered){return;}this._initContainerEl();this._initHeaderEl();this._initConsoleEl();this._initFooterEl();this._initCategories();this._initSources();this._initDragDrop();C.newLogEvent.subscribe(this._onNewLog,this);C.logResetEvent.subscribe(this._onReset,this);C.categoryCreateEvent.subscribe(this._onCategoryCreate,this);C.sourceCreateEvent.subscribe(this._onSourceCreate,this);this.rendered=true;this._filterLogs();},destroy:function(){A.purgeElement(this._elContainer,true);this._elContainer.innerHTML="";this._elContainer.parentNode.removeChild(this._elContainer);this.rendered=false;},hide:function(){this._elContainer.style.display="none";},show:function(){this._elContainer.style.display="block";},collapse:function(){this._elConsole.style.display="none";if(this._elFt){this._elFt.style.display="none";}this._btnCollapse.value="Expand";this.isCollapsed=true;},expand:function(){this._elConsole.style.display="block";if(this._elFt){this._elFt.style.display="block";}this._btnCollapse.value="Collapse";this.isCollapsed=false;},getCheckbox:function(H){return this._filterCheckboxes[H];},getCategories:function(){return this._categoryFilters;},showCategory:function(I){var K=this._categoryFilters;if(K.indexOf){if(K.indexOf(I)>-1){return;}}else{for(var H=0;H<K.length;H++){if(K[H]===I){return;}}}this._categoryFilters.push(I);this._filterLogs();var J=this.getCheckbox(I);if(J){J.checked=true;}},hideCategory:function(I){var K=this._categoryFilters;for(var H=0;H<K.length;H++){if(I==K[H]){K.splice(H,1);break;}}this._filterLogs();var J=this.getCheckbox(I);if(J){J.checked=false;}},getSources:function(){return this._sourceFilters;},showSource:function(H){var K=this._sourceFilters;if(K.indexOf){if(K.indexOf(H)>-1){return;}}else{for(var I=0;I<K.length;I++){if(H==K[I]){return;}}}K.push(H);this._filterLogs();var J=this.getCheckbox(H);if(J){J.checked=true;}},hideSource:function(H){var K=this._sourceFilters;for(var I=0;I<K.length;I++){if(H==K[I]){K.splice(I,1);break;}}this._filterLogs();var J=this.getCheckbox(H);if(J){J.checked=false;}},clearConsole:function(){this._timeout=null;this._buffer=[];this._consoleMsgCount=0;var H=this._elConsole;H.innerHTML="";},setTitle:function(H){this._title.innerHTML=this.html2Text(H);},getLastTime:function(){return this._lastTime;},formatMsg:function(I){var H=this.entryFormat||(this.verboseOutput?F.VERBOSE_TEMPLATE:F.BASIC_TEMPLATE),J={category:I.category,label:I.category.substring(0,4).toUpperCase(),sourceAndDetail:I.sourceDetail?I.source+" "+I.sourceDetail:I.source,message:this.html2Text(I.msg||I.message||"")};if(I.time&&I.time.getTime){J.localTime=I.time.toLocaleTimeString?I.time.toLocaleTimeString():I.time.toString();J.elapsedTime=I.time.getTime()-this.getLastTime();J.totalTime=I.time.getTime()-C.getStartTime();}var K=F.ENTRY_TEMPLATE.cloneNode(true);if(this.verboseOutput){K.className+=" yui-log-verbose";}K.innerHTML=H.replace(/\{(\w+)\}/g,function(L,M){return(M in J)?J[M]:"";});return K;},html2Text:function(H){if(H){H+="";return H.replace(/&/g,"&#38;").replace(/</g,"&#60;").replace(/>/g,"&#62;");}return"";},_sName:null,_buffer:null,_consoleMsgCount:0,_lastTime:null,_timeout:null,_filterCheckboxes:null,_categoryFilters:null,_sourceFilters:null,_elContainer:null,_elHd:null,_elCollapse:null,_btnCollapse:null,_title:null,_elConsole:null,_elFt:null,_elBtns:null,_elCategoryFilters:null,_elSourceFilters:null,_btnPause:null,_btnClear:null,_init:function(H,I){this._buffer=[];this._filterCheckboxes={};this._lastTime=C.getStartTime();if(I&&(I.constructor==Object)){for(var J in I){if(I.hasOwnProperty(J)){this[J]=I[J];}}}this._elContainer=E.get(H);YAHOO.log("LogReader initialized",null,this.toString());},_initContainerEl:function(){if(!this._elContainer||!/div$/i.test(this._elContainer.tagName)){this._elContainer=G.body.insertBefore(B("div"),G.body.firstChild);E.addClass(this._elContainer,"yui-log-container");}E.addClass(this._elContainer,"yui-log");var J=this._elContainer.style,H=["width","right","top","fontSize"],K,I;for(I=H.length-1;I>=0;--I){K=H[I];if(this[K]){J[K]=this[K];}}if(this.left){J.left=this.left;J.right="auto";}if(this.bottom){J.bottom=this.bottom;J.top="auto";}if(YAHOO.env.ua.opera){G.body.style+="";}},_initHeaderEl:function(){if(this._elHd){A.purgeElement(this._elHd,true);this._elHd.innerHTML="";}this._elHd=B("div",{id:"yui-log-hd"+this._sName,className:"yui-log-hd"});this._elCollapse=B("div",{className:"yui-log-btns"});this._btnCollapse=B("input",{type:"button",className:"yui-log-button",value:"Collapse"});A.on(this._btnCollapse,"click",this._onClickCollapseBtn,this);this._title=B("h4",{innerHTML:"Logger Console"});this._elCollapse.appendChild(this._btnCollapse);this._elHd.appendChild(this._elCollapse);this._elHd.appendChild(this._title);this._elContainer.appendChild(this._elHd);},_initConsoleEl:function(){if(this._elConsole){A.purgeElement(this._elConsole,true);this._elConsole.innerHTML="";}this._elConsole=B("div",{className:"yui-log-bd"});if(this.height){this._elConsole.style.height=this.height;}this._elContainer.appendChild(this._elConsole);},_initFooterEl:function(){if(this.footerEnabled){if(this._elFt){A.purgeElement(this._elFt,true);this._elFt.innerHTML="";}this._elFt=B("div",{className:"yui-log-ft"});this._elBtns=B("div",{className:"yui-log-btns"});this._btnPause=B("input",{type:"button",className:"yui-log-button",value:"Pause"});A.on(this._btnPause,"click",this._onClickPauseBtn,this);this._btnClear=B("input",{type:"button",className:"yui-log-button",value:"Clear"});A.on(this._btnClear,"click",this._onClickClearBtn,this);this._elCategoryFilters=B("div",{className:"yui-log-categoryfilters"});this._elSourceFilters=B("div",{className:"yui-log-sourcefilters"});this._elBtns.appendChild(this._btnPause);this._elBtns.appendChild(this._btnClear);this._elFt.appendChild(this._elBtns);this._elFt.appendChild(this._elCategoryFilters);
9
+ this._elFt.appendChild(this._elSourceFilters);this._elContainer.appendChild(this._elFt);}},_initDragDrop:function(){if(D.DD&&this.draggable&&this._elHd){var H=new D.DD(this._elContainer);H.setHandleElId(this._elHd.id);this._elHd.style.cursor="move";}},_initCategories:function(){this._categoryFilters=[];var J=C.categories;for(var H=0;H<J.length;H++){var I=J[H];this._categoryFilters.push(I);if(this._elCategoryFilters){this._createCategoryCheckbox(I);}}},_initSources:function(){this._sourceFilters=[];var J=C.sources;for(var I=0;I<J.length;I++){var H=J[I];this._sourceFilters.push(H);if(this._elSourceFilters){this._createSourceCheckbox(H);}}},_createCategoryCheckbox:function(K){if(this._elFt){var J=B("span",{className:"yui-log-filtergrp"}),H=B("input",{id:"yui-log-filter-"+K+this._sName,className:"yui-log-filter-"+K,type:"checkbox",category:K}),I=B("label",{htmlFor:H.id,className:K,innerHTML:K});A.on(H,"click",this._onCheckCategory,this);this._filterCheckboxes[K]=H;J.appendChild(H);J.appendChild(I);this._elCategoryFilters.appendChild(J);H.checked=true;}},_createSourceCheckbox:function(H){if(this._elFt){var K=B("span",{className:"yui-log-filtergrp"}),I=B("input",{id:"yui-log-filter-"+H+this._sName,className:"yui-log-filter-"+H,type:"checkbox",source:H}),J=B("label",{htmlFor:I.id,className:H,innerHTML:H});A.on(I,"click",this._onCheckSource,this);this._filterCheckboxes[H]=I;K.appendChild(I);K.appendChild(J);this._elSourceFilters.appendChild(K);I.checked=true;}},_filterLogs:function(){if(this._elConsole!==null){this.clearConsole();this._printToConsole(C.getStack());}},_printBuffer:function(){this._timeout=null;if(this._elConsole!==null){var I=this.thresholdMax;I=(I&&!isNaN(I))?I:500;if(this._consoleMsgCount<I){var H=[];for(var J=0;J<this._buffer.length;J++){H[J]=this._buffer[J];}this._buffer=[];this._printToConsole(H);}else{this._filterLogs();}if(!this.newestOnTop){this._elConsole.scrollTop=this._elConsole.scrollHeight;}}},_printToConsole:function(P){var I=P.length,T=G.createDocumentFragment(),W=[],X=this.thresholdMin,J=this._sourceFilters.length,U=this._categoryFilters.length,R,O,N,M,S;if(isNaN(X)||(X>this.thresholdMax)){X=0;}R=(I>X)?(I-X):0;for(O=R;O<I;O++){var L=false,Q=false,V=P[O],H=V.source,K=V.category;for(N=0;N<J;N++){if(H==this._sourceFilters[N]){Q=true;break;}}if(Q){for(N=0;N<U;N++){if(K==this._categoryFilters[N]){L=true;break;}}}if(L){if(this._consoleMsgCount===0){this._lastTime=V.time.getTime();}M=this.formatMsg(V);if(typeof M==="string"){W[W.length]=M;}else{T.insertBefore(M,this.newestOnTop?T.firstChild||null:null);}this._consoleMsgCount++;this._lastTime=V.time.getTime();}}if(W.length){W.splice(0,0,this._elConsole.innerHTML);this._elConsole.innerHTML=this.newestOnTop?W.reverse().join(""):W.join("");}else{if(T.firstChild){this._elConsole.insertBefore(T,this.newestOnTop?this._elConsole.firstChild||null:null);}}},_onCategoryCreate:function(K,J,H){var I=J[0];H._categoryFilters.push(I);if(H._elFt){H._createCategoryCheckbox(I);}},_onSourceCreate:function(K,J,H){var I=J[0];H._sourceFilters.push(I);if(H._elFt){H._createSourceCheckbox(I);}},_onCheckCategory:function(H,I){var J=this.category;if(!this.checked){I.hideCategory(J);}else{I.showCategory(J);}},_onCheckSource:function(H,I){var J=this.source;if(!this.checked){I.hideSource(J);}else{I.showSource(J);}},_onClickCollapseBtn:function(H,I){if(!I.isCollapsed){I.collapse();}else{I.expand();}},_onClickPauseBtn:function(H,I){if(!I.isPaused){I.pause();}else{I.resume();}},_onClickClearBtn:function(H,I){I.clearConsole();},_onNewLog:function(K,J,H){var I=J[0];H._buffer.push(I);if(H.logReaderEnabled===true&&H._timeout===null){H._timeout=setTimeout(function(){H._printBuffer();},H.outputBuffer);}},_onReset:function(J,I,H){H._filterLogs();}};YAHOO.widget.LogReader=F;})();YAHOO.register("logger",YAHOO.widget.Logger,{version:"2.8.1",build:"19"});
@@ -0,0 +1,2104 @@
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
+ /****************************************************************************/
10
+
11
+ /**
12
+ * The LogMsg class defines a single log message.
13
+ *
14
+ * @class LogMsg
15
+ * @constructor
16
+ * @param oConfigs {Object} Object literal of configuration params.
17
+ */
18
+ YAHOO.widget.LogMsg = function(oConfigs) {
19
+ // Parse configs
20
+ /**
21
+ * Log message.
22
+ *
23
+ * @property msg
24
+ * @type String
25
+ */
26
+ this.msg =
27
+ /**
28
+ * Log timestamp.
29
+ *
30
+ * @property time
31
+ * @type Date
32
+ */
33
+ this.time =
34
+
35
+ /**
36
+ * Log category.
37
+ *
38
+ * @property category
39
+ * @type String
40
+ */
41
+ this.category =
42
+
43
+ /**
44
+ * Log source. The first word passed in as the source argument.
45
+ *
46
+ * @property source
47
+ * @type String
48
+ */
49
+ this.source =
50
+
51
+ /**
52
+ * Log source detail. The remainder of the string passed in as the source argument, not
53
+ * including the first word (if any).
54
+ *
55
+ * @property sourceDetail
56
+ * @type String
57
+ */
58
+ this.sourceDetail = null;
59
+
60
+ if (oConfigs && (oConfigs.constructor == Object)) {
61
+ for(var param in oConfigs) {
62
+ if (oConfigs.hasOwnProperty(param)) {
63
+ this[param] = oConfigs[param];
64
+ }
65
+ }
66
+ }
67
+ };
68
+ /****************************************************************************/
69
+ /****************************************************************************/
70
+ /****************************************************************************/
71
+
72
+ /**
73
+ * The LogWriter class provides a mechanism to log messages through
74
+ * YAHOO.widget.Logger from a named source.
75
+ *
76
+ * @class LogWriter
77
+ * @constructor
78
+ * @param sSource {String} Source of LogWriter instance.
79
+ */
80
+ YAHOO.widget.LogWriter = function(sSource) {
81
+ if(!sSource) {
82
+ YAHOO.log("Could not instantiate LogWriter due to invalid source.",
83
+ "error", "LogWriter");
84
+ return;
85
+ }
86
+ this._source = sSource;
87
+ };
88
+
89
+ /////////////////////////////////////////////////////////////////////////////
90
+ //
91
+ // Public methods
92
+ //
93
+ /////////////////////////////////////////////////////////////////////////////
94
+
95
+ /**
96
+ * Public accessor to the unique name of the LogWriter instance.
97
+ *
98
+ * @method toString
99
+ * @return {String} Unique name of the LogWriter instance.
100
+ */
101
+ YAHOO.widget.LogWriter.prototype.toString = function() {
102
+ return "LogWriter " + this._sSource;
103
+ };
104
+
105
+ /**
106
+ * Logs a message attached to the source of the LogWriter.
107
+ *
108
+ * @method log
109
+ * @param sMsg {String} The log message.
110
+ * @param sCategory {String} Category name.
111
+ */
112
+ YAHOO.widget.LogWriter.prototype.log = function(sMsg, sCategory) {
113
+ YAHOO.widget.Logger.log(sMsg, sCategory, this._source);
114
+ };
115
+
116
+ /**
117
+ * Public accessor to get the source name.
118
+ *
119
+ * @method getSource
120
+ * @return {String} The LogWriter source.
121
+ */
122
+ YAHOO.widget.LogWriter.prototype.getSource = function() {
123
+ return this._source;
124
+ };
125
+
126
+ /**
127
+ * Public accessor to set the source name.
128
+ *
129
+ * @method setSource
130
+ * @param sSource {String} Source of LogWriter instance.
131
+ */
132
+ YAHOO.widget.LogWriter.prototype.setSource = function(sSource) {
133
+ if(!sSource) {
134
+ YAHOO.log("Could not set source due to invalid source.", "error", this.toString());
135
+ return;
136
+ }
137
+ else {
138
+ this._source = sSource;
139
+ }
140
+ };
141
+
142
+ /////////////////////////////////////////////////////////////////////////////
143
+ //
144
+ // Private member variables
145
+ //
146
+ /////////////////////////////////////////////////////////////////////////////
147
+
148
+ /**
149
+ * Source of the LogWriter instance.
150
+ *
151
+ * @property _source
152
+ * @type String
153
+ * @private
154
+ */
155
+ YAHOO.widget.LogWriter.prototype._source = null;
156
+
157
+
158
+
159
+ /**
160
+ * The Logger widget provides a simple way to read or write log messages in
161
+ * JavaScript code. Integration with the YUI Library's debug builds allow
162
+ * implementers to access under-the-hood events, errors, and debugging messages.
163
+ * Output may be read through a LogReader console and/or output to a browser
164
+ * console.
165
+ *
166
+ * @module logger
167
+ * @requires yahoo, event, dom
168
+ * @optional dragdrop
169
+ * @namespace YAHOO.widget
170
+ * @title Logger Widget
171
+ */
172
+
173
+ /****************************************************************************/
174
+ /****************************************************************************/
175
+ /****************************************************************************/
176
+
177
+ // Define once
178
+ if(!YAHOO.widget.Logger) {
179
+ /**
180
+ * The singleton Logger class provides core log management functionality. Saves
181
+ * logs written through the global YAHOO.log function or written by a LogWriter
182
+ * instance. Provides access to logs for reading by a LogReader instance or
183
+ * native browser console such as the Firebug extension to Firefox or Safari's
184
+ * JavaScript console through integration with the console.log() method.
185
+ *
186
+ * @class Logger
187
+ * @static
188
+ */
189
+ YAHOO.widget.Logger = {
190
+ // Initialize properties
191
+ loggerEnabled: true,
192
+ _browserConsoleEnabled: false,
193
+ categories: ["info","warn","error","time","window"],
194
+ sources: ["global"],
195
+ _stack: [], // holds all log msgs
196
+ maxStackEntries: 2500,
197
+ _startTime: new Date().getTime(), // static start timestamp
198
+ _lastTime: null, // timestamp of last logged message
199
+ _windowErrorsHandled: false,
200
+ _origOnWindowError: null
201
+ };
202
+
203
+ /////////////////////////////////////////////////////////////////////////////
204
+ //
205
+ // Public properties
206
+ //
207
+ /////////////////////////////////////////////////////////////////////////////
208
+ /**
209
+ * True if Logger is enabled, false otherwise.
210
+ *
211
+ * @property loggerEnabled
212
+ * @type Boolean
213
+ * @static
214
+ * @default true
215
+ */
216
+
217
+ /**
218
+ * Array of categories.
219
+ *
220
+ * @property categories
221
+ * @type String[]
222
+ * @static
223
+ * @default ["info","warn","error","time","window"]
224
+ */
225
+
226
+ /**
227
+ * Array of sources.
228
+ *
229
+ * @property sources
230
+ * @type String[]
231
+ * @static
232
+ * @default ["global"]
233
+ */
234
+
235
+ /**
236
+ * Upper limit on size of internal stack.
237
+ *
238
+ * @property maxStackEntries
239
+ * @type Number
240
+ * @static
241
+ * @default 2500
242
+ */
243
+
244
+ /////////////////////////////////////////////////////////////////////////////
245
+ //
246
+ // Private properties
247
+ //
248
+ /////////////////////////////////////////////////////////////////////////////
249
+ /**
250
+ * Internal property to track whether output to browser console is enabled.
251
+ *
252
+ * @property _browserConsoleEnabled
253
+ * @type Boolean
254
+ * @static
255
+ * @default false
256
+ * @private
257
+ */
258
+
259
+ /**
260
+ * Array to hold all log messages.
261
+ *
262
+ * @property _stack
263
+ * @type Array
264
+ * @static
265
+ * @private
266
+ */
267
+ /**
268
+ * Static timestamp of Logger initialization.
269
+ *
270
+ * @property _startTime
271
+ * @type Date
272
+ * @static
273
+ * @private
274
+ */
275
+ /**
276
+ * Timestamp of last logged message.
277
+ *
278
+ * @property _lastTime
279
+ * @type Date
280
+ * @static
281
+ * @private
282
+ */
283
+ /////////////////////////////////////////////////////////////////////////////
284
+ //
285
+ // Public methods
286
+ //
287
+ /////////////////////////////////////////////////////////////////////////////
288
+ /**
289
+ * Saves a log message to the stack and fires newLogEvent. If the log message is
290
+ * assigned to an unknown category, creates a new category. If the log message is
291
+ * from an unknown source, creates a new source. If browser console is enabled,
292
+ * outputs the log message to browser console.
293
+ *
294
+ * @method log
295
+ * @param sMsg {String} The log message.
296
+ * @param sCategory {String} Category of log message, or null.
297
+ * @param sSource {String} Source of LogWriter, or null if global.
298
+ */
299
+ YAHOO.widget.Logger.log = function(sMsg, sCategory, sSource) {
300
+ if(this.loggerEnabled) {
301
+ if(!sCategory) {
302
+ sCategory = "info"; // default category
303
+ }
304
+ else {
305
+ sCategory = sCategory.toLocaleLowerCase();
306
+ if(this._isNewCategory(sCategory)) {
307
+ this._createNewCategory(sCategory);
308
+ }
309
+ }
310
+ var sClass = "global"; // default source
311
+ var sDetail = null;
312
+ if(sSource) {
313
+ var spaceIndex = sSource.indexOf(" ");
314
+ if(spaceIndex > 0) {
315
+ // Substring until first space
316
+ sClass = sSource.substring(0,spaceIndex);
317
+ // The rest of the source
318
+ sDetail = sSource.substring(spaceIndex,sSource.length);
319
+ }
320
+ else {
321
+ sClass = sSource;
322
+ }
323
+ if(this._isNewSource(sClass)) {
324
+ this._createNewSource(sClass);
325
+ }
326
+ }
327
+
328
+ var timestamp = new Date();
329
+ var logEntry = new YAHOO.widget.LogMsg({
330
+ msg: sMsg,
331
+ time: timestamp,
332
+ category: sCategory,
333
+ source: sClass,
334
+ sourceDetail: sDetail
335
+ });
336
+
337
+ var stack = this._stack;
338
+ var maxStackEntries = this.maxStackEntries;
339
+ if(maxStackEntries && !isNaN(maxStackEntries) &&
340
+ (stack.length >= maxStackEntries)) {
341
+ stack.shift();
342
+ }
343
+ stack.push(logEntry);
344
+ this.newLogEvent.fire(logEntry);
345
+
346
+ if(this._browserConsoleEnabled) {
347
+ this._printToBrowserConsole(logEntry);
348
+ }
349
+ return true;
350
+ }
351
+ else {
352
+ return false;
353
+ }
354
+ };
355
+
356
+ /**
357
+ * Resets internal stack and startTime, enables Logger, and fires logResetEvent.
358
+ *
359
+ * @method reset
360
+ */
361
+ YAHOO.widget.Logger.reset = function() {
362
+ this._stack = [];
363
+ this._startTime = new Date().getTime();
364
+ this.loggerEnabled = true;
365
+ this.log("Logger reset");
366
+ this.logResetEvent.fire();
367
+ };
368
+
369
+ /**
370
+ * Public accessor to internal stack of log message objects.
371
+ *
372
+ * @method getStack
373
+ * @return {Object[]} Array of log message objects.
374
+ */
375
+ YAHOO.widget.Logger.getStack = function() {
376
+ return this._stack;
377
+ };
378
+
379
+ /**
380
+ * Public accessor to internal start time.
381
+ *
382
+ * @method getStartTime
383
+ * @return {Date} Internal date of when Logger singleton was initialized.
384
+ */
385
+ YAHOO.widget.Logger.getStartTime = function() {
386
+ return this._startTime;
387
+ };
388
+
389
+ /**
390
+ * Disables output to the browser's global console.log() function, which is used
391
+ * by the Firebug extension to Firefox as well as Safari.
392
+ *
393
+ * @method disableBrowserConsole
394
+ */
395
+ YAHOO.widget.Logger.disableBrowserConsole = function() {
396
+ YAHOO.log("Logger output to the function console.log() has been disabled.");
397
+ this._browserConsoleEnabled = false;
398
+ };
399
+
400
+ /**
401
+ * Enables output to the browser's global console.log() function, which is used
402
+ * by the Firebug extension to Firefox as well as Safari.
403
+ *
404
+ * @method enableBrowserConsole
405
+ */
406
+ YAHOO.widget.Logger.enableBrowserConsole = function() {
407
+ this._browserConsoleEnabled = true;
408
+ YAHOO.log("Logger output to the function console.log() has been enabled.");
409
+ };
410
+
411
+ /**
412
+ * Surpresses native JavaScript errors and outputs to console. By default,
413
+ * Logger does not handle JavaScript window error events.
414
+ * NB: Not all browsers support the window.onerror event.
415
+ *
416
+ * @method handleWindowErrors
417
+ */
418
+ YAHOO.widget.Logger.handleWindowErrors = function() {
419
+ if(!YAHOO.widget.Logger._windowErrorsHandled) {
420
+ // Save any previously defined handler to call
421
+ if(window.error) {
422
+ YAHOO.widget.Logger._origOnWindowError = window.onerror;
423
+ }
424
+ window.onerror = YAHOO.widget.Logger._onWindowError;
425
+ YAHOO.widget.Logger._windowErrorsHandled = true;
426
+ YAHOO.log("Logger handling of window.onerror has been enabled.");
427
+ }
428
+ else {
429
+ YAHOO.log("Logger handling of window.onerror had already been enabled.");
430
+ }
431
+ };
432
+
433
+ /**
434
+ * Unsurpresses native JavaScript errors. By default,
435
+ * Logger does not handle JavaScript window error events.
436
+ * NB: Not all browsers support the window.onerror event.
437
+ *
438
+ * @method unhandleWindowErrors
439
+ */
440
+ YAHOO.widget.Logger.unhandleWindowErrors = function() {
441
+ if(YAHOO.widget.Logger._windowErrorsHandled) {
442
+ // Revert to any previously defined handler to call
443
+ if(YAHOO.widget.Logger._origOnWindowError) {
444
+ window.onerror = YAHOO.widget.Logger._origOnWindowError;
445
+ YAHOO.widget.Logger._origOnWindowError = null;
446
+ }
447
+ else {
448
+ window.onerror = null;
449
+ }
450
+ YAHOO.widget.Logger._windowErrorsHandled = false;
451
+ YAHOO.log("Logger handling of window.onerror has been disabled.");
452
+ }
453
+ else {
454
+ YAHOO.log("Logger handling of window.onerror had already been disabled.");
455
+ }
456
+ };
457
+
458
+ /////////////////////////////////////////////////////////////////////////////
459
+ //
460
+ // Public events
461
+ //
462
+ /////////////////////////////////////////////////////////////////////////////
463
+
464
+ /**
465
+ * Fired when a new category has been created.
466
+ *
467
+ * @event categoryCreateEvent
468
+ * @param sCategory {String} Category name.
469
+ */
470
+ YAHOO.widget.Logger.categoryCreateEvent =
471
+ new YAHOO.util.CustomEvent("categoryCreate", this, true);
472
+
473
+ /**
474
+ * Fired when a new source has been named.
475
+ *
476
+ * @event sourceCreateEvent
477
+ * @param sSource {String} Source name.
478
+ */
479
+ YAHOO.widget.Logger.sourceCreateEvent =
480
+ new YAHOO.util.CustomEvent("sourceCreate", this, true);
481
+
482
+ /**
483
+ * Fired when a new log message has been created.
484
+ *
485
+ * @event newLogEvent
486
+ * @param sMsg {String} Log message.
487
+ */
488
+ YAHOO.widget.Logger.newLogEvent = new YAHOO.util.CustomEvent("newLog", this, true);
489
+
490
+ /**
491
+ * Fired when the Logger has been reset has been created.
492
+ *
493
+ * @event logResetEvent
494
+ */
495
+ YAHOO.widget.Logger.logResetEvent = new YAHOO.util.CustomEvent("logReset", this, true);
496
+
497
+ /////////////////////////////////////////////////////////////////////////////
498
+ //
499
+ // Private methods
500
+ //
501
+ /////////////////////////////////////////////////////////////////////////////
502
+
503
+ /**
504
+ * Creates a new category of log messages and fires categoryCreateEvent.
505
+ *
506
+ * @method _createNewCategory
507
+ * @param sCategory {String} Category name.
508
+ * @private
509
+ */
510
+ YAHOO.widget.Logger._createNewCategory = function(sCategory) {
511
+ this.categories.push(sCategory);
512
+ this.categoryCreateEvent.fire(sCategory);
513
+ };
514
+
515
+ /**
516
+ * Checks to see if a category has already been created.
517
+ *
518
+ * @method _isNewCategory
519
+ * @param sCategory {String} Category name.
520
+ * @return {Boolean} Returns true if category is unknown, else returns false.
521
+ * @private
522
+ */
523
+ YAHOO.widget.Logger._isNewCategory = function(sCategory) {
524
+ for(var i=0; i < this.categories.length; i++) {
525
+ if(sCategory == this.categories[i]) {
526
+ return false;
527
+ }
528
+ }
529
+ return true;
530
+ };
531
+
532
+ /**
533
+ * Creates a new source of log messages and fires sourceCreateEvent.
534
+ *
535
+ * @method _createNewSource
536
+ * @param sSource {String} Source name.
537
+ * @private
538
+ */
539
+ YAHOO.widget.Logger._createNewSource = function(sSource) {
540
+ this.sources.push(sSource);
541
+ this.sourceCreateEvent.fire(sSource);
542
+ };
543
+
544
+ /**
545
+ * Checks to see if a source already exists.
546
+ *
547
+ * @method _isNewSource
548
+ * @param sSource {String} Source name.
549
+ * @return {Boolean} Returns true if source is unknown, else returns false.
550
+ * @private
551
+ */
552
+ YAHOO.widget.Logger._isNewSource = function(sSource) {
553
+ if(sSource) {
554
+ for(var i=0; i < this.sources.length; i++) {
555
+ if(sSource == this.sources[i]) {
556
+ return false;
557
+ }
558
+ }
559
+ return true;
560
+ }
561
+ };
562
+
563
+ /**
564
+ * Outputs a log message to global console.log() function.
565
+ *
566
+ * @method _printToBrowserConsole
567
+ * @param oEntry {Object} Log entry object.
568
+ * @private
569
+ */
570
+ YAHOO.widget.Logger._printToBrowserConsole = function(oEntry) {
571
+ if(window.console && console.log) {
572
+ var category = oEntry.category;
573
+ var label = oEntry.category.substring(0,4).toUpperCase();
574
+
575
+ var time = oEntry.time;
576
+ var localTime;
577
+ if (time.toLocaleTimeString) {
578
+ localTime = time.toLocaleTimeString();
579
+ }
580
+ else {
581
+ localTime = time.toString();
582
+ }
583
+
584
+ var msecs = time.getTime();
585
+ var elapsedTime = (YAHOO.widget.Logger._lastTime) ?
586
+ (msecs - YAHOO.widget.Logger._lastTime) : 0;
587
+ YAHOO.widget.Logger._lastTime = msecs;
588
+
589
+ var output =
590
+ localTime + " (" +
591
+ elapsedTime + "ms): " +
592
+ oEntry.source + ": ";
593
+
594
+ // for bug 1987607
595
+ if (YAHOO.env.ua.webkit) {
596
+ output += oEntry.msg;
597
+ }
598
+
599
+ console.log(output, oEntry.msg);
600
+ }
601
+ };
602
+
603
+ /////////////////////////////////////////////////////////////////////////////
604
+ //
605
+ // Private event handlers
606
+ //
607
+ /////////////////////////////////////////////////////////////////////////////
608
+
609
+ /**
610
+ * Handles logging of messages due to window error events.
611
+ *
612
+ * @method _onWindowError
613
+ * @param sMsg {String} The error message.
614
+ * @param sUrl {String} URL of the error.
615
+ * @param sLine {String} Line number of the error.
616
+ * @private
617
+ */
618
+ YAHOO.widget.Logger._onWindowError = function(sMsg,sUrl,sLine) {
619
+ // Logger is not in scope of this event handler
620
+ try {
621
+ YAHOO.widget.Logger.log(sMsg+' ('+sUrl+', line '+sLine+')', "window");
622
+ if(YAHOO.widget.Logger._origOnWindowError) {
623
+ YAHOO.widget.Logger._origOnWindowError();
624
+ }
625
+ }
626
+ catch(e) {
627
+ return false;
628
+ }
629
+ };
630
+
631
+ /////////////////////////////////////////////////////////////////////////////
632
+ //
633
+ // First log
634
+ //
635
+ /////////////////////////////////////////////////////////////////////////////
636
+
637
+ YAHOO.widget.Logger.log("Logger initialized");
638
+ }
639
+
640
+ /****************************************************************************/
641
+ /****************************************************************************/
642
+ /****************************************************************************/
643
+ (function () {
644
+ var Logger = YAHOO.widget.Logger,
645
+ u = YAHOO.util,
646
+ Dom = u.Dom,
647
+ Event = u.Event,
648
+ d = document;
649
+
650
+ function make(el,props) {
651
+ el = d.createElement(el);
652
+ if (props) {
653
+ for (var p in props) {
654
+ if (props.hasOwnProperty(p)) {
655
+ el[p] = props[p];
656
+ }
657
+ }
658
+ }
659
+ return el;
660
+ }
661
+
662
+ /**
663
+ * The LogReader class provides UI to read messages logged to YAHOO.widget.Logger.
664
+ *
665
+ * @class LogReader
666
+ * @constructor
667
+ * @param elContainer {HTMLElement} (optional) DOM element reference of an existing DIV.
668
+ * @param elContainer {String} (optional) String ID of an existing DIV.
669
+ * @param oConfigs {Object} (optional) Object literal of configuration params.
670
+ */
671
+ function LogReader(elContainer, oConfigs) {
672
+ this._sName = LogReader._index;
673
+ LogReader._index++;
674
+
675
+ this._init.apply(this,arguments);
676
+
677
+ /**
678
+ * Render the LogReader immediately upon instantiation. If set to false,
679
+ * you must call myLogReader.render() to generate the UI.
680
+ *
681
+ * @property autoRender
682
+ * @type {Boolean}
683
+ * @default true
684
+ */
685
+ if (this.autoRender !== false) {
686
+ this.render();
687
+ }
688
+ }
689
+
690
+ /////////////////////////////////////////////////////////////////////////////
691
+ //
692
+ // Static member variables
693
+ //
694
+ /////////////////////////////////////////////////////////////////////////////
695
+ YAHOO.lang.augmentObject(LogReader, {
696
+ /**
697
+ * Internal class member to index multiple LogReader instances.
698
+ *
699
+ * @property _memberName
700
+ * @static
701
+ * @type Number
702
+ * @default 0
703
+ * @private
704
+ */
705
+ _index : 0,
706
+
707
+ /**
708
+ * Node template for the log entries
709
+ * @property ENTRY_TEMPLATE
710
+ * @static
711
+ * @type {HTMLElement}
712
+ * @default <code>pre</code> element with class yui-log-entry
713
+ */
714
+ ENTRY_TEMPLATE : (function () {
715
+ return make('pre',{ className: 'yui-log-entry' });
716
+ })(),
717
+
718
+ /**
719
+ * Template used for innerHTML of verbose entry output.
720
+ * @property VERBOSE_TEMPLATE
721
+ * @static
722
+ * @default "&lt;p>&lt;span class='{category}'>{label}&lt;/span>{totalTime}ms (+{elapsedTime}) {localTime}:&lt;/p>&lt;p>{sourceAndDetail}&lt;/p>&lt;p>{message}&lt;/p>"
723
+ */
724
+ VERBOSE_TEMPLATE : "<p><span class='{category}'>{label}</span> {totalTime}ms (+{elapsedTime}) {localTime}:</p><p>{sourceAndDetail}</p><p>{message}</p>",
725
+
726
+ /**
727
+ * Template used for innerHTML of compact entry output.
728
+ * @property BASIC_TEMPLATE
729
+ * @static
730
+ * @default "&lt;p>&lt;span class='{category}'>{label}&lt;/span>{totalTime}ms (+{elapsedTime}) {localTime}: {sourceAndDetail}: {message}&lt;/p>"
731
+ */
732
+ BASIC_TEMPLATE : "<p><span class='{category}'>{label}</span> {totalTime}ms (+{elapsedTime}) {localTime}: {sourceAndDetail}: {message}</p>"
733
+ });
734
+
735
+ /////////////////////////////////////////////////////////////////////////////
736
+ //
737
+ // Public member variables
738
+ //
739
+ /////////////////////////////////////////////////////////////////////////////
740
+
741
+ LogReader.prototype = {
742
+ /**
743
+ * Whether or not LogReader is enabled to output log messages.
744
+ *
745
+ * @property logReaderEnabled
746
+ * @type Boolean
747
+ * @default true
748
+ */
749
+ logReaderEnabled : true,
750
+
751
+ /**
752
+ * Public member to access CSS width of the LogReader container.
753
+ *
754
+ * @property width
755
+ * @type String
756
+ */
757
+ width : null,
758
+
759
+ /**
760
+ * Public member to access CSS height of the LogReader container.
761
+ *
762
+ * @property height
763
+ * @type String
764
+ */
765
+ height : null,
766
+
767
+ /**
768
+ * Public member to access CSS top position of the LogReader container.
769
+ *
770
+ * @property top
771
+ * @type String
772
+ */
773
+ top : null,
774
+
775
+ /**
776
+ * Public member to access CSS left position of the LogReader container.
777
+ *
778
+ * @property left
779
+ * @type String
780
+ */
781
+ left : null,
782
+
783
+ /**
784
+ * Public member to access CSS right position of the LogReader container.
785
+ *
786
+ * @property right
787
+ * @type String
788
+ */
789
+ right : null,
790
+
791
+ /**
792
+ * Public member to access CSS bottom position of the LogReader container.
793
+ *
794
+ * @property bottom
795
+ * @type String
796
+ */
797
+ bottom : null,
798
+
799
+ /**
800
+ * Public member to access CSS font size of the LogReader container.
801
+ *
802
+ * @property fontSize
803
+ * @type String
804
+ */
805
+ fontSize : null,
806
+
807
+ /**
808
+ * Whether or not the footer UI is enabled for the LogReader.
809
+ *
810
+ * @property footerEnabled
811
+ * @type Boolean
812
+ * @default true
813
+ */
814
+ footerEnabled : true,
815
+
816
+ /**
817
+ * Whether or not output is verbose (more readable). Setting to true will make
818
+ * output more compact (less readable).
819
+ *
820
+ * @property verboseOutput
821
+ * @type Boolean
822
+ * @default true
823
+ */
824
+ verboseOutput : true,
825
+
826
+ /**
827
+ * Custom output format for log messages. Defaults to null, which falls
828
+ * back to verboseOutput param deciding between LogReader.VERBOSE_TEMPLATE
829
+ * and LogReader.BASIC_TEMPLATE. Use bracketed place holders to mark where
830
+ * message info should go. Available place holder names include:
831
+ * <ul>
832
+ * <li>category</li>
833
+ * <li>label</li>
834
+ * <li>sourceAndDetail</li>
835
+ * <li>message</li>
836
+ * <li>localTime</li>
837
+ * <li>elapsedTime</li>
838
+ * <li>totalTime</li>
839
+ * </ul>
840
+ *
841
+ * @property entryFormat
842
+ * @type String
843
+ * @default null
844
+ */
845
+ entryFormat : null,
846
+
847
+ /**
848
+ * Whether or not newest message is printed on top.
849
+ *
850
+ * @property newestOnTop
851
+ * @type Boolean
852
+ */
853
+ newestOnTop : true,
854
+
855
+ /**
856
+ * Output timeout buffer in milliseconds.
857
+ *
858
+ * @property outputBuffer
859
+ * @type Number
860
+ * @default 100
861
+ */
862
+ outputBuffer : 100,
863
+
864
+ /**
865
+ * Maximum number of messages a LogReader console will display.
866
+ *
867
+ * @property thresholdMax
868
+ * @type Number
869
+ * @default 500
870
+ */
871
+ thresholdMax : 500,
872
+
873
+ /**
874
+ * When a LogReader console reaches its thresholdMax, it will clear out messages
875
+ * and print out the latest thresholdMin number of messages.
876
+ *
877
+ * @property thresholdMin
878
+ * @type Number
879
+ * @default 100
880
+ */
881
+ thresholdMin : 100,
882
+
883
+ /**
884
+ * True when LogReader is in a collapsed state, false otherwise.
885
+ *
886
+ * @property isCollapsed
887
+ * @type Boolean
888
+ * @default false
889
+ */
890
+ isCollapsed : false,
891
+
892
+ /**
893
+ * True when LogReader is in a paused state, false otherwise.
894
+ *
895
+ * @property isPaused
896
+ * @type Boolean
897
+ * @default false
898
+ */
899
+ isPaused : false,
900
+
901
+ /**
902
+ * Enables draggable LogReader if DragDrop Utility is present.
903
+ *
904
+ * @property draggable
905
+ * @type Boolean
906
+ * @default true
907
+ */
908
+ draggable : true,
909
+
910
+ /////////////////////////////////////////////////////////////////////////////
911
+ //
912
+ // Public methods
913
+ //
914
+ /////////////////////////////////////////////////////////////////////////////
915
+
916
+ /**
917
+ * Public accessor to the unique name of the LogReader instance.
918
+ *
919
+ * @method toString
920
+ * @return {String} Unique name of the LogReader instance.
921
+ */
922
+ toString : function() {
923
+ return "LogReader instance" + this._sName;
924
+ },
925
+ /**
926
+ * Pauses output of log messages. While paused, log messages are not lost, but
927
+ * get saved to a buffer and then output upon resume of LogReader.
928
+ *
929
+ * @method pause
930
+ */
931
+ pause : function() {
932
+ this.isPaused = true;
933
+ this._timeout = null;
934
+ this.logReaderEnabled = false;
935
+ if (this._btnPause) {
936
+ this._btnPause.value = "Resume";
937
+ }
938
+ },
939
+
940
+ /**
941
+ * Resumes output of log messages, including outputting any log messages that
942
+ * have been saved to buffer while paused.
943
+ *
944
+ * @method resume
945
+ */
946
+ resume : function() {
947
+ this.isPaused = false;
948
+ this.logReaderEnabled = true;
949
+ this._printBuffer();
950
+ if (this._btnPause) {
951
+ this._btnPause.value = "Pause";
952
+ }
953
+ },
954
+
955
+ /**
956
+ * Adds the UI to the DOM, attaches event listeners, and bootstraps initial
957
+ * UI state.
958
+ *
959
+ * @method render
960
+ */
961
+ render : function () {
962
+ if (this.rendered) {
963
+ return;
964
+ }
965
+
966
+ this._initContainerEl();
967
+
968
+ this._initHeaderEl();
969
+ this._initConsoleEl();
970
+ this._initFooterEl();
971
+
972
+ this._initCategories();
973
+ this._initSources();
974
+
975
+ this._initDragDrop();
976
+
977
+ // Subscribe to Logger custom events
978
+ Logger.newLogEvent.subscribe(this._onNewLog, this);
979
+ Logger.logResetEvent.subscribe(this._onReset, this);
980
+
981
+ Logger.categoryCreateEvent.subscribe(this._onCategoryCreate, this);
982
+ Logger.sourceCreateEvent.subscribe(this._onSourceCreate, this);
983
+
984
+ this.rendered = true;
985
+
986
+ this._filterLogs();
987
+ },
988
+
989
+ /**
990
+ * Removes the UI from the DOM entirely and detaches all event listeners.
991
+ * Implementers should note that Logger will still accumulate messages.
992
+ *
993
+ * @method destroy
994
+ */
995
+ destroy : function () {
996
+ Event.purgeElement(this._elContainer,true);
997
+ this._elContainer.innerHTML = '';
998
+ this._elContainer.parentNode.removeChild(this._elContainer);
999
+
1000
+ this.rendered = false;
1001
+ },
1002
+
1003
+ /**
1004
+ * Hides UI of LogReader. Logging functionality is not disrupted.
1005
+ *
1006
+ * @method hide
1007
+ */
1008
+ hide : function() {
1009
+ this._elContainer.style.display = "none";
1010
+ },
1011
+
1012
+ /**
1013
+ * Shows UI of LogReader. Logging functionality is not disrupted.
1014
+ *
1015
+ * @method show
1016
+ */
1017
+ show : function() {
1018
+ this._elContainer.style.display = "block";
1019
+ },
1020
+
1021
+ /**
1022
+ * Collapses UI of LogReader. Logging functionality is not disrupted.
1023
+ *
1024
+ * @method collapse
1025
+ */
1026
+ collapse : function() {
1027
+ this._elConsole.style.display = "none";
1028
+ if(this._elFt) {
1029
+ this._elFt.style.display = "none";
1030
+ }
1031
+ this._btnCollapse.value = "Expand";
1032
+ this.isCollapsed = true;
1033
+ },
1034
+
1035
+ /**
1036
+ * Expands UI of LogReader. Logging functionality is not disrupted.
1037
+ *
1038
+ * @method expand
1039
+ */
1040
+ expand : function() {
1041
+ this._elConsole.style.display = "block";
1042
+ if(this._elFt) {
1043
+ this._elFt.style.display = "block";
1044
+ }
1045
+ this._btnCollapse.value = "Collapse";
1046
+ this.isCollapsed = false;
1047
+ },
1048
+
1049
+ /**
1050
+ * Returns related checkbox element for given filter (i.e., category or source).
1051
+ *
1052
+ * @method getCheckbox
1053
+ * @param {String} Category or source name.
1054
+ * @return {Array} Array of all filter checkboxes.
1055
+ */
1056
+ getCheckbox : function(filter) {
1057
+ return this._filterCheckboxes[filter];
1058
+ },
1059
+
1060
+ /**
1061
+ * Returns array of enabled categories.
1062
+ *
1063
+ * @method getCategories
1064
+ * @return {String[]} Array of enabled categories.
1065
+ */
1066
+ getCategories : function() {
1067
+ return this._categoryFilters;
1068
+ },
1069
+
1070
+ /**
1071
+ * Shows log messages associated with given category.
1072
+ *
1073
+ * @method showCategory
1074
+ * @param {String} Category name.
1075
+ */
1076
+ showCategory : function(sCategory) {
1077
+ var filtersArray = this._categoryFilters;
1078
+ // Don't do anything if category is already enabled
1079
+ // Use Array.indexOf if available...
1080
+ if(filtersArray.indexOf) {
1081
+ if(filtersArray.indexOf(sCategory) > -1) {
1082
+ return;
1083
+ }
1084
+ }
1085
+ // ...or do it the old-fashioned way
1086
+ else {
1087
+ for(var i=0; i<filtersArray.length; i++) {
1088
+ if(filtersArray[i] === sCategory){
1089
+ return;
1090
+ }
1091
+ }
1092
+ }
1093
+
1094
+ this._categoryFilters.push(sCategory);
1095
+ this._filterLogs();
1096
+ var elCheckbox = this.getCheckbox(sCategory);
1097
+ if(elCheckbox) {
1098
+ elCheckbox.checked = true;
1099
+ }
1100
+ },
1101
+
1102
+ /**
1103
+ * Hides log messages associated with given category.
1104
+ *
1105
+ * @method hideCategory
1106
+ * @param {String} Category name.
1107
+ */
1108
+ hideCategory : function(sCategory) {
1109
+ var filtersArray = this._categoryFilters;
1110
+ for(var i=0; i<filtersArray.length; i++) {
1111
+ if(sCategory == filtersArray[i]) {
1112
+ filtersArray.splice(i, 1);
1113
+ break;
1114
+ }
1115
+ }
1116
+ this._filterLogs();
1117
+ var elCheckbox = this.getCheckbox(sCategory);
1118
+ if(elCheckbox) {
1119
+ elCheckbox.checked = false;
1120
+ }
1121
+ },
1122
+
1123
+ /**
1124
+ * Returns array of enabled sources.
1125
+ *
1126
+ * @method getSources
1127
+ * @return {Array} Array of enabled sources.
1128
+ */
1129
+ getSources : function() {
1130
+ return this._sourceFilters;
1131
+ },
1132
+
1133
+ /**
1134
+ * Shows log messages associated with given source.
1135
+ *
1136
+ * @method showSource
1137
+ * @param {String} Source name.
1138
+ */
1139
+ showSource : function(sSource) {
1140
+ var filtersArray = this._sourceFilters;
1141
+ // Don't do anything if category is already enabled
1142
+ // Use Array.indexOf if available...
1143
+ if(filtersArray.indexOf) {
1144
+ if(filtersArray.indexOf(sSource) > -1) {
1145
+ return;
1146
+ }
1147
+ }
1148
+ // ...or do it the old-fashioned way
1149
+ else {
1150
+ for(var i=0; i<filtersArray.length; i++) {
1151
+ if(sSource == filtersArray[i]){
1152
+ return;
1153
+ }
1154
+ }
1155
+ }
1156
+ filtersArray.push(sSource);
1157
+ this._filterLogs();
1158
+ var elCheckbox = this.getCheckbox(sSource);
1159
+ if(elCheckbox) {
1160
+ elCheckbox.checked = true;
1161
+ }
1162
+ },
1163
+
1164
+ /**
1165
+ * Hides log messages associated with given source.
1166
+ *
1167
+ * @method hideSource
1168
+ * @param {String} Source name.
1169
+ */
1170
+ hideSource : function(sSource) {
1171
+ var filtersArray = this._sourceFilters;
1172
+ for(var i=0; i<filtersArray.length; i++) {
1173
+ if(sSource == filtersArray[i]) {
1174
+ filtersArray.splice(i, 1);
1175
+ break;
1176
+ }
1177
+ }
1178
+ this._filterLogs();
1179
+ var elCheckbox = this.getCheckbox(sSource);
1180
+ if(elCheckbox) {
1181
+ elCheckbox.checked = false;
1182
+ }
1183
+ },
1184
+
1185
+ /**
1186
+ * Does not delete any log messages, but clears all printed log messages from
1187
+ * the console. Log messages will be printed out again if user re-filters. The
1188
+ * static method YAHOO.widget.Logger.reset() should be called in order to
1189
+ * actually delete log messages.
1190
+ *
1191
+ * @method clearConsole
1192
+ */
1193
+ clearConsole : function() {
1194
+ // Clear the buffer of any pending messages
1195
+ this._timeout = null;
1196
+ this._buffer = [];
1197
+ this._consoleMsgCount = 0;
1198
+
1199
+ var elConsole = this._elConsole;
1200
+ elConsole.innerHTML = '';
1201
+ },
1202
+
1203
+ /**
1204
+ * Updates title to given string.
1205
+ *
1206
+ * @method setTitle
1207
+ * @param sTitle {String} New title.
1208
+ */
1209
+ setTitle : function(sTitle) {
1210
+ this._title.innerHTML = this.html2Text(sTitle);
1211
+ },
1212
+
1213
+ /**
1214
+ * Gets timestamp of the last log.
1215
+ *
1216
+ * @method getLastTime
1217
+ * @return {Date} Timestamp of the last log.
1218
+ */
1219
+ getLastTime : function() {
1220
+ return this._lastTime;
1221
+ },
1222
+
1223
+ formatMsg : function (entry) {
1224
+ var entryFormat = this.entryFormat || (this.verboseOutput ?
1225
+ LogReader.VERBOSE_TEMPLATE : LogReader.BASIC_TEMPLATE),
1226
+ info = {
1227
+ category : entry.category,
1228
+
1229
+ // Label for color-coded display
1230
+ label : entry.category.substring(0,4).toUpperCase(),
1231
+
1232
+ sourceAndDetail : entry.sourceDetail ?
1233
+ entry.source + " " + entry.sourceDetail :
1234
+ entry.source,
1235
+
1236
+ // Escape HTML entities in the log message itself for output
1237
+ // to console
1238
+ message : this.html2Text(entry.msg || entry.message || '')
1239
+ };
1240
+
1241
+ // Add time info
1242
+ if (entry.time && entry.time.getTime) {
1243
+ info.localTime = entry.time.toLocaleTimeString ?
1244
+ entry.time.toLocaleTimeString() :
1245
+ entry.time.toString();
1246
+
1247
+ // Calculate the elapsed time to be from the last item that
1248
+ // passed through the filter, not the absolute previous item
1249
+ // in the stack
1250
+ info.elapsedTime = entry.time.getTime() - this.getLastTime();
1251
+
1252
+ info.totalTime = entry.time.getTime() - Logger.getStartTime();
1253
+ }
1254
+
1255
+ var msg = LogReader.ENTRY_TEMPLATE.cloneNode(true);
1256
+ if (this.verboseOutput) {
1257
+ msg.className += ' yui-log-verbose';
1258
+ }
1259
+
1260
+ // Bug 2061169: Workaround for YAHOO.lang.substitute()
1261
+ msg.innerHTML = entryFormat.replace(/\{(\w+)\}/g,
1262
+ function (x, placeholder) {
1263
+ return (placeholder in info) ? info[placeholder] : '';
1264
+ });
1265
+
1266
+ return msg;
1267
+ },
1268
+
1269
+ /**
1270
+ * Converts input chars "<", ">", and "&" to HTML entities.
1271
+ *
1272
+ * @method html2Text
1273
+ * @param sHtml {String} String to convert.
1274
+ * @private
1275
+ */
1276
+ html2Text : function(sHtml) {
1277
+ if(sHtml) {
1278
+ sHtml += "";
1279
+ return sHtml.replace(/&/g, "&#38;").
1280
+ replace(/</g, "&#60;").
1281
+ replace(/>/g, "&#62;");
1282
+ }
1283
+ return "";
1284
+ },
1285
+
1286
+ /////////////////////////////////////////////////////////////////////////////
1287
+ //
1288
+ // Private member variables
1289
+ //
1290
+ /////////////////////////////////////////////////////////////////////////////
1291
+
1292
+ /**
1293
+ * Name of LogReader instance.
1294
+ *
1295
+ * @property _sName
1296
+ * @type String
1297
+ * @private
1298
+ */
1299
+ _sName : null,
1300
+
1301
+ //TODO: remove
1302
+ /**
1303
+ * A class member shared by all LogReaders if a container needs to be
1304
+ * created during instantiation. Will be null if a container element never needs to
1305
+ * be created on the fly, such as when the implementer passes in their own element.
1306
+ *
1307
+ * @property _elDefaultContainer
1308
+ * @type HTMLElement
1309
+ * @private
1310
+ */
1311
+ //YAHOO.widget.LogReader._elDefaultContainer = null;
1312
+
1313
+ /**
1314
+ * Buffer of log message objects for batch output.
1315
+ *
1316
+ * @property _buffer
1317
+ * @type Object[]
1318
+ * @private
1319
+ */
1320
+ _buffer : null,
1321
+
1322
+ /**
1323
+ * Number of log messages output to console.
1324
+ *
1325
+ * @property _consoleMsgCount
1326
+ * @type Number
1327
+ * @default 0
1328
+ * @private
1329
+ */
1330
+ _consoleMsgCount : 0,
1331
+
1332
+ /**
1333
+ * Date of last output log message.
1334
+ *
1335
+ * @property _lastTime
1336
+ * @type Date
1337
+ * @private
1338
+ */
1339
+ _lastTime : null,
1340
+
1341
+ /**
1342
+ * Batched output timeout ID.
1343
+ *
1344
+ * @property _timeout
1345
+ * @type Number
1346
+ * @private
1347
+ */
1348
+ _timeout : null,
1349
+
1350
+ /**
1351
+ * Hash of filters and their related checkbox elements.
1352
+ *
1353
+ * @property _filterCheckboxes
1354
+ * @type Object
1355
+ * @private
1356
+ */
1357
+ _filterCheckboxes : null,
1358
+
1359
+ /**
1360
+ * Array of filters for log message categories.
1361
+ *
1362
+ * @property _categoryFilters
1363
+ * @type String[]
1364
+ * @private
1365
+ */
1366
+ _categoryFilters : null,
1367
+
1368
+ /**
1369
+ * Array of filters for log message sources.
1370
+ *
1371
+ * @property _sourceFilters
1372
+ * @type String[]
1373
+ * @private
1374
+ */
1375
+ _sourceFilters : null,
1376
+
1377
+ /**
1378
+ * LogReader container element.
1379
+ *
1380
+ * @property _elContainer
1381
+ * @type HTMLElement
1382
+ * @private
1383
+ */
1384
+ _elContainer : null,
1385
+
1386
+ /**
1387
+ * LogReader header element.
1388
+ *
1389
+ * @property _elHd
1390
+ * @type HTMLElement
1391
+ * @private
1392
+ */
1393
+ _elHd : null,
1394
+
1395
+ /**
1396
+ * LogReader collapse element.
1397
+ *
1398
+ * @property _elCollapse
1399
+ * @type HTMLElement
1400
+ * @private
1401
+ */
1402
+ _elCollapse : null,
1403
+
1404
+ /**
1405
+ * LogReader collapse button element.
1406
+ *
1407
+ * @property _btnCollapse
1408
+ * @type HTMLElement
1409
+ * @private
1410
+ */
1411
+ _btnCollapse : null,
1412
+
1413
+ /**
1414
+ * LogReader title header element.
1415
+ *
1416
+ * @property _title
1417
+ * @type HTMLElement
1418
+ * @private
1419
+ */
1420
+ _title : null,
1421
+
1422
+ /**
1423
+ * LogReader console element.
1424
+ *
1425
+ * @property _elConsole
1426
+ * @type HTMLElement
1427
+ * @private
1428
+ */
1429
+ _elConsole : null,
1430
+
1431
+ /**
1432
+ * LogReader footer element.
1433
+ *
1434
+ * @property _elFt
1435
+ * @type HTMLElement
1436
+ * @private
1437
+ */
1438
+ _elFt : null,
1439
+
1440
+ /**
1441
+ * LogReader buttons container element.
1442
+ *
1443
+ * @property _elBtns
1444
+ * @type HTMLElement
1445
+ * @private
1446
+ */
1447
+ _elBtns : null,
1448
+
1449
+ /**
1450
+ * Container element for LogReader category filter checkboxes.
1451
+ *
1452
+ * @property _elCategoryFilters
1453
+ * @type HTMLElement
1454
+ * @private
1455
+ */
1456
+ _elCategoryFilters : null,
1457
+
1458
+ /**
1459
+ * Container element for LogReader source filter checkboxes.
1460
+ *
1461
+ * @property _elSourceFilters
1462
+ * @type HTMLElement
1463
+ * @private
1464
+ */
1465
+ _elSourceFilters : null,
1466
+
1467
+ /**
1468
+ * LogReader pause button element.
1469
+ *
1470
+ * @property _btnPause
1471
+ * @type HTMLElement
1472
+ * @private
1473
+ */
1474
+ _btnPause : null,
1475
+
1476
+ /**
1477
+ * Clear button element.
1478
+ *
1479
+ * @property _btnClear
1480
+ * @type HTMLElement
1481
+ * @private
1482
+ */
1483
+ _btnClear : null,
1484
+
1485
+ /////////////////////////////////////////////////////////////////////////////
1486
+ //
1487
+ // Private methods
1488
+ //
1489
+ /////////////////////////////////////////////////////////////////////////////
1490
+
1491
+ /**
1492
+ * Initializes the instance's message buffer, start time, etc
1493
+ *
1494
+ * @method _init
1495
+ * @param container {String|HTMLElement} (optional) the render target
1496
+ * @param config {Object} (optional) instance configuration
1497
+ * @protected
1498
+ */
1499
+ _init : function (container, config) {
1500
+ // Internal vars
1501
+ this._buffer = []; // output buffer
1502
+ this._filterCheckboxes = {}; // pointers to checkboxes
1503
+ this._lastTime = Logger.getStartTime(); // timestamp of last log message to console
1504
+
1505
+ // Parse config vars here
1506
+ if (config && (config.constructor == Object)) {
1507
+ for(var param in config) {
1508
+ if (config.hasOwnProperty(param)) {
1509
+ this[param] = config[param];
1510
+ }
1511
+ }
1512
+ }
1513
+
1514
+ this._elContainer = Dom.get(container);
1515
+
1516
+ YAHOO.log("LogReader initialized", null, this.toString());
1517
+ },
1518
+
1519
+ /**
1520
+ * Initializes the primary container element.
1521
+ *
1522
+ * @method _initContainerEl
1523
+ * @private
1524
+ */
1525
+ _initContainerEl : function() {
1526
+
1527
+ // Default the container if unset or not a div
1528
+ if(!this._elContainer || !/div$/i.test(this._elContainer.tagName)) {
1529
+ this._elContainer = d.body.insertBefore(make("div"),d.body.firstChild);
1530
+ // Only position absolutely if an in-DOM element is not supplied
1531
+ Dom.addClass(this._elContainer,"yui-log-container");
1532
+ }
1533
+
1534
+ Dom.addClass(this._elContainer,"yui-log");
1535
+
1536
+ // If implementer has provided container values, trust and set those
1537
+ var style = this._elContainer.style,
1538
+ styleProps = ['width','right','top','fontSize'],
1539
+ prop,i;
1540
+
1541
+ for (i = styleProps.length - 1; i >= 0; --i) {
1542
+ prop = styleProps[i];
1543
+ if (this[prop]){
1544
+ style[prop] = this[prop];
1545
+ }
1546
+ }
1547
+
1548
+ if(this.left) {
1549
+ style.left = this.left;
1550
+ style.right = "auto";
1551
+ }
1552
+ if(this.bottom) {
1553
+ style.bottom = this.bottom;
1554
+ style.top = "auto";
1555
+ }
1556
+
1557
+ // Opera needs a little prodding to reflow sometimes
1558
+ if (YAHOO.env.ua.opera) {
1559
+ d.body.style += '';
1560
+ }
1561
+
1562
+ },
1563
+
1564
+ /**
1565
+ * Initializes the header element.
1566
+ *
1567
+ * @method _initHeaderEl
1568
+ * @private
1569
+ */
1570
+ _initHeaderEl : function() {
1571
+ // Destroy header if present
1572
+ if(this._elHd) {
1573
+ // Unhook DOM events
1574
+ Event.purgeElement(this._elHd, true);
1575
+
1576
+ // Remove DOM elements
1577
+ this._elHd.innerHTML = "";
1578
+ }
1579
+
1580
+ // Create header
1581
+ // TODO: refactor this into an innerHTML
1582
+ this._elHd = make("div",{
1583
+ id: 'yui-log-hd' + this._sName,
1584
+ className: "yui-log-hd"
1585
+ });
1586
+
1587
+ this._elCollapse = make("div",{ className: 'yui-log-btns' });
1588
+
1589
+ this._btnCollapse = make("input",{
1590
+ type: 'button',
1591
+ className: 'yui-log-button',
1592
+ value: 'Collapse'
1593
+ });
1594
+ Event.on(this._btnCollapse,'click',this._onClickCollapseBtn,this);
1595
+
1596
+
1597
+ this._title = make("h4",{ innerHTML : "Logger Console" });
1598
+
1599
+ this._elCollapse.appendChild(this._btnCollapse);
1600
+ this._elHd.appendChild(this._elCollapse);
1601
+ this._elHd.appendChild(this._title);
1602
+ this._elContainer.appendChild(this._elHd);
1603
+ },
1604
+
1605
+ /**
1606
+ * Initializes the console element.
1607
+ *
1608
+ * @method _initConsoleEl
1609
+ * @private
1610
+ */
1611
+ _initConsoleEl : function() {
1612
+ // Destroy console
1613
+ if(this._elConsole) {
1614
+ // Unhook DOM events
1615
+ Event.purgeElement(this._elConsole, true);
1616
+
1617
+ // Remove DOM elements
1618
+ this._elConsole.innerHTML = "";
1619
+ }
1620
+
1621
+ // Ceate console
1622
+ this._elConsole = make("div", { className: "yui-log-bd" });
1623
+
1624
+ // If implementer has provided console, trust and set those
1625
+ if(this.height) {
1626
+ this._elConsole.style.height = this.height;
1627
+ }
1628
+
1629
+ this._elContainer.appendChild(this._elConsole);
1630
+ },
1631
+
1632
+ /**
1633
+ * Initializes the footer element.
1634
+ *
1635
+ * @method _initFooterEl
1636
+ * @private
1637
+ */
1638
+ _initFooterEl : function() {
1639
+ // Don't create footer elements if footer is disabled
1640
+ if(this.footerEnabled) {
1641
+ // Destroy console
1642
+ if(this._elFt) {
1643
+ // Unhook DOM events
1644
+ Event.purgeElement(this._elFt, true);
1645
+
1646
+ // Remove DOM elements
1647
+ this._elFt.innerHTML = "";
1648
+ }
1649
+
1650
+ // TODO: use innerHTML
1651
+ this._elFt = make("div",{ className: "yui-log-ft" });
1652
+ this._elBtns = make("div", { className: "yui-log-btns" });
1653
+ this._btnPause = make("input", {
1654
+ type: "button",
1655
+ className: "yui-log-button",
1656
+ value: "Pause"
1657
+ });
1658
+
1659
+ Event.on(this._btnPause,'click',this._onClickPauseBtn,this);
1660
+
1661
+ this._btnClear = make("input", {
1662
+ type: "button",
1663
+ className: "yui-log-button",
1664
+ value: "Clear"
1665
+ });
1666
+
1667
+ Event.on(this._btnClear,'click',this._onClickClearBtn,this);
1668
+
1669
+ this._elCategoryFilters = make("div", { className: "yui-log-categoryfilters" });
1670
+ this._elSourceFilters = make("div", { className: "yui-log-sourcefilters" });
1671
+
1672
+ this._elBtns.appendChild(this._btnPause);
1673
+ this._elBtns.appendChild(this._btnClear);
1674
+ this._elFt.appendChild(this._elBtns);
1675
+ this._elFt.appendChild(this._elCategoryFilters);
1676
+ this._elFt.appendChild(this._elSourceFilters);
1677
+ this._elContainer.appendChild(this._elFt);
1678
+ }
1679
+ },
1680
+
1681
+ /**
1682
+ * Initializes Drag and Drop on the header element.
1683
+ *
1684
+ * @method _initDragDrop
1685
+ * @private
1686
+ */
1687
+ _initDragDrop : function() {
1688
+ // If Drag and Drop utility is available...
1689
+ // ...and draggable is true...
1690
+ // ...then make the header draggable
1691
+ if(u.DD && this.draggable && this._elHd) {
1692
+ var ylog_dd = new u.DD(this._elContainer);
1693
+ ylog_dd.setHandleElId(this._elHd.id);
1694
+ //TODO: use class name
1695
+ this._elHd.style.cursor = "move";
1696
+ }
1697
+ },
1698
+
1699
+ /**
1700
+ * Initializes category filters.
1701
+ *
1702
+ * @method _initCategories
1703
+ * @private
1704
+ */
1705
+ _initCategories : function() {
1706
+ // Initialize category filters
1707
+ this._categoryFilters = [];
1708
+ var aInitialCategories = Logger.categories;
1709
+
1710
+ for(var j=0; j < aInitialCategories.length; j++) {
1711
+ var sCategory = aInitialCategories[j];
1712
+
1713
+ // Add category to the internal array of filters
1714
+ this._categoryFilters.push(sCategory);
1715
+
1716
+ // Add checkbox element if UI is enabled
1717
+ if(this._elCategoryFilters) {
1718
+ this._createCategoryCheckbox(sCategory);
1719
+ }
1720
+ }
1721
+ },
1722
+
1723
+ /**
1724
+ * Initializes source filters.
1725
+ *
1726
+ * @method _initSources
1727
+ * @private
1728
+ */
1729
+ _initSources : function() {
1730
+ // Initialize source filters
1731
+ this._sourceFilters = [];
1732
+ var aInitialSources = Logger.sources;
1733
+
1734
+ for(var j=0; j < aInitialSources.length; j++) {
1735
+ var sSource = aInitialSources[j];
1736
+
1737
+ // Add source to the internal array of filters
1738
+ this._sourceFilters.push(sSource);
1739
+
1740
+ // Add checkbox element if UI is enabled
1741
+ if(this._elSourceFilters) {
1742
+ this._createSourceCheckbox(sSource);
1743
+ }
1744
+ }
1745
+ },
1746
+
1747
+ /**
1748
+ * Creates the UI for a category filter in the LogReader footer element.
1749
+ *
1750
+ * @method _createCategoryCheckbox
1751
+ * @param sCategory {String} Category name.
1752
+ * @private
1753
+ */
1754
+ _createCategoryCheckbox : function(sCategory) {
1755
+ if(this._elFt) {
1756
+ var filter = make("span",{ className: "yui-log-filtergrp" }),
1757
+ check = make("input", {
1758
+ id: "yui-log-filter-" + sCategory + this._sName,
1759
+ className: "yui-log-filter-" + sCategory,
1760
+ type: "checkbox",
1761
+ category: sCategory
1762
+ }),
1763
+ label = make("label", {
1764
+ htmlFor: check.id,
1765
+ className: sCategory,
1766
+ innerHTML: sCategory
1767
+ });
1768
+
1769
+
1770
+ // Subscribe to the click event
1771
+ Event.on(check,'click',this._onCheckCategory,this);
1772
+
1773
+ this._filterCheckboxes[sCategory] = check;
1774
+
1775
+ // Append el at the end so IE 5.5 can set "type" attribute
1776
+ // and THEN set checked property
1777
+ filter.appendChild(check);
1778
+ filter.appendChild(label);
1779
+ this._elCategoryFilters.appendChild(filter);
1780
+ check.checked = true;
1781
+ }
1782
+ },
1783
+
1784
+ /**
1785
+ * Creates a checkbox in the LogReader footer element to filter by source.
1786
+ *
1787
+ * @method _createSourceCheckbox
1788
+ * @param sSource {String} Source name.
1789
+ * @private
1790
+ */
1791
+ _createSourceCheckbox : function(sSource) {
1792
+ if(this._elFt) {
1793
+ var filter = make("span",{ className: "yui-log-filtergrp" }),
1794
+ check = make("input", {
1795
+ id: "yui-log-filter-" + sSource + this._sName,
1796
+ className: "yui-log-filter-" + sSource,
1797
+ type: "checkbox",
1798
+ source: sSource
1799
+ }),
1800
+ label = make("label", {
1801
+ htmlFor: check.id,
1802
+ className: sSource,
1803
+ innerHTML: sSource
1804
+ });
1805
+
1806
+
1807
+ // Subscribe to the click event
1808
+ Event.on(check,'click',this._onCheckSource,this);
1809
+
1810
+ this._filterCheckboxes[sSource] = check;
1811
+
1812
+ // Append el at the end so IE 5.5 can set "type" attribute
1813
+ // and THEN set checked property
1814
+ filter.appendChild(check);
1815
+ filter.appendChild(label);
1816
+ this._elSourceFilters.appendChild(filter);
1817
+ check.checked = true;
1818
+ }
1819
+ },
1820
+
1821
+ /**
1822
+ * Reprints all log messages in the stack through filters.
1823
+ *
1824
+ * @method _filterLogs
1825
+ * @private
1826
+ */
1827
+ _filterLogs : function() {
1828
+ // Reprint stack with new filters
1829
+ if (this._elConsole !== null) {
1830
+ this.clearConsole();
1831
+ this._printToConsole(Logger.getStack());
1832
+ }
1833
+ },
1834
+
1835
+ /**
1836
+ * Sends buffer of log messages to output and clears buffer.
1837
+ *
1838
+ * @method _printBuffer
1839
+ * @private
1840
+ */
1841
+ _printBuffer : function() {
1842
+ this._timeout = null;
1843
+
1844
+ if(this._elConsole !== null) {
1845
+ var thresholdMax = this.thresholdMax;
1846
+ thresholdMax = (thresholdMax && !isNaN(thresholdMax)) ? thresholdMax : 500;
1847
+ if(this._consoleMsgCount < thresholdMax) {
1848
+ var entries = [];
1849
+ for (var i=0; i<this._buffer.length; i++) {
1850
+ entries[i] = this._buffer[i];
1851
+ }
1852
+ this._buffer = [];
1853
+ this._printToConsole(entries);
1854
+ }
1855
+ else {
1856
+ this._filterLogs();
1857
+ }
1858
+
1859
+ if(!this.newestOnTop) {
1860
+ this._elConsole.scrollTop = this._elConsole.scrollHeight;
1861
+ }
1862
+ }
1863
+ },
1864
+
1865
+ /**
1866
+ * Cycles through an array of log messages, and outputs each one to the console
1867
+ * if its category has not been filtered out.
1868
+ *
1869
+ * @method _printToConsole
1870
+ * @param aEntries {Object[]} Array of LogMsg objects to output to console.
1871
+ * @private
1872
+ */
1873
+ _printToConsole : function(aEntries) {
1874
+ // Manage the number of messages displayed in the console
1875
+ var entriesLen = aEntries.length,
1876
+ df = d.createDocumentFragment(),
1877
+ msgHTML = [],
1878
+ thresholdMin = this.thresholdMin,
1879
+ sourceFiltersLen = this._sourceFilters.length,
1880
+ categoryFiltersLen = this._categoryFilters.length,
1881
+ entriesStartIndex,
1882
+ i, j, msg, before;
1883
+
1884
+ if(isNaN(thresholdMin) || (thresholdMin > this.thresholdMax)) {
1885
+ thresholdMin = 0;
1886
+ }
1887
+ entriesStartIndex = (entriesLen > thresholdMin) ? (entriesLen - thresholdMin) : 0;
1888
+
1889
+ // Iterate through all log entries
1890
+ for(i=entriesStartIndex; i<entriesLen; i++) {
1891
+ // Print only the ones that filter through
1892
+ var okToPrint = false,
1893
+ okToFilterCats = false,
1894
+ entry = aEntries[i],
1895
+ source = entry.source,
1896
+ category = entry.category;
1897
+
1898
+ for(j=0; j<sourceFiltersLen; j++) {
1899
+ if(source == this._sourceFilters[j]) {
1900
+ okToFilterCats = true;
1901
+ break;
1902
+ }
1903
+ }
1904
+ if(okToFilterCats) {
1905
+ for(j=0; j<categoryFiltersLen; j++) {
1906
+ if(category == this._categoryFilters[j]) {
1907
+ okToPrint = true;
1908
+ break;
1909
+ }
1910
+ }
1911
+ }
1912
+ if(okToPrint) {
1913
+ // Start from 0ms elapsed time
1914
+ if (this._consoleMsgCount === 0) {
1915
+ this._lastTime = entry.time.getTime();
1916
+ }
1917
+
1918
+ msg = this.formatMsg(entry);
1919
+ if (typeof msg === 'string') {
1920
+ msgHTML[msgHTML.length] = msg;
1921
+ } else {
1922
+ df.insertBefore(msg, this.newestOnTop ?
1923
+ df.firstChild || null : null);
1924
+ }
1925
+ this._consoleMsgCount++;
1926
+ this._lastTime = entry.time.getTime();
1927
+ }
1928
+ }
1929
+
1930
+ if (msgHTML.length) {
1931
+ msgHTML.splice(0,0,this._elConsole.innerHTML);
1932
+ this._elConsole.innerHTML = this.newestOnTop ?
1933
+ msgHTML.reverse().join('') :
1934
+ msgHTML.join('');
1935
+ } else if (df.firstChild) {
1936
+ this._elConsole.insertBefore(df, this.newestOnTop ?
1937
+ this._elConsole.firstChild || null : null);
1938
+ }
1939
+ },
1940
+
1941
+ /////////////////////////////////////////////////////////////////////////////
1942
+ //
1943
+ // Private event handlers
1944
+ //
1945
+ /////////////////////////////////////////////////////////////////////////////
1946
+
1947
+ /**
1948
+ * Handles Logger's categoryCreateEvent.
1949
+ *
1950
+ * @method _onCategoryCreate
1951
+ * @param sType {String} The event.
1952
+ * @param aArgs {Object[]} Data passed from event firer.
1953
+ * @param oSelf {Object} The LogReader instance.
1954
+ * @private
1955
+ */
1956
+ _onCategoryCreate : function(sType, aArgs, oSelf) {
1957
+ var category = aArgs[0];
1958
+
1959
+ // Add category to the internal array of filters
1960
+ oSelf._categoryFilters.push(category);
1961
+
1962
+ if(oSelf._elFt) {
1963
+ oSelf._createCategoryCheckbox(category);
1964
+ }
1965
+ },
1966
+
1967
+ /**
1968
+ * Handles Logger's sourceCreateEvent.
1969
+ *
1970
+ * @method _onSourceCreate
1971
+ * @param sType {String} The event.
1972
+ * @param aArgs {Object[]} Data passed from event firer.
1973
+ * @param oSelf {Object} The LogReader instance.
1974
+ * @private
1975
+ */
1976
+ _onSourceCreate : function(sType, aArgs, oSelf) {
1977
+ var source = aArgs[0];
1978
+
1979
+ // Add source to the internal array of filters
1980
+ oSelf._sourceFilters.push(source);
1981
+
1982
+ if(oSelf._elFt) {
1983
+ oSelf._createSourceCheckbox(source);
1984
+ }
1985
+ },
1986
+
1987
+ /**
1988
+ * Handles check events on the category filter checkboxes.
1989
+ *
1990
+ * @method _onCheckCategory
1991
+ * @param v {HTMLEvent} The click event.
1992
+ * @param oSelf {Object} The LogReader instance.
1993
+ * @private
1994
+ */
1995
+ _onCheckCategory : function(v, oSelf) {
1996
+ var category = this.category;
1997
+ if(!this.checked) {
1998
+ oSelf.hideCategory(category);
1999
+ }
2000
+ else {
2001
+ oSelf.showCategory(category);
2002
+ }
2003
+ },
2004
+
2005
+ /**
2006
+ * Handles check events on the category filter checkboxes.
2007
+ *
2008
+ * @method _onCheckSource
2009
+ * @param v {HTMLEvent} The click event.
2010
+ * @param oSelf {Object} The LogReader instance.
2011
+ * @private
2012
+ */
2013
+ _onCheckSource : function(v, oSelf) {
2014
+ var source = this.source;
2015
+ if(!this.checked) {
2016
+ oSelf.hideSource(source);
2017
+ }
2018
+ else {
2019
+ oSelf.showSource(source);
2020
+ }
2021
+ },
2022
+
2023
+ /**
2024
+ * Handles click events on the collapse button.
2025
+ *
2026
+ * @method _onClickCollapseBtn
2027
+ * @param v {HTMLEvent} The click event.
2028
+ * @param oSelf {Object} The LogReader instance
2029
+ * @private
2030
+ */
2031
+ _onClickCollapseBtn : function(v, oSelf) {
2032
+ if(!oSelf.isCollapsed) {
2033
+ oSelf.collapse();
2034
+ }
2035
+ else {
2036
+ oSelf.expand();
2037
+ }
2038
+ },
2039
+
2040
+ /**
2041
+ * Handles click events on the pause button.
2042
+ *
2043
+ * @method _onClickPauseBtn
2044
+ * @param v {HTMLEvent} The click event.
2045
+ * @param oSelf {Object} The LogReader instance.
2046
+ * @private
2047
+ */
2048
+ _onClickPauseBtn : function(v, oSelf) {
2049
+ if(!oSelf.isPaused) {
2050
+ oSelf.pause();
2051
+ }
2052
+ else {
2053
+ oSelf.resume();
2054
+ }
2055
+ },
2056
+
2057
+ /**
2058
+ * Handles click events on the clear button.
2059
+ *
2060
+ * @method _onClickClearBtn
2061
+ * @param v {HTMLEvent} The click event.
2062
+ * @param oSelf {Object} The LogReader instance.
2063
+ * @private
2064
+ */
2065
+ _onClickClearBtn : function(v, oSelf) {
2066
+ oSelf.clearConsole();
2067
+ },
2068
+
2069
+ /**
2070
+ * Handles Logger's newLogEvent.
2071
+ *
2072
+ * @method _onNewLog
2073
+ * @param sType {String} The event.
2074
+ * @param aArgs {Object[]} Data passed from event firer.
2075
+ * @param oSelf {Object} The LogReader instance.
2076
+ * @private
2077
+ */
2078
+ _onNewLog : function(sType, aArgs, oSelf) {
2079
+ var logEntry = aArgs[0];
2080
+ oSelf._buffer.push(logEntry);
2081
+
2082
+ if (oSelf.logReaderEnabled === true && oSelf._timeout === null) {
2083
+ oSelf._timeout = setTimeout(function(){oSelf._printBuffer();}, oSelf.outputBuffer);
2084
+ }
2085
+ },
2086
+
2087
+ /**
2088
+ * Handles Logger's resetEvent.
2089
+ *
2090
+ * @method _onReset
2091
+ * @param sType {String} The event.
2092
+ * @param aArgs {Object[]} Data passed from event firer.
2093
+ * @param oSelf {Object} The LogReader instance.
2094
+ * @private
2095
+ */
2096
+ _onReset : function(sType, aArgs, oSelf) {
2097
+ oSelf._filterLogs();
2098
+ }
2099
+ };
2100
+
2101
+ YAHOO.widget.LogReader = LogReader;
2102
+
2103
+ })();
2104
+ YAHOO.register("logger", YAHOO.widget.Logger, {version: "2.8.1", build: "19"});