Skip to content

Instantly share code, notes, and snippets.

@yvesvanbroekhoven
Created July 11, 2011 14:01
Show Gist options
  • Save yvesvanbroekhoven/1075908 to your computer and use it in GitHub Desktop.
Save yvesvanbroekhoven/1075908 to your computer and use it in GitHub Desktop.
Cephas XP
window.CEPHAS = {
init: function(){
this.autoRefresh(10000);
this.statusUpdate();
this.simonizer();
},
/*
* Auto refresh every x ms
*/
autoRefresh: function(ms){
setTimeout(function(){
window.location.reload();
}, ms);
},
/*
* Status update in header
*/
statusUpdate: function(){
var $status = $("#cephas .status");
var not_working_statuses = [
"sippin' some Bacardi",
"doing your laundry",
"preparing dinner for the team",
"watching TV",
"playing Puzzle Bobble",
"in bed with your girlfriend",
"waiting for the weekend to begin",
"taking a shower",
"randomly putting status messages",
"googling",
"getting jiggy with it",
"hi-fiving robocop",
"exterminating ants",
"taking a nap"
];
var $working = $(".list .working");
if ($working.length) {
$status.text($working.text());
} else {
var rnd = Math.round(Math.random() * (not_working_statuses.length - 1));
$status.text(not_working_statuses[rnd]);
}
},
/*
* Random Simon picture
*/
simonizer: function(){
var rnd = Math.round(Math.random() * 1) + 1;
$("#simon").css({
"background-image": "url(http://dl.dropbox.com/u/1345001/simon-" + rnd + ".jpg)"
});
}
};
window.CEPHAS.init();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment