cpee 2.0.17 → 2.0.22
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/cockpit/css/wfadaptor.css +17 -0
- data/cockpit/js/instance.js +0 -1
- data/cockpit/js_libs.zip +0 -0
- data/cockpit/themes/model/rngs/call.rng +2 -1
- data/cockpit/themes/model/rngs/callmanipulate.rng +2 -1
- data/cockpit/themes/model/theme.js +1 -1
- data/cpee.gemspec +2 -2
- data/lib/cpee/controller.rb +6 -3
- data/lib/cpee/implementation.rb +23 -8
- data/lib/cpee/implementation_notifications.rb +1 -1
- data/lib/cpee/persistence.rb +2 -1
- data/lib/cpee/redis.rb +57 -0
- data/server/handlerwrappers/default.rb +15 -15
- data/server/routing/end.rb +16 -4
- data/server/routing/forward-events.rb +19 -7
- data/server/routing/forward-votes.rb +19 -7
- data/server/routing/persist.rb +27 -15
- data/tools/cpee +5 -5
- data/tools/test/README +4 -0
- data/tools/test/config.json +3 -0
- data/tools/test/contrib/graph_example.svg +1166 -0
- data/tools/test/contrib/legend.svg +817 -0
- data/tools/test/contrib/symbols.svg +224 -0
- data/tools/test/contrib/transformation1.xsl +264 -0
- data/tools/test/contrib/transformation2.xsl +10 -0
- data/tools/test/contrib/tree_example.svg +788 -0
- data/tools/test/css/model.css +24 -0
- data/tools/test/css/track.css +60 -0
- data/tools/test/css/ui.css +214 -0
- data/tools/test/css/wfadaptor.css +422 -0
- data/tools/test/edit.html +258 -0
- data/tools/test/graph.html +69 -0
- data/tools/test/index.html +258 -0
- data/tools/test/js/details.js +109 -0
- data/tools/test/js/instance.js +1344 -0
- data/tools/test/js/model.js +41 -0
- data/tools/test/js/parameters.js +82 -0
- data/tools/test/js/track.js +18 -0
- data/tools/test/js/ui.js +104 -0
- data/tools/test/js/wfadaptor.js +763 -0
- data/tools/test/js_libs.zip +0 -0
- data/tools/test/js_libs/Makefile +2 -0
- data/tools/test/js_libs/ansi_up.js +333 -0
- data/tools/test/js_libs/console.js +80 -0
- data/tools/test/js_libs/custommenu.css +84 -0
- data/tools/test/js_libs/custommenu.js +104 -0
- data/tools/test/js_libs/experiments1/relaxngui.css +185 -0
- data/tools/test/js_libs/experiments1/relaxngui.js +488 -0
- data/tools/test/js_libs/experiments1/rngtest9.html +60 -0
- data/tools/test/js_libs/experiments1/rngtest9.rng +35 -0
- data/tools/test/js_libs/experiments1/rngtest9.xml +8 -0
- data/tools/test/js_libs/jquery-2.2.4.min.js +4 -0
- data/tools/test/js_libs/jquery-3.2.1.min.js +4 -0
- data/tools/test/js_libs/jquery-3.3.1.min.js +2 -0
- data/tools/test/js_libs/jquery.browser.js +40 -0
- data/tools/test/js_libs/jquery.caret.min.js +10 -0
- data/tools/test/js_libs/jquery.cookie.js +117 -0
- data/tools/test/js_libs/jquery.min.js +1 -0
- data/tools/test/js_libs/jquery.svg.min.js +6 -0
- data/tools/test/js_libs/jquery.svgdom.min.js +6 -0
- data/tools/test/js_libs/markdown.min.js +1 -0
- data/tools/test/js_libs/parsequery.js +21 -0
- data/tools/test/js_libs/printf.js +368 -0
- data/tools/test/js_libs/relaxngui.css +213 -0
- data/tools/test/js_libs/relaxngui.js +543 -0
- data/tools/test/js_libs/strftime.min.js +1 -0
- data/tools/test/js_libs/tests/dataelements.html +59 -0
- data/tools/test/js_libs/tests/dataelements.rng +8 -0
- data/tools/test/js_libs/tests/dataelements.xml +3 -0
- data/tools/test/js_libs/tests/relaxngui.css +203 -0
- data/tools/test/js_libs/tests/relaxngui.js +502 -0
- data/tools/test/js_libs/tests/rngtest1.html +66 -0
- data/tools/test/js_libs/tests/rngtest1.rng +147 -0
- data/tools/test/js_libs/tests/rngtest1.xml +13 -0
- data/tools/test/js_libs/tests/rngtest2.html +60 -0
- data/tools/test/js_libs/tests/rngtest2.rng +6 -0
- data/tools/test/js_libs/tests/rngtest2.xml +3 -0
- data/tools/test/js_libs/tests/rngtest3.html +60 -0
- data/tools/test/js_libs/tests/rngtest3.rng +23 -0
- data/tools/test/js_libs/tests/rngtest3.xml +9 -0
- data/tools/test/js_libs/tests/rngtest4.html +60 -0
- data/tools/test/js_libs/tests/rngtest4.rng +19 -0
- data/tools/test/js_libs/tests/rngtest4.xml +12 -0
- data/tools/test/js_libs/tests/rngtest5.html +60 -0
- data/tools/test/js_libs/tests/rngtest5.rng +75 -0
- data/tools/test/js_libs/tests/rngtest5.xml +40 -0
- data/tools/test/js_libs/tests/rngtest6.html +60 -0
- data/tools/test/js_libs/tests/rngtest6.rng +24 -0
- data/tools/test/js_libs/tests/rngtest6.xml +6 -0
- data/tools/test/js_libs/tests/rngtest8.html +60 -0
- data/tools/test/js_libs/tests/rngtest8.rng +13 -0
- data/tools/test/js_libs/tests/rngtest8.xml +2 -0
- data/tools/test/js_libs/tests/rngtest9.html +60 -0
- data/tools/test/js_libs/tests/rngtest9.rng +31 -0
- data/tools/test/js_libs/tests/rngtest9.xml +8 -0
- data/tools/test/js_libs/ui.css +333 -0
- data/tools/test/js_libs/ui.html +168 -0
- data/tools/test/js_libs/ui.js +177 -0
- data/tools/test/js_libs/underscore.min.js +27 -0
- data/tools/test/js_libs/util.js +81 -0
- data/tools/test/js_libs/vkbeautify.0.99.00.beta.js +358 -0
- data/tools/test/js_libs/vkbeautify.js +1 -0
- data/tools/test/js_libs/webcomponents.min.js +196 -0
- data/tools/test/model.html +192 -0
- data/tools/test/rngs/attributes.rng +8 -0
- data/tools/test/rngs/dataelements.rng +8 -0
- data/tools/test/rngs/endpoints.rng +8 -0
- data/tools/test/templates.legacy/Async.xml +46 -0
- data/tools/test/templates.legacy/BCO.xml +70 -0
- data/tools/test/templates.legacy/BCS.xml +70 -0
- data/tools/test/templates.legacy/Centurio.xml +75 -0
- data/tools/test/templates.legacy/Concurrent.xml +40 -0
- data/tools/test/templates.legacy/Coopis Testset.xml +76 -0
- data/tools/test/templates.legacy/Endpoints and Data Manipulation.xml +30 -0
- data/tools/test/templates.legacy/ICSOC Testset.xml +95 -0
- data/tools/test/templates.legacy/Infinity.xml +28 -0
- data/tools/test/templates.legacy/Lego Boxer.xml +31 -0
- data/tools/test/templates.legacy/Lego Conveyor.xml +31 -0
- data/tools/test/templates.legacy/Lego Crane.xml +87 -0
- data/tools/test/templates.legacy/Lego Ejector.xml +55 -0
- data/tools/test/templates.legacy/Lego Full.xml +142 -0
- data/tools/test/templates.legacy/Lego Liddy.xml +40 -0
- data/tools/test/templates.legacy/Lego Plate.xml +31 -0
- data/tools/test/templates.legacy/Lego Transporter.xml +43 -0
- data/tools/test/templates.legacy/Lego_Part_1.xml +85 -0
- data/tools/test/templates.legacy/LgLinear.xml +65 -0
- data/tools/test/templates.legacy/Linear.xml +77 -0
- data/tools/test/templates.legacy/Log.xml +117 -0
- data/tools/test/templates.legacy/Mangler 1.xml +87 -0
- data/tools/test/templates.legacy/Mangler 2.xml +103 -0
- data/tools/test/templates.legacy/Manuel Labels.xml +55 -0
- data/tools/test/templates.legacy/Promise.xml +275 -0
- data/tools/test/templates.legacy/SOPROMO Test Sonification.xml +83 -0
- data/tools/test/templates.legacy/Subprocess.xml +56 -0
- data/tools/test/templates.legacy/Syncing P34 1.xml +77 -0
- data/tools/test/templates.legacy/Syncing P34 2.xml +77 -0
- data/tools/test/templates.legacy/Syncing P34 3.xml +77 -0
- data/tools/test/templates.legacy/Syncing P34.xml +77 -0
- data/tools/test/templates.legacy/TEST - Bad Loop.xml +173 -0
- data/tools/test/templates.legacy/TEST - Wrong Positions.xml +174 -0
- data/tools/test/templates.legacy/Take_5.xml +48 -0
- data/tools/test/templates.legacy/Update.xml +32 -0
- data/tools/test/templates.legacy/Worklist Parallel.xml +104 -0
- data/tools/test/templates.legacy/Worklist Test CPEE.xml +40 -0
- data/tools/test/templates.legacy/Worklist Test.xml +42 -0
- data/tools/test/templates.legacy/Worklist Test2.xml +43 -0
- data/tools/test/templates.legacy/convert_cpee2.rb +15 -0
- data/tools/test/templates.legacy/convert_preset.rb +32 -0
- data/tools/test/templates.legacy/testsets.xml +37 -0
- data/tools/test/templates.legacy/transformations.xml +4 -0
- data/tools/test/templates/Coopis 2010.xml +76 -0
- data/tools/test/templates/IUPC arXiv:1104.3609 P34 1.xml +77 -0
- data/tools/test/templates/IUPC arXiv:1104.3609 P34 2.xml +77 -0
- data/tools/test/templates/IUPC arXiv:1104.3609 P34 3.xml +77 -0
- data/tools/test/templates/Track Test Local.xml +82 -0
- data/tools/test/templates/Track Test.xml +82 -0
- data/tools/test/templates/UR-VUE 2020 Manual Adjust.xml +182 -0
- data/tools/test/templates/UR-VUE 2020 Solution Baseline.xml +203 -0
- data/tools/test/templates/UR-VUE 2020 Solution NN.xml +197 -0
- data/tools/test/templates/UR-VUE 2020 Solution View.xml +151 -0
- data/tools/test/templates/UR-VUE 2020.xml +26 -0
- data/tools/test/templates/Worklist.xml +42 -0
- data/tools/test/templates/instantiate.local/Take_Sub.xml +59 -0
- data/tools/test/templates/instantiate/Take_Perf.xml +46 -0
- data/tools/test/templates/instantiate/Take_Sub.xml +58 -0
- data/tools/test/templates/instantiate/Take_X.xml +48 -0
- data/tools/test/themes/compact/theme.js +1285 -0
- data/tools/test/themes/diana/theme.js +1650 -0
- data/tools/test/themes/extended/theme.js +1325 -0
- data/tools/test/themes/model/rngs/alternative.rng +1 -0
- data/tools/test/themes/model/rngs/call.rng +67 -0
- data/tools/test/themes/model/rngs/callmanipulate.rng +72 -0
- data/tools/test/themes/model/rngs/choose.rng +1 -0
- data/tools/test/themes/model/rngs/critical.rng +1 -0
- data/tools/test/themes/model/rngs/escape.rng +1 -0
- data/tools/test/themes/model/rngs/group.rng +1 -0
- data/tools/test/themes/model/rngs/loop.rng +1 -0
- data/tools/test/themes/model/rngs/manipulate.rng +1 -0
- data/tools/test/themes/model/rngs/otherwise.rng +1 -0
- data/tools/test/themes/model/rngs/parallel.rng +1 -0
- data/tools/test/themes/model/rngs/parallel_branch.rng +1 -0
- data/tools/test/themes/model/rngs/scripts.rng +7 -0
- data/tools/test/themes/model/rngs/stop.rng +1 -0
- data/tools/test/themes/model/rngs/terminate.rng +1 -0
- data/tools/test/themes/model/theme.js +1268 -0
- data/tools/test/themes/packed/theme.js +1286 -0
- data/tools/test/themes/preset/rngs/alternative.rng +25 -0
- data/tools/test/themes/preset/rngs/call.rng +122 -0
- data/tools/test/themes/preset/rngs/callmanipulate.rng +145 -0
- data/tools/test/themes/preset/rngs/choose.rng +14 -0
- data/tools/test/themes/preset/rngs/closed_loop.rng +62 -0
- data/tools/test/themes/preset/rngs/closed_loop_cancel.rng +5 -0
- data/tools/test/themes/preset/rngs/closed_loop_control.rng +31 -0
- data/tools/test/themes/preset/rngs/closed_loop_measuring.rng +12 -0
- data/tools/test/themes/preset/rngs/critical.rng +5 -0
- data/tools/test/themes/preset/rngs/escape.rng +1 -0
- data/tools/test/themes/preset/rngs/group.rng +3 -0
- data/tools/test/themes/preset/rngs/loop.rng +22 -0
- data/tools/test/themes/preset/rngs/manipulate.rng +9 -0
- data/tools/test/themes/preset/rngs/otherwise.rng +22 -0
- data/tools/test/themes/preset/rngs/parallel.rng +21 -0
- data/tools/test/themes/preset/rngs/parallel_branch.rng +8 -0
- data/tools/test/themes/preset/rngs/scripts.rng +23 -0
- data/tools/test/themes/preset/rngs/stop.rng +5 -0
- data/tools/test/themes/preset/rngs/terminate.rng +1 -0
- data/tools/test/themes/preset/symbols/alternative.svg +5 -0
- data/tools/test/themes/preset/symbols/arrow.svg +3 -0
- data/tools/test/themes/preset/symbols/call.svg +6 -0
- data/tools/test/themes/preset/symbols/callmanipulate.svg +8 -0
- data/tools/test/themes/preset/symbols/choose.svg +5 -0
- data/tools/test/themes/preset/symbols/choose_exclusive.svg +5 -0
- data/tools/test/themes/preset/symbols/choose_inclusive.svg +4 -0
- data/tools/test/themes/preset/symbols/closed_loop.svg +5 -0
- data/tools/test/themes/preset/symbols/closed_loop_cancel.svg +5 -0
- data/tools/test/themes/preset/symbols/closed_loop_control.svg +5 -0
- data/tools/test/themes/preset/symbols/closed_loop_measuring.svg +6 -0
- data/tools/test/themes/preset/symbols/complex.svg +8 -0
- data/tools/test/themes/preset/symbols/critical.svg +4 -0
- data/tools/test/themes/preset/symbols/end.svg +3 -0
- data/tools/test/themes/preset/symbols/escape.svg +5 -0
- data/tools/test/themes/preset/symbols/event_end.svg +3 -0
- data/tools/test/themes/preset/symbols/loop.svg +5 -0
- data/tools/test/themes/preset/symbols/manipulate.svg +4 -0
- data/tools/test/themes/preset/symbols/otherwise.svg +5 -0
- data/tools/test/themes/preset/symbols/parallel.svg +5 -0
- data/tools/test/themes/preset/symbols/parallel_branch.svg +5 -0
- data/tools/test/themes/preset/symbols/parallel_branch_compact.svg +4 -0
- data/tools/test/themes/preset/symbols/parallel_branch_event.svg +14 -0
- data/tools/test/themes/preset/symbols/parallel_branch_normal.svg +5 -0
- data/tools/test/themes/preset/symbols/scripts.svg +4 -0
- data/tools/test/themes/preset/symbols/start.svg +3 -0
- data/tools/test/themes/preset/symbols/stop.svg +5 -0
- data/tools/test/themes/preset/symbols/terminate.svg +4 -0
- data/tools/test/themes/preset/theme.js +1287 -0
- data/tools/test/track.html +142 -0
- metadata +221 -3
- data/cockpit/edit.html +0 -1
Binary file
|
@@ -0,0 +1,333 @@
|
|
1
|
+
/* ansi_up.js
|
2
|
+
* author : Dru Nelson
|
3
|
+
* license : MIT
|
4
|
+
* http://github.com/drudru/ansi_up
|
5
|
+
*/
|
6
|
+
(function (root, factory) {
|
7
|
+
if (typeof define === 'function' && define.amd) {
|
8
|
+
// AMD. Register as an anonymous module.
|
9
|
+
define(['exports'], factory);
|
10
|
+
} else if (typeof exports === 'object' && typeof exports.nodeName !== 'string') {
|
11
|
+
// CommonJS
|
12
|
+
factory(exports);
|
13
|
+
} else {
|
14
|
+
// Browser globals
|
15
|
+
var exp = {};
|
16
|
+
factory(exp);
|
17
|
+
root.AnsiUp = exp.default;
|
18
|
+
}
|
19
|
+
}(this, function (exports) {
|
20
|
+
"use strict";
|
21
|
+
function rgx(tmplObj) {
|
22
|
+
var subst = [];
|
23
|
+
for (var _i = 1; _i < arguments.length; _i++) {
|
24
|
+
subst[_i - 1] = arguments[_i];
|
25
|
+
}
|
26
|
+
var regexText = tmplObj.raw[0];
|
27
|
+
var wsrgx = /^\s+|\s+\n|\s+#[\s\S]+?\n/gm;
|
28
|
+
var txt2 = regexText.replace(wsrgx, '');
|
29
|
+
return new RegExp(txt2, 'm');
|
30
|
+
}
|
31
|
+
var AnsiUp = (function () {
|
32
|
+
function AnsiUp() {
|
33
|
+
this.VERSION = "3.0.0";
|
34
|
+
this.ansi_colors = [
|
35
|
+
[
|
36
|
+
{ rgb: [0, 0, 0], class_name: "ansi-black" },
|
37
|
+
{ rgb: [187, 0, 0], class_name: "ansi-red" },
|
38
|
+
{ rgb: [0, 187, 0], class_name: "ansi-green" },
|
39
|
+
{ rgb: [187, 187, 0], class_name: "ansi-yellow" },
|
40
|
+
{ rgb: [0, 0, 187], class_name: "ansi-blue" },
|
41
|
+
{ rgb: [187, 0, 187], class_name: "ansi-magenta" },
|
42
|
+
{ rgb: [0, 187, 187], class_name: "ansi-cyan" },
|
43
|
+
{ rgb: [255, 255, 255], class_name: "ansi-white" }
|
44
|
+
],
|
45
|
+
[
|
46
|
+
{ rgb: [85, 85, 85], class_name: "ansi-bright-black" },
|
47
|
+
{ rgb: [255, 85, 85], class_name: "ansi-bright-red" },
|
48
|
+
{ rgb: [0, 255, 0], class_name: "ansi-bright-green" },
|
49
|
+
{ rgb: [255, 255, 85], class_name: "ansi-bright-yellow" },
|
50
|
+
{ rgb: [85, 85, 255], class_name: "ansi-bright-blue" },
|
51
|
+
{ rgb: [255, 85, 255], class_name: "ansi-bright-magenta" },
|
52
|
+
{ rgb: [85, 255, 255], class_name: "ansi-bright-cyan" },
|
53
|
+
{ rgb: [255, 255, 255], class_name: "ansi-bright-white" }
|
54
|
+
]
|
55
|
+
];
|
56
|
+
this.htmlFormatter = {
|
57
|
+
transform: function (fragment, instance) {
|
58
|
+
var txt = fragment.text;
|
59
|
+
if (txt.length === 0)
|
60
|
+
return txt;
|
61
|
+
if (instance._escape_for_html)
|
62
|
+
txt = instance.old_escape_for_html(txt);
|
63
|
+
if (!fragment.bold && fragment.fg === null && fragment.bg === null)
|
64
|
+
return txt;
|
65
|
+
var styles = [];
|
66
|
+
var classes = [];
|
67
|
+
var fg = fragment.fg;
|
68
|
+
var bg = fragment.bg;
|
69
|
+
if (fragment.bold)
|
70
|
+
styles.push('font-weight:bold');
|
71
|
+
if (!instance._use_classes) {
|
72
|
+
if (fg)
|
73
|
+
styles.push("color:rgb(" + fg.rgb.join(',') + ")");
|
74
|
+
if (bg)
|
75
|
+
styles.push("background-color:rgb(" + bg.rgb + ")");
|
76
|
+
}
|
77
|
+
else {
|
78
|
+
if (fg) {
|
79
|
+
if (fg.class_name !== 'truecolor') {
|
80
|
+
classes.push(fg.class_name + "-fg");
|
81
|
+
}
|
82
|
+
else {
|
83
|
+
styles.push("color:rgb(" + fg.rgb.join(',') + ")");
|
84
|
+
}
|
85
|
+
}
|
86
|
+
if (bg) {
|
87
|
+
if (bg.class_name !== 'truecolor') {
|
88
|
+
classes.push(bg.class_name + "-bg");
|
89
|
+
}
|
90
|
+
else {
|
91
|
+
styles.push("background-color:rgb(" + bg.rgb.join(',') + ")");
|
92
|
+
}
|
93
|
+
}
|
94
|
+
}
|
95
|
+
var class_string = '';
|
96
|
+
var style_string = '';
|
97
|
+
if (classes.length)
|
98
|
+
class_string = " class=\"" + classes.join(' ') + "\"";
|
99
|
+
if (styles.length)
|
100
|
+
style_string = " style=\"" + styles.join(';') + "\"";
|
101
|
+
return "<span" + style_string + class_string + ">" + txt + "</span>";
|
102
|
+
},
|
103
|
+
compose: function (segments, instance) {
|
104
|
+
return segments.join("");
|
105
|
+
}
|
106
|
+
};
|
107
|
+
this.textFormatter = {
|
108
|
+
transform: function (fragment, instance) {
|
109
|
+
return fragment.text;
|
110
|
+
},
|
111
|
+
compose: function (segments, instance) {
|
112
|
+
return segments.join("");
|
113
|
+
}
|
114
|
+
};
|
115
|
+
this.setup_256_palette();
|
116
|
+
this._use_classes = false;
|
117
|
+
this._escape_for_html = true;
|
118
|
+
this.bold = false;
|
119
|
+
this.fg = this.bg = null;
|
120
|
+
this._buffer = '';
|
121
|
+
}
|
122
|
+
Object.defineProperty(AnsiUp.prototype, "use_classes", {
|
123
|
+
get: function () {
|
124
|
+
return this._use_classes;
|
125
|
+
},
|
126
|
+
set: function (arg) {
|
127
|
+
this._use_classes = arg;
|
128
|
+
},
|
129
|
+
enumerable: true,
|
130
|
+
configurable: true
|
131
|
+
});
|
132
|
+
Object.defineProperty(AnsiUp.prototype, "escape_for_html", {
|
133
|
+
get: function () {
|
134
|
+
return this._escape_for_html;
|
135
|
+
},
|
136
|
+
set: function (arg) {
|
137
|
+
this._escape_for_html = arg;
|
138
|
+
},
|
139
|
+
enumerable: true,
|
140
|
+
configurable: true
|
141
|
+
});
|
142
|
+
AnsiUp.prototype.setup_256_palette = function () {
|
143
|
+
var _this = this;
|
144
|
+
this.palette_256 = [];
|
145
|
+
this.ansi_colors.forEach(function (palette) {
|
146
|
+
palette.forEach(function (rec) {
|
147
|
+
_this.palette_256.push(rec);
|
148
|
+
});
|
149
|
+
});
|
150
|
+
var levels = [0, 95, 135, 175, 215, 255];
|
151
|
+
for (var r = 0; r < 6; ++r) {
|
152
|
+
for (var g = 0; g < 6; ++g) {
|
153
|
+
for (var b = 0; b < 6; ++b) {
|
154
|
+
var col = { rgb: [levels[r], levels[g], levels[b]], class_name: 'truecolor' };
|
155
|
+
this.palette_256.push(col);
|
156
|
+
}
|
157
|
+
}
|
158
|
+
}
|
159
|
+
var grey_level = 8;
|
160
|
+
for (var i = 0; i < 24; ++i, grey_level += 10) {
|
161
|
+
var gry = { rgb: [grey_level, grey_level, grey_level], class_name: 'truecolor' };
|
162
|
+
this.palette_256.push(gry);
|
163
|
+
}
|
164
|
+
};
|
165
|
+
AnsiUp.prototype.old_escape_for_html = function (txt) {
|
166
|
+
return txt.replace(/[&<>]/gm, function (str) {
|
167
|
+
if (str === "&")
|
168
|
+
return "&";
|
169
|
+
if (str === "<")
|
170
|
+
return "<";
|
171
|
+
if (str === ">")
|
172
|
+
return ">";
|
173
|
+
});
|
174
|
+
};
|
175
|
+
AnsiUp.prototype.old_linkify = function (txt) {
|
176
|
+
return txt.replace(/(https?:\/\/[^\s]+)/gm, function (str) {
|
177
|
+
return "<a href=\"" + str + "\">" + str + "</a>";
|
178
|
+
});
|
179
|
+
};
|
180
|
+
AnsiUp.prototype.detect_incomplete_ansi = function (txt) {
|
181
|
+
return !(/.*?[\x40-\x7e]/.test(txt));
|
182
|
+
};
|
183
|
+
AnsiUp.prototype.detect_incomplete_link = function (txt) {
|
184
|
+
var found = false;
|
185
|
+
for (var i = txt.length - 1; i > 0; i--) {
|
186
|
+
if (/\s|\x1B/.test(txt[i])) {
|
187
|
+
found = true;
|
188
|
+
break;
|
189
|
+
}
|
190
|
+
}
|
191
|
+
if (!found) {
|
192
|
+
if (/(https?:\/\/[^\s]+)/.test(txt))
|
193
|
+
return 0;
|
194
|
+
else
|
195
|
+
return -1;
|
196
|
+
}
|
197
|
+
var prefix = txt.substr(i + 1, 4);
|
198
|
+
if (prefix.length === 0)
|
199
|
+
return -1;
|
200
|
+
if ("http".indexOf(prefix) === 0)
|
201
|
+
return (i + 1);
|
202
|
+
};
|
203
|
+
AnsiUp.prototype.ansi_to = function (txt, formatter) {
|
204
|
+
var pkt = this._buffer + txt;
|
205
|
+
this._buffer = '';
|
206
|
+
var raw_text_pkts = pkt.split(/\x1B\[/);
|
207
|
+
if (raw_text_pkts.length === 1)
|
208
|
+
raw_text_pkts.push('');
|
209
|
+
this.handle_incomplete_sequences(raw_text_pkts);
|
210
|
+
var first_chunk = this.with_state(raw_text_pkts.shift());
|
211
|
+
var blocks = new Array(raw_text_pkts.length);
|
212
|
+
for (var i = 0, len = raw_text_pkts.length; i < len; ++i) {
|
213
|
+
blocks[i] = (formatter.transform(this.process_ansi(raw_text_pkts[i]), this));
|
214
|
+
}
|
215
|
+
if (first_chunk.text.length > 0)
|
216
|
+
blocks.unshift(formatter.transform(first_chunk, this));
|
217
|
+
return formatter.compose(blocks, this);
|
218
|
+
};
|
219
|
+
AnsiUp.prototype.ansi_to_html = function (txt) {
|
220
|
+
return this.ansi_to(txt, this.htmlFormatter);
|
221
|
+
};
|
222
|
+
AnsiUp.prototype.ansi_to_text = function (txt) {
|
223
|
+
return this.ansi_to(txt, this.textFormatter);
|
224
|
+
};
|
225
|
+
AnsiUp.prototype.with_state = function (text) {
|
226
|
+
return { bold: this.bold, fg: this.fg, bg: this.bg, text: text };
|
227
|
+
};
|
228
|
+
AnsiUp.prototype.handle_incomplete_sequences = function (chunks) {
|
229
|
+
var last_chunk = chunks[chunks.length - 1];
|
230
|
+
if ((last_chunk.length > 0) && this.detect_incomplete_ansi(last_chunk)) {
|
231
|
+
this._buffer = "\x1B[" + last_chunk;
|
232
|
+
chunks.pop();
|
233
|
+
chunks.push('');
|
234
|
+
}
|
235
|
+
else {
|
236
|
+
if (last_chunk.slice(-1) === "\x1B") {
|
237
|
+
this._buffer = "\x1B";
|
238
|
+
console.log("raw", chunks);
|
239
|
+
chunks.pop();
|
240
|
+
chunks.push(last_chunk.substr(0, last_chunk.length - 1));
|
241
|
+
console.log(chunks);
|
242
|
+
console.log(last_chunk);
|
243
|
+
}
|
244
|
+
if (chunks.length === 2 &&
|
245
|
+
chunks[1] === "" &&
|
246
|
+
chunks[0].slice(-1) === "\x1B") {
|
247
|
+
this._buffer = "\x1B";
|
248
|
+
last_chunk = chunks.shift();
|
249
|
+
chunks.unshift(last_chunk.substr(0, last_chunk.length - 1));
|
250
|
+
}
|
251
|
+
}
|
252
|
+
};
|
253
|
+
AnsiUp.prototype.process_ansi = function (block) {
|
254
|
+
if (!this._sgr_regex) {
|
255
|
+
this._sgr_regex = (_a = ["\n ^ # beginning of line\n ([!<-?]?) # a private-mode char (!, <, =, >, ?)\n ([d;]*) # any digits or semicolons\n ([ -/]? # an intermediate modifier\n [@-~]) # the command\n ([sS]*) # any text following this CSI sequence\n "], _a.raw = ["\n ^ # beginning of line\n ([!\\x3c-\\x3f]?) # a private-mode char (!, <, =, >, ?)\n ([\\d;]*) # any digits or semicolons\n ([\\x20-\\x2f]? # an intermediate modifier\n [\\x40-\\x7e]) # the command\n ([\\s\\S]*) # any text following this CSI sequence\n "], rgx(_a));
|
256
|
+
}
|
257
|
+
var matches = block.match(this._sgr_regex);
|
258
|
+
if (!matches) {
|
259
|
+
return this.with_state(block);
|
260
|
+
}
|
261
|
+
var orig_txt = matches[4];
|
262
|
+
if (matches[1] !== '' || matches[3] !== 'm') {
|
263
|
+
return this.with_state(orig_txt);
|
264
|
+
}
|
265
|
+
var sgr_cmds = matches[2].split(';');
|
266
|
+
while (sgr_cmds.length > 0) {
|
267
|
+
var sgr_cmd_str = sgr_cmds.shift();
|
268
|
+
var num = parseInt(sgr_cmd_str, 10);
|
269
|
+
if (isNaN(num) || num === 0) {
|
270
|
+
this.fg = this.bg = null;
|
271
|
+
this.bold = false;
|
272
|
+
}
|
273
|
+
else if (num === 1) {
|
274
|
+
this.bold = true;
|
275
|
+
}
|
276
|
+
else if (num === 22) {
|
277
|
+
this.bold = false;
|
278
|
+
}
|
279
|
+
else if (num === 39) {
|
280
|
+
this.fg = null;
|
281
|
+
}
|
282
|
+
else if (num === 49) {
|
283
|
+
this.bg = null;
|
284
|
+
}
|
285
|
+
else if ((num >= 30) && (num < 38)) {
|
286
|
+
this.fg = this.ansi_colors[0][(num - 30)];
|
287
|
+
}
|
288
|
+
else if ((num >= 40) && (num < 48)) {
|
289
|
+
this.bg = this.ansi_colors[0][(num - 40)];
|
290
|
+
}
|
291
|
+
else if ((num >= 90) && (num < 98)) {
|
292
|
+
this.fg = this.ansi_colors[1][(num - 90)];
|
293
|
+
}
|
294
|
+
else if ((num >= 100) && (num < 108)) {
|
295
|
+
this.bg = this.ansi_colors[1][(num - 100)];
|
296
|
+
}
|
297
|
+
else if (num === 38 || num === 48) {
|
298
|
+
if (sgr_cmds.length > 0) {
|
299
|
+
var is_foreground = (num === 38);
|
300
|
+
var mode_cmd = sgr_cmds.shift();
|
301
|
+
if (mode_cmd === '5' && sgr_cmds.length > 0) {
|
302
|
+
var palette_index = parseInt(sgr_cmds.shift(), 10);
|
303
|
+
if (palette_index >= 0 && palette_index <= 255) {
|
304
|
+
if (is_foreground)
|
305
|
+
this.fg = this.palette_256[palette_index];
|
306
|
+
else
|
307
|
+
this.bg = this.palette_256[palette_index];
|
308
|
+
}
|
309
|
+
}
|
310
|
+
if (mode_cmd === '2' && sgr_cmds.length > 2) {
|
311
|
+
var r = parseInt(sgr_cmds.shift(), 10);
|
312
|
+
var g = parseInt(sgr_cmds.shift(), 10);
|
313
|
+
var b = parseInt(sgr_cmds.shift(), 10);
|
314
|
+
if ((r >= 0 && r <= 255) && (g >= 0 && g <= 255) && (b >= 0 && b <= 255)) {
|
315
|
+
var c = { rgb: [r, g, b], class_name: 'truecolor' };
|
316
|
+
if (is_foreground)
|
317
|
+
this.fg = c;
|
318
|
+
else
|
319
|
+
this.bg = c;
|
320
|
+
}
|
321
|
+
}
|
322
|
+
}
|
323
|
+
}
|
324
|
+
}
|
325
|
+
return this.with_state(orig_txt);
|
326
|
+
var _a;
|
327
|
+
};
|
328
|
+
return AnsiUp;
|
329
|
+
}());
|
330
|
+
//# sourceMappingURL=ansi_up.js.map
|
331
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
332
|
+
exports.default = AnsiUp;
|
333
|
+
}));
|
@@ -0,0 +1,80 @@
|
|
1
|
+
$(document).ready(function(){
|
2
|
+
var history = 1;
|
3
|
+
var current_command = 1;
|
4
|
+
var dragging = 0;
|
5
|
+
var url = location.href + (location.href.match(/\/$/) ? '' : '/');
|
6
|
+
var ansi_up = new AnsiUp;
|
7
|
+
$('.console-line:last-child .edit').focus();
|
8
|
+
$(document).on('click', '.console-line:last-child', function(e) {
|
9
|
+
$('.console-line:last-child .edit').focus();
|
10
|
+
});
|
11
|
+
$(document).on('keydown', 'body', function(e) {
|
12
|
+
if ((e.ctrlKey && e.keyCode == 86) || !e.ctrlKey) {
|
13
|
+
$('.console-line:last-child .edit').focus();
|
14
|
+
} else {
|
15
|
+
return;
|
16
|
+
}
|
17
|
+
if (e.keyCode == 38) {
|
18
|
+
var anakin = $('.console-line:last-child .edit');
|
19
|
+
if(current_command<history) {
|
20
|
+
current_command++;
|
21
|
+
}
|
22
|
+
anakin.text($(".console-line:nth-last-child("+current_command+") > .edit").text());
|
23
|
+
anakin.focus();
|
24
|
+
jQuery.event.trigger({type:'keyup',which:35,charCode:35,ctrlKey: false});
|
25
|
+
return false;
|
26
|
+
} else if (e.keyCode == 40) {
|
27
|
+
var anakin = $('.console-line:last-child .edit');
|
28
|
+
if(current_command>1) {
|
29
|
+
current_command--;
|
30
|
+
}
|
31
|
+
anakin.html($(".console-line:nth-last-child("+current_command+") > .edit").text());
|
32
|
+
} else if (e.keyCode == 13) {
|
33
|
+
var anakin = $('.console-line:last-child .edit');
|
34
|
+
var anakin_str = anakin.text().split(" ");
|
35
|
+
var command= "";
|
36
|
+
var cc = 0;
|
37
|
+
history++;
|
38
|
+
current_command=1;
|
39
|
+
anakin_str.forEach(function(x){
|
40
|
+
if (cc==0){
|
41
|
+
command="cmd="+x;
|
42
|
+
cc++;
|
43
|
+
} else{
|
44
|
+
command+=" "+x;
|
45
|
+
}
|
46
|
+
});
|
47
|
+
if(anakin_str[0]=="clear"){
|
48
|
+
window.location.reload();
|
49
|
+
return false;
|
50
|
+
}
|
51
|
+
$.ajax({
|
52
|
+
url: url,
|
53
|
+
type: 'get',
|
54
|
+
data: command,
|
55
|
+
success: function(data) {
|
56
|
+
if(jQuery.type(data)=="string"){
|
57
|
+
var appendix = '';
|
58
|
+
appendix += $.trim(data) + "\n";
|
59
|
+
if(anakin_str[0]=="help")
|
60
|
+
appendix+="\033[1m\033[31mclear\033[0m\033[0m\n Clear screen.";
|
61
|
+
var node = $("<div style='white-space: pre-wrap;'/>");
|
62
|
+
node.html(ansi_up.ansi_to_html(appendix));
|
63
|
+
anakin.parent().append(node);
|
64
|
+
}
|
65
|
+
},
|
66
|
+
error: function(data) {
|
67
|
+
anakin.parent().append("<div>server made a boo boo</div>");
|
68
|
+
},
|
69
|
+
complete: function(data) {
|
70
|
+
var node = $("#console-template").clone().appendTo("body");
|
71
|
+
node.show();
|
72
|
+
node.removeAttr('id');
|
73
|
+
$('.edit:last-child',node).focus();
|
74
|
+
}
|
75
|
+
});
|
76
|
+
anakin.attr('contenteditable',false);
|
77
|
+
return false;
|
78
|
+
}
|
79
|
+
});
|
80
|
+
});
|
@@ -0,0 +1,84 @@
|
|
1
|
+
/*
|
2
|
+
This file is part of CPEE.
|
3
|
+
|
4
|
+
CPEE is free software: you can redistribute it and/or modify it under the terms
|
5
|
+
of the GNU General Public License as published by the Free Software Foundation,
|
6
|
+
either version 3 of the License, or (at your option) any later version.
|
7
|
+
|
8
|
+
CPEE is distributed in the hope that it will be useful, but WITHOUT ANY
|
9
|
+
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
10
|
+
PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
11
|
+
|
12
|
+
You should have received a copy of the GNU General Public License along with
|
13
|
+
CPEE (file COPYING in the main directory). If not, see
|
14
|
+
<http://www.gnu.org/licenses/>.
|
15
|
+
*/
|
16
|
+
|
17
|
+
div.contextmenu, div.menu {
|
18
|
+
padding: 0;
|
19
|
+
margin: 0;
|
20
|
+
z-index: 100000;
|
21
|
+
position: absolute;
|
22
|
+
display:none;
|
23
|
+
background: Menu;
|
24
|
+
border: 1px solid #a1a1a1;
|
25
|
+
-moz-box-sizing: border-box;
|
26
|
+
-webkit-box-sizing: border-box;
|
27
|
+
box-sizing: border-box;
|
28
|
+
box-shadow: 0.1em 0.1em 0.1em #a1a1a1;
|
29
|
+
}
|
30
|
+
|
31
|
+
table.contextmenu {
|
32
|
+
border-collapse:collapse;
|
33
|
+
border-spacing: 0;
|
34
|
+
border: 0 none;
|
35
|
+
padding: 0;
|
36
|
+
margin: 0;
|
37
|
+
}
|
38
|
+
|
39
|
+
tr.contextmenuheader {
|
40
|
+
font-style:italic;
|
41
|
+
color: #a1a1a1;
|
42
|
+
font-size: small;
|
43
|
+
}
|
44
|
+
|
45
|
+
tr.contextmenuheader > td{
|
46
|
+
padding-left: 0.5em;
|
47
|
+
padding-right: 1em;
|
48
|
+
}
|
49
|
+
tr.contextmenuheader:not(:first-child) {
|
50
|
+
border-top: 1px solid #a1a1a1;
|
51
|
+
}
|
52
|
+
|
53
|
+
div.menu > div {
|
54
|
+
height: 1.5em;
|
55
|
+
}
|
56
|
+
|
57
|
+
tr.contextmenuitem, div.menu > div {
|
58
|
+
font-size: small;
|
59
|
+
color: #333;
|
60
|
+
}
|
61
|
+
tr.contextmenuitem:hover, div.menu > div:hover {
|
62
|
+
background-color:Highlight;
|
63
|
+
color: HighlightText;
|
64
|
+
}
|
65
|
+
tr.contextmenuitem > td, div.menu > div {
|
66
|
+
padding: 0;
|
67
|
+
margin: 0;
|
68
|
+
padding-left: 0.5em;
|
69
|
+
padding-right: 1em;
|
70
|
+
}
|
71
|
+
tr.contextmenuitem > .contextmenuicon {
|
72
|
+
margin-left: 0.7em;
|
73
|
+
padding-right: 0em;
|
74
|
+
}
|
75
|
+
tr.contextmenuitem > .contextmenuicon div {
|
76
|
+
height: 1.5em;
|
77
|
+
width: 1.5em;
|
78
|
+
vertical-align:bottom;
|
79
|
+
}
|
80
|
+
tr.contextmenuitem > .contextmenuicon div svg {
|
81
|
+
height: 1.5em;
|
82
|
+
width: 1.5em;
|
83
|
+
vertical-align:bottom;
|
84
|
+
}
|