Skip to content

Commit d45cb8e

Browse files
Update html.h
1 parent ecc28f1 commit d45cb8e

File tree

1 file changed

+7
-9
lines changed
  • examples/wireless_paper/Wireless_Paper_V1.1

1 file changed

+7
-9
lines changed

examples/wireless_paper/Wireless_Paper_V1.1/html.h

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
//An array for storing web pages
22

3-
4-
53
const char index_html[] PROGMEM = R"rawliteral(
64
<!DOCTYPE HTML>
75
<html>
@@ -30,20 +28,20 @@ const char index_html[] PROGMEM = R"rawliteral(
3028
// document.getElementById("inputFileAgent").value = document.getElementById("avatar").value;
3129
var filePath = file.value;
3230
if (filePath) {
33-
var filePic = file.files[0]; //选择的文件内容--图片
34-
var fileType = filePath.slice(filePath.indexOf(".")); //选择文件的格式
35-
var fileSize = file.files[0].size; //选择文件的大
31+
var filePic = file.files[0]; //Selected file content - images
32+
var fileType = filePath.slice(filePath.indexOf(".")); //Choose the format of the file
33+
var fileSize = file.files[0].size; //Choose the size of the file
3634
var reader = new FileReader();
3735
reader.readAsDataURL(filePic);
3836
reader.onload = function (e) {
3937
var data = e.target.result;
40-
//加载图片获取图片真实宽度和高度
38+
//Load image to obtain the true width and height of the image
4139
var image = new Image();
4240
image.onload = function () {
4341
var width = image.width;
4442
var height = image.height;
45-
if (width == 255 || height == 122) { //判断文件像素
46-
//上传图片
43+
if (width == 255 || height == 122) { //Determine file pixels
44+
//upload pictures
4745
document.getElementById("inputFileAgent").value = document.getElementById("avatar").value;
4846
bmpToXbm(255);
4947
} else {
@@ -146,7 +144,7 @@ const char index_html[] PROGMEM = R"rawliteral(
146144
document.getElementById("dht").innerHTML = this.responseText;
147145
}
148146
};
149-
// 使用GET的方式请求 /dht
147+
// Request using GET /dht
150148
xhttp.open("GET", "/dht", true);
151149
xhttp.send();
152150
}, 1000)

0 commit comments

Comments
 (0)