Game/www/js/profile.js

22 lines
963 B
JavaScript

/*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
function loadProfile() {
callAPI("getprofile", {
username: localStorage.getItem("username"),
password: localStorage.getItem("password"),
id: $(".page[data-name=profile]").data("playerid")
}, function (data) {
console.log(data);
$(".playerinfoflex").addClass("color-theme-" + SETTINGS.teams[data.profile.teamid].color);
$("#playericon .usericon").html(getAvatarIcon(data.profile.id, data.profile.teamid));
$("#playerteaminfo").html("<i class='" + SETTINGS.teams[data.profile.teamid].icon + "'></i> " + SETTINGS.teams[data.profile.teamid].name);
$("#playerlevelinfo").html("Level " + data.profile.level * 1);
}, function (err) {
app.dialog.alert(msg, "Error");
});
}