-
Notifications
You must be signed in to change notification settings - Fork 9
/
webpages.h
46 lines (43 loc) · 3.08 KB
/
webpages.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#ifndef WEBPAGE_H
#define WEBPAGE_H
// OTA code
const char* otaHTML =
"<script src='https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js'></script>"
"<h3>OTA Upload</h3>"
"<form method='POST' action='#' enctype='multipart/form-data' id='upload_form'>"
"<input type='file' name='update' required>"
"<input type='submit' value='Update'>"
"</form>"
"<div id='prg'>progress: 0%</div>"
"<script>"
"$('form').submit(function(e){"
"e.preventDefault();"
"var form = $('#upload_form')[0];"
"var data = new FormData(form);"
" $.ajax({"
"url: '/update',"
"type: 'POST',"
"data: data,"
"contentType: false,"
"processData:false,"
"xhr: function() {"
"var xhr = new window.XMLHttpRequest();"
"xhr.upload.addEventListener('progress', function(evt) {"
"if (evt.lengthComputable) {"
"var per = evt.loaded / evt.total;"
"$('#prg').html('progress: ' + Math.round(per*100) + '%');"
"}"
"}, false);"
"return xhr;"
"},"
"success:function(d, s) {"
"console.log('success!')"
"},"
"error: function (a, b, c) {"
"}"
"});"
"});"
"</script>";
// penguin favicon.ico
const char* penguinIco = "<link href='data:image/x-icon;base64,AAABAAEAEBAAAAEACABoBQAAFgAAACgAAAAQAAAAIAAAAAEACAAAAAAAAAEAAAAAAAAAAAAAAAEAAAAAAAAAAAAAIhUNADQkMwAFEBUA3O/9ADtDUgBJQTwAV9n/ANrs/AA1JjUAX+brAF3j6gAvM0IAODxLAJXl/gDz6egA5fL9AP///wBa1+AATpH2ADo+TQAXDgsA0+HoAOLy/ACuuMAAVdj/ADYvPAA7QlIAV9j/ANjr/AA6QE8AWdv/ANvu/ABa2/8AEQ8OAIjk/QA2OUgAWd7/AE2Q9gBLREAAW97/ALrFzQBc3v8ABREWAElCPQA2hIwANzVCAGP1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