Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvements and some bug fixes to make the page compact and tidy. #85

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
65 changes: 44 additions & 21 deletions doony.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ body.yui-skin-sam,
.yui-skin-sam p,
.yui-skin-sam select {
font-family: Helvetica Neue, Helvetica, Arial, sans-serif;
font-size: 13px;
font-size: 12px;
color: #333;
}

Expand Down Expand Up @@ -445,7 +445,7 @@ fieldset[disabled] .btn-link:focus {
}

.btn-lg {
padding: 10px 16px;
padding: 10px 12px;
font-size: 18px;
line-height: 1.33;
border-radius: 6px;
Expand Down Expand Up @@ -587,7 +587,7 @@ input[type="password"],
select,
textarea,
.CodeMirror {
font-size: 16px;
font-size: 12px;
border-radius: 3px;
border: 1px solid #ccc;
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
Expand All @@ -612,20 +612,17 @@ textarea {
border-bottom: 1px solid #ccc;
}

.yui-skin-sam #top-panel img {
display: none;
}

.yui-skin-sam #search-box {
font-size: 16px;
font-size: 12px;
padding: 5px 10px;
background-image: none;
}

/******************* side panel styles ***********************/

#tasks {
margin-top: 5px;
font-size: 16px;
margin-right: 30px;
margin: 5px;
font-size: 12px;
padding-left: 0;
}

Expand All @@ -640,7 +637,7 @@ textarea {
}

.task a:nth-child(n+1) {
padding: 10px 30px 5px 0;
padding: 8px 26px 8px 0;
display: inline-block;
}

Expand All @@ -651,15 +648,19 @@ textarea {

/* make the link target bigger */
#buildHistory .model-link {
padding: 10px 16px 10px 0;
padding: 0px 0px 0px 0;
}

#buildHistory .pane.stripped {
table-layout: fixed;
}

#buildHistory .pane-header {
font-size: 16px;
font-size: 12px;
}

#buildHistory .build-row td:not(.pane-header) {
padding: 10px 0 10px 10px;
padding: 5px 0 5px 5px;
}

.doony-canvas {
Expand Down Expand Up @@ -694,11 +695,15 @@ textarea {
body > pre,
#main-panel > pre,
.console-output {
font-size: 14px;
background-color: #111;
color: #eee;
font-size: 12px;
background-color: #252525;
color: #C2E1FA;
padding: 10px 10px 30px;
border-radius: 3px;
/*box-shadow*/
box-shadow: 0 1px 10px rgba(0, 0, 255, 0.40);
/*background-clip*/
background-clip: padding-box;
}

/**
Expand Down Expand Up @@ -739,7 +744,11 @@ a.yuimenulabel, a.yuimenuitemlabel,

#doony-title {
color: #fff;
margin: 5px 10px;
margin: 0px 10px;
}

#doony-logo {
height: 33px;
}

#jenkins-home-link {
Expand All @@ -760,7 +769,7 @@ a.yuimenulabel, a.yuimenuitemlabel,
padding: 20px 30px 20px 25px;
border-left: 5px solid #eee;
font-weight: bold;
font-size: 16px;
font-size: 12px;
display: inline-block;
}

Expand All @@ -779,8 +788,22 @@ a.yuimenulabel, a.yuimenuitemlabel,
display: block;
}

.doony-circle {
#projectstatus .doony-circle,
.build-caption.page-headline .doony-circle {
border-radius: 50%;
width: 24px !important;
height: 24px !important;
}

.status_success .doony-circle,
.status_unstable .doony-circle,
.status_failed .doony-circle {
border-radius: 0% !important;
}

.status_success, .status_unstable, .status_failed {
float: left;
width: 33%;
}

.doony-circle-aborted {
Expand Down
21 changes: 18 additions & 3 deletions doony.js
Original file line number Diff line number Diff line change
Expand Up @@ -433,19 +433,34 @@ jQuery(function($) {
$("#main-panel").prepend(div);
};

var isUrlExists = function (url) {
var http = new XMLHttpRequest();
http.open('HEAD', url, false);
http.send();
return http.status!=404;
};


var domain = getSubdomain(window.location.hostname);
var logoFile = "/userContent/logo.png"
var titleSeparator = " - "
var logoHtml = ""
// Load the Logo file, only if exists.
// CSS for #ID "doony-logo" will limit the height of the logo to 33px.
if (isUrlExists(logoFile)) {
logoHtml = "<img src='" + logoFile + "' id='doony-logo'>" + titleSeparator
}
var titleLink = "<div id='doony-title'>" + logoHtml + domain + "</div>"
var doonyTitleLink = $('#jenkins-home-link');
doonyTitleLink.html(titleLink);
if (doonyTitleLink.length === 0) {
doonyTitleLink = $("#top-panel a").first();
doonyTitleLink.html("<div id='doony-title'>" + domain + "</div>");
} else {
doonyTitleLink.html(domain);
if (doonyTitleLink.parent("td").length === 0) {
// ugh, hack
doonyTitleLink.addClass("new-header-link");
}
}

var color = colors[Math.abs(hashCode(domain)) % colors.length];
$("#top-panel, #header").css('background-color', color);

Expand Down