From 121e6f1eb1e41eaf287805998c61852d9b30b590 Mon Sep 17 00:00:00 2001 From: itsdivyanshjain Date: Sun, 25 Sep 2022 10:08:12 -0400 Subject: [PATCH 1/2] added copy to clipboard json_event --- web/static/index.html | 4 ++++ web/static/report/json_parse.js | 4 ++++ web/static/report/table_items.html | 5 ++++- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/web/static/index.html b/web/static/index.html index b748e172e..fc9ed5293 100644 --- a/web/static/index.html +++ b/web/static/index.html @@ -34,9 +34,13 @@ document.getElementById("json_length").innerText = ""; renderjson.set_icons('▶','▼') renderjson.set_collapse_msg(function (asd) {return "...";}); + arr = []; for (let i=1; i<=length; i++) { value = document.getElementById("json_event_"+i).innerText; + arr.push(value); document.getElementById("json_event_"+i).innerText = ""; + document.getElementById("json_clipboard_"+i).addEventListener("click", function() { navigator.clipboard.writeText(arr[i-1]); }); + //document.getElementById("json_clipboard"+i).json_clipboard_ document.getElementById("json_event_"+i).appendChild(renderjson(JSON.parse(value))); } diff --git a/web/static/report/json_parse.js b/web/static/report/json_parse.js index 5fd5226f5..dd44eebcc 100644 --- a/web/static/report/json_parse.js +++ b/web/static/report/json_parse.js @@ -3,9 +3,13 @@ document.getElementById("json_length").innerText = ""; renderjson.set_icons('▶','▼') renderjson.set_collapse_msg(function (asd) {return "...";}); + arr = []; for (let i=1; i<=length; i++) { value = document.getElementById("json_event_"+i).innerText; + arr.push(value); document.getElementById("json_event_"+i).innerText = ""; + document.getElementById("json_clipboard_"+i).addEventListener("click", function() { navigator.clipboard.writeText(arr[i-1]); }); + //document.getElementById("json_clipboard"+i).json_clipboard_ document.getElementById("json_event_"+i).appendChild(renderjson(JSON.parse(value))); } \ No newline at end of file diff --git a/web/static/report/table_items.html b/web/static/report/table_items.html index 7218e73fa..da669a47e 100644 --- a/web/static/report/table_items.html +++ b/web/static/report/table_items.html @@ -1 +1,4 @@ -{0}{1}{2}{3}{4}{6} \ No newline at end of file +{0}{1}{2}{3}{4}
{6}
\ No newline at end of file From 0602baaba564ccdbf16b1620166a37f3a03e6c40 Mon Sep 17 00:00:00 2001 From: itsdivyanshjain Date: Sun, 25 Sep 2022 11:41:30 -0400 Subject: [PATCH 2/2] removed commented debug --- web/static/index.html | 1 - web/static/report/json_parse.js | 1 - 2 files changed, 2 deletions(-) diff --git a/web/static/index.html b/web/static/index.html index fc9ed5293..e50391d8f 100644 --- a/web/static/index.html +++ b/web/static/index.html @@ -40,7 +40,6 @@ arr.push(value); document.getElementById("json_event_"+i).innerText = ""; document.getElementById("json_clipboard_"+i).addEventListener("click", function() { navigator.clipboard.writeText(arr[i-1]); }); - //document.getElementById("json_clipboard"+i).json_clipboard_ document.getElementById("json_event_"+i).appendChild(renderjson(JSON.parse(value))); } diff --git a/web/static/report/json_parse.js b/web/static/report/json_parse.js index dd44eebcc..b1c56bae0 100644 --- a/web/static/report/json_parse.js +++ b/web/static/report/json_parse.js @@ -9,7 +9,6 @@ arr.push(value); document.getElementById("json_event_"+i).innerText = ""; document.getElementById("json_clipboard_"+i).addEventListener("click", function() { navigator.clipboard.writeText(arr[i-1]); }); - //document.getElementById("json_clipboard"+i).json_clipboard_ document.getElementById("json_event_"+i).appendChild(renderjson(JSON.parse(value))); } \ No newline at end of file