j-NativeNotifications
- singleton
Configuration
timeout {Number}doit contenir un délai d'attente (millisecondes) pour l'expiration de la notification (par défaut :8000)icon {String}(facultatif) une icône (par défaut/icon.png)
Méthodes
component.append(title, message, [callback], [icon])pour créer une nouvelle notification
Utilisation
SETTER('nativenotifications/show', 'TITLE', 'MESSAGE', function() {
// optional, click
}, '/img/warning-optional.png');Utilisez-le avec <ui-component name="nativenotifications">. Lorsque le composant n'est pas encore chargé, jComponent le télécharge lors de la première utilisation depuis l'adresse dans DEF.fallback (le CDN Componentator par défaut). Auteur : Peter Širka. Source : le référentiel de composants Componentator, licence MIT.
<ui-component name="nativenotifications" path="allowNotifications"></ui-component>
<script>
var allowNotifications = true;
setTimeout(function() {
SETTER('nativenotifications/append', 'Hello!', 'jComponent is a great solution for everyone.', null, 'https://messenger.totaljs.com/icon.png');
}, 3000);
</script>