UserScript Đăng Script

Đưa nút đăng script ra phía tay phải

スクリプトをインストールするには、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         UserScript Đăng Script
// @namespace    http://tampermonkey.net/
// @version      1.1
// @description  Đưa nút đăng script ra phía tay phải
// @author       Bạn
// @match        https://greatest.deepsurf.us/vi/scripts/*/versions/new
// @match        https://greatest.deepsurf.us/vi/scripts/*/versions
// @grant        GM_addStyle
// ==/UserScript==

(function() {
    'use strict';

    // Thêm CSS để căn chỉnh nút
    GM_addStyle(`
        #submitButtonContainer {
            position: fixed;
            top: 150px; /* Điều chỉnh vị trí theo nhu cầu */
            right: 20px; /* Căn phải */
            z-index: 9999;
        }
        #submitButton {
            background-color: #0076ff;
            color: white;
            padding: 10px 20px;
            border: none;
            border-radius: 5px;
            cursor: pointer;
            font-size: 16px;
        }
        #submitButton:hover {
            background-color: #005bb5;
        }
    `);

    // Tạo nút "Đăng Script"
    const buttonContainer = document.createElement('div');
    buttonContainer.id = 'submitButtonContainer';
    const submitButton = document.createElement('button');
    submitButton.id = 'submitButton';
    submitButton.textContent = 'Đăng Script';

    // Thêm sự kiện click vào nút
    submitButton.addEventListener('click', () => {
        const form = document.querySelector('form.new_script_version');
        if (form) {
            form.submit(); // Gửi form khi nhấn nút
        } else {
            alert('Không tìm thấy form để đăng script.');
        }
    });

    buttonContainer.appendChild(submitButton);
    document.body.appendChild(buttonContainer);
})();