Показаны различия между двумя версиями страницы.
| Следующая версия | Предыдущая версия | ||
| web:cjs:config [2026/03/07 00:02] – создано Luciferus | web:cjs:config [2026/03/07 02:16] (текущий) – Luciferus | ||
|---|---|---|---|
| Строка 1: | Строка 1: | ||
| - | ====== ConverseJS | + | ====== |
| - | The included minified | + | Включенные минифицированные файлы |
| - | Converse is passed its configuration settings when you call its initialize method. | + | Информацию обо всех доступных параметрах конфигурации см. в разделе «Параметры конфигурации» ниже. |
| - | You’ll most likely want to call the initialize method in your HTML page. For an example of how this is done, please see the bottom of the ./ | + | ===== Параметры конфигурации ===== |
| + | ==== Источники медиа: ==== | ||
| - | Please refer to the Configuration settings section below for info on all the available configuration settings. | + | **<color # |
| - | Configuration settings | + | Если значение равно <wrap hi> |
| - | allowed_audio_domains | + | allowed_audio_domains: [' |
| - | Default: null | + | **<color # |
| + | Если значение равно <wrap hi> | ||
| + | allowed_image_domains: | ||
| - | If falsy, all domains are allowed. Set it to an array to specify a whitelist of allowed domains. | + | **<color # |
| - | allowed_image_domains | + | Если значение равно <wrap hi> |
| + | | ||
| - | Default: null | + | **<color # |
| - | If falsy, all domains are allowed. Set it to an array to specify a whitelist of allowed domains. | + | ==== Аутентификация: |
| - | E.g. ['imgur.com', | + | **<color # |
| - | allowed_video_domains | + | < |
| + | authentication: | ||
| + | </ | ||
| + | Этот параметр определяет способ аутентификации, который будет использовать Converse: \\ | ||
| + | **<color # | ||
| - | Default: null | + | **<color # |
| - | If falsy, all domains are allowed. Set it to an array to specify a whitelist of allowed domains. | + | **<color #ffc90e>anonymous</ |
| - | + | ||
| - | E.g. [' | + | |
| - | authentication | + | |
| - | + | ||
| - | Default: login | + | |
| - | + | ||
| - | Allowed values: login, external, | + | |
| - | + | ||
| - | This option states the way Converse will authenticate. | + | |
| - | login | + | |
| - | + | ||
| - | The default means is login, which means that the user either logs in manually with their username and password, or automatically if used together with auto_login set to true and jid and password values. | + | |
| - | external | + | |
| - | + | ||
| - | This setting will still show a login form and submit button, but the form will only contain an input for the user’s JID, not for the password. | + | |
| - | + | ||
| - | That’s because this setting is intended to be used when you are using SASL-EXTERNAL as authentication mechanism, in which case a password is usually not required. | + | |
| - | + | ||
| - | SASL-EXTERNAL is generally used together with x509 client certificates to enable passwordless login or 2-factor authentication. | + | |
| - | + | ||
| - | For more details on this, read this blog post. | + | |
| - | anonymous | + | |
| - | + | ||
| - | This enables anonymous login if the XMPP server supports it. This option can be used together with auto_login | + | |
| - | + | ||
| - | The server’s domain is passed in via the jid setting. | + | |
| - | prebind | + | |
| - | + | ||
| - | See also: Shared Sessions | + | |
| - | + | ||
| - | Use this option when you want to attach to an existing XMPP BOSH session. | + | |
| - | + | ||
| - | Usually a BOSH session is set up server-side in your web app. | + | |
| - | + | ||
| - | Attaching to an existing BOSH session that was set up server-side is useful when you want to maintain a persistent single session for your users instead of requiring them to log in manually. | + | |
| - | + | ||
| - | When a BOSH session is initially created, you’ll receive three tokens. A JID (jabber ID), SID (session ID) and RID (Request ID). | + | |
| - | + | ||
| - | Converse needs these tokens in order to attach to that same session. | + | |
| - | + | ||
| - | In addition to setting authentication to prebind, you’ll also need to set the prebind_url and bosh-service-url. | + | |
| - | + | ||
| - | Here’s an example of Converse being initialized with these options: | + | |
| + | **<color # | ||
| + | Используйте эту опцию, если хотите подключиться к существующей сессии XMPP **BOSH**. Обычно сессия **BOSH** устанавливается на стороне сервера в вашем веб-приложении. Подключение к существующей сессии **BOSH**, созданной на стороне сервера, | ||
| + | При первоначальном создании сессии **BOSH** вы получите три токена: | ||
| + | Вот пример инициализации Converse с этими параметрами: | ||
| + | < | ||
| converse.initialize({ | converse.initialize({ | ||
| bosh_service_url: | bosh_service_url: | ||
| Строка 78: | Строка 48: | ||
| allow_logout: | allow_logout: | ||
| }); | }); | ||
| + | </ | ||
| - | allow_adhoc_commands | + | ==== Cпециальные команды ==== |
| - | + | ||
| - | Default: true | + | |
| - | + | ||
| - | Allows privileged users to run XEP-0050 Ad-Hoc commands via the settings modal. | + | |
| - | allow_bookmarks | + | |
| - | + | ||
| - | Default: true | + | |
| - | + | ||
| - | Enables/ | + | |
| - | + | ||
| - | See also: allow_public_bookmarks | + | |
| - | allow_contact_removal | + | |
| - | + | ||
| - | Default: true | + | |
| - | Allow the user to remove roster contacts by clicking on the delete icon (i.e. trashcan) next to a contact’s name in the roster. | + | **<color # |
| - | allow_contact_requests | + | |
| - | Default: true | + | **<color # |
| - | Allow users to add one another as contacts. If this is set to false, the Add a contact widget, Contact Requests and Pending Contacts roster sections will all not appear. Additionally, | + | **<color # |
| - | allow_dragresize | + | |
| - | Default: true | + | **<color # |
| - | Allow users to resize chats by dragging the edges. The min-height | + | **<color # |
| - | allow_logout | + | |
| - | Default: true | + | **<color # |
| - | Determines whether the user is allowed to log out. If set to false, there will be no logout button. | ||
| allow_message_corrections | allow_message_corrections | ||