137cf96390c0caa698f1d02334f1c87b6514e93e
3 /* load original gitweb.js */
4 var s
= d
.createElement("script");
5 s
.type
= "text/javascript";
6 s
.src
= "static/gitweb.js";
9 /* add separators between .page_nav links split by br */
10 [].slice
.call(d
.querySelectorAll(".page_nav a+br")).forEach(function(v
) {
11 v
.parentNode
.replaceChild(d
.createTextNode(" | "),v
)
16 location
.search
.substring(1).split(";").forEach(function(p
) {
17 var kv
= p
.split("=");
20 if (q
.p
&& (!q
.a
|| q
.a
== "summary")) {
21 var x
= new XMLHttpRequest();
22 x
.onreadystatechange = function() {
23 if (x
.readyState
== XMLHttpRequest
.DONE
&& x
.status
== 200) {
24 var target
= d
.querySelector(".projects_list");
26 var e
= new DOMParser().parseFromString(x
.response
, "text/html");
27 [].slice
.call(e
.getElementsByTagName("a")).forEach(function(a
) {
28 if (a
.host
== location
.host
) {
29 a
.host
= "github.com";
30 a
.pathname
= "/"+q
.p
+"/blob/master"+a
.pathname
;
33 target
.parentNode
.insertBefore(e
.body
.firstChild
, target
.nextSibling
);
37 x
.open("GET", "https://api.github.com/repos/"+q
.p
+"/readme", true);
38 x
.setRequestHeader("Accept", "application/vnd.github.v3.html");