/** NAV JS **/ $(document).ready(function() { updateMiniPanelView(); /** NAVIGATION LOGIC BACKEND / CUSTOMERS **/ $('.menuLink').on('click',function() { if($(this).next('.menuLinkChild').is(':visible')) { $('#navTools .navPanel').each(function() { $(this).hide(); }); $(this).removeClass('menuLinkActive'); } else { $('#navTools .navPanel').each(function() { $(this).hide(); }); $('#navTools .navButton').removeClass('menuLinkActive'); $(this).next('.menuLinkChild').show(); $(this).addClass('menuLinkActive'); if($('#scrollbar1').length) { var scrollbar = $('#scrollbar1'); scrollbar = scrollbar.data("plugin_tinyscrollbar") scrollbar.update(); } } }); $('#navTools').on('click','.closeButton',function() { $('#navTools .navPanel').each(function() { $(this).hide(); }); $('#navTools .navButton').removeClass('menuLinkActive'); }); /** NAVIGATION BACKEND TABS **/ $('#tabButtonNav .tabButton').on('click',function() { $('#tabButtonNav .tabButton').each(function() { $(this).removeClass('tabActive').addClass('tabGray'); }); $(this).removeClass('tabGray').addClass('tabActive'); var id = $(this).data('id'); $('.tabContent').each(function() { $(this).removeClass('tabContentActive').addClass('tabContentInactive'); }); $('#tabContent' + id).removeClass('tabContentInactive').addClass('tabContentActive'); }); /** NAVIGATION LOGIC CREATE **/ $('.crtMenuLink').on('click',function() { closeMenues(); if($(window).width() > 1023) { var position = $(this).offset(); var offmenu = 100 - position['top']; var arrmenu = position['top'] - 87; $(this).next('.crtNavPanel').css('top', offmenu+'px'); $(this).next('.crtMenuLinkChild').find('.crtNavPanelArrow').css('top', arrmenu+'px'); } $(this).next('.crtMenuLinkChild').show(); $(this).addClass('crtMenuLinkActive'); updateCrtMenuScrollbars(); }); $('#createTools').on('click','.crtMenuSubLinkComponents',function(e) { closeSubMenues(); var pos = calculateCrtMenuPosition($(this),$('.crtMenuLinkSubChildComponents')); if($(window).width() > 1023) { $('.crtMenuLinkSubChildComponents').css({'top': pos[1]+ 'px', 'left': pos[0] +'px'}); } else { $('.crtMenuLinkSubChildComponents').css({'top': 120 + 'px', 'left': ($(window).width()/2) + ($('.crtMenuLinkSubChildComponents').width()/2) +'px'}); } $('.crtMenuLinkSubChildComponents').show(); // HIDE ALL $('.zubehoerDesc').each(function () { $(this).hide(); }); $('#componentsDesc'+ $(this).data('id')).show(); updateCrtMenuScrollbars(); }); /** INPUT MOBILE CLICK/FOCUS STUFF */ $('#objXPos, #objYPos, #objWidth, #objHeight, #objAngle, #WIDTH, #HEIGHT').click(function() { if($(window).width() < 1023 && $(window).height() < 800) { $('#objectEdit .respEditPos').hide(); $('#objectEdit .respEditColor').hide(); $('#objectEdit .objEditColorRow').hide(); $('#createTools,#navLeft,#navRight,#createInfobar,.messagearea').hide(); //$('#create').css({'height':'auto'}); $('#objectEdit').css({'height':'auto','position':'inherit','margin-top':'-22px;'}); } }); $('#objXPos, #objYPos, #objWidth, #objHeight, #objAngle, #WIDTH, #HEIGHT').focusout(function() { if($(window).width() < 1023 && $(window).height() < 800) { $('#objectEdit').hide(); } }); $('#objXPos, #objYPos, #objWidth, #objHeight, #objAngle, #WIDTH, #HEIGHT').blur(function() { if($(window).width() < 1023 && $(window).height() < 800) { $('#objectEdit .respEditPos').show(); $('#objectEdit .respEditColor').show(); $('#objectEdit .objEditColorRow').show(); $('#createTools,#navLeft,#navRight,#createInfobar,.messagearea').show(); $('#objectEdit').css({'height':'100%','position':'absolute','top':'142px;'}); } }); /** WINDOW RESIZE */ $(window).resize(function() { updateMiniPanelView(); updateCrtMenuScrollbars(); closeMenues(); //alert('Im doing resize'); if($(window).width() < 1024) { $('#navLeft').trigger('click'); } else { // RESET $('.responsiveNavBox').removeAttr('style'); $('#createTools .crtNavPanel').removeAttr('style'); } //if($('#objXPos, #objYPos, #WIDTH, #HEIGHT').is(':focus')) //{ } //else //{ //$('#objectEdit').hide(); //} $('#textFontList').hide(); $('.textFontList').hide(); }); $('#createTools').on('click','.menuCloseButton,.menuCloseOkButton',function() { closeMenues(); //$('#createTools .crtNavPanel').each(function() { $(this).hide(); }); //$('#createTools .crtNavButton').removeClass('crtMenuLinkActive'); }); $('#createTools').on('click','.menuNextButton',function() { $(this).parent().parent().parent().parent().next().find('.crtMenuLink').trigger('click'); }); $('#createTools').on('click','.menuNextSubButton',function() { $(this).parent().parent().parent().parent().parent().next().find('.crtMenuLink').trigger('click'); }); /** CLOSE SECOND LEVEL CHILD MENUES */ $('#createTools').on('click','.menuSubCloseButton, .menuSubCloseOkButton',function() { $('.crtMenuLinkSubChild').hide(); $('.crtMenuLinkSubChildFixations').hide(); $('.crtMenuLinkSubChildComponents').hide(); }); $('#canvasBox').on('click', function(ev) { closeMenues(); //$('#createTools .crtNavPanel').each(function() { $(this).hide(); }); //$('#createTools .crtNavButton').removeClass('crtMenuLinkActive'); $('#textFontList').hide(); $('.textFontList').hide(); }); $('#navLeft').on('click',function() { $('.responsiveNavBox').css({'position':'relative','left':'35px'}); $('#createTools .crtNavPanel').each(function() { $('#createTools .crtNavPanel').removeAttr('style'); $(this).css({'left':'-35px','top':'70px'}); }); }); $('#navRight').on('click',function() { closeMenues(); if($(window).width() <630) { $('.responsiveNavBox').css({'position':'relative','left':'-245px'}); $('#createTools .crtNavPanel').each(function() { $(this).css({'left':'245px'}); }); } }); $('.respObjEditCloseButton').on('click',function() { $('#objectEdit').hide(); }); $('#createTools').on('click','.components.part,.cborders,.iborders',function() { var item = $(this); $(item).css({'border':'2px solid #0093db'}); setTimeout(function() { $(item).removeAttr('style'); }, 500); }); /** BACKEND RG /LG ADDRESS SHOW/HIDE FORM **/ $('#addAddressButton').click(function(event) { if($('#addAddress').css('display') == 'none') { $('#addAddress').show(); $('#addAddressButton').html('Abbrechen '); } else { $('#addAddress').hide(); $('#addAddressButton').html('Adresse hinzufügen '); // ALLE FORM FIELDS LOESCHEN $('#addressAddForm input[type=\'text\']').val(''); $('#idForm').val(''); $('.panel').hide(); } event.preventDefault(); }); $('.delButton').click(function(event){ var id = $(this).data('formid'); $('#choiceOk').attr('data-id',id); /*window.scrollTo(0,0);*/ choiceWin.open(); return false; }); $('.delRowButton').click(function(event){ var id = $(this).data('formid'); $('#choiceOk').attr('data-id',id); /* window.scrollTo(0,0); */ choiceWin.open(); return false; }); /** BACKEND IMAGE SHOW/HIDE FORM + UPLOADER **/ $('#addImageButton').click(function(event) { if($('#addImage').css('display') == 'none') { $('#addImage').show(); $('#addImageButton').html('Abbrechen '); } else { $('#addImage').hide(); $('#addImageButton').html('Bild hinzufügen '); // ALLE FORM FIELDS LOESCHEN $('.formData input[type=\'text\']').val(''); $('input#idForm').val(''); $('.panel').hide(); } event.preventDefault(); }); // IMAGE CHECKS $('#imUploaderBilder').on('submit', function() { var file = $('#wdata0')[0].files[0]; var ext = ''; if(file) { ext = file.name.substr((file.name.lastIndexOf('.') +1)); } else { showModalInfoWin("Keine Datei ausgewählt","Bitte wählen Sie Bild, um es heraufzuladen."); //alert(unescape('Bitte w%E4hlen Sie ein Bild, um es heraufzuladen')); return false; } // size check if(file.size>2097152) { showModalInfoWin("Dateigröße überschritten","Die Datei darf nicht größer als 2MB sein, um sie heraufzuladen."); //alert(unescape('Die angegebene Datei ist gr%F6sser als 2MB. Bitte beachten Sie die maximale Dateigr%F6sse.')); return false; } else if(ext!='svg') { showModalInfoWin("Dateityp fehlerhaft","In diesem Formular können nur Dateien vom Typ \"SVG\" heraufgeladen werden."); //alert(unescape('Es k%F6nnen nur Dateien vom Typ "SVG" heraufgeladen werden.')); return false; } }); /** BACKEND WORKING DAYS FUNC */ $('#addFeiertage').click(function(event) { event.preventDefault(); // RESET FORM $('.msgOk').hide(); $('#errorMsgDate').hide(); $('#nwd_date1').css({'border':''}); $('#nwd_date2').css({'border':''}); $('#nwd_bezeichner').css({'border':''}); var error=0; var errmsg=''; if($('#nwd_date1').val()=='') { error=1; errmsg='Bitte geben Sie ein gültiges Datum ein.'; $('#nwd_date1').css({'border':'2px solid #f00'}); } else if($('#nwd_bezeichner').val()=='') { error=1; errmsg='Bitte geben Sie einen Bezeichner ein.'; $('#nwd_bezeichner').css({'border':'2px solid #f00'}); } else { if($('#nwd_date2').val()!='') { var d1chk= $('#nwd_date1').val().split('.').reverse().join(''); var d2chk= $('#nwd_date2').val().split('.').reverse().join(''); if(d2chk < d1chk) { error=1; errmsg='Das 2.te Datum liegt vor dem ersten Datum. Das 2.te Datum muss danach liegen oder gleich sein.'; $('#nwd_date2').css({'border':'2px solid #f00'}); } var d1= new Date($('#nwd_date1').val().split('.').reverse().join('-')); var d2= new Date($('#nwd_date2').val().split('.').reverse().join('-')); var t2 = d2.getTime(); var t1 = d1.getTime(); var dayDiff = parseInt((t2-t1)/(24*3600*1000)); if(dayDiff > 6) { error=1; errmsg='Es kann maximal ein Zeitraum von 7 Tagen zeitgleich eingetragen werden.'; $('#nwd_date1').css({'border':'2px solid #f00'}); $('#nwd_date2').css({'border':'2px solid #f00'}); } } } if(error==0) { $('#addFeiertageForm').submit(); } else { $('#errorMsgDate').show(); $('.errorMsg').html(errmsg); } }); /** USER LOGOUT EVENT **/ $('#logoutUserButton').click(function() { /** FUNKTIONIERT NUR WENN widget.js geladen ist... **/ //alert('loggin out from NORMAL SITE') //alert(amazon); amazon.Login.logout(); }); /** MOBILE MENU STUFF **/ $('.mobilebutton').click(function(){ if($('#mobilemenu').is(':visible')) { $('.mobilebutton').css({'background-image':' url(https://schilderstyle.de/konfigurator/icons/mobilemenu_white.png)'}); } else { $('.mobilebutton').css({'background-image':' url(https://schilderstyle.de/konfigurator/icons/mobilemenu_white_close.png'}); } $('#mobilemenu').slideToggle('medium'); $('.userPanel').hide(); }); /** BASKET FUNCTIONALITY **/ var oldMenge=1; $('.mengeBox').focus(function() { oldMenge = $(this).val(); }); $('.mengeBox').blur(function() { if(oldMenge!=$(this).val()) { if($(this).val()==0) { $(this).val(1); } //$('#wkRefresh').submit(); refreshBasket(0); } }); $('.mengeBox').keydown(function (e) { if ($.inArray(e.keyCode, [46, 8, 9, 27, 13, 110, 190]) !== -1 || (e.keyCode == 65 && e.ctrlKey === true) || (e.keyCode == 67 && e.ctrlKey === true) || (e.keyCode == 88 && e.ctrlKey === true) || (e.keyCode >= 35 && e.keyCode <= 39)) { return; } if ((e.shiftKey || (e.keyCode < 48 || e.keyCode > 57)) && (e.keyCode < 96 || e.keyCode > 105)) { e.preventDefault(); } }); $('.rdata13').blur(function() { setSuppliers(); }); $(document).on('click', '.delItemButton', function(event) { var id = $(this).attr('data-id'); var refID = $(this).attr('data-refid'); $('#delItemButtonOk').attr('data-id',id); $('#delItemButtonOk').attr('data-refid',refID); /* window.scrollTo(0,0); */ delItemWin.open(); }); $(document).on('click', '.delAddressButton', function(event) { var id = $(this).attr('data-id'); var refID = $(this).attr('data-refid'); $('#delItemButtonOk').attr('data-id',id); $('#delItemButtonOk').attr('data-refid',refID); /* window.scrollTo(0,0); */ choiceWin.open(); }); $(document).on('click', '.amazonButtonFake', function(event) { $('#LoginWithAmazon img').trigger('click'); }); $(document).on('click', '.chooseDBPayMethod', function(event) { if($(this).val() == 'classic') { $('#requestAmazonPayContainer').hide(); $('#requestClassicPay').show(); $('#amazonWidgetBlock').hide(); $('#classicWidgetBlock').show(); setSuppliers(); } else { $('#requestAmazonPayContainer').show(); $('#requestClassicPay').hide(); $('#amazonWidgetBlock').show(); $('#classicWidgetBlock').hide(); var restoreAmazonError=0; if($('#amazonWrongAddress').is(':visible')) { restoreAmazonError=1; } $('.msgError').hide(); if(restoreAmazonError==1) { $('#amazonWrongAddress').show(); setDeliveryCountry(''); } else { setDeliveryCountry($('#amazonCountryHelper').val()); } } }); $('#wkAdressForm').on('change','#raddress', function() { $.ajax({ url: "https://schilderstyle.de/konfigurator/scripts/backend-io.php", type: 'GET', cache: false, timeout: 30000, data: { com: 'updraddress', id: $("#raddress option:selected").val() }, error: function(){ return true; }, success: function(cp) { $('#raddressblock').html(cp); setSuppliers(); return true; } }); $('#raddressform').hide(); $('#raddressblock').show(); $('#raddress0').prop("checked", true); }); $('#raddress0').on('click', function() { $('#raddressform').hide(); $('#raddressblock').show(); }); $('#raddress1').on('click', function() { $('#raddressform').show(); $('#raddressblock').hide(); }); $('#wkAdressForm').on('change','#daddress', function() { $.ajax({ url: "https://schilderstyle.de/konfigurator/scripts/backend-io.php", type: 'GET', cache: false, timeout: 30000, data: { com: 'upddaddress', id: $("#daddress option:selected").val() }, error: function(){ return true; }, success: function(cp) { $('#daddressblock').html(cp); setSuppliers(); return true; } }); $('#daddressform').hide(); $('#daddressblock').show(); $('#daddress0').prop("checked", true); }); $('#daddress0').on('click', function() { $('#daddressform').hide(); $('#daddressblock').show(); }); $('#daddress1').on('click', function() { $('#daddressform').show(); $('#daddressblock').hide(); }); /** KONFIGURATOR FUNCTIONS **/ /** ORDER LIST */ $('#searchOrderItem').on('submit', function(e) { e.preventDefault(); searchOrder(''); }); $(document).on('change','.setSearchOrderItem', function(e) { searchOrder($(this).data('id')); }); function searchOrder(update) { $('.loader2').show(); $('#searchItemContent').hide(); setTimeout(function() { $.ajax({url: 'https://schilderstyle.de/konfigurator/scripts/backend-io.php', type: 'GET', cache: false, timeout: 3000, async: false, //false, dataType: "text", data: {'com': 'loadOrderItems', 'id': $('#searchOrderID').val(), 'refID': update}, error: function() {}, success: function(cs) { $('#searchItemContent').html(cs); } }); $('.loader2').hide(); $('#searchItemContent').show(); }, 500); } /** ERROR ANALYSIS */ $('#uslSource').on('change', function() { if($('#uslSource option:selected').val()!='') { $('.loader2').show(); $('#uslPage option[value="1"]').prop('selected', true); loadUserSignList($('#uslSource option:selected').val(), $('#uslPage option:selected').val()); $('.loader2').hide(); } else { $('#userSignContent').html('Bitte wählen Sie eine Quelle...'); } }); $('#uslPage').on('change', function() { if($('#uslSource option:selected').val()!='') { $('.loader2').show(); loadUserSignList($('#uslSource option:selected').val(), $('#uslPage option:selected').val()); $('.loader2').hide(); } else { $('#userSignContent').html('Bitte wählen Sie eine Quelle...'); } }); $('#loadUserSignPreviousPage').on('click', function() { if($('#uslSource option:selected').val()!='') { var page = $('#uslPage option:selected').val(); page--; if(page<1) { page=1; } $('html,body').animate({ scrollTop: 0 }); $('.loader2').show(); $('#uslPage option[value=\"' + page + '\"]').prop('selected', true); loadUserSignList($('#uslSource option:selected').val(), $('#uslPage option:selected').val()); $('.loader2').hide(); } else { $('#userSignContent').html('Bitte wählen Sie eine Quelle...'); } }); $('#loadUserSignNextPage').on('click', function() { if($('#uslSource option:selected').val()!='') { var page = $('#uslPage option:selected').val(); page++; //alert(page); $('.loader2').show(); $('#uslPage option[value=\"' + page + '\"]').prop('selected', true); loadUserSignList($('#uslSource option:selected').val(), $('#uslPage option:selected').val()); $('.loader2').hide(); $('html,body').animate({ scrollTop: 0 }); } else { $('#userSignContent').html('Bitte wählen Sie eine Quelle...'); } }); /** MENU UPDATES */ updateMiniPanelView(); }); /** CRTMENU NAVIGATION FUNCTIONS */ function updateCrtMenuScrollbars() { /** max screen 667px + 40px spacer **/ if($(window).width() < 1023 && $(window).height()<800) { var minSpaceHeight = 0; var menuMinHeight = 0; var menu3rdMinHeight = 0; //for (var bar=2; bar<=11; bar++) //for (var bar=2; bar<=10; bar++) //{ // $('#scrollbar'+bar).css({'overflow-y':'scroll', 'overflow-x':'hidden'}); //} } else { var minSpaceHeight = 233; var menuMinHeight = 474; var menuMinWithButtonHeight = 404; var menu3rdMinHeight = 385; } var winMinHeight = menuMinHeight + minSpaceHeight; var winHeight = $(window).height(); $(window).height() < winMinHeight ? $('.crtMenuLinkChild').find('.viewport').css('height', menuMinHeight) : $('.crtMenuLinkChild').find('.viewport').css('height', winHeight-233); /** $(window).height() < winMinHeight ? $('.crtMenuLinkChild').find('.viewport').css('height', menuMinWithButtonHeight) : $('.crtMenuLinkChild').find('.viewport').css('height', winHeight-233); **/ //console.log($('#scrollbar8').find('.crtPanelBlock').height()); //console.log($('.crtMenuLinkSubChildComponents').find('.crtPanelBlock').height() +',' + $('div.crtMenuLinkSubChildFixations').outerHeight(true) + ',' + $('div.crtMenuLinkSubChild').outerHeight(true)); /** SUBWINDOWS */ /** ($('.crtMenuLinkSubChild').find('.crtPanelBlock').height()) > menu3rdMinHeight ? $('#scrollbar9 .viewport').css('height', menu3rdMinHeight) : $('#scrollbar9 .viewport').css('height', 'auto'); ($('.crtMenuLinkSubChildFixations').find('.crtPanelBlock').height()) > menu3rdMinHeight ? $('#scrollbar8 .viewport').css('height', menu3rdMinHeight) : $('#scrollbar8 .viewport').css('height', 'auto'); ($('.crtMenuLinkSubChildComponents').find('.crtPanelBlock').height()) > menu3rdMinHeight ? $('#scrollbar10 .viewport').css('height', menu3rdMinHeight) : $('#scrollbar10 .viewport').css('height', 'auto'); **/ /** refresh bars **/ //for (var bar=2; bar<=11; bar++) //for (var bar=2; bar<=10; bar++) //{ // if($('#scrollbar'+bar).length) // { // var scrollbar = $('#scrollbar'+bar); // scrollbar = scrollbar.data("plugin_tinyscrollbar") // scrollbar.update(); // } //} } function calculateCrtMenuPosition(event,menu) { var position = $(event).offset(); var menuX = position['left'] + 20; var menuY = position['top'] < 220 ? position['top'] - 130 : position['top'] - position['top'] + 130; //console.log('Menu calculated: ' + menuX +','+menuY+ ' WindowHeight: ' + $(menu).find('.crtPanelBlock').height()); return [menuX,menuY] } function closeMenues() { //if($('#objXPos, #objYPos, #objWidth, #objHeight, #WIDTH, #HEIGHT').is(':focus')) if($('#WIDTH').is(':focus')) { //alert('hey'); } else { //if($(window).width() > 1023) //{ $('#createTools .crtNavPanel').each(function() { $(this).hide(); }); $('.crtNavPanelChild').each(function() { $(this).hide(); }); $('.crtNavPanelChildFixations').each(function() { $(this).hide(); }); $('#createTools .crtNavButton').removeClass('crtMenuLinkActive'); //} } } function closeSubMenues() { if($('#WIDTH').is(':focus')) { //alert('submenu'); } else { $('.crtNavPanelChild').each(function() { $(this).hide(); }); $('.crtNavPanelChildFixations').each(function() { $(this).hide(); }); } } /** HIDE PREVIEW SCREEN FOR MINHEIGHT **/ function updateMiniPanelView() { if($(window).width() < 1024) { $('#miniViewPanel').hide(); } else { $(window).height() < 716 ? $('#miniViewPanel').hide() : $('#miniViewPanel').show(); } } /** FIXATION CALC & SHOW FIXATIONS */ function showFixationDetails(ev) { closeSubMenues(); var name = $(ev).data('fxname'); var image= $(ev).data('subimage'); var desc = $(ev).data('subdesc'); var showLeft = 0; var showRight = 0; if($(ev).data('subimage').length==0 && $(ev).data('subdesc').length==0) { $('.fxLvl3LeftBlock').hide(); } else { showLeft=1; $('.fxLvl3LeftBlock').show(); } if($(ev).data('setfx')==1) { showRight=1; $('.fxLvl3RightBlock').show(); } else { $('.fxLvl3RightBlock').hide(); } $('.crtMenuLinkSubChildFixations').find('.subMainTitle').html(name); if(image) { $('.crtMenuLinkSubChildFixations').find('.subImage').html('
'); } else { $('.crtMenuLinkSubChildFixations').find('.subImage').html(''); } $('.crtMenuLinkSubChildFixations').find('.subDesc').html(desc); /* Calc Pos */ var show= showLeft+showRight; var pos = calculateCrtMenuPosition($(ev),$('.crtMenuLinkSubChildFixations')); if($(window).width()<1023) { pos[1] = 100; pos[0] = ($(window).width()/2) + ($('.crtMenuLinkSubChildFixations').width()/2) - 40; } if(show==1) { $('.crtMenuLinkSubChildFixations').css({'top': pos[1]+ 'px', 'left': pos[0] +'px','width':'auto'}); } else { $('.crtMenuLinkSubChildFixations').css({'top': pos[1]+ 'px', 'left': pos[0] +'px','width':''}); } if(show>0) { $('.crtMenuLinkSubChildFixations').show(); } updateCrtMenuScrollbars(); } /** FIXATION SWITCH WIN **/ /** function switchFixationByChoice() { addFixation($('#choiceFixationOk').data('fxid'),$('#choiceFixationOk').data('dpimage'),$('#choiceFixationOk').data('fxname'),$('#choiceFixationOk').data('dc')); choiceFixationWin.close(); } **/ /** --------------------------------------------------------------- */ /** BASKET FUNCTIONS **/ function refreshBasket(mode) { if($('.produktionsZeitSelect:checked').data('days')===undefined) { showModalInfoWin('Produktionszeit wählen!', 'Bitte wählen Sie die gewünschte Produktionszeit aus, um mit der Bestellung fortzufahren.'); return false; } var wkmengedata = $('input[name="wkmenge[]"]').map(function(){ return this.value; }).get(); $.ajax({ url: 'https://schilderstyle.de/konfigurator/scripts/backend-io.php', type: 'POST', cache: true, async: false, dataType: 'text', data: {'com': 'refreshBasket', 'wkmenge': wkmengedata, 'produktionsZeitID' : $('.produktionsZeitID').val(), 'produktionsZeitDays': $('.produktionsZeitSelect:checked').data('days'), 'produktionsZeitValue': $('.produktionsZeitSelect:checked').data('value') }, error: function(em) { window.parent.location.reload(); return true; }, success: function(cs) { if(mode==0) { top.location.href = 'https://schilderstyle.de/konfigurator/2/warenkorb/'; } else { top.location.href = 'https://schilderstyle.de/konfigurator/2/warenkorb/adressen/'; } }}); return false; } /// SET PRODUKTIONSZEIT $(document).on('click','.produktionsZeitSelect', function() { calcProduktionszeit($(this).data('id'),$(this).data('value')); }); function calcProduktionszeit(id,price) { $('.chosenProduktionsZeit').each(function() { $(this).hide(); }); if(id !== undefined && price !== undefined) { $('.produktionsZeitID').val(id); $('.produktionsZeit'+id).show(); // zeige korrekten Preis var zwischenSumme = parseFloat($('.zwischenSummeBase').val()) + parseFloat(price); var gesamt = zwischenSumme / 100 * 119; //parseFloat($('.gesamtBase').val()) + parseFloat(price); var mwst = gesamt - zwischenSumme; //console.log(zwischenSumme, gesamt, mwst); zwischenSumme = zwischenSumme.toFixed(2); zwischenSumme = zwischenSumme.replace(".",","); mwst = mwst.toFixed(2); mwst = mwst.replace(".",","); gesamt = gesamt.toFixed(2); gesamt = gesamt.replace(".",","); $('.zwischenSummeCalc').html(zwischenSumme); $('.mwstCalc').html(mwst); $('.gesamtCalc').html(gesamt); } } function checkCoupon() { var coupon = $('#coupon').val(); $.ajax({ url: 'https://schilderstyle.de/konfigurator/scripts/backend-io.php', type: 'POST', cache: true, async: false, dataType: 'text', data: {'com': 'activateCoupon', 'id': coupon}, error: function(em) { window.parent.location.reload(); return true; }, success: function(cs) { top.location.href = 'https://schilderstyle.de/konfigurator/2/warenkorb/'; }}); return false; } function removeSignFromBasket() { var id = $('#delItemButtonOk').attr('data-id'); var refID = $('#delItemButtonOk').attr('data-refid'); $.ajax({ url: 'https://schilderstyle.de/konfigurator/scripts/backend-io.php', type: 'POST', cache: true, async: false, dataType: 'text', data: {'com': 'removeSignFromBasket', 'id': id, 'refID': refID}, error: function(em) { window.parent.location.reload(); return true; }, success: function(cs) { window.parent.location.reload(); return true; }}); return false; } function showModalInfoWin(title,message) { $('#modalInfoTitle').html(title); $('#modalInfoMessage').html(message); /**window.scrollTo(0,0); **/ modalInfoWin.open(); } //function choiceWin(title,message) //{ // $('#modalInfoTitle').html(title); // $('#modalInfoMessage').html(message); // choiceWin.open(); //} /** BACKEND STUFF KUNDEKONTO **/ function deleteRGAddress() { var id = $('#choiceOk').data('id'); $('#delRGAddress'+id).submit(); } function deleteDLAddress() { var id = $('#choiceOk').data('id'); $('#delDLAddress'+id).submit(); } function deleteDataRow() // SUBMIT CHOICE.WIN { var id = $('#choiceOk').data('id'); $('#delRow'+id).submit(); } /** BACKEND LOAD USER SIGN LIST **/ function loadUserSignList(source,page) { // AJAX UPDATE REQUEST //alert(id+','+refID+','+URL); $.ajax({ url: 'https://schilderstyle.de/konfigurator/scripts/mmk-io.php', type: 'GET', cache: false, timeout: 3000, async: false, //false, dataType: "text", data: {'com': 'loadUserSignList', 'id': source, 'refID': page}, error: function() { }, success: function(cs) { $('#userSignContent').html(cs); return true; } }); return false; } var delItemWin, modalInfoWin, modalFinishWin, modalchoiceWin; /* INIT MODAL WINS */ $(document).ready(function() { delItemWin = new jBox('Modal', { attach : $('.delItemWindow'), content: $('#delItemWinCon'), position: { x: 'center', y:'center' }, closeButton:'box'}); modalInfoWin = new jBox('Modal', { attach : $('.modalWindow'), content: $('#modalInfoWinCon'), position: { x: 'center', y:'center' }, closeButton:'box'}); //modalInfoWin = new jBox('Modal', { attach : $('.modalWindow'), content: $('#modalInfoWinCon'), position: { x: 'center', y: 'center' }, closeButton:'box'}); modalFinishWin = new jBox('Modal', { attach : $('.modalFinishWindow'), content: $('#modalFinishWinCon'), fade:false, position: { x: 'center', y:'center' }, closeOnClick: false, closeButton: false }); // choiceWin = new jBox('Modal', { attach : $('.choiceWindow'), content: $('#choiceWinCon'), position: { x: 'center', y:125 }, closeButton:'box'}); choiceWin = new jBox('Modal', { attach : $('.choiceWindow'), content: $('#choiceWinCon'), position: { x: 'center', y: 'center' }, closeButton:'box'}); choiceFixationWin = new jBox('Modal', { attach : $('.choiceFixationWindow'), content: $('#choiceFixationWinCon'), position: { x: 'center', y: 'center' }, closeButton:'box'}); });