Tasmota textarea maximizer

Maximizes the textarea's on the console and scripting screens. Makes editing a little easier

当前为 2024-03-05 提交的版本,查看 最新版本

// ==UserScript==
// @name         Tasmota textarea maximizer
// @namespace    http://monkeyr.com/
// @license      MIT
// @version      1.0
// @description  Maximizes the textarea's on the console and scripting screens. Makes editing a little easier
// @author       mh
// @match        http://*/s10*
// @match        http://*/cs*
// @match        http://*/ufse*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=tasmota.github.io
// @require      http://code.jquery.com/jquery-latest.min.js
// @grant        none
// ==/UserScript==

(function($) {
    const cont = $('body>div').css({'min-width': '98%'});
    //console.log(cont.children())
    let textarea=null, others_height=0, delta_height=200;
    cont.children().each((i,e) => {
        const ele = $(e);
        //console.log(e);
        if(ele.is('fieldset')){
            textarea=ele.find('textarea');
        }
        else if(ele.is('textarea')){
            delta_height=100;
            textarea=ele;
        }
        else{
            others_height+=ele.outerHeight();
            //console.log(ele.outerHeight());
        }
    });
    textarea.height(document.documentElement.clientHeight - others_height - delta_height);
    window.addEventListener('resize', function() {textarea.height(document.documentElement.clientHeight - others_height - delta_height);console.log('resize event')});
})(jQuery);