var data = {}; /****** id:"xxxxxxxxxxxx", name:'UKeFu', email:'ukefu@ukewo.cn', phone:'18588888888' ****/ ;(function(name,context,definition){if(typeof module!=='undefined'&&module.exports){module.exports=definition()}else if(typeof define==='function'&&define.amd){define(definition)}else{context[name]=definition()}})('Fingerprint',this,function(){'use strict';var Fingerprint=function(options){var nativeForEach,nativeMap;nativeForEach=Array.prototype.forEach;nativeMap=Array.prototype.map;this.each=function(obj,iterator,context){if(obj===null){return}if(nativeForEach&&obj.forEach===nativeForEach){obj.forEach(iterator,context)}else if(obj.length===+obj.length){for(var i=0,l=obj.length;i>>16)*c1)&0xffff)<<16)))&0xffffffff;k1=(k1<<15)|(k1>>>17);k1=((((k1&0xffff)*c2)+((((k1>>>16)*c2)&0xffff)<<16)))&0xffffffff;h1^=k1;h1=(h1<<13)|(h1>>>19);h1b=((((h1&0xffff)*5)+((((h1>>>16)*5)&0xffff)<<16)))&0xffffffff;h1=(((h1b&0xffff)+0x6b64)+((((h1b>>>16)+0xe654)&0xffff)<<16))}k1=0;switch(remainder){case 3:k1^=(key.charCodeAt(i+2)&0xff)<<16;case 2:k1^=(key.charCodeAt(i+1)&0xff)<<8;case 1:k1^=(key.charCodeAt(i)&0xff);k1=(((k1&0xffff)*c1)+((((k1>>>16)*c1)&0xffff)<<16))&0xffffffff;k1=(k1<<15)|(k1>>>17);k1=(((k1&0xffff)*c2)+((((k1>>>16)*c2)&0xffff)<<16))&0xffffffff;h1^=k1}h1^=key.length;h1^=h1>>>16;h1=(((h1&0xffff)*0x85ebca6b)+((((h1>>>16)*0x85ebca6b)&0xffff)<<16))&0xffffffff;h1^=h1>>>13;h1=((((h1&0xffff)*0xc2b2ae35)+((((h1>>>16)*0xc2b2ae35)&0xffff)<<16)))&0xffffffff;h1^=h1>>>16;return h1>>>0},hasLocalStorage:function(){try{return!!window.localStorage}catch(e){return true;}},hasSessionStorage:function(){try{return!!window.sessionStorage}catch(e){return true;}},hasIndexDb:function(){try{return!!window.indexedDB}catch(e){return true;}},isCanvasSupported:function(){var elem=document.createElement('canvas');return!!(elem.getContext&&elem.getContext('2d'))},isIE:function(){if(navigator.appName==='Microsoft Internet Explorer'){return true}else if(navigator.appName==='Netscape'&&/Trident/.test(navigator.userAgent)){return true}return false},getPluginsString:function(){if(this.isIE()&&this.ie_activex){return this.getIEPluginsString()}else{return this.getRegularPluginsString()}},getRegularPluginsString:function(){return this.map(navigator.plugins,function(p){var mimeTypes=this.map(p,function(mt){return[mt.type,mt.suffixes].join('~')}).join(',');return[p.name,p.description,mimeTypes].join('::')},this).join(';')},getIEPluginsString:function(){if(window.ActiveXObject){var names=['ShockwaveFlash.ShockwaveFlash','AcroPDF.PDF','PDF.PdfCtrl','QuickTime.QuickTime','rmocx.RealPlayer G2 Control','rmocx.RealPlayer G2 Control.1','RealPlayer.RealPlayer(tm) ActiveX Control (32-bit)','RealVideo.RealVideo(tm) ActiveX Control (32-bit)','RealPlayer','SWCtl.SWCtl','WMPlayer.OCX','AgControl.AgControl','Skype.Detection'];return this.map(names,function(name){try{new ActiveXObject(name);return name}catch(e){return null}}).join(';')}else{return"";}},getScreenResolution:function(){var resolution;if(this.screen_orientation){resolution=(screen.height>screen.width)?[screen.height,screen.width]:[screen.width,screen.height]}else{resolution=[screen.height,screen.width]}return resolution},getCanvasFingerprint:function(){var canvas=document.createElement('canvas');var ctx=canvas.getContext('2d');var txt='http://valve.github.io';ctx.textBaseline="top";ctx.font="14px 'Arial'";ctx.textBaseline="alphabetic";ctx.fillStyle="#f60";ctx.fillRect(125,1,62,20);ctx.fillStyle="#069";ctx.fillText(txt,2,15);ctx.fillStyle="rgba(102, 204, 0, 0.7)";ctx.fillText(txt,4,17);return canvas.toDataURL()}};return Fingerprint}); var result = new Fingerprint().get(); var signal = 0 ; function append(parent, text) { if (typeof text === 'string') { var temp = document.createElement('div'); temp.innerHTML = text; parent.appendChild(temp); } else { parent.appendChild(text); } } var ukefu = { time : new Date().getTime(), in :"https://www.xiaochiai.com//im/0sV8kV/userlist.html?appid=0sV8kV&orgi=2c9af0316ac12ec6016ac137fb7606c5&client=af114ab4feaa4782b5fd7e418f0daa6a" , url :"https://www.xiaochiai.com//im/online?appid=0sV8kV&orgi=2c9af0316ac12ec6016ac137fb7606c5&client=af114ab4feaa4782b5fd7e418f0daa6a" , chat : "https://www.xiaochiai.com//im/index.html?appid=0sV8kV&orgi=2c9af0316ac12ec6016ac137fb7606c5&client=af114ab4feaa4782b5fd7e418f0daa6a" , refuse :"https://www.xiaochiai.com//im/refuse.html?appid=0sV8kV&orgi=2c9af0316ac12ec6016ac137fb7606c5&client=af114ab4feaa4782b5fd7e418f0daa6a", config : function(d){ data = d ; if(d.id != null && d.id != ''){ result = d.id ; } } , ajax:function(url , success , error) { var xhr = false; signal = signal + 1 ; try { xhr = new ActiveXObject("Msxml2.XMLHTTP"); // ie msxml3.0+(IE7.0及以上) } catch (e) { try{ xhr = new ActiveXObject("Microsoft.XMLHTTP"); //ie msxml2.6(IE5/6) }catch (e2) { xhr = false; } } if (!xhr && typeof XMLHttpRequest != 'undefined') {// Firefox, Opera 8.0+, Safari xhr = new XMLHttpRequest(); } xhr.onreadystatechange = function (data) { if (xhr.readyState == 4) { var status = xhr.status; if (status >= 200 && status < 300) { var event = xhr.responseText ; if(event && event.indexOf('invite') >= 0){ ukefu.writeinvite() ; }else if(event && event.indexOf('refuse') >= 0){ ukefu.refuseInvite() ; }else if(event && event.indexOf('accept') >= 0){ ukefu.acceptInvite() ; } if(success){ success(event); } } else { // if(error){ error(); } } xhr.abort(); signal = signal - 1 ; } } xhr.open("GET", url , true); try{ xhr.send(null); }catch(e){} }, ping : function(){ var url = ukefu.url ; if(data){ if(data.id){ url = url + "&id="+data.id ; } if(data.name){ url = url + "&name="+encodeURIComponent(data.name); } if(data.email){ url = url + "&email="+encodeURIComponent(data.email); } if(data.phone){ url = url + "&phone="+encodeURIComponent(data.phone); } url = url + "&title="+encodeURIComponent(document.title); url = url+"&traceid=beb4f53568c44bf4a67ed0632d9f41f2" url = url+"&url="+encodeURIComponent(location.href) } ukefu.ajax(url + "&userid="+result+"&sessionid=D3A85F525CAABFD79BBD674D397E4512&sign="+result+"&t="+new Date().getTime() , function(){ukefu.ping();}); }, writepoint:function(){ var skillHtml = "" ; append(document.body, ''); append(document.body, ''); append(document.body, ''); append(document.body, ""); document.getElementById("ukefu-im-point-text").onclick=function(){ ukefu.openChatDialog(); } var inviteDialog = document.getElementById('ukefu-invite-dialog'); var height = document.documentElement.clientHeight ; var width = document.documentElement.clientWidth ; var top = (50 - 92*100/height)+"%"; var left = (50 - 210*100/width)+"%" ; inviteDialog.style.top = top ; inviteDialog.style.left = left ; ; }, openChatDialog:function(){ ukefu.openChatDialogWithURL(ukefu.chat); }, openChatDialogWithURL:function(url){ url = url + "&userid="+result+"&sessionid=D3A85F525CAABFD79BBD674D397E4512" if(data){ if(data.id){ url = url + "&id="+data.id ; } if(data.name){ url = url + "&name="+encodeURIComponent(data.name); } if(data.email){ url = url + "&email="+encodeURIComponent(data.email); } if(data.phone){ url = url + "&phone="+encodeURIComponent(data.phone); } } url = url + "&title="+encodeURIComponent(document.title); url = url+"&traceid=beb4f53568c44bf4a67ed0632d9f41f2" url = url+"&url="+encodeURIComponent(location.href) ; try{ window.open(url+"&t="+new Date().getTime(), "ukefu-chat", "height=600, width=850, top="+ (window.screen.availHeight - 30 - 600) /2+", left="+(window.screen.availWidth - 10 - 750)/2+",toolbar=no, menubar=no, scrollbars=no, resizable=no, directories=no,location=no, status=no"); }catch(e){} return false; }, display:function(){ ukefu.writepoint(); //解决延迟加载问题,放到别的位置,会发生在div模块没有加载时去使用DOM 问题,取值为null function setStyle(param){ var isNo=window.location.href.indexOf('www.xiaochiai.com')>-1; //获取当前窗口的宽度 var w=window.screen.width; //调整wechat picture 和 phone picture if(w<500){ let WPicture=document.getElementById('QRCode'); WPicture.firstElementChild.style.width='200px'; let PhonePicture=document.getElementById('IPNum'); PhonePicture.firstElementChild.style.width='200px'; } //通过屏幕显示宽度,调整边框的样式 if(w<500){ let objTheme=document.getElementById('ukefu-point-theme'); objTheme.style.height='170px'; objTheme.style.width='55px' param.style.paddingTop='5px'; if(param == 'ukefu-im-point-text'){ param.style.height='56px'; }else{ param.style.height='55px'; } param.style.lineHeight='15px'; }else{ //pc 端显示效果 param.style.paddingTop='10px'; if(isNo){ param.style.height='70px'; }else{ param.style.height='60px'; } param.style.lineHeight='20px'; } } function changeDom(){ try{ let textId=document.getElementById('ukefu-im-point-text'); setStyle(textId); let wechatId=document.getElementById('ukefu-im-wechat'); setStyle(wechatId); let phoneNum=document.getElementById('ukefu-im-phoneNum'); setStyle(phoneNum); }catch(err){}; } changeDom(); function changeImage(){ let wechat=document.getElementById('QRCode'); let phoneNum=document.getElementById('IPNum'); try{ wechat.firstElementChild.src='https://www.xiaochiai.com//images/qiyewechat.png'; phoneNum.firstElementChild.src='https://www.xiaochiai.com//images/telcontact.png'; }catch(err){}; } changeImage(); document.getElementById("ukefu-point").style.display = "block" ; setTimeout(function(){ ukefu.writeinvite() ; } , 10000); }, writeinvite:function(){ document.getElementById('ukefu-invite-dialog').style.display = "block" ; }, refuseInvite:function(){ document.getElementById('ukefu-invite-dialog').style.display = "none" ; ukefu.ajax(ukefu.refuse + "&userid="+result+"&sessionid=D3A85F525CAABFD79BBD674D397E4512&t="+new Date().getTime()); }, acceptInvite:function(){ document.getElementById('ukefu-invite-dialog').style.display = "none" ; }, check:function(){ var checkTimes = 0 ; setInterval(function(){ if(signal <= 0){ checkTimes++ ; }else{ checkTimes = 0 ; } if(checkTimes >= 3){ //检查当前的 Keep-Alive是否存活,检查3次都处于未存活状态,则启动 // signal = 0 ; checkTimes = 0 ; ukefu.ping(); console.log("客户端信息校对"); } },5000) ; } } function openAgentChatDialog(url){ return ukefu.openChatDialogWithURL(url) ; } ukefu.ajax(ukefu.in+"&userid="+result+"&t="+new Date().getTime() , function(data){ if(data == "in"){}else{ ukefu.display(); ukefu.ping(); ukefu.check(); } }); function bottomColor(param){ var h=window.screen.height; var w=window.screen.width; if(param=="ukefu-im-wechat"){ var x=document.getElementById(param).getBoundingClientRect().left; var y=document.getElementById(param).getBoundingClientRect().top; if (document.getElementById('QRCode') !=null){ var imobj=document.getElementById('QRCode').style; if (x2*h/5){ imobj.top=y-240+'px' }else{ imobj.top=y-30+'px'; } }else { //判断是否在手机端显示,若是,做图片左移 if(w<500){ imobj.left=x-210+'px'; }else{ imobj.left=x-300+'px'; } if(y>2*h/5){ imobj.top=y-100+'px' }else{ imobj.top=y-30+'px'; } } } if (document.getElementById('QRCode').style.display=="none") { document.getElementById('QRCode').style.display = "inline"; } } if(param=="ukefu-im-phoneNum"){ var x=document.getElementById(param).getBoundingClientRect().left; var y=document.getElementById(param).getBoundingClientRect().top; if (document.getElementById('IPNum') !=null){ var imobj=document.getElementById('IPNum').style; if (x2*h/5){ if(w<500){ imobj.top=y-90+'px' }else{ imobj.top=y-160+'px' } }else{ imobj.top=y-20+'px'; } }else { //若是分辨率<500 ,属于手机端,则图片左移, if(w<500){ imobj.left=x-220+'px'; }else{ imobj.left=x-420+'px'; } if(y>2*h/5){ if(w<500){ imobj.top=y-90+'px' }else{ imobj.top=y-160+'px' } }else{ imobj.top=y-20+'px'; } } } if (document.getElementById('IPNum').style.display=="none") { document.getElementById('IPNum').style.display = "inline"; } } if(param=='ukefu-im-point-text'){ try{ changeColor('ukefu-point-top'); } catch(err) {} } if(param=='ukefu-im-phoneNum'){ try{ changeColor('ukefu-point-bottom'); } catch(err) {} } try{ changeColor(param); } catch(err) {} } function leaveColor(param){ console.log('the param is-->:'+param) if(param=="ukefu-im-wechat"){ if (document.getElementById('QRCode').style.display =="inline"){ document.getElementById('QRCode').style.display="none"; } } if(param=="ukefu-im-phoneNum"){ if (document.getElementById('IPNum').style.display =="inline"){ document.getElementById('IPNum').style.display="none"; } } if(param=='ukefu-im-point-text'){ document.getElementById('ukefu-point-top').style.background=''; } if(param=='ukefu-im-phoneNum'){ document.getElementById('ukefu-point-bottom').style.background=''; } document.getElementById(param).style.background=''; } function changeColor(param){ var modeNum; modeNum=1; switch(modeNum){ case 1: document.getElementById(param).style.background='#4a9bf6'; break; case 2: document.getElementById(param).style.background='#A3DBF9'; break; case 3: document.getElementById(param).style.background='#8cbdde'; break; case 4: document.getElementById(param).style.background='#adc232'; break; case 5: document.getElementById(param).style.background='#d00b3c'; break; case 6: document.getElementById(param).style.background='#ff62b9'; break; } }