Greasy Fork

Greasy Fork is available in English.

BunPro: JLPT Percentage

Adds percentages to the JLPT progress bars.

当前为 2018-05-23 提交的版本,查看 最新版本

// ==UserScript==
// @name         BunPro: JLPT Percentage
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  Adds percentages to the JLPT progress bars. 
// @author       Kumirei
// @include      https://bunpro.jp/users*
// @require      http://greasyfork.icu/scripts/5392-waitforkeyelements/code/WaitForKeyElements.js?version=115012
// @grant        none
// ==/UserScript==

(function() {
		$('head').append('<style id="BunProPercentageScript">' +
						 '    .profile-jlpt-level .progress .percentage {' +
						 '        position: absolute; '+
						 '        left: 50%;' +
						 '        line-height: 15px;' +
						 '        transform: translate(-50%,0);' +
						 '        text-shadow: 1px 0px black;' +
						 '    }' +
						 '</style>');
		waitForKeyElements('.profile-jlpt-level .progress-bar', function(e) {
				var percentage = String(Math.round(e.attr('aria-valuenow')*10)/10) + "%";
				$(e[0].parentNode).append('<span class="percentage">' + percentage + '</span>');
		});
})();