正文
增加 14 行删除 2 行
17 行未改动181920212223242526231 行未改动全部展开2582592602612622632642652,460 行未改动全部展开272627272728272927302731273227334 行未改动2738273927402741274227432744274527461,731 行未改动全部展开44784479448044814482448344844485102 行未改动全部展开17 行未改动```javascript// ==UserScript==// @name LuoguSP// @namespace https://github.com/ShanireZ/LuoguSP// @version 2.12.2// @description LuoguSP:题目难度着色 / 私信 Ctrl+Click(用户名+头像) 跳转主页 / 显示隐藏的个人简介 / IDE 一键测试样例 / 受限文章与剪贴板直接显示// @author ShanireZ, realskc (Until 1.8.2)// @license GPL-3.0// @match https://www.luogu.com.cn/*231 行未改动全部展开return Object.freeze({ resolve });}function createProblemPipeline(config) {const {identity,documentAdapter,2,460 行未改动全部展开difficultySource: {text: (path, options) => limiter.text(path, options),// 记录列表 / 练习页已把整批难度注入 _feInstance;返回来源对象与纯题目数据,// 去重和 LRU 均由 Problem Pipeline Module 持有,不污染洛谷原始数组。harvest: () => {const cur = window._feInstance && window._feInstance.currentData;if (!cur) return [];const batches = [];4 行未改动batches.push({source: list,problems: () => [...list].map((item) => ({pid: item.problem && item.problem.pid,difficulty: item.problem && item.problem.difficulty,})),});}if (/^https:\/\/www\.luogu\.com\.cn\/user\/\d+#practice$/.test(url)) {1,731 行未改动全部展开if (LUOGUSP_NODE_MODULE) {module.exports = Object.freeze({createGetRequestScheduler,createProblemIdentityResolver,createProblemPipeline,createIdeBatchRunner,createSaverTransport,createSaverProtocol,102 行未改动全部展开17 行未改动181920212223242526231 行未改动全部展开2582592602612622632642652662672682692702712722732,460 行未改动全部展开2734273527362737273827392740274127424 行未改动274727482749275027512752275327542755275627571,731 行未改动全部展开448944904491449244934494449544964497102 行未改动全部展开17 行未改动```javascript// ==UserScript==// @name LuoguSP// @namespace https://github.com/ShanireZ/LuoguSP// @version 2.12.4// @description LuoguSP:题目难度着色 / 私信 Ctrl+Click(用户名+头像) 跳转主页 / 显示隐藏的个人简介 / IDE 一键测试样例 / 受限文章与剪贴板直接显示// @author ShanireZ, realskc (Until 1.8.2)// @license GPL-3.0// @match https://www.luogu.com.cn/*231 行未改动全部展开return Object.freeze({ resolve });}// 评测记录注入的 5..7 在新旧难度数据之间存在歧义:相同数值可能对应不同当前档位。// 只复用编号含义未变化的 0..4;高档题交给题目页接口按 pid 获取当前难度。function recordDifficultyForHarvest(difficulty) {return Number.isInteger(difficulty) && difficulty >= 0 && difficulty <= 4? difficulty: null;}function createProblemPipeline(config) {const {identity,documentAdapter,2,460 行未改动全部展开difficultySource: {text: (path, options) => limiter.text(path, options),// 记录列表 / 练习页已把整批难度注入 _feInstance;返回来源对象与纯题目数据,// 去重和 LRU 均由 Problem Pipeline Module 持有,不污染洛谷原始数组。// 记录列表的高档难度值不可靠,映射为 null 后由 Pipeline 查询题目页当前值。harvest: () => {const cur = window._feInstance && window._feInstance.currentData;if (!cur) return [];const batches = [];4 行未改动batches.push({source: list,problems: () => [...list].map((item) => ({pid: item.problem && item.problem.pid,difficulty: recordDifficultyForHarvest(item.problem && item.problem.difficulty,),})),});}if (/^https:\/\/www\.luogu\.com\.cn\/user\/\d+#practice$/.test(url)) {1,731 行未改动全部展开if (LUOGUSP_NODE_MODULE) {module.exports = Object.freeze({createGetRequestScheduler,createProblemIdentityResolver,recordDifficultyForHarvest,createProblemPipeline,createIdeBatchRunner,createSaverTransport,createSaverProtocol,102 行未改动全部展开