Commit dea861fe authored by Romain Loth's avatar Romain Loth

comex additions to tina2

parent 32d61e05
...@@ -661,7 +661,7 @@ var TinaWebJS = function ( sigmacanvas ) { ...@@ -661,7 +661,7 @@ var TinaWebJS = function ( sigmacanvas ) {
} }
}); });
if (TW.conf.getRelatedDocs) { if (TW.conf.getRelatedDocs && document.getElementById('reldocs-type')) {
document.getElementById('reldocs-type').value = TW.conf.relatedDocsType document.getElementById('reldocs-type').value = TW.conf.relatedDocsType
} }
......
...@@ -329,19 +329,19 @@ function htmlfied_nodesatts(elems){ ...@@ -329,19 +329,19 @@ function htmlfied_nodesatts(elems){
information += '<li><b>' + node.label + '</b></li>'; information += '<li><b>' + node.label + '</b></li>';
if(node.htmlCont==""){ if(node.htmlCont==""){
if (!isUndef(node.level)) { if (!isUndef(node.level)) {
information += '<li>' + node.level + '</li>'; information += '<li class="infosoc">' + node.level + '</li>';
} }
} else { } else {
information += '<li>' + $("<div/>").html(node.htmlCont).text() + '</li>'; information += '<li class="infosoc">' + $("<div/>").html(node.htmlCont).text() + '</li>';
} }
socnodes.push(information) socnodes.push(information)
} }
if(swActual(node.type) == 'semantic'){ if(swActual(node.type) == 'semantic'){
information += '<li><b>' + node.label + '</b></li>'; information += '<li><b>' + node.label + '</b></li>';
let google='<a href=http://www.google.com/#hl=en&source=hp&q=%20'+node.label.replace(" ","+")+'%20><img src="libs/img2/google.png"></img></a>'; let google='<a href=http://www.google.com/#hl=en&source=hp&q=%20'+node.label.replace(" ","+")+'%20><img src="static/img/google.png"></img></a>';
let wiki = '<a href=http://en.wikipedia.org/wiki/'+node.label.replace(" ","_")+'><img src="libs/img2/wikipedia.png"></img></a>'; let wiki = '<a href=http://en.wikipedia.org/wiki/'+node.label.replace(" ","_")+'><img src="static/img/wikipedia.png"></img></a>';
let flickr= '<a href=http://www.flickr.com/search/?w=all&q='+node.label.replace(" ","+")+'><img src="libs/img2/flickr.png"></img></a>'; let flickr= '<a href=http://www.flickr.com/search/?w=all&q='+node.label.replace(" ","+")+'><img src="static/img/flickr.png"></img></a>';
information += '<li>'+google+"&nbsp;"+wiki+"&nbsp;"+flickr+'</li><br>'; information += '<li>'+google+"&nbsp;"+wiki+"&nbsp;"+flickr+'</li><br>';
semnodes.push(information) semnodes.push(information)
} }
...@@ -431,7 +431,7 @@ function updateRelatedNodesPanel( sels , same, oppos ) { ...@@ -431,7 +431,7 @@ function updateRelatedNodesPanel( sels , same, oppos ) {
sameNodesDIV+= '</div>'; sameNodesDIV+= '</div>';
} }
informationDIV += '<br><h4>Information:</h4><ul>'; informationDIV += '<br><h4>Information:</h4><ul class="infoitems">';
informationDIV += htmlfied_nodesatts( sels ).join("<br>\n") informationDIV += htmlfied_nodesatts( sels ).join("<br>\n")
informationDIV += '</ul><br>'; informationDIV += '</ul><br>';
......
...@@ -6,7 +6,7 @@ TW.conf = (function(TW){ ...@@ -6,7 +6,7 @@ TW.conf = (function(TW){
let TWConf = {} let TWConf = {}
TWConf.branding = 'ProjectExplorer' // <--- the name displayed in upper left TWConf.branding = 'Community Explorer 2' // <--- the name displayed in upper left
// ========================== // ==========================
...@@ -33,7 +33,7 @@ TW.conf = (function(TW){ ...@@ -33,7 +33,7 @@ TW.conf = (function(TW){
// Related documents (topPapers) data source // Related documents (topPapers) data source
// ----------------------------------------- // -----------------------------------------
TWConf.getRelatedDocs = true TWConf.getRelatedDocs = false
TWConf.relatedDocsMax = 10 TWConf.relatedDocsMax = 10
TWConf.relatedDocsAPI = "http://127.0.0.1:5000/twitter_search" TWConf.relatedDocsAPI = "http://127.0.0.1:5000/twitter_search"
......
...@@ -1014,6 +1014,8 @@ function dictfyJSON( data , categories ) { ...@@ -1014,6 +1014,8 @@ function dictfyJSON( data , categories ) {
for(var nid in data.nodes) { for(var nid in data.nodes) {
let n = data.nodes[nid]; let n = data.nodes[nid];
console.log(">>", n)
let node = {} let node = {}
node.id = (n.id) ? n.id : nid ; // use the key if no id node.id = (n.id) ? n.id : nid ; // use the key if no id
...@@ -1028,6 +1030,11 @@ function dictfyJSON( data , categories ) { ...@@ -1028,6 +1030,11 @@ function dictfyJSON( data , categories ) {
else node.attributes = {} else node.attributes = {}
node.type = (n.type)? n.type : categories[0] ; node.type = (n.type)? n.type : categories[0] ;
// comex additions
node.htmlCont = n.content || '';
node.CC = n.CC || '';
node.ACR = n.ACR || '';
// £TODO REFA new sigma.js: shape is not attr but custom type linked to a renderer's name // £TODO REFA new sigma.js: shape is not attr but custom type linked to a renderer's name
// node.shape = "square"; // node.shape = "square";
......
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