Advertisement
Guest User

Ignore Goodjers

a guest
Aug 9th, 2010
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name           Ignore Goodjers
  3. // @namespace      gwj
  4. // @description    Increases the number of potential Tannhauserings
  5. // @include        http://www.gamerswithjobs.com/node/*
  6. // @require       http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js
  7. // ==/UserScript==
  8.  
  9. // Add/remove users in this list to ignore/unignore them
  10. var usersToIgnore = [
  11.     "Floomi",
  12.     "Bonus_Eruptus"
  13. ];
  14.  
  15. // Strip out newlines from class names. Seems to screw up jQuery's selectors
  16. function FixClassNames() {
  17.     $("*").each(function(){
  18.         var node = $(this).get(0);
  19.        
  20.         node.className = node.className.replace(/\s+/, ' ').replace(/(^\s+|\s+$)/, '');
  21.     });
  22. }
  23.  
  24. $(document).ready(function() {
  25.     FixClassNames();
  26.    
  27.     $(".gwj_unignore").live('click', function(){
  28.         var linksDiv = $(this).closest("div.links");
  29.         linksDiv.next("div.comment").show();
  30.         linksDiv.remove();
  31.     });
  32.  
  33.     $.each(usersToIgnore, function(i, val){
  34.         $("div.author-name:contains('" + val + "')").closest("div.comment").each(function(){
  35.             var comment = $(this);
  36.            
  37.             comment.hide();
  38.             comment.before('<div class="links"><ul class="links"><li><a class="gwj_unignore"><strong>Did ' + val + ' Tannhauser me?</strong></a></li></ul></div>');
  39.         });
  40.     });
  41. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement