您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Shows image's rating above its thumbnail on Derpibooru.
当前为
// ==UserScript== // @name Derpibooru - Rating Info // @description Shows image's rating above its thumbnail on Derpibooru. // @namespace derpibooru_ratinginfo // @require https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js // @include /^https?:\/\/(www\.)?(derpiboo(ru\.org|\.ru)|trixiebooru\.org).*$/ // @version 20151030 // @grant GM_addStyle // ==/UserScript== GM_addStyle('.RI_rating > * {padding-right: 3px; font-weight: bold}'); var conf = [ ['safe', 'S', '#67AF2B'], ['explicit', 'E', '#CF0001'], ['questionable', 'Q', '#C4B246'], ['suggestive', 'Sg', '#C4B246'], ['grimdark', 'GD', '#5E0000'], ['semi-grimdark', 'S-GD', '#5E0000'], ['grotesque', 'Gr', '#000000'] ]; var tags = conf.map(function (value) { return value[0]; }); $.each(conf, function (index, value) { GM_addStyle('.RI_' + value[0] + ':after {content: "' + value[1] + '"; color:' + value[2] + '}'); }); $.each($('.image-thumb-box'), function (index, value) { var infoBoxEl = $(value).find('.imageinfo') [0]; var imgTags = $(value).find('.image-container') [0].dataset.imageTagAliases.split(', '); var rTags = imgTags.filter(function (value) { return tags.indexOf(value) != - 1 }); var ratingNode = document.createElement('span'); ratingNode.className = 'RI_rating'; $.each(rTags, function (index, value) { var tagNode = document.createElement('span'); tagNode.className = 'RI_' + value; ratingNode.appendChild(tagNode); }); $(infoBoxEl).prepend(ratingNode); });