R34.XXX Favorites Button

Adds a favorite button to gallery pages on rule34.xxx.

2022/03/02のページです。最新版はこちら。

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください。
// ==UserScript==
// @name         R34.XXX Favorites Button
// @namespace    https://linktr.ee/GanbatGAN
// @version      1.1
// @description  Adds a favorite button to gallery pages on rule34.xxx.
// @author       Ganbat
// @match        https://rule34.xxx/index.php?page=post&s=list&tags=*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=rule34.xxx
// @grant        GM_addStyle
// @require      http://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js
// @license      Unlicense
// ==/UserScript==

/* globals $ */

GM_addStyle ( `
    .galFavBtn {
        cursor: pointer;
        color: #009;
    }
    .galFavBtn:hover {
        color: #000;
    }
` );

(function() {
    'use strict';

    $('.thumb').each(function() {
        var postLink = $(this).children("a").first();
        var postID = $(this).attr('id').substring(1);
        postLink.after('<br /><div><b class="galFavBtn" onclick="post_vote(\''+ postID +'\', \'up\'); addFav(\''+ postID +'\'); $(this).parentElement.hide(); return false;">Add to Favorites</b></div>');
    });
})();