Implemented the notification popup option

This commit is contained in:
Simon Vermeersch 2017-01-15 13:43:00 +01:00 committed by Griatch
parent 24cb3d3b31
commit 7027a2cf9b

View file

@ -349,27 +349,24 @@ function onNewLine(text, originator) {
favico.badge(unread); favico.badge(unread);
document.title = "(" + unread + ") " + originalTitle; document.title = "(" + unread + ") " + originalTitle;
//// TODO: Following code adds a full notification popup. It if (("notification_popup" in options) && (options["notification_popup"])) {
//// works fine but should be possible to turn off if a player Notification.requestPermission().then(function(result) {
//// wants to (pending webclient config pane). if(result === "granted") {
//// var title = originalTitle === "" ? "Evennia" : originalTitle;
//Notification.requestPermission().then(function(result) { var options = {
// if(result === "granted") { body: text.replace(/(<([^>]+)>)/ig,""),
// icon: "/static/website/images/evennia_logo.png"
// var title = originalTitle === "" ? "Evennia" : originalTitle; }
// var options = {
// body: text.replace(/(<([^>]+)>)/ig,""), var n = new Notification(title, options);
// icon: "/static/website/images/evennia_logo.png" n.onclick = function(e) {
// } e.preventDefault();
// window.focus();
// var n = new Notification(title, options); this.close();
// n.onclick = function(e) { }
// e.preventDefault(); }
// window.focus(); });
// this.close(); }
// // }
// }
//})
} }
} }