marty 2.4.7 → 2.4.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Dockerfile.dummy +8 -5
- data/Gemfile.lock +1 -1
- data/README.md +8 -0
- data/app/assets/javascripts/marty/application.js +1 -0
- data/app/assets/javascripts/marty/codemirror/codemirror.js +9730 -0
- data/app/{components/marty/script_form/client → assets/javascripts/marty/codemirror}/mode/delorean/delorean.js +0 -0
- data/app/assets/javascripts/marty/codemirror/mode/javascript/javascript.js +900 -0
- data/app/assets/javascripts/marty/codemirror/mode/python/python.js +399 -0
- data/app/{components/marty/script_form/client → assets/javascripts/marty/codemirror}/mode/ruby/ruby.js +135 -34
- data/app/{components/marty/script_form/client/Ext.ux.form.field.CodeMirror.js → assets/javascripts/marty/extjs/extensions/marty.js} +87 -6
- data/app/assets/stylesheets/marty/application.css +1 -13
- data/app/assets/stylesheets/marty/codemirror/codemirror.css +346 -0
- data/app/{components/marty/script_form/client → assets/stylesheets/marty/codemirror}/delorean.css +0 -0
- data/app/components/marty/auth_app/client/auth_app.js +82 -80
- data/app/components/marty/data_grid_view.rb +1 -54
- data/app/components/marty/data_grid_view/client/data_grid_view.js +49 -0
- data/app/components/marty/form.rb +1 -5
- data/app/components/marty/form/client/form.js +5 -0
- data/app/components/marty/grid.rb +1 -146
- data/app/components/marty/grid/client/grid.js +146 -0
- data/app/components/marty/import_view.rb +1 -32
- data/app/components/marty/import_view/client/import_view.js +32 -0
- data/app/components/marty/live_search_grid_panel.rb +1 -21
- data/app/components/marty/live_search_grid_panel/client/live_search_grid_panel.js +27 -0
- data/app/components/marty/main_auth_app.rb +4 -145
- data/app/components/marty/main_auth_app/client/main_auth_app.js +124 -0
- data/app/components/marty/mcfly_grid_panel.rb +1 -17
- data/app/components/marty/mcfly_grid_panel/client/mcfly_grid_panel.js +37 -0
- data/app/components/marty/new_posting_form.rb +1 -6
- data/app/components/marty/new_posting_form/client/new_posting_form.js +6 -0
- data/app/components/marty/panel.rb +1 -5
- data/app/components/marty/panel/client/panel.js +5 -0
- data/app/components/marty/posting_grid.rb +4 -55
- data/app/components/marty/posting_grid/client/posting_grid.js +50 -0
- data/app/components/marty/promise_view.rb +2 -75
- data/app/components/marty/promise_view/client/promise_view.css +12 -9
- data/app/components/marty/promise_view/client/promise_view.js +57 -0
- data/app/components/marty/report_form.rb +3 -69
- data/app/components/marty/report_form/client/report_form.js +78 -0
- data/app/components/marty/report_select.rb +1 -45
- data/app/components/marty/report_select/client/report_select.js +50 -0
- data/app/components/marty/reporting.rb +1 -8
- data/app/components/marty/reporting/client/reporting.js +8 -0
- data/app/components/marty/script_form.rb +2 -63
- data/app/components/marty/script_form/client/script_form.js +44 -0
- data/app/components/marty/script_tester.rb +1 -7
- data/app/components/marty/script_tester/client/script_tester.js +7 -0
- data/app/components/marty/scripting.rb +1 -55
- data/app/components/marty/scripting/client/scripting.js +62 -0
- data/app/components/marty/simple_app/client/simple_app.js +21 -13
- data/app/models/marty/promise.rb +22 -1
- data/app/views/layouts/marty/application.html.erb +8 -6
- data/docker-compose.dummy.yml +2 -0
- data/lib/marty/monkey.rb +0 -16
- data/lib/marty/version.rb +1 -1
- data/spec/dummy/config/initializers/assets.rb +1 -0
- data/spec/features/reporting_spec.rb +1 -0
- data/spec/features/scripting_spec.rb +4 -4
- data/spec/spec_helper.rb +1 -0
- data/spec/support/chromedriver.rb +5 -1
- data/spec/support/shared_connection_db_helpers.rb +42 -2
- metadata +29 -168
- data/app/assets/images/marty/.gitkeep +0 -0
- data/app/components/marty/mcfly_grid_panel/client/dup_in_form.js +0 -20
- data/app/components/marty/script_form/client/codemirror.css +0 -172
- data/app/components/marty/script_form/client/codemirror.js +0 -3130
- data/app/components/marty/script_form/client/mode/clike/clike.js +0 -284
- data/app/components/marty/script_form/client/mode/clike/index.html +0 -102
- data/app/components/marty/script_form/client/mode/clike/scala.html +0 -766
- data/app/components/marty/script_form/client/mode/clojure/clojure.js +0 -206
- data/app/components/marty/script_form/client/mode/clojure/index.html +0 -67
- data/app/components/marty/script_form/client/mode/coffeescript/LICENSE +0 -22
- data/app/components/marty/script_form/client/mode/coffeescript/coffeescript.js +0 -346
- data/app/components/marty/script_form/client/mode/coffeescript/index.html +0 -728
- data/app/components/marty/script_form/client/mode/commonlisp/commonlisp.js +0 -101
- data/app/components/marty/script_form/client/mode/commonlisp/index.html +0 -165
- data/app/components/marty/script_form/client/mode/css/css.js +0 -448
- data/app/components/marty/script_form/client/mode/css/index.html +0 -58
- data/app/components/marty/script_form/client/mode/css/test.js +0 -501
- data/app/components/marty/script_form/client/mode/diff/diff.js +0 -32
- data/app/components/marty/script_form/client/mode/diff/index.html +0 -105
- data/app/components/marty/script_form/client/mode/ecl/ecl.js +0 -203
- data/app/components/marty/script_form/client/mode/ecl/index.html +0 -42
- data/app/components/marty/script_form/client/mode/erlang/erlang.js +0 -463
- data/app/components/marty/script_form/client/mode/erlang/index.html +0 -63
- data/app/components/marty/script_form/client/mode/gfm/gfm.js +0 -150
- data/app/components/marty/script_form/client/mode/gfm/index.html +0 -48
- data/app/components/marty/script_form/client/mode/go/go.js +0 -170
- data/app/components/marty/script_form/client/mode/go/index.html +0 -73
- data/app/components/marty/script_form/client/mode/groovy/groovy.js +0 -210
- data/app/components/marty/script_form/client/mode/groovy/index.html +0 -72
- data/app/components/marty/script_form/client/mode/haskell/haskell.js +0 -242
- data/app/components/marty/script_form/client/mode/haskell/index.html +0 -61
- data/app/components/marty/script_form/client/mode/haxe/haxe.js +0 -429
- data/app/components/marty/script_form/client/mode/haxe/index.html +0 -91
- data/app/components/marty/script_form/client/mode/htmlembedded/htmlembedded.js +0 -72
- data/app/components/marty/script_form/client/mode/htmlembedded/index.html +0 -50
- data/app/components/marty/script_form/client/mode/htmlmixed/htmlmixed.js +0 -84
- data/app/components/marty/script_form/client/mode/htmlmixed/index.html +0 -52
- data/app/components/marty/script_form/client/mode/javascript/index.html +0 -78
- data/app/components/marty/script_form/client/mode/javascript/javascript.js +0 -361
- data/app/components/marty/script_form/client/mode/jinja2/index.html +0 -38
- data/app/components/marty/script_form/client/mode/jinja2/jinja2.js +0 -42
- data/app/components/marty/script_form/client/mode/less/index.html +0 -740
- data/app/components/marty/script_form/client/mode/less/less.js +0 -266
- data/app/components/marty/script_form/client/mode/lua/index.html +0 -73
- data/app/components/marty/script_form/client/mode/lua/lua.js +0 -140
- data/app/components/marty/script_form/client/mode/markdown/index.html +0 -343
- data/app/components/marty/script_form/client/mode/markdown/markdown.js +0 -382
- data/app/components/marty/script_form/client/mode/markdown/test.js +0 -1084
- data/app/components/marty/script_form/client/mode/mysql/index.html +0 -42
- data/app/components/marty/script_form/client/mode/mysql/mysql.js +0 -186
- data/app/components/marty/script_form/client/mode/ntriples/index.html +0 -33
- data/app/components/marty/script_form/client/mode/ntriples/ntriples.js +0 -172
- data/app/components/marty/script_form/client/mode/ocaml/index.html +0 -130
- data/app/components/marty/script_form/client/mode/ocaml/ocaml.js +0 -114
- data/app/components/marty/script_form/client/mode/pascal/LICENSE +0 -7
- data/app/components/marty/script_form/client/mode/pascal/index.html +0 -49
- data/app/components/marty/script_form/client/mode/pascal/pascal.js +0 -94
- data/app/components/marty/script_form/client/mode/perl/LICENSE +0 -19
- data/app/components/marty/script_form/client/mode/perl/index.html +0 -63
- data/app/components/marty/script_form/client/mode/perl/perl.js +0 -816
- data/app/components/marty/script_form/client/mode/php/index.html +0 -49
- data/app/components/marty/script_form/client/mode/php/php.js +0 -148
- data/app/components/marty/script_form/client/mode/pig/index.html +0 -43
- data/app/components/marty/script_form/client/mode/pig/pig.js +0 -172
- data/app/components/marty/script_form/client/mode/plsql/index.html +0 -63
- data/app/components/marty/script_form/client/mode/plsql/plsql.js +0 -217
- data/app/components/marty/script_form/client/mode/properties/index.html +0 -41
- data/app/components/marty/script_form/client/mode/properties/properties.js +0 -63
- data/app/components/marty/script_form/client/mode/python/LICENSE.txt +0 -21
- data/app/components/marty/script_form/client/mode/python/index.html +0 -123
- data/app/components/marty/script_form/client/mode/python/python.js +0 -338
- data/app/components/marty/script_form/client/mode/r/LICENSE +0 -24
- data/app/components/marty/script_form/client/mode/r/index.html +0 -74
- data/app/components/marty/script_form/client/mode/r/r.js +0 -141
- data/app/components/marty/script_form/client/mode/rpm/changes/changes.js +0 -19
- data/app/components/marty/script_form/client/mode/rpm/changes/index.html +0 -54
- data/app/components/marty/script_form/client/mode/rpm/spec/index.html +0 -100
- data/app/components/marty/script_form/client/mode/rpm/spec/spec.css +0 -5
- data/app/components/marty/script_form/client/mode/rpm/spec/spec.js +0 -66
- data/app/components/marty/script_form/client/mode/rst/index.html +0 -526
- data/app/components/marty/script_form/client/mode/rst/rst.js +0 -326
- data/app/components/marty/script_form/client/mode/ruby/LICENSE +0 -24
- data/app/components/marty/script_form/client/mode/ruby/index.html +0 -172
- data/app/components/marty/script_form/client/mode/rust/index.html +0 -49
- data/app/components/marty/script_form/client/mode/rust/rust.js +0 -432
- data/app/components/marty/script_form/client/mode/scheme/index.html +0 -65
- data/app/components/marty/script_form/client/mode/scheme/scheme.js +0 -230
- data/app/components/marty/script_form/client/mode/shell/index.html +0 -50
- data/app/components/marty/script_form/client/mode/shell/shell.js +0 -118
- data/app/components/marty/script_form/client/mode/sieve/LICENSE +0 -23
- data/app/components/marty/script_form/client/mode/sieve/index.html +0 -81
- data/app/components/marty/script_form/client/mode/sieve/sieve.js +0 -156
- data/app/components/marty/script_form/client/mode/smalltalk/index.html +0 -56
- data/app/components/marty/script_form/client/mode/smalltalk/smalltalk.js +0 -139
- data/app/components/marty/script_form/client/mode/smarty/index.html +0 -83
- data/app/components/marty/script_form/client/mode/smarty/smarty.js +0 -148
- data/app/components/marty/script_form/client/mode/sparql/index.html +0 -41
- data/app/components/marty/script_form/client/mode/sparql/sparql.js +0 -143
- data/app/components/marty/script_form/client/mode/stex/index.html +0 -98
- data/app/components/marty/script_form/client/mode/stex/stex.js +0 -182
- data/app/components/marty/script_form/client/mode/stex/test.js +0 -343
- data/app/components/marty/script_form/client/mode/tiddlywiki/index.html +0 -141
- data/app/components/marty/script_form/client/mode/tiddlywiki/tiddlywiki.css +0 -14
- data/app/components/marty/script_form/client/mode/tiddlywiki/tiddlywiki.js +0 -384
- data/app/components/marty/script_form/client/mode/tiki/index.html +0 -83
- data/app/components/marty/script_form/client/mode/tiki/tiki.css +0 -26
- data/app/components/marty/script_form/client/mode/tiki/tiki.js +0 -309
- data/app/components/marty/script_form/client/mode/vb/LICENSE.txt +0 -21
- data/app/components/marty/script_form/client/mode/vb/index.html +0 -89
- data/app/components/marty/script_form/client/mode/vb/vb.js +0 -260
- data/app/components/marty/script_form/client/mode/vbscript/index.html +0 -43
- data/app/components/marty/script_form/client/mode/vbscript/vbscript.js +0 -26
- data/app/components/marty/script_form/client/mode/velocity/index.html +0 -104
- data/app/components/marty/script_form/client/mode/velocity/velocity.js +0 -146
- data/app/components/marty/script_form/client/mode/verilog/index.html +0 -211
- data/app/components/marty/script_form/client/mode/verilog/verilog.js +0 -194
- data/app/components/marty/script_form/client/mode/xml/index.html +0 -45
- data/app/components/marty/script_form/client/mode/xml/xml.js +0 -318
- data/app/components/marty/script_form/client/mode/xquery/LICENSE +0 -20
- data/app/components/marty/script_form/client/mode/xquery/index.html +0 -223
- data/app/components/marty/script_form/client/mode/xquery/test/index.html +0 -27
- data/app/components/marty/script_form/client/mode/xquery/test/testBase.js +0 -42
- data/app/components/marty/script_form/client/mode/xquery/test/testEmptySequenceKeyword.js +0 -16
- data/app/components/marty/script_form/client/mode/xquery/test/testMultiAttr.js +0 -16
- data/app/components/marty/script_form/client/mode/xquery/test/testNamespaces.js +0 -91
- data/app/components/marty/script_form/client/mode/xquery/test/testProcessingInstructions.js +0 -16
- data/app/components/marty/script_form/client/mode/xquery/test/testQuotes.js +0 -19
- data/app/components/marty/script_form/client/mode/xquery/xquery.js +0 -451
- data/app/components/marty/script_form/client/mode/yaml/index.html +0 -68
- data/app/components/marty/script_form/client/mode/yaml/yaml.js +0 -95
- data/app/components/marty/script_form/client/theme/ambiance.css +0 -81
- data/app/components/marty/script_form/client/theme/blackboard.css +0 -25
- data/app/components/marty/script_form/client/theme/cobalt.css +0 -18
- data/app/components/marty/script_form/client/theme/eclipse.css +0 -25
- data/app/components/marty/script_form/client/theme/elegant.css +0 -10
- data/app/components/marty/script_form/client/theme/erlang-dark.css +0 -21
- data/app/components/marty/script_form/client/theme/lesser-dark.css +0 -44
- data/app/components/marty/script_form/client/theme/monokai.css +0 -28
- data/app/components/marty/script_form/client/theme/neat.css +0 -9
- data/app/components/marty/script_form/client/theme/night.css +0 -21
- data/app/components/marty/script_form/client/theme/rubyblue.css +0 -21
- data/app/components/marty/script_form/client/theme/vibrant-ink.css +0 -27
- data/app/components/marty/script_form/client/theme/xq-dark.css +0 -46
- data/app/components/marty/script_form/client/util/closetag.js +0 -164
- data/app/components/marty/script_form/client/util/dialog.css +0 -27
- data/app/components/marty/script_form/client/util/dialog.js +0 -70
- data/app/components/marty/script_form/client/util/foldcode.js +0 -196
- data/app/components/marty/script_form/client/util/formatting.js +0 -193
- data/app/components/marty/script_form/client/util/javascript-hint.js +0 -134
- data/app/components/marty/script_form/client/util/loadmode.js +0 -51
- data/app/components/marty/script_form/client/util/match-highlighter.js +0 -44
- data/app/components/marty/script_form/client/util/multiplex.js +0 -77
- data/app/components/marty/script_form/client/util/overlay.js +0 -54
- data/app/components/marty/script_form/client/util/pig-hint.js +0 -123
- data/app/components/marty/script_form/client/util/runmode-standalone.js +0 -90
- data/app/components/marty/script_form/client/util/runmode.js +0 -53
- data/app/components/marty/script_form/client/util/search.js +0 -118
- data/app/components/marty/script_form/client/util/searchcursor.js +0 -119
- data/app/components/marty/script_form/client/util/simple-hint.css +0 -16
- data/app/components/marty/script_form/client/util/simple-hint.js +0 -97
- data/app/components/marty/script_form/client/util/xml-hint.js +0 -137
- data/lib/marty/javascript/grid_view_in_form.js +0 -81
data/app/{components/marty/script_form/client → assets/stylesheets/marty/codemirror}/delorean.css
RENAMED
File without changes
|
@@ -1,89 +1,91 @@
|
|
1
1
|
{
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
2
|
+
netzkeOnSignIn: function () {
|
3
|
+
var me = this;
|
4
|
+
this.signinWin = this.signinWin || Ext.create('Ext.Window', {
|
5
|
+
modal: true,
|
6
|
+
layout: 'fit',
|
7
7
|
|
8
|
-
|
9
|
-
|
10
|
-
|
8
|
+
submit: function () {
|
9
|
+
var form = this.items.first();
|
10
|
+
var values = form.getForm().getValues();
|
11
11
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
closeAction: 'hide',
|
28
|
-
title: "Sign in",
|
29
|
-
fbar: [
|
30
|
-
{
|
31
|
-
text: 'OK',
|
32
|
-
name: 'signin_submit',
|
33
|
-
handler: function() {
|
34
|
-
this.up('window').submit();
|
35
|
-
},
|
36
|
-
},
|
37
|
-
{
|
38
|
-
text:'Cancel',
|
39
|
-
handler: function() {
|
40
|
-
this.up('window').close();
|
41
|
-
},
|
42
|
-
},
|
43
|
-
],
|
44
|
-
|
45
|
-
items: {
|
46
|
-
xtype: 'form',
|
47
|
-
defaultType: 'textfield',
|
48
|
-
bodyPadding: '15px 15px 0px 10px',
|
49
|
-
defaults: {
|
50
|
-
listeners: {
|
51
|
-
specialkey: function (field, event) {
|
52
|
-
if (event.getKey() == event.ENTER) {
|
53
|
-
field.up('window').submit();
|
54
|
-
}
|
55
|
-
}
|
56
|
-
},
|
57
|
-
},
|
58
|
-
items: [
|
59
|
-
{
|
60
|
-
fieldLabel: 'Login',
|
61
|
-
name: 'login',
|
62
|
-
},
|
63
|
-
{
|
64
|
-
fieldLabel: 'Password',
|
65
|
-
name: 'password',
|
66
|
-
inputType: 'password',
|
67
|
-
}
|
68
|
-
]
|
12
|
+
// calling the endpoint
|
13
|
+
me.server.signIn(values, function (res) {
|
14
|
+
if (res) {
|
15
|
+
if (!me.authSpecMode) {
|
16
|
+
this.signinWin.close();
|
17
|
+
}
|
18
|
+
Ext.Msg.show({
|
19
|
+
title: "Signed in",
|
20
|
+
msg: "Signed in successfully, reloading...",
|
21
|
+
icon: Ext.Msg.INFO,
|
22
|
+
closable: false
|
23
|
+
});
|
24
|
+
if (!me.authSpecMode) {
|
25
|
+
window.location.href = "/";
|
69
26
|
}
|
27
|
+
}
|
70
28
|
});
|
29
|
+
},
|
71
30
|
|
72
|
-
|
73
|
-
|
74
|
-
|
31
|
+
closeAction: 'hide',
|
32
|
+
title: "Sign in",
|
33
|
+
fbar: [{
|
34
|
+
text: 'OK',
|
35
|
+
name: 'signin_submit',
|
36
|
+
handler: function () {
|
37
|
+
this.up('window').submit();
|
38
|
+
},
|
39
|
+
},
|
40
|
+
{
|
41
|
+
text: 'Cancel',
|
42
|
+
handler: function () {
|
43
|
+
this.up('window').close();
|
44
|
+
},
|
45
|
+
},
|
46
|
+
],
|
75
47
|
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
48
|
+
items: {
|
49
|
+
xtype: 'form',
|
50
|
+
defaultType: 'textfield',
|
51
|
+
bodyPadding: '15px 15px 0px 10px',
|
52
|
+
defaults: {
|
53
|
+
listeners: {
|
54
|
+
specialkey: function (field, event) {
|
55
|
+
if (event.getKey() == event.ENTER) {
|
56
|
+
field.up('window').submit();
|
57
|
+
}
|
86
58
|
}
|
87
|
-
|
88
|
-
|
59
|
+
},
|
60
|
+
},
|
61
|
+
items: [{
|
62
|
+
fieldLabel: 'Login',
|
63
|
+
name: 'login',
|
64
|
+
},
|
65
|
+
{
|
66
|
+
fieldLabel: 'Password',
|
67
|
+
name: 'password',
|
68
|
+
inputType: 'password',
|
69
|
+
}
|
70
|
+
]
|
71
|
+
}
|
72
|
+
});
|
73
|
+
|
74
|
+
this.signinWin.show();
|
75
|
+
this.signinWin.down('textfield').focus(false, 100);
|
76
|
+
},
|
77
|
+
|
78
|
+
netzkeOnSignOut: function () {
|
79
|
+
this.server.signOut(null, function (success) {
|
80
|
+
if (success) {
|
81
|
+
Ext.Msg.show({
|
82
|
+
title: "Signed out",
|
83
|
+
msg: "Signed out, reloading the application...",
|
84
|
+
icon: Ext.Msg.INFO,
|
85
|
+
closable: false
|
86
|
+
});
|
87
|
+
window.location.href = "/";
|
88
|
+
}
|
89
|
+
})
|
90
|
+
}
|
89
91
|
}
|
@@ -6,61 +6,8 @@ module Marty; class DataGridView < McflyGridPanel
|
|
6
6
|
|
7
7
|
include Extras::Layout
|
8
8
|
|
9
|
-
def self.show_grid_js(options={})
|
10
|
-
dg = options[:data_grid] || 'data_grid'
|
11
|
-
title_str = options[:title_str] || 'Data Grid'
|
12
|
-
|
13
|
-
javascript = l(<<-JS)
|
14
|
-
function() {
|
15
|
-
var sel = this.getSelectionModel().getSelection()[0];
|
16
|
-
var record_id = sel && sel.getId();
|
17
|
-
this.server.showGrid({record_id: record_id,
|
18
|
-
data_grid: "#{dg}",
|
19
|
-
title_str: "#{title_str}"});
|
20
|
-
}
|
21
|
-
JS
|
22
|
-
javascript
|
23
|
-
end
|
24
|
-
|
25
|
-
def self.client_show_grid_js
|
26
|
-
javascript = l(<<-JS)
|
27
|
-
function(count, data, title_str) {
|
28
|
-
var columns = [];
|
29
|
-
var fields = [];
|
30
|
-
|
31
|
-
for (var i=0; i<count; i++) {
|
32
|
-
fields.push("a" + i);
|
33
|
-
columns.push({dataIndex: "a" + i, text: i, flex: 1});
|
34
|
-
}
|
35
|
-
|
36
|
-
Ext.create('Ext.Window', {
|
37
|
-
height: "80%",
|
38
|
-
width: "80%",
|
39
|
-
x: 0,
|
40
|
-
y: 0,
|
41
|
-
autoWidth: true,
|
42
|
-
modal: true,
|
43
|
-
autoScroll: true,
|
44
|
-
title: title_str,
|
45
|
-
items: {
|
46
|
-
xtype: 'grid',
|
47
|
-
border: false,
|
48
|
-
hideHeaders: false,
|
49
|
-
columns: columns,
|
50
|
-
store: Ext.create('Ext.data.ArrayStore', {
|
51
|
-
fields: fields,
|
52
|
-
data: data,
|
53
|
-
})
|
54
|
-
},
|
55
|
-
}).show();
|
56
|
-
}
|
57
|
-
JS
|
58
|
-
javascript
|
59
|
-
end
|
60
|
-
|
61
9
|
client_class do |c|
|
62
|
-
c.
|
63
|
-
c.netzke_client_show_grid = DataGridView.client_show_grid_js
|
10
|
+
c.include :data_grid_view
|
64
11
|
end
|
65
12
|
|
66
13
|
def configure(c)
|
@@ -0,0 +1,49 @@
|
|
1
|
+
{
|
2
|
+
netzkeShowGrid: function (options = {}) {
|
3
|
+
var dg = options.dataGrid || 'data_grid'
|
4
|
+
var title_str = options.titleStr || 'Data Grid'
|
5
|
+
|
6
|
+
var sel = this.getSelectionModel().getSelection()[0];
|
7
|
+
var record_id = sel && sel.getId();
|
8
|
+
this.server.showGrid({
|
9
|
+
record_id: record_id,
|
10
|
+
data_grid: dg,
|
11
|
+
title_str: title_str
|
12
|
+
});
|
13
|
+
},
|
14
|
+
|
15
|
+
netzkeClientShowGrid: function (count, data, title_str) {
|
16
|
+
var columns = [];
|
17
|
+
var fields = [];
|
18
|
+
|
19
|
+
for (var i = 0; i < count; i++) {
|
20
|
+
fields.push("a" + i);
|
21
|
+
columns.push({
|
22
|
+
dataIndex: "a" + i,
|
23
|
+
text: i,
|
24
|
+
flex: 1
|
25
|
+
});
|
26
|
+
}
|
27
|
+
|
28
|
+
Ext.create('Ext.Window', {
|
29
|
+
height: "80%",
|
30
|
+
width: "80%",
|
31
|
+
x: 0,
|
32
|
+
y: 0,
|
33
|
+
autoWidth: true,
|
34
|
+
modal: true,
|
35
|
+
autoScroll: true,
|
36
|
+
title: title_str,
|
37
|
+
items: {
|
38
|
+
xtype: 'grid',
|
39
|
+
border: false,
|
40
|
+
hideHeaders: false,
|
41
|
+
columns: columns,
|
42
|
+
store: Ext.create('Ext.data.ArrayStore', {
|
43
|
+
fields: fields,
|
44
|
+
data: data,
|
45
|
+
})
|
46
|
+
},
|
47
|
+
}).show();
|
48
|
+
},
|
49
|
+
}
|
@@ -13,152 +13,7 @@ class Marty::Grid < ::Netzke::Grid::Base
|
|
13
13
|
end
|
14
14
|
|
15
15
|
client_class do |c|
|
16
|
-
c.
|
17
|
-
function(name) {
|
18
|
-
return Ext.getCmp(name);
|
19
|
-
}
|
20
|
-
JS
|
21
|
-
|
22
|
-
c.find_component = l(<<-JS)
|
23
|
-
function(name) {
|
24
|
-
return Ext.ComponentQuery.query(`[name=${name}]`)[0];
|
25
|
-
}
|
26
|
-
JS
|
27
|
-
|
28
|
-
c.set_disable_component_actions = l(<<-JS)
|
29
|
-
function(prefix, flag) {
|
30
|
-
for (var key in this.actions) {
|
31
|
-
if (key.substring(0, prefix.length) == prefix) {
|
32
|
-
this.actions[key].setDisabled(flag);
|
33
|
-
}
|
34
|
-
}
|
35
|
-
}
|
36
|
-
JS
|
37
|
-
|
38
|
-
c.init_component = l(<<-JS)
|
39
|
-
function() {
|
40
|
-
this.dockedItems = this.dockedItems || [];
|
41
|
-
if (this.paging == 'pagination') {
|
42
|
-
this.dockedItems.push({
|
43
|
-
xtype: 'pagingtoolbar',
|
44
|
-
dock: 'bottom',
|
45
|
-
layout: {overflowHandler: 'Menu'},
|
46
|
-
listeners: {
|
47
|
-
'beforechange': this.disableDirtyPageWarning ? {} : {
|
48
|
-
fn: this.netzkeBeforePageChange, scope: this
|
49
|
-
}
|
50
|
-
},
|
51
|
-
store: this.store,
|
52
|
-
items: this.bbar && ["-"].concat(this.bbar)
|
53
|
-
});
|
54
|
-
} else if (this.bbar) {
|
55
|
-
this.dockedItems.push({
|
56
|
-
xtype: 'toolbar',
|
57
|
-
dock: 'bottom',
|
58
|
-
layout: {overflowHandler: 'Menu'},
|
59
|
-
items: this.bbar
|
60
|
-
});
|
61
|
-
}
|
62
|
-
|
63
|
-
// block creation of toolbars in parent
|
64
|
-
delete this.bbar;
|
65
|
-
var paging = this.paging
|
66
|
-
if (paging != 'buffered') { this.paging = false; }
|
67
|
-
this.callParent();
|
68
|
-
this.paging = paging
|
69
|
-
|
70
|
-
var me = this;
|
71
|
-
|
72
|
-
var children = me.serverConfig.child_components || [];
|
73
|
-
me.onSelectionChange(
|
74
|
-
function(m) {
|
75
|
-
var has_sel = m.hasSelection();
|
76
|
-
|
77
|
-
var rid = null;
|
78
|
-
if (has_sel) {
|
79
|
-
if (m.type == 'spreadsheet') {
|
80
|
-
var cell = m.getSelected().startCell;
|
81
|
-
rid = cell && cell.record.getId();
|
82
|
-
}
|
83
|
-
if (!rid) {
|
84
|
-
selected = m.getSelection()[0];
|
85
|
-
rid = selected && selected.getId();
|
86
|
-
}
|
87
|
-
}
|
88
|
-
|
89
|
-
me.serverConfig.selected = rid;
|
90
|
-
me.setDisableComponentActions('do', !has_sel);
|
91
|
-
|
92
|
-
for (var child of children) {
|
93
|
-
var comp = me.findComponent(child)
|
94
|
-
if (comp) {
|
95
|
-
comp.serverConfig.parent_id = rid;
|
96
|
-
if (comp.setDisableComponentActions) {
|
97
|
-
comp.setDisableComponentActions('parent', !has_sel);
|
98
|
-
}
|
99
|
-
if (comp.reload) { comp.reload() }
|
100
|
-
}
|
101
|
-
}
|
102
|
-
});
|
103
|
-
|
104
|
-
var store = me.getStore();
|
105
|
-
var linked = me.serverConfig.linked_components || [];
|
106
|
-
for (var event of ['update', 'netzkerefresh']) {
|
107
|
-
store.on(event, function() {
|
108
|
-
for (var link of linked) {
|
109
|
-
var comp = me.findComponent(link);
|
110
|
-
if (comp && comp.reload) { comp.reload() }
|
111
|
-
}
|
112
|
-
}, this);
|
113
|
-
}
|
114
|
-
}
|
115
|
-
JS
|
116
|
-
|
117
|
-
c.on_selection_change = l(<<-JS)
|
118
|
-
function(f) {
|
119
|
-
var me = this;
|
120
|
-
me.getSelectionModel().on('selectionchange', f);
|
121
|
-
}
|
122
|
-
JS
|
123
|
-
|
124
|
-
c.do_view_in_form = l(<<-JS)
|
125
|
-
function(record){
|
126
|
-
this.netzkeLoadComponent("view_window", {
|
127
|
-
serverConfig: {record_id: record.id},
|
128
|
-
callback: function(w){
|
129
|
-
w.show();
|
130
|
-
w.on('close', function(){
|
131
|
-
if (w.closeRes === "ok") {
|
132
|
-
this.netzkeReloadStore();
|
133
|
-
}
|
134
|
-
}, this);
|
135
|
-
}});
|
136
|
-
}
|
137
|
-
JS
|
138
|
-
|
139
|
-
c.reload = l(<<-JS)
|
140
|
-
function(opts={}) {
|
141
|
-
this.netzkeReloadStore(opts);
|
142
|
-
}
|
143
|
-
JS
|
144
|
-
|
145
|
-
c.reload_all = l(<<-JS)
|
146
|
-
function() {
|
147
|
-
var me = this;
|
148
|
-
var children = me.serverConfig.child_components || [];
|
149
|
-
this.store.reload();
|
150
|
-
for (child of children) {
|
151
|
-
var comp = me.findComponent(child);
|
152
|
-
if (comp && comp.reload) { comp.reload() }
|
153
|
-
}
|
154
|
-
}
|
155
|
-
JS
|
156
|
-
|
157
|
-
c.clear_filters = l(<<-JS)
|
158
|
-
function() {
|
159
|
-
this.filters.clearFilters();
|
160
|
-
}
|
161
|
-
JS
|
16
|
+
c.include :grid
|
162
17
|
end
|
163
18
|
|
164
19
|
######################################################################
|