1$(function(){ 2 $('#feedback').validate({ 3 errorElement: 'span', 4 errorClass: 'false', 5 validClass: 'right', 6 onfocusout: function(element){ 7 $(element).valid(); 8 }, 9 errorPlacement: function(error,element){ 10 element.parent().next().append(error); 11 }, 12 highlight: function(element, errorClass, validClass) { 13 $(element).removeClass('right').addClass('false'); 14 $(element).parent().next().removeClass('right').addClass('false').find('i').html(''); 15 }, 16 success: function(span){ 17 span.parent().removeClass('false').addClass('right'); 18 //span.prev('.iconfont').html(''); 19 }, 20 rules: { 21 username: { 22 required: true 23 }, 24 email: { 25 required: true, 26 email: true 27 }, 28 phone: { 29 minlength: 5, 30 maxlength: 11, 31 digits: true 32 }, 33 title: { 34 required: true 35 }, 36 message: { 37 required: true, 38 minlength: 6 39 } 40 }, 41 messages: { 42 username: { 43 required: '请填åå§å' 44 }, 45 email: { 46 required: '请填åE-mail', 47 email : '请è¾å ¥æ£ç¡®æ ¼å¼ççµåé®ä»¶' 48 }, 49 phone: { 50 minlength: "çµè¯å·ç é¿åº¦ä¸º5-11ä½", 51 maxlength: "çµè¯å·ç é¿åº¦ä¸º5-11ä½", 52 digits: 'çµè¯å·ç åªè½è¾å ¥æ°å' 53 }, 54 title: { 55 required: 'è¯·å¡«åæ é¢' 56 }, 57 message: { 58 required: '请填åé®é¢æè¿°', 59 minlength: "é®é¢æè¿°è³å°è¦6个å符" 60 } 61 }, 62 /* éåé误æ¾ç¤ºæ¶æ¯æ¹æ³,以alertæ¹å¼å¼¹åºéè¯¯æ¶æ¯ */ 63 showErrors : function(errorMap, errorList) { 64 var msg = ""; 65 $.each(errorList, function(i, v) { 66 msg += (v.message + "<br/>"); 67 }); 68 if (msg != "") 69 appUtil.wintitle(msg); 70 }, 71 /* 失å»ç¦ç¹æ¶ä¸éªè¯ */ 72 onfocusout : false, 73 onkeyup:false, 74 }); 75}) 76$.validator.setDefaults( { 77 submitHandler: function (form) { 78 $(form).ajaxSubmit({ 79 type:"post", 80 url:"/api/feedback?"+ (new Date()).getTime(), 81 success: function (result, statusText, xhr, ele) { 82 if (result.isSuccess) { 83 appUtil.wintitle($("#feedbacktitle").val()+"å·²ç»åéæåï¼"); 84 var textinfo = $("#feedback input[type='text'],textarea"); 85 textinfo.each(function(){ 86 $(this).val(""); 87 }); 88 } else { 89 appUtil.wintitle("æ¨æäº¤ç太é¢ç¹!伿¯ä¸ä¼å§!"); 90 } 91 } 92 }); 93 } 94}); 95/*éªè¯demo表åend*/ 96/*** app.js ***/ 97var appUtil = { 98 wintitle: function (a) { 99 var c, d, b = this; 100 this.msg_back || (c = '<div id="msg_back" onclick="appUtil.hideAlert();" style="display:none;position:absolute;background-color: #666;width:100%;height:' + document.body.scrollHeight + 'px;left:0px;top:0px;filter:alpha(opacity=10);opacity:0.1;z-index:1000;"></div>', d = '<div id="msg_body" onclick="appUtil.hideAlert();" style="display:none;position:fixed;overflow:hidden;border-radius:5px;text-align:center;z-index:1001;width:60%;color:#FFF;height:auto;line-height:22px;padding:15px 0;top:260px;left:40%;margin-left:-20%;filter:alpha(opacity=60);opacity: 0.8;background:#000;"></div>', this.msg_back = $(c), this.msg_body = $(d), this.msg_back.appendTo(document.body), this.msg_body.appendTo(document.body)), 101 this.msg_body.html(a), 102 b.msg_back.show(), 103 b.msg_body.show(), 104 //$.browser.safari && $.browser.version <= 532.9 && window.scrollTo(0, 0), 105 msgTimeout = setTimeout(function () { 106 b.msg_back.hide(), 107 b.msg_body.hide() 108 }, 109 3e3) 110 }, 111 hideAlert: function () { 112 this.msg_back.hide(), 113 this.msg_body.hide(), 114 msgTimeout && window.clearTimeout(msgTimeout) 115 } 116}; !(window.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.