diff --git a/dev/lib/codemirror.js b/dev/lib/codemirror.js index aba145d8..f80ffa0e 100644 --- a/dev/lib/codemirror.js +++ b/dev/lib/codemirror.js @@ -80,8 +80,21 @@ function elt(tag, content, className, style) { function eltP(tag, content, className, style) { var e = elt(tag, content, className, style) e.setAttribute("role", "presentation") + e.setAttribute("id", "presentation") return e } +function copyExpression() { + var expressionText = "" + document.getElementById("presentation").childNodes.forEach((child) => { + expressionText += child.innerText + }) + navigator.clipboard.writeText(expressionText) + + document.getElementById("copyExpressionButton").innerText= "Copied !" + setTimeout(() => { + document.getElementById("copyExpressionButton").innerText= "Copy Expression" + }, 800); +} var range if (document.createRange) { range = function(node, start, end, endNode) { diff --git a/index.html b/index.html index acde6aa0..bbf2e8b9 100644 --- a/index.html +++ b/index.html @@ -157,6 +157,20 @@

Menu

Expression

+
+ + + + + + + Copy Expression +