1$(function () { 2 var url = "/login/ajaxIsLogin"; 3 $.ajax({ 4 type: "POST", 5 data: {}, 6 url: url, 7 dataType: "json", 8 success: function (data) { 9 if (data.status == "1") { 10 isLogin = true; 11 userid = data.data.userid; 12 var html = '<div class="r class-header">'; 13 14 if (data.data.notice.length > 0) { 15 html += '<label class="color-6">æ¶æ¯</label>'; 16 html += '<em class="text-c border-2 white vel">' + data.data.notice.length + '</em>'; 17 } 18 html += '<a href="/user/' + data.data.userid + '" class="header as">'; 19 html += '<img src="//file.tvsou.com/f/' + data.data.photo + '/zm44-44" width="40" height="40" class="border-radius vel" alt=""></a></div>'; 20 21 html += '<div class="header-list absolute hide" style="display: none;"><ol class="font-12">'; 22 html += '<li><a rel="nofollow" href="/user/' + data.data.userid + '" class="class-icon icon-01 color-6"><span>æç主页</span></a></li>'; 23 html += '<li><a href="/my" class="class-icon icon-03 color-6"><span>设置</span></a></li>'; 24 html += '<li><a href="/login/exit" class="class-icon icon-04 color-6"><span>éåºç»å½</span></a></li>'; 25 html += '</ol></div>'; 26 $(".login-div").remove(); 27 $(".search-bg-h").show(); 28 $(".search-bg-h").before(html); 29 var _order_timeout; 30 $(".class-header").hover(function () { 31 clearTimeout(_order_timeout); 32 $(".header-list").show() 33 }, function () { 34 _order_timeout = setTimeout(function () { 35 $(".header-list").hide() 36 }, 500) 37 }); 38 $(".header-list").hover(function () { 39 clearTimeout(_order_timeout); 40 $(".header-list").show() 41 }, function () { 42 _order_timeout = setTimeout(function () { 43 $(".header-list").hide() 44 }, 500) 45 }); 46 var noticeTimeout; 47 $("body").delegate(".menu-notice-btn", "click", function () { 48 $(".menu-notice-list").show() 49 }); 50 $("body").delegate(".menu-notice-btn", "mouseout", function () { 51 noticeTimeout = setTimeout(function () { 52 $(".menu-notice-list").hide() 53 }, 500) 54 }); 55 $(".menu-notice-list").hover(function () { 56 clearTimeout(noticeTimeout); 57 $(".menu-notice-list").show() 58 }, function () { 59 noticeTimeout = setTimeout(function () { 60 $(".menu-notice-list").hide() 61 }, 500) 62 }); 63 $("body").delegate(".menu-notice-read", "click", function () { 64 var url = "/tvsou/user/ajaxDoNotice"; 65 $.ajax({ 66 type: "POST", 67 data: { 68 "id": $(this).attr("data-id") 69 }, 70 url: url, 71 dataType: "json", 72 success: function (data) {} 73 }) 74 }) 75 } else { 76 $(".search-bg-h").show(); 77 $(".login-div").show() 78 } 79 } 80 }); 81 $("#keywords").bind({ 82 focus: function () { 83 $(this).addClass("color-3") 84 }, 85 blur: function () { 86 $(this).removeClass("color-3") 87 }, 88 keypress: function (event) { 89 if (event.keyCode == "13") { 90 if ($("#keywords").val() != "") { 91 var base = new Base64(); 92 var keyword = encodeURIComponent(base.encode($("#keywords").val())); 93 window.location.href = "/search/" + keyword 94 } else { 95 $("#keywords").attr("placeholder", "æç´¢èç®ãææãé¢é") 96 } 97 } 98 } 99 }); 100 $(".search-top-btn").click(function () { 101 if ($("#keywords").val() != "") { 102 var base = new Base64(); 103 var keyword = encodeURIComponent(base.encode($("#keywords").val())); 104 window.location.href = "/search/" + keyword 105 } else { 106 $("#keywords").attr("placeholder", "æç´¢èç®ãææãé¢é") 107 } 108 }) 109 110 function Base64() { 111 // private property 112 _keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
112+/="; 113 // public method for encoding 114 this.encode = function (input) { 115 var output = ""; 116 var chr1, chr2, chr3, enc1, enc2, enc3, enc4; 117 var i = 0; 118 input = _utf8_encode(input); 119 while (i < input.length) { 120 chr1 = input.charCodeAt(i++); 121 chr2 = input.charCodeAt(i++); 122 chr3 = input.charCodeAt(i++); 123 enc1 = chr1 >> 2; 124 enc2 = ((chr1 & 3) << 4) | (chr2 >> 4); 125 enc3 = ((chr2 & 15) << 2) | (chr3 >> 6); 126 enc4 = chr3 & 63; 127 if (isNaN(chr2)) { 128 enc3 = enc4 = 64; 129 } else if (isNaN(chr3)) { 130 enc4 = 64; 131 } 132 output = output + 133 _keyStr.charAt(enc1) + _keyStr.charAt(enc2) + 134 _keyStr.charAt(enc3) + _keyStr.charAt(enc4); 135 } 136 return output; 137 } 138 // public method for decoding 139 this.decode = function (input) { 140 var output = ""; 141 var chr1, chr2, chr3; 142 var enc1, enc2, enc3, enc4; 143 var i = 0; 144 input = input.replace(/[^A-Za-z0-9\+\/\=]/g, ""); 145 while (i < input.length) { 146 enc1 = _keyStr.indexOf(input.charAt(i++)); 147 enc2 = _keyStr.indexOf(input.charAt(i++)); 148 enc3 = _keyStr.indexOf(input.charAt(i++)); 149 enc4 = _keyStr.indexOf(input.charAt(i++)); 150 chr1 = (enc1 << 2) | (enc2 >> 4); 151 chr2 = ((enc2 & 15) << 4) | (enc3 >> 2); 152 chr3 = ((enc3 & 3) << 6) | enc4; 153 output = output + String.fromCharCode(chr1); 154 if (enc3 != 64) { 155 output = output + String.fromCharCode(chr2); 156 } 157 if (enc4 != 64) { 158 output = output + String.fromCharCode(chr3); 159 } 160 } 161 output = _utf8_decode(output); 162 return output; 163 } 164 _utf8_encode = function (string) { 165 string = string.replace(/\r\n/g, "\n"); 166 var utftext = ""; 167 for (var n = 0; n < string.length; n++) { 168 var c = string.charCodeAt(n); 169 if (c < 128) { 170 utftext += String.fromCharCode(c); 171 } else if ((c > 127) && (c < 2048)) { 172 utftext += String.fromCharCode((c >> 6) | 192); 173 utftext += String.fromCharCode((c & 63) | 128); 174 } else { 175 utftext += String.fromCharCode((c >> 12) | 224); 176 utftext += String.fromCharCode(((c >> 6) & 63) | 128); 177 utftext += String.fromCharCode((c & 63) | 128); 178 } 179 } 180 return utftext; 181 } 182 // private method for UTF-8 decoding 183 _utf8_decode = function (utftext) { 184 var string = ""; 185 var i = 0; 186 var c = c1 = c2 = 0; 187 while (i < utftext.length) { 188 c = utftext.charCodeAt(i); 189 if (c < 128) { 190 string += String.fromCharCode(c); 191 i++; 192 } else if ((c > 191) && (c < 224)) { 193 c2 = utftext.charCodeAt(i + 1); 194 string += String.fromCharCode(((c & 31) << 6) | (c2 & 63)); 195 i += 2; 196 } else { 197 c2 = utftext.charCodeAt(i + 1); 198 c3 = utftext.charCodeAt(i + 2); 199 string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63)); 200 i += 3; 201 } 202 } 203 return string; 204 } 205 } 206 207});
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.