Last active
May 23, 2018 07:40
-
-
Save vyznev/1f558af47f205d85f1f3862060cd1628 to your computer and use it in GitHub Desktop.
Stack Exchange timeline link user script
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 Stack Exchange timeline link | |
// @namespace http://vyznev.net/ | |
// @description Adds a link to the question timeline on Stack Exchange | |
// @include *stackexchange.com/questions/* | |
// @include *stackoverflow.com/questions/* | |
// @include *superuser.com/questions/* | |
// @include *serverfault.com/questions/* | |
// @include *stackapps.com/questions/* | |
// @include *mathoverflow.net/questions/* | |
// @include *askubuntu.com/questions/* | |
// @version 1.3 | |
// @grant none | |
// @noframes | |
// ==/UserScript== | |
var injector = document.createElement('script'); | |
injector.textContent = 'window.StackExchange && StackExchange.ready( ' + function () { | |
$('#question, .answer').each( function () { | |
var $this = $(this); | |
var id = $this.data( $this.is('#question') ? 'questionid' : 'answerid' ); | |
if (! id) return; | |
var html = '<span class="lsep">|</span><a class="userscript-timeline" href="/posts/' + Number(id) + '/timeline" title="timeline for this post">timeline</a>'; | |
$this.find('.post-menu').append(html); | |
} ); | |
} + ' )'; | |
document.body.appendChild(injector); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment