JavaScript - są tu spece?

Szukasz jej/jego? Kontaktu? Wejdź napisz.
Regulamin forum
UWAGA !!! ZABRANIA SIĘ WYMIANY NAGRANIAMI Z SHOWUP.TV BEZ ZGODY WŁAŚCICIELA PRAW AUTORSKICH
Aby brać udział w konkursach należy dodawać linki do profili i transmisji w postach o naszych Dziewczynach z ShowUp.tv
JavaScript - są tu spece?
05 cze 2017, 01:01


Zamierzam zrobić mały skrypt GreaseMonkey (czyli JavaScript) na showup.tv...
Chcę podmienić parę rzeczy tam...

Tak losowo sobie wkleję jeden z 4 JSów ze SU...
Kod: Zaznacz cały
function AutoModerator(){this.sentences=am[0];this.sentencesChars=am[1];};AutoModerator.prototype.isInSentences=function(string){var result=false;var regex='';for(var i=0;i<this.sentences.length;i++){if(string.match(new RegExp(this.sentences[i]))){regex=this.sentences[i];result=true;break;}}
return[result,regex,string];};AutoModerator.prototype.isInSentencesByChars=function(string){var result=false;var regex='';for(var i=0;i<this.sentencesChars.length;i++){if(this.isInString(string,this.sentencesChars[i])){regex=this.sentencesChars[i];result=true;break;}}
return[result,regex,string];};AutoModerator.prototype.isInString=function(string,search){string=string.replace(/[^a-zA-Z0-9]/gi,'').replace(/[_\s]/g,'');var toComplete=search.length;if(string.length<toComplete)
return;var found=0;var i2=0;for(var i=0;i<string.length;i++){if(i2==3){found=0;i2=0;}
if(string[i]==search[found]){found++;i2=0;if(found==toComplete){return true;}}
if(string[i]!=' ')
i2++;}
return false;};AutoModerator.prototype.isTelNum=function(string){string=string.replace(/\D/g,'');if(string.length>=6){return true;}
return false;};AutoModerator.prototype.replacePolishLetters=function(string){return string.replace(/ą/g,'a').replace(/ć/g,'c').replace(/ę/g,'e').replace(/ł/g,'l').replace(/ń/g,'n').replace(/ó/g,'o').replace(/ś/g,'s').replace(/ż/g,'z').replace(/ź/g,'z');};AutoModerator.prototype.validate=function(string,fromSending){string=string.toLowerCase();string=this.replacePolishLetters(string);var result=this.isInSentences(string);if(result[0]&&fromSending){$.post(siteUrl+"/site/auto_moderator/notify",{uid:user.uid,regex:result[1],msg:result[2],type:1});}
if(result[0])
return!result[0];result=this.isInSentencesByChars(string);if(result[0]&&fromSending){$.post(siteUrl+"/site/auto_moderator/notify",{uid:user.uid,regex:result[1],msg:result[2],type:2});}
if(result[0])
return!result[0];result=this.isTelNum(string);if(result&&fromSending){$.post(siteUrl+"/site/auto_moderator/notify",{uid:user.uid,regex:'telNum',msg:string,type:3});}
return!result;};var autoModerator=new AutoModerator();function Transmission(transmissionGUI,startTrans,packetController,messagesSystem,transUser){this.maxMessages=75;this.fakeCamList=new Array("e2eSoft","video2webcam","camsuite","splitcam","fake","screencamera","many","falsecamera","webcammax","laseczka","virtualcamera","magic","magiccamera","e2esoft","xsplitbroadcaster");this.wasConnected=false;this.loadBackupData=false;this.transUser=transUser;this.joined=false;this.joinStatus='disconnected';this.streamID="";this.isOldPhoto=false;this.photoReady=false;this.token='';this.chatBlocked=false;this.lastChatmsgSend=0;this.currTokens=0;this.lastChatMessage="";this.nMessages=0;this.isAim=false;this.aimTokens=0;this.mutedList=new Array();this.bannedList=new Array();this.viewersList=new Array();this.nGuests=0;this.nLogged=0;this.updateStats=true;this.nTotalViewers=0;this.nActive=0;this.prvSettings=new Array();this.invited=false;this.flashReady=false;this.streamStatus=false;this.streamReady=false;this.boldUsers=new Array();this.tips=new Array();this.messagesSystem=messagesSystem;this.packetController=packetController;this.transmissionGUI=transmissionGUI;this.startTrans=startTrans;this.waitingRoomInfoId=-1;this.terminatedInfoId=-1;this.failureInfoId=-1;this.waitingRoomPrvInfoId=-1;this.prvInfoTimer=null;this.isInPrv=false;var obj=this;if(this.packetController.connected)
this.connectedHandler();addConnectionEventListener(this.packetController.EVT_CONNECTED,this.connectedHandler.bind(this));this.initListeners();addConnectionEventListener(this.packetController.EVT_DISCONNECTED,this.disconnectedHandler.bind(this));addPackageListener(this.packetController.EVT_NEW_PACKAGE,G_T_TERMINATED,this.terminatedHandler.bind(this));if(this.startTrans)
transmissionGUI.showMakePhotoInfo();};Transmission.prototype.connectedHandler=function(){if(this.startTrans){this.packetController.send(S_START_TRANSMISSION,this.loadBackupData);addPackageListener(this.packetController.EVT_NEW_PACKAGE,G_T_HOST_STATUS,this.startHandler.bind(this));this.loadBackupData=true;}else{this.packetController.send(S_JOIN_TRANSMISSION,this.transUser.login);addPackageListener(this.packetController.EVT_NEW_PACKAGE,G_T_JOIN_STATUS,this.joinHandler.bind(this));}
if(this.wasConnected){var o=this;o.updateStats=false;setTimeout(function(){o.updateStats=true;},15000);}
this.wasConnected=true;};Transmission.prototype.disconnectedHandler=function(){this.joined=false;this.joinStatus='disconnected';transmissionGUI.disableButtons();};Transmission.prototype.startHandler=function(p){this.joinStatus=p.msg[0];switch(p.msg[0]){case'created':this.joined=true;prvTemplates.getTemplates();break;case'isInPrv':this.joined=false;this.messagesSystem.show('error',lang['p-host-isinprv']);break;case'alreadyHost':this.joined=false;this.messagesSystem.show('error',lang['p-host-already']);break;default:break;}
if(this.joined)
transmissionGUI.enableButtons();else
transmissionGUI.disableButtons();};Transmission.prototype.joinHandler=function(p){this.joinStatus=p.msg[0];if(p.msg[0]!='joined')
cardInformer.showInfo('hostStatus','(offline)');switch(p.msg[0]){case'joined':this.joined=true;cardInformer.removeInfo('hostStatus');if(!this.startTrans)
this.transmissionGUI.startStream();break;case'failure':this.joined=false;if(!this.isInPrv){if(this.failureInfoId)
this.messagesSystem.hide(this.failureInfoId);this.failureInfoId=this.messagesSystem.show('error',lang['p-join-failure']);}
break;case'maxTransmissionsLimitReached':this.joined=false;if(user.isLogged)
this.messagesSystem.show('error',lang['p-join-max-reached']);else
this.messagesSystem.show('error',lang['p-join-max-reached2']);break;case'viewersLimitReached':this.joined=false;this.messagesSystem.show('error',lang['p-join-max-viewers-reached']);break;case'alreadyJoined':this.joined=false;this.messagesSystem.show('error',lang['p-join-already']);break;case'banned':this.joined=false;this.messagesSystem.show('error',lang['p-join-banned']);break;default:break;}
if(this.joined)
transmissionGUI.enableButtons();else
transmissionGUI.disableButtons();};Transmission.prototype.terminatedHandler=function(){cardInformer.showInfo('hostStatus','(offline)');this.terminatedInfoId=messagesSystem.show("error",lang['p-trans-terminated']);this.transmissionGUI.hide();document.getElementById("video").videoStatus("off");this.joinStatus='terminated';transmissionGUI.disableButtons();};Transmission.prototype.initListeners=function(){var o=this;addPackageListener(this.packetController.EVT_NEW_PACKAGE,G_T_UPDATE_DESCRIPTION,this.transmissionGUI.gotDescription.bind(this.transmissionGUI));addPackageListener(this.packetController.EVT_NEW_PACKAGE,G_T_OLD_PHOTO_USED,this.isOldPhotoHandler.bind(this));addPackageListener(this.packetController.EVT_NEW_PACKAGE,G_T_FROM_PRV,this.fromPrvHandler.bind(this));addPackageListener(this.packetController.EVT_NEW_PACKAGE,G_T_STREAM_ID,this.streamIdHandler.bind(this));addPackageListener(this.packetController.EVT_NEW_PACKAGE,G_W_JOINED,this.waitingRoomJoined.bind(this));addPackageListener(this.packetController.EVT_NEW_PACKAGE,G_W_TRANS_STARTED,this.waitingRoomStarted.bind(this));addPackageListener(this.packetController.EVT_NEW_PACKAGE,G_W_PRV_INFO,this.waitingRoomPrvInfo.bind(this));addPackageListener(this.packetController.EVT_NEW_PACKAGE,G_T_STATISTICS,this.statisticsHandler.bind(this));addPackageListener(this.packetController.EVT_NEW_PACKAGE,G_T_MESSAGE,this.msgNewMessage.bind(this));addPackageListener(this.packetController.EVT_NEW_PACKAGE,G_T_SPAM,this.transmissionGUI.msgSpamMessage.bind(this.transmissionGUI));addPackageListener(this.packetController.EVT_NEW_PACKAGE,G_T_DEL_MES,this.transmissionGUI.msgRemoveMessage.bind(this.transmissionGUI));addPackageListener(this.packetController.EVT_NEW_PACKAGE,G_Z_SENDSTATUS,this.transmissionGUI.tipStatus.bind(this.transmissionGUI));addPackageListener(this.packetController.EVT_NEW_PACKAGE,G_T_TOKENS_TRANSFER,this.tokensTransferHandler.bind(this));addPackageListener(this.packetController.EVT_NEW_PACKAGE,G_T_TIP_LEADER,this.tipLeaderHandler.bind(this));addPackageListener(this.packetController.EVT_NEW_PACKAGE,G_T_VIP_LIST,this.vipHandler.bind(this));addPackageListener(this.packetController.EVT_NEW_PACKAGE,G_T_TIP,this.tipHandler.bind(this));addPackageListener(this.packetController.EVT_NEW_PACKAGE,G_Z_SETTINGS,this.tokensSettingsHandler.bind(this));addPackageListener(this.packetController.EVT_NEW_PACKAGE,G_T_KICKED,function(){o.messagesSystem.show('error',lang['p-trans-kicked']);setTimeout(function(){window.location='http://google.com';},3000);});addPackageListener(this.packetController.EVT_NEW_PACKAGE,G_T_BANNED,function(){o.messagesSystem.show('error',lang['p-trans-banned']);setTimeout(function(){window.location='http://google.com';},3000);});addPackageListener(this.packetController.EVT_NEW_PACKAGE,G_T_MUTED_LIST,this.mutedListHandler.bind(this));addPackageListener(this.packetController.EVT_NEW_PACKAGE,G_T_VIEWERS_LIST,this.usersListHandler.bind(this));addPackageListener(this.packetController.EVT_NEW_PACKAGE,G_T_BAN_LIST,this.banListHandler.bind(this));addPackageListener(this.packetController.EVT_NEW_PACKAGE,G_P_SETTINGS,this.prvSettingsHandler.bind(this));addPackageListener(this.packetController.EVT_NEW_PACKAGE,G_P_INVITATION,this.incomingInvitation.bind(this));addPackageListener(this.packetController.EVT_NEW_PACKAGE,G_P_INVITEDECLINED,this.incomingInvitationDeclined.bind(this));addPackageListener(this.packetController.EVT_NEW_PACKAGE,G_P_INVITECANCEL,this.incomingInvitationCanceled.bind(this));addPackageListener(this.packetController.EVT_NEW_PACKAGE,G_P_INVITESTATUS,this.invInvitationStatus.bind(this));addPackageListener(this.packetController.EVT_NEW_PACKAGE,G_T_STREAM_STATUS,this.streamStatusHandler.bind(this));addPackageListener(this.packetController.EVT_NEW_PACKAGE,G_T_TOKEN,this.tokenHandler.bind(this));addPackageListener(this.packetController.EVT_NEW_PACKAGE,G_T_MSG_PRIVILEGES,this.transmissionGUI.msgPrivilegesHandler.bind(this.transmissionGUI));};Transmission.prototype.waitingRoomPrvInfo=function(p){var data=p.msg[0].split("[:]");var time=data[0];var currTime=data[1];var status=data[2];var adnationalInfo="";this.isInPrv=true;if(status=="stopped"){adnationalInfo="("+lang['p-prvinfo-stopped']+")";if(this.prvInfoTimer!=null)
clearInterval(this.prvInfoTimer);}else if(status=="finished"){adnationalInfo="("+lang['p-prvinfo-finished']+")";if(this.prvInfoTimer!=null)
clearInterval(this.prvInfoTimer);}else if(status=="running"){var o=this;this.prvInfoTimer=setInterval(function(){currTime++;var info=lang['p-prvinfo-info']+": "+secondsToTime(time-currTime)+" "+adnationalInfo;o.messagesSystem.change(o.waitingRoomPrvInfoId,info);},1000);}
var info=lang['p-prvinfo-info']+": "+secondsToTime(time-currTime)+" "+adnationalInfo;this.messagesSystem.hide(this.terminatedInfoId);this.messagesSystem.hide(this.failureInfoId);if(this.waitingRoomPrvInfoId==-1){this.waitingRoomPrvInfoId=this.messagesSystem.show('success',info);}else
this.messagesSystem.change(this.waitingRoomPrvInfoId,info);};Transmission.prototype.waitingRoomJoined=function(){if(this.waitingRoomInfoId)
this.messagesSystem.hide(this.waitingRoomInfoId);this.waitingRoomInfoId=this.messagesSystem.show('info',lang['p-autojoin']);if(user.isLogged)
transmissionGUI.showPlayerInfo('charge');else
transmissionGUI.showPlayerInfo('register');};Transmission.prototype.waitingRoomStarted=function(){var o=this;var delay=Math.round(Math.random()*(1000*15));setTimeout(function(){o.isInPrv=false;transmissionGUI.hidePlayerInfo();o.messagesSystem.hide(o.waitingRoomInfoId);o.messagesSystem.hide(o.terminatedInfoId);o.messagesSystem.hide(o.failureInfoId);o.messagesSystem.hide(o.waitingRoomPrvInfoId);o.packetController.send(S_JOIN_TRANSMISSION,o.transUser.login);},delay);};Transmission.prototype.isOldPhotoHandler=function(){this.isOldPhoto=true;this.photoReadyInfo();};Transmission.prototype.fromPrvHandler=function(){prvTemplatesGUI.setRadioChecked();setTimeout(function(){prvTemplates.setStatus(true);},3000);};Transmission.prototype.tokenHandler=function(p){this.token=p.msg[0];this.transmissionGUI.startStream();};Transmission.prototype.setDescription=function(description){if(!this.joined&&this.joinStatus=='disconnected'){messagesSystem.show('info',lang['trans-reconnecting'],2000);return;}
this.packetController.send(S_T_SET_DESCRIPTION,description);};Transmission.prototype.statisticsHandler=function(p){this.nTotalViewers=p.msg[0];if(this.updateStats)
this.transmissionGUI.setStatistics(p.msg[0]);};Transmission.prototype.msgSend=function(msg){if(!this.joined&&this.joinStatus=='disconnected'){messagesSystem.show('info',lang['trans-reconnecting'],2000);return;}
if(msg=="")
return;if(this.chatBlocked)
return;msg=htmlspecialchars(msg);var reg=/[^a-z0-9\-_zżźćńółęąś!”$%&’()*\+,\/;\[\\\]\^_`{|}~:=@#'"?. ]/gi;msg=msg.replace(reg,"");if(msg==""){this.transmissionGUI.msgBadCharacters();return;}
if((user.adminLevel==0||(user.adminLevel==1&&msg.indexOf("/m")==-1))&&((this.transUser.login!=user.login&&user.isMuted)||!autoModerator.validate(msg,true))){var p=new Object();p.msg=[user.uid,user.login,msg,"normal"];this.transmissionGUI.msgNewMessage(p);return;}
var floodTimer=2500;if(user.adminLevel!=0){floodTimer=1000;}
if(this.lastChatmsgSend<new Date().getTime()-floodTimer&&this.lastChatMessage!=msg){this.packetController.sendArray(S_T_MESSAGE,[this.transUser.login,msg]);this.lastChatmsgSend=new Date().getTime();}else
this.transmissionGUI.msgFloodMessage();};Transmission.prototype.msgNewMessage=function(p){if(p.msg[3]!="moderator"&&!autoModerator.validate(p.msg[2],false))
return;this.transmissionGUI.msgNewMessage(p);if(this.nMessages+1>=this.maxMessages){this.transmissionGUI.msgRemoveLastMessage();}
this.nMessages++;};Transmission.prototype.isFakeCam=function(camName){if(camName=="")
return true;for(var i=0;i<this.fakeCamList.length;i++){if(camName.match(new RegExp(this.fakeCamList[i]))){return true;}}
return false;};Transmission.prototype.setAimSettings=function(status,desc,tokens){if(!this.joined&&this.joinStatus=='disconnected'){messagesSystem.show('info',lang['trans-reconnecting'],2000);return;}
if(status=="false"){tokens=20;}
this.packetController.sendArray(S_Z_SET_SETTINGS,[status+"",desc,tokens+""]);};Transmission.prototype.setPrvSettings=function(status,type,desc,tokens,time){if(status=="false"){tokens=20;time=20;}
this.packetController.sendArray(S_T_SET_PRVSETTINGS,[status+"",type+"",desc,tokens+"",time+""]);};Transmission.prototype.sendTip=function(tokens){if(!this.joined&&this.joinStatus=='disconnected'){messagesSystem.show('info',lang['trans-reconnecting'],2000);return;}
packetController.sendArray(S_Z_SEND,new Array(this.transUser.login,tokens,'pub',''));};Transmission.prototype.tokensSettingsHandler=function(p){var data=p.msg;this.isAim=(data[0]=="true");this.aimTokens=data[2];this.transmissionGUI.tipAimStatus(this.isAim,this.aimTokens,data[1]);};Transmission.prototype.isBold=function(username){for(var i=0;i<this.boldUsers.length;i++){if(this.boldUsers[i]==username)
return true;}
return false;};Transmission.prototype.tipHandler=function(p){this.currTokens=p.msg[2];this.tips[this.tips.length]=p.msg;this.transmissionGUI.tipTransferInfo(p.msg[0],p.msg[1],this.currTokens);};function getUserIndexFromArray(users,username){for(var i=0;i<users.length;i++){if(users[i][0]==username)
return i;}
return-1;};Transmission.prototype.tipLeaderHandler=function(p){if(p.msg[0]!=null)
transmissionGUI.setTipLeader(p.msg[0],p.msg[1],p.msg[0]=='manyleaders');};Transmission.prototype.vipHandler=function(p){this.boldUsers=p.msg;};Transmission.prototype.tokensTransferHandler=function(p){var tipsArray=removeEmptyKeys(p.msg);var splitted=tipsArray[tipsArray.length-1].split('[:]');this.currTokens=tipsArray[0];var data=new Array();var nData=0;for(var i=tipsArray.length-1;i>=1;i--){splitted=tipsArray[i].split('[:]');data[nData]=new Array();data[nData][0]=splitted[0];data[nData][1]=splitted[1];nData++;}
this.tips=data;this.transmissionGUI.tipTransferArray(data,this.currTokens);};Transmission.prototype.streamIdHandler=function(p){this.streamID=p.msg[0];};Transmission.prototype.usersListHandler=function(p){this.transmissionGUI.modGotList();for(var i=0;i<this.viewersList.length;i++){if(!isInViewersArray(p.msg,this.viewersList[i]))
this.transmissionGUI.modRemoveUser(this.viewersList[i]);}
for(i=0;i<p.msg.length;i++){if(!isInViewersArray(this.viewersList,p.msg[i])){this.transmissionGUI.modAddUser(p.msg[i]);var u=p.msg[i].split('[:]');if(this.isMuted(p.msg[i]))
this.transmissionGUI.modMuteUser(u[0]);}}
this.viewersList=p.msg;this.nLogged=p.msg.length;if(this.nTotalViewers-this.nLogged>0)
this.nGuests=this.nTotalViewers-this.nLogged;else
this.nGuests=0;this.transmissionGUI.modSetUserStats();this.transmissionGUI.modShowIfOffline();};Transmission.prototype.isMuted=function(uid){for(var i=0;i<this.mutedList.length;i++){if(uid==this.mutedList[i])
return true;}
return false;};Transmission.prototype.transMute=function(uid){packetController.send(S_T_MUTE,uid);};Transmission.prototype.transUnMute=function(uid){packetController.send(S_T_UNMUTE,uid);};Transmission.prototype.transKick=function(uid){packetController.send(S_T_KICK,uid);this.transmissionGUI.modRemoveUser(uid+"[:]");};Transmission.prototype.transBan=function(uid,login){packetController.sendArray(S_T_BAN,new Array(uid,login));this.transmissionGUI.modRemoveUser(uid+"[:]");};Transmission.prototype.transUnBan=function(uid,login){packetController.sendArray(S_T_UNBAN,new Array(uid,login));this.transmissionGUI.banUnBan(uid);};Transmission.prototype.prvSettingsHandler=function(p){this.prvSettings=p.msg.sort(templatesSort);if(this.prvSettings.length!=0)
this.transmissionGUI.invShowButton();else
this.transmissionGUI.invHideButton();};function templatesSort(a,b){var aData=a.split('[:]');var bData=b.split('[:]');return aData[3]-bData[3];};Transmission.prototype.invite=function(templateID){if(!this.joined&&this.joinStatus=='disconnected'){messagesSystem.show('info',lang['trans-reconnecting'],2000);return;}
packetController.sendArray(S_P_INVITE,[this.transUser.login,templateID]);};Transmission.prototype.incomingInvitation=function(p){this.invited=true;var settings=p.msg[1].split('[:]');transmissionGUI.invShowInvitation(p.msg[0],settings[1],settings[2],settings[3],settings[4]);};Transmission.prototype.sendInvitationDecision=function(decision){if(this.invited){packetController.sendArray(S_P_INVITEDECISION,[this.transUser.login,decision]);}
if(decision=="decline")
this.invited=false;};Transmission.prototype.incomingInvitationDeclined=function(){this.transmissionGUI.invInvitationDeclined();this.invited=false;};Transmission.prototype.incomingInvitationCanceled=function(){this.transmissionGUI.invInvitationCanceled();this.invited=false;};Transmission.prototype.invInvitationStatus=function(p){this.transmissionGUI.invInvitationStatus(p.msg[0]);};Transmission.prototype.streamStatusHandler=function(p){if(p)
this.streamStatus=(p.msg[0]=="true");if(this.flashReady){if(!this.startTrans){if(this.streamStatus)
document.getElementById("video").videoStatus("on");else
document.getElementById("video").videoStatus("off");}}else{var o=this;setTimeout(function(){o.streamStatusHandler();},500);}};Transmission.prototype.mutedListHandler=function(p){this.mutedList=p.msg;this.transmissionGUI.modUnMuteAll();for(var i=0;i<this.mutedList.length;i++){var u=this.mutedList[i].split("[:]");this.transmissionGUI.modMuteUser(u[0]);}
this.transmissionGUI.mutRenderMutedList();};Transmission.prototype.banListHandler=function(p){this.bannedList=p.msg;this.transmissionGUI.banRenderBannedList();};Transmission.prototype.photoReadyInfo=function(){if(!this.photoReady){this.photoReady=true;this.transmissionGUI.photoReadyInfo();var o=this;if(typeof document.getElementById('video')!="undefined"&&document.getElementById('video')!=null)
document.getElementById('video').makePubShot(o.token);setInterval(function(){document.getElementById('video').makePubShot(o.token);},1000*60*4);}};function onIOError(error){alert("BÅ‚Ä…d podczas tworzenia miniaturki: "+error);};function videoObjectLoaded(swfObjectID){setTimeout(function(){transmission.flashReady=true;},500);};function streamStatus(swfObjectID,msg,isReady){if(!transmission.startTrans)
return;if(isReady){msg=msg.toLowerCase();if(transmission.isFakeCam(msg))
return;$.post(siteUrl+"/site/setcamname",{name:msg});transmission.streamReady=true;}else
transmission.streamReady=false;packetController.send(S_T_STREAM_STATUS,transmission.streamReady);return true;};function photoReady(){if(transmission.streamReady)
packetController.send(S_T_PHOTO_READY);transmission.photoReadyInfo();return true;};function isInViewersArray(arr,viewer){for(var i=0;i<arr.length;i++){if(arr[i]==viewer)
return true;}
return false;};function getUsersOnline(){return transmission.nTotalViewers;};function secondsToTime(seconds){var minutes=Math.floor(seconds/60);var seconds=seconds-(minutes*60);if(seconds<10)
seconds="0"+seconds;if(minutes<10)
minutes="0"+minutes;return minutes+":"+seconds;};function htmlspecialchars(string,quote_style,charset,double_encode){var optTemp=0,i=0,noquotes=false;if(typeof quote_style==='undefined'||quote_style===null){quote_style=2;}
string=string.toString();if(double_encode!==false){string=string.replace(/&/g,'&amp;');}
string=string.replace(/</g,'&lt;').replace(/>/g,'&gt;');var OPTS={'ENT_NOQUOTES':0,'ENT_HTML_QUOTE_SINGLE':1,'ENT_HTML_QUOTE_DOUBLE':2,'ENT_COMPAT':2,'ENT_QUOTES':3,'ENT_IGNORE':4};if(quote_style===0){noquotes=true;}
if(typeof quote_style!=='number'){quote_style=[].concat(quote_style);for(i=0;i<quote_style.length;i++){if(OPTS[quote_style[i]]===0){noquotes=true;}else if(OPTS[quote_style[i]]){optTemp=optTemp|OPTS[quote_style[i]];}}
quote_style=optTemp;}
if(quote_style&OPTS.ENT_HTML_QUOTE_SINGLE){string=string.replace(/'/g,'&#039;');}
if(!noquotes){string=string.replace(/"/g,'&quot;');}
return string;};function trace(msg){};function PrvTemplates(){this.prvTemplates=new Array();this.currentStatus=false;};PrvTemplates.prototype.addTemplate=function(des,tim,tok,typ){var o=this;$.post(siteUrl+'/site/prvtemplates/add',{desc:des,time:tim,tokens:tok,type:typ,csrfToken:csrfToken},function(data){if(data=='ok')
o.getTemplates();else if(data=='tooMuchTemplates')
prvTemplatesGUI.showError(lang['p-temp-limit']);else
prvTemplatesGUI.showError(lang['p-temp-error']);});};PrvTemplates.prototype.deleteTemplate=function(tempID){var o=this;$.post(siteUrl+'/site/prvtemplates/delete',{id:tempID,csrfToken:csrfToken},function(data){o.getTemplates();});};PrvTemplates.prototype.activateTemplate=function(tempID){var o=this;for(var i=0;i<this.prvTemplates.length;i++){if(this.prvTemplates[i][0]==tempID)
this.prvTemplates[i][1]=true;}
$.post(siteUrl+'/site/prvtemplates/activate',{id:tempID,csrfToken:csrfToken});this.sendPrvSettings();};PrvTemplates.prototype.deactivateTemplate=function(tempID){var o=this;for(var i=0;i<this.prvTemplates.length;i++){if(this.prvTemplates[i][0]==tempID)
this.prvTemplates[i][1]=false;}
$.post(siteUrl+'/site/prvtemplates/deactivate',{id:tempID,csrfToken:csrfToken});this.sendPrvSettings();};PrvTemplates.prototype.getTemplates=function(){var o=this;$.ajax({type:"POST",url:siteUrl+'/site/prvtemplates/get',data:{csrfToken:csrfToken},dataType:"xml",success:function(xmlData){o.prvTemplates=new Array();$(xmlData).find("template").each(function(){var i=o.prvTemplates.length;o.prvTemplates[i]=new Array();o.prvTemplates[i][0]=$(this).find("id").text();o.prvTemplates[i][1]=$(this).find("active").text();o.prvTemplates[i][2]=$(this).find("description").text();o.prvTemplates[i][3]=$(this).find("type").text();o.prvTemplates[i][4]=$(this).find("time").text();o.prvTemplates[i][5]=$(this).find("tokens").text();});prvTemplatesGUI.render(xmlData);o.sendPrvSettings();}});};PrvTemplates.prototype.sendPrvSettings=function(){if(this.currentStatus){var temp=new Array();for(var i=0;i<this.prvTemplates.length;i++){if(this.prvTemplates[i][1]==1){temp[temp.length]=this.prvTemplates[i][0]+'[:]'+this.prvTemplates[i][2]+'[:]'+this.prvTemplates[i][4]+'[:]'+this.prvTemplates[i][5]+'[:]'+this.prvTemplates[i][3];}}
packetController.sendArray(S_T_SET_PRVSETTINGS,temp);}else{packetController.sendArray(S_T_SET_PRVSETTINGS,[]);}};PrvTemplates.prototype.setStatus=function(turnedOn){this.currentStatus=turnedOn;this.sendPrvSettings();};var prvTemplates;$(function(){prvTemplates=new PrvTemplates();});function TransmissionGUI(){this.previousMessageDark=false;this.tipTransferInfoTimer=false;this.addedModerateListeners=false;this.makePhotoPreviousText=$('#make-photo').html();this.currentStreamId=null;this.currentStreamToken=null;this.msgInit();this.invInit();this.tipInit();this.repInit();};TransmissionGUI.prototype.enableButtons=function(){if(transmission.startTrans){$('#settingsButton').fadeTo("fast",1);$('#aim-wrap').fadeTo("fast",1);$('#aim-wrap input').attr('disabled',false);$('#descriptionInput').attr('disabled',false);$('#changeAimStatusButton').fadeTo("fast",1);$('#invitations-wrap').fadeTo("fast",1);$('#invitations-wrap input').attr('disabled',false);}else{if(transmission.prvSettings.length!=0){$('#inviteButton').fadeTo("fast",1);$('#inviteButton2').fadeTo("fast",1);}
$('.send-tip-button').fadeTo("fast",1);}
$('#chatButton').fadeTo("fast",1);$('#chatInput').attr('disabled',false).val('');};TransmissionGUI.prototype.disableButtons=function(){var fadeVal=.4;if(transmission.startTrans){$('#settingsButton').fadeTo("fast",fadeVal);$('#aim-wrap').fadeTo("fast",fadeVal);$('#aim-wrap input').attr('disabled',true);$('#descriptionInput').attr('disabled',true);$('#changeAimStatusButton').fadeTo("fast",fadeVal);$('#invitations-wrap').fadeTo("fast",fadeVal);$('#invitations-wrap input').attr('disabled',true);}else{$('#inviteButton').hide();$('#private-popup').hide();$('#tip-popup').hide();$('#inviteButton2').fadeTo("fast",fadeVal);$('.send-tip-button').fadeTo("fast",fadeVal);}
$('#chatButton').fadeTo("fast",fadeVal);if(user.isLogged){if(transmission.joinStatus=='disconnected')
$('#chatInput').attr('disabled',true).val(lang['trans-reconnecting']);else
$('#chatInput').attr('disabled',false).val('');}};TransmissionGUI.prototype.showMakePhotoInfo=function(){$('#resize-left .transmission-wrap .fb-share-button').hide();$('#resize-left .transmission-wrap').css('background-color','#920303');$('#make-photo').html('<p>'+lang['p-makephoto']+'</p>');};TransmissionGUI.prototype.startStream=function(){if(this.currentStreamId==transmission.streamID&&this.currentStreamToken==transmission.token&&transmission.streamStatus){packetController.send(S_T_STREAM_STATUS,transmission.streamReady);return;}
this.currentStreamId=transmission.streamID;this.currentStreamToken=transmission.token;if(transmission.startTrans){this.modInit();this.banInit();this.mutInit();}
startFlashStream(transmission.streamID,transmission.token,transmission.startTrans,null,null,null,transmission.streamStatus,transmission.isOldPhoto);};TransmissionGUI.prototype.gotDescription=function(p){var description=p.msg[0];if(!transmission.startTrans){if(description=="")
description='&nbsp;';$("#description").html(description);}else if(description!="")
$("#descriptionInput").val(description);};TransmissionGUI.prototype.setStatistics=function(viewers){$("#viewersOnline").html(viewers);};TransmissionGUI.prototype.hide=function(){$("#transContent").hide();$("#chatPart").css("margin-bottom","10px");};TransmissionGUI.prototype.photoReadyInfo=function(){$('#resize-left .transmission-wrap').css('background-color','#2B9203');$('#resize-left .transmission-wrap p').html(lang['p-photoready']);var o=this;setTimeout(function(){$('#resize-left .transmission-wrap').css('background-color','#000000');$('#resize-left .transmission-wrap .fb-share-button').show();$('#make-photo').html(o.makePhotoPreviousText);},5000);};TransmissionGUI.prototype.setDescription=function(){var desc=$("#descriptionInput").val();if(desc==lang['p-desc-success'])
return;if(desc.length<80){$("#descriptionInput").css("color","green");$("#descriptionInput").css("font-weight","bold");setTimeout(function(){$("#descriptionInput").css("color","white");$("#descriptionInput").css("font-weight","normal");},1000);transmission.setDescription(desc);$("#descError").hide("slow");}else{$("#descriptionInput").css("border","1px solid red");}};TransmissionGUI.prototype.bSettingsNotifyChange=function(){$("#bs_info_success").hide("slow");$("#bs_info").html(lang['remember-to-save']);$("#bs_info").show("slow");};TransmissionGUI.prototype.favoritesAction=function(){if(!user.isLogged)return;if($("#favoritedStar").hasClass('liked')){favorites.remove(transmission.transUser.uid);$("#favoritedStar").removeClass('liked');$("#favoritedStar a").css("opacity","0.3");}else{favorites.add(transmission.transUser.uid);$("#favoritedStar").addClass('liked');$("#favoritedStar a").css("opacity","1");}}
TransmissionGUI.prototype.showPlayerInfo=function(type){this.hidePlayerInfo();$('#cameraWindow').css('cursor','pointer');if(type=='charge'){$('#cameraWindow').css('background','url(\'images/pinfo-tokens.jpg\') no-repeat center center');$('#cameraWindow').bind("click",function(){buyTokensPopup();});}else{$('#cameraWindow').css('background','url(\'images/pinfo-register.jpg\') no-repeat center center');$('#cameraWindow').bind("click",function(){window.open(siteUrl+"/site/register",'_blank');});}
$('#cameraWindow embed').hide();};TransmissionGUI.prototype.hidePlayerInfo=function(type){$('#cameraWindow').css('cursor','auto');$('#cameraWindow').unbind("click");$('#cameraWindow').css('background','black');$('#cameraWindow embed').show();};$(function(){$("#settingsButton").click(function(){transmissionGUI.setDescription();});$("#descriptionInput").enterKey(function(){transmissionGUI.setDescription();});});function disableEnterKey(e,func)
{var key;if(window.event)
key=window.event.keyCode;else
key=e.which;if(key==13){func();return false;}
return true;}
function add0(str){if(str.length==1)
return'0'+str;return str;}
function PrvTemplatesGUI(){$('#prvtypeinput').html(injectVariable(lang['p-allow-type-from'],[100]));$('#prvtokens').keyup(function(){var tokens=$(this).val();if(!isNaN(Number(tokens))){if(tokens>=100){$('#prvtypeinput').html('<input type="checkbox" id="prvtype" value="2"> '+lang['p-allow-type2']);}else{$('#prvtypeinput').html(injectVariable(lang['p-allow-type-from'],[100]));}}});};PrvTemplatesGUI.prototype.addTemplate=function(){var prvType=1;if($("#prvtype"))
if($("#prvtype").prop('checked'))prvType=2;else
prvType=1;var desc=$("#prvdesc").val();var time=$("#prvtime").val();var tokens=$("#prvtokens").val();var error=false;$("#prvdesc").removeClass('inputError');$("#prvtime").removeClass('inputError');$("#prvtokens").removeClass('inputError');if(desc==lang['p-temp-desc']||desc.length==0||desc.length>60){error=true;$("#prvdesc").addClass('inputError');}
if(time<1||time>10000||isNaN(Number(time))){error=true;$("#prvtime").addClass('inputError');}
if(tokens<10||tokens>10000||isNaN(Number(tokens))){error=true;$("#prvtokens").addClass('inputError');}
if(!error){prvTemplates.addTemplate(desc,time,tokens,prvType);$("#prvtype").removeAttr('checked');$("#prvdesc").val('');$("#prvtime").val('');$("#prvtokens").val('');}};PrvTemplatesGUI.prototype.showError=function(msg){$("#prv_options .error").html(msg).show("slow");setTimeout(function(){$("#prv_options .error").hide("slow");},4000);};PrvTemplatesGUI.prototype.deleteTemplate=function(tempID){if(window.confirm(lang['p-temp-confirm']))
prvTemplates.deleteTemplate(tempID);};PrvTemplatesGUI.prototype.activateOrDeactivate=function(tempID){if($("#temp"+tempID).prop('checked'))
prvTemplates.activateTemplate(tempID);else
prvTemplates.deactivateTemplate(tempID);};PrvTemplatesGUI.prototype.render=function(xmlData){var data='';$(xmlData).find("template").each(function(){var isChecked='';if($(this).find("active").text()==1)
isChecked='CHECKED';var t='';if($(this).find("type").text()==2)
t='<span class="greenDesc">('+lang['p-temp-type2']+')</span>';data+='<tr>';data+='<td><span class="layout-name">'+$(this).find("description").text()+' '+t+'</span></td>';data+='<td><span class="layout-time">'+$(this).find("time").text()+' min</span></td>';data+='<td><span class="layout-tokens">'+$(this).find("tokens").text()+'</span></td>';data+='<td><label for=""><input type="checkbox" id="temp'+$(this).find("id").text()+'" '+isChecked+' onclick="prvTemplatesGUI.activateOrDeactivate('+$(this).find("id").text()+');"> '+lang['p-active']+'</label></td>';data+='<td><a href="javascript:void(0)" onclick="prvTemplatesGUI.deleteTemplate('+$(this).find("id").text()+');" class="delete-layout"></a></td>';data+='</tr>';});$("#templates-panel .positions").html(data);};PrvTemplatesGUI.prototype.setRadioChecked=function(){$('input:radio[name="prv_status"]').filter('[value="true"]').prop('checked',true);};PrvTemplatesGUI.prototype.setStatus=function(turnedOn){prvTemplates.setStatus(turnedOn);};var prvTemplatesGUI;$(function(){prvTemplatesGUI=new PrvTemplatesGUI();});TransmissionGUI.prototype.emInit=function(){this.emList={":angel:":"angel","-.-":"angry","-,-":"angry",":bandit:":"bandit",":bear:":"bear",":beer:":"beer",":D":"bigsmile",";D":"bigsmile",":bow:":"bow",":U:":"brokenheart",":bug:":"bug",":^":"cake",":call:":"call",":cash:":"cash",":clapping:":"clapping",":coffee:":"coffee","8-":"cool",";(":"crying",":dance:":"dance",":devil:":"devil",":doh:":"doh",":drink:":"drink",":drunk:":"drunk",":dull:":"dull",":eblush:":"eblush",":emo:":"emo",":envy:":"envy","]:":"evilgrin",":F":"flower",":fubar:":"fubar",":giggle:":"giggle",":handshake:":"handshake",":happy:":"happy",":headbang:":"headbang",":heart:":"heart",":heidy:":"heidy",":hi:":"hi",":inlove:":"inlove",":itwasntme:":"itwasntme",":kiss:":"kiss",":mail:":"mail",":makeup:":"makeup",":middlefinger:":"middlefinger",":mmm:":"mmm",":mooning:":"mooning",":~":"movie",":music:":"music",":myspace:":"myspace","8-|":"nerd",":ninja:":"ninja",":no:":"no",":nod:":"nod",":party:":"party",":phone:":"phone",":pizza:":"pizza",":poolparty:":"poolparty",":puke":"puke",":punch:":"punch",":rain:":"rain",":rock:":"rock",":rofl:":"rofl",":(":"sadsmile",":shake:":"shake",":skype:":"skype","|-:":"sleepy",":smile:":"smile",":smirk:":"smirk",":smoke:":"smoke",":|":"speechless",":*":"star",":sun:":"sun",":O":"surprised",":swear":"swear",":sweating:":"sweating",":talk:":"talking",":think:":"thinking",":tmi:":"tmi",":toivo:":"toivo",":P":"tongueout",":wait:":"wait",":whew:":"whew",":wink:":"wink",":^":"wondering",":S":"worried",":yawn:":"yawn",":yes:":"yes"}
for(value in this.emList){$('#emoticonsWindow .dialog-body').append('<div class="emoticon"><a href="javascript:void(0)" onclick="transmissionGUI.emSet(\''+value+'\');"><img src="images/emoticons/'+this.emList[value]+'.gif"></a></div>');}};TransmissionGUI.prototype.emOpen=function(){$('#emoticonsWindow').css("margin-top","0px","margin-left","180px");if(!$('#emoticonsWindow').is(':visible'))
$("#emoticonsWindow").show("slow");else
this.emClose();};TransmissionGUI.prototype.emClose=function(){$("#emoticonsWindow").hide("slow");};TransmissionGUI.prototype.emSet=function(code){this.emClose();$("#chatInput").val($("#chatInput").val()+' '+code);};TransmissionGUI.prototype.aimNotifyChange=function(){$("#aim_options .aim-info").html(lang['remember-to-save']);$("#aim_options .aim-info").show("slow");};TransmissionGUI.prototype.aimSetData=function(isAim,tokens,description){if(isAim){$('input:radio[name="aim_status"]').filter('[value="true"]').prop('checked',true);$("#aim_options").fadeTo('slow',1);$("#aim_desc").val(description);$("#aim_tokens").val(tokens);}else{$('input:radio[name="aim_status"]').filter('[value="true"]').prop('checked',false);$("#aim_options").fadeTo('slow',0.2);}}
TransmissionGUI.prototype.aimSetStatus=function(dontSendToServer){if(!transmission.joined)
return;var status=$('input[name=aim_status]:checked').val();$("#aim_options .aim-info").hide("slow");var err=false;if(status=='true'){if(typeof this.aimLCookies=="undefined")
this.aimLoadFromCookies();$("#aim_options").fadeTo('slow',1);$('#aim_progress').slideDown('slow');if($("#aim_desc").val()==""||$("#aim_desc").val().length>150){err=true;$("#aim_desc").css("border","1px solid red");}else
$("#aim_desc").css("border","1px solid #989898");if($("#aim_tokens").val()==""||isNaN($("#aim_tokens").val())||$("#aim_tokens").val()<10||$("#aim_tokens").val()>5000){err=true;$("#aim_tokens").css("border","1px solid red");}else
$("#aim_tokens").css("border","1px solid #989898");}else{$('#aim_progress').slideUp('slow');$("#aim_options").fadeTo('slow',0.2);}
if(!err){$("#aim_info_success").html(lang['changes-saved']);$("#aim_info_success").show("slow");setTimeout(function(){$("#aim_info_success").hide("slow");},3000);if(!dontSendToServer)
transmission.setAimSettings(status,$("#aim_desc").val(),$("#aim_tokens").val());var aimSettings=status+"[:]"+$("#aim_desc").val()+"[:]"+$("#aim_tokens").val();$.cookie("aimsettings",null);$.cookie("aimsettings",aimSettings,{expires:180});}};TransmissionGUI.prototype.aimLoadFromCookies=function(){this.aimLCookies=true;if($.cookie("aimsettings")){var temp=$.cookie("aimsettings").split("[:]");$("#aim_desc").val(temp[1]);$("#aim_tokens").val(temp[2]);}};TransmissionGUI.prototype.msgInit=function(){var o=this;this.modMode=false;this.msgID=0;$("#chatInput").enterKey(function(){o.msgSend();});$("#chatButton").click(function(){o.msgSend();});$("#modButton").click(function(){o.msgSetModMode();$("#chatInput").focus();});$("#aDown").click(function(){o.msgADown();});$("#aUp").click(function(){o.msgAUp();});transResize.events.addEventListener(transResize.EVT_RESIZE,this.msgOnChatResize.bind(this));if($.cookie("fontsize")){$("#chat-pane").css('font-size',$.cookie("fontsize")+'px');}
if($.cookie("lineheight")){$("#chat-pane .chat").css('line-height',$.cookie("lineheight")+'px');}};TransmissionGUI.prototype.msgBadCharacters=function(){this.msgSetInputMode('error',{msg:lang['chat-bad-char-msg'],disabled:true,timeToUnblock:1000,showMsgAfter:100});};TransmissionGUI.prototype.msgAUp=function(){var size=Number($("#chat-pane").css('font-size').replace('px',''))+1;$("#chat-pane").css('font-size',size+'px');$('#scrollbar-chat').tinyscrollbar_update('bottom');transResize.enlarge();var lineHeight=Number($("#chat-pane .chat").css('line-height').replace('px',''))+1;$("#chat-pane .chat").css('line-height',lineHeight+'px');$.cookie("fontsize",size,{expires:31});$.cookie("lineheight",lineHeight,{expires:31});};TransmissionGUI.prototype.msgADown=function(){var size=Number($("#chat-pane").css('font-size').replace('px',''))-1;if(size<10)
return;$("#chat-pane").css('font-size',size+'px');$('#scrollbar-chat').tinyscrollbar_update('bottom');var lineHeight=Number($("#chat-pane .chat").css('line-height').replace('px',''))-1;$("#chat-pane .chat").css('line-height',lineHeight+'px');$.cookie("fontsize",size,{expires:31});$.cookie("lineheight",lineHeight,{expires:31});};TransmissionGUI.prototype.msgPrivilegesHandler=function(){this.msgSetInputMode('error',{msg:lang['p-msg-privilege'],disabled:true,timeToUnblock:5000,showMsgAfter:200});};TransmissionGUI.prototype.msgSetModMode=function(){if(this.modMode){$('#chatInput').css('background-color','');}else{$('#chatInput').css('background-color','#1F0036');}
this.modMode=!this.modMode;};TransmissionGUI.prototype.msgOnChatResize=function(o){$('#resize-right').height(o.height);$('#resize-right .pane').height(o.height-71);var viewportHeight=o.height-111;$('#scrollbar-chat .viewport').height(viewportHeight);$('#scrollbar-chat .scrollbar').height(viewportHeight);$('#scrollbar-chat .track').height(viewportHeight);$('#scrollbar-chat').tinyscrollbar_update('bottom',true);$('#scrollbar-viewers .viewport').height(viewportHeight-15);$('#scrollbar-viewers .scrollbar').height(viewportHeight);$('#scrollbar-viewers .track').height(viewportHeight);$('#scrollbar-viewers').tinyscrollbar_update();viewportHeight=(viewportHeight/2)-10;$('#scrollbar-blocked .viewport').height(viewportHeight-15);$('#scrollbar-blocked .scrollbar').height(viewportHeight);$('#scrollbar-blocked .track').height(viewportHeight);$('#scrollbar-blocked').tinyscrollbar_update();$('#scrollbar-muted .viewport').height(viewportHeight-15);$('#scrollbar-muted .scrollbar').height(viewportHeight);$('#scrollbar-muted .track').height(viewportHeight);$('#scrollbar-muted').tinyscrollbar_update();};TransmissionGUI.prototype.msgSend=function(forceSend){if(!transmission.joined&&transmission.joinStatus=='disconnected'){messagesSystem.show('info',lang['trans-reconnecting'],2000);return;}
if(transmission.chatBlocked)
return;if(!user.isLogged){$("#chatInput").val(lang['p-login-first']);$(".send-message").css("border","1px solid red");$("#chatInput").css("color","red");return;}
var msg=$("#chatInput").val();if(this.modMode){msg='/m'+msg;}else{if(user.adminLevel!=0&&!forceSend){if(modPrompt.checkPromptWord(msg))
return;}}
if(msg.length<200){if(user.uid!=transmission.transUser.uid)
transmission.msgSend(msg);else{setTimeout(function(){transmission.msgSend(msg);},2000);this.msgNewMessage({msg:[transmission.transUser.uid,transmission.transUser.login,msg,""]},true);}
$("#chatInput").val("");}else{this.msgSetInputMode('error',{msg:lang['p-msg-too-long'],timeToUnblock:1000});}};TransmissionGUI.prototype.msgNewMessage=function(p,notFromSocket){var uid=p.msg[0];var username=p.msg[1];var message=p.msg[2];var isModMsg=(p.msg[3]=="moderator");var reg=/[^a-z0-9\-_zżźćńółęąś!”$%&’()*\+,\/;\[\\\]\^_`{|}~:=@#'"?. ]/gi;message=message.replace(reg,"");if(!notFromSocket&&transmission.transUser.login==username&&user.uid==transmission.transUser.uid)
return;var hostString='guest';if(transmission.transUser.login==username)
hostString='host';if(isModMsg){username='Moderator';hostString='moderator';message=message.substring(2);}
var vip='';if(transmission.isBold(username))
vip='<span class="vip">VIP</span>';var forMe=p.msg[2].indexOf('@'+user.login)!=-1;if(!user.isLogged)
forMe=false;var usernameText='<a target="_blank" class="chat-link '+hostString+'" href="'+siteUrl+'/profile/'+username+'">'+username+vip+':</a>';if(isModMsg)
usernameText=username+vip+":";var code='<li login="'+username+'" uid="'+uid+'" id="'+this.msgID+'"><span class="author '+hostString+'">'+usernameText+' </span>';if(!forMe)
code+='<span class="message">'+message+'</span>';else
code+='<span class="message forme">'+message+'</span>';if(user.isLogged&&!isModMsg&&user.login!=username){if(transmission.startTrans)
code+='<div class="mod" style="font-size:12px;line-height:18px;">'+lang['p-click-mod']+'</div>';else if(transmission.transUser.login!=username)
code+='<a class="report" href="javascript:void(0)" onclick="transmissionGUI.repOpen('+this.msgID+')">!</a>';}
code+='</li>';$("#chatView").append(code);$('#scrollbar-chat').tinyscrollbar_update('bottom');this.msgID++;};TransmissionGUI.prototype.msgTipInfo=function(who,tokens){var code='<li class="rounded-wrap tipInfo">';code+='<span><strong>'+injectVariable(lang['p-tip-info'],[who,tokens])+'</strong></span>';code+='</li>';$("#chatView").append(code);$('#scrollbar-chat').tinyscrollbar_update('bottom');};TransmissionGUI.prototype.msgCardInfo=function(who,tokens,uniq){var code='<li class="rounded-wrap tipInfo"><div style="float:left;margin-right:10px;"><img src="images/christmas-tree.png" /></div><div style="width:350px;">';code+='<span><strong>'+injectVariable(lang['p-card-info'],[who,tokens,'openChristmasCard("'+uniq+'")'])+'</strong></span>';code+='</div></li>';$("#chatView").append(code);$('#scrollbar-chat').tinyscrollbar_update('bottom');};TransmissionGUI.prototype.msgRemoveLastMessage=function(){var div=document.getElementById("chatView");$(div.firstChild).remove();$('#scrollbar-chat').tinyscrollbar_update('bottom');};TransmissionGUI.prototype.msgRemoveMessage=function(p){var login=p.msg[0];if(login!=''&&login!=user.login){$("#chatView").find("li[login='"+login+"']").each(function(){$(this).remove();});$('#scrollbar-chat').tinyscrollbar_update('bottom');}};TransmissionGUI.prototype.msgSpamMessage=function(){this.msgSetInputMode('error',{msg:lang['chat-send-spam'],disabled:true,timeToUnblock:5000,showMsgAfter:200});};TransmissionGUI.prototype.msgFloodMessage=function(){var timeToUnblock=2000;if(user.adminLevel!=0)
timeToUnblock=400;this.msgSetInputMode('error',{msg:lang['chat-send-flood'],disabled:true,timeToUnblock:timeToUnblock,showMsgAfter:200});};TransmissionGUI.prototype.msgSetInputMode=function(mode,data){var o=this;if(mode=='error'){if(data.disabled){$("#chatInput").prop('disabled','disabled');transmission.chatBlocked=true;}
if(data.timeToUnblock){this.previousMessage=$("#chatInput").val();setTimeout(function(){o.msgSetInputMode('normal',{msg:o.previousMessage});},data.timeToUnblock);}
if(data.msg){if(!data.showMsgAfter)
$("#chatInput").val(data.msg);else{setTimeout(function(){$("#chatInput").val(data.msg);},data.showMsgAfter);}}
$("#chatInput").css("color","red");$(".send-message").css("border","1px solid red");}else{transmission.chatBlocked=false;$("#chatInput").removeAttr('disabled');if(data.msg!=null){$("#chatInput").val(data.msg);}
$("#chatInput").css("color","#817a7e");$(".send-message").css("border","1px solid #715C6A");}};function msgSend(){transmissionGUI.msgSend();};TransmissionGUI.prototype.tipInit=function(){this.sendedFrom=0;var o=this;$('#sendTip1 .generic-pink-btn').click(function(){o.tipSend1();});$('#sendTip1 .tip-input').enterKey(function(){o.tipSend1();});$('#tip-popup .generic-pink-btn').click(function(){o.tipSend2();});$('#tip-popup .tip-input').enterKey(function(){o.tipSend2();});};TransmissionGUI.prototype.tipOpenPopup=function(){$('#tip-popup').css('display','block').css('height','25px').css('top','40px');$('#tip-popup .info').css('display','none');$('#tip-popup').fadeTo('slow',1);};TransmissionGUI.prototype.tipClosePopup=function(){$('#tip-popup').fadeTo('slow',0,function(){$('#tip-popup').css('display','none');});};TransmissionGUI.prototype.tipSend1=function(){this.sendedFrom=1;if(!user.isLogged){this.tipShowInfo(lang['login-first'],'error',1);return;}
var tokens=$("#sendTip1 .tip-input").val();if(tokens==""||isNaN(tokens)){$("#sendTip1 .tip-input").css("border","1px solid red");}else{$("#sendTip1 .tip-input").css("border","1px solid #4D4D4D");transmission.sendTip(tokens);}};TransmissionGUI.prototype.tipSend2=function(){this.sendedFrom=2;if(!user.isLogged){this.tipShowInfo(lang['login-first'],'error',2);return;}
var tokens=$("#tip-popup .tip-input").val();if(tokens==""||isNaN(tokens)){$("#tip-popup .tip-input").css("border","1px solid red");}else{$("#tip-popup .tip-input").css("border","1px solid #4D4D4D");transmission.sendTip(tokens);}};TransmissionGUI.prototype.tipShowInfo=function(msg,type,loc){if(loc==2){$('#tip-popup .info').html(msg);$('#tip-popup .info').removeClass('red');$('#tip-popup .info').removeClass('green');if(type=='error')
$('#tip-popup .info').addClass('red');else
$('#tip-popup .info').addClass('green');$('#tip-popup').stop(true,true).animate({height:'40px'},1000);$('#tip-popup .info').show('slow');}else{$("#sendTip1 .progress-text").removeClass('red');$("#sendTip1 .progress-text").removeClass('green');$("#sendTip1 .progress-text").html(msg);if(type=='error')
$("#sendTip1 .progress-text").addClass('red');else
$("#sendTip1 .progress-text").addClass('green');}};TransmissionGUI.prototype.tipHideInfo=function(loc){if(loc==2){$('#tip-popup').stop(true,true).animate({height:'25px'},1000);$('#tip-popup .info').hide('slow');}else{$("#sendTip1 .progress-text").removeClass('red');$("#sendTip1 .progress-text").removeClass('green');$("#sendTip1 .progress-text").html(lang['tip-min']);}};TransmissionGUI.prototype.tipStatus=function(p){var status=p.msg[0];var who=p.msg[1];var tokens=p.msg[2];var type='error';var msg='';if(status=="sended"){msg=lang['tip-succ'];type='success';}else if(status=="noUser"){msg=lang['tip-user-left'];}else if(status=="minNeeded"){msg=lang['tip-min'];}else if(status=='tooLittleTokens'){msg=lang['tip-little-tokens'];}else{msg=lang['tip-cant-be-host'];}
this.tipShowInfo(msg,type,this.sendedFrom);if(status=="sended"){var o=this;setTimeout(function(){o.tipHideInfo(o.sendedFrom);},2000);}};TransmissionGUI.prototype.tipTransferInfo=function(from,tokens,total){if(transmission.isAim)
this.tipUpdateAimStatus();$("#scrollbar-tips .recived-tokens").prepend('<li><span class="username">'+from+'</span><span class="tokens">+'+tokens+'</span></li>');$("#recTokens").html(total);$("#scrollbar-tips").show('slow');$("#scrollbar-tips").tinyscrollbar_update();this.msgTipInfo(from,tokens);};TransmissionGUI.prototype.tipTransferArray=function(transfersArray,total){if(transmission.isAim){this.tipUpdateAimStatus();}
var html='';for(var i=0;i<transfersArray.length;i++){html+='<li><span class="username">'+transfersArray[i][0]+'</span><span class="tokens">+'+transfersArray[i][1]+'</span></li>';}
$("#recTokens").html(total);if(html!=''){$("#scrollbar-tips .recived-tokens").html(html);$("#scrollbar-tips").show('slow');}else{$("#scrollbar-tips").hide();}
$("#scrollbar-tips").tinyscrollbar_update();};TransmissionGUI.prototype.tipAimStatus=function(isAim,tokens,description){if(transmission.startTrans)
transmissionGUI.aimSetData(isAim,tokens,description);if(isAim){$('#aim_progress').slideDown('slow');$("#aim_description").show('slow');this.tipUpdateAimStatus();$("#aim_description .transmission-goal").html(description);}else{$("#aim_description").hide('slow');$('#aim_progress').slideUp('slow');$("#aim_progress .progress-text").html("- / - "+lang['p-aim-tokens-word']+" (0%)");$("#aim_progress .progress").stop(true,true).animate({width:'0%'},500);$("#aim_description .transmission-goal").html(lang['p-no-aim']);}};TransmissionGUI.prototype.tipUpdateAimStatus=function(){var currTokens=transmission.currTokens;var aimTokens=transmission.aimTokens;var percent=(currTokens*1)/aimTokens;percent=Math.round(percent*100);$("#aim_progress .progress-text").html(currTokens+" / "+aimTokens+' '+lang['p-aim-tokens-word']+' ('+percent+'%)');if(percent>100)
percent=100;$("#aim_progress .progress").stop(true,true).animate({width:percent+'%'},500);};TransmissionGUI.prototype.setTipLeader=function(username,tokens,manyLeaders){$('#tip-leader').show();if(!manyLeaders)
$('#tip-leader').html(lang['tip-leader']+': <strong>'+username+'</strong> <span>('+tokens+' '+lang['p-aim-tokens-word']+')</span>');else
$('#tip-leader').html(lang['tip-leader-many']);};TransmissionGUI.prototype.invInit=function(){this.buttonMode='';this.buttonTimer=null;$('#inviteButton').click(function(){$(this).css('display','block');$('#private-popup').fadeTo('slow',1,function(){$('#scrollbar-invitations').tinyscrollbar_update();});});$('#private-popup .gray-btn').click(function(){$('#private-popup').fadeTo('slow',0,function(){$(this).css('display','none');});});};TransmissionGUI.prototype.invShowButton=function(){if(!user.isLogged){$("#scrollbar-invitations").hide();this.inviSetButtonMode('login');}else{this.inviSetButtonMode('invite');var html='';for(var i=transmission.prvSettings.length;i>=0;i--){if(typeof transmission.prvSettings[i]!="undefined"){var data=transmission.prvSettings[i].split('[:]');var checked='';if(transmission.prvSettings.length==1)
checked='CHECKED';html+='<div class="session-option">';html+='<label>'
html+='<span class="session-title"><input type="radio" name="prv_template" name="prvSelectedTemplate" value="'+data[0]+'" '+checked+'>'+data[2]+'</span>';html+='<p class="session-details">';html+='<span class="session-time">'+lang['p-invi-time']+': '+data[4]+' min.</span> | <span class="session-price">'+lang['p-invi-price']+': <span class="tokens">'+data[3]+'</span>';html+='</span></p>';if(data[1]==2)
html+='<p><small>+ '+lang['p-invi-type2']+'</small></p>';html+='</label>';html+='</div>';}}
$("#privateContainer").html(html);}
if($('#scrollbar-invitations').length!=0)
$('#scrollbar-invitations').tinyscrollbar_update();$("#inviteButton").fadeTo('slow',1);var o=this;$('#inviteButton2').click(function(){o.inviClicked();});};TransmissionGUI.prototype.invHideButton=function(){$("#inviteButton").fadeTo('slow',0,function(){$(this).css('display','none');});$('#private-popup').fadeTo('slow',0,function(){$(this).css('display','none');});};TransmissionGUI.prototype.invSendInvitation=function(){if(user.isLogged){var selectedID=$('#private-popup input:radio:checked').val();if(typeof selectedID!="undefined"){transmission.invite(selectedID);this.inviSetButtonMode('pending');}else{var o=this;this.inviSetButtonMode('notemplate');setTimeout(function(){o.inviSetButtonMode('invite');},2000);}}else{this.inviSetButtonMode('login');}};TransmissionGUI.prototype.invShowInvitation=function(login,type,desc,tokens,time){$("#invitation-popup .login").html(login);if(type==2)
$("#invitation-popup .type").show();else
$("#invitation-popup .type").hide();$("#invitation-popup .desc").html(desc);$("#invitation-popup .tokens").html(tokens);$("#invitation-popup .time").html(time);$("#invitation-popup").show("slow");makeSound();};TransmissionGUI.prototype.invHideInvitation=function(){$("#invitation-popup").hide("slow");};TransmissionGUI.prototype.invAcceptInvitation=function(){this.invHideInvitation();transmission.sendInvitationDecision("accept");};TransmissionGUI.prototype.invDeclineInvitation=function(){this.invHideInvitation();transmission.sendInvitationDecision("decline");};TransmissionGUI.prototype.invInvitationDeclined=function(){this.invHideInvitation();this.inviSetButtonMode('declined');};TransmissionGUI.prototype.invInvitationCanceled=function(){this.invHideInvitation();};TransmissionGUI.prototype.invInvitationStatus=function(status){if(status=="tooLittleTokens"){this.inviSetButtonMode('tokens');var o=this;setTimeout(function(){o.inviSetButtonMode('invite');},2000);}else if(status=="alreadyInvited"){var o=this;this.inviSetButtonMode('alreadyInvited');setTimeout(function(){o.inviSetButtonMode('invite');},4000);}else if(status=="invited"){this.inviSetButtonMode('pending');}else if(status=="pubExists"){this.inviSetButtonMode('pubExists');}};TransmissionGUI.prototype.inviSetButtonMode=function(mode){var o=this;if(this.buttonTimer!=null)
clearTimeout(this.buttonTimer);$('#inviteButton2').removeClass();$('#inviteButton2').addClass('generic-pink-btn');$('#private-popup .gray-btn').show();switch(mode){case'invite':$('#inviteButton2').html(lang['p-invi-invite']);$('#inviteButton2').removeClass().addClass('generic-pink-btn');break;case'login':$('#inviteButton2').html(lang['p-invi-login']);$('#inviteButton2').addClass('rejected-transmission');break;case'declined':$('#inviteButton2').html(lang['p-invi-rejected']);$('#inviteButton2').addClass('rejected-transmission');this.buttonTimer=setTimeout(function(){o.inviSetButtonMode('invite');},30000);break;case'pending':$('#inviteButton2').html(lang['p-invi-pending']);$('#inviteButton2').addClass('pending-transmission');$('#private-popup .gray-btn').hide();break;case'tokens':$('#inviteButton2').html(lang['p-invi-tokens']);$('#inviteButton2').addClass('rejected-transmission');this.buttonTimer=setTimeout(function(){o.inviSetButtonMode('invite');},10000);break;case'alreadyInvited':$('#inviteButton2').html(lang['p-invi-already']);$('#inviteButton2').addClass('rejected-transmission');break;case'notemplate':$('#inviteButton2').html(lang['p-invi-notemplate']);$('#inviteButton2').addClass('rejected-transmission');this.buttonTimer=setTimeout(function(){o.inviSetButtonMode('invite');},10000);break;case'pubExists':$('#inviteButton2').html(lang['p-invi-pubexists']);$('#inviteButton2').addClass('rejected-transmission').css('margin-top','5px');this.buttonTimer=setTimeout(function(){o.inviSetButtonMode('invite');},10000);break;default:break;}
this.buttonMode=mode;};TransmissionGUI.prototype.inviClicked=function(){if(this.buttonMode=='invite')
this.invSendInvitation();};TransmissionGUI.prototype.modInit=function(){this.modMinReqTime=500;this.modReqTime=10000;this.showIfOffline=false;this.searchingUserID=-1;this.modInterval=null;this.modDontSendReq=false;addPackageListener(packetController.EVT_NEW_PACKAGE,G_T_MESSAGE,this.modAddListener.bind(this));addPackageListener(packetController.EVT_NEW_PACKAGE,G_T_VIEWERS_LIST_FAILURE,this.modRequestFailure.bind(this));var o=this;o.modResetList();pubTabs.events.addEventListener(pubTabs.EVT_CHANGE,function(a){if(a.name=='viewers')
o.modStartRequests();else
o.modStopRequests();});$('#findUserButton').click(function(){if(!o.modDontSendReq){o.showIfOffline=false;o.modResetList();o.modStartRequests();o.modDisableSending();}});$("#findUserInput").enterKey(function(){if(!o.modDontSendReq){o.showIfOffline=false;o.modResetList();o.modStartRequests();o.modDisableSending();}});$("#findUserInput").change(function(){o.showIfOffline=false;o.modInputChanged();});$("#findAllButton").click(function(){if(!o.modDontSendReq){o.showIfOffline=false;$("#findUserInput").val('');o.modResetList();o.modStartRequests();o.modDisableSending();o.modInputChanged();}});};TransmissionGUI.prototype.modInputChanged=function(){if($("#findUserInput").val()!=''){$("#findUserInput").width('50%');$("#findAllButton").show();}else{$("#findUserInput").width('70%');$("#findAllButton").hide();}};TransmissionGUI.prototype.modRequestFailure=function(){var o=this;setTimeout(function(){o.modResetList();o.modStartRequests();},500);};TransmissionGUI.prototype.modResetList=function(){$('#userslist').html('<li class="wait">'+lang['please-wait']+'</li>');if(typeof transmission!='undefined'){transmission.viewersList=new Array();$('#scrollbar-viewers').tinyscrollbar_update('relative');}};TransmissionGUI.prototype.modDisableSending=function(){this.modDontSendReq=true;var o=this;$("#findUserButton").prop('disabled','disabled');setTimeout(function(){o.modDontSendReq=false;$("#findUserButton").removeAttr('disabled');},this.modMinReqTime);};TransmissionGUI.prototype.modStartRequests=function(){this.modStopRequests();packetController.send(S_T_GET_VIEWERS,$('#findUserInput').val().toLowerCase());this.modInterval=setInterval(function(){packetController.send(S_T_GET_VIEWERS,$('#findUserInput').val().toLowerCase());},this.modReqTime);};TransmissionGUI.prototype.modStopRequests=function(){if(this.modInterval!=null)
clearInterval(this.modInterval);};TransmissionGUI.prototype.modAddListener=function(p){var o=this;setTimeout(function(){$("#chatView li").click(function(){o.showIfOffline=true;o.searchingUserID=$(this).attr("uid");$('#findUserInput').val($(this).attr("login"));pubTabs.set('viewers');o.modInputChanged();});},500);};TransmissionGUI.prototype.modAction=function(uid,login,action){switch(action){case'kick':transmission.transKick(uid);break;case'mute':transmission.transMute(uid);break;case'unmute':transmission.transUnMute(uid);break;case'ban':var answer=confirm(lang['p-confirm']);if(answer)
transmission.transBan(uid,login);break;case'unban':break;default:break;}};TransmissionGUI.prototype.modSetUserStats=function(){if(pubTabs.currentTab=='viewers')
$('#scrollbar-viewers').tinyscrollbar_update('relative');};TransmissionGUI.prototype.modGotList=function(us){$('#userslist .wait').remove();};TransmissionGUI.prototype.modShowIfOffline=function(){if(this.showIfOffline&&$("#userslist").html()==''){this.modAddUser(this.searchingUserID+'[:]'+$('#findUserInput').val(),true);}};TransmissionGUI.prototype.modAddUser=function(us,offline){var u=us.split("[:]");$("#uid"+u[0]).remove();var offlineText='';if(offline)
offlineText=' <span style="color:grey;">(offline)</span>';var html='<li login="'+u[1]+'" id="uid'+u[0]+'">'+u[1]+offlineText;html+='<span class="user-actions">';if(u[0]!=user.uid){html+='<a href="javascript:void(0)" onclick="transmissionGUI.modAction(\''+u[0]+'\',\''+u[1]+'\',\'kick\')" class="gray-btn">'+lang['p-kick']+'</a>';html+='<a href="javascript:void(0)" onclick="transmissionGUI.modAction(\''+u[0]+'\',\''+u[1]+'\',\'mute\')" class="gray-btn mut">'+lang['p-mute']+'</a>';html+='<a href="javascript:void(0)" onclick="transmissionGUI.modAction(\''+u[0]+'\',\''+u[1]+'\',\'unmute\')" class="gray-btn unmut" style="display:none;">'+lang['p-unmute']+'</a>';html+='<a href="javascript:void(0)" onclick="transmissionGUI.modAction(\''+u[0]+'\',\''+u[1]+'\',\'ban\')" class="gray-btn">'+lang['p-ban']+'</a>';}
html+='</span>';html+='</li>';$("#userslist").append(html);};TransmissionGUI.prototype.modRemoveUser=function(u){var user=u.split("[:]");$("#uid"+user[0]).remove();};TransmissionGUI.prototype.modMuteUser=function(uid){$("#uid"+uid).prepend('<div class="muted"></div>');$("#uid"+uid+" .mut").hide();$("#uid"+uid+" .unmut").show();};TransmissionGUI.prototype.modUnMuteAll=function(){$("#userslist .unmut").hide();$("#userslist .mut").show();$("#userslist li").each(function(){$(this).find('.muted').remove();});};TransmissionGUI.prototype.banInit=function(){var o=this;$('#blockedFindButton').click(function(){o.banRenderBannedList();});$('#blockedFindInput').enterKey(function(){o.banRenderBannedList();});$("#blockedFindAllButton").click(function(){$('#blockedFindInput').val('');o.banRenderBannedList();});};TransmissionGUI.prototype.banInputChanged=function(){if($("#blockedFindInput").val()!=''){$("#blockedFindInput").width('50%');$("#blockedFindAllButton").show();}else{$("#blockedFindInput").width('70%');$("#blockedFindAllButton").hide();}};TransmissionGUI.prototype.banRenderBannedList=function(){$("#bannedlist").html('');var value=$('#blockedFindInput').val().toLowerCase();this.banInputChanged();for(var i=0;i<transmission.bannedList.length;i++){var user=transmission.bannedList[i].split("[:]");if(value==""||user[1].toLowerCase().indexOf(value)!=-1){var html='<li id="ban_uid'+user[0]+'">'+user[1];html+='<span class="user-actions">';html+='<a href="javascript:void(0)" onClick="transmission.transUnBan('+user[0]+', \''+user[1]+'\');" class="gray-btn">'+lang['p-unban']+'</a>';html+='</span>';html+='</li>';$("#bannedlist").append(html);}}
$('#scrollbar-blocked').tinyscrollbar({sizethumb:21});};TransmissionGUI.prototype.banUnBan=function(uid){$("#ban_uid"+uid).remove();};TransmissionGUI.prototype.mutInit=function(){var o=this;$('#blockedFindButton').click(function(){o.mutRenderMutedList();});$('#blockedFindInput').enterKey(function(){o.mutRenderMutedList();});$("#blockedFindAllButton").click(function(){$('#blockedFindInput').val('');o.mutRenderMutedList();});};TransmissionGUI.prototype.mutRenderMutedList=function(){$("#mutedlist").html('');var value=$('#blockedFindInput').val().toLowerCase();for(var i=0;i<transmission.mutedList.length;i++){var user=transmission.mutedList[i].split("[:]");if(value==""||user[1].toLowerCase().indexOf(value)!=-1){var html='<li id="muted_uid'+user[0]+'">'+user[1];html+='<span class="user-actions">';html+='<a href="javascript:void(0)" onClick="transmissionGUI.mutUnMute(\''+user[0]+'\',\''+user[1]+'\')" class="gray-btn">'+lang['p-unmute']+'</a>';html+='</span>';html+='</li>';$("#mutedlist").append(html);}}
$('#scrollbar-muted').tinyscrollbar({sizethumb:21});};TransmissionGUI.prototype.mutUnMute=function(uid,login){transmissionGUI.modAction(uid,login,'unmute');$("#muted_uid"+uid).remove();};TransmissionGUI.prototype.repInit=function(){this.currLogin='';this.currMsg='';};TransmissionGUI.prototype.repOpen=function(msgID){var elem=$('#chatView').find('li[id='+msgID+']');this.currLogin=$(elem).attr('login');this.currMsg=$(elem).find('.message').html();$('#report-popup .description').html('"'+this.currLogin+': '+this.currMsg+'"');$('#report-popup').css('display','block').fadeTo('slow',1);};TransmissionGUI.prototype.repClose=function(){this.currLogin='';this.currMsg='';$('#report-popup').fadeTo('slow',0,function(){$('#report-popup').css('display','none');});};TransmissionGUI.prototype.repReport=function(){if(this.currLogin!=''&&this.currMsg!=''){packetController.sendArray(S_T_WARN,[transmission.transUser.login,this.currLogin,this.currMsg]);this.repClose();}};function ChatAdvert(){if(typeof chatAdvSettings=="undefined")return;this.turnedOn=chatAdvSettings.enabled;this.minViewers=chatAdvSettings.minViewers;this.adverts=new Array();for(var i=0;i<chatAdvList.length;i++){this.adverts[this.adverts.length]=new AdvertMsg(chatAdvList[i].author,chatAdvList[i].msg,chatAdvList[i].forSex,chatAdvList[i].repeats,chatAdvList[i].specified);}
this.timeInterval=[chatAdvSettings.randTimeFrom*1000,chatAdvSettings.randTimeTo*1000];this.target=chatAdvSettings.target;this.timer=null;if(this.turnedOn){this.prepareAdverts();this.run();}};ChatAdvert.prototype.prepareAdverts=function(){var temp=new Array();if(typeof this.adverts=="undefined")return;if(this.target=="all"||(this.target=="guests"&&!user.isLogged)||(this.target=="users"&&user.isLogged)){for(var i=0;i<this.adverts.length;i++){if(this.adverts[i]!=null&&(this.adverts[i].forSex=="all"||this.adverts[i].forSex==user.sex))
temp[temp.length]=this.adverts[i];}}
this.adverts=temp;};ChatAdvert.prototype.run=function(){if(this.timer!=null){if(transmission.nTotalViewers>=this.minViewers&&this.adverts.length!=0){var advIndex=Math.floor(Math.random()*this.adverts.length);var advert=this.adverts[advIndex];chatAdvertGUI.show(advert);advert.displayed++;if(advert.displayed>=advert.repeats){this.adverts.splice(advIndex);}}}
var random=Math.floor(Math.random()*(this.timeInterval[1]-this.timeInterval[0]))+this.timeInterval[0];this.timer=setTimeout(this.run.bind(this),random);};function AdvertMsg(author,msg,forSex,repeats,specified){this.author=author;this.msg=msg;this.forSex=forSex;this.specified=specified;this.repeats=repeats;this.displayed=0;};var chatAdvert;$(function(){setTimeout(function(){chatAdvert=new ChatAdvert();},2000);});function ChatAdvertGUI(){};ChatAdvertGUI.prototype.show=function(advert){if(!advert.specified)
var html='<li login="unknown" uid="-1" id="-1"><span class="author guest">'+advert.author+': </span><span class="message">'+advert.msg+'</span></li>';else
var html='<li login="unknown" uid="-1" id="-1"><span class="author advert">'+advert.author+': </span><span class="message">'+advert.msg+'</span></li>';$("#chatView").append(html);$('#scrollbar-chat').tinyscrollbar_update('bottom');transmissionGUI.msgID++;};var chatAdvertGUI;$(function(){chatAdvertGUI=new ChatAdvertGUI();});function TransBotList(){this.refreshInterval=false;this.running=true;if($.cookie("hidebotlist")&&$.cookie("hidebotlist")=="true"){this.running=false;}
if(this.running)
this.start();};TransBotList.prototype.start=function(forceFirstRequest){this.running=true;$.cookie("hidebotlist","false",{expires:14});var o=this;this.lastListRequest=new Date().getTime();if(forceFirstRequest)
o.listRequest();this.refreshInterval=setInterval(function(){if(new Date().getTime()-o.lastListRequest>110000){o.lastListRequest=new Date().getTime();o.listRequest();}},120000);};TransBotList.prototype.stop=function(){this.running=false;if(this.refreshInterval)
clearInterval(this.refreshInterval);$.cookie("hidebotlist","true",{expires:14});transBotListGUI.clear();};TransBotList.prototype.listRequest=function(){this.running=true;$.getJSON(siteUrl+'/site/trans_list/get_list/bottom',function(data){var html='';$.each(data,function(k,v){var card=false;if(typeof this.card!="undefined"&&this.card>1)
card=this.card;html+=transBotListGUI.getHtml(this.username,this.viewers,this.small_img,card,this.images);});transBotListGUI.render(html);});};var transBotList;$(function(){transBotList=new TransBotList();});function TransBotListGUI(){if($.cookie("category")){this.setCategory($.cookie("category"),true);}else
this.setCategory('female',true);this.setHideShowButtonStatus();var o=this;$("#filter_action").click(function(){o.hideShow();});};TransBotListGUI.prototype.setHideShowButtonStatus=function(){if(!transBotList.running){$("#filter_action img").prop('src','images/down-arrow.png');}else{$("#filter_action img").prop('src','images/up-arrow.png');}};TransBotListGUI.prototype.hideShow=function(){if(transBotList.running){transBotList.stop();}else{transBotList.start(true);}
this.setHideShowButtonStatus();};TransBotListGUI.prototype.setCategory=function(cat,withoutReq){$('#filter_all').removeClass('current');$('#filter_male').removeClass('current');$('#filter_female').removeClass('current');$('#filter_'+cat).addClass('current');listCategories.setCategory(cat);if(!withoutReq){if(!transBotList.running)
this.hideShow();else
transBotList.listRequest();}};TransBotListGUI.prototype.clear=function(){$("#transList").html('');};TransBotListGUI.prototype.getHtml=function(username,viewers,small_img,card,images){var shortUname=username;if(username.length>11)
shortUname=username.substr(0,11)+"...";var c='';if(card){c='<div class="warn-card card'+card+'" style="position:absolute;"></div>';}
var html='<div class="stream">';html+='<div class="stream-frame">';html+='<a href="'+siteUrl+'/'+username+'" title="">'+c+'<img class="lazy" data-original="files/'+small_img+'.jpg" src="images/grey.gif" imgdata="'+images+'" width="132" height="99"/></a>';html+='<a href="'+siteUrl+'/'+username+'" title="" class="stream-overlay"></a>';html+='<div class="stream-meta">';html+='<a href="'+siteUrl+'/'+username+'" title="">';html+='<span class="stream-name">'+shortUname+'</span>';html+='<span class="stream-viewers">'+viewers+'</span>';html+='</a>';html+='</div>';html+='</div>';html+='</div>';return html;};TransBotListGUI.prototype.render=function(html){$("#transList").html(html);$('img.lazy').lazyload();this.addNextImageListener();};TransBotListGUI.prototype.nextImage=function($obj,$img){var imagesArr=$img.attr('imgdata').split(',');if(imagesArr.length>1){for(var i=0;i<imagesArr.length-1;i++){imagesArr[i]=location.protocol+'//static.showup.tv/files/'+imagesArr[i];}
if(!$img.attr('preloaded')){for(var i=0;i<imagesArr.length-1;i++){var im=new Image();im.src=imagesArr[i];}
$img.attr('preloaded','1');}
$obj.find('a.stream-overlay').css('display','none');if($img.attr('src')==$img.attr('data-original')||$img.attr('src')=='images/grey.gif'){$img.attr('src',imagesArr[0]);}else{var changed=false;for(var i=0;i<imagesArr.length-1;i++){if(imagesArr[i]==$img.attr('src')&&i<imagesArr.length-2){$img.attr('src',imagesArr[i+1]);changed=true;break;}}
if(!changed)
$img.attr('src',imagesArr[0]);}}};TransBotListGUI.prototype.startNextImage=function($obj,$img){this.stopNextImage($obj,$img);var o=this;this.nextImageTimer=setInterval(function(){o.nextImage($obj,$img);},1000);};TransBotListGUI.prototype.stopNextImage=function($obj,$img){if(this.nextImageTimer!=null)
clearInterval(this.nextImageTimer);$obj.find('a.stream-overlay').css('display','');$img.attr('src',$img.attr('data-original'));};TransBotListGUI.prototype.addNextImageListener=function(){var o=this;$("#transList .stream").mouseenter(function(){o.startNextImage($(this),$(this).find('img.lazy'));}).mouseleave(function(){o.stopNextImage($(this),$(this).find('img.lazy'));});};var transBotListGUI;$(function(){transBotListGUI=new TransBotListGUI();transBotListGUI.addNextImageListener();});function PubTabs(){this.currentTab='chat';this.EVT_CHANGE=0;this.events=new Event();};PubTabs.prototype.set=function(n){if(!transmission.joined)
return;this.currentTab=n;$('#chat-tab').removeClass("current");$('#viewers-tab').removeClass("current");$('#blocked-tab').removeClass("current");$('#'+n+'-tab').addClass("current");$('#chat-pane').hide();$('#viewers-pane').hide();$('#blocked-pane').hide();$('#'+n+'-pane').show();if(n=='chat')
$('#scrollbar-'+n).tinyscrollbar_update('bottom');else
$('#scrollbar-'+n).tinyscrollbar_update('relative');this.events.performEvent(this.EVT_CHANGE,{name:n});};var pubTabs;$(function(){pubTabs=new PubTabs();});function TransResize(){this.videoCount=1;this.initListeners();this.previousePageX=0;this.EVT_RESIZE=0;this.EVT_RESIZE_END=1;this.events=new Event();this.dontEnlarge=false;this.startAreaWidth=$('#resize-area').width();this.currentWidth=$('#resize-left').width();};TransResize.prototype.init=function(){if($.cookie("transsize_16_9")){this.setNewWidth($.cookie("transsize_16_9"));this.setVideoSize();}else{}};TransResize.prototype.initListeners=function(){$('#resize-handle').bind('mousedown',this.mouseDown.bind(this));};TransResize.prototype.mouseDown=function(event){$('html, body').animate({scrollTop:$("#resize-left").offset().top-50},300);$('#video').width(230);$('#video').height(172);if(this.videoCount==2){$('#video2').width(230);$('#video2').height(172);}
$('body').bind('mousemove',this.mouseMove.bind(this));$('body').bind('mouseup',this.mouseUp.bind(this));return false;};TransResize.prototype.mouseUp=function(){$('body').unbind('mousemove');$('body').unbind('mouseup');this.setVideoSize();$.cookie("transsize_16_9",this.currentWidth,{expires:31});this.events.performEvent(this.EVT_RESIZE_END);};TransResize.prototype.setVideoSize=function(){$('#video').width('100%');$('#video').height('100%');if($('#video2')){$('#video2').width('100%');$('#video2').height('100%');}};TransResize.prototype.mouseMove=function(event){var offsetX=$('#resize-left').offset().left;var x=event.pageX-offsetX-20;this.setNewWidth(x);};TransResize.prototype.enlarge=function(){if(Number(this.currentWidth)+10-65<550){this.setNewWidth(Number(this.currentWidth)+10);$.cookie("transsize_16_9",this.currentWidth,{expires:31});this.events.performEvent(this.EVT_RESIZE_END);}};TransResize.prototype.setNewWidth=function(newWidth){if(newWidth<501)
newWidth=501;newWidth=Math.round(newWidth);if(this.currentWidth<newWidth&&this.dontEnlarge)
return;this.currentWidth=newWidth;$('#resize-left').width(newWidth);var newHeight=Math.round((newWidth*3)/4);$('#cameraWindow').height(newHeight);$('#resize-left').height($('#cameraWindow').height()+38+30);if(this.videoCount==2){$('#cameraWindow2').height(newHeight);$('#resize-left').height($('#resize-left').height()+$('#cameraWindow2').height());}else
$('#cameraWindow2').height(newHeight);newHeight+=38;if(this.videoCount==2){$('#resize-handle').height(newHeight*2-37);}else{$('#resize-handle').height(newHeight);}
this.events.performEvent(this.EVT_RESIZE,{width:newWidth,height:newHeight});var newChatWidth=newWidth-65;if(newChatWidth<436)
newChatWidth=436;if(newChatWidth>550)
newChatWidth=550;$('#resize-right').width(newChatWidth);$('#resize-area').width($('#resize-left').width()+$('#resize-handle').width()+$('#resize-right').width()+71);this.centralizeArea();};TransResize.prototype.centralizeArea=function(){var width=$('#resize-area').width()-40;var diff=Math.round((width-this.startAreaWidth)/2);$('#resize-area').css('margin-left',-diff+'px');var offset=$('#resize-area').offset();this.dontEnlarge=(offset.left<=15);if(this.dontEnlarge)
this.setNewWidth(this.currentWidth+offset.left-16);};TransResize.prototype.setVideoCount=function(count){this.videoCount=count;this.refresh();};TransResize.prototype.refresh=function(){this.setNewWidth(this.currentWidth);};var transResize;$(function(){transResize=new TransResize();});
Legginsomaniak, fan lodzików i nie jestem hakerem, wybijcie sobie to z głowy ;x
Voldemort Szołapka :sarcastic_blum:
AllMyLinks = wszystkie linki w jednym miejscu
Awatar użytkownika
Fapka
Night's Watch
Night's Watch
Posty: 1478
Rejestracja: 04 mar 2017, 11:09
Lokalizacja: śląskie
Podziękował: 102 razy
Podziękowano mu: 173 razy
Co masz w Majtkach?: Dick
Twoja ulubienica z SU: VeronikaVirt
Anal?: Nie
Nick na ShowUp.tv: Fappi i niepubliczne


Wróć do Szukam



Użytkownicy przeglądający to forum: Obecnie na forum nie ma żadnego zarejestrowanego użytkownika i 15 gości