-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmastercodes.js
More file actions
53 lines (46 loc) · 1.71 KB
/
mastercodes.js
File metadata and controls
53 lines (46 loc) · 1.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
// Disable right-click functionality
document.addEventListener("contextmenu", function (e) {
e.preventDefault();
});
// Prevent opening developer tools or saving/viewing source via shortcuts
document.addEventListener("keydown", function (e) {
// Block Ctrl+Shift+J or Cmd+Shift+J
if ((e.ctrlKey || e.metaKey) && e.shiftKey && e.code === "KeyJ") {
e.preventDefault();
}
// Block Ctrl+Shift+I or Cmd+Shift+I
if ((e.ctrlKey || e.metaKey) && e.shiftKey && e.code === "KeyI") {
e.preventDefault();
}
// Block F12 key
if (e.code === "F12") {
e.preventDefault();
}
// Block Ctrl+U or Cmd+Option+U
if ((e.ctrlKey || e.metaKey) && (e.code === "KeyU" || e.altKey)) {
e.preventDefault();
}
// Block Ctrl+S or Cmd+S
if ((e.ctrlKey || e.metaKey) && e.code === "KeyS") {
e.preventDefault();
}
});
document.addEventListener("DOMContentLoaded", function () {
// Version number
const versionNumber = "v2.3.0" + ".";
//Version - Top
const versionTopElements = document.querySelectorAll("#version-top");
versionTopElements.forEach(element => {
element.innerHTML = `<b>Version: ${versionNumber}</b>`;
});
//Version - Bottom
const versionBottomElements = document.querySelectorAll("#version-bottom");
versionBottomElements.forEach(element => {
element.innerHTML = `<b>Version: ${versionNumber}</b>`;
});
});
// JavaScript for showing current Year in the Footer
document.addEventListener("DOMContentLoaded", () => {
const currentYear = new Date().getFullYear();
document.getElementById("current-year").textContent = currentYear;
});