1function addNotification() { 2 var ids = $('div.js-mailalert > input[type=hidden]'); 3 4 $.ajax({ 5 type: 'POST', 6 url: $('div.js-mailalert').data('url'), 7 data: 'id_product='+ids[0].value+'&id_product_attribute='+ids[1].value+'&customer_email='+$('div.js-mailalert > input[type=email]').val(), 8 success: function (resp) { 9 resp = JSON.parse(resp); 10 11 if (!resp.error) { 12 classes = ' bg-green-100 border-green-300 text-green-500'; 13 } else { 14 classes = ' bg-red-100 border-red-300 text-red-500'; 15 } 16 17 $('div.js-mailalert > span').html('<article class="block w-max mb-3 rounded relative border px-2 py-1' + classes + '" role="alert" data-alert="success">'+resp.message+'</article>').show(); 18 19 if (!resp.error) { 20 $('div.js-mailalert > button').hide(); 21 $('div.js-mailalert > input[type=email]').hide(); 22 $('div.js-mailalert > #gdpr_consent').hide(); 23 } 24 } 25 }); 26 return false; 27} 28 29$('document').ready(function() { 30 $('.js-remove-email-alert').click(function() { 31 var self = $(this); 32 var ids = self.attr('rel').replace('js-id-emailalerts-', ''); 33 ids = ids.split('-'); 34 var id_product_mail_alert = ids[0]; 35 var id_product_attribute_mail_alert = ids[1]; 36 var parent = self.closest('li'); 37 38 $.ajax({ 39 url: self.data('url'), 40 type: "POST", 41 data: { 42 'id_product': id_product_mail_alert, 43 'id_product_attribute': id_product_attribute_mail_alert 44 }, 45 success: function(result) { 46 if (result == '0') { 47 parent.fadeOut("normal", function() { 48 parent.remove(); 49 }); 50 } 51 } 52 }); 53 }); 54});
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.