Chicken Smoothie: Add Rename Group Button

Adds a second "rename this group" button to the group dropdown menu on Chicken Smoothie

当前为 2025-04-23 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         Chicken Smoothie: Add Rename Group Button
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  Adds a second "rename this group" button to the group dropdown menu on Chicken Smoothie
// @author       You
// @match        https://www.chickensmoothie.com/accounts/viewgroup.php?*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    // Wait for the page to load and the necessary DOM elements to be available
    window.addEventListener('load', function() {
        const groupDropdown = document.querySelector('#groupDropdown'); // The dropdown menu containing the group selector
        const groupInfoArea = document.querySelector('.groupInfo'); // This could be a container where buttons exist

        if (groupDropdown && groupInfoArea) {
            // Create the new "Rename Group" button
            const renameButton = document.createElement('button');
            renameButton.textContent = 'Rename This Group';
            renameButton.style.marginLeft = '10px'; // Space between original button and new button
            renameButton.style.padding = '5px 10px';
            renameButton.style.cursor = 'pointer';

            // Event listener to trigger renaming functionality
            renameButton.addEventListener('click', function() {
                // Logic for renaming the group goes here (show input form, etc.)
                alert('This is where the renaming form would pop up.');
                // You can replace this alert with an actual implementation of renaming
            });

            // Insert the new button next to the group dropdown
            groupInfoArea.appendChild(renameButton);
        }
    });
})();