Chicken Smoothie: Add Rename Group Button

Adds a second "rename this group" button inside the group form 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 inside the group form 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 completely
    window.addEventListener('load', function() {
        // Find the form element where the group dropdown is located
        const groupForm = document.querySelector('form[name="gotogroup"]'); // Select the form by name attribute

        if (groupForm) {
            // Create a new "Rename Group" button
            const renameButton = document.createElement('button');
            renameButton.textContent = 'Rename This Group';
            renameButton.style.marginLeft = '10px'; // Space out from other form elements
            renameButton.style.padding = '5px 10px';
            renameButton.style.cursor = 'pointer';
            renameButton.style.backgroundColor = '#4CAF50'; // Green background
            renameButton.style.color = 'white';
            renameButton.style.border = 'none';
            renameButton.style.borderRadius = '5px';

            // Event listener for the "Rename" button
            renameButton.addEventListener('click', function() {
                // Trigger renaming behavior (you can adjust this as needed)
                alert('This would be the renaming functionality.');
                // Replace this alert with your renaming logic, such as a prompt or form.
            });

            // Append the new button inside the form, after the group dropdown
            groupForm.appendChild(renameButton);
        } else {
            console.log('Could not find the form element on the page.');
        }
    });
})();