Advertisement
Farbjodr

Hide message

Jul 26th, 2015
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name         Hide Message
  3. // @version      0.2
  4. // @description  Works for messages that have cid, or extplug notifications
  5. // @author       Ravana
  6. // @match        https://plug.dj/*
  7. // @require http://code.jquery.com/jquery-latest.js
  8. // ==/UserScript==
  9.  
  10. setTimeout(function() {
  11.     API.on(API.CHAT,function(data){
  12.         if(data.cid){
  13.             $("[data-cid="+data.cid+"]> > .bdg").click(function(e){
  14.                 if(e.ctrlKey){
  15.                     if($(this).parent().parent().hasClass("extplug-deleted")){
  16.                         $(this).parent().parent().remove();
  17.                     } else {
  18.                         $(this).parent().parent().css("opacity","0.8");
  19.                         $(this).click(function(e){
  20.                             if(e.ctrlKey){
  21.                                 $(this).parent().parent().remove();
  22.                             }
  23.                         });
  24.                     }
  25.                 }
  26.             });
  27.         } else {
  28.             $(".extplug-notification").last().click(function(e){
  29.                 if(e.ctrlKey){
  30.                     $(this).remove();
  31.                 }
  32.             });
  33.         }
  34.     })
  35. },10000);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement