1 2//################################################ 3var ucws_var_debug=false; 4var ucws_stop_beat = false; 5var ucws_var_beatTimeOut = 5*1000; 6var ucws_var_checkagreelogin = 1*60*1000; /*2åéå妿客æ·éåºäºï¼è®©å®¢æ·å次ä¸çº¿*/ 7var ucws_var_pageBeatCount = 0; 8var ucws_var_beatCountLimit = 200; 9var ucws_var_currPageId = ""; 10var ucws_var_pageInter; 11var ucws_cookiekey_visitorid = "uc_visitorid"; 12var ucws_var_visitorid = ""; 13var ucws_var_customerid = ""; 14 15var ucws_var_proxyserver = "webchat.czbank.com"; 16var ucws_var_proxyport = ""; 17var ucws_var_context = "webstat/"; //ä¾å¦"webstat/" 18var ucws_var_header = "http://"; 19//var ucws_var_pageRequestUrl = ucws_var_header + ucws_var_proxyserver + ":" + ucws_var_proxyport + "/" + ucws_var_context + "webstatmain"; 20//var ucws_var_userBeatUrl = ucws_var_header + ucws_var_proxyserver + ":" + ucws_var_proxyport + "/" + ucws_var_context + "webstatmain"; 21var ucws_var_pageRequestUrl = ucws_var_header + ucws_var_proxyserver + "/" + ucws_var_context + "webstatmain"; 22var ucws_var_userBeatUrl = ucws_var_header + ucws_var_proxyserver + "/" + ucws_var_context + "webstatmain"; 23 24var ucws_var_domain = ""; 25 26var ucws_win_bgObj; 27var ucws_win_msgObj; 28var ucws_curr_inviteJson; 29 30var ucws_monitor_type = '0'; //ç¶æçæ§ 31 32//åå§åæ£ç¡®ç访é®å°ååç«¯å£ 33function ucws_path_init() { 34 var str = document.getElementById("js_ucstarwebstat").src; 35 if(str != null && str.length > 0) { 36 var theHeader = "http://"; 37 var index01 = str.indexOf("http://"); 38 var index011 = str.indexOf("https://"); 39 if(index01 < 0 && index011 >= 0) { 40 //theHeader = "https://"; 41 index01 = index011; 42 } 43 ucws_var_header = theHeader; 44 if(index01 >= 0) { 45 str = str.substring(index01+theHeader.length,str.length); 46 var index02 = str.indexOf("/"); 47 if(index02 >= 0) { 48 str = str.substring(0,index02); 49 var index03 = str.indexOf(":"); 50 if(index03 >= 0) { 51 var myaddress = str; 52 var myipaddr = str.substring(0,index03); 53 var myport = str.substring(index03+1,str.length); 54 //ucws_var_proxyserver = myipaddr; 55 //ucws_var_proxyport = myport; 56 //ucws_var_pageRequestUrl = theHeader + ucws_var_proxyserver + ":" + ucws_var_proxyport + "/" + ucws_var_context + "webstatmain";; 57 //var ucws_var_userBeatUrl = theHeader + ucws_var_proxyserver + ":" + ucws_var_proxyport + "/" + ucws_var_context + "webstatmain";; 58 ucws_var_pageRequestUrl = theHeader + ucws_var_proxyserver + "/" + ucws_var_context + "webstatmain";; 59 var ucws_var_userBeatUrl = theHeader + ucws_var_proxyserver + "/" + ucws_var_context + "webstatmain";; 60 61 } else { 62 //var myaddress = str; 63 //var myipaddr = str; 64 //ucws_var_proxyserver = myipaddr; 65 //ucws_var_proxyport = "80"; 66 //if(ucws_var_header.indexOf("https://") >= 0) { 67 // ucws_var_proxyport = "443"; 68 //} 69 ucws_var_pageRequestUrl = theHeader + ucws_var_proxyserver + "/" + ucws_var_context + "webstatmain";; 70 var ucws_var_userBeatUrl = theHeader + ucws_var_proxyserver + "/" + ucws_var_context + "webstatmain";; 71 } 72 } 73 } 74 } 75} 76 77 78function ucws_showWin(title, msg, w, h){ 79 80 //var theImgInvite = ucws_var_header + ucws_var_proxyserver + ":" + ucws_var_proxyport + "/" + ucws_var_context + "images/uc_invite.png"; 81 var theImgInvite = ucws_var_header + ucws_var_proxyserver + "/" + ucws_var_context + "images/uc_invite.png"; 82 83 var titleheight = "22px"; // æç¤ºçªå£æ é¢é«åº¦ 84 var bordercolor = "#666699"; // æç¤ºçªå£çè¾¹æ¡é¢è² 85 var titlecolor = "#FFFFFF"; // æç¤ºçªå£çæ é¢é¢è² 86 var titlebgcolor = "#A0BDE3"; // æç¤ºçªå£çæ é¢èæ¯è² 87 var bgcolor = "#FFFFFF"; // æç¤ºå 容çèæ¯è² 88 89 var iWidth = document.body.clientWidth; 90 var iHeight = document.body.clientHeight; 91 var offTop = 0; 92 if(iHeight - h > 0) { 93 offTop = iHeight - h; 94 } 95 offTop = 10; 96 97 var paddingLeft = 40; 98 //h = 70; 99 /* 100 //å°èæ¯è®¾ç½®æç°è² 101 ucws_win_bgObj = document.createElement("div"); 102 ucws_win_bgObj.style.cssText = "position:absolute;
102left:0px;top:0px;width:"+iWidth+"px;height:"+Math.max(document.body.clientHeight, iHeight)+"px;filter:Alpha(Opacity=30);opacity:0.3;background-color:#000000;z-index:101;"; 103 document.body.appendChild(ucws_win_bgObj); 104 */ 105 ucws_win_msgObj=document.createElement("div"); 106 //var theCssText = "position:absolute;font:11px 'å®ä½';top:"+(offTop)/2+"px;left:"+(iWidth-w)/2+"px;width:"+w+"px;height:"+h+"px;text-align:center;border:1px solid "+bordercolor+";background-color:"+bgcolor+";padding:1px;line-height:22px;z-index:2000;"; 107 var theCssText = "position:absolute;font:11px 'å®ä½';top:"+(offTop)/2+"px;left:"+(iWidth-w)/2+"px;width:"+w+"px;height:"+h+"px;text-align:center;padding:1px;line-height:22px;z-index:2000;"; 108 theCssText += "background: url('" + theImgInvite + "') no-repeat;"; 109 ucws_win_msgObj.style.cssText = theCssText; 110 document.body.appendChild(ucws_win_msgObj); 111 112 var table = document.createElement("table"); 113 ucws_win_msgObj.appendChild(table); 114 table.style.cssText = "margin:0px;border:0px;padding:0px;"; 115 table.cellSpacing = 0; 116 var tr = table.insertRow(-1); 117 var titleBar = tr.insertCell(-1); 118 titleBar.style.cssText = "width:100%;height:"+titleheight+"px;text-align:left;padding:3px;margin:0px;font:bold 13px 'å®ä½';"; 119 titleBar.style.paddingLeft = "5px"; 120 //titleBar.innerHTML = title; 121 var moveX = 0; 122 var moveY = 0; 123 var moveTop = 0; 124 var moveLeft = 0; 125 var moveable = false; 126 var docMouseMoveEvent = document.onmousemove; 127 var docMouseUpEvent = document.onmouseup; 128 ucws_win_msgObj.onmousedown = function() { 129 var evt = getEvent(); 130 moveable = true; 131 moveX = evt.clientX; 132 moveY = evt.clientY; 133 moveTop = parseInt(ucws_win_msgObj.style.top); 134 moveLeft = parseInt(ucws_win_msgObj.style.left); 135 136 document.onmousemove = function() { 137 if (moveable) { 138 var evt = getEvent(); 139 var x = moveLeft + evt.clientX - moveX; 140 var y = moveTop + evt.clientY - moveY; 141 //if ( x > 0 &&( x + w < iWidth) && y > 0 && (y + h < iHeight) ) { 142 ucws_win_msgObj.style.left = x + "px"; 143 ucws_win_msgObj.style.top = y + "px"; 144 //} 145 } 146 }; 147 document.onmouseup = function () { 148 if (moveable) { 149 document.onmousemove = docMouseMoveEvent; 150 document.onmouseup = docMouseUpEvent; 151 moveable = false; 152 moveX = 0; 153 moveY = 0; 154 moveTop = 0; 155 moveLeft = 0; 156 } 157 }; 158 } 159 160 var closeBtn = tr.insertCell(-1); 161 closeBtn.style.cssText = "cursor:pointer; padding-right:5px;"; 162 closeBtn.innerHTML = "<span style='font-size:15pt; width: 10px; color:"+titlecolor+";'>x</span>"; 163 closeBtn.onclick = function(){ 164 try { 165 //å é¤èæ¯è®¾ç½® 166 document.body.removeChild(ucws_win_bgObj); 167 } catch(e) { 168 169 } 170 document.body.removeChild(ucws_win_msgObj); 171 172 ucws_reLogin(); 173 } 174 var msgBox = table.insertRow(-1).insertCell(-1); 175 msgBox.style.cssText = "font:10pt 'å®ä½';"; 176 msgBox.colSpan = 2; 177 msgBox.innerHTML = msg; 178 179 // è·å¾äºä»¶Event对象ï¼ç¨äºå ¼å®¹IEåFireFox 180 function getEvent() { 181 return window.event || arguments.callee.caller.arguments[0]; 182 } 183} 184 185/** 186 * å建é请çé¡µé¢ 187 */ 188function ucws_createInviteWindow(_str) { 189 190 //var theImgAgree = ucws_var_header + ucws_var_proxyserver + ":" + ucws_var_proxyport + "/" + ucws_var_context + "images/uc_agree.png"; 191 //var theImgRefuse = ucws_var_header + ucws_var_proxyserver + ":" + ucws_var_proxyport + "/" + ucws_var_context + "images/uc_refuse.png"; 192 var theImgAgree = ucws_var_header + ucws_var_proxyserver + "/" + ucws_var_context + "images/uc_agree.png"; 193 var theImgRefuse = ucws_var_header + ucws_var_proxyserver + "/" + ucws_var_context + "images/uc_refuse.png"; 194 195 //è¯·é®æä»ä¹è½å¸®å©å°æ¨çï¼ 196 var innerStr = "<div style='padding:5px; padding-left:80px;'>"; 197 if(_str != null && _str != undefined) { 198 innerStr += decodeURIComponent(_str); 199 } else { 200 innerStr += "\u8BF7\u95EE\u6709\u4EC0\u4E48\u80FD\u5E2E\u52A9\u5230\u60A8\u7684\uFF1F"; 201 } 202 203 204 205 //åæ 206 innerStr += "</br></br><input type='image' src='" + theImgAgree + "' value='\u540C\u610F' onclick='ucws_userAgree()'/>"; 207 //æç» 208 innerStr += " <input type='image' src='" + theImgRefuse + "' value='\u62D2\u7EDD' onclick='ucws_userDisAgree()'/>"; 209 innerStr += "</div>"; 210 211 //é请 212 ucws_showWin("\u9080\u8BF7",innerStr,315,120); 213 214 //åæ¢è¯·æ± 215 ucws_stop_beat = true; 216 217} 218 219 220/** 221 * å建è°è¯é¡µé¢ 222 */ 223function ucws_createDebugDiv() { 224 if(document.getElementById("ucwsDebugInfo") != null) { 225 return; 226 } 227 var div1 = document.createElement('div'); 228 div1.id='ucwsDebugInfo'; 229 div1.style.border='1px solid #ddd'; 230 document.body.appendChild(div1); 231} 232 233/**
234 * pageId: idå·ï¼ç±å®¢æ·ç«¯çæä¸æå¡å¨è¿è¡å¯¹åº 235 * title: æ é¢ 236 * browserType: æµè§å¨ç±»å: 0:IE 1:ç«ç 2:Google 237 * browserCode: æµè§å¨ç¼ç 238 * pageUrl: 访é®çé¡µé¢ 239 * param: 页é¢çåæ° 240 * statue: ç¶æ 0:åè¿å ¥ 1:éåº 241 */ 242function ucws_pageinfo(pageId,title,bsType,bsCode,pageUrl,param,statue,clientId) { 243 this.pageId = pageId; 244 this.title = title; 245 this.bsType = bsType; 246 this.bsCode = bsCode; 247 this.pageUrl = pageUrl; 248 this.param = param; 249 this.statue = statue; 250 this.clientId = clientId; 251} 252 253function ucws_userinfo(userid) { 254 this.userid = userid; 255} 256 257//è·å页é¢ä¿¡æ¯ 258function ucws_getPageInfo() { 259 var vTitle = document.title; 260 var vPageId = new Date().getTime(); 261 ucws_var_currPageId = vPageId; 262 var vBrowserType = ucws_util_getBrowser(); 263 var vBrowserCharset = ucws_util_getPageCharset(); 264 var vFullUrl = document.location.href; 265 266 267 var pageObj = new ucws_pageinfo(); 268 pageObj.pageId = vPageId; 269 pageObj.title = vTitle; 270 pageObj.bsType = vBrowserType; 271 pageObj.bsCode = vBrowserCharset; 272 pageObj.pageUrl = vFullUrl; 273 pageObj.clientId = ucws_var_visitorid; 274 275 ucws_util_log(ucws_JSON.stringify(pageObj),1); 276 277 var url = ucws_var_pageRequestUrl; 278 url += "?callback=?" //è·¨å 279 ucws_getJSON(url, {time:new Date().getTime(),action:'webinfo',from:ucws_var_visitorid,body:ucws_JSON.stringify(pageObj)}, 280 function(json){ 281 ucws_util_log("åéç½é¡µä¿¡æ¯:"+json.body); 282 } 283 ); 284} 285 286//éåºé¡µé¢ 287function ucws_outPageInfo() { 288 ucws_util_log("Out:" + ucws_var_currPageId); 289} 290 291//*********************utils****************** 292//è·åæµè§å¨ç¼ç 293function ucws_util_getPageCharset(){ 294 var charSet = ""; 295 var oType = ucws_util_getBrowser(); 296 switch(oType){ 297 case "0": 298 charSet = document.charset; 299 break; 300 case "1": 301 charSet = document.characterSet; 302 break; 303 default: 304 break; 305 } 306 return charSet; 307} 308//è·åæµè§å¨ç±»å: 0:IE 1:ç«ç 2:Google 309function ucws_util_getBrowser(){ 310 var oType = ""; 311 if(navigator.userAgent.indexOf("MSIE")!=-1){ 312 oType="0"; //IE 313 }else if(navigator.userAgent.indexOf("Firefox")!=-1){ 314 oType="1"; //Firefox 315 }else { 316 oType="1"; 317 } 318 return oType; 319} 320//æ¥å¿è°è¯ 321function ucws_util_log(msg,level) { 322 323 if(ucws_var_debug == false) { 324 return; 325 } 326 327 if(level == undefined) { 328 level = 0; 329 } 330 var content = "level:" + level + "\n " + msg; 331 //alert(); 332 333 if(document.getElementById('ucwsDebugInfo') == null) { 334 ucws_createDebugDiv(); 335 } 336 try { 337 document.getElementById('ucwsDebugInfo').innerHTML += content + "</br>"; 338 } catch(e) { 339 340 } 341} 342 343//è·åéæºçæç游客IDå¹¶åå¨å°cookieä¸ 344function ucws_getRandomVisitorId() { 345 var vTempId = "" + new Date().getTime(); 346 vTempId = vTempId.substring(vTempId.length - 5, vTempId.length); 347 vTempId = ""+ Math.round(Math.random()*10000) + vTempId; 348 return vTempId; 349} 350 351/** 352 * è·å游客çIDå¹¶æ¾å°cookieä¸ 353 * @returns 354 */ 355function ucws_getTheVisitorId() { 356 /*var theVisitorId = ucws_cookie(ucws_cookiekey_visitorid); 357 if(theVisitorId == null || theVisitorId == '') { 358 theVisitorId = ucws_getRandomVisitorId(); 359 ucws_cookie(ucws_cookiekey_visitorid,theVisitorId,{ expires: 3650, path: '/' }); 360 } 361 return theVisitorId;*/ 362 //为é¿å 使ç¨jqueræ¹æ³ï¼è¿éç´æ¥çæidä¸å»cookieä¸è·å 363 return ucws_getRandomVisitorId(); 364} 365 366//*********************end utils************** 367 368function ucws_pageBeat() { 369 if(ucws_stop_beat == true) { 370 return; 371 } 372 if(ucws_var_visitorid != null && ucws_var_visitorid != "") { 373 374 if(ucws_var_pageBeatCount > ucws_var_beatCountLimit) { 375 ucws_util_log("Beat Limit Out"); 376 return; 377 } 378 379 ucws_util_log("Page Beat: " + ucws_var_currPageId + ucws_var_pageBeatCount); 380 ucws_var_pageBeatCount ++; 381 ucws_postuserbeat(); 382 } 383 384} 385 386function ucws_postuserbeat() { 387 var userInfo = new ucws_userinfo(); 388 userInfo.userid = ucws_var_visitorid; 389 390 var url = ucws_var_pageRequestUrl; 391 url += "?callback=?" //è·¨å 392 ucws_getJSON(url, {time:new Date().getTime(),action:'userbeat',from:ucws_var_visitorid,body:ucws_JSON.stringify(userInfo)}, 393 function(json){ 394 try { 395 ucws_util_log("æ¡æ:"+json.body); 396 if(json.invite == "true") { 397 ucws_curr_inviteJson = json; 398 ucws_createInviteWindow(json.memo); 399 } 400 } catch(e) { 401 ucws_util_log(e); 402 } 403 window.setTimeout(ucws_pageBeat, ucws_var_beatTimeOut); 404 } 405 ); 406} 407 408 409function ucws_reLogin() { 410 ucws_stop_beat = false; 411 ucws_init(ucws_var_customerid,ucws_monitor_type,ucws_var_domain); 412} 413 414/** 415 * 夿æ¯å¦æ¯å½æ° 416 */ 417function isUcFunction( fn ) { 418 return !!fn && !fn.nodeName && fn.constructor != String && 419 fn.constructor != RegExp && fn.constructor != Array && 420 /function/i.test( fn + "" ); 421} 422 423/** 424 * åæé请 425 */ 426function ucws_userAgree() { 427 //alert('Agree:' + ucws_var_visitorid); 428 if(ucws_curr_inviteJson != null) { 429 //alert('Invite:' + ucws_curr_inviteJson.seatId + "|" + ucws_curr_inviteJson.seatName); 430 var funcucws_callback_agree; 431 try { funcucws_callback_agree = eval('ucws_callback_agree') } catch(e) { } 432 if(funcucws_callback_agree != undefined && isUcFunction(funcucws_callback_agree)) { 433 funcucws_callback_agree(ucws_curr_inviteJson.seatId,ucws_curr_inviteJson.seatName,ucws_var_customerid); 434 } else { 435 436 var theArgObj = new Object(); 437 theArgObj.seatId = ucws_curr_inviteJson.seatId; 438 theArgObj.seatName = ucws_curr_inviteJson.seatName; 439 theArgObj.customerid = ucws_var_customerid; 440 theArgObj.seatType = '1'; 441 ucws_userAgree_confirm(theArgObj); 442 443 //ucws_preloginWin(ucws_curr_inviteJson.seatId,ucws_curr_inviteJson.seatName,ucws_var_customerid, '1'); 444 445 } 446 } 447 448 //var agreeUrl = ucws_var_header + ucws_var_proxyserver + ":" + ucws_var_proxyport + "/"
448+ ucws_var_context + "ucmonitor_control.jsp"; 449 var agreeUrl = ucws_var_header + ucws_var_proxyserver + "/" + ucws_var_context + "ucmonitor_control.jsp"; 450 agreeUrl += "?callback=?"; //è·¨å 451 ucws_getJSON(agreeUrl,{action:'agree',visitorId:ucws_var_visitorid}); 452 453 try { 454 //å é¤èæ¯è®¾ç½® 455 document.body.removeChild(ucws_win_bgObj); 456 } catch(e) { 457 458 } 459 document.body.removeChild(ucws_win_msgObj); 460 461 window.setTimeout(ucws_checkReLogin,ucws_var_checkagreelogin); 462} 463 464function ucws_userAgree_confirm(_argData) { 465 var argSeatId = _argData.seatId; 466 var argSeatName = _argData.seatName; 467 var argCustomerid = _argData.customerid; 468 var argSeatType = _argData.seatType; 469 470 try { 471 if(ucws_preloginWin_agree != undefined) { 472 473 } 474 } catch(e) { 475 alert("请å¨é¡µé¢ä¸é ç½®ucws_preloginWin_agreeç³è¯·å å ¥å½æ°"); 476 return; 477 } 478 ucws_preloginWin_agree(argSeatId,argSeatName,argCustomerid, argSeatType); 479 /* 480 if(ucws_preloginWin_agree != undefined) { 481 ucws_preloginWin_agree(argSeatId,argSeatName,argCustomerid, argSeatType); 482 } else { 483 ucws_preloginWin(argSeatId,argSeatName,argCustomerid, argSeatType); 484 } 485 */ 486} 487 488/** 489 * æç»é请 490 */ 491function ucws_userDisAgree() { 492 //alert('DisAgree:' + ucws_var_visitorid); 493 if(ucws_curr_inviteJson != null) { 494 //alert('Invite:' + ucws_curr_inviteJson.seatId + "|" + ucws_curr_inviteJson.seatName); 495 //var url = ucws_var_header + ucws_var_proxyserver + ":" + ucws_var_proxyport + "/" + ucws_var_context + "ucmonitor_control.jsp"; 496 var url = ucws_var_header + ucws_var_proxyserver + "/" + ucws_var_context + "ucmonitor_control.jsp"; 497 url += "?callback=?"; //è·¨å 498 ucws_getJSON(url,{action:'disagree',visitorId:ucws_var_visitorid}); 499 } 500 501 try { 502 //å é¤èæ¯è®¾ç½® 503 document.body.removeChild(ucws_win_bgObj); 504 } catch(e) { 505 506 } 507 document.body.removeChild(ucws_win_msgObj); 508 509 ucws_reLogin(); 510 511} 512 513/** 514 * 页é¢å ³ééåºçæ§ 515 */ 516function ucws_prelogout() { 517 if(ucws_var_visitorid == undefined || ucws_var_visitorid == null) { 518 return; 519 } 520 var userInfo = new ucws_userinfo(); 521 userInfo.userid = ucws_var_visitorid; 522 523 if(ucws_monitor_type == '0') { 524 //ä¸è¿è¡ç¶æçæ§ 525 return; 526 } 527 var url = ucws_var_pageRequestUrl; 528 url += "?callback=?" //è·¨å 529 ucws_getJSON(url, {time:new Date().getTime(),action:'logout',from:ucws_var_visitorid,body:ucws_JSON.stringify(userInfo)}, 530 function(json){ 531 ucws_util_log("ç»åº:"+json.body); 532 //add by polarrwl , 2011.06.24 533 //ucws_getPageInfo(); 534 ucws_var_pageInter = window.setTimeout(ucws_pageBeat, 3*1000); 535 } 536 ); 537} 538 539window.onbeforeunload = function() { 540 ucws_prelogout(); 541} 542 543/** 544 * æ£æ¥éè¿æ åµ 545 */ 546function ucws_checkReLogin() { 547 if(ucws_stop_beat == true) { 548 ucws_reLogin(); 549 } else { 550 window.setTimeout(ucws_checkReLogin,ucws_var_checkagreelogin); 551 } 552} 553 554/**********************æä¾å¤é¨è°ç¨çæ¥å£***************************/ 555 556/** 557 * çæ§åå§å 558 * @param {Object} customerId 游客IDï¼å¦æä¸ºç©ºï¼åèªå¨å建 559 * @param {Object} mtype æ¯å¦è¿è¡éè¯·çæ§ã0:å¦ 1:æ¯ ç¼ºçæ¯"æ¯" 560 * @param {Object} domain å(æå¡å¨ç»ç»æ¶æä¸å¯¹åºçå) 561 */ 562function ucws_init(customerId,mtype,domain) { 563 564 //åå§åIPå°å 565 ucws_path_init(); 566 567 //设置domain 568 if(domain != undefined) { 569 ucws_var_domain = domain; 570 } 571 572 //åå§åå½åç客æ·ID(æ£å¼å®¢æ·ç¨customerId,游客ç¨ucws_var_visitorid); 573 if(customerId != null && customerId.length > 0) { 574 ucws_var_visitorid = customerId; 575 ucws_var_customerid = customerId; 576 ucws_util_log("customer id :" + ucws_var_visitorid); 577 } else { 578 ucws_var_visitorid = ucws_getTheVisitorId(); 579 ucws_util_log("Visitor id :" + ucws_var_visitorid); 580 } 581 582 var userInfo = new ucws_userinfo(); 583 userInfo.userid = ucws_var_visitorid; 584 585 if(mtype != undefined) { 586 ucws_monitor_type = '' + mtype; 587 } 588 //çæ§æ¸¸å®¢æ·æè 客æ·çæµè§æ åµ 589 if(ucws_monitor_type == '1') { 590 if(!customerId || customerId == '') { 591 alert('åªè½çæ§æ£å¼å®¢æ·'); 592 return; 593 } 594 var url = ucws_var_pageRequestUrl; 595 url += "?callback=?" //è·¨å 596 ucws_getJSON(url, {time:new Date().getTime(),action:'login',from:ucws_var_visitorid,body:ucws_JSON.stringify(userInfo)}, 597 function(json){ 598 ucws_util_log("ç»é:"+json.body); 599 //add by polarrwl , 2011.06.24 600 //ucws_getPageInfo(); 601 ucws_var_pageInter = window.setTimeout(ucws_pageBeat, 3*1000); 602 } 603 ); 604 } 605} 606 607/** 608 * æ£å¸¸çç»å½æ¹å¼ 609 */ 610function ucws_prelogin(_config) { 611 if(_config == undefined || _config == null) {
612 alert('Config not Found'); 613 } 614 var theUserType = _config.usertype; /*ç¨æ·ç±»å:0:游客,1:æ£å¼å®¢æ·,2:ç½ç«å®¢æ·*/ 615 var username = _config.username; /*ç¨æ·å¸å·:å¦ææ¯æ£å¼å®¢æ·åç½ç«å®¢æ·éè¦ç¨å°*/ 616 var issso = _config.issso; /*æ¯å¦åç¹ç»å½*/ 617 var serverip = _config.serverip; /*åç¹ç»å½çæå¡å¨å°å*/ 618 var xmppport = _config.xmppport; /*åç¹ç»å½ç端å£å·*/ 619 var serverport = _config.serverport; /*IMæå¡å¨çHTTP端å£å·,åç¹ç»å½ç¨*/ 620 var winWidth = _config.winwidth; /*å¼¹åºçªå£å®½*/ 621 var winHeight = _config.winheight; /*å¼¹åºçªå£é«*/ 622 var custname = _config.custname; /*客æ·åç§°*/ 623 var openSeat = _config.openseat; /*æ¯å¦ç´æ¥æå¼åº§å¸æè 座å¸éå*/ 624 var seatId = _config.seatid; /*æ¯å¦ç´æ¥æå¼åº§å¸æè 座å¸éå*/ 625 var seatType = _config.seattype; /*æ¯å¦ç´æ¥æå¼åº§å¸æè 座å¸éå*/ 626 var opentype = _config.opentype; /*æå¼ç±»å*/ 627 var clienttype = _config.clienttype; /*客æ·ç«¯ç±»å: phone:ææºå®¢æ·ç«¯(对åºucstarclient_phoneç®å½) å ¶ä»:web客æ·ç«¯(对åºucstarclientç®å½)*/ 628 /*åå§åæ°æ®*/ 629 if(theUserType == undefined || theUserType == null) { 630 theUserType = '0'; 631 } 632 if(clienttype == undefined || clienttype == null) { 633 clienttype = ''; 634 } 635 //å¦ææ¯æ¸¸å®¢ï¼åå¸å·éç¨èªå¨çæç游客ID 636 if(theUserType == '0' && (username == undefined || username == null || username == '')) { 637 username = ucws_var_visitorid; 638 } 639 if(opentype == undefined) { 640 opentype = "0"; 641 } 642 if(issso == undefined) { 643 issso = true; 644 } 645 if(custname == undefined) { 646 custname = "客æ·"; 647 } 648 if(winWidth == undefined) { 649 winWidth = 600; 650 } 651 if(winHeight == undefined) { 652 winHeight = 400; 653 } 654 if(openSeat == undefined) { 655 openSeat = false; 656 } 657 if(seatId == undefined) { 658 seatId = ""; 659 } 660 if(seatType == undefined) { 661 seatType = "0"; 662 } 663 /*åå§åæ°æ®-END*/ 664 665 //var url = ucws_var_header + ucws_var_proxyserver + ":" + ucws_var_proxyport + "/" + ucws_var_context; 666 var url = ucws_var_header + ucws_var_proxyserver + "/" + ucws_var_context; 667 if(openSeat == true) { 668 url += "ucmonitor_login_seat.jsp" 669 } else { 670 url += "ucmonitor_login_normal.jsp" 671 } 672 673 url += "?username=" + username; 674 url += "&userType=" + theUserType; 675 url += "&serverip=" + serverip; 676 url += "&xmppport=" + xmppport; 677 url += "&serverport=" + serverport; 678 url += "&custname=" + encodeURIComponent(custname); 679 url += "&issso=" + issso; 680 url += "&seatId=" + seatId; 681 url += "&seatType=" + seatType; 682 url += "&clienttype=" + clienttype; 683 if(opentype == '1') { 684 location.href = url; 685 } else {
686 var myWin = window.open(url,"login",'width=' + winWidth + ',height=' + winHeight + ',scrollbars=yes,status=no,toolbar=no,location=no,menu=no,resizable=no'); 687 } 688} 689 690/** 691 * ç´æ¥æå¼åº§å¸ä¼è¯ 692 * @param {} _visitorId 693 * @param {} _seatId 694 */ 695function ucws_preloginWin(_seatId, _seatName, _customerId, _seatType, _winWidth, _winHeight) { 696 if(_seatType == undefined || _seatType == ""){ 697 _seatType = "0"; 698 } 699 var theUserType = "0"; 700 if(_customerId != null && _customerId != '') { 701 theUserType = "1"; 702 } 703 if(ucws_var_visitorid == null || _seatId == null || ucws_var_visitorid == '' || _seatId == '') { 704 alert('error,seatid or visitorid is null!'); 705 return; 706 } 707 //var url = ucws_var_header + ucws_var_proxyserver + ":" + ucws_var_proxyport + "/" + ucws_var_context + "ucmonitor_login.jsp"; 708 var url = ucws_var_header + ucws_var_proxyserver + "/" + ucws_var_context + "ucmonitor_login.jsp"; 709 if(theUserType == 1) { 710 url += "?username=" + _customerId; 711 } else { 712 url += "?username=" + ucws_var_visitorid; 713 } 714 url += "&seatId=" + _seatId; 715 url += "&seatName=" + _seatName; 716 url += "&userType=" + theUserType; 717 url += "&domainUri=" + (null == ucws_var_domain ? "":ucws_var_domain); 718 url += "&seatType=" + _seatType; 719 var winW = 600; 720 var winH = 400; 721 if(_winWidth != undefined) { 722 winW = _winWidth; 723 } 724 if(_winHeight != undefined) { 725 winH = _winHeight; 726 }
727 var myWin = window.open(url,"login",'width=' + winW + ',height=' + winH + ',scrollbars=yes,status=no,toolbar=no,location=no,menu=no,resizable=no'); 728} 729 730/** 731 * ç´æ¥æå¼åº§å¸ä¼è¯ å®ä¿¡ 732 * @author lggang 733 * @param {} _visitorId 734 * @param {} _seatId 735 */ 736function ucws_preloginWin_anxin(_customerId, _customerSource, _ssoServerIp, _ssoLoginUrl, _ssoServerDomain, _ssoXmppPort, _ssoServerPort, _winWidth, _winHeight) { 737 //var webClientUrl = ucws_var_header + ucws_var_proxyserver + ":" + ucws_var_proxyport + "/" + ucws_var_context + "anxin_webclient/client/"; 738 var webClientUrl = ucws_var_header + ucws_var_proxyserver + "/" + ucws_var_context + "anxin_webclient/client/"; 739 740 var url = ""; 741 if(_customerId != undefined && _customerId != ""){ 742 url = _ssoLoginUrl; 743 url += "?thetime=" + new Date().getTime(); 744 url += "&username=" + _customerId; 745 url += "&usersource=" + _customerSource; 746 url += "&serverip=" + _ssoServerIp; 747 url += "&serverdomain=" + _ssoServerDomain; 748 url += "&xmppport=" + _ssoXmppPort; 749 url += "&serverport=" + _ssoServerPort; 750 url += "&webclienturl=" + webClientUrl; 751 }else{ 752 url = webClientUrl; 753 //url += "ucallclient.html?usersource="+_customerSource; 754 url += "anxinclient.html?usersource="+_customerSource; 755 } 756 var winW = 800; 757 var winH = 600; 758 if(_winWidth != undefined) { 759 winW = _winWidth; 760 } 761 if(_winHeight != undefined) { 762 winH = _winHeight; 763 }
764 var myWin = window.open(url,"login",'width=' + winW + ',height=' + winH + ',scrollbars=yes,status=no,toolbar=no,location=no,menu=no,resizable=no'); 765} 766 767/** 768 * SSOç»éæ¨¡å¼ 769 * 770 */ 771function ucws_preloginWin_ssocom(_customerId, _dataconf, _winWidth, _winHeight) { 772 //var webClientUrl = ucws_var_header + ucws_var_proxyserver + ":" + ucws_var_proxyport + "/" + ucws_var_context + "ucstarwebcall/"; 773 var webClientUrl = ucws_var_header + ucws_var_proxyserver + "/" + ucws_var_context + "ucstarwebcall/"; 774 var url = ""; 775 if(_customerId != undefined && _customerId != ""){ 776 url = _dataconf.ssourl; 777 url += "?thetime=" + new Date().getTime(); 778 url += "&username=" + _customerId; 779 url += "&usersource=" + _dataconf.source; 780 url += "&serverip=" + _dataconf.serverip; 781 url += "&serverdomain=" + _dataconf.domain; 782 url += "&xmppport=" + _dataconf.xmppport; 783 url += "&serverport=" + _dataconf.serverport; 784 url += "&webclienturl=" + webClientUrl; 785 if(_dataconf.seatid != undefined) { 786 url += "&seat=" + _dataconf.seatid; 787 } 788 if(_dataconf.seattype != undefined) { 789 url += "&seatType=" + _dataconf.seattype; 790 } 791 }else{ 792 url = webClientUrl; 793 url += "ucstarclient.html?usersource="+_dataconf.source; 794 } 795 var winW = 800; 796 var winH = 600; 797 if(_winWidth != undefined) { 798 winW = _winWidth; 799 } 800 if(_winHeight != undefined) { 801 winH = _winHeight; 802 }
803 var myWin = window.open(url,"login",'width=' + winW + ',height=' + winH + ',scrollbars=yes,status=no,toolbar=no,location=no,menu=no,resizable=no'); 804} 805 806/** 807 * ç´æ¥æå¼åº§å¸ä¼è¯ å®ä¿¡ 808 * @author lggang 809 * @param {} _visitorId 810 * @param {} _seatId 811 */ 812function ucws_preloginWin_webcall(_customerId, _customerSource, _ssoServerIp, _ssoLoginUrl, _ssoServerDomain, _ssoXmppPort, _ssoServerPort, _winWidth, _winHeight) { 813 //var webClientUrl = ucws_var_header + ucws_var_proxyserver + ":" + ucws_var_proxyport + "/" + ucws_var_context + "ucstarclient_webcall/client/"; 814 var webClientUrl = ucws_var_header + ucws_var_proxyserver + "/" + ucws_var_context + "ucstarclient_webcall/client/"; 815 var url = ""; 816 if(_customerId != undefined && _customerId != ""){ 817 url = _ssoLoginUrl; 818 url += "?thetime=" + new Date().getTime(); 819 url += "&username=" + _customerId; 820 url += "&usersource=" + _customerSource; 821 url += "&serverip=" + _ssoServerIp; 822 url += "&serverdomain=" + _ssoServerDomain; 823 url += "&xmppport=" + _ssoXmppPort; 824 url += "&serverport=" + _ssoServerPort; 825 url += "&webclienturl=" + webClientUrl; 826 }else{ 827 url = webClientUrl; 828 url += "ucallclient.html?usersource="+_customerSource; 829 //url += "anxinclient.html?usersource="+_customerSource; 830 } 831 var winW = 800; 832 var winH = 600; 833 if(_winWidth != undefined) { 834 winW = _winWidth; 835 } 836 if(_winHeight != undefined) { 837 winH = _winHeight; 838 }
839 var myWin = window.open(url,"login",'width=' + winW + ',height=' + winH + ',scrollbars=yes,status=no,toolbar=no,location=no,menu=no,resizable=no'); 840} 841 842/** 843 * ç´æ¥æå¼åº§å¸ä¼è¯ æµå 844 * @author yqiang 845 * @param {} _visitorId 846 * @param {} _seatId 847 */ 848function ucws_preloginWin_czbank(_seatId, _userid ,_voiphone ,_lable,_nickname,_selfpriority, _winWidth, _winHeight) { 849 850 var theUserType = "0"; 851 if(_userid != null && _userid != '') { 852 theUserType = "2"; 853 } 854 if(ucws_var_visitorid == null || _seatId == null || ucws_var_visitorid == '' || _seatId == '') { 855 alert('error,seatid or visitorid is null!'); 856 return; 857 } 858 //var url = ucws_var_header + ucws_var_proxyserver + ":" + ucws_var_proxyport + "/" + ucws_var_context + "ucmonitor_login.jsp"; 859 var url = ucws_var_header + ucws_var_proxyserver + "/" + ucws_var_context + "ucmonitor_login.jsp"; 860 if(theUserType == 2) { 861 url += "?username=" + _userid; 862 } else { 863 url += "?username=" + ucws_var_visitorid; 864 } 865 url += "&seatId=" + _seatId; 866 url += "&seatName=" + ''; 867 url += "&userType=" + theUserType; 868 url += "&domainUri=" + (null == ucws_var_domain ? "":ucws_var_domain); 869 url += "&seatType=" + 0; 870 url += "&priority=" + 1; 871 url += "&voiphone=" + _voiphone; 872 url += "&lable=" + _lable; 873 url += "&nickname=" + encodeURIComponent(_nickname); 874 url += "&selfpriority=" + _selfpriority; 875 var winW = 600; 876 var winH = 400; 877 if(_winWidth != undefined) { 878 winW = _winWidth; 879 } 880 if(_winHeight != undefined) { 881 winH = _winHeight; 882 }
883 var myWin = window.open(url,"login",'width=' + winW + ',height=' + winH + ',scrollbars=yes,status=no,toolbar=no,location=no,menubar=no,resizable=no'); 884} 885 886 887/**********************æä¾å¤é¨è°ç¨çæ¥å£-END***************************/
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.