Skip to content

Commit c073732

Browse files
committed
update some files of 3 to 6
1 parent a962f33 commit c073732

31 files changed

Lines changed: 123 additions & 756 deletions

File tree

3-frames-and-windows/06-clickjacking/top-location.view/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@
3131

3232
<body>
3333

34-
<p>After a click on the button the visitor gets a "strange" question about whether he wants to leave.</p>
34+
<p>After a click on the button the visitor gets a "strange" question about whether they want to leave.</p>
3535

36-
<p>Probably he would respond "No", and the iframe protection is hacked.</p>
36+
<p>Probably they would respond "No", and the iframe protection is hacked.</p>
3737

3838
<button onclick="attack()">Add a "protected" iframe</button>
3939

4-binary/01-arraybuffer-binary-arrays/01-concat/_js.view/solution.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
function concat(arrays) {
2-
// 对每个数组长度求和
2+
// sum of individual array lengths
33
let totalLength = arrays.reduce((acc, value) => acc + value.length, 0);
44

55
if (!arrays.length) return null;
66

77
let result = new Uint8Array(totalLength);
88

9-
// 对于每个数组 — 复制到 result
10-
// 下一个数组在前一个后面复制
9+
// for each array - copy it over result
10+
// next array is copied right after the previous one
1111
let length = 0;
1212
for(let array of arrays) {
1313
result.set(array, length);

4-binary/01-arraybuffer-binary-arrays/01-concat/_js.view/source.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
function concat(arrays) {
2-
// ……你的代码……
2+
// ...your code...
33
}
44

55
let chunks = [

4-binary/03-blob/blob.svg

Lines changed: 1 addition & 51 deletions
Loading
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11

22
async function getUsers(names) {
3-
/* 你的代码 */
3+
/* your code */
44
}

5-network/02-formdata/post.view/server.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ let router = new Router();
99

1010
router.post('/user', async (ctx) => {
1111
ctx.body = {
12-
message: "User saved."
12+
message: "User saved"
1313
};
1414
});
1515

@@ -18,7 +18,7 @@ router.post('/image-form', async (ctx) => {
1818
let files = [];
1919
const { fields } = await busboy(ctx.req, {
2020
onFile(fieldname, file, filename, encoding, mimetype) {
21-
// 读取所有文件流(file stream),然后继续
21+
// read all file stream to continue
2222
let length = 0;
2323
file.on('data', function(data) {
2424
length += data.length;
@@ -34,7 +34,7 @@ router.post('/image-form', async (ctx) => {
3434
});
3535

3636
ctx.body = {
37-
message: `Image saved, firstName: ${fields.firstName}, Image size:${files[0].length}, fileName: ${files[0].filename}.`
37+
message: `Image saved, firstName: ${fields.firstName}, Image size:${files[0].length}, fileName: ${files[0].filename}`
3838
};
3939
});
4040

@@ -44,7 +44,7 @@ router.post('/user-avatar', async (ctx) => {
4444
let files = [];
4545
const { fields } = await busboy(ctx.req, {
4646
onFile(fieldname, file, filename, encoding, mimetype) {
47-
// 读取所有文件流,然后继续
47+
// read all file stream to continue
4848
let length = 0;
4949
file.on('data', function(data) {
5050
length += data.length;
@@ -61,7 +61,7 @@ router.post('/user-avatar', async (ctx) => {
6161
});
6262

6363
ctx.body = {
64-
message: `User with picture, firstName: ${fields.firstName}, picture size:${files[0].length}.`
64+
message: `User with picture, firstName: ${fields.firstName}, picture size:${files[0].length}`
6565
};
6666
});
6767

0 commit comments

Comments
 (0)