Put Bookmarks Button on AO3 Home

Puts the "Bookmarked Fics" button on the home page of AO3.

当前为 2022-02-16 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)


    // ==UserScript==
    // @name         Put Bookmarks Button on AO3 Home
    // @namespace    https://greasyfork.org/en/users/876643-elli-lili-lunch
    // @version      0.1
    // @description  Puts the "Bookmarked Fics" button on the home page of AO3.
    // @author       Elli-lili-lunch, based off "Put Marked for Later Button on AO3 Home v0.2" JaneBuzJane
    // @match        http://archiveofourown.org/*
    // @match        https://archiveofourown.org/*
    // @match        http://archiveofourown.org/works*
    // @match        https://archiveofourown.org/works*
    // @require      http://ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js
    // @require      https://code.jquery.com/jquery-2.2.4.js
    // @run-at      document-idle
    // @grant        none
    // @license MIT
    // ==/UserScript==
     
    var $j = jQuery.noConflict();
     
    $j(document).ready(function() {
     
        // From https://greasyfork.org/en/scripts/406616-ao3-no-rekudos/code
    var greeting, username;
    greeting = document.getElementById('greeting'); 
    username = greeting.querySelector('a').href;
        
        // From https://stackoverflow.com/questions/43742732/use-javascript-or-jquery-to-create-an-href-url-using-variables-passed-in-through
    var dynamicContent = "archiveofourown.org";
    var username = ""+username+"";
    var url = ""+username+"/bookmarks";
    $('#container').html('<a href="'+url+'">Bookmarked Fics</a>');
     
     
        // From https://stackoverflow.com/questions/1145208/how-to-add-a-list-item-to-an-existing-unordered-list
    $("ul.primary.navigation.actions").append('<li><a href="'+url+'"><span class="dropdown-toggle">Bookmarked Fics</span></a></li>');
        
    });