From cbc25df5b41af8500d089646e4ce739a4ef521cf Mon Sep 17 00:00:00 2001 From: Christian Cleberg Date: Fri, 22 Mar 2024 21:55:34 -0500 Subject: create live preview pane --- static/app.js | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'static/app.js') diff --git a/static/app.js b/static/app.js index 7da442b..36f6c89 100644 --- a/static/app.js +++ b/static/app.js @@ -1,3 +1,14 @@ +window.onkeyup = keyup; +var inputText; + +function keyup(e) { + // inputText = e.target.value; + inputText = parseOrg(); + + const preview = document.getElementById("preview"); + preview.innerHTML = inputText; +} + function parseOrg() { var orgCode = document.getElementById("editor").value; var orgParser = new Org.Parser(); -- cgit v1.2.3