UserScript Đăng Script

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

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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

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

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

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.

ستحتاج إلى تثبيت إضافة مثل Stylus لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتتمكن من تثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

(لدي بالفعل مثبت أنماط للمستخدم، دعني أقم بتثبيته!)

// ==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);
})();