Namespace: jsxc

jsxc

JavaScript Xmpp Chat namespace
Source:

Classes

Message
Message

Namespaces

gui
muc
notification
options
otr
storage
webrtc
xmpp

Members

<static> bid

My bar id
Source:

<static> CONST

Some constants
Source:

<static> keepalive

Interval for keep-alive
Source:

<static> log

debug log
Source:

<static> ls

last values which we wrote into localstorage (IE workaround)
Source:

<static> master

True if i'm the master
Source:

<static> notice

This namespace handle the notice system.
Source:

<static> reconnect

True if jid, sid and rid was used to connect
Source:

<static> restoreCompleted

True if restore is complete
Source:

<static> role_allocation

True if the role allocation is finished
Source:

<static> storageNotConform

storage event is even fired if I write something into storage (IE workaround) 0: conform, 1: not conform, 2: not shure
Source:

<static> to

Timeout for keepalive
Source:

<static> toBusy

Timeout after normal keepalive starts
Source:

<static> toNotification

Timeout for notification
Source:

<static> toNotificationDelay

Timeout delay for notification
Source:

<static> toSNC

Timeout for storageNotConform test
Source:

<static> triggeredFromBox

True if login through box
Source:

<static> triggeredFromElement

True if logout through element click
Source:

<static> triggeredFromLogout

True if logout through logout click
Source:

<static> version

Version of jsxc
Source:

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:

<static> checkMaster()

Checks if there is a master
Source:

<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:

<static> el_exists(selector) → {Boolean}

Checks if there is a element with the given selector
Parameters:
Name Type Description
selector String jQuery selector
Source:
Returns:
Type
Boolean

<static> error(msg, data)

Write error message.
Parameters:
Name Type Description
msg String Error message
data Object
Source:

<static> escapeHTML()

Escapes some characters to HTML character
Source:

<static> exec(fnName, fnParams)

Executes the given function in jsxc namespace.
Parameters:
Name Type Description
fnName string Function name
fnParams array Function parameters
Source:
Returns:
Function return value

<static> getFormattedTime(unixtime)

Parse a unix timestamp and return a formatted time string
Parameters:
Name Type Description
unixtime Object
Source:
Returns:
time of day and/or date

<static> hasFocus() → {boolean}

Checks if tab has focus.
Source:
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:
Returns:
32-bit signed integer
Type
integer

<static> init(options)

Starts the action
Parameters:
Name Type Description
options object
Source:

<static> isHidden() → {boolean}

Checks if tab is hidden.
Source:
Returns:
True if tab is hidden
Type
boolean

<static> isLoginForm() → {boolean}

Returns true if login form is found.
Source:
Returns:
True if login form was found.
Type
boolean

<static> jidToBid(jid)

Create comparable bar jid.
Parameters:
Name Type Description
jid
Source:
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:
Returns:
css Compatible string
Type
String

<static> keepAlive()

Sends the keep-alive signal to signal that the master is still there.
Source:

<static> keepBusyAlive()

Send one keep-alive signal with higher timeout, and than resume with normal signal
Source:

<static> onMaster()

Called if the script is the master
Source:

<static> onSlave()

Called if the script is a slave
Source:

<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:

<static> random(max) → {Integer}

Generates a random integer number between 0 and max
Parameters:
Name Type Description
max Integer
Source:
Returns:
random integer between 0 and max
Type
Integer

<static> removeHTML(text)

Removes all html tags.
Parameters:
Name Type Description
text
Source:
Returns:
stripped text

<static> restoreRoster()

Restore roster
Source:

<static> restoreWindows()

Restore all windows
Source:

<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:

<static> startKeepAlive()

Start sending keep-alive signal
Source:

<static> submitLoginForm()

This method submits the specified login form.
Source:

<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:
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: