Created
July 11, 2011 14:01
-
-
Save yvesvanbroekhoven/1075908 to your computer and use it in GitHub Desktop.
Cephas XP
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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