1(function($){ 2 $("#customer-login__submit, #customer-add__submit").on("click", function(){ 3 var boxOpen = $(this).data("open"); 4 var boxClose = $(this).data("close"); 5 6 $('.access-button').each(function() { 7 if (!$(this).hasClass('button--inverse')) { 8 $(this).addClass('button--inverse'); 9 } 10 }) 11 12 if ($(this).hasClass('button--inverse')) { 13 $(this).removeClass('button--inverse'); 14 } 15 if($("#"+boxOpen+"__box").hasClass("open")){ 16 $("#"+boxOpen+"__form").submit(); 17 return false; 18 }else{ 19 $("#"+boxOpen+"__box").addClass("open").show(); 20 $("#"+boxClose+"__box").removeClass("open").hide(); 21 return false; 22 } 23 }); 24 25 $("#cliente_informativa").on("click", function(){ 26 if (this.checked) { 27 $("#customer-add__consensoprofilazione").removeClass("hidden"); 28 } 29 else { 30 $("#customer-add__consensoprofilazione").addClass("hidden"); 31 } 32 }); 33 34 35 $(".open").show(); 36 37 /* 38 * Definizione del submit della clienteadd form. 39 * 40 */ 41 function onSubmitCustomerAddForm(formsetter) 42 { 43 // invio form // 44 var optionsForm = { 45 url: contextPathLingua + '/controller?action=cliente_insert', 46 type: 'post', 47 beforeSubmit: 48 function removerror() { 49 removeErrorFieldsFromForm(formsetter); 50 }, 51 success: 52 function showResponse(jsonData, statusText) { 53 if (jsonData.status == 'ok') 54 { 55 writeFacebookPixelTrack('CompleteRegistration', '{ "content_name" : "Registration", "content_category" : "User Registration" }'); 56 var redirectTo = $('#customer-login__redirect-to').val(); 57 if (redirectTo !== '') 58 { 59 document.location.href = redirectTo; 60 } 61 else 62 { 63 document.location.href = contextPathLingua + '/customerview'; 64 } 65 } 66 else 67 { 68 $.errorBox(jsonData.message); 69 ShowErrorField(jsonData.fields, formsetter); 70 } 71 } 72 }; 73 $(formsetter).ajaxForm(optionsForm); 74 } 75 76 /* 77 * Definizione del submit della clientelogin form. 78 * 79 */ 80 function onSubmitCustomerLoginForm (formsetter) 81 { 82 // invio form // 83 var optionsForm = { 84 url: contextPathLingua + '/controller', 85 type: 'post', 86 beforeSubmit: 87 function removerror() { 88 removeErrorFieldsFromForm(formsetter); 89 }, 90 success: 91 function showResponse(jsonData, statusText) { 92 if (jsonData.status == 'ok' && jsonData.loginRedirectTo != null) 93 { 94 window.location.href = jsonData.loginRedirectTo; 95 } 96 else if (jsonData.status == 'ok') 97 document.location.href="/"; 98 else 99 { 100 $.errorBox(jsonData.message); 101 ShowErrorField(jsonData.fields, formsetter); 102 $('#customer-login__error').html(jsonData.message); 103 $('#customer-login__error').removeClass('hidden'); 104 } 105 } 106 }; 107 $(formsetter).ajaxForm(optionsForm); 108 } 109 110 onSubmitCustomerAddForm('#customer-add__form'); 111 onSubmitCustomerLoginForm('#customer-login__form'); 112})(jQuery); 113 114var _popupSocial = null; 115function socialPopUp(pag) 116{ 117 var w = 800; 118 var h = 600; 119 120 var pw = Math.floor((screen.width - w) / 2); 121 var ph = Math.floor((screen.height - h) / 2); 122 123 if(Modernizr.mq('(max-width: 768px)')){ 124 w = screen.width; 125 h = screen.height; 126 127 pw = 0; 128 ph = 0; 129 } 130 131 // Crea il popup solo se non è già stato aperto 132 if (!_popupSocial || _popupSocial.closed) 133 _popupSocial = window.open(pag, "scelte", "scrollbars=yes, toolbar=no, width=" + w + ",height=" + h + ",top=" + ph + ",left=" + pw); 134 135 // Attiva il popup (portalo in primo piano) 136 if (_popupSocial) _popupSocial.focus(); 137}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.