maglev-database-explorer 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (688) hide show
  1. data/MIT-LICENSE +21 -0
  2. data/README.rdoc +3 -0
  3. data/Rakefile +40 -0
  4. data/app/assets/javascripts/maglev-database-explorer/application.js +17 -0
  5. data/app/assets/javascripts/maglev_database_explorer/def.js +2 -0
  6. data/app/assets/stylesheets/maglev-database-explorer/application.css +13 -0
  7. data/app/assets/stylesheets/maglev_database_explorer/def.css +4 -0
  8. data/app/controllers/maglev_database_explorer/application_controller.rb +4 -0
  9. data/app/controllers/maglev_database_explorer/code_controller.rb +101 -0
  10. data/app/controllers/maglev_database_explorer/object_controller.rb +60 -0
  11. data/app/controllers/maglev_database_explorer/object_explorer_controller.rb +9 -0
  12. data/app/helpers/maglev_database_explorer/application_helper.rb +4 -0
  13. data/app/views/layouts/maglev-database-explorer/application.html.erb +14 -0
  14. data/app/views/maglev_database_explorer/object_explorer/_workspace.html.erb +28 -0
  15. data/app/views/maglev_database_explorer/object_explorer/index.html.erb +92 -0
  16. data/config/routes.rb +15 -0
  17. data/lib/maglev-database-explorer.rb +17 -0
  18. data/lib/maglev-database-explorer/code_evaluation.rb +36 -0
  19. data/lib/maglev-database-explorer/database_views.rb +29 -0
  20. data/lib/maglev-database-explorer/database_views/abstract_dictionary.rb +69 -0
  21. data/lib/maglev-database-explorer/database_views/abstract_exception.rb +25 -0
  22. data/lib/maglev-database-explorer/database_views/array.rb +28 -0
  23. data/lib/maglev-database-explorer/database_views/boolean.rb +12 -0
  24. data/lib/maglev-database-explorer/database_views/class.rb +46 -0
  25. data/lib/maglev-database-explorer/database_views/exception.rb +3 -0
  26. data/lib/maglev-database-explorer/database_views/execblock.rb +5 -0
  27. data/lib/maglev-database-explorer/database_views/fixnum.rb +5 -0
  28. data/lib/maglev-database-explorer/database_views/float.rb +6 -0
  29. data/lib/maglev-database-explorer/database_views/globals.rb +2 -0
  30. data/lib/maglev-database-explorer/database_views/gsnmethod.rb +29 -0
  31. data/lib/maglev-database-explorer/database_views/hash.rb +5 -0
  32. data/lib/maglev-database-explorer/database_views/maglev_record.rb +43 -0
  33. data/lib/maglev-database-explorer/database_views/module.rb +104 -0
  34. data/lib/maglev-database-explorer/database_views/nilclass.rb +6 -0
  35. data/lib/maglev-database-explorer/database_views/object.rb +77 -0
  36. data/lib/maglev-database-explorer/database_views/proc.rb +4 -0
  37. data/lib/maglev-database-explorer/database_views/repository.rb +4 -0
  38. data/lib/maglev-database-explorer/database_views/ruby_workspace.rb +6 -0
  39. data/lib/maglev-database-explorer/database_views/smalltalk_classes.rb +35 -0
  40. data/lib/maglev-database-explorer/database_views/smalltalk_classes.st +60 -0
  41. data/lib/maglev-database-explorer/database_views/string.rb +27 -0
  42. data/lib/maglev-database-explorer/database_views/symbol.rb +33 -0
  43. data/lib/maglev-database-explorer/database_views/system.rb +48 -0
  44. data/lib/maglev-database-explorer/database_views/thread.rb +101 -0
  45. data/lib/maglev-database-explorer/debug_server.rb +22 -0
  46. data/lib/maglev-database-explorer/engine.rb +23 -0
  47. data/lib/maglev-database-explorer/engine_symlinks.rb +19 -0
  48. data/lib/maglev-database-explorer/halt.rb +33 -0
  49. data/lib/maglev-database-explorer/ruby_workspace.rb +31 -0
  50. data/lib/maglev-database-explorer/version.rb +3 -0
  51. data/lib/tasks/maglev-database-explorer_tasks.rake +4 -0
  52. data/public/LICENSE +35 -0
  53. data/public/amber/CHANGELOG +65 -0
  54. data/public/amber/LICENSE +22 -0
  55. data/public/amber/Makefile +53 -0
  56. data/public/amber/README.md +30 -0
  57. data/public/amber/bin/amber +3 -0
  58. data/public/amber/bin/amberc +352 -0
  59. data/public/amber/bin/nodecompile.js +33 -0
  60. data/public/amber/bin/server +3 -0
  61. data/public/amber/bin/server.bat +3 -0
  62. data/public/amber/css/amber-normalize.css +468 -0
  63. data/public/amber/css/amber-normalize.less +501 -0
  64. data/public/amber/css/amber.css +539 -0
  65. data/public/amber/css/documentation.css +84 -0
  66. data/public/amber/css/profstef.css +75 -0
  67. data/public/amber/css/style.css +313 -0
  68. data/public/amber/documentation.html +37 -0
  69. data/public/amber/examples/Makefile +23 -0
  70. data/public/amber/examples/README +4 -0
  71. data/public/amber/examples/android/helloamber/AndroidManifest.xml +19 -0
  72. data/public/amber/examples/android/helloamber/HelloAmber.st +13 -0
  73. data/public/amber/examples/android/helloamber/Makefile +56 -0
  74. data/public/amber/examples/android/helloamber/README.md +80 -0
  75. data/public/amber/examples/android/helloamber/ant.properties +17 -0
  76. data/public/amber/examples/android/helloamber/assets/index.html +15 -0
  77. data/public/amber/examples/android/helloamber/assets/jquery-1.7.2.min.js +4 -0
  78. data/public/amber/examples/android/helloamber/build.xml +83 -0
  79. data/public/amber/examples/android/helloamber/local.properties +10 -0
  80. data/public/amber/examples/android/helloamber/proguard-project.txt +20 -0
  81. data/public/amber/examples/android/helloamber/project.properties +14 -0
  82. data/public/amber/examples/android/helloamber/res/layout/main.xml +6 -0
  83. data/public/amber/examples/android/helloamber/res/values/strings.xml +4 -0
  84. data/public/amber/examples/android/helloamber/src/org/amberlang/android/helloamber/HelloAmber.java +59 -0
  85. data/public/amber/examples/myproject/index.html +16 -0
  86. data/public/amber/examples/nodejs/README +9 -0
  87. data/public/amber/examples/nodejs/benchfib/Benchfib.st +124 -0
  88. data/public/amber/examples/nodejs/benchfib/Makefile +8 -0
  89. data/public/amber/examples/nodejs/benchfib/benchfib +1 -0
  90. data/public/amber/examples/nodejs/hello/Hello.st +9 -0
  91. data/public/amber/examples/nodejs/hello/Makefile +8 -0
  92. data/public/amber/examples/nodejs/hello/README +13 -0
  93. data/public/amber/examples/nodejs/hello/hello +1 -0
  94. data/public/amber/examples/nodejs/meta/Makefile +8 -0
  95. data/public/amber/examples/nodejs/meta/MyScript.st +27 -0
  96. data/public/amber/examples/nodejs/meta/meta +1 -0
  97. data/public/amber/examples/nodejs/pystone/Makefile +8 -0
  98. data/public/amber/examples/nodejs/pystone/Pystone.st +306 -0
  99. data/public/amber/examples/nodejs/pystone/pystone +1 -0
  100. data/public/amber/examples/nodejs/trivialserver/Makefile +8 -0
  101. data/public/amber/examples/nodejs/trivialserver/TrivialServer.st +51 -0
  102. data/public/amber/examples/nodejs/trivialserver/trivial +1 -0
  103. data/public/amber/examples/presentation/esug2011/images/asterix.png +0 -0
  104. data/public/amber/examples/presentation/esug2011/images/background_box.png +0 -0
  105. data/public/amber/examples/presentation/esug2011/images/background_header.png +0 -0
  106. data/public/amber/examples/presentation/esug2011/images/balloon.jpg +0 -0
  107. data/public/amber/examples/presentation/esug2011/images/balloon_header.png +0 -0
  108. data/public/amber/examples/presentation/esug2011/images/devices.jpg +0 -0
  109. data/public/amber/examples/presentation/esug2011/images/enyo.png +0 -0
  110. data/public/amber/examples/presentation/esug2011/images/ide_star_wars.png +0 -0
  111. data/public/amber/examples/presentation/esug2011/images/nodejs.png +0 -0
  112. data/public/amber/examples/presentation/esug2011/images/terminal.png +0 -0
  113. data/public/amber/examples/presentation/esug2011/images/webos.png +0 -0
  114. data/public/amber/examples/presentation/fosdem2012/images/amber.png +0 -0
  115. data/public/amber/examples/presentation/fosdem2012/images/ambrhino.jpg +0 -0
  116. data/public/amber/examples/presentation/fosdem2012/images/nodejs.png +0 -0
  117. data/public/amber/examples/presentation/fosdem2012/images/pharo.png +0 -0
  118. data/public/amber/examples/presentation/fosdem2012/images/php.gif +0 -0
  119. data/public/amber/examples/presentation/fosdem2012/images/rails.png +0 -0
  120. data/public/amber/examples/presentation/fosdem2012/lib/booklet/images/arrow-next.png +0 -0
  121. data/public/amber/examples/presentation/fosdem2012/lib/booklet/images/arrow-prev.png +0 -0
  122. data/public/amber/examples/presentation/fosdem2012/lib/booklet/images/closedhand.cur +0 -0
  123. data/public/amber/examples/presentation/fosdem2012/lib/booklet/images/openhand.cur +0 -0
  124. data/public/amber/examples/presentation/fosdem2012/lib/booklet/images/shadow-top-back.png +0 -0
  125. data/public/amber/examples/presentation/fosdem2012/lib/booklet/images/shadow-top-forward.png +0 -0
  126. data/public/amber/examples/presentation/fosdem2012/lib/booklet/images/shadow.png +0 -0
  127. data/public/amber/examples/presentation/fosdem2012/lib/booklet/jquery.booklet.1.2.0.css +100 -0
  128. data/public/amber/examples/presentation/fosdem2012/lib/booklet/jquery.booklet.1.2.0.js +1232 -0
  129. data/public/amber/examples/presentation/fosdem2012/lib/booklet/jquery.booklet.1.2.0.min.js +13 -0
  130. data/public/amber/examples/presentation/fosdem2012/lib/booklet/jquery.easing.1.3.js +38 -0
  131. data/public/amber/examples/presentation/index.html +17 -0
  132. data/public/amber/examples/presentation/js/Presentation.deploy.js +1922 -0
  133. data/public/amber/examples/presentation/js/Presentation.js +2712 -0
  134. data/public/amber/examples/presentation/st/Presentation.st +1996 -0
  135. data/public/amber/examples/trysmalltalk/index.html +18 -0
  136. data/public/amber/examples/trysmalltalk/js/TrySmalltalk.deploy.js +837 -0
  137. data/public/amber/examples/trysmalltalk/js/TrySmalltalk.js +1206 -0
  138. data/public/amber/examples/trysmalltalk/st/TrySmalltalk.st +964 -0
  139. data/public/amber/examples/twitterwall/css/twitterwall.css +19 -0
  140. data/public/amber/examples/twitterwall/index.html +35 -0
  141. data/public/amber/examples/twitterwall/js/TwitterWall.deploy.js +116 -0
  142. data/public/amber/examples/twitterwall/js/TwitterWall.js +146 -0
  143. data/public/amber/examples/twitterwall/st/TwitterWall.st +91 -0
  144. data/public/amber/examples/webos/README +11 -0
  145. data/public/amber/examples/webos/eris/DuckQwaq.wav +0 -0
  146. data/public/amber/examples/webos/eris/EnyoAmber.st +36 -0
  147. data/public/amber/examples/webos/eris/Eris.css +0 -0
  148. data/public/amber/examples/webos/eris/Eris.st +86 -0
  149. data/public/amber/examples/webos/eris/Makefile +37 -0
  150. data/public/amber/examples/webos/eris/README +3 -0
  151. data/public/amber/examples/webos/eris/appinfo.json +10 -0
  152. data/public/amber/examples/webos/eris/depends.js +4 -0
  153. data/public/amber/examples/webos/eris/index.html +12 -0
  154. data/public/amber/examples/webos/helloamber/EnyoAmber.st +36 -0
  155. data/public/amber/examples/webos/helloamber/HelloAmber.st +86 -0
  156. data/public/amber/examples/webos/helloamber/Makefile +38 -0
  157. data/public/amber/examples/webos/helloamber/README +5 -0
  158. data/public/amber/examples/webos/helloamber/appinfo.json +10 -0
  159. data/public/amber/examples/webos/helloamber/depends.js +3 -0
  160. data/public/amber/examples/webos/helloamber/index.html +12 -0
  161. data/public/amber/favicon.ico +0 -0
  162. data/public/amber/images/amber.png +0 -0
  163. data/public/amber/images/amber.svg +706 -0
  164. data/public/amber/images/amber_small.png +0 -0
  165. data/public/amber/images/off.amber.png +0 -0
  166. data/public/amber/images/off.png +0 -0
  167. data/public/amber/images/offHover.amber.png +0 -0
  168. data/public/amber/images/offHover.png +0 -0
  169. data/public/amber/images/presentation.png +0 -0
  170. data/public/amber/images/profstef.png +0 -0
  171. data/public/amber/images/sprite.amber.png +0 -0
  172. data/public/amber/images/sprite.png +0 -0
  173. data/public/amber/images/tinylogo.amber.png +0 -0
  174. data/public/amber/images/tinylogo.png +0 -0
  175. data/public/amber/images/twitterwall.png +0 -0
  176. data/public/amber/index.html +55 -0
  177. data/public/amber/js/Additional-Examples.deploy.js +15 -0
  178. data/public/amber/js/Additional-Examples.js +21 -0
  179. data/public/amber/js/Benchfib.deploy.js +132 -0
  180. data/public/amber/js/Benchfib.js +167 -0
  181. data/public/amber/js/Canvas.deploy.js +2446 -0
  182. data/public/amber/js/Canvas.js +3547 -0
  183. data/public/amber/js/Compiler-Tests.deploy.js +97 -0
  184. data/public/amber/js/Compiler-Tests.js +137 -0
  185. data/public/amber/js/Compiler.deploy.js +1877 -0
  186. data/public/amber/js/Compiler.js +2622 -0
  187. data/public/amber/js/Documentation.deploy.js +961 -0
  188. data/public/amber/js/Documentation.js +1376 -0
  189. data/public/amber/js/Examples.deploy.js +53 -0
  190. data/public/amber/js/Examples.js +73 -0
  191. data/public/amber/js/IDE.deploy.js +3557 -0
  192. data/public/amber/js/IDE.js +5002 -0
  193. data/public/amber/js/Kernel-Announcements.deploy.js +107 -0
  194. data/public/amber/js/Kernel-Announcements.js +152 -0
  195. data/public/amber/js/Kernel-Classes.deploy.js +774 -0
  196. data/public/amber/js/Kernel-Classes.js +1095 -0
  197. data/public/amber/js/Kernel-Collections.deploy.js +3121 -0
  198. data/public/amber/js/Kernel-Collections.js +4427 -0
  199. data/public/amber/js/Kernel-Exceptions.deploy.js +244 -0
  200. data/public/amber/js/Kernel-Exceptions.js +349 -0
  201. data/public/amber/js/Kernel-Methods.deploy.js +573 -0
  202. data/public/amber/js/Kernel-Methods.js +807 -0
  203. data/public/amber/js/Kernel-Objects.deploy.js +2877 -0
  204. data/public/amber/js/Kernel-Objects.js +4107 -0
  205. data/public/amber/js/Kernel-Tests.deploy.js +1513 -0
  206. data/public/amber/js/Kernel-Tests.js +2053 -0
  207. data/public/amber/js/Kernel-Transcript.deploy.js +142 -0
  208. data/public/amber/js/Kernel-Transcript.js +202 -0
  209. data/public/amber/js/Maglev-Core.deploy.js +2967 -0
  210. data/public/amber/js/Maglev-Core.js +4202 -0
  211. data/public/amber/js/Maglev-Database-Explorer.deploy.js +4426 -0
  212. data/public/amber/js/Maglev-Database-Explorer.js +6162 -0
  213. data/public/amber/js/Maglev-Vendor.deploy.js +350 -0
  214. data/public/amber/js/Maglev-Vendor.js +465 -0
  215. data/public/amber/js/README.md +5 -0
  216. data/public/amber/js/SUnit.deploy.js +351 -0
  217. data/public/amber/js/SUnit.js +501 -0
  218. data/public/amber/js/amber.js +273 -0
  219. data/public/amber/js/boot.js +602 -0
  220. data/public/amber/js/compat.js +22 -0
  221. data/public/amber/js/init.js +9 -0
  222. data/public/amber/js/lib/CodeMirror/LICENSE +19 -0
  223. data/public/amber/js/lib/CodeMirror/active-line.js +39 -0
  224. data/public/amber/js/lib/CodeMirror/amber.css +21 -0
  225. data/public/amber/js/lib/CodeMirror/codemirror.css +67 -0
  226. data/public/amber/js/lib/CodeMirror/codemirror.js +2144 -0
  227. data/public/amber/js/lib/CodeMirror/smalltalk.js +134 -0
  228. data/public/amber/js/lib/jQuery/jquery-1.4.4.min.js +167 -0
  229. data/public/amber/js/lib/jQuery/jquery-1.6.4.min.js +4 -0
  230. data/public/amber/js/lib/jQuery/jquery-ui-1.8.16.custom.min.js +791 -0
  231. data/public/amber/js/lib/jQuery/jquery.textarea.js +267 -0
  232. data/public/amber/js/lib/peg-0.6.2.min.js +2 -0
  233. data/public/amber/js/lib/showdown.js +419 -0
  234. data/public/amber/js/parser.js +4222 -0
  235. data/public/amber/js/parser.pegjs +223 -0
  236. data/public/amber/learn.html +40 -0
  237. data/public/amber/repl/Makefile +8 -0
  238. data/public/amber/repl/REPL.js +124 -0
  239. data/public/amber/repl/REPL.st +56 -0
  240. data/public/amber/repl/amber.js +18085 -0
  241. data/public/amber/server/FileServer.st +576 -0
  242. data/public/amber/server/Makefile +8 -0
  243. data/public/amber/server/server.js +13049 -0
  244. data/public/amber/st/Benchfib.st +124 -0
  245. data/public/amber/st/Canvas.st +968 -0
  246. data/public/amber/st/Compiler-Tests.st +471 -0
  247. data/public/amber/st/Compiler.st +1445 -0
  248. data/public/amber/st/Documentation.st +758 -0
  249. data/public/amber/st/Examples.st +38 -0
  250. data/public/amber/st/IDE.st +2404 -0
  251. data/public/amber/st/Kernel-Announcements.st +61 -0
  252. data/public/amber/st/Kernel-Classes.st +462 -0
  253. data/public/amber/st/Kernel-Collections.st +1611 -0
  254. data/public/amber/st/Kernel-Exceptions.st +124 -0
  255. data/public/amber/st/Kernel-Methods.st +291 -0
  256. data/public/amber/st/Kernel-Objects.st +1587 -0
  257. data/public/amber/st/Kernel-Tests.st +953 -0
  258. data/public/amber/st/Kernel-Transcript.st +70 -0
  259. data/public/amber/st/Maglev-Core.st +1659 -0
  260. data/public/amber/st/Maglev-Database-Explorer.st +3085 -0
  261. data/public/amber/st/Maglev-Vendor.st +213 -0
  262. data/public/amber/st/Makefile +104 -0
  263. data/public/amber/st/README.md +4 -0
  264. data/public/amber/st/SUnit.st +172 -0
  265. data/public/css/bootstrap-combined.no-icons.min.css +731 -0
  266. data/public/css/bootstrap.css +6811 -0
  267. data/public/css/jquery-ui.min.css +5 -0
  268. data/public/css/smalltalk_code.css +42 -0
  269. data/public/css/style.css +209 -0
  270. data/public/images/maglev-logo.gif +0 -0
  271. data/public/images/rails_tiny.png +0 -0
  272. data/public/images/ruby.png +0 -0
  273. data/public/images/ruby_smalltalk_bridge.png +0 -0
  274. data/public/images/smalltalk.png +0 -0
  275. data/public/libs/bootstrap.min.js +7 -0
  276. data/public/libs/codemirror/CONTRIBUTING.md +72 -0
  277. data/public/libs/codemirror/LICENSE +23 -0
  278. data/public/libs/codemirror/README.md +11 -0
  279. data/public/libs/codemirror/addon/dialog/dialog.css +32 -0
  280. data/public/libs/codemirror/addon/dialog/dialog.js +80 -0
  281. data/public/libs/codemirror/addon/display/placeholder.js +54 -0
  282. data/public/libs/codemirror/addon/edit/closebrackets.js +54 -0
  283. data/public/libs/codemirror/addon/edit/closetag.js +86 -0
  284. data/public/libs/codemirror/addon/edit/continuecomment.js +44 -0
  285. data/public/libs/codemirror/addon/edit/continuelist.js +25 -0
  286. data/public/libs/codemirror/addon/edit/matchbrackets.js +82 -0
  287. data/public/libs/codemirror/addon/fold/brace-fold.js +31 -0
  288. data/public/libs/codemirror/addon/fold/foldcode.js +32 -0
  289. data/public/libs/codemirror/addon/fold/indent-fold.js +11 -0
  290. data/public/libs/codemirror/addon/fold/xml-fold.js +64 -0
  291. data/public/libs/codemirror/addon/hint/html-hint.js +582 -0
  292. data/public/libs/codemirror/addon/hint/javascript-hint.js +142 -0
  293. data/public/libs/codemirror/addon/hint/pig-hint.js +117 -0
  294. data/public/libs/codemirror/addon/hint/python-hint.js +93 -0
  295. data/public/libs/codemirror/addon/hint/show-hint.css +38 -0
  296. data/public/libs/codemirror/addon/hint/show-hint.js +180 -0
  297. data/public/libs/codemirror/addon/hint/xml-hint.js +118 -0
  298. data/public/libs/codemirror/addon/lint/javascript-lint.js +127 -0
  299. data/public/libs/codemirror/addon/lint/json-lint.js +14 -0
  300. data/public/libs/codemirror/addon/lint/lint.css +96 -0
  301. data/public/libs/codemirror/addon/lint/lint.js +197 -0
  302. data/public/libs/codemirror/addon/mode/loadmode.js +51 -0
  303. data/public/libs/codemirror/addon/mode/multiplex.js +95 -0
  304. data/public/libs/codemirror/addon/mode/overlay.js +59 -0
  305. data/public/libs/codemirror/addon/runmode/colorize.js +29 -0
  306. data/public/libs/codemirror/addon/runmode/runmode-standalone.js +130 -0
  307. data/public/libs/codemirror/addon/runmode/runmode.js +52 -0
  308. data/public/libs/codemirror/addon/runmode/runmode.node.js +89 -0
  309. data/public/libs/codemirror/addon/search/match-highlighter.js +60 -0
  310. data/public/libs/codemirror/addon/search/search.js +131 -0
  311. data/public/libs/codemirror/addon/search/searchcursor.js +133 -0
  312. data/public/libs/codemirror/addon/selection/active-line.js +39 -0
  313. data/public/libs/codemirror/addon/selection/mark-selection.js +34 -0
  314. data/public/libs/codemirror/bin/compress +91 -0
  315. data/public/libs/codemirror/bin/lint +11 -0
  316. data/public/libs/codemirror/demo/activeline.html +70 -0
  317. data/public/libs/codemirror/demo/bidi.html +61 -0
  318. data/public/libs/codemirror/demo/btree.html +87 -0
  319. data/public/libs/codemirror/demo/buffers.html +98 -0
  320. data/public/libs/codemirror/demo/changemode.html +50 -0
  321. data/public/libs/codemirror/demo/closebrackets.html +63 -0
  322. data/public/libs/codemirror/demo/closetag.html +37 -0
  323. data/public/libs/codemirror/demo/complete.html +70 -0
  324. data/public/libs/codemirror/demo/emacs.html +60 -0
  325. data/public/libs/codemirror/demo/folding.html +69 -0
  326. data/public/libs/codemirror/demo/fullscreen.html +147 -0
  327. data/public/libs/codemirror/demo/html5complete.html +92 -0
  328. data/public/libs/codemirror/demo/indentwrap.html +49 -0
  329. data/public/libs/codemirror/demo/lint.html +90 -0
  330. data/public/libs/codemirror/demo/loadmode.html +40 -0
  331. data/public/libs/codemirror/demo/marker.html +59 -0
  332. data/public/libs/codemirror/demo/markselection.html +36 -0
  333. data/public/libs/codemirror/demo/matchhighlighter.html +38 -0
  334. data/public/libs/codemirror/demo/multiplex.html +60 -0
  335. data/public/libs/codemirror/demo/mustache.html +59 -0
  336. data/public/libs/codemirror/demo/placeholder.html +36 -0
  337. data/public/libs/codemirror/demo/preview.html +76 -0
  338. data/public/libs/codemirror/demo/resize.html +49 -0
  339. data/public/libs/codemirror/demo/runmode.html +50 -0
  340. data/public/libs/codemirror/demo/search.html +85 -0
  341. data/public/libs/codemirror/demo/spanaffectswrapping_shim.html +73 -0
  342. data/public/libs/codemirror/demo/theme.html +89 -0
  343. data/public/libs/codemirror/demo/variableheight.html +52 -0
  344. data/public/libs/codemirror/demo/vim.html +65 -0
  345. data/public/libs/codemirror/demo/visibletabs.html +53 -0
  346. data/public/libs/codemirror/demo/widget.html +74 -0
  347. data/public/libs/codemirror/demo/xmlcomplete.html +81 -0
  348. data/public/libs/codemirror/doc/baboon.png +0 -0
  349. data/public/libs/codemirror/doc/baboon_vector.svg +153 -0
  350. data/public/libs/codemirror/doc/compress.html +200 -0
  351. data/public/libs/codemirror/doc/docs.css +167 -0
  352. data/public/libs/codemirror/doc/internals.html +505 -0
  353. data/public/libs/codemirror/doc/manual.html +1897 -0
  354. data/public/libs/codemirror/doc/modes.html +94 -0
  355. data/public/libs/codemirror/doc/oldrelease.html +492 -0
  356. data/public/libs/codemirror/doc/realworld.html +100 -0
  357. data/public/libs/codemirror/doc/reporting.html +60 -0
  358. data/public/libs/codemirror/doc/upgrade_v2.2.html +98 -0
  359. data/public/libs/codemirror/doc/upgrade_v3.html +227 -0
  360. data/public/libs/codemirror/index.html +487 -0
  361. data/public/libs/codemirror/keymap/emacs.js +30 -0
  362. data/public/libs/codemirror/keymap/vim.js +3044 -0
  363. data/public/libs/codemirror/lib/codemirror.css +253 -0
  364. data/public/libs/codemirror/lib/codemirror.js +5585 -0
  365. data/public/libs/codemirror/mode/apl/apl.js +160 -0
  366. data/public/libs/codemirror/mode/apl/index.html +61 -0
  367. data/public/libs/codemirror/mode/asterisk/asterisk.js +183 -0
  368. data/public/libs/codemirror/mode/asterisk/index.html +142 -0
  369. data/public/libs/codemirror/mode/clike/clike.js +302 -0
  370. data/public/libs/codemirror/mode/clike/index.html +103 -0
  371. data/public/libs/codemirror/mode/clike/scala.html +767 -0
  372. data/public/libs/codemirror/mode/clojure/clojure.js +222 -0
  373. data/public/libs/codemirror/mode/clojure/index.html +76 -0
  374. data/public/libs/codemirror/mode/coffeescript/LICENSE +22 -0
  375. data/public/libs/codemirror/mode/coffeescript/coffeescript.js +346 -0
  376. data/public/libs/codemirror/mode/coffeescript/index.html +728 -0
  377. data/public/libs/codemirror/mode/commonlisp/commonlisp.js +101 -0
  378. data/public/libs/codemirror/mode/commonlisp/index.html +165 -0
  379. data/public/libs/codemirror/mode/css/css.js +567 -0
  380. data/public/libs/codemirror/mode/css/index.html +58 -0
  381. data/public/libs/codemirror/mode/css/scss.html +145 -0
  382. data/public/libs/codemirror/mode/css/scss_test.js +80 -0
  383. data/public/libs/codemirror/mode/css/test.js +113 -0
  384. data/public/libs/codemirror/mode/d/d.js +205 -0
  385. data/public/libs/codemirror/mode/d/index.html +262 -0
  386. data/public/libs/codemirror/mode/diff/diff.js +32 -0
  387. data/public/libs/codemirror/mode/diff/index.html +105 -0
  388. data/public/libs/codemirror/mode/ecl/ecl.js +192 -0
  389. data/public/libs/codemirror/mode/ecl/index.html +39 -0
  390. data/public/libs/codemirror/mode/erlang/erlang.js +463 -0
  391. data/public/libs/codemirror/mode/erlang/index.html +64 -0
  392. data/public/libs/codemirror/mode/gas/gas.js +326 -0
  393. data/public/libs/codemirror/mode/gas/index.html +57 -0
  394. data/public/libs/codemirror/mode/gfm/gfm.js +96 -0
  395. data/public/libs/codemirror/mode/gfm/index.html +74 -0
  396. data/public/libs/codemirror/mode/gfm/test.js +112 -0
  397. data/public/libs/codemirror/mode/go/go.js +165 -0
  398. data/public/libs/codemirror/mode/go/index.html +74 -0
  399. data/public/libs/codemirror/mode/groovy/groovy.js +210 -0
  400. data/public/libs/codemirror/mode/groovy/index.html +73 -0
  401. data/public/libs/codemirror/mode/haskell/haskell.js +242 -0
  402. data/public/libs/codemirror/mode/haskell/index.html +62 -0
  403. data/public/libs/codemirror/mode/haxe/haxe.js +429 -0
  404. data/public/libs/codemirror/mode/haxe/index.html +90 -0
  405. data/public/libs/codemirror/mode/htmlembedded/htmlembedded.js +73 -0
  406. data/public/libs/codemirror/mode/htmlembedded/index.html +49 -0
  407. data/public/libs/codemirror/mode/htmlmixed/htmlmixed.js +104 -0
  408. data/public/libs/codemirror/mode/htmlmixed/index.html +73 -0
  409. data/public/libs/codemirror/mode/http/http.js +98 -0
  410. data/public/libs/codemirror/mode/http/index.html +32 -0
  411. data/public/libs/codemirror/mode/javascript/index.html +92 -0
  412. data/public/libs/codemirror/mode/javascript/javascript.js +467 -0
  413. data/public/libs/codemirror/mode/javascript/typescript.html +48 -0
  414. data/public/libs/codemirror/mode/jinja2/index.html +38 -0
  415. data/public/libs/codemirror/mode/jinja2/jinja2.js +42 -0
  416. data/public/libs/codemirror/mode/less/index.html +741 -0
  417. data/public/libs/codemirror/mode/less/less.js +266 -0
  418. data/public/libs/codemirror/mode/livescript/LICENSE +23 -0
  419. data/public/libs/codemirror/mode/livescript/index.html +446 -0
  420. data/public/libs/codemirror/mode/livescript/livescript.js +267 -0
  421. data/public/libs/codemirror/mode/livescript/livescript.ls +266 -0
  422. data/public/libs/codemirror/mode/lua/index.html +74 -0
  423. data/public/libs/codemirror/mode/lua/lua.js +140 -0
  424. data/public/libs/codemirror/mode/markdown/index.html +344 -0
  425. data/public/libs/codemirror/mode/markdown/markdown.js +526 -0
  426. data/public/libs/codemirror/mode/markdown/test.js +636 -0
  427. data/public/libs/codemirror/mode/meta.js +75 -0
  428. data/public/libs/codemirror/mode/mirc/index.html +149 -0
  429. data/public/libs/codemirror/mode/mirc/mirc.js +177 -0
  430. data/public/libs/codemirror/mode/ntriples/index.html +33 -0
  431. data/public/libs/codemirror/mode/ntriples/ntriples.js +170 -0
  432. data/public/libs/codemirror/mode/ocaml/index.html +131 -0
  433. data/public/libs/codemirror/mode/ocaml/ocaml.js +113 -0
  434. data/public/libs/codemirror/mode/pascal/LICENSE +7 -0
  435. data/public/libs/codemirror/mode/pascal/index.html +48 -0
  436. data/public/libs/codemirror/mode/pascal/pascal.js +94 -0
  437. data/public/libs/codemirror/mode/perl/LICENSE +19 -0
  438. data/public/libs/codemirror/mode/perl/index.html +62 -0
  439. data/public/libs/codemirror/mode/perl/perl.js +816 -0
  440. data/public/libs/codemirror/mode/php/index.html +51 -0
  441. data/public/libs/codemirror/mode/php/php.js +129 -0
  442. data/public/libs/codemirror/mode/pig/index.html +42 -0
  443. data/public/libs/codemirror/mode/pig/pig.js +171 -0
  444. data/public/libs/codemirror/mode/properties/index.html +41 -0
  445. data/public/libs/codemirror/mode/properties/properties.js +63 -0
  446. data/public/libs/codemirror/mode/python/LICENSE.txt +21 -0
  447. data/public/libs/codemirror/mode/python/index.html +135 -0
  448. data/public/libs/codemirror/mode/python/python.js +340 -0
  449. data/public/libs/codemirror/mode/q/index.html +131 -0
  450. data/public/libs/codemirror/mode/q/q.js +124 -0
  451. data/public/libs/codemirror/mode/r/LICENSE +24 -0
  452. data/public/libs/codemirror/mode/r/index.html +74 -0
  453. data/public/libs/codemirror/mode/r/r.js +141 -0
  454. data/public/libs/codemirror/mode/rpm/changes/changes.js +19 -0
  455. data/public/libs/codemirror/mode/rpm/changes/index.html +53 -0
  456. data/public/libs/codemirror/mode/rpm/spec/index.html +99 -0
  457. data/public/libs/codemirror/mode/rpm/spec/spec.css +5 -0
  458. data/public/libs/codemirror/mode/rpm/spec/spec.js +66 -0
  459. data/public/libs/codemirror/mode/rst/LICENSE.txt +21 -0
  460. data/public/libs/codemirror/mode/rst/index.html +524 -0
  461. data/public/libs/codemirror/mode/rst/rst.js +550 -0
  462. data/public/libs/codemirror/mode/ruby/LICENSE +24 -0
  463. data/public/libs/codemirror/mode/ruby/index.html +173 -0
  464. data/public/libs/codemirror/mode/ruby/ruby.js +197 -0
  465. data/public/libs/codemirror/mode/rust/index.html +48 -0
  466. data/public/libs/codemirror/mode/rust/rust.js +432 -0
  467. data/public/libs/codemirror/mode/sass/index.html +54 -0
  468. data/public/libs/codemirror/mode/sass/sass.js +349 -0
  469. data/public/libs/codemirror/mode/scheme/index.html +65 -0
  470. data/public/libs/codemirror/mode/scheme/scheme.js +230 -0
  471. data/public/libs/codemirror/mode/shell/index.html +51 -0
  472. data/public/libs/codemirror/mode/shell/shell.js +118 -0
  473. data/public/libs/codemirror/mode/sieve/LICENSE +19 -0
  474. data/public/libs/codemirror/mode/sieve/index.html +81 -0
  475. data/public/libs/codemirror/mode/sieve/sieve.js +183 -0
  476. data/public/libs/codemirror/mode/smalltalk/index.html +57 -0
  477. data/public/libs/codemirror/mode/smalltalk/smalltalk.js +141 -0
  478. data/public/libs/codemirror/mode/smarty/index.html +83 -0
  479. data/public/libs/codemirror/mode/smarty/smarty.js +148 -0
  480. data/public/libs/codemirror/mode/sparql/index.html +42 -0
  481. data/public/libs/codemirror/mode/sparql/sparql.js +143 -0
  482. data/public/libs/codemirror/mode/sql/index.html +68 -0
  483. data/public/libs/codemirror/mode/sql/sql.js +268 -0
  484. data/public/libs/codemirror/mode/stex/index.html +98 -0
  485. data/public/libs/codemirror/mode/stex/stex.js +246 -0
  486. data/public/libs/codemirror/mode/stex/test.js +117 -0
  487. data/public/libs/codemirror/mode/tcl/index.html +129 -0
  488. data/public/libs/codemirror/mode/tcl/tcl.js +131 -0
  489. data/public/libs/codemirror/mode/tiddlywiki/index.html +142 -0
  490. data/public/libs/codemirror/mode/tiddlywiki/tiddlywiki.css +14 -0
  491. data/public/libs/codemirror/mode/tiddlywiki/tiddlywiki.js +353 -0
  492. data/public/libs/codemirror/mode/tiki/index.html +81 -0
  493. data/public/libs/codemirror/mode/tiki/tiki.css +26 -0
  494. data/public/libs/codemirror/mode/tiki/tiki.js +308 -0
  495. data/public/libs/codemirror/mode/turtle/index.html +39 -0
  496. data/public/libs/codemirror/mode/turtle/turtle.js +145 -0
  497. data/public/libs/codemirror/mode/vb/LICENSE.txt +21 -0
  498. data/public/libs/codemirror/mode/vb/index.html +88 -0
  499. data/public/libs/codemirror/mode/vb/vb.js +259 -0
  500. data/public/libs/codemirror/mode/vbscript/index.html +42 -0
  501. data/public/libs/codemirror/mode/vbscript/vbscript.js +26 -0
  502. data/public/libs/codemirror/mode/velocity/index.html +103 -0
  503. data/public/libs/codemirror/mode/velocity/velocity.js +144 -0
  504. data/public/libs/codemirror/mode/verilog/index.html +121 -0
  505. data/public/libs/codemirror/mode/verilog/verilog.js +182 -0
  506. data/public/libs/codemirror/mode/xml/index.html +45 -0
  507. data/public/libs/codemirror/mode/xml/xml.js +328 -0
  508. data/public/libs/codemirror/mode/xquery/LICENSE +20 -0
  509. data/public/libs/codemirror/mode/xquery/index.html +221 -0
  510. data/public/libs/codemirror/mode/xquery/test.js +64 -0
  511. data/public/libs/codemirror/mode/xquery/xquery.js +450 -0
  512. data/public/libs/codemirror/mode/yaml/index.html +68 -0
  513. data/public/libs/codemirror/mode/yaml/yaml.js +95 -0
  514. data/public/libs/codemirror/mode/z80/index.html +39 -0
  515. data/public/libs/codemirror/mode/z80/z80.js +85 -0
  516. data/public/libs/codemirror/package.json +21 -0
  517. data/public/libs/codemirror/test/doc_test.js +329 -0
  518. data/public/libs/codemirror/test/driver.js +138 -0
  519. data/public/libs/codemirror/test/index.html +182 -0
  520. data/public/libs/codemirror/test/lint/acorn.js +1593 -0
  521. data/public/libs/codemirror/test/lint/lint.js +112 -0
  522. data/public/libs/codemirror/test/lint/parse-js.js +1372 -0
  523. data/public/libs/codemirror/test/lint/walk.js +216 -0
  524. data/public/libs/codemirror/test/mode_test.css +10 -0
  525. data/public/libs/codemirror/test/mode_test.js +192 -0
  526. data/public/libs/codemirror/test/phantom_driver.js +31 -0
  527. data/public/libs/codemirror/test/run.js +33 -0
  528. data/public/libs/codemirror/test/test.js +1400 -0
  529. data/public/libs/codemirror/test/vim_test.js +1688 -0
  530. data/public/libs/codemirror/theme/ambiance-mobile.css +5 -0
  531. data/public/libs/codemirror/theme/ambiance.css +75 -0
  532. data/public/libs/codemirror/theme/blackboard.css +25 -0
  533. data/public/libs/codemirror/theme/cobalt.css +18 -0
  534. data/public/libs/codemirror/theme/eclipse.css +25 -0
  535. data/public/libs/codemirror/theme/elegant.css +10 -0
  536. data/public/libs/codemirror/theme/erlang-dark.css +21 -0
  537. data/public/libs/codemirror/theme/lesser-dark.css +44 -0
  538. data/public/libs/codemirror/theme/midnight.css +52 -0
  539. data/public/libs/codemirror/theme/monokai.css +28 -0
  540. data/public/libs/codemirror/theme/neat.css +9 -0
  541. data/public/libs/codemirror/theme/night.css +21 -0
  542. data/public/libs/codemirror/theme/rubyblue.css +21 -0
  543. data/public/libs/codemirror/theme/solarized.css +207 -0
  544. data/public/libs/codemirror/theme/twilight.css +26 -0
  545. data/public/libs/codemirror/theme/vibrant-ink.css +27 -0
  546. data/public/libs/codemirror/theme/xq-dark.css +46 -0
  547. data/public/libs/codemirror/theme/xq-light.css +43 -0
  548. data/public/libs/font-awesome/css/font-awesome-ie7.css +983 -0
  549. data/public/libs/font-awesome/css/font-awesome-ie7.min.css +24 -0
  550. data/public/libs/font-awesome/css/font-awesome.css +1268 -0
  551. data/public/libs/font-awesome/css/font-awesome.min.css +24 -0
  552. data/public/libs/font-awesome/font/FontAwesome.otf +0 -0
  553. data/public/libs/font-awesome/font/fontawesome-webfont.eot +0 -0
  554. data/public/libs/font-awesome/font/fontawesome-webfont.svg +339 -0
  555. data/public/libs/font-awesome/font/fontawesome-webfont.ttf +0 -0
  556. data/public/libs/font-awesome/font/fontawesome-webfont.woff +0 -0
  557. data/public/libs/font-awesome/less/bootstrap.less +78 -0
  558. data/public/libs/font-awesome/less/core.less +132 -0
  559. data/public/libs/font-awesome/less/extras.less +79 -0
  560. data/public/libs/font-awesome/less/font-awesome-ie7.less +413 -0
  561. data/public/libs/font-awesome/less/font-awesome.less +32 -0
  562. data/public/libs/font-awesome/less/icons.less +330 -0
  563. data/public/libs/font-awesome/less/mixins.less +34 -0
  564. data/public/libs/font-awesome/less/path.less +15 -0
  565. data/public/libs/font-awesome/less/variables.less +9 -0
  566. data/public/libs/jquery-1.10.0.min.js +6 -0
  567. data/public/libs/jquery-ui.min.js +12 -0
  568. data/public/libs/jquery.jsPlumb-1.4.0-all.js +9571 -0
  569. data/public/libs/jquery.livequery.js +226 -0
  570. data/public/libs/jsPlumbInitializer.js +72 -0
  571. data/public/libs/jstree/README.txt +10 -0
  572. data/public/libs/jstree/_demo/_dump.sql +20 -0
  573. data/public/libs/jstree/_demo/_inc/__mysql_errors.log +0 -0
  574. data/public/libs/jstree/_demo/_inc/class._database.php +146 -0
  575. data/public/libs/jstree/_demo/_inc/class._database_i.php +152 -0
  576. data/public/libs/jstree/_demo/_inc/class.tree.php +602 -0
  577. data/public/libs/jstree/_demo/_install.txt +6 -0
  578. data/public/libs/jstree/_demo/config.php +14 -0
  579. data/public/libs/jstree/_demo/file.png +0 -0
  580. data/public/libs/jstree/_demo/folder.png +0 -0
  581. data/public/libs/jstree/_demo/index.html +461 -0
  582. data/public/libs/jstree/_demo/root.png +0 -0
  583. data/public/libs/jstree/_demo/server.php +69 -0
  584. data/public/libs/jstree/_docs/!style.css +48 -0
  585. data/public/libs/jstree/_docs/_drive.png +0 -0
  586. data/public/libs/jstree/_docs/_html_data.html +2 -0
  587. data/public/libs/jstree/_docs/_json_data.json +4 -0
  588. data/public/libs/jstree/_docs/_search_data.json +6 -0
  589. data/public/libs/jstree/_docs/_search_result.json +1 -0
  590. data/public/libs/jstree/_docs/_xml_flat.xml +12 -0
  591. data/public/libs/jstree/_docs/_xml_nest.xml +18 -0
  592. data/public/libs/jstree/_docs/checkbox.html +171 -0
  593. data/public/libs/jstree/_docs/contextmenu.html +121 -0
  594. data/public/libs/jstree/_docs/cookies.html +97 -0
  595. data/public/libs/jstree/_docs/core.html +689 -0
  596. data/public/libs/jstree/_docs/crrm.html +316 -0
  597. data/public/libs/jstree/_docs/dnd.html +199 -0
  598. data/public/libs/jstree/_docs/hotkeys.html +82 -0
  599. data/public/libs/jstree/_docs/html_data.html +175 -0
  600. data/public/libs/jstree/_docs/index.html +86 -0
  601. data/public/libs/jstree/_docs/json_data.html +249 -0
  602. data/public/libs/jstree/_docs/languages.html +152 -0
  603. data/public/libs/jstree/_docs/logo.png +0 -0
  604. data/public/libs/jstree/_docs/search.html +153 -0
  605. data/public/libs/jstree/_docs/sort.html +85 -0
  606. data/public/libs/jstree/_docs/syntax/!script.js +2232 -0
  607. data/public/libs/jstree/_docs/syntax/!style.css +511 -0
  608. data/public/libs/jstree/_docs/syntax/clipboard.swf +0 -0
  609. data/public/libs/jstree/_docs/syntax/help.png +0 -0
  610. data/public/libs/jstree/_docs/syntax/magnifier.png +0 -0
  611. data/public/libs/jstree/_docs/syntax/page_white_code.png +0 -0
  612. data/public/libs/jstree/_docs/syntax/page_white_copy.png +0 -0
  613. data/public/libs/jstree/_docs/syntax/printer.png +0 -0
  614. data/public/libs/jstree/_docs/syntax/wrapping.png +0 -0
  615. data/public/libs/jstree/_docs/themeroller.html +107 -0
  616. data/public/libs/jstree/_docs/themes.html +127 -0
  617. data/public/libs/jstree/_docs/types.html +178 -0
  618. data/public/libs/jstree/_docs/ui.html +197 -0
  619. data/public/libs/jstree/_docs/unique.html +85 -0
  620. data/public/libs/jstree/_docs/xml_data.html +218 -0
  621. data/public/libs/jstree/_lib/jquery.cookie.js +96 -0
  622. data/public/libs/jstree/_lib/jquery.hotkeys.js +99 -0
  623. data/public/libs/jstree/_lib/jquery.js +5 -0
  624. data/public/libs/jstree/jquery.jstree.js +4564 -0
  625. data/public/libs/jstree/themes/apple/bg.jpg +0 -0
  626. data/public/libs/jstree/themes/apple/d.png +0 -0
  627. data/public/libs/jstree/themes/apple/dot_for_ie.gif +0 -0
  628. data/public/libs/jstree/themes/apple/style.css +61 -0
  629. data/public/libs/jstree/themes/apple/throbber.gif +0 -0
  630. data/public/libs/jstree/themes/classic/d.gif +0 -0
  631. data/public/libs/jstree/themes/classic/d.png +0 -0
  632. data/public/libs/jstree/themes/classic/dot_for_ie.gif +0 -0
  633. data/public/libs/jstree/themes/classic/style.css +77 -0
  634. data/public/libs/jstree/themes/classic/throbber.gif +0 -0
  635. data/public/libs/jstree/themes/default-rtl/d.gif +0 -0
  636. data/public/libs/jstree/themes/default-rtl/d.png +0 -0
  637. data/public/libs/jstree/themes/default-rtl/dots.gif +0 -0
  638. data/public/libs/jstree/themes/default-rtl/style.css +84 -0
  639. data/public/libs/jstree/themes/default-rtl/throbber.gif +0 -0
  640. data/public/libs/jstree/themes/default/d.gif +0 -0
  641. data/public/libs/jstree/themes/default/d.png +0 -0
  642. data/public/libs/jstree/themes/default/style.css +74 -0
  643. data/public/libs/jstree/themes/default/throbber.gif +0 -0
  644. data/test/dummy/README.rdoc +261 -0
  645. data/test/dummy/Rakefile +7 -0
  646. data/test/dummy/app/assets/javascripts/application.js +15 -0
  647. data/test/dummy/app/assets/javascripts/demo_app.js +2 -0
  648. data/test/dummy/app/assets/stylesheets/application.css +13 -0
  649. data/test/dummy/app/assets/stylesheets/demo_app.css +4 -0
  650. data/test/dummy/app/controllers/application_controller.rb +3 -0
  651. data/test/dummy/app/controllers/demo_app_controller.rb +6 -0
  652. data/test/dummy/app/helpers/application_helper.rb +2 -0
  653. data/test/dummy/app/helpers/demo_app_helper.rb +2 -0
  654. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  655. data/test/dummy/config.ru +4 -0
  656. data/test/dummy/config/application.rb +59 -0
  657. data/test/dummy/config/boot.rb +10 -0
  658. data/test/dummy/config/database.yml +25 -0
  659. data/test/dummy/config/environment.rb +5 -0
  660. data/test/dummy/config/environments/development.rb +37 -0
  661. data/test/dummy/config/environments/production.rb +67 -0
  662. data/test/dummy/config/environments/test.rb +37 -0
  663. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  664. data/test/dummy/config/initializers/inflections.rb +15 -0
  665. data/test/dummy/config/initializers/mime_types.rb +5 -0
  666. data/test/dummy/config/initializers/secret_token.rb +7 -0
  667. data/test/dummy/config/initializers/session_store.rb +8 -0
  668. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  669. data/test/dummy/config/locales/en.yml +5 -0
  670. data/test/dummy/config/routes.rb +6 -0
  671. data/test/dummy/db/test.sqlite3 +0 -0
  672. data/test/dummy/log/development.log +17606 -0
  673. data/test/dummy/public/404.html +26 -0
  674. data/test/dummy/public/422.html +26 -0
  675. data/test/dummy/public/500.html +25 -0
  676. data/test/dummy/public/favicon.ico +0 -0
  677. data/test/dummy/script/rails +6 -0
  678. data/test/dummy/test/functional/demo_app_controller_test.rb +7 -0
  679. data/test/dummy/test/unit/helpers/demo_app_helper_test.rb +4 -0
  680. data/test/dummy/tmp/cache/assets/D26/980/sprockets%2Fe04a37a0fa7f26c1183a1a4436e2a9c1 +0 -0
  681. data/test/dummy/tmp/cache/assets/D32/4F0/sprockets%2Fbd5441f3593e4ea157222202f3fddad6 +0 -0
  682. data/test/dummy/tmp/pids/server.pid +1 -0
  683. data/test/functional/maglev_database_explorer/def_controller_test.rb +9 -0
  684. data/test/integration/navigation_test.rb +10 -0
  685. data/test/maglev-database-explorer_test.rb +7 -0
  686. data/test/test_helper.rb +15 -0
  687. data/test/unit/helpers/maglev_database_explorer/def_helper_test.rb +6 -0
  688. metadata +813 -0
@@ -0,0 +1,3085 @@
1
+ Smalltalk current createPackage: 'Maglev-Database-Explorer' properties: #{}!
2
+ Widget subclass: #MaglevDraggableObject
3
+ instanceVariableNames: 'content'
4
+ package: 'Maglev-Database-Explorer'!
5
+
6
+ !MaglevDraggableObject methodsFor: 'accessing'!
7
+
8
+ content
9
+ ^ content
10
+ !
11
+
12
+ content: anObject
13
+ content := anObject.
14
+ ! !
15
+
16
+ !MaglevDraggableObject methodsFor: 'rendering'!
17
+
18
+ renderOn: html
19
+ html div
20
+ class: 'draggable-new-object-container'
21
+ with: [
22
+ html div
23
+ class: 'ui-widget-content ui-draggable draggable-new-object';
24
+ with: [
25
+ html div
26
+ class: 'object-drag-dummy';
27
+ style: 'display: none;';
28
+ with: MaglevIcon move;
29
+ with: content.
30
+ html div
31
+ class: 'object-iv-name';
32
+ with: content]].
33
+ ! !
34
+
35
+ !MaglevDraggableObject class methodsFor: 'not yet classified'!
36
+
37
+ with: anObject
38
+ ^ self basicNew
39
+ content: anObject;
40
+ initialize;
41
+ yourself
42
+ ! !
43
+
44
+ Widget subclass: #MaglevGsNMethodEditor
45
+ instanceVariableNames: 'object editorContainer errorBox rubyIcon stIcon envIdContainer sourceLocationContainer editor editorHeight editorWidth'
46
+ package: 'Maglev-Database-Explorer'!
47
+
48
+ !MaglevGsNMethodEditor methodsFor: 'accessing'!
49
+
50
+ envId
51
+ ^ self methodObject at: 2
52
+ !
53
+
54
+ filename
55
+ ^ (self methodObject at: 4) at: 1
56
+ !
57
+
58
+ lineInFile
59
+ ^ (self methodObject at: 4) at: 2
60
+ !
61
+
62
+ methodObject
63
+ ^ object
64
+ !
65
+
66
+ object
67
+ ^ object
68
+ !
69
+
70
+ object: anObject
71
+ object := anObject
72
+ !
73
+
74
+ sourceOffset
75
+ ^ -1
76
+ !
77
+
78
+ sourceString
79
+ ^ self methodObject at: 1
80
+ ! !
81
+
82
+ !MaglevGsNMethodEditor methodsFor: 'initializing'!
83
+
84
+ initializeEditor
85
+ |params extraKeys|
86
+ extraKeys := Object new
87
+ basicAt: 'Ctrl-S' put: [self commandSave];
88
+ yourself.
89
+ params := Object new
90
+ basicAt: 'mode' put: 'text/x-ruby';
91
+ basicAt: 'styleActiveLine' put: true;
92
+ basicAt: 'lineNumbers' put: true;
93
+ basicAt: 'matchBrackets' put: true;
94
+ basicAt: 'extraKeys' put: extraKeys;
95
+ yourself.
96
+ editor := CodeMirror value: (editorContainer asJQuery at: 0) value: params.
97
+ editor setValue: ''.
98
+ self mouseFix.
99
+ self makeEditorResizable.
100
+ !
101
+
102
+ makeEditorResizable
103
+ < self['@editorContainer']._asJQuery().find('.CodeMirror').resizable({
104
+ resize: function() {
105
+ self['@editor'].setSize($(this).width(), $(this).height());
106
+ }
107
+ }); >
108
+ !
109
+
110
+ mouseFix
111
+ < var editor = self['@editorContainer'];
112
+ editor._asJQuery().mousedown(function (event) {
113
+ event.preventDefault();
114
+ return false;
115
+ }); >
116
+ ! !
117
+
118
+ !MaglevGsNMethodEditor methodsFor: 'interactions'!
119
+
120
+ commandSave
121
+ |selectedCategory|
122
+ errorBox hide.
123
+ errorBox asJQuery empty.
124
+ object environmentId = 1
125
+ ifTrue: [object
126
+ compileRubySourceCode: editor getValue
127
+ withCallback: [:success :obj |
128
+ obj isException
129
+ ifTrue: [self signalFailure: obj]
130
+ ifFalse: [self signalSuccess]]]
131
+ ifFalse: [object
132
+ compileSmalltalkSourceCode: editor getValue
133
+ withCallback: [:success :obj |
134
+ obj isException
135
+ ifTrue: [self signalFailure: obj]
136
+ ifFalse: [self signalSuccess]]].
137
+ !
138
+
139
+ signalFailure: aDescription
140
+ |html|
141
+ html := HTMLCanvas onJQuery: errorBox asJQuery.
142
+ html with: aDescription inlineViewComponent.
143
+ errorBox show.
144
+ editorContainer asJQuery css: 'background-color' with: '#ff0039'.
145
+ editorContainer asJQuery animate: (Object new basicAt: 'backgroundColor' put: '#ffffff'; yourself) timeout: 250.
146
+ !
147
+
148
+ signalSuccess
149
+ editorContainer asJQuery css: 'background-color' with: '#3fb618'.
150
+ editorContainer asJQuery animate: (Object new basicAt: 'backgroundColor' put: '#ffffff'; yourself) timeout: 250.
151
+ ! !
152
+
153
+ !MaglevGsNMethodEditor methodsFor: 'rendering'!
154
+
155
+ renderEditorOn: html
156
+ editorContainer := html span
157
+ class: 'pull-left code-area'.
158
+ html div style: 'clear: both;'.
159
+ errorBox := html div
160
+ class: 'alert alert-error';
161
+ style: 'margin-bottom: 0px;';
162
+ hide.
163
+ self initializeEditor.
164
+ !
165
+
166
+ renderMethodObject
167
+ |envId|
168
+ editor setValue: self sourceString.
169
+ editorContainer show.
170
+ envId := self envId.
171
+ envIdContainer asJQuery empty.
172
+ envIdContainer with: envId.
173
+ sourceLocationContainer empty.
174
+ envId = 1
175
+ ifTrue: [
176
+ sourceLocationContainer with: self filename.
177
+ stIcon hide. rubyIcon show.
178
+ editor setOption: 'mode' data: 'text/x-ruby'.]
179
+ ifFalse: [sourceLocationContainer with: 'n/a'].
180
+ envId = 0 ifTrue: [
181
+ stIcon show. rubyIcon hide.
182
+ editor setOption: 'mode' data: 'text/x-stsrc'].
183
+ envId > 1
184
+ ifTrue: [stIcon hide. rubyIcon hide].
185
+ !
186
+
187
+ renderOn: html
188
+ self renderEditorOn: html.
189
+ self renderStatusBarOn: html.
190
+ self renderMethodObject.
191
+ !
192
+
193
+ renderStatusBarOn: html
194
+ html table
195
+ class: 'table-bordered';
196
+ style: 'margin-top: 5px; width: 100%;';
197
+ with: [html tbody with: [
198
+ html tr with: [
199
+ html td with: [
200
+ rubyIcon := MaglevIconImage ruby hide; yourself.
201
+ stIcon := MaglevIconImage smalltalk hide; yourself.
202
+ html with: rubyIcon.
203
+ html with: stIcon.
204
+ envIdContainer := html span with: 'Environment ID'];
205
+ style: 'width: 1px;'.
206
+ html td with: [
207
+ sourceLocationContainer := html span with: 'Source location']]]].
208
+ ! !
209
+
210
+ !MaglevGsNMethodEditor class methodsFor: 'instance creation'!
211
+
212
+ for: anObject
213
+ ^ self basicNew
214
+ object: anObject;
215
+ initialize;
216
+ yourself
217
+ ! !
218
+
219
+ MaglevGsNMethodEditor subclass: #MaglevGsNMethodDebugEditor
220
+ instanceVariableNames: 'argValueBox argSelect'
221
+ package: 'Maglev-Database-Explorer'!
222
+ !MaglevGsNMethodDebugEditor commentStamp!
223
+ Copied from _frameContentsAt:
224
+
225
+ "Private. Returns an Array describing the specified level in the receiver.
226
+ aLevel == 1 is top of stack. If aLevel is less than 1 or greater than
227
+ stackDepth, returns nil.
228
+
229
+ The result Array contains:
230
+ offset item
231
+ ----- -----
232
+ 1 gsMethod (a GsNMethod)
233
+ 2 ipOffset (zero-based relative to first named instance variable in portable code;
234
+ negative means a stack breakpoint is present)
235
+ 3 frameOffset (zero-based)
236
+ 4 varContext
237
+ 5 saveProtectedMode
238
+ 6 markerOrException
239
+ 7 nil (not used)
240
+ 8 self (possibly nil in a ComplexBlock)
241
+ 9 argAndTempNames (an Array of Symbols or Strings)
242
+ 10 receiver
243
+ 11 arguments and temps, if any"!
244
+
245
+ !MaglevGsNMethodDebugEditor methodsFor: 'accessing'!
246
+
247
+ argAndTempNames
248
+ ^ object at: 9
249
+ !
250
+
251
+ argOrTempValue: anInteger
252
+ ^ MaglevObject newObject: ((object at: 11) at: anInteger)
253
+ !
254
+
255
+ methodObject
256
+ ^ object at: 1
257
+ !
258
+
259
+ ownerSelf
260
+ ^ MaglevObject newObject: (object at: 8)
261
+ !
262
+
263
+ receiver
264
+ ^ MaglevObject newObject: (object at: 10)
265
+ !
266
+
267
+ sourceOffset
268
+ ^ object at: 12
269
+ !
270
+
271
+ sourceOffsetX
272
+ ^ (object at: 13) at: 1
273
+ !
274
+
275
+ sourceOffsetY
276
+ ^ (object at: 13) at: 2
277
+ ! !
278
+
279
+ !MaglevGsNMethodDebugEditor methodsFor: 'rendering'!
280
+
281
+ renderArg
282
+ |argIndex argValue|
283
+ argIndex := (argSelect asJQuery at: 0) selectedIndex - 1.
284
+ argIndex = -1
285
+ ifTrue: [argValue := self ownerSelf].
286
+ argIndex = 0
287
+ ifTrue: [argValue := self receiver].
288
+ argIndex > 0
289
+ ifTrue: [argValue := self argOrTempValue: argIndex].
290
+ argValueBox asJQuery empty.
291
+ argValueBox with: argValue inlineViewComponent.
292
+ !
293
+
294
+ renderArgsOn: html
295
+ html table with: [
296
+ html tbody with: [
297
+ html tr with: [
298
+ html td with: [
299
+ argSelect := html select
300
+ with: [html option with: '(self)'];
301
+ with: [html option with: '(receiver)'];
302
+ with: [self argAndTempNames do: [:arg |
303
+ html option with: arg]];
304
+ style: 'margin-bottom: 0px;';
305
+ onChange: [self renderArg].
306
+ argValueBox := html div].
307
+ html td
308
+ with: [argValueBox := html div];
309
+ style: 'padding-left: 5px;']]];
310
+ style: 'margin-top: 5px;'.
311
+ self renderArg.
312
+ !
313
+
314
+ renderMethodObject
315
+ |rangeFrom rangeTo|
316
+ super renderMethodObject.
317
+ < self['@editor'].setSelection(
318
+ {line: self._sourceOffsetY(), ch: self._sourceOffsetX()},
319
+ {line: self._sourceOffsetY(), ch: self._sourceOffsetX()}); >.
320
+ editor replaceSelection: '⚡'.
321
+ !
322
+
323
+ renderOn: html
324
+ self renderEditorOn: html.
325
+ self renderArgsOn: html.
326
+ self renderStatusBarOn: html.
327
+ self renderMethodObject.
328
+ ! !
329
+
330
+ Object subclass: #MaglevHaltedThreadListener
331
+ instanceVariableNames: 'container interval timer renderedOops html navbar'
332
+ package: 'Maglev-Database-Explorer'!
333
+
334
+ !MaglevHaltedThreadListener methodsFor: 'accessing'!
335
+
336
+ interval
337
+ interval ifNil: [interval := 2500].
338
+ ^ interval
339
+ !
340
+
341
+ interval: aNumber
342
+ interval := aNumber.
343
+ < clearInterval(self['@timer']); >.
344
+ self startPolling.
345
+ ! !
346
+
347
+ !MaglevHaltedThreadListener methodsFor: 'initializing'!
348
+
349
+ initialize
350
+ container := '#halted-threads-navigation' asJQuery.
351
+ navbar := '#halted-threads-navbar' asJQuery.
352
+ navbar hide.
353
+ html := HTMLCanvas onJQuery: container.
354
+ renderedOops := Dictionary new.
355
+ !
356
+
357
+ start
358
+ timer := self startPolling.
359
+ !
360
+
361
+ startPolling
362
+ < return setInterval(function() {self._refresh();}, self._interval()); >
363
+ ! !
364
+
365
+ !MaglevHaltedThreadListener methodsFor: 'polling'!
366
+
367
+ refresh
368
+ |params|
369
+ params := Dictionary new
370
+ at: 'allElements' put: true;
371
+ at: 'noBehavior' put: true;
372
+ yourself.
373
+ MaglevObjectSpace instance evalObject
374
+ evaluateWithoutUpdate: 'MaglevDatabaseExplorer.halted_threads'
375
+ language: 'ruby'
376
+ with: params
377
+ withCallback: [:success :obj | |currentOops|
378
+ success ifTrue:[
379
+ currentOops := Set new.
380
+ obj do: [:el |
381
+ (renderedOops includesKey: el oop)
382
+ ifFalse: [self renderObject: el oop with: el inlineViewComponent].
383
+ currentOops add: el oop].
384
+ renderedOops keysAndValuesDo: [:oop :comp |
385
+ (currentOops includes: oop)
386
+ ifFalse: [self removeObject: oop with: comp]].
387
+ renderedOops size = 0
388
+ ifTrue: [navbar hide]
389
+ ifFalse: [navbar show]]].
390
+ !
391
+
392
+ removeObject: oop with: component
393
+ component asJQuery remove.
394
+ renderedOops removeKey: oop.
395
+ !
396
+
397
+ renderObject: oop with: component
398
+ |inlineContainer|
399
+ inlineContainer := html span
400
+ style: 'padding: 4px 2px 2px 4px;';
401
+ with: component.
402
+ renderedOops at: oop put: inlineContainer.
403
+ ! !
404
+
405
+ MaglevHaltedThreadListener class instanceVariableNames: 'instance'!
406
+
407
+ !MaglevHaltedThreadListener class methodsFor: 'instance creation'!
408
+
409
+ instance
410
+ instance ifNil: [instance := self new].
411
+ ^ instance
412
+ !
413
+
414
+ start
415
+ self instance start.
416
+ ! !
417
+
418
+ Widget subclass: #MaglevIcon
419
+ instanceVariableNames: 'b icon spin caption'
420
+ package: 'Maglev-Database-Explorer'!
421
+
422
+ !MaglevIcon methodsFor: 'accessing'!
423
+
424
+ caption
425
+ ^ caption
426
+ !
427
+
428
+ caption: aString
429
+ caption := aString.
430
+ !
431
+
432
+ icon
433
+ icon ifNil: [icon := 'star'].
434
+ ^ icon
435
+ !
436
+
437
+ icon: aString
438
+ icon := aString.
439
+ !
440
+
441
+ onClick: aBlock
442
+ b onClick: aBlock.
443
+ !
444
+
445
+ spin
446
+ spin ifNil: [spin := false].
447
+ ^ spin
448
+ !
449
+
450
+ spin: aBoolean
451
+ spin := aBoolean.
452
+ ! !
453
+
454
+ !MaglevIcon methodsFor: 'interactions'!
455
+
456
+ hide
457
+ b hide.
458
+ !
459
+
460
+ show
461
+ b show.
462
+ ! !
463
+
464
+ !MaglevIcon methodsFor: 'rendering'!
465
+
466
+ renderOn: html
467
+ |cssClass|
468
+ cssClass := 'icon-', self icon.
469
+ self spin
470
+ ifTrue: [cssClass := cssClass, ' icon-spin'].
471
+ caption
472
+ ifNil: [b := html b
473
+ class: cssClass;
474
+ yourself]
475
+ ifNotNil: [b := html b
476
+ class: cssClass;
477
+ data: 'toggle' with: 'tooltip';
478
+ data: 'placement' with: 'top';
479
+ data: 'original-title' with: caption;
480
+ yourself.
481
+ b asJQuery tooltip].
482
+ ! !
483
+
484
+ !MaglevIcon class methodsFor: 'instance creation'!
485
+
486
+ codeFork
487
+ ^ self new
488
+ icon: 'code-fork';
489
+ yourself
490
+ !
491
+
492
+ flag
493
+ ^ self new
494
+ icon: 'flag';
495
+ yourself
496
+ !
497
+
498
+ globe
499
+ ^ self new
500
+ icon: 'globe';
501
+ yourself
502
+ !
503
+
504
+ hdd
505
+ ^ self new
506
+ icon: 'hdd';
507
+ yourself
508
+ !
509
+
510
+ listAlt
511
+ ^ self new
512
+ icon: 'list-alt';
513
+ yourself
514
+ !
515
+
516
+ move
517
+ ^ self new
518
+ icon: 'move';
519
+ yourself
520
+ !
521
+
522
+ pause
523
+ ^ self new
524
+ icon: 'pause';
525
+ yourself
526
+ !
527
+
528
+ pencil
529
+ ^ self new
530
+ icon: 'pencil';
531
+ yourself
532
+ !
533
+
534
+ play
535
+ ^ self new
536
+ icon: 'play';
537
+ yourself
538
+ !
539
+
540
+ playCircle
541
+ ^ self new
542
+ icon: 'play-circle';
543
+ yourself
544
+ !
545
+
546
+ remove
547
+ ^ self new
548
+ icon: 'remove';
549
+ yourself
550
+ !
551
+
552
+ resizeSmall
553
+ ^ self new
554
+ icon: 'resize-small';
555
+ yourself
556
+ !
557
+
558
+ search
559
+ ^ self new
560
+ icon: 'search';
561
+ yourself
562
+ !
563
+
564
+ star
565
+ ^ self new
566
+ icon: 'star';
567
+ yourself
568
+ !
569
+
570
+ stop
571
+ ^ self new
572
+ icon: 'stop';
573
+ yourself
574
+ !
575
+
576
+ terminal
577
+ ^ self new
578
+ icon: 'terminal';
579
+ yourself
580
+ !
581
+
582
+ trash
583
+ ^ self new
584
+ icon: 'trash';
585
+ yourself
586
+ !
587
+
588
+ wait
589
+ ^ self new
590
+ icon: 'refresh';
591
+ spin: true;
592
+ caption: 'Loading...';
593
+ yourself
594
+ ! !
595
+
596
+ Widget subclass: #MaglevIconImage
597
+ instanceVariableNames: 'src cssClass image hidden'
598
+ package: 'Maglev-Database-Explorer'!
599
+
600
+ !MaglevIconImage methodsFor: 'accessing'!
601
+
602
+ cssClass: aString
603
+ cssClass := aString.
604
+ !
605
+
606
+ hidden
607
+ hidden ifNil: [hidden := false].
608
+ ^ hidden
609
+ !
610
+
611
+ src: aString
612
+ src := aString.
613
+ ! !
614
+
615
+ !MaglevIconImage methodsFor: 'interactions'!
616
+
617
+ hide
618
+ hidden := true.
619
+ image ifNotNil: [image hide].
620
+ !
621
+
622
+ show
623
+ hidden := false.
624
+ image ifNotNil: [image show].
625
+ ! !
626
+
627
+ !MaglevIconImage methodsFor: 'rendering'!
628
+
629
+ renderOn: html
630
+ image := html img
631
+ src: src;
632
+ class: cssClass.
633
+ self hidden ifTrue: [image hide].
634
+ ! !
635
+
636
+ !MaglevIconImage class methodsFor: 'instance creation'!
637
+
638
+ rails
639
+ ^ self new
640
+ src: 'images/rails_tiny.png';
641
+ yourself
642
+ !
643
+
644
+ ruby
645
+ ^ self new
646
+ src: 'images/ruby.png';
647
+ cssClass: 'icon-language';
648
+ yourself
649
+ !
650
+
651
+ rubySmalltalkBridge
652
+ ^ self new
653
+ src: 'images/ruby_smalltalk_bridge.png';
654
+ cssClass: 'icon-language';
655
+ yourself
656
+ !
657
+
658
+ smalltalk
659
+ ^ self new
660
+ src: 'images/smalltalk.png';
661
+ cssClass: 'icon-language';
662
+ yourself
663
+ ! !
664
+
665
+ Widget subclass: #MaglevListBox
666
+ instanceVariableNames: 'list changedCallback htmlIv divContainer height searchbox searchInput olContainer olHeightBeforeSearch'
667
+ package: 'Maglev-Database-Explorer'!
668
+
669
+ !MaglevListBox methodsFor: 'accessing'!
670
+
671
+ changedCallback: aBlock
672
+ changedCallback := aBlock.
673
+ !
674
+
675
+ height
676
+ ^ olContainer asJQuery height
677
+ !
678
+
679
+ height: anInteger
680
+ |searchboxHeight|
681
+ (searchbox asJQuery is: ':visible')
682
+ ifTrue: [searchboxHeight := searchbox asJQuery height + 2]
683
+ ifFalse: [searchboxHeight := 0].
684
+ height := anInteger.
685
+ olContainer asJQuery css: 'height' data: (anInteger - searchboxHeight) asString, 'px'.
686
+ !
687
+
688
+ selectedData
689
+ ^ (list asJQuery find: '.ui-selected') data: 'data'
690
+ !
691
+
692
+ selectedDataIndex
693
+ ^ (list asJQuery find: '.ui-selected') index + 1
694
+ !
695
+
696
+ selectedDataVisibleIndex
697
+ ^ ((list asJQuery find: 'li:visible') index: (list asJQuery find: 'li.ui-selected')) + 1
698
+ !
699
+
700
+ size
701
+ ^ (list asJQuery find: 'li') length
702
+ !
703
+
704
+ sizeVisible
705
+ ^ (list asJQuery find: 'li:visible') length
706
+ !
707
+
708
+ style: aString
709
+ divContainer style: aString.
710
+ ! !
711
+
712
+ !MaglevListBox methodsFor: 'interactions'!
713
+
714
+ bindEvents
715
+ < self['@list']._asJQuery().selectable({
716
+ stop: function() {self._selectionChanged();},
717
+ tolerance: 'fit'}); >
718
+ !
719
+
720
+ clear
721
+ list asJQuery empty.
722
+ !
723
+
724
+ commandFind
725
+ olHeightBeforeSearch := self height.
726
+ searchbox show.
727
+ self height: self height.
728
+ searchInput asJQuery focus.
729
+ !
730
+
731
+ filterResults
732
+ |text|
733
+ text := searchInput asJQuery val.
734
+ (list asJQuery find: 'li') each: [:idx :htmlEl | |el|
735
+ < el = $(htmlEl); >.
736
+ (el text includesSubString: text)
737
+ ifTrue: [el show]
738
+ ifFalse: [el hide]].
739
+ self hideSearchBox.
740
+ !
741
+
742
+ focus
743
+ list asJQuery focus.
744
+ !
745
+
746
+ hide
747
+ list hide.
748
+ !
749
+
750
+ hideSearchBox
751
+ searchbox hide.
752
+ self height: olHeightBeforeSearch.
753
+ list asJQuery focus.
754
+ !
755
+
756
+ moveSelectionDown
757
+ |newIndex|
758
+ newIndex := self selectedDataVisibleIndex + 1 - 1.
759
+ newIndex = self sizeVisible ifTrue: [newIndex := 0].
760
+ self unselectAll.
761
+ (list asJQuery find: 'li:visible:eq(', newIndex asString, ')') addClass: 'ui-selected'.
762
+ self selectionChanged.
763
+ !
764
+
765
+ moveSelectionUp
766
+ |newIndex|
767
+ newIndex := self selectedDataVisibleIndex - 1 - 1.
768
+ newIndex < 0 ifTrue: [newIndex := self sizeVisible - 1].
769
+ self unselectAll.
770
+ (list asJQuery find: 'li:visible:eq(', newIndex asString, ')') addClass: 'ui-selected'.
771
+ self selectionChanged.
772
+ !
773
+
774
+ selectionChanged
775
+ self focus.
776
+ changedCallback value: self selectedData value: self selectedDataIndex.
777
+ !
778
+
779
+ show
780
+ list show.
781
+ !
782
+
783
+ unselectAll
784
+ (list asJQuery find: 'li') removeClass: 'ui-selected'.
785
+ ! !
786
+
787
+ !MaglevListBox methodsFor: 'rendering'!
788
+
789
+ makeResizable
790
+ < self['@olContainer']._asJQuery().resizable({handles: 's'}); >
791
+ !
792
+
793
+ renderOn: html
794
+ divContainer := html div with: [
795
+ self renderSearchBoxOn: html.
796
+ olContainer := html div
797
+ style: 'overflow: hidden; border: 1px solid #aaaaaa';
798
+ with: [
799
+ list := html ol
800
+ style: 'width: 100%; height: 100%; overflow: auto; border: none; outline: none;';
801
+ at: 'tabindex' put: '1';
802
+ onKeyDown: [:e |
803
+ e preventDefault.
804
+ e keyCode = 40 ifTrue: [self moveSelectionDown].
805
+ e keyCode = 38 ifTrue: [self moveSelectionUp].
806
+ (e keyCode = 70 and: [e ctrlKey]) ifTrue: [self commandFind]];
807
+ onClick: [self focus]].
808
+ self makeResizable.
809
+ htmlIv := html].
810
+ self bindEvents.
811
+ !
812
+
813
+ renderSearchBoxOn: html
814
+ searchbox := html div
815
+ class: 'input-prepend';
816
+ style: 'margin-bottom: 2px; box-sizing: border-box; -webkit-box-sizing: border-box; padding-right: 52px; width: 100%;';
817
+ with: [
818
+ html span
819
+ class: 'add-on';
820
+ with: 'find'.
821
+ searchInput := html input
822
+ type: 'text';
823
+ class: 'span2';
824
+ style: 'width: 100%;';
825
+ onChange: [self filterResults];
826
+ onFocusOut: [self hideSearchBox]];
827
+ hide.
828
+ !
829
+
830
+ with: content
831
+ self with: content data: '' darker: false.
832
+ !
833
+
834
+ with: content darker: aBoolean
835
+ self with: content data: '' darker: aBoolean.
836
+ !
837
+
838
+ with: content data: dataString
839
+ "|html|
840
+ html := HTMLCanvas onJQuery: list asJQuery."
841
+ list with: [
842
+ htmlIv li
843
+ class: 'ui-widget-content';
844
+ data: 'data' with: dataString;
845
+ with: [content value: htmlIv]].
846
+ !
847
+
848
+ with: content data: dataString darker: aBoolean
849
+ list with: [ |li|
850
+ li := htmlIv li
851
+ class: 'ui-widget-content';
852
+ data: 'data' with: dataString;
853
+ with: [content value: htmlIv].
854
+ aBoolean ifTrue: [li asJQuery addClass: 'list-darker']].
855
+ ! !
856
+
857
+ Widget subclass: #MaglevObjectDropdown
858
+ instanceVariableNames: 'container resultContainer editor editorElement rubyButton smalltalkButton object'
859
+ package: 'Maglev-Database-Explorer'!
860
+
861
+ !MaglevObjectDropdown methodsFor: 'accessing'!
862
+
863
+ code
864
+ ^ editor getValue
865
+ !
866
+
867
+ language
868
+ self isRuby
869
+ ifTrue: [^ 'ruby']
870
+ ifFalse: [^ 'smalltalk']
871
+ ! !
872
+
873
+ !MaglevObjectDropdown methodsFor: 'initializing'!
874
+
875
+ initializeEditor
876
+ |params|
877
+ params := Object new
878
+ basicAt: 'mode' put: 'text/x-ruby';
879
+ basicAt: 'styleActiveLine' put: true;
880
+ basicAt: 'lineNumbers' put: true;
881
+ basicAt: 'matchBrackets' put: true;
882
+ yourself.
883
+ editor := CodeMirror value: (editorElement asJQuery at: 0) value: params.
884
+ editor setValue: ''.
885
+ !
886
+
887
+ mouseFix
888
+ < var menu = self['@container'];
889
+ var editor = self['@editorElement'];
890
+ menu._asJQuery().mousedown(function (event) {
891
+ event.preventDefault();
892
+ return false;
893
+ });
894
+ editor._asJQuery().mousedown(function (event) {
895
+ event.preventDefault();
896
+ return false;
897
+ }); >
898
+ ! !
899
+
900
+ !MaglevObjectDropdown methodsFor: 'interactions'!
901
+
902
+ appendToInlineObject: anObject for: dropdownContainer
903
+ object := anObject object.
904
+ container asJQuery appendTo: dropdownContainer asJQuery.
905
+ !
906
+
907
+ evalDoIt
908
+ !
909
+
910
+ evalInspectIt
911
+ !
912
+
913
+ evalPrintIt
914
+ self executeWithCallback: [:success :resultObj |
915
+ success
916
+ ifTrue: [resultContainer with: resultObj inlineViewComponent]
917
+ ifFalse: [resultContainer with: resultObj inlineViewComponent]].
918
+ !
919
+
920
+ executeWithCallback: aBlock
921
+ resultContainer
922
+ addClass: 'alert-info';
923
+ removeClass: 'alert-success';
924
+ removeClass: 'alert-error'.
925
+ resultContainer asJQuery empty.
926
+ resultContainer
927
+ with: MaglevIcon wait;
928
+ with: ' loading...';
929
+ show.
930
+ object
931
+ evaluate: self code
932
+ language: self language
933
+ withCallback: [:success :resultObj |
934
+ resultContainer asJQuery empty.
935
+ resultContainer removeClass: 'alert-info'.
936
+ success
937
+ ifTrue: [resultContainer addClass: 'alert-success']
938
+ ifFalse: [resultContainer addClass: 'alert-error'].
939
+ aBlock value: success value: resultObj]
940
+ !
941
+
942
+ languageChanged
943
+ self isRuby
944
+ ifFalse: [editor setOption: 'mode' data: 'text/x-ruby']
945
+ ifTrue: [editor setOption: 'mode' data: 'text/x-stsrc'].
946
+ ! !
947
+
948
+ !MaglevObjectDropdown methodsFor: 'rendering'!
949
+
950
+ renderButtonsOn: html
951
+ html button
952
+ class: 'btn btn-primary';
953
+ type: 'button';
954
+ with: 'Do it';
955
+ onClick: [self evalDoIt].
956
+ html button
957
+ class: 'btn btn-primary';
958
+ type: 'button';
959
+ with: 'Print it';
960
+ onClick: [self evalPrintIt].
961
+ html button
962
+ class: 'btn btn-primary';
963
+ type: 'button';
964
+ with: 'Inspect it';
965
+ onClick: [self evalInspectIt].
966
+ html div
967
+ class: 'btn-group';
968
+ style: 'float: right;';
969
+ data: 'toggle' with: 'buttons-radio';
970
+ with: [
971
+ rubyButton := html button
972
+ class: 'btn active';
973
+ data: 'toggle' with: 'buttons-checkbox';
974
+ onClick: [self languageChanged];
975
+ type: 'button';
976
+ with: 'Ruby'.
977
+ smalltalkButton := html button
978
+ class: 'btn';
979
+ data: 'toggle' with: 'buttons-checkbox';
980
+ onClick: [self languageChanged];
981
+ type: 'button';
982
+ with: 'Smalltalk'].
983
+ !
984
+
985
+ renderFormOn: html
986
+ html form
987
+ style: 'margin: 0px;';
988
+ with: [
989
+ editorElement := html div
990
+ class: 'pull-left code-area'.
991
+ html div style: 'clear: both;'.
992
+ resultContainer := html div
993
+ class: 'alert';
994
+ hide.
995
+ html div
996
+ class: 'button-area';
997
+ with: [self renderButtonsOn: html]].
998
+ !
999
+
1000
+ renderOn: html
1001
+ container := html div
1002
+ class: 'dropdown-menu';
1003
+ with: [html fieldset
1004
+ class: 'textbox';
1005
+ style: 'padding: 10px';
1006
+ with: [self renderFormOn: html]].
1007
+ self initializeEditor.
1008
+ self mouseFix.
1009
+ ! !
1010
+
1011
+ !MaglevObjectDropdown methodsFor: 'testing'!
1012
+
1013
+ isRuby
1014
+ ^ rubyButton asJQuery hasClass: 'active'
1015
+ !
1016
+
1017
+ isSmalltalk
1018
+ ^ smalltalkButton asJQuery hasClass: 'active'
1019
+ ! !
1020
+
1021
+ MaglevObjectDropdown class instanceVariableNames: 'instance'!
1022
+
1023
+ !MaglevObjectDropdown class methodsFor: 'singleton'!
1024
+
1025
+ instance
1026
+ instance ifNil: [
1027
+ instance := self new.
1028
+ instance appendToJQuery: '#temporary-rendering-area' asJQuery].
1029
+ ^ instance
1030
+ ! !
1031
+
1032
+ Widget subclass: #MaglevObjectInline
1033
+ instanceVariableNames: 'object hasDropDown isDraggable depth isShort dragContent dragDummy dragObject fullInspection'
1034
+ package: 'Maglev-Database-Explorer'!
1035
+
1036
+ !MaglevObjectInline methodsFor: 'accessing'!
1037
+
1038
+ depth
1039
+ depth ifNil: [depth := 1].
1040
+ ^ depth
1041
+ !
1042
+
1043
+ depth: anInteger
1044
+ depth := anInteger.
1045
+ !
1046
+
1047
+ fullInspection
1048
+ fullInspection ifNil: [fullInspection := false].
1049
+ ^ fullInspection
1050
+ !
1051
+
1052
+ fullInspection: aBoolean
1053
+ fullInspection := aBoolean.
1054
+ !
1055
+
1056
+ hasDropDown
1057
+ hasDropDown ifNil: [hasDropDown := self hasDropDownDefault].
1058
+ ^ hasDropDown
1059
+ !
1060
+
1061
+ hasDropDown: aBoolean
1062
+ hasDropDown := aBoolean.
1063
+ !
1064
+
1065
+ isDraggable
1066
+ isDraggable ifNil: [isDraggable := self isDraggableDefault].
1067
+ ^ isDraggable
1068
+ !
1069
+
1070
+ isDraggable: aBoolean
1071
+ isDraggable := aBoolean.
1072
+ !
1073
+
1074
+ isShort
1075
+ isShort ifNil: [isShort := false].
1076
+ ^ isShort
1077
+ !
1078
+
1079
+ isShort: aBoolean
1080
+ isShort := aBoolean.
1081
+ !
1082
+
1083
+ object
1084
+ ^ object
1085
+ !
1086
+
1087
+ object: anObject
1088
+ object := anObject.
1089
+ ! !
1090
+
1091
+ !MaglevObjectInline methodsFor: 'constants'!
1092
+
1093
+ hasDropDownDefault
1094
+ ^ true
1095
+ !
1096
+
1097
+ isDraggableDefault
1098
+ ^ true
1099
+ !
1100
+
1101
+ maxDepth
1102
+ ^ 1
1103
+ !
1104
+
1105
+ maxInspection
1106
+ self fullInspection
1107
+ ifTrue: [^ 1000]
1108
+ ifFalse: [^ 15].
1109
+ ! !
1110
+
1111
+ !MaglevObjectInline methodsFor: 'interactions'!
1112
+
1113
+ bindDraggable
1114
+ |options cursorPos|
1115
+ cursorPos := Object new
1116
+ basicAt: 'left' put: 0;
1117
+ basicAt: 'top' put: 0;
1118
+ yourself.
1119
+ options := Object new
1120
+ basicAt: 'create' put: [:event :ui | ];
1121
+ basicAt: 'cursorPos' put: cursorPos;
1122
+ basicAt: 'start' put: [:event :ui | self dragStart: event a: ui];
1123
+ basicAt: 'stop' put: [:event :ui | self dragStop: event a: ui];
1124
+ yourself.
1125
+ dragObject asJQuery draggable: options.
1126
+ !
1127
+
1128
+ dragStart: event a: ui
1129
+ dragContent hide.
1130
+ dragDummy show.
1131
+ !
1132
+
1133
+ dragStop: event a: ui
1134
+ |position window|
1135
+ position := dragObject asJQuery offset.
1136
+ window := Maglev instance showReloadObjectWindow: object oop.
1137
+ window left: position left - (dragObject width / 2).
1138
+ window top: position top - (dragObject height / 2).
1139
+ dragObject left: 0.
1140
+ dragObject top: 0.
1141
+ dragDummy hide.
1142
+ dragContent show.
1143
+ !
1144
+
1145
+ showDropdownFor: dropdownContainer
1146
+ MaglevObjectDropdown instance appendToInlineObject: self for: dropdownContainer.
1147
+ ! !
1148
+
1149
+ !MaglevObjectInline methodsFor: 'rendering'!
1150
+
1151
+ renderDraggableObjectOn: html
1152
+ html div
1153
+ class: 'draggable-new-object-container';
1154
+ with: [
1155
+ dragObject := html div
1156
+ class: 'ui-widget-content ui-draggable draggable-new-object';
1157
+ with: [
1158
+ dragDummy := html div
1159
+ class: 'object-drag-dummy';
1160
+ style: 'display: none;';
1161
+ with: MaglevIcon move;
1162
+ with: [self renderObjectContainerOn: html].
1163
+ dragContent := html div
1164
+ class: 'object-iv-name';
1165
+ with: [self renderObjectContainerOn: html]]].
1166
+ self bindDraggable.
1167
+ !
1168
+
1169
+ renderLoadedObjectOn: html
1170
+ |text shorted|
1171
+ shorted := false.
1172
+ text := object inspection copyFrom: 1 to: self maxInspection.
1173
+ text size < object inspection size ifTrue: [
1174
+ text := text, '...'.
1175
+ shorted := true.
1176
+ (text at: 2) = '<' ifTrue: [text := text, '>']].
1177
+ html with: [|tooltip|
1178
+ tooltip := html span
1179
+ data: 'toggle' with: 'tooltip';
1180
+ data: 'placement' with: 'top';
1181
+ data: 'original-title' with: object inspection;
1182
+ with: text.
1183
+ shorted ifTrue: [tooltip asJQuery tooltip]].
1184
+ !
1185
+
1186
+ renderObjectActionsOn: html
1187
+ " html
1188
+ with: MaglevIcon search;
1189
+ with: MaglevIcon pencil."
1190
+ !
1191
+
1192
+ renderObjectContainerOn: html
1193
+ html span
1194
+ class: 'object-inline-view-view';
1195
+ with: [
1196
+ self renderObjectActionsOn: html.
1197
+ html span
1198
+ class: 'object-inline-typed-view';
1199
+ with: [
1200
+ self hasDropDown
1201
+ ifTrue: [self renderObjectWithDropDownOn: html]
1202
+ ifFalse: [self renderObjectOn: html]]].
1203
+ !
1204
+
1205
+ renderObjectOn: html
1206
+ object isLoaded
1207
+ ifTrue: [self renderLoadedObjectOn: html]
1208
+ ifFalse: [self renderUnloadedObjectOn: html].
1209
+ !
1210
+
1211
+ renderObjectWithDropDownOn: html
1212
+ |dropdownContainer|
1213
+ dropdownContainer := html span
1214
+ class: 'dropdown';
1215
+ with: [
1216
+ html a
1217
+ class: 'dropdown-toggle btn object-dropdown-toggle';
1218
+ data: 'toggle' with: 'dropdown';
1219
+ onClick: [self showDropdownFor: dropdownContainer];
1220
+ with: [
1221
+ self renderObjectOn: html.
1222
+ html b class: 'caret']].
1223
+ !
1224
+
1225
+ renderOn: html
1226
+ self isDraggable
1227
+ ifTrue: [self renderDraggableObjectOn: html]
1228
+ ifFalse: [self renderObjectContainerOn: html].
1229
+ !
1230
+
1231
+ renderText: text withDropDownOn: html
1232
+ |dropdownContainer|
1233
+ self hasDropDown
1234
+ ifTrue: [
1235
+ dropdownContainer := html span
1236
+ class: 'dropdown';
1237
+ with: [
1238
+ html a
1239
+ class: 'dropdown-toggle btn object-dropdown-toggle';
1240
+ data: 'toggle' with: 'dropdown';
1241
+ onClick: [self showDropdownFor: dropdownContainer];
1242
+ with: [
1243
+ html with: text.
1244
+ html b class: 'caret']]]
1245
+ ifFalse: [html with: text].
1246
+ !
1247
+
1248
+ renderUnloadedObjectOn: html
1249
+ |text shorted|
1250
+ shorted := false.
1251
+ text := object inspection copyFrom: 1 to: self maxInspection.
1252
+ text size < object inspection size ifTrue: [
1253
+ text := text, '...'.
1254
+ shorted := true.
1255
+ (text at: 2) = '<' ifTrue: [text := text, '>']].
1256
+ html with: [|tooltip|
1257
+ tooltip := html span
1258
+ data: 'toggle' with: 'tooltip';
1259
+ data: 'placement' with: 'top';
1260
+ data: 'original-title' with: object inspection;
1261
+ with: text.
1262
+ shorted ifTrue: [tooltip asJQuery tooltip]].
1263
+ ! !
1264
+
1265
+ !MaglevObjectInline class methodsFor: 'instance creation'!
1266
+
1267
+ newWithDepth: anInteger
1268
+ ^ self basicNew
1269
+ depth: anInteger;
1270
+ initialize;
1271
+ yourself
1272
+ ! !
1273
+
1274
+ MaglevObjectInline subclass: #MaglevArrayInline
1275
+ instanceVariableNames: ''
1276
+ package: 'Maglev-Database-Explorer'!
1277
+
1278
+ !MaglevArrayInline methodsFor: 'constants'!
1279
+
1280
+ maxDepth
1281
+ ^ 2
1282
+ !
1283
+
1284
+ maxElements
1285
+ ^ 3
1286
+ ! !
1287
+
1288
+ !MaglevArrayInline methodsFor: 'rendering'!
1289
+
1290
+ renderLoadedObjectOn: html
1291
+ |showElements maxElements|
1292
+ maxElements := self maxElements.
1293
+ showElements := maxElements min: self object elementsSize.
1294
+ self renderText: '[' withDropDownOn: html.
1295
+ html with: ' '.
1296
+ self isShort
1297
+ ifTrue: [html with: ' ... ']
1298
+ ifFalse: [
1299
+ (1 to: showElements) do: [:idx |
1300
+ html with: ((self object at: idx) inlineViewComponentWithDepth: self depth - 1).
1301
+ (idx < showElements or: [self object elementsSize > maxElements])
1302
+ ifTrue: [html with: ' , ']].
1303
+ self object elementsSize > maxElements
1304
+ ifTrue: [html with: ' ... '] ].
1305
+ html with: ' '.
1306
+ self renderText: ']' withDropDownOn: html.
1307
+ !
1308
+
1309
+ renderObjectWithDropDownOn: html
1310
+ "Do not render a drop down menu around the whole object."
1311
+ self renderObjectOn: html.
1312
+ !
1313
+
1314
+ renderUnloadedObjectOn: html
1315
+ self renderText: '[' withDropDownOn: html.
1316
+ html with: '...'.
1317
+ self renderText: ']' withDropDownOn: html.
1318
+ ! !
1319
+
1320
+ MaglevObjectInline subclass: #MaglevBooleanInline
1321
+ instanceVariableNames: ''
1322
+ package: 'Maglev-Database-Explorer'!
1323
+
1324
+ !MaglevBooleanInline methodsFor: 'constants'!
1325
+
1326
+ hasDropDownDefault
1327
+ ^ false
1328
+ !
1329
+
1330
+ isDraggableDefault
1331
+ ^ false
1332
+ ! !
1333
+
1334
+ MaglevObjectInline subclass: #MaglevExceptionInline
1335
+ instanceVariableNames: ''
1336
+ package: 'Maglev-Database-Explorer'!
1337
+
1338
+ !MaglevExceptionInline methodsFor: 'rendering'!
1339
+
1340
+ renderObjectActionsOn: html
1341
+ object isTrappable
1342
+ ifFalse: [html with: (MaglevIcon terminal
1343
+ caption: 'Not trappable')].
1344
+ object isResumable
1345
+ ifTrue: [html with: (MaglevIcon playCircle
1346
+ caption: 'Resumable')].
1347
+ object isDBEHalt
1348
+ ifTrue: [html with: (MaglevIcon flag
1349
+ caption: 'Database Explorer Halt')].
1350
+ ! !
1351
+
1352
+ MaglevObjectInline subclass: #MaglevFixnumInline
1353
+ instanceVariableNames: ''
1354
+ package: 'Maglev-Database-Explorer'!
1355
+
1356
+ !MaglevFixnumInline methodsFor: 'constants'!
1357
+
1358
+ hasDropDownDefault
1359
+ ^ false
1360
+ !
1361
+
1362
+ isDraggableDefault
1363
+ ^ false
1364
+ ! !
1365
+
1366
+ !MaglevFixnumInline methodsFor: 'rendering'!
1367
+
1368
+ renderObjectActionsOn: html
1369
+ ! !
1370
+
1371
+ MaglevObjectInline subclass: #MaglevFloatInline
1372
+ instanceVariableNames: ''
1373
+ package: 'Maglev-Database-Explorer'!
1374
+
1375
+ !MaglevFloatInline methodsFor: 'constants'!
1376
+
1377
+ hasDropDownDefault
1378
+ ^ false
1379
+ !
1380
+
1381
+ isDraggableDefault
1382
+ ^ false
1383
+ ! !
1384
+
1385
+ !MaglevFloatInline methodsFor: 'rendering'!
1386
+
1387
+ renderObjectActionsOn: html
1388
+ ! !
1389
+
1390
+ MaglevObjectInline subclass: #MaglevHashInline
1391
+ instanceVariableNames: ''
1392
+ package: 'Maglev-Database-Explorer'!
1393
+
1394
+ !MaglevHashInline methodsFor: 'constants'!
1395
+
1396
+ maxDepth
1397
+ ^ 2
1398
+ !
1399
+
1400
+ maxElements
1401
+ ^ 3
1402
+ ! !
1403
+
1404
+ !MaglevHashInline methodsFor: 'rendering'!
1405
+
1406
+ renderLoadedObjectOn: html
1407
+ |showElements maxElements|
1408
+ maxElements := self maxElements.
1409
+ showElements := maxElements min: self object elementsSize.
1410
+ self renderText: '{' withDropDownOn: html.
1411
+ html with: ' '.
1412
+ self isShort
1413
+ ifTrue: [html with: ' ... ']
1414
+ ifFalse: [
1415
+ (1 to: showElements) do: [:idx | |key value|
1416
+ key := (self object at: idx) key.
1417
+ value := (self object at: idx) value.
1418
+ html
1419
+ with: (key inlineViewComponentWithDepth: self depth + 1);
1420
+ with: '=>';
1421
+ with: (value inlineViewComponentWithDepth: self depth + 1).
1422
+ (idx < showElements or: [self object elementsSize > maxElements])
1423
+ ifTrue: [html with: ' , ']].
1424
+ self object elementsSize > maxElements
1425
+ ifTrue: [html with: ' ... ']].
1426
+ html with: ' '.
1427
+ self renderText: '}' withDropDownOn: html.
1428
+ !
1429
+
1430
+ renderObjectWithDropDownOn: html
1431
+ "Do not render a drop down menu around the whole object."
1432
+ self renderObjectOn: html.
1433
+ !
1434
+
1435
+ renderUnloadedObjectOn: html
1436
+ self renderText: '{' withDropDownOn: html.
1437
+ html with: '...'.
1438
+ self renderText: '}' withDropDownOn: html.
1439
+ ! !
1440
+
1441
+ MaglevObjectInline subclass: #MaglevMaglevRecordBaseInline
1442
+ instanceVariableNames: ''
1443
+ package: 'Maglev-Database-Explorer'!
1444
+
1445
+ !MaglevMaglevRecordBaseInline methodsFor: 'rendering'!
1446
+
1447
+ renderObjectActionsOn: html
1448
+ html with: (MaglevIcon hdd caption: 'MaglevRecord::Base')
1449
+ ! !
1450
+
1451
+ MaglevObjectInline subclass: #MaglevModuleInline
1452
+ instanceVariableNames: ''
1453
+ package: 'Maglev-Database-Explorer'!
1454
+
1455
+ !MaglevModuleInline methodsFor: 'constants'!
1456
+
1457
+ maxDepth
1458
+ ^ 1
1459
+ ! !
1460
+
1461
+ MaglevModuleInline subclass: #MaglevClassInline
1462
+ instanceVariableNames: ''
1463
+ package: 'Maglev-Database-Explorer'!
1464
+
1465
+ !MaglevClassInline methodsFor: 'constants'!
1466
+
1467
+ maxDepth
1468
+ ^ 1
1469
+ !
1470
+
1471
+ renderObjectActionsOn: html
1472
+ html with: (MaglevIcon listAlt
1473
+ caption: 'List class instances').
1474
+ ! !
1475
+
1476
+ MaglevObjectInline subclass: #MaglevNilClassInline
1477
+ instanceVariableNames: ''
1478
+ package: 'Maglev-Database-Explorer'!
1479
+
1480
+ !MaglevNilClassInline methodsFor: 'constants'!
1481
+
1482
+ hasDropDownDefault
1483
+ ^ false
1484
+ !
1485
+
1486
+ isDraggableDefault
1487
+ ^ false
1488
+ ! !
1489
+
1490
+ MaglevObjectInline subclass: #MaglevRubyWorkspaceInline
1491
+ instanceVariableNames: ''
1492
+ package: 'Maglev-Database-Explorer'!
1493
+
1494
+ !MaglevRubyWorkspaceInline methodsFor: 'rendering'!
1495
+
1496
+ renderObjectActionsOn: html
1497
+ html with: (MaglevIcon terminal caption: 'Workspace').
1498
+ ! !
1499
+
1500
+ MaglevObjectInline subclass: #MaglevStringInline
1501
+ instanceVariableNames: ''
1502
+ package: 'Maglev-Database-Explorer'!
1503
+
1504
+ !MaglevStringInline methodsFor: 'constants'!
1505
+
1506
+ hasDropDownDefault
1507
+ ^ false
1508
+ !
1509
+
1510
+ isDraggableDefault
1511
+ ^ false
1512
+ ! !
1513
+
1514
+ MaglevObjectInline subclass: #MaglevSymbolInline
1515
+ instanceVariableNames: ''
1516
+ package: 'Maglev-Database-Explorer'!
1517
+
1518
+ !MaglevSymbolInline methodsFor: 'constants'!
1519
+
1520
+ hasDropDownDefault
1521
+ ^ false
1522
+ !
1523
+
1524
+ isDraggableDefault
1525
+ ^ false
1526
+ ! !
1527
+
1528
+ MaglevObjectInline subclass: #MaglevThreadInline
1529
+ instanceVariableNames: ''
1530
+ package: 'Maglev-Database-Explorer'!
1531
+
1532
+ !MaglevThreadInline methodsFor: 'constants'!
1533
+
1534
+ maxInspection
1535
+ ^ 25
1536
+ !
1537
+
1538
+ renderObjectActionsOn: html
1539
+ object isRailsThread
1540
+ ifTrue: [html with: MaglevIconImage rails].
1541
+ object status = 'sleep'
1542
+ ifTrue: [html with: (MaglevIcon pause
1543
+ caption: 'Thread status: sleeping')].
1544
+ object status = 'false'
1545
+ ifTrue: [html with: (MaglevIcon stop
1546
+ caption: 'Thread status: stopped (false)')].
1547
+ object status = 'run'
1548
+ ifTrue: [html with: (MaglevIcon play
1549
+ caption: 'Thread status: running')].
1550
+ object status = 'aborting'
1551
+ ifTrue: [html with: (MaglevIcon trash
1552
+ caption: 'Thread status: aborting')].
1553
+ ! !
1554
+
1555
+ Widget subclass: #MaglevObjectInstancesView
1556
+ instanceVariableNames: 'object rangeFrom rangeTo instancesWaitBox contentBox'
1557
+ package: 'Maglev-Database-Explorer'!
1558
+
1559
+ !MaglevObjectInstancesView methodsFor: 'accessing'!
1560
+
1561
+ currentInstVarNames
1562
+ |ivNames|
1563
+ ivNames := Set new.
1564
+ (self rangeFrom to: self rangeTo) do: [:idx | |obj|
1565
+ obj := self objectAt: idx.
1566
+ obj instVarsDo: [:key :value | ivNames add: key string]].
1567
+ ^ ivNames
1568
+ !
1569
+
1570
+ object
1571
+ ^ object
1572
+ !
1573
+
1574
+ object: anObject
1575
+ object := anObject.
1576
+ !
1577
+
1578
+ objectAt: anIndex
1579
+ ^ object instances at: anIndex
1580
+ !
1581
+
1582
+ rangeFrom
1583
+ rangeFrom ifNil: [rangeFrom := 1].
1584
+ ^ rangeFrom
1585
+ !
1586
+
1587
+ rangeFrom: anInteger
1588
+ rangeFrom := anInteger.
1589
+ !
1590
+
1591
+ rangeTo
1592
+ rangeTo ifNil: [rangeTo := 10].
1593
+ object instancesSize ifNotNil: [rangeTo := rangeTo min: object instancesSize].
1594
+ ^ rangeTo
1595
+ !
1596
+
1597
+ rangeTo: anInteger
1598
+ rangeTo := anInteger.
1599
+ object instancesSize ifNotNil: [rangeTo := rangeTo min: object instancesSize].
1600
+ ! !
1601
+
1602
+ !MaglevObjectInstancesView methodsFor: 'interactions'!
1603
+
1604
+ currentPage
1605
+ ^ (self rangeFrom / 10) ceiled
1606
+ !
1607
+
1608
+ pages
1609
+ ^ (object instancesSize / 10) ceiled
1610
+ ! !
1611
+
1612
+ !MaglevObjectInstancesView methodsFor: 'rendering'!
1613
+
1614
+ renderInstVarTable
1615
+ |html|
1616
+ html := HTMLCanvas onJQuery: contentBox asJQuery.
1617
+ contentBox asJQuery empty.
1618
+ instancesWaitBox show.
1619
+ object
1620
+ loadInstancesFrom: self rangeFrom
1621
+ to: self rangeTo
1622
+ withCallback: [:obj | |ivNames|
1623
+ instancesWaitBox hide.
1624
+ object := obj.
1625
+ ivNames := self currentInstVarNames.
1626
+ html table
1627
+ class: 'table table-bordered';
1628
+ style: 'margin-bottom: 0px;';
1629
+ with: [html thead with: [
1630
+ html tr with: [
1631
+ html th with: 'oop'.
1632
+ html th with: 'Object'.
1633
+ ivNames do: [:ivName |
1634
+ html th with: ivName]]].
1635
+ html tbody with: [
1636
+ object instances do: [:obj |
1637
+ html tr with: [
1638
+ html td with: obj oop.
1639
+ html td with: obj inlineViewComponent.
1640
+ ivNames do: [:ivName |
1641
+ html td with: (obj instVarAt: ivName ifAbsent: MaglevInvalidObject instance) inlineViewComponent]]]]].
1642
+ self renderPaginationOn: html.
1643
+ instancesWaitBox hide].
1644
+ !
1645
+
1646
+ renderOn: html
1647
+ instancesWaitBox := html div
1648
+ with: [html
1649
+ with: MaglevIcon wait;
1650
+ with: ' loading...'].
1651
+ contentBox := html div.
1652
+ self renderInstVarTable.
1653
+ !
1654
+
1655
+ renderPaginationOn: html
1656
+ |firstPage lastPage currentPage|
1657
+ currentPage := self currentPage.
1658
+ firstPage := currentPage - 5 max: 1.
1659
+ lastPage := firstPage + 10 min: self pages.
1660
+ html
1661
+ div
1662
+ style: 'text-align: center;';
1663
+ with: [html span
1664
+ class: 'pagination';
1665
+ with: [html ul
1666
+ style: 'margin-top: 10px;';
1667
+ with: [(firstPage to: lastPage) do: [:index | |liClass|
1668
+ currentPage = index
1669
+ ifTrue: [liClass := 'disabled']
1670
+ ifFalse: [liClass := 'active'].
1671
+ html li
1672
+ class: liClass;
1673
+ with: [html a
1674
+ onClick: [
1675
+ self rangeFrom: (index - 1) * 10 + 1.
1676
+ self rangeTo: index * 10.
1677
+ self renderInstVarTable];
1678
+ with: index asString]]]]].
1679
+ ! !
1680
+
1681
+ Widget subclass: #MaglevTable
1682
+ instanceVariableNames: 'object collectionName rangeFrom rangeTo isAssociationDictionary tableBody currentPage pageListItems pagination'
1683
+ package: 'Maglev-Database-Explorer'!
1684
+
1685
+ !MaglevTable methodsFor: 'accessing'!
1686
+
1687
+ collection
1688
+ ^ object perform: collectionName
1689
+ !
1690
+
1691
+ collectionName
1692
+ ^ collectionName
1693
+ !
1694
+
1695
+ collectionName: aString
1696
+ collectionName := aString
1697
+ !
1698
+
1699
+ collectionSize
1700
+ ^ object perform: collectionName, 'Size'
1701
+ !
1702
+
1703
+ currentPage
1704
+ currentPage ifNil: [currentPage := 1].
1705
+ ^ currentPage
1706
+ !
1707
+
1708
+ isAssociationDictionary
1709
+ isAssociationDictionary ifNil: [isAssociationDictionary := false].
1710
+ ^ isAssociationDictionary
1711
+ !
1712
+
1713
+ isAssociationDictionary: aBoolean
1714
+ isAssociationDictionary := aBoolean.
1715
+ !
1716
+
1717
+ object
1718
+ ^ object
1719
+ !
1720
+
1721
+ object: anObject
1722
+ object := anObject.
1723
+ !
1724
+
1725
+ pageSize
1726
+ ^ 10
1727
+ !
1728
+
1729
+ pages
1730
+ ^ (self collectionSize / self pageSize) ceiled
1731
+ !
1732
+
1733
+ rangeFrom
1734
+ rangeFrom ifNil: [rangeFrom := 1].
1735
+ ^ rangeFrom
1736
+ !
1737
+
1738
+ rangeFrom: anInteger
1739
+ rangeFrom := anInteger.
1740
+ !
1741
+
1742
+ rangeTo
1743
+ ^ self rangeFrom + self pageSize - 1 min: self collectionSize
1744
+ ! !
1745
+
1746
+ !MaglevTable methodsFor: 'rendering'!
1747
+
1748
+ renderAssociation: key to: value on: html
1749
+ html tr with: [
1750
+ html td with: key inlineViewComponent.
1751
+ html td with: value inlineViewComponent].
1752
+ !
1753
+
1754
+ renderAssociationDictionaryBodyOn: html
1755
+ (self rangeFrom to: self rangeTo) do: [:idx | |obj|
1756
+ obj := self collection at: idx.
1757
+ html tr with: [
1758
+ html td with: obj key inlineViewComponent.
1759
+ html td with: obj value inlineViewComponent]].
1760
+ !
1761
+
1762
+ renderDictionaryBodyOn: html
1763
+ (self rangeFrom to: self rangeTo) do: [:idx | |obj|
1764
+ obj := self collection at: idx.
1765
+ html tr with: [
1766
+ html td with: idx inlineViewComponent.
1767
+ html td with: obj inlineViewComponent]].
1768
+ !
1769
+
1770
+ renderOn: html
1771
+ |pagClass|
1772
+ self pages = 1
1773
+ ifTrue: [pagClass := 'display: none;']
1774
+ ifFalse: [pagClass := ''].
1775
+ html table
1776
+ class: 'table table-bordered';
1777
+ style: 'margin-bottom: 0px;';
1778
+ with: [tableBody := html tbody].
1779
+ html div
1780
+ style: 'text-align: center;';
1781
+ with: [pagination := html span
1782
+ class: 'pagination';
1783
+ style: pagClass].
1784
+ self renderPagination.
1785
+ self renderPage: 1.
1786
+ !
1787
+
1788
+ renderPage: anInteger
1789
+ |html|
1790
+ currentPage := anInteger.
1791
+ html := HTMLCanvas onJQuery: tableBody asJQuery.
1792
+ rangeFrom := anInteger - 1 * self pageSize + 1.
1793
+ tableBody asJQuery empty.
1794
+ html
1795
+ with: MaglevIcon wait;
1796
+ with: ' loading...'.
1797
+ self renderPagination.
1798
+ object
1799
+ ensureIsLoaded: collectionName
1800
+ from: rangeFrom
1801
+ to: self rangeTo
1802
+ withCallback: [
1803
+ tableBody asJQuery empty.
1804
+ self renderTableBodyOn: (HTMLCanvas onJQuery: tableBody asJQuery)].
1805
+ !
1806
+
1807
+ renderPagination
1808
+ |firstPage lastPage html|
1809
+ pageListItems := Dictionary new.
1810
+ firstPage := self currentPage - 5 max: 1.
1811
+ lastPage := firstPage + 10 min: self pages.
1812
+ pagination asJQuery empty.
1813
+ html := (HTMLCanvas onJQuery: pagination asJQuery).
1814
+ pagination
1815
+ with: [html ul
1816
+ style: 'margin-top: 10px;';
1817
+ with: [(firstPage to: lastPage) do: [:index | |liClass|
1818
+ currentPage = index
1819
+ ifTrue: [liClass := 'disabled']
1820
+ ifFalse: [liClass := 'active'].
1821
+ html li
1822
+ class: liClass;
1823
+ with: [html a
1824
+ onClick: [self renderPage: index];
1825
+ with: index asString]]]].
1826
+ !
1827
+
1828
+ renderTableBodyOn: html
1829
+ self isAssociationDictionary
1830
+ ifTrue: [self renderAssociationDictionaryBodyOn: html. ^ self]
1831
+ ifFalse: [self renderDictionaryBodyOn: html. ^ self].
1832
+ ! !
1833
+
1834
+ !MaglevTable class methodsFor: 'instance creation'!
1835
+
1836
+ newAssociationDictFor: anObject with: aString
1837
+ ^ self basicNew
1838
+ object: anObject;
1839
+ collectionName: aString;
1840
+ isAssociationDictionary: true;
1841
+ initialize;
1842
+ yourself
1843
+ !
1844
+
1845
+ newFor: anObject with: aString
1846
+ ^ self basicNew
1847
+ object: anObject;
1848
+ collectionName: aString;
1849
+ initialize;
1850
+ yourself
1851
+ ! !
1852
+
1853
+ Widget subclass: #MaglevWindow
1854
+ instanceVariableNames: 'container navigationItem'
1855
+ package: 'Maglev-Database-Explorer'!
1856
+
1857
+ !MaglevWindow methodsFor: 'accessing'!
1858
+
1859
+ container
1860
+ ^ container
1861
+ !
1862
+
1863
+ navigationItem
1864
+ ^ navigationItem
1865
+ !
1866
+
1867
+ navigationItem: anObject
1868
+ navigationItem := anObject.
1869
+ ! !
1870
+
1871
+ !MaglevWindow methodsFor: 'attributes'!
1872
+
1873
+ left: aValue
1874
+ container left: aValue.
1875
+ !
1876
+
1877
+ top: aValue
1878
+ container top: aValue.
1879
+ ! !
1880
+
1881
+ !MaglevWindow methodsFor: 'interactions'!
1882
+
1883
+ clear
1884
+ container asJQuery empty.
1885
+ !
1886
+
1887
+ closeWindow
1888
+ MaglevJsPlumb deleteEndpointsFor: container asJQuery.
1889
+ container asJQuery remove.
1890
+ !
1891
+
1892
+ connectTo: aWindow as: type with: caption
1893
+ MaglevJsPlumb connectWindow: self to: aWindow as: type with: caption.
1894
+ !
1895
+
1896
+ connectTo: aWindow with: parameters
1897
+ MaglevJsPlumb connectWindow: self to: aWindow with: parameters.
1898
+ !
1899
+
1900
+ moveToFront
1901
+ container asJQuery css: 'z-index' data: self class highestZIndex + 1.
1902
+ !
1903
+
1904
+ prepareWindow
1905
+ MaglevJsPlumb prepareObject: (container asJQuery).
1906
+ container
1907
+ onMouseEnter: [container removeClass: 'window-mouse-out'];
1908
+ onMouseLeave: [container addClass: 'window-mouse-out'].
1909
+ !
1910
+
1911
+ replace: aWindow
1912
+ aWindow clear.
1913
+ container := aWindow container.
1914
+ ! !
1915
+
1916
+ !MaglevWindow methodsFor: 'rendering'!
1917
+
1918
+ appendToWorkspace
1919
+ self renderOn: (HTMLCanvas onJQuery: '#workspace' asJQuery).
1920
+ !
1921
+
1922
+ renderCloseButtonOn: html
1923
+ html span
1924
+ class: 'display-inline-block';
1925
+ style: 'float: right; margin-top: 3px; margin-left: 3px;';
1926
+ with: [html a
1927
+ href: '#';
1928
+ class: 'window-close-button';
1929
+ onClick: [self closeWindow];
1930
+ with: MaglevIcon remove].
1931
+ !
1932
+
1933
+ renderHeightPlaceholderOn: html
1934
+ html span
1935
+ style: 'visibility: hidden;';
1936
+ with: [
1937
+ html a
1938
+ class: 'btn';
1939
+ with: 'a'].
1940
+ !
1941
+
1942
+ renderHorziontalLineOn: html
1943
+ html hr style: 'margin: 10px;'.
1944
+ !
1945
+
1946
+ renderNavigationOn: html
1947
+ html with: 'New window'.
1948
+ !
1949
+
1950
+ renderOn: html
1951
+ container ifNil: [
1952
+ container := html div.
1953
+ self prepareWindow].
1954
+ container
1955
+ class: 'component window';
1956
+ with: [
1957
+ html div
1958
+ class: 'nowrap';
1959
+ with: [
1960
+ self renderWindowTitleOn: html.
1961
+ self renderWindowContentOn: html]].
1962
+ container onMouseDown: [self moveToFront].
1963
+ self moveToFront.
1964
+ !
1965
+
1966
+ renderReplace
1967
+ self renderOn: (HTMLCanvas onJQuery: container asJQuery).
1968
+ !
1969
+
1970
+ renderWindowContentOn: html
1971
+ !
1972
+
1973
+ renderWindowTitleContentOn: html
1974
+ html with: 'A new window'.
1975
+ self renderHeightPlaceholderOn: html.
1976
+ self renderCloseButtonOn: html.
1977
+ !
1978
+
1979
+ renderWindowTitleOn: html
1980
+ html div
1981
+ class: 'window-title';
1982
+ with: [html span
1983
+ class: 'window-title-content';
1984
+ with: [self renderWindowTitleContentOn: html]].
1985
+ ! !
1986
+
1987
+ !MaglevWindow methodsFor: 'testing'!
1988
+
1989
+ isWaitingWindow
1990
+ ^ false
1991
+ ! !
1992
+
1993
+ !MaglevWindow class methodsFor: 'instance creation'!
1994
+
1995
+ newReplace: aWindow
1996
+ ^ self new
1997
+ replace: aWindow;
1998
+ yourself
1999
+ ! !
2000
+
2001
+ !MaglevWindow class methodsFor: 'interactions'!
2002
+
2003
+ highestZIndex
2004
+ < var indexHighest = 0;
2005
+ $('.window').each(function(){
2006
+ var indexCurrent = parseInt($(this).css("z-index"), 10);
2007
+ if(indexCurrent >> indexHighest) {
2008
+ indexHighest = indexCurrent;
2009
+ }
2010
+ });
2011
+ return indexHighest; >.
2012
+ ! !
2013
+
2014
+ MaglevWindow subclass: #MaglevObjectWindow
2015
+ instanceVariableNames: 'container object classObject tabs captions tabsContainer currentTab'
2016
+ package: 'Maglev-Database-Explorer'!
2017
+
2018
+ !MaglevObjectWindow methodsFor: 'accessing'!
2019
+
2020
+ captions
2021
+ captions ifNil: [captions := Dictionary new].
2022
+ ^ captions
2023
+ !
2024
+
2025
+ container
2026
+ ^ container
2027
+ !
2028
+
2029
+ object
2030
+ ^ object
2031
+ !
2032
+
2033
+ object: anObject
2034
+ object := anObject.
2035
+ classObject := anObject classObject.
2036
+ !
2037
+
2038
+ tabs
2039
+ tabs ifNil: [tabs := Dictionary new].
2040
+ ^ tabs
2041
+ ! !
2042
+
2043
+ !MaglevObjectWindow methodsFor: 'interactions'!
2044
+
2045
+ closeWindow
2046
+ MaglevObjectSpace instance unregisterWindow: self.
2047
+ super closeWindow.
2048
+ !
2049
+
2050
+ defaultTab
2051
+ ^ nil
2052
+ !
2053
+
2054
+ makeCurrentTabResizable
2055
+ currentTab
2056
+ style: 'overflow: hidden;'.
2057
+ currentTab asJQuery children first
2058
+ attr: 'style' with: 'width: 100%; height: 100%; overflow: auto;'.
2059
+ currentTab asJQuery resizable.
2060
+ !
2061
+
2062
+ prepareWindow
2063
+ super prepareWindow
2064
+ MaglevObjectSpace registerWindow: self.
2065
+ !
2066
+
2067
+ replace: aWindow
2068
+ super replace: aWindow.
2069
+ aWindow isWaitingWindow
2070
+ ifFalse: [MaglevObjectSpace instance unregisterWindow: aWindow].
2071
+ MaglevObjectSpace instance registerWindow: self.
2072
+ !
2073
+
2074
+ showTab: caption
2075
+ |allTabs|
2076
+ allTabs := self contentTabs.
2077
+ "Lazy generate new tabs."
2078
+ ((self tabs includesKey: caption) not and: [allTabs includesKey: caption])
2079
+ ifTrue: [ |tab html|
2080
+ html := HTMLCanvas onJQuery: tabsContainer asJQuery.
2081
+ tab := html div
2082
+ with: [
2083
+ html div
2084
+ with: [self perform: (allTabs at: caption) withArguments: {html}]].
2085
+ self tabs at: caption put: tab].
2086
+ self tabs keysAndValuesDo: [:tabCaption :tab | |capEl|
2087
+ capEl := self captions at: tabCaption.
2088
+ caption = tabCaption
2089
+ ifTrue: [
2090
+ currentTab := tab.
2091
+ tab show.
2092
+ capEl addClass: 'active']
2093
+ ifFalse: [
2094
+ tab hide.
2095
+ capEl removeClass: 'active']].
2096
+ "return false to avoid scrolling to the top"
2097
+ ^ false
2098
+ ! !
2099
+
2100
+ !MaglevObjectWindow methodsFor: 'rendering'!
2101
+
2102
+ checkAddConnectionTo: aWindow
2103
+ object instVarsDo: [:ivName :ivValue |
2104
+ ivValue == aWindow object ifTrue: [self connectTo: aWindow as: #iv with: ivName inspection]].
2105
+ (object classObject == aWindow object and: [object virtualClassObject ~~ aWindow object])
2106
+ ifTrue: [self connectTo: aWindow as: #class with: nil].
2107
+ object virtualClassObject == aWindow object
2108
+ ifTrue: [self connectTo: aWindow as: #virtualClass with: nil].
2109
+ !
2110
+
2111
+ contentTabs
2112
+ |result|
2113
+ result := Dictionary new.
2114
+ self object hasInstVars
2115
+ ifTrue: [result at: 'Instance Variables' put: #renderInstanceVariablesOn:].
2116
+ object customTabs do: [:customTab | |selector|
2117
+ selector := 'renderCustom', (customTab at: 2), 'On:'.
2118
+ self class compile: selector, 'html ', (customTab at: 3).
2119
+ result at: (customTab at: 1) put: selector asSymbol].
2120
+ ^ result
2121
+ !
2122
+
2123
+ renderInstanceVariablesOn: html
2124
+ html with: (MaglevTable newAssociationDictFor: self object with: #instVars).
2125
+ !
2126
+
2127
+ renderNavigationOn: html
2128
+ html with: object inlineViewComponentNavItem.
2129
+ !
2130
+
2131
+ renderVirtualClassAndClassOn: html
2132
+ classObject = object virtualClassObject ifFalse: [
2133
+ html
2134
+ with: ' : ';
2135
+ with: object virtualClassObject inlineViewComponent].
2136
+ html
2137
+ with: ' :: ';
2138
+ with: classObject inlineViewComponent.
2139
+ !
2140
+
2141
+ renderWindowContentOn: html
2142
+ |allTabs firstCaption defaultTab|
2143
+ allTabs := self contentTabs.
2144
+ allTabs size > 0 ifTrue: [
2145
+ html ul
2146
+ class: 'nav nav-tabs';
2147
+ style: 'display: inline-block; margin-bottom: 0px; margin-top: 5px; width: 100%;';
2148
+ with: [
2149
+ html li
2150
+ style: 'float: right;';
2151
+ onClick: [self makeCurrentTabResizable];
2152
+ with: [
2153
+ html a
2154
+ href: '#';
2155
+ onClick: [self makeCurrentTabResizable];
2156
+ with: MaglevIcon resizeSmall].
2157
+ self contentTabs keysAndValuesDo: [:caption :generator | |capEl|
2158
+ firstCaption ifNil: [firstCaption := caption].
2159
+ capEl := html li with: [
2160
+ html a
2161
+ href: '#';
2162
+ onClick: [self showTab: caption];
2163
+ with: caption].
2164
+ self captions at: caption put: capEl]]].
2165
+ tabsContainer := html div.
2166
+ defaultTab := self defaultTab.
2167
+ defaultTab
2168
+ ifNil: [firstCaption ifNotNil: [self showTab: firstCaption]]
2169
+ ifNotNil: [self showTab: defaultTab].
2170
+ !
2171
+
2172
+ renderWindowTitleContentOn: html
2173
+ html with: object inlineViewComponentShort.
2174
+ html with: [
2175
+ html span
2176
+ style: 'margin-left: 5px;';
2177
+ with: '<0x', object oop asHexString, '>'].
2178
+ self renderHeightPlaceholderOn: html.
2179
+ html div
2180
+ class: 'right-inline-block';
2181
+ with: [
2182
+ self renderVirtualClassAndClassOn: html.
2183
+ self renderCloseButtonOn: html].
2184
+ ! !
2185
+
2186
+ !MaglevObjectWindow class methodsFor: 'instance creation'!
2187
+
2188
+ newReplace: aWindow with: anObject
2189
+ ^ self new
2190
+ object: anObject;
2191
+ replace: aWindow;
2192
+ yourself
2193
+ ! !
2194
+
2195
+ MaglevObjectWindow subclass: #MaglevArrayWindow
2196
+ instanceVariableNames: ''
2197
+ package: 'Maglev-Database-Explorer'!
2198
+
2199
+ !MaglevArrayWindow methodsFor: 'interactions'!
2200
+
2201
+ defaultTab
2202
+ ^ 'Elements'
2203
+ ! !
2204
+
2205
+ !MaglevArrayWindow methodsFor: 'rendering'!
2206
+
2207
+ checkAddConnectionTo: aWindow
2208
+ super checkAddConnectionTo: aWindow.
2209
+ object elements keysAndValuesDo: [:idx :value |
2210
+ value == aWindow object ifTrue: [self connectTo: aWindow as: #arrayElement with: idx]].
2211
+ !
2212
+
2213
+ contentTabs
2214
+ |result|
2215
+ result := super contentTabs.
2216
+ self object hasElements
2217
+ ifTrue: [result at: 'Elements' put: #renderArrayElementsOn:].
2218
+ ^ result
2219
+ !
2220
+
2221
+ renderArrayElementsOn: html
2222
+ html with: (MaglevTable newFor: self object with: #elements).
2223
+ ! !
2224
+
2225
+ MaglevObjectWindow subclass: #MaglevExceptionWindow
2226
+ instanceVariableNames: ''
2227
+ package: 'Maglev-Database-Explorer'!
2228
+
2229
+ MaglevObjectWindow subclass: #MaglevFixnumWindow
2230
+ instanceVariableNames: ''
2231
+ package: 'Maglev-Database-Explorer'!
2232
+
2233
+ MaglevObjectWindow subclass: #MaglevFloatWindow
2234
+ instanceVariableNames: ''
2235
+ package: 'Maglev-Database-Explorer'!
2236
+
2237
+ MaglevObjectWindow subclass: #MaglevHashWindow
2238
+ instanceVariableNames: ''
2239
+ package: 'Maglev-Database-Explorer'!
2240
+
2241
+ !MaglevHashWindow methodsFor: 'interactions'!
2242
+
2243
+ defaultTab
2244
+ ^ 'Associations'
2245
+ ! !
2246
+
2247
+ !MaglevHashWindow methodsFor: 'rendering'!
2248
+
2249
+ checkAddConnectionTo: aWindow
2250
+ super checkAddConnectionTo: aWindow.
2251
+ object keysAndValuesDo: [:key :value |
2252
+ key == aWindow object ifTrue: [self connectTo: aWindow as: #hashKey with: 'self[...] = ', value shortInspection].
2253
+ value == aWindow object ifTrue: [self connectTo: aWindow as: #hashValue with: 'self[', key shortInspection, '] = ...']].
2254
+ !
2255
+
2256
+ contentTabs
2257
+ |result|
2258
+ result := super contentTabs.
2259
+ self object hasElements
2260
+ ifTrue: [result at: 'Associations' put: #renderHashElementsOn:].
2261
+ ^ result
2262
+ !
2263
+
2264
+ renderHashElementsOn: html
2265
+ html with: (MaglevTable newAssociationDictFor: self object with: #elements).
2266
+ ! !
2267
+
2268
+ MaglevObjectWindow subclass: #MaglevMaglevRecordBaseWindow
2269
+ instanceVariableNames: ''
2270
+ package: 'Maglev-Database-Explorer'!
2271
+
2272
+ !MaglevMaglevRecordBaseWindow methodsFor: 'rendering'!
2273
+
2274
+ contentTabs
2275
+ |result|
2276
+ result := super contentTabs.
2277
+ result at: 'Attributes' put: #renderAttributesOn:.
2278
+ ^ result
2279
+ !
2280
+
2281
+ renderAttributesOn: html
2282
+ html with: (MaglevTable newAssociationDictFor: self object with: #attributes).
2283
+ ! !
2284
+
2285
+ MaglevObjectWindow subclass: #MaglevModuleWindow
2286
+ instanceVariableNames: 'categoryNamesSelect selectorsSelect selectors rubySelectors methodContainer waitingScreen hierarchyContainer'
2287
+ package: 'Maglev-Database-Explorer'!
2288
+
2289
+ !MaglevModuleWindow methodsFor: 'initializing'!
2290
+
2291
+ initializeTree: container
2292
+ < container.jstree({
2293
+ plugins: ["crrm", "html_data", "themes"],
2294
+ core: {
2295
+ animation: 0,
2296
+ open_parents: true}});
2297
+ // setTimout: jstree fix
2298
+ setTimeout(function(){
2299
+ container.find('.treeview-replace-me').each(function(index, el) {
2300
+ var jqEl = $(el);
2301
+ self._renderInlineViewFor_inside_(jqEl.data('oop'), jqEl);
2302
+ jqEl.removeClass('treeview-replace-me');
2303
+ });}, 0); >
2304
+ ! !
2305
+
2306
+ !MaglevModuleWindow methodsFor: 'interactions'!
2307
+
2308
+ defaultTab
2309
+ ^ 'Code'
2310
+ !
2311
+
2312
+ renderHierarchySubclass: cls for: oop
2313
+ < var ownerLi = self['@hierarchyContainer']._asJQuery().find("[data-oop='" + oop + "']");
2314
+ if (ownerLi.find("[data-oop='" + cls._oop() + "']").length == 0) {
2315
+ self['@hierarchyContainer']._asJQuery().jstree('create', ownerLi, null, {attr: {'data-oop': cls._oop(), 'data-replace-me': '1'}}, null, true);
2316
+ } >
2317
+ !
2318
+
2319
+ renderSelectors: selectedCategory
2320
+ |currentSelectors|
2321
+ selectorsSelect clear.
2322
+ currentSelectors := selectors at: selectedCategory.
2323
+ currentSelectors ifNil: [^ self].
2324
+ currentSelectors do: [:sel |
2325
+ selectorsSelect
2326
+ with: [:html | html with: sel]
2327
+ data: sel].
2328
+ !
2329
+
2330
+ renderSourceCode: selectorString
2331
+ |selectedCategory|
2332
+ methodContainer asJQuery empty.
2333
+ selectorString ifNil: [^ self].
2334
+ waitingScreen show.
2335
+ selectedCategory := self selectedCategoryString.
2336
+ selectedCategory = '(all Ruby)'
2337
+ ifTrue: [self renderRubySourceCodeFor: selectorString]
2338
+ ifFalse: [self renderSmalltalkSourceCodeFor: selectorString].
2339
+ !
2340
+
2341
+ replaceHierarchySubclasses
2342
+ < self['@hierarchyContainer']._asJQuery().find("[data-replace-me='1']").each(function(idx, el) {
2343
+ // TODO: jQuery not working here for unknown reasons
2344
+ el.getElementsByTagName('a')[0].remove();
2345
+ el.removeAttribute('data-replace-me');
2346
+ var jqEl = $(el);
2347
+ self._renderInlineViewFor_inside_(jqEl.data('oop'), jqEl);
2348
+ }); >
2349
+ !
2350
+
2351
+ selectedCategoryString
2352
+ ^ categoryNamesSelect selectedData
2353
+ ! !
2354
+
2355
+ !MaglevModuleWindow methodsFor: 'rendering'!
2356
+
2357
+ contentTabs
2358
+ |result|
2359
+ result := super contentTabs.
2360
+ self object hasConstants
2361
+ ifTrue: [result at: 'Constants' put: #renderConstantsOn:].
2362
+ self object hasIncludedModules
2363
+ ifTrue: [result at: 'Included Modules' put: #renderIncludedModulesOn:].
2364
+ result at: 'Code' put: #renderCodeTabOn:.
2365
+ result at: 'Hierarchy' put: #renderHierarchyOn:.
2366
+ ^ result
2367
+ !
2368
+
2369
+ renderCodeTabOn: html
2370
+ html root
2371
+ style: 'width: 100%;'.
2372
+ self renderListsOn: html.
2373
+ waitingScreen := html div
2374
+ with: [html
2375
+ with: MaglevIcon wait;
2376
+ with: ' loading...'].
2377
+ methodContainer := html div
2378
+ style: 'margin-top: 10px;'.
2379
+ self object allSelectorsWithCallback: [:obj |
2380
+ selectors := obj.
2381
+ self renderSelectorCategories.
2382
+ waitingScreen hide.
2383
+ categoryNamesSelect show.
2384
+ selectorsSelect show].
2385
+ !
2386
+
2387
+ renderConstantsOn: html
2388
+ html with: (MaglevTable newAssociationDictFor: self object with: #constants).
2389
+ !
2390
+
2391
+ renderHierarchyOn: htmlIn
2392
+ |waitingBox hcContainer|
2393
+ hcContainer := htmlIn div
2394
+ style: 'height: 300px; overflow: hidden;'.
2395
+ waitingBox := htmlIn div with: [
2396
+ htmlIn
2397
+ with: MaglevIcon wait;
2398
+ with: ' loading...'].
2399
+ object ensureSuperListLoadedWithCallback: [ |renderedInlines html|
2400
+ html := HTMLCanvas onJQuery: hcContainer asJQuery.
2401
+ renderedInlines := Array new.
2402
+ hierarchyContainer := html div
2403
+ style: 'width: 100%; height: 100%; overflow: auto;';
2404
+ with: [ |lastUl|
2405
+ lastUl := html ul.
2406
+ object superList do: [:cls | "render superclasses"
2407
+ lastUl with: [
2408
+ html li
2409
+ data: 'oop' with: cls oop asString;
2410
+ with: [|container|
2411
+ container := html span
2412
+ data: 'oop' with: cls oop asString;
2413
+ class: 'treeview-replace-me'.
2414
+ renderedInlines add: container];
2415
+ with: [lastUl := html ul]]]].
2416
+ self initializeTree: hierarchyContainer asJQuery.
2417
+ hcContainer asJQuery resizable.
2418
+ waitingBox hide].
2419
+ !
2420
+
2421
+ renderIncludedModulesOn: html
2422
+ html with: (MaglevTable newFor: self object with: #includedModules).
2423
+ !
2424
+
2425
+ renderInlineViewFor: oop inside: htmlElement
2426
+ |html subclassesButton waitIcon|
2427
+ html := HTMLCanvas onJQuery: htmlElement.
2428
+ waitIcon := MaglevIcon wait.
2429
+ html with: waitIcon.
2430
+ waitIcon hide.
2431
+ subclassesButton := MaglevIcon codeFork.
2432
+ html with: [html a with: subclassesButton].
2433
+ subclassesButton onClick: [ |obj|
2434
+ subclassesButton hide.
2435
+ waitIcon show.
2436
+ obj := MaglevObjectSpace instance at: oop.
2437
+ obj ensureSubclassesLoadedWithCallback: [
2438
+ obj subclasses do: [:cls |
2439
+ self renderHierarchySubclass: cls for: oop].
2440
+ self replaceHierarchySubclasses.
2441
+ waitIcon hide]].
2442
+ (MaglevObjectSpace instance at: oop) inlineViewComponentFull renderOn: html.
2443
+ !
2444
+
2445
+ renderListsOn: html
2446
+ categoryNamesSelect := MaglevListBox new.
2447
+ html with: categoryNamesSelect.
2448
+ categoryNamesSelect
2449
+ changedCallback: [:cat :index | self renderSelectors: cat];
2450
+ height: 250;
2451
+ style: 'float: left; width: 50%; margin-right: 10px; margin-left: 0px; display: inline-block;';
2452
+ hide.
2453
+ selectorsSelect := MaglevListBox new.
2454
+ html with: selectorsSelect.
2455
+ selectorsSelect
2456
+ changedCallback: [:sel :index | self renderSourceCode: sel];
2457
+ height: 250;
2458
+ style: 'display: inline-block; width: 50%; box-sizing: border-box; -webkit-box-sizing: border-box; padding-right: 10px;';
2459
+ hide.
2460
+ !
2461
+
2462
+ renderMethodObject: obj
2463
+ methodContainer with: (MaglevGsNMethodEditor for: obj).
2464
+ waitingScreen hide.
2465
+ !
2466
+
2467
+ renderRubySourceCodeFor: selectorString
2468
+ object
2469
+ sourceCodeFor: selectorString
2470
+ language: 'ruby'
2471
+ withCallback: [:obj | self renderMethodObject: obj].
2472
+ !
2473
+
2474
+ renderSelectorCategories
2475
+ categoryNamesSelect clear.
2476
+ selectors keysAndValuesDo: [:category :catSelectors |
2477
+ categoryNamesSelect with: [:html |
2478
+ category = '(all Ruby)'
2479
+ ifTrue: [html with: MaglevIconImage ruby]
2480
+ ifFalse: [html with: MaglevIconImage smalltalk].
2481
+ html with: category]
2482
+ data: category].
2483
+ !
2484
+
2485
+ renderSmalltalkSourceCodeFor: selectorString
2486
+ object
2487
+ sourceCodeFor: selectorString
2488
+ language: 'smalltalk'
2489
+ withCallback: [:obj | self renderMethodObject: obj].
2490
+ !
2491
+
2492
+ sortList: aListBox
2493
+ |box children|
2494
+ box := aListBox asJQuery.
2495
+ < children = box.children('option').sort(function (a, b) {return a.innerHTML >> b.innerHTML ? 1 : -1}); >.
2496
+ box empty.
2497
+ children appendTo: box.
2498
+ ! !
2499
+
2500
+ MaglevModuleWindow subclass: #MaglevClassWindow
2501
+ instanceVariableNames: ''
2502
+ package: 'Maglev-Database-Explorer'!
2503
+
2504
+ !MaglevClassWindow methodsFor: 'rendering'!
2505
+
2506
+ checkAddConnectionTo: aWindow
2507
+ super checkAddConnectionTo: aWindow.
2508
+ object superclassObject == aWindow object ifTrue: [self connectTo: aWindow as: #superclass with: nil].
2509
+ !
2510
+
2511
+ contentTabs
2512
+ |result|
2513
+ result := super contentTabs.
2514
+ result at: 'Instances' put: #renderInstancesOn:.
2515
+ ^ result
2516
+ !
2517
+
2518
+ renderInstancesOn: html
2519
+ html with: object instancesViewComponent.
2520
+ !
2521
+
2522
+ renderWindowTitleContentOn: html
2523
+ html
2524
+ with: object inlineViewComponentShort;
2525
+ with: ' < ';
2526
+ with: object superclassObject inlineViewComponent.
2527
+ html with: [
2528
+ html span
2529
+ style: 'margin-left: 5px;';
2530
+ with: '<0x', object oop asHexString, '>'].
2531
+ self renderHeightPlaceholderOn: html.
2532
+ html div
2533
+ class: 'right-inline-block';
2534
+ with: [
2535
+ self renderVirtualClassAndClassOn: html.
2536
+ self renderCloseButtonOn: html].
2537
+ ! !
2538
+
2539
+ MaglevClassWindow subclass: #MaglevSystemClassWindow
2540
+ instanceVariableNames: 'transactionResultBox'
2541
+ package: 'Maglev-Database-Explorer'!
2542
+
2543
+ !MaglevSystemClassWindow methodsFor: 'interactions'!
2544
+
2545
+ abortTransaction
2546
+ self showTransactionWaitingBox.
2547
+ object
2548
+ evaluate: 'self.__DBEAbortTransaction'
2549
+ language: 'ruby'
2550
+ withCallback: [:success :resultObj |
2551
+ transactionResultBox asJQuery empty.
2552
+ transactionResultBox removeClass: 'alert-info'.
2553
+ success
2554
+ ifTrue: [transactionResultBox addClass: 'alert-success']
2555
+ ifFalse: [transactionResultBox addClass: 'alert-error'].
2556
+ transactionResultBox with: resultObj inlineViewComponent].
2557
+ !
2558
+
2559
+ commitTransaction
2560
+ self showTransactionWaitingBox.
2561
+ object
2562
+ evaluate: 'self.__DBECommitTransaction'
2563
+ language: 'ruby'
2564
+ withCallback: [:success :resultObj |
2565
+ transactionResultBox asJQuery empty.
2566
+ transactionResultBox removeClass: 'alert-info'.
2567
+ success
2568
+ ifTrue: [transactionResultBox addClass: 'alert-success']
2569
+ ifFalse: [transactionResultBox addClass: 'alert-error'].
2570
+ transactionResultBox with: resultObj inlineViewComponent].
2571
+ !
2572
+
2573
+ continueTransaction
2574
+ self showTransactionWaitingBox.
2575
+ object
2576
+ evaluate: 'self.__DBEContinueTransaction'
2577
+ language: 'ruby'
2578
+ withCallback: [:success :resultObj |
2579
+ transactionResultBox asJQuery empty.
2580
+ transactionResultBox removeClass: 'alert-info'.
2581
+ success
2582
+ ifTrue: [transactionResultBox addClass: 'alert-success']
2583
+ ifFalse: [transactionResultBox addClass: 'alert-error'].
2584
+ transactionResultBox with: resultObj inlineViewComponent].
2585
+ !
2586
+
2587
+ defaultTab
2588
+ ^ 'Control Panel'
2589
+ ! !
2590
+
2591
+ !MaglevSystemClassWindow methodsFor: 'rendering'!
2592
+
2593
+ contentTabs
2594
+ |result|
2595
+ result := super contentTabs.
2596
+ result at: 'Stone Version Report' put: #renderStoneVersionReportOn:.
2597
+ result at: 'Gem Version Report' put: #renderGemVersionReportOn:.
2598
+ result at: 'Control Panel' put: #renderControlPanelOn:.
2599
+ ^ result
2600
+ !
2601
+
2602
+ renderControlPanelOn: html
2603
+ html with: [
2604
+ html div
2605
+ class: 'well';
2606
+ with: [
2607
+ html input
2608
+ type: 'button';
2609
+ class: 'btn btn-warning';
2610
+ value: 'Abort Transaction';
2611
+ style: 'width: 32%; margin-right: 1%;';
2612
+ onClick: [self abortTransaction].
2613
+ html input
2614
+ type: 'button';
2615
+ class: 'btn btn-warning';
2616
+ value: 'Commit Transaction';
2617
+ style: 'width: 32%; margin-right: 1%;';
2618
+ onClick: [self commitTransaction].
2619
+ html input
2620
+ type: 'button';
2621
+ class: 'btn btn-warning';
2622
+ value: 'Continue Transaction';
2623
+ style: 'width: 33%;';
2624
+ onClick: [self continueTransaction].
2625
+ transactionResultBox := html div
2626
+ style: 'margin-top: 10px; margin-bottom: 0px;';
2627
+ class: 'alert';
2628
+ hide]].
2629
+ !
2630
+
2631
+ renderGemVersionReportOn: html
2632
+ html with: (MaglevTable newAssociationDictFor: self object with: #gemVersionReport).
2633
+ !
2634
+
2635
+ renderStoneVersionReportOn: html
2636
+ html with: (MaglevTable newAssociationDictFor: self object with: #stoneVersionReport).
2637
+ !
2638
+
2639
+ showTransactionWaitingBox
2640
+ transactionResultBox
2641
+ addClass: 'alert-info';
2642
+ removeClass: 'alert-success';
2643
+ removeClass: 'alert-error'.
2644
+ transactionResultBox asJQuery empty.
2645
+ transactionResultBox
2646
+ with: MaglevIcon wait;
2647
+ with: ' loading...';
2648
+ show.
2649
+ ! !
2650
+
2651
+ MaglevObjectWindow subclass: #MaglevNilClassWindow
2652
+ instanceVariableNames: ''
2653
+ package: 'Maglev-Database-Explorer'!
2654
+
2655
+ MaglevObjectWindow subclass: #MaglevRubyWorkspaceWindow
2656
+ instanceVariableNames: 'terminalBox commandBox'
2657
+ package: 'Maglev-Database-Explorer'!
2658
+
2659
+ !MaglevRubyWorkspaceWindow methodsFor: 'interactions'!
2660
+
2661
+ defaultTab
2662
+ ^ 'Workspace'
2663
+ !
2664
+
2665
+ handleEnter
2666
+ |command html|
2667
+ html := HTMLCanvas onJQuery: terminalBox asJQuery.
2668
+ command := commandBox asJQuery val.
2669
+ command := command replace: '''' with: ''''''.
2670
+ commandBox asJQuery prop: 'disabled' value: true.
2671
+ html
2672
+ with: command;
2673
+ with: html br.
2674
+ object
2675
+ evaluate: 'self.evaluate(''', command, ''')'
2676
+ language: 'ruby'
2677
+ withCallback: [:success :resultObj | |class|
2678
+ (resultObj at: 1) value
2679
+ ifTrue: [class := 'alert alert-error']
2680
+ ifFalse: [class := 'alert alert-success'].
2681
+ terminalBox with: [html div
2682
+ class: class;
2683
+ with: '=> ';
2684
+ with: (resultObj at: 2) inlineViewComponent;
2685
+ with: html br].
2686
+ self scrollToBottom.
2687
+ commandBox asJQuery prop: 'disabled' value: false.
2688
+ commandBox asJQuery val: ''].
2689
+ !
2690
+
2691
+ scrollToBottom
2692
+ terminalBox asJQuery scrollTop: (terminalBox asJQuery at: 0) scrollHeight.
2693
+ ! !
2694
+
2695
+ !MaglevRubyWorkspaceWindow methodsFor: 'rendering'!
2696
+
2697
+ contentTabs
2698
+ |result|
2699
+ result := super contentTabs.
2700
+ result at: 'Workspace' put: #renderWorkspaceOn:.
2701
+ ^ result
2702
+ !
2703
+
2704
+ mouseFix
2705
+ < var editor = self['@terminalBox'];
2706
+ editor._asJQuery().mousedown(function (event) {
2707
+ event.preventDefault();
2708
+ return false;
2709
+ }); >
2710
+ !
2711
+
2712
+ renderWorkspaceOn: html
2713
+ terminalBox := html pre
2714
+ style: 'height: 350px; overflow-y: scroll; overflow-x: hidden; color: #000000;'.
2715
+ commandBox := html input
2716
+ type: 'text';
2717
+ style: 'width: 97%;';
2718
+ onKeyPress: [:evt | evt keyCode == 13
2719
+ ifTrue: [self handleEnter]].
2720
+ self mouseFix.
2721
+ ! !
2722
+
2723
+ MaglevObjectWindow subclass: #MaglevStringWindow
2724
+ instanceVariableNames: ''
2725
+ package: 'Maglev-Database-Explorer'!
2726
+
2727
+ MaglevObjectWindow subclass: #MaglevSymbolWindow
2728
+ instanceVariableNames: ''
2729
+ package: 'Maglev-Database-Explorer'!
2730
+
2731
+ MaglevObjectWindow subclass: #MaglevThreadWindow
2732
+ instanceVariableNames: 'methodSelect methodContainer waitingScreen waitForStackTrace'
2733
+ package: 'Maglev-Database-Explorer'!
2734
+
2735
+ !MaglevThreadWindow methodsFor: 'accessing'!
2736
+
2737
+ frameIndex
2738
+ ^ methodSelect selectedDataIndex
2739
+ ! !
2740
+
2741
+ !MaglevThreadWindow methodsFor: 'interactions'!
2742
+
2743
+ defaultTab
2744
+ ^ 'Stack Trace'
2745
+ !
2746
+
2747
+ isMethodUnimportant: aString
2748
+ |unimportant|
2749
+ unimportant := {'AbstractException >>'. 'AbstractException class'. 'GsProcess >>'. 'GsProcess class'.
2750
+ 'ProcessorScheduler >>'. 'ProcessorScheduler class'. 'CodeEvaluation class'. 'RubyCompiler >>'.
2751
+ 'RubyCompiler class'. 'onException:do:'. 'RubyProc >> callAndRescue:'. '_gsReturnToC'.
2752
+ '>> onSynchronous:do:'. 'ExecBlock >> ensure:'. 'ExecBlock >> rubyEnsure:'}.
2753
+ unimportant do: [:str |
2754
+ (aString includesSubString: str)
2755
+ ifTrue: [^ true]].
2756
+ ^ false
2757
+ !
2758
+
2759
+ proceed
2760
+ object
2761
+ proceedWithCallback: [:obj |
2762
+ object fullReloadWithCallback: [:threadReloaded |
2763
+ object isRailsThread
2764
+ ifTrue: [self closeWindow]
2765
+ ifFalse: [(threadReloaded windowViewComponentReplace: self) renderReplace]]].
2766
+ !
2767
+
2768
+ reloadStackWithCallback: aBlock
2769
+ |html|
2770
+ waitForStackTrace show.
2771
+ methodSelect clear.
2772
+ object stackTraceMethodsWithCallback: [:obj |
2773
+ obj do: [:method | |isUnimportant|
2774
+ isUnimportant := self isMethodUnimportant: method.
2775
+ methodSelect
2776
+ with: [:html |
2777
+ (method includesSubString: '(envId 0)')
2778
+ ifTrue: [html with: MaglevIconImage smalltalk].
2779
+ (method includesSubString: '(envId 1)')
2780
+ ifTrue: [html with: MaglevIconImage ruby].
2781
+ (method includesSubString: '(envId 1b)')
2782
+ ifTrue: [html with: MaglevIconImage rubySmalltalkBridge].
2783
+ html with: method] darker: isUnimportant].
2784
+ waitForStackTrace hide.
2785
+ aBlock = nil
2786
+ ifFalse: [aBlock value]].
2787
+ !
2788
+
2789
+ selectStackFrame: anInteger
2790
+ < self['@methodSelect']._asJQuery()[0].selectedIndex = anInteger - 1; >.
2791
+ self renderFrame.
2792
+ !
2793
+
2794
+ stepInto
2795
+ |frameIndex|
2796
+ frameIndex := self frameIndex.
2797
+ object
2798
+ stepInto: frameIndex
2799
+ withCallback: [:obj |
2800
+ self reloadStackWithCallback: [
2801
+ self selectStackFrame: frameIndex]].
2802
+ !
2803
+
2804
+ stepOver
2805
+ |frameIndex|
2806
+ frameIndex := self frameIndex.
2807
+ object
2808
+ stepOver: frameIndex
2809
+ withCallback: [:obj | self reloadStackWithCallback: [
2810
+ self selectStackFrame: frameIndex]].
2811
+ !
2812
+
2813
+ trimStack
2814
+ |frameIndex|
2815
+ frameIndex := self frameIndex.
2816
+ object
2817
+ trimTo: frameIndex
2818
+ withCallback: [:obj | self reloadStackWithCallback: [
2819
+ self selectStackFrame: frameIndex]].
2820
+ ! !
2821
+
2822
+ !MaglevThreadWindow methodsFor: 'rendering'!
2823
+
2824
+ contentTabs
2825
+ |result|
2826
+ result := super contentTabs.
2827
+ result at: 'Stack Trace' put: #renderStackTraceOn:.
2828
+ result at: 'Thread Local Storage' put: #renderLocalStorageOn:.
2829
+ ^ result
2830
+ !
2831
+
2832
+ renderButtonsOn: html
2833
+ html div
2834
+ class: 'button-area';
2835
+ style: 'margin-bottom: 10px;';
2836
+ with: [
2837
+ html input
2838
+ type: 'button';
2839
+ class: 'btn btn-primary';
2840
+ value: 'Proceed';
2841
+ style: 'margin-right: 1%; width: 24%;';
2842
+ onClick: [self proceed].
2843
+ html input
2844
+ type: 'button';
2845
+ class: 'btn btn-primary';
2846
+ value: 'Step into';
2847
+ style: 'margin-right: 1%; width: 24%;';
2848
+ onClick: [self stepInto].
2849
+ html input
2850
+ type: 'button';
2851
+ class: 'btn btn-primary';
2852
+ value: 'Step over';
2853
+ style: 'margin-right: 1%; width: 24%;';
2854
+ onClick: [self stepOver].
2855
+ html input
2856
+ type: 'button';
2857
+ class: 'btn btn-primary';
2858
+ value: 'Trim stack';
2859
+ style: 'width: 25%;';
2860
+ onClick: [self trimStack]].
2861
+ !
2862
+
2863
+ renderFrame: frameIndex
2864
+ methodContainer asJQuery empty.
2865
+ waitingScreen show.
2866
+ frameIndex > 0
2867
+ ifTrue: [object
2868
+ stackFrame: frameIndex
2869
+ withCallback: [:obj |
2870
+ methodContainer asJQuery empty.
2871
+ methodContainer with: (MaglevGsNMethodDebugEditor for: obj).
2872
+ waitingScreen hide]]
2873
+ ifFalse: [waitingScreen hide].
2874
+ !
2875
+
2876
+ renderLocalStorageOn: html
2877
+ html with: (MaglevTable newAssociationDictFor: object localStorage with: #elements).
2878
+ !
2879
+
2880
+ renderStackTraceOn: html
2881
+ waitForStackTrace := html div
2882
+ with: [html
2883
+ with: MaglevIcon wait;
2884
+ with: ' loading...'].
2885
+ methodSelect := MaglevListBox new.
2886
+ html with: methodSelect.
2887
+ methodSelect
2888
+ changedCallback: [:text :index | self renderFrame: index];
2889
+ height: 250;
2890
+ style: 'width: 100%;'.
2891
+ self renderButtonsOn: html.
2892
+ waitingScreen := html div
2893
+ with: [html
2894
+ with: MaglevIcon wait;
2895
+ with: ' loading...'];
2896
+ hide.
2897
+ methodContainer := html div.
2898
+ self reloadStackWithCallback: nil.
2899
+ ! !
2900
+
2901
+ MaglevWindow subclass: #MaglevSearchWindow
2902
+ instanceVariableNames: 'maglev selectBox waitForResult listContents methodContainer waitingScreen'
2903
+ package: 'Maglev-Database-Explorer'!
2904
+
2905
+ !MaglevSearchWindow methodsFor: 'not yet classified'!
2906
+
2907
+ listIndex
2908
+ ^ (selectBox asJQuery at: 0) selectedIndex + 1
2909
+ !
2910
+
2911
+ maglev
2912
+ maglev ifNil: [maglev := Maglev instance].
2913
+ ^maglev
2914
+ !
2915
+
2916
+ renderClass
2917
+ |listElement cls selector envId|
2918
+ waitingScreen show.
2919
+ listElement := listContents at: self listIndex.
2920
+ cls := (listElement at: 1) at:1.
2921
+ envId := ((listElement at: 1) at:2) inspection asNumber.
2922
+ selector := listElement at: 2.
2923
+ envId = 0 ifTrue:[
2924
+ cls sourceCodeFor: selector language: 'smalltalk' withCallback: [:obj|
2925
+ self renderMethodObject: obj.]
2926
+ ]
2927
+ ifFalse:[
2928
+ cls sourceCodeFor: selector language: 'ruby' withCallback: [:obj|
2929
+ self renderMethodObject: obj]
2930
+ ]
2931
+ !
2932
+
2933
+ renderListOf: selectors
2934
+ |html|
2935
+ html := HTMLCanvas onJQuery: selectBox asJQuery.
2936
+ selectBox asJQuery empty.
2937
+ listContents := Array new.
2938
+ selectors do:[:selector|
2939
+ self maglev implementersOf: selector withCallback:[:success :obj|
2940
+ obj hasElements ifTrue:[
2941
+ selectBox
2942
+ with: [obj do: [:cls |
2943
+ listContents add: {cls. selector}.
2944
+ html option with: (cls at:1) inspection, '>>' , selector]];
2945
+ size: 10;
2946
+ style: 'width: 100%;';
2947
+ show
2948
+ "onChange: [self renderClass]"
2949
+ ].
2950
+ waitForResult hide.
2951
+ ]
2952
+ ]
2953
+ !
2954
+
2955
+ renderMethodObject: obj
2956
+ methodContainer asJQuery empty.
2957
+ methodContainer with: (MaglevGsNMethodEditor for: obj).
2958
+ waitingScreen hide.
2959
+ !
2960
+
2961
+ renderWindowContentOn: html
2962
+ html div
2963
+ class: 'maglev-search';
2964
+ with: [
2965
+ html form
2966
+ class: 'search-form';
2967
+ onSubmit: [:e|e preventDefault. self searchSelectorsAndClasses.];
2968
+ with:[
2969
+ html input
2970
+ class: 'search-input'
2971
+ ]
2972
+ ].
2973
+ selectBox := html select
2974
+ size: 10;
2975
+ style: 'width: 100%;';
2976
+ onChange: [self renderClass];
2977
+ hide.
2978
+ waitForResult := html div
2979
+ with: [html
2980
+ with: MaglevIcon wait;
2981
+ with: ' loading...'];
2982
+ hide.
2983
+ waitingScreen := html div
2984
+ with: [html
2985
+ with: MaglevIcon wait;
2986
+ with: ' loading...'];
2987
+ hide.
2988
+ methodContainer := html div.
2989
+ !
2990
+
2991
+ searchSelectorsAndClasses
2992
+ |input maglev selectors|
2993
+ input := '.search-input' asJQuery val.
2994
+ selectors := Array new.
2995
+ waitForResult show.
2996
+ self maglev findMethodNamesMatching: input with:[:success :obj|
2997
+ success ifTrue: [selectors addAll: (obj string tokenize: ' ').
2998
+ self renderListOf: selectors].
2999
+
3000
+ ].
3001
+ ! !
3002
+
3003
+ MaglevWindow subclass: #MaglevWaitingWindow
3004
+ instanceVariableNames: ''
3005
+ package: 'Maglev-Database-Explorer'!
3006
+
3007
+ !MaglevWaitingWindow methodsFor: 'rendering'!
3008
+
3009
+ renderWindowContentOn: html
3010
+ !
3011
+
3012
+ renderWindowTitleOn: html
3013
+ html
3014
+ with: MaglevIcon wait;
3015
+ with: ' loading...'.
3016
+ ! !
3017
+
3018
+ !MaglevWaitingWindow methodsFor: 'testing'!
3019
+
3020
+ isWaitingWindow
3021
+ ^ true
3022
+ ! !
3023
+
3024
+ MaglevWindow subclass: #MaglevWebBrowserWindow
3025
+ instanceVariableNames: 'url inputUrl iframe'
3026
+ package: 'Maglev-Database-Explorer'!
3027
+
3028
+ !MaglevWebBrowserWindow methodsFor: 'accessing'!
3029
+
3030
+ url
3031
+ ^ url
3032
+ !
3033
+
3034
+ url: aString
3035
+ url := aString.
3036
+ inputUrl asJQuery attr: 'value' with: aString.
3037
+ iframe asJQuery attr: 'src' with: aString.
3038
+ ! !
3039
+
3040
+ !MaglevWebBrowserWindow methodsFor: 'rendering'!
3041
+
3042
+ renderWindowContentOn: html
3043
+ |iframeContainer|
3044
+ html div
3045
+ class: 'input-prepend';
3046
+ style: 'width: 100%; margin-top: 10px; box-sizing: border-box; padding-right: 51px; margin-bottom: 5px;';
3047
+ with: [
3048
+ html span
3049
+ class: 'add-on';
3050
+ with: 'URL'.
3051
+ inputUrl := html input
3052
+ type: 'text';
3053
+ style: 'width: 100%;';
3054
+ onKeyPress: [:evt | evt which = 13
3055
+ ifTrue: [self url: inputUrl asJQuery val]]].
3056
+ iframeContainer := html div
3057
+ style: 'margin-bottom: 5px; margin-right: 5px;';
3058
+ with: [
3059
+ iframe := html iframe
3060
+ style: 'width: 100%; height: 100%; border: 1px solid #ccc;';
3061
+ frameborder: '0';
3062
+ src: 'about:blank'].
3063
+ iframeContainer asJQuery resizable.
3064
+ !
3065
+
3066
+ renderWindowTitleContentOn: html
3067
+ html with: MaglevIcon globe.
3068
+ html with: 'Web Browser'.
3069
+ self renderHeightPlaceholderOn: html.
3070
+ self renderCloseButtonOn: html.
3071
+ ! !
3072
+
3073
+ !MaglevWebBrowserWindow class methodsFor: 'instance creation'!
3074
+
3075
+ defaultUrl
3076
+ < var port = parseInt(window.location.host.split(':')[1]) - 1;
3077
+ return window.location.protocol + '//' + window.location.host.split(':')[0] + ':' + port + '/'; >
3078
+ !
3079
+
3080
+ showNew
3081
+ ^ self new
3082
+ appendToWorkspace;
3083
+ url: self defaultUrl.
3084
+ ! !
3085
+