-
Diego Sampaio authoredDiego Sampaio authored
README.md 2.93 KiB
Rocket.Chat main library
This package contains the main libraries of Rocket.Chat.
APIs
Settings
This is an example to create settings:
RocketChat.settings.addGroup('Settings_Group', function() {
this.add('SettingInGroup', 'default_value', { type: 'boolean', public: true });
this.section('Group_Section', function() {
this.add('Setting_Inside_Section', 'default_value', {
type: 'boolean',
public: true,
enableQuery: {
_id: 'SettingInGroup',
value: true
}
});
});
});
RocketChat.settings.add
type:
-
string
- Stores a string value- Additional options:
-
multiline
: boolean
-
- Additional options:
-
int
- Stores an integer value -
boolean
- Stores a boolean value -
select
- Creates an<select>
element- Additional options:
-
values
: Array of: { key: 'value', i18nLabel: 'Option_Label' }
-
- Additional options:
-
color
- Creates a color pick element -
action
- Executes aMethod.call
tovalue
- Additional options:
-
actionText
: Translatable value of the button
-
- Additional options:
-
asset
- Creates an upload field
RocketChat.settings.add
options:
-
description
- Description of the setting -
public
- Boolean to set if the setting should be sent to client or not -
enableQuery
- Only enable this setting if the correspondent setting has the value specified -
alert
- Shows an alert message with the given text