From 1ea2317ab4e47dd4b2e87a7f462262d231cef489 Mon Sep 17 00:00:00 2001 From: Devin Howard Date: Thu, 14 Feb 2013 22:36:08 -0500 Subject: [PATCH 1/3] nicer formatting on savelayout in maps_controller.rb --- app/controllers/maps_controller.rb | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/app/controllers/maps_controller.rb b/app/controllers/maps_controller.rb index cdd9fba4..f6e8fb83 100644 --- a/app/controllers/maps_controller.rb +++ b/app/controllers/maps_controller.rb @@ -148,23 +148,23 @@ class MapsController < ApplicationController # PUT maps/:id/savelayout def savelayout - @map = Map.find(params[:id]) - - if params[:map][:coordinates] - @all = params[:map][:coordinates] - @all = @all.split(',') - @all.each do |topic| - topic = topic.split('/') - @mapping = Mapping.find(topic[0]) - if @mapping + @map = Map.find(params[:id]) + + if params[:map][:coordinates] + @all = params[:map][:coordinates] + @all = @all.split(',') + @all.each do |topic| + topic = topic.split('/') + @mapping = Mapping.find(topic[0]) + if @mapping @mapping.xloc = topic[1] - @mapping.yloc = topic[2] - @mapping.save + @mapping.yloc = topic[2] + @mapping.save end - end - @map.arranged = true - @map.save - end + end + @map.arranged = true + @map.save + end end # GET maps/:id/realtime From f1a7e040fbe7671c6be85d6590ed82195fcc1285 Mon Sep 17 00:00:00 2001 From: Devin Howard Date: Sat, 16 Feb 2013 17:32:50 -0500 Subject: [PATCH 2/3] fixed & error on synapse desc display --- app/assets/javascripts/Jit/graphsettings.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/app/assets/javascripts/Jit/graphsettings.js b/app/assets/javascripts/Jit/graphsettings.js index 8b3b4165..5d092906 100644 --- a/app/assets/javascripts/Jit/graphsettings.js +++ b/app/assets/javascripts/Jit/graphsettings.js @@ -300,6 +300,9 @@ var nodeSettings = { var desc = adj.getData("desc"); var showDesc = adj.getData("showDesc"); if( desc != "" && showDesc ) { + // '&' to '&' + desc = decodeEntities(desc); + //now adjust the label placement var ctx = canvas.getCtx(); var radius = canvas.getSize(); @@ -449,3 +452,14 @@ function onPlaceLabelHandler(domElement, node) { style = label.style; style.left = (-(w / 2 + 106)) + 'px'; } + +// thanks to http://stackoverflow.com/questions/4338963/ +// convert-html-character-entities-back-to-regular-text-using-javascript +function decodeEntities(desc) { + var str, temp = document.createElement('p'); + temp.innerHTML = desc; //browser handles the entities + str = temp.textContent || temp.innerText; + temp = null; //delete the element; + return str; +}//decodeEntities + From d289d77b5a55685d2fcbad6e98c089c8cdb42310 Mon Sep 17 00:00:00 2001 From: Devin Howard Date: Sat, 16 Feb 2013 17:52:38 -0500 Subject: [PATCH 3/3] added seek/analyse/organize tabs to topic view. Was that a good idea? Who knows. --- app/views/topics/show.html.erb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/views/topics/show.html.erb b/app/views/topics/show.html.erb index ced68f64..442dff01 100644 --- a/app/views/topics/show.html.erb +++ b/app/views/topics/show.html.erb @@ -41,6 +41,10 @@ }); +<%= render :partial => 'main/find' %> +<%= render :partial => 'main/analyze' %> +<%= render :partial => 'main/organize' %> + <% if authenticated? %> <%= render :partial => 'topics/new' %> <%= render :partial => 'synapses/new' %>