diff --git a/background.js b/background.js index 25504aa..853c7af 100644 --- a/background.js +++ b/background.js @@ -61,6 +61,7 @@ function checkResponse() { var response = JSON.parse(xhr.responseText); var topStatus = -1; if (response.jobs) { + //API call executed against a view of potentially multiple jobs jobs = response.jobs; if (localStorage.sorting == 'status') { jobs.sort(sortByStatus); @@ -69,6 +70,14 @@ function checkResponse() { } for (var i in response.jobs) topStatus = Math.max(topStatus, STATUSES[response.jobs[i].color]); + } else if (response.color) { + //API call executed against a single job + jobs = [{ + name : response.name, + url : response.url, + color : response.color + }]; + topStatus = STATUSES[response.color]; } handleSuccess(topStatus); return; diff --git a/style.css b/style.css index b792db5..725e1cc 100644 --- a/style.css +++ b/style.css @@ -64,7 +64,11 @@ input[type=button] { border-radius: 2px; padding: 5px; background: -webkit-gradient(linear, left top, left bottom, from(#eee), to(#ccc)); +} + +input[type=button]:active { + border: 1px inset #999; } div.optionform {