Last active
December 22, 2015 08:48
-
-
Save seveniu/6446991 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==Tempermonkey Script== | |
// ==UserScript== | |
// @name My Fancy New Userscript | |
// @namespace http://use.i.E.your.homepage/ | |
// @version 0.1 | |
// @description enter something useful | |
// @match http://search.maven.org/* | |
// @require http://code.jquery.com/jquery-1.8.2.js | |
// @copyright 2012+, You | |
// ==/UserScript== | |
var flag = false; | |
$(document).on("click",".tooltip",function(){ | |
var groupId = $(this).find("#groupId").text(); | |
var artifactId = $(this).find("#artifactId").text(); | |
var version = $($(this).find("a").get("2")).text(); | |
var result = "<textarea rows='5' style='white-space:nowrap;overflow:scroll;width:300px'><dependency>\n <groupId>"+groupId+"</groupId>\n <artifactId>"+artifactId+"</artifactId>\n <version>"+version+"</version>\n</dependency></textarea><br/><button id='close_result'>关闭</button>"; | |
if(!flag) { | |
$("body").append("<div id='result_div' style='position:fixed;top:10%;left:30px;'></div>"); | |
flag=true; | |
} | |
$(this).css("font-weight","bold"); | |
$("#result_div").html(result); | |
$("#result_div").css("display","block"); | |
}); | |
$(document).on("click","#close_result",function(){ | |
$(".tooltip").css("font-weight","normal"); | |
$("#result_div").css("display","none"); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment