cpee 2.1.23 → 2.1.24

Sign up to get free protection for your applications and to get access to all the features.
@@ -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,
@@ -474,9 +492,9 @@ function WFAdaptorManifestation(adaptor) {
474
492
  },
475
493
  }, //}}}
476
494
  'adaptor': {//{{{
477
- 'mousedown': function (node,e) {
478
- self.events.mousedown(node,e,true,true);
479
- },
495
+ 'mousedown': function (node,e) { self.events.mousedown(node,e,true,true); },
496
+ 'touchstart': function (node,e) { self.events.touchstart(node,e,true,true); },
497
+ 'touchend': self.events.touchend,
480
498
  'click': self.events.click,
481
499
  'dblclick': self.events.dblclick,
482
500
  'mouseover': self.events.mouseover,
@@ -539,9 +557,9 @@ function WFAdaptorManifestation(adaptor) {
539
557
  return childs;
540
558
  }, //}}}
541
559
  'adaptor': {//{{{
542
- 'mousedown': function (node,e) {
543
- self.events.mousedown(node,e,true,true);
544
- },
560
+ 'mousedown': function (node,e) { self.events.mousedown(node,e,true,true); },
561
+ 'touchstart': function (node,e) { self.events.touchstart(node,e,true,true); },
562
+ 'touchend': self.events.touchend,
545
563
  'click': self.events.click,
546
564
  'dblclick': self.events.dblclick,
547
565
  'mouseover': self.events.mouseover,
@@ -623,9 +641,9 @@ function WFAdaptorManifestation(adaptor) {
623
641
  return childs;
624
642
  }, //}}}
625
643
  'adaptor': {//{{{
626
- 'mousedown': function (node,e) {
627
- self.events.mousedown(node,e,true,false);
628
- },
644
+ 'mousedown': function (node,e) { self.events.mousedown(node,e,true,false); },
645
+ 'touchstart': function (node,e) { self.events.touchstart(node,e,true,false); },
646
+ 'touchend': self.events.touchend,
629
647
  'click': self.events.click,
630
648
  'dblclick': self.events.dblclick,
631
649
  'mouseover': self.events.mouseover,
@@ -715,9 +733,9 @@ function WFAdaptorManifestation(adaptor) {
715
733
  return childs;
716
734
  }, //}}}
717
735
  'adaptor': {//{{{
718
- 'mousedown': function (node,e) {
719
- self.events.mousedown(node,e,true,true);
720
- },
736
+ 'mousedown': function (node,e) { self.events.mousedown(node,e,true,true); },
737
+ 'touchstart': function (node,e) { self.events.touchstart(node,e,true,true); },
738
+ 'touchend': self.events.touchend,
721
739
  'click': self.events.click,
722
740
  'dblclick': self.events.dblclick,
723
741
  'mouseover': self.events.mouseover,
@@ -811,9 +829,9 @@ function WFAdaptorManifestation(adaptor) {
811
829
  return childs;
812
830
  }, //}}}
813
831
  'adaptor': {//{{{
814
- 'mousedown': function (node,e) {
815
- self.events.mousedown(node,e,true,true);
816
- },
832
+ 'mousedown': function (node,e) { self.events.mousedown(node,e,true,true); },
833
+ 'touchstart': function (node,e) { self.events.touchstart(node,e,true,true); },
834
+ 'touchend': self.events.touchend,
817
835
  'click': self.events.click,
818
836
  'dblclick': self.events.dblclick,
819
837
  'mouseover': self.events.mouseover,
@@ -904,9 +922,9 @@ function WFAdaptorManifestation(adaptor) {
904
922
  return childs;
905
923
  }, //}}}
906
924
  'adaptor': {//{{{
907
- 'mousedown': function (node,e) {
908
- self.events.mousedown(node,e,true,true);
909
- },
925
+ 'mousedown': function (node,e) { self.events.mousedown(node,e,true,true); },
926
+ 'touchstart': function (node,e) { self.events.touchstart(node,e,true,true); },
927
+ 'touchend': self.events.touchend,
910
928
  'click': self.events.click,
911
929
  'dblclick': self.events.dblclick,
912
930
  'mouseover': self.events.mouseover,
@@ -998,9 +1016,9 @@ function WFAdaptorManifestation(adaptor) {
998
1016
  return childs;
999
1017
  }, //}}}
1000
1018
  'adaptor': {//{{{
1001
- 'mousedown': function (node,e) {
1002
- self.events.mousedown(node,e,true,true);
1003
- },
1019
+ 'mousedown': function (node,e) { self.events.mousedown(node,e,true,true); },
1020
+ 'touchstart': function (node,e) { self.events.touchstart(node,e,true,true); },
1021
+ 'touchend': self.events.touchend,
1004
1022
  'click': self.events.click,
1005
1023
  'dblclick': self.events.dblclick,
1006
1024
  'mouseover': self.events.mouseover,
@@ -1080,9 +1098,9 @@ function WFAdaptorManifestation(adaptor) {
1080
1098
  return childs;
1081
1099
  }, //}}}
1082
1100
  'adaptor': {//{{{
1083
- 'mousedown': function (node,e) {
1084
- self.events.mousedown(node,e,true,true);
1085
- },
1101
+ 'mousedown': function (node,e) { self.events.mousedown(node,e,true,true); },
1102
+ 'touchstart': function (node,e) { self.events.touchstart(node,e,true,true); },
1103
+ 'touchend': self.events.touchend,
1086
1104
  'click': self.events.click,
1087
1105
  'dblclick': self.events.dblclick,
1088
1106
  'mouseover': self.events.mouseover,
@@ -1112,9 +1130,9 @@ function WFAdaptorManifestation(adaptor) {
1112
1130
  ];
1113
1131
  }, //}}}
1114
1132
  'adaptor': {//{{{
1115
- 'mousedown': function (node,e) {
1116
- self.events.mousedown(node,e,true,true);
1117
- },
1133
+ 'mousedown': function (node,e) { self.events.mousedown(node,e,true,true); },
1134
+ 'touchstart': function (node,e) { self.events.touchstart(node,e,true,true); },
1135
+ 'touchend': self.events.touchend,
1118
1136
  'click': self.events.click,
1119
1137
  'dblclick': self.events.dblclick,
1120
1138
  'mouseover': self.events.mouseover,
@@ -1190,9 +1208,9 @@ function WFAdaptorManifestation(adaptor) {
1190
1208
  return childs;
1191
1209
  }, //}}}
1192
1210
  'adaptor': {//{{{
1193
- 'mousedown': function (node,e) {
1194
- self.events.mousedown(node,e,true,false);
1195
- },
1211
+ 'mousedown': function (node,e) { self.events.mousedown(node,e,true,false); },
1212
+ 'touchstart': function (node,e) { self.events.touchstart(node,e,true,false); },
1213
+ 'touchend': self.events.touchend,
1196
1214
  'click': self.events.click,
1197
1215
  'dblclick': self.events.dblclick,
1198
1216
  'mouseover': self.events.mouseover,