| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- var blinkTime;
- var titleTipTime;
- function sendTimeMsgCount(){
- try{
- var toUserStr = $("#currentUserId").val();
- var param = {'type':"timeMsg"};
- if(toUserStr){
- sendAsyncAjax(param,"loadOrgIndex.do?t="+new Date().getTime(),"json",loadTimeMsgCountProcess,loadTimeMsgCountError);
- }
- }catch(e){}
- }
- function loadTimeMsgCountProcess(data){
- var imCount = 0;
- var msgCount = 0;
- var emailCount = 0;
- var onlineCount = 0;
- try{
- if(data!=null){
- imCount = data.imCount;
- msgCount = data.msgCount;
- emailCount = data.emailCount;
- onlineCount = data.onlineCount;
- }
- if(imCount>0){
- if(!blinkTime){
- blink();
- }
- // if(!titleTipTime){
- myThreadProcess();
- // }
- }else{
- window.top.document.title=$("#topTitle").val();
- clearTimeout(titleTipTime);
- clearTimeout(blinkTime);
- im_imgCount.style.visibility = "visible";
- }
- loadTimeOnlineProcess(onlineCount);
- $("#imCount").html(imCount);
- $("#msgCount").html(msgCount);
- $("#emailCount").html(emailCount);
- }catch(e){
- $("#imCount").html(0);
- $("#msgCount").html(0);
- $("#emailCount").html(0);
- }
- }
- function myThreadProcess(){
- try{
- var topTitle = $("#topTitle").val();
- var str = "[ ]"+topTitle;
- var msg = "[您有新的会话]"+topTitle;
- if(window.top.document.title==str){
- window.top.document.title=msg;
- }else{
- window.top.document.title=str;
- }
- titleTipTime = setTimeout("myThreadProcess()",500);
- }catch(e){
-
- }
- }
- function blink() {
- im_imgCount.style.visibility = (im_imgCount.style.visibility == "hidden") ? "visible" : "hidden";
- blinkTime = setTimeout("blink()", 500);
- }
- function loadTimeMsgCountError(request,msg){
- var text = request.responseText;
- if(text!=undefined&&text.indexOf("SYSTEM_TIMEOUT_ERROR")!=-1){
- $("body").html("<div style='margin:50px auto;text-align:center'>"+text+"</div>");
- }
- }
- function loadTimeOnlineProcess(data){
- try{
- var onlineObj = $("#online",window.top.document);
- $(onlineObj).parent().show();
- var oldCount = $(onlineObj).html();
- oldCount = parseInt(oldCount,10);
- if(oldCount != data){
- $(onlineObj).html(data);
- olineObj = onlineTree();
- if(orgObj){
- orgTree();
- }
- if(groupObj){
- groupTree();
- }
- }
- }catch(e){}
- }
|