您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Make the AlternativeTo website even better!
// ==UserScript== // @name AlternativeTo Enhancer // @namespace http://tampermonkey.net/ // @version 1.0 // @description Make the AlternativeTo website even better! // @author Al Boulley, [email protected] // @match https://alternativeto.net/software/* // @grant none // ==/UserScript== (function() { sortedItems = false; function sortAlternativesTo() { jQuery.fn.order = function(asc, fn) { fn = fn || function (el) { return $(el).text().replace(/^\s+|\s+$/g, ''); }; var T = asc !== false ? 1 : -1, F = asc !== false ? -1 : 1; this.sort(function (a, b) { a = fn(a); b = fn(b); if (a == b) return 0; return a < b ? F : T; }); this.each(function (i) { this.parentNode.appendChild(this); }); }; if (!sortedItems) { listItems = $('#alternativeList li[id^="item-"]'); listItems.order(false, function (el) { return parseInt($('.num', el).text()); }); sortedItems = true; statusComplete = '<li><h1 style="width:100%; background-color:#333; color:#3F3; padding:0.3em; font-size:3em; '; statusComplete += 'border:10px solid #3F3; text-align:center;">Alternatives Loaded & Sorted!</h1></li>'; listItems[0].insertAdjacentHTML('beforebegin', statusComplete); } } function initiateSort() { loadMore = $('#alternativeList button.btn-load-more'); if (loadMore.length > 0) { loadMore.click(); setTimeout(initiateSort, 4000); } setTimeout(sortAlternativesTo, 3000); } window.onload = initiateSort; })();