diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2019-01-03 15:01:52 +0100 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2019-01-03 15:01:52 +0100 |
commit | cf80b4f24e96e7d6e40845ac1fe206fc67a20b12 (patch) | |
tree | 21999356424ca66ff89532eec5594cd457492290 /virtual/packages/gitweb/gitweb.js | |
parent | 9f944a58aa12729d1699134ed9370ffa5f9a41b9 (diff) | |
download | Nix-cf80b4f24e96e7d6e40845ac1fe206fc67a20b12.tar.gz Nix-cf80b4f24e96e7d6e40845ac1fe206fc67a20b12.tar.zst Nix-cf80b4f24e96e7d6e40845ac1fe206fc67a20b12.zip |
Add gitweb service
Diffstat (limited to 'virtual/packages/gitweb/gitweb.js')
-rw-r--r-- | virtual/packages/gitweb/gitweb.js | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/virtual/packages/gitweb/gitweb.js b/virtual/packages/gitweb/gitweb.js new file mode 100644 index 0000000..72f3cfa --- /dev/null +++ b/virtual/packages/gitweb/gitweb.js | |||
@@ -0,0 +1,27 @@ | |||
1 | function include(filename, onload) { | ||
2 | var head = document.getElementsByTagName('head')[0]; | ||
3 | var script = document.createElement('script'); | ||
4 | script.src = filename; | ||
5 | script.type = 'text/javascript'; | ||
6 | script.onload = script.onreadystatechange = function() { | ||
7 | if (script.readyState) { | ||
8 | if (script.readyState === 'complete' || script.readyState === 'loaded') { | ||
9 | script.onreadystatechange = null; | ||
10 | onload(); | ||
11 | } | ||
12 | } | ||
13 | else { | ||
14 | onload(); | ||
15 | } | ||
16 | } | ||
17 | head.appendChild(script); | ||
18 | } | ||
19 | |||
20 | include('static/gitweb.js', function() {}); | ||
21 | include('//code.jquery.com/jquery-3.1.0.min.js', function() { | ||
22 | $("div.title").each(function(index, element) { | ||
23 | if ($(element).text() === "readme" || $(element).text() === " ") { | ||
24 | $(element).hide(); | ||
25 | } | ||
26 | }); | ||
27 | }); | ||