您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
字幕库按下载量排序
当前为
// ==UserScript== // @name Zimuku Sort // @namespace Violentmonkey Scripts // @match https://zimuku.org/subs/* // @grant none // @version 0.1 // @author Ifover // @license MIT License // @description 字幕库按下载量排序 // ==/UserScript== (function () { let tbody = $('.table tbody') let hTr = tbody.children() let trArr = Array.from(hTr) let sortNumArr = [] for (let tr of trArr) { let tds = $(tr).children() if (tds.length) { let num = $(tds[3]).text() num = num.indexOf('万') !== -1 ? parseFloat(num) * 10000 : parseInt(num) sortNumArr.push(num) } } // console.log(sortNumArr) for (let i = 0; i < sortNumArr.length; i++) { for (let j = 0; j < i; j++) { if (sortNumArr[i] > sortNumArr[j]) { let temp = sortNumArr[i]; sortNumArr[i] = sortNumArr[j]; sortNumArr[j] = temp let temp2 = trArr[i]; trArr[i] = trArr[j]; trArr[j] = temp2; } } } // console.log(sortNumArr) hTr.remove() for (let tr of trArr) { tbody.append(tr) } })();