cpee-frames 1.0.3 → 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f6e3e17dafdfc33eea6a1985ef1195ae366e481783eee9a0521f2e24b376ab89
4
- data.tar.gz: b1027c8c1e6ddea9122c87ccef384c1e628f8db1fa6369f61e819d235446cb96
3
+ metadata.gz: bdca65cce57c3f745051b004fba4e46bc353dafa402fa04e4165a5fad8646010
4
+ data.tar.gz: 99881a242c05659c8e73fb3c2c8fb1b71275650f71482f41e327cd5fb620eee0
5
5
  SHA512:
6
- metadata.gz: 182e44f12d97f59918eaea3a2590614c7758f920f2a4ce06ed848623348941fd60bfc493add7228f4f228d32867fb42bf66984d0505a68f95d4c294b49e7c17b
7
- data.tar.gz: 190580b76dfc5a2100ad0cd1fbee4056f7db53ce9fa9cc7845574b3d87c8ee7923470c8b7da53e0047590696bc563790c3c1f4caaa880227fb5d8d4ff9894d86
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"
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"
@@ -250,7 +250,7 @@ module CPEE
250
250
  def response
251
251
  data_dir = @a[0]
252
252
  fname = File.join(data_dir,@r[-2],'frames.json')
253
- if File.exists? fname
253
+ if File.exist? fname
254
254
 
255
255
  infofile = File.join(data_dir,@r[-2],'info.json')
256
256
  infojson = JSON::parse(File.read(infofile))
@@ -287,7 +287,7 @@ module CPEE
287
287
  #puts @p[0].value
288
288
 
289
289
  #fname = File.join(data_dir,@r[-2],'dataelements.json')
290
- #if File.exists? fname
290
+ #if File.exist? fname
291
291
  # Riddl::Parameter::Complex.new('value','application/json',File.read(fname))
292
292
  #else
293
293
  # @status = 404
@@ -299,7 +299,7 @@ module CPEE
299
299
  def response
300
300
  data_dir = @a[0]
301
301
  fname = File.join(data_dir,@r[-2],'dataelements.json')
302
- if File.exists? fname
302
+ if File.exist? fname
303
303
  Riddl::Parameter::Complex.new('value','application/json',File.read(fname))
304
304
  else
305
305
  @status = 404
@@ -311,7 +311,7 @@ module CPEE
311
311
  def response
312
312
  data_dir = @a[0]
313
313
  fname = File.join(data_dir,@r[-2],'info.json')
314
- if File.exists? fname
314
+ if File.exist? fname
315
315
  Riddl::Parameter::Complex.new('value','application/json',File.read(fname))
316
316
  else
317
317
  @status = 404
@@ -323,7 +323,7 @@ module CPEE
323
323
  def response
324
324
  data_dir = @a[0]
325
325
  fname = File.join(data_dir,@r[-2],'info.json')
326
- if File.exists? fname
326
+ if File.exist? fname
327
327
  infojson = JSON::parse(File.read(fname))
328
328
  Riddl::Parameter::Complex.new('value','application/json',infojson["langs"])
329
329
  else
@@ -336,7 +336,7 @@ module CPEE
336
336
  def response
337
337
  data_dir = @a[1]
338
338
  fname = File.join(data_dir,@r[-2],'info.json')
339
- if File.exists? fname
339
+ if File.exist? fname
340
340
  infojson = JSON::parse(File.read(fname))
341
341
  infojson["lang"] = @p[0].value
342
342
 
@@ -362,7 +362,7 @@ module CPEE
362
362
  def response
363
363
  data_dir = @a[0]
364
364
  fname = File.join(data_dir,@r[-2],'style.url')
365
- if File.exists? fname
365
+ if File.exist? fname
366
366
  Riddl::Parameter::Complex.new('url','text/plain',File.read(fname).strip)
367
367
  else
368
368
  @status = 404
@@ -374,7 +374,7 @@ module CPEE
374
374
  def response
375
375
  data_dir = @a[0]
376
376
  fname = File.join(data_dir,@r[-2],'cpeeinstance.url')
377
- if File.exists? fname
377
+ if File.exist? fname
378
378
  Riddl::Parameter::Complex.new('url','text/plain',File.read(fname).strip)
379
379
  else
380
380
  @status = 404
@@ -388,7 +388,7 @@ module CPEE
388
388
  end
389
389
  end #}}}
390
390
 
391
- class Handler < Riddl::Implementation
391
+ class Handler < Riddl::Implementation #{{{
392
392
  def response
393
393
  data_dir = @a[1]
394
394
  topic = @p[1].value
@@ -401,11 +401,6 @@ module CPEE
401
401
  parameters = content['parameters']
402
402
  receiving = content['received']
403
403
 
404
- #puts instancenr
405
- #puts activity
406
- puts content['values']
407
-
408
-
409
404
  if content['values']&.any?
410
405
  #puts alldata['ausfuehrungen']
411
406
  puts "writing file"
@@ -416,7 +411,7 @@ module CPEE
416
411
  @a[0].send(@r[0])
417
412
  nil
418
413
  end
419
- end
414
+ end #}}}
420
415
 
421
416
  class SSE < Riddl::SSEImplementation #{{{
422
417
  def onopen
@@ -500,7 +495,7 @@ module CPEE
500
495
  opts[:signals][idx] ||= Signaling.new
501
496
  opts[:signals2]["handler"] ||= Signaling.new
502
497
 
503
- run Get, "test" if get
498
+ run Get if get
504
499
  run InitFrame, opts[:signals][idx], opts[:data_dir] if post 'input'
505
500
 
506
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
  -->
@@ -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>
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.'
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: 'https://centurio.work/out/frames/' + fr + '/dataelements.json',
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
- $.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
-
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
- // 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.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: 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
@@ -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