cpee 2.1.23 → 2.1.27

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.
@@ -8,6 +8,7 @@ function WFAdaptorManifestation(adaptor) {
8
8
  this.compact = false;
9
9
  this.striped = false;
10
10
  this.endpoints = {};
11
+ this.presstimer;
11
12
 
12
13
  //{{{ transform the details data to description parts based on rng
13
14
  this.source = function(base,opts) {
@@ -137,69 +138,80 @@ function WFAdaptorManifestation(adaptor) {
137
138
  }
138
139
  } //}}}
139
140
 
140
- // Events
141
- this.events.mousedown = function(svgid, e, child, sibling) { // {{{
142
- if(e.button == 0) { // left-click
143
- } else if(e.button == 1) { // middle-click
144
- } else if(e.button == 2) { // right-click
145
- if (save['state'] != "ready" && save['state'] != "stopped") { return false; }
141
+ function contextMenuHandling(svgid,e,child,sibling) { //{{{
142
+ if (save['state'] != "ready" && save['state'] != "stopped") { return false; }
146
143
 
147
- var xml_node = self.adaptor.description.get_node_by_svg_id(svgid);
148
- var group = null;
149
- var menu = {};
144
+ var xml_node = self.adaptor.description.get_node_by_svg_id(svgid);
145
+ var group = null;
146
+ var menu = {};
150
147
 
151
- if (child) {
152
- group = self.elements[xml_node.get(0).tagName].permissible_children(xml_node,'into');
148
+ if (child) {
149
+ group = self.elements[xml_node.get(0).tagName].permissible_children(xml_node,'into');
150
+ if(group.length > 0) {
151
+ menu['Insert into'] = group;
152
+ copyOrMove(menu['Insert into'],group,xml_node,self.adaptor.description.insert_first_into);
153
+ }
154
+ if (self.elements[xml_node.get(0).tagName].permissible_children_expert) {
155
+ group = self.elements[xml_node.get(0).tagName].permissible_children_expert(xml_node,'into');
153
156
  if(group.length > 0) {
154
- menu['Insert into'] = group;
155
- copyOrMove(menu['Insert into'],group,xml_node,self.adaptor.description.insert_first_into);
156
- }
157
- if (self.elements[xml_node.get(0).tagName].permissible_children_expert) {
158
- group = self.elements[xml_node.get(0).tagName].permissible_children_expert(xml_node,'into');
159
- if(group.length > 0) {
160
- menu['Insert into (Experts Only!)'] = group;
161
- copyOrMove(menu['Insert into (Experts Only!)'],group,xml_node,self.adaptor.description.insert_first_into);
162
- }
157
+ menu['Insert into (Experts Only!)'] = group;
158
+ copyOrMove(menu['Insert into (Experts Only!)'],group,xml_node,self.adaptor.description.insert_first_into);
163
159
  }
164
160
  }
165
- if (sibling) {
166
- group = self.elements[xml_node.parent().get(0).tagName].permissible_children(xml_node,'after');
161
+ }
162
+ if (sibling) {
163
+ group = self.elements[xml_node.parent().get(0).tagName].permissible_children(xml_node,'after');
164
+ if(group.length > 0) {
165
+ menu['Insert after'] = group;
166
+ copyOrMove(menu['Insert after'],group,xml_node,self.adaptor.description.insert_after);
167
+ }
168
+ if (self.elements[xml_node.parent().get(0).tagName].permissible_children_expert) {
169
+ group = self.elements[xml_node.parent().get(0).tagName].permissible_children_expert(xml_node,'after');
167
170
  if(group.length > 0) {
168
- menu['Insert after'] = group;
169
- copyOrMove(menu['Insert after'],group,xml_node,self.adaptor.description.insert_after);
170
- }
171
- if (self.elements[xml_node.parent().get(0).tagName].permissible_children_expert) {
172
- group = self.elements[xml_node.parent().get(0).tagName].permissible_children_expert(xml_node,'after');
173
- if(group.length > 0) {
174
- menu['Insert after (Experts Only!)'] = group;
175
- copyOrMove(menu['Insert after (Experts Only!)'],group,xml_node,self.adaptor.description.insert_after);
176
- }
171
+ menu['Insert after (Experts Only!)'] = group;
172
+ copyOrMove(menu['Insert after (Experts Only!)'],group,xml_node,self.adaptor.description.insert_after);
177
173
  }
178
174
  }
175
+ }
179
176
 
180
- if(xml_node.get(0).tagName != 'description' && !self.elements[xml_node.get(0).tagName].neverdelete) {
181
- var icon = self.elements[xml_node.get(0).tagName].illustrator.svg.clone();
182
- icon.children('.rfill').addClass('menu');
183
- menu['Delete'] = [{
184
- 'label': 'Remove Element',
185
- 'function_call': function(selector,target,selected){ self.adaptor.description.remove(selector,target); self.adaptor.illustrator.get_label_by_svg_id(selected).addClass('selected'); },
186
- 'menu_icon': icon,
187
- 'type': undefined,
188
- 'params': [null, xml_node, self.selected()]
189
- }];
190
- }
191
- if($('> code', xml_node).length > 0 && xml_node.get(0).tagName == 'call') {
192
- var icon = self.elements.callmanipulate.illustrator.svg.clone();
193
- icon.children('.rfill:last').addClass('menu');
194
- menu['Delete'].push({
195
- 'label': 'Remove Output Transformation',
196
- 'function_call': self.adaptor.description.remove,
197
- 'menu_icon': icon,
198
- 'type': undefined,
199
- 'params': ['> code', xml_node]
200
- });
201
- }
202
- new CustomMenu(e).contextmenu(menu);
177
+ if(xml_node.get(0).tagName != 'description' && !self.elements[xml_node.get(0).tagName].neverdelete) {
178
+ var icon = self.elements[xml_node.get(0).tagName].illustrator.svg.clone();
179
+ icon.children('.rfill').addClass('menu');
180
+ menu['Delete'] = [{
181
+ 'label': 'Remove Element',
182
+ 'function_call': function(selector,target,selected){ self.adaptor.description.remove(selector,target); self.adaptor.illustrator.get_label_by_svg_id(selected).addClass('selected'); },
183
+ 'menu_icon': icon,
184
+ 'type': undefined,
185
+ 'params': [null, xml_node, self.selected()]
186
+ }];
187
+ }
188
+ if($('> code', xml_node).length > 0 && xml_node.get(0).tagName == 'call') {
189
+ var icon = self.elements.callmanipulate.illustrator.svg.clone();
190
+ icon.children('.rfill:last').addClass('menu');
191
+ menu['Delete'].push({
192
+ 'label': 'Remove Output Transformation',
193
+ 'function_call': self.adaptor.description.remove,
194
+ 'menu_icon': icon,
195
+ 'type': undefined,
196
+ 'params': ['> code', xml_node]
197
+ });
198
+ }
199
+ new CustomMenu(e).contextmenu(menu);
200
+ } //}}}
201
+
202
+ // Events
203
+ this.events.touchend = function(svgid, e) { // {{{
204
+ clearTimeout(self.presstimer);
205
+ } // }}}
206
+ this.events.touchstart = function(svgid, e, child, sibling) { // {{{
207
+ self.presstimer = window.setTimeout(function() { contextMenuHandling(svgid,e,child,sibling); },1000);
208
+ return false;
209
+ } // }}}
210
+ this.events.mousedown = function(svgid, e, child, sibling) { // {{{
211
+ if(e.button == 0) { // left-click
212
+ } else if(e.button == 1) { // middle-click
213
+ } else if(e.button == 2) { // right-click
214
+ contextMenuHandling(svgid,e,child,sibling);
203
215
  }
204
216
  return false;
205
217
  } // }}}
@@ -302,6 +314,8 @@ function WFAdaptorManifestation(adaptor) {
302
314
  }, //}}}
303
315
  'adaptor': {//{{{
304
316
  'mousedown': function (node,e) { self.events.mousedown(node,e,true,true); },
317
+ 'touchstart': function (node,e) { self.events.touchstart(node,e,true,true); },
318
+ 'touchend': self.events.touchend,
305
319
  'click': self.events.click,
306
320
  'dragstart': self.events.dragstart,
307
321
  'mouseover': self.events.mouseover,
@@ -328,6 +342,8 @@ function WFAdaptorManifestation(adaptor) {
328
342
  }, //}}}
329
343
  'adaptor': {//{{{
330
344
  'mousedown': function (node,e) { self.events.mousedown(node,e,false,true); },
345
+ 'touchstart': function (node,e) { self.events.touchstart(node,e,false,true); },
346
+ 'touchend': self.events.touchend,
331
347
  'click': self.events.click,
332
348
  'mouseover': self.events.mouseover,
333
349
  'mouseout': self.events.mouseout
@@ -345,6 +361,8 @@ function WFAdaptorManifestation(adaptor) {
345
361
  }, //}}}
346
362
  'adaptor': {//{{{
347
363
  'mousedown': function (node,e) { self.events.mousedown(node,e,false,true); },
364
+ 'touchstart': function (node,e) { self.events.touchstart(node,e,false,true); },
365
+ 'touchend': self.events.touchend,
348
366
  'click': self.events.click,
349
367
  'mouseover': self.events.mouseover,
350
368
  'mouseout': self.events.mouseout
@@ -362,6 +380,8 @@ function WFAdaptorManifestation(adaptor) {
362
380
  }, //}}}
363
381
  'adaptor': {//{{{
364
382
  'mousedown': function (node,e) { self.events.mousedown(node,e,false,true); },
383
+ 'touchstart': function (node,e) { self.events.touchstart(node,e,false,true); },
384
+ 'touchend': self.events.touchend,
365
385
  'click': self.events.click,
366
386
  'mouseover': self.events.mouseover,
367
387
  'mouseout': self.events.mouseout
@@ -380,6 +400,8 @@ function WFAdaptorManifestation(adaptor) {
380
400
  }, //}}}
381
401
  'adaptor': {//{{{
382
402
  'mousedown': function (node,e) { self.events.mousedown(node,e,false,false); },
403
+ 'touchstart': function (node,e) { self.events.touchstart(node,e,false,false); },
404
+ 'touchend': self.events.touchend,
383
405
  'mouseover': self.events.mouseover,
384
406
  'mouseout': self.events.mouseout
385
407
  }//}}}
@@ -391,9 +413,7 @@ function WFAdaptorManifestation(adaptor) {
391
413
  'svg': self.adaptor.theme_dir + 'symbols/end.svg'
392
414
  }, //}}}
393
415
  'adaptor': {//{{{
394
- 'mousedown': function (node,e) {
395
- self.events.suppress();
396
- }
416
+ 'mousedown': function (node,e) { self.events.suppress(); }
397
417
  }//}}}
398
418
  }; /*}}}*/
399
419
  this.elements.event_end = { /*{{{*/
@@ -403,9 +423,7 @@ function WFAdaptorManifestation(adaptor) {
403
423
  'svg': self.adaptor.theme_dir + 'symbols/event_end.svg'
404
424
  }, //}}}
405
425
  'adaptor': {//{{{
406
- 'mousedown': function (node,e) {
407
- self.events.suppress();
408
- },
426
+ 'mousedown': function (node,e) { self.events.suppress(); },
409
427
  'click': self.events.click,
410
428
  'dblclick': self.events.dblclick,
411
429
  'mouseover': self.events.mouseover,
@@ -426,9 +444,9 @@ function WFAdaptorManifestation(adaptor) {
426
444
  },
427
445
  }, //}}}
428
446
  'adaptor': {//{{{
429
- 'mousedown': function (node,e) {
430
- self.events.mousedown(node,e,true,true);
431
- },
447
+ 'mousedown': function (node,e) { self.events.mousedown(node,e,true,true); },
448
+ 'touchstart': function (node,e) { self.events.touchstart(node,e,true,true); },
449
+ 'touchend': self.events.touchend,
432
450
  'click': self.events.click,
433
451
  'dblclick': self.events.dblclick,
434
452
  'mouseover': self.events.mouseover,
@@ -447,9 +465,9 @@ function WFAdaptorManifestation(adaptor) {
447
465
  'svg': self.adaptor.theme_dir + 'symbols/choose_exclusive.svg',
448
466
  }, //}}}
449
467
  'adaptor': {//{{{
450
- 'mousedown': function (node,e) {
451
- self.events.mousedown(node,e,true,true);
452
- },
468
+ 'mousedown': function (node,e) { self.events.mousedown(node,e,true,true); },
469
+ 'touchstart': function (node,e) { self.events.touchstart(node,e,true,true); },
470
+ 'touchend': self.events.touchend,
453
471
  'click': self.events.click,
454
472
  'dblclick': self.events.dblclick,
455
473
  'mouseover': self.events.mouseover,
@@ -462,7 +480,9 @@ function WFAdaptorManifestation(adaptor) {
462
480
  'endnodes': 'this',
463
481
  'svg': self.adaptor.theme_dir + 'symbols/parallel.svg',
464
482
  'resolve_symbol': function(node) {
465
- if($(node).attr('cancel') == 'last' && $(node).attr('wait') == '-1') {
483
+ if($(node).children(':not(parallel_branch)').length > 0) {
484
+ return 'parallel_complex';
485
+ } else if($(node).attr('cancel') == 'last' && $(node).attr('wait') == '-1') {
466
486
  return 'parallel_simple';
467
487
  } else if($(node).attr('cancel') == 'first' && $(node).attr('wait') == '-1') {
468
488
  return 'parallel_event_all';
@@ -474,9 +494,9 @@ function WFAdaptorManifestation(adaptor) {
474
494
  },
475
495
  }, //}}}
476
496
  'adaptor': {//{{{
477
- 'mousedown': function (node,e) {
478
- self.events.mousedown(node,e,true,true);
479
- },
497
+ 'mousedown': function (node,e) { self.events.mousedown(node,e,true,true); },
498
+ 'touchstart': function (node,e) { self.events.touchstart(node,e,true,true); },
499
+ 'touchend': self.events.touchend,
480
500
  'click': self.events.click,
481
501
  'dblclick': self.events.dblclick,
482
502
  'mouseover': self.events.mouseover,
@@ -539,9 +559,9 @@ function WFAdaptorManifestation(adaptor) {
539
559
  return childs;
540
560
  }, //}}}
541
561
  'adaptor': {//{{{
542
- 'mousedown': function (node,e) {
543
- self.events.mousedown(node,e,true,true);
544
- },
562
+ 'mousedown': function (node,e) { self.events.mousedown(node,e,true,true); },
563
+ 'touchstart': function (node,e) { self.events.touchstart(node,e,true,true); },
564
+ 'touchend': self.events.touchend,
545
565
  'click': self.events.click,
546
566
  'dblclick': self.events.dblclick,
547
567
  'mouseover': self.events.mouseover,
@@ -623,9 +643,9 @@ function WFAdaptorManifestation(adaptor) {
623
643
  return childs;
624
644
  }, //}}}
625
645
  'adaptor': {//{{{
626
- 'mousedown': function (node,e) {
627
- self.events.mousedown(node,e,true,false);
628
- },
646
+ 'mousedown': function (node,e) { self.events.mousedown(node,e,true,false); },
647
+ 'touchstart': function (node,e) { self.events.touchstart(node,e,true,false); },
648
+ 'touchend': self.events.touchend,
629
649
  'click': self.events.click,
630
650
  'dblclick': self.events.dblclick,
631
651
  'mouseover': self.events.mouseover,
@@ -715,9 +735,9 @@ function WFAdaptorManifestation(adaptor) {
715
735
  return childs;
716
736
  }, //}}}
717
737
  'adaptor': {//{{{
718
- 'mousedown': function (node,e) {
719
- self.events.mousedown(node,e,true,true);
720
- },
738
+ 'mousedown': function (node,e) { self.events.mousedown(node,e,true,true); },
739
+ 'touchstart': function (node,e) { self.events.touchstart(node,e,true,true); },
740
+ 'touchend': self.events.touchend,
721
741
  'click': self.events.click,
722
742
  'dblclick': self.events.dblclick,
723
743
  'mouseover': self.events.mouseover,
@@ -811,9 +831,9 @@ function WFAdaptorManifestation(adaptor) {
811
831
  return childs;
812
832
  }, //}}}
813
833
  'adaptor': {//{{{
814
- 'mousedown': function (node,e) {
815
- self.events.mousedown(node,e,true,true);
816
- },
834
+ 'mousedown': function (node,e) { self.events.mousedown(node,e,true,true); },
835
+ 'touchstart': function (node,e) { self.events.touchstart(node,e,true,true); },
836
+ 'touchend': self.events.touchend,
817
837
  'click': self.events.click,
818
838
  'dblclick': self.events.dblclick,
819
839
  'mouseover': self.events.mouseover,
@@ -904,9 +924,9 @@ function WFAdaptorManifestation(adaptor) {
904
924
  return childs;
905
925
  }, //}}}
906
926
  'adaptor': {//{{{
907
- 'mousedown': function (node,e) {
908
- self.events.mousedown(node,e,true,true);
909
- },
927
+ 'mousedown': function (node,e) { self.events.mousedown(node,e,true,true); },
928
+ 'touchstart': function (node,e) { self.events.touchstart(node,e,true,true); },
929
+ 'touchend': self.events.touchend,
910
930
  'click': self.events.click,
911
931
  'dblclick': self.events.dblclick,
912
932
  'mouseover': self.events.mouseover,
@@ -998,9 +1018,9 @@ function WFAdaptorManifestation(adaptor) {
998
1018
  return childs;
999
1019
  }, //}}}
1000
1020
  'adaptor': {//{{{
1001
- 'mousedown': function (node,e) {
1002
- self.events.mousedown(node,e,true,true);
1003
- },
1021
+ 'mousedown': function (node,e) { self.events.mousedown(node,e,true,true); },
1022
+ 'touchstart': function (node,e) { self.events.touchstart(node,e,true,true); },
1023
+ 'touchend': self.events.touchend,
1004
1024
  'click': self.events.click,
1005
1025
  'dblclick': self.events.dblclick,
1006
1026
  'mouseover': self.events.mouseover,
@@ -1080,9 +1100,9 @@ function WFAdaptorManifestation(adaptor) {
1080
1100
  return childs;
1081
1101
  }, //}}}
1082
1102
  'adaptor': {//{{{
1083
- 'mousedown': function (node,e) {
1084
- self.events.mousedown(node,e,true,true);
1085
- },
1103
+ 'mousedown': function (node,e) { self.events.mousedown(node,e,true,true); },
1104
+ 'touchstart': function (node,e) { self.events.touchstart(node,e,true,true); },
1105
+ 'touchend': self.events.touchend,
1086
1106
  'click': self.events.click,
1087
1107
  'dblclick': self.events.dblclick,
1088
1108
  'mouseover': self.events.mouseover,
@@ -1112,9 +1132,9 @@ function WFAdaptorManifestation(adaptor) {
1112
1132
  ];
1113
1133
  }, //}}}
1114
1134
  'adaptor': {//{{{
1115
- 'mousedown': function (node,e) {
1116
- self.events.mousedown(node,e,true,true);
1117
- },
1135
+ 'mousedown': function (node,e) { self.events.mousedown(node,e,true,true); },
1136
+ 'touchstart': function (node,e) { self.events.touchstart(node,e,true,true); },
1137
+ 'touchend': self.events.touchend,
1118
1138
  'click': self.events.click,
1119
1139
  'dblclick': self.events.dblclick,
1120
1140
  'mouseover': self.events.mouseover,
@@ -1190,9 +1210,9 @@ function WFAdaptorManifestation(adaptor) {
1190
1210
  return childs;
1191
1211
  }, //}}}
1192
1212
  'adaptor': {//{{{
1193
- 'mousedown': function (node,e) {
1194
- self.events.mousedown(node,e,true,false);
1195
- },
1213
+ 'mousedown': function (node,e) { self.events.mousedown(node,e,true,false); },
1214
+ 'touchstart': function (node,e) { self.events.touchstart(node,e,true,false); },
1215
+ 'touchend': self.events.touchend,
1196
1216
  'click': self.events.click,
1197
1217
  'dblclick': self.events.dblclick,
1198
1218
  'mouseover': self.events.mouseover,
@@ -155,7 +155,7 @@
155
155
  </element>
156
156
  </element>
157
157
  </element>
158
- <element name="input" rngui:header="Documentation">
158
+ <element name="documentation" rngui:header="Documentation">
159
159
  <element name="input" rngui:header="Input Arguments" rngui:fold="closed">
160
160
  <zeroOrMore rngui:label="Create Argument">
161
161
  <element name="item" rngui:label="Description">
@@ -195,7 +195,7 @@
195
195
  </element>
196
196
  </element>
197
197
 
198
- <element name="input" rngui:header="Documentation">
198
+ <element name="documentation" rngui:header="Documentation">
199
199
  <element name="input" rngui:header="Input Arguments" rngui:fold="closed">
200
200
  <zeroOrMore rngui:label="Create Argument">
201
201
  <element name="item" rngui:label="Description">