您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Sorts files alphabetically by default when you view the "Files" section of a module in LumiNUS
// ==UserScript== // @name LumiNUSAutoSort // @description Sorts files alphabetically by default when you view the "Files" section of a module in LumiNUS // @author Soh Thiam Hing // @license OSL-3.0 // @version 1.0 // @match https://luminus.nus.edu.sg/* // @namespace com.daffodilistic.tampermonkey // @require https://cdn.jsdelivr.net/gh/CoeJoder/waitForKeyElements.js@6b9ca81bf32899b4274086aa9d48c3ce5648e0b6/waitForKeyElements.js // ==/UserScript== waitForKeyElements(selectSortIconElement, sortByFilename, false); function selectSortIconElement() { let targets = document.querySelectorAll("list-view > section > header > column.name > div > i"); let elements = []; for (const t of targets) { if (t.parentNode.textContent.includes("File Name") && !t.hasAttribute('data-userscript-alreadyfound')) { elements.push(t); } } return elements; } function sortByFilename(node) { let event = new Event('click'); node.dispatchEvent(event); return false; }