1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-13 15:25:59 +00:00

notify: use iconfont, update colors and increase height a bit

This commit is contained in:
Andrew Dolgov
2018-12-06 12:52:44 +03:00
parent 0ea0b606be
commit d99d04a2ae
6 changed files with 82 additions and 61 deletions

View File

@@ -170,8 +170,7 @@ const Notify = {
}
let msgfmt = "<span class=\"msg\">%s</span>".replace("%s", __(msg));
let icon = false;
let icon = "";
notify.className = "notify";
@@ -180,22 +179,28 @@ const Notify = {
switch (kind) {
case this.KIND_INFO:
notify.addClassName("notify_info")
icon = App.getInitParam("icon_information");
icon = "notifications";
break;
case this.KIND_ERROR:
notify.addClassName("notify_error");
icon = App.getInitParam("icon_alert");
icon = "error";
break;
case this.KIND_PROGRESS:
notify.addClassName("notify_progress");
icon = App.getInitParam("icon_indicator_white")
break;
default:
icon = "notifications";
}
if (icon) msgfmt = "<span><img src=\"%s\"></span>".replace("%s", icon) + msgfmt;
if (icon)
if (icon.indexOf("data:image") != -1)
msgfmt = "<img src=\"%s\">".replace("%s", icon) + msgfmt;
else
msgfmt = "<i class='material-icons icon-notify'>%s</i>".replace("%s", icon) + msgfmt;
msgfmt += (" <span><img src=\"%s\" class='close' title=\"" +
__("Click to close") + "\" onclick=\"Notify.close()\"></span>")
msgfmt += ("<i class='material-icons icon-close' title=\"" +
__("Click to close") + "\" onclick=\"Notify.close()\">close</i>")
.replace("%s", App.getInitParam("icon_cross"));
notify.innerHTML = msgfmt;