Pārlūkot izejas kodu

New config setting `show_client_info`

Determines whether we show the icon for opening the client's "About" modal.
JC Brand 6 gadi atpakaļ
vecāks
revīzija
61a0e1bb16

+ 1 - 0
CHANGES.md

@@ -3,6 +3,7 @@
 ## 4.1.3 (Unreleased)
 
 - New config setting [locked_muc_domain](https://conversejs.org/docs/html/configuration.html#locked-muc-domain)
+- New config setting [show_client_info](https://conversejs.org/docs/html/configuration.html#show-client-info)
 - #1373: Re-add support for the [muc_domain](https://conversejs.org/docs/html/configuration.html#muc-domain) setting
 - #1400: When a chat message is just an emoji, enlarge the emoji
 - #1437: List of groupchats in modal doesn't scroll

+ 10 - 1
dist/converse.js

@@ -57327,6 +57327,11 @@ _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_4__["default"].plugins
      */
     const _converse = this._converse,
           __ = _converse.__;
+
+    _converse.api.settings.update({
+      'show_client_info': true
+    });
+
     _converse.ProfileModal = _converse.BootstrapModal.extend({
       events: {
         'change input[type="file"': "updateFilePreview",
@@ -94248,9 +94253,13 @@ var __t, __p = '', __e = _.escape, __j = Array.prototype.join;
 function print() { __p += __j.call(arguments, '') }
 __p += '<!-- src/templates/profile_view.html -->\n<div class="userinfo controlbox-padded">\n<div class="controlbox-section profile d-flex">\n    <a class="show-profile" href="#">\n        <canvas class="avatar align-self-center" height="40" width="40"></canvas>\n    </a>\n    <span class="username w-100 align-self-center">' +
 __e(o.fullname) +
-'</span>\n    <a class="controlbox-heading__btn show-client-info fa fa-info-circle align-self-center" title="' +
+'</span>\n    ';
+ if (o._converse.show_client_info) { ;
+__p += '\n        <a class="controlbox-heading__btn show-client-info fa fa-info-circle align-self-center" title="' +
 __e(o.info_details) +
 '"></a>\n    ';
+ } ;
+__p += '\n    ';
  if (o._converse.allow_logout) { ;
 __p += '\n        <a class="controlbox-heading__btn logout fa fa-sign-out-alt align-self-center" title="' +
 __e(o.title_log_out) +

+ 8 - 0
docs/source/configuration.rst

@@ -1271,6 +1271,14 @@ show_chatstate_notifications
 
 Specifies whether chat state (online, dnd, away) HTML5 desktop notifications should be shown.
 
+show_client_info
+----------------
+
+* Default:  ``true``
+
+Specifies whether the info icon is shown on the controlbox which when clicked opens an
+"About" modal with more information about the version of Converse being used.
+
 show_controlbox_by_default
 --------------------------
 

+ 4 - 0
src/converse-profile.js

@@ -33,6 +33,10 @@ converse.plugins.add('converse-profile', {
         const { _converse } = this,
               { __ } = _converse;
 
+        _converse.api.settings.update({
+            'show_client_info': true
+        });
+
 
         _converse.ProfileModal = _converse.BootstrapModal.extend({
             events: {

+ 3 - 1
src/templates/profile_view.html

@@ -4,7 +4,9 @@
         <canvas class="avatar align-self-center" height="40" width="40"></canvas>
     </a>
     <span class="username w-100 align-self-center">{{{o.fullname}}}</span>
-    <a class="controlbox-heading__btn show-client-info fa fa-info-circle align-self-center" title="{{{o.info_details}}}"></a>
+    {[ if (o._converse.show_client_info) { ]}
+        <a class="controlbox-heading__btn show-client-info fa fa-info-circle align-self-center" title="{{{o.info_details}}}"></a>
+    {[ } ]}
     {[ if (o._converse.allow_logout) { ]}
         <a class="controlbox-heading__btn logout fa fa-sign-out-alt align-self-center" title="{{{o.title_log_out}}}"></a>
     {[ } ]}