SHARE
TWEET

IEX Ignore

a guest Apr 26th, 2017 204 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name IEX Forum Script
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description If you ignore it, it'll go away!
  6. // @author You
  7. // @match https://www.iex.nl/Forum/*
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. (function() {
  12. 'use strict';
  13.  
  14. // vul hier de forum-id's in die je wilt negeren tussen dubbele quotes met een comma gescheiden dus: "1234","4321" etc.
  15. var ignored = ["1229994"];
  16. var showFn = function(e) {e.target.nextSibling.style.display = "block"; e.target.parentNode.removeChild(e.target);};
  17. var posts = document.getElementsByClassName("ForumPost");
  18. for (var i = 0; i < posts.length; i++) {
  19.     var post = posts[i];
  20.     var userBox = posts[i].getElementsByClassName("UserName")[0];
  21.     var userId = userBox.getAttribute("href").match(/Leden\/(\d+)\//)[1];
  22.     for (var j = 0; j < ignored.length; j++){
  23.         if (userId == ignored[j]) {
  24.             var content = post.getElementsByClassName("Post")[0];
  25.             content.style.display = "none";
  26.             userBox.innerText += " [ignored]";
  27.             var showBtn = document.createElement("span");
  28.             showBtn.innerText = "[show]";
  29.             showBtn.addEventListener("click", showFn);
  30.             content.parentNode.insertBefore(showBtn, content);
  31.             break;
  32.         }
  33.     }
  34. }})();
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top