From 695b5f3705fbdb42dd7422e4dc88f25e895d1406 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 26 Oct 2014 21:17:10 -0700 Subject: Dingus improvements; moved to top level. --- dingus.html | 135 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 135 insertions(+) create mode 100644 dingus.html (limited to 'dingus.html') diff --git a/dingus.html b/dingus.html new file mode 100644 index 0000000..8c35fe5 --- /dev/null +++ b/dingus.html @@ -0,0 +1,135 @@ + + + + + commonmark.js demo + + + + + + + + +
+
+

commonmark.js dingus

+
+
+
+
Parsed in + ms. Rendered in ms.
+

clear 

+ +
    +
    +
    + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + + -- cgit v1.2.3 From 6c3ed4e899bfba4dddd763045fcec2375341e4fc Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Mon, 27 Oct 2014 08:48:19 -0700 Subject: dingus: Show HTML tab if query has text. This should be a safer default; if someone sends you dangerous HTML, you'll see it immediately. --- dingus.html | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'dingus.html') diff --git a/dingus.html b/dingus.html index 8c35fe5..7c3a7c7 100644 --- a/dingus.html +++ b/dingus.html @@ -20,7 +20,7 @@ function getQueryVariable(variable) var pair = vars[i].split("="); if(pair[0] == variable){return decodeURIComponent(pair[1]);} } - return(''); + return null; } @@ -64,7 +64,12 @@ $(document).ready(function() { render(); }, 0); // ms delay }; - $("#text").val(getQueryVariable("text")); + var initial_text = getQueryVariable("text"); + if (initial_text) { + $("#text").val(initial_text); + // show HTML tab if text is from query + $('#result-tabs a[href="#result"]').tab('show'); + } parseAndRender(); $("#clear-text-box").click(function(e) { $("#text").val(''); @@ -114,7 +119,7 @@ $(document).ready(function() {
      -