jsduck 2.0.pre4 → 3.0.pre

Sign up to get free protection for your applications and to get access to all the features.
Files changed (485) hide show
  1. data/.gitignore +1 -0
  2. data/README.md +126 -34
  3. data/Rakefile +343 -115
  4. data/bin/jsduck +4 -196
  5. data/example.js +144 -0
  6. data/jsduck.gemspec +4 -9
  7. data/lib/jsduck/aggregator.rb +1 -1
  8. data/lib/jsduck/app.rb +165 -182
  9. data/lib/jsduck/categories.rb +17 -2
  10. data/lib/jsduck/class.rb +10 -0
  11. data/lib/jsduck/class_formatter.rb +77 -0
  12. data/lib/jsduck/doc_formatter.rb +42 -4
  13. data/lib/jsduck/doc_parser.rb +64 -10
  14. data/lib/jsduck/examples.rb +33 -0
  15. data/lib/jsduck/exporter.rb +18 -42
  16. data/lib/jsduck/guides.rb +41 -74
  17. data/lib/jsduck/icons.rb +28 -0
  18. data/lib/jsduck/js_literal_builder.rb +21 -0
  19. data/lib/jsduck/js_literal_parser.rb +106 -0
  20. data/lib/jsduck/js_parser.rb +115 -97
  21. data/lib/jsduck/json_duck.rb +45 -0
  22. data/lib/jsduck/lexer.rb +55 -25
  23. data/lib/jsduck/lint.rb +84 -0
  24. data/lib/jsduck/merger.rb +91 -21
  25. data/lib/jsduck/options.rb +320 -0
  26. data/lib/jsduck/relations.rb +7 -1
  27. data/lib/jsduck/renderer.rb +315 -0
  28. data/lib/jsduck/source_writer.rb +2 -2
  29. data/lib/jsduck/type_parser.rb +85 -0
  30. data/lib/jsduck/videos.rb +33 -0
  31. data/lib/jsduck/welcome.rb +21 -0
  32. data/{template → template-min}/README.md +0 -0
  33. data/template-min/app.js +1 -0
  34. data/template-min/build-js.html +25 -0
  35. data/template-min/egIframe.html +24 -0
  36. data/template-min/extjs/bootstrap.js +73 -0
  37. data/template-min/extjs/ext-all-debug.js +90047 -0
  38. data/{template → template-min}/extjs/ext-all.js +0 -0
  39. data/template-min/extjs/resources/css/ext-all.css +1 -0
  40. data/template-min/extjs/resources/themes/images/default/boundlist/trigger-arrow.png +0 -0
  41. data/template-min/extjs/resources/themes/images/default/box/corners-blue.gif +0 -0
  42. data/template-min/extjs/resources/themes/images/default/box/corners.gif +0 -0
  43. data/template-min/extjs/resources/themes/images/default/box/l-blue.gif +0 -0
  44. data/template-min/extjs/resources/themes/images/default/box/l.gif +0 -0
  45. data/template-min/extjs/resources/themes/images/default/box/r-blue.gif +0 -0
  46. data/template-min/extjs/resources/themes/images/default/box/r.gif +0 -0
  47. data/template-min/extjs/resources/themes/images/default/box/tb-blue.gif +0 -0
  48. data/template-min/extjs/resources/themes/images/default/box/tb.gif +0 -0
  49. data/template-min/extjs/resources/themes/images/default/btn/btn-default-large-bg.gif +0 -0
  50. data/template-min/extjs/resources/themes/images/default/btn/btn-default-large-corners.gif +0 -0
  51. data/template-min/extjs/resources/themes/images/default/btn/btn-default-large-disabled-bg.gif +0 -0
  52. data/template-min/extjs/resources/themes/images/default/btn/btn-default-large-disabled-corners.gif +0 -0
  53. data/template-min/extjs/resources/themes/images/default/btn/btn-default-large-disabled-sides.gif +0 -0
  54. data/template-min/extjs/resources/themes/images/default/btn/btn-default-large-focus-bg.gif +0 -0
  55. data/template-min/extjs/resources/themes/images/default/btn/btn-default-large-focus-corners.gif +0 -0
  56. data/template-min/extjs/resources/themes/images/default/btn/btn-default-large-focus-sides.gif +0 -0
  57. data/template-min/extjs/resources/themes/images/default/btn/btn-default-large-over-bg.gif +0 -0
  58. data/template-min/extjs/resources/themes/images/default/btn/btn-default-large-over-corners.gif +0 -0
  59. data/template-min/extjs/resources/themes/images/default/btn/btn-default-large-over-sides.gif +0 -0
  60. data/template-min/extjs/resources/themes/images/default/btn/btn-default-large-pressed-bg.gif +0 -0
  61. data/template-min/extjs/resources/themes/images/default/btn/btn-default-large-pressed-corners.gif +0 -0
  62. data/template-min/extjs/resources/themes/images/default/btn/btn-default-large-pressed-sides.gif +0 -0
  63. data/template-min/extjs/resources/themes/images/default/btn/btn-default-large-sides.gif +0 -0
  64. data/template-min/extjs/resources/themes/images/default/btn/btn-default-medium-bg.gif +0 -0
  65. data/template-min/extjs/resources/themes/images/default/btn/btn-default-medium-corners.gif +0 -0
  66. data/template-min/extjs/resources/themes/images/default/btn/btn-default-medium-disabled-bg.gif +0 -0
  67. data/template-min/extjs/resources/themes/images/default/btn/btn-default-medium-disabled-corners.gif +0 -0
  68. data/template-min/extjs/resources/themes/images/default/btn/btn-default-medium-disabled-sides.gif +0 -0
  69. data/template-min/extjs/resources/themes/images/default/btn/btn-default-medium-focus-bg.gif +0 -0
  70. data/template-min/extjs/resources/themes/images/default/btn/btn-default-medium-focus-corners.gif +0 -0
  71. data/template-min/extjs/resources/themes/images/default/btn/btn-default-medium-focus-sides.gif +0 -0
  72. data/template-min/extjs/resources/themes/images/default/btn/btn-default-medium-over-bg.gif +0 -0
  73. data/template-min/extjs/resources/themes/images/default/btn/btn-default-medium-over-corners.gif +0 -0
  74. data/template-min/extjs/resources/themes/images/default/btn/btn-default-medium-over-sides.gif +0 -0
  75. data/template-min/extjs/resources/themes/images/default/btn/btn-default-medium-pressed-bg.gif +0 -0
  76. data/template-min/extjs/resources/themes/images/default/btn/btn-default-medium-pressed-corners.gif +0 -0
  77. data/template-min/extjs/resources/themes/images/default/btn/btn-default-medium-pressed-sides.gif +0 -0
  78. data/template-min/extjs/resources/themes/images/default/btn/btn-default-medium-sides.gif +0 -0
  79. data/template-min/extjs/resources/themes/images/default/btn/btn-default-small-bg.gif +0 -0
  80. data/template-min/extjs/resources/themes/images/default/btn/btn-default-small-corners.gif +0 -0
  81. data/template-min/extjs/resources/themes/images/default/btn/btn-default-small-disabled-bg.gif +0 -0
  82. data/template-min/extjs/resources/themes/images/default/btn/btn-default-small-disabled-corners.gif +0 -0
  83. data/template-min/extjs/resources/themes/images/default/btn/btn-default-small-disabled-sides.gif +0 -0
  84. data/template-min/extjs/resources/themes/images/default/btn/btn-default-small-focus-bg.gif +0 -0
  85. data/template-min/extjs/resources/themes/images/default/btn/btn-default-small-focus-corners.gif +0 -0
  86. data/template-min/extjs/resources/themes/images/default/btn/btn-default-small-focus-sides.gif +0 -0
  87. data/template-min/extjs/resources/themes/images/default/btn/btn-default-small-over-bg.gif +0 -0
  88. data/template-min/extjs/resources/themes/images/default/btn/btn-default-small-over-corners.gif +0 -0
  89. data/template-min/extjs/resources/themes/images/default/btn/btn-default-small-over-sides.gif +0 -0
  90. data/template-min/extjs/resources/themes/images/default/btn/btn-default-small-pressed-bg.gif +0 -0
  91. data/template-min/extjs/resources/themes/images/default/btn/btn-default-small-pressed-corners.gif +0 -0
  92. data/template-min/extjs/resources/themes/images/default/btn/btn-default-small-pressed-sides.gif +0 -0
  93. data/template-min/extjs/resources/themes/images/default/btn/btn-default-small-sides.gif +0 -0
  94. data/template-min/extjs/resources/themes/images/default/btn/btn-default-toolbar-large-corners.gif +0 -0
  95. data/template-min/extjs/resources/themes/images/default/btn/btn-default-toolbar-large-disabled-corners.gif +0 -0
  96. data/template-min/extjs/resources/themes/images/default/btn/btn-default-toolbar-large-disabled-sides.gif +0 -0
  97. data/template-min/extjs/resources/themes/images/default/btn/btn-default-toolbar-large-focus-bg.gif +0 -0
  98. data/template-min/extjs/resources/themes/images/default/btn/btn-default-toolbar-large-focus-corners.gif +0 -0
  99. data/template-min/extjs/resources/themes/images/default/btn/btn-default-toolbar-large-focus-sides.gif +0 -0
  100. data/template-min/extjs/resources/themes/images/default/btn/btn-default-toolbar-large-over-bg.gif +0 -0
  101. data/template-min/extjs/resources/themes/images/default/btn/btn-default-toolbar-large-over-corners.gif +0 -0
  102. data/template-min/extjs/resources/themes/images/default/btn/btn-default-toolbar-large-over-sides.gif +0 -0
  103. data/template-min/extjs/resources/themes/images/default/btn/btn-default-toolbar-large-pressed-bg.gif +0 -0
  104. data/template-min/extjs/resources/themes/images/default/btn/btn-default-toolbar-large-pressed-corners.gif +0 -0
  105. data/template-min/extjs/resources/themes/images/default/btn/btn-default-toolbar-large-pressed-sides.gif +0 -0
  106. data/template-min/extjs/resources/themes/images/default/btn/btn-default-toolbar-large-sides.gif +0 -0
  107. data/template-min/extjs/resources/themes/images/default/btn/btn-default-toolbar-medium-corners.gif +0 -0
  108. data/template-min/extjs/resources/themes/images/default/btn/btn-default-toolbar-medium-disabled-corners.gif +0 -0
  109. data/template-min/extjs/resources/themes/images/default/btn/btn-default-toolbar-medium-disabled-sides.gif +0 -0
  110. data/template-min/extjs/resources/themes/images/default/btn/btn-default-toolbar-medium-focus-bg.gif +0 -0
  111. data/template-min/extjs/resources/themes/images/default/btn/btn-default-toolbar-medium-focus-corners.gif +0 -0
  112. data/template-min/extjs/resources/themes/images/default/btn/btn-default-toolbar-medium-focus-sides.gif +0 -0
  113. data/template-min/extjs/resources/themes/images/default/btn/btn-default-toolbar-medium-over-bg.gif +0 -0
  114. data/template-min/extjs/resources/themes/images/default/btn/btn-default-toolbar-medium-over-corners.gif +0 -0
  115. data/template-min/extjs/resources/themes/images/default/btn/btn-default-toolbar-medium-over-sides.gif +0 -0
  116. data/template-min/extjs/resources/themes/images/default/btn/btn-default-toolbar-medium-pressed-bg.gif +0 -0
  117. data/template-min/extjs/resources/themes/images/default/btn/btn-default-toolbar-medium-pressed-corners.gif +0 -0
  118. data/template-min/extjs/resources/themes/images/default/btn/btn-default-toolbar-medium-pressed-sides.gif +0 -0
  119. data/template-min/extjs/resources/themes/images/default/btn/btn-default-toolbar-medium-sides.gif +0 -0
  120. data/template-min/extjs/resources/themes/images/default/btn/btn-default-toolbar-small-corners.gif +0 -0
  121. data/template-min/extjs/resources/themes/images/default/btn/btn-default-toolbar-small-disabled-corners.gif +0 -0
  122. data/template-min/extjs/resources/themes/images/default/btn/btn-default-toolbar-small-disabled-sides.gif +0 -0
  123. data/template-min/extjs/resources/themes/images/default/btn/btn-default-toolbar-small-focus-bg.gif +0 -0
  124. data/template-min/extjs/resources/themes/images/default/btn/btn-default-toolbar-small-focus-corners.gif +0 -0
  125. data/template-min/extjs/resources/themes/images/default/btn/btn-default-toolbar-small-focus-sides.gif +0 -0
  126. data/template-min/extjs/resources/themes/images/default/btn/btn-default-toolbar-small-over-bg.gif +0 -0
  127. data/template-min/extjs/resources/themes/images/default/btn/btn-default-toolbar-small-over-corners.gif +0 -0
  128. data/template-min/extjs/resources/themes/images/default/btn/btn-default-toolbar-small-over-sides.gif +0 -0
  129. data/template-min/extjs/resources/themes/images/default/btn/btn-default-toolbar-small-pressed-bg.gif +0 -0
  130. data/template-min/extjs/resources/themes/images/default/btn/btn-default-toolbar-small-pressed-corners.gif +0 -0
  131. data/template-min/extjs/resources/themes/images/default/btn/btn-default-toolbar-small-pressed-sides.gif +0 -0
  132. data/template-min/extjs/resources/themes/images/default/btn/btn-default-toolbar-small-sides.gif +0 -0
  133. data/template-min/extjs/resources/themes/images/default/btn-group/btn-group-default-framed-corners.gif +0 -0
  134. data/template-min/extjs/resources/themes/images/default/btn-group/btn-group-default-framed-notitle-corners.gif +0 -0
  135. data/template-min/extjs/resources/themes/images/default/btn-group/btn-group-default-framed-notitle-sides.gif +0 -0
  136. data/template-min/extjs/resources/themes/images/default/btn-group/btn-group-default-framed-sides.gif +0 -0
  137. data/template-min/extjs/resources/themes/images/default/button/arrow.gif +0 -0
  138. data/template-min/extjs/resources/themes/images/default/button/btn.gif +0 -0
  139. data/template-min/extjs/resources/themes/images/default/button/group-cs.gif +0 -0
  140. data/template-min/extjs/resources/themes/images/default/button/group-lr.gif +0 -0
  141. data/template-min/extjs/resources/themes/images/default/button/group-tb.gif +0 -0
  142. data/template-min/extjs/resources/themes/images/default/button/s-arrow-b-noline.gif +0 -0
  143. data/template-min/extjs/resources/themes/images/default/button/s-arrow-b.gif +0 -0
  144. data/template-min/extjs/resources/themes/images/default/button/s-arrow-bo.gif +0 -0
  145. data/template-min/extjs/resources/themes/images/default/button/s-arrow-light.gif +0 -0
  146. data/template-min/extjs/resources/themes/images/default/button/s-arrow-noline.gif +0 -0
  147. data/template-min/extjs/resources/themes/images/default/button/s-arrow-o.gif +0 -0
  148. data/template-min/extjs/resources/themes/images/default/button/s-arrow.gif +0 -0
  149. data/template-min/extjs/resources/themes/images/default/datepicker/datepicker-footer-bg.gif +0 -0
  150. data/template-min/extjs/resources/themes/images/default/datepicker/datepicker-footer-bg.png +0 -0
  151. data/template-min/extjs/resources/themes/images/default/datepicker/datepicker-header-bg.gif +0 -0
  152. data/template-min/extjs/resources/themes/images/default/datepicker/datepicker-header-bg.png +0 -0
  153. data/template-min/extjs/resources/themes/images/default/dd/drop-add.gif +0 -0
  154. data/template-min/extjs/resources/themes/images/default/dd/drop-no.gif +0 -0
  155. data/template-min/extjs/resources/themes/images/default/dd/drop-yes.gif +0 -0
  156. data/template-min/extjs/resources/themes/images/default/editor/tb-sprite.gif +0 -0
  157. data/{template → template-min}/extjs/resources/themes/images/default/form/checkbox.gif +0 -0
  158. data/template-min/extjs/resources/themes/images/default/form/clear-trigger.gif +0 -0
  159. data/template-min/extjs/resources/themes/images/default/form/date-trigger.gif +0 -0
  160. data/template-min/extjs/resources/themes/images/default/form/error-tip-corners.gif +0 -0
  161. data/template-min/extjs/resources/themes/images/default/form/exclamation.gif +0 -0
  162. data/template-min/extjs/resources/themes/images/default/form/radio.gif +0 -0
  163. data/template-min/extjs/resources/themes/images/default/form/search-trigger.gif +0 -0
  164. data/template-min/extjs/resources/themes/images/default/form/spinner-small.gif +0 -0
  165. data/template-min/extjs/resources/themes/images/default/form/spinner.gif +0 -0
  166. data/{template → template-min}/extjs/resources/themes/images/default/form/text-bg.gif +0 -0
  167. data/template-min/extjs/resources/themes/images/default/form/trigger-square.gif +0 -0
  168. data/template-min/extjs/resources/themes/images/default/form/trigger-tpl.gif +0 -0
  169. data/template-min/extjs/resources/themes/images/default/form/trigger.gif +0 -0
  170. data/template-min/extjs/resources/themes/images/default/form-invalid-tip/form-invalid-tip-default-corners.gif +0 -0
  171. data/template-min/extjs/resources/themes/images/default/form-invalid-tip/form-invalid-tip-default-sides.gif +0 -0
  172. data/template-min/extjs/resources/themes/images/default/grid/arrow-left-white.gif +0 -0
  173. data/template-min/extjs/resources/themes/images/default/grid/arrow-right-white.gif +0 -0
  174. data/template-min/extjs/resources/themes/images/default/grid/cell-special-bg.gif +0 -0
  175. data/template-min/extjs/resources/themes/images/default/grid/cell-special-bg.png +0 -0
  176. data/template-min/extjs/resources/themes/images/default/grid/cell-special-selected-bg.gif +0 -0
  177. data/template-min/extjs/resources/themes/images/default/grid/cell-special-selected-bg.png +0 -0
  178. data/template-min/extjs/resources/themes/images/default/grid/checked.gif +0 -0
  179. data/template-min/extjs/resources/themes/images/default/grid/col-move-bottom.gif +0 -0
  180. data/template-min/extjs/resources/themes/images/default/grid/col-move-top.gif +0 -0
  181. data/template-min/extjs/resources/themes/images/default/grid/column-header-bg.gif +0 -0
  182. data/template-min/extjs/resources/themes/images/default/grid/column-header-bg.png +0 -0
  183. data/template-min/extjs/resources/themes/images/default/grid/column-header-over-bg.gif +0 -0
  184. data/template-min/extjs/resources/themes/images/default/grid/column-header-over-bg.png +0 -0
  185. data/template-min/extjs/resources/themes/images/default/grid/columns.gif +0 -0
  186. data/template-min/extjs/resources/themes/images/default/grid/dd-insert-arrow-left.gif +0 -0
  187. data/template-min/extjs/resources/themes/images/default/grid/dd-insert-arrow-left.png +0 -0
  188. data/template-min/extjs/resources/themes/images/default/grid/dd-insert-arrow-right.gif +0 -0
  189. data/template-min/extjs/resources/themes/images/default/grid/dd-insert-arrow-right.png +0 -0
  190. data/template-min/extjs/resources/themes/images/default/grid/dirty.gif +0 -0
  191. data/template-min/extjs/resources/themes/images/default/grid/done.gif +0 -0
  192. data/template-min/extjs/resources/themes/images/default/grid/drop-no.gif +0 -0
  193. data/template-min/extjs/resources/themes/images/default/grid/drop-yes.gif +0 -0
  194. data/template-min/extjs/resources/themes/images/default/grid/footer-bg.gif +0 -0
  195. data/template-min/extjs/resources/themes/images/default/grid/grid-blue-hd.gif +0 -0
  196. data/template-min/extjs/resources/themes/images/default/grid/grid-blue-split.gif +0 -0
  197. data/template-min/extjs/resources/themes/images/default/grid/grid-hrow.gif +0 -0
  198. data/template-min/extjs/resources/themes/images/default/grid/grid-loading.gif +0 -0
  199. data/template-min/extjs/resources/themes/images/default/grid/grid-split.gif +0 -0
  200. data/template-min/extjs/resources/themes/images/default/grid/grid-vista-hd.gif +0 -0
  201. data/template-min/extjs/resources/themes/images/default/grid/grid3-hd-btn.gif +0 -0
  202. data/template-min/extjs/resources/themes/images/default/grid/grid3-hrow-over.gif +0 -0
  203. data/template-min/extjs/resources/themes/images/default/grid/grid3-hrow.gif +0 -0
  204. data/template-min/extjs/resources/themes/images/default/grid/grid3-rowheader.gif +0 -0
  205. data/template-min/extjs/resources/themes/images/default/grid/group-by.gif +0 -0
  206. data/template-min/extjs/resources/themes/images/default/grid/group-collapse.gif +0 -0
  207. data/template-min/extjs/resources/themes/images/default/grid/group-expand-sprite.gif +0 -0
  208. data/template-min/extjs/resources/themes/images/default/grid/group-expand.gif +0 -0
  209. data/template-min/extjs/resources/themes/images/default/grid/hd-pop.gif +0 -0
  210. data/template-min/extjs/resources/themes/images/default/grid/hmenu-asc.gif +0 -0
  211. data/template-min/extjs/resources/themes/images/default/grid/hmenu-desc.gif +0 -0
  212. data/template-min/extjs/resources/themes/images/default/grid/hmenu-lock.gif +0 -0
  213. data/template-min/extjs/resources/themes/images/default/grid/hmenu-lock.png +0 -0
  214. data/template-min/extjs/resources/themes/images/default/grid/hmenu-unlock.gif +0 -0
  215. data/template-min/extjs/resources/themes/images/default/grid/hmenu-unlock.png +0 -0
  216. data/template-min/extjs/resources/themes/images/default/grid/invalid_line.gif +0 -0
  217. data/{template → template-min}/extjs/resources/themes/images/default/grid/loading.gif +0 -0
  218. data/template-min/extjs/resources/themes/images/default/grid/mso-hd.gif +0 -0
  219. data/template-min/extjs/resources/themes/images/default/grid/nowait.gif +0 -0
  220. data/template-min/extjs/resources/themes/images/default/grid/page-first-disabled.gif +0 -0
  221. data/template-min/extjs/resources/themes/images/default/grid/page-first.gif +0 -0
  222. data/template-min/extjs/resources/themes/images/default/grid/page-last-disabled.gif +0 -0
  223. data/template-min/extjs/resources/themes/images/default/grid/page-last.gif +0 -0
  224. data/template-min/extjs/resources/themes/images/default/grid/page-next-disabled.gif +0 -0
  225. data/template-min/extjs/resources/themes/images/default/grid/page-next.gif +0 -0
  226. data/template-min/extjs/resources/themes/images/default/grid/page-prev-disabled.gif +0 -0
  227. data/template-min/extjs/resources/themes/images/default/grid/page-prev.gif +0 -0
  228. data/template-min/extjs/resources/themes/images/default/grid/pick-button.gif +0 -0
  229. data/template-min/extjs/resources/themes/images/default/grid/property-cell-bg.gif +0 -0
  230. data/template-min/extjs/resources/themes/images/default/grid/property-cell-selected-bg.gif +0 -0
  231. data/template-min/extjs/resources/themes/images/default/grid/refresh-disabled.gif +0 -0
  232. data/template-min/extjs/resources/themes/images/default/grid/refresh.gif +0 -0
  233. data/template-min/extjs/resources/themes/images/default/grid/row-check-sprite.gif +0 -0
  234. data/template-min/extjs/resources/themes/images/default/grid/row-expand-sprite.gif +0 -0
  235. data/template-min/extjs/resources/themes/images/default/grid/row-over.gif +0 -0
  236. data/template-min/extjs/resources/themes/images/default/grid/row-sel.gif +0 -0
  237. data/template-min/extjs/resources/themes/images/default/grid/sort-hd.gif +0 -0
  238. data/template-min/extjs/resources/themes/images/default/grid/sort_asc.gif +0 -0
  239. data/template-min/extjs/resources/themes/images/default/grid/sort_desc.gif +0 -0
  240. data/template-min/extjs/resources/themes/images/default/grid/unchecked.gif +0 -0
  241. data/template-min/extjs/resources/themes/images/default/grid/wait.gif +0 -0
  242. data/template-min/extjs/resources/themes/images/default/layout/mini-bottom.gif +0 -0
  243. data/template-min/extjs/resources/themes/images/default/layout/mini-left.gif +0 -0
  244. data/template-min/extjs/resources/themes/images/default/layout/mini-right.gif +0 -0
  245. data/template-min/extjs/resources/themes/images/default/layout/mini-top.gif +0 -0
  246. data/template-min/extjs/resources/themes/images/default/menu/checked.gif +0 -0
  247. data/template-min/extjs/resources/themes/images/default/menu/group-checked.gif +0 -0
  248. data/template-min/extjs/resources/themes/images/default/menu/item-over.gif +0 -0
  249. data/template-min/extjs/resources/themes/images/default/menu/menu-item-active-bg.gif +0 -0
  250. data/template-min/extjs/resources/themes/images/default/menu/menu-item-active-corners.gif +0 -0
  251. data/template-min/extjs/resources/themes/images/default/menu/menu-item-active-sides.gif +0 -0
  252. data/template-min/extjs/resources/themes/images/default/menu/menu-parent.gif +0 -0
  253. data/template-min/extjs/resources/themes/images/default/menu/menu.gif +0 -0
  254. data/template-min/extjs/resources/themes/images/default/menu/unchecked.gif +0 -0
  255. data/template-min/extjs/resources/themes/images/default/panel/panel-default-framed-corners.gif +0 -0
  256. data/template-min/extjs/resources/themes/images/default/panel/panel-default-framed-sides.gif +0 -0
  257. data/template-min/extjs/resources/themes/images/default/panel-header/panel-header-default-bottom-bg.gif +0 -0
  258. data/template-min/extjs/resources/themes/images/default/panel-header/panel-header-default-framed-bottom-bg.gif +0 -0
  259. data/template-min/extjs/resources/themes/images/default/panel-header/panel-header-default-framed-bottom-corners.gif +0 -0
  260. data/template-min/extjs/resources/themes/images/default/panel-header/panel-header-default-framed-bottom-sides.gif +0 -0
  261. data/template-min/extjs/resources/themes/images/default/panel-header/panel-header-default-framed-collapsed-bottom-bg.gif +0 -0
  262. data/template-min/extjs/resources/themes/images/default/panel-header/panel-header-default-framed-collapsed-bottom-corners.gif +0 -0
  263. data/template-min/extjs/resources/themes/images/default/panel-header/panel-header-default-framed-collapsed-bottom-sides.gif +0 -0
  264. data/template-min/extjs/resources/themes/images/default/panel-header/panel-header-default-framed-collapsed-left-bg.gif +0 -0
  265. data/template-min/extjs/resources/themes/images/default/panel-header/panel-header-default-framed-collapsed-left-corners.gif +0 -0
  266. data/template-min/extjs/resources/themes/images/default/panel-header/panel-header-default-framed-collapsed-left-sides.gif +0 -0
  267. data/template-min/extjs/resources/themes/images/default/panel-header/panel-header-default-framed-collapsed-right-bg.gif +0 -0
  268. data/template-min/extjs/resources/themes/images/default/panel-header/panel-header-default-framed-collapsed-right-corners.gif +0 -0
  269. data/template-min/extjs/resources/themes/images/default/panel-header/panel-header-default-framed-collapsed-right-sides.gif +0 -0
  270. data/template-min/extjs/resources/themes/images/default/panel-header/panel-header-default-framed-collapsed-top-bg.gif +0 -0
  271. data/template-min/extjs/resources/themes/images/default/panel-header/panel-header-default-framed-collapsed-top-corners.gif +0 -0
  272. data/template-min/extjs/resources/themes/images/default/panel-header/panel-header-default-framed-collapsed-top-sides.gif +0 -0
  273. data/template-min/extjs/resources/themes/images/default/panel-header/panel-header-default-framed-left-bg.gif +0 -0
  274. data/template-min/extjs/resources/themes/images/default/panel-header/panel-header-default-framed-left-corners.gif +0 -0
  275. data/template-min/extjs/resources/themes/images/default/panel-header/panel-header-default-framed-left-sides.gif +0 -0
  276. data/template-min/extjs/resources/themes/images/default/panel-header/panel-header-default-framed-right-bg.gif +0 -0
  277. data/template-min/extjs/resources/themes/images/default/panel-header/panel-header-default-framed-right-corners.gif +0 -0
  278. data/template-min/extjs/resources/themes/images/default/panel-header/panel-header-default-framed-right-sides.gif +0 -0
  279. data/template-min/extjs/resources/themes/images/default/panel-header/panel-header-default-framed-top-bg.gif +0 -0
  280. data/template-min/extjs/resources/themes/images/default/panel-header/panel-header-default-framed-top-corners.gif +0 -0
  281. data/template-min/extjs/resources/themes/images/default/panel-header/panel-header-default-framed-top-sides.gif +0 -0
  282. data/template-min/extjs/resources/themes/images/default/panel-header/panel-header-default-left-bg.gif +0 -0
  283. data/template-min/extjs/resources/themes/images/default/panel-header/panel-header-default-right-bg.gif +0 -0
  284. data/template-min/extjs/resources/themes/images/default/panel-header/panel-header-default-top-bg.gif +0 -0
  285. data/template-min/extjs/resources/themes/images/default/progress/progress-default-bg.gif +0 -0
  286. data/template-min/extjs/resources/themes/images/default/shared/blue-loading.gif +0 -0
  287. data/template-min/extjs/resources/themes/images/default/shared/calendar.gif +0 -0
  288. data/template-min/extjs/resources/themes/images/default/shared/glass-bg.gif +0 -0
  289. data/template-min/extjs/resources/themes/images/default/shared/hd-sprite.gif +0 -0
  290. data/template-min/extjs/resources/themes/images/default/shared/icon-error.gif +0 -0
  291. data/template-min/extjs/resources/themes/images/default/shared/icon-info.gif +0 -0
  292. data/template-min/extjs/resources/themes/images/default/shared/icon-question.gif +0 -0
  293. data/template-min/extjs/resources/themes/images/default/shared/icon-warning.gif +0 -0
  294. data/template-min/extjs/resources/themes/images/default/shared/large-loading.gif +0 -0
  295. data/template-min/extjs/resources/themes/images/default/shared/left-btn.gif +0 -0
  296. data/template-min/extjs/resources/themes/images/default/shared/loading-balls.gif +0 -0
  297. data/template-min/extjs/resources/themes/images/default/shared/right-btn.gif +0 -0
  298. data/template-min/extjs/resources/themes/images/default/shared/shadow-c.png +0 -0
  299. data/template-min/extjs/resources/themes/images/default/shared/shadow-lr.png +0 -0
  300. data/template-min/extjs/resources/themes/images/default/shared/shadow.png +0 -0
  301. data/template-min/extjs/resources/themes/images/default/shared/warning.gif +0 -0
  302. data/template-min/extjs/resources/themes/images/default/sizer/e-handle-dark.gif +0 -0
  303. data/template-min/extjs/resources/themes/images/default/sizer/e-handle.gif +0 -0
  304. data/template-min/extjs/resources/themes/images/default/sizer/ne-handle-dark.gif +0 -0
  305. data/template-min/extjs/resources/themes/images/default/sizer/ne-handle.gif +0 -0
  306. data/template-min/extjs/resources/themes/images/default/sizer/nw-handle-dark.gif +0 -0
  307. data/template-min/extjs/resources/themes/images/default/sizer/nw-handle.gif +0 -0
  308. data/template-min/extjs/resources/themes/images/default/sizer/s-handle-dark.gif +0 -0
  309. data/template-min/extjs/resources/themes/images/default/sizer/s-handle.gif +0 -0
  310. data/template-min/extjs/resources/themes/images/default/sizer/se-handle-dark.gif +0 -0
  311. data/template-min/extjs/resources/themes/images/default/sizer/se-handle.gif +0 -0
  312. data/template-min/extjs/resources/themes/images/default/sizer/square.gif +0 -0
  313. data/template-min/extjs/resources/themes/images/default/sizer/sw-handle-dark.gif +0 -0
  314. data/template-min/extjs/resources/themes/images/default/sizer/sw-handle.gif +0 -0
  315. data/template-min/extjs/resources/themes/images/default/slider/slider-bg.gif +0 -0
  316. data/template-min/extjs/resources/themes/images/default/slider/slider-bg.png +0 -0
  317. data/template-min/extjs/resources/themes/images/default/slider/slider-thumb.gif +0 -0
  318. data/template-min/extjs/resources/themes/images/default/slider/slider-thumb.png +0 -0
  319. data/template-min/extjs/resources/themes/images/default/slider/slider-v-bg.gif +0 -0
  320. data/template-min/extjs/resources/themes/images/default/slider/slider-v-bg.png +0 -0
  321. data/template-min/extjs/resources/themes/images/default/slider/slider-v-thumb.gif +0 -0
  322. data/template-min/extjs/resources/themes/images/default/slider/slider-v-thumb.png +0 -0
  323. data/template-min/extjs/resources/themes/images/default/tab/tab-default-bottom-active-bg.gif +0 -0
  324. data/template-min/extjs/resources/themes/images/default/tab/tab-default-bottom-active-corners.gif +0 -0
  325. data/template-min/extjs/resources/themes/images/default/tab/tab-default-bottom-active-sides.gif +0 -0
  326. data/template-min/extjs/resources/themes/images/default/tab/tab-default-bottom-bg.gif +0 -0
  327. data/template-min/extjs/resources/themes/images/default/tab/tab-default-bottom-corners.gif +0 -0
  328. data/template-min/extjs/resources/themes/images/default/tab/tab-default-bottom-disabled-bg.gif +0 -0
  329. data/template-min/extjs/resources/themes/images/default/tab/tab-default-bottom-disabled-corners.gif +0 -0
  330. data/template-min/extjs/resources/themes/images/default/tab/tab-default-bottom-disabled-sides.gif +0 -0
  331. data/template-min/extjs/resources/themes/images/default/tab/tab-default-bottom-over-bg.gif +0 -0
  332. data/template-min/extjs/resources/themes/images/default/tab/tab-default-bottom-over-corners.gif +0 -0
  333. data/template-min/extjs/resources/themes/images/default/tab/tab-default-bottom-over-sides.gif +0 -0
  334. data/template-min/extjs/resources/themes/images/default/tab/tab-default-bottom-sides.gif +0 -0
  335. data/template-min/extjs/resources/themes/images/default/tab/tab-default-close.gif +0 -0
  336. data/template-min/extjs/resources/themes/images/default/tab/tab-default-top-active-bg.gif +0 -0
  337. data/template-min/extjs/resources/themes/images/default/tab/tab-default-top-active-corners.gif +0 -0
  338. data/template-min/extjs/resources/themes/images/default/tab/tab-default-top-active-sides.gif +0 -0
  339. data/template-min/extjs/resources/themes/images/default/tab/tab-default-top-bg.gif +0 -0
  340. data/template-min/extjs/resources/themes/images/default/tab/tab-default-top-corners.gif +0 -0
  341. data/template-min/extjs/resources/themes/images/default/tab/tab-default-top-disabled-bg.gif +0 -0
  342. data/template-min/extjs/resources/themes/images/default/tab/tab-default-top-disabled-corners.gif +0 -0
  343. data/template-min/extjs/resources/themes/images/default/tab/tab-default-top-disabled-sides.gif +0 -0
  344. data/template-min/extjs/resources/themes/images/default/tab/tab-default-top-over-bg.gif +0 -0
  345. data/template-min/extjs/resources/themes/images/default/tab/tab-default-top-over-corners.gif +0 -0
  346. data/template-min/extjs/resources/themes/images/default/tab/tab-default-top-over-sides.gif +0 -0
  347. data/template-min/extjs/resources/themes/images/default/tab/tab-default-top-sides.gif +0 -0
  348. data/template-min/extjs/resources/themes/images/default/tab-bar/scroll-left.gif +0 -0
  349. data/template-min/extjs/resources/themes/images/default/tab-bar/scroll-right.gif +0 -0
  350. data/template-min/extjs/resources/themes/images/default/tab-bar/tab-bar-default-bg.gif +0 -0
  351. data/template-min/extjs/resources/themes/images/default/tip/tip-corners.gif +0 -0
  352. data/template-min/extjs/resources/themes/images/default/tip/tip-sides.gif +0 -0
  353. data/template-min/extjs/resources/themes/images/default/toolbar/more.gif +0 -0
  354. data/template-min/extjs/resources/themes/images/default/toolbar/scroll-left.gif +0 -0
  355. data/template-min/extjs/resources/themes/images/default/toolbar/scroll-right.gif +0 -0
  356. data/template-min/extjs/resources/themes/images/default/toolbar/toolbar-default-bg.gif +0 -0
  357. data/template-min/extjs/resources/themes/images/default/tools/tool-sprite-tpl.gif +0 -0
  358. data/template-min/extjs/resources/themes/images/default/tools/tool-sprites.gif +0 -0
  359. data/template-min/extjs/resources/themes/images/default/tools/tools-sprites-trans.gif +0 -0
  360. data/{template → template-min}/extjs/resources/themes/images/default/tree/arrows.gif +0 -0
  361. data/template-min/extjs/resources/themes/images/default/tree/drop-above.gif +0 -0
  362. data/template-min/extjs/resources/themes/images/default/tree/drop-add.gif +0 -0
  363. data/template-min/extjs/resources/themes/images/default/tree/drop-append.gif +0 -0
  364. data/template-min/extjs/resources/themes/images/default/tree/drop-below.gif +0 -0
  365. data/template-min/extjs/resources/themes/images/default/tree/drop-between.gif +0 -0
  366. data/template-min/extjs/resources/themes/images/default/tree/drop-no.gif +0 -0
  367. data/template-min/extjs/resources/themes/images/default/tree/drop-over.gif +0 -0
  368. data/template-min/extjs/resources/themes/images/default/tree/drop-under.gif +0 -0
  369. data/template-min/extjs/resources/themes/images/default/tree/drop-yes.gif +0 -0
  370. data/template-min/extjs/resources/themes/images/default/tree/elbow-end-minus-nl.gif +0 -0
  371. data/template-min/extjs/resources/themes/images/default/tree/elbow-end-minus.gif +0 -0
  372. data/template-min/extjs/resources/themes/images/default/tree/elbow-end-plus-nl.gif +0 -0
  373. data/template-min/extjs/resources/themes/images/default/tree/elbow-end-plus.gif +0 -0
  374. data/{template/resources/images → template-min/extjs/resources/themes/images/default/tree}/elbow-end.gif +0 -0
  375. data/template-min/extjs/resources/themes/images/default/tree/elbow-line.gif +0 -0
  376. data/template-min/extjs/resources/themes/images/default/tree/elbow-minus-nl.gif +0 -0
  377. data/template-min/extjs/resources/themes/images/default/tree/elbow-minus.gif +0 -0
  378. data/template-min/extjs/resources/themes/images/default/tree/elbow-plus-nl.gif +0 -0
  379. data/template-min/extjs/resources/themes/images/default/tree/elbow-plus.gif +0 -0
  380. data/template-min/extjs/resources/themes/images/default/tree/elbow.gif +0 -0
  381. data/template-min/extjs/resources/themes/images/default/tree/folder-open.gif +0 -0
  382. data/template-min/extjs/resources/themes/images/default/tree/folder.gif +0 -0
  383. data/template-min/extjs/resources/themes/images/default/tree/leaf.gif +0 -0
  384. data/template-min/extjs/resources/themes/images/default/tree/loading.gif +0 -0
  385. data/template-min/extjs/resources/themes/images/default/tree/s.gif +0 -0
  386. data/template-min/extjs/resources/themes/images/default/util/splitter/mini-bottom.gif +0 -0
  387. data/template-min/extjs/resources/themes/images/default/util/splitter/mini-left.gif +0 -0
  388. data/template-min/extjs/resources/themes/images/default/util/splitter/mini-right.gif +0 -0
  389. data/template-min/extjs/resources/themes/images/default/util/splitter/mini-top.gif +0 -0
  390. data/template-min/extjs/resources/themes/images/default/window/window-default-corners.gif +0 -0
  391. data/template-min/extjs/resources/themes/images/default/window/window-default-sides.gif +0 -0
  392. data/template-min/extjs/resources/themes/images/default/window-header/window-header-default-bottom-corners.gif +0 -0
  393. data/template-min/extjs/resources/themes/images/default/window-header/window-header-default-bottom-sides.gif +0 -0
  394. data/template-min/extjs/resources/themes/images/default/window-header/window-header-default-left-corners.gif +0 -0
  395. data/template-min/extjs/resources/themes/images/default/window-header/window-header-default-left-sides.gif +0 -0
  396. data/template-min/extjs/resources/themes/images/default/window-header/window-header-default-right-corners.gif +0 -0
  397. data/template-min/extjs/resources/themes/images/default/window-header/window-header-default-right-sides.gif +0 -0
  398. data/template-min/extjs/resources/themes/images/default/window-header/window-header-default-top-corners.gif +0 -0
  399. data/template-min/extjs/resources/themes/images/default/window-header/window-header-default-top-sides.gif +0 -0
  400. data/{template → template-min}/favicon.ico +0 -0
  401. data/template-min/index.php +59 -0
  402. data/template-min/print-template.html +22 -0
  403. data/template-min/resources/css/app.css +1 -0
  404. data/template-min/resources/images/arrows.png +0 -0
  405. data/{template → template-min}/resources/images/class-m.png +0 -0
  406. data/{template → template-min}/resources/images/class-sm.png +0 -0
  407. data/{template → template-min}/resources/images/component-m.png +0 -0
  408. data/{template → template-min}/resources/images/configs.png +0 -0
  409. data/{template → template-min}/resources/images/doc-m.png +0 -0
  410. data/template-min/resources/images/elbow-end.gif +0 -0
  411. data/{template → template-min}/resources/images/events.png +0 -0
  412. data/template-min/resources/images/example-icons.png +0 -0
  413. data/{template → template-min}/resources/images/expandcollapse.png +0 -0
  414. data/{template → template-min}/resources/images/guide-icon.png +0 -0
  415. data/{template → template-min}/resources/images/guides.png +0 -0
  416. data/template-min/resources/images/header.png +0 -0
  417. data/template-min/resources/images/hero-extjs4-alt.png +0 -0
  418. data/template-min/resources/images/icons.png +0 -0
  419. data/template-min/resources/images/link-green-standard-over.png +0 -0
  420. data/template-min/resources/images/link-green-standard.png +0 -0
  421. data/{template → template-min}/resources/images/loading-title.png +0 -0
  422. data/{template → template-min}/resources/images/loading.gif +0 -0
  423. data/template-min/resources/images/logo-screen-noglow.png +0 -0
  424. data/template-min/resources/images/logo.png +0 -0
  425. data/{template → template-min}/resources/images/member-collapsed.gif +0 -0
  426. data/{template → template-min}/resources/images/member-expanded.gif +0 -0
  427. data/{template → template-min}/resources/images/member-hover.gif +0 -0
  428. data/{template → template-min}/resources/images/methods.png +0 -0
  429. data/template-min/resources/images/more.png +0 -0
  430. data/template-min/resources/images/preview.png +0 -0
  431. data/template-min/resources/images/print.png +0 -0
  432. data/{template → template-min}/resources/images/properties.png +0 -0
  433. data/template-min/resources/images/search-box.png +0 -0
  434. data/{template → template-min}/resources/images/singleton-m.png +0 -0
  435. data/template-min/resources/images/tabs.png +0 -0
  436. data/{template → template-min}/resources/images/version-tabs.png +0 -0
  437. data/template-min/resources/images/welcome-bg-js4.gif +0 -0
  438. data/{template → template-min}/resources/images/x.png +0 -0
  439. data/{template → template-min}/resources/images/x12.png +0 -0
  440. data/template-min/resources/images/x122.png +0 -0
  441. data/{template/index.html → template-min/template.html} +9 -14
  442. data/template-min/welcome.html +78 -0
  443. metadata +429 -76
  444. data/lib/jsduck/jsonp.rb +0 -17
  445. data/lib/jsduck/tree.rb +0 -117
  446. data/lib/jsduck/tree_icons.rb +0 -19
  447. data/template/app/Application.js +0 -53
  448. data/template/app/Favorites.js +0 -88
  449. data/template/app/History.js +0 -45
  450. data/template/app/LocalStore.js +0 -45
  451. data/template/app/Settings.js +0 -39
  452. data/template/app/Syntax.js +0 -20
  453. data/template/app/controller/Classes.js +0 -301
  454. data/template/app/controller/Search.js +0 -189
  455. data/template/app/model/Favorite.js +0 -11
  456. data/template/app/model/Setting.js +0 -11
  457. data/template/app/store/Favorites.js +0 -7
  458. data/template/app/store/Search.js +0 -14
  459. data/template/app/store/Settings.js +0 -7
  460. data/template/app/view/ClassGrid.js +0 -114
  461. data/template/app/view/HoverMenu.js +0 -59
  462. data/template/app/view/HoverMenuButton.js +0 -147
  463. data/template/app/view/Viewport.js +0 -240
  464. data/template/app/view/cls/Header.js +0 -47
  465. data/template/app/view/cls/Overview.js +0 -415
  466. data/template/app/view/cls/Toolbar.js +0 -199
  467. data/template/app/view/index/Container.js +0 -62
  468. data/template/app/view/search/Dropdown.js +0 -115
  469. data/template/app/view/tree/Tree.js +0 -143
  470. data/template/app.js +0 -25
  471. data/template/prettify/prettify.css +0 -1
  472. data/template/prettify/prettify.js +0 -28
  473. data/template/resources/css/docs-ext.css +0 -3594
  474. data/template/resources/css/reset.css +0 -59
  475. data/template/resources/css/scrollbars.css +0 -14
  476. data/template/resources/css/viewport.css +0 -420
  477. data/template/resources/images/data-package.png +0 -0
  478. data/template/resources/images/drag-bar-center.png +0 -0
  479. data/template/resources/images/headBG.png +0 -0
  480. data/template/resources/images/header.gif +0 -0
  481. data/template/resources/images/icon.png +0 -0
  482. data/template/resources/images/icons.png +0 -0
  483. data/template/resources/images/model.png +0 -0
  484. data/template/resources/images/root-lines.png +0 -0
  485. data/template/resources/images/search-box.png +0 -0
data/lib/jsduck/tree.rb DELETED
@@ -1,117 +0,0 @@
1
-
2
- module JsDuck
3
-
4
- # Creator of package-tree in the format expected by the
5
- # documentation browser UI.
6
- #
7
- # See unit test for example output.
8
- #
9
- class Tree
10
- def initialize
11
- @root = {
12
- :id => "apidocs",
13
- :iconCls => "icon-docs",
14
- :text => "API Documentation",
15
- :children => []
16
- }
17
- @packages = {"" => @root}
18
- end
19
-
20
- # Given list of class documentation objects returns a
21
- # tree-structure that can be turned into JSON that's needed by
22
- # documentation browser interface.
23
- def create(docs, guides=[])
24
- docs.each {|cls| add_class(cls) }
25
- sort_tree(@root)
26
- add_guides(guides)
27
- @root
28
- end
29
-
30
- # Sorts all child nodes, and recursively all child packages.
31
- def sort_tree(node)
32
- node[:children].sort! {|a,b| compare(a, b) }
33
- node[:children].find_all {|c| c[:children] }.each {|c| sort_tree(c) }
34
- end
35
-
36
- # Comparson method that sorts package nodes before class nodes.
37
- def compare(a, b)
38
- if a[:leaf] == b[:leaf]
39
- a[:text].casecmp(b[:text])
40
- else
41
- a[:leaf] ? 1 : -1
42
- end
43
- end
44
-
45
- # When package for the class exists, add class node to that
46
- # package; otherwise create the package first.
47
- def add_class(cls)
48
- parent_name = cls.package_name
49
- parent = @packages[parent_name] || add_package(parent_name)
50
- parent[:children] << class_node(cls)
51
- end
52
-
53
- # When parent package exists, add new package node into it, also
54
- # record the package into @packages hash for quick lookups;
55
- # otherwise create the parent package first.
56
- #
57
- # Note that the root package always exists, so we can safely
58
- # recurse knowing we will eventually stop.
59
- def add_package(name)
60
- parent_name = Class.package_name(name)
61
- parent = @packages[parent_name] || add_package(parent_name)
62
- package = package_node(name)
63
- parent[:children] << package
64
- @packages[name] = package
65
- package
66
- end
67
-
68
- # When guides list not empty, add guides to tree
69
- def add_guides(guides)
70
- if guides.length > 0
71
- pkg = package_node("guides")
72
- guides.each {|g| pkg[:children] << guide_node(g) }
73
- @root[:children] << pkg
74
- end
75
- end
76
-
77
- # Given full doc object for class creates class node
78
- def class_node(cls)
79
- return {
80
- :text => cls.short_name,
81
- :url => "/api/"+cls.full_name,
82
- :iconCls => class_icon(cls),
83
- :leaf => true
84
- }
85
- end
86
-
87
- def class_icon(cls)
88
- if cls[:singleton]
89
- "icon-singleton"
90
- elsif cls.inherits_from?("Ext.Component")
91
- "icon-component"
92
- else
93
- "icon-class"
94
- end
95
- end
96
-
97
- # Given full package name like my.package creates package node
98
- def package_node(name)
99
- return {
100
- :text => Class.short_name(name),
101
- :iconCls => "icon-pkg",
102
- :children => []
103
- }
104
- end
105
-
106
- # Given full guide object creates guide node
107
- def guide_node(guide)
108
- return {
109
- :text => guide[:title],
110
- :url => "/guide/"+guide[:name],
111
- :iconCls => "icon-guide",
112
- :leaf => true
113
- }
114
- end
115
- end
116
-
117
- end
@@ -1,19 +0,0 @@
1
- module JsDuck
2
-
3
- # Takes the structure produced by JsDuck::Tree.create and creates
4
- # hashmap of classname-icon pairs.
5
- class TreeIcons
6
- def extract_icons(node)
7
- icons = {}
8
- if node[:children]
9
- node[:children].each do |child|
10
- icons.merge!(extract_icons(child))
11
- end
12
- else
13
- icons[node[:url]] = node[:iconCls]
14
- end
15
- icons
16
- end
17
- end
18
-
19
- end
@@ -1,53 +0,0 @@
1
- /**
2
- * Main application definition for Docs app.
3
- *
4
- * We define our own Application class because this way we can also
5
- * easily define the dependencies.
6
- */
7
- Ext.define('Docs.Application', {
8
- extend: 'Ext.app.Application',
9
- name: 'Docs',
10
-
11
- requires: [
12
- 'Docs.Favorites',
13
- 'Docs.History',
14
- 'Docs.Settings'
15
- ],
16
-
17
- uses: [
18
- 'Ext.util.History',
19
- 'Ext.data.JsonP'
20
- ],
21
-
22
- controllers: [
23
- 'Classes',
24
- 'Search'
25
- ],
26
-
27
- launch: function() {
28
- Docs.App = this;
29
- Docs.Favorites.init();
30
- Docs.Settings.init();
31
-
32
- Ext.create('Docs.view.Viewport');
33
-
34
- // Update favorites grid height between browser tabs if changed
35
- Ext.getStore('Settings').on('load', function(store) {
36
- var favHeight = Docs.Settings.get('favorites-height');
37
- if (favHeight) {
38
- var tabPanel = Ext.getCmp('classes-tab-panel');
39
- tabPanel.suspendEvents();
40
- tabPanel.setHeight(favHeight);
41
- tabPanel.resumeEvents();
42
- }
43
- });
44
-
45
- Docs.History.init();
46
-
47
- // When google analytics event tracking script present on page
48
- if (Docs.initEventTracking) {
49
- Docs.initEventTracking();
50
- }
51
- }
52
-
53
- });
@@ -1,88 +0,0 @@
1
- /**
2
- * Favorites management.
3
- */
4
- Ext.define("Docs.Favorites", {
5
- extend: 'Docs.LocalStore',
6
- storeName: 'Favorites',
7
- singleton: true,
8
-
9
- init: function() {
10
- this.callParent(arguments);
11
-
12
- // Populate favorites with Top 10 classes
13
- if (this.store.data.items.length == 0) {
14
- var top10 = [
15
- 'Ext.data.Store',
16
- 'Ext',
17
- 'Ext.grid.Panel',
18
- 'Ext.panel.Panel',
19
- 'Ext.form.field.ComboBox',
20
- 'Ext.data.Model',
21
- 'Ext.form.Panel',
22
- 'Ext.button.Button',
23
- 'Ext.tree.Panel',
24
- 'Ext.Component'
25
- ];
26
- this.store.add(Ext.Array.map(top10, function(clsName) {
27
- return {url: "/api/"+clsName, title: clsName};
28
- }));
29
- this.syncStore();
30
- }
31
-
32
- // For backwards compatibility with old Favorites Model
33
- // convert the old-style records to new schema.
34
- else if (!this.store.first().get("url")) {
35
- this.store.each(function(r) {
36
- r.set("title", r.data.cls);
37
- r.set("url", "/api/"+r.get("cls"));
38
- r.set("cls", "");
39
- });
40
- this.syncStore();
41
- }
42
- },
43
-
44
- /**
45
- * Associates Favorites with Docs TreePanel component.
46
- * @param {Docs.view.tree.Tree} tree
47
- */
48
- setTree: function(tree) {
49
- this.tree = tree;
50
- },
51
-
52
- /**
53
- * Adds page to favorites
54
- *
55
- * @param {String} url the page to add
56
- * @param {String} title title for Favorites entry
57
- */
58
- add: function(url, title) {
59
- if (!this.has(url)) {
60
- this.store.add({url: url, title: title});
61
- this.syncStore();
62
- this.tree.setFavorite(url, true);
63
- }
64
- },
65
-
66
- /**
67
- * Removes page from favorites.
68
- *
69
- * @param {String} url the page URL to remove
70
- */
71
- remove: function(url) {
72
- if (this.has(url)) {
73
- this.store.removeAt(this.store.findExact('url', url));
74
- this.syncStore();
75
- this.tree.setFavorite(url, false);
76
- }
77
- },
78
-
79
- /**
80
- * Checks if page exists in favorites
81
- *
82
- * @param {String} url the URL to check
83
- * @return {Boolean} true when present
84
- */
85
- has: function(url) {
86
- return this.store.findExact('url', url) > -1;
87
- }
88
- });
@@ -1,45 +0,0 @@
1
- /**
2
- * Browser history management using Ext.util.History.
3
- */
4
- Ext.define("Docs.History", {
5
- singleton: true,
6
-
7
- /**
8
- * Initializes history management.
9
- */
10
- init: function() {
11
- Ext.util.History.init(function() {
12
- this.navigate(Ext.util.History.getToken());
13
- }, this);
14
- Ext.util.History.on("change", this.navigate, this);
15
- },
16
-
17
- // Parses current URL and navigates to the page
18
- navigate: function(token) {
19
- var url = this.parseToken(token);
20
- if (url.type === "api") {
21
- Docs.App.getController('Classes').loadClass(url.url, true);
22
- }
23
- else if (url.type === "guide") {
24
- Docs.App.getController('Classes').loadGuide(url.url, true);
25
- }
26
- else {
27
- Docs.App.getController('Classes').loadIndex(true);
28
- }
29
- },
30
-
31
- // Parses current browser location
32
- parseToken: function(token) {
33
- var matches = token && token.match(/\/(api|guide)\/(.*)/);
34
- return matches ? {type: matches[1], url: matches[0]} : {};
35
- },
36
-
37
- /**
38
- * Adds URL to history
39
- *
40
- * @param {String} token the part of URL after #
41
- */
42
- push: function(token) {
43
- Ext.util.History.add(token);
44
- }
45
- });
@@ -1,45 +0,0 @@
1
- /**
2
- * Provides methods dealing with localStorage- and memory-store.
3
- *
4
- * Base class for Favorites and Settings.
5
- */
6
- Ext.define("Docs.LocalStore", {
7
- storeName: '',
8
-
9
- /**
10
- * Initializes store management.
11
- *
12
- * Initializes this.store variable and loads the store if
13
- * localStorage available.
14
- */
15
- init: function() {
16
- this.localStorage = ('localStorage' in window && window['localStorage'] !== null);
17
- this.store = Ext.getStore(this.storeName);
18
-
19
- if (this.localStorage) {
20
- this.store.load();
21
- if (window.addEventListener) {
22
- window.addEventListener("storage", Ext.Function.bind(this.onStorageChange, this), false);
23
- }
24
- else {
25
- window.attachEvent("onstorage", Ext.Function.bind(this.onStorageChange, this));
26
- }
27
- }
28
- },
29
-
30
- // When records in localstorage change, reload the store.
31
- onStorageChange: function(e) {
32
- e = e || window.event;
33
- if (e.key === this.store.getProxy().id) {
34
- this.store.load();
35
- }
36
- },
37
-
38
- /**
39
- * Syncs the store with localStorage if possible.
40
- */
41
- syncStore: function() {
42
- this.localStorage && this.store.sync();
43
- }
44
-
45
- });
@@ -1,39 +0,0 @@
1
- /**
2
- * Provides access to Docs app settings.
3
- */
4
- Ext.define("Docs.Settings", {
5
- extend: 'Docs.LocalStore',
6
- storeName: 'Settings',
7
- singleton: true,
8
-
9
- /**
10
- * Saves a setting
11
- *
12
- * @param {String} key Name of the setting
13
- * @param {Mixed} value Value of the setting
14
- */
15
- set: function(key, value) {
16
- var index = this.store.findExact("key", key);
17
- // There is currently a bug in localstorage with Ext that
18
- // prevents updated records getting synced properly. As a
19
- // temporary fix, remove and re-add the item instead of just
20
- // changing the value.
21
- if (index > -1) {
22
- this.store.removeAt(index);
23
- }
24
- this.store.add({key: key, value: value});
25
-
26
- this.syncStore();
27
- },
28
-
29
- /**
30
- * Gets value of a setting.
31
- *
32
- * @param {String} key Name of the setting
33
- * @return {Mixed} value of the setting or undefined.
34
- */
35
- get: function(key) {
36
- var index = this.store.findExact("key", key);
37
- return index > -1 ? this.store.getAt(index).get("value") : undefined;
38
- }
39
- });
@@ -1,20 +0,0 @@
1
- /**
2
- * Utility for performing syntax highlighting.
3
- */
4
- Ext.define("Docs.Syntax", {
5
- singleton: true,
6
-
7
- /**
8
- * Marks all code blocks with "prettyprint" class and then calls
9
- * the prettify library function to highlight them.
10
- *
11
- * @param {HTMLElement/Ext.core.Element} root HTML element inside
12
- * which to perform the highlighting.
13
- */
14
- highlight: function(root) {
15
- Ext.Array.forEach(Ext.query("pre > code", root.dom || root), function(el) {
16
- Ext.get(el).addCls("prettyprint");
17
- });
18
- prettyPrint();
19
- }
20
- });