js_lis 1.0.14 → 1.0.15
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/VirtualKeyboard.js +27 -21
- package/package.json +1 -1
package/VirtualKeyboard.js
CHANGED
|
@@ -20,30 +20,36 @@ export class VirtualKeyboard {
|
|
|
20
20
|
this.initialize();
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
async initialize() {
|
|
24
|
-
try {
|
|
25
|
-
await this.generateKey();
|
|
26
|
-
this.render();
|
|
27
|
-
this.initializeInputListeners();
|
|
28
|
-
console.log("VirtualKeyboard initialized successfully.");
|
|
29
|
-
} catch (error) {
|
|
30
|
-
console.error("Error initializing VirtualKeyboard:", error);
|
|
31
|
-
}
|
|
23
|
+
async initialize() {
|
|
24
|
+
try {
|
|
25
|
+
await this.generateKey();
|
|
26
|
+
this.render();
|
|
27
|
+
this.initializeInputListeners();
|
|
28
|
+
console.log("VirtualKeyboard initialized successfully.");
|
|
29
|
+
} catch (error) {
|
|
30
|
+
console.error("Error initializing VirtualKeyboard:", error);
|
|
31
|
+
}
|
|
32
32
|
}
|
|
33
|
+
|
|
33
34
|
|
|
34
|
-
async generateKey() {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}
|
|
35
|
+
async generateKey() {
|
|
36
|
+
if (window.crypto && window.crypto.subtle) {
|
|
37
|
+
try {
|
|
38
|
+
this.cryptoKey = await window.crypto.subtle.generateKey(
|
|
39
|
+
{ name: "AES-GCM", length: 256 },
|
|
40
|
+
true,
|
|
41
|
+
["encrypt", "decrypt"]
|
|
42
|
+
);
|
|
43
|
+
} catch (error) {
|
|
44
|
+
console.error("Error generating key:", error);
|
|
45
|
+
throw error;
|
|
46
|
+
}
|
|
47
|
+
} else {
|
|
48
|
+
console.error("Web Crypto API is not supported in this environment.");
|
|
49
|
+
throw new Error("Web Crypto API is not supported.");
|
|
46
50
|
}
|
|
51
|
+
}
|
|
52
|
+
|
|
47
53
|
|
|
48
54
|
async encodeText(text) {
|
|
49
55
|
const encodedData = new TextEncoder().encode(text);
|