diff --git a/DuetWebControl-1.17-RC6.zip b/DuetWebControl-1.17.zip
similarity index 69%
rename from DuetWebControl-1.17-RC6.zip
rename to DuetWebControl-1.17.zip
index c5ceb519e..f96f55947 100644
Binary files a/DuetWebControl-1.17-RC6.zip and b/DuetWebControl-1.17.zip differ
diff --git a/core/js/notify.js b/core/js/notify.js
index 51c2dc8b0..297c82430 100644
--- a/core/js/notify.js
+++ b/core/js/notify.js
@@ -7,7 +7,7 @@
*/
-var notificationOptions = {
+var jsNotificationOptions = {
animate: {
enter: 'animated fadeInDown',
exit: 'animated fadeOutDown'
@@ -29,7 +29,7 @@ var notificationOptions = {
};
// Apply custom options for JS plugin
-$.notifyDefaults(notificationOptions);
+$.notifyDefaults(jsNotificationOptions);
function showDownloadMessage() {
var notifySettings = { icon: "glyphicon glyphicon-compressed",
@@ -68,7 +68,30 @@ function showHaltMessage() {
}
function showMessage(type, title, message, timeout, allowDismiss) {
- // Find a suitable icon
+ // Set default arguments
+ if (timeout == undefined) { timeout = settings.notificationTimeout; }
+ if (allowDismiss == undefined) { allowDismiss = true; }
+
+ // Check if an HTML5 notification shall be displayed
+ if (document.hidden && settings.useHtmlNotifications) {
+ // HTML5 notifications expect plain strings. Remove potential styles first
+ if (title.indexOf("<") != -1) { title = $("" + title + "").text(); }
+ if (message.indexOf("<") != -1) { message = $("" + message + "").text(); }
+
+ // Create new notification and display it
+ var options = {
+ body: message,
+ icon: "favicon.ico",
+ dir : "ltr",
+ requireInteraction: allowDismiss
+ };
+ var notification = new Notification(title, options);
+ if (allowDismiss) { notification.onclick = function() { this.close(); }; }
+ if (timeout > 0) { setTimeout(function() { notification.close(); }, timeout); }
+ return notification;
+ }
+
+ // Otherwise display a JQuery notification. Find a suitable icon first
var icon = "glyphicon glyphicon-info-sign";
if (type == "warning") {
icon = "glyphicon glyphicon-warning-sign";
@@ -87,7 +110,7 @@ function showMessage(type, title, message, timeout, allowDismiss) {
}
// Show the notification
- var notifySettings = { icon: "glyphicon glyphicon-" + icon,
+ var notifySettings = { icon: icon,
title: title,
message: message};
var options = { type: type,
diff --git a/core/js/settings.js b/core/js/settings.js
index 77fdb62c2..83e1ecee3 100644
--- a/core/js/settings.js
+++ b/core/js/settings.js
@@ -42,6 +42,7 @@ var settings = {
doTpre: true, // change
doTpost: true, // options
+ useHtmlNotifications: false, // whether HTML5-based notifications can be used
notificationTimeout: 5000, // in ms
autoCloseUserMessages: false, // whether M117 messages are automatically closed
@@ -415,6 +416,29 @@ $("#btn_clear_cache").click(function(e) {
e.preventDefault();
});
+$("[data-setting='useHtmlNotifications']").change(function() {
+ if ($(this).prop("checked")) {
+ if (!("Notification" in window)) {
+ // Don't allow this option to be set if the browser doesn't support it
+ $(this).prop("checked", false);
+ alert(T("This browser does not support desktop notification"));
+ }
+ else if (Notification.permission !== 'denied') {
+ $(this).prop("checked", false);
+ Notification.requestPermission(function(permission) {
+ if (!('permission' in Notification)) {
+ Notification.permission = permission;
+ }
+
+ if (permission === "granted") {
+ // Don't allow this option to be set unless permission has been granted
+ $("[data-setting='useHtmlNotifications']").prop("checked", true);
+ }
+ });
+ }
+ }
+});
+
// List Items
$("#btn_add_gcode").click(function(e) {
diff --git a/core/language.xml b/core/language.xml
index 18ad73dbd..a5df90cc8 100644
--- a/core/language.xml
+++ b/core/language.xml
@@ -651,6 +651,9 @@
Diese Datei ist recht groß. Es kann eine Weile dauern bevor sie vollständig geladen ist...
Sie können keine einzelnen Dateien hochladen. Bitte laden Sie nur ZIP-Dateien hoch, die mindestens ein Verzeichnis pro Filamentkonfiguration enthalten.
Fehler
+ Dieser Browser unterstützt keine Desktopbenachrichtigungen
+ Benutze HTML5-basierte Desktopbenachrichtigungen wenn die Seite versteckt ist
+ Zeige HTML5 Desktopbenachrichtigungen wenn die Weboberfläche nicht sichtbar ist
diff --git a/core/reprap.htm b/core/reprap.htm
index 57b5fc2f0..bee26ce44 100644
--- a/core/reprap.htm
+++ b/core/reprap.htm
@@ -1,5 +1,5 @@
-