Paste Essays(editable) (Acellus)

Essays are kinda dead to me

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey, το Greasemonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

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

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Userscripts για να εγκαταστήσετε αυτόν τον κώδικα.

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

Θα χρειαστεί να εγκαταστήσετε μια επέκταση διαχείρισης κώδικα χρήστη για να εγκαταστήσετε αυτόν τον κώδικα.

(Έχω ήδη έναν διαχειριστή κώδικα χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

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.

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

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

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

(Έχω ήδη έναν διαχειριστή στυλ χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

// ==UserScript==
// @name         Paste Essays(editable) (Acellus)
// @namespace    https://github.com/YeesterPlus
// @version      1.0
// @description  Essays are kinda dead to me
// @author       YeesterPlus
// @license      MIT
// @icon         https://www.google.com/s2/favicons?sz=64&domain=acellus.com
// @match        https://admin192a.acellus.com/student/*
// @grant        none
// @grant        GM_addStyle
// @grant        GM_setValue
// @grant        GM_getValue
// @grant        GM_deleteValue
// @run-at       document-end
// ==/UserScript==
(function() {
    'use strict';

    // Define the text to be typed
    var textToType = "Paste here";

     // Function to simulate typing as a user
    function typeTextAsUser(element, text) {
        var index = 0;
        var event = new KeyboardEvent('keydown', { key: '', code: '' });
        var inputEvent = new Event('input', { bubbles: true });

        var interval = setInterval(function() {
            // Simulate typing one character at a time
            element.textContent += text.charAt(index);
            element.dispatchEvent(inputEvent);
            element.dispatchEvent(event);
            index++;

            // Stop typing when text is fully typed
            if (index >= text.length) {
                clearInterval(interval);
            }
        }, 5); // Very fast typing speed
    }

    // Function to open the popup
    async function openPopup() {
        typeTextAsUser(document.activeElement, await navigator.clipboard.readText());
    }

    // Add event listener for when text inputs gain focus
    document.onkeydown = function interceptKeys(evt) {
    evt = evt||window.event // IE support
    var c = evt.keyCode
    var ctrlDown = evt.ctrlKey||evt.metaKey // Mac support

    // Check for Alt+Gr (http://en.wikipedia.org/wiki/AltGr_key)
    if (ctrlDown && evt.altKey) return true

    // Check for ctrl+c, v and x
    if (ctrlDown && c==86) openPopup() // v

    // Otherwise allow
    return true
} // Use capture phase to ensure event is caught before any other handlers

})();