v2ex回复排序

v2ex回复按照❤️排序

目前为 2017-11-12 提交的版本。查看 最新版本

// ==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.3
// @grant       none
// @description sort v2ex reply by star❤️
// ==/UserScript==
let content = $("div.box[style] + div + div.box");
let hasPages = content.find("a.page_current").size()!=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 vx <= vy;
    }
).appendTo(content);

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

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

QingJ © 2025

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