-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAirport-Project.user.js
37 lines (35 loc) · 1.21 KB
/
Airport-Project.user.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// ==UserScript==
// @name Airport Project
// @namespace http://pythoner.work/
// @version 0.1
// @description Show project info card by hovering over it
// @author Haisheng HU
// @match http://*/*
// @grant GM_getResourceText
// @grant GM_addStyle
// @require http://code.jquery.com/ui/1.12.1/jquery-ui.js
// @resource jquicss http://code.jquery.com/ui/1.12.1/themes/smoothness/jquery-ui.css
// ==/UserScript==
(function() {
var newCSS = GM_getResourceText('jquicss');
GM_addStyle(newCSS);
GM_addStyle('.ui-tooltip {font-size:10pt;font-family:Calibri;}');
var reg = /ABD-\d{4,}/;
var titles = {};
$('div#body').on('mouseover', 'td, div, p, span, a', function(evt) {
var project = evt.target;
var href = project.href;
if (!reg.test($(project).text())) return;
if (titles[href]) return;
// open tooltip
project.title = '';
titles[href] = true;
$.get(href, null, function(data) {
project.title = data;
$(project).tooltip({content: function() {
return $(this).prop('title');
}});
$(project).tooltip('open');
});
});
})();