diff --git a/www/css/app.css b/www/css/app.css index 5348695..9404e52 100644 --- a/www/css/app.css +++ b/www/css/app.css @@ -52,3 +52,16 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/. .flex-wrap { flex-wrap: wrap; } + +.badges .badge { + width: 50px; + height: 50px; + border: 2px solid white; + border-radius: 50%; + overflow: hidden; + margin: 1em; +} + +.badges .badge i { + font-size: 35px; +} \ No newline at end of file diff --git a/www/js/profile.js b/www/js/profile.js index bf694ab..dc4a131 100644 --- a/www/js/profile.js +++ b/www/js/profile.js @@ -16,6 +16,27 @@ function loadProfile() { $("#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"); }); diff --git a/www/pages/profile.html b/www/pages/profile.html index 1850be0..208afcf 100644 --- a/www/pages/profile.html +++ b/www/pages/profile.html @@ -12,7 +12,8 @@
-
+
+
@@ -24,6 +25,10 @@
+
+ +
+
diff --git a/www/routes.js b/www/routes.js index 7ac03af..9e5f8ee 100644 --- a/www/routes.js +++ b/www/routes.js @@ -32,7 +32,7 @@ var routes = [ pageAfterIn: function () { function tryToLoadInventory() { if (typeof loadInventory != "function") { - setTimeout(loadInventory, 100); + setTimeout(tryToLoadInventory, 100); } else { loadInventory(function () {}); } @@ -48,10 +48,10 @@ var routes = [ on: { pageAfterIn: function () { function tryToLoadProfile() { - if (typeof loadProfile != "function") { - setTimeout(loadProfile, 100); - } else { + if (typeof loadProfile === "function") { loadProfile(function () {}); + } else { + setTimeout(tryToLoadProfile, 100); } } tryToLoadProfile(); @@ -91,7 +91,7 @@ var routes = [ pageAfterIn: function () { function tryToLoadSettings() { if (typeof loadSettings != "function") { - setTimeout(loadSettings, 500); + setTimeout(tryToLoadSettings, 500); } else { loadSettings(); }