JSDoc: Namespace: notification

# Namespace: notification

## jsxc. notification

This namespace handles the Notification API.

Source:
  - jsxc.lib.notification.js, line 1

### Members

#### <static> audio

  Current audio file.
  Source:
    - jsxc.lib.notification.js, line 9

### Methods

#### <static> hasPermission() → {Boolean}

  Check permission.
  Source:
    - jsxc.lib.notification.js, line 193

  ##### Returns:

  True if we have the permission
  Type
    Boolean

#### <static> hasSupport() → {Boolean}

  Checks if browser has support for notifications and add on chrome to the default api.
  Source:
    - jsxc.lib.notification.js, line 114

  ##### Returns:

  True if the browser has support.
  Type
    Boolean

#### <static> init()

  Register notification on incoming messages.
  Source:
    - jsxc.lib.notification.js, line 16

#### <static> muteSound(external)

  Mute sound.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `external` | boolean | True if triggered from external tab. Default: false.

  Source:
    - jsxc.lib.notification.js, line 252

#### <static> notify(title, msg, d, force, soundFile, loop, source)

  Shows a pop up notification and optional play sound.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `title` |  | Title
  `msg` |  | Message
  `d` |  | Duration
  `force` |  | Should message also shown, if tab is visible?
  `soundFile` |  | Playing given sound file
  `loop` |  | Loop sound file?
  `source` |  | Bid which triggered this notification

  Source:
    - jsxc.lib.notification.js, line 51

#### <static> playSound(soundFile, loop, force)

  Plays the given file.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `soundFile` | string | File relative to the sound directory
  `loop` | boolean | True for loop
  `force` | boolean | Play even if a tab is visible. Default: false.

  Source:
    - jsxc.lib.notification.js, line 205

#### <static> prepareRequest()

  Ask user on first incoming message if we should inform him about new messages.
  Source:
    - jsxc.lib.notification.js, line 158

#### <static> requestPermission()

  Request notification permission.
  Source:
    - jsxc.lib.notification.js, line 174

#### <static> stopSound()

  Stop/remove current sound.
  Source:
    - jsxc.lib.notification.js, line 236

#### <static> unmuteSound(external)

  Unmute sound.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `external` | boolean | True if triggered from external tab. Default: false.

  Source:
    - jsxc.lib.notification.js, line 267