w-dwload-reel 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.editorconfig +9 -0
- package/.eslintignore +3 -0
- package/.eslintrc.js +55 -0
- package/.jsdoc +25 -0
- package/LICENSE +21 -0
- package/README.md +63 -0
- package/SECURITY.md +5 -0
- package/babel.config.js +16 -0
- package/dist/w-dwload-reel.umd.js +7 -0
- package/dist/w-dwload-reel.umd.js.map +1 -0
- package/docs/WDwloadReel.mjs.html +317 -0
- package/docs/fonts/Montserrat/Montserrat-Bold.eot +0 -0
- package/docs/fonts/Montserrat/Montserrat-Bold.ttf +0 -0
- package/docs/fonts/Montserrat/Montserrat-Bold.woff +0 -0
- package/docs/fonts/Montserrat/Montserrat-Bold.woff2 +0 -0
- package/docs/fonts/Montserrat/Montserrat-Regular.eot +0 -0
- package/docs/fonts/Montserrat/Montserrat-Regular.ttf +0 -0
- package/docs/fonts/Montserrat/Montserrat-Regular.woff +0 -0
- package/docs/fonts/Montserrat/Montserrat-Regular.woff2 +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.eot +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.svg +978 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.ttf +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff2 +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.eot +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.svg +1049 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.ttf +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff2 +0 -0
- package/docs/global.html +520 -0
- package/docs/index.html +84 -0
- package/docs/scripts/collapse.js +39 -0
- package/docs/scripts/commonNav.js +28 -0
- package/docs/scripts/linenumber.js +25 -0
- package/docs/scripts/nav.js +12 -0
- package/docs/scripts/polyfill.js +4 -0
- package/docs/scripts/prettify/Apache-License-2.0.txt +202 -0
- package/docs/scripts/prettify/lang-css.js +2 -0
- package/docs/scripts/prettify/prettify.js +28 -0
- package/docs/scripts/search.js +99 -0
- package/docs/styles/jsdoc.css +776 -0
- package/docs/styles/prettify.css +80 -0
- package/g.mjs +42 -0
- package/package.json +29 -0
- package/script.txt +17 -0
- package/src/WDwloadReel.mjs +245 -0
- package/test/WDwloadReel.test.mjs +47 -0
- package/toolg/addVersion.mjs +4 -0
- package/toolg/cleanFolder.mjs +4 -0
- package/toolg/gDistRollup.mjs +26 -0
- package/toolg/modifyReadme.mjs +4 -0
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/docs/global.html
ADDED
|
@@ -0,0 +1,520 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
|
|
5
|
+
<meta charset="utf-8">
|
|
6
|
+
<title>Global - Documentation</title>
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
<script src="scripts/prettify/prettify.js"></script>
|
|
10
|
+
<script src="scripts/prettify/lang-css.js"></script>
|
|
11
|
+
<!--[if lt IE 9]>
|
|
12
|
+
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
|
|
13
|
+
<![endif]-->
|
|
14
|
+
<link type="text/css" rel="stylesheet" href="styles/prettify.css">
|
|
15
|
+
<link type="text/css" rel="stylesheet" href="styles/jsdoc.css">
|
|
16
|
+
<script src="scripts/nav.js" defer></script>
|
|
17
|
+
|
|
18
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
19
|
+
</head>
|
|
20
|
+
<body>
|
|
21
|
+
|
|
22
|
+
<input type="checkbox" id="nav-trigger" class="nav-trigger" />
|
|
23
|
+
<label for="nav-trigger" class="navicon-button x">
|
|
24
|
+
<div class="navicon"></div>
|
|
25
|
+
</label>
|
|
26
|
+
|
|
27
|
+
<label for="nav-trigger" class="overlay"></label>
|
|
28
|
+
|
|
29
|
+
<nav >
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
<h2><a href="index.html">Home</a></h2><h3>Global</h3><ul><li><a href="global.html#WDwloadReel">WDwloadReel</a></li></ul>
|
|
33
|
+
|
|
34
|
+
</nav>
|
|
35
|
+
|
|
36
|
+
<div id="main">
|
|
37
|
+
|
|
38
|
+
<h1 class="page-title">Global</h1>
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
<section>
|
|
47
|
+
|
|
48
|
+
<header>
|
|
49
|
+
|
|
50
|
+
<h2>
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
</h2>
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
</header>
|
|
58
|
+
|
|
59
|
+
<article>
|
|
60
|
+
|
|
61
|
+
<div class="container-overview">
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
<dl class="details">
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
</dl>
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
</div>
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
<h3 class="subsection-title">Methods</h3>
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
<h4 class="name" id="WDwloadReel"><span class="type-signature type-signature-async">(async) </span>WDwloadReel<span class="signature">(url, fp, opt<span class="signature-attributes">opt</span>)</span><span class="type-signature"> → {Promise}</span></h4>
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
<dl class="details">
|
|
141
|
+
|
|
142
|
+
<dt class="tag-description">Description:</dt>
|
|
143
|
+
<dd class="tag-description"><ul class="dummy"><li><p>下載Facebook Reel為mp4檔案至本機指定位置</p></li></ul></dd>
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
<dt class="tag-source">Source:</dt>
|
|
148
|
+
<dd class="tag-source"><ul class="dummy"><li>
|
|
149
|
+
<a href="WDwloadReel.mjs.html">WDwloadReel.mjs</a>, <a href="WDwloadReel.mjs.html#line61">line 61</a>
|
|
150
|
+
</li></ul></dd>
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
</dl>
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
<h5 class="h5-examples">Example</h5>
|
|
195
|
+
|
|
196
|
+
<pre class="prettyprint"><code>import fs from 'fs'
|
|
197
|
+
import WDwloadReel from './src/WDwloadReel.mjs'
|
|
198
|
+
|
|
199
|
+
async function test() {
|
|
200
|
+
|
|
201
|
+
//url
|
|
202
|
+
let url = 'https://www.facebook.com/reel/XXXXXXXXXX'
|
|
203
|
+
|
|
204
|
+
//fp
|
|
205
|
+
let fp = './abc.mp4'
|
|
206
|
+
|
|
207
|
+
//funProg
|
|
208
|
+
let funProg = (prog, nn, na) => {
|
|
209
|
+
console.log('prog', `${prog.toFixed(2)}%`, nn, na)
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
//WDwloadReel
|
|
213
|
+
await WDwloadReel(url, fp, {
|
|
214
|
+
funProg,
|
|
215
|
+
})
|
|
216
|
+
|
|
217
|
+
//len
|
|
218
|
+
let len = fs.statSync(fp).size
|
|
219
|
+
console.log('len', len)
|
|
220
|
+
|
|
221
|
+
console.log('done:', fp)
|
|
222
|
+
}
|
|
223
|
+
test()
|
|
224
|
+
.catch((err) => {
|
|
225
|
+
console.log('catch', err)
|
|
226
|
+
})
|
|
227
|
+
// prog 1.00% 23456 2345678
|
|
228
|
+
// prog 2.00% 46912 2345678
|
|
229
|
+
// ...
|
|
230
|
+
// prog 99.00% 2322221 2345678
|
|
231
|
+
// prog 100.00% 2345678 2345678
|
|
232
|
+
// len 2345678
|
|
233
|
+
// done: ./abc.mp4</code></pre>
|
|
234
|
+
|
|
235
|
+
|
|
236
|
+
|
|
237
|
+
|
|
238
|
+
<h5 class="h5-parameters">Parameters:</h5>
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
<table class="params">
|
|
242
|
+
<thead>
|
|
243
|
+
<tr>
|
|
244
|
+
|
|
245
|
+
<th>Name</th>
|
|
246
|
+
|
|
247
|
+
|
|
248
|
+
<th>Type</th>
|
|
249
|
+
|
|
250
|
+
|
|
251
|
+
<th>Attributes</th>
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
|
|
255
|
+
<th>Default</th>
|
|
256
|
+
|
|
257
|
+
|
|
258
|
+
<th class="last">Description</th>
|
|
259
|
+
</tr>
|
|
260
|
+
</thead>
|
|
261
|
+
|
|
262
|
+
<tbody>
|
|
263
|
+
|
|
264
|
+
|
|
265
|
+
<tr>
|
|
266
|
+
|
|
267
|
+
<td class="name"><code>url</code></td>
|
|
268
|
+
|
|
269
|
+
|
|
270
|
+
<td class="type">
|
|
271
|
+
|
|
272
|
+
|
|
273
|
+
<span class="param-type">String</span>
|
|
274
|
+
|
|
275
|
+
|
|
276
|
+
|
|
277
|
+
|
|
278
|
+
</td>
|
|
279
|
+
|
|
280
|
+
|
|
281
|
+
<td class="attributes">
|
|
282
|
+
|
|
283
|
+
|
|
284
|
+
|
|
285
|
+
|
|
286
|
+
|
|
287
|
+
</td>
|
|
288
|
+
|
|
289
|
+
|
|
290
|
+
|
|
291
|
+
<td class="default">
|
|
292
|
+
|
|
293
|
+
</td>
|
|
294
|
+
|
|
295
|
+
|
|
296
|
+
<td class="description last"><p>輸入Facebook Reel網址字串(facebook.com / fb.watch)</p></td>
|
|
297
|
+
</tr>
|
|
298
|
+
|
|
299
|
+
|
|
300
|
+
|
|
301
|
+
<tr>
|
|
302
|
+
|
|
303
|
+
<td class="name"><code>fp</code></td>
|
|
304
|
+
|
|
305
|
+
|
|
306
|
+
<td class="type">
|
|
307
|
+
|
|
308
|
+
|
|
309
|
+
<span class="param-type">String</span>
|
|
310
|
+
|
|
311
|
+
|
|
312
|
+
|
|
313
|
+
|
|
314
|
+
</td>
|
|
315
|
+
|
|
316
|
+
|
|
317
|
+
<td class="attributes">
|
|
318
|
+
|
|
319
|
+
|
|
320
|
+
|
|
321
|
+
|
|
322
|
+
|
|
323
|
+
</td>
|
|
324
|
+
|
|
325
|
+
|
|
326
|
+
|
|
327
|
+
<td class="default">
|
|
328
|
+
|
|
329
|
+
</td>
|
|
330
|
+
|
|
331
|
+
|
|
332
|
+
<td class="description last"><p>輸入儲存video(*.mp4)檔案路徑字串</p></td>
|
|
333
|
+
</tr>
|
|
334
|
+
|
|
335
|
+
|
|
336
|
+
|
|
337
|
+
<tr>
|
|
338
|
+
|
|
339
|
+
<td class="name"><code>opt</code></td>
|
|
340
|
+
|
|
341
|
+
|
|
342
|
+
<td class="type">
|
|
343
|
+
|
|
344
|
+
|
|
345
|
+
<span class="param-type">Object</span>
|
|
346
|
+
|
|
347
|
+
|
|
348
|
+
|
|
349
|
+
|
|
350
|
+
</td>
|
|
351
|
+
|
|
352
|
+
|
|
353
|
+
<td class="attributes">
|
|
354
|
+
|
|
355
|
+
<optional><br>
|
|
356
|
+
|
|
357
|
+
|
|
358
|
+
|
|
359
|
+
|
|
360
|
+
|
|
361
|
+
</td>
|
|
362
|
+
|
|
363
|
+
|
|
364
|
+
|
|
365
|
+
<td class="default">
|
|
366
|
+
|
|
367
|
+
<code>{}</code>
|
|
368
|
+
|
|
369
|
+
</td>
|
|
370
|
+
|
|
371
|
+
|
|
372
|
+
<td class="description last"><p>輸入設定物件,預設{}</p>
|
|
373
|
+
<h6>Properties</h6>
|
|
374
|
+
|
|
375
|
+
|
|
376
|
+
<table class="params">
|
|
377
|
+
<thead>
|
|
378
|
+
<tr>
|
|
379
|
+
|
|
380
|
+
<th>Name</th>
|
|
381
|
+
|
|
382
|
+
|
|
383
|
+
<th>Type</th>
|
|
384
|
+
|
|
385
|
+
|
|
386
|
+
<th>Attributes</th>
|
|
387
|
+
|
|
388
|
+
|
|
389
|
+
|
|
390
|
+
<th>Default</th>
|
|
391
|
+
|
|
392
|
+
|
|
393
|
+
<th class="last">Description</th>
|
|
394
|
+
</tr>
|
|
395
|
+
</thead>
|
|
396
|
+
|
|
397
|
+
<tbody>
|
|
398
|
+
|
|
399
|
+
|
|
400
|
+
<tr>
|
|
401
|
+
|
|
402
|
+
<td class="name"><code>funProg</code></td>
|
|
403
|
+
|
|
404
|
+
|
|
405
|
+
<td class="type">
|
|
406
|
+
|
|
407
|
+
|
|
408
|
+
<span class="param-type">function</span>
|
|
409
|
+
|
|
410
|
+
|
|
411
|
+
|
|
412
|
+
|
|
413
|
+
</td>
|
|
414
|
+
|
|
415
|
+
|
|
416
|
+
<td class="attributes">
|
|
417
|
+
|
|
418
|
+
<optional><br>
|
|
419
|
+
|
|
420
|
+
|
|
421
|
+
|
|
422
|
+
|
|
423
|
+
|
|
424
|
+
</td>
|
|
425
|
+
|
|
426
|
+
|
|
427
|
+
|
|
428
|
+
<td class="default">
|
|
429
|
+
|
|
430
|
+
<code>null</code>
|
|
431
|
+
|
|
432
|
+
</td>
|
|
433
|
+
|
|
434
|
+
|
|
435
|
+
<td class="description last"><p>輸入回傳進度函數,傳入參數為prog代表進度百分比(0~100)、nn代表當前已下載bytes、na代表全部須下載bytes,預設null</p></td>
|
|
436
|
+
</tr>
|
|
437
|
+
|
|
438
|
+
|
|
439
|
+
</tbody>
|
|
440
|
+
</table>
|
|
441
|
+
|
|
442
|
+
</td>
|
|
443
|
+
</tr>
|
|
444
|
+
|
|
445
|
+
|
|
446
|
+
</tbody>
|
|
447
|
+
</table>
|
|
448
|
+
|
|
449
|
+
|
|
450
|
+
|
|
451
|
+
|
|
452
|
+
|
|
453
|
+
|
|
454
|
+
|
|
455
|
+
|
|
456
|
+
|
|
457
|
+
|
|
458
|
+
|
|
459
|
+
|
|
460
|
+
|
|
461
|
+
|
|
462
|
+
|
|
463
|
+
|
|
464
|
+
<h5 class="h5-returns">Returns:</h5>
|
|
465
|
+
|
|
466
|
+
|
|
467
|
+
<div class="param-desc">
|
|
468
|
+
<p>回傳Promise,resolve回傳'ok',reject回傳錯誤訊息</p>
|
|
469
|
+
</div>
|
|
470
|
+
|
|
471
|
+
|
|
472
|
+
|
|
473
|
+
<dl class="param-type">
|
|
474
|
+
<dt>
|
|
475
|
+
Type
|
|
476
|
+
</dt>
|
|
477
|
+
<dd>
|
|
478
|
+
|
|
479
|
+
<span class="param-type">Promise</span>
|
|
480
|
+
|
|
481
|
+
|
|
482
|
+
|
|
483
|
+
</dd>
|
|
484
|
+
</dl>
|
|
485
|
+
|
|
486
|
+
|
|
487
|
+
|
|
488
|
+
|
|
489
|
+
|
|
490
|
+
|
|
491
|
+
|
|
492
|
+
|
|
493
|
+
|
|
494
|
+
|
|
495
|
+
|
|
496
|
+
</article>
|
|
497
|
+
|
|
498
|
+
</section>
|
|
499
|
+
|
|
500
|
+
|
|
501
|
+
|
|
502
|
+
|
|
503
|
+
|
|
504
|
+
|
|
505
|
+
</div>
|
|
506
|
+
|
|
507
|
+
<br class="clear">
|
|
508
|
+
|
|
509
|
+
<footer>
|
|
510
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Tue May 26 2026 20:57:38 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
511
|
+
</footer>
|
|
512
|
+
|
|
513
|
+
<script>prettyPrint();</script>
|
|
514
|
+
<script src="scripts/polyfill.js"></script>
|
|
515
|
+
<script src="scripts/linenumber.js"></script>
|
|
516
|
+
|
|
517
|
+
|
|
518
|
+
|
|
519
|
+
</body>
|
|
520
|
+
</html>
|
package/docs/index.html
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
|
|
5
|
+
<meta charset="utf-8">
|
|
6
|
+
<title>Home - Documentation</title>
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
<script src="scripts/prettify/prettify.js"></script>
|
|
10
|
+
<script src="scripts/prettify/lang-css.js"></script>
|
|
11
|
+
<!--[if lt IE 9]>
|
|
12
|
+
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
|
|
13
|
+
<![endif]-->
|
|
14
|
+
<link type="text/css" rel="stylesheet" href="styles/prettify.css">
|
|
15
|
+
<link type="text/css" rel="stylesheet" href="styles/jsdoc.css">
|
|
16
|
+
<script src="scripts/nav.js" defer></script>
|
|
17
|
+
|
|
18
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
19
|
+
</head>
|
|
20
|
+
<body>
|
|
21
|
+
|
|
22
|
+
<input type="checkbox" id="nav-trigger" class="nav-trigger" />
|
|
23
|
+
<label for="nav-trigger" class="navicon-button x">
|
|
24
|
+
<div class="navicon"></div>
|
|
25
|
+
</label>
|
|
26
|
+
|
|
27
|
+
<label for="nav-trigger" class="overlay"></label>
|
|
28
|
+
|
|
29
|
+
<nav >
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
<h2><a href="index.html">Home</a></h2><h3>Global</h3><ul><li><a href="global.html#WDwloadReel">WDwloadReel</a></li></ul>
|
|
33
|
+
|
|
34
|
+
</nav>
|
|
35
|
+
|
|
36
|
+
<div id="main">
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
<section class="package">
|
|
47
|
+
<h3> </h3>
|
|
48
|
+
</section>
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
</div>
|
|
70
|
+
|
|
71
|
+
<br class="clear">
|
|
72
|
+
|
|
73
|
+
<footer>
|
|
74
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Tue May 26 2026 20:57:38 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
75
|
+
</footer>
|
|
76
|
+
|
|
77
|
+
<script>prettyPrint();</script>
|
|
78
|
+
<script src="scripts/polyfill.js"></script>
|
|
79
|
+
<script src="scripts/linenumber.js"></script>
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
</body>
|
|
84
|
+
</html>
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
function hideAllButCurrent(){
|
|
2
|
+
//by default all submenut items are hidden
|
|
3
|
+
//but we need to rehide them for search
|
|
4
|
+
document.querySelectorAll("nav > ul").forEach(function(parent) {
|
|
5
|
+
if (parent.className.indexOf("collapse_top") !== -1) {
|
|
6
|
+
parent.style.display = "none";
|
|
7
|
+
}
|
|
8
|
+
});
|
|
9
|
+
document.querySelectorAll("nav > ul > li > ul li").forEach(function(parent) {
|
|
10
|
+
parent.style.display = "none";
|
|
11
|
+
});
|
|
12
|
+
document.querySelectorAll("nav > h3").forEach(function(section) {
|
|
13
|
+
if (section.className.indexOf("collapsed_header") !== -1) {
|
|
14
|
+
section.addEventListener("click", function(){
|
|
15
|
+
if (section.nextSibling.style.display === "none") {
|
|
16
|
+
section.nextSibling.style.display = "block";
|
|
17
|
+
} else {
|
|
18
|
+
section.nextSibling.style.display = "none";
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
//only current page (if it exists) should be opened
|
|
25
|
+
var file = window.location.pathname.split("/").pop().replace(/\.html/, '');
|
|
26
|
+
document.querySelectorAll("nav > ul > li > a").forEach(function(parent) {
|
|
27
|
+
var href = parent.attributes.href.value.replace(/\.html/, '');
|
|
28
|
+
if (file === href) {
|
|
29
|
+
if (parent.parentNode.parentNode.className.indexOf("collapse_top") !== -1) {
|
|
30
|
+
parent.parentNode.parentNode.style.display = "block";
|
|
31
|
+
}
|
|
32
|
+
parent.parentNode.querySelectorAll("ul li").forEach(function(elem) {
|
|
33
|
+
elem.style.display = "block";
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
hideAllButCurrent();
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
if (typeof fetch === 'function') {
|
|
2
|
+
const init = () => {
|
|
3
|
+
if (typeof scrollToNavItem !== 'function') return false
|
|
4
|
+
scrollToNavItem()
|
|
5
|
+
// hideAllButCurrent not always loaded
|
|
6
|
+
if (typeof hideAllButCurrent === 'function') hideAllButCurrent()
|
|
7
|
+
return true
|
|
8
|
+
}
|
|
9
|
+
fetch('./nav.inc.html')
|
|
10
|
+
.then(response => response.ok ? response.text() : `${response.url} => ${response.status} ${response.statusText}`)
|
|
11
|
+
.then(body => {
|
|
12
|
+
document.querySelector('nav').innerHTML += body
|
|
13
|
+
// nav.js should be quicker to load than nav.inc.html, a fallback just in case
|
|
14
|
+
return init()
|
|
15
|
+
})
|
|
16
|
+
.then(done => {
|
|
17
|
+
if (done) return
|
|
18
|
+
let i = 0
|
|
19
|
+
;(function waitUntilNavJs () {
|
|
20
|
+
if (init()) return
|
|
21
|
+
if (i++ < 100) return setTimeout(waitUntilNavJs, 300)
|
|
22
|
+
console.error(Error('nav.js not loaded after 30s waiting for it'))
|
|
23
|
+
})()
|
|
24
|
+
})
|
|
25
|
+
.catch(error => console.error(error))
|
|
26
|
+
} else {
|
|
27
|
+
console.error(Error('Browser too old to display commonNav (remove commonNav docdash option)'))
|
|
28
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/*global document */
|
|
2
|
+
(function() {
|
|
3
|
+
var source = document.getElementsByClassName('prettyprint source linenums');
|
|
4
|
+
var i = 0;
|
|
5
|
+
var lineNumber = 0;
|
|
6
|
+
var lineId;
|
|
7
|
+
var lines;
|
|
8
|
+
var totalLines;
|
|
9
|
+
var anchorHash;
|
|
10
|
+
|
|
11
|
+
if (source && source[0]) {
|
|
12
|
+
anchorHash = document.location.hash.substring(1);
|
|
13
|
+
lines = source[0].getElementsByTagName('li');
|
|
14
|
+
totalLines = lines.length;
|
|
15
|
+
|
|
16
|
+
for (; i < totalLines; i++) {
|
|
17
|
+
lineNumber++;
|
|
18
|
+
lineId = 'line' + lineNumber;
|
|
19
|
+
lines[i].id = lineId;
|
|
20
|
+
if (lineId === anchorHash) {
|
|
21
|
+
lines[i].className += ' selected';
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
})();
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
function scrollToNavItem() {
|
|
2
|
+
var path = window.location.href.split('/').pop().replace(/\.html/, '');
|
|
3
|
+
document.querySelectorAll('nav a').forEach(function(link) {
|
|
4
|
+
var href = link.attributes.href.value.replace(/\.html/, '');
|
|
5
|
+
if (path === href) {
|
|
6
|
+
link.scrollIntoView({block: 'center'});
|
|
7
|
+
return;
|
|
8
|
+
}
|
|
9
|
+
})
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
scrollToNavItem();
|