巴哈姆特之收藏前確認

為了我每次都手殘點到收藏的朋友而做,可以防止誤觸收藏按鈕。

目前為 2018-12-05 提交的版本,檢視 最新版本

// ==UserScript==
// @name         巴哈姆特之收藏前確認
// @description  為了我每次都手殘點到收藏的朋友而做,可以防止誤觸收藏按鈕。
// @namespace    nathan60107
// @version      1.0
// @author       nathan60107(貝果)
// @homepage     https://home.gamer.com.tw/homeindex.php?owner=nathan60107
// @include      https://forum.gamer.com.tw/C*
// ==/UserScript==

FORUM_homeBookmark = function(e, t, o, a, n, i, r, s, l) {
    Dialogify.confirm('確定要收藏?',{
        ok: function(){
            if (!forum_chkLogin()) return !1;
            let a1 = encodeURIComponent(a);
            if ("G2" == e) var c = encodeURIComponent("http://forum.gamer.com.tw/G2.php?bsn=" + t + "&sn=" + o);
            else var c = encodeURIComponent("http://forum.gamer.com.tw/Co.php?bsn=" + t + "&sn=" + o);
            var p = "";
            if (egg("#cf" + o + " a[name=attachImgName]:first").attr("id") && (p = egg("#cf" + o + " a[name=attachImgName]:first").attr("id"), p.match(/^https?:\/\/truth\.bahamut\.com\.tw\//) || (p = "")), "" == p) {
                var g = egg("#avatar_fpath" + o).attr("src");
                p = g.replace(/\?x=\d{10}$/g, "")
            }
            console.log("title=" + a1 + "&url=" + c + "&dcc1=" + n + "&dcc2=" + i + "&dctype=" + r + "&dcmachine=" + s + "&gname=" + encodeURIComponent(l) + "&nopic=" + p + "&_t=" + Date.now());
            return egg.ajax({
                url: "/ajax/home_bookmark.php",
                success: FORUM_homeBookmark_getdata,
                param: "title=" + a1 + "&url=" + c + "&dcc1=" + n + "&dcc2=" + i + "&dctype=" + r + "&dcmachine=" + s + "&gname=" + encodeURIComponent(l) + "&nopic=" + p + "&_t=" + Date.now(),
                method: "GET"
            }), !1
        }
    });
}