1(function (e) { 2 e.fn.ham3dform = function (t) { 3 var n = { 4 start_load: function () { 5 }, 6 elements_ok: function () { 7 }, 8 elements_no: function () { 9 }, 10 response: function () { 11 }, 12 check: function () { 13 }, 14 start_form_validate: function () { 15 }, 16 send: true, 17 all_elements_ok: function () { 18 }, 19 bind: "submit" 20 }; 21 var r = e.extend(n, t); 22 return this.each(function () { 23 submited = ""; 24 e(this).find("input[type='submit']").unbind("click").bind("click", function () { 25 submited = "&" + e(this).attr("name") + "=ok"; 26 }); 27 e(this).unbind(r.bind).bind(r.bind, function () { 28 29 pat_arr = new Array; 30 pat_arr["email"] = /^[a-zA-Z0-9-._]+@[a-zA-Z0-9-._]+\.[a-zA-Z0-9-._]{2,4}$/i; 31 pat_arr["url"] = /http\:\/\/[a-zA-Z0-9-._]+\.[a-zA-Z]{2,4}/i; 32 pat_arr["user"] = /^[a-zA-Z0-9-._]{2,20}$/; 33 pat_arr["pass"] = /^[a-zA-Z0-9-._]{5,20}$/; 34 pat_arr["fish"] = /^[\u0600-\u06FF 0-9-._]{1,20}$/; 35 pat_arr["cap"] = /^[0-9-]{5}$/; 36 pat_arr["zip"] = /^[0-9-]{10}$/; 37 pat_arr["mobile"] = /^09[0-9]{9}$/; 38 pat_arr["tell"] = /^(0[0-9]{3})?[0-9]{7,8}$/; 39 pat_arr["nationalcode"] = /^[0-9-]{10}$/; 40 pat_arr["idcertificate"] = /^[0-9-]{10}$/; 41 pat_arr["gpa"] = /^[0-9]{2}\/[0-9]{2}$/; 42 pat_arr["areacode"] = /^[0-9]{3}$/; 43 form = this; 44 error = ""; 45 e(this).find("input, select, textarea").not("[type=submit]").each(function () { 46 r.start_form_validate(form, this); 47 val = e(this).val(); 48 if (typeof e(this).attr("error") != "undefined" && e(this).attr("error") != "") { 49 if (val == "") { 50 error = e(this).attr("error") 51 } 52 } 53 54 if (typeof e(this).attr("check") != "undefined" && e(this).attr("check") != "" && e(this).val() != "") { 55 element = this; 56 for (key in pat_arr) { 57 value = pat_arr[key]; 58 if (e(element).attr("check") == key) { 59 if (!val.match(new RegExp(value))) { 60 error = r.check(element, key, pat_arr) 61 } 62 } 63 } 64 } 65 if (error != "") { 66 r.elements_no(this, error); 67 return false 68 } else { 69 r.elements_ok(this, error) 70 } 71 }); 72 73 if (error != "") { 74 return false 75 } 76 77 r.all_elements_ok(); 78 79 if (r.send) { 80 data = e(this).serialize(); 81 82 ajax_method = e(this).attr("ajax_method"); 83 84 if (typeof e(this).attr("ajax_method") == "undefined") { 85 ajax_method = "post" 86 } 87 action = e(this).attr("action"); 88 89 e.ajax({ 90 type: ajax_method, 91 url: action, 92 data: data + submited, 93 beforeSend: function (e) { 94 r.start_load(form) 95 }, 96 success: function (e) { 97 r.response(form, e) 98 } 99 }); 100 return false 101 } 102 }) 103 }) 104 } 105})(jQuery)
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.