marty 2.4.7 → 2.4.8

Sign up to get free protection for your applications and to get access to all the features.
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
@@ -0,0 +1,146 @@
1
+ {
2
+ getComponent: function (name) {
3
+ return Ext.getCmp(name);
4
+ },
5
+
6
+ findComponent: function (name) {
7
+ return Ext.ComponentQuery.query(`[name=${name}]`)[0];
8
+ },
9
+
10
+ setDisableComponentActions: function (prefix, flag) {
11
+ for (var key in this.actions) {
12
+ if (key.substring(0, prefix.length) == prefix) {
13
+ this.actions[key].setDisabled(flag);
14
+ }
15
+ }
16
+ },
17
+
18
+ initComponent: function () {
19
+ this.dockedItems = this.dockedItems || [];
20
+ if (this.paging == 'pagination') {
21
+ this.dockedItems.push({
22
+ xtype: 'pagingtoolbar',
23
+ dock: 'bottom',
24
+ layout: {
25
+ overflowHandler: 'Menu'
26
+ },
27
+ listeners: {
28
+ 'beforechange': this.disableDirtyPageWarning ? {} : {
29
+ fn: this.netzkeBeforePageChange,
30
+ scope: this
31
+ }
32
+ },
33
+ store: this.store,
34
+ items: this.bbar && ["-"].concat(this.bbar)
35
+ });
36
+ } else if (this.bbar) {
37
+ this.dockedItems.push({
38
+ xtype: 'toolbar',
39
+ dock: 'bottom',
40
+ layout: {
41
+ overflowHandler: 'Menu'
42
+ },
43
+ items: this.bbar
44
+ });
45
+ }
46
+
47
+ // block creation of toolbars in parent
48
+ delete this.bbar;
49
+ var paging = this.paging
50
+ if (paging != 'buffered') {
51
+ this.paging = false;
52
+ }
53
+ this.callParent();
54
+ this.paging = paging
55
+
56
+ var me = this;
57
+
58
+ var children = me.serverConfig.child_components || [];
59
+ me.onSelectionChange(
60
+ function (m) {
61
+ var has_sel = m.hasSelection();
62
+
63
+ var rid = null;
64
+ if (has_sel) {
65
+ if (m.type == 'spreadsheet') {
66
+ var cell = m.getSelected().startCell;
67
+ rid = cell && cell.record.getId();
68
+ }
69
+ if (!rid) {
70
+ selected = m.getSelection()[0];
71
+ rid = selected && selected.getId();
72
+ }
73
+ }
74
+
75
+ me.serverConfig.selected = rid;
76
+ me.setDisableComponentActions('do', !has_sel);
77
+
78
+ for (var child of children) {
79
+ var comp = me.findComponent(child)
80
+ if (comp) {
81
+ comp.serverConfig.parent_id = rid;
82
+ if (comp.setDisableComponentActions) {
83
+ comp.setDisableComponentActions('parent', !has_sel);
84
+ }
85
+ if (comp.reload) {
86
+ comp.reload()
87
+ }
88
+ }
89
+ }
90
+ });
91
+
92
+ var store = me.getStore();
93
+ var linked = me.serverConfig.linked_components || [];
94
+ for (var event of ['update', 'netzkerefresh']) {
95
+ store.on(event, function () {
96
+ for (var link of linked) {
97
+ var comp = me.findComponent(link);
98
+ if (comp && comp.reload) {
99
+ comp.reload()
100
+ }
101
+ }
102
+ }, this);
103
+ }
104
+ },
105
+
106
+ onSelectionChange: function (f) {
107
+ var me = this;
108
+ me.getSelectionModel().on('selectionchange', f);
109
+ },
110
+
111
+ doViewInForm: function (record) {
112
+ this.netzkeLoadComponent("view_window", {
113
+ serverConfig: {
114
+ record_id: record.id
115
+ },
116
+ callback: function (w) {
117
+ w.show();
118
+ w.on('close', function () {
119
+ if (w.closeRes === "ok") {
120
+ this.netzkeReloadStore();
121
+ }
122
+ }, this);
123
+ }
124
+ });
125
+ },
126
+
127
+ reload: function (opts = {}) {
128
+ this.netzkeReloadStore(opts);
129
+ },
130
+
131
+ reloadAll: function () {
132
+ var me = this;
133
+ var children = me.serverConfig.child_components || [];
134
+ this.store.reload();
135
+ for (child of children) {
136
+ var comp = me.findComponent(child);
137
+ if (comp && comp.reload) {
138
+ comp.reload()
139
+ }
140
+ }
141
+ },
142
+
143
+ clearFilters: function () {
144
+ this.filters.clearFilters();
145
+ },
146
+ }
@@ -20,38 +20,7 @@ class Marty::ImportView < Marty::Form
20
20
  end
21
21
 
22
22
  client_class do |c|
23
- c.set_result = l(<<-JS)
24
- function(html) {
25
- var result = this.netzkeGetComponent('result');
26
- result.updateBodyHtml(html);
27
-
28
- var window = this.netzkeGetParentComponent();
29
- var parent_view = window.netzkeGetParentComponent();
30
-
31
- if (parent_view && parent_view.reload) { parent_view.reload() }
32
- }
33
- JS
34
-
35
- c.init_component = l(<<-JS)
36
- function() {
37
- var me = this;
38
- me.callParent();
39
- var form = me.getForm();
40
-
41
- var window = this.netzkeGetParentComponent();
42
- var parent_view = window.netzkeGetParentComponent();
43
-
44
- this.serverConfig.parent_id = parent_view.serverConfig.parent_id ||
45
- parent_view.serverConfig.selected;
46
-
47
- var textname = form.findField('import_data');
48
- var importbutton = me.actions["apply"].items[0];
49
-
50
- importbutton.on('click', function(t, e, ops) {
51
- me.netzkeGetComponent('result').updateBodyHtml('');
52
- });
53
- }
54
- JS
23
+ c.include :import_view
55
24
  end
56
25
 
57
26
  ######################################################################
@@ -0,0 +1,32 @@
1
+ {
2
+ initComponent: function () {
3
+ var me = this;
4
+ me.callParent();
5
+ var form = me.getForm();
6
+
7
+ var window = this.netzkeGetParentComponent();
8
+ var parent_view = window.netzkeGetParentComponent();
9
+
10
+ this.serverConfig.parent_id = parent_view.serverConfig.parent_id ||
11
+ parent_view.serverConfig.selected;
12
+
13
+ var textname = form.findField('import_data');
14
+ var importbutton = me.actions["apply"].items[0];
15
+
16
+ importbutton.on('click', function (t, e, ops) {
17
+ me.netzkeGetComponent('result').updateBodyHtml('');
18
+ });
19
+ },
20
+
21
+ setResult: function (html) {
22
+ var result = this.netzkeGetComponent('result');
23
+ result.updateBodyHtml(html);
24
+
25
+ var window = this.netzkeGetParentComponent();
26
+ var parent_view = window.netzkeGetParentComponent();
27
+
28
+ if (parent_view && parent_view.reload) {
29
+ parent_view.reload()
30
+ }
31
+ }
32
+ }
@@ -14,27 +14,7 @@
14
14
 
15
15
  class Marty::LiveSearchGridPanel < Marty::McflyGridPanel
16
16
  client_class do |c|
17
- c.listen_fn = l(<<-JS)
18
- function(obj, search_text) {
19
- var lg = this.ownerCt.ownerCt;
20
- lg.getStore().getProxy().extraParams.live_search = search_text;
21
- lg.getStore().load();
22
- }
23
- JS
24
-
25
- c.tbar = ['->', {
26
- name: 'live_search_text',
27
- xtype: 'textfield',
28
- enable_key_events: true,
29
- ref: '../live_search_field',
30
- empty_text: 'Search',
31
- listeners: {
32
- change: {
33
- fn: c.listen_fn,
34
- buffer: 100,
35
- }
36
- }
37
- }]
17
+ c.include :live_search_grid_panel
38
18
  end
39
19
 
40
20
  def get_records(params)
@@ -0,0 +1,27 @@
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
+ },
21
+
22
+ listenFn: function (obj, search_text) {
23
+ var lg = this.ownerCt.ownerCt;
24
+ lg.getStore().getProxy().extraParams.live_search = search_text;
25
+ lg.getStore().load();
26
+ }
27
+ }
@@ -16,6 +16,10 @@ class Marty::MainAuthApp < Marty::AuthApp
16
16
  extend ::Marty::Permissions
17
17
  include Marty::Extras::Misc
18
18
 
19
+ client_class do |c|
20
+ c.include :main_auth_app
21
+ end
22
+
19
23
  # set of posting types user is allowed to post with
20
24
  def self.has_posting_perm?
21
25
  Marty::NewPostingForm.has_any_perm?
@@ -339,151 +343,6 @@ class Marty::MainAuthApp < Marty::AuthApp
339
343
  a.disabled = Marty::Util.warped? || !self.class.has_posting_perm?
340
344
  end
341
345
 
342
- client_class do |c|
343
- c.show_detail = l(<<-JS)
344
- function(details, title) {
345
- this.hideLoadmask();
346
- Ext.create('Ext.Window', {
347
- height: 400,
348
- minWidth: 400,
349
- maxWidth: 1200,
350
- autoWidth: true,
351
- modal: true,
352
- autoScroll: true,
353
- html: details,
354
- title: title || "Details"
355
- }).show();
356
- }
357
- JS
358
-
359
- c.show_loadmask = l(<<-JS)
360
- function(msg) {
361
- this.maskCmp = new Ext.LoadMask( {
362
- msg: msg || 'Loading...',
363
- target: this,
364
- });
365
- this.maskCmp.show();
366
- }
367
- JS
368
-
369
- c.hide_loadmask = l(<<-JS)
370
- function() {
371
- if (this.maskCmp) { this.maskCmp.hide(); };
372
- }
373
- JS
374
-
375
- c.netzke_on_new_posting = l(<<-JS)
376
- function(params) {
377
- this.netzkeLoadComponent("new_posting_window",
378
- { callback: function(w) { w.show(); },
379
- });
380
- }
381
- JS
382
-
383
- c.netzke_on_select_posting = l(<<-JS)
384
- function(params) {
385
- this.netzkeLoadComponent("posting_window",
386
- { callback: function(w) { w.show(); },
387
- });
388
- }
389
- JS
390
-
391
- c.netzke_on_reload = l(<<-JS)
392
- function(params) {
393
- window.location.reload();
394
- }
395
- JS
396
-
397
- c.netzke_on_load_seed = l(<<-JS)
398
- function(params) {
399
- this.server.loadSeed({});
400
- }
401
- JS
402
-
403
- c.netzke_on_select_now = l(<<-JS)
404
- function(params) {
405
- this.server.selectPosting({});
406
- }
407
- JS
408
-
409
- c.netzke_on_reload_scripts = l(<<-JS)
410
- function(params) {
411
- var me = this;
412
- Ext.Msg.show({
413
- title: 'Reload Scripts',
414
- msg: 'Enter RELOAD and press OK to force a reload of all scripts',
415
- width: 375,
416
- buttons: Ext.Msg.OKCANCEL,
417
- prompt: true,
418
- fn: function (btn, value) {
419
- btn == "ok" && value == "RELOAD" && me.server.reloadScripts({});
420
- }
421
- });
422
- }
423
- JS
424
-
425
- c.netzke_on_bg_stop = l(<<-JS)
426
- function(params) {
427
- var me = this;
428
- Ext.Msg.show({
429
- title: 'Stop Delayed Jobs',
430
- msg: 'Enter STOP and press OK to force a stop of delayed_job',
431
- width: 375,
432
- buttons: Ext.Msg.OKCANCEL,
433
- prompt: true,
434
- fn: function (btn, value) {
435
- if (btn == "ok" && value == "STOP") {
436
- me.showLoadmask('Stopping delayed job...');
437
- me.server.bgStop({});
438
- }
439
- }
440
- });
441
- }
442
- JS
443
-
444
- c.netzke_on_bg_restart = l(<<-JS)
445
- function(params) {
446
- var me = this;
447
- Ext.Msg.show({
448
- title: 'Restart Delayed Jobs',
449
- msg: 'Enter RESTART and press OK to force a restart of delayed_job',
450
- width: 375,
451
- buttons: Ext.Msg.OKCANCEL,
452
- prompt: true,
453
- fn: function (btn, value) {
454
- if (btn == "ok" && value == "RESTART") {
455
- me.showLoadmask('Restarting delayed job...');
456
- me.server.bgRestart({});
457
- }
458
- }
459
- });
460
- }
461
- JS
462
-
463
- c.netzke_on_bg_status = l(<<-JS)
464
- function() {
465
- this.showLoadmask('Checking delayed job status...');
466
- this.server.bgStatus({});
467
- }
468
- JS
469
-
470
- c.netzke_on_log_cleanup = l(<<-JS)
471
- function(params) {
472
- var me = this;
473
- Ext.Msg.show({
474
- title: 'Log Cleanup',
475
- msg: 'Enter number of days to keep',
476
- width: 375,
477
- buttons: Ext.Msg.OKCANCEL,
478
- prompt: true,
479
- fn: function (btn, value) {
480
- btn == "ok" && me.server.logCleanup(value);
481
- }
482
- });
483
- }
484
- JS
485
- end
486
-
487
346
  action :select_posting do |a|
488
347
  a.text = I18n.t('select_posting')
489
348
  a.tooltip = I18n.t('select_posting')
@@ -0,0 +1,124 @@
1
+ {
2
+ showDetail: function (details, title) {
3
+ this.hideLoadmask();
4
+ Ext.create('Ext.Window', {
5
+ height: 400,
6
+ minWidth: 400,
7
+ maxWidth: 1200,
8
+ autoWidth: true,
9
+ modal: true,
10
+ autoScroll: true,
11
+ html: details,
12
+ title: title || "Details"
13
+ }).show();
14
+ },
15
+
16
+ showLoadMask: function (msg) {
17
+ this.maskCmp = new Ext.LoadMask({
18
+ msg: msg || 'Loading...',
19
+ target: this,
20
+ });
21
+ this.maskCmp.show();
22
+ },
23
+
24
+ hideLoadMask: function () {
25
+ if (this.maskCmp) {
26
+ this.maskCmp.hide();
27
+ };
28
+ },
29
+
30
+ netzkeOnNewPosting: function (params) {
31
+ this.netzkeLoadComponent("new_posting_window", {
32
+ callback: function (w) {
33
+ w.show();
34
+ },
35
+ });
36
+ },
37
+
38
+ netzkeOnSelectPosting: function (params) {
39
+ this.netzkeLoadComponent("posting_window", {
40
+ callback: function (w) {
41
+ w.show();
42
+ },
43
+ });
44
+ },
45
+
46
+ netzkeOnReload: function (params) {
47
+ window.location.reload();
48
+ },
49
+
50
+ netzkeOnLoadSeed: function (params) {
51
+ this.server.loadSeed({});
52
+ },
53
+
54
+ netzkeOnSelectNow: function (params) {
55
+ this.server.selectPosting({});
56
+ },
57
+
58
+ netzkeOnReloadScripts: function (params) {
59
+ var me = this;
60
+ Ext.Msg.show({
61
+ title: 'Reload Scripts',
62
+ msg: 'Enter RELOAD and press OK to force a reload of all scripts',
63
+ width: 375,
64
+ buttons: Ext.Msg.OKCANCEL,
65
+ prompt: true,
66
+ fn: function (btn, value) {
67
+ btn == "ok" && value == "RELOAD" && me.server.reloadScripts({});
68
+ }
69
+ });
70
+ },
71
+
72
+ netzkeOnBgStop: function (params) {
73
+ var me = this;
74
+ Ext.Msg.show({
75
+ title: 'Stop Delayed Jobs',
76
+ msg: 'Enter STOP and press OK to force a stop of delayed_job',
77
+ width: 375,
78
+ buttons: Ext.Msg.OKCANCEL,
79
+ prompt: true,
80
+ fn: function (btn, value) {
81
+ if (btn == "ok" && value == "STOP") {
82
+ me.showLoadmask('Stopping delayed job...');
83
+ me.server.bgStop({});
84
+ }
85
+ }
86
+ });
87
+ },
88
+
89
+ netzkeOnBgRestart: function (params) {
90
+ var me = this;
91
+ Ext.Msg.show({
92
+ title: 'Restart Delayed Jobs',
93
+ msg: 'Enter RESTART and press OK to force a restart of delayed_job',
94
+ width: 375,
95
+ buttons: Ext.Msg.OKCANCEL,
96
+ prompt: true,
97
+ fn: function (btn, value) {
98
+ if (btn == "ok" && value == "RESTART") {
99
+ me.showLoadmask('Restarting delayed job...');
100
+ me.server.bgRestart({});
101
+ }
102
+ }
103
+ });
104
+ },
105
+
106
+ netzkeOnBgStatus: function () {
107
+ this.showLoadmask('Checking delayed job status...');
108
+ this.server.bgStatus({});
109
+ },
110
+
111
+ netzkeOnLogCleanup: function (params) {
112
+ var me = this;
113
+ Ext.Msg.show({
114
+ title: 'Log Cleanup',
115
+ msg: 'Enter number of days to keep',
116
+ width: 375,
117
+ buttons: Ext.Msg.OKCANCEL,
118
+ prompt: true,
119
+ fn: function (btn, value) {
120
+ btn == "ok" && me.server.logCleanup(value);
121
+ }
122
+ });
123
+ }
124
+ }