Greasy Fork is available in English.
Ну и говна кусок этот код
当前为
// ==UserScript==
// @name LZT_Trophy
// @namespace http://tampermonkey.net/
// @version 0.7
// @description Ну и говна кусок этот код
// @author llimonix
// @match https://zelenka.guru/*
// @icon https://cdn-icons-png.flaticon.com/512/2830/2830919.png
// @grant none
// @license MIT
// ==/UserScript==
(function() {
let pageCounter = $('.page_counter');
if (pageCounter.length > 0) {
let hrefValue = pageCounter.attr('href');
let parts = hrefValue.replace('members/', '').split("/");
let value = parts[0];
console.log(value)
let trophy;
if (~hrefValue.indexOf("members/")) {
value = `members/${value}`
}
XenForo.ajax(`https://zelenka.guru/${value}/trophies`, {}).then(data => {
trophy = data.templateHtml;
let parser = new DOMParser();
trophy = parser.parseFromString(trophy, 'text/html');
let overlayScrollElements = $(trophy).find('.overlayScroll');
let totalCount = overlayScrollElements.length;
if (totalCount > 1) {
overlayScrollElements.first().remove();
}
let trophies = $(trophy).find('.trophy');
let trophiesList = trophies.map((_, trophy) => trophy.id).get();
let trophiesstyle = $(trophy).find('.trophy-icon');
let trophystyleList = trophiesstyle.map((_, trophy) => trophy.style.cssText.replace(/"/g, '')).get();
let titletrophy = $(trophy).find('.title');
let titleTexttrophyList = titletrophy.map((_, trophy) => trophy.textContent).get();
let htmlTrophy = "<ol>";
for (let index = 0; index < trophystyleList.length; index++) {
htmlTrophy += `<li class="trophy DelayedTooltip" title="${titleTexttrophyList[index]}" id="${trophiesList[index]}" tabindex="0"><div class="trophy-icon" style="${trophystyleList[index]}"></div></li>`;
}
htmlTrophy += "</ol>";
if (screen.width <= 480) {
$('.memberViewTrophies').html(htmlTrophy);
$('.Responsive .memberViewTrophies').css('display', 'block');
$('.memberViewTrophies').css({
'position': 'relative',
'margin': '20px 0 0',
'overflow-x': 'scroll',
'white-space': 'nowrap'
});
} else {
$('.memberViewTrophies').html(htmlTrophy);
}
});
}
})();