From 4e1936f740d6ed3499df59e4f76efa91f49c5cb3 Mon Sep 17 00:00:00 2001 From: schneefux Date: Thu, 13 Mar 2014 19:03:14 +0100 Subject: füge Login-Request hinzu; erstelle das Layout für den Wechsel zur Planansicht MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- css/index.css | 10 ++++++++++ index.html | 38 +++++++++++++++++++++++++++----------- js/index.js | 24 ++++++++++++++++++++++++ 3 files changed, 61 insertions(+), 11 deletions(-) diff --git a/css/index.css b/css/index.css index d1fce0d..627220e 100644 --- a/css/index.css +++ b/css/index.css @@ -29,10 +29,20 @@ body { /* Portrait layout (default) */ .app { + position: fixed; + top: 0; + bottom: 0; + left: 0; + right: 0; } /* Landscape layout (with min-width) */ @media screen and (min-aspect-ratio: 1/1) and (min-width:400px) { .app { + position: fixed; + top: 0; + bottom: 0; + left: 0; + right: 0; } } diff --git a/index.html b/index.html index 71087ba..7811cd9 100644 --- a/index.html +++ b/index.html @@ -28,17 +28,33 @@
- + +
+ +

WvS VPlan | Login

+ +
+ +
+
+ + + +
+
+
+
+
+ + +

WvS VPlan | Vertretungsplan

+ +
+ + Hier steht der V-Plan. + +
+
diff --git a/js/index.js b/js/index.js index 1f239e8..ab4d48e 100644 --- a/js/index.js +++ b/js/index.js @@ -16,6 +16,30 @@ * along with this program. If not, see . */ +function login(){ + var req = new XMLHttpRequest(); + + var username = encodeURIComponent(document.getElementById('username').value); + var password = encodeURIComponent(document.getElementById('password').value); + var params = "username=" + username + "&password=" + password; + + req.onreadystatechange = function(){ + if(req.readyState == 4){ + if(req.status == 0){ + console.log("Es fehlt die Berechtigung, um auf den Server zuzugreifen."); + }else if(req.status != 200 || window.location.href.indexOf("http") != -1){ + console.log("Etwas ist schiefgelaufen :("); + }else{ + console.log('Request erfolgreich'); + } + } + } + + req.open("POST", "https://***REMOVED***/moodle/login/index.php", true); + req.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); + req.send(params); +} + var app = { // Application Constructor initialize: function() { -- cgit v1.3.1