15// ==UserScript== 15// @name New Userscript 15// @namespace http://tampermonkey.net/ 15// @version 0.1 15// @description try to take over the world! 15// @author You 15// @match https://nullnyan.net/* 15// @grant none 15// ==/UserScript== 10window.Hide15 =15 { 15 board:15 05/\/(\w+)\/?/i.exec(10window.location.pathname)[021], 15 toggleThread:15 (opNum,15 keepRecord)15 =>15 { 15 02let15 op15 =15 _.id(05`05P05${opNum05}05`); 15 02let15 board15 =15 10window.Hide.board; 15 02if15 (op)15 { 15 02let15 thread15 =15 op.parentNode; 15 !localStorage.hiddenThreads15 &&15 localStorage.setItem(05'hiddenThreads',15 05'{"placeholder": true}'); 15 15/* Fuck javascript */ 15 02let15 wholeHiddenList15 =15 10JSON.parse(localStorage.hiddenThreads); 15 02let15 thisBoardHiddenList15 =15 wholeHiddenList[board]15 ||15 {}; 15 !!thisBoardHiddenList[opNum]15 ?15 (!keepRecord15 ?15 06delete15 thisBoardHiddenList[opNum]15 :15 06void(020))15 :15 thisBoardHiddenList[opNum]15 =15 02true; 15 wholeHiddenList[board]15 =15 thisBoardHiddenList; 15 localStorage.setItem(05'hiddenThreads',15 10JSON.stringify(wholeHiddenList)); 15 thread.style.display15 =15 (thread.style.display15 ==15 05'none'?05'':05'none'); 15 } 15 }, 15 init:15 ()15 =>15 { 15 02let15 board15 =15 10window.Hide.board; 15 02if15 (!!localStorage.hiddenThreads)15 { 15 02for15 (02let15 num15 06in15 10JSON.parse(localStorage.hiddenThreads)[board])15 10window.Hide.toggleThread(num,15 02true); 15 } 15 } }; Hide.init();15 15// Everything except media is loaded 15//window.addEventListener('load', Hide.init); // Page is fully loaded