cpee 1.4.31 → 1.4.32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (74) hide show
  1. checksums.yaml +4 -4
  2. data/cockpit/css/ui.css +25 -6
  3. data/cockpit/css/wfadaptor.css +20 -10
  4. data/cockpit/graph.html +7 -2
  5. data/cockpit/index.html +2 -3
  6. data/cockpit/js/details.js +3 -0
  7. data/cockpit/js/instance.js +70 -20
  8. data/cockpit/js/ui.js +32 -5
  9. data/cockpit/js/wfadaptor.js +70 -42
  10. data/cockpit/themes/compact/theme.js +55 -46
  11. data/cockpit/themes/default/symbols/otherwise.svg +2 -1
  12. data/cockpit/themes/{promise/symbols/choose.svg → default/symbols/parallel_branch_compact.svg} +2 -2
  13. data/cockpit/themes/default/theme.js +39 -44
  14. data/cockpit/themes/extended/theme.js +252 -60
  15. data/cockpit/themes/{lego → packed}/theme.js +492 -105
  16. data/cockpit/track.html +39 -32
  17. data/cpee.gemspec +1 -1
  18. data/lib/cpee/controller.rb +2 -0
  19. data/lib/cpee/instantiation.rb +22 -5
  20. data/lib/cpee/value_helper.rb +1 -1
  21. data/lib/instantiation.xml +3 -0
  22. data/log/elasticsearch_logging.rb +189 -50
  23. data/server/handlerwrappers/default.rb +3 -3
  24. data/server/server.pid +1 -0
  25. metadata +5 -53
  26. data/cockpit/themes/lego/rngs/alternative.rng +0 -5
  27. data/cockpit/themes/lego/rngs/call.rng +0 -41
  28. data/cockpit/themes/lego/rngs/choose.rng +0 -8
  29. data/cockpit/themes/lego/rngs/critical.rng +0 -5
  30. data/cockpit/themes/lego/rngs/loop.rng +0 -11
  31. data/cockpit/themes/lego/rngs/manipulate.rng +0 -6
  32. data/cockpit/themes/lego/rngs/parallel.rng +0 -5
  33. data/cockpit/themes/lego/rngs/parallel_branch.rng +0 -8
  34. data/cockpit/themes/lego/symbols/alternative.svg +0 -4
  35. data/cockpit/themes/lego/symbols/call.svg +0 -4
  36. data/cockpit/themes/lego/symbols/callmanipulate.svg +0 -6
  37. data/cockpit/themes/lego/symbols/callori.svg +0 -4
  38. data/cockpit/themes/lego/symbols/choose.svg +0 -4
  39. data/cockpit/themes/lego/symbols/choose_exclusive.svg +0 -5
  40. data/cockpit/themes/lego/symbols/choose_inclusive.svg +0 -4
  41. data/cockpit/themes/lego/symbols/critical.svg +0 -4
  42. data/cockpit/themes/lego/symbols/escape.svg +0 -5
  43. data/cockpit/themes/lego/symbols/lego.svg +0 -72
  44. data/cockpit/themes/lego/symbols/loop.svg +0 -5
  45. data/cockpit/themes/lego/symbols/manipulate.svg +0 -4
  46. data/cockpit/themes/lego/symbols/otherwise.svg +0 -4
  47. data/cockpit/themes/lego/symbols/parallel.svg +0 -6
  48. data/cockpit/themes/lego/symbols/parallel_branch.svg +0 -4
  49. data/cockpit/themes/lego/symbols/scripts.svg +0 -4
  50. data/cockpit/themes/lego/symbols/start.svg +0 -3
  51. data/cockpit/themes/promise/rngs/alternative.rng +0 -5
  52. data/cockpit/themes/promise/rngs/call.rng +0 -41
  53. data/cockpit/themes/promise/rngs/choose.rng +0 -8
  54. data/cockpit/themes/promise/rngs/critical.rng +0 -5
  55. data/cockpit/themes/promise/rngs/loop.rng +0 -11
  56. data/cockpit/themes/promise/rngs/manipulate.rng +0 -6
  57. data/cockpit/themes/promise/rngs/parallel.rng +0 -5
  58. data/cockpit/themes/promise/rngs/parallel_branch.rng +0 -8
  59. data/cockpit/themes/promise/symbols/alternative.svg +0 -4
  60. data/cockpit/themes/promise/symbols/call.svg +0 -4
  61. data/cockpit/themes/promise/symbols/callmanipulate.svg +0 -6
  62. data/cockpit/themes/promise/symbols/choose_exclusive.svg +0 -5
  63. data/cockpit/themes/promise/symbols/choose_inclusive.svg +0 -4
  64. data/cockpit/themes/promise/symbols/critical.svg +0 -4
  65. data/cockpit/themes/promise/symbols/escape.svg +0 -5
  66. data/cockpit/themes/promise/symbols/loop.svg +0 -5
  67. data/cockpit/themes/promise/symbols/manipulate.svg +0 -4
  68. data/cockpit/themes/promise/symbols/otherwise.svg +0 -4
  69. data/cockpit/themes/promise/symbols/parallel.svg +0 -6
  70. data/cockpit/themes/promise/symbols/parallel_branch.svg +0 -4
  71. data/cockpit/themes/promise/symbols/preminder.svg +0 -6
  72. data/cockpit/themes/promise/symbols/scripts.svg +0 -4
  73. data/cockpit/themes/promise/symbols/start.svg +0 -3
  74. data/cockpit/themes/promise/theme.js +0 -801
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9e48011aec4db8af5bc2b79dd87481695b733dbdffb0b171e8fb6281af4de1c9
4
- data.tar.gz: e686360f51c1b0f6c72446182b0e9bb9bb572a7cc57877bcb4dbb8c92201ce28
3
+ metadata.gz: cc0378a344f36f63688176739300a794d7382bd0b64328f77268a86d7793b600
4
+ data.tar.gz: dc7386cf36ec7fa429869d574f0fcf00100e7f6e557a40659ffad85d14578059
5
5
  SHA512:
6
- metadata.gz: eb4e1ca4c4f3cc2ae1720d189aaca4a6daa3caa2021e89a3e46c6c59c14721e7b02a604e075b4c751708e1644789cc09ee1b2035014e7832f12cd8f0086c0ff7
7
- data.tar.gz: 38310d626cd1f1adacc706938621e34aa1da45d846a4852da008c96b8e2d86d5aa1de12b47c9fe30fc1f2ecff03f22ac35632b75a52181d0ec5ed13af56239ad
6
+ metadata.gz: 9752ddc5b88787159245f8cf00fc4ac5bde112bae2bd663d6f2c0ce79fd92e2298e83acc28a806a5828560fbcedb71b16b2e4ff9ddf22666cc02d49104cafd71
7
+ data.tar.gz: cc8b6d31edf48155691537d23ecb959ef86c98d8cdbe0ae94361d81f9b5d1fbc14eedbda84215372ef8422c38c02a2cc7410b91bc08e87da24c827b633d47e4b
@@ -10,25 +10,44 @@ body {
10
10
  #graphgrid {
11
11
  display: grid;
12
12
  grid-gap: 0;
13
- grid-template-columns: max-content repeat(100,min-content);
14
13
  width: 100%;
15
14
  }
16
15
  #graphcanvas {
17
16
  grid-column: 1;
18
17
  }
19
- .graphspacer {
20
- grid-row: 1;
21
- grid-column: 2;
18
+ #graphgrid .graphlabel {
19
+ padding-left: 0.5em;
20
+ padding-right: 0.5em;
21
+ display: flex;
22
+ flex-direction: row;
22
23
  }
23
- .graphlabel {
24
+ #graphgrid .graphempty {
24
25
  padding-left: 0.5em;
25
26
  display: flex;
26
27
  flex-direction: row;
27
28
  }
28
- .graphlabel > span {
29
+ #graphgrid .graphlast {
30
+ padding-left: 0.5em;
31
+ display: flex;
32
+ flex-direction: row;
33
+ }
34
+ #graphgrid.striped .graphlabel, #graphgrid.striped .graphempty {
35
+ border-left: 1pt solid var(--wfadaptor-border);
36
+ }
37
+ #graphgrid.striped .graphlabel.even, #graphgrid.striped .graphempty.even, #graphgrid.striped .graphlast.even {
38
+ background-color: #e9e9e9;
39
+ }
40
+ #graphgrid .graphlabel > span {
29
41
  align-self: center;
30
42
  white-space: nowrap;
31
43
  }
44
+ #graphgrid .graphlabel.hover {
45
+ color: var(--wfadaptor-selected);
46
+ cursor: pointer;
47
+ }
48
+ #graphgrid .graphlabel.selected {
49
+ color: var(--wfadaptor-selected);
50
+ }
32
51
 
33
52
  #instance ui-content { height: 7em; }
34
53
 
@@ -20,13 +20,15 @@
20
20
  --wfadaptor-exec-active-text: #cc0000;
21
21
  --wfadaptor-exec-vote: #8ae234;
22
22
  --wfadaptor-exec-vote-text: #73d216;
23
- --wfadaptor-highlight: Highlight;
23
+ --wfadaptor-highlight: #0081c7;
24
24
  --wfadaptor-base: #000000;
25
25
  --wfadaptor-label: #d4d4d4;
26
26
  --wfadaptor-mark: #d4d4d4;
27
27
  --wfadaptor-selected: #f57900;
28
+ --wfadaptor-stripe: #e9e9e9;
28
29
  --wfadaptor-background: #ffffff;
29
30
  --wfadaptor-background-menu: #ff7f7f;
31
+ --wfadaptor-border: #a1a1a1;
30
32
  }
31
33
 
32
34
  svg {
@@ -44,6 +46,14 @@ svg g.passive .rfill {
44
46
  fill: var(--wfadaptor-exec-passive);
45
47
  fill-opacity:1;
46
48
  }
49
+
50
+ svg rect.stripe.even {
51
+ fill: var(--wfadaptor-background);
52
+ }
53
+ svg rect.stripe.odd {
54
+ fill: var(--wfadaptor-stripe);
55
+ }
56
+
47
57
  svg g.active .rfill {
48
58
  fill: var(--wfadaptor-exec-active);
49
59
  fill-opacity:1;
@@ -73,6 +83,7 @@ svg line.ourline, svg path.ourline {
73
83
  stroke-width: 2;
74
84
  fill: none;
75
85
  }
86
+
76
87
  svg rect.block {
77
88
  stroke-width: 1;
78
89
  stroke-dasharray: 3,5;
@@ -220,7 +231,6 @@ svg .standwithout {
220
231
  }
221
232
  svg .standtrans {
222
233
  fill: var(--wfadaptor-background);
223
- fill-opacity:0;
224
234
  }
225
235
  svg text.normal {
226
236
  font-size:20px;
@@ -329,8 +339,8 @@ svg text.label {
329
339
  line-height:125%;
330
340
  writing-mode:horizontal-tb;
331
341
  text-anchor:left;
332
- color: var(--wfadaptor-text);
333
- fill: var(--wfadaptor-text);
342
+ color: var(--wfadaptor-base);
343
+ fill: var(--wfadaptor-base);
334
344
  fill-opacity:1;
335
345
  stroke:none;
336
346
  font-family:Arial;
@@ -342,12 +352,12 @@ svg text.label {
342
352
  fill: var(--wfadaptor-base);
343
353
  }
344
354
 
345
- svg g.element[element-id]:hover .hfill {
355
+ svg g.element[element-id].hover .hfill {
346
356
  fill: var(--wfadaptor-selected);
347
357
  fill-opacity:1;
348
358
  cursor: pointer;
349
359
  }
350
- svg g.element[element-id]:hover .hline {
360
+ svg g.element[element-id].hover .hline {
351
361
  fill: var(--wfadaptor-selected);
352
362
  fill-opacity:1;
353
363
  stroke: var(--wfadaptor-selected);
@@ -358,7 +368,7 @@ svg g.element[element-id]:hover .hline {
358
368
  stroke-dasharray:none;
359
369
  cursor: pointer;
360
370
  }
361
- svg g.element[element-id]:hover .htext {
371
+ svg g.element[element-id].hover .htext {
362
372
  fill: var(--wfadaptor-selected);
363
373
  fill-opacity:1;
364
374
  stroke: var(--wfadaptor-selected);
@@ -370,11 +380,11 @@ svg g.element[element-id]:hover .htext {
370
380
  stroke-dasharray:none;
371
381
  cursor: pointer;
372
382
  }
373
- svg g.element[element-id]:hover > text.label {
383
+ svg g.element[element-id].hover > text.label {
374
384
  color: var(--wfadaptor-selected);
375
385
  fill: var(--wfadaptor-selected);
376
386
  }
377
- svg g.element[element-id]:hover .cfill {
387
+ svg g.element[element-id].hover .cfill {
378
388
  fill: var(--wfadaptor-base);
379
389
  fill-opacity:1;
380
390
  stroke: var(--wfadaptor-base);
@@ -385,7 +395,7 @@ svg g.element[element-id]:hover .cfill {
385
395
  stroke-opacity:1;
386
396
  stroke-dasharray:none;
387
397
  }
388
- svg g.element[element-id]:hover .cline {
398
+ svg g.element[element-id].hover .cline {
389
399
  stroke: var(--wfadaptor-base);
390
400
  stroke-linecap:round;
391
401
  stroke-linejoin:round;
@@ -57,8 +57,13 @@
57
57
  <link rel="stylesheet" href="css/ui.css" type="text/css"/>
58
58
  </head>
59
59
  <body data-base-port="8298" data-res-port="9303" data-theme-base="themes" is="x-ui">
60
- <div id='graphcolumn' style='overflow: auto'>
61
- <svg xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:x="http://www.w3.org/1999/xlink" id='graphcanvas' width='1' height='1'></svg>
60
+ <div class='hidden' id='relaxngworker'></div>
61
+ <div id="trackfull">
62
+ <div id='graphcolumn'>
63
+ <div id='graphgrid'>
64
+ <svg xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:x="http://www.w3.org/1999/xlink" id='graphcanvas' width='1' height='1'></svg>
65
+ </div>
66
+ </div>
62
67
  </div>
63
68
  </body>
64
69
  </html>
@@ -127,8 +127,8 @@
127
127
  <ui-area data-belongs-to-tab="new" id="areanew"> <!--{{{-->
128
128
  <table class='x-ui-layout'>
129
129
  <tr>
130
- <td>Repository:</td>
131
- <td><input name="repo-url" type="text" value=""/></td>
130
+ <td>Resources:</td>
131
+ <td><input name="res-url" type="text" value=""/></td>
132
132
  <td></td>
133
133
  </tr>
134
134
  <tr>
@@ -240,7 +240,6 @@
240
240
  <ui-area data-belongs-to-tab="details" id='graphcolumn'>
241
241
  <div id='graphgrid'>
242
242
  <svg xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:x="http://www.w3.org/1999/xlink" id='graphcanvas' width='1' height='1'></svg>
243
- <div class='graphspacer'></div>
244
243
  </div>
245
244
  </ui-area>
246
245
  <ui-resizehandle data-belongs-to-tab="details" data-label="drag to resize"></ui-resizehandle>
@@ -59,6 +59,9 @@ function do_main_save() { //{{{
59
59
  if (vtarget.length > 0) {
60
60
  vtarget.parents('g.element[element-id]').addClass('selected');
61
61
  }
62
+ manifestation.adaptor.illustrator.get_label_by_svg_id(svgid).addClass('selected');
63
+
64
+
62
65
  var newnode = vtarget.parents('g.element[element-id]');
63
66
  var newtype = newnode.attr('element-type') + '_' + newnode.attr('element-endpoint');
64
67
  var g = graphrealization.get_description();
@@ -69,7 +69,7 @@ var sub_less = 'topic' + '=' + 'activity' + '&' +// {{{
69
69
 
70
70
  function cockpit() { //{{{
71
71
  $("button[name=base]").click(function(){ create_instance($("input[name=base-url]").val(),null,false,false); });
72
- $("button[name=instance]").click(function(){ ui_activate_tab("#tabinstance"); monitor_instance($("input[name=instance-url]").val(),$("input[name=repo-url]").val(),false,false); });
72
+ $("button[name=instance]").click(function(){ ui_activate_tab("#tabinstance"); monitor_instance($("input[name=instance-url]").val(),$("input[name=res-url]").val(),false,false); });
73
73
  $("button[name=loadtestset]").click(function(e){new CustomMenu(e).menu($('#predefinedtestsets'),function(){ load_testset(false) } ); });
74
74
  $("button[name=loadtestsetfile]").click(load_testsetfile);
75
75
  $("button[name=loadmodelfile]").click(load_modelfile);
@@ -106,7 +106,7 @@ function cockpit() { //{{{
106
106
  });
107
107
  }
108
108
  ui_activate_tab("#tabexecution");
109
- monitor_instance(q.monitor,$("body").attr('current-repo'),true,false);
109
+ monitor_instance(q.monitor,$("body").attr('current-resources'),true,false);
110
110
  } else if (q.load) {
111
111
  if (q.load.match(/https?:\/\//)) {
112
112
  $('body').attr('load-testset',q.load);
@@ -122,7 +122,7 @@ function cockpit() { //{{{
122
122
  create_instance($("body").attr('current-base'),"Plain Instance",false,false);
123
123
  } else if (q.monitor) {
124
124
  ui_activate_tab("#tabexecution");
125
- monitor_instance(q.monitor,$("body").attr('current-repo'),false,false);
125
+ monitor_instance(q.monitor,$("body").attr('current-resources'),false,false);
126
126
  } else if (q.exec) {
127
127
  if (q.exec.match(/https?:\/\//)) {
128
128
  $('body').attr('load-testset',q.load);
@@ -199,7 +199,7 @@ function create_instance(base,name,load,exec) {// {{{
199
199
  success: function(res){
200
200
  var iu = (base + "//" + res + "/").replace(/\/+/g,"/").replace(/:\//,"://");
201
201
  if (name) {
202
- monitor_instance(iu,$("body").attr('current-repo'),load,exec);
202
+ monitor_instance(iu,$("body").attr('current-resources'),load,exec);
203
203
  } else {
204
204
  $("body").attr('current-instance', sanitize_url(iu));
205
205
  $("input[name=instance-url]").val(iu);
@@ -284,10 +284,10 @@ function websocket() { //{{{
284
284
 
285
285
  function monitor_instance(cin,rep,load,exec) {// {{{
286
286
  $("body").attr('current-instance',sanitize_url(cin));
287
- $("body").attr('current-repo', sanitize_url(rep));
287
+ $("body").attr('current-resources',sanitize_url(rep));
288
288
 
289
289
  $("input[name=instance-url]").val($("body").attr('current-instance'));
290
- $("input[name=repo-url]").val($("body").attr('current-repo'));
290
+ $("input[name=res-url]").val($("body").attr('current-resources'));
291
291
 
292
292
  $('.tabbehind button').hide();
293
293
  $('#dat_details').empty();
@@ -345,7 +345,7 @@ function monitor_instance(cin,rep,load,exec) {// {{{
345
345
 
346
346
  function monitor_instance_values(val) {// {{{
347
347
  var url = $('body').attr('current-instance');
348
- var rep = $('body').attr('current-repo');
348
+ var rep = $('body').attr('current-resources');
349
349
  var bas = $('body').attr('current-base');
350
350
 
351
351
  $.ajax({
@@ -362,7 +362,7 @@ function monitor_instance_values(val) {// {{{
362
362
  url: rep + encodeURIComponent($(v).text()),
363
363
  success: function() {
364
364
  tmp[v.tagName] = {};
365
- var deferreds = [new $.Deferred(), new $.Deferred()];
365
+ var deferreds = [new $.Deferred(), new $.Deferred(), new $.Deferred()];
366
366
  $.ajax({
367
367
  url: rep + encodeURIComponent($(v).text()) + "/symbol.svg",
368
368
  success: function(res) {
@@ -379,6 +379,14 @@ function monitor_instance_values(val) {// {{{
379
379
  },
380
380
  error: deferreds[1].resolve
381
381
  })
382
+ $.ajax({
383
+ url: rep + encodeURIComponent($(v).text()) + "/properties.json",
384
+ success: function(res) {
385
+ tmp[v.tagName]['properties'] = res;
386
+ deferreds[2].resolve(true);
387
+ },
388
+ error: deferreds[2].resolve
389
+ })
382
390
  $.when.apply($, deferreds).then(function(x) {
383
391
  save['endpoints_cache'] = tmp;
384
392
  // when updating attributes clear the attributes, because they might change as well. New arguments are possible.
@@ -413,33 +421,60 @@ function adaptor_init(url,theme,dslx) { //{{{
413
421
  save['graph_theme'] = theme;
414
422
  save['graph_adaptor'] = new WfAdaptor($('body').data('theme-base') + '/' + theme + '/theme.js',function(graphrealization){
415
423
  manifestation.endpoints = save.endpoints_list;
416
- graphrealization.draw_labels = function(max,labels,shift) {
417
- $('#graphcanvas').css('grid-row', '1/span ' +( max.row + 1));
418
- $('#graphgrid .graphlabel').remove();
419
- $('#graphgrid').css('grid-template-rows', shift + 'px repeat(' + max.row + ', 1fr)');
424
+ graphrealization.draw_labels = function(max,labels,shift,striped) {
425
+ $('#graphcanvas').css('grid-row', '1/span ' + (max.row + 2));
426
+ if (striped == true) {
427
+ if (!$('#graphgrid').hasClass('striped')) {
428
+ $('#graphgrid').addClass('striped');
429
+ }
430
+ } else {
431
+ $('#graphgrid').removeClass('striped');
432
+ }
433
+
434
+ $('#graphgrid .graphlabel, #graphgrid .graphempty, #graphgrid .graphlast').remove();
420
435
  var tlabels = {};
421
436
  var tcolumns = [];
437
+ var tcolumncount = {}
422
438
  _.each(labels,function(val){
423
439
  if (val.label != "") {
424
440
  tlabels[val.row] = [];
425
441
  _.each(val.label,function(col) {
426
442
  if (!tcolumns.includes(col.column)) {
427
443
  tcolumns.push(col.column);
444
+ tcolumncount[col.column] = 0;
428
445
  }
429
- tlabels[val.row][tcolumns.indexOf(col.column)] = col.value;
446
+ if (col.value != undefined) {
447
+ tcolumncount[col.column] += 1;
448
+ }
449
+ tlabels[val.row][tcolumns.indexOf(col.column)] = { label: col.value, type: val.tname, id: val.element_id };
430
450
  });
431
451
  }
432
452
  });
453
+ $('#graphgrid').css({
454
+ 'grid-template-rows': (shift/2) + 'px repeat(' + max.row + ', 1fr) ' + (shift/2) + 'px',
455
+ 'grid-template-columns': 'max-content' + (tcolumns.length > 0 ? ' repeat(' + tcolumns.length.toString() + ',max-content)' : '') + ' auto'
456
+ });
433
457
  for (var i = 0; i < max.row; i++) {
434
- _.each(tlabels[i+1],function(col,j) {
435
- if (col != undefined) {
436
- $('#graphgrid').append($('<div class="graphlabel" style="grid-column: ' + (j+2) + '; grid-row: ' + (i+2) + '; padding-bottom: ' + shift + 'px"><span>' + col + '</span></div>'));
458
+ for (var j =0; j < tcolumns.length; j++) {
459
+ if (tlabels[i+1] != undefined && tlabels[i+1][j] != undefined && tlabels[i+1][j].label != undefined && tlabels[i+1][j].label != '') {
460
+ var col = tlabels[i+1][j];
461
+ var ele = $('<div class="graphlabel ' + (i % 2 == 0 ? 'odd' : 'even') + '" element-type="' + col.type + '" element-id="' + col.id + '" style="grid-column: ' + (j+2) + '; grid-row: ' + (i+2) + '"><span>' + col.label + '</span></div>');
462
+ graphrealization.illustrator.draw.bind_event(ele,col.type,false);
463
+ $('#graphgrid').append(ele);
464
+ } else {
465
+ if (tcolumncount[tcolumns[j]] != 0) {
466
+ var ele = $('<div class="graphempty ' + (i % 2 == 0 ? 'odd' : 'even') + '" style="grid-column: ' + (j+2) + '; grid-row: ' + (i+2) + '; padding-bottom: ' + shift + 'px">&#032;</div>');
467
+ $('#graphgrid').append(ele);
468
+ }
437
469
  }
438
- });
470
+ }
471
+ var j = tcolumns.length;
472
+ var ele = $('<div class="graphlast ' + (i % 2 == 0 ? 'odd' : 'even') + '" style="grid-column: ' + (j+2) + '; grid-row: ' + (i+2) + '; padding-bottom: ' + shift + 'px">&#032;</div>');
473
+ $('#graphgrid').append(ele);
439
474
  }
440
475
  };
441
476
  graphrealization.set_svg_container($('#graphcanvas'));
442
- graphrealization.set_css_container($('#graphgrid'));
477
+ graphrealization.set_label_container($('#graphgrid'));
443
478
  graphrealization.set_description($(dslx), true);
444
479
  graphrealization.notify = function(svgid) {
445
480
  var g = graphrealization.get_description();
@@ -766,12 +801,27 @@ function save_svg() {// {{{
766
801
  gc.prepend($X('<style xmlns="http://www.w3.org/2000/svg" type="text/css"><![CDATA[' + res + ']]></style>'));
767
802
  $(window.document.styleSheets).each(function(i,x){
768
803
  if (x && x.href && x.href.match(/wfadaptor\.css$/)) {
804
+ var varreps = {};
769
805
  $(x.cssRules).each(function(j,y){
770
- var loc = $(gc).find(y.selectorText.replace(/^svg /,''));
771
- loc.attr('style',y.style.cssText + loc.attr('style') + ';');
806
+ if (y.selectorText == ":root") {
807
+ $(y.style).each(function(k,z) {
808
+ varreps['var\\(' + z + '\\)'] = getComputedStyle(document.documentElement).getPropertyValue(z).toString();
809
+ });
810
+ }
811
+ var loc = $(gc).find(y.selectorText.replace(/svg /g,''));
812
+ var cst = y.style.cssText;
813
+ for (k in varreps) {
814
+ cst = cst.replace(new RegExp(k,'g'),varreps[k]);
815
+ }
816
+ loc.each(function(k,loco) {
817
+ var sty = $(loco).attr('style') == undefined ? '' : $(loco).attr('style');
818
+ $(loco).attr('style',cst + sty);
819
+ });
772
820
  });
773
821
  var loc = $(gc).find('text.super');
774
822
  loc.attr('style',loc.attr('style') + ' display: none');
823
+ var loc = $(gc).find('.stripe');
824
+ loc.attr('style',loc.attr('style') + ' display: none');
775
825
  }
776
826
  });
777
827
  $.ajax({
@@ -18,9 +18,9 @@ $(document).ready(function() {
18
18
  $.ajax({
19
19
  url: "config.json",
20
20
  success: function(res){
21
- $("input[name=repo-url]").val(res['repo-url']);
21
+ $("input[name=res-url]").val(res['res-url']);
22
22
  $("input[name=base-url]").val(res['base-url']);
23
- $("body").attr('current-repo',res['repo-url']);
23
+ $("body").attr('current-resources',res['res-url']);
24
24
  $("body").attr('current-base',res['base-url']);
25
25
  $("body").attr('current-testsets',res['testsets-url']);
26
26
  cockpit();
@@ -28,16 +28,43 @@ $(document).ready(function() {
28
28
  error: function(){
29
29
  $("body").attr('current-testsets','testsets/');
30
30
  if (location.protocol.match(/^file/)) {
31
- $("body").attr('current-repo',"http://localhost:" + $('body').data('res-port'));
31
+ $("body").attr('current-resources',"http://localhost:" + $('body').data('res-port'));
32
32
  $("body").attr('current-base',"http://localhost:" + $('body').data('base-port'));
33
33
  } else {
34
- $("body").attr('current-repo',location.protocol + "//" + location.hostname + ":" + $('body').data('res-port'));
34
+ $("body").attr('current-resources',location.protocol + "//" + location.hostname + ":" + $('body').data('res-port'));
35
35
  $("body").attr('current-base',location.protocol + "//" + location.hostname + ":" + $('body').data('base-port'));
36
36
  }
37
- $("input[name=repo-url]").val($("body").attr('current-repo'));
37
+ $("input[name=res-url]").val($("body").attr('current-resources'));
38
38
  $("input[name=base-url]").val($("body").attr('current-base'));
39
39
  cockpit();
40
40
  }
41
41
  });
42
42
  }
43
43
  });
44
+
45
+ $(document).on('copy', '[contenteditable]', function (e) {
46
+ e = e.originalEvent;
47
+ var selectedText = window.getSelection();
48
+ var range = selectedText.getRangeAt(0);
49
+ var selectedTextReplacement = range.toString()
50
+ e.clipboardData.setData('text/plain', selectedTextReplacement);
51
+ e.preventDefault(); // default behaviour is to copy any selected text
52
+ });
53
+
54
+ // Paste fix for contenteditable
55
+ $(document).on('paste', '[contenteditable]', function (e) {
56
+ e.preventDefault();
57
+
58
+ if (window.clipboardData) {
59
+ content = window.clipboardData.getData('Text');
60
+ if (window.getSelection) {
61
+ var selObj = window.getSelection();
62
+ var selRange = selObj.getRangeAt(0);
63
+ selRange.deleteContents();
64
+ selRange.insertNode(document.createTextNode(content));
65
+ }
66
+ } else if (e.originalEvent.clipboardData) {
67
+ content = (e.originalEvent || e).clipboardData.getData('text/plain');
68
+ document.execCommand('insertText', false, content);
69
+ }
70
+ });