版本比较
洛谷简易插件·LuoguSP
正文
增加 14 行删除 2 行
17 行未改动18192021222223242526231 行未改动全部展开2582592602612622632642652662672682692702712722732,460 行未改动全部展开2734273527362737273827392740274127424 行未改动2747274827492750275127422752275327542755275627571,731 行未改动全部展开448944904491449244934494449544964497102 行未改动全部展开17 行未改动```javascript// ==UserScript==// @name LuoguSP// @namespace https://github.com/ShanireZ/LuoguSP// @version 2.12.2// @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( difficulty: item.problem && item.problem.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, recordDifficultyForHarvest, createProblemPipeline, createIdeBatchRunner, createSaverTransport, createSaverProtocol,102 行未改动全部展开