1$.noConflict(); 2 3jQuery(function() { 4 var nome = $( "#nome" ), 5 email = $( "#email" ), 6 commento = $( "#commento" ), 7 tips = $( ".validateTips" ); 8 9 function updateTips( t ) { 10 tips 11 .text( t ) 12 .addClass( "ui-state-highlight" ); 13 setTimeout(function() { 14 tips.removeClass( "ui-state-highlight", 1500 ); 15 }, 500 ); 16 } 17 18 function checkLength( o, n, min, max ) { 19 if ( o.val().length > max || o.val().length < min ) { 20 o.addClass( "ui-state-error" ); 21 updateTips( "Length of " + n + " must be between " + 22 min + " and " + max + "." ); 23 return false; 24 } else { 25 return true; 26 } 27 } 28 29 function checkRegexp( o, regexp, n ) { 30 if ( !( regexp.test( o ) ) ) { 31 user_email.addClass( "ui-state-error" ); 32 updateTips( n ); 33 return false; 34 } else { 35 return true; 36 } 37 } 38 39 function validateMultipleEmailsCommaSeparated(value) { 40 var result = value.val().split(","); 41 if (result.length == 0) { 42 if(!checkRegexp(value, /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i, "Wrong email format, eg.: [email protected]")) 43 return false; 44 } else { 45 for(var i = 0;i < result.length;i++) { 46 if(!checkRegexp(result[i], /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i, "Wrong email format, eg.: [email protected]" )) 47 return false; 48 } 49 } 50 return true; 51 } 52 53 $( "#dialog-form" ).dialog({ 54 autoOpen: false, 55 height: 250, 56 width: 420, 57 modal: true, 58 show: { effect: "slide", duration: 500 }, 59 buttons: { 60 "Send": function() { 61 var bValid = true; 62 bValid = bValid && checkLength(email, "e-mail", 1, 256 ); 63 bValid = bValid && validateMultipleEmailsCommaSeparated(email); 64 if ( bValid ) { 65 $( this ).dialog( "close" ); 66 $( "#polling-form" ).dialog( "open" ); 67 $.ajax({
68 url:"ajaxSendComment.asp", 69 type: 'POST', 70 data: {'nome': nome.val(), 71 'email': email.val(), 72 'commento': commento.val() 73 }, 74 cache:false, 75 async:true, 76 success:function(result){ 77 if (result.indexOf('IZZOKEI') > 0){ 78 $( "#jpcustoms tbody" ).replaceWith("<tr>" + 79 "<td align='center' valign='top' width='100%'><br /><span class='arial14greenbold'>The Request has been processed successfully.</span><br />" + 80 "<span class='arial12blubold'>Refresh the view to see the corresponding record above.<br />" + 81 "If you do not see it, please check your email to see if you received any error notifications.<br />" + 82 "<a title='Refresh View' href='docs2.jsp?ORDER_ID=" + order_id.val() + "'><img src='img/reset_icon.png' border='0' width='27' height='27' align='absmiddle'></a></span>" + 83 "</td></tr>"); 84 } else { 85 $( "#jpcustoms tbody" ).replaceWith("<tr>" + 86 "<td align='center' valign='top' width='100%'><br /><span class='arial14redbold'>ALERT: the Request has failed:</span><br />" + 87 "<span class='arial12blusel'>" + result + "</span><br />" + 88 "<span class='arial14redbold'>Please review the MBL e HBLs info, fix any error or missing data, than retry.</span><br />" + 89 "<a title='Refresh View' href='docs2.jsp?ORDER_ID=" + order_id.val() + "'><img src='img/reset_icon.png' border='0' width='27' height='27' align='absmiddle'></a></span>" + 90 "</td>" + 91 "</tr>"); 92 } 93 $( "#polling-form" ).dialog( "close" ); 94 } 95 }); 96 } 97 }, 98 "Cancel": function() { 99 $( this ).dialog( "close" ); 100 } 101 }}); 102 103 $( "#change-vessel" ) 104 .button() 105 .click(function() { 106 $( "#change-vessel-form" ).dialog( "open" ); 107 }); 108 109 $( "#polling-form" ).dialog({ 110 autoOpen: false, 111 height: 250, 112 width: 420, 113 modal: true 114 }); 115 });
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.