diff --git a/public/global.js b/public/global.js index c0a5ee25..4f840dd6 100644 --- a/public/global.js +++ b/public/global.js @@ -188,7 +188,6 @@ function runWebSockets() { } conn.onmessage = (event) => { - //console.log("WSMessage:", event.data); if(event.data[0] == "{") { console.log("json message"); let data = ""; diff --git a/public/init.js b/public/init.js index 670ad39c..0d9bab21 100644 --- a/public/init.js +++ b/public/init.js @@ -9,6 +9,8 @@ var hooks = { "pre_init": [], "start_init": [], "end_init": [], + "after_add_alert":[], + "after_update_alert_list":[], }; var ranInitHooks = {} diff --git a/themes/cosora/theme.json b/themes/cosora/theme.json index 1710dff7..5a26f874 100644 --- a/themes/cosora/theme.json +++ b/themes/cosora/theme.json @@ -1,7 +1,7 @@ { "Name": "cosora", "FriendlyName": "Cosora", - "Version": "0.0.1", + "Version": "0.1.0", "Creator": "Azareal", "URL": "github.com/Azareal/Gosora", "Tag": "WIP", diff --git a/themes/nox/public/main.css b/themes/nox/public/main.css index 0387af8d..3b18a717 100644 --- a/themes/nox/public/main.css +++ b/themes/nox/public/main.css @@ -55,9 +55,44 @@ li a { padding-bottom: 21px; color: #dddddd; } -.menu_alerts { +.menu_alerts .alert_bell, .menu_alerts .alert_counter, .menu_alerts:not(.selectedAlert) .alertList { display: none; } +.alertList { + display: flex; + flex-direction: column; + background-color: #444444; + position: absolute; + border: 1px solid #333333; + top: 82px; + border-top: none; + right: 0px; + padding-left: 16px; + padding-right: 16px; +} +.alertItem.withAvatar { + background: none !important; + height: 66px; + padding-top: 4px; + display: flex; + padding: 16px; + padding-left: 0px; + padding-right: 0px; +} +.alertItem.withAvatar:not(:last-child) { + border-bottom: 1px solid #555555; +} +.alertItem.withAvatar .bgsub { + height: 36px; + width: 36px; + border-radius: 32px; +} +.alertItem.withAvatar .text { + margin-left: 12px; + padding-top: 5px; + font-size: 16px; +} + .right_of_nav { float: left; width: 200px; diff --git a/themes/nox/public/misc.js b/themes/nox/public/misc.js new file mode 100644 index 00000000..d17ce72a --- /dev/null +++ b/themes/nox/public/misc.js @@ -0,0 +1,22 @@ +"use strict"; + +(() => { + addInitHook("after_update_alert_list", () => { + if(alertCount==0) { + $(".alerts").html("No new alerts") + } else { + $(".alerts").html(alertCount + " new alerts") + } + }) +})(); + +$(document).ready(() => { + $(".alerts").click((event) => { + event.stopPropagation(); + var alerts = $(".menu_alerts")[0]; + if($(alerts).hasClass("selectedAlert")) return; + if(!conn) loadAlerts(alerts); + alerts.className += " selectedAlert"; + document.getElementById("back").className += " alertActive" + }); +}); \ No newline at end of file diff --git a/themes/nox/theme.json b/themes/nox/theme.json index 9ddd6fc6..78696545 100644 --- a/themes/nox/theme.json +++ b/themes/nox/theme.json @@ -27,6 +27,11 @@ "Name":"trumbowyg/ui/trumbowyg.custom.css", "Location":"global", "Loggedin":true + }, + { + "Name":"nox/misc.js", + "Location":"global", + "Loggedin":true } ] }