Přidání xml editoru

David Zálešák 3 years ago
parent a9ac73a8e8
commit 40d19301c7

@ -346,12 +346,9 @@ form input {
gap: 1em; gap: 1em;
} }
#textInput textarea { #textInput #textArea {
width: 100%; width: 100%;
height: 100%; height: 100%;
resize: none;
padding: 0;
margin: 0;
} }
#textInput input { #textInput input {

@ -12,6 +12,7 @@
<script src="./js/view.js"></script> <script src="./js/view.js"></script>
<script src="./js/video.js"></script> <script src="./js/video.js"></script>
<script src="./js/comments.js"></script> <script src="./js/comments.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.2.9/ace.js"></script>
</head> </head>
@ -56,7 +57,7 @@
<div class="hidden" id="textInput"> <div class="hidden" id="textInput">
<div>XML soubor je pro zatím nutné vytvořit v tomto editoru. GUI editor není ještě vytvořen, ale je v plánu. <div>XML soubor je pro zatím nutné vytvořit v tomto editoru. GUI editor není ještě vytvořen, ale je v plánu.
</div> </div>
<textarea name="xml" id="textArea" form="form"></textarea> <div id="textArea"></div>
<input type="submit" value="Přidat video" form="form"> <input type="submit" value="Přidat video" form="form">
</div> </div>

@ -24,7 +24,12 @@ class View {
Connect.setRequestHeader("Content-Type", "text/xml"); Connect.setRequestHeader("Content-Type", "text/xml");
Connect.send(null); Connect.send(null);
// Place the response in an XML document. // 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) { drawCommentTitles(comments) {

@ -14,4 +14,5 @@
</text> </text>
</comment> </comment>
--> -->
</video> </video>
Loading…
Cancel
Save