var XURL='https://keysteel.de/konfigurator/2/'; // ONLINE $(document).ready(function() { loadMenu(); }); // BIND HANDLER MENUPANEL $(document).on('click', '.showUserPanel', function () { $("#panel").show(); $('#mmkmenu .showUserPanel').toggleClass('showUserPanelActive'); }); $(document).on('click', '.showUserPanelActive', function () { $("#panel").hide(); $('#mmkmenu .showUserPanelActive').toggleClass('showUserPanel'); }); $(document).on('click', '.showUserLoggedPanel', function () { $("#panel").show(); $('#mmkmenu .showUserLoggedPanel').toggleClass('showUserLoggedPanelActive'); }); $(document).on('click', '.showUserLoggedPanelActive', function () { $("#panel").hide(); $('#mmkmenu .showUserLoggedPanelActive').toggleClass('showUserLoggedPanel'); }); $(document).on('submit','#loginForm', function () { $('#loginForm .loginLoader').show(); $('#loginForm .loginInfo').show(); $('#loginForm .loginFailed').hide(); $('#loginForm .loginInfo').html('Prüfe Zugangsdaten'); $.ajax({ type: "POST", url: XURL+'login/', data: $("#loginForm").serialize(), success: function(text) { if(text=='failed') { $('#loginForm .loginInfo').hide(); $('#loginForm .loginFailed').show(); $('#loginForm .loginFailed').html('Login fehlgeschlagen - Prüfen Sie die Eingabe und klicken erneut auf "Login"'); } else { top.location.href = text; //'http://ts.ic.de/schilderstyle.de/schilderstyle/cms.php?sp=kundenkonto'; } //alert(text); }, }); return false; }); //function loginOk() //{ //alert('Yeah'); // top.location.href = 'http://ts.ic.de/schilderstyle.de/schilderstyle/cms.php?sp=kundenkonto'; //} function loadMenu() { var xhttp = new XMLHttpRequest(); xhttp.onreadystatechange = function() { if (xhttp.readyState == 4 && xhttp.status == 200) { document.getElementById("mmkmenu").innerHTML = xhttp.responseText; } //else //{ // alert(xhttp.readyState +' <-> '+xhttp.status); //} }; //alert(XURL); xhttp.open("GET", XURL+'warenkorb_menu/', true); xhttp.send(); } function autoSizeIframe(id) { var newheight; var newwidth; if(document.getElementById){ newheight=document.getElementById(id).contentWindow.document .body.scrollHeight; newwidth=document.getElementById(id).contentWindow.document .body.scrollWidth; } document.getElementById(id).height= (newheight) + "px"; document.getElementById(id).width= (newwidth) + "px"; } //function doLogin() { // var logSuccess = 0; // var log = document.getElementById('loginInfo'); // log.style.display='block'; // var xhttp = new XMLHttpRequest(); // xhttp.onreadystatechange = function() { // if (xhttp.readyState == 4 && xhttp.status == 200) { // logSuccess = loginReturn(xhttp.responseText,logSuccess) // } // }; // xhttp.open("POST", XURL, false); // xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); // xhttp.send('sp=login&user='+ document.getElementById('user').value +'&pwd='+ document.getElementById('pwd').value); // if(logSuccess==0) { return false; } //} //function loginReturn(xhttp,logSuccess) { //alert(xhttp); //if(xhttp=='false') // { // document.getElementById("loginInfo").innerHTML = 'Login fehlgeschlagen'; return false; // } //else // { // document.getElementById("mmkmenu").innerHTML = xhttp; logSuccess=1; // } // return logSuccess; //}