mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-07 16:44:07 +01:00
Try and fallback from HTML to plain text to match spec - removed HTML notifications
This commit is contained in:
parent
2218fd8956
commit
20ab9041cf
@ -133,7 +133,34 @@ function append_notification_message(_id, _message, _browser_notify) {
|
||||
// Notification API
|
||||
if(_browser_notify)
|
||||
{
|
||||
var notice = webkitNotifications.createHTMLNotification(_browser_notify);
|
||||
var notice;
|
||||
if(webkitNotifications.createHTMLNotification)
|
||||
{
|
||||
notice = webkitNotifications.createHTMLNotification(_browser_notify);
|
||||
}
|
||||
else if (webkitNotifications.createNotification)
|
||||
{
|
||||
// Pull the subject of the messasge, if possible
|
||||
var message = /<b>(.*?)<\/b>/.exec(_message);
|
||||
if(message && message[1])
|
||||
{
|
||||
_message = message[1];
|
||||
}
|
||||
else
|
||||
{
|
||||
_message = _message.replace(/<(?:.|\n)*?>/gm, '');
|
||||
}
|
||||
notice = webkitNotifications.createNotification('', "Egroupware",_message);
|
||||
|
||||
// When they click, bring up the popup for full info
|
||||
notice.onclick = function() {
|
||||
window.focus();
|
||||
egwpopup_display();
|
||||
this.close();
|
||||
}
|
||||
}
|
||||
if(notice)
|
||||
{
|
||||
notice.ondisplay = function() {
|
||||
// Confirm when user gets to see it - no close needed
|
||||
// Wait a bit to let it load first, or it might not be there when requested.
|
||||
@ -144,3 +171,4 @@ function append_notification_message(_id, _message, _browser_notify) {
|
||||
notice.show();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user