cockpit/themes/compact/theme.js in cpee-1.5.16 vs cockpit/themes/compact/theme.js in cpee-1.5.17

- old
+ new

@@ -150,19 +150,19 @@ 'menu_icon': icon, 'type': undefined, 'params': [null, xml_node] }]; } - if($('> finalize, > update', xml_node).length > 0 && xml_node.get(0).tagName == 'call') { + if($('> code', xml_node).length > 0 && xml_node.get(0).tagName == 'call') { var icon = self.elements.callmanipulate.illustrator.svg.clone(); icon.children('.rfill:last').addClass('menu'); menu['Delete'].push({ 'label': 'Remove Scripts', 'function_call': self.adaptor.description.remove, 'menu_icon': icon, 'type': undefined, - 'params': ['> finalize, > update', xml_node] + 'params': ['> code', xml_node] }); } if (xml_node.get(0).tagName == "call" || xml_node.get(0).tagName == "manipulate" || xml_node.get(0).tagName == "stop") { var icon = self.elements.call.illustrator.svg.clone(); icon.children('g.replace').addClass('active'); @@ -251,21 +251,21 @@ var ret = [ { column: 'Label', value: $('> label',$(node).children('parameters')).text().replace(/^['"]/,'').replace(/['"]$/,'') } ]; return ret; }, 'info': function(node){ return { 'element-endpoint': $(node).attr('endpoint') }; }, 'resolve_symbol': function(node) { - if($('finalize,update', node).length > 0) { + if($('code', node).length > 0) { return 'callmanipulate'; } else { return 'call'; } }, 'svg': self.adaptor.theme_dir + 'symbols/call.svg' },//}}} 'description': self.adaptor.theme_dir + 'rngs/call.rng', 'permissible_children': function(node,mode) { //{{{ - if(node.children('finalize,update').length < 1) + if(node.children('code').length < 1) return [ {'label': 'Scripts', 'function_call': self.adaptor.description.insert_last_into, 'menu_icon': self.elements.callmanipulate.illustrator.svg.clone(), 'type': undefined, @@ -535,11 +535,11 @@ 'permissible_children': function(node,mode) { //{{{ var func = null; var childs = null; if (mode == 'into') { func = self.adaptor.description.insert_first_into } else { func = self.adaptor.description.insert_after } - return [ + var childs = [ {'label': 'Service Call with Scripts', 'function_call': func, 'menu_icon': self.elements.callmanipulate.illustrator.svg.clone(), 'type': 'callmanipulate', 'params': [self.adaptor.description.elements.callmanipulate, node]}, @@ -575,17 +575,22 @@ 'params': [self.adaptor.description.elements.terminate, node]}, {'label': 'Stop', 'function_call': func, 'menu_icon': self.elements.stop.illustrator.svg.clone(), 'type': 'stop', - 'params': [self.adaptor.description.elements.stop, node]}, - {'label': 'Critical', - 'function_call': func, - 'menu_icon': self.elements.critical.illustrator.svg.clone(), - 'type': 'critical', - 'params': [self.adaptor.description.elements.critical, node]} + 'params': [self.adaptor.description.elements.stop, node]} ]; + if(node.parent('parallel_branch').length > 0) { + childs.push({ + 'label': 'Critical', + 'function_call': func, + 'menu_icon': self.elements.critical.illustrator.svg.clone(), + 'type': 'critical', + 'params': [self.adaptor.description.elements.critical, node] + }); + } + return childs; }, //}}} 'adaptor': {//{{{ 'mousedown': function (node,e) { self.events.mousedown(node,e,true,false); }, @@ -622,11 +627,11 @@ 'function_call': func, 'menu_icon': self.elements.parallel_branch.illustrator.svg.clone(), 'type': 'parallel_branch', 'params': [self.adaptor.description.elements.parallel_branch, node]}]; } - return [ + var childs = [ {'label': 'Service Call with Scripts', 'function_call': func, 'menu_icon': self.elements.callmanipulate.illustrator.svg.clone(), 'type': 'callmanipulate', 'params': [self.adaptor.description.elements.callmanipulate, node]}, @@ -662,17 +667,22 @@ 'params': [self.adaptor.description.elements.terminate, node]}, {'label': 'Stop', 'function_call': func, 'menu_icon': self.elements.stop.illustrator.svg.clone(), 'type': 'stop', - 'params': [self.adaptor.description.elements.stop, node]}, - {'label': 'Critical', - 'function_call': func, - 'menu_icon': self.elements.critical.illustrator.svg.clone(), - 'type': 'critical', - 'params': [self.adaptor.description.elements.critical, node]} + 'params': [self.adaptor.description.elements.stop, node]} ]; + if(node.parent('parallel_branch').length > 0) { + childs.push({ + 'label': 'Critical', + 'function_call': func, + 'menu_icon': self.elements.critical.illustrator.svg.clone(), + 'type': 'critical', + 'params': [self.adaptor.description.elements.critical, node] + }); + } + return childs; }, //}}} 'adaptor': {//{{{ 'mousedown': function (node,e) { self.events.mousedown(node,e,true,true); }, @@ -714,11 +724,11 @@ {'label': 'Service Call', 'function_call': func, 'menu_icon': self.elements.call.illustrator.svg.clone(), 'type': 'call', 'params': [self.adaptor.description.elements.call, node]}, - {'label': 'Manipulate', + {'label': 'Script', 'function_call': func, 'menu_icon': self.elements.manipulate.illustrator.svg.clone(), 'type': 'manipulate', 'params': [self.adaptor.description.elements.manipulate, node]}, {'label': 'Decision', @@ -738,17 +748,21 @@ 'params': [self.adaptor.description.elements.terminate, node]}, {'label': 'Stop', 'function_call': func, 'menu_icon': self.elements.stop.illustrator.svg.clone(), 'type': 'stop', - 'params': [self.adaptor.description.elements.stop, node]}, - {'label': 'Critical', - 'function_call': func, - 'menu_icon': self.elements.critical.illustrator.svg.clone(), - 'type': 'critical', - 'params': [self.adaptor.description.elements.critical, node]} + 'params': [self.adaptor.description.elements.stop, node]} ]; + if(node.parent('parallel_branch').length > 0) { + childs.push({ + 'label': 'Critical', + 'function_call': func, + 'menu_icon': self.elements.critical.illustrator.svg.clone(), + 'type': 'critical', + 'params': [self.adaptor.description.elements.critical, node] + }); + } if(node.parent('parallel').length > node.parent('parallel_branch').length) { childs.push({'label': 'Parallel Branch', 'function_call': func, 'menu_icon': self.elements.parallel_branch.illustrator.svg.clone(), 'type': 'parallel_branch', @@ -804,11 +818,11 @@ {'label': 'Service Call', 'function_call': func, 'menu_icon': self.elements.call.illustrator.svg.clone(), 'type': 'call', 'params': [self.adaptor.description.elements.call, node]}, - {'label': 'Manipulate', + {'label': 'Script', 'function_call': func, 'menu_icon': self.elements.manipulate.illustrator.svg.clone(), 'type': 'manipulate', 'params': [self.adaptor.description.elements.manipulate, node]}, {'label': 'Decision', @@ -823,11 +837,16 @@ 'params': [self.adaptor.description.elements.loop, node]}, {'label': 'Parallel Branch', 'function_call': func, 'menu_icon': self.elements.parallel_branch.illustrator.svg.clone(), 'type': 'parallel_branch', - 'params': [self.adaptor.description.elements.parallel_branch, node]} + 'params': [self.adaptor.description.elements.parallel_branch, node]}, + {'label': 'Stop', + 'function_call': func, + 'menu_icon': self.elements.stop.illustrator.svg.clone(), + 'type': 'stop', + 'params': [self.adaptor.description.elements.stop, node]} ]; if(node.get(0).tagName != 'parallel') childs.push({'label': 'Parallel', 'function_call': self.adaptor.description.insert_last_into, 'menu_icon': self.elements.parallel.illustrator.svg.clone(), @@ -869,14 +888,13 @@ 'svg': self.adaptor.theme_dir + 'symbols/parallel_branch.svg' },//}}} 'description': self.adaptor.theme_dir + 'rngs/parallel_branch.rng', 'permissible_children': function(node,mode) { //{{{ var func = null; - var childs = null; if (mode == 'into') { func = self.adaptor.description.insert_first_into } else { func = self.adaptor.description.insert_after } - childs = [ + var childs = [ {'label': 'Service Call with Scripts', 'function_call': func, 'menu_icon': self.elements.callmanipulate.illustrator.svg.clone(), 'type': 'callmanipulate', 'params': [self.adaptor.description.elements.callmanipulate, node]}, @@ -917,11 +935,11 @@ 'params': [self.adaptor.description.elements.stop, node]}, {'label': 'Critical', 'function_call': func, 'menu_icon': self.elements.critical.illustrator.svg.clone(), 'type': 'critical', - 'params': [self.adaptor.description.elements.critical, node]}, + 'params': [self.adaptor.description.elements.critical, node]} ]; if(node.parents('choose').length > node.parents('alternative, otherwise').length && node.get(0).tagName == 'parallel_branch') { return [{'label': 'Alternative', 'function_call': func, 'menu_icon': self.elements.alternative.illustrator.svg.clone(), @@ -962,11 +980,11 @@ 'description': self.adaptor.theme_dir + 'rngs/critical.rng', 'permissible_children': function(node,mode) { //{{{ var func = null; if (mode == 'into') { func = self.adaptor.description.insert_first_into } else { func = self.adaptor.description.insert_after } - return [ + var childs = [ {'label': 'Service Call with Scripts', 'function_call': func, 'menu_icon': self.elements.callmanipulate.illustrator.svg.clone(), 'type': 'callmanipulate', 'params': [self.adaptor.description.elements.callmanipulate, node]}, @@ -1002,17 +1020,22 @@ 'params': [self.adaptor.description.elements.terminate, node]}, {'label': 'Stop', 'function_call': func, 'menu_icon': self.elements.stop.illustrator.svg.clone(), 'type': 'stop', - 'params': [self.adaptor.description.elements.stop, node]}, - {'label': 'Critical', - 'function_call': func, - 'menu_icon': self.elements.critical.illustrator.svg.clone(), - 'type': 'critical', - 'params': [self.adaptor.description.elements.critical, node]}, + 'params': [self.adaptor.description.elements.stop, node]} ]; + if(node.parent('parallel_branch').length > 0) { + childs.push({ + 'label': 'Critical', + 'function_call': func, + 'menu_icon': self.elements.critical.illustrator.svg.clone(), + 'type': 'critical', + 'params': [self.adaptor.description.elements.critical, node] + }); + } + return childs; }, //}}} 'adaptor': {//{{{ 'mousedown': function (node,e) { self.events.mousedown(node,e,true,true); }, @@ -1072,22 +1095,22 @@ 'description': null, 'permissible_children': function(node,mode) { //{{{ var func = null; if (mode == 'into') { func = self.adaptor.description.insert_first_into } else { func = self.adaptor.description.insert_after } - return [ + var childs = [ {'label': 'Service Call with Scripts', 'function_call': func, 'menu_icon': self.elements.callmanipulate.illustrator.svg.clone(), 'type': 'callmanipulate', 'params': [self.adaptor.description.elements.callmanipulate, node]}, {'label': 'Service Call', 'function_call': func, 'menu_icon': self.elements.call.illustrator.svg.clone(), 'type': 'call', 'params': [self.adaptor.description.elements.call, node]}, - {'label': 'Script Task', + {'label': 'Script', 'function_call': func, 'menu_icon': self.elements.manipulate.illustrator.svg.clone(), 'type': 'manipulate', 'params': [self.adaptor.description.elements.manipulate, node]}, {'label': 'Parallel', @@ -1112,16 +1135,21 @@ 'params': [self.adaptor.description.elements.terminate, node]}, {'label': 'Stop', 'function_call': func, 'menu_icon': self.elements.stop.illustrator.svg.clone(), 'type': 'stop', - 'params': [self.adaptor.description.elements.stop, node]}, - {'label': 'Critical', - 'function_call': func, - 'menu_icon': self.elements.critical.illustrator.svg.clone(), - 'type': 'critical', - 'params': [self.adaptor.description.elements.critical, node]} + 'params': [self.adaptor.description.elements.stop, node]} ]; + if(node.parent('parallel_branch').length > 0) { + childs.push({ + 'label': 'Critical', + 'function_call': func, + 'menu_icon': self.elements.critical.illustrator.svg.clone(), + 'type': 'critical', + 'params': [self.adaptor.description.elements.critical, node] + }); + } + return childs; }, //}}} 'adaptor': {//{{{ 'mousedown': function (node,e) { self.events.mousedown(node,e,true,false); },