Skip to content

Instantly share code, notes, and snippets.

@vctls
Created September 3, 2018 07:42
Show Gist options
  • Save vctls/26883c250d89bca0630d8712ab04fffd to your computer and use it in GitHub Desktop.
Save vctls/26883c250d89bca0630d8712ab04fffd to your computer and use it in GitHub Desktop.
Display Jenkins pipeline options and script editor in full width.
// ==UserScript==
// @name Wide Jenkins
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Display pipeline options in wide screen.
// @author Victor Toulouse
// @match http://jenkins-ci.org
// @grant none
// ==/UserScript==
/**
* Wait for the script editor to appear.
*/
function check(changes, observer) {
if(document.querySelector('tr.dropdownList-container:nth-child(215) > td:nth-child(1)')) {
observer.disconnect();
document.querySelector('tr.dropdownList-container:nth-child(215) > td:nth-child(1)').style.display = 'none';
document.querySelector('tr.dropdownList-container:nth-child(215) > td:nth-child(2)').colSpan = '3';
}
}
(function() {
'use strict';
document.querySelector('.container').style.width = '100%';
document.querySelector('.container').style.padding = '0';
document.querySelector('.col-md-offset-2').style.width = '100%';
document.querySelector('.col-md-offset-2').style.margin = '0';
(new MutationObserver(check)).observe(document, {childList: true, subtree: true});
})();
@unrue
Copy link

unrue commented Jul 15, 2019

How I have to use that script?

@vctls
Copy link
Author

vctls commented Jul 15, 2019

@unrue you need to install a browser extension like Tampermonkey or Greasemonkey then add the script to it.
But you should use the improved version by @a2intl : https://gist.github.com/a2intl/293a76ae3323ec21d7cdceb6f7cd63af

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment