鲨鱼默认隐藏mediainfo

默认隐藏mediainfo

// ==UserScript==
// @name 鲨鱼默认隐藏mediainfo
// @namespace https://sharkpt.net
// @icon https://sharkpt.net/favicon.ico
// @version 1.0
// @description 默认隐藏mediainfo
// @match https://sharkpt.net/details.php?*
// @require https://cdn.staticfile.org/jquery/3.6.4/jquery.min.js
// @author freefrank
// @license MIT
// ==/UserScript==

(function () {
    'use strict';

    $(document).ready(function () {
        // Find the target element
        const targetElement = $('td.rowfollow[valign="top"][align="left"] > div.nexus-media-info-raw');

        // Create and add the show/hide button
        const button = $('<button>').text('Show').css('margin-bottom', '5px');
        targetElement.before(button);

        // Hide the target element by default
        targetElement.hide();

        // Toggle the visibility of the target element when the button is clicked
        button.on('click', function () {
            targetElement.toggle();
            if (button.text() === 'Show') {
                button.text('Hide');
            } else {
                button.text('Show');
            }
        });
    });
})();