Greasy Fork

Greasy Fork is available in English.

论坛大师・Discuz! 界面美化、隐藏广告、功能增强、回帖强显……

论坛大师(简体中文)・Discuz! 界面美化、隐藏广告、功能增强、回帖强显……

目前为 2020-04-11 提交的版本。查看 最新版本

// ==UserScript==
// @name         Forum Master・Discuz! Beautified interface, Hidden ads, Enhanced functions.
// @name:en      Forum Master・Discuz! Beautified interface, Hidden ads, Enhanced functions.
// @name:zh      论坛大师・Discuz! 界面美化、隐藏广告、功能增强、回帖强显……
// @name:zh-CN   论坛大师・Discuz! 界面美化、隐藏广告、功能增强、回帖强显……
// @name:zh-HK   論壇大師・Discuz! 界面美化、隱藏廣告、功能增強、回帖強顯……
// @name:zh-TW   論壇大師・Discuz! 界面美化、隱藏廣告、功能增強、回帖強顯……
// @namespace    Forum Master・Discuz!
// @homepage     http://greasyfork.icu/scripts/400250
// @version      0.0.1
// @icon         https://www.discuz.net/favicon.ico
// @description  Forum Master - Discuz! Beautify the interface, hide ads, enhance functions.
// @description:en    Forum Master - Discuz! Beautify the interface, hide ads, enhance functions.
// @description:zh    论坛大师(中文)・Discuz! 界面美化、隐藏广告、功能增强、回帖强显……
// @description:zh-CN 论坛大师(简体中文)・Discuz! 界面美化、隐藏广告、功能增强、回帖强显……
// @description:zh-HK 論壇大師(繁体中文)・Discuz! 界面美化、隱藏廣告、功能增強、回帖強顯……
// @description:zh-TW 論壇大師(繁体中文)・Discuz! 界面美化、隱藏廣告、功能增強、回帖強顯……
// @author       hostname
// @match        https://www.discuz.net/thread-*.html
// @match        https://www.discuz.net/forum.php?mod=viewthread&tid=*
// @match        https://www.52pojie.cn/thread-*.html
// @match        https://www.52pojie.cn/forum.php?mod=viewthread&tid=*
// @match        https://hostloc.com/thread-*.html
// @match        https://hostloc.com/forum.php?mod=viewthread&tid=*
// @match        https://www.hostloc.com/thread-*.html
// @match        https://www.hostloc.com/forum.php?mod=viewthread&tid=*
// @match        https://bbs.kafan.cn/thread-*.html
// @match        https://bbs.kafan.cn/forum.php?mod=viewthread&tid=*
// @match        http://bbs.pcbeta.com/thread-*.html
// @match        http://bbs.pcbeta.com/viewthread-*.html
// @match        http://bbs.pcbeta.com/forum.php?mod=viewthread&tid=*
// @match        https://bbs.pcbeta.com/thread-*.html
// @match        https://bbs.pcbeta.com/viewthread-*.html
// @match        https://bbs.pcbeta.com/forum.php?mod=viewthread&tid=*
// @match        http://www.gebi1.com/thread-*.html
// @match        http://www.gebi1.com/forum.php?mod=viewthread&tid=*
// @match        http://bbs.wuyou.net/thread-*.html
// @match        http://bbs.wuyou.net/forum.php?mod=viewthread&tid=*
// @match        http://wuyou.net/thread-*.html
// @match        http://wuyou.net/forum.php?mod=viewthread&tid=*
// @grant        unsafeWindow
// @grant        GM_addStyle
// @supportURL   http://greasyfork.icu/scripts/400250
// @license      MIT
// ==/UserScript==

(function () {
    'use strict';

    // Cascading Style Sheets・Global
    GM_addStyle(`
        body, table, input, button, select, textarea, a {
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei New", "Microsoft Yahei", "WenQuanYi Micro Hei", "Noto Sans CJK", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
        }

        .mono, .md, .code, .pre, .tt, mono, md, code, pre, tt,
        .blockcode ol li {
            font-family: "Fira Code", Hack, "Source Code Pro", SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", "Microsoft YaHei Mono", "WenQuanYi Zen Hei Mono", "Noto Sans Mono CJK", monospace !important;
        }

        .ads {
            display: none;
        }

        #um .avt img {
            border-radius: 50%;
        }

        #um .avt img:hover {
            border-radius: 0;
        }

        .pls .avatar {
            padding-top: 1px;
            text-align: center;
        }

        .pls .avatar img {
            width: 120px;
            height: 120px;
            border-radius: 50%;
            padding: 0;
            border: 4px solid #ffffff;
            box-shadow: 0 0 4px #cccccc;
        }

        .pls .avatar img:hover {
            border-radius: 0;
        }

        .pls .m img {
            width: 120px;
            height: 120px;
        }
    `);

    // Cascading Style Sheets・www.52pojie.cn
    GM_addStyle(`
        .dnch_eo_pt,
        .dnch_eo_pb {
            display: none;
        }
    `);

    // Cascading Style Sheets・www.hostloc.com
    GM_addStyle(`
        .a_h,
        .a_t,
        .a_pt,
        .a_pb {
            display: none;
        }

        #hiddenpoststip {
            padding: 0;
        }

        #hiddenpoststip a {
            height: 32px;
            line-height: 32px;
            font-size: 16px;
        }

        #hiddenpoststip a:hover {
            color: #f33;
        }

        #hiddenpoststip a::before {
            padding-right: 16px;
            content: "🌜";
        }
        #hiddenpoststip a::after {
            padding-left: 16px;
            content: "🌛";
        }
    `);

    // Cascading Style Sheets・bbs.pcbeta.com
    GM_addStyle(`
        #diynavtop {
            display: none;
        }
    `);

    const attachContent = '[img]https://www.fb.com/security/hsts-pixel.gif[/img]';

    const fastPostMessage = document.getElementById('fastpostmessage');

    function editor_content() {
        let fastPostMessageContent = fastPostMessage.value;
        if (fastPostMessageContent && fastPostMessageContent.length < 10) {
            fastPostMessageContent = fastPostMessageContent.trim();
            fastPostMessage.value = fastPostMessageContent.concat('\n\n', attachContent);
        }
    }

    fastPostMessage.removeAttribute('onkeydown');

    fastPostMessage.addEventListener('keydown', function (event) {
        if (event.ctrlKey && event.which === 13) {
            editor_content();
            seditor_ctlent(event, 'fastpostvalidate($(\'fastpostform\'))');
        }
        if (event.altKey && event.which === 83) {
            editor_content();
            seditor_ctlent(event, 'fastpostvalidate($(\'fastpostform\'))');
        }
    }, false);

    document.getElementById('fastpostsubmit').addEventListener('click', editor_content, false);
})();