From e7e749d9b971a10110011c83bf19afdbbe4f3bc6 Mon Sep 17 00:00:00 2001 From: franck cuny Date: Mon, 13 Jun 2011 16:42:36 +0200 Subject: change layout and add new js Signed-off-by: franck cuny --- public/javascripts/github-connector.js | 152 +++++++++++++++++++++++++++++++++ public/javascripts/sigma-connector.js | 125 +++++++++++++++++++++++++++ 2 files changed, 277 insertions(+) create mode 100644 public/javascripts/github-connector.js create mode 100644 public/javascripts/sigma-connector.js (limited to 'public') diff --git a/public/javascripts/github-connector.js b/public/javascripts/github-connector.js new file mode 100644 index 0000000..db8ddac --- /dev/null +++ b/public/javascripts/github-connector.js @@ -0,0 +1,152 @@ +var githubNodesObj = {}; +var githubEdgesObj = {}; +var graphAttributes = {}; + +// Interface: +function init(){ + getGraphAttributes() +} + +function newQuery(query){ + sigmaDOM = thisMovie("SiGMa"); + + getGithubGraph(query); +} + +function thisMovie(movieName) { + if (navigator.appName.indexOf("Microsoft") != -1) { + return window[movieName]; + } else { + return document[movieName]; + } +} + +function setComboBoxes(){ + var colorAtts = []; + var sizeAtts = []; + + for(var att in graphAttributes){ + graphAttributes[att]["id"] = att; + + if(graphAttributes[att]["type"]=="Num"){ + sizeAtts.push(graphAttributes[att]); + colorAtts.push(graphAttributes[att]); + }else{ + colorAtts.push(graphAttributes[att]); + } + } + + var nodes_color = document.forms["node_properties"]["nodes_color"]; + var nodes_size = document.forms["node_properties"]["nodes_size"]; + + while(nodes_color.options.length) nodes_color.options.remove(0); + while(nodes_size.options.length) nodes_size.options.remove(0); + + var i; + var optn; + + var l=colorAtts.length; + for(i=0;i