aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2020-07-10 22:56:42 +0200
committerHugo Hörnquist <hugo@lysator.liu.se>2020-07-10 22:56:42 +0200
commitc240cb743eb5c6523525eb749786f8137a50edc0 (patch)
tree961aa0060031675578bc811fc6fe95da83d76cf4
parentJavascript bind properties to object. (diff)
downloadcalp-c240cb743eb5c6523525eb749786f8137a50edc0.tar.gz
calp-c240cb743eb5c6523525eb749786f8137a50edc0.tar.xz
Remove Javascript XML pretty printer.
-rw-r--r--static/script.js43
1 files changed, 0 insertions, 43 deletions
diff --git a/static/script.js b/static/script.js
index ce2cc4d7..afbb66eb 100644
--- a/static/script.js
+++ b/static/script.js
@@ -1,46 +1,3 @@
-/* ------- XML Formatting --------------------------- */
-
-function start_tag(str) {
- return "<span class='html-tag'>&lt;" + str + "&gt;</span>";
-}
-
-function end_tag(str) {
- return "<span class='html-tag'>&lt;/" + str + "&gt;</span>";
-}
-
-function self_tag(str) {
- return "<span class='html-tag'>&lt;" + str + "/&gt;</span>";
-}
-
-function istring(indent) {
- return "".padStart(indent);
-}
-
-function pretty_print_xml(xml, indent=0) {
- /* pretty_print_xml(xml.documentElement) */
-
- let tag = xml.tagName;
-
-
- if (xml.childElementCount == 0) {
- if (xml.textContent) {
- return istring(indent)
- + start_tag(tag)
- + "<b>" + xml.textContent + "</b>"
- + end_tag(tag);
- } else {
- return istring(indent) + self_tag(tag);
- }
- } else {
- let str = istring(indent) + start_tag(tag) + "<br/>";
- for (let child of xml.children) {
- str += pretty_print_xml(child, indent + 1) + "<br/>";
- }
- str += istring(indent) + end_tag(tag);
- return str;
- }
-}
-
/* -------------------------------------------------- */
function round_time (time, fraction) {