diff options
Diffstat (limited to 'tools/gui')
-rw-r--r-- | tools/gui/resources/web/definitions.js | 9 | ||||
-rw-r--r-- | tools/gui/resources/web/index.html | 1 | ||||
-rw-r--r-- | tools/gui/resources/web/main.js | 6 | ||||
-rw-r--r-- | 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() + + " <b>" + (title || "") + "</b><br>" + text + "<br><br>"); + 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 @@ <link rel="stylesheet" href="highlight/hljs-cbt-theme.css"> </head> <body> +<div id="notifications"></div> <div id="popup"> <div class="stroke" onclick="Popup.hide()">×</div> <table id="popup-table"></table> diff --git a/tools/gui/resources/web/main.js b/tools/gui/resources/web/main.js index 139795a..3a5e418 100644 --- a/tools/gui/resources/web/main.js +++ b/tools/gui/resources/web/main.js @@ -1,4 +1,4 @@ -Notifications.init(); +Notifications.init($("#notifications")); Popup.init($("#popup"), $("#popup-table")); @@ -35,7 +35,7 @@ function createProject() { dependencies: Dependencies.serialize(), flags: getFlags() }, "post").done(() => { - Notifications.show("Done."); + Notifications.show("Project created."); }).always(() => { button.innerHTML = buttonText; button.disabled = false; @@ -65,7 +65,7 @@ function copyProject() { button.blur(); button.disabled = true; ajax("/project/copy", {name: name}, "post").done(() => { - Notifications.show("Done."); + Notifications.show("Project copied."); }).always(() => { button.innerHTML = buttonText; button.disabled = false; diff --git a/tools/gui/resources/web/styles.css b/tools/gui/resources/web/styles.css index 124b63f..e9d6626 100644 --- a/tools/gui/resources/web/styles.css +++ b/tools/gui/resources/web/styles.css @@ -149,6 +149,19 @@ button, .entry { cursor: pointer; } +#notifications { + position: absolute; + top: 1em; + left: 1em; + width: 20%; + max-height: 30%; + background: rgba(0, 0, 0, 0.1); + padding: 0 0.2em; + font-size: 0.5em; + overflow-y: auto; + word-wrap: break-word; +} + #popup { position: fixed; left: 0; |