add js to firmwaree upload

hide upload until selected, update return msg box
This commit is contained in:
tablatronix
2018-11-09 16:43:54 -06:00
parent 5a3829abf9
commit 7da803389c
2 changed files with 8 additions and 4 deletions
+5 -1
View File
@@ -303,7 +303,11 @@ button.D{
<p/>More information about WiFiManager at <a href='https://github.com/tzapu/WiFiManager'>https://github.com/tzapu/WiFiManager</a>
<!-- /HTTP_HELP -->
<!-- FORM_UPLOAD -->
<Br/><br/>Form UPLOAD<br/><form method='POST' action='u' enctype='multipart/form-data'><input type='file' name='update' accept='.bin,application/octet-stream'><button type='submit' value='Submit'>Submit</button></form>
<Br/><br/>Form UPLOAD<br/>
<form method='POST' action='u' enctype='multipart/form-data'>
<input type='file' name='update' accept='.bin,application/octet-stream' onchange="(function(el){document.getElementById('uploadbin').style.display = el.value=='' ? 'none' : 'initial';})(this)">
<button id='uploadbin' class="h">Submit</button>
</form>
<!-- /FORM_UPLOAD -->
<!-- HTTP_END -->
+3 -3
View File
@@ -116,9 +116,9 @@ const char HTTP_HELP[] PROGMEM =
"</table>"
"<p/>More information about WiFiManager at <a href='https://github.com/tzapu/WiFiManager'>https://github.com/tzapu/WiFiManager</a>.";
const char HTTP_UPDATE[] PROGMEM = "<form method='POST' action='u' enctype='multipart/form-data'><input type='file' name='update' accept='.bin,application/octet-stream'><input type='submit' value='Update'></form>";
const char HTTP_UPDATE_FAIL[] PROGMEM = "Update Failed!";
const char HTTP_UPDATE_OK[] PROGMEM = "Update OK! Rebooting now...";
const char HTTP_UPDATE[] PROGMEM = "Upload New Firmware<br/><form method='POST' action='u' enctype='multipart/form-data' onchange=\"(function(el){document.getElementById('uploadbin').style.display = el.value=='' ? 'none' : 'initial';})(this)\"><input type='file' name='update' accept='.bin,application/octet-stream'><button id='uploadbin' type='submit' class='h D'>Update</button></form>";
const char HTTP_UPDATE_FAIL[] PROGMEM = "<div class='msg D'><strong>Update Failed!</strong><Br/>Reboot device and try again</div>";
const char HTTP_UPDATE_OK[] PROGMEM = "<div class='msg P'><strong>Update OK!</strong> Device Rebooting now...</div>";
#ifdef JSTEST
const char HTTP_JS[] PROGMEM =