Greasy Fork

Greasy Fork is available in English.

论坛大师・Discuz!

论坛大师(简体中文)・Discuz!

当前为 2020-04-10 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         Forum Master・Discuz!
// @name:zh-CN   论坛大师・Discuz!
// @name:zh-HK   論壇大師・Discuz!
// @name:zh-TW   論壇大師・Discuz!
// @namespace    Forum Master・Discuz!
// @icon         https://www.discuz.net/favicon.ico
// @version      0.0.1
// @description  Forum Master - 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://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=*
// @grant        none
// ==/UserScript==

(function () {
    'use strict';

    // Your code here...

    // Cascading Style Sheets
    const style_tag_100 = document.createElement('style');
    style_tag_100.innerHTML = `
        .a_t, .a_pt {
            display: none;
        }

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

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

        .pls .avatar {
            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;
        }

        .avtm img {
            width: 60px;
        }
    `
    document.head.appendChild(style_tag_100);

    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);
})();