Skip to content

Instantly share code, notes, and snippets.

@plucury
Created November 28, 2013 08:04
Show Gist options
  • Save plucury/7688655 to your computer and use it in GitHub Desktop.
Save plucury/7688655 to your computer and use it in GitHub Desktop.
function displayMyData (data, chinese) {
$('.ajaxLoader').hide();
$('.headerRight').html(data.user.name);
var params = {
username: data.user.name
}
_.extend(params, data.global);
if (data.user.stats.length < 1) {
params.personalHours = 0;
params.personalXrp = 0;
} else {
params.personalHours = Math.round(data.user.stats['RunTime'] / 60.0 / 60.0);
params.personalXrp = 0;
}
if (chinese) {
$('#content').html(_.template($('#statsPageTemplateChinese').html(), params));
} else {
$('#content').html(_.template($('#statsPageTemplate').html(), params));
}
$('.ajaxLoader').hide();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment