From 280bc8f3bad4649dda1af61188afdd381a2b40d8 Mon Sep 17 00:00:00 2001 From: lyxal <36217120+Lyxal@users.noreply.github.com> Date: Fri, 17 Nov 2023 21:47:52 +1100 Subject: [PATCH] Get ready for template --- latest.html | 21 ++++++--------------- main.js | 48 +++++++++--------------------------------------- 2 files changed, 15 insertions(+), 54 deletions(-) diff --git a/latest.html b/latest.html index 7acc271..fe2c29d 100644 --- a/latest.html +++ b/latest.html @@ -5,6 +5,7 @@ + Vyxal 3 Interpreter - - - - - + + + + @@ -149,4 +140,4 @@

import(remotePath)); - return response; -} - -importOr("./vyxal.js", "https://vyxal.github.io/Vyxal/vyxal.js").then( - response => { - Vyxal = response.Vyxal; - window.Vyxal = Vyxal - codepage = Vyxal.getCodepage(); - - fetchOr("/ShortDictionary.txt", "https://vyxal.github.io/Vyxal/ShortDictionary.txt").then( - (text) => { - shortDict = text - Vyxal.setShortDict(shortDict) +var codepage = Vyxal.getCodepage() - }) - fetchOr("/LongDictionary.txt", "https://vyxal.github.io/Vyxal/LongDictionary.txt").then( - (text) => { - longDict = text - Vyxal.setLongDict(longDict) - } - ) - } -); - - -importOr("./helpText.js", "https://vyxal.github.io/Vyxal/helpText.js").then( - response => { - HelpText = response.HelpText; - } -); const $ = x => document.getElementById(x) @@ -354,12 +325,12 @@ function initCodeMirror() { function resize(elem) { var dummy = $$$("#dummy") dummy.style.fontFamily = getComputedStyle($$$('.CodeMirror.cm-s-default')).fontFamily - dummy.style.fontSize = '15px' + dummy.style.fontSize = '12px' dummy.style.lineHeight = '24px' dummy.value = elem.doc.getValue() elem.setSize( null, - (elem.lineCount() * 22) + 24 + (elem.lineCount() * 24) + 24 ) elem.refresh(); dummy.value = "" @@ -371,7 +342,7 @@ function initCodeMirror() { } let mode = { - mode: 'vyxal', + mode: '', lineWrapping: true, autofocus: true, } @@ -440,7 +411,6 @@ function initCodeMirror() { } for (const boxId of ['header', 'code', 'footer']) { - console.log(boxId) globalThis['e_' + boxId] = CodeMirror.fromTextArea($$$('#' + boxId), boxId === 'code' ? codeMode : mode) globalThis['e_' + boxId].on('change', cm => { resize(globalThis['e_' + boxId])