cpee-frames 1.0.2 → 1.0.5
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/cpee-frames.gemspec +1 -1
- data/lib/cpee-frames/implementation.rb +25 -29
- data/lib/cpee-frames/ui/framedata.html +2 -5
- data/lib/cpee-frames/ui/menu.html +1 -6
- data/lib/cpee-frames/ui/template.html +0 -2
- data/lib/cpee-frames/ui/test.html +1 -4
- data/server/frames +1 -1
- data/tools/cpee-frames +2 -2
- data/ui/js/frame_data.js +3 -16
- data/ui/js/test.js +44 -51
- data/ui/js/ui.js +9 -115
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bdca65cce57c3f745051b004fba4e46bc353dafa402fa04e4165a5fad8646010
|
4
|
+
data.tar.gz: 99881a242c05659c8e73fb3c2c8fb1b71275650f71482f41e327cd5fb620eee0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2cfd3358722637897a9d2487fc3705038fca7b6b31b64a2038a26279c72f210a943da04387fba17badaf85251f5848f3c91680cff7266b9a663d748ee6cee818
|
7
|
+
data.tar.gz: f8197d917103bfc9c5eb23dfe88733eb39a47ef52e333707b308271bf2f5c3c9a483c7a52f07aa334e4c59ec4bb47daa9de2cd370eff8bf73afcb111e58a7c21
|
data/cpee-frames.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = "cpee-frames"
|
3
|
-
s.version = "1.0.
|
3
|
+
s.version = "1.0.5"
|
4
4
|
s.platform = Gem::Platform::RUBY
|
5
5
|
s.license = "GPL-3.0"
|
6
6
|
s.summary = "Dashboard management service with UI and backend for the cpee.org family of workflow management tools"
|
@@ -29,6 +29,17 @@ module CPEE
|
|
29
29
|
|
30
30
|
SERVER = File.expand_path(File.join(__dir__,'frames.xml'))
|
31
31
|
|
32
|
+
def self::overlap?(l1x, l1y, r1x, r1y, l2x, l2y, r2x, r2y)
|
33
|
+
if l1x > r2x || l2x > r1x
|
34
|
+
return false
|
35
|
+
end
|
36
|
+
if l1y > r2y || l2y > r1y
|
37
|
+
return false
|
38
|
+
end
|
39
|
+
return true
|
40
|
+
end
|
41
|
+
|
42
|
+
|
32
43
|
# https://coderwall.com/p/atyfyq/ruby-string-to-boolean
|
33
44
|
# showbutton
|
34
45
|
refine String do #{{{
|
@@ -100,7 +111,7 @@ module CPEE
|
|
100
111
|
|
101
112
|
#check if new frame overlaps others if it does, delete overlapped frames
|
102
113
|
data_hash["data"].each do | c |
|
103
|
-
if
|
114
|
+
if CPEE::Frames::overlap?(c['lx'], c['ly'], c['rx'], c['ry'], @p[1].value.to_i, @p[2].value.to_i, (@p[1].value.to_i + @p[3].value.to_i - 1), (@p[2].value.to_i + @p[4].value.to_i - 1))
|
104
115
|
data_hash["data"].delete(c)
|
105
116
|
end
|
106
117
|
end
|
@@ -146,7 +157,7 @@ module CPEE
|
|
146
157
|
|
147
158
|
#check if new frame overlaps others if it does, delete overlapped frames
|
148
159
|
data_hash["data"].each do | c |
|
149
|
-
if
|
160
|
+
if CPEE::Frames::overlap?(c['lx'], c['ly'], c['rx'], c['ry'], @p[1].value.to_i, @p[2].value.to_i, (@p[1].value.to_i + @p[3].value.to_i - 1), (@p[2].value.to_i + @p[4].value.to_i - 1))
|
150
161
|
data_hash["data"].delete(c)
|
151
162
|
end
|
152
163
|
end
|
@@ -199,7 +210,7 @@ module CPEE
|
|
199
210
|
data_hash = JSON::parse(file)
|
200
211
|
|
201
212
|
data_hash["data"].each do | c |
|
202
|
-
if
|
213
|
+
if CPEE::Frames::overlap?(c['lx'], c['ly'], c['rx'], c['ry'], @p[0].value.to_i, @p[1].value.to_i, (@p[0].value.to_i + 1), (@p[1].value.to_i + 1))
|
203
214
|
data_hash["data"].delete(c)
|
204
215
|
end
|
205
216
|
end
|
@@ -208,16 +219,6 @@ module CPEE
|
|
208
219
|
end
|
209
220
|
end
|
210
221
|
|
211
|
-
def doOverlap(l1x, l1y, r1x, r1y, l2x, l2y, r2x, r2y)
|
212
|
-
if l1x > r2x || l2x > r1x
|
213
|
-
return false;
|
214
|
-
end
|
215
|
-
if l1y > r2y || l2y > r1y
|
216
|
-
return false;
|
217
|
-
end
|
218
|
-
return true;
|
219
|
-
end
|
220
|
-
|
221
222
|
class Delete < Riddl::Implementation
|
222
223
|
def response
|
223
224
|
data_dir = @a[1]
|
@@ -249,7 +250,7 @@ module CPEE
|
|
249
250
|
def response
|
250
251
|
data_dir = @a[0]
|
251
252
|
fname = File.join(data_dir,@r[-2],'frames.json')
|
252
|
-
if File.
|
253
|
+
if File.exist? fname
|
253
254
|
|
254
255
|
infofile = File.join(data_dir,@r[-2],'info.json')
|
255
256
|
infojson = JSON::parse(File.read(infofile))
|
@@ -286,7 +287,7 @@ module CPEE
|
|
286
287
|
#puts @p[0].value
|
287
288
|
|
288
289
|
#fname = File.join(data_dir,@r[-2],'dataelements.json')
|
289
|
-
#if File.
|
290
|
+
#if File.exist? fname
|
290
291
|
# Riddl::Parameter::Complex.new('value','application/json',File.read(fname))
|
291
292
|
#else
|
292
293
|
# @status = 404
|
@@ -298,7 +299,7 @@ module CPEE
|
|
298
299
|
def response
|
299
300
|
data_dir = @a[0]
|
300
301
|
fname = File.join(data_dir,@r[-2],'dataelements.json')
|
301
|
-
if File.
|
302
|
+
if File.exist? fname
|
302
303
|
Riddl::Parameter::Complex.new('value','application/json',File.read(fname))
|
303
304
|
else
|
304
305
|
@status = 404
|
@@ -310,7 +311,7 @@ module CPEE
|
|
310
311
|
def response
|
311
312
|
data_dir = @a[0]
|
312
313
|
fname = File.join(data_dir,@r[-2],'info.json')
|
313
|
-
if File.
|
314
|
+
if File.exist? fname
|
314
315
|
Riddl::Parameter::Complex.new('value','application/json',File.read(fname))
|
315
316
|
else
|
316
317
|
@status = 404
|
@@ -322,7 +323,7 @@ module CPEE
|
|
322
323
|
def response
|
323
324
|
data_dir = @a[0]
|
324
325
|
fname = File.join(data_dir,@r[-2],'info.json')
|
325
|
-
if File.
|
326
|
+
if File.exist? fname
|
326
327
|
infojson = JSON::parse(File.read(fname))
|
327
328
|
Riddl::Parameter::Complex.new('value','application/json',infojson["langs"])
|
328
329
|
else
|
@@ -335,7 +336,7 @@ module CPEE
|
|
335
336
|
def response
|
336
337
|
data_dir = @a[1]
|
337
338
|
fname = File.join(data_dir,@r[-2],'info.json')
|
338
|
-
if File.
|
339
|
+
if File.exist? fname
|
339
340
|
infojson = JSON::parse(File.read(fname))
|
340
341
|
infojson["lang"] = @p[0].value
|
341
342
|
|
@@ -361,7 +362,7 @@ module CPEE
|
|
361
362
|
def response
|
362
363
|
data_dir = @a[0]
|
363
364
|
fname = File.join(data_dir,@r[-2],'style.url')
|
364
|
-
if File.
|
365
|
+
if File.exist? fname
|
365
366
|
Riddl::Parameter::Complex.new('url','text/plain',File.read(fname).strip)
|
366
367
|
else
|
367
368
|
@status = 404
|
@@ -373,7 +374,7 @@ module CPEE
|
|
373
374
|
def response
|
374
375
|
data_dir = @a[0]
|
375
376
|
fname = File.join(data_dir,@r[-2],'cpeeinstance.url')
|
376
|
-
if File.
|
377
|
+
if File.exist? fname
|
377
378
|
Riddl::Parameter::Complex.new('url','text/plain',File.read(fname).strip)
|
378
379
|
else
|
379
380
|
@status = 404
|
@@ -387,7 +388,7 @@ module CPEE
|
|
387
388
|
end
|
388
389
|
end #}}}
|
389
390
|
|
390
|
-
class Handler < Riddl::Implementation
|
391
|
+
class Handler < Riddl::Implementation #{{{
|
391
392
|
def response
|
392
393
|
data_dir = @a[1]
|
393
394
|
topic = @p[1].value
|
@@ -400,11 +401,6 @@ module CPEE
|
|
400
401
|
parameters = content['parameters']
|
401
402
|
receiving = content['received']
|
402
403
|
|
403
|
-
#puts instancenr
|
404
|
-
#puts activity
|
405
|
-
puts content['values']
|
406
|
-
|
407
|
-
|
408
404
|
if content['values']&.any?
|
409
405
|
#puts alldata['ausfuehrungen']
|
410
406
|
puts "writing file"
|
@@ -415,7 +411,7 @@ module CPEE
|
|
415
411
|
@a[0].send(@r[0])
|
416
412
|
nil
|
417
413
|
end
|
418
|
-
end
|
414
|
+
end #}}}
|
419
415
|
|
420
416
|
class SSE < Riddl::SSEImplementation #{{{
|
421
417
|
def onopen
|
@@ -499,7 +495,7 @@ module CPEE
|
|
499
495
|
opts[:signals][idx] ||= Signaling.new
|
500
496
|
opts[:signals2]["handler"] ||= Signaling.new
|
501
497
|
|
502
|
-
run Get
|
498
|
+
run Get if get
|
503
499
|
run InitFrame, opts[:signals][idx], opts[:data_dir] if post 'input'
|
504
500
|
|
505
501
|
run NewFrameSet, opts[:signals][idx], opts[:data_dir] if put 'sframe'
|
@@ -42,19 +42,16 @@
|
|
42
42
|
<link rel="stylesheet" href="../css/frames.css" type="text/css"/>
|
43
43
|
<link class='custom' rel="stylesheet" href="" type="text/css"/>
|
44
44
|
|
45
|
-
|
46
|
-
|
47
45
|
<!-- Forms
|
48
46
|
<script src='https://centurio.work/out/forms/js/formio.full.min.js'></script>
|
49
47
|
-->
|
50
48
|
<script>
|
51
49
|
if (location.href.match(/\/$/) == null) {
|
52
50
|
location.href = location.href + '/';
|
53
|
-
|
51
|
+
}
|
54
52
|
</script>
|
55
53
|
</head>
|
56
54
|
<body is="x-ui">
|
57
|
-
Data:
|
58
|
-
<div id="alldata"></div>
|
55
|
+
Data: <div id="alldata"></div>
|
59
56
|
</body>
|
60
57
|
</html>
|
@@ -53,15 +53,10 @@
|
|
53
53
|
url: window.name,
|
54
54
|
contentType: "application/json",
|
55
55
|
data: JSON.stringify(menu),
|
56
|
-
success: function (data) {
|
57
|
-
|
58
|
-
}
|
56
|
+
success: function (data) { }
|
59
57
|
});
|
60
|
-
|
61
|
-
|
62
58
|
//alert(xyz);
|
63
59
|
}
|
64
|
-
|
65
60
|
</script>
|
66
61
|
</head>
|
67
62
|
<body is="x-ui">
|
@@ -42,12 +42,10 @@
|
|
42
42
|
<link rel="stylesheet" href="../css/frames.css" type="text/css"/>
|
43
43
|
<link class='custom' rel="stylesheet" href="" type="text/css"/>
|
44
44
|
|
45
|
-
|
46
45
|
<link rel="icon" type="image/png" sizes="32x32" href="../css/favicon-32x32.png">
|
47
46
|
<link rel="icon" type="image/png" sizes="96x96" href="../css/favicon-96x96.png">
|
48
47
|
<link rel="icon" type="image/png" sizes="16x16" href="../css/favicon-16x16.png">
|
49
48
|
|
50
|
-
|
51
49
|
<!-- Forms
|
52
50
|
<script src='https://centurio.work/out/forms/js/formio.full.min.js'></script>
|
53
51
|
-->
|
data/server/frames
CHANGED
@@ -16,7 +16,7 @@
|
|
16
16
|
# CPEE-FRAMES (file LICENSE in the main directory). If not, see
|
17
17
|
# <http://www.gnu.org/licenses/>.
|
18
18
|
|
19
|
-
if File.
|
19
|
+
if File.exist?(File.join(__dir__,'..','lib','cpee-frames','implementation.rb'))
|
20
20
|
require_relative File.join(__dir__,'..','lib','cpee-frames','implementation')
|
21
21
|
else
|
22
22
|
require 'cpee-frames/implementation'
|
data/tools/cpee-frames
CHANGED
@@ -66,14 +66,14 @@ else
|
|
66
66
|
end
|
67
67
|
|
68
68
|
if command == 'new'
|
69
|
-
if !File.
|
69
|
+
if !File.exist?(dir)
|
70
70
|
FileUtils.cp_r(File.join(curpath,'..','server'),dir)
|
71
71
|
FileUtils.mkdir(File.join(dir,'data')) rescue nil
|
72
72
|
else
|
73
73
|
puts 'Directory already exists.'
|
74
74
|
end
|
75
75
|
elsif command == 'newui'
|
76
|
-
if !File.
|
76
|
+
if !File.exist?(dir)
|
77
77
|
FileUtils.cp_r(File.join(curpath,'..','ui'),dir)
|
78
78
|
else
|
79
79
|
puts 'Directory already exists.'
|
data/ui/js/frame_data.js
CHANGED
@@ -1,13 +1,9 @@
|
|
1
|
-
|
2
|
-
|
3
1
|
function showDocument(fr = "") {
|
4
|
-
|
5
2
|
if(fr != ""){
|
6
3
|
$.ajax({
|
7
4
|
type: "GET",
|
8
|
-
url: '
|
5
|
+
url: '/out/frames/' + fr + '/dataelements.json',
|
9
6
|
success: function(ret) {
|
10
|
-
|
11
7
|
$("#alldata").text(JSON.stringify(ret["ausfuehrungen"]));
|
12
8
|
},
|
13
9
|
error: function() {
|
@@ -18,11 +14,7 @@ function showDocument(fr = "") {
|
|
18
14
|
}
|
19
15
|
}
|
20
16
|
|
21
|
-
|
22
|
-
function clearDocument() {
|
23
|
-
console.log('rrrr');
|
24
|
-
}
|
25
|
-
|
17
|
+
function clearDocument() { }
|
26
18
|
|
27
19
|
function init() {
|
28
20
|
es = new EventSource('handler/sse/');
|
@@ -47,7 +39,7 @@ function init() {
|
|
47
39
|
catch (e) {
|
48
40
|
}
|
49
41
|
}
|
50
|
-
|
42
|
+
|
51
43
|
}
|
52
44
|
};
|
53
45
|
es.onerror = function() {
|
@@ -57,11 +49,6 @@ function init() {
|
|
57
49
|
};
|
58
50
|
}
|
59
51
|
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
52
|
$(document).ready(function() {
|
66
53
|
init();
|
67
54
|
});
|
data/ui/js/test.js
CHANGED
@@ -1,5 +1,3 @@
|
|
1
|
-
|
2
|
-
|
3
1
|
document.addEventListener('keyup', (event) => {
|
4
2
|
if (event.key == 'ArrowRight') {
|
5
3
|
$.ajax({
|
@@ -15,54 +13,49 @@ document.addEventListener('keyup', (event) => {
|
|
15
13
|
}
|
16
14
|
});
|
17
15
|
}
|
18
|
-
|
19
|
-
if (event.key == 'ArrowUp') {
|
20
16
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
}
|
33
|
-
}
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
17
|
+
if (event.key == 'ArrowUp') {
|
18
|
+
$.ajax({
|
19
|
+
type: "POST",
|
20
|
+
url: "../Manuel",
|
21
|
+
headers: {"content-id": "frame"},
|
22
|
+
data: { lx: "2", ly: '0', rx: '1', ry: '2', url: 'https://centurio.work/' },
|
23
|
+
success: function(res) {
|
24
|
+
location.reload();
|
25
|
+
},
|
26
|
+
error: function (request, status, error) {
|
27
|
+
alert(request.responseText + status + error);
|
28
|
+
}
|
29
|
+
});
|
30
|
+
}
|
31
|
+
|
32
|
+
if (event.key == 'ArrowDown') {
|
33
|
+
$.ajax({
|
34
|
+
type: "POST",
|
35
|
+
url: "../Manuel",
|
36
|
+
headers: {"content-id": "frame"},
|
37
|
+
data: { lx: "0", ly: '0', rx: '2', ry: '2', url: 'https://centurio.work/flow-test/' },
|
38
|
+
success: function(res) {
|
39
|
+
location.reload();
|
40
|
+
},
|
41
|
+
error: function (request, status, error) {
|
42
|
+
alert(request.responseText + status + error);
|
43
|
+
}
|
44
|
+
});
|
45
|
+
}
|
46
|
+
|
47
|
+
if (event.key == 'ArrowLeft') {
|
48
|
+
$.ajax({
|
49
|
+
type: "POST",
|
50
|
+
url: "../Manuel",
|
51
|
+
headers: {"content-id": "frame"},
|
52
|
+
data: { lx: "1", ly: '1', rx: '2', ry: '2', url: 'https://centurio.work/customers/evva/was/ui/' },
|
53
|
+
success: function(res) {
|
54
|
+
location.reload();
|
55
|
+
},
|
56
|
+
error: function (request, status, error) {
|
57
|
+
alert(request.responseText + status + error);
|
58
|
+
}
|
59
|
+
});
|
60
|
+
}
|
67
61
|
});
|
68
|
-
|
data/ui/js/ui.js
CHANGED
@@ -1,21 +1,17 @@
|
|
1
1
|
var reason ="";
|
2
2
|
var storage = []; //{col:1, row:1, colamount:1, rowamount: 1}];
|
3
3
|
|
4
|
-
|
5
4
|
function doOverlap(l1x, l1y, r1x, r1y, l2x, l2y, r2x, r2y) {
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
5
|
+
// If one rectangle is on left side of other
|
6
|
+
if (l1x > r2x || l2x > r1x)
|
7
|
+
return false;
|
8
|
+
// If one rectangle is above other
|
9
|
+
if (l1y > r2y || l2y > r1y)
|
10
|
+
return false;
|
11
|
+
return true;
|
13
12
|
}
|
14
13
|
|
15
|
-
|
16
14
|
function makeFrame(lx, ly, rx, ry, content = "", id = "", defaultpara = "", showbutton = "", style = "") {
|
17
|
-
|
18
|
-
|
19
15
|
//check if rects overlap if they do remove old ones
|
20
16
|
for (i = 0; i < window.storage.length; i++) {
|
21
17
|
if(doOverlap(window.storage[i].lx, window.storage[i].ly, window.storage[i].rx, window.storage[i].ry, lx, ly, rx, ry)){
|
@@ -38,7 +34,6 @@ function makeFrame(lx, ly, rx, ry, content = "", id = "", defaultpara = "", show
|
|
38
34
|
spancol= ""
|
39
35
|
if(rx-lx+1 > 1){
|
40
36
|
spancol = " / span " + (rx-lx+1);
|
41
|
-
|
42
37
|
}
|
43
38
|
|
44
39
|
spanrow= ""
|
@@ -84,28 +79,23 @@ function makeFrame(lx, ly, rx, ry, content = "", id = "", defaultpara = "", show
|
|
84
79
|
});
|
85
80
|
}
|
86
81
|
|
87
|
-
|
88
82
|
//hideRectangel(lx, ly, rx, ry)
|
89
83
|
}
|
90
84
|
else{
|
91
85
|
$(".item" + lx + "-" + ly).html("No language available.<br> Nicht in der Sprache verfügbar.");
|
92
86
|
}
|
93
87
|
}
|
94
|
-
|
95
88
|
}
|
96
89
|
|
97
90
|
function sendForm(menuitem, cpeecallback,lx,ly){
|
98
91
|
//Call iframe function that button has been pressed iframe should send json back
|
99
92
|
//document.getElementById(decodeURIComponent(cpeecallback)).contentWindow.buttonPressed(cpeecallback);
|
100
93
|
|
101
|
-
|
102
94
|
var formdata;
|
103
|
-
|
95
|
+
if (typeof document.getElementById(decodeURIComponent(cpeecallback)).contentWindow.buttonPressed !== 'undefined' && $.isFunction(document.getElementById(decodeURIComponent(cpeecallback)).contentWindow.buttonPressed)) {
|
104
96
|
var formdata = document.getElementById(decodeURIComponent(cpeecallback)).contentWindow.buttonPressed();
|
105
97
|
}
|
106
98
|
|
107
|
-
|
108
|
-
|
109
99
|
$.ajax({
|
110
100
|
type: "PUT",
|
111
101
|
url: decodeURIComponent(cpeecallback),
|
@@ -115,9 +105,6 @@ function sendForm(menuitem, cpeecallback,lx,ly){
|
|
115
105
|
}
|
116
106
|
});
|
117
107
|
|
118
|
-
|
119
|
-
|
120
|
-
|
121
108
|
//Its a design question if removing the frame should be done within centurio, do have more controll, or automatic within code?
|
122
109
|
//close frame
|
123
110
|
|
@@ -131,11 +118,9 @@ function sendForm(menuitem, cpeecallback,lx,ly){
|
|
131
118
|
success: function (data) {
|
132
119
|
}
|
133
120
|
});
|
134
|
-
|
135
121
|
}
|
136
122
|
|
137
123
|
function sendData(dataelement, datavalue){
|
138
|
-
|
139
124
|
$.ajax({
|
140
125
|
type: "Get",
|
141
126
|
url: 'cpeeinstance.url',
|
@@ -150,11 +135,9 @@ function sendData(dataelement, datavalue){
|
|
150
135
|
});
|
151
136
|
}
|
152
137
|
});
|
153
|
-
|
154
138
|
}
|
155
139
|
|
156
140
|
function sendCallback(callbackUrl, jsonToSend){
|
157
|
-
|
158
141
|
$.ajax({
|
159
142
|
type: "PUT",
|
160
143
|
url: callbackUrl,
|
@@ -167,7 +150,6 @@ function sendCallback(callbackUrl, jsonToSend){
|
|
167
150
|
}
|
168
151
|
|
169
152
|
function showDocument() {
|
170
|
-
|
171
153
|
$.ajax({
|
172
154
|
type: "GET",
|
173
155
|
url: 'style.url',
|
@@ -198,93 +180,9 @@ function showDocument() {
|
|
198
180
|
clearDocument();
|
199
181
|
}
|
200
182
|
});
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
/*
|
206
|
-
$.ajax({
|
207
|
-
type: "GET",
|
208
|
-
url: 'languages',
|
209
|
-
success: function(ret) {
|
210
|
-
$('#content .added').remove();
|
211
|
-
$('#control .added').remove();
|
212
|
-
var ctemplate = $('#content template')[0];
|
213
|
-
var btemplate = $('#control template')[0];
|
214
|
-
var promises = [];
|
215
|
-
$('language',ret).each(function(i,e){
|
216
|
-
var cclone = document.importNode(ctemplate.content, true);
|
217
|
-
var bclone = document.importNode(btemplate.content, true);
|
218
|
-
promises.push(new Promise((resolve, reject) => {
|
219
|
-
$('> *',cclone).each(function(j,c){
|
220
|
-
$(c).addClass('added');
|
221
|
-
$(c).attr('lang', e.textContent);
|
222
|
-
$.ajax({
|
223
|
-
type: "GET",
|
224
|
-
url: 'documents/' + e.textContent,
|
225
|
-
success: function(doc) {
|
226
|
-
if (c.nodeName == 'IFRAME') {
|
227
|
-
$(c).attr('src',doc);
|
228
|
-
} else {
|
229
|
-
$('iframe',c).attr('src',doc);
|
230
|
-
}
|
231
|
-
$('#content').append(c);
|
232
|
-
resolve(true);
|
233
|
-
},
|
234
|
-
error: function() {
|
235
|
-
reject(false);
|
236
|
-
setTimeout(function(){ showDocument(); }, 500);
|
237
|
-
}
|
238
|
-
});
|
239
|
-
});
|
240
|
-
}));
|
241
|
-
promises.push(new Promise((resolve, reject) => {
|
242
|
-
$('> *',bclone).each(function(j,c){
|
243
|
-
$(c).addClass('added');
|
244
|
-
$(c).attr('lang', e.textContent);
|
245
|
-
$.ajax({
|
246
|
-
type: "GET",
|
247
|
-
url: 'buttons/' + e.textContent,
|
248
|
-
success: function(but) {
|
249
|
-
if (c.nodeName == 'BUTTON') {
|
250
|
-
$(c).text(but);
|
251
|
-
} else {
|
252
|
-
$('button',c).text(but);
|
253
|
-
}
|
254
|
-
$('#control').append(c);
|
255
|
-
resolve(true);
|
256
|
-
},
|
257
|
-
error: function() {
|
258
|
-
resolve(true);
|
259
|
-
}
|
260
|
-
});
|
261
|
-
});
|
262
|
-
}));
|
263
|
-
});
|
264
|
-
Promise.all(promises).then((values) => {
|
265
|
-
$.ajax({
|
266
|
-
type: "GET",
|
267
|
-
url: 'style.url',
|
268
|
-
success: function(ret) {
|
269
|
-
$('head link.custom').attr('href',ret);
|
270
|
-
}
|
271
|
-
});
|
272
|
-
lang_init('#content','#languages');
|
273
|
-
$('#languages').removeClass('hidden');
|
274
|
-
$('#nope').addClass('hidden');
|
275
|
-
});
|
276
|
-
},
|
277
|
-
error: function() {
|
278
|
-
reason = '';
|
279
|
-
clearDocument();
|
280
|
-
}
|
281
|
-
});
|
282
|
-
*/
|
283
183
|
}
|
284
184
|
|
285
|
-
|
286
185
|
function clearDocument() {
|
287
|
-
console.log('rrrr');
|
288
186
|
$('#languages').addClass('hidden');
|
289
187
|
$('#nope').removeClass('hidden');
|
290
188
|
$('#control .added').remove();
|
@@ -296,7 +194,6 @@ function reloadAllFrames() {
|
|
296
194
|
location.reload();
|
297
195
|
}
|
298
196
|
|
299
|
-
|
300
197
|
function init() {
|
301
198
|
es = new EventSource('sse/');
|
302
199
|
es.onopen = function() {
|
@@ -330,12 +227,11 @@ function init() {
|
|
330
227
|
es.onerror = function() {
|
331
228
|
reason = 'Server down.';
|
332
229
|
clearDocument();
|
230
|
+
es.close();
|
333
231
|
setTimeout(init, 10000);
|
334
232
|
};
|
335
233
|
}
|
336
234
|
|
337
|
-
|
338
|
-
|
339
235
|
function makeGrid(x, y) {
|
340
236
|
const container = document.getElementById("container");
|
341
237
|
container.style.setProperty('--grid-rows', y);
|
@@ -353,7 +249,6 @@ function makeGrid(x, y) {
|
|
353
249
|
*/
|
354
250
|
};
|
355
251
|
|
356
|
-
|
357
252
|
//https://developer.mozilla.org/de/docs/Web/JavaScript/Reference/Global_Objects/Function/caller
|
358
253
|
function sendJson(callback, jsonToSend){
|
359
254
|
$.ajax({
|
@@ -367,7 +262,6 @@ function sendJson(callback, jsonToSend){
|
|
367
262
|
});
|
368
263
|
}
|
369
264
|
|
370
|
-
|
371
265
|
$(document).ready(function() {
|
372
266
|
init();
|
373
267
|
});
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cpee-frames
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Manuell Gall
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: tools
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2025-03-17 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: riddl
|
@@ -90,7 +90,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
90
90
|
- !ruby/object:Gem::Version
|
91
91
|
version: '0'
|
92
92
|
requirements: []
|
93
|
-
rubygems_version: 3.
|
93
|
+
rubygems_version: 3.5.22
|
94
94
|
signing_key:
|
95
95
|
specification_version: 4
|
96
96
|
summary: Dashboard management service with UI and backend for the cpee.org family
|