Skip to content

Instantly share code, notes, and snippets.

@Scimonster
Created May 15, 2015 09:00
Show Gist options
  • Save Scimonster/02cd5e1e901c19ab6ec3 to your computer and use it in GitHub Desktop.
Save Scimonster/02cd5e1e901c19ab6ec3 to your computer and use it in GitHub Desktop.
Show tag info while editing (SE)
// ==UserScript==
// @name Show tag info while editing
// @version 0.1
// @description While hovering over a tag while editing, show the tag's excerpt
// @author Scimonster
// @match http://*.stackexchange.com/*
// @match http://*.stackoverflow.com/*
// @match http://*.superuser.com/*
// @match http://*.serverfault.com/*
// @match http://*.askubuntu.com/*
// @match http://*.mathoverflow.net/*
// @match http://*.stackapps.com/*
// @grant none
// ==/UserScript==
function t(t) {
var e = $(t),
n = e.attr("href");
// if (!n || "/" != n.charAt(0)) return null;
var i = e.text();
return i.indexOf("*") > -1 ? null : (e.attr("title", ""), "/tags/" + encodeURIComponent(i) + "/subscriber-info")
}
function e(t, e) {
var n = $(t),
i = n.offset(),
a = n.outerHeight(),
o = {
"left": i.left
},
r = i.top + a,
s = i.left + e.outerWidth();
e.height() + r > $(window).height() + $(window).scrollTop() ? o.bottom = $(window).height() - i.top - 8 : o.top = r;
var c = Math.max(1024, $(window).width());
return s > c && (o.left -= s - c), o
}
var to = setInterval(function(){
if(!StackExchange.helpers.MagicPopup) return;
clearInterval(to);
StackExchange.helpers.MagicPopup({
"selector": ".tag-editor .post-tag:not(.user-tag,.no-tag-menu)",
"id": "tag-menu",
"getUrl": t,
"showing": e,
"shown": function(t, e) {
//n && n(e, $(t).text())
}
})
}, 500)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment