mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-03-09 15:40:18 +00:00
Fixed copy to clipboard to work on non-firefox/chrome browsers.
This commit is contained in:
parent
7e6d4e6b48
commit
684d266ad1
3 changed files with 9 additions and 7 deletions
|
@ -285,8 +285,9 @@
|
|||
else { openTab(null, 'wintab64'); }
|
||||
}
|
||||
|
||||
function copyToClipLinuxInstall() { navigator.clipboard.writeText(linuxInstall); }
|
||||
function copyToClipLinuxUnInstall() { navigator.clipboard.writeText(linuxUnInstall); }
|
||||
function copyToClipLinuxInstall() { copyTextToClip(linuxInstall); }
|
||||
function copyToClipLinuxUnInstall() { copyTextToClip(linuxUnInstall); }
|
||||
function copyTextToClip(txt) { function selectElementText(e) { if (document.selection) { var range = document.body.createTextRange(); range.moveToElementText(e); range.select(); } else if (window.getSelection) { var range = document.createRange(); range.selectNode(e); window.getSelection().removeAllRanges(); window.getSelection().addRange(range); } } var e = document.createElement('DIV'); e.textContent = txt; document.body.appendChild(e); selectElementText(e); document.execCommand('copy'); e.remove(); }
|
||||
|
||||
</script>
|
||||
</body>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue