Greasy Fork

Greasy Fork is available in English.

北邮人BT趣味盒高度调整

北邮人BT首页趣味盒高度调整

目前为 2021-09-08 提交的版本,查看 最新版本

// ==UserScript==
// @name         北邮人BT趣味盒高度调整
// @namespace    http://tampermonkey.net/
// @description  北邮人BT首页趣味盒高度调整
// @version      1.12
// @author       wangcr
// @match        https://bt.byr.cn/index.php
// @match        https://bt.byr.cn/
// @match        https://byr.pt/index.php
// @match        https://byr.pt/
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    window.changeFunboxHeight = function(){
        $("iframe[src='fun.php?action=view']").attr("height", $("#funbox_height").attr("value"));
        localStorage.funbox_height = $("#funbox_height").attr("value");
    }
    window.changeShoutboxHeight = function(){
        $("iframe[src='shoutbox.php?type=shoutbox']").attr("height", $("#shoutbox_height").attr("value"));
        localStorage.shoutbox_height = $("#shoutbox_height").attr("value");
    }
    var funbox_height;
    if(localStorage.funbox_height == undefined || localStorage.funbox_height == null){funbox_height = "300";}else{funbox_height = localStorage.funbox_height;}
    $("iframe[src='fun.php?action=view']").attr("height", funbox_height);
    
    var shoutbox_height;
    if(localStorage.shoutbox_height == undefined || localStorage.shoutbox_height == null){shoutbox_height = "300";}else{shoutbox_height = localStorage.shoutbox_height;}
    $("iframe[src='shoutbox.php?type=shoutbox']").attr("height", shoutbox_height);
    
    var funbox_element = document.createElement('span');
    funbox_element.className = "small";
    funbox_element.innerHTML = '<span calss="small"> - | <input id="funbox_height" type="range" value=' + funbox_height + ' min="180" max="1000" step="10" onchange="changeFunboxHeight()" style="height: 7pt;vertical-align: text-bottom;">| </span>';
    $(funbox_element).insertAfter($($("h2:contains('趣味盒')").children("font").get(0)));

    var shoutbox_element = document.createElement('span');
    shoutbox_element.className = "small";
    shoutbox_element.innerHTML = '<span calss="small"> - | <input id="shoutbox_height" type="range" value=' + shoutbox_height + ' min="180" max="1000" step="10" onchange="changeShoutboxHeight()" style="height: 7pt;vertical-align: text-bottom;">| </span>';
    $(shoutbox_element).insertAfter($($("h2:contains('群聊区')").children("font").get(0)));
})();