Always Show Copy and Edit Buttons

Make copy and edit buttons always visible on Lambda Chat

スクリプトをインストールするには、Tampermonkey, GreasemonkeyViolentmonkey のような拡張機能のインストールが必要です。

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

スクリプトをインストールするには、TampermonkeyViolentmonkey のような拡張機能のインストールが必要です。

スクリプトをインストールするには、TampermonkeyUserscripts のような拡張機能のインストールが必要です。

このスクリプトをインストールするには、Tampermonkeyなどの拡張機能をインストールする必要があります。

このスクリプトをインストールするには、ユーザースクリプト管理ツールの拡張機能をインストールする必要があります。

(ユーザースクリプト管理ツールは設定済みなのでインストール!)

このスタイルをインストールするには、Stylusなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus などの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus tなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

(ユーザースタイル管理ツールは設定済みなのでインストール!)

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください
// ==UserScript==
// @name         Always Show Copy and Edit Buttons
// @namespace    http://tampermonkey.net/
// @version      0.3
// @license MIT
// @description  Make copy and edit buttons always visible on Lambda Chat
// @match        https://lambda.chat/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    // Function to modify buttons visibility
    function makeButtonsVisible() {
        // Select all copy button containers
        const copyButtons = document.querySelectorAll('.invisible.md\\:group-hover\\:visible');
        
        // Select all edit/branch buttons with the specific classes
        const editButtons = document.querySelectorAll('.group-hover\\:block.md\\:hidden');

        // Make copy buttons visible
        copyButtons.forEach(button => {
            button.classList.remove('invisible');
            button.classList.add('visible');
            button.style.opacity = '1';
        });

        // Make edit buttons visible
        editButtons.forEach(button => {
            button.classList.remove('md:hidden');
            button.style.display = 'block';
            // Remove group-hover:block since we want it always visible
            button.classList.remove('group-hover:block');
        });
    }

    // Run initially
    makeButtonsVisible();

    // Create observer to handle dynamically added buttons
    const observer = new MutationObserver(() => {
        makeButtonsVisible();
    });

    // Start observing the document for added nodes
    observer.observe(document.body, {
        childList: true,
        subtree: true
    });
})();