From 40d19301c72d4313a4dd8cd2cb2ecf3a908e4167 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Z=C3=A1le=C5=A1=C3=A1k?= Date: Sun, 31 Jan 2021 21:23:41 +0100 Subject: [PATCH] =?UTF-8?q?P=C5=99id=C3=A1n=C3=AD=20xml=20editoru?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- css/style.css | 5 +---- index.html | 3 ++- js/view.js | 7 ++++++- videos/example.xml | 1 + 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/css/style.css b/css/style.css index 01096b6..04b1227 100644 --- a/css/style.css +++ b/css/style.css @@ -346,12 +346,9 @@ form input { gap: 1em; } -#textInput textarea { +#textInput #textArea { width: 100%; height: 100%; - resize: none; - padding: 0; - margin: 0; } #textInput input { diff --git a/index.html b/index.html index cbc84bb..7d54c84 100644 --- a/index.html +++ b/index.html @@ -12,6 +12,7 @@ + @@ -56,7 +57,7 @@ diff --git a/js/view.js b/js/view.js index 2c7fa80..b57b9e1 100644 --- a/js/view.js +++ b/js/view.js @@ -24,7 +24,12 @@ class View { Connect.setRequestHeader("Content-Type", "text/xml"); Connect.send(null); // Place the response in an XML document. - textArea.value = Connect.responseText; + var exampleText = document.createTextNode(Connect.responseText); + textArea.append(exampleText); + + this.editor = ace.edit("textArea"); + this.editor.setTheme("ace/theme/github"); + this.editor.getSession().setMode("ace/mode/xml"); } drawCommentTitles(comments) { diff --git a/videos/example.xml b/videos/example.xml index aac171b..4e40aae 100644 --- a/videos/example.xml +++ b/videos/example.xml @@ -14,4 +14,5 @@ --> + \ No newline at end of file