Merge branch 'master' into tlistsort

This commit is contained in:
Azareal 2018-09-20 22:44:59 +10:00
commit 64caed61ee
8 changed files with 77 additions and 6 deletions

View File

@ -188,7 +188,6 @@ function runWebSockets() {
}
conn.onmessage = (event) => {
//console.log("WSMessage:", event.data);
if(event.data[0] == "{") {
console.log("json message");
let data = "";

View File

@ -9,6 +9,8 @@ var hooks = {
"pre_init": [],
"start_init": [],
"end_init": [],
"after_add_alert":[],
"after_update_alert_list":[],
};
var ranInitHooks = {}

View File

@ -44,8 +44,8 @@
<div class="user_box">
<img src="{{.CurrentUser.Avatar}}" />
<div class="option_box">
<span class="username">{{.CurrentUser.Name}}</span>
<span class="alerts">21 new alerts</span>
<a href="{{.CurrentUser.Link}}" class="username">{{.CurrentUser.Name}}</a>
<span class="alerts">No new alerts</span>
</div>
</div>
{{end}}

View File

@ -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",

View File

@ -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;
@ -960,7 +995,6 @@ input[type=checkbox]:checked + label .sel {
.user_box {
display: none;
}
#back {
flex-direction: column;
}
@ -977,6 +1011,12 @@ input[type=checkbox]:checked + label .sel {
}
}
@media(min-width: 751px) {
.menu_profile {
display: none;
}
}
@media(max-width: 850px) {
/**/
}

22
themes/nox/public/misc.js Normal file
View File

@ -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"
});
});

View File

@ -34,6 +34,9 @@
padding: 12px;
}
.colstack_right .colstack_head:not(:first-child) {
margin-top: 0px;
}
#profile_right_lane {
width: 100%;
}

View File

@ -27,6 +27,11 @@
"Name":"trumbowyg/ui/trumbowyg.custom.css",
"Location":"global",
"Loggedin":true
},
{
"Name":"nox/misc.js",
"Location":"global",
"Loggedin":true
}
]
}