Gitee宽屏显示

Gitee宽屏显示,更方便的阅读内容。

目前為 2024-11-19 提交的版本,檢視 最新版本

// ==UserScript==
// @name         Gitee宽屏显示
// @version      1.1
// @description  Gitee宽屏显示,更方便的阅读内容。
// @author       蚩尤后裔-汪茂雄
// @homepage     https://gf.qytechs.cn/zh-CN/scripts/518028-gitee%E5%AE%BD%E5%B1%8F%E6%98%BE%E7%A4%BA
// @match        http*://gitee.com/*
// @require      http://libs.baidu.com/jquery/2.0.0/jquery.min.js
// @license      MIT
// @namespace    https://gf.qytechs.cn/zh-CN/scripts/518028-gitee%E5%AE%BD%E5%B1%8F%E6%98%BE%E7%A4%BA
// ==/UserScript==

(function () {
    'use strict';

    const buttonIdName = "btn_25081993"; // 自定义操作按钮的ID名称
    const restoreTitle = '宽屏恢复';
    const wideScreenTitle = '宽屏显示';


    $(function(){
        appendWideScreenButton();
    });


    /**
    * 向页面添加自定义操作按钮
    * 添加到提交次数的后面
    */
    function appendWideScreenButton() {
        // 定义自定义操作按钮
        let downloadJQ = $("<div>" + wideScreenTitle + "</div>");
        downloadJQ.css({
            "position" : "fixed",
            "left" : "1px",
            "top" : "80%",
            "height" : "90px",
            "width" : "20px",
            'background-color': 'rgba(46,46,46, 1)',
            "color": "#fff",
            'font-size': '16px',
            'cursor': 'pointer'
        });
        downloadJQ.attr("id", buttonIdName);

        // 添加到提交次数的后面
        $('#git-nav-user-bar').before(downloadJQ);

        // 绑定单击事件。隐藏或者展示右侧面板
        downloadJQ.on("click", function(event){
            if(downloadJQ.text() == wideScreenTitle) {
                $('.four.wide.column').hide();
                $('#git-project-container').attr('style', 'width:100% !important;');
                $('.ui.container').attr('style', 'width:100% !important;');
                downloadJQ.text(restoreTitle);
            } else {
                $('.four.wide.column').show();
                $('#git-project-container').attr('style', 'width:75% !important;');
                $('.ui.container').attr('style', 'width:1240px !important;');
                downloadJQ.text(wideScreenTitle);
            }
        });
    }





})();

QingJ © 2025

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