cockpit/themes/compact/theme.js in cpee-1.4.8 vs cockpit/themes/compact/theme.js in cpee-1.4.10
- old
+ new
@@ -21,17 +21,17 @@
ntxt = ntxt.replace(/trans-xmlns/,'xmlns');
return($X(ntxt));
} else {
if (opts && opts == 'clone') {
+ base = base.clone();
if (base.attr('id')) {
- base = base.clone();
- // not very generic, because it is assumed that id is attribute of top level
- // a better solution would be to parse rng for get_free_id()
- // but: there is lots of lock-in to element-id, so fuck it
base.attr('id',self.adaptor.description.get_free_id());
}
+ base.find('*[id]').each(function(k,v){
+ $(v).attr('id',self.adaptor.description.get_free_id(base));
+ });
}
return base;
}
}; //}}}
//{{{ Return the svgid for the clicked task
@@ -57,13 +57,13 @@
//{{{ Render the details from rng (right hand side of graph tab)
this.update_details = function(svgid){
var tab = $('#dat_details');
var node = self.adaptor.description.get_node_by_svg_id(svgid).get(0);
tab.empty();
- if (self.adaptor.description.elements[$(node).attr('svg-type')]) {
+ if (self.adaptor.description.elements[$(node).attr('svg-subtype')]) {
save['details_target'] = { 'svgid': svgid, 'model': self.adaptor.description };
- var rng = self.adaptor.description.elements[$(node).attr('svg-type')].clone();
+ var rng = self.adaptor.description.elements[$(node).attr('svg-subtype')].clone();
if (save['endpoints_cache'][$(node).attr('endpoint')] && save['endpoints_cache'][$(node).attr('endpoint')].schema) {
var schema = save['endpoints_cache'][$(node).attr('endpoint')].schema.documentElement;
$(rng).find(' > element[name="parameters"] > element[name="arguments"]').replaceWith($(schema).clone());
}
save['details'] = new RelaxNGui(rng,tab,self.adaptor.description.context_eval);
@@ -273,10 +273,41 @@
'adaptor': {//{{{
'mousedown': function (node,e) { self.events.mousedown(node,e,false,true); },
'click': self.events.click,
}//}}}
}; /*}}}*/
+ this.elements.stop = { /*{{{*/
+ 'type': 'primitive',
+ 'illustrator': {//{{{
+ 'endnodes': 'this',
+ 'svg': self.adaptor.theme_dir + 'symbols/stop.svg'
+ },//}}}
+ 'description': self.adaptor.theme_dir + 'rngs/stop.rng',
+ 'permissible_children': function(node,mode) { //{{{
+ return [];
+ }, //}}}
+ 'adaptor': {//{{{
+ 'mousedown': function (node,e) { self.events.mousedown(node,e,false,true); },
+ 'click': self.events.click,
+ }//}}}
+ }; /*}}}*/
+ this.elements.terminate = { /*{{{*/
+ 'type': 'primitive',
+ 'illustrator': {//{{{
+ 'endnodes': 'this',
+ 'final': true,
+ 'svg': self.adaptor.theme_dir + 'symbols/terminate.svg'
+ },//}}}
+ 'description': self.adaptor.theme_dir + 'rngs/terminate.rng',
+ 'permissible_children': function(node,mode) { //{{{
+ return [];
+ }, //}}}
+ 'adaptor': {//{{{
+ 'mousedown': function (node,e) { self.events.mousedown(node,e,false,true); },
+ 'click': self.events.click,
+ }//}}}
+ }; /*}}}*/
// Complex Elements
this.elements.choose = { /*{{{*/
'type': 'complex',
'illustrator': {//{{{
@@ -388,10 +419,20 @@
{'label': 'Loop',
'function_call': func,
'menu_icon': self.elements.loop.illustrator.svg.clone(),
'type': 'loop',
'params': [self.adaptor.description.elements.loop, node]},
+ {'label': 'Terminate',
+ 'function_call': func,
+ 'menu_icon': self.elements.terminate.illustrator.svg.clone(),
+ 'type': 'terminate',
+ '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]}
@@ -461,10 +502,20 @@
{'label': 'Loop',
'function_call': func,
'menu_icon': self.elements.loop.illustrator.svg.clone(),
'type': 'loop',
'params': [self.adaptor.description.elements.loop, node]},
+ {'label': 'Terminate',
+ 'function_call': func,
+ 'menu_icon': self.elements.terminate.illustrator.svg.clone(),
+ 'type': 'terminate',
+ '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]}
@@ -523,10 +574,20 @@
{'label': 'Loop',
'function_call': func,
'menu_icon': self.elements.loop.illustrator.svg.clone(),
'type': 'loop',
'params': [self.adaptor.description.elements.loop, node]},
+ {'label': 'Terminate',
+ 'function_call': func,
+ 'menu_icon': self.elements.terminate.illustrator.svg.clone(),
+ 'type': 'terminate',
+ '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]}
@@ -600,10 +661,20 @@
{'label': 'Loop',
'function_call': self.adaptor.description.insert_last_into,
'menu_icon': self.elements.loop.illustrator.svg.clone(),
'type': 'loop',
'params': [self.adaptor.description.elements.loop, node]},
+ {'label': 'Terminate',
+ 'function_call': self.adaptor.description.insert_last_into,
+ 'menu_icon': self.elements.terminate.illustrator.svg.clone(),
+ 'type': 'terminate',
+ 'params': [self.adaptor.description.elements.terminate, node]},
+ {'label': 'Stop',
+ 'function_call': self.adaptor.description.insert_last_into,
+ 'menu_icon': self.elements.stop.illustrator.svg.clone(),
+ 'type': 'stop',
+ 'params': [self.adaptor.description.elements.stop, node]},
{'label': 'Critical',
'function_call': self.adaptor.description.insert_last_into,
'menu_icon': self.elements.critical.illustrator.svg.clone(),
'type': 'critical',
'params': [self.adaptor.description.elements.critical, node]},
@@ -681,10 +752,20 @@
{'label': 'Loop',
'function_call': func,
'menu_icon': self.elements.loop.illustrator.svg.clone(),
'type': 'loop',
'params': [self.adaptor.description.elements.loop, node]},
+ {'label': 'Terminate',
+ 'function_call': func,
+ 'menu_icon': self.elements.terminate.illustrator.svg.clone(),
+ 'type': 'terminate',
+ '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]},
@@ -756,10 +837,20 @@
{'label': 'Loop',
'function_call': func,
'menu_icon': self.elements.loop.illustrator.svg.clone(),
'type': 'loop',
'params': [self.adaptor.description.elements.loop, node]},
+ {'label': 'Terminate',
+ 'function_call': func,
+ 'menu_icon': self.elements.terminate.illustrator.svg.clone(),
+ 'type': 'terminate',
+ '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]},
@@ -854,9 +945,19 @@
{'label': 'Loop',
'function_call': func,
'menu_icon': self.elements.loop.illustrator.svg.clone(),
'type': 'loop',
'params': [self.adaptor.description.elements.loop, node]},
+ {'label': 'Terminate',
+ 'function_call': func,
+ 'menu_icon': self.elements.terminate.illustrator.svg.clone(),
+ 'type': 'terminate',
+ '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]}