JSDoc: Namespace: window

# Namespace: window

## jsxc.gui.window

Handle functions related to the gui of the window

Source:
  - jsxc.lib.gui.js, line 2050

### Methods

#### (static) _close(bid)

Close chatwindow

##### Parameters:

Name | Type | Description
--- | --- | ---
`bid` | String |

Source:
  - jsxc.lib.gui.js, line 2422

#### (static) _hide(bid)

Minimize text area

##### Parameters:

Name | Type | Description
--- | --- | ---
`bid` | String |

Source:
  - jsxc.lib.gui.js, line 2546

#### (static) _show(bid) → {undefined}

Maximize text area

##### Parameters:

Name | Type | Description
--- | --- | ---
`bid` | String |

Source:
  - jsxc.lib.gui.js, line 2467

##### Returns:

Type
  undefined

#### (static) clear(bid) → {undefined}

Clear chat history

##### Parameters:

Name | Type | Description
--- | --- | ---
`bid` | type |

Source:
  - jsxc.lib.gui.js, line 2977

##### Returns:

Type
  undefined

#### (static) close(bid)

Close chatwindow and clean up

##### Parameters:

Name | Type | Description
--- | --- | ---
`bid` | String | bar jid

Source:
  - jsxc.lib.gui.js, line 2397

#### (static) get(bid) → {jquery}

Returns the window element

##### Parameters:

Name | Type | Description
--- | --- | ---
`bid` | String |

Source:
  - jsxc.lib.gui.js, line 2372

##### Returns:

jQuery object of the window element

Type
  jquery

#### (static) hide(bidopt)

Minimize text area and save

##### Parameters:

Name | Type | Attributes | Description
--- | --- | --- | ---
`bid` | String | <optional> |

Source:
  - jsxc.lib.gui.js, line 2521

#### (static) highlight(bid)

Highlight window

##### Parameters:

Name | Type | Description
--- | --- | ---
`bid` | type |

Source:
  - jsxc.lib.gui.js, line 2560

#### (static) init(bid) → {jQuery}

Init a window skeleton

##### Parameters:

Name | Type | Description
--- | --- | ---
`bid` | String |

Source:
  - jsxc.lib.gui.js, line 2063

##### Returns:

Window object

Type
  jQuery

#### (static) open(bid) → {jQuery}

Open a window, related to the bid. If the window doesn't exist, it will be created.

##### Parameters:

Name | Type | Description
--- | --- | ---
`bid` | String |

Source:
  - jsxc.lib.gui.js, line 2383

##### Returns:

Window object

Type
  jQuery

#### (static) postMessage(args) → {jsxc.Message}

Create message object from given properties, write Message to chat area and save. Check border cases and remove html.

##### Parameters:

Name | Type | Description
--- | --- | ---
`args` | object | New message properties ###### Properties
Name | Type | Description
--- | --- | ---
`bid` | string |
`direction` | direction |
`msg` | string |
`encrypted` | boolean |
`forwarded` | boolean |
`sender` | boolean |
`stamp` | integer |
`attachment` | object | Attached data ###### Properties
Name | Type | Description
--- | --- | ---
`name` | string | File name
`size` | string | File size
`type` | string | File type
`data` | string | File data

Source:
  - jsxc.lib.gui.js, line 2596

##### Returns:

maybe modified message object

Type
  jsxc.Message

#### (static) postMessage(message) → {jsxc.Message}

Write Message to chat area and save. Check border cases and remove html.

##### Parameters:

Name | Type | Description
--- | --- | ---
`message` | jsxc.Message | object to be send

Source:
  - jsxc.lib.gui.js, line 2588

##### Returns:

maybe modified message object

Type
  jsxc.Message

#### (static) receivedMessage(bid, uid)

Mark message as received.

##### Parameters:

Name | Type | Description
--- | --- | ---
`bid` | string |
`uid` | string | message id

Deprecated:
  - since v3.0.0. Use jsxc.Message.received.
Source:
  - jsxc.lib.gui.js, line 3009

#### (static) renderMessage(bid, post, restore)

Write Message to chat area

##### Parameters:

Name | Type | Description
--- | --- | ---
`bid` | String | bar jid
`post` | Object | Post object with direction, msg, uid, received
`restore` | Bool | If true no highlights are used

Source:
  - jsxc.lib.gui.js, line 2696

#### (static) resize(win, ui, outeropt)

Resize given window to given size. If no size is provided the window is resized to the default size.

##### Parameters:

Name | Type | Attributes | Description
--- | --- | --- | ---
`win` | string | jquery |  | Bid or window object
`ui` | object |  | The size has to be in the format {size:{width: [INT], height: [INT]}}
`outer` | boolean | <optional> | If true the given size is used as outer dimensions.

Source:
  - jsxc.lib.gui.js, line 2303

#### (static) restoreChat(bid) → {undefined}

Load old log into chat area

##### Parameters:

Name | Type | Description
--- | --- | ---
`bid` | type |

Source:
  - jsxc.lib.gui.js, line 2941

##### Returns:

Type
  undefined

#### (static) scrollDown(bid)

Scroll chat area to the bottom

##### Parameters:

Name | Type | Description
--- | --- | ---
`bid` | String | bar jid

Source:
  - jsxc.lib.gui.js, line 2575

#### (static) setText(bid, text) → {undefined}

Set text into input area

##### Parameters:

Name | Type | Description
--- | --- | ---
`bid` | type |
`text` | type |

Source:
  - jsxc.lib.gui.js, line 2922

##### Returns:

Type
  undefined

#### (static) show(bid)

Maximize text area and save

##### Parameters:

Name | Type | Description
--- | --- | ---
`bid` | String |

Source:
  - jsxc.lib.gui.js, line 2454

#### (static) toggle(bid)

Toggle between minimize and maximize of the text area

##### Parameters:

Name | Type | Description
--- | --- | ---
`bid` | String | bar jid

Source:
  - jsxc.lib.gui.js, line 2432