v2.4: decouple highlight-mode toggle + settings persistence + Cmd+click on Mac

Squashed port of the v2.4.0..v2.4.6 iteration on hypercypher production. The history-table
highlight semantics no longer follow the Cross/Same query match mode — a new ▼ toggle next
to the highlight box (styled like the ⚡ auto-match button, dim/lit on/off) controls them
independently. Cross/Same checkboxes now affect only the query/modal + export (as the names
suggest). optHltSameCipher and autoMatchEnabled both round-trip through localStorage now via
calcOptionsArr. Cmd+click on macOS now works as Ctrl+click does on Win/Linux (toggle a
history value into the highlight box) — macOS routes Ctrl+click to contextmenu so the
existing gesture was unreachable for Mac.

Pure client-side; no db change (v2.3 db.json + db_lite.json Release assets still valid).
Files: calc/calc.js, calc/highlighter.js, calc/init-variables.js, calc/styles.css, index.html.
Cache-bust calc v13 / highlighter v3 / init-variables v7 / styles v9.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
malonehunterandClaude Opus 4.7 committed 2026-05-30 07:46:08 -04:00
1 parent 202fe8ed04
commit 4eb10f2bdb
6 files changed
+103 -14

No files matched your search

+3 -3
View File
@@ -266,7 +266,7 @@ function updateHistoryTableSameCiphMatch() {
if (highlt_num.indexOf(v_grid_col[n][m]) > -1) { // if value is in highlight box
for (z = m+1; z < v_grid_col[n].length; z++) { // compare vs other values in same column
// if value matches another value in the same column and is present in highlight box
if (v_grid_col[n][m] == v_grid_col[n][z]) {
if (v_grid_col[n][m] == v_grid_col[n][z]) {
hltBoolArr[m][n] = true // mark both as values to be highlighted
hltBoolArr[z][n] = true // [phrase][cipher]
}
@@ -499,7 +499,7 @@ function tdToggleHighlight(val){ // click on value in history table to toggle hi
hlt_val = JSON.stringify(highlt_num).replace(/,/g, " ") // to string
hlt_val = hlt_val.substring(1, hlt_val.length-1) // remove brackets
document.getElementById("highlightBox").value = hlt_val // update values inside textbox
if (optFiltCrossCipherMatch) { updateHistoryTable(); } else { updateHistoryTableSameCiphMatch(); }
if (!optHltSameCipher) { updateHistoryTable(); } else { updateHistoryTableSameCiphMatch(); }
return
}
@@ -508,5 +508,5 @@ function tdToggleHighlight(val){ // click on value in history table to toggle hi
document.getElementById("highlightBox").value += " " // append space if necessary
}
document.getElementById("highlightBox").value += val // append clicked value to Highlight textbox
if (optFiltCrossCipherMatch) { updateHistoryTable(); } else { updateHistoryTableSameCiphMatch(); }
if (!optHltSameCipher) { updateHistoryTable(); } else { updateHistoryTableSameCiphMatch(); }
};