Subversion Repositories ALCASAR

Compare Revisions

Ignore whitespace Rev 536 → Rev 537

/web/js/statusControler.js
4,6 → 4,7
chilliController.onUpdate = updateUI ;
chilliController.onError = handleError ;
chilliClock.onTick = function () { }
 
var isloggedout = false;
 
if (!window.queryObj) {
103,27 → 104,6
//showErrorPage(code);
}
 
/* Action triggered when buttons are pressed */
function connect() {
var username = document.getElementById('username').value ;
var password = document.getElementById('password').value ;
 
if (username == null || username == '')
return setElementValue('logonMessage', 'Username is required');
showWaitPage(1000);
chilliController.logon( username , password ) ;
}
 
function disconnect() {
if (confirm("Are you sure you want to disconnect now?")) {
chilliClock.stop();
showWaitPage(1000);
chilliController.logoff();
}
return false;
}
 
/* User interface pages update */
function showLoggedOutPage() {
isloggedout = true;
213,6 → 193,30
setElementValue("errorMessage", str);
}
 
function closePopup(){
this.focus();
self.opener=this;
self.close();
}
function alcasarLogoff(){
if (isloggedout == false){
chilliClock.stop();
chilliController.logoff();
}
showWaitPage(1000);
isloggedout = true;
}
function logout() {
alcasarLogoff();
window.setTimeout("closePopup()",1000);
}
function logoutWithConfirmation(msg) {
if (confirm(msg)) {
logout();
}
return false;
}
var chillijsWindowOnLoad = window.onload;
var delayTimer; // global reference to delayTimer
 
220,15 → 224,19
if (chillijsWindowOnLoad)
chillijsWindowOnLoad();
 
//var logonForm = document.getElementById('logonForm');
var logonForm = document.getElementById('loggedOutPage');
 
var head = document.getElementsByTagName("head")[0];
if (head == null) head = document.body;
 
if (logonForm == null) {
logonForm = document.getElementById('loginForm');
}
showWaitPage();
setTimeout('chilliController.refresh()', 500);
}
}
 
// The event window.onbeforeunload doesn't work with some browsers like 'opera' or 'Safari'.
// In the next version of alcasar, 30' without the status window do an automatic logout.
var alcasarOnbeforeUnload = window.onbeforeunload;
 
window.onbeforeunload = function(){
if (alcasarOnbeforeUnload)
alcasarOnbeforeUnload();
alcasarLogoff();
}