Guest User

Untitled

a guest
Jan 14th, 2012
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.65 KB | None | 0 0
  1. if(window.location.pathname.indexOf("viewprofilepage") != -1){
  2. if(!localStorage.getItem("ignored")){
  3. var setupignored = [];
  4. setupignored.push("filler01");
  5. setupignored.push("filler02");
  6. localStorage.setItem("ignored", JSON.stringify(setupignored));
  7. }
  8.  
  9. var thisUser = $('.viewprofilepagebanner .login-bold').html();
  10. var ignored = [];
  11. ignored = JSON.parse(localStorage.getItem("ignored"));
  12. for (x=0;x<ignored.length;x++) {
  13. if (thisUser == ignored[x]) {
  14. var unhateButton = document.createElement('a');
  15. $(unhateButton).css({'cursor':'pointer', 'color':'white', 'font-size':'22px'});
  16. $(unhateButton).html(" ☺");
  17. $(unhateButton).addClass('unfucker');
  18. $(unhateButton).attr('title', 'Click to remove from ignore');
  19. $('.viewprofilepagebanner .UserName').parent().append(unhateButton);
  20. }
  21. }
  22. if($.inArray(thisUser, ignored) == -1) {
  23. var hateButton = document.createElement('a');
  24. $(hateButton).css({'cursor':'pointer', 'color':'white', 'font-size':'8px'});
  25. $(hateButton).html(' ▼');
  26. $(hateButton).addClass('fucker');
  27. $(hateButton).attr('title', 'Click to hide all posts from this asshole.');
  28.  
  29. $('.viewprofilepagebanner .UserName').parent().append(hateButton);
  30. }
  31.  
  32. $('.fucker').live("click", function(){
  33. $(this).html(" ☺").css('font-size','22px');
  34. $(this).addClass("unfucker");
  35. $(this).removeClass("fucker");
  36. var irritant = $(this).parent().find('.login-bold').html();
  37. var ignored = [];
  38.  
  39. ignored = JSON.parse(localStorage.getItem("ignored"));
  40.  
  41. ignored.push(irritant);
  42. localStorage.setItem("ignored", JSON.stringify(ignored));
  43. });
  44.  
  45. $('.unfucker').live("click", function(){
  46. $(this).html(" ▼").css('font-size','8px');
  47. $(this).addClass("fucker");
  48. $(this).removeClass("unfucker");
  49. var irritant = $(this).parent().find('.login-bold').html();
  50. var ignored = [];
  51. ignored = JSON.parse(localStorage.getItem("ignored"));
  52. var index = $.inArray(irritant, ignored);
  53. ignored.splice(index,1);
  54. localStorage.setItem("ignored", JSON.stringify(ignored));
  55. });
  56.  
  57.  
  58.  
  59. if($('.UserProfileSummary').find('.login-bold').html() == $('#viewUserProfile').html()){
  60. var clearignore = document.createElement('a');
  61. $(clearignore).attr("id", "clearignore");
  62. $(clearignore).html("clear ignore list");
  63. $(clearignore).css({"font-size":"10px", "text-decoration":"none", "cursor":"pointer"});
  64. $('.UserProfileSummary').append(clearignore);
  65. $("#clearignore").click(function(){
  66. localStorage.removeItem("ignored");
  67. });
  68. }
  69. }
  70.  
  71.  
  72.  
  73. $('.lia-list-row').each(function(){
  74. var ignored = [];
  75. ignored = JSON.parse(localStorage.getItem("ignored"));
  76. var user = $(this).find('.UserName').find('.login-bold').html();
  77. for (x=0;x<ignored.length;x++) {
  78. if (user == ignored[x]) {
  79. $(this).hide();
  80. }
  81. }
  82.  
  83. });
  84.  
  85. $('.lia-quilt-forum-message').each(function(){
  86. var ignored = [];
  87. ignored = JSON.parse(localStorage.getItem("ignored"));
  88. var user = $(this).find('.UserName').find('.login-bold').html();
  89. for (x=0;x<ignored.length;x++) {
  90. if (user == ignored[x]) {
  91. $(this).hide();
  92. var showhidden = document.createElement('a');
  93. $(showhidden).css({'cursor':'pointer', 'color':'white'});
  94. $(showhidden).html("ignored user - click to view");
  95. $(showhidden).addClass('defucker');
  96. $(showhidden).attr('title', 'Click to remove from ignore');
  97. $(this).parent().append(showhidden);
  98. $('.defucker').live("click", function(){
  99. $(this).parent().find('.lia-quilt-forum-message').show();
  100. $(this).html("click again to re-hide");
  101. $(this).addClass("refucker");
  102. $(this).removeClass("defucker");
  103. });
  104. $('.refucker').live("click", function(){
  105. $(this).parent().find('.lia-quilt-forum-message').hide();
  106. $(this).html("ignored user - click to view");
  107. $(this).addClass("defucker");
  108. $(this).removeClass("refucker");
  109. });
  110. }
  111. }
  112.  
  113. });
Advertisement
Add Comment
Please, Sign In to add comment