from server 20

This commit is contained in:
root 2023-01-20 22:10:54 +05:00
parent 2022c3b735
commit 8a0d78ee8b
3 changed files with 16 additions and 1 deletions

View File

@ -0,0 +1,13 @@
const copyListener = (e) => {
const range = window.getSelection().getRangeAt(0),
rangeContents = range.cloneContents(),
pageLink = `Orient Link: ${document.location.href}`,
helper = document.createElement("div");
helper.appendChild(rangeContents);
event.clipboardData.setData("text/plain", `${helper.innerText}\n${pageLink}`);
event.clipboardData.setData("text/html", `${helper.innerHTML}<br>${pageLink}`);
event.preventDefault();
};
document.addEventListener("copy", copyListener);

View File

@ -119,6 +119,7 @@ default = 0
<script src="{{ 'assets/new/jquery.js'|theme}}"></script>
<script src="{{ 'assets/new/scripts/swiper/swiper-bundle.min.js'|theme}}"></script>
<script src="{{ 'assets/new/copy.js'|theme}}"></script>
{% framework extras %}
{% scripts %}

View File

@ -133,6 +133,7 @@ random = 0
<script src="{{ 'assets/new/scripts/swiper/swiper-bundle.min.js'|theme}}"></script>
{% scripts %}
<script src="{{ 'assets/new/jquery.js'|theme}}"></script>
<script src="{{ 'assets/new/copy.js'|theme}}"></script>
{% framework extras %}