Files
openide/plugins/evaluation-plugin/core/resources/error.js
Alexey Kalina d30036c9e0 [evaluation-plugin] move evaluation plugin to community
GitOrigin-RevId: 7f2ef90142ba670bae0c92be5261bc9ccf249220
2022-03-04 13:25:26 +00:00

27 lines
912 B
JavaScript

copyBtn = document.getElementById("copyBtn");
copyBtn.style.fontSize = '20px';
copyBtn.style.padding = '0 0 0 4px';
copyBtn.title = 'Copy to Clipboard';
copyBtn.onclick = function () {
let textArea = document.createElement("textarea");
textArea.style.position = 'fixed';
textArea.style.top = '0';
textArea.style.left = '0';
textArea.style.width = '2em';
textArea.style.height = '2em';
textArea.style.padding = '0';
textArea.style.border = 'none';
textArea.style.outline = 'none';
textArea.style.boxShadow = 'none';
textArea.style.background = 'transparent';
textArea.value = document.getElementById('stackTrace').textContent;
document.body.appendChild(textArea);
textArea.focus();
textArea.select();
try {
document.execCommand('copy')
} catch (e) {
console.log("Did not copy :(")
}
document.body.removeChild(textArea)
};