This commit did three things:

1) Make Seek case insensitive for topic name search
2) Changed indentation in find.js
3) Removed some commented code in onCanvasSearch - if you want to recover it, it's in this commit
This commit is contained in:
Devin Howard 2013-02-21 19:59:59 -05:00
parent e594660804
commit 3e4368c0f4

View file

@ -75,20 +75,12 @@ function showCategory(category, duration) {
}); });
} }
// Define the Find/Filters possibilities // Define the Find/Filters possibilities
var findTopics = ['name','metacode', 'mapper (by name)', 'map (by name)'] var findTopics = ['name','metacode', 'mapper (by name)', 'map (by name)']
var findSynapses = ['topics (by name)', 'directionality', 'mapper (by name)', 'map (by name)'] var findSynapses = ['topics (by name)', 'directionality', 'mapper (by name)', 'map (by name)']
var findMaps = ['name', 'topic (by name)', 'mapper (by name)', 'synapse (by topics)'] var findMaps = ['name', 'topic (by name)', 'mapper (by name)', 'synapse (by topics)']
var findMappers = ['name', 'topic (by name)', 'map (by name)', 'synapse (by topics)'] var findMappers = ['name', 'topic (by name)', 'map (by name)', 'synapse (by topics)']
// These functions toggle ALL nodes and synapses on the page // These functions toggle ALL nodes and synapses on the page
function hideAll(duration) { function hideAll(duration) {
if (duration == null) duration = 500; if (duration == null) duration = 500;
@ -121,47 +113,38 @@ function showAll(duration) {
}); });
} }
/// Traverse the Graph and only show the searched for nodes /// Traverse the Graph and only show the searched for nodes
function onCanvasSearch(searchQuery, mapID, mapperID) {
function onCanvasSearch(name,mapID,mapperID) { searchQuery = name.toLowerCase();
Mconsole.graph.eachNode(function (n) {
Mconsole.graph.eachNode( function (n) { nodeName = n.name.toLowerCase();
if (name != null) { if (name != null) {
if (n.name.indexOf(name) !== -1 && name != "") { if (nodeName.indexOf(searchQuery) !== -1 && searchQuery != "") {
n.setData('onCanvas', true); n.setData('onCanvas', true);
//$('.name.topic_' + n.id).css('display','block'); }
} else {
else { n.setData('onCanvas', false);
n.setData('onCanvas', false); }
//$('.name.topic_' + n.id).css('display','none'); }
} else if (mapID != null) {
} if (n.getData('inmaps').indexOf(parseInt(mapID)) !== -1) {
else if (mapID != null) { n.setData('onCanvas', true);
if (n.getData('inmaps').indexOf(parseInt(mapID)) !== -1) { }
n.setData('onCanvas', true); else {
//$('.name.topic_' + n.id).css('display','block'); n.setData('onCanvas', false);
} }
else { }
n.setData('onCanvas', false); else if (mapperID != null) {
//$('.name.topic_' + n.id).css('display','none'); if (n.getData('userid').toString() == mapperID) {
} n.setData('onCanvas', true);
} }
else if (mapperID != null) { else {
if (n.getData('userid').toString() == mapperID) { n.setData('onCanvas', false);
n.setData('onCanvas', true); }
//$('.name.topic_' + n.id).css('display','block'); }
} Mconsole.plot();
else { });
n.setData('onCanvas', false); }//onCanvasSearch
//$('.name.topic_' + n.id).css('display','none');
}
}
Mconsole.plot();
});
}
function clearCanvas() { function clearCanvas() {
Mconsole.graph.eachNode(function(n) { Mconsole.graph.eachNode(function(n) {
@ -201,13 +184,11 @@ function clearFoundData() {
//// /**
//// * Define all the dynamic interactions for the FIND/FILTER using Jquery
//// */
//// Define all the dynamic interactions for the FIND/FILTER using Jquery
$(document).ready(function() { $(document).ready(function() {
// this sets up the initial opening of the find box // this sets up the initial opening of the find box
$('#sideOptionFind').bind('click',function(){ $('#sideOptionFind').bind('click',function(){
if (!findOpen) openFind(); if (!findOpen) openFind();