/* * 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", { 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(" " + SETTINGS.teams[data.profile.teamid].name); $("#playerlevelinfo").html("Level " + data.profile.level * 1); data.profile.badges.forEach(function (badge) { $("#badgebin").append('
'); }); $("#badgebin").on("click", ".badge", function () { var name = $(this).data("name"); var desc = $(this).data("desc"); app.popover.create({ targetEl: this, backdrop: false, content: '
'+ '
'+ '
'+ '' + name + ''+ '

' + desc + '

'+ '
'+ '
'+ '
' }).open(); }); }, function (err) { app.dialog.alert(msg, "Error"); }); }