From: Dennis Schafroth Date: Wed, 9 Jun 2010 15:18:00 +0000 (+0200) Subject: Handling of login/logout. Still missing iPhone layout on login page. X-Git-Tag: v1.4.2~7^2~8 X-Git-Url: http://lists.indexdata.dk/?a=commitdiff_plain;h=5b9f0fb26f7500cec299e9c4d031d6804a3d84f7;p=pazpar2-moved-to-github.git Handling of login/logout. Still missing iPhone layout on login page. --- diff --git a/www/iphone/example_client.js b/www/iphone/example_client.js index a131b8a..d9b9fed 100644 --- a/www/iphone/example_client.js +++ b/www/iphone/example_client.js @@ -40,9 +40,43 @@ var SubjectMax = 10; var AuthorMax = 10; var tab = "recordview"; +function loggedOut() { + var login = document.getElementById("login"); + login.innerHTML = 'Login'; +} + +function loggingOutFailed() { + alert("Logging out failed"); +} + +function login() { + window.location = "login.html"; +} + +function logout() { + auth.logOut(loggedOut, loggingOutFailed, false); +} + +function logInOrOut() { + var loginElement = document.getElementById("login"); + if (loginElement.innerHTML == 'Login') + login(); + else + logout(); +} +function loggedIn() { + var login = document.getElementById("login"); + login.innerHTML = 'Logout'; + // login.onclick = 'logout();'; + domReady(); +} + +function auth_check() { + auth.check(loggedIn, login); +} // -// pz2.js event handlers: +// Pz2.js event handlers: // function my_oninit() { my_paz.stat(); diff --git a/www/iphone/index.html b/www/iphone/index.html index b7837b8..3170ffd 100644 --- a/www/iphone/index.html +++ b/www/iphone/index.html @@ -11,24 +11,26 @@ + - - + + - - +