Google Slides Custom Plus Button

Add a custom button to Google Slides toolbar for additional features

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

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

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

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

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==UserScript==
// @name         Google Slides Custom Plus Button
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  Add a custom button to Google Slides toolbar for additional features
// @author       Your Name
// @match        https://docs.google.com/presentation/d/*
// @grant        none
// @run-at       document-end
// ==/UserScript==

(function() {
    'use strict';

    // Function to create and add a custom button to the toolbar
    const addCustomButton = () => {
        const toolbar = document.querySelector('[aria-label="Google Slides"] .punch-viewer-toolbar');
        if (toolbar) {
            // Create a new button
            const button = document.createElement('button');
            button.innerText = '+';
            button.style.marginLeft = '10px';
            button.style.fontSize = '20px';
            button.style.backgroundColor = '#f1f1f1';
            button.style.border = 'none';
            button.style.padding = '5px 10px';
            button.style.cursor = 'pointer';

            // Action for button click
            button.onclick = () => {
                // Example action: show an alert with options
                const action = prompt('Choose an action:\n1. Morph Transition\n2. Zoom\n3. Presenter Coach\n4. Animation\n5. Charts\n6. Slide Maker\n7. 3D Models\n8. Drawing\n9. Font Import\n10. Images');
                switch(action) {
                    case '1':
                        alert('Morph Transition feature (not implemented)');
                        break;
                    case '2':
                        alert('Zoom feature (not implemented)');
                        break;
                    case '3':
                        alert('Presenter Coach feature (not implemented)');
                        break;
                    case '4':
                        alert('Animation feature (not implemented)');
                        break;
                    case '5':
                        alert('Charts feature (not implemented)');
                        break;
                    case '6':
                        alert('Slide Maker feature (not implemented)');
                        break;
                    case '7':
                        alert('3D Models feature (not implemented)');
                        break;
                    case '8':
                        alert('Drawing feature (not implemented)');
                        break;
                    case '9':
                        alert('Font Import feature (not implemented)');
                        break;
                    case '10':
                        alert('Images feature (not implemented)');
                        break;
                    default:
                        alert('Invalid option');
                }
            };

            // Add button to toolbar
            toolbar.appendChild(button);
        } else {
            // Retry if toolbar not found
            setTimeout(addCustomButton, 1000);
        }
    };

    // Run the function to add the button
    addCustomButton();
})();