JSDoc: Namespace: jsxc

# Namespace: jsxc

## jsxc

JavaScript Xmpp Chat namespace

Source:
  - jsxc.lib.js, line 1

### Classes

Message
Message

### Namespaces

gui
muc
notification
options
otr
storage
webrtc
xmpp

### Members

#### <static> bid

  My bar id
  Source:
    - jsxc.lib.js, line 59

#### <static> CONST

  Some constants
  Source:
    - jsxc.lib.js, line 62

#### <static> keepalive

  Interval for keep-alive
  Source:
    - jsxc.lib.js, line 29

#### <static> log

  debug log
  Source:
    - jsxc.lib.js, line 174

#### <static> ls

  last values which we wrote into localstorage (IE workaround)
  Source:
    - jsxc.lib.js, line 47

#### <static> master

  True if i'm the master
  Source:
    - jsxc.lib.js, line 11

#### <static> notice

  This namespace handle the notice system.
  Source:
    - jsxc.lib.notice.js, line 7

#### <static> reconnect

  True if jid, sid and rid was used to connect
  Source:
    - jsxc.lib.js, line 32

#### <static> restoreCompleted

  True if restore is complete
  Source:
    - jsxc.lib.js, line 35

#### <static> role_allocation

  True if the role allocation is finished
  Source:
    - jsxc.lib.js, line 14

#### <static> storageNotConform

  storage event is even fired if I write something into storage (IE workaround) 0: conform, 1: not conform, 2: not shure
  Source:
    - jsxc.lib.js, line 53

#### <static> to

  Timeout for keepalive
  Source:
    - jsxc.lib.js, line 17

#### <static> toBusy

  Timeout after normal keepalive starts
  Source:
    - jsxc.lib.js, line 20

#### <static> toNotification

  Timeout for notification
  Source:
    - jsxc.lib.js, line 23

#### <static> toNotificationDelay

  Timeout delay for notification
  Source:
    - jsxc.lib.js, line 26

#### <static> toSNC

  Timeout for storageNotConform test
  Source:
    - jsxc.lib.js, line 56

#### <static> triggeredFromBox

  True if login through box
  Source:
    - jsxc.lib.js, line 38

#### <static> triggeredFromElement

  True if logout through element click
  Source:
    - jsxc.lib.js, line 41

#### <static> triggeredFromLogout

  True if logout through logout click
  Source:
    - jsxc.lib.js, line 44

#### <static> version

  Version of jsxc
  Source:
    - jsxc.lib.js, line 8

### Methods

#### <private, static> _prepareLogin(username, password, cb, loadedSettings)

  Process xmpp settings and save loaded settings.

  ##### Parameters:

  Name | Type | Argument | Description
  --- | --- | --- | ---
  `username` | string |  |
  `password` | string |  |
  `cb` | function |  | Called after login is prepared with result as param
  `loadedSettings` | object | <optional> | additonal options

  Source:
    - jsxc.lib.js, line 455

#### <static> checkMaster()

  Checks if there is a master
  Source:
    - jsxc.lib.js, line 558

#### <static> debug(msg, data, Could)

  Write debug message to console and to log.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `msg` | String | Debug message
  `data` | Object |
  `Could` | String | be warn|error|null

  Source:
    - jsxc.lib.js, line 121

#### <static> el_exists(selector) → {Boolean}

  Checks if there is a element with the given selector

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `selector` | String | jQuery selector

  Source:
    - jsxc.lib.js, line 640

  ##### Returns:

  Type
    Boolean

#### <static> error(msg, data)

  Write error message.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `msg` | String | Error message
  `data` | Object |

  Source:
    - jsxc.lib.js, line 169

#### <static> escapeHTML()

  Escapes some characters to HTML character
  Source:
    - jsxc.lib.js, line 743

#### <static> exec(fnName, fnParams)

  Executes the given function in jsxc namespace.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `fnName` | string | Function name
  `fnParams` | array | Function parameters

  Source:
    - jsxc.lib.js, line 838

  ##### Returns:

  Function return value

#### <static> getFormattedTime(unixtime)

  Parse a unix timestamp and return a formatted time string

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `unixtime` | Object |

  Source:
    - jsxc.lib.js, line 91

  ##### Returns:

  time of day and/or date

#### <static> hasFocus() → {boolean}

  Checks if tab has focus.
  Source:
    - jsxc.lib.js, line 814

  ##### Returns:

  True if tabs has focus
  Type
    boolean

#### <static> hashStr(str) → {integer}

  Hash string into 32-bit signed integer.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `str` | string | input string

  Source:
    - jsxc.lib.js, line 858

  ##### Returns:

  32-bit signed integer
  Type
    integer

#### <static> init(options)

  Starts the action

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `options` | object |

  Source:
    - jsxc.lib.js, line 182

#### <static> isHidden() → {boolean}

  Checks if tab is hidden.
  Source:
    - jsxc.lib.js, line 786

  ##### Returns:

  True if tab is hidden
  Type
    boolean

#### <static> isLoginForm() → {boolean}

  Returns true if login form is found.
  Source:
    - jsxc.lib.js, line 406

  ##### Returns:

  True if login form was found.
  Type
    boolean

#### <static> jidToBid(jid)

  Create comparable bar jid.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `jid` |  |

  Source:
    - jsxc.lib.js, line 665

  ##### Returns:

  comparable bar jid

#### <static> jidToCid(jid) → {String}

  Creates a CSS compatible string from a JID

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `jid` | type | Valid Jabber ID

  Source:
    - jsxc.lib.js, line 650

  ##### Returns:

  css Compatible string
  Type
    String

#### <static> keepAlive()

  Sends the keep-alive signal to signal that the master is still there.
  Source:
    - jsxc.lib.js, line 603

#### <static> keepBusyAlive()

  Send one keep-alive signal with higher timeout, and than resume with normal signal
  Source:
    - jsxc.lib.js, line 611

#### <static> onMaster()

  Called if the script is the master
  Source:
    - jsxc.lib.js, line 538

#### <static> onSlave()

  Called if the script is a slave
  Source:
    - jsxc.lib.js, line 520

#### <static> prepareLogin(username, password, cb)

  Load settings and prepare jid.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `username` | string |
  `password` | string |
  `cb` | function | Called after login is prepared with result as param

  Source:
    - jsxc.lib.js, line 418

#### <static> random(max) → {Integer}

  Generates a random integer number between 0 and max

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `max` | Integer |

  Source:
    - jsxc.lib.js, line 630

  ##### Returns:

  random integer between 0 and max
  Type
    Integer

#### <static> removeHTML(text)

  Removes all html tags.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `text` |  |

  Source:
    - jsxc.lib.js, line 755

  ##### Returns:

  stripped text

#### <static> restoreRoster()

  Restore roster
  Source:
    - jsxc.lib.js, line 672

#### <static> restoreWindows()

  Restore all windows
  Source:
    - jsxc.lib.js, line 694

#### <static> start(jid, sid, rid)

  Attach to new chat session with jid, sid and rid.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `jid` | string | Jabber Id
  `sid` | string | Session Id
  `rid` | string | Request Id

  Source:
    - jsxc.lib.js, line 375

#### <static> startKeepAlive()

  Start sending keep-alive signal
  Source:
    - jsxc.lib.js, line 596

#### <static> submitLoginForm()

  This method submits the specified login form.
  Source:
    - jsxc.lib.js, line 724

#### <static> switchEvents() → {string}

  Executes only one of the given events

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `obj.key` | string | event name
  `obj.value` | function | function to execute

  Source:
    - jsxc.lib.js, line 766

  ##### Returns:

  namespace of all events
  Type
    string

#### <static> warn(msg, data)

  Write warn message.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `msg` | String | Warn message
  `data` | Object |

  Source:
    - jsxc.lib.js, line 158