summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
Diffstat (limited to 'js')
-rw-r--r--js/index.js10
1 files changed, 3 insertions, 7 deletions
diff --git a/js/index.js b/js/index.js
index c586b71..09cfd3a 100644
--- a/js/index.js
+++ b/js/index.js
@@ -49,7 +49,7 @@ function updateCheck(){
loginOk = false;
}
- if(loginOk == true){
+ if(loginOk === true){
tryLogin(); // nur wenn alles in Ordnung ist, einloggen lassen
}
});
@@ -626,14 +626,12 @@ function loggedIn(resultHtml){
var link = $('.coursebox .info .coursename a:contains("Vertretungsplan")', resultHtml).attr('href');
if(link === undefined){
- return 0;
+ fail();
}
localStorage.setItem('overviewlink', link);
console.log('Eingeloggt');
getOverview(link, fail);
-
- return 1;
}
/* sendet einen HTTPost-Request mit Logindaten */
@@ -667,6 +665,7 @@ function getUserData(){
}
var password = encodeURIComponent($('#password').val());
+
if(password === ''){
password = localStorage.getItem('password');
}else{
@@ -676,9 +675,6 @@ function getUserData(){
console.log('Benutzerdaten geladen');
if(username !== null && username.length !== 0 && password !== null && password.length !== 0){
- $('#username').val(username);
- $('#password').val(password);
-
return [username, password];
}else{
return null;