From 525edb86c0e4286f0ce061bddd8c98e194f92dde Mon Sep 17 00:00:00 2001 From: Mike Tzou Date: Tue, 17 Mar 2020 01:01:50 +0800 Subject: trypandoc: Add checkbox for standalone option (#6189) --- trypandoc/index.html | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'trypandoc/index.html') diff --git a/trypandoc/index.html b/trypandoc/index.html index ea7cacc2d..2b42ab179 100644 --- a/trypandoc/index.html +++ b/trypandoc/index.html @@ -32,8 +32,9 @@ function newpage() { var input = $("#text").val(); var from = $("#from").val(); var to = $("#to").val(); + var standalone = $("#standalone").is(':checked') ? "1" : "0"; var href = window.location.href; - window.location.href = href.replace(/([?].*)?$/,"?" + $.param({text: input, from: from, to: to})); + window.location.href = href.replace(/([?].*)?$/,"?" + $.param({text: input, from: from, to: to, standalone: standalone})); }; $(document).ready(function() { @@ -43,8 +44,10 @@ $(document).ready(function() { $("#from").val(from); var to = $.QueryString["to"] || "html"; $("#to").val(to); + var standalone = ($.QueryString["standalone"] === "1") ? "1" : "0" + $("#standalone").prop('checked', (standalone === "1")); if (text && text != "") { - $.getJSON("/cgi-bin/trypandoc", { from: from, to: to, text: text }, + $.getJSON("/cgi-bin/trypandoc", { from: from, to: to, text: text, standalone: standalone }, function(res) { $("#results").text(res.html); $("#version").text(res.version); @@ -116,6 +119,10 @@ $(document).ready(function() { + +
-- cgit v1.2.3