osu! Activity Hover Details

Hover on Recent Activities to see score details

目前為 2014-07-14 提交的版本,檢視 最新版本

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

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

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name           osu! Activity Hover Details
// @description    Hover on Recent Activities 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.10.4.min.js
// @copyright      2014, Jeb
// @version	       0.1.0.0
// @namespace https://greasyfork.org/users/3079
// ==/UserScript==

$(function() {
    $( document ).tooltip({
        items: ".event, .h",
        content: function() {
            var element = $( this );
            if ( element.is( ".event" ) ) {
                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");
                    console.log("http://wa.vg/tooltip.php?m="+m+"&u="+u+"&b="+b);
                    $.get("http://wa.vg/tooltip.php", {
                        'm':m,'u':u,'b':b
                    }, function(data) {
                        element.attr("title",data);
                        return data;
                    });
                    return "Loading...";
                }else
                    return element.attr("title");
            }else 
                if ( element.is( ".h" ) ) {
                    if (typeof(element.attr("title"))=="undefined"){
                        u=userId;
                        m=element.children(0)[1].innerHTML.replace(/<a href="\/b\/.*?\?m=(.*?)">.*/,"$1");
                        b=element.children(0)[1].innerHTML.replace(/<a href="\/b\/(.*?)\?m=.*?">.*/,"$1");
                        console.log("http://wa.vg/tooltip.php?u="+u+"&b="+m);
                        $.get("http://wa.vg/tooltip.php", {
                            'm':m,'u':u,'b':b
                        }, function(data) {
                            element.attr("title",data);
                            return data;
                        });
                        return "Loading...";
                    }else
                        return element.attr("title");
                }else
                    return element.attr("title");
        }
    });
});