github.com/e154/smart-home@v0.17.2-0.20240311175135-e530a6e5cd45/doc/content/en/docs/plugins/notify/html5_notify.md (about)

     1  
     2  ---
     3  title: "HTML5 Уведомления"
     4  linkTitle: "html5_notify"
     5  date: 2021-10-20
     6  description: >
     7  
     8  ---
     9  
    10  HTML5 notifications are a way to display information to users on a web page without reloading or navigating to another page. Notifications can contain text, images, sound, or video and appear in the bottom-right corner of the screen. HTML5 notifications utilize an API that allows web applications to send notifications to the browser using JavaScript.
    11  
    12  Attributes:
    13  - userIDS: The user IDs associated with the notification.
    14  - title: The title of the notification.
    15  - body: The body or content of the notification.
    16  
    17  JavaScript Properties:
    18  
    19  ----------------
    20  
    21  ### New Message:
    22  
    23  Creates a message object.
    24  
    25  ```coffeescript
    26  msg = notifr.newMessage();
    27  msg.type = 'html5_notify';
    28  msg.attributes = {
    29    'userIDS': '14',
    30    'title': 'Lorem Ipsum is simply',
    31    'body': 'Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum'
    32  };
    33  ```
    34  
    35  | Value | Description |
    36  |-------|-------------|
    37  | newMessage() | Method |
    38  | msg | Type: Object (Message) |
    39  
    40  ----------------
    41  
    42  ### Code Example:
    43  
    44  ```coffeescript
    45  # html5_notify
    46  # ##################################
    47  
    48  sendMsg =()->
    49    msg = notifr.newMessage();
    50    msg.type = 'html5_notify';
    51    msg.attributes = {
    52      'userIDS': '14',
    53      'title': 'Lorem Ipsum is simply',
    54      'body': 'Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum'
    55    };
    56    notifr.send(msg);
    57  
    58  sendMsg()
    59  ```
    60