soup.io: Display hidden elements

Shows hidden reactions, reposts, icons and dates on soup.io pages

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name soup.io: Display hidden elements
// @namespace    http://xcvbnm.org/
// @author Nordern
// @description Shows hidden reactions, reposts, icons and dates on soup.io pages
// @version 4.1
// @match http://*.soup.io/*
// @match https://*.soup.io/*
// @license public domain
// ==/UserScript==
/* 
 * Available on github under: https://github.com/edave64/souplements/blob/master/showHiddenElements.js
 * Using the infinite scrolling support template: https://github.com/edave64/souplements/blob/master/infiniteScrollingTemplate.js
 */
 
(function () {
    function customCode () {
        [].forEach.call(
            document.querySelectorAll('.hide-reposted-by,.icons.hidden,.date.hidden,.hide-tags'),
            function (ele) {
                ele.classList.remove('hide-reposted-by');
                ele.classList.remove('hide-tags');
                ele.classList.remove('hidden');
            }
        );
    }

    // Reduces calls to customCode by limiting it to execute once per javascript activity and stops it from calling
    // itself.
    var _runner = null;
    function runDelayed () {
        if (_runner === null) {
            _runner = setTimeout(function () {
                try {
                    customCode();
                } finally {
                    _runner = null;
                }
            }, 0);
        }
    }
    function register () {
        customCode();
        new MutationObserver(runDelayed).observe(
            document.getElementById('contentcontainer'), {
                childList: true,
                subtree: true
            }
        );
    }
    // Is the soup page already loaded? This allows the custom code to run as both a bookmarklet and a userscript.
    if (document.getElementById('contentcontainer')) {
        register();
    } else {
        document.addEventListener("load", register);
    }
}());