diff --git a/cara/apps/calculator/static/js/report.js b/cara/apps/calculator/static/js/report.js index 0cd59cfd..a6d53017 100644 --- a/cara/apps/calculator/static/js/report.js +++ b/cara/apps/calculator/static/js/report.js @@ -529,4 +529,15 @@ function draw_alternative_scenarios_plot(concentration_plot_svg_id, alternative_ // Redraw based on the new size whenever the browser window is resized. window.addEventListener("resize", redraw); +} + +function copy_clipboard(shareable_link) { + const el = document.createElement('textarea'); + el.value = shareable_link; + document.body.appendChild(el); + el.select(); + document.execCommand('copy'); + document.body.removeChild(el); + + alert("Shareable link copied to clipboard.") } \ No newline at end of file diff --git a/cara/apps/calculator/templates/base/calculator.report.html.j2 b/cara/apps/calculator/templates/base/calculator.report.html.j2 index 06c157dc..34c24249 100644 --- a/cara/apps/calculator/templates/base/calculator.report.html.j2 +++ b/cara/apps/calculator/templates/base/calculator.report.html.j2 @@ -155,7 +155,7 @@ {% endblock report_results %} {% block report_footer %} -