marty 2.4.7 → 2.4.8

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 (225) hide show
  1. checksums.yaml +4 -4
  2. data/Dockerfile.dummy +8 -5
  3. data/Gemfile.lock +1 -1
  4. data/README.md +8 -0
  5. data/app/assets/javascripts/marty/application.js +1 -0
  6. data/app/assets/javascripts/marty/codemirror/codemirror.js +9730 -0
  7. data/app/{components/marty/script_form/client → assets/javascripts/marty/codemirror}/mode/delorean/delorean.js +0 -0
  8. data/app/assets/javascripts/marty/codemirror/mode/javascript/javascript.js +900 -0
  9. data/app/assets/javascripts/marty/codemirror/mode/python/python.js +399 -0
  10. data/app/{components/marty/script_form/client → assets/javascripts/marty/codemirror}/mode/ruby/ruby.js +135 -34
  11. data/app/{components/marty/script_form/client/Ext.ux.form.field.CodeMirror.js → assets/javascripts/marty/extjs/extensions/marty.js} +87 -6
  12. data/app/assets/stylesheets/marty/application.css +1 -13
  13. data/app/assets/stylesheets/marty/codemirror/codemirror.css +346 -0
  14. data/app/{components/marty/script_form/client → assets/stylesheets/marty/codemirror}/delorean.css +0 -0
  15. data/app/components/marty/auth_app/client/auth_app.js +82 -80
  16. data/app/components/marty/data_grid_view.rb +1 -54
  17. data/app/components/marty/data_grid_view/client/data_grid_view.js +49 -0
  18. data/app/components/marty/form.rb +1 -5
  19. data/app/components/marty/form/client/form.js +5 -0
  20. data/app/components/marty/grid.rb +1 -146
  21. data/app/components/marty/grid/client/grid.js +146 -0
  22. data/app/components/marty/import_view.rb +1 -32
  23. data/app/components/marty/import_view/client/import_view.js +32 -0
  24. data/app/components/marty/live_search_grid_panel.rb +1 -21
  25. data/app/components/marty/live_search_grid_panel/client/live_search_grid_panel.js +27 -0
  26. data/app/components/marty/main_auth_app.rb +4 -145
  27. data/app/components/marty/main_auth_app/client/main_auth_app.js +124 -0
  28. data/app/components/marty/mcfly_grid_panel.rb +1 -17
  29. data/app/components/marty/mcfly_grid_panel/client/mcfly_grid_panel.js +37 -0
  30. data/app/components/marty/new_posting_form.rb +1 -6
  31. data/app/components/marty/new_posting_form/client/new_posting_form.js +6 -0
  32. data/app/components/marty/panel.rb +1 -5
  33. data/app/components/marty/panel/client/panel.js +5 -0
  34. data/app/components/marty/posting_grid.rb +4 -55
  35. data/app/components/marty/posting_grid/client/posting_grid.js +50 -0
  36. data/app/components/marty/promise_view.rb +2 -75
  37. data/app/components/marty/promise_view/client/promise_view.css +12 -9
  38. data/app/components/marty/promise_view/client/promise_view.js +57 -0
  39. data/app/components/marty/report_form.rb +3 -69
  40. data/app/components/marty/report_form/client/report_form.js +78 -0
  41. data/app/components/marty/report_select.rb +1 -45
  42. data/app/components/marty/report_select/client/report_select.js +50 -0
  43. data/app/components/marty/reporting.rb +1 -8
  44. data/app/components/marty/reporting/client/reporting.js +8 -0
  45. data/app/components/marty/script_form.rb +2 -63
  46. data/app/components/marty/script_form/client/script_form.js +44 -0
  47. data/app/components/marty/script_tester.rb +1 -7
  48. data/app/components/marty/script_tester/client/script_tester.js +7 -0
  49. data/app/components/marty/scripting.rb +1 -55
  50. data/app/components/marty/scripting/client/scripting.js +62 -0
  51. data/app/components/marty/simple_app/client/simple_app.js +21 -13
  52. data/app/models/marty/promise.rb +22 -1
  53. data/app/views/layouts/marty/application.html.erb +8 -6
  54. data/docker-compose.dummy.yml +2 -0
  55. data/lib/marty/monkey.rb +0 -16
  56. data/lib/marty/version.rb +1 -1
  57. data/spec/dummy/config/initializers/assets.rb +1 -0
  58. data/spec/features/reporting_spec.rb +1 -0
  59. data/spec/features/scripting_spec.rb +4 -4
  60. data/spec/spec_helper.rb +1 -0
  61. data/spec/support/chromedriver.rb +5 -1
  62. data/spec/support/shared_connection_db_helpers.rb +42 -2
  63. metadata +29 -168
  64. data/app/assets/images/marty/.gitkeep +0 -0
  65. data/app/components/marty/mcfly_grid_panel/client/dup_in_form.js +0 -20
  66. data/app/components/marty/script_form/client/codemirror.css +0 -172
  67. data/app/components/marty/script_form/client/codemirror.js +0 -3130
  68. data/app/components/marty/script_form/client/mode/clike/clike.js +0 -284
  69. data/app/components/marty/script_form/client/mode/clike/index.html +0 -102
  70. data/app/components/marty/script_form/client/mode/clike/scala.html +0 -766
  71. data/app/components/marty/script_form/client/mode/clojure/clojure.js +0 -206
  72. data/app/components/marty/script_form/client/mode/clojure/index.html +0 -67
  73. data/app/components/marty/script_form/client/mode/coffeescript/LICENSE +0 -22
  74. data/app/components/marty/script_form/client/mode/coffeescript/coffeescript.js +0 -346
  75. data/app/components/marty/script_form/client/mode/coffeescript/index.html +0 -728
  76. data/app/components/marty/script_form/client/mode/commonlisp/commonlisp.js +0 -101
  77. data/app/components/marty/script_form/client/mode/commonlisp/index.html +0 -165
  78. data/app/components/marty/script_form/client/mode/css/css.js +0 -448
  79. data/app/components/marty/script_form/client/mode/css/index.html +0 -58
  80. data/app/components/marty/script_form/client/mode/css/test.js +0 -501
  81. data/app/components/marty/script_form/client/mode/diff/diff.js +0 -32
  82. data/app/components/marty/script_form/client/mode/diff/index.html +0 -105
  83. data/app/components/marty/script_form/client/mode/ecl/ecl.js +0 -203
  84. data/app/components/marty/script_form/client/mode/ecl/index.html +0 -42
  85. data/app/components/marty/script_form/client/mode/erlang/erlang.js +0 -463
  86. data/app/components/marty/script_form/client/mode/erlang/index.html +0 -63
  87. data/app/components/marty/script_form/client/mode/gfm/gfm.js +0 -150
  88. data/app/components/marty/script_form/client/mode/gfm/index.html +0 -48
  89. data/app/components/marty/script_form/client/mode/go/go.js +0 -170
  90. data/app/components/marty/script_form/client/mode/go/index.html +0 -73
  91. data/app/components/marty/script_form/client/mode/groovy/groovy.js +0 -210
  92. data/app/components/marty/script_form/client/mode/groovy/index.html +0 -72
  93. data/app/components/marty/script_form/client/mode/haskell/haskell.js +0 -242
  94. data/app/components/marty/script_form/client/mode/haskell/index.html +0 -61
  95. data/app/components/marty/script_form/client/mode/haxe/haxe.js +0 -429
  96. data/app/components/marty/script_form/client/mode/haxe/index.html +0 -91
  97. data/app/components/marty/script_form/client/mode/htmlembedded/htmlembedded.js +0 -72
  98. data/app/components/marty/script_form/client/mode/htmlembedded/index.html +0 -50
  99. data/app/components/marty/script_form/client/mode/htmlmixed/htmlmixed.js +0 -84
  100. data/app/components/marty/script_form/client/mode/htmlmixed/index.html +0 -52
  101. data/app/components/marty/script_form/client/mode/javascript/index.html +0 -78
  102. data/app/components/marty/script_form/client/mode/javascript/javascript.js +0 -361
  103. data/app/components/marty/script_form/client/mode/jinja2/index.html +0 -38
  104. data/app/components/marty/script_form/client/mode/jinja2/jinja2.js +0 -42
  105. data/app/components/marty/script_form/client/mode/less/index.html +0 -740
  106. data/app/components/marty/script_form/client/mode/less/less.js +0 -266
  107. data/app/components/marty/script_form/client/mode/lua/index.html +0 -73
  108. data/app/components/marty/script_form/client/mode/lua/lua.js +0 -140
  109. data/app/components/marty/script_form/client/mode/markdown/index.html +0 -343
  110. data/app/components/marty/script_form/client/mode/markdown/markdown.js +0 -382
  111. data/app/components/marty/script_form/client/mode/markdown/test.js +0 -1084
  112. data/app/components/marty/script_form/client/mode/mysql/index.html +0 -42
  113. data/app/components/marty/script_form/client/mode/mysql/mysql.js +0 -186
  114. data/app/components/marty/script_form/client/mode/ntriples/index.html +0 -33
  115. data/app/components/marty/script_form/client/mode/ntriples/ntriples.js +0 -172
  116. data/app/components/marty/script_form/client/mode/ocaml/index.html +0 -130
  117. data/app/components/marty/script_form/client/mode/ocaml/ocaml.js +0 -114
  118. data/app/components/marty/script_form/client/mode/pascal/LICENSE +0 -7
  119. data/app/components/marty/script_form/client/mode/pascal/index.html +0 -49
  120. data/app/components/marty/script_form/client/mode/pascal/pascal.js +0 -94
  121. data/app/components/marty/script_form/client/mode/perl/LICENSE +0 -19
  122. data/app/components/marty/script_form/client/mode/perl/index.html +0 -63
  123. data/app/components/marty/script_form/client/mode/perl/perl.js +0 -816
  124. data/app/components/marty/script_form/client/mode/php/index.html +0 -49
  125. data/app/components/marty/script_form/client/mode/php/php.js +0 -148
  126. data/app/components/marty/script_form/client/mode/pig/index.html +0 -43
  127. data/app/components/marty/script_form/client/mode/pig/pig.js +0 -172
  128. data/app/components/marty/script_form/client/mode/plsql/index.html +0 -63
  129. data/app/components/marty/script_form/client/mode/plsql/plsql.js +0 -217
  130. data/app/components/marty/script_form/client/mode/properties/index.html +0 -41
  131. data/app/components/marty/script_form/client/mode/properties/properties.js +0 -63
  132. data/app/components/marty/script_form/client/mode/python/LICENSE.txt +0 -21
  133. data/app/components/marty/script_form/client/mode/python/index.html +0 -123
  134. data/app/components/marty/script_form/client/mode/python/python.js +0 -338
  135. data/app/components/marty/script_form/client/mode/r/LICENSE +0 -24
  136. data/app/components/marty/script_form/client/mode/r/index.html +0 -74
  137. data/app/components/marty/script_form/client/mode/r/r.js +0 -141
  138. data/app/components/marty/script_form/client/mode/rpm/changes/changes.js +0 -19
  139. data/app/components/marty/script_form/client/mode/rpm/changes/index.html +0 -54
  140. data/app/components/marty/script_form/client/mode/rpm/spec/index.html +0 -100
  141. data/app/components/marty/script_form/client/mode/rpm/spec/spec.css +0 -5
  142. data/app/components/marty/script_form/client/mode/rpm/spec/spec.js +0 -66
  143. data/app/components/marty/script_form/client/mode/rst/index.html +0 -526
  144. data/app/components/marty/script_form/client/mode/rst/rst.js +0 -326
  145. data/app/components/marty/script_form/client/mode/ruby/LICENSE +0 -24
  146. data/app/components/marty/script_form/client/mode/ruby/index.html +0 -172
  147. data/app/components/marty/script_form/client/mode/rust/index.html +0 -49
  148. data/app/components/marty/script_form/client/mode/rust/rust.js +0 -432
  149. data/app/components/marty/script_form/client/mode/scheme/index.html +0 -65
  150. data/app/components/marty/script_form/client/mode/scheme/scheme.js +0 -230
  151. data/app/components/marty/script_form/client/mode/shell/index.html +0 -50
  152. data/app/components/marty/script_form/client/mode/shell/shell.js +0 -118
  153. data/app/components/marty/script_form/client/mode/sieve/LICENSE +0 -23
  154. data/app/components/marty/script_form/client/mode/sieve/index.html +0 -81
  155. data/app/components/marty/script_form/client/mode/sieve/sieve.js +0 -156
  156. data/app/components/marty/script_form/client/mode/smalltalk/index.html +0 -56
  157. data/app/components/marty/script_form/client/mode/smalltalk/smalltalk.js +0 -139
  158. data/app/components/marty/script_form/client/mode/smarty/index.html +0 -83
  159. data/app/components/marty/script_form/client/mode/smarty/smarty.js +0 -148
  160. data/app/components/marty/script_form/client/mode/sparql/index.html +0 -41
  161. data/app/components/marty/script_form/client/mode/sparql/sparql.js +0 -143
  162. data/app/components/marty/script_form/client/mode/stex/index.html +0 -98
  163. data/app/components/marty/script_form/client/mode/stex/stex.js +0 -182
  164. data/app/components/marty/script_form/client/mode/stex/test.js +0 -343
  165. data/app/components/marty/script_form/client/mode/tiddlywiki/index.html +0 -141
  166. data/app/components/marty/script_form/client/mode/tiddlywiki/tiddlywiki.css +0 -14
  167. data/app/components/marty/script_form/client/mode/tiddlywiki/tiddlywiki.js +0 -384
  168. data/app/components/marty/script_form/client/mode/tiki/index.html +0 -83
  169. data/app/components/marty/script_form/client/mode/tiki/tiki.css +0 -26
  170. data/app/components/marty/script_form/client/mode/tiki/tiki.js +0 -309
  171. data/app/components/marty/script_form/client/mode/vb/LICENSE.txt +0 -21
  172. data/app/components/marty/script_form/client/mode/vb/index.html +0 -89
  173. data/app/components/marty/script_form/client/mode/vb/vb.js +0 -260
  174. data/app/components/marty/script_form/client/mode/vbscript/index.html +0 -43
  175. data/app/components/marty/script_form/client/mode/vbscript/vbscript.js +0 -26
  176. data/app/components/marty/script_form/client/mode/velocity/index.html +0 -104
  177. data/app/components/marty/script_form/client/mode/velocity/velocity.js +0 -146
  178. data/app/components/marty/script_form/client/mode/verilog/index.html +0 -211
  179. data/app/components/marty/script_form/client/mode/verilog/verilog.js +0 -194
  180. data/app/components/marty/script_form/client/mode/xml/index.html +0 -45
  181. data/app/components/marty/script_form/client/mode/xml/xml.js +0 -318
  182. data/app/components/marty/script_form/client/mode/xquery/LICENSE +0 -20
  183. data/app/components/marty/script_form/client/mode/xquery/index.html +0 -223
  184. data/app/components/marty/script_form/client/mode/xquery/test/index.html +0 -27
  185. data/app/components/marty/script_form/client/mode/xquery/test/testBase.js +0 -42
  186. data/app/components/marty/script_form/client/mode/xquery/test/testEmptySequenceKeyword.js +0 -16
  187. data/app/components/marty/script_form/client/mode/xquery/test/testMultiAttr.js +0 -16
  188. data/app/components/marty/script_form/client/mode/xquery/test/testNamespaces.js +0 -91
  189. data/app/components/marty/script_form/client/mode/xquery/test/testProcessingInstructions.js +0 -16
  190. data/app/components/marty/script_form/client/mode/xquery/test/testQuotes.js +0 -19
  191. data/app/components/marty/script_form/client/mode/xquery/xquery.js +0 -451
  192. data/app/components/marty/script_form/client/mode/yaml/index.html +0 -68
  193. data/app/components/marty/script_form/client/mode/yaml/yaml.js +0 -95
  194. data/app/components/marty/script_form/client/theme/ambiance.css +0 -81
  195. data/app/components/marty/script_form/client/theme/blackboard.css +0 -25
  196. data/app/components/marty/script_form/client/theme/cobalt.css +0 -18
  197. data/app/components/marty/script_form/client/theme/eclipse.css +0 -25
  198. data/app/components/marty/script_form/client/theme/elegant.css +0 -10
  199. data/app/components/marty/script_form/client/theme/erlang-dark.css +0 -21
  200. data/app/components/marty/script_form/client/theme/lesser-dark.css +0 -44
  201. data/app/components/marty/script_form/client/theme/monokai.css +0 -28
  202. data/app/components/marty/script_form/client/theme/neat.css +0 -9
  203. data/app/components/marty/script_form/client/theme/night.css +0 -21
  204. data/app/components/marty/script_form/client/theme/rubyblue.css +0 -21
  205. data/app/components/marty/script_form/client/theme/vibrant-ink.css +0 -27
  206. data/app/components/marty/script_form/client/theme/xq-dark.css +0 -46
  207. data/app/components/marty/script_form/client/util/closetag.js +0 -164
  208. data/app/components/marty/script_form/client/util/dialog.css +0 -27
  209. data/app/components/marty/script_form/client/util/dialog.js +0 -70
  210. data/app/components/marty/script_form/client/util/foldcode.js +0 -196
  211. data/app/components/marty/script_form/client/util/formatting.js +0 -193
  212. data/app/components/marty/script_form/client/util/javascript-hint.js +0 -134
  213. data/app/components/marty/script_form/client/util/loadmode.js +0 -51
  214. data/app/components/marty/script_form/client/util/match-highlighter.js +0 -44
  215. data/app/components/marty/script_form/client/util/multiplex.js +0 -77
  216. data/app/components/marty/script_form/client/util/overlay.js +0 -54
  217. data/app/components/marty/script_form/client/util/pig-hint.js +0 -123
  218. data/app/components/marty/script_form/client/util/runmode-standalone.js +0 -90
  219. data/app/components/marty/script_form/client/util/runmode.js +0 -53
  220. data/app/components/marty/script_form/client/util/search.js +0 -118
  221. data/app/components/marty/script_form/client/util/searchcursor.js +0 -119
  222. data/app/components/marty/script_form/client/util/simple-hint.css +0 -16
  223. data/app/components/marty/script_form/client/util/simple-hint.js +0 -97
  224. data/app/components/marty/script_form/client/util/xml-hint.js +0 -137
  225. data/lib/marty/javascript/grid_view_in_form.js +0 -81
@@ -1,23 +0,0 @@
1
- Copyright (C) 2012 Thomas Schmid <schmid-thomas@gmx.net>
2
-
3
- Permission is hereby granted, free of charge, to any person obtaining a copy
4
- of this software and associated documentation files (the "Software"), to deal
5
- in the Software without restriction, including without limitation the rights
6
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
- copies of the Software, and to permit persons to whom the Software is
8
- furnished to do so, subject to the following conditions:
9
-
10
- The above copyright notice and this permission notice shall be included in
11
- all copies or substantial portions of the Software.
12
-
13
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
- THE SOFTWARE.
20
-
21
- Please note that some subdirectories of the CodeMirror distribution
22
- include their own LICENSE files, and are released under different
23
- licences.
@@ -1,81 +0,0 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8">
5
- <title>CodeMirror: Sieve (RFC5228) mode</title>
6
- <link rel="stylesheet" href="../../doc/docs.css">
7
- <link rel="stylesheet" href="../../lib/codemirror.css">
8
- <script src="../../lib/codemirror.js"></script>
9
- <script src="sieve.js"></script>
10
- <style>.CodeMirror {background: #f8f8f8;}</style>
11
- </head>
12
- <body>
13
- <h1>CodeMirror: Sieve (RFC5228) mode</h1>
14
- <form><textarea id="code" name="code">
15
- #
16
- # Example Sieve Filter
17
- # Declare any optional features or extension used by the script
18
- #
19
-
20
- require ["fileinto", "reject"];
21
-
22
- #
23
- # Reject any large messages (note that the four leading dots get
24
- # "stuffed" to three)
25
- #
26
- if size :over 1M
27
- {
28
- reject text:
29
- Please do not send me large attachments.
30
- Put your file on a server and send me the URL.
31
- Thank you.
32
- .... Fred
33
- .
34
- ;
35
- stop;
36
- }
37
-
38
- #
39
- # Handle messages from known mailing lists
40
- # Move messages from IETF filter discussion list to filter folder
41
- #
42
- if header :is "Sender" "owner-ietf-mta-filters@imc.org"
43
- {
44
- fileinto "filter"; # move to "filter" folder
45
- }
46
- #
47
- # Keep all messages to or from people in my company
48
- #
49
- elsif address :domain :is ["From", "To"] "example.com"
50
- {
51
- keep; # keep in "In" folder
52
- }
53
-
54
- #
55
- # Try and catch unsolicited email. If a message is not to me,
56
- # or it contains a subject known to be spam, file it away.
57
- #
58
- elsif anyof (not address :all :contains
59
- ["To", "Cc", "Bcc"] "me@example.com",
60
- header :matches "subject"
61
- ["*make*money*fast*", "*university*dipl*mas*"])
62
- {
63
- # If message header does not contain my address,
64
- # it's from a list.
65
- fileinto "spam"; # move to "spam" folder
66
- }
67
- else
68
- {
69
- # Move all other (non-company) mail to "personal"
70
- # folder.
71
- fileinto "personal";
72
- }
73
- </textarea></form>
74
- <script>
75
- var editor = CodeMirror.fromTextArea(document.getElementById("code"), {});
76
- </script>
77
-
78
- <p><strong>MIME types defined:</strong> <code>application/sieve</code>.</p>
79
-
80
- </body>
81
- </html>
@@ -1,156 +0,0 @@
1
- /*
2
- * See LICENSE in this directory for the license under which this code
3
- * is released.
4
- */
5
-
6
- CodeMirror.defineMode("sieve", function(config) {
7
- function words(str) {
8
- var obj = {}, words = str.split(" ");
9
- for (var i = 0; i < words.length; ++i) obj[words[i]] = true;
10
- return obj;
11
- }
12
-
13
- var keywords = words("if elsif else stop require");
14
- var atoms = words("true false not");
15
- var indentUnit = config.indentUnit;
16
-
17
- function tokenBase(stream, state) {
18
-
19
- var ch = stream.next();
20
- if (ch == "/" && stream.eat("*")) {
21
- state.tokenize = tokenCComment;
22
- return tokenCComment(stream, state);
23
- }
24
-
25
- if (ch === '#') {
26
- stream.skipToEnd();
27
- return "comment";
28
- }
29
-
30
- if (ch == "\"") {
31
- state.tokenize = tokenString(ch);
32
- return state.tokenize(stream, state);
33
- }
34
-
35
- if (ch === "{")
36
- {
37
- state._indent++;
38
- return null;
39
- }
40
-
41
- if (ch === "}")
42
- {
43
- state._indent--;
44
- return null;
45
- }
46
-
47
- if (/[{}\(\),;]/.test(ch))
48
- return null;
49
-
50
- // 1*DIGIT "K" / "M" / "G"
51
- if (/\d/.test(ch)) {
52
- stream.eatWhile(/[\d]/);
53
- stream.eat(/[KkMmGg]/);
54
- return "number";
55
- }
56
-
57
- // ":" (ALPHA / "_") *(ALPHA / DIGIT / "_")
58
- if (ch == ":") {
59
- stream.eatWhile(/[a-zA-Z_]/);
60
- stream.eatWhile(/[a-zA-Z0-9_]/);
61
-
62
- return "operator";
63
- }
64
-
65
- stream.eatWhile(/[\w\$_]/);
66
- var cur = stream.current();
67
-
68
- // "text:" *(SP / HTAB) (hash-comment / CRLF)
69
- // *(multiline-literal / multiline-dotstart)
70
- // "." CRLF
71
- if ((cur == "text") && stream.eat(":"))
72
- {
73
- state.tokenize = tokenMultiLineString;
74
- return "string";
75
- }
76
-
77
- if (keywords.propertyIsEnumerable(cur))
78
- return "keyword";
79
-
80
- if (atoms.propertyIsEnumerable(cur))
81
- return "atom";
82
- }
83
-
84
- function tokenMultiLineString(stream, state)
85
- {
86
- state._multiLineString = true;
87
- // the first line is special it may contain a comment
88
- if (!stream.sol()) {
89
- stream.eatSpace();
90
-
91
- if (stream.peek() == "#") {
92
- stream.skipToEnd();
93
- return "comment";
94
- }
95
-
96
- stream.skipToEnd();
97
- return "string";
98
- }
99
-
100
- if ((stream.next() == ".") && (stream.eol()))
101
- {
102
- state._multiLineString = false;
103
- state.tokenize = tokenBase;
104
- }
105
-
106
- return "string";
107
- }
108
-
109
- function tokenCComment(stream, state) {
110
- var maybeEnd = false, ch;
111
- while ((ch = stream.next()) != null) {
112
- if (maybeEnd && ch == "/") {
113
- state.tokenize = tokenBase;
114
- break;
115
- }
116
- maybeEnd = (ch == "*");
117
- }
118
- return "comment";
119
- }
120
-
121
- function tokenString(quote) {
122
- return function(stream, state) {
123
- var escaped = false, ch;
124
- while ((ch = stream.next()) != null) {
125
- if (ch == quote && !escaped)
126
- break;
127
- escaped = !escaped && ch == "\\";
128
- }
129
- if (!escaped) state.tokenize = tokenBase;
130
- return "string";
131
- };
132
- }
133
-
134
- return {
135
- startState: function(base) {
136
- return {tokenize: tokenBase,
137
- baseIndent: base || 0,
138
- _indent: 0};
139
- },
140
-
141
- token: function(stream, state) {
142
- if (stream.eatSpace())
143
- return null;
144
-
145
- return (state.tokenize || tokenBase)(stream, state);;
146
- },
147
-
148
- indent: function(state, textAfter) {
149
- return state.baseIndent + state._indent * indentUnit;
150
- },
151
-
152
- electricChars: "}"
153
- };
154
- });
155
-
156
- CodeMirror.defineMIME("application/sieve", "sieve");
@@ -1,56 +0,0 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8">
5
- <title>CodeMirror: Smalltalk mode</title>
6
- <link rel="stylesheet" href="../../lib/codemirror.css">
7
- <script src="../../lib/codemirror.js"></script>
8
- <script src="smalltalk.js"></script>
9
- <link rel="stylesheet" href="../../doc/docs.css">
10
- <style>
11
- .CodeMirror {border: 2px solid #dee; border-right-width: 10px;}
12
- .CodeMirror-gutter {border: none; background: #dee;}
13
- .CodeMirror-gutter pre {color: white; font-weight: bold;}
14
- </style>
15
- </head>
16
- <body>
17
- <h1>CodeMirror: Smalltalk mode</h1>
18
-
19
- <form><textarea id="code" name="code">
20
- "
21
- This is a test of the Smalltalk code
22
- "
23
- Seaside.WAComponent subclass: #MyCounter [
24
- | count |
25
- MyCounter class &gt;&gt; canBeRoot [ ^true ]
26
-
27
- initialize [
28
- super initialize.
29
- count := 0.
30
- ]
31
- states [ ^{ self } ]
32
- renderContentOn: html [
33
- html heading: count.
34
- html anchor callback: [ count := count + 1 ]; with: '++'.
35
- html space.
36
- html anchor callback: [ count := count - 1 ]; with: '--'.
37
- ]
38
- ]
39
-
40
- MyCounter registerAsApplication: 'mycounter'
41
- </textarea></form>
42
-
43
- <script>
44
- var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
45
- lineNumbers: true,
46
- matchBrackets: true,
47
- mode: "text/x-stsrc",
48
- indentUnit: 4
49
- });
50
- </script>
51
-
52
- <p>Simple Smalltalk mode.</p>
53
-
54
- <p><strong>MIME types defined:</strong> <code>text/x-stsrc</code>.</p>
55
- </body>
56
- </html>
@@ -1,139 +0,0 @@
1
- CodeMirror.defineMode('smalltalk', function(config, modeConfig) {
2
-
3
- var specialChars = /[+\-/\\*~<>=@%|&?!.:;^]/;
4
- var keywords = /true|false|nil|self|super|thisContext/;
5
-
6
- var Context = function(tokenizer, parent) {
7
- this.next = tokenizer;
8
- this.parent = parent;
9
- };
10
-
11
- var Token = function(name, context, eos) {
12
- this.name = name;
13
- this.context = context;
14
- this.eos = eos;
15
- };
16
-
17
- var State = function() {
18
- this.context = new Context(next, null);
19
- this.expectVariable = true;
20
- this.indentation = 0;
21
- this.userIndentationDelta = 0;
22
- };
23
-
24
- State.prototype.userIndent = function(indentation) {
25
- this.userIndentationDelta = indentation > 0 ? (indentation / config.indentUnit - this.indentation) : 0;
26
- };
27
-
28
- var next = function(stream, context, state) {
29
- var token = new Token(null, context, false);
30
- var aChar = stream.next();
31
-
32
- if (aChar === '"') {
33
- token = nextComment(stream, new Context(nextComment, context));
34
-
35
- } else if (aChar === '\'') {
36
- token = nextString(stream, new Context(nextString, context));
37
-
38
- } else if (aChar === '#') {
39
- stream.eatWhile(/[^ .]/);
40
- token.name = 'string-2';
41
-
42
- } else if (aChar === '$') {
43
- stream.eatWhile(/[^ ]/);
44
- token.name = 'string-2';
45
-
46
- } else if (aChar === '|' && state.expectVariable) {
47
- token.context = new Context(nextTemporaries, context);
48
-
49
- } else if (/[\[\]{}()]/.test(aChar)) {
50
- token.name = 'bracket';
51
- token.eos = /[\[{(]/.test(aChar);
52
-
53
- if (aChar === '[') {
54
- state.indentation++;
55
- } else if (aChar === ']') {
56
- state.indentation = Math.max(0, state.indentation - 1);
57
- }
58
-
59
- } else if (specialChars.test(aChar)) {
60
- stream.eatWhile(specialChars);
61
- token.name = 'operator';
62
- token.eos = aChar !== ';'; // ; cascaded message expression
63
-
64
- } else if (/\d/.test(aChar)) {
65
- stream.eatWhile(/[\w\d]/);
66
- token.name = 'number';
67
-
68
- } else if (/[\w_]/.test(aChar)) {
69
- stream.eatWhile(/[\w\d_]/);
70
- token.name = state.expectVariable ? (keywords.test(stream.current()) ? 'keyword' : 'variable') : null;
71
-
72
- } else {
73
- token.eos = state.expectVariable;
74
- }
75
-
76
- return token;
77
- };
78
-
79
- var nextComment = function(stream, context) {
80
- stream.eatWhile(/[^"]/);
81
- return new Token('comment', stream.eat('"') ? context.parent : context, true);
82
- };
83
-
84
- var nextString = function(stream, context) {
85
- stream.eatWhile(/[^']/);
86
- return new Token('string', stream.eat('\'') ? context.parent : context, false);
87
- };
88
-
89
- var nextTemporaries = function(stream, context, state) {
90
- var token = new Token(null, context, false);
91
- var aChar = stream.next();
92
-
93
- if (aChar === '|') {
94
- token.context = context.parent;
95
- token.eos = true;
96
-
97
- } else {
98
- stream.eatWhile(/[^|]/);
99
- token.name = 'variable';
100
- }
101
-
102
- return token;
103
- };
104
-
105
- return {
106
- startState: function() {
107
- return new State;
108
- },
109
-
110
- token: function(stream, state) {
111
- state.userIndent(stream.indentation());
112
-
113
- if (stream.eatSpace()) {
114
- return null;
115
- }
116
-
117
- var token = state.context.next(stream, state.context, state);
118
- state.context = token.context;
119
- state.expectVariable = token.eos;
120
-
121
- state.lastToken = token;
122
- return token.name;
123
- },
124
-
125
- blankLine: function(state) {
126
- state.userIndent(0);
127
- },
128
-
129
- indent: function(state, textAfter) {
130
- var i = state.context.next === next && textAfter && textAfter.charAt(0) === ']' ? -1 : state.userIndentationDelta;
131
- return (state.indentation + i) * config.indentUnit;
132
- },
133
-
134
- electricChars: ']'
135
- };
136
-
137
- });
138
-
139
- CodeMirror.defineMIME('text/x-stsrc', {name: 'smalltalk'});