cpee 2.1.53 → 2.1.55

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 895480af20ce6499a796ff2beb4985350038da28ed581a315ac9d04bc796e09b
4
- data.tar.gz: e04fa030ef2aca658d5ca1a6880325429de767fac55d1f9f3831356b3fc30c0a
3
+ metadata.gz: acbdde24b745eb2500d3d97ebc420bf339e2d91b27112b218e89937ebd14f867
4
+ data.tar.gz: 6803d51bab8de86ad7ee04f020322b449c15194ac8706b0e242ad70451278b24
5
5
  SHA512:
6
- metadata.gz: 77b2c6977626b081e38ba035b6129c710b89837bc102bc21e85aae4a894fb73eabd0e1dcd3a1a131e68603f4bdbfb634370790dc60b529770db26253666bac8a
7
- data.tar.gz: bd4ca4ede0b5754385e8981e371dc0e10f0b3af2da5a4722566a50eeec75a8d80fa90bd474dc206c2dbaaa3b738db5ca749bc4568082a93ed73ae142fac798ca
6
+ metadata.gz: c17020b1920c7121a12b8118e325ae0828a4c39b9b3d72eb16db3a2c4b274b5a91523a5b4ace73c1395f89980403598381c7dc52068e4daecda933698efc9b6a
7
+ data.tar.gz: 4dad3811a454bbe4ef660fbbd2e73e87e97b8dd058a36d3234a17dc27fb484f154a0486f4495b0de9c09055355e6044808335f38ebe6190131ada75b7626b7d5
@@ -1,10 +1,3 @@
1
- resources {
2
- border-left: 1pt solid var(--wfadaptor-border);
3
- }
4
- #resources line.resource-line:hover {
5
- stroke: red;
6
- }
7
-
8
1
  .resource-label {
9
2
  position: absolute;
10
3
  padding-left: 0.5em;
@@ -0,0 +1,20 @@
1
+ svg rect.border {
2
+ fill: var(--wfadaptor-border);
3
+ }
4
+ svg .resource-point.read {
5
+ fill: green;
6
+ }
7
+ svg .resource-point.write {
8
+ fill: orange;
9
+ }
10
+ svg .resource-point.both {
11
+ fill: blue;
12
+ }
13
+ svg line.resource-line {
14
+ stroke: red;
15
+ stroke-opacity: 0.1;
16
+ }
17
+ svg line.resource-line:hover {
18
+ stroke: red;
19
+ stroke-opacity: 0.2;
20
+ }
data/cockpit/css/ui.css CHANGED
@@ -41,10 +41,6 @@ body {
41
41
  #graphgrid.striped .graphlabel, #graphgrid.striped .graphempty {
42
42
  border-left: 1pt solid var(--wfadaptor-border);
43
43
  }
44
- #graphgrid.striped #resources rect.border {
45
- width: 0.8pt;
46
- fill: var(--wfadaptor-border);
47
- }
48
44
  #graphgrid.striped .graphlabel.even, #graphgrid.striped .graphempty.even, #graphgrid.striped .graphlast.even {
49
45
  background-color: #e9e9e9;
50
46
  }
data/cockpit/edit.html CHANGED
@@ -57,7 +57,8 @@
57
57
  <script type="text/javascript" src="js/modifiers.js"></script>
58
58
  <script type="text/javascript" src="js/resources.js"></script>
59
59
  <link rel="stylesheet" href="css/ui.css" type="text/css"/>
60
- <link rel="stylesheet" href="css/resources.css" type="text/css"/>
60
+ <link rel="stylesheet" href="css/resources-label.css" type="text/css"/>
61
+ <link rel="stylesheet" href="css/resources-svg.css" type="text/css" data-include-export="true"/>
61
62
  <link rel="stylesheet" href="/global_ui/uicpee.css" type="text/css"/>
62
63
  <style>
63
64
  /* has to be fucking inline, because firefox and chrome disagree how to handle filter urls */
data/cockpit/graph.html CHANGED
@@ -55,7 +55,10 @@
55
55
  <script type="text/javascript" src="js/details.js"></script>
56
56
  <script type="text/javascript" src="js/parameters.js"></script>
57
57
  <script type="text/javascript" src="js/modifiers.js"></script>
58
+ <script type="text/javascript" src="js/resources.js"></script>
58
59
  <link rel="stylesheet" href="css/ui.css" type="text/css"/>
60
+ <link rel="stylesheet" href="css/resources-label.css" type="text/css"/>
61
+ <link rel="stylesheet" href="css/resources-svg.css" type="text/css" data-include-export="true"/>
59
62
  <link rel="stylesheet" href="css/graph.css" type="text/css"/>
60
63
  </head>
61
64
  <body data-base-port="8298" data-res-port="9303" data-theme-base="themes" is="x-ui-">
@@ -63,6 +66,7 @@
63
66
  <div id="trackfull">
64
67
  <div id='graphcolumn'>
65
68
  <div id='graphgrid'>
69
+ <div class="resource-label" style="display: none"></div>
66
70
  <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>
67
71
  </div>
68
72
  </div>
data/cockpit/index.html CHANGED
@@ -46,7 +46,7 @@
46
46
 
47
47
  <!-- modelling ui -->
48
48
  <script type="text/javascript" src="js/wfadaptor.js"></script>
49
- <link rel="stylesheet" href="css/wfadaptor.css" type="text/css"/>
49
+ <link rel="stylesheet" href="css/wfadaptor.css" type="text/css" data-include-export="true"/>
50
50
 
51
51
  <!-- custom stuff, play arround -->
52
52
  <script type="text/javascript" src="js/ui.js"></script>
@@ -56,7 +56,8 @@
56
56
  <script type="text/javascript" src="js/modifiers.js"></script>
57
57
  <script type="text/javascript" src="js/resources.js"></script>
58
58
  <link rel="stylesheet" href="css/ui.css" type="text/css"/>
59
- <link rel="stylesheet" href="css/resources.css" type="text/css"/>
59
+ <link rel="stylesheet" href="css/resources-label.css" type="text/css"/>
60
+ <link rel="stylesheet" href="css/resources-svg.css" type="text/css" data-include-export="true"/>
60
61
  <link rel="stylesheet" href="/global_ui/uicpee.css" type="text/css"/>
61
62
  <style>
62
63
  /* has to be fucking inline, because firefox and chrome disagree how to handle filter urls */
@@ -505,10 +505,12 @@ function monitor_instance_values(type,vals) {// {{{
505
505
  } else {
506
506
  save['modeltype'] = undefined;
507
507
  }
508
- if ($('#modifiers > div').length == 0) {
509
- modifiers_display().then(function(){ modifiers_select(); });
510
- } else {
511
- modifiers_select();
508
+ if ($('#modifiers').length > 0) {
509
+ if ($('#modifiers > div').length == 0) {
510
+ modifiers_display().then(function(){ modifiers_select(); });
511
+ } else {
512
+ modifiers_select();
513
+ }
512
514
  }
513
515
  var text = $(" > attributes > info",res).text() + " (" + url.replace(/\/$/,'').split(/[\\/]/).pop() + ")";
514
516
  $('#title').text(text);
@@ -566,39 +568,35 @@ function adaptor_init(url,theme,dslx) { //{{{
566
568
  }
567
569
 
568
570
  $('#graphgrid .graphlabel, #graphgrid .graphempty, #resources, #graphgrid .graphlast').remove();
569
- var tlabels = {};
570
- var tcolumns = [];
571
- var tcolumncount = {}
572
- var thidden = [];
571
+ let tcolumns = [];
572
+ let tcolumntype = {};
573
+ let tcolumncount = {}
573
574
 
574
- var tsvgs = {};
575
575
  const mapPoints = new Map();
576
- let iconsize = 14;
577
- let iconshift = 7;
576
+ const tcolumnsvgs = {};
577
+ const iconsize = 10;
578
+ const space = 5;
578
579
 
579
580
  _.each(labels,function(val){
580
581
  if (val.label != "") {
581
- tlabels[val.row] = [];
582
582
  _.each(val.label,function(col) {
583
583
  if (!tcolumns.includes(col.column)) {
584
584
  tcolumns.push(col.column);
585
585
  tcolumncount[col.column] = 0;
586
+ tcolumnsvgs[col.column] = {};
586
587
  }
587
- if (!thidden.includes(col.column) && col.type == 'resource') {
588
- thidden.push(col.column);
588
+ if (tcolumntype[col.column] == undefined && col.type != undefined) {
589
+ tcolumntype[col.column] = col.type;
589
590
  }
590
591
  if (col.value != undefined) {
592
+ let pos = dimensions.height_shift/2 + dimensions.height * (val.row - 1) + (dimensions.height / 2);
593
+ let firstpos = dimensions.height_shift/2 + (dimensions.height / 2);
591
594
 
592
- // Start Peilei
593
595
  if (col.type == "resource") {
594
- let str = '';
595
596
  for (const [k, v] of Object.entries(col.value)) {
596
- var p = {};
597
- p.row = val.row;
598
- p.AR = v;
599
- p.yc = dimensions.height_shift/2 + dimensions.height * val.row - 20;
597
+ var p = { AR: v };
600
598
  if (!mapPoints.has(k)) {
601
- p.y0 = p.y0 == undefined ? (dimensions.height_shift/2 + dimensions.height * val.row - 20) : p.y0;
599
+ p.y0 = p.y0 == undefined ? pos : p.y0;
602
600
  p.ymax = (p.ymax == undefined) ? p.y0 : p.ymax;
603
601
  } else {
604
602
  p.y0 = mapPoints.get(k).y0;
@@ -606,70 +604,52 @@ function adaptor_init(url,theme,dslx) { //{{{
606
604
  }
607
605
  mapPoints.set(k, p);
608
606
  }
609
- var cx = iconshift*2;
610
- str += '<g xmlns="http://www.w3.org/2000/svg">';
611
607
 
608
+ let tsvg = $X('<g xmlns="http://www.w3.org/2000/svg"></g>');
609
+
610
+ var cx = space;
612
611
  for (const [k, p] of mapPoints) {
613
- let firstAssignFlag = 0;
614
- p.x0 = p.xc = cx;
612
+ let firstAssignFlag = false;
613
+ p.x = cx;
615
614
 
616
615
  // Including Triangle
617
616
  if (k in col.value) { // Define points for a triangle pointing to the right
617
+ let inner;
618
+
618
619
  if (p.AR == "Read") {
619
- str += '<polygon xmlns="http://www.w3.org/2000/svg" points="' + (cx - 5) + ',' + (dimensions.height_shift/2 + dimensions.height * val.row - 20) + ' ' + (cx + 5) + ',' + (dimensions.height_shift/2 + dimensions.height * val.row - 15) + ' ' + (cx + 5) + ',' + (dimensions.height_shift/2 + dimensions.height * val.row - 25) + '" fill="green" class="resource-point">';
620
- if (p.yc == p.y0) {
621
- firstAssignFlag = 1;
622
- }
620
+ inner = $X('<polygon xmlns="http://www.w3.org/2000/svg" points="' + (p.x) + ',' + pos + ' ' + (p.x + iconsize) + ',' + (pos + iconsize/2) + ' ' + (p.x + iconsize) + ',' + (pos - iconsize/2) + '" class="resource-point read"></polygon>');
621
+ if (pos == p.y0) { firstAssignFlag = true; }
623
622
  } else if (p.AR == "Assign") { // Define points for a triangle pointing to the left
624
- str += '<polygon xmlns="http://www.w3.org/2000/svg" points="' + (cx + 5) + ',' + (dimensions.height_shift/2 + dimensions.height * val.row - 20) + ' ' + (cx - 5) + ',' + (dimensions.height_shift/2 + dimensions.height * val.row - 15) + ' ' + (cx - 5) + ',' + (dimensions.height_shift/2 + dimensions.height * val.row - 25) + '" fill="orange" class="resource-point">';
623
+ inner = $X('<polygon xmlns="http://www.w3.org/2000/svg" points="' + (p.x + iconsize) + ',' + pos + ' ' + (p.x) + ',' + (pos + iconsize/2) + ' ' + (p.x) + ',' + (pos - iconsize/2) + '" class="resource-point write"></polygon>');
625
624
  } else if (p.AR == "AssignRead") {
626
- p.yc = dimensions.height_shift/2 + dimensions.height * val.row - 20;
627
- str += '<circle xmlns="http://www.w3.org/2000/svg" cx="' + cx + '" cy="' + p.yc + '" r="5" fill="blue" class="resource-point">';
625
+ inner = $X('<circle xmlns="http://www.w3.org/2000/svg" cx="' + (p.x + iconsize/2) + '" cy="' + pos + '" r="' + (iconsize / 2) + '" class="resource-point both"></circle>');
628
626
  }
629
627
 
630
- if (dimensions.height_shift/2 + dimensions.height * val.row != p.y0) {
631
- p.yc = dimensions.height_shift/2 + dimensions.height * val.row - 20;
632
- if (dimensions.height_shift/2 + dimensions.height * val.row - 20 > p.ymax) {
633
- p.ymax = dimensions.height_shift/2 + dimensions.height * val.row - 20;
634
- }
628
+ // extend the bars
629
+ if (pos > p.ymax) {
630
+ p.ymax = pos;
635
631
  }
636
632
 
637
- // Converted from <title>
638
- str += '<text xmlns="http://www.w3.org/2000/svg">' + k + '</text>';
639
-
640
- if (p.AR == "Read" || p.AR == "Assign") {
641
- str += '</polygon>';
642
- } else if (p.AR == "AssignRead") {
643
- str += '</circle>';
644
- }
633
+ inner.append($X('<text xmlns="http://www.w3.org/2000/svg">' + k + '</text>'));
634
+ tsvg.append(inner);
645
635
  }
646
636
 
647
- if (firstAssignFlag == 1) {
637
+ if (firstAssignFlag) {
648
638
  // Additional logic and construction of another polygon for orange triangle pointing left
649
- p.y0 -= ((p.row-1) * dimensions.height);
650
- str += '<polygon xmlns="http://www.w3.org/2000/svg" points="' + (cx + 5) + ',' + (dimensions.height_shift/2 + dimensions.height - 20) + ' ' + (cx - 5) + ',' + (dimensions.height_shift/2 + dimensions.height - 15) + ' ' + (cx - 5) + ',' + (dimensions.height_shift/2 + dimensions.height - 25) + '" fill="orange" class="resource-point">' + '<text xmlns="http://www.w3.org/2000/svg">' + k + '</text></polygon>';
651
- }
652
- cx += iconsize;
653
- }
654
-
655
- for (const [k, p] of mapPoints) {
656
- if(k in col.value) {
657
- if (dimensions.height_shift/2+dimensions.height*val.row != p.y0) {
658
- p.yc = dimensions.height_shift/2 + dimensions.height * val.row - 20;
659
- if(dimensions.height_shift/2 + dimensions.height * val.row - 20 > p.ymax) {
660
- p.ymax = dimensions.height_shift/2 + dimensions.height * val.row - 20;
661
- }
662
- }
639
+ p.y0 -= (val.row-1) * dimensions.height;
640
+ tsvg.append($X('<polygon xmlns="http://www.w3.org/2000/svg" points="' + (p.x + iconsize) + ',' + firstpos + ' ' + (p.x) + ',' + (firstpos + iconsize/2) + ' ' + (p.x) + ',' + (firstpos - iconsize/2) + '" class="resource-point write">' + '<text xmlns="http://www.w3.org/2000/svg">' + k + '</text></polygon>'));
663
641
  }
642
+ cx += iconsize + space;
664
643
  }
665
- str += '</g>';
666
644
 
667
- tsvgs[val.row] = $X(str);
645
+ tcolumnsvgs[col.column][val.row] = tsvg;
646
+ } else {
647
+ tsvg = $X('<text x="' + space + '" y="' + (dimensions.height * val.row - dimensions.height_shift) + '" xmlns="http://www.w3.org/2000/svg">' + col.value + '</text>');
648
+ tcolumnsvgs[col.column][val.row] = tsvg;
668
649
  }
669
650
 
670
651
  tcolumncount[col.column] += 1;
671
652
  }
672
- tlabels[val.row][tcolumns.indexOf(col.column)] = { label: col.value, type: val.tname, id: val.element_id };
673
653
  });
674
654
  }
675
655
  });
@@ -679,48 +659,47 @@ function adaptor_init(url,theme,dslx) { //{{{
679
659
  'grid-template-columns': 'max-content' + (tcolumns.length > 0 ? ' repeat(' + tcolumns.length.toString() + ',max-content)' : '') + ' auto'
680
660
  });
681
661
 
682
- for (var i = 0; i < max.row; i++) {
683
- for (var j = 0; j < tcolumns.length - 1; j++) {
684
- if (thidden != tcolumns[j]) {
685
- if (tlabels[i+1] != undefined && tlabels[i+1][j] != undefined && tlabels[i+1][j].label != undefined && tlabels[i+1][j].label != '') {
686
- var col = tlabels[i+1][j];
687
- var ele = $('<div element-row="' + i + '" 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>');
688
- graphrealization.illustrator.draw.bind_event(ele, col.type, false);
689
- $('#graphgrid').append(ele);
690
- } else {
691
- if (tcolumncount[tcolumns[j]] != 0) {
692
- var ele = $('<div element-row="' + i + '" class="graphempty ' + (i % 2 == 0 ? 'odd' : 'even') + '" style="grid-column: ' + (j+2) + '; grid-row: ' + (i+2) + '; padding-bottom: ' + dimensions.height_shift + 'px">&#032;</div>');
693
- $('#graphgrid').append(ele);
694
- }
662
+ tcolumns.forEach(h => {
663
+ if (Object.keys(tcolumnsvgs[h]).length > 0) {
664
+ const svgcolumn = $X('<svg xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:x="http://www.w3.org/1999/xlink" id="resources"></svg>');
665
+ const svgback = $X('<g xmlns="http://www.w3.org/2000/svg"></g>');
666
+ const svgfront = $X('<g xmlns="http://www.w3.org/2000/svg"></g>');
667
+ let xwidth = 0;
668
+ svgcolumn.append(svgback);
669
+ svgcolumn.append(svgfront);
670
+ svgcolumn.css('grid-row', '1/span ' + (max.row + 2))
671
+ svgcolumn.css('grid-column', tcolumns.indexOf(tcolumns.first) + 2);
672
+ svgcolumn.attr('height', $('#graphcanvas').attr('height'));
673
+ $('#graphgrid').append(svgcolumn);
674
+
675
+ for (var i = 0; i < max.row; i++) {
676
+ let node = svgfront.append($(tcolumnsvgs[h][i+1]));
677
+ if (xwidth < node[0].getBBox().width) { xwidth = node[0].getBBox().width; }
678
+ }
679
+ xwidth = xwidth + 2 * space;
680
+ if (striped == true) {
681
+ for (var i = 0; i < max.row; i++) {
682
+ svgback.append($X('<rect xmlns="http://www.w3.org/2000/svg" element-row="' + i + '" class="stripe ' + (i % 2 == 0 ? 'even' : 'odd') + '" x="0" y="' + (dimensions.height * i + dimensions.height_shift/2) + '" width="' + (xwidth + 1) + '" height="' + dimensions.height + '"></rect>'));
683
+ svgback.append($X('<rect xmlns="http://www.w3.org/2000/svg" element-row="' + i + '" class="border" x="0" y="' + (dimensions.height * i + dimensions.height_shift/2) + '" height="' + dimensions.height + '" width="1"></rect>'));
684
+ }
685
+ }
686
+ if (tcolumntype[h] == "resource") {
687
+ for (const [k, p] of mapPoints) {
688
+ svgback.append($X('<line xmlns="http://www.w3.org/2000/svg" x1="' + (p.x + iconsize/2) + '" y1="' + p.y0 + '" x2="' + (p.x + iconsize/2) + '" y2="' + p.ymax + '" class="resource-line" stroke-width="' + iconsize + '"><text>' + k + '</text></line>'));
695
689
  }
696
690
  }
697
- }
698
-
699
- var j = tcolumns.length;
700
- var ele = $('<div element-row="' + i + '" class="graphlast ' + (i % 2 == 0 ? 'odd' : 'even') + '" style="grid-column: ' + (j+2) + '; grid-row: ' + (i+2) + '; padding-bottom: ' + dimensions.height_shift + 'px">&#032;</div>');
701
- $('#graphgrid').append(ele);
702
- }
703
691
 
704
- if (Object.keys(tsvgs).length > 0) {
705
- let dataflow = $X('<svg xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:x="http://www.w3.org/1999/xlink" id="resources"></svg>');
706
- dataflow.css('grid-row', '1/span ' + (max.row + 2));
707
- dataflow.css('grid-column', tcolumns.indexOf(thidden.first) + 2);
708
- dataflow.attr('height', $('#graphcanvas').attr('height'));
709
- dataflow.attr('width', mapPoints.size * iconsize + iconshift * 2);
692
+ $('.resource-label').hide(); // Speech Bubble hide by default
710
693
 
711
- for (var i = 0; i < max.row; i++) { // Needs parenthesises below
712
- dataflow.append($X('<rect xmlns="http://www.w3.org/2000/svg" class="stripe ' + (i % 2 == 0 ? 'even' : 'odd') + '" x="0" y="' + (dimensions.height * i + 5.2) + '" width="' + (mapPoints.size * iconsize + iconshift * 2) + '" height="' + dimensions.height + '"></rect>'));
713
- dataflow.append($X('<rect xmlns="http://www.w3.org/2000/svg" class="border" x="0" y="' + (dimensions.height * i + 5.2) + '" height="' + dimensions.height + '"></rect>'));
714
- }
715
- for (const [k, p] of mapPoints) {
716
- dataflow.append($X('<line xmlns="http://www.w3.org/2000/svg" x1="' + p.x0 + '" y1="' + p.y0 + '" x2="' + p.xc + '" y2="' + p.ymax + '" class="resource-line" stroke-opacity="0.1" stroke="orange" stroke-width="10" marker-end="url(#arrowhead)"><text>' + k + '</text></line>'));
717
- }
718
- for (var i = 0; i < max.row; i++) {
719
- dataflow.append($(tsvgs[i+1]));
694
+ svgcolumn.attr('width', xwidth);
720
695
  }
721
- $('#graphgrid').append(dataflow);
696
+ });
722
697
 
723
- $('.resource-label').hide(); // Speech Bubble hide by default
698
+ // Add the last stripe
699
+ var j = tcolumns.length;
700
+ for (var i = 0; i < max.row; i++) {
701
+ var ele = $('<div element-row="' + i + '" class="graphlast ' + (i % 2 == 0 ? 'odd' : 'even') + '" style="grid-column: ' + (j+2) + '; grid-row: ' + (i+2) + '; padding-bottom: ' + dimensions.height_shift + 'px">&#032;</div>');
702
+ $('#graphgrid').append(ele);
724
703
  }
725
704
  };
726
705
  graphrealization.set_svg_container($('#graphcanvas'));
@@ -1122,48 +1101,50 @@ function save_svgfile() {// {{{
1122
1101
  var url = $('body').attr('current-instance');
1123
1102
 
1124
1103
  var gc = $('#graphcanvas').clone();
1125
- $.ajax({
1126
- type: "GET",
1127
- url: "css/wfadaptor.css",
1128
- success: function(res){
1129
- gc.prepend($X('<style xmlns="http://www.w3.org/2000/svg" type="text/css"><![CDATA[' + res + ']]></style>'));
1130
- $(window.document.styleSheets).each(function(i,x){
1131
- if (x && x.href && x.href.match(/wfadaptor\.css$/)) {
1132
- var varreps = {};
1133
- $(x.cssRules).each(function(j,y){
1134
- if (y.selectorText == ":root") {
1135
- $(y.style).each(function(k,z) {
1136
- varreps['var\\(' + z + '\\)'] = getComputedStyle(document.documentElement).getPropertyValue(z).toString();
1137
- });
1138
- }
1139
- var loc = $(gc).find(y.selectorText.replace(/svg /g,''));
1140
- var cst = y.style.cssText;
1141
- for (k in varreps) {
1142
- cst = cst.replace(new RegExp(k,'g'),varreps[k]);
1143
- }
1144
- loc.each(function(k,loco) {
1145
- var sty = $(loco).attr('style') == undefined ? '' : $(loco).attr('style');
1146
- $(loco).attr('style',cst + sty);
1147
- });
1104
+ var start = parseInt(gc.attr('width'));
1105
+ $('#graphgrid > svg:not(#graphcanvas)').each( (i,ele) => {
1106
+ const gr = $X('<g transform="translate(' + start + ')" xmlns="http://www.w3.org/2000/svg"></g>');
1107
+ start = start + parseInt(ele.getAttribute('width'));
1108
+ $('g',ele).each((j,g) => {
1109
+ gr.append($(g).clone());
1110
+ });
1111
+ gc.append(gr);
1112
+ });
1113
+ var varreps = {};
1114
+ $(window.document.styleSheets).each(function(i,x){
1115
+ if (x && x.href && x.ownerNode.attributes.getNamedItem('data-include-export')) {
1116
+ $(x.cssRules).each(function(j,y){
1117
+ if (y.selectorText == ":root") {
1118
+ $(y.style).each(function(k,z) {
1119
+ varreps['var\\(' + z + '\\)'] = getComputedStyle(document.documentElement).getPropertyValue(z).toString();
1148
1120
  });
1149
- var loc = $(gc).find('text.super');
1150
- loc.attr('style',loc.attr('style') + ' display: none');
1151
- var loc = $(gc).find('.stripe');
1152
- loc.attr('style',loc.attr('style') + ' display: none');
1153
1121
  }
1122
+ var loc = $(gc).find(y.selectorText.replace(/svg /g,''));
1123
+ var cst = y.style.cssText;
1124
+ for (k in varreps) {
1125
+ cst = cst.replace(new RegExp(k,'g'),varreps[k]);
1126
+ }
1127
+ loc.each(function(k,loco) {
1128
+ var sty = $(loco).attr('style') == undefined ? '' : $(loco).attr('style');
1129
+ $(loco).attr('style',cst + sty);
1130
+ console.log(loco);
1131
+ });
1154
1132
  });
1155
- $.ajax({
1156
- type: "GET",
1157
- url: url + "/properties/attributes/info/",
1158
- success: function(res){
1159
- $('#savesvgfile').attr('download',res + '.svg');
1160
- $('#savesvgfile').attr('href','data:application/xml;charset=utf-8;base64,' + $B64(gc.serializeXML()));
1161
- document.getElementById('savesvgfile').click();
1162
- },
1163
- error: report_failure
1164
- });
1133
+ var loc = $(gc).find('text.super');
1134
+ loc.attr('style',loc.attr('style') + ' display: none; ');
1165
1135
  }
1166
1136
  });
1137
+ gc.attr('width',start+1);
1138
+ $.ajax({
1139
+ type: "GET",
1140
+ url: url + "/properties/attributes/info/",
1141
+ success: function(res){
1142
+ $('#savesvgfile').attr('download',res + '.svg');
1143
+ $('#savesvgfile').attr('href','data:application/xml;charset=utf-8;base64,' + $B64(gc.serializePrettyXML()));
1144
+ document.getElementById('savesvgfile').click();
1145
+ },
1146
+ error: report_failure
1147
+ });
1167
1148
  }// }}}
1168
1149
  async function set_testset(testset,exec) {// {{{
1169
1150
  var url = $('body').attr('current-instance');
@@ -228,24 +228,6 @@ function WfIllustrator(wf_adaptor) { // View {{{
228
228
  return g;
229
229
  } // }}}
230
230
 
231
- var draw_label = this.draw.draw_label = function (tname, id, label, row, col, group) { // {{{
232
- var g = $X('<text class="label" transform="translate(' + String(col*self.width-self.width_shift) + ',' + String(row*self.height+20-(self.height-self.height_shift)) + ')" xmlns="http://www.w3.org/2000/svg"></text>');
233
- var spli = $(label.split(/\n/));
234
- spli.each(function(k,v) {
235
- var tspan = $X('<tspan x="0" dy="' + (spli.length > 1 ? '-7' : '0') + '" xmlns="http://www.w3.org/2000/svg"></tspan>');
236
- if (k == 0) {
237
- tspan.text(v);
238
- } else {
239
- tspan.text(v);
240
- tspan.attr('dy','15');
241
- tspan.attr('dx','15');
242
- }
243
- g.append(tspan);
244
- });
245
- if(group) { group.find('g.element[element-id=' + id + ']').append(g); }
246
- else {self.svg.container.append(g);}
247
- return g;
248
- } // }}}
249
231
  var draw_symbol = this.draw.draw_symbol = function (sname, id, title, row, col, group, addition) { // {{{
250
232
  if(self.elements[sname] == undefined || self.elements[sname].svg == undefined) sname = 'unknown';
251
233
  if (addition) {
@@ -380,15 +362,6 @@ function WfDescription(wf_adaptor, wf_illustrator) { // Model {{{
380
362
  } else {
381
363
  adaptor.draw_labels(graph.max,[],{ 'height': illustrator.height, 'height_shift': illustrator.height_shift },false);
382
364
  }
383
- if (illustrator.compact == false) {
384
- if (labels.length > 0) {
385
- _.each(labels,function(a,key) {
386
- if (a.label && a.label[0] && a.label[0].column == 'Label' && a.label[0].value) {
387
- illustrator.draw.draw_label(a.tname, a.element_id, a.label[0].value, a.row, graph.max.col + 1, graph.svg);
388
- }
389
- });
390
- }
391
- }
392
365
  } //}}}
393
366
 
394
367
  // Generic Functions {{{
data/cockpit/model.html CHANGED
@@ -58,6 +58,8 @@
58
58
  <script type="text/javascript" src="js/edit.js"></script>
59
59
  <link rel="stylesheet" href="css/ui.css" type="text/css"/>
60
60
  <link rel="stylesheet" href="css/model.css" type="text/css"/>
61
+ <link rel="stylesheet" href="css/resources-label.css" type="text/css"/>
62
+ <link rel="stylesheet" href="css/resources-svg.css" type="text/css" data-include-export="true"/>
61
63
  <link rel="stylesheet" href="/global_ui/uicpee.css" type="text/css"/>
62
64
  <style>
63
65
  /* has to be fucking inline, because firefox and chrome disagree how to handle filter urls */
@@ -63,11 +63,7 @@ function WFAdaptorManifestation(adaptor) {
63
63
  //{{{ Render the details from rng (right hand side of graph tab)
64
64
  this.update_details = function(svgid){
65
65
  var tab = $('#dat_details');
66
- var focus_ele = $(':focus',tab);
67
- var focus_path = focus_ele.attr('data-relaxngui-path');
68
- var focus_pos = focus_ele.prop('selectionStart');
69
66
  var node = self.adaptor.description.get_node_by_svg_id(svgid).get(0);
70
- tab.empty();
71
67
  if (self.adaptor.description.elements[$(node).attr('svg-subtype')]) {
72
68
  save['details_target'] = { 'svgid': svgid, 'model': self.adaptor.description };
73
69
  var rng = self.adaptor.description.elements[$(node).attr('svg-subtype')].clone();
@@ -78,20 +74,16 @@ function WFAdaptorManifestation(adaptor) {
78
74
  if (save['endpoints_list'][$(node).attr('endpoint')] && (!save['endpoints_list'][$(node).attr('endpoint')].startsWith('http') || save['endpoints_list'][$(node).attr('endpoint')].match(/^https?-/))) {
79
75
  $(rng).find(' > element[name="parameters"] > element[name="method"]').remove();
80
76
  }
81
- save['details'] = new RelaxNGui(rng,tab,self.adaptor.description.context_eval,true);
82
77
  var nn = $X($(node).serializeXML());
83
78
  nn.removeAttr('svg-id');
84
79
  nn.removeAttr('svg-type');
85
80
  nn.removeAttr('svg-subtype');
86
81
  nn.removeAttr('svg-label');
82
+
83
+ tab.empty();
84
+ save['details'] = new RelaxNGui(rng,tab,self.adaptor.description.context_eval,true);
87
85
  save['details'].content(nn);
88
- if (focus_ele.length > 0) {
89
- var ele = $('[data-relaxngui-path="' + focus_path + '"]',tab)[0];
90
- ele.focus();
91
- if (ele.setSelectionRange) {
92
- ele.setSelectionRange(focus_pos,focus_pos);
93
- }
94
- }
86
+
95
87
  format_visual_forms();
96
88
  }
97
89
  }; //}}}
@@ -211,8 +203,17 @@ function WFAdaptorManifestation(adaptor) {
211
203
  $(nodes).each(function(key,str) {
212
204
  nodes[key] = $X(str);
213
205
  });
206
+ let svgids = [];
214
207
  $(nodes).each(function(key,node){
215
- var target = self.adaptor.description.get_node_by_svg_id($(node).attr('svg-id'));
208
+ svgids.push($(node).attr('svg-id'));
209
+ });
210
+ svgids.sort((a,b) => {
211
+ if (a > b) { return -1; }
212
+ else if (a < b) { return 1; }
213
+ else { return 0; }
214
+ });
215
+ svgids.forEach(svgid => {
216
+ var target = self.adaptor.description.get_node_by_svg_id(svgid);
216
217
  del_ui_pos(target)
217
218
  self.adaptor.description.remove(null,target);
218
219
  localStorage.removeItem('marked');
@@ -1233,28 +1234,33 @@ function WFAdaptorManifestation(adaptor) {
1233
1234
  return 'vertical';
1234
1235
  },
1235
1236
  'resolve_symbol': function(node) {
1237
+ let alist = []
1236
1238
  let plist = []
1237
- let dirty = false
1238
- $('*:not(:has(*))',node).each(function(i,n) {
1239
- let lines = n.textContent.split(/(\r\n)|\n|;/)
1240
- for (const l of lines) {
1241
- if (l != null) {
1242
- let m0 = l.match(/^[^=]*data\.([a-z0-9A-Z_]+)[^=]*=/)
1243
- if (m0 != null) {
1244
- plist.push(m0[1])
1245
- }
1246
- let m1 = l.match(/=[^=].*data\.([a-z0-9A-Z_]+)/)
1247
- let m2 = l.match(/^[^=]*data\.([a-z0-9A-Z_]+)[^=]*$/)
1248
- if (m1 != null && !plist.includes(m1[1])) {
1249
- dirty = true
1250
- }
1251
- if (m2 != null && !plist.includes(m2[1])) {
1252
- dirty = true
1253
- }
1254
- }
1239
+
1240
+ var regassi = /data\.([a-zA-Z_]+)\s*(=[^=]|\+\=|\-\=|\*\=|\/\=|<<|>>)/g; // we do not have to check for &gt;/&lt; version of stuff as only conditions are in attributes, and conditions can not contain assignments
1241
+ var reg_not_assi = /data\.([a-zA-Z_]+)\s*/g;
1242
+ $ ('call > parameters > arguments > *, call > code > *, loop[condition], alternative[condition]',node).each(function(i,n) {
1243
+ let item;
1244
+ if (n.hasAttribute('condition')) {
1245
+ item = n.getAttribute('condition');
1246
+ } else {
1247
+ item = n.textContent;
1248
+ }
1249
+ if (n.parentNode.nodeName == 'arguments' && item.charAt(0) != '!' ) { return }
1250
+
1251
+ let indices = [];
1252
+
1253
+ for (const match of item.matchAll(regassi)) {
1254
+ indices.push(match.index);
1255
+ alist.push(match[1]);
1256
+ }
1257
+ for (const match of item.matchAll(reg_not_assi)) {
1258
+ const arg1 = match[1];
1259
+ if (indices.includes(match.index)) { continue; }
1260
+ if (!alist.includes(arg1)) { plist.push(arg1); }
1255
1261
  }
1256
1262
  })
1257
- if (dirty) { return 'start_event'; }
1263
+ if (plist.length > 0) { return 'start_event'; }
1258
1264
  },
1259
1265
  'closing_symbol': 'end',
1260
1266
  'col_shift': function(node) {