Commit a6c5e88c authored by Marc Duez's avatar Marc Duez

interface : builder.js now handle info-container

no more static info inside info-container
parent 968d7008
......@@ -198,48 +198,7 @@
<div id="left">
<div id="info">
<div id=info_data_file> &nbsp;</div>
<div id=info_analysis_file> &nbsp; </div>
<div id="info_system"> &nbsp; </div>
<div id="info_color_Tag" class="info_color" style="">tag colors
<span id="fastTag0" class="tagColorBox tagColor0" onclick="nextDisplayTag(this)"></span>
<span id="fastTag1" class="tagColorBox tagColor1" onclick="nextDisplayTag(this)"></span>
<span id="fastTag2" class="tagColorBox tagColor2" onclick="nextDisplayTag(this)"></span>
<span id="fastTag3" class="tagColorBox tagColor3" onclick="nextDisplayTag(this)"></span>
<span id="fastTag4" class="tagColorBox tagColor4" onclick="nextDisplayTag(this)"></span>
<span id="fastTag5" class="tagColorBox tagColor5" onclick="nextDisplayTag(this)"></span>
<span id="fastTag6" class="tagColorBox tagColor6" onclick="nextDisplayTag(this)"></span>
<span id="fastTag7" class="tagColorBox tagColor7" onclick="nextDisplayTag(this)"></span>
<span id="fastTag8" class="tagColorBox tagColor8" onclick="nextDisplayTag(this)"></span>
</div>
<div id="info_color_N" class="info_color" style="display:none">N colors :
<span> N=0 </span>
<span class="gradient"></span>
<span id="info_n_max"> N=max</span>
</div>
<div id="info_color_N2" class="info_color" style="display:none">N colors :
<span> N=0 </span>
<span class="gradient"></span>
<span id="info_n2_max"> N=max</span>
</div>
<div id="info_color_abundance" class="info_color" style="display:none" >
abundance colors :
<span> 0% </span>
<span class="gradient"></span>
<span id="info_size_max"> 100%</span>
</div>
</div>
<div id="color-info" class="gradient_abundance"></div>
<div id="info"> </div>
<div id="sort-bar">
sort list by
......
......@@ -2,6 +2,8 @@ function Builder(model) {
this.m = model; //Model utilisé
this.m.view.push(this); //synchronisation au Model
this.colorMethod = "";
var drag_separator = false
}
......@@ -26,9 +28,16 @@ Builder.prototype = {
this.build_tagSelector()
this.build_displaySelector()
this.build_info_container()
},
update: function () {},
update: function () {
if (this.colorMethod != this.m.colorMethod){
this.colorMethod = this.m.colorMethod
this.build_info_container()
}
},
updateElem: function () {},
......@@ -110,7 +119,7 @@ Builder.prototype = {
li.appendChild(div)
listTag.appendChild(li);
}
initTag();
},
/*complete displaySelector menu with correct info about current tagname / top
......@@ -159,20 +168,103 @@ Builder.prototype = {
toggle_left_container : function () {
var self = this
elem = $("#left-container")
if ($("#left-container").css("width") == "0px" ){
$("#left-container").css("display", "")
if (elem.css("width") == "0px" ){
elem.css("display", "")
.animate({width: self.width_left_container}, 400 , function(){
$("#toggle-left-container").html("< < <")
self.m.resize();
})
}else{
$("#left-container").animate({width: "0px"}, 400 , function(){
elem.animate({width: "0px"}, 400 , function(){
$(this).css("display", "none")
$("#toggle-left-container").html("> > >")
self.m.resize();
})
}
}
},
build_info_container : function () {
var self = this
var parent = document.getElementById("info")
parent.innerHTML="";
var div_data_file = document.createElement('div');
div_data_file.id = "info_data_file"
div_data_file.appendChild(document.createTextNode(this.m.dataFileName));
var div_analysis_file = document.createElement('div');
div_analysis_file.id = "info_analysis_file"
div_analysis_file.appendChild(document.createTextNode(this.m.analysisFileName));
var div_system = document.createElement('div');
div_system.id = "info_system"
div_system.appendChild(document.createTextNode(this.m.system));
var div_color = this.build_info_color()
parent.appendChild(div_data_file)
parent.appendChild(div_analysis_file)
parent.appendChild(div_system)
parent.appendChild(div_color)
initTag();
},
build_info_color : function () {
var self = this
var div = document.createElement('div');
div.className = "info_color"
var span1 = document.createElement('span');
var span2 = document.createElement('span');
var span3 = document.createElement('span');
switch(this.colorMethod){
case "N2" :
div.appendChild(document.createTextNode(" colors : "));
span1.appendChild(document.createTextNode(" N=0 "));
span2.className = "gradient";
span3.appendChild(document.createTextNode("N="+this.m.n2_max));
break;
case "Tag" :
div.appendChild(document.createTextNode(" tag colors : "));
for (var i = 0; i < tagName.length; i++) {
var spantag = document.createElement('span');
spantag.className = "tagColorBox tagColor"+i
spantag.id = "fastTag"+i
spantag.onclick = function () {
nextDisplayTag(this)
}
span2.appendChild(spantag);
}
break;
case "abundance" :
div.appendChild(document.createTextNode(" colors : "));
span1.appendChild(document.createTextNode(" 0% "));
span2.className = "gradient";
span3.appendChild(document.createTextNode(" 100%"));
break;
}
div.appendChild(span1)
div.appendChild(span2)
div.appendChild(span3)
return div;
},
}
\ No newline at end of file
......@@ -88,7 +88,6 @@ Model.prototype = {
var oFReader = new FileReader();
var oFile = document.getElementById(data).files[0];
self.dataFileName= document.getElementById(data).files[0].name;
document.getElementById("info_data_file").innerHTML= self.dataFileName;//TODO
oFReader.readAsText(oFile);
oFReader.onload = function (oFREvent) {
......@@ -782,8 +781,6 @@ Model.prototype = {
* */
changeColorMethod : function(colorM){
this.colorMethod=colorM;
$(".info_color").hide();
$("#info_color_"+colorM).show();
this.update();
},
......
......@@ -33,7 +33,7 @@ class MyMiniTest
#close browser
def after_suites
#$b.close
$b.close
end
#test suite launcher
......
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