Skip to content

Instantly share code, notes, and snippets.

@postadelmaga
Last active September 17, 2017 12:42
Show Gist options
  • Save postadelmaga/70d67b74eff024f1e0b24e3d4ea4b040 to your computer and use it in GitHub Desktop.
Save postadelmaga/70d67b74eff024f1e0b24e3d4ea4b040 to your computer and use it in GitHub Desktop.
Rambox - JIRA Software service
function removeElement(el) {
if (el) {
el.remove();
}
}
function removeElementById(id, parent = false) {
var el = document.getElementById(id);
if (el && parent) {
el = el.parentElement;
}
removeElement(el);
}
function removeElementByClass(name) {
var el = document.getElementsByClassName(name);
if (el.length > 0) {
el[0].remove();
}
}
function setToolbar() {
// Logo
var logo = document.getElementById('logo');
var img = logo.querySelector('img');
img.src = 'https://www.atlassian.com/assets/img/icons/imkt/imkt-navbar__charlie-logo.svg';
img.style.height = '100px';
// Clean
removeElementByClass('aui-header-before');
removeElementById('home_link',true);
removeElementById('browse_link');
removeElementById('greenhopper_menu');
removeElementById('create-menu');
removeElementById('jira-header-feedback-link');
removeElementById('system-help-menu');
}
function getBigImage(url){
var parser = document.createElement('a');
parser.href = url;
return parser.protocol +'//' + parser.host + parser.pathname;
}
function setIssuePage(){
if (document.baseURI.search('/browse') === -1){
return ;
}
// Issue details: remove padding
if (img = document.querySelector('#assignee-val img')) {
document.querySelector('.issue-header-content .aui-page-header-image .aui-avatar-inner img').src = getBigImage(img.src);
// removeElementById('viewissuesidebar');
}
removeElementById('viewissue-devstatus-panel');
removeElementById('greenhopper-agile-issue-web-panel_heading');
removeElementByClass('aui-sidebar-wrapper');
removeElementByClass('toolbar-split toolbar-split-right');
var el = document.getElementsByClassName('aui-page-panel')
if (el.length > 0) {
el[0].style.paddingLeft = '0px';
}
}
function setPage() {
setToolbar();
setIssuePage();
removeElementByClass('dashboard-tabs');
// workaround issues menu hidden
setTimeout(setBodyWidth, 250);
}
function setBodyWidth() {
document.body.style.minWidth = '400px';
}
function setFinal() {
// setInterval(function(){setPage();}, 400);
}
document.onload = setPage();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment