marty 0.5.41 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +3 -2
- data/app/components/marty/api_auth_view.rb +5 -8
- data/app/components/marty/auth_app.rb +8 -9
- data/app/components/marty/auth_app/{javascripts → client}/auth_app.js +4 -4
- data/app/components/marty/config_view.rb +7 -9
- data/app/components/marty/extras/misc.rb +14 -1
- data/app/components/marty/form.rb +1 -1
- data/app/components/marty/grid.rb +27 -14
- data/app/components/marty/grid_append_only.rb +3 -5
- data/app/components/marty/import_type_view.rb +8 -11
- data/app/components/marty/live_search_grid_panel.rb +3 -3
- data/app/components/marty/main_auth_app.rb +17 -19
- data/app/components/marty/mcfly_grid_panel.rb +13 -15
- data/app/components/marty/new_posting_form.rb +5 -5
- data/app/components/marty/new_posting_window.rb +1 -1
- data/app/components/marty/panel.rb +2 -2
- data/app/components/marty/posting_grid.rb +19 -28
- data/app/components/marty/posting_window.rb +6 -7
- data/app/components/marty/promise_view.rb +23 -24
- data/app/components/marty/promise_view/{stylesheets → client}/promise_view.css +0 -0
- data/app/components/marty/report_form.rb +11 -10
- data/app/components/marty/report_select.rb +17 -15
- data/app/components/marty/reporting.rb +2 -2
- data/app/components/marty/script_form.rb +34 -38
- data/app/components/marty/script_form/{javascripts → client}/Ext.ux.form.field.CodeMirror.js +0 -0
- data/app/components/marty/script_form/{stylesheets → client}/codemirror.css +0 -0
- data/app/components/marty/script_form/{javascripts → client}/codemirror.js +0 -0
- data/app/components/marty/script_form/{stylesheets → client}/delorean.css +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/clike/clike.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/clike/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/clike/scala.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/clojure/clojure.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/clojure/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/coffeescript/LICENSE +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/coffeescript/coffeescript.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/coffeescript/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/commonlisp/commonlisp.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/commonlisp/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/css/css.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/css/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/css/test.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/delorean/delorean.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/diff/diff.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/diff/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/ecl/ecl.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/ecl/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/erlang/erlang.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/erlang/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/gfm/gfm.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/gfm/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/go/go.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/go/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/groovy/groovy.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/groovy/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/haskell/haskell.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/haskell/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/haxe/haxe.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/haxe/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/htmlembedded/htmlembedded.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/htmlembedded/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/htmlmixed/htmlmixed.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/htmlmixed/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/javascript/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/javascript/javascript.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/jinja2/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/jinja2/jinja2.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/less/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/less/less.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/lua/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/lua/lua.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/markdown/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/markdown/markdown.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/markdown/test.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/mysql/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/mysql/mysql.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/ntriples/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/ntriples/ntriples.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/ocaml/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/ocaml/ocaml.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/pascal/LICENSE +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/pascal/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/pascal/pascal.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/perl/LICENSE +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/perl/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/perl/perl.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/php/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/php/php.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/pig/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/pig/pig.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/plsql/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/plsql/plsql.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/properties/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/properties/properties.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/python/LICENSE.txt +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/python/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/python/python.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/r/LICENSE +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/r/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/r/r.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/rpm/changes/changes.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/rpm/changes/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/rpm/spec/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/rpm/spec/spec.css +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/rpm/spec/spec.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/rst/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/rst/rst.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/ruby/LICENSE +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/ruby/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/ruby/ruby.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/rust/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/rust/rust.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/scheme/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/scheme/scheme.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/shell/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/shell/shell.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/sieve/LICENSE +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/sieve/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/sieve/sieve.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/smalltalk/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/smalltalk/smalltalk.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/smarty/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/smarty/smarty.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/sparql/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/sparql/sparql.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/stex/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/stex/stex.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/stex/test.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/tiddlywiki/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/tiddlywiki/tiddlywiki.css +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/tiddlywiki/tiddlywiki.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/tiki/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/tiki/tiki.css +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/tiki/tiki.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/vb/LICENSE.txt +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/vb/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/vb/vb.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/vbscript/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/vbscript/vbscript.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/velocity/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/velocity/velocity.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/verilog/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/verilog/verilog.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/xml/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/xml/xml.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/xquery/LICENSE +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/xquery/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/xquery/test/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/xquery/test/testBase.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/xquery/test/testEmptySequenceKeyword.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/xquery/test/testMultiAttr.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/xquery/test/testNamespaces.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/xquery/test/testProcessingInstructions.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/xquery/test/testQuotes.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/xquery/xquery.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/yaml/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/yaml/yaml.js +0 -0
- data/app/components/marty/script_form/{stylesheets → client}/theme/ambiance.css +0 -0
- data/app/components/marty/script_form/{stylesheets → client}/theme/blackboard.css +0 -0
- data/app/components/marty/script_form/{stylesheets → client}/theme/cobalt.css +0 -0
- data/app/components/marty/script_form/{stylesheets → client}/theme/eclipse.css +0 -0
- data/app/components/marty/script_form/{stylesheets → client}/theme/elegant.css +0 -0
- data/app/components/marty/script_form/{stylesheets → client}/theme/erlang-dark.css +0 -0
- data/app/components/marty/script_form/{stylesheets → client}/theme/lesser-dark.css +0 -0
- data/app/components/marty/script_form/{stylesheets → client}/theme/monokai.css +0 -0
- data/app/components/marty/script_form/{stylesheets → client}/theme/neat.css +0 -0
- data/app/components/marty/script_form/{stylesheets → client}/theme/night.css +0 -0
- data/app/components/marty/script_form/{stylesheets → client}/theme/rubyblue.css +0 -0
- data/app/components/marty/script_form/{stylesheets → client}/theme/vibrant-ink.css +0 -0
- data/app/components/marty/script_form/{stylesheets → client}/theme/xq-dark.css +0 -0
- data/app/components/marty/script_form/{javascripts → client}/util/closetag.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/util/dialog.css +0 -0
- data/app/components/marty/script_form/{javascripts → client}/util/dialog.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/util/foldcode.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/util/formatting.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/util/javascript-hint.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/util/loadmode.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/util/match-highlighter.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/util/multiplex.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/util/overlay.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/util/pig-hint.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/util/runmode-standalone.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/util/runmode.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/util/search.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/util/searchcursor.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/util/simple-hint.css +0 -0
- data/app/components/marty/script_form/{javascripts → client}/util/simple-hint.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/util/xml-hint.js +0 -0
- data/app/components/marty/script_grid.rb +24 -32
- data/app/components/marty/script_tester.rb +11 -11
- data/app/components/marty/scripting.rb +12 -12
- data/app/components/marty/simple_app.rb +2 -2
- data/app/components/marty/simple_app/{javascripts → client}/simple_app.js +0 -0
- data/app/components/marty/simple_app/{javascripts → client}/statusbar_ext.js +0 -0
- data/app/components/marty/tag_grid.rb +15 -21
- data/app/components/marty/user_view.rb +41 -57
- data/lib/marty/monkey.rb +1 -1
- data/lib/marty/version.rb +1 -1
- data/marty.gemspec +3 -2
- data/spec/dummy/app/assets/{stylesheets → client}/application.css +0 -0
- data/spec/dummy/app/assets/client/application.js +15 -0
- data/spec/features/scripting_spec.rb +17 -0
- data/spec/features/user_view_spec.rb +15 -15
- data/spec/spec_helper.rb +9 -0
- metadata +189 -174
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/app/components/marty/script_form/{javascripts → client}/mode/xquery/test/testMultiAttr.js
RENAMED
File without changes
|
data/app/components/marty/script_form/{javascripts → client}/mode/xquery/test/testNamespaces.js
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -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
|
-
|
33
|
-
|
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 :
|
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 :
|
47
|
-
return
|
48
|
-
config[:
|
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
|
47
|
+
return client.netzke_notify("Can only delete in DEV tag") unless
|
53
48
|
tag && tag.isdev?
|
54
49
|
|
55
|
-
super(params
|
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 :
|
55
|
+
endpoint :add_window__add_form__submit do |params|
|
61
56
|
data = ActiveSupport::JSON.decode(params[:data])
|
62
57
|
|
63
|
-
return
|
64
|
-
config[:
|
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
|
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
|
-
|
76
|
-
return
|
70
|
+
client.success = true
|
71
|
+
return client.netzke_on_submit_success
|
77
72
|
end
|
78
73
|
|
79
|
-
|
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[:
|
81
|
+
a.disabled = !config[:permissions][:create]
|
90
82
|
end
|
91
83
|
|
92
84
|
def default_bbar
|
93
|
-
[:add_in_form, :
|
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
|
92
|
+
def default_form_items
|
101
93
|
[:name]
|
102
94
|
end
|
103
95
|
|
104
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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 :
|
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
|
-
|
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
|
-
|
80
|
-
|
79
|
+
client.netzke_notify "done"
|
80
|
+
client.set_result result.join("<br/>")
|
81
81
|
|
82
82
|
rescue SystemStackError
|
83
|
-
return
|
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
|
-
|
92
|
-
|
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
|
-
|
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
|
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
|
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
|
-
|
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.
|
36
|
+
c.include :simple_app
|
37
37
|
end
|
38
38
|
|
39
39
|
def configure(c)
|
File without changes
|