Inicial
This commit is contained in:
@@ -0,0 +1,70 @@
|
||||
if (window.history.replaceState) {
|
||||
window.history.replaceState(null, null, window.location.href);
|
||||
};
|
||||
|
||||
$(function(){
|
||||
$(".toggle-password").click(function() {
|
||||
$(this).toggleClass("fa-eye fa-eye-slash");
|
||||
var type = $(this).hasClass("fa-eye-slash") ? "text" : "password";
|
||||
$("#password").attr("type", type);
|
||||
});
|
||||
});
|
||||
|
||||
$(function(){
|
||||
$(".toggle-token").click(function() {
|
||||
$(this).toggleClass("fa-eye fa-eye-slash");
|
||||
var type = $(this).hasClass("fa-eye-slash") ? "text" : "password";
|
||||
$("#security-token").attr("type", type);
|
||||
});
|
||||
});
|
||||
|
||||
$(function(){
|
||||
$('#conf-new-email').on("cut copy paste",function(e) {
|
||||
e.preventDefault();
|
||||
});
|
||||
});
|
||||
|
||||
$(function(){
|
||||
$('.change-email-button').on('click', function(e) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
$("#change-email-response").empty();
|
||||
|
||||
var button = $(this);
|
||||
var buttonoriginal = button.html();
|
||||
var bValue = button.data('id');
|
||||
var data = {changeemail: bValue};
|
||||
data = $("#uw-change-email-form").serialize() + '&' + $.param(data);
|
||||
|
||||
changeButton(button, 'Cambiando correo');
|
||||
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: '',
|
||||
data: data,
|
||||
dataType: 'json',
|
||||
success: function(data) {
|
||||
$("#change-email-response").append(data.message).hide().slideDown();
|
||||
|
||||
if (data.success === true) {
|
||||
button.html("Correo cambiado");
|
||||
button.css("color","#d79602");
|
||||
}
|
||||
else {
|
||||
setTimeout(function() {
|
||||
$("#change-email-response").slideUp( function() {
|
||||
$("#change-email-response").empty();
|
||||
restoreButton(button, buttonoriginal);
|
||||
});
|
||||
}, 5000);
|
||||
}
|
||||
},
|
||||
error: function() {
|
||||
setTimeout(function() {
|
||||
alert("Algo ha salido mal. Por favor intente más tarde");
|
||||
window.location.reload();
|
||||
}, 2000);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,119 @@
|
||||
// Evitar el reenvío del formulario si la página se recarga
|
||||
if (window.history.replaceState) {
|
||||
window.history.replaceState(null, null, window.location.href);
|
||||
}
|
||||
|
||||
// Mostrar/ocultar la contraseña
|
||||
$(function() {
|
||||
$(".toggle-password").click(function() {
|
||||
$(this).toggleClass("fa-eye fa-eye-slash");
|
||||
const type = $(this).hasClass("fa-eye-slash") ? "text" : "password";
|
||||
$("#password").attr("type", type);
|
||||
});
|
||||
});
|
||||
|
||||
// Manejar el envío del formulario de inicio de sesión
|
||||
$(function() {
|
||||
$('.login-button').on('click', function(e) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
|
||||
const button = $(this);
|
||||
const buttonOriginal = button.html();
|
||||
const username = $("#username").val().trim();
|
||||
const password = $("#password").val().trim();
|
||||
const loginResponse = $("#login-response");
|
||||
|
||||
// Cambiar el texto del botón a "Conectando..."
|
||||
changeButton(button, 'Conectando');
|
||||
|
||||
// Validar si los campos están vacíos
|
||||
if (username === "" || password === "") {
|
||||
loginResponse.html('<span class="red-form-response">Por favor rellene todos los campos.</span>');
|
||||
loginResponse.hide().slideDown();
|
||||
|
||||
// Limpiar el mensaje y restaurar el botón después de 5 segundos
|
||||
setTimeout(function() {
|
||||
loginResponse.slideUp(function() {
|
||||
loginResponse.empty();
|
||||
restoreButton(button, buttonOriginal);
|
||||
});
|
||||
}, 5000);
|
||||
return;
|
||||
}
|
||||
|
||||
// Serializar datos para el envío
|
||||
const bValue = button.data('id');
|
||||
let data = { login: bValue };
|
||||
data = $("#uw-login-form").serialize() + '&' + $.param(data);
|
||||
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: '',
|
||||
data: data,
|
||||
dataType: 'json',
|
||||
success: function(response) {
|
||||
loginResponse.hide().empty();
|
||||
|
||||
if (response.success === true) {
|
||||
// Si el inicio de sesión es exitoso
|
||||
button.html("Conectado");
|
||||
button.css("color", "#d79602");
|
||||
|
||||
// Mostrar mensaje de conexión exitosa
|
||||
loginResponse.html('<span class="ok-form-response">Conexión exitosa.<br />Redirigiendo...</span>');
|
||||
loginResponse.hide().slideDown();
|
||||
|
||||
// Redirigir después de 3 segundos
|
||||
setTimeout(function() {
|
||||
window.location = "my-account";
|
||||
}, 3000);
|
||||
} else if (response.alert === true) {
|
||||
button.html("Sancionado");
|
||||
} else if (response.locked === true) {
|
||||
button.html("Seguridad");
|
||||
} else {
|
||||
// Mostrar mensaje para credenciales incorrectas
|
||||
loginResponse.html('<span class="red-form-response">Nombre de usuario / Contraseña incorrectos.</span>');
|
||||
loginResponse.hide().slideDown();
|
||||
|
||||
// Restaurar el botón y ocultar el mensaje después de 5 segundos
|
||||
setTimeout(function() {
|
||||
loginResponse.slideUp(function() {
|
||||
loginResponse.empty();
|
||||
restoreButton(button, buttonOriginal);
|
||||
});
|
||||
}, 5000);
|
||||
}
|
||||
},
|
||||
error: function() {
|
||||
setTimeout(function() {
|
||||
alert("Algo ha salido mal. Por favor intente más tarde");
|
||||
window.location.reload();
|
||||
}, 2000);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
// Función para cambiar el estado del botón a "Conectando"
|
||||
function changeButton(button, text) {
|
||||
button.html(text);
|
||||
button.prop("disabled", true);
|
||||
button.css({
|
||||
"color": "rgb(177, 153, 127)",
|
||||
"background-color": "rgba(255, 255, 255, 0.1)",
|
||||
"cursor": "default"
|
||||
});
|
||||
}
|
||||
|
||||
// Función para restaurar el estado original del botón
|
||||
function restoreButton(button, originalText) {
|
||||
button.html(originalText);
|
||||
button.prop("disabled", false);
|
||||
button.css({
|
||||
"color": "",
|
||||
"background-color": "",
|
||||
"cursor": ""
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
$(document).ready(function(){$("#account-settings").click(function(){$("#account-settings-panel").slideToggle("slow");$(".fa-arrow-down-account").toggleClass('rotate');$(".fa-arrow-down-account").toggleClass('rotate2');});$("#character-settings").click(function(){$("#character-settings-panel").slideToggle("slow");$(".fa-arrow-down-character").toggleClass('rotate');$(".fa-arrow-down-character").toggleClass('rotate2');});$("#account-history").click(function(){$("#account-history-panel").slideToggle("slow");$(".fa-arrow-down-history").toggleClass('rotate');$(".fa-arrow-down-history").toggleClass('rotate2');});});
|
||||
@@ -0,0 +1,62 @@
|
||||
$(function() {
|
||||
if (window.history.replaceState) {
|
||||
window.history.replaceState(null, null, window.location.href);
|
||||
}
|
||||
|
||||
$('.reward-form').on('submit', function(e) {
|
||||
e.preventDefault();
|
||||
const form = $(this);
|
||||
const button = form.find('button[type="submit"]');
|
||||
const originalButtonText = button.html();
|
||||
const recruitResponse = $("#recruit-response");
|
||||
const rewardRow = form.closest('tr');
|
||||
const rewardsCounter = $("#claimed-rewards-counter");
|
||||
|
||||
// Serializar datos del formulario
|
||||
const data = form.serialize();
|
||||
|
||||
changeButton(button, 'Reclamando...');
|
||||
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: '',
|
||||
data: data,
|
||||
dataType: 'json',
|
||||
success: function(response) {
|
||||
recruitResponse.hide().empty();
|
||||
|
||||
if (response.success) {
|
||||
recruitResponse.html(`<span class="ok-form-response">${response.message}</span>`).slideDown();
|
||||
|
||||
// Actualizar la fila y deshabilitar el formulario
|
||||
rewardRow.find('.reward-action').html(`<span class="ok-form-response">${response.message}</span>`);
|
||||
|
||||
// Actualizar el contador de recompensas
|
||||
if (response.claimed_count !== undefined) {
|
||||
rewardsCounter.text(`${response.claimed_count}/6`);
|
||||
}
|
||||
} else {
|
||||
recruitResponse.html(`<span class="red-form-response">${response.message}</span>`).slideDown();
|
||||
}
|
||||
|
||||
setTimeout(function() {
|
||||
restoreButton(button, originalButtonText);
|
||||
}, 3000);
|
||||
},
|
||||
error: function() {
|
||||
recruitResponse.html('<span class="red-form-response">Error en el servidor. Inténtalo de nuevo más tarde.</span>').slideDown();
|
||||
restoreButton(button, originalButtonText);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
function changeButton(button, text) {
|
||||
button.html(text);
|
||||
button.prop("disabled", true);
|
||||
}
|
||||
|
||||
function restoreButton(button, originalText) {
|
||||
button.html(originalText);
|
||||
button.prop("disabled", false);
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
if(window.history.replaceState){window.history.replaceState(null,null,window.location.href);};$(function(){$('select').on('change',function(){var select=$(this);select.css('color',select.children('option:selected').css('color'));});});$(function(){$('#trade-sell-a').on('click',function(){$('#trade-sell-div').fadeIn('slow');$('#trade-buy-div').hide();});$('#trade-buy-a').on('click',function(){$('#trade-buy-div').fadeIn('slow');$('#trade-sell-div').hide();});});$(function(){$(".toggle-password").click(function(){$(this).toggleClass("fa-eye fa-eye-slash");var type=$(this).hasClass("fa-eye-slash")?"text":"password";$("#password-sell").attr("type",type);});});$(function(){$(".toggle-password").click(function(){$(this).toggleClass("fa-eye fa-eye-slash");var type=$(this).hasClass("fa-eye-slash")?"text":"password";$("#password-buy").attr("type",type);});});$(function(){$(".toggle-token").click(function(){$(this).toggleClass("fa-eye fa-eye-slash");var type=$(this).hasClass("fa-eye-slash")?"text":"password";$("#security-token-sell").attr("type",type);});});$(function(){$(".toggle-token").click(function(){$(this).toggleClass("fa-eye fa-eye-slash");var type=$(this).hasClass("fa-eye-slash")?"text":"password";$("#security-token-buy").attr("type",type);});});$(function(){$('.trade-points-sell-button').on('click',function(e){e.preventDefault();e.stopPropagation();$("#trade-points-sell-response").empty();var button=$(this);var buttonoriginal=button.html();var data={tradepointssell:button.data('id')};data=$("#uw-trade-points-sell-form").serialize()+'&'+$.param(data);changeButton(button,'CREANDO CÓDIGO');$.ajax({type:'POST',url:'',data:data,dataType:'json',success:function(data){$("#trade-points-sell-response").append(data.message).hide().slideDown();if(data.success===true){button.html("CÓDIGO CREADO");button.css("color","#d79602");setTimeout(function(){$("#uw-trade-points-sell-form")[0].reset();restoreButton(button,buttonoriginal);grecaptcha.reset(0);},5000);}
|
||||
else{setTimeout(function(){$("#trade-points-sell-response").slideUp(function(){$("#trade-points-sell-response").empty();restoreButton(button,buttonoriginal);grecaptcha.reset(0);});},5000);}},error:function(){setTimeout(function(){alert("Algo ha salido mal. Por favor intente más tarde");window.location.reload();},2000);}});});});$(function(){$('.trade-points-buy-button').on('click',function(e){e.preventDefault();e.stopPropagation();$("#trade-points-buy-response").empty();$(".trade-points-check-button").prop('disabled',true);var button=$(this);var buttonoriginal=button.html();var data={tradepointsbuy:button.data('id')};data=$("#uw-trade-points-buy-form").serialize()+'&'+$.param(data);changeButton(button,'CANJEANDO CÓDIGO');$.ajax({type:'POST',url:'',data:data,dataType:'json',success:function(data){$("#trade-points-buy-response").append(data.message).hide().slideDown();if(data.success===true){button.html("CÓDIGO CANJEADO");button.css("color","#d79602");setTimeout(function(){$("#uw-trade-points-buy-form")[0].reset();$(".trade-points-check-button").prop('disabled',false);restoreButton(button,buttonoriginal);grecaptcha.reset(1);},5000);}
|
||||
else{setTimeout(function(){$("#trade-points-buy-response").slideUp(function(){$("#trade-points-buy-response").empty();$(".trade-points-check-button").prop('disabled',false);restoreButton(button,buttonoriginal);grecaptcha.reset(1);});},5000);}},error:function(){setTimeout(function(){alert("Algo ha salido mal. Por favor intente más tarde");window.location.reload();},2000);}});});});$(function(){$('.trade-points-check-button').on('click',function(e){e.preventDefault();e.stopPropagation();$("#trade-points-buy-response").empty();$(".trade-points-buy-button").prop('disabled',true);var button=$(this);var buttonoriginal=button.html();var data={tradepointscheck:button.data('id')};data=$("#uw-trade-points-buy-form").serialize()+'&'+$.param(data);changeButton(button,'CHEQUEANDO CÓDIGO');$.ajax({type:'POST',url:'',data:data,dataType:'json',success:function(data){$("#trade-points-buy-response").append(data.message).hide().slideDown();if(data.success===true){button.html("INFO DEL CÓDIGO");button.css("color","#d79602");setTimeout(function(){$(".trade-points-buy-button").prop('disabled',false);restoreButton(button,buttonoriginal);grecaptcha.reset(1);},5000);}
|
||||
else{setTimeout(function(){$("#trade-points-buy-response").slideUp(function(){$("#trade-points-buy-response").empty();$(".trade-points-buy-button").prop('disabled',false);restoreButton(button,buttonoriginal);grecaptcha.reset(1);});},5000);}},error:function(){setTimeout(function(){alert("Algo ha salido mal. Por favor intente más tarde");window.location.reload();},2000);}});});});
|
||||
Reference in New Issue
Block a user