2012-10-24 06:47:08 +00:00
|
|
|
$('#new_synapse').fadeOut('fast');
|
2012-12-21 04:45:44 +00:00
|
|
|
$('#synapse_desc').attr('value','');
|
2013-01-01 22:45:35 +00:00
|
|
|
$('#synapse_topic1id').attr('value','0');
|
|
|
|
$('#synapse_topic2id').attr('value','0');
|
2012-10-24 06:47:08 +00:00
|
|
|
|
2012-12-21 04:45:44 +00:00
|
|
|
var temp1, temp2, temp;
|
2012-10-24 06:47:08 +00:00
|
|
|
|
2012-12-21 04:45:44 +00:00
|
|
|
if ( Mconsole != null) {
|
2013-01-01 22:45:35 +00:00
|
|
|
temp1 = Mconsole.graph.getNode(<%= @synapse.topic1.id %>);
|
|
|
|
temp2 = Mconsole.graph.getNode(<%= @synapse.topic2.id %>);
|
2012-12-21 04:45:44 +00:00
|
|
|
Mconsole.graph.addAdjacence(temp1, temp2, {});
|
|
|
|
temp = Mconsole.graph.getAdjacence(temp1.id, temp2.id);
|
|
|
|
console.log(temp);
|
|
|
|
temp.setDataset('start', {
|
|
|
|
lineWidth: 0.4,
|
|
|
|
color: '#d1d1d1'
|
|
|
|
});
|
|
|
|
temp.setDataset('end', {
|
|
|
|
lineWidth: 3,
|
|
|
|
color: '#36acfb'
|
|
|
|
});
|
|
|
|
var d = new Array(<%= @synapse.node1_id.to_s() %>, <%= @synapse.node2_id.to_s() %>);
|
|
|
|
temp.setDataset('current', {
|
|
|
|
desc: '<%= @synapse.desc %>',
|
|
|
|
showDesc: true,
|
|
|
|
category: '<%= @synapse.category %>',
|
|
|
|
id: '<%= @synapse.id %>',
|
|
|
|
userid: '<%= @synapse.user.id %>',
|
|
|
|
username: '<%= @synapse.user.name %>'
|
|
|
|
});
|
|
|
|
temp.data.$direction = d;
|
|
|
|
Mconsole.fx.plotLine(temp, Mconsole.canvas);
|
|
|
|
Mconsole.fx.animate({
|
|
|
|
modes: ['edge-property:lineWidth:color'],
|
|
|
|
duration: 400
|
|
|
|
});
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
json = <%= @synapse.selfplusnodes_as_json.html_safe %>
|
|
|
|
initialize("chaotic");
|
2012-10-24 06:47:08 +00:00
|
|
|
}
|