30

Obsolete: The links are dead, but the forked script in the answer(s) may still work.

Screenshot / Code Snippet

Partial screenshot of additions

About

Add revision links, and timeline links on all questions post menus.
Intended for development features, probably useless when the feature is actually implemented.

License

probably CC-BY-SA

Download

http://userscripts.org/scripts/show/97069

Platform

Tested only on Firefox 3.6, Google Chrome 10 dev, Opera 11
(Linux versions)

Contact

S.Mark - mark at my-mm dot org

Code

Userscript (javascript) using existing Stack Overflow jQuery

source - http://userscripts.org/scripts/review/97069

5
  • Note: if you have SEModifications installed, this userscript isn't needed. Feb 25, 2011 at 21:31
  • Hey @Mark, FYI possible bug.
    – Lazer
    Mar 5, 2011 at 8:21
  • 1
    Thanks @Lazer, I have updated my script, please install it again. (I have moved timeline link to another line.)
    – YOU
    Mar 5, 2011 at 9:12
  • nice one! but now superseded by SEModifications which adds further features Sep 17, 2011 at 10:51
  • 1
    If you're still maintaining this, I'd suggest changing the ID detection to something like id=$(this).find('a[class="short-link"]').attr("href").replace(/\/[aq]\//, "").replace(/\/\d+/, "");. That way it works on sites where you don't have an account or aren't logged in.
    – mmyers
    Apr 2, 2013 at 16:02

1 Answer 1

9

Here's a small and simpler updated fork. It adds only the timeline link:

// ==UserScript==
// @name          Stack Exchange Timeline Link
// @namespace     stackoverflow
// @description   Add a 'timeline' link to Stack Exchange / Stack Overflow posts - based on http://stackapps.com/questions/2047/add-timeline-and-revisions-links/4238#4238
// @include       http*//*stackexchange.com/*
// @include       http*//*stackoverflow.com/*
// @include       http*//*serverfault.com/*
// @include       http*//*superuser.com/*
// @include       http*//*askubuntu.com/*
// @include       http*//*mathoverflow.net/*
// @include       http*//*onstartups.com/*
// @include       http*//*nothingtoinstall.com/*
// @include       http*//*seasonedadvice.com/*
// @include       http*//*stackapps.com/*
// @exclude       http*//chat*stackexchange.com/*
// @exclude       http*//chat*stackoverflow.com/*
// @exclude       http*//api*stackexchange.com/*
// @exclude       http*//data*stackexchange.com/*
// @exclude       */reputation
// @grant         none
// ==/UserScript==

(function(){
    var start=function(){
        $(".post-menu").each(function(){
            id = $(this).find("a.short-link")[0].href.replace(/^.*\/a\//, "").replace(/\/\d+(?:#.*)?$/, "").replace(/\D+/, "");
            rlink = $("<span class='lsep'>|</span><a href='/posts/"+id+"/timeline'>timeline</a>");
            $(this).append(rlink);
        });
    };

    var script = document.createElement("script");
    script.type = "text/javascript";
    script.textContent = "(" + start + ")();";
    document.body.appendChild(script);
})();
4
  • 2
    Here's a substantial update that adds support for all Stack Exchange sites, including Meta sites for the Trilogy and sites such as Ask Ubuntu which have different domain names. I've also removed the return false; at the end of the start function because answers now have their own timelines. gist.github.com/bwDraco/85a5806b0d0681efc596
    – bwDraco
    Jan 8, 2016 at 3:58
  • @bwDraco thanks for the update man! I'll be editing those in my end as well. :)
    – cregox
    Jan 8, 2016 at 12:32
  • 1
    Stack Exchange doesn't officially support HTTPS, but it mostly works. Your include patterns currently only match HTTP. Mar 13, 2016 at 1:37
  • @JeffreyBosboom so true! I thought removing http: might work, but that backfires too hard - looks almost every site then gets included. Looks like replacing : with * worked fine, though. Hope that's good enough!
    – cregox
    Mar 13, 2016 at 19:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .