c3d2-web/content/static/candy/plugins/notifications
Jörg Thalheim c4ebf7ba80 candy 2.0 + plugins 2015-07-22 01:01:23 +02:00
..
README.md candy 2.0 + plugins 2015-07-22 01:01:23 +02:00
candy.js candy 2.0 + plugins 2015-07-22 01:01:23 +02:00

README.md

Notifications

Send HTML5 Notifications when a message is received and the window is not in focus. This only works with webkit browsers.

Usage

To enable Notifications you have to include its JavaScript code and stylesheet:

<script type="text/javascript" src="candyshop/notifications/candy.js"></script>

Call its init() method after Candy has been initialized:

Candy.init('/http-bind/');

CandyShop.Notifications.init(); 

Candy.Core.connect();

It is possible to configure the Plugin.

CandyShop.Notifications.init({
	notifyNormalMessage: false,		// Send a notification for every message. Defaults to false
	notifyPersonalMessage: true,	// Send a notification if the user is mentioned. (Requires NotfiyMe Plugin) Defaults to true
	closeTime: 3000					// Close notification after X milliseconds. Zero means it doesn't close automaticly. Defaults to 3000
});