Skip to content

Instantly share code, notes, and snippets.

@shu8
Created March 29, 2016 18:08
Show Gist options
  • Save shu8/7845a87e2ac63f7301ea8662978d1bda to your computer and use it in GitHub Desktop.
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
// ==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;">&nearr;</span>');
} else {
$(this).append('<span title="Current question is linked from this question" style="color:black;font-size:15px;margin-left:5px;">&swarr;</span>');
}
});
}, 2000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment