Сортировка по очкам в ивенте [RUS]

Перевод на русский язык скрипта Arekino.

当前为 2021-05-29 提交的版本,查看 最新版本

// ==UserScript==
// @name         Сортировка по очкам в ивенте [RUS]
// @version      0.2
// @author       Arekino
// @match        https://www.heroeswm.ru/clan_info.php*
// @grant        none
// @namespace https://gf.qytechs.cn/users/239593
// @description Перевод на русский язык скрипта Arekino.
// ==/UserScript==
 
(function() {
    'use strict';
    var i = document.createElement("div");
  
    i.setAttribute('style', 'text-align: center;background-color: #ce2e5a;color: #e2b77d;border: 0;border-radius: 5px;width: 250px;padding: 10px;margin: 10px auto;box-shadow: inset 0 0 0 1px #e2b77d, inset 0 0 4px rgb(0 0 0 / 50%), inset 0 -25px 10px rgb(0 0 0 / 50%), 0 1px 7px rgb(0 0 0 / 70%);');
    i.setAttribute('class', 'sort-btn'); 
  
    var css = '.sort-btn:hover{ cursor: pointer; -webkit-filter: brightness(1.3) drop-shadow(0 1px 3px #ffcf7e); filter: brightness(130%) drop-shadow(0 1px 3px #ffcf7e); }';
    var style = document.createElement('style');

    if (style.styleSheet) {
         style.styleSheet.cssText = css;
    } else {
         style.appendChild(document.createTextNode(css));
    }

    document.getElementsByTagName('head')[0].appendChild(style);
  
    i.innerText = "Сортировать по очкам в ивенте";
    i.onclick=()=>{[...document.querySelectorAll("tr")].filter(x=>{if(x.childElementCount==6||(x.children[0].innerText.includes(".")&&x.childElementCount==5)){if(isNaN(parseInt(x.lastElementChild.innerText))) x.lastElementChild.innerText=0;return true}return false})
        .sort((x,y)=>parseInt(y.lastElementChild.innerText.replace(",",""))-parseInt(x.lastElementChild.innerText.replace(",",""))).forEach((x,i)=>{x.parentElement.appendChild(x);x.firstElementChild.innerText=`${i+1}.`})}
    document.querySelector("body > center > table > tbody > tr > td > table > tbody > tr > td > table:nth-child(1)").after(i)
    // Your code here...
})();

QingJ © 2025

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