Chicken Smoothie: Add Rename Group Button

Adds a second "rename this group" button inside the group form on Chicken Smoothie

目前為 2025-04-23 提交的版本,檢視 最新版本

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

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

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

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

你需要先安裝一款使用者腳本管理器擴展,比如 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.');
        }
    });
})();