See Podfic First

moves the AO3 inspired by links to the top of the page

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

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

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

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

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

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.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name         See Podfic First
// @version      0.1.1
// @description  moves the AO3 inspired by links to the top of the page
// @author       GodOfLaundryBaskets
// @include      http*://archiveofourown.org/*works*
// @require      http://code.jquery.com/jquery-3.5.1.min.js
// @grant        none
// @license MIT
/* globals jQuery, $, waitForKeyElements */
// @namespace https://greasyfork.org/users/1164278
// ==/UserScript==


function addPodficsOnSamePage() {
    const children = Array.from(document.querySelectorAll('div.children'));
    if (!children.length) {
        return false;
    }
    $("div.notes").first().append("<br />").append(children);
    $("p.jump").first().remove();
    return true;
}

function addPodficsAtEndOfWork() {
    const jumpBlock = Array.from(document.querySelectorAll('p.jump'));

    if (!jumpBlock.length || !jumpBlock[0].textContent.includes("other works inspired by this one")) {
        return false;
    }

    $(jumpBlock).css("font-weight", "bold")
    $(jumpBlock).css("background-color", "#e2e2e2");;
}

$( document ).ready(function() {
    'use strict';
    var added = addPodficsOnSamePage();

    if(!added) {
        addPodficsAtEndOfWork()
    }
});