Skip to content

Commit ecc28f1

Browse files
Update html.h
1 parent bb5b320 commit ecc28f1

File tree

1 file changed

+7
-10
lines changed
  • examples/wireless_paper/Wireless_Paper_V1.0

1 file changed

+7
-10
lines changed

examples/wireless_paper/Wireless_Paper_V1.0/html.h

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
//An array for storing web pages
2-
3-
4-
52
const char index_html[] PROGMEM = R"rawliteral(
63
<!DOCTYPE HTML>
74
<html>
@@ -30,20 +27,20 @@ const char index_html[] PROGMEM = R"rawliteral(
3027
// document.getElementById("inputFileAgent").value = document.getElementById("avatar").value;
3128
var filePath = file.value;
3229
if (filePath) {
33-
var filePic = file.files[0]; //选择的文件内容--图片
34-
var fileType = filePath.slice(filePath.indexOf(".")); //选择文件的格式
35-
var fileSize = file.files[0].size; //选择文件的大
30+
var filePic = file.files[0]; //Selected file content - images
31+
var fileType = filePath.slice(filePath.indexOf(".")); //Choose the format of the file
32+
var fileSize = file.files[0].size; //选Choose the size of the file
3633
var reader = new FileReader();
3734
reader.readAsDataURL(filePic);
3835
reader.onload = function (e) {
3936
var data = e.target.result;
40-
//加载图片获取图片真实宽度和高度
37+
//Load image to obtain the true width and height of the image
4138
var image = new Image();
4239
image.onload = function () {
4340
var width = image.width;
4441
var height = image.height;
45-
if (width == 255 || height == 122) { //判断文件像素
46-
//上传图片
42+
if (width == 255 || height == 122) { //Determine file pixels
43+
//upload pictures
4744
document.getElementById("inputFileAgent").value = document.getElementById("avatar").value;
4845
bmpToXbm(255);
4946
} else {
@@ -147,7 +144,7 @@ const char index_html[] PROGMEM = R"rawliteral(
147144
document.getElementById("dht").innerHTML = this.responseText;
148145
}
149146
};
150-
// 使用GET的方式请求 /dht
147+
// Request using GET /dht
151148
xhttp.open("GET", "/dht", true);
152149
xhttp.send();
153150
}, 1000)

0 commit comments

Comments
 (0)