Skip to content

Instantly share code, notes, and snippets.

@jagregory
Created June 6, 2012 04:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jagregory/2879903 to your computer and use it in GitHub Desktop.
Save jagregory/2879903 to your computer and use it in GitHub Desktop.
function refreshData(time){
if(time != undefined){
clearTimeouts();
}
refreshNextMatch(time);
refreshGPSData(time);
refreshTopNews(time);
}
function refreshNextMatch(time){
if(time == undefined) time = 1000*60*60;
self.timeouts["nextMatch"] = setTimeout(function(){
getNextMatch();
refreshNextMatch();
}, time);
}
function refreshGPSData(time){
if(time == undefined) time = 1000*20;
self.timeouts["gpsData"] = setTimeout(function(){
getLatestGPSData();
refreshGPSData();
}, time);
}
function refreshTopNews(time){
if(time == undefined) time = 1000*60*60;
self.timeouts["topNews"] = setTimeout(function(){
getTop5NewsSummaries();
refreshTopNews();
}, time);
}
function init() {
app.showAjaxScreen(true);
app.home().loadSingleMatchFunction = loadSingleMatch;
app.home().refresh = refreshData;
getNextMatch();
getLatestGPSData();
getTop5NewsSummaries();
refreshData();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment