resize-o-don

resizeable columns in mastodon

目前为 2022-11-03 提交的版本。查看 最新版本

// ==UserScript==
// @name         resize-o-don
// @license      DWTFYW
// @namespace    http://pureandapplied.com.au/resizodon
// @version      0.2.2
// @description  resizeable columns in mastodon
// @author       You
// @match        https://*.social/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=aus.social
// @grant        none
// ==/UserScript==


(function() {
    function makeResizable () {
        let cols =[];
        for (let a = 0; a < arguments.length; a++){
                    let divs = document.getElementsByClassName(arguments[a]);
            for (let d = 0; d < divs.length; d++){
                cols.push(divs[d]);
            }
        }

        for(let i=0; i< cols.length - 1; i++){
            console.log(cols[i]);
            cols[i].style.resize = "horizontal";
            cols[i].style.flexShrink = 0;
            resizeObserver.observe(cols[i]);
            //cols[i].style.width = '350px';
        }
        cols[cols.length -1].resize = "horizontal";
        cols[cols.length -1].style.flex = "1 1 auto";
    };
    const resizeObserver = new ResizeObserver((entries) => {
        for (const entry of entries) {
            if (entry.contentBoxSize) {
                setupResizing();
            }
        }
    })
    function setupResizing(){
        makeResizable('drawer', 'column');
    };
    setupResizing();
})();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址