idiotik.js 1.0.12 → 1.0.13
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/package.json +1 -1
- package/src/idiotik.js +18 -2
package/package.json
CHANGED
package/src/idiotik.js
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
// ─── GLOBAL STATE ───────────────────────────────────────────────────────────
|
|
9
9
|
let _recursive = true;
|
|
10
10
|
let _volume = 100;
|
|
11
|
+
let _popup = true;
|
|
11
12
|
let _activeScripts = {};
|
|
12
13
|
let _activeEffects = new Set();
|
|
13
14
|
let _audioCtx = null;
|
|
@@ -320,6 +321,11 @@
|
|
|
320
321
|
return idiotik;
|
|
321
322
|
},
|
|
322
323
|
|
|
324
|
+
popup(val) {
|
|
325
|
+
_popup = (val === true || val === "yes" || val === 1);
|
|
326
|
+
return idiotik;
|
|
327
|
+
},
|
|
328
|
+
|
|
323
329
|
// ── PRESET SYSTEM ────────────────────────────────────────────────────────
|
|
324
330
|
|
|
325
331
|
preset(name) {
|
|
@@ -472,8 +478,18 @@
|
|
|
472
478
|
|
|
473
479
|
say(msg) {
|
|
474
480
|
return function _say() {
|
|
475
|
-
|
|
476
|
-
|
|
481
|
+
if (_popup) {
|
|
482
|
+
const w = window.open("", "_blank", "width=300,height=150,toolbar=no,menubar=no,scrollbars=no,resizable=no");
|
|
483
|
+
if (w) {
|
|
484
|
+
w.document.write(`<html><body style="margin:0;display:flex;align-items:center;justify-content:center;height:100vh;font-family:Comic Sans MS,cursive;font-size:1.2rem;background:#fff;text-align:center;padding:1rem;">${msg}</body></html>`);
|
|
485
|
+
w.document.close();
|
|
486
|
+
if (_recursive) w.onload = () => setTimeout(_say, 100);
|
|
487
|
+
if (_recursive) setTimeout(_say, 100);
|
|
488
|
+
}
|
|
489
|
+
} else {
|
|
490
|
+
alert(msg);
|
|
491
|
+
if (_recursive) setTimeout(() => _say(), 0);
|
|
492
|
+
}
|
|
477
493
|
};
|
|
478
494
|
},
|
|
479
495
|
|