JSDoc: Namespace: window

# Namespace: window

## jsxc.gui. window

Handle functions related to the gui of the window

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

### Methods

#### <static> _close(bid)

  Close chatwindow

  ##### Parameters:

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

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

#### <static> _hide(bid)

  Minimize text area

  ##### Parameters:

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

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

#### <static> _postMessage(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 2567

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

  Maximize text area

  ##### Parameters:

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

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

  ##### Returns:

  Type
    undefined

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

  Clear chat history

  ##### Parameters:

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

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

  ##### 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 2279

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

  Returns the window element

  ##### Parameters:

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

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

  ##### Returns:

  jQuery object of the window element
  Type
    jquery

#### <static> hide(bid)

  Minimize text area and save

  ##### Parameters:

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

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

#### <static> highlight(bid)

  Highlight window

  ##### Parameters:

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

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

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

  Init a window skeleton

  ##### Parameters:

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

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

  ##### 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 2265

  ##### Returns:

  Window object
  Type
    jQuery

#### <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 2470

  ##### Returns:

  maybe modified message object
  Type
    jsxc.Message

#### <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 2471

  ##### 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 2798

#### <static> resize(win, ui, outer)

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

  ##### Parameters:

  Name | Type | Argument | 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 2185

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

  Load old log into chat area

  ##### Parameters:

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

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

  ##### 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 2457

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

  Set text into input area

  ##### Parameters:

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

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

  ##### Returns:

  Type
    undefined

#### <static> show(bid)

  Maximize text area and save

  ##### Parameters:

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

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

#### <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 2314