您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Userscript for Moodle sites that lets you quickly jump to the current week/section. Made for the Boost and Fordson themes.
// ==UserScript== // @name Moodle: Jump to Current Section // @version 0.1 // @description Userscript for Moodle sites that lets you quickly jump to the current week/section. Made for the Boost and Fordson themes. // @author dotcomboom // @match *://*/course/view.php?id=* // @grant none // @namespace https://gf.qytechs.cn/en/users/691054-dotcomboom // ==/UserScript== (function() { 'use strict'; // config const jump_on_page_load = true; // whether to jump when page first loads const navbar = true; // whether to add button to top navbar //----------- const c = document.getElementsByClassName("current")[1]; // index 0 is your user avatar, index 1 is the highlighted/current section if the course has one if (c) { // check if there is one if (jump_on_page_load) { c.scrollIntoView(); } if (navbar) { const btn = document.createElement("li"); const link = document.createElement("a"); const ltext = document.createTextNode("Current Section"); btn.classList.add("nav-item"); link.classList.add("nav-link"); link.href = "javascript:void(0)"; link.addEventListener("click", () => { c.scrollIntoView() }); link.appendChild(ltext); btn.appendChild(link); document.querySelector(".navbar-nav").appendChild(btn); } } })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址