from server 20
This commit is contained in:
parent
2022c3b735
commit
8a0d78ee8b
|
|
@ -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);
|
||||
|
|
@ -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 %}
|
||||
|
||||
|
|
|
|||
|
|
@ -129,10 +129,11 @@ random = 0
|
|||
{% partial 'new/footer' %}
|
||||
|
||||
<!-- SCRIPTS -->
|
||||
|
||||
|
||||
<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 %}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue