unicode-input-toolconverter 0.2.0 → 0.2.3
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/.nyc_output/out.json +8980 -1849
- package/CHANGES.md +15 -1
- package/README.md +6 -11
- package/_locales/en-US/messages.json +153 -6
- package/_locales/hu-HU/messages.json +153 -6
- package/_locales/pt-BR/messages.json +153 -6
- package/_locales/sv-SE/messages.json +153 -6
- package/babel.config.json +0 -1
- package/browser_action/characterSelection.js +18 -11
- package/browser_action/charrefConverters.js +286 -79
- package/browser_action/chartBuild.js +97 -27
- package/browser_action/encodingBehaviors.js +10 -7
- package/browser_action/entityBehaviors.js +42 -16
- package/browser_action/index-es.html +13 -1
- package/browser_action/index-instrumented.html +13 -1
- package/browser_action/index-pages.html +13 -1
- package/browser_action/index.html +13 -1
- package/browser_action/index.iife.min.js +9 -1
- package/browser_action/index.iife.min.js.map +1 -1
- package/browser_action/index.instrumented.iife.min.js +1 -1
- package/browser_action/index.instrumented.iife.min.js.map +1 -1
- package/browser_action/index.js +5 -5
- package/browser_action/preferences/prefDefaults.js +12 -3
- package/browser_action/service-worker/sw-activateCallback.js +1 -2
- package/browser_action/service-worker/sw-resources.json +6 -4
- package/browser_action/templateUtils/elements.js +12 -1
- package/browser_action/templateUtils/fill.js +6 -0
- package/browser_action/templateUtils/validation.js +4 -1
- package/browser_action/templates/chartBuild.js +167 -102
- package/browser_action/templates/index.js +227 -53
- package/browser_action/templatesElementCustomization/widgets.js +40 -15
- package/browser_action/unicode/UnicodeConverter.js +99 -73
- package/browser_action/unicode/charrefunicodeDb.js +100 -50
- package/browser_action/unicode/getScriptInfoForCodePoint.js +13 -4
- package/browser_action/unicode/hangul.js +27 -20
- package/browser_action/unicode/lastScriptNames.json +1 -1
- package/browser_action/unicode/parseUnihanFromTextFileStrings.js +44 -25
- package/browser_action/unicode/unicodeFieldInfo.js +112 -90
- package/browser_action/unicode/unicodeScripts.js +409 -35
- package/browser_action/unicode/unihan.js +4 -3
- package/browser_action/unicode/unihanDbPopulate.js +7 -2
- package/browser_action/unicode/unihanFields.js +34 -0
- package/browser_action/unicodecharref.js +353 -190
- package/browser_action/utils/DOMUtils.js +95 -34
- package/browser_action/utils/FetchUtils.js +7 -6
- package/browser_action/utils/TextUtils.js +4 -4
- package/browser_action/utils/TypedArrayUtils.js +9 -5
- package/browser_action/utils/semicolonSeparatedToArray.js +3 -3
- package/browser_action/utils/setupServiceWorker.js +2 -2
- package/eslint.config.js +11 -0
- package/icons/openWindow16.png +0 -0
- package/icons/openWindow24.png +0 -0
- package/lib/background.html +7 -0
- package/lib/background.js +2 -2
- package/package.json +80 -70
- package/pnpm-workspace.yaml +8 -0
- package/server.js +66 -51
- package/sw.js +97 -56
- package/tools/entities-import.js +4 -1
- package/tools/findEsResources.js +33 -10
- package/tools/fix-sw-resources-vendor-paths.js +60 -0
- package/tools/list-locales.js +2 -2
- package/tools/parseUnicodeCharts.js +126 -60
- package/tools/ucd-import.js +1 -10
- package/tools/unicode-charts.html +49 -20
- package/tools/unihan-import.js +45 -15
- package/tools/write-sw-version.js +16 -0
- package/tsconfig.json +23 -0
- package/typings/__coverage__.d.ts +5 -0
- package/typings/apple-system-profiler.d.ts +17 -0
- package/typings/commands.d.ts +19 -0
- package/typings/json-6.d.ts +4 -0
- package/typings/rollup-plugin-istanbul.d.ts +3 -0
- package/vendor/camelcase/index.d.ts +154 -0
- package/vendor/camelcase/index.js +137 -23
- package/vendor/fflate/esm/browser.d.ts +1539 -0
- package/vendor/fflate/esm/browser.js +82 -55
- package/vendor/intl-dom/dist/Formatter.d.ts +120 -0
- package/vendor/intl-dom/dist/Formatter.d.ts.map +1 -0
- package/vendor/intl-dom/dist/collation.d.ts +42 -0
- package/vendor/intl-dom/dist/collation.d.ts.map +1 -0
- package/vendor/intl-dom/dist/defaultAllSubstitutions.d.ts +52 -0
- package/vendor/intl-dom/dist/defaultAllSubstitutions.d.ts.map +1 -0
- package/vendor/intl-dom/dist/defaultInsertNodes.d.ts +96 -0
- package/vendor/intl-dom/dist/defaultInsertNodes.d.ts.map +1 -0
- package/vendor/intl-dom/dist/defaultKeyCheckerConverter.d.ts +17 -0
- package/vendor/intl-dom/dist/defaultKeyCheckerConverter.d.ts.map +1 -0
- package/vendor/intl-dom/dist/defaultLocaleResolver.d.ts +285 -0
- package/vendor/intl-dom/dist/defaultLocaleResolver.d.ts.map +1 -0
- package/vendor/intl-dom/dist/findLocaleStrings.d.ts +88 -0
- package/vendor/intl-dom/dist/findLocaleStrings.d.ts.map +1 -0
- package/vendor/intl-dom/dist/getDOMForLocaleString.d.ts +67 -0
- package/vendor/intl-dom/dist/getDOMForLocaleString.d.ts.map +1 -0
- package/vendor/intl-dom/dist/getMessageForKeyByStyle.d.ts +73 -0
- package/vendor/intl-dom/dist/getMessageForKeyByStyle.d.ts.map +1 -0
- package/vendor/intl-dom/dist/getStringFromMessageAndDefaults.d.ts +26 -0
- package/vendor/intl-dom/dist/getStringFromMessageAndDefaults.d.ts.map +1 -0
- package/vendor/intl-dom/dist/i18n.d.ts +113 -0
- package/vendor/intl-dom/dist/i18n.d.ts.map +1 -0
- package/vendor/intl-dom/dist/index.d.ts +92 -0
- package/vendor/intl-dom/dist/index.d.ts.map +1 -0
- package/vendor/intl-dom/dist/index.esm.d.ts +34 -0
- package/vendor/intl-dom/dist/index.esm.js +854 -896
- package/vendor/intl-dom/dist/index.esm.min.js +4 -0
- package/vendor/intl-dom/dist/index.esm.min.js.map +1 -0
- package/vendor/intl-dom/dist/index.umd.js +2953 -0
- package/vendor/intl-dom/dist/index.umd.min.js +4 -0
- package/vendor/intl-dom/dist/index.umd.min.js.map +1 -0
- package/vendor/intl-dom/dist/promiseChainForValues.d.ts +34 -0
- package/vendor/intl-dom/dist/promiseChainForValues.d.ts.map +1 -0
- package/vendor/intl-dom/dist/shared.d.ts +20 -0
- package/vendor/intl-dom/dist/shared.d.ts.map +1 -0
- package/vendor/intl-dom/dist/utils.d.ts +53 -0
- package/vendor/intl-dom/dist/utils.d.ts.map +1 -0
- package/vendor/jamilih/dist/jml.d.mts +468 -0
- package/vendor/jamilih/dist/{jml-es.js → jml.mjs} +1489 -343
- package/vendor/jquery/dist/jquery.js +1677 -2713
- package/vendor/json-6/dist/index.mjs +2 -0
- package/vendor/miller-columns/CHANGES.md +185 -0
- package/vendor/miller-columns/LICENSE-MIT.txt +21 -0
- package/vendor/miller-columns/README.md +249 -0
- package/vendor/miller-columns/demos/index.html +69 -0
- package/vendor/miller-columns/demos/index.js +72 -0
- package/vendor/miller-columns/dist/index-es.js +748 -0
- package/vendor/miller-columns/dist/index-es.min.d.ts +25 -0
- package/vendor/miller-columns/dist/index-es.min.js +7 -1
- package/vendor/miller-columns/dist/index-umd.js +757 -0
- package/vendor/miller-columns/dist/index-umd.min.js +7 -0
- package/vendor/miller-columns/dist/index.d.ts +25 -0
- package/vendor/miller-columns/dist/millerColumns.d.ts +10 -0
- package/vendor/miller-columns/eslint.config.js +46 -0
- package/vendor/miller-columns/fix-declarations.js +18 -0
- package/vendor/miller-columns/miller-columns.css +24 -1
- package/vendor/miller-columns/package.json +73 -0
- package/vendor/miller-columns/pnpm-workspace.yaml +2 -0
- package/vendor/miller-columns/src/index.js +642 -0
- package/vendor/miller-columns/src/millerColumns.ts +12 -0
- package/vendor/miller-columns/tsconfig-prod.json +23 -0
- package/vendor/miller-columns/tsconfig.json +21 -0
- package/vendor/simple-prefs/dist/index.esm.d.ts +1 -0
- package/vendor/simple-prefs/dist/index.esm.js +164 -216
- package/vendor/simple-prefs/dist/simple-prefs.d.ts +117 -0
- package/lgtm.yml +0 -5
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* eslint-disable camelcase -- i18n */
|
|
2
|
-
import {jml, body, $, $$, nbsp} from '
|
|
2
|
+
import {jml, body, $, $$, nbsp} from 'jamilih/dist/jml.js';
|
|
3
3
|
import {fill} from '../templateUtils/fill.js';
|
|
4
4
|
import {safeLink} from '../templateUtils/validation.js';
|
|
5
5
|
// import encodings from '../encodings.js';
|
|
@@ -8,13 +8,21 @@ import unicodecharref from '../unicodecharref.js';
|
|
|
8
8
|
import CharrefConverterBridges from '../charrefConverters.js';
|
|
9
9
|
import {registerDTD} from '../entityBehaviors.js';
|
|
10
10
|
|
|
11
|
+
/**
|
|
12
|
+
* @param {{
|
|
13
|
+
* _: import('intl-dom').I18NCallback<string>,
|
|
14
|
+
* fonts: string[]
|
|
15
|
+
* }} cfg
|
|
16
|
+
*/
|
|
11
17
|
const indexTemplate = function ({_, fonts}) {
|
|
12
|
-
|
|
18
|
+
/** @type {HTMLHtmlElement} */
|
|
19
|
+
($('html')).lang = _.resolvedLocale;
|
|
13
20
|
document.title = _('uresults_title');
|
|
14
21
|
jml('div', {
|
|
15
22
|
role: 'main'
|
|
16
23
|
}, [
|
|
17
|
-
|
|
24
|
+
/** @type {import('jamilih/dist/jml.js').JamilihArray} */
|
|
25
|
+
(['div', {
|
|
18
26
|
id: 'unicodeTabBox',
|
|
19
27
|
style: 'width: 700px;',
|
|
20
28
|
class: 'tabbox'
|
|
@@ -59,10 +67,14 @@ const indexTemplate = function ({_, fonts}) {
|
|
|
59
67
|
class: 'searchBox',
|
|
60
68
|
$on: {
|
|
61
69
|
async change () {
|
|
62
|
-
await unicodecharref.startset(
|
|
70
|
+
await unicodecharref.startset(
|
|
71
|
+
/** @type {HTMLInputElement} */ (this)
|
|
72
|
+
);
|
|
63
73
|
},
|
|
64
74
|
async input () {
|
|
65
|
-
await unicodecharref.startset(
|
|
75
|
+
await unicodecharref.startset(
|
|
76
|
+
/** @type {HTMLInputElement} */ (this)
|
|
77
|
+
);
|
|
66
78
|
}
|
|
67
79
|
}
|
|
68
80
|
}],
|
|
@@ -71,10 +83,16 @@ const indexTemplate = function ({_, fonts}) {
|
|
|
71
83
|
class: 'searchBox',
|
|
72
84
|
$on: {
|
|
73
85
|
async change () {
|
|
74
|
-
await unicodecharref.searchUnicode(
|
|
86
|
+
await unicodecharref.searchUnicode(
|
|
87
|
+
/** @type {HTMLInputElement} */
|
|
88
|
+
(this)
|
|
89
|
+
);
|
|
75
90
|
},
|
|
76
91
|
async input () {
|
|
77
|
-
await unicodecharref.searchUnicode(
|
|
92
|
+
await unicodecharref.searchUnicode(
|
|
93
|
+
/** @type {HTMLInputElement} */
|
|
94
|
+
(this)
|
|
95
|
+
);
|
|
78
96
|
}
|
|
79
97
|
}
|
|
80
98
|
}],
|
|
@@ -83,10 +101,16 @@ const indexTemplate = function ({_, fonts}) {
|
|
|
83
101
|
class: 'searchBox',
|
|
84
102
|
$on: {
|
|
85
103
|
change () {
|
|
86
|
-
unicodecharref.searchUnihan(
|
|
104
|
+
unicodecharref.searchUnihan(
|
|
105
|
+
/** @type {HTMLInputElement} */
|
|
106
|
+
(this)
|
|
107
|
+
);
|
|
87
108
|
},
|
|
88
109
|
input () {
|
|
89
|
-
unicodecharref.searchUnihan(
|
|
110
|
+
unicodecharref.searchUnihan(
|
|
111
|
+
/** @type {HTMLInputElement} */
|
|
112
|
+
(this)
|
|
113
|
+
);
|
|
90
114
|
}
|
|
91
115
|
}
|
|
92
116
|
}]
|
|
@@ -177,7 +201,12 @@ const indexTemplate = function ({_, fonts}) {
|
|
|
177
201
|
class: 'charthbox',
|
|
178
202
|
$on: {
|
|
179
203
|
async click (e) {
|
|
180
|
-
await unicodecharref.onlyentsyesflip(
|
|
204
|
+
await unicodecharref.onlyentsyesflip(
|
|
205
|
+
/**
|
|
206
|
+
* @type {Event & {target: HTMLInputElement}}
|
|
207
|
+
*/
|
|
208
|
+
(e)
|
|
209
|
+
);
|
|
181
210
|
}
|
|
182
211
|
}
|
|
183
212
|
}],
|
|
@@ -192,7 +221,12 @@ const indexTemplate = function ({_, fonts}) {
|
|
|
192
221
|
id: 'rowsset',
|
|
193
222
|
$on: {
|
|
194
223
|
async change (e) {
|
|
195
|
-
await unicodecharref.rowsset(
|
|
224
|
+
await unicodecharref.rowsset(
|
|
225
|
+
/**
|
|
226
|
+
* @type {Event & {target: HTMLInputElement}}
|
|
227
|
+
*/
|
|
228
|
+
(e)
|
|
229
|
+
);
|
|
196
230
|
}
|
|
197
231
|
}
|
|
198
232
|
}]
|
|
@@ -204,7 +238,12 @@ const indexTemplate = function ({_, fonts}) {
|
|
|
204
238
|
id: 'colsset',
|
|
205
239
|
$on: {
|
|
206
240
|
async change (e) {
|
|
207
|
-
await unicodecharref.colsset(
|
|
241
|
+
await unicodecharref.colsset(
|
|
242
|
+
/**
|
|
243
|
+
* @type {Event & {target: HTMLInputElement}}
|
|
244
|
+
*/
|
|
245
|
+
(e)
|
|
246
|
+
);
|
|
208
247
|
}
|
|
209
248
|
}
|
|
210
249
|
}]
|
|
@@ -218,7 +257,12 @@ const indexTemplate = function ({_, fonts}) {
|
|
|
218
257
|
class: 'charthbox',
|
|
219
258
|
$on: {
|
|
220
259
|
async click (e) {
|
|
221
|
-
await unicodecharref.entflip(
|
|
260
|
+
await unicodecharref.entflip(
|
|
261
|
+
/**
|
|
262
|
+
* @type {Event & {target: HTMLInputElement}}
|
|
263
|
+
*/
|
|
264
|
+
(e)
|
|
265
|
+
);
|
|
222
266
|
}
|
|
223
267
|
}
|
|
224
268
|
}],
|
|
@@ -232,7 +276,12 @@ const indexTemplate = function ({_, fonts}) {
|
|
|
232
276
|
class: 'charthbox',
|
|
233
277
|
$on: {
|
|
234
278
|
async click (e) {
|
|
235
|
-
await unicodecharref.decflip(
|
|
279
|
+
await unicodecharref.decflip(
|
|
280
|
+
/**
|
|
281
|
+
* @type {Event & {target: HTMLInputElement}}
|
|
282
|
+
*/
|
|
283
|
+
(e)
|
|
284
|
+
);
|
|
236
285
|
}
|
|
237
286
|
}
|
|
238
287
|
}],
|
|
@@ -246,7 +295,12 @@ const indexTemplate = function ({_, fonts}) {
|
|
|
246
295
|
class: 'charthbox',
|
|
247
296
|
$on: {
|
|
248
297
|
async click (e) {
|
|
249
|
-
await unicodecharref.hexflip(
|
|
298
|
+
await unicodecharref.hexflip(
|
|
299
|
+
/**
|
|
300
|
+
* @type {Event & {target: HTMLInputElement}}
|
|
301
|
+
*/
|
|
302
|
+
(e)
|
|
303
|
+
);
|
|
250
304
|
}
|
|
251
305
|
}
|
|
252
306
|
}],
|
|
@@ -260,7 +314,12 @@ const indexTemplate = function ({_, fonts}) {
|
|
|
260
314
|
class: 'charthbox',
|
|
261
315
|
$on: {
|
|
262
316
|
async click (e) {
|
|
263
|
-
await unicodecharref.unicodeflip(
|
|
317
|
+
await unicodecharref.unicodeflip(
|
|
318
|
+
/**
|
|
319
|
+
* @type {Event & {target: HTMLInputElement}}
|
|
320
|
+
*/
|
|
321
|
+
(e)
|
|
322
|
+
);
|
|
264
323
|
}
|
|
265
324
|
}
|
|
266
325
|
}],
|
|
@@ -275,7 +334,12 @@ const indexTemplate = function ({_, fonts}) {
|
|
|
275
334
|
class: 'charthbox',
|
|
276
335
|
$on: {
|
|
277
336
|
async click (e) {
|
|
278
|
-
await unicodecharref.middleflip(
|
|
337
|
+
await unicodecharref.middleflip(
|
|
338
|
+
/**
|
|
339
|
+
* @type {Event & {target: HTMLInputElement}}
|
|
340
|
+
*/
|
|
341
|
+
(e)
|
|
342
|
+
);
|
|
279
343
|
}
|
|
280
344
|
}
|
|
281
345
|
}],
|
|
@@ -289,7 +353,12 @@ const indexTemplate = function ({_, fonts}) {
|
|
|
289
353
|
class: 'charthbox',
|
|
290
354
|
$on: {
|
|
291
355
|
async click (e) {
|
|
292
|
-
await unicodecharref.buttonflip(
|
|
356
|
+
await unicodecharref.buttonflip(
|
|
357
|
+
/**
|
|
358
|
+
* @type {Event & {target: HTMLInputElement}}
|
|
359
|
+
*/
|
|
360
|
+
(e)
|
|
361
|
+
);
|
|
293
362
|
}
|
|
294
363
|
}
|
|
295
364
|
}],
|
|
@@ -301,7 +370,7 @@ const indexTemplate = function ({_, fonts}) {
|
|
|
301
370
|
nbsp.repeat(2),
|
|
302
371
|
['button', {class: 'fontsize', $on: {
|
|
303
372
|
click () {
|
|
304
|
-
unicodecharref.tblfontsize(
|
|
373
|
+
unicodecharref.tblfontsize(1);
|
|
305
374
|
}
|
|
306
375
|
}}, [_('plus')]],
|
|
307
376
|
nbsp,
|
|
@@ -321,8 +390,12 @@ const indexTemplate = function ({_, fonts}) {
|
|
|
321
390
|
id: 'font',
|
|
322
391
|
size: '12',
|
|
323
392
|
$custom: {
|
|
393
|
+
/**
|
|
394
|
+
* @param {string} val
|
|
395
|
+
*/
|
|
324
396
|
$setFontFamily (val) {
|
|
325
|
-
|
|
397
|
+
/** @type {HTMLTextAreaElement} */
|
|
398
|
+
($('#insertText')).style.fontFamily = val;
|
|
326
399
|
// Form elements don't inherit, so find these
|
|
327
400
|
// manually
|
|
328
401
|
$$('#chart_table button[name="unicode"]').
|
|
@@ -333,8 +406,21 @@ const indexTemplate = function ({_, fonts}) {
|
|
|
333
406
|
},
|
|
334
407
|
$on: {
|
|
335
408
|
async change (e) {
|
|
336
|
-
await unicodecharref.setprefs(
|
|
337
|
-
|
|
409
|
+
await unicodecharref.setprefs(
|
|
410
|
+
/**
|
|
411
|
+
* @type {Event & {target: HTMLInputElement}}
|
|
412
|
+
*/
|
|
413
|
+
(e)
|
|
414
|
+
);
|
|
415
|
+
/**
|
|
416
|
+
* @type {HTMLInputElement & {
|
|
417
|
+
* $setFontFamily: (val: string) => void
|
|
418
|
+
* }}
|
|
419
|
+
*/
|
|
420
|
+
(this).$setFontFamily(
|
|
421
|
+
/** @type {HTMLInputElement} */
|
|
422
|
+
(this).value
|
|
423
|
+
);
|
|
338
424
|
}
|
|
339
425
|
}
|
|
340
426
|
}],
|
|
@@ -342,8 +428,20 @@ const indexTemplate = function ({_, fonts}) {
|
|
|
342
428
|
? [
|
|
343
429
|
['br'],
|
|
344
430
|
['select', {id: 'font-list', $on: {
|
|
431
|
+
/**
|
|
432
|
+
* @this {HTMLSelectElement}
|
|
433
|
+
*/
|
|
345
434
|
async change () {
|
|
346
|
-
|
|
435
|
+
const font =
|
|
436
|
+
/**
|
|
437
|
+
* @type {HTMLInputElement & {
|
|
438
|
+
* $setFontFamily: (val: string) => void
|
|
439
|
+
* }}
|
|
440
|
+
*/ (
|
|
441
|
+
$('#font')
|
|
442
|
+
);
|
|
443
|
+
font.value =
|
|
444
|
+
(this).value;
|
|
347
445
|
await unicodecharref.setprefs({
|
|
348
446
|
target: {
|
|
349
447
|
type: 'select-one',
|
|
@@ -351,7 +449,7 @@ const indexTemplate = function ({_, fonts}) {
|
|
|
351
449
|
value: this.value
|
|
352
450
|
}
|
|
353
451
|
});
|
|
354
|
-
|
|
452
|
+
font.$setFontFamily(this.value);
|
|
355
453
|
}
|
|
356
454
|
}}, [
|
|
357
455
|
['option', [
|
|
@@ -377,9 +475,19 @@ const indexTemplate = function ({_, fonts}) {
|
|
|
377
475
|
id: 'lang',
|
|
378
476
|
size: '5',
|
|
379
477
|
$on: {
|
|
478
|
+
/**
|
|
479
|
+
* @this {HTMLInputElement}
|
|
480
|
+
* @param {Event} e
|
|
481
|
+
*/
|
|
380
482
|
async change (e) {
|
|
381
|
-
await unicodecharref.setprefs(
|
|
382
|
-
|
|
483
|
+
await unicodecharref.setprefs(
|
|
484
|
+
/**
|
|
485
|
+
* @type {Event & {target: HTMLInputElement}}
|
|
486
|
+
*/
|
|
487
|
+
(e)
|
|
488
|
+
);
|
|
489
|
+
/** @type {HTMLElement} */
|
|
490
|
+
($('#chart_table')).lang = this.value;
|
|
383
491
|
}
|
|
384
492
|
}
|
|
385
493
|
}]
|
|
@@ -436,7 +544,12 @@ const indexTemplate = function ({_, fonts}) {
|
|
|
436
544
|
type: 'checkbox',
|
|
437
545
|
$on: {
|
|
438
546
|
async click (e) {
|
|
439
|
-
await unicodecharref.setImagePref(
|
|
547
|
+
await unicodecharref.setImagePref(
|
|
548
|
+
/**
|
|
549
|
+
* @type {Event & {target: HTMLInputElement}}
|
|
550
|
+
*/
|
|
551
|
+
(e)
|
|
552
|
+
);
|
|
440
553
|
}
|
|
441
554
|
}
|
|
442
555
|
}],
|
|
@@ -472,7 +585,8 @@ const indexTemplate = function ({_, fonts}) {
|
|
|
472
585
|
['div', [
|
|
473
586
|
['button', {id: 'clearoutput', $on: {
|
|
474
587
|
click () {
|
|
475
|
-
|
|
588
|
+
/** @type {HTMLTextAreaElement} */
|
|
589
|
+
($('#insertText')).value = '';
|
|
476
590
|
}
|
|
477
591
|
}}, [
|
|
478
592
|
_('button_clearoutput')
|
|
@@ -533,7 +647,12 @@ const indexTemplate = function ({_, fonts}) {
|
|
|
533
647
|
id: 'showAllDetailedView',
|
|
534
648
|
$on: {
|
|
535
649
|
async click (e) {
|
|
536
|
-
await unicodecharref.setprefs(
|
|
650
|
+
await unicodecharref.setprefs(
|
|
651
|
+
/**
|
|
652
|
+
* @type {Event & {target: HTMLInputElement}}
|
|
653
|
+
*/
|
|
654
|
+
(e)
|
|
655
|
+
);
|
|
537
656
|
}
|
|
538
657
|
}
|
|
539
658
|
}],
|
|
@@ -570,9 +689,9 @@ const indexTemplate = function ({_, fonts}) {
|
|
|
570
689
|
_(key),
|
|
571
690
|
nbsp.repeat(2),
|
|
572
691
|
[
|
|
573
|
-
key
|
|
574
|
-
|
|
575
|
-
|
|
692
|
+
key === 'decompositionMapping' ||
|
|
693
|
+
key === 'numericType' ||
|
|
694
|
+
key.includes('case_Mapping')
|
|
576
695
|
? 'span'
|
|
577
696
|
: 'input',
|
|
578
697
|
{
|
|
@@ -599,7 +718,12 @@ const indexTemplate = function ({_, fonts}) {
|
|
|
599
718
|
id: 'showAllDetailedCJKView',
|
|
600
719
|
$on: {
|
|
601
720
|
async click (e) {
|
|
602
|
-
await unicodecharref.setprefs(
|
|
721
|
+
await unicodecharref.setprefs(
|
|
722
|
+
/**
|
|
723
|
+
* @type {Event & {target: HTMLInputElement}}
|
|
724
|
+
*/
|
|
725
|
+
(e)
|
|
726
|
+
);
|
|
603
727
|
}
|
|
604
728
|
}
|
|
605
729
|
}],
|
|
@@ -823,7 +947,7 @@ const indexTemplate = function ({_, fonts}) {
|
|
|
823
947
|
nbsp.repeat(2),
|
|
824
948
|
['button', {class: 'fontsize', $on: {
|
|
825
949
|
click () {
|
|
826
|
-
unicodecharref.fontsizetextbox(
|
|
950
|
+
unicodecharref.fontsizetextbox(1);
|
|
827
951
|
}
|
|
828
952
|
}}, [
|
|
829
953
|
_('plus')
|
|
@@ -875,7 +999,7 @@ const indexTemplate = function ({_, fonts}) {
|
|
|
875
999
|
hidden: true
|
|
876
1000
|
}, [
|
|
877
1001
|
['label', [
|
|
878
|
-
['
|
|
1002
|
+
['progress', {id: 'progress_element'}]
|
|
879
1003
|
]],
|
|
880
1004
|
['button', {
|
|
881
1005
|
id: 'closeDownloadProgressBox',
|
|
@@ -896,9 +1020,7 @@ const indexTemplate = function ({_, fonts}) {
|
|
|
896
1020
|
const url = new URL(location.href);
|
|
897
1021
|
navigator.registerProtocolHandler(
|
|
898
1022
|
'web+unicode',
|
|
899
|
-
url.protocol + '://' + url.host + url.pathname + '?customProtocol=%s'
|
|
900
|
-
// Deprecated title arg but required for some browsers
|
|
901
|
-
'Unicode'
|
|
1023
|
+
url.protocol + '://' + url.host + url.pathname + '?customProtocol=%s'
|
|
902
1024
|
);
|
|
903
1025
|
}
|
|
904
1026
|
}}, [
|
|
@@ -910,7 +1032,12 @@ const indexTemplate = function ({_, fonts}) {
|
|
|
910
1032
|
_('initialTab_label'), nbsp.repeat(3),
|
|
911
1033
|
['select', {id: 'initialTab', $on: {
|
|
912
1034
|
async change (e) {
|
|
913
|
-
await unicodecharref.setprefs(
|
|
1035
|
+
await unicodecharref.setprefs(
|
|
1036
|
+
/**
|
|
1037
|
+
* @type {Event & {target: HTMLInputElement}}
|
|
1038
|
+
*/
|
|
1039
|
+
(e)
|
|
1040
|
+
);
|
|
914
1041
|
}
|
|
915
1042
|
}}, [
|
|
916
1043
|
['option', {
|
|
@@ -942,7 +1069,12 @@ const indexTemplate = function ({_, fonts}) {
|
|
|
942
1069
|
class: 'topofpanel',
|
|
943
1070
|
$on: {
|
|
944
1071
|
async click (e) {
|
|
945
|
-
await unicodecharref.hexLettersCasing(
|
|
1072
|
+
await unicodecharref.hexLettersCasing(
|
|
1073
|
+
/**
|
|
1074
|
+
* @type {Event & {target: HTMLInputElement}}
|
|
1075
|
+
*/
|
|
1076
|
+
(e)
|
|
1077
|
+
);
|
|
946
1078
|
}
|
|
947
1079
|
}
|
|
948
1080
|
}],
|
|
@@ -956,7 +1088,12 @@ const indexTemplate = function ({_, fonts}) {
|
|
|
956
1088
|
id: 'asciiLt128',
|
|
957
1089
|
$on: {
|
|
958
1090
|
async click (e) {
|
|
959
|
-
await unicodecharref.setprefs(
|
|
1091
|
+
await unicodecharref.setprefs(
|
|
1092
|
+
/**
|
|
1093
|
+
* @type {Event & {target: HTMLInputElement}}
|
|
1094
|
+
*/
|
|
1095
|
+
(e)
|
|
1096
|
+
);
|
|
960
1097
|
}
|
|
961
1098
|
}
|
|
962
1099
|
}],
|
|
@@ -971,7 +1108,12 @@ const indexTemplate = function ({_, fonts}) {
|
|
|
971
1108
|
class: 'topofpanel',
|
|
972
1109
|
$on: {
|
|
973
1110
|
async click (e) {
|
|
974
|
-
await unicodecharref.setprefs(
|
|
1111
|
+
await unicodecharref.setprefs(
|
|
1112
|
+
/**
|
|
1113
|
+
* @type {Event & {target: HTMLInputElement}}
|
|
1114
|
+
*/
|
|
1115
|
+
(e)
|
|
1116
|
+
);
|
|
975
1117
|
}
|
|
976
1118
|
}
|
|
977
1119
|
}],
|
|
@@ -986,7 +1128,12 @@ const indexTemplate = function ({_, fonts}) {
|
|
|
986
1128
|
class: 'topofpanel',
|
|
987
1129
|
$on: {
|
|
988
1130
|
async click (e) {
|
|
989
|
-
await unicodecharref.setprefs(
|
|
1131
|
+
await unicodecharref.setprefs(
|
|
1132
|
+
/**
|
|
1133
|
+
* @type {Event & {target: HTMLInputElement}}
|
|
1134
|
+
*/
|
|
1135
|
+
(e)
|
|
1136
|
+
);
|
|
990
1137
|
}
|
|
991
1138
|
}
|
|
992
1139
|
}],
|
|
@@ -1001,7 +1148,12 @@ const indexTemplate = function ({_, fonts}) {
|
|
|
1001
1148
|
class: 'topofpanel',
|
|
1002
1149
|
$on: {
|
|
1003
1150
|
async click (e) {
|
|
1004
|
-
await unicodecharref.setprefs(
|
|
1151
|
+
await unicodecharref.setprefs(
|
|
1152
|
+
/**
|
|
1153
|
+
* @type {Event & {target: HTMLInputElement}}
|
|
1154
|
+
*/
|
|
1155
|
+
(e)
|
|
1156
|
+
);
|
|
1005
1157
|
}
|
|
1006
1158
|
}
|
|
1007
1159
|
}],
|
|
@@ -1016,7 +1168,12 @@ const indexTemplate = function ({_, fonts}) {
|
|
|
1016
1168
|
class: 'topofpanel',
|
|
1017
1169
|
$on: {
|
|
1018
1170
|
async click (e) {
|
|
1019
|
-
await unicodecharref.setprefs(
|
|
1171
|
+
await unicodecharref.setprefs(
|
|
1172
|
+
/**
|
|
1173
|
+
* @type {Event & {target: HTMLInputElement}}
|
|
1174
|
+
*/
|
|
1175
|
+
(e)
|
|
1176
|
+
);
|
|
1020
1177
|
}
|
|
1021
1178
|
}
|
|
1022
1179
|
}],
|
|
@@ -1049,7 +1206,12 @@ const indexTemplate = function ({_, fonts}) {
|
|
|
1049
1206
|
class: 'topofpanel',
|
|
1050
1207
|
$on: {
|
|
1051
1208
|
async click (e) {
|
|
1052
|
-
await unicodecharref.setprefs(
|
|
1209
|
+
await unicodecharref.setprefs(
|
|
1210
|
+
/**
|
|
1211
|
+
* @type {Event & {target: HTMLInputElement}}
|
|
1212
|
+
*/
|
|
1213
|
+
(e)
|
|
1214
|
+
);
|
|
1053
1215
|
}
|
|
1054
1216
|
}
|
|
1055
1217
|
}],
|
|
@@ -1062,7 +1224,12 @@ const indexTemplate = function ({_, fonts}) {
|
|
|
1062
1224
|
id: 'CSSWhitespace',
|
|
1063
1225
|
$on: {
|
|
1064
1226
|
async change (e) {
|
|
1065
|
-
await unicodecharref.cssWhitespace(
|
|
1227
|
+
await unicodecharref.cssWhitespace(
|
|
1228
|
+
/**
|
|
1229
|
+
* @type {Event & {target: HTMLInputElement}}
|
|
1230
|
+
*/
|
|
1231
|
+
(e)
|
|
1232
|
+
);
|
|
1066
1233
|
}
|
|
1067
1234
|
}
|
|
1068
1235
|
}, [
|
|
@@ -1192,7 +1359,7 @@ const indexTemplate = function ({_, fonts}) {
|
|
|
1192
1359
|
]],
|
|
1193
1360
|
['div', {style: 'text-align: center; margin-top: 10px;'}, [
|
|
1194
1361
|
['button', {class: 'dtdbutton', $on: {click () {
|
|
1195
|
-
unicodecharref.insertent(
|
|
1362
|
+
unicodecharref.insertent();
|
|
1196
1363
|
}}}, [
|
|
1197
1364
|
_('DTD_insertent')
|
|
1198
1365
|
]]
|
|
@@ -1203,7 +1370,12 @@ const indexTemplate = function ({_, fonts}) {
|
|
|
1203
1370
|
type: 'checkbox',
|
|
1204
1371
|
$on: {
|
|
1205
1372
|
async click (e) {
|
|
1206
|
-
await unicodecharref.append2htmlflip(
|
|
1373
|
+
await unicodecharref.append2htmlflip(
|
|
1374
|
+
/**
|
|
1375
|
+
* @type {Event & {target: HTMLInputElement}}
|
|
1376
|
+
*/
|
|
1377
|
+
(e)
|
|
1378
|
+
);
|
|
1207
1379
|
}
|
|
1208
1380
|
}
|
|
1209
1381
|
}],
|
|
@@ -1281,7 +1453,7 @@ const indexTemplate = function ({_, fonts}) {
|
|
|
1281
1453
|
About_ial_onetongue_link: jml('a', {
|
|
1282
1454
|
class: 'text-link',
|
|
1283
1455
|
target: '_blank',
|
|
1284
|
-
href: '
|
|
1456
|
+
href: 'https://onetongue.com'
|
|
1285
1457
|
}, [
|
|
1286
1458
|
_('About_ial_onetongue_linkText')
|
|
1287
1459
|
])
|
|
@@ -1289,14 +1461,16 @@ const indexTemplate = function ({_, fonts}) {
|
|
|
1289
1461
|
]]
|
|
1290
1462
|
]]
|
|
1291
1463
|
]]
|
|
1292
|
-
]]
|
|
1464
|
+
]])
|
|
1293
1465
|
], body);
|
|
1294
1466
|
|
|
1295
1467
|
// See why intl-dom not apparently keeping event handlers
|
|
1296
|
-
|
|
1468
|
+
/** @type {HTMLButtonElement} */
|
|
1469
|
+
($('#donationbutton')).addEventListener('click', () => {
|
|
1297
1470
|
window.open(
|
|
1298
1471
|
'https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=brettz9%40yahoo%2ecom&no_shipping=0&no_note=1&tax=0¤cy_code=USD&bn=PP%2dDonationsBF&charset=UTF%2d8',
|
|
1299
|
-
'bzamirdonation'
|
|
1472
|
+
'bzamirdonation',
|
|
1473
|
+
'noopener'
|
|
1300
1474
|
);
|
|
1301
1475
|
});
|
|
1302
1476
|
};
|
|
@@ -1,31 +1,51 @@
|
|
|
1
|
-
import {jml, $$} from '
|
|
1
|
+
import {jml, $$} from 'jamilih/dist/jml.js';
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* @typedef {HTMLElement & {
|
|
5
|
+
* $getTabs: () => HTMLElement[],
|
|
6
|
+
* $getTabPanels: () => HTMLElement[],
|
|
7
|
+
* $selectTabForTabPanel: (tabPanel: HTMLDivElement) => void
|
|
8
|
+
* $selectTab: (tab: Element) => void,
|
|
9
|
+
* $selectedTab: () => HTMLElement
|
|
10
|
+
* }} TabBox
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* @param {string} sel The selector
|
|
15
|
+
*/
|
|
3
16
|
export const makeTabBox = function (sel) {
|
|
4
|
-
|
|
17
|
+
/**
|
|
18
|
+
* @type {TabBox[]}
|
|
19
|
+
*/
|
|
20
|
+
($$(sel)).forEach(function (tabbox) {
|
|
5
21
|
tabbox.$getTabs = function () {
|
|
6
|
-
return [
|
|
22
|
+
return /** @type {HTMLElement[]} */ ([...(/** @type {HTMLElement} */ (
|
|
23
|
+
this.querySelector('.tabs')
|
|
24
|
+
)).children].filter((child) => {
|
|
7
25
|
return child.classList.contains('tab');
|
|
8
|
-
});
|
|
26
|
+
}));
|
|
9
27
|
};
|
|
10
28
|
tabbox.$getTabPanels = function () {
|
|
11
|
-
return [
|
|
12
|
-
|
|
13
|
-
|
|
29
|
+
return /** @type {HTMLElement[]} */ (
|
|
30
|
+
[...this.children].filter((tabPanel) => {
|
|
31
|
+
return tabPanel.classList.contains('tabpanel');
|
|
32
|
+
})
|
|
33
|
+
);
|
|
14
34
|
};
|
|
15
35
|
tabbox.$selectTabForTabPanel = function (tabPanel) {
|
|
16
36
|
const tabs = tabbox.$getTabs();
|
|
17
37
|
const tab = tabs.find((tb) => {
|
|
18
38
|
return tb.dataset.label === tabPanel.dataset.label;
|
|
19
39
|
});
|
|
20
|
-
|
|
40
|
+
tabbox.$selectTab(/** @type {Element} */ (tab));
|
|
21
41
|
};
|
|
22
42
|
tabbox.$selectTab = function (tab) {
|
|
23
43
|
const tabs = tabbox.$getTabs();
|
|
24
44
|
tabbox.$getTabPanels().forEach((tabPanel, i) => {
|
|
25
45
|
const childTab = tabs[i];
|
|
26
46
|
if (tab === childTab) {
|
|
27
|
-
childTab.dataset.selected = true;
|
|
28
|
-
tabPanel.dataset.selected = true;
|
|
47
|
+
childTab.dataset.selected = 'true';
|
|
48
|
+
tabPanel.dataset.selected = 'true';
|
|
29
49
|
} else {
|
|
30
50
|
delete childTab.dataset.selected;
|
|
31
51
|
delete tabPanel.dataset.selected;
|
|
@@ -33,11 +53,14 @@ export const makeTabBox = function (sel) {
|
|
|
33
53
|
});
|
|
34
54
|
};
|
|
35
55
|
tabbox.$selectedTab = function (/* tab */) {
|
|
36
|
-
return
|
|
37
|
-
|
|
38
|
-
|
|
56
|
+
return /** @type {HTMLElement} */ (
|
|
57
|
+
tabbox.$getTabPanels().find(({dataset: {selected}}) => {
|
|
58
|
+
return selected;
|
|
59
|
+
})
|
|
60
|
+
);
|
|
39
61
|
};
|
|
40
|
-
|
|
62
|
+
/** @type {HTMLElement} */
|
|
63
|
+
(tabbox.querySelector('.tabs')).prepend(...tabbox.$getTabPanels().map(({
|
|
41
64
|
dataset: {title, selected, label}
|
|
42
65
|
}) => {
|
|
43
66
|
// Set to h1 for accessibility, though styles will reduce default size
|
|
@@ -50,7 +73,9 @@ export const makeTabBox = function (sel) {
|
|
|
50
73
|
tabbox.$selectTab(this);
|
|
51
74
|
}
|
|
52
75
|
}
|
|
53
|
-
}, [
|
|
76
|
+
}, [
|
|
77
|
+
/** @type {string} */ (label)
|
|
78
|
+
]);
|
|
54
79
|
}), jml('br', {style: 'clear: left;'}));
|
|
55
80
|
});
|
|
56
81
|
};
|