Created
March 29, 2016 18:08
-
-
Save shu8/7845a87e2ac63f7301ea8662978d1bda to your computer and use it in GitHub Desktop.
A userscript that adds arrows on linked posts in the sidebar to show whether they are being linked to or from
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
// ==UserScript== | |
// @name Mark linked posts as whether they are linked to or linked from | |
// @namespace http://stackexchange.com/users/4337810/ | |
// @version 1.0 | |
// @description A userscript that adds arrows on linked posts in the sidebar to show whether they are being linked to or from | |
// @author ᔕᖺᘎᕊ (http://stackexchange.com/users/4337810/) | |
// @match *://*.stackoverflow.com/* | |
// @match *://*.stackexchange.com/* | |
// @match *://*.superuser.com/* | |
// @match *://*.serverfault.com/* | |
// @match *://*.askubuntu.com/* | |
// @match *://*.stackapps.com/* | |
// @match *://*.mathoverflow.net/* | |
// @grant none | |
// ==/UserScript== | |
setTimeout(function() { | |
$('.linked .spacer a.question-hyperlink').each(function() { | |
var id = $(this).attr('href').split('/')[4].split('?')[0]; | |
if($('a[href*="' + id + '"]').not('.spacer a').length) { | |
$(this).append('<span title="Current question links to this question" style="color:black;font-size:15px;margin-left:5px;">↗</span>'); | |
} else { | |
$(this).append('<span title="Current question is linked from this question" style="color:black;font-size:15px;margin-left:5px;">↙</span>'); | |
} | |
}); | |
}, 2000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment