Restored vanished code & partially refactored returning json

This commit is contained in:
djpbessems
2019-02-25 14:27:25 +01:00
parent ecce4d9342
commit 2f5b0e263a
7 changed files with 86 additions and 55 deletions

View File

@ -20,27 +20,22 @@ $(document).ready(function(){
ref: $('#ref').val()
})
.done(function(data,status) {
try {
var ajaxData = JSON.parse(data);
}
catch (e) {
console.log(data);
}
if (ajaxData.Result === 'Success') {
if (data.Result === 'Success') {
$('#btnlogin').css({
'background': 'green url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAaklEQVQ4jeXOMQ5AQBBG4T2BC4i76EWich7ncAKbqCRuodTqnMNTkFgJs3ZU4tXz/Rlj/hUQv8EpMAClFk9sjUAiHVcCnoFMwhZYgPYG575Xe46aIOyMdJx7ji9GwrEzUgOFCu8DkRp/qxU2BKCUyZR6ygAAAABJRU5ErkJggg==) no-repeat center',
'transform': 'rotateX(0deg)'
});
setTimeout(function() {
$('#btnlogin').prop('disabled', false).css({
'background': '#B50000 linear-gradient(0deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0) 50%, rgba(255,255,255,0.25) 51%) no-repeat center',
'background': '#003399 linear-gradient(0deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0) 50%, rgba(255,255,255,0.25) 51%) no-repeat center',
'color': '#FFF'
});
if (ajaxData.CrossDomainLogin) {
if (data.CrossDomainLogin) {
// Create iframes for other domains
console.log('CrossDomainLogin initiated');
}
window.location.replace(ajaxData.Location);
console.log("Navigating to :" + data.Location);
window.location.replace(data.Location);
}, 2250);
} else {
$('#btnlogin').css({
@ -49,12 +44,12 @@ console.log('CrossDomainLogin initiated');
});
setTimeout(function() {
$('#btnlogin').prop('disabled', false).css({
'background': '#B50000 linear-gradient(0deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0) 50%, rgba(255,255,255,0.25) 51%) no-repeat center',
'background': '#003399 linear-gradient(0deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0) 50%, rgba(255,255,255,0.25) 51%) no-repeat center',
'color': '#FFF'
});
// TODO: Add feedback (based on ajaxData.Reason)
// TODO: Add feedback (based on data.Reason)
// Is the redirect needed?
window.location.replace('lucidAuth.login.php'/*+ '?reason=' + ajaxData.Reason*/);
window.location.replace('lucidAuth.login.php'/*+ '?reason=' + data.Reason*/);
}, 2250);
}
});

View File

@ -20,8 +20,7 @@ body {
visibility: visible;
display: block;
}
#content,
#error {
#content {
background: url(/images/bg_main_bottom.gif) repeat-x bottom left;
font-family: Tahoma, sans-serif;
border: 3px solid #CCCCCC;
@ -30,6 +29,10 @@ body {
left: 50%;
visibility: visible;
border-radius: 5px;
top: -125px;
margin-left: -225px;
height: 220px;
width: 450px;
}
#error .main {
padding: 0 10px;