mirror of
https://github.com/status-im/NimYAML.git
synced 2025-01-13 21:15:13 +00:00
Testing ground works in Firefox
This commit is contained in:
parent
bbd2e297e4
commit
f543bc231a
@ -30,7 +30,7 @@
|
||||
<div class="twelve-columns footer">
|
||||
<span class="nim-sprite"></span>
|
||||
<br/>
|
||||
<small>Made with Nim. Generated: 2016-01-13 22:41:14 UTC</small>
|
||||
<small>Made with Nim. Generated: 2016-01-13 23:09:48 UTC</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -311,7 +311,7 @@ contains all local tags that are used for type serialization. Does not contain a
|
||||
<div class="twelve-columns footer">
|
||||
<span class="nim-sprite"></span>
|
||||
<br/>
|
||||
<small>Made with Nim. Generated: 2016-01-13 22:41:14 UTC</small>
|
||||
<small>Made with Nim. Generated: 2016-01-13 23:09:48 UTC</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
23
testing.html
23
testing.html
@ -82,6 +82,12 @@
|
||||
</div>
|
||||
</article>
|
||||
<script type="text/javascript">
|
||||
function setTextContent(element, text) {
|
||||
while (element.firstChild!==null) {
|
||||
element.removeChild(element.firstChild); // remove all existing content
|
||||
}
|
||||
element.appendChild(document.createTextNode(text));
|
||||
}
|
||||
function parse() {
|
||||
var r = new XMLHttpRequest();
|
||||
var params = "style=" + encodeURIComponent(document.querySelector(
|
||||
@ -96,28 +102,27 @@
|
||||
var result = JSON.parse(r.responseText);
|
||||
switch(result.code) {
|
||||
case 0:
|
||||
output.innerText = result.output;
|
||||
setTextContent(output, result.output);
|
||||
output.style.color = "black";
|
||||
break;
|
||||
case 1:
|
||||
output.innerText = "Parser error at line " + result.line +
|
||||
setTextContent(output, "Parser error at line " + result.line +
|
||||
", column " + result.column + ":\n" + result.message +
|
||||
"\n\n" + result.detail;
|
||||
"\n\n" + result.detail);
|
||||
output.style.color = "orange";
|
||||
break;
|
||||
case 2:
|
||||
output.innerText = "Presenter error:\n" + result.message;
|
||||
setTextContent(output, "Presenter error:\n" + result.message);
|
||||
output.style.color = "orange";
|
||||
break;
|
||||
}
|
||||
} else if (r.status == 0) {
|
||||
output.innerText =
|
||||
"YAML parser server does not seem to be available.";
|
||||
setTextContent(output,
|
||||
"YAML parser server does not seem to be available.");
|
||||
output.style.color = "red";
|
||||
} else {
|
||||
output.innerText = "Status: " + r.status +
|
||||
"\nException occurred on server:\n\n" +
|
||||
r.responseText;
|
||||
setTextContent(output, "Status: " + r.status +
|
||||
"\nException occurred on server:\n\n" + r.responseText);
|
||||
output.style.color = "red";
|
||||
}
|
||||
}
|
||||
|
@ -726,7 +726,7 @@ Parser <tt class="docutils literal"><span class="pre">input</span></tt> as YAML
|
||||
<div class="twelve-columns footer">
|
||||
<span class="nim-sprite"></span>
|
||||
<br/>
|
||||
<small>Made with Nim. Generated: 2016-01-13 22:41:13 UTC</small>
|
||||
<small>Made with Nim. Generated: 2016-01-13 23:09:47 UTC</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
Loading…
x
Reference in New Issue
Block a user