ao3 work block

permanently hide works that you've blocked

目前為 2016-06-02 提交的版本,檢視 最新版本

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         ao3 work block
// @namespace    https://greasyfork.org/en/users/36620
// @version      0.1.5
// @description  permanently hide works that you've blocked
// @author       scriptfairy
// @match        http*://archiveofourown.org/*works*
// @require      http://ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js
// @grant        GM_setValue
// @grant        GM_listValues
// ==/UserScript==

(function($) {
    function blockThis(work) {
        var id = $(work).attr('id');
        GM_setValue(id, id);
    }
    function blockAll() {
        var ids = GM_listValues();
        for (j=0;j<ids.length;j++) {
            $('li.blurb#'+ids[j]).hide();
        }
    }
    $(document).ready(function() {
        blockAll();
        var works = $('li.blurb');
        for (i=0;i<works.length;i++) {
            $(works[i]).find('.datetime').prepend('<a href="javascript:void(0);">Block</a>');
        }
        $('.datetime a').click(function() {
            blockThis($(this).parents('li.blurb'));
            $(this).parents('li.blurb').hide();
        });
    });
})(window.jQuery);