-
Notifications
You must be signed in to change notification settings - Fork 0
/
DataScanner.js
62 lines (57 loc) · 1.88 KB
/
DataScanner.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
function scanDataFolder(){
$.ajax({
type: 'GET',
url: 'php/DirScan_main.php',
//data: "type="+type+"&query="+jsonparams,
//contentType: "application/json",
//dataType: 'json',
success : function(data){
console.log(data);
dataFolderTree=data;
},
error: function(){
console.log('Page Not found: updateLeftPanel_uni()');
}
});
}
function getGexfPath(v){
gexfpath=(gexfDictReverse[v])?gexfDictReverse[v]:v;
return gexfpath;
}
function getGexfLegend(gexfPath){
legend=(gexfDict[gexfPath])?gexfDict[gexfPath]:gexfPath;
return legend;
}
function jsActionOnGexfSelector(gexfLegend){
window.location=window.location.origin+window.location.pathname+"?file="+encodeURIComponent(getGexfPath(gexfLegend));
}
function listGexfs(){
divlen=$("#gexfs").length;
if(divlen>0) {
param = JSON.stringify(gexfDict);
$.ajax({
type: 'GET',
url: 'php/listFiles.php',
//contentType: "application/json",
//dataType: 'json',
success : function(data){
html="<select style='width:150px;' ";
javs='onchange="'+'jsActionOnGexfSelector(this.value);'+'"';
html+=javs;
html+=">";
html+='<option selected>[More Graphs]</option>';
for(var i in data){
//pr("path: "+data[i]);
//pr("legend: "+getGexfLegend(data[i]));
//pr("");
html+="<option>"+getGexfLegend(data[i])+"</option>";
}
html+="</select>";
$("#gexfs").html(html);
},
error: function(){
console.log("Page Not found.");
}
});
}
}