j-NativeNotifications
- singleton
Konfigurácia
timeout {Number}musí obsahovať časový limit (milisekundy) na uplynutie platnosti upozornenia (predvolené:8000)icon {String}(voliteľné) ikona (predvolené/icon.png)
Metódy
component.append(title, message, [callback], [icon])na vytvorenie nového oznámenia
Použitie
SETTER('nativenotifications/show', 'TITLE', 'MESSAGE', function() {
// optional, click
}, '/img/warning-optional.png');Použite ho so <ui-component name="nativenotifications">. Keď komponent ešte nie je načítaný, jComponent ho stiahne pri prvom použití z adresy v DEF.fallback (predvolene CDN Componentator). Autor: Peter Širka. Zdroj: úložisko komponentov Componentator, licencia 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>