1var _pallback = function () {}; 2$(function () { 3 $("[data-id=search]").click(function () { 4 if ($("#SearchValidateCode").val() == "") { 5 $(".field-validation-error").html("请è¾å ¥éªè¯ç ã"); 6 return; 7 } 8 9 $.ajaxPreventCSRF({ 10 type: "post", 11 dataType: 'json', 12 async: false, 13 url: $("#SearchValidateCode").attr("data-val-captcha-url"), 14 data: { captcha: $("#SearchValidateCode").val() }, 15 success: function (data) { 16 if (data) { 17 closeModal(); 18 _pallback(); 19 } else { 20 $(".field-validation-error").html($("#SearchValidateCode").attr("data-val-captcha")); 21 $("#SearchValidateCode").val(""); 22 $("#VolidateCodeDiv .validationcode img").trigger("click"); 23 } 24 } 25 }); 26 }); 27 28 $(".close").click(function () { 29 closeModal(); 30 }); 31 32 $('#SearchValidateCode') 33 .keydown(function (e) { 34 if (e.keyCode == 13) { 35 var $this = $(this); 36 var keyword = encodeURIComponent($this.val()); 37 if (keyword) { 38 $("[data-id=search]").trigger("click"); 39 } 40 } 41 }); 42}); 43 44function validateCode(pallback) { 45 if ($("input[name=wd]").val() == "" && $('#isadvancesearch').val() == "false") { 46 alert("请è¾å ¥å ³é®è¯"); 47 return; 48 } 49 50 _pallback = pallback; 51 var url = $(".search").attr("data-val-captcha-visible-url"); 52 $.ajax({
53 type: "get", 54 url: url, 55 dataType: 'text', 56 async: false, 57 cache: false, 58 success: function (data) { 59 if (data == "True" && $("#VolidateCodeDiv,.modal-backdrop").length > 0) { 60 openModal(); 61 var SearchValidateCode = $("#SearchValidateCode").parent().find("img"); 62 if (SearchValidateCode.length == 0) { 63 refreshValidateCode(); 64 65 } 66 67 $.refreshCsrf(); 68 } else { 69 closeModal(); 70 _pallback(); 71 } 72 } 73 }); 74} 75 76function openModal() { 77 $("#VolidateCodeDiv,.modal-backdrop").show(); 78 $(".field-validation-error").html(""); 79 $("#SearchValidateCode").val(""); 80 $("body").addClass("modal-open"); 81 $("#VolidateCodeDiv .validationcode img").trigger("click"); 82} 83 84function closeModal() { 85 $("#VolidateCodeDiv,.modal-backdrop").hide(); 86 $("body").removeClass("modal-open"); 87} 88 89function refreshValidateCode() { 90 $('#VolidateCodeDiv [data-type=searchcaptcha]') 91 .each(function () { 92 var $captchaImage = $('<img>'), 93 self = $(this), 94 setting = self.data(); 95 if (self.find("img").length === 0) { 96 $captchaImage.attr('title', 'ç䏿¸ ï¼æ¢ä¸å¼ '); 97 $captchaImage.attr('src', setting.captchaUrl); 98 $captchaImage.click(function () { 99 $captchaImage.attr('src', setting.captchaUrl + '?code=' + Math.random()); 100 }); 101 self.append($captchaImage); 102 } 103 }); 104}
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.