Greasy Fork 支持简体中文。

LibraryThing which of my books tagged

On any site-wide tag page, shows which one's own books have been tagged that way (without having to page through)

目前為 2015-07-30 提交的版本,檢視 最新版本

// ==UserScript==
// @name        LibraryThing which of my books tagged
// @namespace   https://greasyfork.org/en/users/11592-max-starkenburg
// @description On any site-wide tag page, shows which one's own books have been tagged that way (without having to page through)
// @include     http*://*librarything.com/tag/*
// @include     http*://*librarything.tld/tag/*
// @version     2
// ==/UserScript==

// Some variables
var cataloglink = document.getElementById("masttab_books");
var username = cataloglink ? cataloglink.getAttribute("href").substr(9) : null; // The chunk after "/catalog/"
var params = "{v: 1.0, width: 500, height: 650, modal: false}";

// Bring in the CSS for the tagmirror lightbox
var link = document.createElement("link");
    link.setAttribute("rel","stylesheet");
    link.setAttribute("href","/css/tagmirror.css");
    link.setAttribute("type","text/css");
document.getElementsByTagName("head")[0].appendChild(link);

// Add a "my books" link to the tag page
if (username) {
    var tagnumber = document.getElementsByName("fromtag")[0].getAttribute("value");
    var myBooks = document.createElement('span');
    myBooks.className = "my-books-tagged";
    var tagText = document.getElementsByName("fromtagtext")[0].getAttribute("value");
    myBooks.innerHTML = '(<a href="javascript:LibraryThing.lightbox.ajax(\'/ajax_tagmirror_tagtobooks.php?view='+username+'&tag='+tagnumber+'\', '+params+')">My books globally tagged '+tagText+'</a>)';
    var aka = document.getElementsByClassName("alsoknownas")[0];
    aka.nextSibling.appendChild(myBooks);
}