marty 0.5.41 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (205) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +3 -2
  3. data/app/components/marty/api_auth_view.rb +5 -8
  4. data/app/components/marty/auth_app.rb +8 -9
  5. data/app/components/marty/auth_app/{javascripts → client}/auth_app.js +4 -4
  6. data/app/components/marty/config_view.rb +7 -9
  7. data/app/components/marty/extras/misc.rb +14 -1
  8. data/app/components/marty/form.rb +1 -1
  9. data/app/components/marty/grid.rb +27 -14
  10. data/app/components/marty/grid_append_only.rb +3 -5
  11. data/app/components/marty/import_type_view.rb +8 -11
  12. data/app/components/marty/live_search_grid_panel.rb +3 -3
  13. data/app/components/marty/main_auth_app.rb +17 -19
  14. data/app/components/marty/mcfly_grid_panel.rb +13 -15
  15. data/app/components/marty/new_posting_form.rb +5 -5
  16. data/app/components/marty/new_posting_window.rb +1 -1
  17. data/app/components/marty/panel.rb +2 -2
  18. data/app/components/marty/posting_grid.rb +19 -28
  19. data/app/components/marty/posting_window.rb +6 -7
  20. data/app/components/marty/promise_view.rb +23 -24
  21. data/app/components/marty/promise_view/{stylesheets → client}/promise_view.css +0 -0
  22. data/app/components/marty/report_form.rb +11 -10
  23. data/app/components/marty/report_select.rb +17 -15
  24. data/app/components/marty/reporting.rb +2 -2
  25. data/app/components/marty/script_form.rb +34 -38
  26. data/app/components/marty/script_form/{javascripts → client}/Ext.ux.form.field.CodeMirror.js +0 -0
  27. data/app/components/marty/script_form/{stylesheets → client}/codemirror.css +0 -0
  28. data/app/components/marty/script_form/{javascripts → client}/codemirror.js +0 -0
  29. data/app/components/marty/script_form/{stylesheets → client}/delorean.css +0 -0
  30. data/app/components/marty/script_form/{javascripts → client}/mode/clike/clike.js +0 -0
  31. data/app/components/marty/script_form/{javascripts → client}/mode/clike/index.html +0 -0
  32. data/app/components/marty/script_form/{javascripts → client}/mode/clike/scala.html +0 -0
  33. data/app/components/marty/script_form/{javascripts → client}/mode/clojure/clojure.js +0 -0
  34. data/app/components/marty/script_form/{javascripts → client}/mode/clojure/index.html +0 -0
  35. data/app/components/marty/script_form/{javascripts → client}/mode/coffeescript/LICENSE +0 -0
  36. data/app/components/marty/script_form/{javascripts → client}/mode/coffeescript/coffeescript.js +0 -0
  37. data/app/components/marty/script_form/{javascripts → client}/mode/coffeescript/index.html +0 -0
  38. data/app/components/marty/script_form/{javascripts → client}/mode/commonlisp/commonlisp.js +0 -0
  39. data/app/components/marty/script_form/{javascripts → client}/mode/commonlisp/index.html +0 -0
  40. data/app/components/marty/script_form/{javascripts → client}/mode/css/css.js +0 -0
  41. data/app/components/marty/script_form/{javascripts → client}/mode/css/index.html +0 -0
  42. data/app/components/marty/script_form/{javascripts → client}/mode/css/test.js +0 -0
  43. data/app/components/marty/script_form/{javascripts → client}/mode/delorean/delorean.js +0 -0
  44. data/app/components/marty/script_form/{javascripts → client}/mode/diff/diff.js +0 -0
  45. data/app/components/marty/script_form/{javascripts → client}/mode/diff/index.html +0 -0
  46. data/app/components/marty/script_form/{javascripts → client}/mode/ecl/ecl.js +0 -0
  47. data/app/components/marty/script_form/{javascripts → client}/mode/ecl/index.html +0 -0
  48. data/app/components/marty/script_form/{javascripts → client}/mode/erlang/erlang.js +0 -0
  49. data/app/components/marty/script_form/{javascripts → client}/mode/erlang/index.html +0 -0
  50. data/app/components/marty/script_form/{javascripts → client}/mode/gfm/gfm.js +0 -0
  51. data/app/components/marty/script_form/{javascripts → client}/mode/gfm/index.html +0 -0
  52. data/app/components/marty/script_form/{javascripts → client}/mode/go/go.js +0 -0
  53. data/app/components/marty/script_form/{javascripts → client}/mode/go/index.html +0 -0
  54. data/app/components/marty/script_form/{javascripts → client}/mode/groovy/groovy.js +0 -0
  55. data/app/components/marty/script_form/{javascripts → client}/mode/groovy/index.html +0 -0
  56. data/app/components/marty/script_form/{javascripts → client}/mode/haskell/haskell.js +0 -0
  57. data/app/components/marty/script_form/{javascripts → client}/mode/haskell/index.html +0 -0
  58. data/app/components/marty/script_form/{javascripts → client}/mode/haxe/haxe.js +0 -0
  59. data/app/components/marty/script_form/{javascripts → client}/mode/haxe/index.html +0 -0
  60. data/app/components/marty/script_form/{javascripts → client}/mode/htmlembedded/htmlembedded.js +0 -0
  61. data/app/components/marty/script_form/{javascripts → client}/mode/htmlembedded/index.html +0 -0
  62. data/app/components/marty/script_form/{javascripts → client}/mode/htmlmixed/htmlmixed.js +0 -0
  63. data/app/components/marty/script_form/{javascripts → client}/mode/htmlmixed/index.html +0 -0
  64. data/app/components/marty/script_form/{javascripts → client}/mode/javascript/index.html +0 -0
  65. data/app/components/marty/script_form/{javascripts → client}/mode/javascript/javascript.js +0 -0
  66. data/app/components/marty/script_form/{javascripts → client}/mode/jinja2/index.html +0 -0
  67. data/app/components/marty/script_form/{javascripts → client}/mode/jinja2/jinja2.js +0 -0
  68. data/app/components/marty/script_form/{javascripts → client}/mode/less/index.html +0 -0
  69. data/app/components/marty/script_form/{javascripts → client}/mode/less/less.js +0 -0
  70. data/app/components/marty/script_form/{javascripts → client}/mode/lua/index.html +0 -0
  71. data/app/components/marty/script_form/{javascripts → client}/mode/lua/lua.js +0 -0
  72. data/app/components/marty/script_form/{javascripts → client}/mode/markdown/index.html +0 -0
  73. data/app/components/marty/script_form/{javascripts → client}/mode/markdown/markdown.js +0 -0
  74. data/app/components/marty/script_form/{javascripts → client}/mode/markdown/test.js +0 -0
  75. data/app/components/marty/script_form/{javascripts → client}/mode/mysql/index.html +0 -0
  76. data/app/components/marty/script_form/{javascripts → client}/mode/mysql/mysql.js +0 -0
  77. data/app/components/marty/script_form/{javascripts → client}/mode/ntriples/index.html +0 -0
  78. data/app/components/marty/script_form/{javascripts → client}/mode/ntriples/ntriples.js +0 -0
  79. data/app/components/marty/script_form/{javascripts → client}/mode/ocaml/index.html +0 -0
  80. data/app/components/marty/script_form/{javascripts → client}/mode/ocaml/ocaml.js +0 -0
  81. data/app/components/marty/script_form/{javascripts → client}/mode/pascal/LICENSE +0 -0
  82. data/app/components/marty/script_form/{javascripts → client}/mode/pascal/index.html +0 -0
  83. data/app/components/marty/script_form/{javascripts → client}/mode/pascal/pascal.js +0 -0
  84. data/app/components/marty/script_form/{javascripts → client}/mode/perl/LICENSE +0 -0
  85. data/app/components/marty/script_form/{javascripts → client}/mode/perl/index.html +0 -0
  86. data/app/components/marty/script_form/{javascripts → client}/mode/perl/perl.js +0 -0
  87. data/app/components/marty/script_form/{javascripts → client}/mode/php/index.html +0 -0
  88. data/app/components/marty/script_form/{javascripts → client}/mode/php/php.js +0 -0
  89. data/app/components/marty/script_form/{javascripts → client}/mode/pig/index.html +0 -0
  90. data/app/components/marty/script_form/{javascripts → client}/mode/pig/pig.js +0 -0
  91. data/app/components/marty/script_form/{javascripts → client}/mode/plsql/index.html +0 -0
  92. data/app/components/marty/script_form/{javascripts → client}/mode/plsql/plsql.js +0 -0
  93. data/app/components/marty/script_form/{javascripts → client}/mode/properties/index.html +0 -0
  94. data/app/components/marty/script_form/{javascripts → client}/mode/properties/properties.js +0 -0
  95. data/app/components/marty/script_form/{javascripts → client}/mode/python/LICENSE.txt +0 -0
  96. data/app/components/marty/script_form/{javascripts → client}/mode/python/index.html +0 -0
  97. data/app/components/marty/script_form/{javascripts → client}/mode/python/python.js +0 -0
  98. data/app/components/marty/script_form/{javascripts → client}/mode/r/LICENSE +0 -0
  99. data/app/components/marty/script_form/{javascripts → client}/mode/r/index.html +0 -0
  100. data/app/components/marty/script_form/{javascripts → client}/mode/r/r.js +0 -0
  101. data/app/components/marty/script_form/{javascripts → client}/mode/rpm/changes/changes.js +0 -0
  102. data/app/components/marty/script_form/{javascripts → client}/mode/rpm/changes/index.html +0 -0
  103. data/app/components/marty/script_form/{javascripts → client}/mode/rpm/spec/index.html +0 -0
  104. data/app/components/marty/script_form/{javascripts → client}/mode/rpm/spec/spec.css +0 -0
  105. data/app/components/marty/script_form/{javascripts → client}/mode/rpm/spec/spec.js +0 -0
  106. data/app/components/marty/script_form/{javascripts → client}/mode/rst/index.html +0 -0
  107. data/app/components/marty/script_form/{javascripts → client}/mode/rst/rst.js +0 -0
  108. data/app/components/marty/script_form/{javascripts → client}/mode/ruby/LICENSE +0 -0
  109. data/app/components/marty/script_form/{javascripts → client}/mode/ruby/index.html +0 -0
  110. data/app/components/marty/script_form/{javascripts → client}/mode/ruby/ruby.js +0 -0
  111. data/app/components/marty/script_form/{javascripts → client}/mode/rust/index.html +0 -0
  112. data/app/components/marty/script_form/{javascripts → client}/mode/rust/rust.js +0 -0
  113. data/app/components/marty/script_form/{javascripts → client}/mode/scheme/index.html +0 -0
  114. data/app/components/marty/script_form/{javascripts → client}/mode/scheme/scheme.js +0 -0
  115. data/app/components/marty/script_form/{javascripts → client}/mode/shell/index.html +0 -0
  116. data/app/components/marty/script_form/{javascripts → client}/mode/shell/shell.js +0 -0
  117. data/app/components/marty/script_form/{javascripts → client}/mode/sieve/LICENSE +0 -0
  118. data/app/components/marty/script_form/{javascripts → client}/mode/sieve/index.html +0 -0
  119. data/app/components/marty/script_form/{javascripts → client}/mode/sieve/sieve.js +0 -0
  120. data/app/components/marty/script_form/{javascripts → client}/mode/smalltalk/index.html +0 -0
  121. data/app/components/marty/script_form/{javascripts → client}/mode/smalltalk/smalltalk.js +0 -0
  122. data/app/components/marty/script_form/{javascripts → client}/mode/smarty/index.html +0 -0
  123. data/app/components/marty/script_form/{javascripts → client}/mode/smarty/smarty.js +0 -0
  124. data/app/components/marty/script_form/{javascripts → client}/mode/sparql/index.html +0 -0
  125. data/app/components/marty/script_form/{javascripts → client}/mode/sparql/sparql.js +0 -0
  126. data/app/components/marty/script_form/{javascripts → client}/mode/stex/index.html +0 -0
  127. data/app/components/marty/script_form/{javascripts → client}/mode/stex/stex.js +0 -0
  128. data/app/components/marty/script_form/{javascripts → client}/mode/stex/test.js +0 -0
  129. data/app/components/marty/script_form/{javascripts → client}/mode/tiddlywiki/index.html +0 -0
  130. data/app/components/marty/script_form/{javascripts → client}/mode/tiddlywiki/tiddlywiki.css +0 -0
  131. data/app/components/marty/script_form/{javascripts → client}/mode/tiddlywiki/tiddlywiki.js +0 -0
  132. data/app/components/marty/script_form/{javascripts → client}/mode/tiki/index.html +0 -0
  133. data/app/components/marty/script_form/{javascripts → client}/mode/tiki/tiki.css +0 -0
  134. data/app/components/marty/script_form/{javascripts → client}/mode/tiki/tiki.js +0 -0
  135. data/app/components/marty/script_form/{javascripts → client}/mode/vb/LICENSE.txt +0 -0
  136. data/app/components/marty/script_form/{javascripts → client}/mode/vb/index.html +0 -0
  137. data/app/components/marty/script_form/{javascripts → client}/mode/vb/vb.js +0 -0
  138. data/app/components/marty/script_form/{javascripts → client}/mode/vbscript/index.html +0 -0
  139. data/app/components/marty/script_form/{javascripts → client}/mode/vbscript/vbscript.js +0 -0
  140. data/app/components/marty/script_form/{javascripts → client}/mode/velocity/index.html +0 -0
  141. data/app/components/marty/script_form/{javascripts → client}/mode/velocity/velocity.js +0 -0
  142. data/app/components/marty/script_form/{javascripts → client}/mode/verilog/index.html +0 -0
  143. data/app/components/marty/script_form/{javascripts → client}/mode/verilog/verilog.js +0 -0
  144. data/app/components/marty/script_form/{javascripts → client}/mode/xml/index.html +0 -0
  145. data/app/components/marty/script_form/{javascripts → client}/mode/xml/xml.js +0 -0
  146. data/app/components/marty/script_form/{javascripts → client}/mode/xquery/LICENSE +0 -0
  147. data/app/components/marty/script_form/{javascripts → client}/mode/xquery/index.html +0 -0
  148. data/app/components/marty/script_form/{javascripts → client}/mode/xquery/test/index.html +0 -0
  149. data/app/components/marty/script_form/{javascripts → client}/mode/xquery/test/testBase.js +0 -0
  150. data/app/components/marty/script_form/{javascripts → client}/mode/xquery/test/testEmptySequenceKeyword.js +0 -0
  151. data/app/components/marty/script_form/{javascripts → client}/mode/xquery/test/testMultiAttr.js +0 -0
  152. data/app/components/marty/script_form/{javascripts → client}/mode/xquery/test/testNamespaces.js +0 -0
  153. data/app/components/marty/script_form/{javascripts → client}/mode/xquery/test/testProcessingInstructions.js +0 -0
  154. data/app/components/marty/script_form/{javascripts → client}/mode/xquery/test/testQuotes.js +0 -0
  155. data/app/components/marty/script_form/{javascripts → client}/mode/xquery/xquery.js +0 -0
  156. data/app/components/marty/script_form/{javascripts → client}/mode/yaml/index.html +0 -0
  157. data/app/components/marty/script_form/{javascripts → client}/mode/yaml/yaml.js +0 -0
  158. data/app/components/marty/script_form/{stylesheets → client}/theme/ambiance.css +0 -0
  159. data/app/components/marty/script_form/{stylesheets → client}/theme/blackboard.css +0 -0
  160. data/app/components/marty/script_form/{stylesheets → client}/theme/cobalt.css +0 -0
  161. data/app/components/marty/script_form/{stylesheets → client}/theme/eclipse.css +0 -0
  162. data/app/components/marty/script_form/{stylesheets → client}/theme/elegant.css +0 -0
  163. data/app/components/marty/script_form/{stylesheets → client}/theme/erlang-dark.css +0 -0
  164. data/app/components/marty/script_form/{stylesheets → client}/theme/lesser-dark.css +0 -0
  165. data/app/components/marty/script_form/{stylesheets → client}/theme/monokai.css +0 -0
  166. data/app/components/marty/script_form/{stylesheets → client}/theme/neat.css +0 -0
  167. data/app/components/marty/script_form/{stylesheets → client}/theme/night.css +0 -0
  168. data/app/components/marty/script_form/{stylesheets → client}/theme/rubyblue.css +0 -0
  169. data/app/components/marty/script_form/{stylesheets → client}/theme/vibrant-ink.css +0 -0
  170. data/app/components/marty/script_form/{stylesheets → client}/theme/xq-dark.css +0 -0
  171. data/app/components/marty/script_form/{javascripts → client}/util/closetag.js +0 -0
  172. data/app/components/marty/script_form/{javascripts → client}/util/dialog.css +0 -0
  173. data/app/components/marty/script_form/{javascripts → client}/util/dialog.js +0 -0
  174. data/app/components/marty/script_form/{javascripts → client}/util/foldcode.js +0 -0
  175. data/app/components/marty/script_form/{javascripts → client}/util/formatting.js +0 -0
  176. data/app/components/marty/script_form/{javascripts → client}/util/javascript-hint.js +0 -0
  177. data/app/components/marty/script_form/{javascripts → client}/util/loadmode.js +0 -0
  178. data/app/components/marty/script_form/{javascripts → client}/util/match-highlighter.js +0 -0
  179. data/app/components/marty/script_form/{javascripts → client}/util/multiplex.js +0 -0
  180. data/app/components/marty/script_form/{javascripts → client}/util/overlay.js +0 -0
  181. data/app/components/marty/script_form/{javascripts → client}/util/pig-hint.js +0 -0
  182. data/app/components/marty/script_form/{javascripts → client}/util/runmode-standalone.js +0 -0
  183. data/app/components/marty/script_form/{javascripts → client}/util/runmode.js +0 -0
  184. data/app/components/marty/script_form/{javascripts → client}/util/search.js +0 -0
  185. data/app/components/marty/script_form/{javascripts → client}/util/searchcursor.js +0 -0
  186. data/app/components/marty/script_form/{javascripts → client}/util/simple-hint.css +0 -0
  187. data/app/components/marty/script_form/{javascripts → client}/util/simple-hint.js +0 -0
  188. data/app/components/marty/script_form/{javascripts → client}/util/xml-hint.js +0 -0
  189. data/app/components/marty/script_grid.rb +24 -32
  190. data/app/components/marty/script_tester.rb +11 -11
  191. data/app/components/marty/scripting.rb +12 -12
  192. data/app/components/marty/simple_app.rb +2 -2
  193. data/app/components/marty/simple_app/{javascripts → client}/simple_app.js +0 -0
  194. data/app/components/marty/simple_app/{javascripts → client}/statusbar_ext.js +0 -0
  195. data/app/components/marty/tag_grid.rb +15 -21
  196. data/app/components/marty/user_view.rb +41 -57
  197. data/lib/marty/monkey.rb +1 -1
  198. data/lib/marty/version.rb +1 -1
  199. data/marty.gemspec +3 -2
  200. data/spec/dummy/app/assets/{stylesheets → client}/application.css +0 -0
  201. data/spec/dummy/app/assets/client/application.js +15 -0
  202. data/spec/features/scripting_spec.rb +17 -0
  203. data/spec/features/user_view_spec.rb +15 -15
  204. data/spec/spec_helper.rb +9 -0
  205. metadata +189 -174
@@ -9,16 +9,10 @@ class Marty::ScriptGrid < Marty::Grid
9
9
  super
10
10
 
11
11
  c.model = "Marty::Script"
12
- c.enable_extended_search = false
13
12
  c.multi_select = false
14
-
15
- c.columns ||= [:name, :created_dt, :tag]
13
+ c.attributes ||= [:name, :created_dt, :tag]
16
14
  c.title ||= I18n.t('scripts', default: "Scripts")
17
-
18
- c.data_store.sorters = {
19
- property: :name,
20
- direction: 'ASC',
21
- }
15
+ c.store_config.merge!({sorters: [{property: :name, direction: 'ASC'}]})
22
16
  end
23
17
 
24
18
  def get_records(params)
@@ -29,90 +23,88 @@ class Marty::ScriptGrid < Marty::Grid
29
23
  # if there are no non-DEV tags we get an exception above
30
24
  ts = 'infinity'
31
25
  end
32
- tb = data_class.table_name
33
- data_class.where("#{tb}.obsoleted_dt >= ? AND #{tb}.created_dt < ?",
26
+
27
+ tb = model.table_name
28
+ model.where("#{tb}.obsoleted_dt >= ? AND #{tb}.created_dt < ?",
34
29
  ts, ts).scoping do
35
30
  super
36
31
  end
37
32
  end
38
33
 
39
- action :del do |a|
34
+ action :delete do |a|
40
35
  a.text = I18n.t("script_grid.delete")
41
36
  a.tooltip = I18n.t("script_grid.delete")
42
37
  a.icon = :script_delete
43
38
  a.disabled = config[:prohibit_delete]
44
39
  end
45
40
 
46
- endpoint :server_delete do |params, this|
47
- return this.netzke_feedback("Permission Denied") if
48
- config[:prohibit_delete]
41
+ endpoint :destroy do |params|
42
+ return client.netzke_notify("Permission Denied") if
43
+ !config[:permissions][:delete]
49
44
 
50
45
  tag = Marty::Tag.map_to_tag(root_sess[:selected_tag_id])
51
46
 
52
- return this.netzke_feedback("Can only delete in DEV tag") unless
47
+ return client.netzke_notify("Can only delete in DEV tag") unless
53
48
  tag && tag.isdev?
54
49
 
55
- super(params, this)
50
+ super(params)
56
51
  end
57
52
 
58
53
  # override the add_in_form endpoint. Script creation needs to use
59
54
  # the create_script method.
60
- endpoint :add_window__add_form__netzke_submit do |params, this|
55
+ endpoint :add_window__add_form__submit do |params|
61
56
  data = ActiveSupport::JSON.decode(params[:data])
62
57
 
63
- return this.netzke_feedback("Permission Denied") if
64
- config[:prohibit_create]
58
+ return client.netzke_notify("Permission Denied") if
59
+ !config[:permissions][:create]
65
60
 
66
61
  tag = Marty::Tag.map_to_tag(root_sess[:selected_tag_id])
67
62
 
68
- return this.netzke_feedback("Can only add in DEV tag") unless
63
+ return client.netzke_notify("Can only add in DEV tag") unless
69
64
  tag && tag.isdev?
70
65
 
71
66
  name = data["name"]
72
67
  script = Marty::Script.create_script(name, "# Script #{name}")
73
68
 
74
69
  if script.valid?
75
- this.success = true
76
- return this.on_submit_success
70
+ client.success = true
71
+ return client.netzke_on_submit_success
77
72
  end
78
73
 
79
- data_adapter.errors_array(script).each do |error|
80
- flash :error => error
81
- end
82
- this.netzke_feedback(@flash)
74
+ client.netzke_notify(model_adapter.errors_array(script).join("\n"))
83
75
  end
84
76
 
85
77
  action :add_in_form do |a|
86
78
  a.text = I18n.t("script_grid.new")
87
79
  a.tooltip = I18n.t("script_grid.new")
88
80
  a.icon = :script_add
89
- a.disabled = config[:prohibit_create]
81
+ a.disabled = !config[:permissions][:create]
90
82
  end
91
83
 
92
84
  def default_bbar
93
- [:add_in_form, :del]
85
+ [:add_in_form, :delete]
94
86
  end
95
87
 
96
88
  def default_context_menu
97
89
  []
98
90
  end
99
91
 
100
- def default_fields_for_forms
92
+ def default_form_items
101
93
  [:name]
102
94
  end
103
95
 
104
- column :name do |c|
96
+ attribute :name do |c|
105
97
  c.flex = 1
106
98
  c.text = I18n.t("script_grid.name")
107
99
  end
108
100
 
109
- column :created_dt do |c|
101
+ attribute :created_dt do |c|
110
102
  c.text = I18n.t("script_grid.created_dt")
111
103
  c.format = "Y-m-d H:i"
112
104
  c.read_only = true
113
105
  end
114
106
 
115
- column :tag do |c|
107
+ attribute :tag do |c|
116
108
  c.text = I18n.t("script_grid.tag")
117
109
  c.flex = 1
118
110
  c.getter = lambda { |r| r.find_tag.try(:name) }
@@ -9,7 +9,7 @@ class Marty::ScriptTester < Marty::Form
9
9
  fieldset(I18n.t("script_tester.attributes"),
10
10
  {
11
11
  name: "attrs",
12
- attr_type: :text,
12
+ xtype: :textarea,
13
13
  value: "",
14
14
  hide_label: true,
15
15
  min_height: 125,
@@ -19,7 +19,7 @@ class Marty::ScriptTester < Marty::Form
19
19
  fieldset(I18n.t("script_tester.parameters"),
20
20
  {
21
21
  name: "params",
22
- attr_type: :text,
22
+ xtype: :textarea,
23
23
  value: "",
24
24
  hide_label: true,
25
25
  min_height: 125,
@@ -30,8 +30,8 @@ class Marty::ScriptTester < Marty::Form
30
30
  ]
31
31
  end
32
32
 
33
- js_configure do |c|
34
- c.set_result = <<-JS
33
+ client_class do |c|
34
+ c.set_result = l(<<-JS)
35
35
  function(html) {
36
36
  var result = this.netzkeGetComponent('result');
37
37
  result.updateBodyHtml(html);
@@ -47,7 +47,7 @@ class Marty::ScriptTester < Marty::Form
47
47
  get_engine(root_sess[:selected_script_name])
48
48
  end
49
49
 
50
- endpoint :netzke_submit do |params, this|
50
+ endpoint :submit do |params|
51
51
  data = ActiveSupport::JSON.decode(params[:data])
52
52
 
53
53
  attrs = data["attrs"].split(';').map(&:strip).reject(&:empty?)
@@ -59,7 +59,7 @@ class Marty::ScriptTester < Marty::Form
59
59
  begin
60
60
  phash = ActiveSupport::JSON.decode("{ #{pjson} }")
61
61
  rescue MultiJson::DecodeError
62
- this.netzke_feedback "Malformed input parameters"
62
+ client.netzke_notify "Malformed input parameters"
63
63
  return
64
64
  end
65
65
 
@@ -76,11 +76,11 @@ class Marty::ScriptTester < Marty::Form
76
76
  "#{a} = #{q}"
77
77
  }
78
78
 
79
- this.netzke_feedback "done"
80
- this.set_result result.join("<br/>")
79
+ client.netzke_notify "done"
80
+ client.set_result result.join("<br/>")
81
81
 
82
82
  rescue SystemStackError
83
- return this.netzke_feedback "System Stack Error"
83
+ return client.netzke_notify "System Stack Error"
84
84
 
85
85
  rescue => exc
86
86
  res = Delorean::Engine.grok_runtime_exception(exc)
@@ -88,8 +88,8 @@ class Marty::ScriptTester < Marty::Form
88
88
  result = ["Error: #{res['error']}", "Backtrace:"] +
89
89
  res["backtrace"].map {|m, line, fn| "#{m}:#{line} #{fn}"}
90
90
 
91
- this.netzke_feedback "failed"
92
- this.set_result '<font color="red">' + result.join("<br/>") + "</font>"
91
+ client.netzke_notify "failed"
92
+ client.set_result '<font color="red">' + result.join("<br/>") + "</font>"
93
93
  end
94
94
  end
95
95
 
@@ -29,12 +29,12 @@ class Marty::Scripting < Netzke::Base
29
29
  ]
30
30
  end
31
31
 
32
- js_configure do |c|
32
+ client_class do |c|
33
33
 
34
34
  c.header = false
35
35
  c.layout = :border
36
36
 
37
- c.init_component = <<-JS
37
+ c.init_component = l(<<-JS)
38
38
  function() {
39
39
  var me = this;
40
40
  me.callParent();
@@ -50,10 +50,10 @@ class Marty::Scripting < Netzke::Base
50
50
  return;
51
51
 
52
52
  var tag_id = records[0].get('id');
53
- me.selectTag({tag_id: tag_id});
53
+ me.server.selectTag({tag_id: tag_id});
54
54
  script_grid.getStore().load();
55
55
  var script_name = null;
56
- script_form.netzkeLoad({script_name: script_name});
56
+ script_form.server.netzkeLoad({script_name: script_name});
57
57
  }, me);
58
58
 
59
59
  script_grid.getSelectionModel().on('selectionchange',
@@ -66,35 +66,35 @@ class Marty::Scripting < Netzke::Base
66
66
  return;
67
67
 
68
68
  var script_name = records[0].get('name');
69
- me.selectScript({script_name: script_name});
70
- script_form.netzkeLoad({script_name: script_name});
69
+ me.server.selectScript({script_name: script_name});
70
+ script_form.server.netzkeLoad({script_name: script_name});
71
71
  }, me);
72
72
  }
73
73
  JS
74
74
 
75
- c.script_refresh = <<-JS
75
+ c.script_refresh = l(<<-JS)
76
76
  function(script_name) {
77
77
  if (!script_name) {
78
- this.selectScript({});
78
+ this.server.selectScript({});
79
79
  this.netzkeReload();
80
80
  }
81
81
  else {
82
- this.selectScript({script_name: script_name});
82
+ this.server.selectScript({script_name: script_name});
83
83
  this.netzkeGetComponent('tag_grid').getStore().load();
84
84
  this.netzkeGetComponent('script_grid').getStore().load();
85
- this.netzkeGetComponent('script_form').netzkeLoad(
85
+ this.netzkeGetComponent('script_form').server.netzkeLoad(
86
86
  {script_name: script_name});
87
87
  }
88
88
  }
89
89
  JS
90
90
  end
91
91
 
92
- endpoint :select_tag do |params, this|
92
+ endpoint :select_tag do |params|
93
93
  root_sess[:selected_tag_id] = params[:tag_id]
94
94
  root_sess[:selected_script_name] = nil
95
95
  end
96
96
 
97
- endpoint :select_script do |params, this|
97
+ endpoint :select_script do |params|
98
98
  root_sess[:selected_script_name] = params[:script_name]
99
99
  end
100
100
 
@@ -29,11 +29,11 @@
29
29
  #
30
30
  # The JS side of the component will have those regions referenced as this.mainPanel, this.statusBar, and this.menuBar.
31
31
  class Marty::SimpleApp < Netzke::Base
32
- js_configure do |c|
32
+ client_class do |c|
33
33
  c.extend = "Ext.container.Viewport"
34
34
  c.layout = :border
35
35
  c.require Netzke::Core.ext_path.join("examples", "ux/statusbar/StatusBar.js"), :statusbar_ext
36
- c.mixin
36
+ c.include :simple_app
37
37
  end
38
38
 
39
39
  def configure(c)