Advertisement
Farbjodr

Del own message

May 14th, 2015
330
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name         Del own message
  3. // @version      0.1
  4. // @description  made it not add duplicate to others messages. EDIT: PARTIALLY WORKING. PLUG CHANGED HTML. Edit: should work again
  5. // @author       Ravana
  6. // @match        https://plug.dj/*
  7. // @require http://code.jquery.com/jquery-latest.js
  8. // ==/UserScript==
  9.  
  10. setTimeout(function() {
  11.     var currentUser=API.getUser().id;
  12.     API.on(API.CHAT,function(data){
  13.         if(currentUser!=data.uid)return;
  14.         $("[data-cid="+data.cid+"]").prepend('<div class="delete-button own-message">Erase</div>');
  15.         $("[data-cid="+data.cid+"]").mouseenter(function(){$(this).children().first().css("display","block")});
  16.         $("[data-cid="+data.cid+"]").mouseleave(function(){$(this).children().first().css("display","none")});
  17.         $(".own-message").click(function(){API.moderateDeleteChat($(this).parent().attr("data-cid"))});
  18.     })
  19. },10000);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement