]> git.immae.eu Git - perso/Immae/Config/Nix.git/blobdiff - flakes/mypackages/overlays/gitweb/theme/gitweb.js
Squash changes containing private information
[perso/Immae/Config/Nix.git] / flakes / mypackages / overlays / gitweb / theme / gitweb.js
diff --git a/flakes/mypackages/overlays/gitweb/theme/gitweb.js b/flakes/mypackages/overlays/gitweb/theme/gitweb.js
new file mode 100644 (file)
index 0000000..72f3cfa
--- /dev/null
@@ -0,0 +1,27 @@
+function include(filename, onload) {
+  var head   = document.getElementsByTagName('head')[0];
+  var script = document.createElement('script');
+  script.src = filename;
+  script.type = 'text/javascript';
+  script.onload = script.onreadystatechange = function() {
+    if (script.readyState) {
+      if (script.readyState === 'complete' || script.readyState === 'loaded') {
+        script.onreadystatechange = null;
+        onload();
+      }
+    } 
+    else {
+      onload();
+    }
+  }
+  head.appendChild(script);
+}
+
+include('static/gitweb.js', function() {});
+include('//code.jquery.com/jquery-3.1.0.min.js', function() {
+  $("div.title").each(function(index, element) {
+    if ($(element).text() === "readme" || $(element).text() === " ") {
+      $(element).hide();
+    }
+  });
+});