From 1599f6dad8e89d23e838da257fb4c07e0871a187 Mon Sep 17 00:00:00 2001 From: EP Date: Fri, 22 Aug 2025 12:53:15 -0700 Subject: [PATCH] Advanced Settings: call correct engine method setStegOptions and unescape values; fixes 'engine missing' --- js/app.js | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/js/app.js b/js/app.js index 17005dd..590bedf 100644 --- a/js/app.js +++ b/js/app.js @@ -128,21 +128,26 @@ window.app = new Vue({ const orderSel = document.querySelector('.steg-bit-order'); const trailSel = document.querySelector('.steg-trailing-zw'); - if (window.steganography && window.steganography.setOptions) { - window.steganography.setOptions({ - initialPresentation: initSel && initSel.value || 'none', - vsZero: vs0Sel && vs0Sel.value || '\\ufe0e', - vsOne: vs1Sel && vs1Sel.value || '\\ufe0f', - interbitZW: zwSel && zwSel.value || '', - interbitEvery: Math.max(1, Math.min(8, Number(everyInput && everyInput.value || 1))), - bitOrder: orderSel && orderSel.value || 'msb', - trailingZW: trailSel && trailSel.value || '' + const parseEsc = (s)=>{ + if (!s) return s; + try { return eval(`'${s}'`); } catch(_) { return s; } + }; + + if (window.steganography && window.steganography.setStegOptions) { + window.steganography.setStegOptions({ + initialPresentation: (initSel && initSel.value) || 'none', + bitZeroVS: parseEsc(vs0Sel && vs0Sel.value) || '\ufe0e', + bitOneVS: parseEsc(vs1Sel && vs1Sel.value) || '\ufe0f', + interBitZW: parseEsc(zwSel && zwSel.value) || null, + interBitEvery: Math.max(1, Math.min(8, Number((everyInput && everyInput.value) || 1))), + bitOrder: (orderSel && orderSel.value) || 'msb', + trailingZW: parseEsc(trailSel && trailSel.value) || '' }); this.unicodeApplyFlash = true; this.showNotification(' Advanced settings applied', 'success'); setTimeout(()=>{ this.unicodeApplyFlash = false; }, 1200); } else { - this.showNotification(' Engine missing setOptions()', 'warning'); + this.showNotification(' Engine missing setStegOptions()', 'warning'); } } catch (e) { console.error('Apply Unicode options error', e);