mirror of
https://github.com/Mezeporta/Erupe.git
synced 2025-12-15 08:25:09 +01:00
Added config at char select screen Transmog saving and loading (unlocks are not yet tackled and it is global rn) Sigil saving (can break, initial pass of save) Null compression and decompression functions. First pass of the diff save function. Disabled stamp cards
46 lines
1.1 KiB
JavaScript
46 lines
1.1 KiB
JavaScript
function createErrorAlert(message) {
|
|
parent.postMessage(message, "*");
|
|
}
|
|
|
|
|
|
// Function to continually check if we got a login result yet,
|
|
// then navigating to the character selection if we did.
|
|
function checkAuthResult() {
|
|
var loginResult = window.external.getLastAuthResult();
|
|
console.log('|' + loginResult + '|');
|
|
if(loginResult == "AUTH_PROGRESS") {
|
|
setTimeout(checkAuthResult, 500);
|
|
} else if (loginResult == "AUTH_SUCCESS") {
|
|
window.location.href = 'charsel.html'
|
|
} else {
|
|
createErrorAlert("Error logging in!");
|
|
}
|
|
}
|
|
|
|
$(function() {
|
|
|
|
// Login form submission.
|
|
$("#loginform").submit(function(e){
|
|
e.preventDefault();
|
|
|
|
username = $("#username").val();
|
|
password = $("#password").val();
|
|
|
|
try{
|
|
window.external.loginCog(username, password, password);
|
|
} catch(e){
|
|
createErrorAlert("Error on loginCog: " + e);
|
|
}
|
|
|
|
checkAuthResult();
|
|
});
|
|
|
|
$("#btn_config").click(function() {
|
|
try{
|
|
window.external.openMhlConfig();
|
|
} catch(e){
|
|
createErrorAlert("Error on openMhlConfig: " + e);
|
|
}
|
|
})
|
|
});
|