-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: [esx_property\client\html\copy.html]: remove jquery
- Loading branch information
1 parent
d9b91d8
commit 3711d3c
Showing
2 changed files
with
27 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 24 additions & 21 deletions
45
server-data/resources/[esx_addons]/esx_property/client/html/copy.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,28 @@ | ||
<!-- Cred: https://github.com/TerbSEC/FiveM-CoordsSaver/tree/master/html --> | ||
<html> | ||
<head> | ||
<script src="nui://game/ui/jquery.js" type="text/javascript"></script> | ||
</head> | ||
<script> | ||
function ready(fn) { | ||
if (document.readyState !== "loading") { | ||
fn(); | ||
} else { | ||
document.addEventListener("DOMContentLoaded", fn); | ||
}} | ||
|
||
<script> | ||
$(document).ready(function(){ | ||
window.addEventListener("message", function(event) { | ||
var node = document.createElement("textarea"); | ||
var selection = document.getSelection(); | ||
|
||
node.textContent = event.data.link; | ||
document.body.appendChild(node); | ||
|
||
selection.removeAllRanges(); | ||
node.select(); | ||
document.execCommand("copy"); | ||
|
||
selection.removeAllRanges(); | ||
document.body.removeChild(node); | ||
}); | ||
}); | ||
</script> | ||
ready(function () { | ||
window.addEventListener("message", function (event) { | ||
let node = document.createElement("textarea"); | ||
let selection = document.getSelection(); | ||
|
||
node.textContent = event.data.link; | ||
document.body.appendChild(node); | ||
|
||
selection.removeAllRanges(); | ||
node.select(); | ||
document.execCommand("copy"); | ||
|
||
selection.removeAllRanges(); | ||
document.body.removeChild(node); | ||
}); | ||
}); | ||
</script> | ||
</html> |