Greasy Fork

来自缓存

Greasy Fork is available in English.

Joe's Quality To Value for Popmundo

Adds numeric values to the level bars and quality names. Any problems, please contact Joe Isaacs (http://www.popmundo.com/World/Popmundo.aspx/Character/3248185)

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name            Joe's Quality To Value for Popmundo
// @namespace       http://popmundo-diaries.com/
// @Author	        Joe Isaacs CharId #3248185 <[email protected]>
// @description     Adds numeric values to the level bars and quality names. Any problems, please contact Joe Isaacs (http://www.popmundo.com/World/Popmundo.aspx/Character/3248185)
// @version         1.0.2
// @include         http://*.popmundo.com/World/Popmundo.aspx/*
// @require         https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js
// @grant           GM_info
// ==/UserScript==

function appendJsFile( scriptFile ) {
	var script = document.createElement( "script" );
	script.type = "text/javascript";
	script.src = scriptFile;
	jisQuery( "head" ).append( script );
}

function canExec( execRegex ) {
	var execCurrentUrl = window.location.href;

	if( execCurrentUrl.match( execRegex ) ) {
		return true;
	} else {
		return false;
	}
}

/**
 * ********** Area: variables
 */

var jisQuery = jQuery.noConflict();

/**
 * ********** Area: execution
 */

giveScoringNumberValues();
giveScoringProgressBarPercentages();
giveScoringNegativeProgressBarPercentages();

/**
 * ********** Area: functions
 */

//Add value to quality
function giveScoringNumberValues() {
	jisQuery( "a[href*='Scoring']" ).each( function() {
		value = jisQuery( this ).attr( 'title' );
		value = value.substr( 0, value.lastIndexOf( "/" ) );
		value = jisQuery( this ).text() + " (" + value + ")";
		jisQuery( this ).text( value );
	} );
}

//Add value to progress bar type
function giveScoringProgressBarPercentages() {
	jisQuery( 'div[class*="rogressBar"]' ).each( function() {
		value = jisQuery( this ).attr( 'title' );
		value = value.substr( 0, value.indexOf( "%" ) );
		span = '<span style="    text-align: center; font-weight: 400; font-size: smaller;">&nbsp;&nbsp;&nbsp;' + value + '%</span>';
		value = jisQuery( this ).children( "div:first" ).append( span );
	} );
}

//Add value to negative progress bar type
function giveScoringNegativeProgressBarPercentages() {
	jisQuery( '.plusMinusBar' ).each( function() {
		value = jisQuery( this ).attr( 'title' );
		value = value.substr( 0, value.indexOf( "%" ) );
		span = '<span style="    text-align: center; font-weight: 400; font-size: smaller;">&nbsp;&nbsp;&nbsp;' + value + '%</span>';
		if( value >= 0 ) {
			jisQuery( this ).children( "div" ).eq( 1 ).children().append( span );
		} else {
			jisQuery( this ).children( "div" ).eq( 0 ).children().append( span );
		}
	} );
}