diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/app.js | 25 | ||||
| -rw-r--r-- | src/i18n.js | 6 |
2 files changed, 23 insertions, 8 deletions
@@ -221,7 +221,7 @@ function howItWorksScreen() { ui.screen = ui.returnScreen === 'wallet' ? 'wallet' : 'unlock'; render(); }; - const para = (key) => h('p', { class: 'muted', style: 'margin:0' }, t(key)); + const para = (key) => h('p', { class: 'muted', style: 'margin:0' }, ...linkify(t(key))); return h( 'div', { class: 'col', style: 'gap:16px' }, @@ -242,9 +242,7 @@ function howItWorksScreen() { { class: 'col', style: 'gap:12px;margin-top:12px' }, para('hiwTech1'), para('hiwTech2'), - para('hiwTech3'), - para('hiwTech4'), - para('hiwTech5') + para('hiwTech4') ) ) ), @@ -252,6 +250,25 @@ function howItWorksScreen() { ); } +// Turn known tokens (e.g. mempool.space) into links within a plain string, +// returning an array of text + anchor nodes. Keeps i18n strings link-free. +const HIW_LINKS = [['mempool.space', 'https://mempool.space']]; +function linkify(text) { + const esc = (s) => s.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); + const re = new RegExp('(' + HIW_LINKS.map(([tok]) => esc(tok)).join('|') + ')', 'g'); + const out = []; + let last = 0; + let m; + while ((m = re.exec(text))) { + if (m.index > last) out.push(text.slice(last, m.index)); + const href = HIW_LINKS.find(([tok]) => tok === m[0])[1]; + out.push(h('a', { href, target: '_blank', rel: 'noopener' }, m[0])); + last = m.index + m[0].length; + } + if (last < text.length) out.push(text.slice(last)); + return out; +} + function tabBtn(label, active, onClick) { return h('button', { class: active ? 'active' : '', onClick }, label); } diff --git a/src/i18n.js b/src/i18n.js index 179cc1e..90cb2f1 100644 --- a/src/i18n.js +++ b/src/i18n.js @@ -65,11 +65,9 @@ const STR = { hiwBasics2: 'Everything happens on your device. There’s no server keeping your balance and nobody holding your coins for you. The words stay in your browser, and the page still works when you’re offline.', hiwBasics4: 'If you lose the twelve words and don’t have a backup, the coins are gone for good. There’s no reset link and no one to call, so back them up before you put money in.', hiwTechTitle: 'For the technically curious', - hiwTech1: 'There’s no backend. The whole thing is one static HTML file, so nothing on a server ever touches your keys. It reads balances and history from a public block explorer (mempool.space), and the only thing that leaves your device is your addresses, never your keys.', + hiwTech1: 'There’s no backend. This page is one static HTML file, so nothing on a server ever touches your keys. It reads balances and history from a public block explorer (mempool.space).', hiwTech2: 'It sticks to the usual Bitcoin standards: a 12-word BIP39 recovery phrase, with BIP84 native SegWit (P2WPKH) keys derived at m/84\'/0\'/0\'. If this wallet ever vanishes, drop the same phrase into Electrum, Sparrow, or any other standard wallet and your coins will be right there.', - hiwTech3: 'None of the cryptography is homemade. Key generation, signing, and hashing all happen locally through the well-worn @scure and @noble libraries (bip32, bip39, secp256k1).', - hiwTech4: 'You can save this page and open it straight off your hard drive with no connection at all. For real cold storage, keep your keys on a machine that never goes online: export a snapshot from a connected device, carry it over to sign offline, then bring the signed transaction back to something online to broadcast it.', - hiwTech5: 'Want another layer? Add a passphrase (sometimes called a 13th word) on top of your twelve. It creates a completely separate wallet and you’ll type it every time. Forget it and there’s no getting it back, so guard it as carefully as the phrase itself.', + hiwTech4: 'You can save this page and open it straight off your hard drive with no connection at all.', balance: 'Balance', pending: 'Pending', tabReceive: 'Receive', |
