Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- // PD4 Chat Menu Customizer
- // Created by Serlite
- //
- // - Hides chat menu options via CSS so unused items won't be accidentally clicked
- // - To hide an item, add the item number to the array "chatItemsToHide". Items are as follows:
- // 1: (Unrelated)
- // 2: Message
- // 3: Tip
- // 4: Add to my friends
- // 5: View stats
- // 6: Ignore
- // 7: Mute (mods only)
- */
- loadjQuery();
- initializeAugs();
- var chatItemsToHide = [4, 6];
- // Adds jQuery to document if needed
- function loadjQuery(){
- if (!window.jQuery){
- var script = document.createElement("SCRIPT");
- script.src = 'https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js';
- script.type = 'text/javascript';
- document.getElementsByTagName("head")[0].appendChild(script);
- }
- }
- function initializeAugs(){
- // Give time for jQuery to load
- if (!window.jQuery){
- setTimeout(initializeAugs, 500);
- }
- else{
- if (chatItemsToHide.length > 0){
- var selectorList = "";
- for (var i = 0; i < chatItemsToHide.length; i++){
- if (i > 0){
- selectorList += ",";
- }
- selectorList += "ul.chat__channel__message__tool-tip li:nth-child(" + chatItemsToHide[i] + ")";
- }
- jQuery("head").append(
- '<style>'+
- ' ' + selectorList + '{'+
- ' display:none;'+
- ' }'+
- '</style>'
- );
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement