/* MILANA */ $(document).ready(function() { milanaAmounts.init(); milana.init(); milana.initVar() if ( milana.amount_in_valid == '1' ){ milana.btnRender(); } }); var milana = { color : '', amount_in_valid : '', amount_btn_text : '', initVar : function(){ if( typeof amount_in_valid_text != 'undefined' && amount_in_valid_text != ''){ milana.amount_btn_text = amount_in_valid_text; }else { if (typeof Step3 != 'undefined') { milana.amount_btn_text = Step3.select('.payment-submit .button').first().val(); } } if(typeof amount_in_valid != 'undefined' ){ milana.amount_in_valid = amount_in_valid; } }, init : function(){ milana.stepsRender(); milana.step1(); milana.step2(); milana.step3(); milana.stepInfos(); milana.amountsRender(); milana.typeA(); $('body').bind('change_amount', milana.changeAMount); }, changeAMount : function(){ Steps.adaptHeight(); }, stepsRender : function(){ $('body:not(#type-a):not(#type-b) #header').wrapInner('
'); //radio & checkbox $('[name=iscompany]').after(''); $('[type=checkbox][name^=reserved_]').each(function(index, el) { $(this).after(''); $(this).attr('id', $(this).attr('name')); }); $('input[type=radio]').each(function(index, el) { var id = $(this).parent().attr('for'); $(this).attr('id', id); }); //placeholder $('#step-1 label').each(function(index, el) { var parent = $(this).parent(); //console.log($(parent).data('ira-placeholder')); if( $(parent).data('ira-placeholder') != false ) { var input = $(this).next(':input'); $(this).find('.help').text('').hide(); if (input.attr('type') == 'text') { input.attr('placeholder', $(this).text().trim()); $(this).hide(); } }else { $(this).show(); } }); $('#step-2 label').each(function(index, el) { var parent = $(this).parent(); //console.log($(parent).data('ira-placeholder')); if( $(parent).data('ira-placeholder') != false ) { var input = $(this).next(':input'); $(this).find('.help').text('').hide(); if (input.attr('type') == 'text') { if(parent.is('[name^= "reserved_"]')){ //console.log('reserved !!! :'+parent.attr('name')) var placeholder = parent.find('.reserved_title').text().trim(); placeholder += $(this).find('.required').text(); input.attr('placeholder', placeholder); //$(this).find('label').hide(); }else { input.attr('placeholder', $(this).text().trim()); } //$(this).hide(); } if (input.attr('type') == 'date') { input.attr('placeholder', $(this).text().trim()); //$(this).hide(); } if ($(this).attr('for') == 'civility'){ $('[name=civility] option').first().text($(this).text().trim()); $(this).hide(); } if ($(this).attr('for') == 'email'){ $(this).html(''); } }else { $(this).show(); } }); $('#step-2 .intl-tel-input').each(function(index, el) { input = $(this).find('input'); input.attr('placeholder', $(this).siblings('label').text().trim()); $(this).siblings('label').hide(); }); // select2 $.getScript( 'https://libs.iraiser.eu/libs/forms/select2/js/select2.full.min.js', function( data, textStatus, jqxhr ) { if (typeof Step3 != 'undefined') { Step3.select('#cardmonth, #cardyear').select2({ minimumResultsForSearch: Infinity }); } $('#step-2 select[name^=reserved_], #step-2 select[name=civility]').select2({ minimumResultsForSearch: Infinity }); $('#step-2 select[name=country]').select2({ }); $('#step-1 select').select2({ minimumResultsForSearch: Infinity }); }); if( $('#form-info').length > 0 ){ //$('#main_wrapinner').prepend($('#form-info')); $('#main_wrapinner').prepend(''); $('#form-info').remove(); $('#step-1 .step-title').addClass('noradius'); }else { } if ( $('[name=lang]') ) { $('[name=lang] option').each(function(index, el) { var label = $(this).text(); var link = $(this).val(); $('#lang').append(''+label+' '); }); $('[name=lang]').hide(); }; }, step1 : function(){ if( typeof Step1 != 'undefined'){ $('#step-1 .bloc' ).wrapAll('
'); $('.tabs').prepend(''); $('#step-1 .bloc h3').each(function(index, el) { var frequency = $(this).parents('.bloc').attr('id'); if(index == 0){ $(this).appendTo('.tabs ul.tabs_menu').wrap('
  • '); }else { $(this).appendTo('.tabs ul.tabs_menu').wrap('
  • '); } }); //$('#step-1 #regular h3').prependTo('.tabs').wrap('
  • '); milana.tabs(); $('#step-1 #or').siblings('.unit ').hide(); $('#step-1 #or').remove(); if (Step1.active_tax_reduction < 1){ $('.tax-info').hide(); } $('#step-1 .height_adaptor').append('
    '); } }, step2 : function(){ /*$('#c-addr2, #c-pcode, #c-city, #c-country').hide(); if( $('[name=address1]').val() != '' ){ $('#c-addr2, #c-pcode, #c-city, #c-country').show(); } $('[name=address1]').keyup(function(event) { if( $('[name=address1]').val() != '' ){ $('#c-addr2, #c-pcode, #c-city, #c-country').slideDown(); Steps.adaptHeight(); } }); */ }, step3 : function(){ if( typeof Step3 != 'undefined'){ Step3.select('[name=cardtype]').after(''); Step3.select('#card-type').append('
    '); /* typeA hack*/ $('#type-a [name=cardtype]').after(''); $('#type-a #card-type').append('
    '); Step3.select('[name=cardtype]').change(function(event) { $('#card-type li').removeClass('selected'); $(this).parents('li').addClass('selected'); }); /* typeA hack*/ $('#type-a [name=cardtype]').change(function(event) { $('#card-type li').removeClass('selected'); $(this).parents('li').addClass('selected'); }); /* Step3.select('#card-scode').each(function(index, el) { $(this).after($(this).find('.help')); }); */ /*placeholder*/ Step3.select('#card-number label, #card-scode label, #card-expiry label, #iban-input label, #bic-input label').each(function(index, el) { var input = $(this).next(':input'); $(this).find('.help').text('').hide(); if (input.attr('type') == 'text') { input.attr('placeholder', $(this).text()); $(this).hide(); } }); /* typeA hack*/ $('#type-a #card-number label').each(function(index, el) { var input = $(this).next(':input'); $(this).find('.help').text('').hide(); if (input.attr('type') == 'text') { input.attr('placeholder', $(this).text()); $(this).hide(); } }); /* accordeon*/ /*Step3.select('.payment_body').hide(); Step3.select('.payment_head').each(function(index, el) { $(this).click(function(event) { if ($(this).siblings('.payment_body').is(':visible')){ return; }else { Step3.select('.payment_body').slideUp(); Step3.select('.payment_head').removeClass('active'); $(this).siblings('.payment_body').slideDown(); $(this).addClass('active'); } }); });*/ Step3.select('.payment_body').hide(); if ( typeof Step1 != 'undefined'){ $('.payment_mode h4',Step1['payment_modes_regular']).each(function(index, el) { $(this).click(function(event) { if ($(this).siblings('.payment_body').is(':visible')){ return; }else { $('.payment_body',Step1['payment_modes_regular']).slideUp(); $('.payment_mode h4',Step1['payment_modes_regular']).removeClass('active'); $(this).siblings('.payment_body').slideDown( "slow", function() { // Animation complete. Steps.adaptHeight(); //console.log('BOUM'); }); $(this).addClass('active'); } }); }); $('.payment_mode h4',Step1['payment_modes_once']).each(function(index, el) { $(this).click(function(event) { if ($(this).siblings('.payment_body').is(':visible')){ return; }else { $('.payment_body',Step1['payment_modes_once']).slideUp(); $('.payment_mode h4',Step1['payment_modes_once']).removeClass('active'); $(this).siblings('.payment_body').slideDown( "slow", function() { // Animation complete. Steps.adaptHeight(); //console.log('BOUM'); }); $(this).addClass('active'); } }); }); } Step3.select('#payment_mode-paypal .payment_head').each(function(index, el) { $(this).find('.payment_mode_title').html(''); }); Step3.select('#payment_mode-paypal_paypal .payment_head').each(function(index, el) { $(this).find('.payment_mode_title').html(''); }); Step3.select('#payment_mode-highconnexion_highconnexion .payment_body').each(function(index, el) { $(this).prepend('