Comment out full notification until webclient has a config pane. Make webclient title reflect game name. Merges #1046.
This commit is contained in:
parent
57ea70cb82
commit
401b60e233
2 changed files with 69 additions and 64 deletions
|
|
@ -247,21 +247,17 @@ function onBeforeUnload() {
|
||||||
return "You are about to leave the game. Please confirm.";
|
return "You are about to leave the game. Please confirm.";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Notifications
|
||||||
var unread = 0;
|
var unread = 0;
|
||||||
var originalTitle = document.title;
|
var originalTitle = document.title;
|
||||||
var focused = true;
|
var focused = true;
|
||||||
var favico;
|
var favico;
|
||||||
|
|
||||||
/*function onVisibilityChange() {
|
|
||||||
if(!document.hidden) {
|
|
||||||
document.title = originalTitle;
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
|
|
||||||
function onBlur(e) {
|
function onBlur(e) {
|
||||||
focused = false;
|
focused = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Notifications for unfocused window
|
||||||
function onFocus(e) {
|
function onFocus(e) {
|
||||||
focused = true;
|
focused = true;
|
||||||
document.title = originalTitle;
|
document.title = originalTitle;
|
||||||
|
|
@ -271,24 +267,32 @@ function onFocus(e) {
|
||||||
|
|
||||||
function onNewLine(text, originator) {
|
function onNewLine(text, originator) {
|
||||||
if(!focused) {
|
if(!focused) {
|
||||||
|
// Changes unfocused browser tab title to number of unread messages
|
||||||
unread++;
|
unread++;
|
||||||
favico.badge(unread);
|
favico.badge(unread);
|
||||||
document.title = "(" + unread + ") " + originalTitle;
|
document.title = "(" + unread + ") " + originalTitle;
|
||||||
Notification.requestPermission().then(function(result) {
|
|
||||||
if(result === "granted") {
|
//// TODO: Following code adds a full notification popup. It
|
||||||
var title = originalTitle === "" ? "Evennia" : originalTitle;
|
//// works fine but should be possible to turn off if a player
|
||||||
var options = {
|
//// wants to (pending webclient config pane).
|
||||||
body: text.replace(/(<([^>]+)>)/ig,""),
|
////
|
||||||
icon: "/static/website/images/evennia_logo.png"
|
//Notification.requestPermission().then(function(result) {
|
||||||
}
|
// if(result === "granted") {
|
||||||
var n = new Notification(title, options);
|
//
|
||||||
n.onclick = function(e) {
|
// var title = originalTitle === "" ? "Evennia" : originalTitle;
|
||||||
e.preventDefault();
|
// var options = {
|
||||||
window.focus();
|
// body: text.replace(/(<([^>]+)>)/ig,""),
|
||||||
this.close();
|
// icon: "/static/website/images/evennia_logo.png"
|
||||||
}
|
// }
|
||||||
}
|
//
|
||||||
})
|
// var n = new Notification(title, options);
|
||||||
|
// n.onclick = function(e) {
|
||||||
|
// e.preventDefault();
|
||||||
|
// window.focus();
|
||||||
|
// this.close();
|
||||||
|
// // }
|
||||||
|
// }
|
||||||
|
//})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ JQuery available.
|
||||||
{% load staticfiles %}
|
{% load staticfiles %}
|
||||||
<html dir="ltr" lang="en">
|
<html dir="ltr" lang="en">
|
||||||
<head>
|
<head>
|
||||||
|
<title> {{game_name}} </title>
|
||||||
<meta http-equiv="content-type", content="application/xhtml+xml; charset=UTF-8" />
|
<meta http-equiv="content-type", content="application/xhtml+xml; charset=UTF-8" />
|
||||||
<meta name="author" content="Evennia" />
|
<meta name="author" content="Evennia" />
|
||||||
<meta name="generator" content="Evennia" />
|
<meta name="generator" content="Evennia" />
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue