copy auch für divs
This commit is contained in:
parent
6f4c30fc7a
commit
588347e71d
@ -9,6 +9,15 @@ function copyToClipboard(id) {
|
|||||||
document.execCommand("copy");
|
document.execCommand("copy");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function copyDivToClipboard(id) {
|
||||||
|
let range = document.createRange();
|
||||||
|
range.selectNode(document.getElementById(id));
|
||||||
|
window.getSelection().removeAllRanges();
|
||||||
|
window.getSelection().addRange(range);
|
||||||
|
document.execCommand("copy");
|
||||||
|
window.getSelection().removeAllRanges();
|
||||||
|
}
|
||||||
|
|
||||||
function copiedToClipboard(id) {
|
function copiedToClipboard(id) {
|
||||||
var tooltip = document.getElementById(id);
|
var tooltip = document.getElementById(id);
|
||||||
tooltip.innerHTML = "Kopiert";
|
tooltip.innerHTML = "Kopiert";
|
||||||
|
|||||||
2
copy-to-clipboard.min.css
vendored
2
copy-to-clipboard.min.css
vendored
@ -1 +1 @@
|
|||||||
.copy-to-clipboard{position:relative;display:inline-block}.copy-to-clipboard .tooltiptext{visibility:hidden;width:140px;background-color:#555;color:#fff;text-align:center;border-radius:6px;padding:5px;position:absolute;z-index:1;bottom:150%;left:50%;margin-left:-75px}.copy-to-clipboard .tooltiptext::after{content:"";position:absolute;top:100%;left:50%;margin-left:-5px;border-width:5px;border-style:solid;border-color:#555 transparent transparent transparent}.copy-to-clipboard:hover .tooltiptext{visibility:visible;opacity:1}
|
.copy-to-clipboard{position:relative;display:inline-block}.copy-to-clipboard .tooltiptext{visibility:hidden;width:140px;background-color:#555;color:#fff;text-align:center;border-radius:6px;padding:5px;position:absolute;z-index:1;bottom:150%;left:50%;margin-left:-75px}.copy-to-clipboard .tooltiptext::after{content:"";position:absolute;top:100%;left:50%;margin-left:-5px;border-width:5px;border-style:solid;border-color:#555 transparent transparent}.copy-to-clipboard:hover .tooltiptext{visibility:visible;opacity:1}
|
||||||
3
copy-to-clipboard.min.js
vendored
3
copy-to-clipboard.min.js
vendored
@ -1,2 +1 @@
|
|||||||
function copyToClipboard(id){var copyText=document.getElementById(id);copyText.select(),copyText.setSelectionRange(0,99999),document.execCommand("copy")}function copiedToClipboard(id){var tooltip;document.getElementById(id).innerHTML="Kopiert"}function resetClipboard(id){var tooltip;document.getElementById(id).innerHTML="Kopieren"}
|
function copyToClipboard(e){var n=document.getElementById(e);n.select(),n.setSelectionRange(0,99999),document.execCommand("copy")}function copyDivToClipboard(e){let n=document.createRange();n.selectNode(document.getElementById(e)),window.getSelection().removeAllRanges(),window.getSelection().addRange(n),document.execCommand("copy"),window.getSelection().removeAllRanges()}function copiedToClipboard(e){document.getElementById(e).innerHTML="Kopiert"}function resetClipboard(e){document.getElementById(e).innerHTML="Kopieren"}
|
||||||
//# sourceMappingURL=copy-to-clipboard.min.js.map
|
|
||||||
Loading…
Reference in New Issue
Block a user