diff --git a/democode/perleditor.html b/democode/perleditor.html
index 5fa27e1..b2e0761 100644
--- a/democode/perleditor.html
+++ b/democode/perleditor.html
@@ -309,6 +309,15 @@ function getFileData () {
return filedata;
}
+function copyit (what) {
+ var pageurl = $('#pageurl');
+ pageurl.val(what);
+ pageurl.show();
+ pageurl[0].select();
+ document.execCommand("copy");
+ pageurl.hide();
+}
+
$(function () {
var hashdata = window.location.hash.substr(1);
@@ -407,18 +416,18 @@ $(function () {
perlRunner.postMessage({ runPerl: rp_data }, '*');
});
- // "copy frame url" function
+ // "copy url / json" function
$('#copyurl').click(function () {
- var pageurl = $('#pageurl');
var data = getFileData();
data.cmdline = $('#argv').val();
var loc = new URL(window.location);
loc.hash = encodeURIComponent(JSON.stringify(data));
- pageurl.val(loc);
- pageurl.show();
- pageurl[0].select();
- document.execCommand("copy");
- pageurl.hide();
+ copyit(loc);
+ });
+ $('#copyjson').click(function () {
+ var data = getFileData();
+ data.cmdline = $('#argv').val();
+ copyit(JSON.stringify(data, null, "\t"));
});
// start looking for the Perl runner
@@ -469,7 +478,8 @@ $(function () {
Add Output File
- Copy Frame URL
+ Copy URL
+ / JSON