mirror of
https://github.com/xodivorce/xeorl.git
synced 2025-12-20 00:29:34 +05:30
v4.2.3
This commit is contained in:
12
htdocs/assets/js/_cookies.js
Normal file
12
htdocs/assets/js/_cookies.js
Normal file
@@ -0,0 +1,12 @@
|
||||
function acceptCookies() {
|
||||
document.cookie = "user_cookies=accepted; path=/; max-age=" + 60*60*24*30;
|
||||
document.getElementById("cookieBanner").style.display = "none";
|
||||
}
|
||||
|
||||
window.onload = function() {
|
||||
if (document.cookie.indexOf("user_cookies") === -1) {
|
||||
document.getElementById("cookieBanner").style.display = "flex";
|
||||
} else {
|
||||
document.getElementById("cookieBanner").style.display = "none";
|
||||
}
|
||||
};
|
||||
23
htdocs/assets/js/_developer_tools.js
Executable file
23
htdocs/assets/js/_developer_tools.js
Executable file
@@ -0,0 +1,23 @@
|
||||
(function() {
|
||||
function checkDevTools() {
|
||||
console.clear();
|
||||
console.log('%cSTOP!', 'color: red; font-size: 50px; font-weight: bold;');
|
||||
console.log('%cThis is a browser feature intended for developers.', 'color: white; background: red; font-size: 16px; padding: 5px;');
|
||||
console.log('%cIf someone told you to copy-paste something here to enable a premium feature or "hack" someone\'s account, it is a scam and will give them access to your Xeorl account.', 'color: white; background: black; font-size: 14px; padding: 5px;');
|
||||
}
|
||||
|
||||
function detectDevTools() {
|
||||
const threshold = 160;
|
||||
const widthThreshold = 400;
|
||||
|
||||
if (
|
||||
window.outerHeight - window.innerHeight > threshold ||
|
||||
window.outerWidth - window.innerWidth > widthThreshold
|
||||
) {
|
||||
checkDevTools();
|
||||
}
|
||||
}
|
||||
|
||||
window.addEventListener('resize', detectDevTools);
|
||||
setInterval(detectDevTools, 1000);
|
||||
})();
|
||||
@@ -1,13 +1,7 @@
|
||||
function storeEmailAndContinue() {
|
||||
// Get the email entered by the user
|
||||
var email = document.getElementById('email').value;
|
||||
|
||||
// Store the email in sessionStorage
|
||||
sessionStorage.setItem('userEmail', email);
|
||||
|
||||
// Redirect to the next step
|
||||
location.href = 'forgot_pass_step_two.php';
|
||||
}
|
||||
|
||||
// Retrieve the email from sessionStorage and display it
|
||||
document.getElementById('userEmail').textContent = sessionStorage.getItem('userEmail') || 'hygeonhealth@example.com';
|
||||
document.getElementById('userEmail').textContent = sessionStorage.getItem('userEmail') || 'supportxeorl@example.com';
|
||||
|
||||
@@ -1,66 +1,33 @@
|
||||
// // Array of background image sources
|
||||
// const images = ['assets/images/dna.jpg', 'assets/images/dna2.jpg', 'assets/images/dna3.jpg', 'assets/images/dna4.jpg'];
|
||||
// let currentIndex = 0;
|
||||
|
||||
// function changeBackgroundImage() {
|
||||
// const imgElement = document.getElementById('background-image');
|
||||
// // Fade out
|
||||
// imgElement.style.opacity = 0;
|
||||
|
||||
// setTimeout(() => {
|
||||
// // Change image source
|
||||
// currentIndex = (currentIndex + 1) % images.length;
|
||||
// imgElement.src = images[currentIndex];
|
||||
|
||||
// // Fade in
|
||||
// imgElement.style.opacity = 1;
|
||||
// }, 800); // Match this timeout with the CSS transition duration
|
||||
// }
|
||||
|
||||
// // Change image every 5 seconds
|
||||
// setInterval(changeBackgroundImage, 5000);
|
||||
|
||||
|
||||
// Password visibility toggle logic
|
||||
const passwordField = document.getElementById('password-field');
|
||||
const togglePassword = document.getElementById('toggle-password');
|
||||
|
||||
togglePassword.addEventListener('click', function () {
|
||||
// Toggle between 'password' and 'text'
|
||||
const type = passwordField.getAttribute('type') === 'password' ? 'text' : 'password';
|
||||
passwordField.setAttribute('type', type);
|
||||
|
||||
// Optionally toggle the eye icon image (if different images are needed)
|
||||
this.src = type === 'password' ? 'assets/images/eye.svg' : 'assets/images/eye-off.svg';
|
||||
});
|
||||
|
||||
// Password Reset Function
|
||||
function togglePasswordVisibility() {
|
||||
const confirmPasswordInput = document.getElementById('confirmPassword');
|
||||
if (confirmPasswordInput.type === 'password') {
|
||||
confirmPasswordInput.type = 'text'; // Show password
|
||||
} else {
|
||||
confirmPasswordInput.type = 'password'; // Hide password
|
||||
}
|
||||
confirmPasswordInput.type = confirmPasswordInput.type === 'password' ? 'text' : 'password';
|
||||
}
|
||||
// Conform Password Seen Function
|
||||
|
||||
function resetPassword() {
|
||||
const newPassword = document.getElementById('newPassword').value;
|
||||
const confirmPassword = document.getElementById('confirmPassword').value;
|
||||
const validationMessage = document.getElementById('validation-message');
|
||||
|
||||
if (newPassword.length < 8) {
|
||||
showMessage('Password must be at least 8 characters long.', '#FF0000'); // Red color for error
|
||||
showMessage('Password must be at least 8 characters long.', '#FF0000');
|
||||
return;
|
||||
}
|
||||
|
||||
if (newPassword !== confirmPassword) {
|
||||
showMessage('Passwords do not match. Please try again.', '#FF0000'); // Red color for error
|
||||
showMessage('Passwords do not match. Please try again.', '#FF0000');
|
||||
return;
|
||||
}
|
||||
|
||||
// Redirect or submit form after validation
|
||||
location.href = 'password_reset_success.php'; // Change this to your success page
|
||||
location.href = 'password_reset_success.php';
|
||||
}
|
||||
|
||||
function showMessage(message, color) {
|
||||
@@ -69,8 +36,7 @@ function showMessage(message, color) {
|
||||
validationMessage.style.color = color;
|
||||
validationMessage.style.display = 'block';
|
||||
|
||||
// Hide the message after 5 seconds (5000ms)
|
||||
setTimeout(function() {
|
||||
validationMessage.style.display = 'none';
|
||||
}, 5000);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@ document.addEventListener("DOMContentLoaded", function () {
|
||||
const burgerToggle = document.getElementById("burger-toggle");
|
||||
const sidebar = document.querySelector(".sidebar");
|
||||
|
||||
// Ensure sidebar is hidden initially
|
||||
sidebar.style.display = "none";
|
||||
|
||||
burgerToggle.addEventListener("click", function () {
|
||||
@@ -17,12 +16,11 @@ document.addEventListener("DOMContentLoaded", function () {
|
||||
});
|
||||
|
||||
window.addEventListener('scroll', function () {
|
||||
const header = document.querySelector('.header'); // Get the header element
|
||||
const header = document.querySelector('.header');
|
||||
|
||||
// Check if the page has been scrolled
|
||||
if (window.scrollY > 0) {
|
||||
header.classList.add('scrolled'); // Add the "scrolled" class
|
||||
header.classList.add('scrolled');
|
||||
} else {
|
||||
header.classList.remove('scrolled'); // Remove the "scrolled" class
|
||||
header.classList.remove('scrolled');
|
||||
}
|
||||
});
|
||||
|
||||
@@ -3,7 +3,6 @@ const form = document.querySelector(".shorten-form"),
|
||||
shortenBtn = document.querySelector("#shorten-btn"),
|
||||
linksList = document.querySelector("#links-list");
|
||||
|
||||
// Clear the list and show the "You don't have any shortened links" message
|
||||
function resetLinksList() {
|
||||
linksList.innerHTML = `
|
||||
<li id="default-message">
|
||||
@@ -18,7 +17,6 @@ function resetLinksList() {
|
||||
`;
|
||||
}
|
||||
|
||||
// Check session storage for existing links on page load
|
||||
document.addEventListener("DOMContentLoaded", () => {
|
||||
const savedLinks = sessionStorage.getItem("shortenedLinks");
|
||||
if (savedLinks) {
|
||||
@@ -35,17 +33,15 @@ shortenBtn.onclick = () => {
|
||||
if (xhr.readyState == 4 && xhr.status == 200) {
|
||||
let data = xhr.response;
|
||||
if (data.length <= 5) {
|
||||
//This is your domain name
|
||||
const domain = "xeorl.buzz/";
|
||||
// This is your shoeten domain name
|
||||
const domain = "http://localhost/Php-Projects/xeorl/htdocs//";
|
||||
let shortenURL = domain + data;
|
||||
|
||||
// Remove the default message if it exists
|
||||
const defaultMessage = document.getElementById("default-message");
|
||||
if (defaultMessage) {
|
||||
defaultMessage.remove();
|
||||
}
|
||||
|
||||
// Add the new link to the list
|
||||
let newRow = `
|
||||
<li>
|
||||
<div class="link-icon"><img src="assets/images/url.png" class="logo-img"></div>
|
||||
@@ -58,12 +54,9 @@ shortenBtn.onclick = () => {
|
||||
</li>
|
||||
`;
|
||||
|
||||
// Append the new link to the list and update session storage
|
||||
linksList.insertAdjacentHTML('afterbegin', newRow);
|
||||
sessionStorage.setItem("shortenedLinks", linksList.innerHTML);
|
||||
|
||||
// Clear the input field
|
||||
urlInput.value = "";
|
||||
urlInput.value = "";
|
||||
} else {
|
||||
alert(data);
|
||||
}
|
||||
@@ -74,7 +67,6 @@ shortenBtn.onclick = () => {
|
||||
xhr.send(formData);
|
||||
};
|
||||
|
||||
// Handle copy button clicks
|
||||
document.addEventListener('click', function(e) {
|
||||
if (e.target.closest('.copy-btn')) {
|
||||
const linkInfo = e.target.closest('li').querySelector('.short-link').textContent;
|
||||
@@ -84,13 +76,13 @@ document.addEventListener('click', function(e) {
|
||||
}
|
||||
});
|
||||
|
||||
// Handle members only delete button clicks!!
|
||||
document.addEventListener('click', function(e) {
|
||||
if (e.target.closest('.delete-btn')) {
|
||||
alert("This feature is available for members only.");
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// Handle delete button clicks
|
||||
/*
|
||||
document.addEventListener('click', function(e) {
|
||||
@@ -118,5 +110,3 @@ document.addEventListener('click', function(e) {
|
||||
}
|
||||
|
||||
});*/
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
// script.js
|
||||
|
||||
// Add any form validation or interactivity here, like checking if the fields are filled
|
||||
document.querySelector("form").addEventListener("submit", function(event) {
|
||||
const inputs = document.querySelectorAll(".input-field");
|
||||
let valid = true;
|
||||
@@ -15,40 +12,14 @@ document.querySelector("form").addEventListener("submit", function(event) {
|
||||
});
|
||||
|
||||
if (!valid) {
|
||||
event.preventDefault(); // Prevent form submission if validation fails
|
||||
event.preventDefault();
|
||||
alert("Please fill all the fields.");
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
document.getElementById('toggle-password').addEventListener('click', function () {
|
||||
const passwordField = document.getElementById('password-field');
|
||||
const passwordType = passwordField.getAttribute('type') === 'password' ? 'text' : 'password';
|
||||
passwordField.setAttribute('type', passwordType);
|
||||
|
||||
// Optionally, you can change the eye icon to an "eye-off" icon when the password is visible
|
||||
this.src = passwordType === 'password' ? 'assets/images/eye.svg' : 'assets/images/eye-off.svg';
|
||||
});
|
||||
|
||||
// // Array of background image sources
|
||||
// const images = ['assets/images/wire.jpg', 'assets/images/internet.jpg','assets/images/redworld.jpg','assets/images/travel.jpg'];
|
||||
// let currentIndex = 0;
|
||||
|
||||
// function changeBackgroundImage() {
|
||||
// const imgElement = document.getElementById('background-image');
|
||||
// // Fade out
|
||||
// imgElement.style.opacity = 0;
|
||||
|
||||
// setTimeout(() => {
|
||||
// // Change image source
|
||||
// currentIndex = (currentIndex + 1) % images.length;
|
||||
// imgElement.src = images[currentIndex];
|
||||
|
||||
// // Fade in
|
||||
// imgElement.style.opacity = 1;
|
||||
// }, 800); // Match this timeout with the CSS transition duration
|
||||
// }
|
||||
|
||||
// // Change image every 5 seconds
|
||||
// setInterval(changeBackgroundImage, 5000);
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
// script.js
|
||||
|
||||
// Add any form validation or interactivity here, like checking if the fields are filled
|
||||
document.querySelector("form").addEventListener("submit", function(event) {
|
||||
const inputs = document.querySelectorAll(".input-field");
|
||||
let valid = true;
|
||||
|
||||
|
||||
inputs.forEach(input => {
|
||||
if (input.value === "") {
|
||||
valid = false;
|
||||
@@ -15,39 +12,29 @@ document.querySelector("form").addEventListener("submit", function(event) {
|
||||
});
|
||||
|
||||
if (!valid) {
|
||||
event.preventDefault(); // Prevent form submission if validation fails
|
||||
event.preventDefault();
|
||||
alert("Please fill all the fields.");
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
document.getElementById('toggle-password').addEventListener('click', function () {
|
||||
document.getElementById('toggle-password').addEventListener('click', function() {
|
||||
const passwordField = document.getElementById('password-field');
|
||||
const passwordType = passwordField.getAttribute('type') === 'password' ? 'text' : 'password';
|
||||
passwordField.setAttribute('type', passwordType);
|
||||
|
||||
// Optionally, you can change the eye icon to an "eye-off" icon when the password is visible
|
||||
this.src = passwordType === 'password' ? 'assets/images/eye.svg' : 'assets/images/eye-off.svg';
|
||||
});
|
||||
|
||||
// // Array of background image sources
|
||||
// const images = ['assets/images/dna.jpg', 'assets/images/dna2.jpg','assets/images/dna3.jpg','assets/images/dna4.jpg'];
|
||||
// let currentIndex = 0;
|
||||
function toggleSubmitButton() {
|
||||
const checkbox = document.getElementById("agree");
|
||||
const submitBtn = document.getElementById("submit-btn");
|
||||
const errorMessage = document.getElementById("error-message");
|
||||
|
||||
// function changeBackgroundImage() {
|
||||
// const imgElement = document.getElementById('background-image');
|
||||
// // Fade out
|
||||
// imgElement.style.opacity = 0;
|
||||
if (checkbox.checked) {
|
||||
submitBtn.disabled = false;
|
||||
errorMessage.style.display = "none";
|
||||
} else {
|
||||
submitBtn.disabled = true;
|
||||
}
|
||||
}
|
||||
|
||||
// setTimeout(() => {
|
||||
// // Change image source
|
||||
// currentIndex = (currentIndex + 1) % images.length;
|
||||
// imgElement.src = images[currentIndex];
|
||||
|
||||
// // Fade in
|
||||
// imgElement.style.opacity = 1;
|
||||
// }, 800); // Match this timeout with the CSS transition duration
|
||||
// }
|
||||
|
||||
// // Change image every 5 seconds
|
||||
// setInterval(changeBackgroundImage, 5000);
|
||||
document.addEventListener("DOMContentLoaded", toggleSubmitButton);
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
// Countdown logic
|
||||
let countdown = 10;
|
||||
let countdownInterval;
|
||||
const timerElement = document.getElementById("timer");
|
||||
@@ -10,15 +9,15 @@ function updateCountdown() {
|
||||
timerElement.textContent = countdown;
|
||||
}
|
||||
if (countdown <= 0) {
|
||||
button.disabled = false; // Enable the button when countdown ends
|
||||
button.classList.add("active"); // Optional, if you use active class for style
|
||||
button.style.cursor = "pointer"; // Enable cursor
|
||||
setTimeout(function () {
|
||||
button.textContent = "Getting links..."; // Change text before enabling
|
||||
}, 300); // 0.3 seconds delay
|
||||
setTimeout(function () {
|
||||
button.textContent = "Get link"; // Final button text
|
||||
}, 600); // After another 0.3 seconds
|
||||
button.disabled = false;
|
||||
button.classList.add("active");
|
||||
button.style.cursor = "pointer";
|
||||
setTimeout(() => {
|
||||
button.textContent = "Getting links...";
|
||||
}, 300);
|
||||
setTimeout(() => {
|
||||
button.textContent = "Get link";
|
||||
}, 600);
|
||||
clearInterval(countdownInterval);
|
||||
}
|
||||
}
|
||||
@@ -32,14 +31,12 @@ function stopCountdown() {
|
||||
}
|
||||
|
||||
function init() {
|
||||
// Initialize countdown value and button state
|
||||
countdown = 10;
|
||||
timerElement.textContent = countdown;
|
||||
button.disabled = true;
|
||||
button.classList.remove("active");
|
||||
button.style.cursor = "not-allowed";
|
||||
button.textContent = "PLEASE WAIT...";
|
||||
|
||||
startCountdown();
|
||||
}
|
||||
|
||||
@@ -52,11 +49,11 @@ document.addEventListener("visibilitychange", () => {
|
||||
});
|
||||
|
||||
window.addEventListener("beforeunload", () => {
|
||||
init(); // Reset state when the page is about to be unloaded
|
||||
init();
|
||||
});
|
||||
|
||||
init(); // Call init to initialize the countdown when the page loads
|
||||
init();
|
||||
|
||||
function redirect() {
|
||||
window.location.href = redirectUrl; // Redirect to the full URL
|
||||
window.location.href = redirectUrl;
|
||||
}
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
//Right-click disable
|
||||
document.addEventListener('contextmenu', event => event.preventDefault());
|
||||
|
||||
// Disable common keyboard shortcuts for developer tools
|
||||
document.addEventListener('keydown', function(event) {
|
||||
if (event.ctrlKey && (event.key === 'I' || event.key === 'i' || event.key === 'J' || event.key === 'j' || event.key === 'U' || event.key === 'u')) {
|
||||
event.preventDefault();
|
||||
}
|
||||
if (event.key === 'F12') {
|
||||
event.preventDefault();
|
||||
}
|
||||
});
|
||||
|
||||
// Detect developer tools opening
|
||||
(function() {
|
||||
const element = new Image();
|
||||
Object.defineProperty(element, 'id', {
|
||||
get: function() {
|
||||
alert('Developer tools opened!');
|
||||
}
|
||||
});
|
||||
console.log(element);
|
||||
})();
|
||||
Reference in New Issue
Block a user