Converse converse.js

Namespace: settings

_converse.api.settings

This grouping allows access to the configuration settings of Converse.

Source:

Namespaces

listen
listen

Methods

(static) extend(settings)

Allows new configuration settings to be specified, or new default values for existing configuration settings to be specified.

Note, calling this method after converse.initialize has been called will not change the initialization settings provided via converse.initialize.

Parameters:
Name Type Description
settings object

The configuration settings

Source:
Example
_converse.api.settings.extend({
   'enable_foo': true
});

// The user can then override the default value of the configuration setting when
// calling `converse.initialize`.
converse.initialize({
    'enable_foo': false
});

(static) extend(settings)

Allows new configuration settings to be specified, or new default values for existing configuration settings to be specified.

Note, calling this method after converse.initialize has been called will not change the initialization settings provided via converse.initialize.

Parameters:
Name Type Description
settings object

The configuration settings

Source:
Example
_converse.api.settings.extend({
   'enable_foo': true
});

// The user can then override the default value of the configuration setting when
// calling `converse.initialize`.
converse.initialize({
    'enable_foo': false
});

(static) get() → {*}

Source:
Returns:

Value of the particular configuration setting.

Type
*
Example
_converse.api.settings.get("play_sounds");

(static) get() → {*}

Source:
Returns:

Value of the particular configuration setting.

Type
*
Example
_converse.api.settings.get("play_sounds");

(static) set(settings_or_keyopt, valueopt)

Set one or many configuration settings.

Note, this is not an alternative to calling converse.initialize, which still needs to be called. Generally, you'd use this method after Converse is already running and you want to change the configuration on-the-fly.

Parameters:
Name Type Attributes Description
settings_or_key Object | string <optional>

An object containing configuration settings. Alternatively to passing in an object, you can pass in a key and a value.

value string <optional>
Source:
Examples
_converse.api.settings.set("play_sounds", true);
_converse.api.settings.set({
    "play_sounds": true,
    "hide_offline_users": true
});

(static) set(settings_or_keyopt, valueopt)

Set one or many configuration settings.

Note, this is not an alternative to calling converse.initialize, which still needs to be called. Generally, you'd use this method after Converse is already running and you want to change the configuration on-the-fly.

Parameters:
Name Type Attributes Description
settings_or_key Object | string <optional>

An object containing configuration settings. Alternatively to passing in an object, you can pass in a key and a value.

value string <optional>
Source:
Examples
_converse.api.settings.set("play_sounds", true);
_converse.api.settings.set({
    "play_sounds": true,
    "hide_offline_users": true
});

_converse.api.settings

This grouping allows access to the configuration settings of Converse.

Source:

Namespaces

listen
listen

Methods

(static) extend(settings)

Allows new configuration settings to be specified, or new default values for existing configuration settings to be specified.

Note, calling this method after converse.initialize has been called will not change the initialization settings provided via converse.initialize.

Parameters:
Name Type Description
settings object

The configuration settings

Source:
Example
_converse.api.settings.extend({
   'enable_foo': true
});

// The user can then override the default value of the configuration setting when
// calling `converse.initialize`.
converse.initialize({
    'enable_foo': false
});

(static) extend(settings)

Allows new configuration settings to be specified, or new default values for existing configuration settings to be specified.

Note, calling this method after converse.initialize has been called will not change the initialization settings provided via converse.initialize.

Parameters:
Name Type Description
settings object

The configuration settings

Source:
Example
_converse.api.settings.extend({
   'enable_foo': true
});

// The user can then override the default value of the configuration setting when
// calling `converse.initialize`.
converse.initialize({
    'enable_foo': false
});

(static) get() → {*}

Source:
Returns:

Value of the particular configuration setting.

Type
*
Example
_converse.api.settings.get("play_sounds");

(static) get() → {*}

Source:
Returns:

Value of the particular configuration setting.

Type
*
Example
_converse.api.settings.get("play_sounds");

(static) set(settings_or_keyopt, valueopt)

Set one or many configuration settings.

Note, this is not an alternative to calling converse.initialize, which still needs to be called. Generally, you'd use this method after Converse is already running and you want to change the configuration on-the-fly.

Parameters:
Name Type Attributes Description
settings_or_key Object | string <optional>

An object containing configuration settings. Alternatively to passing in an object, you can pass in a key and a value.

value string <optional>
Source:
Examples
_converse.api.settings.set("play_sounds", true);
_converse.api.settings.set({
    "play_sounds": true,
    "hide_offline_users": true
});

(static) set(settings_or_keyopt, valueopt)

Set one or many configuration settings.

Note, this is not an alternative to calling converse.initialize, which still needs to be called. Generally, you'd use this method after Converse is already running and you want to change the configuration on-the-fly.

Parameters:
Name Type Attributes Description
settings_or_key Object | string <optional>

An object containing configuration settings. Alternatively to passing in an object, you can pass in a key and a value.

value string <optional>
Source:
Examples
_converse.api.settings.set("play_sounds", true);
_converse.api.settings.set({
    "play_sounds": true,
    "hide_offline_users": true
});