osu! Activity Hover Details

Hover on Recent Activities to see score details

目前為 2014-08-04 提交的版本,檢視 最新版本

// ==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.11.1.min.js
// @copyright      2014, Jeb
// @version	       0.1.0.9
// @namespace https://gf.qytechs.cn/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, .h",
        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");
                        console.log("http://wa.vg/apis/tooltip.php?m="+m+"&u="+u+"&b="+b);
                        $.get("http://wa.vg/apis/tooltip.php", {
                            'm':m,'u':u,'b':b
                        }, function(data) {
                            element.attr("title",data);
                        });
                    }
                    
                });
                $( ".h" ).click(function() {
                    element=$(this);
                    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/apis/tooltip.php?u="+u+"&b="+m);
                        $.get("http://wa.vg/apis/tooltip.php", {
                            'm':m,'u':u,'b':b
                        }, function(data) {
                            element.attr("title",data);
                        });
                    }
                    
                });
                return "Click on a score to load";
            }else return element.attr("title");
        }
    });
    
});

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址