osu! Activity Hover Details

Hover on Recent Activities / Best Performance to see score details

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name           osu! Activity Hover Details
// @description    Hover on Recent Activities / Best Performance to see score details
// @author         JebwizOscar
// @icon           http://osu.ppy.sh/favicon.ico
// @include        https://osu.ppy.sh/u/*
// @include        http://osu.ppy.sh/u/*
// @require        http://code.jquery.com/ui/1.10.4/jquery-ui.js
// @require        http://code.jquery.com/jquery-1.11.1.min.js
// @copyright      2014, Jeb
// @version        0.1.2.10
// @namespace      https://greasyfork.org/users/3079
// ==/UserScript==
function addStyle(style) {
    var head = document.getElementsByTagName("head")[0];
    var ele = head.appendChild(window.document.createElement( 'style' ));
    ele.innerHTML = style;
    return ele;
}
addStyle('@import "//ajax.aspnetcdn.com/ajax/jquery.ui/1.10.0/themes/base/jquery-ui.css"');
$(function() {
    
    $( document ).tooltip({
        items: ".event, .prof-beatmap",
        content: function(){
            var element = $( this );
            if (typeof(element.attr("title"))=="undefined"){
                
                $( ".event" ).click(function() {
                    element=$(this);
                    if (typeof(element.attr("title"))=="undefined"){
                        u=userId;
                        b=element.children(0).last()[0].outerHTML.replace(/((.|\n)+)\/b\/(\d+)((.|\n)+)/,"$3");
                        m=element.children(0).last()[0].outerHTML.replace(/((.|\n)+)\/b\/(\d+)\?m=(\d+)((.|\n)+)/,"$4");
                        $.get("http://wa.vg/apis/tooltip.php", {
                            'm':m,'u':u,'b':b
                        }, function(data) {
                            element.attr("title",data);
                        });
						element.attr("title","Loading...");
						return "Loading...";
                    }
                    
                });
                $( ".prof-beatmap" ).click(function() {
                    element=$(this);
                    if (element.attr("id").indexOf("performance")==0){
						if (typeof(element.attr("title"))=="undefined"){
							u=userId;
							cd=$(element.children(0).children(0).children(0).children(0).children(0)[0]).children(0)[1].innerHTML;
							m=cd.replace(/<a href="\/b\/.*?\?m=(.*?)">.*/,"$1");
							b=cd.replace(/<a href="\/b\/(.*?)\?m=.*?">.*/,"$1");
							$.get("http://wa.vg/apis/tooltip.php", {
								'm':m,'u':u,'b':b
							}, function(data) {
								element.attr("title",data);
							});
							element.attr("title","Loading...");
							return "Loading...";
						}
                    }else return element.attr("title");
					;
                });
                return "Click on a score to load";
            }else return element.attr("title");
        }
    });

    
});