1var isenselabs_gdpr_path = 'extension/module/isenselabs_gdpr'; 2 3$(document).ready(function() { 4 $.ajax({ 5 url: 'index.php?route=' + isenselabs_gdpr_path + '/getOptinsSettings', 6 type: 'get', 7 data: {}, 8 dataType: 'json', 9 success: function(resp) { 10 if (!resp.error && resp.data.enabled && ($('form[action*="information/contact"]').length == 1 || $('form textarea[name="enquiry"]').length == 1)) { 11 var checkbox_html = '<label><input type="checkbox" name="optin_agree" value="1" /> ' + resp.data.text_optin_checkbox + '</label>'; 12 var form = $('textarea[name="enquiry"]').parents('form'); 13 var textarea = form.find('textarea[name=enquiry]'); 14 if(textarea.next('.text-danger').length > 0) { 15 textarea.next('.text-danger').after(checkbox_html); 16 } else { 17 textarea.after(checkbox_html); 18 } 19 if(typeof Journal == 'object') { 20 form.find('input[name=optin_agree]').parent('label').css('width', '100%'); 21 } 22 23 form.on('submit', function(e) { 24 e.preventDefault(); 25 26 var option_checkbox = form.find('input[name="optin_agree"]'); 27 if (!option_checkbox.is(':checked')) { 28 alert(resp.data.text_optin_error); 29 } else { 30 this.submit(); 31 } 32 }); 33 34 } 35 } 36 }); 37});
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.