Author: hnategh
New Revision: 56008
URL: http://svn.stylite.de/viewvc/egroupware?rev=56008&view=rev
Log:
Check Notification API is supported by browser before using it
Modified:
trunk/egroupware/api/js/jsapi/egw_notification.js
— trunk/egroupware/api/js/jsapi/egw_notification.js (original)
+++ trunk/egroupware/api/js/jsapi/egw_notification.js Wed May 4 15:04:55 2016
@@ -19,14 +19,20 @@
-
@augments Class
-
@param {string} _app application name object is instanciated for
-
@param {object} _wnd window object is instanciated for
-
-
-
@return {object} defined functions of module
*/
egw.extend(‘notification’, egw.MODULE_WND_LOCAL, function(_app, _wnd)
{
“use strict”;
// Notification permission, the default value is ‘default’ which is equivalent to ‘denied’
- var permission = Notification.permission || ‘default’;
-
-
var permission = ‘default’;
-
-
if (typeof Notification != ‘undefined’)
-
{
-
permission = Notification.permission;
-
}
return {
@@ -45,10 +51,12 @@
* onclose: // Callback function dispateches on notification close
* onerror: // Callback function dispatches on error, default is a egw.debug log
* }
-
* @return {boolean} false if Notification is not supported by browser
*/
notification: function (_title, _options)
{
-
// Check if the notification is supported by browser
-
if (typeof Notification == 'undefined') return false;
var self = this;
// Check and ask for permission
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
eGroupWare-cvs mailing list
eGroupWare-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/egroupware-cvs