Gallery Mode for Lists - RateYourMusic

Creates a toggleable gallery for RYM lists.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name        Gallery Mode for Lists - RateYourMusic
// @namespace   Violentmonkey Scripts
// @match       https://rateyourmusic.com/list/*
// @grant       none
// @version     1.1
// @author      ~iN008
// @description Creates a toggleable gallery for RYM lists.
// ==/UserScript==

//Adds button to the right of likes, creates a gallery section hidden by default
$(".fav1.subtext").after("<div class='gallerybutton btn btn_small blue_btn' style=margin-left:1em>Toggle Gallery</div>");
$("div.row").append("<clear/><div class=gallery style=display:none;width:100%;clear:both;padding:1.5em;text-align:center></div>");

//Populates gallary with list images, removes any blanks and spaces accordingly
$("td.list_art").clone().removeClass('list_art').addClass('gallerymode').appendTo("div.gallery"); 
$("td.gallerymode:empty").remove();
$(".gallerymode").find("br", "span:empty").remove();
$(".gallerymode").children().width("150px");
$("td.gallerymode").each(function(){
    so_class = $(this).attr("class");
    so_val = $(this).html();
    so_new = $("<span style=display:inline-block;margin-right:0.3em;width:150px></span>").html(so_val);
    if (so_class.length > 0) {
        $(so_new).attr("class",so_class);
    }
    $(this).replaceWith(so_new);
});

//Toggle function
$("div.gallerybutton").click(function() {
  $("div.gallery").toggle();
});