From ae4b7b1ef5ec86f8ac5859d6e3593ba49885f036 Mon Sep 17 00:00:00 2001 From: tim-zh Date: Mon, 1 May 2017 18:55:33 +0300 Subject: Fix #421 Html notifications --- tools/gui/resources/web/definitions.js | 9 ++++++--- tools/gui/resources/web/index.html | 1 + tools/gui/resources/web/main.js | 6 +++--- tools/gui/resources/web/styles.css | 13 +++++++++++++ 4 files changed, 23 insertions(+), 6 deletions(-) diff --git a/tools/gui/resources/web/definitions.js b/tools/gui/resources/web/definitions.js index 75ef509..846bbc9 100644 --- a/tools/gui/resources/web/definitions.js +++ b/tools/gui/resources/web/definitions.js @@ -53,12 +53,15 @@ let Popup = { }; let Notifications = { - init: function () { - Notification.requestPermission(); + init: function (container) { + this._container = container; }, show: function (text, title) { - new Notification(title || "", {body: text}); + let now = new Date(); + this._container.html(this._container.html() + now.getHours() + ":" + now.getMinutes() + ":" + now.getSeconds() + + " " + (title || "") + "
" + text + "

"); + this._container.animate({scrollTop: this._container[0].scrollHeight}, {duration: 500, queue: false}); }, showFail: function (e) { diff --git a/tools/gui/resources/web/index.html b/tools/gui/resources/web/index.html index 6b7a7a9..0b25c0e 100644 --- a/tools/gui/resources/web/index.html +++ b/tools/gui/resources/web/index.html @@ -10,6 +10,7 @@ +