aboutsummaryrefslogtreecommitdiff
path: root/dev
diff options
context:
space:
mode:
authorMaxime Dénès2017-10-09 15:40:30 +0200
committerMaxime Dénès2017-10-09 15:40:30 +0200
commit82ebd162a6b31d1056eb630b9805cdcb83b8fa04 (patch)
tree8acc86eec77b8733fcebb5e01a8758d36979d35e /dev
parent81753dcda29bf7d7ecd6c8c0ddb3347f4cd49766 (diff)
parentc9601079959950cf47fb99d0e7c0e4fa6ce96ece (diff)
Merge PR #1115: Autolink to Github PRs from Bugzilla
Diffstat (limited to 'dev')
-rw-r--r--dev/Bugzilla_Coq_autolink.user.js25
1 files changed, 25 insertions, 0 deletions
diff --git a/dev/Bugzilla_Coq_autolink.user.js b/dev/Bugzilla_Coq_autolink.user.js
new file mode 100644
index 0000000000..ed056021b3
--- /dev/null
+++ b/dev/Bugzilla_Coq_autolink.user.js
@@ -0,0 +1,25 @@
+// ==UserScript==
+// @name Bugzilla Coq autolink
+// @namespace CoqScript
+// @include https://coq.inria.fr/bugs/*
+// @description Makes #XXXX into links to Github Coq PRs
+// @version 1
+// @grant none
+// ==/UserScript==
+
+var regex = /#(\d+)/g;
+var substr = '<a href="https://github.com/coq/coq/pull/$1">$&</a>';
+
+function doNode(node)
+{
+ node.innerHTML = node.innerHTML.replace(regex,substr);
+}
+
+var comments = document.getElementsByClassName("bz_comment_table")[0];
+var pars = comments.getElementsByClassName("bz_comment_text");
+
+for(var j=0; j<pars.length; j++)
+{
+ doNode(pars[j]);
+}
+