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
@@ -44,23 +44,7 @@ class Marty::McflyGridPanel < Marty::Grid
44
44
  end
45
45
 
46
46
  client_class do |c|
47
- c.init_component = l(<<-JS)
48
- function() {
49
- this.callParent();
50
-
51
- // dup is a non standard button, so we have to explicitly manage
52
- // its clickability
53
- this.getSelectionModel().on('selectionchange', function(selModel) {
54
- this.actions.dupInForm &&
55
- this.actions.dupInForm.setDisabled(!selModel.hasSelection() ||
56
- !this.permissions.create);
57
- }, this);
58
- }
59
- JS
60
- end
61
-
62
- client_class do |c|
63
- c.include :dup_in_form
47
+ c.include :mcfly_grid_panel
64
48
  end
65
49
 
66
50
  action :dup_in_form do |a|
@@ -0,0 +1,37 @@
1
+ {
2
+ initComponent: function () {
3
+ this.callParent();
4
+
5
+ // dup is a non standard button, so we have to explicitly manage
6
+ // its clickability
7
+ this.getSelectionModel().on('selectionchange', function (selModel) {
8
+ this.actions.dupInForm &&
9
+ this.actions.dupInForm.setDisabled(!selModel.hasSelection() ||
10
+ !this.permissions.create);
11
+ }, this);
12
+ },
13
+ // copied from basepack grid's onEditInForm
14
+ netzkeOnDupInForm: function () {
15
+ var selModel = this.getSelectionModel();
16
+ var recordId = selModel.getSelection()[0].getId();
17
+ this.netzkeLoadComponent("edit_window", {
18
+ title: "Duplicate in Form",
19
+ serverConfig: {
20
+ record_id: recordId
21
+ },
22
+ callback: function (w) {
23
+ w.show();
24
+ var form = w.items.first();
25
+ form.baseParams = {
26
+ dup: true
27
+ };
28
+ w.on('close', function () {
29
+ if (w.closeRes === "ok") {
30
+ this.store.load();
31
+ }
32
+ }, this);
33
+ },
34
+ scope: this
35
+ });
36
+ }
37
+ }
@@ -5,12 +5,7 @@ class Marty::NewPostingForm < Marty::Form
5
5
  has_marty_permissions read: :any
6
6
 
7
7
  client_class do |c|
8
- c.close_me = l(<<-JS)
9
- function() {
10
- // assume we're embedded in a window
11
- this.netzkeGetParentComponent().close();
12
- }
13
- JS
8
+ c.include :new_posting_form
14
9
  end
15
10
 
16
11
  action :apply do |a|
@@ -0,0 +1,6 @@
1
+ {
2
+ closeMe: function () {
3
+ // assume we're embedded in a window
4
+ this.netzkeGetParentComponent().close();
5
+ }
6
+ }
@@ -1,11 +1,7 @@
1
1
  # Marty's version of the Netzke Panel component.
2
2
  class Marty::Panel < Netzke::Core::Panel
3
3
  client_class do |c|
4
- c.update_body_html = l(<<-JS)
5
- function(html){
6
- this.body.update(html);
7
- }
8
- JS
4
+ c.include :panel
9
5
  end
10
6
  end
11
7
 
@@ -0,0 +1,5 @@
1
+ {
2
+ updateBodyHtml: function (html) {
3
+ this.body.update(html);
4
+ }
5
+ }
@@ -13,6 +13,10 @@ class Marty::PostingGrid < Marty::Grid
13
13
  page_size: 12})
14
14
  end
15
15
 
16
+ client_class do |c|
17
+ c.include :posting_grid
18
+ end
19
+
16
20
  # hijacking delete button
17
21
  action :delete do |a|
18
22
  a.text = "Select"
@@ -21,61 +25,6 @@ class Marty::PostingGrid < Marty::Grid
21
25
  a.disabled = true
22
26
  end
23
27
 
24
- client_class do |c|
25
- c.init_component = l(<<-JS)
26
- function() {
27
- this.callParent();
28
-
29
- this.getSelectionModel().on('selectionchange', function(selModel) {
30
- this.actions.detail &&
31
- this.actions.detail.setDisabled(!selModel.hasSelection());
32
- }, this);
33
- }
34
- JS
35
-
36
- c.detail = l(<<-JS)
37
- function() {
38
- record_id = this.getSelectionModel().getSelection()[0].getId();
39
- this.server.detail({record_id: record_id});
40
- }
41
- JS
42
-
43
- c.netzke_show_detail = l(<<-JS)
44
- function(details) {
45
- Ext.create('Ext.Window', {
46
- height: 150,
47
- minWidth: 250,
48
- autoWidth: true,
49
- modal: true,
50
- autoScroll: true,
51
- html: details,
52
- title: "Posting Details"
53
- }).show();
54
- }
55
- JS
56
-
57
- c.netzke_on_delete = l(<<-JS)
58
- function() {
59
- var records = [];
60
- var me = this;
61
- me.getSelectionModel().selected.each(function(r) {
62
- records.push(r.getId());
63
- }, me);
64
-
65
- // find the root component (main application)
66
- var main_app = me;
67
- while (1) {
68
- var p = main_app.netzkeGetParentComponent();
69
- if (!p) { break; }
70
- main_app = p;
71
- }
72
-
73
- // assumes main_app has serverSelectPosting method
74
- main_app.server.selectPosting(records);
75
- }
76
- JS
77
- end
78
-
79
28
  def default_bbar
80
29
  [:delete, :detail]
81
30
  end
@@ -0,0 +1,50 @@
1
+ {
2
+ initComponent: function () {
3
+ this.callParent();
4
+
5
+ this.getSelectionModel().on('selectionchange', function (selModel) {
6
+ this.actions.detail &&
7
+ this.actions.detail.setDisabled(!selModel.hasSelection());
8
+ }, this);
9
+ },
10
+
11
+ detail: function () {
12
+ record_id = this.getSelectionModel().getSelection()[0].getId();
13
+ this.server.detail({
14
+ record_id: record_id
15
+ });
16
+ },
17
+
18
+ netzkeShowDetail: function (details) {
19
+ Ext.create('Ext.Window', {
20
+ height: 150,
21
+ minWidth: 250,
22
+ autoWidth: true,
23
+ modal: true,
24
+ autoScroll: true,
25
+ html: details,
26
+ title: "Posting Details"
27
+ }).show();
28
+ },
29
+
30
+ netzkeOnDelete: function () {
31
+ var records = [];
32
+ var me = this;
33
+ me.getSelectionModel().selected.each(function (r) {
34
+ records.push(r.getId());
35
+ }, me);
36
+
37
+ // find the root component (main application)
38
+ var main_app = me;
39
+ while (1) {
40
+ var p = main_app.netzkeGetParentComponent();
41
+ if (!p) {
42
+ break;
43
+ }
44
+ main_app = p;
45
+ }
46
+
47
+ // assumes main_app has serverSelectPosting method
48
+ main_app.server.selectPosting(records);
49
+ }
50
+ }
@@ -5,38 +5,8 @@ class Marty::PromiseView < Netzke::Tree::Base
5
5
  config.require :promise_view
6
6
  end
7
7
 
8
- client_class do |config|
9
- config.default_get_row_class = l(<<-JS)
10
- function(record, index, rowParams, ds) {
11
- var status = record.get('status');
12
- if (status === false) return "red-row";
13
- if (status === true) return "green-row";
14
- return "orange-row";
15
- }
16
- JS
17
-
18
- config.listen_fn = l(<<-JS)
19
- function(obj, search_text) {
20
- var lg = this.ownerCt.ownerCt;
21
- lg.getStore().getProxy().extraParams.live_search = search_text;
22
- lg.getStore().load();
23
- }
24
- JS
25
-
26
- # Live search box -- direct copy from Marty::LiveSearchGridPanel
27
- config.tbar = ['->', {
28
- name: 'live_search_text',
29
- xtype: 'textfield',
30
- enable_key_events: true,
31
- ref: '../live_search_field',
32
- empty_text: 'Search',
33
- listeners: {
34
- change: {
35
- fn: config.listen_fn,
36
- buffer: 500,
37
- }
38
- }
39
- }]
8
+ client_class do |c|
9
+ c.include :promise_view
40
10
  end
41
11
 
42
12
  def configure(config)
@@ -69,49 +39,6 @@ class Marty::PromiseView < Netzke::Tree::Base
69
39
  [:clear, '->', :refresh, :download]
70
40
  end
71
41
 
72
- client_class do |config|
73
- config.init_component = l(<<-JS)
74
- function() {
75
- this.callParent();
76
- this.getSelectionModel().on('selectionchange', function(selModel) {
77
- this.actions.download &&
78
- this.actions.download.setDisabled(!selModel.hasSelection());
79
- }, this);
80
- this.getView().getRowClass = this.defaultGetRowClass;
81
- }
82
- JS
83
-
84
- config.netzke_on_download = l(<<-JS)
85
- function() {
86
- var jid = this.getSelectionModel().getSelection()[0].getId();
87
- // FIXME: seems pretty hacky
88
- window.location = "#{Marty::Util.marty_path}/job/download?job_id=" + jid;
89
- }
90
- JS
91
-
92
- config.netzke_on_refresh = l(<<-JS)
93
- function() {
94
- this.store.load();
95
- }
96
- JS
97
-
98
- config.netzke_on_clear = l(<<-JS)
99
- function(params) {
100
- var me = this;
101
- Ext.Msg.show({
102
- title: 'Clear All Jobs',
103
- msg: 'Enter CLEAR and press OK to clear all previous jobs',
104
- width: 375,
105
- buttons: Ext.Msg.OKCANCEL,
106
- prompt: true,
107
- fn: function (btn, value) {
108
- (btn == "ok" && value == "CLEAR") && me.server.clear({});
109
- }
110
- });
111
- }
112
- JS
113
- end
114
-
115
42
  action :clear do |a|
116
43
  a.text = a.tooltip = 'Clear'
117
44
  a.disabled = false
@@ -1,26 +1,29 @@
1
1
  .green-row {
2
- background-color: #91FF91;
2
+ background-color: #91FF91;
3
3
  }
4
4
 
5
5
  .red-row {
6
- background-color: #FF4545;
6
+ background-color: #FF4545;
7
7
  }
8
8
 
9
9
  .orange-row {
10
- background-color: #FF9D5C;
10
+ background-color: #FF9D5C;
11
11
  }
12
12
 
13
13
  .x-grid-item-selected .green-row {
14
- background-color: #549454; /* V: 58 */
15
- font-weight: bold;
14
+ background-color: #549454;
15
+ /* V: 58 */
16
+ font-weight: bold;
16
17
  }
17
18
 
18
19
  .x-grid-item-selected .red-row {
19
- background-color: #bd3333; /* V: 74 */
20
- font-weight: bold;
20
+ background-color: #bd3333;
21
+ /* V: 74 */
22
+ font-weight: bold;
21
23
  }
22
24
 
23
25
  .x-grid-item-selected .orange-row {
24
- background-color: #b87243; /* V: 74 */
25
- font-weight: bold;
26
+ background-color: #b87243;
27
+ /* V: 74 */
28
+ font-weight: bold;
26
29
  }
@@ -0,0 +1,57 @@
1
+ {
2
+ initComponent: function () {
3
+ var me = this;
4
+ me.tbar = ['->',
5
+ {
6
+ name: 'live_search_text',
7
+ xtype: 'textfield',
8
+ enable_key_events: true,
9
+ ref: '../live_search_field',
10
+ empty_text: 'Search',
11
+ listeners: {
12
+ change: {
13
+ fn: me.listenFn,
14
+ buffer: 500,
15
+ }
16
+ }
17
+ }
18
+ ]
19
+ this.callParent();
20
+ this.getSelectionModel().on('selectionchange', function (selModel) {
21
+ this.actions.download && this.actions.download.setDisabled(!selModel.hasSelection());
22
+ }, this);
23
+ this.getView().getRowClass = this.defaultGetRowClass;
24
+ },
25
+ defaultGetRowClass: function (record, index, rowParams, ds) {
26
+ var status = record.get('status');
27
+ if (status === false) return "red-row";
28
+ if (status === true) return "green-row";
29
+ return "orange-row";
30
+ },
31
+ listenFn: function (obj, search_text) {
32
+ var lg = this.ownerCt.ownerCt;
33
+ lg.getStore().getProxy().extraParams.live_search = search_text;
34
+ lg.getStore().load();
35
+ },
36
+ netzkeOnDownload: function () {
37
+ var jid = this.getSelectionModel().getSelection()[0].getId();
38
+ // FIXME: seems pretty hacky
39
+ window.location = "#{Marty::Util.marty_path}/job/download?job_id=" + jid;
40
+ },
41
+ netzkeOnRefresh: function () {
42
+ this.store.load();
43
+ },
44
+ netzkeOnClear: function (params) {
45
+ var me = this;
46
+ Ext.Msg.show({
47
+ title: 'Clear All Jobs',
48
+ msg: 'Enter CLEAR and press OK to clear all previous jobs',
49
+ width: 375,
50
+ buttons: Ext.Msg.OKCANCEL,
51
+ prompt: true,
52
+ fn: function (btn, value) {
53
+ (btn == "ok" && value == "CLEAR") && me.server.clear({});
54
+ }
55
+ });
56
+ }
57
+ }
@@ -98,79 +98,13 @@ class Marty::ReportForm < Marty::Form
98
98
  |r| r.app.app == Marty::Engine
99
99
  }.format({})
100
100
 
101
- c.netzke_on_foreground = l(<<-JS)
101
+ c.mount_path = l(<<-JS)
102
102
  function() {
103
- var values = this.getForm().getValues();
104
- var data = Ext.encode(values);
105
-
106
- var params = {data: data, reptitle: this.reptitle};
107
-
108
- // very hacky -- when selected_testing is set, we assume we're
109
- // testing and try to inline the result.
110
- if (values["selected_testing"]) {
111
- this.repformat = "txt";
112
- params["disposition"] = "inline";
113
- }
114
-
115
- var form = document.createElement("form");
116
-
117
- form.setAttribute("method", "post");
118
- form.setAttribute("action", "#{@@mount_path}/report."+this.repformat);
119
-
120
- // set authenticity token
121
- var hiddenField = document.createElement("input");
122
- hiddenField.setAttribute("type", "hidden");
123
- hiddenField.setAttribute("name", "authenticity_token");
124
- hiddenField.setAttribute("value", this.authenticityToken);
125
- form.appendChild(hiddenField);
126
-
127
- for (var key in params) {
128
- if (params.hasOwnProperty(key)) {
129
- var hiddenField = document.createElement("input");
130
- hiddenField.setAttribute("type", "hidden");
131
- hiddenField.setAttribute("name", key);
132
- hiddenField.setAttribute("value", params[key]);
133
-
134
- form.appendChild(hiddenField);
135
- }
136
- }
137
-
138
- document.body.appendChild(form);
139
- form.submit();
140
- document.body.removeChild(form);
103
+ return "#{@@mount_path}"
141
104
  }
142
105
  JS
143
106
 
144
- c.netzke_on_link = l(<<-JS)
145
- function() {
146
- var values = this.getForm().getValues();
147
-
148
- // check for early url generation and exit with error message
149
- if (values['selected_script_name'] == null) {
150
- alert("Please select a report before generating url.");
151
- return;
152
- }
153
-
154
- params = {
155
- "format": this.repformat,
156
- "reptitle": this.reptitle
157
- }
158
-
159
- for (var key in values) {if (values[key] == "") {delete values[key]}}
160
- data = Ext.encode(values)
161
-
162
- // construct url
163
- var proto_host = location.protocol + '//' + location.host
164
- var url = proto_host + '/report?data=' + data
165
- for (var key in params) {
166
- if (params[key] == "") continue;
167
- url += '&' + key + '=' + params[key];
168
- }
169
- url = encodeURI(url)
170
- var win = window.open('');
171
- win.document.write(url.link(url));
172
- }
173
- JS
107
+ c.include :report_form
174
108
  end
175
109
 
176
110
  endpoint :netzke_load do |params|