1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-07 23:27:17 +02:00

Unify textarea highlighting

This commit is contained in:
Jakub Vrana
2025-03-31 19:30:23 +02:00
parent 63ab8561be
commit cfde891ea4
3 changed files with 8 additions and 11 deletions

View File

@@ -46,6 +46,10 @@ function syntaxHighlighting(version, vendor) {
const pre = jush.textarea(tag);
if (pre) {
setupSubmitHighlightInput(pre);
tag.onchange = () => {
pre.textContent = tag.value;
pre.oninput();
};
}
}
}

View File

@@ -82,6 +82,7 @@ for (const el of qsa('textarea')) {
}
});
setupSubmitHighlightInput(cm.getWrapperElement());
el.onchange = () => cm.setValue(el.value);
}
}
</script>

View File

@@ -59,17 +59,9 @@ const geminiText = qsl('textarea');
const geminiButton = qsl('input');
function setSqlareaValue(value) {
qs('textarea.sqlarea').value = value;
const jushPre = qs('pre.sqlarea');
if (jushPre) {
jushPre.textContent = value;
jushPre.oninput(); // syntax highlighting
}
const cmPre = qs('.CodeMirror');
if (cmPre) {
cmPre.CodeMirror.setValue(value);
cmPre.CodeMirror.refresh();
}
const sqlarea = qs('textarea.sqlarea');
sqlarea.value = value;
sqlarea.onchange();
}
geminiButton.onclick = () => {