Commit 1933f1a6 authored by PkSM3's avatar PkSM3

bugfix in specific-mouse-behaviour

parent c525a003
...@@ -73,13 +73,13 @@ function clickInCountry( CC ) { ...@@ -73,13 +73,13 @@ function clickInCountry( CC ) {
$.doTimeout(20,function (){ $.doTimeout(20,function (){
if(swclickActual=="social") { if(swclickActual=="social") {
MultipleSelection(results); MultipleSelection(results , false); //false-> dont apply deselection algorithm
return; return;
} }
if(swclickActual=="semantic") { if(swclickActual=="semantic") {
var oposresults = getNeighs2( results , bipartiteD2N ); var oposresults = getNeighs2( results , bipartiteD2N );
MultipleSelection(oposresults); MultipleSelection(oposresults , false);
return; return;
} }
......
...@@ -583,11 +583,10 @@ function search(string) { ...@@ -583,11 +583,10 @@ function search(string) {
coincd.push(results[i].id) coincd.push(results[i].id)
} }
$.doTimeout(30,function (){ $.doTimeout(30,function (){
MultipleSelection(coincd); MultipleSelection(coincd , true);
$("input#searchinput").val(""); $("input#searchinput").val("");
$("input#searchinput").autocomplete( "close" ); $("input#searchinput").autocomplete( "close" );
}); });
} }
//============================ < / SEARCH > ============================// //============================ < / SEARCH > ============================//
...@@ -342,7 +342,7 @@ function theListeners(){ ...@@ -342,7 +342,7 @@ function theListeners(){
coincidences.push(matches[j].id) coincidences.push(matches[j].id)
} }
$.doTimeout(30,function (){ $.doTimeout(30,function (){
MultipleSelection(coincidences); MultipleSelection(coincidences , true);//true-> apply deselection algorithm
$("input#searchinput").val(""); $("input#searchinput").val("");
$("input#searchinput").autocomplete( "close" ); $("input#searchinput").autocomplete( "close" );
}); });
...@@ -357,7 +357,7 @@ function theListeners(){ ...@@ -357,7 +357,7 @@ function theListeners(){
var exfnd = exactfind( $("#searchinput").val() ) var exfnd = exactfind( $("#searchinput").val() )
$.doTimeout(30,function (){ $.doTimeout(30,function (){
MultipleSelection(exfnd.id); MultipleSelection(exfnd.id , true);//true-> apply deselection algorithm
$("input#searchinput").val(""); $("input#searchinput").val("");
$("input#searchinput").autocomplete( "close" ); $("input#searchinput").autocomplete( "close" );
}); });
...@@ -494,10 +494,12 @@ function theListeners(){ ...@@ -494,10 +494,12 @@ function theListeners(){
} }
cancelSelection(false); cancelSelection(false);
cpCountTypes = Object.keys(countTypes); cpCountTypes = Object.keys(countTypes);
if(cpCountTypes.length==1) MultipleSelection(Object.keys(dummyarray)); if(cpCountTypes.length==1)
else MultipleSelection(actualSel); MultipleSelection(Object.keys(dummyarray) , true);//true-> apply deselection algorithm
else
MultipleSelection(actualSel , true);//true-> apply deselection algorithm
} else MultipleSelection(actualSel); } else MultipleSelection(actualSel , true);//true-> apply deselection algorithm
// //The most brilliant way of knowing if an array is empty in the world of JavaScript // //The most brilliant way of knowing if an array is empty in the world of JavaScript
i=0; for(var s in actualSel) { i++; break;} i=0; for(var s in actualSel) { i++; break;}
......
...@@ -504,7 +504,7 @@ function graphTagCloudElem(nodes) { ...@@ -504,7 +504,7 @@ function graphTagCloudElem(nodes) {
RefreshState(vars[1]); RefreshState(vars[1]);
swMacro=false; swMacro=false;
MultipleSelection(ndsids); MultipleSelection(ndsids , false);//false-> dont apply deselection algorithm
$.doTimeout(10,function (){ $.doTimeout(10,function (){
fa2enabled=true; partialGraph.startForceAtlas2(); fa2enabled=true; partialGraph.startForceAtlas2();
...@@ -1034,7 +1034,7 @@ function DrawAsSelectedNodes( nodeskeys ) { ...@@ -1034,7 +1034,7 @@ function DrawAsSelectedNodes( nodeskeys ) {
overNodes=true; overNodes=true;
} }
function MultipleSelection(nodes){ function MultipleSelection(nodes , desalg){
pr("IN MULTIPLE SELECTION: checkbox="+checkBox) pr("IN MULTIPLE SELECTION: checkbox="+checkBox)
...@@ -1050,32 +1050,35 @@ function MultipleSelection(nodes){ ...@@ -1050,32 +1050,35 @@ function MultipleSelection(nodes){
if(!checkBox) { if(!checkBox) {
checkBox=true; checkBox=true;
printStates();
if(PAST=="--") { pr("prevsels:")
pr("faire rien") pr(Object.keys(prevsels))
} else { pr("ndsids:")
if(!is_empty(prevsels) && PAST==NOW ) { pr(ndsids)
var blacklist = {};
for(var i in ndsids) { if (desalg && !is_empty(prevsels) ) {
ID = ndsids[i]; pr("DOING THE WEIRD ALGORITHM")
if ( prevsels[ID] ) { var blacklist = {};
delete prevsels[ID]; for(var i in ndsids) {
blacklist[ID] = true; ID = ndsids[i];
} if ( prevsels[ID] ) {
delete prevsels[ID];
blacklist[ID] = true;
} }
}
if(Object.keys(blacklist).length>0) { if(Object.keys(blacklist).length>0) {
tmparr = Object.keys(prevsels); tmparr = Object.keys(prevsels);
for (var i in ndsids) { for (var i in ndsids) {
ID = ndsids[i]; ID = ndsids[i];
if(isUndef(blacklist[ID])) { if(isUndef(blacklist[ID])) {
tmparr.push(ID) tmparr.push(ID)
}
} }
ndsids = tmparr;
} }
ndsids = tmparr;
} }
} } else pr("CASE NOT COVERED")
if (ndsids.length>0) { if (ndsids.length>0) {
for(var i in ndsids) { for(var i in ndsids) {
...@@ -1156,7 +1159,7 @@ function hoverNodeEffectWhileFA2(selectionRadius) { ...@@ -1156,7 +1159,7 @@ function hoverNodeEffectWhileFA2(selectionRadius) {
if(cursor_size==0 && !checkBox){ if(cursor_size==0 && !checkBox){
//Normal click on a node //Normal click on a node
$.doTimeout(30,function (){ $.doTimeout(30,function (){
MultipleSelection(nodeID); MultipleSelection(nodeID , true);//true-> apply deselection algorithm
}); });
} }
...@@ -1164,7 +1167,7 @@ function hoverNodeEffectWhileFA2(selectionRadius) { ...@@ -1164,7 +1167,7 @@ function hoverNodeEffectWhileFA2(selectionRadius) {
//Normal click on a node, but we won't clean the previous selections //Normal click on a node, but we won't clean the previous selections
selections[nodeID] = 1; selections[nodeID] = 1;
$.doTimeout(30,function (){ $.doTimeout(30,function (){
MultipleSelection( Object.keys(selections) ); MultipleSelection( Object.keys(selections) , true );//true-> apply deselection algorithm
}); });
} }
} }
...@@ -1695,9 +1698,7 @@ function changeToMeso(iwannagraph) { ...@@ -1695,9 +1698,7 @@ function changeToMeso(iwannagraph) {
fa2enabled=true; partialGraph.startForceAtlas2(); fa2enabled=true; partialGraph.startForceAtlas2();
pr("inside multipleselection:") MultipleSelection(Object.keys(selections) , false);//false-> dont apply deselection algorithm
printStates();
MultipleSelection(Object.keys(selections));
$('.gradient').css({"background-size":"90px 90px"}); $('.gradient').css({"background-size":"90px 90px"});
} }
...@@ -1741,7 +1742,7 @@ function changeToMacro(iwannagraph) { ...@@ -1741,7 +1742,7 @@ function changeToMacro(iwannagraph) {
if (!is_empty(selections)) if (!is_empty(selections))
$.doTimeout(10,function (){ $.doTimeout(10,function (){
chosenones=(PAST=="a"||PAST=="b")?selections:opossites; chosenones=(PAST=="a"||PAST=="b")?selections:opossites;
MultipleSelection(Object.keys(chosenones)) MultipleSelection(Object.keys(chosenones) , false)//false-> dont apply deselection algorithm
}); });
} else { } else {
...@@ -1775,7 +1776,7 @@ function changeToMacro(iwannagraph) { ...@@ -1775,7 +1776,7 @@ function changeToMacro(iwannagraph) {
} }
if (!is_empty(selections)) if (!is_empty(selections))
MultipleSelection(Object.keys(selections)); MultipleSelection(Object.keys(selections) , false);//false-> dont apply deselection algorithm
} }
$.doTimeout(30,function (){ $.doTimeout(30,function (){
......
...@@ -31,7 +31,7 @@ function test2 { ...@@ -31,7 +31,7 @@ function test2 {
for f in $iter for f in $iter
do do
filename=`echo $f | sed s/"\.\/"//g` filename=`echo $f | sed s/"\.\/"//g`
variable=`cat $filename | grep "fa2enabled"` variable=`cat $filename | grep "MultipleSelection"`
if [[ "$variable" != "" ]] if [[ "$variable" != "" ]]
then then
echo $filename echo $filename
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment