Files
NodeMCU_Lua/WebIDE/web_ide3.html

37 lines
1.6 KiB
HTML

if vars=="edit" then
conn:send("
<script>function tag(c){document.getElementsByTagName('w')[0].innerHTML=c};\n
")
conn:send("
var x=new XMLHttpRequest()\nx.onreadystatechange=function(){if(x.readyState==4) document.getElementsByName('t')[0].value = x.responseText; };\nx.open('GET',location.pathname,true)\nx.send()</script>
")
conn:send("
<a href='/'>Back to file list</a><br><br><textarea name=t cols=79 rows=17></textarea></br>
")
conn:send("
<button onclick=\"tag('Saving');x.open('POST',location.pathname,true);\nx.onreadystatechange=function(){if(x.readyState==4) tag(x.responseText);};\nx.send(new Blob([document.getElementsByName('t')[0].value],{type:'text/plain'}));\">Save</button><a href='?run'>run</a><w></w>
")
end
<script>function tag(c){document.getElementsByTagName('w')[0].innerHTML=c};\n
var x=new XMLHttpRequest()\nx.onreadystatechange=function(){if(x.readyState==4) document.getElementsByName('t')[0].value = x.responseText; };\nx.open('GET',location.pathname,true)\nx.send()</script>
<a href='/'>Back to file list</a><br><br><textarea name=t cols=79 rows=17></textarea></br>
<button onclick=\"tag('Saving');x.open('POST',location.pathname,true);\nx.onreadystatechange=function(){if(x.readyState==4) tag(x.responseText);};\nx.send(new Blob([document.getElementsByName('t')[0].value],{type:'text/plain'}));\">Save</button><a href='?run'>run</a><w></w>