cockpit/themes/extended/theme.js in cpee-1.5.16 vs cockpit/themes/extended/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'); @@ -280,21 +280,21 @@ } 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, @@ -576,11 +576,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]}, @@ -616,17 +616,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); }, @@ -667,11 +672,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]}, @@ -707,17 +712,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); }, @@ -759,11 +769,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', @@ -783,17 +793,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', @@ -849,11 +863,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', @@ -868,11 +882,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(), @@ -914,14 +933,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]}, @@ -962,11 +980,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(), @@ -1007,11 +1025,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]}, @@ -1047,17 +1065,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); }, @@ -1118,22 +1141,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', @@ -1158,16 +1181,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); },