cpee-frames 1.0.3 → 1.0.6

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f6e3e17dafdfc33eea6a1985ef1195ae366e481783eee9a0521f2e24b376ab89
4
- data.tar.gz: b1027c8c1e6ddea9122c87ccef384c1e628f8db1fa6369f61e819d235446cb96
3
+ metadata.gz: '08d58fb0e3ead41a726a13e9c2882566ce9517b33db09d2a598f3d4c309efce3'
4
+ data.tar.gz: 5a11e363e355246150f36896193d5ca42524af006438470e11770f17336a7647
5
5
  SHA512:
6
- metadata.gz: 182e44f12d97f59918eaea3a2590614c7758f920f2a4ce06ed848623348941fd60bfc493add7228f4f228d32867fb42bf66984d0505a68f95d4c294b49e7c17b
7
- data.tar.gz: 190580b76dfc5a2100ad0cd1fbee4056f7db53ce9fa9cc7845574b3d87c8ee7923470c8b7da53e0047590696bc563790c3c1f4caaa880227fb5d8d4ff9894d86
6
+ metadata.gz: ae2f0971be48e1ec132cd40822962d8b0c1845112790fcf02e0378f6d61624869e44890402b9c0072b22c5771e2405761d0cbf268f9520184c500030d6c7ebbc
7
+ data.tar.gz: 69dc3c99cd8bf566d329354d44663e80b8d4bcc17950d2ef2507945549f223fc962bf2ba17ba53aaa7785740a01747eb346549855a84063edb7b4136533c4b23
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"
3
+ s.version = "1.0.6"
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"
@@ -2,15 +2,15 @@
2
2
  #
3
3
  # This file is part of CPEE-FRAMES.
4
4
  #
5
- # CPEE-FRAMES is free software: you can redistribute it and/or
6
- # modify it under the terms of the GNU General Public License as published by
7
- # the Free Software Foundation, either version 3 of the License, or (at your
8
- # option) any later version.
5
+ # CPEE-FRAMES is free software: you can redistribute it and/or modify it under
6
+ # the terms of the GNU General Public License as published by the Free Software
7
+ # Foundation, either version 3 of the License, or (at your option) any later
8
+ # version.
9
9
  #
10
- # CPEE-FRAMES is distributed in the hope that it will be useful,
11
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
13
- # Public License for more details.
10
+ # CPEE-FRAMES is distributed in the hope that it will be useful, but WITHOUT
11
+ # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12
+ # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
13
+ # details.
14
14
  #
15
15
  # You should have received a copy of the GNU General Public License along with
16
16
  # CPEE-FRAMES (file LICENSE in the main directory). If not, see
@@ -66,15 +66,7 @@ module CPEE
66
66
 
67
67
  class Get < Riddl::Implementation #{{{
68
68
  def response
69
- if @r[0] == 'test'
70
- Riddl::Parameter::Complex.new('ui','text/html',File.open(File.join(__dir__,'ui','test.html')))
71
- elsif @r[0] == 'menu'
72
- Riddl::Parameter::Complex.new('ui','text/html',File.open(File.join(__dir__,'ui','menu.html')))
73
- elsif @r[0] == 'framedata'
74
- Riddl::Parameter::Complex.new('ui','text/html',File.open(File.join(__dir__,'ui','framedata.html')))
75
- else
76
- Riddl::Parameter::Complex.new('ui','text/html',File.open(File.join(__dir__,'ui','template.html')))
77
- end
69
+ Riddl::Parameter::Complex.new('ui','text/html',File.open(File.join(__dir__,'ui','template.html')))
78
70
  end
79
71
  end #}}}
80
72
 
@@ -250,7 +242,7 @@ module CPEE
250
242
  def response
251
243
  data_dir = @a[0]
252
244
  fname = File.join(data_dir,@r[-2],'frames.json')
253
- if File.exists? fname
245
+ if File.exist? fname
254
246
 
255
247
  infofile = File.join(data_dir,@r[-2],'info.json')
256
248
  infojson = JSON::parse(File.read(infofile))
@@ -287,7 +279,7 @@ module CPEE
287
279
  #puts @p[0].value
288
280
 
289
281
  #fname = File.join(data_dir,@r[-2],'dataelements.json')
290
- #if File.exists? fname
282
+ #if File.exist? fname
291
283
  # Riddl::Parameter::Complex.new('value','application/json',File.read(fname))
292
284
  #else
293
285
  # @status = 404
@@ -299,7 +291,7 @@ module CPEE
299
291
  def response
300
292
  data_dir = @a[0]
301
293
  fname = File.join(data_dir,@r[-2],'dataelements.json')
302
- if File.exists? fname
294
+ if File.exist? fname
303
295
  Riddl::Parameter::Complex.new('value','application/json',File.read(fname))
304
296
  else
305
297
  @status = 404
@@ -311,7 +303,7 @@ module CPEE
311
303
  def response
312
304
  data_dir = @a[0]
313
305
  fname = File.join(data_dir,@r[-2],'info.json')
314
- if File.exists? fname
306
+ if File.exist? fname
315
307
  Riddl::Parameter::Complex.new('value','application/json',File.read(fname))
316
308
  else
317
309
  @status = 404
@@ -323,7 +315,7 @@ module CPEE
323
315
  def response
324
316
  data_dir = @a[0]
325
317
  fname = File.join(data_dir,@r[-2],'info.json')
326
- if File.exists? fname
318
+ if File.exist? fname
327
319
  infojson = JSON::parse(File.read(fname))
328
320
  Riddl::Parameter::Complex.new('value','application/json',infojson["langs"])
329
321
  else
@@ -336,7 +328,7 @@ module CPEE
336
328
  def response
337
329
  data_dir = @a[1]
338
330
  fname = File.join(data_dir,@r[-2],'info.json')
339
- if File.exists? fname
331
+ if File.exist? fname
340
332
  infojson = JSON::parse(File.read(fname))
341
333
  infojson["lang"] = @p[0].value
342
334
 
@@ -362,7 +354,7 @@ module CPEE
362
354
  def response
363
355
  data_dir = @a[0]
364
356
  fname = File.join(data_dir,@r[-2],'style.url')
365
- if File.exists? fname
357
+ if File.exist? fname
366
358
  Riddl::Parameter::Complex.new('url','text/plain',File.read(fname).strip)
367
359
  else
368
360
  @status = 404
@@ -374,7 +366,7 @@ module CPEE
374
366
  def response
375
367
  data_dir = @a[0]
376
368
  fname = File.join(data_dir,@r[-2],'cpeeinstance.url')
377
- if File.exists? fname
369
+ if File.exist? fname
378
370
  Riddl::Parameter::Complex.new('url','text/plain',File.read(fname).strip)
379
371
  else
380
372
  @status = 404
@@ -388,7 +380,7 @@ module CPEE
388
380
  end
389
381
  end #}}}
390
382
 
391
- class Handler < Riddl::Implementation
383
+ class Handler < Riddl::Implementation #{{{
392
384
  def response
393
385
  data_dir = @a[1]
394
386
  topic = @p[1].value
@@ -401,11 +393,6 @@ module CPEE
401
393
  parameters = content['parameters']
402
394
  receiving = content['received']
403
395
 
404
- #puts instancenr
405
- #puts activity
406
- puts content['values']
407
-
408
-
409
396
  if content['values']&.any?
410
397
  #puts alldata['ausfuehrungen']
411
398
  puts "writing file"
@@ -416,7 +403,7 @@ module CPEE
416
403
  @a[0].send(@r[0])
417
404
  nil
418
405
  end
419
- end
406
+ end #}}}
420
407
 
421
408
  class SSE < Riddl::SSEImplementation #{{{
422
409
  def onopen
@@ -500,7 +487,7 @@ module CPEE
500
487
  opts[:signals][idx] ||= Signaling.new
501
488
  opts[:signals2]["handler"] ||= Signaling.new
502
489
 
503
- run Get, "test" if get
490
+ run Get if get
504
491
  run InitFrame, opts[:signals][idx], opts[:data_dir] if post 'input'
505
492
 
506
493
  run NewFrameSet, opts[:signals][idx], opts[:data_dir] if put 'sframe'
@@ -1,18 +1,18 @@
1
1
  <!--
2
- This file is part of centurio.work/out/frame.
2
+ This file is part of CPEE-FRAMES.
3
3
 
4
- centurio.work/out/frame is free software: you can redistribute it and/or modify
5
- it under the terms of the GNU General Public License as published by the Free
6
- Software Foundation, either version 3 of the License, or (at your option) any
7
- later version.
4
+ CPEE-FRAMES is free software: you can redistribute it and/or modify it under
5
+ the terms of the GNU General Public License as published by the Free Software
6
+ Foundation, either version 3 of the License, or (at your option) any later
7
+ version.
8
8
 
9
- centurio.work/out/frame is distributed in the hope that it will be useful, but
10
- WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11
- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12
- more details.
9
+ CPEE-FRAMES is distributed in the hope that it will be useful, but WITHOUT
10
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11
+ FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
12
+ details.
13
13
 
14
14
  You should have received a copy of the GNU General Public License along with
15
- centurio.work/out/frame (file LICENSE in the main directory). If not, see
15
+ CPEE-FRAMES (file LICENSE in the main directory). If not, see
16
16
  <http://www.gnu.org/licenses/>.
17
17
  -->
18
18
 
@@ -42,15 +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
- <!-- Forms
52
- <script src='https://centurio.work/out/forms/js/formio.full.min.js'></script>
53
- -->
54
49
  <script>
55
50
  if (location.href.match(/\/$/) == null) {
56
51
  location.href = location.href + '/';
@@ -1,18 +1,18 @@
1
1
  <!--
2
- This file is part of centurio.work/out/frame.
2
+ This file is part of CPEE-FRAMES.
3
3
 
4
- centurio.work/out/frame is free software: you can redistribute it and/or modify
5
- it under the terms of the GNU General Public License as published by the Free
6
- Software Foundation, either version 3 of the License, or (at your option) any
7
- later version.
4
+ CPEE-FRAMES is free software: you can redistribute it and/or modify it under
5
+ the terms of the GNU General Public License as published by the Free Software
6
+ Foundation, either version 3 of the License, or (at your option) any later
7
+ version.
8
8
 
9
- centurio.work/out/frame is distributed in the hope that it will be useful, but
10
- WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11
- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12
- more details.
9
+ CPEE-FRAMES is distributed in the hope that it will be useful, but WITHOUT
10
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11
+ FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
12
+ details.
13
13
 
14
14
  You should have received a copy of the GNU General Public License along with
15
- centurio.work/out/frame (file LICENSE in the main directory). If not, see
15
+ CPEE-FRAMES (file LICENSE in the main directory). If not, see
16
16
  <http://www.gnu.org/licenses/>.
17
17
  -->
18
18
 
@@ -52,8 +52,8 @@
52
52
 
53
53
  <li>define Endpoint: *adapt to your needs*</li>
54
54
  <ul>
55
- <li>init: https-post://centurio.work/out/frames/</li>
56
- <li>frames: https-put://centurio.work/out/frames/</li>
55
+ <li>init: https-post://your.server/frames/</li>
56
+ <li>frames: https-put://your.server/frames/</li>
57
57
  </ul>
58
58
  <li>define Data Element: (url where your frame will be reached)</li>
59
59
  <ul>
@@ -102,7 +102,7 @@
102
102
  <li>In the case your site is empty</li>
103
103
  <ul>
104
104
  <li>HAHA</li>
105
- <li>Nah its not that bad, look in your process engine and best thing to do is to use the design service next time</li>
105
+ <li>Nah its not that bad, look in your process engine; the best thing to do is to use the design service next time</li>
106
106
  </ul>
107
107
  </ul>
108
108
  </ul>
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.exists?(File.join(__dir__,'..','lib','cpee-frames','implementation.rb'))
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.exists?(dir)
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.exists?(dir)
76
+ if !File.exist?(dir)
77
77
  FileUtils.cp_r(File.join(curpath,'..','ui'),dir)
78
78
  else
79
79
  puts 'Directory already exists.'
@@ -1,14 +1,10 @@
1
-
2
-
3
1
  function showDocument(fr = "") {
4
-
5
2
  if(fr != ""){
6
3
  $.ajax({
7
4
  type: "GET",
8
- url: 'https://centurio.work/out/frames/' + fr + '/dataelements.json',
5
+ url: 'dataelements.json',
9
6
  success: function(ret) {
10
-
11
- $("#alldata").text(JSON.stringify(ret["ausfuehrungen"]));
7
+ $("#alldata").text(JSON.stringify(ret));
12
8
  },
13
9
  error: function() {
14
10
  reason = '';
@@ -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
  });
@@ -1,18 +1,18 @@
1
1
  <!--
2
- This file is part of centurio.work/out/frame.
2
+ This file is part of CPEE-FRAMES.
3
3
 
4
- centurio.work/out/frame is free software: you can redistribute it and/or modify
5
- it under the terms of the GNU General Public License as published by the Free
6
- Software Foundation, either version 3 of the License, or (at your option) any
7
- later version.
4
+ CPEE-FRAMES is free software: you can redistribute it and/or modify it under
5
+ the terms of the GNU General Public License as published by the Free Software
6
+ Foundation, either version 3 of the License, or (at your option) any later
7
+ version.
8
8
 
9
- centurio.work/out/frame is distributed in the hope that it will be useful, but
10
- WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11
- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12
- more details.
9
+ CPEE-FRAMES is distributed in the hope that it will be useful, but WITHOUT
10
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11
+ FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
12
+ details.
13
13
 
14
14
  You should have received a copy of the GNU General Public License along with
15
- centurio.work/out/frame (file LICENSE in the main directory). If not, see
15
+ CPEE-FRAMES (file LICENSE in the main directory). If not, see
16
16
  <http://www.gnu.org/licenses/>.
17
17
  -->
18
18
 
@@ -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>
@@ -1,18 +1,18 @@
1
1
  <!--
2
- This file is part of centurio.work/out/frame.
2
+ This file is part of CPEE-FRAMES.
3
3
 
4
- centurio.work/out/frame is free software: you can redistribute it and/or modify
5
- it under the terms of the GNU General Public License as published by the Free
6
- Software Foundation, either version 3 of the License, or (at your option) any
7
- later version.
4
+ CPEE-FRAMES is free software: you can redistribute it and/or modify it under
5
+ the terms of the GNU General Public License as published by the Free Software
6
+ Foundation, either version 3 of the License, or (at your option) any later
7
+ version.
8
8
 
9
- centurio.work/out/frame is distributed in the hope that it will be useful, but
10
- WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11
- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12
- more details.
9
+ CPEE-FRAMES is distributed in the hope that it will be useful, but WITHOUT
10
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11
+ FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
12
+ details.
13
13
 
14
14
  You should have received a copy of the GNU General Public License along with
15
- centurio.work/out/frame (file LICENSE in the main directory). If not, see
15
+ CPEE-FRAMES (file LICENSE in the main directory). If not, see
16
16
  <http://www.gnu.org/licenses/>.
17
17
  -->
18
18
 
@@ -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">
@@ -1,18 +1,18 @@
1
1
  <!--
2
- This file is part of centurio.work/out/frame.
2
+ This file is part of CPEE-FRAMES.
3
3
 
4
- centurio.work/out/frame is free software: you can redistribute it and/or modify
5
- it under the terms of the GNU General Public License as published by the Free
6
- Software Foundation, either version 3 of the License, or (at your option) any
7
- later version.
4
+ CPEE-FRAMES is free software: you can redistribute it and/or modify it under
5
+ the terms of the GNU General Public License as published by the Free Software
6
+ Foundation, either version 3 of the License, or (at your option) any later
7
+ version.
8
8
 
9
- centurio.work/out/frame is distributed in the hope that it will be useful, but
10
- WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11
- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12
- more details.
9
+ CPEE-FRAMES is distributed in the hope that it will be useful, but WITHOUT
10
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11
+ FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
12
+ details.
13
13
 
14
14
  You should have received a copy of the GNU General Public License along with
15
- centurio.work/out/frame (file LICENSE in the main directory). If not, see
15
+ CPEE-FRAMES (file LICENSE in the main directory). If not, see
16
16
  <http://www.gnu.org/licenses/>.
17
17
  -->
18
18
 
@@ -47,9 +47,6 @@
47
47
  </script>
48
48
  </head>
49
49
  <body is="x-ui">
50
- <div id="container">
51
- test
52
- </div>
53
-
50
+ <div id="container">test</div>
54
51
  </body>
55
52
  </html>
@@ -0,0 +1,61 @@
1
+ document.addEventListener('keyup', (event) => {
2
+ if (event.key == 'ArrowRight') {
3
+ $.ajax({
4
+ type: "PUT",
5
+ url: "../Manuel",
6
+ headers: {"content-id": "input"},
7
+ data: { style_url: "mystyleURL", document_url: 'www.nixdrin.at' },
8
+ success: function(res) {
9
+ location.reload();
10
+ },
11
+ error: function (request, status, error) {
12
+ alert(request.responseText + status + error);
13
+ }
14
+ });
15
+ }
16
+
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
+ }
61
+ });
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
- // If one rectangle is on left side of other
7
- if (l1x > r2x || l2x > r1x)
8
- return false;
9
- // If one rectangle is above other
10
- if (l1y > r2y || l2y > r1y)
11
- return false;
12
- return true;
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
- if (typeof document.getElementById(decodeURIComponent(cpeecallback)).contentWindow.buttonPressed !== 'undefined' && $.isFunction(document.getElementById(decodeURIComponent(cpeecallback)).contentWindow.buttonPressed)) {
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.3
4
+ version: 1.0.6
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: 2023-02-23 00:00:00.000000000 Z
12
+ date: 2025-03-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: riddl
@@ -55,10 +55,7 @@ files:
55
55
  - cpee-frames.gemspec
56
56
  - lib/cpee-frames/frames.xml
57
57
  - lib/cpee-frames/implementation.rb
58
- - lib/cpee-frames/ui/framedata.html
59
- - lib/cpee-frames/ui/menu.html
60
58
  - lib/cpee-frames/ui/template.html
61
- - lib/cpee-frames/ui/test.html
62
59
  - lib/cpee-frames/ui/tutorial.html
63
60
  - server/frames
64
61
  - server/frames.conf
@@ -67,9 +64,12 @@ files:
67
64
  - ui/css/favicon-32x32.png
68
65
  - ui/css/favicon-96x96.png
69
66
  - ui/css/frames.css
70
- - ui/js/frame_data.js
67
+ - ui/examples/frame_data.js
68
+ - ui/examples/framedata.html
69
+ - ui/examples/menu.html
70
+ - ui/examples/test.html
71
+ - ui/examples/test.js
71
72
  - ui/js/language.js
72
- - ui/js/test.js
73
73
  - ui/js/ui.js
74
74
  homepage: https://github.com/ManuelGall/cpee-frames
75
75
  licenses:
@@ -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.3.26
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
data/ui/js/test.js DELETED
@@ -1,68 +0,0 @@
1
-
2
-
3
- document.addEventListener('keyup', (event) => {
4
- if (event.key == 'ArrowRight') {
5
- $.ajax({
6
- type: "PUT",
7
- url: "../Manuel",
8
- headers: {"content-id": "input"},
9
- data: { style_url: "mystyleURL", document_url: 'www.nixdrin.at' },
10
- success: function(res) {
11
- location.reload();
12
- },
13
- error: function (request, status, error) {
14
- alert(request.responseText + status + error);
15
- }
16
- });
17
- }
18
-
19
- if (event.key == 'ArrowUp') {
20
-
21
- $.ajax({
22
- type: "POST",
23
- url: "../Manuel",
24
- headers: {"content-id": "frame"},
25
- data: { lx: "2", ly: '0', rx: '1', ry: '2', url: 'https://centurio.work/' },
26
- success: function(res) {
27
- location.reload();
28
- },
29
- error: function (request, status, error) {
30
- alert(request.responseText + status + error);
31
- }
32
- });
33
- }
34
-
35
-
36
- if (event.key == 'ArrowDown') {
37
- $.ajax({
38
- type: "POST",
39
- url: "../Manuel",
40
- headers: {"content-id": "frame"},
41
- data: { lx: "0", ly: '0', rx: '2', ry: '2', url: 'https://centurio.work/flow-test/' },
42
- success: function(res) {
43
- location.reload();
44
- },
45
- error: function (request, status, error) {
46
- alert(request.responseText + status + error);
47
- }
48
- });
49
- }
50
-
51
- if (event.key == 'ArrowLeft') {
52
- $.ajax({
53
- type: "POST",
54
- url: "../Manuel",
55
- headers: {"content-id": "frame"},
56
- data: { lx: "1", ly: '1', rx: '2', ry: '2', url: 'https://centurio.work/customers/evva/was/ui/' },
57
- success: function(res) {
58
- location.reload();
59
- },
60
- error: function (request, status, error) {
61
- alert(request.responseText + status + error);
62
- }
63
- });
64
- }
65
-
66
-
67
- });
68
-