Commit c621d16a authored by Mathieu Giraud's avatar Mathieu Giraud

index.html, main.js, conf.js.sample: 'demo' -> 'file_menu', separate menu

Some offline usage of the browser could require to properly display a list of files
parent d542d147
......@@ -131,6 +131,15 @@
</div></div>
</div>
<div class="menu" id="static_file_menu" onmouseover="showSelector('fileSelector');" style="display : none">file
<div id="fileSelector" class="selector"><div>
<div class="menu_box">
<div id="upload_list">
</div>
</div>
</div></div>
</div>
<div class="menu" id="demo_file_menu" onmouseover="showSelector('demoSelector');">import/export
<div id="demoSelector" class="selector"><div>
<div class="menu_box">
......@@ -149,10 +158,6 @@
<a class="buttonSelector" onclick="javascript:m.exportCSV()">export csv (visible clones)</a>
<a class="buttonSelector" onclick="javascript:m.exportFasta()">export fasta(selected clones)</a>
</div>
<div class="menu_box">
<div id="upload_list">
</div>
</div>
</div></div>
</div>
......
......@@ -18,7 +18,7 @@ var config = {
* use an empty array [] if you don't want demo_file menu
*/
"demo" : {
"file_menu" : {
"path" : "/browser/demo_file/",
"file" : [
"A_BCD.data",
......
......@@ -24,35 +24,35 @@ if (typeof config != 'undefined') {
document.getElementsByTagName("head")[0].appendChild(fileref)
}
if (config.demo && config.demo.file.length != 0){
if (config.file_menu && config.file_menu.file.length != 0){
//detect if files are available
$.ajax({
type: "POST",
timeout: 5000,
crossDomain: true,
url: config.demo.path + config.demo.file[0],
url: config.file_menu.path + config.file_menu.file[0],
success: function (result) {
$('#demo_file_menu').css("display", "")
var demo_file = document.getElementById("demoSelector").firstChild
$('#static_file_menu').css("display", "")
var demo_file = document.getElementById("fileSelector").firstChild
for (var i = 0; i < config.demo.file.length; i++) {
for (var i = 0; i < config.file_menu.file.length; i++) {
(function (i) {
var a = document.createElement('a');
a.className = "buttonSelector"
a.onclick = function () {
m.loadDataUrl(config.demo.path + config.demo.file[i])
m.loadDataUrl(config.file_menu.path + config.file_menu.file[i])
}
a.appendChild(document.createTextNode(config.demo.file[i]))
a.appendChild(document.createTextNode(config.file_menu.file[i]))
demo_file.appendChild(a);
})(i)
}
},
error: function() {
myConsole.flash("demo file list not available", 1)
myConsole.flash("Files are not available", 1)
}
});
......
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