diff --git a/www/css/main.css b/www/css/main.css index 4af3b1b..cbee076 100644 --- a/www/css/main.css +++ b/www/css/main.css @@ -167,7 +167,7 @@ body { font-weight: bold; } -#namedisp { +#namecontainer { float: left; } @@ -233,16 +233,10 @@ body { } .chat-username { - color: green; + color: white; font-weight: bold; } -.chat-username-admin { - color: red; - font-weight: bold; - font-style: italic; -} - #buttons { position: absolute; right: 0px; @@ -296,6 +290,29 @@ body { width: fit-content; } +#privmsg-header { + padding-top: 5px; + border-top: 1px solid white; + border-right: 1px solid white; +} + +#privmsgs { + padding-top: 10px; + margin-top: -10px; +} + +#loading-privmsgs { + border-right: 1px solid white; + padding-top: 10px; + margin-top: -10px; +} + +#privmsg-container { + border-right: 1px solid white; + padding-top: 10px; + margin-top: -10px; +} + #badge-header { padding-top: 5px; border-top: 1px solid white; diff --git a/www/js/user.js b/www/js/user.js index 9c54d79..23e6016 100644 --- a/www/js/user.js +++ b/www/js/user.js @@ -62,17 +62,36 @@ function getChat() { data = sortResults(data, 'time', true); var content = ""; data.forEach(function (msg) { - var usernameclass = "chat-username"; - if (msg.nickname === 'skylarmt') { - usernameclass = "chat-username-admin"; + var usernamecolor = "green"; + var usernamecss = ""; + if (msg.color) { + usernamecolor = msg.color; } - content += "" + msg.nickname + " " + msg.message + "
"; + if (msg.css) { + usernamecss = msg.css; + } + content += "" + msg.nickname + " " + msg.message + "
"; }); $('#chatmsgs').html(content); }); } } +function privMsgSync() { + $.getJSON( + mkApiUrl('privmsgs') + "?filter=unread", + function (data) { + if (data.status === 'OK') { + if (data.msgs.length > 0) { + $('#gotprivmsg').css('display', ''); + } else { + $('#gotprivmsg').css('display', 'none'); + } + } + } + ); +} + var skycons = new Skycons({"color": "black", "resizeClear": true}); skycons.add("weathericon", "clear-day"); @@ -116,12 +135,16 @@ function weatherLoadWait() { } syncStats(); +privMsgSync(); setInterval(function () { syncStats(); }, 10 * 1000); setInterval(function () { getChat(); -}, 3000); +}, 3 * 1000); +setInterval(function () { + privMsgSync(); +}, 15 * 1000); setInterval(function () { getWeather(); getTerrain(); diff --git a/www/screens/home.html b/www/screens/home.html index 327676c..21f8518 100644 --- a/www/screens/home.html +++ b/www/screens/home.html @@ -42,7 +42,14 @@

- + + + + + + diff --git a/www/screens/profile.html b/www/screens/profile.html index e1d3a85..ddadbeb 100644 --- a/www/screens/profile.html +++ b/www/screens/profile.html @@ -26,6 +26,17 @@

+