1function getByClassNames(classStr, tag) { 2 if (document.getElementsByClassName) { 3 return document.getElementsByClassName(classStr) 4 } else { 5 var nodes = document.getElementsByTagName('body'); 6 var ret = []; 7 if (tag && Object.prototype.toString.call(tag).toLowerCase() !== '[object string]') { 8 nodes = tag; 9 } 10 for (var i = 0; i < nodes.length; i++) { 11 if (hasClass(nodes[i], classStr)) { 12 ret.push(nodes[i]) 13 } 14 return ret; 15 } 16 } 17} 18 19var select_banner = function () { 20 var baseMimgUrl = 'static/mimg'; 21 // if(window.cssPath && typeof window.cssPath === 'string'){ 22 // var _url = window.cssPath.split('/'); 23 // for (var index = 0; index < _url.length; index++) { 24 // var element = _url[index]; 25 // if(element && element!== 'http' && element!== 'https'){ 26 // baseMimgUrl = element; 27 // break; 28 // } 29 // } 30 // } 31 var lxStyledBanners = ['/'+ baseMimgUrl +'/p/official_site/admin/imageRight.png', 32 '/'+ baseMimgUrl +'/p/official_site/admin/imageLeft.png', 33 '/'+ baseMimgUrl +'/p/official_site/admin/imageCenter.png', 34 '/' + baseMimgUrl + '/p/official_site/admin/imageRight.png'], 35 computedBanner; 36 37 // å¦æç¨æ·ä½¿ç¨é»è®¤èæ¯ï¼åæ ¹æ®æ ·å¼éæ©é»è®¤èæ¯ 38 // å¦åæ ¹æ®æä»¶åç§°å¤æç¨æ·çèªå®ä¹èæ¯å¾çæ¯æ¹çä¹åä¸ä¼ è¿æ¯æ¹çä¹åä¸ä¼ 39 // æ¹çä¹åä¸ä¼ çå¾çéè¦åå ¼å®¹å¤çï¼ä¸æ¾ç¤ºç»å½æ¡èæ¯ã设置ç»å½æ¡èæ¯è² 40 41 var $loginModWrapper = getId('login-mod-wrapper'); 42 43 44 if (isDefaultBg) { 45 computedBanner = lxStyledBanners[currentStyle]; 46 } else { 47 computedBanner = currentBanner; 48 var timeStr = computedBanner.match(/\/([\d]+)\.[^\/]+$/) && computedBanner.match(/\/([\d]+)\.[^\/]+$/)[1] || undefined, 49 uploadTime = timeStr && new Number(timeStr) || undefined, 50 judgeTime = 1353600000000;//2012-11-23 00:00:00 51 if (!uploadTime || uploadTime < judgeTime) { 52 $loginModWrapper.style.backgroundImage = 'none'; 53 $loginModWrapper.style.backgroundColor = '#fff'; 54 } 55 } 56 // è®¾ç½®èæ¯bannerå¾ç 57 var $mainPart = getId('main-part'); 58 $mainPart.style.backgroundImage = 'url(' + computedBanner.replace('http:','https:') + ')'; 59 if (isDefaultBg) { 60 // é»è®¤èæ¯æ¶å ä¸ç¹å»è·³è½¬ 61 $mainPart.style.cursor = 'pointer'; 62 63 $mainPart.onclick =function () { 64 var win_mail = window.open("//dashi.163.com/index.html?from=mail413"); 65 win_mail.opener = null; 66 window.DATracker && DATracker.track('click_login_pic_download'); 67 }; 68 } 69 70 // æ ¹æ®style设置ç»å½æ¡çæ ·å¼ 71 setLoginStyle('login-mod-wrapper'); 72 setLoginStyle('login-mod-qr'); 73 74 function setLoginStyle(domId){ 75 var $loginbox = getId(domId); 76 if($loginbox){ 77 addClass($loginbox,'login-mod-wrapper-' + currentStyle); 78 $loginbox.style.cursor = 'default'; 79 $loginbox.onclick = function (e) { 80 if ( e && e.stopPropagation ) { 81 e.stopPropagation(); 82 } else { 83 window.event.cancelBubble = true; 84 } 85 }; 86 } 87 } 88 89 getId('login-mod-wrapper').style.display = 'block'; 90 91 if(getId('official_app')){ 92 getId('official_app').onclick = function() { 93 // window.open('https://hubble.netease.com/sl/aaagOQ'); 94 window.DATracker && DATracker.track('click_login_topbar_mailapplication'); 95 }; 96 97 getId('official_app').onmouseenter = function() { 98 window.DATracker && DATracker.track('scan_login_topbar_mailappliction'); 99 }; 100 101 // getId('donwload_block').onclick =function() { 102 // window.DATracker && DATracker.track('click_login_account_download'); 103 // window.open('https://hubble.netease.com/sl/aaagOK'); 104 // }; 105 } 106 107 function QrLogin() { 108 this.type = ""; 109 this.lang = "zh_cn" 110 var param = window.location.search.split("?")[1]; 111 if(param && param.indexOf("hl=en_US") > -1){ 112 this.lang = "en_US" 113 } 114 } 115 116 Object.extend = function(destination, source) { 117 for (var property in source) { 118 destination[property] = source[property]; 119 } 120 return destination; 121 } 122 123 Object.extend(QrLogin.prototype, { 124 map: { 125 "dashi":{ 126 getQrSrc : function (t) { 127 return "https://mail.qiye.163.com/commonweb/qrcode/getqrcode.do?w=130&h=130&t=" + (t ? Date.now() : ""); 128 }, 129 getQrCheck: function () { 130 return "https://mail.qiye.163.com/commonweb/qrcode/checkstatus.do?p=qiyemail" 131 }, 132 name: { 133 "zh_cn": "é®ç®±å¤§å¸", 134 "en_US": "Mail Master" 135 }, 136 }, 137 "wechat":{ 138 getQrSrc : function (t) { 139 var domain = getId('domain') ? (getId('domain').value || '') : ''; 140 return "https://open.qiye.163.com/miniapp/qrcode/create?type=1&w=130&h=130&t=" + (t ? Date.now() : "") + "&domain=" + domain; 141 }, 142 getQrCheck: function () { 143 return "https://open.qiye.163.com/miniapp/qrcode/check?p=qiyemail&all_secure=1&hl=zh_CN&ch=" 144 }, 145 name:{ 146 "zh_cn": "微信", 147 "en_US": "Wechat" 148 } 149 }, 150 "qiyewechat":{ 151 getQrSrc: function () { 152 return '' 153 }, 154 getQrCheck : function () { 155 return void(0); 156 }, 157 getOpenLink : function () { 158 var searchParamGroup = []; 159 var param = window.location.search.split("?")[1]; 160 searchParamGroup.push({ 161 key: 'domain', 162 value: getId('domain') ? (getId('domain').value || '') : '' 163 }); 164 searchParamGroup.push({ 165 key:'hl', 166 value: (param && param.indexOf("hl=en_US") > -1) ? 'en_US' : 'zh_CN' 167 }); 168 searchParamGroup.push({ 169 key:'all_secure', 170 value: getId('all_secure') ? (getId('all_secure').value || "1") : "1" 171 }); 172 var queryStrArr = []; 173 for (var index = 0; index < searchParamGroup.length; index++) { 174 var p = searchParamGroup[index]; 175 queryStrArr.push(p.key + '=' + p.value); 176 } 177 var url = 'https://open.qiye.163.com/miniapp/qiye_weixin/qr/login?' + queryStrArr.join('&') 178 return url; 179 }, 180 name:{ 181 "zh_cn":'ä¼ä¸å¾®ä¿¡', 182 'en_US': 'WeCom' 183 } 184 }, 185 "dingtalk":{ 186 getQrSrc: function (t) { 187 var domain = getId('domain') ? (getId('domain').value || '') : ''; 188 return "https://open.qiye.163.com/miniapp/qrcode/create?type=2&w=130&h=130&t=" + (t ? Date.now() : "") + "&domain=" + domain ; 189 }, 190 getQrCheck : function () { 191 return "https://open.qiye.163.com/miniapp/qrcode/check?p=qiyemail&all_secure=1&hl=zh_CN&ch=" 192 }, 193 name:{ 194 "zh_cn":'éé', 195 'en_US': 'DingTalk' 196 } 197 }, 198 "sirius":{ 199 getQrSrc: function (t) { 200 var domain = getId('domain') ? (getId('domain').value || '') : ''; 201 return "https://open.qiye.163.com/miniapp/qrcode/create?type=5&w=130&h=130&t=" + (t ? Date.now() : "") + "&domain=" + domain ; 202 }, 203 getQrCheck : function () { 204 return "https://open.qiye.163.com/miniapp/qrcode/check?p=sirius&all_secure=1&hl=zh_CN&ch=" 205 }, 206 name:{ 207 "zh_cn":'ç½æçµçåå ¬å®¢æ·ç«¯', 208 'en_US': 'NetEase Lingxi Client' 209 } 210 } 211 }, 212
213 //å·æ°äºç»´ç 214 refreshQrCode: function () { 215 var that = this; 216 var appCodeImg = getId("appCode"); 217 var imgUrl = that.map[that.type].getQrSrc(true); 218 var openLink = that.map[that.type].getOpenLink && that.map[that.type].getOpenLink(); 219 if(imgUrl){ 220 appCodeImg.src =imgUrl; 221 return true; 222 } 223 if(openLink){ 224 window.open(openLink,'_blank'); 225 return false; 226 } 227 }, 228 //å¼å§äºç»´ç æ«æè½®è¯¢ 229 startScan: function () { 230 var that = this; 231 /*éç½®æ«ç ç¶æ å¼å§*/ 232 that.stopScan(); 233 if(!that.refreshQrCode()){ 234 return; 235 } 236 var appLoginWait = getId('appLoginWait'); 237 var appLoginScan = getId('appLoginScan'); 238 appLoginWait.style.display = 'block'; 239 appLoginScan.style.display = 'none'; 240 var url = that.map[that.type].getQrCheck(); 241 /*éç½®æ«ç ç¶æ ç»æ*/ 242 that.scanTimer = setTimeout(checkCode, 2000); 243 function checkCode() { 244 JSONP({ 245 url: url, 246 // type: 'get', 247 //dataType: 'jsonp', 248 success: function (response) { 249 if(response && (response.code === 200 || response.suc)){ 250 var data = response.result || response.con; 251 if (data.status == 0) { 252 //æªæ«ç 253 } 254 else if (data.status == 1) { 255 //æ«ç æå 256 appLoginWait.style.display = 'none'; 257 appLoginScan.style.display = 'block'; 258 } 259 else if (data.status == 2) { 260 //ç»å½æå 261 return window.location.href = data.loginurl || data.loginUrl; 262 } 263 else if (data.status == 3) { 264 //ä¸åå¨æå·²è¿æ 265 that.showCodeRefresh(); 266 } 267 } 268 that.scanTimer = setTimeout(checkCode, 2000); 269 }, 270 error: function () { 271 that.showCodeRefresh(); 272 } 273 }); 274 } 275 276 }, 277 //忢äºç»´ç æ«æè½®è¯¢ 278 stopScan: function () { 279 var that = this; 280 clearTimeout(that.scanTimer); 281 clearInterval(that.scanTimer); 282 }, 283 //æ¾ç¤ºäºç»´ç 失æé®ç½© 284 showCodeRefresh: function () { 285 var that = this; 286 that.stopScan(); 287 getId('appCodeRefresh').style.display = 'block'; 288 removeClass(getId('appCodeWrap'),'allowmove'); 289 }, 290 //éèäºç»´ç 失æé®ç½© 291 hideCodeRefresh: function () { 292 var that = this; 293 getId('appCodeRefresh').style.display = 'none'; 294 addClass(getId('appCodeWrap'),'allowmove'); 295 that.startScan(); 296 }, 297 initQrcode: function () { 298 var that = this; 299 //var $appList = getId('appList'); 300 // var $appList = getByClassNames('J_appList'); 301 // var $siriusScan = getByClassNames('J_app_sirius'); 302 var $appList = $dom.get('.J_appList'); 303 var $siriusScan = $dom.get('.J_app_sirius'); 304 that.scanTimer = null; 305 var $codebox = getId("codeContain"); 306 var $appName = getId("appName"); 307 var $siriusPc = getId("sirius_pc_wrapper"); 308 var $closeBtn = getId("closeEntryBtn"); 309 var $siriusWrapper = getId("app_sirius_wrapper"); 310 $codebox.onclick = function (e) { 311 if ( e && e.stopPropagation ) { 312 e.stopPropagation(); 313 } else { 314 window.event.cancelBubble = true; 315 } 316 } 317 318 319 for(var i=0;i<$appList.length;i++){ 320 $appList[i].onclick = thirdScanCallback; 321 } 322 323 for(var i=0;i<$siriusScan.length;i++){ 324 $siriusScan[i].onclick = thirdScanCallback; 325 } 326 327 function thirdScanCallback (e) { 328 var event = e || window.event; 329 var target= event.target || event.srcElement; 330 var id = target.getAttribute('id'); 331 if(id == 'accountlogin'){ 332 getId('loginmod').style.display = 'block'; 333 getId('mobilemod').style.display = 'none'; 334 return; 335 } 336 337 if(id == 'mobilelogin'){ 338 getId('loginmod').style.display = 'none'; 339 getId('mobilemod').style.display = 'block'; 340 return; 341 } 342 343 switch (id) { 344 case "appDashi": 345 that.type = "dashi"; 346 break; 347 case "appWechat": 348 that.type = "wechat"; 349 break; 350 case "appQiyeWechat": 351 that.type = "qiyewechat"; 352 break; 353 case "appDingtalk": 354 that.type = "dingtalk"; 355 break; 356 case "appSirius": 357 that.type = "sirius"; 358 break; 359 default: 360 return 361 } 362 if(!that.refreshQrCode()){ 363 return 364 } 365 $appName.innerHTML = that.map[that.type].name[that.lang]; 366 367 if(id == 'appSirius'){ 368 $siriusPc.style.display = 'block'; 369 $closeBtn.style.display = 'none'; 370 }else{ 371 if($siriusPc){ 372 $siriusPc.style.display = 'none'; 373 } 374 $closeBtn.style.display = 'block'; 375 } 376 377 $codebox.style.display = 'block'; 378 $codebox.style.left = '0'; 379 $codebox.style.top = '0'; 380 $codebox.style.opacity = 1; 381 that.startScan(); 382 }; 383 384 $siriusPc.onclick = closeQrCodeCallback; 385 $closeBtn.onclick = closeQrCodeCallback; 386 387 function closeQrCodeCallback(e) { 388 var event = e || window.event; 389 var target= event.target || event.srcElement; 390 var id = target.getAttribute('id'); 391 $codebox.style.left = '413px'; 392 $codebox.style.top = '335px'; 393 $codebox.style.opacity = 0; 394 getId('appCodeRefresh').style.display = 'none'; 395 addClass(getId('appCodeWrap'),'allowmove'); 396 that.type = ""; 397 that.stopScan(); 398 }; 399 400 getId('appLoginRestart').onclick = function () { 401 that.startScan(); 402 }; 403 getId('appCodeRefresh').onclick =function () { 404 that.hideCodeRefresh(); 405 } 406 407 }, 408 scanCodeHandler: function () { 409 var that = this; 410 that.initQrcode(); 411 } 412 }) 413 414 var qrLogin = new QrLogin() 415 qrLogin.scanCodeHandler() 416 // 设置éè¯¯æ¶æ¯ 417 if (errMsg.trim().length > 0) { 418 setMsgpid(errMsg); 419 } 420}; 421 422select_banner(); 423// $dom.onready(function(){ 424// select_banner(); 425// })
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.