Source Editor
Core Editor
Evaluate
eval = function(a) { output.log(a); }
it works!
Add Source
originalEval = eval; evaluate.onclick = function() { eval = originalEval; for (let s of document.getElementsByClassName("source")) { eval(s.value); } } document.documentElement.addEventListener("keypress", event => { if (event.key !== "Enter" || !event.shiftKey) return; event.preventDefault(); document.getElementById("evaluate").click(); }) output.clear = function() { output.value = ""; } output.log = function(a) { output.value = output.value + a + "\n"; } env = {}; clearenv = function() { env = {}; } temp.clear = function() { temp.innerHTML = ""; } make_adder = function(b) { return function(t, id) { var a = document.createElement(t); a.id = id; a.add = make_adder(a); b.appendChild(a); return a; } } temp.add = make_adder(temp); function clear() { clearenv(); temp.clear(); output.clear(); } addsource.onclick = function() { let a = document.createElement("textarea"); a.classList.add("source"); a.rows="30"; a.cols="60"; sourceend.insertAdjacentElement("beforebegin", a); }
Load Core