Skip to content

Commit

Permalink
Merge branch 'status' into gh-pages
Browse files Browse the repository at this point in the history
Conflicts:
	_layouts/default.html
  • Loading branch information
holman committed Jul 23, 2011
2 parents 6be1b17 + 803084f commit b31436c
Show file tree
Hide file tree
Showing 6 changed files with 283 additions and 14 deletions.
20 changes: 19 additions & 1 deletion _layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ <h1>{{ page.title }}</h1>
<ul>
{% for cat in (page.sidebar_cats) %}
<li class="js-topic">
{% if cat == "github_resources" %}
{% if cat == 'github_resources' %}
<h3><a href="#">GitHub Resources</a></h3>
{% else %}
<h3><a href="#">{{ cat | replace:'_',' ' | capitalize }}</a></h3>
Expand All @@ -72,6 +72,24 @@ <h3><a href="#">{{ cat | replace:'_',' ' | capitalize }}</a></h3>
<div class="sidebar-module">
<p>This website is <a href="http://github.com/github/help.github.com#readme" target="_blank">open source</a>. Please help us by forking the project and adding to it.</p>
</div>

<div class="sidebar-module">
<div class="status-box loading">
<h4>Site Status:</h4>
<a href="http://status.github.com">Fetching status <img class="status-anim" src="/images/load-anim.gif" height="10" width="43" alt="loading"/></a>
</div>
</div> <!-- /sidebar-module -->

<div class="sidebar-module">
<div class="tip-box">
<h4>GitHub Tips</h4>
<a href="#" class="next">Next Tip</a>
<div class="tip-body">
<span class="load"><img src="/images/indicator.gif" width="16" height="16" /></span>
<p>Loading tip...</p>
</div>
</div>
</div> <!-- /help-sidebar-module -->
</div><!-- /sidebar-shell -->

</div><!-- #wrapper -->
Expand Down
195 changes: 194 additions & 1 deletion css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,6 @@ img.top-margin {
/* Bootcamp module */
/****************************/


.bootcamp-help {
margin: 0 0 20px 0;
}
Expand Down Expand Up @@ -362,3 +361,197 @@ img.top-margin {

/* @end */

/****************************/
/* Tip Widget */
/****************************/

.sidebar-module > .tip-box {
position: relative;
overflow: hidden;
display: block;
width: 100%;
}

.sidebar-module > .tip-box h4 {
padding: 8px 10px;
background-color: #f1f1f1;
background-image: -moz-linear-gradient(top, #f1f1f1, #e1e1e1);
background-image: -ms-linear-gradient(top, #f1f1f1, #e1e1e1);
background-image: -o-linear-gradient(top, #f1f1f1, #e1e1e1);
background-image: -webkit-gradient(linear, left top, left bottom, from(#f1f1f1), to(#e1e1e1));
background-image: -webkit-linear-gradient(top, #f1f1f1, #e1e1e1);
background-image: linear-gradient(top, #f1f1f1, #e1e1e1);
filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#f1f1f1', EndColorStr='#e1e1e1');
color: #666;
text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);
font-size: 12px;
border: solid #CACACA;
border-width: 1px;
margin: 0px;
}

.sidebar-module > .tip-box a.next {
padding: 7px 10px 8px;
position: absolute;
top: 1px;
right: 1px;
font-size: 11px;
color: #666;
font-weight: bold;
border-left: 1px solid #CACACA;
border-top: 1px solid #f2f2f2;
background-color: #eaeaea;
background-image: -moz-linear-gradient(top, #eaeaea, #d6d6d6);
background-image: -ms-linear-gradient(top, #eaeaea, #d6d6d6);
background-image: -o-linear-gradient(top, #eaeaea, #d6d6d6);
background-image: -webkit-gradient(linear, left top, left bottom, from(#eaeaea), to(#d6d6d6));
background-image: -webkit-linear-gradient(top, #eaeaea, #d6d6d6);
background-image: linear-gradient(top, #eaeaea, #d6d6d6);
filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#eaeaea', EndColorStr='#d6d6d6');
}

.sidebar-module > .tip-box a.next:hover {
border-top: 1px solid #efefef;
background-color: #e5e5e5;
background-image: -moz-linear-gradient(top, #e5e5e5, #cecece);
background-image: -ms-linear-gradient(top, #e5e5e5, #cecece);
background-image: -o-linear-gradient(top, #e5e5e5, #cecece);
background-image: -webkit-gradient(linear, left top, left bottom, from(#e5e5e5), to(#cecece));
background-image: -webkit-linear-gradient(top, #e5e5e5, #cecece);
background-image: linear-gradient(top, #e5e5e5, #cecece);
filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#e5e5e5', EndColorStr='#cecece');
}

.sidebar-module div.tip-body {
border: solid #CACACA;
border-width: 0px 1px 1px 1px;
background-color: #FAFAFB;
padding: 0px 10px;
overflow: hidden;
}

.sidebar-module .load {
padding: 13px 5px 0 0;
float: left;
}

/* @end */

/****************************/
/* Bootcamp module */
/****************************/

.sidebar-module > .status-box {
position: relative;
overflow: hidden;
display: block;
width: 100%;
}

.sidebar-module > .status-box h4 {
padding: 7px 10px;
background-color: #f1f1f1;
background-image: -moz-linear-gradient(top, #f1f1f1, #e1e1e1);
background-image: -ms-linear-gradient(top, #f1f1f1, #e1e1e1);
background-image: -o-linear-gradient(top, #f1f1f1, #e1e1e1);
background-image: -webkit-gradient(linear, left top, left bottom, from(#f1f1f1), to(#e1e1e1));
background-image: -webkit-linear-gradient(top, #f1f1f1, #e1e1e1);
background-image: linear-gradient(top, #f1f1f1, #e1e1e1);
filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#f1f1f1', EndColorStr='#e1e1e1');
color: #666;
text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);
font-size: 12px;
border-right: 1px solid #cacaca;
width: 70px;
border: solid #CACACA;
border-width: 1px 0px 1px 1px;
float: left;
margin: 0px;
}

.sidebar-module .all-good a,
.sidebar-module .all-good h4 {
height: 18px;
}

.sidebar-module > .status-box a {
background: transparent url(/images/status_sprites.png) 0 0 repeat-x;
float: left;
padding: 7px 10px;
margin: 0px;
display: block;
width: 219px;
border: 1px solid #9abe85;
padding-left: 10px;
font-weight: bold;
font-size: 12px;
text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);
}

.sidebar-module > .status-box a:hover {
text-decoration: none;
}

.sidebar-module .good a {
background-position: 0px 0px; /* green */
border-color: #88c185;
color: #005d07;
}

.sidebar-module .good a:hover {
background-position: 0px -33px;
}

.sidebar-module .scheduled a {
background-position: 0px -66px; /* yellow */
border-color: #e8af01;
color: #a16701;
}

.sidebar-module .scheduled a:hover {
background-position: 0px -99px;
}

.sidebar-module .minorproblem a {
background-position: 0px -132px; /* orange */
border-color: #f16f00;
color: #932a00;
}

.sidebar-module .minorproblem a:hover {
background-position: 0px -165px;
}

.sidebar-module .majorproblem a {
background-position: 0px -198px; /* red */
border-color: #bb493b;
color: #751711;
text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
}

.sidebar-module .majorproblem a:hover {
background-position: 0px -231px;
}

.sidebar-module .loading a {
background-position: 0px -264px; /* red */
border-color: #888;
color: #4d4d4d;
}

.sidebar-module .loading a:hover {
background-position: 0px -297px;
}

.sidebar-module img.status-anim {
display: none
}

.sidebar-module .loading img.status-anim {
display: inline;
float: right;
margin-top: 4px;
position: relative;
}

/* @end */
Binary file added images/indicator.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/load-anim.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/status_sprites.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
82 changes: 70 additions & 12 deletions js/help.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,72 @@
$(document).ready(function(){
$(".more-info h4").click(function () {
var contentdiv = $(this).parent().find(".more-content")
var h4 = $(this).parent().find("h4")
h4.toggleClass("compressed expanded")
if (contentdiv.is(":hidden")) {
contentdiv.slideDown("50")
} else {
contentdiv.slideUp("50")
}
})
});
/*
* Displays a new Tip.
*
* resp - the Response hash
* tip - the String tip to display
*/
function tip(resp){
$('.tip-body .load').hide()
$('.tip-body > p').html(resp['tip'])
}

/*
* Updates the status div.
*
* resp - the Response hash
* status - the status of GitHub
*/
function updateStatus(resp){
current = resp['status']
if (current == 'majorproblem')
message = "Major service disruption"
else if (current == 'minorproblem')
message = "Minor service disruption"
else
message = "All systems operational"

$('.status-box').removeClass('loading')
$('.status-box').addClass(current)
$('.status-box > a').text(message)
}

$(document).ready(function(){
$(".more-info h4").click(function () {
var contentdiv = $(this).parent().find(".more-content")
var h4 = $(this).parent().find("h4")
h4.toggleClass("compressed expanded")
if (contentdiv.is(":hidden")) {
contentdiv.slideDown("50")
} else {
contentdiv.slideUp("50")
}
})

$.ajax({
url: 'http://status.github.com/current-status.json',
type: 'GET',
dataType: 'jsonp',
error: function(resp){
}
})

var new_tip = function() {
$.ajax({
url: 'https://github.com/tips?callback=tip',
type: 'GET',
dataType: 'jsonp',
error: function(resp){
$('.tip-body > p').text('There was a problem loading your tip.')
}
})
return false
}

$('.tip-box > a').click(function() {
$('.tip-body .load').show()
$('.tip-body > p').text('Loading next tip...')
new_tip()
return false
})

new_tip()
});

0 comments on commit b31436c

Please sign in to comment.