Put Marked for Later Button on AO3 Home

Puts the "Marked for Later" button on the home page of AO3.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         Put Marked for Later Button on AO3 Home
// @namespace    https://greasyfork.org/en/users/773998
// @version      0.2
// @description  Puts the "Marked for Later" button on the home page of AO3.
// @author       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
// ==/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+"/readings?show=to-read";
$('#container').html('<a href="'+url+'">Marked for Later</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">Marked for Later</span></a></li>');
    
});