simonjefford / tinyprojects

One off scripts, small plugins etc which I find useful.

This URL has Read+Write access

commit  65d2eb90ae244ebaacd6e96e9a60213022ea1080
tree    9c8b2a6f331b6e2f0e70fdfa4761da6932884421
parent  7584f0a2d29bcfd49418000e0157f2a0945d9472
tinyprojects / scripts / greasemonkey / railslighthouselinker.js
100644 16 lines (15 sloc) 0.56 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// ==UserScript==
// @name Rails Lighthouse Linker
// @namespace http://sjjdev.com/lighthouselinker
// @include http://github.com/*/rails/commit/*
// ==/UserScript==
 
var pre = document.getElementsByClassName("message")[0].childNodes[0];
if (pre)
{
  var norm = pre.innerHTML.replace('\n', '')
  var results = norm.match(/\[#([0-9]+).*\]/);
  if (results)
  {
    pre.innerHTML = norm.replace(results[0], '\n<a href="http://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/' + results[1] + '">' + results[0] + '</a>\n\n')
  }
}