// ==UserScript==
// @name Stack Exchange: Add Timeline and Revisions links to posts
// @description Adds links to posts to always show history and links to questions to show the Timeline".
// @namespace StackExchange
// @match *://*.askubuntu.com/questions/*
// @match *://*.mathoverflow.net/questions/*
// @match *://*.serverfault.com/questions/*
// @match *://*.stackapps.com/questions/*
// @match *://*.stackexchange.com/questions/*
// @match *://*.stackoverflow.com/questions/*
// @match *://*.superuser.com/questions/*
// @version 1.3
// @history 1.3 SE changed Timelines. Answers were separated out from the question timeline.
// @history 1.2 Updated match list
// @history 1.1 Added revisions link
// @grant none
// ==/UserScript==
$(".post-menu").each ( function (J) {
var jThis = $(this);
var href = jThis.find ('a[class="short-link"]').attr ("href");
var idMtch = href.split (/[qa]\/(\d+)/);
if (idMtch.length > 2) {
var id = idMtch[1];
jThis.append (
'|revisions'
);
jThis.append (
'|timeline'
);
}
} );
$(".revcell3.vm>div").each (function () {
//-- Looks like a timebomb...
guid = $(this).find ("a").attr ("href").match (/\w{8} (?:-\w{4} ){3}-\w{12}/)[0];
$(this).prepend ('link|');
} );