var XURL='https://schilderstyle.de/konfigurator/2/'; var gw = 0; $(document).ready(function() { //$('#mmkmenu').html("
Anmelden
Warenkorb
"); /* MODE IS WITH OR WITHOUT MMKMENU */ $("
Anmelden
Warenkorb
").insertAfter($("nav > div.main-menu-right")); $("
Anmelden
Warenkorb
").insertAfter($("div.hamburger-menu")); gw = $(window).width(); // set global width to check horizontal resize event; resizeNavigation() }); $(document).on('click', '.showUserPanel', function () { /** if($('#panel').is(':visible')) { $('#panel').hide(); } else { $('#panel').show(); } **/ if($('.mmkPanel').is(':visible')) { $('.mmkPanel').hide(); } else { $('.mmkPanel').show(); } if($('#mobilemenu').is(':visible')) { $('#mobilemenu').hide(); $('.mobilebutton').css({'background-image':' url(https://schilderstyle.de/konfigurator/icons/mobilemenu.png)'}); } }); $(document).on('click', '.showUserLoggedPanel', function () { /**if($('#panelLogged').is(':visible')) { $('#panelLogged').hide(); } else { $('#panelLogged').show(); } **/ if($('.mmkPanelLogged').is(':visible')) { $('.mmkPanelLogged').hide(); } else { $('.mmkPanelLogged').show(); } if($('#mobilemenu').is(':visible')) { $('#mobilemenu').hide(); $('.mobilebutton').css({'background-image':' url(https://schilderstyle.de/konfigurator/icons/mobilemenu.png)'}); } }); $(document).on('submit','.mmkLoginForm', function () { $('.loginLoader',this).show(); $('.loginInfo',this).show(); $('.loginFailed',this).hide(); $('.loginInfo',this).html('Prüfe Zugangsdaten'); console.log(XURL); $.ajax({ type: "POST", url: XURL+'login/', data: $(this).serialize(), success: function(text) { if(text=='failed') { $('.mmkLoginForm .loginInfo').hide(); $('.mmkLoginForm .loginFailed').show(); $('.mmkLoginForm .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'; } }, }); return false; }); $(document).on('click','#logoutUserButton', function() { /** FUNKTIONIERT NUR WENN widget.js geladen ist... **/ //alert('loggin out from MMK-INIT') //alert(amazon); amazon.Login.logout(); }); $(window).on('resize', function() { resizeNavigation() }); function resizeNavigation() { //console.log($(window).height(),$(window).width(),gw); if($(window).width()!=gw) { if ($(window).width() < 1500) { $('.usLoggedText').hide(); $('.usText').hide(); } else { $('.usLoggedText').show(); $('.usText').show(); } /* HIDE LOGIN MENU */ $('#mmkmenu .userPanel, #mmkRespMenu .userPanel').hide(); } } /** 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"; } **/