Toffu

Autofills Woffu schedule

As of 28.05.2021. See апошняя версія.

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 or Violentmonkey 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.

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.

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

// ==UserScript==
// @name         Toffu
// @namespace    http://yelidmod.com/trendier
// @version      0.3
// @description  Autofills Woffu schedule
// @author       DonNadie
// @match        https://*.woffu.com/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    window.addEventListener('load', () => {
        const observer = new MutationObserver(() => {
            $modal.querySelectorAll('input').forEach((input, i) => {
                if (input.value.length < 1) {
                    input.focus();
                    input.value = input.placeholder.substr(0, 5); // from 19:00:00 to 19:00
                    input.dispatchEvent(new Event('change'));
                }
            });
        });
        const $modal = document.getElementById('diary-edit');

        if ($modal != null) {
            observer.observe($modal, {
                childList: true,
                subtree: true
            });
        }
    }, false);
})();