您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
This has two tiny changes to fix the original, made by the user above at https://userscripts-mirror.org/scripts/show/18788
当前为
// ==UserScript== // @name Metafilter MultiFavorited Multiwidth - Fixed // @namespace http://www.metafilter.com/user/25038 // @description This has two tiny changes to fix the original, made by the user above at https://userscripts-mirror.org/scripts/show/18788 // @include http://www.metafilter.com/* // @include http://*.metafilter.com/* // @include https://*.metafilter.com/* // @version 6 // ==/UserScript== (function () { // Threshold; at this number or higher the comment will be highlights var threshold = 2; // Highlighting colors, change to match your preferences! var MetaHighlight='#337dc3'; var askMeHighlight='#47cf4a'; var TalkHighlight='#888888'; var searchPattern = "//a[contains(@title,'users marked this as favorite')]"; var options = document.evaluate( searchPattern, document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null ); if (options.snapshotLength == 0 ) { var options = document.evaluate( searchPatternFavesOff, document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null ); } var i; for (var klass = null, i = 0; (klass = options.snapshotItem(i)); i++) { var favCount=klass.title.replace(/^[^0-9]*([0-9]+)[^0-9]+$/,'$1'); if (favCount >= threshold) { var commentNode=klass; while (commentNode.nodeName != "DIV") { commentNode = commentNode.parentNode; } commentNode.style.borderLeft=''+((favCount/2)+1)+'px solid'; commentNode.style.paddingLeft='5px'; commentNode.style.marginLeft=''+(70-((favCount/2)+1))+'px'; if (document.location.hostname.indexOf('www')==0) commentNode.style.borderColor=MetaHighlight; if (document.location.hostname.indexOf('ask')==0) commentNode.style.borderColor=askMeHighlight if (document.location.hostname.indexOf('metatalk')==0) commentNode.style.borderColor=TalkHighlight; }; } })();