AO3: Hide Summaries

Hides summaries by default, and adds a button to show them

15.09.2022 itibariyledir. En son verisyonu görün.

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

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

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

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

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Zateb bir user-style yöneticim var, yükleyeyim!)

// ==UserScript==
// @name         AO3: Hide Summaries
// @description  Hides summaries by default, and adds a button to show them
// @version      1.0

// @author       Nexidava
// @namespace    https://greasyfork.org/en/users/725254

// @match        *://*.archiveofourown.org/*
// @require      https://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js
// @grant        none
// @license      GPL-3.0 <https://www.gnu.org/licenses/gpl.html>
// ==/UserScript==

var hideSummaries = true;

function setSummaries($, button, hide) {
    var summaries = $("blockquote.summary")
    if(hide) {
        button.prop("value", "Show Summaries")
        summaries.hide()
    } else {
        button.prop("value", "Hide Summaries")
        summaries.show()
    }
}

function toggleSummaries($, button) {
    hideSummaries = !hideSummaries;
    setSummaries($, button, hideSummaries);
    button.blur()
}

(function($) {
    var button = $('<input class="button" type="button" value="Show Summaries" style="margin:0.3em">')
    setSummaries($, button, hideSummaries)
    button.click(x => { toggleSummaries($, button) })
    $("li.search").prepend(button)
})(jQuery);