diff --git a/index.html b/index.html index 203bf3a..3cb925f 100644 --- a/index.html +++ b/index.html @@ -8,6 +8,8 @@ + + diff --git a/main.css b/main.css index 7b83af4..b19ea89 100644 --- a/main.css +++ b/main.css @@ -5,4 +5,10 @@ .incomplete { color: gray !important; -} \ No newline at end of file +} + +#editor { + display: none; + width: 100%; + height: 100%; +} diff --git a/main.js b/main.js index f7c569e..29d92de 100644 --- a/main.js +++ b/main.js @@ -29,8 +29,9 @@ $.get({ // setup function setup(data, mode) { - editor = new CodeMirror(document.body, { - value: data, + let el = document.getElementById("editor"); + el.value = data; + editor = CodeMirror.fromTextArea(el, { mode: mode, readOnly: true, autofocus: true, @@ -42,6 +43,8 @@ function setup(data, mode) { } }); + editor.setSize("100%", "100%"); + incompleteMark = editor.doc.markText({ line: 0, ch: 0 }, getEndPos(), { className: "incomplete" });