// ==UserScript== // @name Rain Classroom Helper // @namespace https://raineggplant.com/ // @version 0.2.4 // @description 优化雨课堂使用体验 // @author RainEggplant // @match *://www.yuketang.cn/web* // @match *://pro.yuketang.cn/web* // @match *://changjiang.yuketang.cn/web* // @grant GM_addStyle // @require https://cdn.bootcss.com/jquery/1.12.4/jquery.min.js // @homepageURL https://github.com/RainEggplant/rain-classroom-helper // @downloadURL https://update.greasyfork.icu/scripts/396387/Rain%20Classroom%20Helper.user.js // @updateURL https://update.greasyfork.icu/scripts/396387/Rain%20Classroom%20Helper.meta.js // ==/UserScript== (function () { 'use strict'; const DEBUG = false; // 调整左边栏样式 GM_addStyle(` .left .panel { padding-top: 34px !important; max-height: unset !important; } .nav-list { font-size: 18px !important; } .nav-item { height: 45px !important; line-height: 32px !important; padding-top: 6px !important; } .kecheng, .kejian, .shiti, .geren, .addlink { width: 30px !important; } .left .panel .nav-list .nav-item .name { padding-left: 18px !important; } `); // 调整右边栏样式 GM_addStyle(` .right { width: 320px !important; } .right .control-panel { padding-top: 32px !important; max-height: unset !important; } .title { font-size: 22px !important; } .page-nav-control { width: 320px !important; } .page-control { padding-top: 15px !important; } .control-desc { display: none !important; } .page-nav { padding: unset !important; font-size: 18px !important; } .print-preview-box { margin: 0px 0 0 !important; } .contact-us { display: none; } .right .control-panel .page-control .paging-number-list .page-no:nth-child(5n) { margin: 0 14px 13px 0 !important; } `); // 调整中间 iframe 为自适应宽度 GM_addStyle(` .wrapper-inner { width: 92% !important; } .center { width: auto !important; margin-left: 180px !important; margin-right: 320px !important; float: none !important; } .center .rain-iframe { width: calc(95% - 40px) !important; height: 95% !important; } .student__timeline-wrapper { top: 2.33rem !important; } `); // 调整布局 waitForKeyElements('div.index-view.none.J_index', function () { // note: you must move div.right instead of div.center, or the sidebar // will lost its funtion $('div.right.fr').insertBefore($('div.center.fl')); }); // 缩小 “体验新版” 尺寸 waitForKeyElements('a.newWebEntry', function () { $('a.newWebEntry') .find('img') .attr('style', 'width: 150px; margin-top: 20px;'); }); // 添加右边栏视频框 GM_addStyle(` #video-iframe { width: 320px; height: 304px; } `); waitForKeyElements('div.control-panel.Absolute-Center', function () { const videoIFrame = '