远景回复特效

在 Discuz! 论坛回帖时,给回复加上小小的特效!

// ==UserScript==
// @name         远景回复特效
// @namespace    http://bbs.pcbeta.com/
// @description  在 Discuz! 论坛回帖时,给回复加上小小的特效!
// @author       stiger & qyh1206
// @match        https://www.52pojie.cn/thread-*.html
// @match        https://www.52pojie.cn/forum.php?mod=viewthread&tid=*
// @match        https://www.right.com.cn/forum/thread-*.html
// @match        https://www.right.com.cn/forum/forum.php?mod=viewthread&tid=*
// @match        https://bbs.kafan.cn/thread-*.html
// @match        https://bbs.kafan.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        http://bbs.pcbeta.com/thread-*.html
// @match        http://bbs.pcbeta.com/forum.php?mod=viewthread&tid=*
// @match        http://bbs.pcbeta.com/viewthread-*.html
// @match        https://bbs.pcbeta.com/thread-*.html
// @match        https://bbs.pcbeta.com/forum.php?mod=viewthread&tid=*
// @match        https://bbs.pcbeta.com/viewthread-*.html
// @match        https://bbs.pcbeta.com/forum.php?mod=viewthread&tid=*
// @match        http://bbs.huorong.cn/thread-*.html
// @match        http://bbs.huorong.cn/forum.php?mod=viewthread&tid=*
// @match        https://bbs.huorong.cn/thread-*.html
// @match        https://bbs.huorong.cn/forum.php?mod=viewthread&tid=*
// @match        https://iya.app/thread-*.html
// @match        https://iya.app/forum.php?mod=viewthread&tid=*
// @match        https://www.dospy.wang/thread-*.html
// @match        https://www.dospy.wang/forum.php?mod=viewthread&tid=*
// @match        http://www.aihao.cc/thread-*.html
// @match        http://www.aihao.cc/forum.php?mod=viewthread&tid=*
// @match        https://www.aihao.cc/thread-*.html
// @match        https://www.aihao.cc/forum.php?mod=viewthread&tid=*
// @version      1.6
// @grant        none
// @icon         https://i.postimg.cc/W4n0ZY8Q/image.png
// @license      GPL-3.0
// ==/UserScript==
//

//unsafeWindow
//     *forum.php?mod=viewthread&tid=*
//     *viewthread.php?tid=*
//     *thread*.html



var str=""+"\n [size=3][color=#DC143C]            [/color][/font][/size]"+"\n\n [size=1][color=#778899][align=right]  Windows 10 专业预览版 【Win Next ◆ [color=red] 20161.1000.rs [/color]】 [/align][/color][/font][/size]"+"\n [size=1][color=#778899][align=right] Google Chrome【Chromium [color=red] 86.0.4193.0 [/color]】 [/align][/color][/font][/size]"+"\n [size=1][color=#778899][align=right] Intel(R)Core(TM)CPU【I9-9900ks @ 4.50 GHz】 [/align][/color][/font][/size]";

var strs="[color=blue][b]     [/b][/color]";

$("fastpostmessage").onfocus = function (){
    $("fastpostmessage").style.background = 'none';
    if ($("fastpostmessage").value === ''){

        $("fastpostmessage").value=str;
    }
};


var up_re = document.getElementById ("post_reply");
//mouseenter
up_re.addEventListener ("click", function (event){
    setTimeout (function () {$("postmessage").value = str;}, 500);
});




var down_re = document.getElementById ("post_replytmp");
//mouseenter
down_re.addEventListener ("click", function (event){
    setTimeout (function () {$("postmessage").value = str;}, 500);
});


// 不加 event 也可以
//down_re.addEventListener ("click", function (){
//   setTimeout (function () {$("postmessage").value = "你好";}, 500);
// });



var side_re = document.getElementsByClassName ("replyfast")[0];

//mouseenter
side_re.addEventListener ("click", function ( event ) {
    document.getElementsByClassName ("replyfast")[0].click ();
    setTimeout (function (){$("postmessage").value = str;}, 500);
}, false);


var middle_re = document.getElementsByClassName ("fastre");
for (var i = 0; i < middle_re.length; i++) {
    middle_re [i].addEventListener ("click", function (){setTimeout (function (){$("postmessage").value = str;}, 500);});
}


var cmt_re = document.getElementsByClassName ("cmmnt");
for (var c = 0; i < cmt_re.length; i++) {
    cmt_re [i].addEventListener ("click", function (){setTimeout (function (){$("commentmessage").value = strs;}, 500);});
}