Void_Knight

RbxDev "improver"

Jul 20th, 2014
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name        ROBLOX Developer Forum Improver
  3. // @namespace   http://the-tavern.eu/Vorlias
  4. // @description Fixes the ROBLOX developer forum
  5. // @include     http://developer.roblox.com/forum/*
  6. // @version     1.0.1.0
  7. // @grant       none
  8. // ==/UserScript==
  9.  
  10.  
  11. var settings =
  12. {
  13.     useLoungeHider: true, // Makes the Lounge topics less... obvious.
  14.     fullyHideLounge: false // Hide lounge posts completely (Needs useLoungeHider enabled)
  15.        && this.useLoungeHider,
  16.    
  17.     blockSignatures: true, // Block images/spoilers in signatures
  18.     fixGrammar: true, // Fix the hideous grammar the forum has
  19.     removeAdColumn: true, // Removes the ad column on the side, giving more forum room
  20.     ignoreUsers: [ // ignore this user's posts/threads
  21.     ],
  22. }
  23.  
  24. var imgs = $('.kmsgsignature .kmsgimage'); // annoying images
  25. var sigs = $('.kmsgsignature .kspoiler'); // spoilers
  26.  
  27.  
  28. if (settings.blockSignatures)
  29. {
  30.  
  31.     for (var i = 0; i < imgs.length; i++)
  32.     {
  33.         var obj = $(imgs[i]);
  34.         obj.html("[<b>Signature image blocked</b>]");
  35.  
  36.     }
  37.  
  38.     for (var i = 0; i < sigs.length; i++)
  39.     {
  40.         var signature = $(sigs[i]).parent().parent().parent()
  41.         signature.html("[<b>Spoiler blocked</b>]");
  42.     }
  43.  
  44. }
  45.  
  46. if (settings.removeAdColumn)
  47. {
  48.     // Remove that pointless right column
  49.     $('#right-col').remove();
  50.     $('#middle-col').css("width", "97%");
  51. }
  52.  
  53.  
  54.  
  55. if (settings.fixGrammar)
  56. {
  57.     // Remove the annoying grammar mistakes... ugh.
  58.     var tys = $('.kmessage-thankyou');
  59.  
  60.  
  61.     for (var i = 0; i < tys.length; i++)
  62.     {
  63.         var src = $(tys[i]);
  64.         var oldHTML = src.html();
  65.  
  66.         // "and has also been thanked by ## other(s)" would have been better - but nevermind.
  67.         // Seems whoever wrote this forum software has really terrible english
  68.         var re = /and this user have (\d+) others thankyou/;
  69.         oldHTML = oldHTML.replace(re, "+ $1 other(s)");
  70.         // 'said' is the wrong context, they were thanked without actual posts saying "thank you".
  71.         oldHTML = oldHTML.replace(/The following user\(s\) said Thank You:/,"Users that have thanked this post: ");
  72.         src.html(oldHTML);
  73.     }
  74. }
  75.  
  76.  
  77.     var authors = $('.kwho-user');
  78.     for (var i = 0; i < authors.length; i++)
  79.     {
  80.         var elem = $(authors[i]);
  81.         var user = elem.text();
  82.  
  83.         for (var j = 0;j < settings.ignoreUsers.length; j++)
  84.         {
  85.             var val = settings.ignoreUsers[j];
  86.             if (val.toLowerCase() === user.toLowerCase())
  87.                 elem.parent().parent().parent().parent().remove();
  88.         }
  89.     }
  90.  
  91. var is_recent = document.location.toString().search(/\/forum\/recent/g);
  92. if (is_recent !== -1 && settings.useLoungeHider)
  93. {
  94.  
  95.    
  96.    
  97.     var results = $('.ktopic-category a');
  98.     for (var i = 0; i < results.length; i++)
  99.     {
  100.         var result = $(results[i]);
  101.         if (result.html() === "Lounge")
  102.         {
  103.            var parent = result.parent().parent().parent().parent();
  104.            
  105.            if (settings.fullyHideLounge)
  106.            {
  107.                parent.css('display','none');
  108.            }else{
  109.                parent.css('color', '#AAAAAA');
  110.                //parent.find('td').css('background-color','#FFDDDD');
  111.                parent.find(".ktopic-posted-time").html("");
  112.                parent.find(".ktopic-category").css("display","none");
  113.                parent.find("[rel='follow']").attr("style","color:#AAAAAA !important;");
  114.                parent.find("[rel='nofollow']").attr("style","color:#AAAAAA !important;");
  115.                
  116.                var title = parent.children('.kcol-mid').children('.ktopic-title-cover').children('.ktopic-title');
  117.                 title.html(title.html() + " <font style='color:red;font-size:12px;'>[ Off Topic ]</font>");
  118.            }
  119.         }
  120.     }
  121. }
Advertisement
Add Comment
Please, Sign In to add comment