v2ex回复排序

sort v2ex reply by star❤️

目前為 2020-06-22 提交的版本,檢視 最新版本

// ==UserScript==
// @name        v2ex回复排序
// @namespace   [email protected]
// @include     http*://*v2ex.com/t/*
// @description:en sort v2ex reply by star❤️
// @description:zh-CN v2ex回复按照❤️排序
// @version     1.0.0.5
// @description sort v2ex reply by star❤️
// ==/UserScript==

//green author
$("strong a.dark:contains('"+$("small.gray a").text()+"')").css('color', 'green');

//blue link
//$("div.cell[id^='r_'] a[rel='nofollow']").css('color', 'blue');
$("a[rel~='nofollow']").css('color', 'blue');

let content = $("div.box[style] + div + div.box");
let hasPages = content.find("a.page_current").length!==0;
let lastPageRow = hasPages ? content.find("div.cell:last") : null;
content.find("div.cell[id^='r_']").sort(
    function(x, y){
        let vx = parseInt($(x).find("span.small").text().replace(/♥/g, ""));
        if (isNaN(vx)) vx = 0;
        let vy = parseInt($(y).find("span.small").text().replace(/♥/g, ""));
        if (isNaN(vy)) vy = 0;
        return vy - vx;
    }
).appendTo(content);

// move the lastPageRow to the end of content
if(lastPageRow){
    lastPageRow.appendTo(content);
}

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址