您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Override tooltip function
- // ==UserScript==
- // @name MyFigureCollection: instant tooltip
- // @namespace http://tampermonkey.net/
- // @version 0.1
- // @description Override tooltip function
- // @author Rafael Vuijk
- // @match http*://myfigurecollection.net/*
- // @grant none
- // ==/UserScript==
- (function() {
- 'use strict';
- var tooltip_index = null; // added to prevent duplicate tooltips
- $(".tbx-tooltip").each(function() {
- var $this=$(this), _move=function(e){
- if(!TB.tooltip){return false;}
- TB.tooltip.show().css({
- top:e.pageY>TB.window.height()/2+TB.window.scrollTop()?e.pageY-TB.tooltip.innerHeight()-10:e.pageY+20,left:e.pageX>TB.window.width()/2?e.pageX-TB.tooltip.innerWidth()-10:e.pageX+20
- });
- };
- $this.off(".tooltip")
- .on("mouseenter.tooltip",function(e) {
- _resetTooltip();
- var vars = _getVars($this).split(":"), index = vars[0]+":"+vars[1];
- tooltip_index = index;
- if (!(index in TB.cache.tooltip)) {
- TB.timer.tooltip = setTimeout(function(){
- if (tooltip_index == index) { // added extra check
- $.post(jroot+"/actions.php","commit=loadTooltip&objectId="+vars[1]+"&objectType="+vars[0],function(j){
- if(TB.timer.tooltip){
- if (tooltip_index == index) { // added extra check
- TB.cache.tooltip[index]=$("<div></div>").addClass("tooltip").appendTo("#content").html(j.htmlValues.TOOLTIP);
- TB.tooltip=TB.cache.tooltip[index]; _move(e);
- }
- }
- }, "json");
- }
- },0);
- } else {
- TB.tooltip=TB.cache.tooltip[index]; _move(e);
- }
- })
- .on("mousemove.tooltip",function(e){
- _move(e);
- })
- .on("mouseleave.tooltip",function(){
- _resetTooltip();
- });
- });
- })();