Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@billrichards
billrichards / jenkins-custom-theme.js
Last active April 26, 2021 11:50
For use with the jenkins `simple theme` plugin, this js modifies the left sidebar. It hides left nav links and moves some sections to the bottom.
function customJenkins() {
var url = window.location.href.replace(window.location.protocol, ''),
urls = ['//127.0.0.1:8080/','//jenkins:8080/','//jenkins:8080/view/all/builds','//127.0.0.1:8080/view/all/builds'];
if (urls.includes(url)) {
// hide most of the left nav links on the pages in the urls array
var dontHide = ['Manage Jenkins','Build History','New Item'];
try {
var tasks = document.getElementsByClassName('task');
for (var i = 0; i < tasks.length; i++) {
if (!dontHide.includes(tasks[i].innerText)) {
<!DOCTYPE HTML>
<html>
<head>
<style>
body {
background-color:#daaaaa;
}
.bright1 {background-color:green;}
.bright2 {background-color:blue;}
.bright3 {background-color:orange;}