Skip to content

Commit

Permalink
refactor: [esx_property\client\html\copy.html]: remove jquery
Browse files Browse the repository at this point in the history
  • Loading branch information
bitpredator committed Oct 16, 2023
1 parent d9b91d8 commit 3711d3c
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 22 deletions.
4 changes: 3 additions & 1 deletion .github/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,6 @@

<!-- Version 1.0.0 -->
1. [.github\PULL_REQUEST_TEMPLATE.md]: update the pull request template file @bitpredator
2. [esx_property\config.lua]: improves code formatting @bitpredator
2. [esx_property\config.lua]: improves code formatting @bitpredator
[esx_property\client\html\copy.html]: remove jquery @bitpredator

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>

0 comments on commit 3711d3c

Please sign in to comment.