Advertisement
Guest User

cutucada

a guest
May 28th, 2016
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.45 KB | None | 0 0
  1. window.location.pathname.match(/\/u\d+/) && $(function() {
  2. if (!_userdata.session_logged_in) return;
  3. var lang = {
  4. poke : 'Cutucar',
  5. message : 'Você foi cutucado !'
  6. },
  7. a = document.createElement('DIV'), b = poke(window.location.pathname.match(/u(\d+)/)[1], document.title.match(/.*? - (.*)/)[1]), c = document.getElementById('profile-advanced-right') || document.getElementById('page-body');
  8. a.style.textAlign = 'right';
  9. a.appendChild(b);
  10. c.insertBefore(a,c.firstChild);
  11.  
  12. if (window.location.pathname.match(/wall/) && $('.message-footer').length) {
  13. for (var i = 0, c = $('.message-footer'); i<c.length; i++) {
  14. var d = document.createElement('LI'), e = poke($('.message-header:eq('+i+') a').attr('href').match(/u(\d+)/)[1], $('.message-header:eq('+i+') a').text());
  15. d.appendChild(e);
  16. c[i].insertBefore(d,c[i].firstChild);
  17. }
  18. }
  19.  
  20. function poke(id, unm) {
  21. var a = document.createElement('A');
  22. if (id == _userdata.user_id) return a;
  23. a.href = '/privmsg?mode=post_profile&u=' + id;
  24. a.innerHTML = lang.poke;
  25. a.className = 'pokie';
  26. a.onclick = function(e) {
  27. var id = this.href.match(/u=(\d+)/)[1];
  28. e.preventDefault();
  29. $.post('/privmsg?mode=post_profile',{
  30. subject : lang.poke,
  31. message : lang.message,
  32. username : unm,
  33. post : 1
  34. },function() { window.location.pathname = '/u' + id + 'wall' });
  35. };
  36. return a;
  37. };
  38. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement