-
{{value}}
+
{{label}}
{{description}}
@@ -79,7 +79,7 @@
+
+
+
{{label}}
+
+
+ {{originator}}
+
+
+
+
+
\ No newline at end of file
diff --git a/app/views/maps/_newsynapse.html.erb b/app/views/maps/_newsynapse.html.erb
index 69777d03..d32b7398 100644
--- a/app/views/maps/_newsynapse.html.erb
+++ b/app/views/maps/_newsynapse.html.erb
@@ -8,6 +8,7 @@
<%= form.text_field :desc, :placeholder => "describe the connection..." %>
<%= form.hidden_field :topic1id, :value => 0 %>
<%= form.hidden_field :topic2id, :value => 0 %>
+ <%= form.hidden_field :grabSynapse, :value => "null" %>
<% if (@map.permission == "commons" && authenticated?) || @map.user == user %>
<%= form.hidden_field :map, :value => @map.id %>
<% end %>
diff --git a/app/views/maps/show.html.erb b/app/views/maps/show.html.erb
index 4636c4a2..6011b9ea 100644
--- a/app/views/maps/show.html.erb
+++ b/app/views/maps/show.html.erb
@@ -205,6 +205,11 @@
bindFilterHover();
bindInfoHover();
+ $(".sidebarCollaborateIcon").click(function(event) {
+ goRealtime = !goRealtime;
+ $(".sidebarCollaborateIcon").toggleClass("blue");
+ });
+
// initialize best_in_place editing
$('.authenticated div.permission.canEdit .best_in_place').best_in_place();
diff --git a/app/views/synapses/_new.html.erb b/app/views/synapses/_new.html.erb
index 0c98c2d3..50ecc35c 100644
--- a/app/views/synapses/_new.html.erb
+++ b/app/views/synapses/_new.html.erb
@@ -5,8 +5,9 @@
#%>
<%= form_for Synapse.new, url: synapses_url, remote: true do |form| %>
- <%= form.autocomplete_field :desc, autocomplete_synapse_desc_synapses_path, :placeholder => "Describe the connection..." %>
+ <%= form.text_field :desc, :placeholder => "describe the connection..." %>
<%= form.hidden_field :topic1id, :value => 0 %>
<%= form.hidden_field :topic2id, :value => 0 %>
+ <%= form.hidden_field :grabSynapse, :value => "null" %>
<% end %>
diff --git a/app/views/synapses/create.js.erb b/app/views/synapses/create.js.erb
index 36948ca3..b92a24e1 100644
--- a/app/views/synapses/create.js.erb
+++ b/app/views/synapses/create.js.erb
@@ -3,9 +3,10 @@
* Javascript called when you create a new synapse.
*/
$('#new_synapse').fadeOut('fast');
-$('#synapse_desc').attr('value','');
+$('#synapse_desc').typeahead('setQuery','');
$('#synapse_topic1id').attr('value','0');
$('#synapse_topic2id').attr('value','0');
+$('#synapse_grabSynapse').attr('value','null');
// reset the draw synapse positions to false
MetamapsModel.synapseStartCoord = false;
MetamapsModel.synapseEndCoord = false;
diff --git a/config/routes.rb b/config/routes.rb
index 960d6a38..c5d0edc8 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -9,6 +9,7 @@ ISSAD::Application.routes.draw do
match '/search/topics', to: 'main#searchtopics', via: :get, as: :searchtopics
match '/search/maps', to: 'main#searchmaps', via: :get, as: :searchmaps
match '/search/mappers', to: 'main#searchmappers', via: :get, as: :searchmappers
+ match '/search/synapses', to: 'main#searchsynapses', via: :get, as: :searchsynapses
match 'maps/:id/savelayout', to: 'maps#savelayout', via: :put, as: :savelayout
match 'topics/:map_id/:topic_id/removefrommap', to: 'topics#removefrommap', via: :post, as: :removefrommap
@@ -19,14 +20,10 @@ ISSAD::Application.routes.draw do
end
match 'topics/:id/:format', to: 'topics#json', via: :get, as: :json
- resources :synapses do
- get :autocomplete_synapse_desc, :on => :collection
- end
+ resources :synapses
match 'synapses/:id/:format', to: 'synapses#json', via: :get, as: :json
- resources :maps do
- get :autocomplete_map_name, :on => :collection
- end
+ resources :maps
match 'maps/:id/embed', to: 'maps#embed', via: :get, as: :embed
match 'maps/:id/:format', to: 'maps#json', via: :get, as: :json
@@ -36,7 +33,6 @@ ISSAD::Application.routes.draw do
end
resources :users, except: :show do
- get :autocomplete_user_name, :on => :collection
resources :topics, :only => [:index]
resources :synapses, :only => [:index]
resources :maps, :only => [:index]
diff --git a/public/assets/MMCCicon_realtime_blue-7d74516f638c995156bffae310aeed7a.png b/public/assets/MMCCicon_realtime_blue-7d74516f638c995156bffae310aeed7a.png
new file mode 100644
index 00000000..e821e243
Binary files /dev/null and b/public/assets/MMCCicon_realtime_blue-7d74516f638c995156bffae310aeed7a.png differ
diff --git a/public/assets/MMCCicon_realtime_blue.png b/public/assets/MMCCicon_realtime_blue.png
new file mode 100644
index 00000000..e821e243
Binary files /dev/null and b/public/assets/MMCCicon_realtime_blue.png differ
diff --git a/public/assets/application-6c43f7a71ebd80496a8f18f5b1789324.js b/public/assets/application-6c43f7a71ebd80496a8f18f5b1789324.js
deleted file mode 100644
index 63a43ddb..00000000
--- a/public/assets/application-6c43f7a71ebd80496a8f18f5b1789324.js
+++ /dev/null
@@ -1,36 +0,0 @@
-/*!
- * jQuery JavaScript Library v1.8.1
- * http://jquery.com/
- *
- * Includes Sizzle.js
- * http://sizzlejs.com/
- *
- * Copyright 2012 jQuery Foundation and other contributors
- * Released under the MIT license
- * http://jquery.org/license
- *
- * Date: Thu Aug 30 2012 17:17:22 GMT-0400 (Eastern Daylight Time)
- */
-function BestInPlaceEditor(e){this.element=e,this.initOptions(),this.bindForm(),this.initNil(),jQuery(this.activator).bind("click",{editor:this},this.clickHandler)}function switchVisible(e,t){categoryVisible[e]==1?hideCategory(e,t):categoryVisible[e]==0&&showCategory(e,t)}function hideCategory(e,t){t==null&&(t=500),Mconsole.graph.eachNode(function(t){t.getData("metacode")==e&&(t.setData("alpha",.4,"end"),t.eachAdjacency(function(e){e.setData("alpha",.4,"end")}))}),Mconsole.fx.animate({modes:["node-property:alpha","edge-property:alpha"],duration:t})}function showCategory(e,t){t==null&&(t=500),Mconsole.graph.eachNode(function(t){t.getData("metacode")==e&&(t.setData("alpha",1,"end"),t.eachAdjacency(function(e){e.setData("alpha",1,"end")}))}),Mconsole.fx.animate({modes:["node-property:alpha","edge-property:alpha"],duration:t})}function hideAll(e){e==null&&(e=500),Mconsole.graph.eachNode(function(e){e.setData("alpha",.4,"end"),e.eachAdjacency(function(e){e.setData("alpha",.2,"end")})}),Mconsole.fx.animate({modes:["node-property:alpha","edge-property:alpha"],duration:e})}function showAll(e){e==null&&(e=500),Mconsole.graph.eachNode(function(e){e.setData("alpha",1,"end"),e.eachAdjacency(function(e){e.setData("alpha",.4,"end")})}),Mconsole.fx.animate({modes:["node-property:alpha","edge-property:alpha"],duration:e})}function filterTopicsByMap(e){Mconsole.graph.eachNode(function(t){t.getData("inmaps").indexOf(parseInt(e))!==-1?t.setData("alpha",1,"end"):t.setData("alpha",.4,"end"),Mconsole.fx.animate({modes:["node-property:alpha","edge-property:alpha"],duration:500})})}function filterTopicsByMapper(e){Mconsole.graph.eachNode(function(t){t.getData("userid").toString()==e?t.setData("alpha",1,"end"):t.setData("alpha",.4,"end"),Mconsole.fx.animate({modes:["node-property:alpha","edge-property:alpha"],duration:500})})}function filterTopicsByName(e){Mconsole.graph.eachNode(function(t){nodeName=t.name.toLowerCase(),nodeName.indexOf(e)!==-1&&e!=""?t.setData("alpha",1,"end"):t.setData("alpha",.4,"end"),Mconsole.fx.animate({modes:["node-property:alpha","edge-property:alpha"],duration:500})})}function clearCanvas(){Mconsole.graph.eachNode(function(e){Mconsole.graph.removeNode(e.id)}),Mconsole.plot()}function clearCanvasExceptRoot(){var e=new Array;Mconsole.graph.eachNode(function(t){e.push(t.id)});var t=Mconsole.graph.nodes[Mconsole.root];e.forEach(function(e,n){e!=t.id&&Mconsole.graph.removeNode(e)}),fetchRelatives(t)}function selectEdgeOnClickHandler(e,t){if(Mconsole.busy)return;if(synapseWasDoubleClicked()){synapseDoubleClickHandler(e,t);return}var n=MetamapsModel.selectedEdges.indexOf(e);n==-1?n=!1:n!=-1&&(n=!0),n&&t.shiftKey?deselectEdge(e):!n&&t.shiftKey?selectEdge(e):n&&!t.shiftKey?deselectAllEdges():!n&&!t.shiftKey&&(deselectAllEdges(),selectEdge(e)),Mconsole.plot()}function synapseDoubleClickHandler(e,t){editEdge(e,t)}function synapseWasDoubleClicked(){var e=MetamapsModel.lastSynapseClick,t=Date.now();return MetamapsModel.lastSynapseClick=t,t-e
Delete'),mapid&&userid!=null&&(r+='Remove from Map'),r+='Hide until refresh',mapid||(r+='Center This Topic'),r+='Open In New Tab',r+="",n.innerHTML=r,$(n).css({left:t.clientX,top:t.clientY}),$("#center-container").append(n),$(".rc-delete").click(function(){$(".rightclickmenu").remove();var e=MetamapsModel.selectedNodes.length,t=MetamapsModel.selectedEdges.length,n=e==1?"1 topic":e+" topics",r=t==1?"1 synapse":t+" synapses",i="You have "+n+" and "+r+" selected. ",s=confirm(i+"Are you sure you want to permanently delete them all? This will remove them from all maps they appear on.");s==1&&(deleteSelectedEdges(),deleteSelectedNodes())}),$(".rc-remove").click(function(){$(".rightclickmenu").remove(),hideSelectedEdges(),hideSelectedNodes()}),$(".rc-hide").click(function(){$(".rightclickmenu").remove(),hideSelectedEdges(),hideSelectedNodes()}),$(".rc-center").click(function(){$(".rightclickmenu").remove(),centerOn(e.id)}),$(".rc-popout").click(function(){$(".rightclickmenu").remove();var t=window.open("/topics/"+e.id,"_blank");t.focus()})}function canvasDoubleClickHandler(e,t){var n=MetamapsModel.lastCanvasClick,r=Date.now();MetamapsModel.lastCanvasClick=r,r-n=Mconsole.canvas.scaleOffsetX*d&&Mconsole.canvas.scaleOffsetX*d>=1&&Mconsole.canvas.scale(d,d),Mconsole.canvas.scaleOffsetX<.5?Mconsole.canvas.viz.labels.hideLabels(!0):Mconsole.canvas.scaleOffsetX>.5&&Mconsole.canvas.viz.labels.hideLabels(!1),lastDist=p}}function graphSettings(e,t){var n={injectInto:"infovis",Navigation:{enable:!0,panning:"avoid nodes",zooming:28},Node:{overridable:!0,color:"#2D6A5D",type:"customNode",dim:25},Edge:{overridable:!0,color:"#222222",type:"customEdge",lineWidth:2,alpha:.4},Label:{type:"Native",size:20,family:"arial",textBaseline:"hanging",color:"#DDD"},Tips:{enable:!1,onShow:function(e,t){}},Events:{enable:!0,enableForEdges:!0,onMouseMove:function(e,t,n){onMouseMoveHandler(e,t,n)},onDragMove:function(e,t,n){onDragMoveTopicHandler(e,t,n)},onDragEnd:function(e,t,n){onDragEndTopicHandler(e,t,n,!1)},onDragCancel:function(e,t,n){onDragCancelHandler(e,t,n,!1)},onTouchStart:function(e,t,n){Mconsole.events.touched=!0,touchPos=t.getPos();var r=Mconsole.canvas,i=r.translateOffsetX;oy=r.translateOffsetY,sx=r.scaleOffsetX,sy=r.scaleOffsetY,touchPos.x*=sx,touchPos.y*=sy,touchPos.x+=i,touchPos.y+=oy,touchDragNode=e},onTouchMove:function(e,t,n){touchDragNode?onDragMoveTopicHandler(touchDragNode,t,n):(touchPanZoomHandler(t,n),Mconsole.labels.hideLabel(Mconsole.graph.getNode(MetamapsModel.showcardInUse)))},onTouchEnd:function(e,t,n){},onTouchCancel:function(e,t,n){},onClick:function(e,t,n){if(MetamapsModel.boxStartCoordinates){Mconsole.busy=!1,MetamapsModel.boxEndCoordinates=t.getPos(),selectNodesWithBox();return}if(n.target.id!="infovis-canvas")return!1;e.nodeFrom?selectEdgeOnClickHandler(e,n):e&&!e.nodeFrom?selectNodeOnClickHandler(e,n):(MetamapsModel.didPan||hideCards(),canvasDoubleClickHandler(t.getPos(),n))},onRightClick:function(e,t,n){n.preventDefault(),n.stopPropagation(),e&&!e.nodeFrom?selectNodeOnRightClickHandler(e,n):e&&e.nodeFrom}},iterations:200,levelDistance:200};return t&&(n.Edge.type="customEdgeEmbed"),e=="centered"&&(n.background={CanvasStyles:{strokeStyle:"#333",lineWidth:1.5}},n.levelDistance=400,n.Events.enableForEdges=!0,n.Events.onDragEnd=function(e,t,n){onDragEndTopicHandler(e,t,n,!1)},n.Events.onDragCancel=function(e,t,n){onDragCancelHandler(e,t,n,!0)}),n}function hideCards(){$("#edit_synapse").hide(),MetamapsModel.edgecardInUse=null,hideCurrentCard(),$(".rightclickmenu").remove()}function drawSelectBox(e,t){Mconsole.plot();var n=Mconsole.canvas.getCtx(),r=MetamapsModel.boxStartCoordinates.x,i=MetamapsModel.boxStartCoordinates.y,s=e.getPos().x,o=e.getPos().y;Mconsole.plot(),n.beginPath(),n.moveTo(r,i),n.lineTo(r,o),n.lineTo(s,o),n.lineTo(s,i),n.lineTo(r,i),n.strokeStyle="black",n.stroke()}function selectNodesWithBox(){var e=MetamapsModel.boxStartCoordinates.x,t=MetamapsModel.boxStartCoordinates.y,n=MetamapsModel.boxEndCoordinates.x,r=MetamapsModel.boxEndCoordinates.y;Mconsole.graph.eachNode(function(i){var s=gType=="centered"?i.pos.toComplex().x:i.pos.x,o=gType=="centered"?i.pos.toComplex().y:i.pos.y;if(es&&s>n&&t>o&&o>r||e>s&&s>n&&to&&o>r){var u=MetamapsModel.selectedNodes.indexOf(i);u==-1?selectNode(i):u!=-1&&deselectNode(i)}}),MetamapsModel.boxStartCoordinates=!1,MetamapsModel.boxEndCoordinates=!1,Mconsole.plot()}function onMouseMoveHandler(e,t,n){if(Mconsole.busy)return;var e=t.getNode(),r=t.getEdge();if(e!=0){MetamapsModel.edgeHoveringOver&&onMouseLeave(MetamapsModel.edgeHoveringOver);return}r==0&&MetamapsModel.edgeHoveringOver!=0?onMouseLeave(MetamapsModel.edgeHoveringOver):r!=0&&MetamapsModel.edgeHoveringOver==0?onMouseEnter(r):r!=0&&MetamapsModel.edgeHoveringOver!=r&&(onMouseLeave(MetamapsModel.edgeHoveringOver),onMouseEnter(r)),MetamapsModel.edgeHoveringOver=r}function onMouseEnter(e){$("canvas").css("cursor","pointer");var t=MetamapsModel.selectedEdges.indexOf(e);t==-1&&(e.setData("showDesc",!0,"current"),e.setDataset("end",{lineWidth:4,alpha:1}),Mconsole.fx.animate({modes:["edge-property:lineWidth:color:alpha"],duration:100}),Mconsole.plot())}function onMouseLeave(e){$("canvas").css("cursor","default");var t=MetamapsModel.selectedEdges.indexOf(e);t==-1&&(e.setData("showDesc",!1,"current"),e.setDataset("end",{lineWidth:2,alpha:.4}),Mconsole.fx.animate({modes:["edge-property:lineWidth:color:alpha"],duration:100})),Mconsole.plot()}function onDragEndTopicHandler(e,t,n,r){if(tempInit&&tempNode2==null)$("#topic_addSynapse").val("true"),$("#new_topic").fadeIn("fast"),$("#topic_name").focus();else if(tempInit&&tempNode2!=null)$("#topic_addSynapse").val("false"),$("#synapse_topic1id").val(tempNode.id),$("#synapse_topic2id").val(tempNode2.id),$("#new_synapse").fadeIn("fast"),$("#synapse_desc").focus(),tempNode=null,tempNode2=null,tempInit=!1;else if(dragged&&dragged!=0&&goRealtime){saveLayout(dragged);for(var i=0;i $_name_$ $_map_count_$
$_synapse_count_$
$_a_tag_$$_link_$$_close_a_tag_$ $_go_link_$
"):(r="",i=""));var s=new Array;for(var o in imgArray)imgArray.hasOwnProperty(o)&&o!=t.getData("metacode")&&s.push(o);s.sort(),s.unshift(t.getData("metacode"));var u="'[";for(var a in s)u+='["'+s[a]+'","'+s[a]+'"],';u=u.slice(0,-1),u+="]'";var f="
",c="";userid==t.getData("userid")&&(c='
');var h=["commons","public","private"],p="'[";for(var a in h)p+='["'+h[a]+'","'+h[a]+'"],';return p=p.slice(0,-1),p+="]'",c=c.replace(/\$_permission_choices_\$/g,p),e=e.replace(/\$_edit_permission_\$/g,c),e=e.replace(/\$_permission_\$/g,t.getData("permission")),e=e.replace(/\$_mk_permission_\$/g,mk_permission(t)),e=e.replace(/\$_map_count_\$/g,t.getData("inmaps").length),e=e.replace(/\$_synapse_count_\$/g,t.getData("synapseCount")),e=e.replace(/\$_id_\$/g,t.id),e=e.replace(/\$_metacode_\$/g,t.getData("metacode")),e=e.replace(/\$_imgsrc_\$/g,imgArray[t.getData("metacode")].src),e=e.replace(/\$_name_\$/g,t.name),e=e.replace(/\$_userid_\$/g,t.getData("userid")),e=e.replace(/\$_username_\$/g,t.getData("username")),e=e.replace(/\$_metacode_choices_\$/g,u),e=e.replace(/\$_go_link_\$/g,n),e=e.replace(/\$_a_tag_\$/g,r),e=e.replace(/\$_close_a_tag_\$/g,i),e=e.replace(/\$_link_nil_\$/g,l),t.getData("link")==""&&authorizeToEdit(t)?e=e.replace(/\$_link_\$/g,l):e=e.replace(/\$_link_\$/g,t.getData("link")),e=e.replace(/\$_desc_nil_\$/g,f),t.getData("desc")==""&&authorizeToEdit(t)?e=e.replace(/\$_desc_\$/g,f):e=e.replace(/\$_desc_\$/g,t.getData("desc")),e}function hideCurrentCard(){if(MetamapsModel.showcardInUse){var e=Mconsole.graph.getNode(MetamapsModel.showcardInUse);hideCard(e)}}function hideCard(e){var t=".showcard";$(t).fadeOut("fast",function(){Mconsole.plot()}),MetamapsModel.showcardInUse=null}function populateShowCard(e){var t=document.getElementById("showcard");$(t).find(".permission").remove();var n=generateShowcardHTML();n=replaceVariables(n,e);if(authorizeToEdit(e)){var r=document.createElement("div");r.className="permission canEdit",r.innerHTML=n,t.appendChild(r)}else{var r=document.createElement("div");r.className="permission cannotEdit",r.innerHTML=n,t.appendChild(r)}$(".showcard .metacodeImage").hover(function(){$(".showcard .icon").css("z-index","3"),$(".showcard .metacodeTitle").show()},function(){$(".showcard .metacodeTitle").hide(),$(".showcard .icon").css("z-index","1")}),$(t).find(".best_in_place_metacode").bind("ajax:success",function(){var n=$(this).html();$(t).find("img.icon").attr("alt",n),$(t).find("img.icon").attr("src",imgArray[n].src),e.setData("metacode",n),Mconsole.plot()}),$(t).find(".best_in_place_name").bind("ajax:success",function(){var t=$(this).html();e.name=t}),$(t).find(".best_in_place_desc").bind("ajax:success",function(){this.innerHTML=this.innerHTML.replace(/\r/g,""),$(t).find(".scroll").mCustomScrollbar("update");var n=$(this).html();e.setData("desc",n)}),$(t).find(".best_in_place_link").bind("ajax:success",function(){var n=$(this).html();$(t).find(".go-link").attr("href",n),e.setData("link",n)}),$(t).find(".permActivator").bind("mouseover",function(){clearTimeout(MetamapsModel.topicPermTimer2),that=this,MetamapsModel.topicPermTimer1=setTimeout(function(){MetamapsModel.topicPermSliding||(MetamapsModel.topicPermSliding=!0,$(that).animate({width:"203px",height:"37px"},300,function(){MetamapsModel.topicPermSliding=!1}))},300)}),$(t).find(".permActivator").bind("mouseout",function(){clearTimeout(MetamapsModel.topicPermTimer1),that=this,MetamapsModel.topicPermTimer2=setTimeout(function(){MetamapsModel.topicPermSliding||(MetamapsModel.topicPermSliding=!0,$(that).animate({height:"16px",width:"16px"},300,function(){MetamapsModel.topicPermSliding=!1}))},800)}),$(t).find(".best_in_place_permission").bind("ajax:success",function(){var t=$(this).html(),n=$(this).parents(".cardSettings").find(".mapPerm");n.attr("title",t),t=="commons"?n.html("co"):t=="public"?n.html("pu"):t=="private"&&n.html("pr"),e.setData("permission",t)}),$(".showcard").find(".scroll").mCustomScrollbar()}function authorizeToEdit(e){return!userid||e.data.$permission!="commons"&&e.data.$userid!=userid?!1:!0}function mk_permission(e){if(e.getData("permission")=="commons")return"co";if(e.getData("permission")=="public")return"pu";if(e.getData("permission")=="private")return"pr"}function centerOn(e){if(!Mconsole.busy){var t=Mconsole.graph.getNode(e);$("div.index img").attr("src",imgArray[t.getData("metacode")].src),$("div.index .mapName").html(t.name),$(document).attr("title",t.name+" | Metamaps"),window.history.pushState(t.name,"Metamaps","/topics/"+t.id),Mconsole.onClick(t.id,{hideLabels:!1,duration:1e3,onComplete:function(){fetchRelatives(t)}})}}function editEdge(e,t){if(authorizeToEdit(e)){var n=$("#edit_synapse").css("left"),r=$("#edit_synapse").css("top");$("#edit_synapse").remove(),deselectEdge(e);var i=document.createElement("div");i.setAttribute("id","edit_synapse"),i.className="permission canEdit",$(".main .wrapper").append(i),populateEditEdgeForm(e),$("#edit_synapse").css("position","absolute"),t?($("#edit_synapse").css("left",t.clientX),$("#edit_synapse").css("top",t.clientY)):($("#edit_synapse").css("left",n),$("#edit_synapse").css("top",r)),$("#edit_synapse").show(),MetamapsModel.edgecardInUse=e.data.$id}else!authorizeToEdit(e)&&userid&&alert("You don't have the permissions to edit this synapse.")}function populateEditEdgeForm(e){add_perms_form(e),add_direction_form(e),add_name_form(e)}function add_name_form(e){var t='
'),$("#edit_synapse_name").attr("class","best_in_place best_in_place_desc"),$("#edit_synapse_name").attr("data-object","synapse"),$("#edit_synapse_name").attr("data-attribute","desc"),$("#edit_synapse_name").attr("data-type","input"),$("#edit_synapse_name").attr("data-nil",t),$("#edit_synapse_name").attr("data-url","/synapses/"+e.getData("id")),$("#edit_synapse_name").html(e.getData("desc")),$("#edit_synapse_name").html().trim()==""&&$("#edit_synapse_name").html(t),$("#edit_synapse_name").bind("ajax:success",function(){var n=$(this).html();n==t?e.setData("desc",""):e.setData("desc",n),selectEdge(e),Mconsole.plot()})}function add_perms_form(e){$("#edit_synapse").append('
'),$("#edit_synapse .mapPerm").html(mk_permission(e)),userid==e.getData("userid")&&($("#edit_synapse").append('
'),$("#edit_synapse .click-to-edit").attr("title","Click to Edit"),$("#edit_synapse .click-to-edit").append(best_in_place_perms(e)),$("#edit_synapse .editSettings").append('
'),$("#edit_synapse").find(".best_in_place_permission").bind("ajax:success",function(){var e=$(this).html();switch(e){case"commons":$("#edit_synapse .mapPerm").html("co");break;case"public":$("#edit_synapse .mapPerm").html("pu");break;case"private":$("#edit_synapse .mapPerm").html("pr")}}),$("#edit_synapse .permActivator").bind("mouseover",function(){clearTimeout(MetamapsModel.edgePermTimer2),that=this,MetamapsModel.edgePermTimer1=setTimeout(function(){MetamapsModel.edgePermSliding||(MetamapsModel.edgePermSliding=!0,$(that).animate({width:"203px",height:"37px"},300,function(){MetamapsModel.edgePermSliding=!1}))},300)}),$("#edit_synapse .permActivator").bind("mouseout",function(){clearTimeout(MetamapsModel.edgePermTimer1),that=this,MetamapsModel.edgePermTimer2=setTimeout(function(){MetamapsModel.edgePermSliding||(MetamapsModel.edgePermSliding=!0,$(that).animate({height:"16px",width:"16px"},300,function(){MetamapsModel.edgePermSliding=!1}))},800)}))}function add_direction_form(e){$("#edit_synapse").append('