Drag

The extension adds drag and drop when loading the report

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         Drag
// @description  The extension adds drag and drop when loading the report
// @namespace    http://tampermonkey.net/
// @version      0.1
// @author       You
// @match        https://pro.guap.ru/inside/student/reports/*/create
// @icon         data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant        none
// @license MIT
// ==/UserScript==

(function() {
    const drop_area = document.getElementsByClassName('card')[0];
    const load_button = document.getElementsByClassName('btn-info')[0];

    ['dragenter', 'dragover', 'dragleave', 'drop'].forEach(eventName => {
        drop_area.addEventListener(eventName, (e) => {
            e.preventDefault();
            e.stopPropagation();
        }, false)
    });

    drop_area.addEventListener('drop', (e) => {
        document.getElementById('file').files = e.dataTransfer.files;
        load_button.text = e.dataTransfer.files[0].name;
    });

    ['dragenter', 'dragover'].forEach(eventName => {
        drop_area.addEventListener(eventName, _ => {
            drop_area.style.cssText = 'box-shadow: 0 0 .5rem rgba(0,250,0,.75) !important;'
        }, false)
    });

    ['dragleave', 'drop'].forEach(eventName => {
        drop_area.addEventListener(eventName, _ => {
            drop_area.style.cssText = 'box-shadow: var(--suai-shadow) !important'
        }, false)
    });
})();