Commit abf1c2eb authored by mc16's avatar mc16

Botão de upload padronizado

parent 7bee9950
function save_data(){
if(dataSet == null){
alert("NOP");
return;
......@@ -10,9 +10,9 @@ function save_data(){
}
var data = tempos;
var csvContent = "data:text/csv;charset=utf-8,";
csvContent += JSON.stringify(dataSet);
var encodedUri = encodeURI(csvContent);
//window.open(encodedUri,"ahsuhas");
var encodedUri = encodeURI(csvContent);
......@@ -24,6 +24,10 @@ function save_data(){
link.click(); // This will download the data file named "my_data.csv".
}
function getFile(){
document.getElementById("upfile").click();
}
function load_data(inputFiles){
f = inputFiles[0];
var reader = new FileReader();
......@@ -33,10 +37,10 @@ function load_data(inputFiles){
var data = e.target.result;
dataSet = JSON.parse(data);
salvaTestes();
location.reload();
location.reload();
}
})(f);
reader.readAsBinaryString(f);
}
......@@ -41,9 +41,11 @@
<li><a onClick="gerenciarTestes();" class="pure-menu-link">Gerenciar Testes</a></li>
<li><a onClick="configuracoes();" class="pure-menu-link">Configurações</a></li>
<li><a value='enviado' onClick="downloadCsv();">Baixar os resultados</a></li>
<li><a value='enviado' onClick="buscaTestes()">Examinar os gráficos</a></li>
<li><a onClick="save_data();">Salvar dados</a></li>
<li><input type=file id=input_load_data onchange=load_data(this.files)></li>
<li><a onClick="save_data();">Salvar dados</a></li>
<li><a class="pure-menu-link" onclick="getFile()"> Upload</a></li>
<div style='height: 0px;width: 0px; overflow:hidden;'>
<input id="upfile" type="file" value="upload" onchange="load_data(this.files)"/>
</div>
<li><a href="index.html">Fazer teste</a></li>
</ul>
......@@ -75,9 +77,11 @@
<li><a onClick="gerenciarTestes();" class="pure-menu-link">Gerenciar Testes</a></li>
<li><a onClick="configuracoes();" class="pure-menu-link">Configurações</a></li>
<li><a value='enviado' onClick="downloadCsv();">Baixar os resultados</a></li>
<li><a value='enviado' onClick="buscaTestes()">Examinar os gráficos</a></li>
<li><a onClick="save_data();">Salvar dados</a></li>
<li><input type=file id=input_load_data onchange=load_data(this.files)></li>
<li><a class="pure-menu-link" onclick="getFile()"> Upload</a></li>
<div style='height: 0px;width: 0px; overflow:hidden;'>
<input id="upfile" type="file" value="upload" onchange="load_data(this.files)"/>
</div>
<li><a href="index.html">Fazer teste</a></li>
</ul>
</div> <!-- /#menu -->
......@@ -107,9 +111,11 @@
<li ><a onClick="gerenciarTestes();" >Gerenciar Testes</a></li>
<li ><a onClick="configuracoes();">Configurações</a></li>
<li><a value='enviado' onClick="downloadCsv();">Baixar os resultados</a></li>
<li><a value='enviado' onClick="buscaTestes()">Examinar os gráficos</a></li>
<li><a onClick="save_data();">Salvar dados</a></li>
<li><input type=file id=input_load_data onchange=load_data(this.files)></li>
<li><a class="pure-menu-link" onclick="getFile()"> Upload</a></li>
<div style='height: 0px;width: 0px; overflow:hidden;'>
<input id="upfile" type="file" value="upload" onchange="load_data(this.files)"/>
</div>
<li><a href="index.html">Fazer teste</a></li>
</ul>
</div> <!-- /#menu -->
......@@ -146,11 +152,6 @@
<div class="home-menu pure-menu pure-menu-horizontal pure-menu-fixed" style='background-color:#0078e7;'>
<a class="pure-menu-heading" href="">STROOP</a>
<ul class="pure-menu-list">
<li class="pure-menu-item pure-menu-selected"><a onClick="inicioTestes();" class="pure-menu-link">Início</a></li>
<li class="pure-menu-item"><a onClick="gerenciarTestes();" class="pure-menu-link">Gerenciar Testes</a></li>
<li class="pure-menu-item"><a onClick="configuracoes();" class="pure-menu-link">Configurações</a></li>
</ul>
</div>
</div>
<div class="corpo">
......@@ -169,7 +170,7 @@
<br>
<br>
<button onClick="logado_config_salvaConfig()">Salvar</button>
</center>
</div>
</div>
......
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