Advertisement
drchloe

Mewch Post Hiding Feature

Aug 5th, 2018
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //HIDER CSS
  2. var showposts = 30;
  3. setTimeout(function () {
  4.     if (window.location.href.indexOf('res') !== -1) {
  5.         dostuff();
  6.     }
  7. }, 1000);
  8.  
  9. function dostuff() {
  10.     var hider = document.createElement('style');
  11.     var magic = '.board-container .hider:after{content:"Show Hidden Posts"; color:red;} .board-container .hider:checked{content:"Hide Posts";} .board-container .hider:not(:checked) + .thread-container div:not(:nth-last-child(-n+'+showposts+')){display:none;} .thread-container .post-container:nth-child(1){display:block !important;}';
  12.     hider.innerHTML = magic;
  13.     document.head.appendChild(hider);
  14.    
  15.     var cssbutton = document.createElement('input');
  16.     cssbutton.className = 'hider';
  17.     cssbutton.style = 'width: 260px;';
  18.     cssbutton.type = 'checkbox';
  19.     var parent = document.getElementsByClassName('board-container')[0]
  20.     parent.insertBefore(cssbutton, document.getElementsByClassName('thread-container')[0]);
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement