marty 2.4.7 → 2.4.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
.CodeMirror-completions {
|
|
2
|
-
position: absolute;
|
|
3
|
-
z-index: 10;
|
|
4
|
-
overflow: hidden;
|
|
5
|
-
-webkit-box-shadow: 2px 3px 5px rgba(0,0,0,.2);
|
|
6
|
-
-moz-box-shadow: 2px 3px 5px rgba(0,0,0,.2);
|
|
7
|
-
box-shadow: 2px 3px 5px rgba(0,0,0,.2);
|
|
8
|
-
}
|
|
9
|
-
.CodeMirror-completions select {
|
|
10
|
-
background: #fafafa;
|
|
11
|
-
outline: none;
|
|
12
|
-
border: none;
|
|
13
|
-
padding: 0;
|
|
14
|
-
margin: 0;
|
|
15
|
-
font-family: monospace;
|
|
16
|
-
}
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
(function() {
|
|
2
|
-
CodeMirror.simpleHint = function(editor, getHints, givenOptions) {
|
|
3
|
-
// Determine effective options based on given values and defaults.
|
|
4
|
-
var options = {}, defaults = CodeMirror.simpleHint.defaults;
|
|
5
|
-
for (var opt in defaults)
|
|
6
|
-
if (defaults.hasOwnProperty(opt))
|
|
7
|
-
options[opt] = (givenOptions && givenOptions.hasOwnProperty(opt) ? givenOptions : defaults)[opt];
|
|
8
|
-
|
|
9
|
-
function collectHints(previousToken) {
|
|
10
|
-
// We want a single cursor position.
|
|
11
|
-
if (editor.somethingSelected()) return;
|
|
12
|
-
|
|
13
|
-
var tempToken = editor.getTokenAt(editor.getCursor());
|
|
14
|
-
|
|
15
|
-
// Don't show completions if token has changed and the option is set.
|
|
16
|
-
if (options.closeOnTokenChange && previousToken != null &&
|
|
17
|
-
(tempToken.start != previousToken.start || tempToken.className != previousToken.className)) {
|
|
18
|
-
return;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
var result = getHints(editor);
|
|
22
|
-
if (!result || !result.list.length) return;
|
|
23
|
-
var completions = result.list;
|
|
24
|
-
function insert(str) {
|
|
25
|
-
editor.replaceRange(str, result.from, result.to);
|
|
26
|
-
}
|
|
27
|
-
// When there is only one completion, use it directly.
|
|
28
|
-
if (completions.length == 1) {insert(completions[0]); return true;}
|
|
29
|
-
|
|
30
|
-
// Build the select widget
|
|
31
|
-
var complete = document.createElement("div");
|
|
32
|
-
complete.className = "CodeMirror-completions";
|
|
33
|
-
var sel = complete.appendChild(document.createElement("select"));
|
|
34
|
-
// Opera doesn't move the selection when pressing up/down in a
|
|
35
|
-
// multi-select, but it does properly support the size property on
|
|
36
|
-
// single-selects, so no multi-select is necessary.
|
|
37
|
-
if (!window.opera) sel.multiple = true;
|
|
38
|
-
for (var i = 0; i < completions.length; ++i) {
|
|
39
|
-
var opt = sel.appendChild(document.createElement("option"));
|
|
40
|
-
opt.appendChild(document.createTextNode(completions[i]));
|
|
41
|
-
}
|
|
42
|
-
sel.firstChild.selected = true;
|
|
43
|
-
sel.size = Math.min(10, completions.length);
|
|
44
|
-
var pos = editor.cursorCoords();
|
|
45
|
-
complete.style.left = pos.x + "px";
|
|
46
|
-
complete.style.top = pos.yBot + "px";
|
|
47
|
-
document.body.appendChild(complete);
|
|
48
|
-
// If we're at the edge of the screen, then we want the menu to appear on the left of the cursor.
|
|
49
|
-
var winW = window.innerWidth || Math.max(document.body.offsetWidth, document.documentElement.offsetWidth);
|
|
50
|
-
if(winW - pos.x < sel.clientWidth)
|
|
51
|
-
complete.style.left = (pos.x - sel.clientWidth) + "px";
|
|
52
|
-
// Hack to hide the scrollbar.
|
|
53
|
-
if (completions.length <= 10)
|
|
54
|
-
complete.style.width = (sel.clientWidth - 1) + "px";
|
|
55
|
-
|
|
56
|
-
var done = false;
|
|
57
|
-
function close() {
|
|
58
|
-
if (done) return;
|
|
59
|
-
done = true;
|
|
60
|
-
complete.parentNode.removeChild(complete);
|
|
61
|
-
}
|
|
62
|
-
function pick() {
|
|
63
|
-
insert(completions[sel.selectedIndex]);
|
|
64
|
-
close();
|
|
65
|
-
setTimeout(function(){editor.focus();}, 50);
|
|
66
|
-
}
|
|
67
|
-
CodeMirror.connect(sel, "blur", close);
|
|
68
|
-
CodeMirror.connect(sel, "keydown", function(event) {
|
|
69
|
-
var code = event.keyCode;
|
|
70
|
-
// Enter
|
|
71
|
-
if (code == 13) {CodeMirror.e_stop(event); pick();}
|
|
72
|
-
// Escape
|
|
73
|
-
else if (code == 27) {CodeMirror.e_stop(event); close(); editor.focus();}
|
|
74
|
-
else if (code != 38 && code != 40) {
|
|
75
|
-
close(); editor.focus();
|
|
76
|
-
// Pass the event to the CodeMirror instance so that it can handle things like backspace properly.
|
|
77
|
-
editor.triggerOnKeyDown(event);
|
|
78
|
-
// Don't show completions if the code is backspace and the option is set.
|
|
79
|
-
if (!options.closeOnBackspace || code != 8) {
|
|
80
|
-
setTimeout(function(){collectHints(tempToken);}, 50);
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
});
|
|
84
|
-
CodeMirror.connect(sel, "dblclick", pick);
|
|
85
|
-
|
|
86
|
-
sel.focus();
|
|
87
|
-
// Opera sometimes ignores focusing a freshly created node
|
|
88
|
-
if (window.opera) setTimeout(function(){if (!done) sel.focus();}, 100);
|
|
89
|
-
return true;
|
|
90
|
-
}
|
|
91
|
-
return collectHints();
|
|
92
|
-
};
|
|
93
|
-
CodeMirror.simpleHint.defaults = {
|
|
94
|
-
closeOnBackspace: true,
|
|
95
|
-
closeOnTokenChange: false
|
|
96
|
-
};
|
|
97
|
-
})();
|
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
(function() {
|
|
3
|
-
|
|
4
|
-
CodeMirror.xmlHints = [];
|
|
5
|
-
|
|
6
|
-
CodeMirror.xmlHint = function(cm, simbol) {
|
|
7
|
-
|
|
8
|
-
if(simbol.length > 0) {
|
|
9
|
-
var cursor = cm.getCursor();
|
|
10
|
-
cm.replaceSelection(simbol);
|
|
11
|
-
cursor = {line: cursor.line, ch: cursor.ch + 1};
|
|
12
|
-
cm.setCursor(cursor);
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
// dirty hack for simple-hint to receive getHint event on space
|
|
16
|
-
var getTokenAt = editor.getTokenAt;
|
|
17
|
-
|
|
18
|
-
editor.getTokenAt = function() { return 'disabled'; };
|
|
19
|
-
CodeMirror.simpleHint(cm, getHint);
|
|
20
|
-
|
|
21
|
-
editor.getTokenAt = getTokenAt;
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
var getHint = function(cm) {
|
|
25
|
-
|
|
26
|
-
var cursor = cm.getCursor();
|
|
27
|
-
|
|
28
|
-
if (cursor.ch > 0) {
|
|
29
|
-
|
|
30
|
-
var text = cm.getRange({line: 0, ch: 0}, cursor);
|
|
31
|
-
var typed = '';
|
|
32
|
-
var simbol = '';
|
|
33
|
-
for(var i = text.length - 1; i >= 0; i--) {
|
|
34
|
-
if(text[i] == ' ' || text[i] == '<') {
|
|
35
|
-
simbol = text[i];
|
|
36
|
-
break;
|
|
37
|
-
}
|
|
38
|
-
else {
|
|
39
|
-
typed = text[i] + typed;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
text = text.slice(0, text.length - typed.length);
|
|
44
|
-
|
|
45
|
-
var path = getActiveElement(cm, text) + simbol;
|
|
46
|
-
var hints = CodeMirror.xmlHints[path];
|
|
47
|
-
|
|
48
|
-
if(typeof hints === 'undefined')
|
|
49
|
-
hints = [''];
|
|
50
|
-
else {
|
|
51
|
-
hints = hints.slice(0);
|
|
52
|
-
for (var i = hints.length - 1; i >= 0; i--) {
|
|
53
|
-
if(hints[i].indexOf(typed) != 0)
|
|
54
|
-
hints.splice(i, 1);
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
return {
|
|
59
|
-
list: hints,
|
|
60
|
-
from: { line: cursor.line, ch: cursor.ch - typed.length },
|
|
61
|
-
to: cursor
|
|
62
|
-
};
|
|
63
|
-
};
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
var getActiveElement = function(codeMirror, text) {
|
|
67
|
-
|
|
68
|
-
var element = '';
|
|
69
|
-
|
|
70
|
-
if(text.length >= 0) {
|
|
71
|
-
|
|
72
|
-
var regex = new RegExp('<([^!?][^\\s/>]*).*?>', 'g');
|
|
73
|
-
|
|
74
|
-
var matches = [];
|
|
75
|
-
var match;
|
|
76
|
-
while ((match = regex.exec(text)) != null) {
|
|
77
|
-
matches.push({
|
|
78
|
-
tag: match[1],
|
|
79
|
-
selfclose: (match[0].slice(match[0].length - 2) === '/>')
|
|
80
|
-
});
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
for (var i = matches.length - 1, skip = 0; i >= 0; i--) {
|
|
84
|
-
|
|
85
|
-
var item = matches[i];
|
|
86
|
-
|
|
87
|
-
if (item.tag[0] == '/')
|
|
88
|
-
{
|
|
89
|
-
skip++;
|
|
90
|
-
}
|
|
91
|
-
else if (item.selfclose == false)
|
|
92
|
-
{
|
|
93
|
-
if (skip > 0)
|
|
94
|
-
{
|
|
95
|
-
skip--;
|
|
96
|
-
}
|
|
97
|
-
else
|
|
98
|
-
{
|
|
99
|
-
element = '<' + item.tag + '>' + element;
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
element += getOpenTag(text);
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
return element;
|
|
108
|
-
};
|
|
109
|
-
|
|
110
|
-
var getOpenTag = function(text) {
|
|
111
|
-
|
|
112
|
-
var open = text.lastIndexOf('<');
|
|
113
|
-
var close = text.lastIndexOf('>');
|
|
114
|
-
|
|
115
|
-
if (close < open)
|
|
116
|
-
{
|
|
117
|
-
text = text.slice(open);
|
|
118
|
-
|
|
119
|
-
if(text != '<') {
|
|
120
|
-
|
|
121
|
-
var space = text.indexOf(' ');
|
|
122
|
-
if(space < 0)
|
|
123
|
-
space = text.indexOf('\t');
|
|
124
|
-
if(space < 0)
|
|
125
|
-
space = text.indexOf('\n');
|
|
126
|
-
|
|
127
|
-
if (space < 0)
|
|
128
|
-
space = text.length;
|
|
129
|
-
|
|
130
|
-
return text.slice(0, space);
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
return '';
|
|
135
|
-
};
|
|
136
|
-
|
|
137
|
-
})();
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
Ext.define('Netzke.Grid.EventHandlers', {
|
|
2
|
-
override: 'Netzke.Grid.EventHandlers',
|
|
3
|
-
netzkeHandleItemdblclick: function(view, record) {
|
|
4
|
-
if (this.editsInline) return; // inline editing is handled elsewhere
|
|
5
|
-
|
|
6
|
-
// MONKEY: add view in form capability
|
|
7
|
-
var has_perm = (this.permissions || {});
|
|
8
|
-
if (has_perm.read !== false && !has_perm.update) {
|
|
9
|
-
this.doViewInForm(record);
|
|
10
|
-
} else if (has_perm.update !== false) {
|
|
11
|
-
this.doEditInForm(record);
|
|
12
|
-
}
|
|
13
|
-
},
|
|
14
|
-
|
|
15
|
-
netzkeReloadStore: function(opts={}) {
|
|
16
|
-
var store = this.getStore();
|
|
17
|
-
|
|
18
|
-
// MONKEY: add beforenetzkereload and netzkerevent on store
|
|
19
|
-
store.fireEvent('beforenetzkereload');
|
|
20
|
-
var callback = opts.callback;
|
|
21
|
-
opts.callback = function() {
|
|
22
|
-
if (callback) { callback() }
|
|
23
|
-
store.fireEvent('netzkereload');
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
// NETZKE'S HACK to work around buffered store's buggy reload()
|
|
27
|
-
if (!store.lastRequestStart) {
|
|
28
|
-
store.load(opts);
|
|
29
|
-
} else store.reload(opts);
|
|
30
|
-
},
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
Ext.define('Ext.toolbar.Paging', {
|
|
34
|
-
override: 'Ext.toolbar.Paging',
|
|
35
|
-
|
|
36
|
-
handleRefresh: Ext.emptyFn,
|
|
37
|
-
|
|
38
|
-
doRefresh: function() {
|
|
39
|
-
var me = this,
|
|
40
|
-
current = me.store.currentPage;
|
|
41
|
-
|
|
42
|
-
// MONKEY: add netzkerefresh to ExtJS paging toolbar refresh
|
|
43
|
-
// as beforechange is too generic
|
|
44
|
-
me.store.fireEvent('netzkerefresh', me);
|
|
45
|
-
|
|
46
|
-
if (me.fireEvent('beforechange', me, current) !== false) {
|
|
47
|
-
me.store.loadPage(current);
|
|
48
|
-
|
|
49
|
-
me.handleRefresh();
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
Ext.define('Netzke.Grid.Columns', {
|
|
55
|
-
override: 'Netzke.Grid.Columns',
|
|
56
|
-
netzkeNormalizeAssociationRenderer: function(c) {
|
|
57
|
-
var passedRenderer = c.renderer, // renderer we got from netzkeNormalizeRenderer
|
|
58
|
-
assocValue;
|
|
59
|
-
c.scope = this;
|
|
60
|
-
c.renderer = function(value, a, r, ri, ci, store, view){
|
|
61
|
-
var column = view.headerCt.items.getAt(ci),
|
|
62
|
-
editor = column.getEditor && column.getEditor(),
|
|
63
|
-
|
|
64
|
-
/* MONKEY: use findRecordByValue instead of findRecord to remedy inline editing temporarily
|
|
65
|
-
changing N/A columns to the recently changed value.
|
|
66
|
-
*/
|
|
67
|
-
recordFromStore = editor && editor.isXType('combobox') && editor.findRecordByValue(value),
|
|
68
|
-
renderedValue;
|
|
69
|
-
|
|
70
|
-
if (recordFromStore) {
|
|
71
|
-
renderedValue = recordFromStore.get('text');
|
|
72
|
-
} else if ((assocValue = (r.get('association_values') || {})[c.name]) !== undefined) {
|
|
73
|
-
renderedValue = (assocValue == undefined) ? c.emptyText : assocValue;
|
|
74
|
-
} else {
|
|
75
|
-
renderedValue = value;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
return passedRenderer ? passedRenderer.call(this, renderedValue) : renderedValue;
|
|
79
|
-
};
|
|
80
|
-
},
|
|
81
|
-
});
|