Plugin Directory

Changeset 2802161


Ignore:
Timestamp:
10/21/2022 12:28:49 AM (3 years ago)
Author:
staffingengine
Message:

Update to version 0.4.0 from GitHub

Location:
staffing-engine-chatbot
Files:
16 edited
1 copied

Legend:

Unmodified
Added
Removed
  • staffing-engine-chatbot/tags/0.4.0/readme.txt

    r2795262 r2802161  
    44- Donate Link: https://staffingengine.ai/
    55- Tags: chatbot, live chat, AI, staffing, recruiting
    6 - Stable tag: 0.3.0
     6- Stable tag: 0.4.0
    77- Requires at least: 5.5
    88- Tested up to: 6.0.1
     
    4848- UI/UX improvements to plugin settings page
    4949- Bug fixes
     50
     51= 0.4.0 : 2022-10-20 =
     52
     53- Better settings for auto expand functionality
     54- More fixes for guarding against overzealous wordpress themes
     55- Bug fixes
  • staffing-engine-chatbot/tags/0.4.0/src/bin/rational-option-pages.php

    r2784220 r2802161  
    426426                    ! empty( $field['text'] ) ? esc_html( $field['text'] ) : ''                         // text
    427427                );
     428        if ( ! empty( $field['description'] ) ) {
     429          printf(
     430            '<p class="se-checkbox-description">%s</p>',
     431            esc_html( $field['description'] )
     432          );
     433        }
    428434                break;
    429435            case 'media':
     
    535541                    esc_attr( $field['type'] ),                                                                                     // type
    536542                    esc_attr( $field['value'] ),                                                                                    // value
    537                     ! empty( $attributes ) ? esc_attr( implode( ' ', $attributes ) ) : '',                                          // additional attributes
     543                    ! empty( $attributes ) ? implode( ' ', $attributes ) : '',                                          // additional attributes
    538544                    ! empty( $field['text'] ) ? '<p class="help">' . esc_html( $field['text'] ) . '</p>' : ''           // text
    539545                );
  • staffing-engine-chatbot/tags/0.4.0/src/includes/admin.php

    r2795262 r2802161  
    192192            'fields' => array(
    193193              'position' => array(
    194                 'id'        => 'position',
    195                 'title' => __( 'Bot position', Plugin::SLUG ),
    196                 'text'  => __( 'Set the location of the bot on your site.', Plugin::SLUG ),
    197                 'type'  => 'select',
    198                 'value' => 'bottom-right',
    199                 'choices'       => array(
     194                'id'          => 'position',
     195                'title'   => __( 'Bot position', Plugin::SLUG ),
     196                'text'    => __( 'Set the location of the bot on your site.', Plugin::SLUG ),
     197                'type'    => 'select',
     198                'value'   => 'bottom-right',
     199                'choices'   => array(
    200200                  'bottom-right' => __( 'Bottom Right', Plugin::SLUG ),
    201201                  'bottom-left'  => __( 'Bottom Left', Plugin::SLUG ),
     
    221221                'id'      => 'animation',
    222222                'title'   => __( 'Animation type', Plugin::SLUG ),
    223                 'text'  => __( 'Choose an animation style to get the attention of site visitors.', Plugin::SLUG ),
     223                'text'    => __( 'Choose an animation style to get the attention of site visitors.', Plugin::SLUG ),
    224224                'type'    => 'select',
    225225                'value'   => 'pulse',
     
    270270                'text'    => __( 'Show the close icon on the popup. If disabled, it cannot be dismissed.', Plugin::SLUG  ),
    271271                'type'    => 'radio',
    272                 'value' => 'yes',
     272                'value'   => 'yes',
    273273                'choices'       => array(
    274274                  'yes' => __( 'Show', Plugin::SLUG),
     
    277277              ),
    278278              'inviteTimeout'   => array(
    279                 'id'    => 'invite_timeout',
    280                 'title' => __( 'Invite Timeout', Plugin::SLUG ),
    281                 'text'  => __( 'Set how long until the popup appears (in seconds)', Plugin::SLUG ),
    282                 'type'  => 'number',
    283                 'value' => 6,
     279                'id'         => 'invite_timeout',
     280                'title'      => __( 'Invite Timeout', Plugin::SLUG ),
     281                'text'       => __( 'Set how long until the popup appears (in seconds)', Plugin::SLUG ),
     282                'type'       => 'number',
     283                'value'      => 6,
     284                'attributes' => array(
     285                  'min' => 1,
     286                  'max' => 60,
     287                )
     288              ),
     289            ),
     290          ),
     291          'autoExpand' => array(
     292            'title'  => __( 'Auto Expand', Plugin::SLUG),
     293            'text'   => __( 'Automatically expand the chatbot sometime after the site has loaded', Plugin::SLUG ),
     294            'fields' => array(
     295              'autoExpandEnable' => array(
     296                'id'      => 'auto_expand_enable',
     297                'title'   => __( 'Enable Auto Expand', Plugin::SLUG ),
     298                'text'    => __( 'Auto Expand will automatically open the chatbot window after a set amount of time. Use "Enable, excluding small screens" to prevent auto expand from taking over the entire site on mobile devices.', Plugin::SLUG ),
     299                'type'    => 'select',
     300                'value'   => 'disable',
     301                'choices' => array(
     302                  'disable'           => __( 'Disable', Plugin::SLUG ),
     303                  'enable-not-mobile' => __( 'Enable, excluding small screens', Plugin::SLUG ),
     304                  'enable'            => __( 'Enable', Plugin::SLUG ),
     305                ),
     306              ),
     307              'autoExpandDelay' => array(
     308                'id'           => 'auto_expand_delay',
     309                'title'      => __( 'Auto Expand Delay', Plugin::SLUG ),
     310                'text'       => __( 'How long to wait (in seconds) before the chatbot window automatically opens.', Plugin::SLUG ),
     311                'type'       => 'number',
     312                'value'      => 5,
     313                'attributes' => array(
     314                  'min' => 1,
     315                  'max' => 60,
     316                )
    284317              ),
    285318            ),
     
    287320          'behavior' => array(
    288321            'title'  => __( 'Behavior', Plugin::SLUG),
    289             'text'   => __( 'Customize the chat widget\'s behavior', Plugin::SLUG ),
     322            'text'   => __( 'Customize how the chatbot acts under certain conditions', Plugin::SLUG ),
    290323            'fields' => array(
    291               'autoExpandDelay' => array(
    292                 'id'      => 'auto_expand_delay',
    293                 'title' => __( 'Auto Expand Delay', Plugin::SLUG ),
    294                 'text'  => __( 'How long to wait (in seconds) before the chatbot window automatically opens. Set to 0 to disable auto expand.', Plugin::SLUG ),
    295                 'type'  => 'number',
    296                 'value' => 0,
    297               ),
    298324              'allowStartNewConversation'       => array(
    299325                'id'      => 'allow_start_new_conversation',
     
    301327                'text'    => __( 'Set whether site visitors can start a new conversation or are required to pick up from a previous conversation, if one exists.', Plugin::SLUG ),
    302328                'type'    => 'radio',
    303                 'value' => 'yes',
    304                 'choices'       => array(
     329                'value'   => 'yes',
     330                'choices' => array(
    305331                  'yes' => __( 'Allow', Plugin::SLUG),
    306332                  'no'  => __( 'Don\'t Allow', Plugin::SLUG ),
  • staffing-engine-chatbot/tags/0.4.0/src/includes/embed.php

    r2795262 r2802161  
    129129        ?>
    130130<script>
     131  const IS_MOBILE = window.innerWidth <= 768;
     132
     133  const handleAutoExpand = (config, autoExpandState) => {
     134    if (autoExpandState === 'disable') {
     135      config.autoExpandDelay = 0;
     136    } else if (autoExpandState === 'enable-not-mobile' && IS_MOBILE) {
     137      config.autoExpandDelay = 0;
     138    }
     139  };
     140
    131141  const config = <?php echo json_encode( self::$final_options ); ?>;
     142  const autoExpandState = <?php echo json_encode( self::$options['auto_expand_enable'] ); ?>;
     143
     144  handleAutoExpand(config, autoExpandState);
    132145
    133146  const staffingEngineChatConfig = Object.assign(config, {
     
    183196      "inviteTimeout" => array_key_exists( 'invite_timeout', self::$options ) ? $this->parse_ms_setting( esc_attr( self::$options['invite_timeout'] ) . '000' ) : 5000,
    184197      "showCloseIcon" => array_key_exists( 'invite_show_close_icon', self::$options ) ? $this->parse_radio_setting( esc_attr( self::$options['invite_show_close_icon'] ), true ) : true,
    185       "autoExpandDelay" => array_key_exists( 'auto_expand_delay', self::$options ) ? $this->parse_ms_setting( esc_attr( self::$options['auto_expand_delay'] ) . '000' ) : 0,
     198      "autoExpandDelay" => array_key_exists( 'auto_expand_delay', self::$options ) ? $this->parse_ms_setting( esc_attr( self::$options['auto_expand_delay'] ) . '000' ) : '0',
    186199      "allowStartNewConversation" => array_key_exists( 'allow_start_new_conversation', self::$options ) ? $this->parse_radio_setting( esc_attr( self::$options['allow_start_new_conversation'] ), true ) : true,
    187200    ];
  • staffing-engine-chatbot/tags/0.4.0/src/public/css/se-chatbot-admin.css

    r2795262 r2802161  
    3434}
    3535
     36#staffing_engine_chatbot-page .se-checkbox-description {
     37  margin-top: 8px;
     38}
     39
    3640#staffing_engine_chatbot-page .se-alert-message {
    3741  background-color: #fef08a;
  • staffing-engine-chatbot/tags/0.4.0/src/public/css/se-chatbot.css

    r2785528 r2802161  
    1717 * the rwc iframe. This is particularly a problem with themes like salient
    1818 * that use `!important` on generic elements like `button`.
    19  *
    20  * TODO: We might consider only loading these on demand, or as an option to "resolve
    21  * common theme conflicts" or something since they aren't always necessary.
    2219 */
     20
    2321#staffing-engine-chatbot .rwc-embed-thumb {
     22  background-color: var(--widgetColor) !important;
    2423  border-radius: 50% !important;
    2524  box-shadow: 0 5px 25px 0 rgba(0,0,0,.13) !important;
    2625  transition: transform .4s,opacity .4s,visibility .4s,-webkit-transform .4s !important;
     26  border: none !important;
     27  outline: none !important;
     28  padding: 0 !important;
     29}
     30
     31#staffing-engine-chatbot .rwc-embed-welcome__btn button {
     32  color: #fff !important;
     33  background: var(--widgetColor) !important;
     34  border: 1px solid var(--rwcTheme) !important;
     35  border-color: var(--widgetColor) !important;
     36  border-radius: 8px !important;
     37  outline: none !important;
    2738}
    2839
    2940#staffing-engine-chatbot .rwc-embed-welcome__close {
     41  position: absolute !important;
     42  top: -7px !important;
     43  right: -7px !important;
     44  border: none !important;
    3045  border-radius: 50% !important;
    3146  -webkit-box-shadow: 0 2px 4px 0 rgba(0,0,0,.1) !important;
     
    3651  border-radius: 50% !important;
    3752  transition: background .15s ease !important;
     53  background-color: rgba(0, 0, 0, 0.3) !important;
     54  border: none !important;
     55  outline: none !important;
     56  padding: 0 !important;
     57  color: #fff !important;
    3858}
  • staffing-engine-chatbot/tags/0.4.0/src/public/js/se-chatbot-admin.js

    r2795262 r2802161  
    55    manageEnabled();
    66    manageInvitation();
     7    manageAutoExpand();
    78  }
    89
     
    4849
    4950    element.addEventListener(event, (event) => callback(event.target[key]));
     51  }
     52
     53  function setFormElementVisibility(element, visible) {
     54    !visible
     55      ? element.classList.add('se-hide-form-input')
     56      : element.classList.remove('se-hide-form-input');
    5057  }
    5158
     
    106113      ];
    107114
    108       if (!shown) {
    109         for (let el of invitationElements) {
    110           el.classList.add('se-hide-form-input');
    111         }
    112         return;
    113       }
    114 
    115       for (let el of invitationElements) {
    116         el.classList.remove('se-hide-form-input');
     115      for (const el of invitationElements) {
     116        setFormElementVisibility(el, shown)
    117117      }
    118118    }
    119119  }
     120
     121  function manageAutoExpand() {
     122    const autoExpandSelect = document.querySelector('#staffing_engine_chatbot-page select[id="auto_expand_enable"]');
     123
     124    listenForEvent(autoExpandSelect, 'change', onChanged, 'value', true);
     125
     126    function onChanged(value) {
     127      const autoExpandDelay = document.querySelector('#staffing_engine_chatbot-page input[id="auto_expand_delay"]').parentElement.parentElement
     128      setFormElementVisibility(autoExpandDelay, value !== 'disable')
     129    }
     130  }
    120131})();
  • staffing-engine-chatbot/tags/0.4.0/staffing-engine-chatbot.php

    r2795262 r2802161  
    55 * @copyright   (c) 2022 staffing Engine
    66 * @license     GPL-3.0-or-later
    7  * @version     0.3.0
     7 * @version     0.4.0
    88 *
    99 * @wordpress-plugin
     
    1515 * License: GPL v3 or later
    1616 * License URI: https://www.gnu.org/licenses/gpl-3.0.en.html
    17  * Version: 0.3.0
     17 * Version: 0.4.0
    1818 * Requires at least: 5.5
    1919 * Requires PHP: 7.1
     
    4141}
    4242
    43 define( 'SE_CHAT_VERSION', '0.3.0' );
     43define( 'SE_CHAT_VERSION', '0.4.0' );
    4444
    4545define( 'SE_CHAT_MIN_PHP', '7.1.0' );
  • staffing-engine-chatbot/trunk/readme.txt

    r2795262 r2802161  
    44- Donate Link: https://staffingengine.ai/
    55- Tags: chatbot, live chat, AI, staffing, recruiting
    6 - Stable tag: 0.3.0
     6- Stable tag: 0.4.0
    77- Requires at least: 5.5
    88- Tested up to: 6.0.1
     
    4848- UI/UX improvements to plugin settings page
    4949- Bug fixes
     50
     51= 0.4.0 : 2022-10-20 =
     52
     53- Better settings for auto expand functionality
     54- More fixes for guarding against overzealous wordpress themes
     55- Bug fixes
  • staffing-engine-chatbot/trunk/src/bin/rational-option-pages.php

    r2784220 r2802161  
    426426                    ! empty( $field['text'] ) ? esc_html( $field['text'] ) : ''                         // text
    427427                );
     428        if ( ! empty( $field['description'] ) ) {
     429          printf(
     430            '<p class="se-checkbox-description">%s</p>',
     431            esc_html( $field['description'] )
     432          );
     433        }
    428434                break;
    429435            case 'media':
     
    535541                    esc_attr( $field['type'] ),                                                                                     // type
    536542                    esc_attr( $field['value'] ),                                                                                    // value
    537                     ! empty( $attributes ) ? esc_attr( implode( ' ', $attributes ) ) : '',                                          // additional attributes
     543                    ! empty( $attributes ) ? implode( ' ', $attributes ) : '',                                          // additional attributes
    538544                    ! empty( $field['text'] ) ? '<p class="help">' . esc_html( $field['text'] ) . '</p>' : ''           // text
    539545                );
  • staffing-engine-chatbot/trunk/src/includes/admin.php

    r2795262 r2802161  
    192192            'fields' => array(
    193193              'position' => array(
    194                 'id'        => 'position',
    195                 'title' => __( 'Bot position', Plugin::SLUG ),
    196                 'text'  => __( 'Set the location of the bot on your site.', Plugin::SLUG ),
    197                 'type'  => 'select',
    198                 'value' => 'bottom-right',
    199                 'choices'       => array(
     194                'id'          => 'position',
     195                'title'   => __( 'Bot position', Plugin::SLUG ),
     196                'text'    => __( 'Set the location of the bot on your site.', Plugin::SLUG ),
     197                'type'    => 'select',
     198                'value'   => 'bottom-right',
     199                'choices'   => array(
    200200                  'bottom-right' => __( 'Bottom Right', Plugin::SLUG ),
    201201                  'bottom-left'  => __( 'Bottom Left', Plugin::SLUG ),
     
    221221                'id'      => 'animation',
    222222                'title'   => __( 'Animation type', Plugin::SLUG ),
    223                 'text'  => __( 'Choose an animation style to get the attention of site visitors.', Plugin::SLUG ),
     223                'text'    => __( 'Choose an animation style to get the attention of site visitors.', Plugin::SLUG ),
    224224                'type'    => 'select',
    225225                'value'   => 'pulse',
     
    270270                'text'    => __( 'Show the close icon on the popup. If disabled, it cannot be dismissed.', Plugin::SLUG  ),
    271271                'type'    => 'radio',
    272                 'value' => 'yes',
     272                'value'   => 'yes',
    273273                'choices'       => array(
    274274                  'yes' => __( 'Show', Plugin::SLUG),
     
    277277              ),
    278278              'inviteTimeout'   => array(
    279                 'id'    => 'invite_timeout',
    280                 'title' => __( 'Invite Timeout', Plugin::SLUG ),
    281                 'text'  => __( 'Set how long until the popup appears (in seconds)', Plugin::SLUG ),
    282                 'type'  => 'number',
    283                 'value' => 6,
     279                'id'         => 'invite_timeout',
     280                'title'      => __( 'Invite Timeout', Plugin::SLUG ),
     281                'text'       => __( 'Set how long until the popup appears (in seconds)', Plugin::SLUG ),
     282                'type'       => 'number',
     283                'value'      => 6,
     284                'attributes' => array(
     285                  'min' => 1,
     286                  'max' => 60,
     287                )
     288              ),
     289            ),
     290          ),
     291          'autoExpand' => array(
     292            'title'  => __( 'Auto Expand', Plugin::SLUG),
     293            'text'   => __( 'Automatically expand the chatbot sometime after the site has loaded', Plugin::SLUG ),
     294            'fields' => array(
     295              'autoExpandEnable' => array(
     296                'id'      => 'auto_expand_enable',
     297                'title'   => __( 'Enable Auto Expand', Plugin::SLUG ),
     298                'text'    => __( 'Auto Expand will automatically open the chatbot window after a set amount of time. Use "Enable, excluding small screens" to prevent auto expand from taking over the entire site on mobile devices.', Plugin::SLUG ),
     299                'type'    => 'select',
     300                'value'   => 'disable',
     301                'choices' => array(
     302                  'disable'           => __( 'Disable', Plugin::SLUG ),
     303                  'enable-not-mobile' => __( 'Enable, excluding small screens', Plugin::SLUG ),
     304                  'enable'            => __( 'Enable', Plugin::SLUG ),
     305                ),
     306              ),
     307              'autoExpandDelay' => array(
     308                'id'           => 'auto_expand_delay',
     309                'title'      => __( 'Auto Expand Delay', Plugin::SLUG ),
     310                'text'       => __( 'How long to wait (in seconds) before the chatbot window automatically opens.', Plugin::SLUG ),
     311                'type'       => 'number',
     312                'value'      => 5,
     313                'attributes' => array(
     314                  'min' => 1,
     315                  'max' => 60,
     316                )
    284317              ),
    285318            ),
     
    287320          'behavior' => array(
    288321            'title'  => __( 'Behavior', Plugin::SLUG),
    289             'text'   => __( 'Customize the chat widget\'s behavior', Plugin::SLUG ),
     322            'text'   => __( 'Customize how the chatbot acts under certain conditions', Plugin::SLUG ),
    290323            'fields' => array(
    291               'autoExpandDelay' => array(
    292                 'id'      => 'auto_expand_delay',
    293                 'title' => __( 'Auto Expand Delay', Plugin::SLUG ),
    294                 'text'  => __( 'How long to wait (in seconds) before the chatbot window automatically opens. Set to 0 to disable auto expand.', Plugin::SLUG ),
    295                 'type'  => 'number',
    296                 'value' => 0,
    297               ),
    298324              'allowStartNewConversation'       => array(
    299325                'id'      => 'allow_start_new_conversation',
     
    301327                'text'    => __( 'Set whether site visitors can start a new conversation or are required to pick up from a previous conversation, if one exists.', Plugin::SLUG ),
    302328                'type'    => 'radio',
    303                 'value' => 'yes',
    304                 'choices'       => array(
     329                'value'   => 'yes',
     330                'choices' => array(
    305331                  'yes' => __( 'Allow', Plugin::SLUG),
    306332                  'no'  => __( 'Don\'t Allow', Plugin::SLUG ),
  • staffing-engine-chatbot/trunk/src/includes/embed.php

    r2795262 r2802161  
    129129        ?>
    130130<script>
     131  const IS_MOBILE = window.innerWidth <= 768;
     132
     133  const handleAutoExpand = (config, autoExpandState) => {
     134    if (autoExpandState === 'disable') {
     135      config.autoExpandDelay = 0;
     136    } else if (autoExpandState === 'enable-not-mobile' && IS_MOBILE) {
     137      config.autoExpandDelay = 0;
     138    }
     139  };
     140
    131141  const config = <?php echo json_encode( self::$final_options ); ?>;
     142  const autoExpandState = <?php echo json_encode( self::$options['auto_expand_enable'] ); ?>;
     143
     144  handleAutoExpand(config, autoExpandState);
    132145
    133146  const staffingEngineChatConfig = Object.assign(config, {
     
    183196      "inviteTimeout" => array_key_exists( 'invite_timeout', self::$options ) ? $this->parse_ms_setting( esc_attr( self::$options['invite_timeout'] ) . '000' ) : 5000,
    184197      "showCloseIcon" => array_key_exists( 'invite_show_close_icon', self::$options ) ? $this->parse_radio_setting( esc_attr( self::$options['invite_show_close_icon'] ), true ) : true,
    185       "autoExpandDelay" => array_key_exists( 'auto_expand_delay', self::$options ) ? $this->parse_ms_setting( esc_attr( self::$options['auto_expand_delay'] ) . '000' ) : 0,
     198      "autoExpandDelay" => array_key_exists( 'auto_expand_delay', self::$options ) ? $this->parse_ms_setting( esc_attr( self::$options['auto_expand_delay'] ) . '000' ) : '0',
    186199      "allowStartNewConversation" => array_key_exists( 'allow_start_new_conversation', self::$options ) ? $this->parse_radio_setting( esc_attr( self::$options['allow_start_new_conversation'] ), true ) : true,
    187200    ];
  • staffing-engine-chatbot/trunk/src/public/css/se-chatbot-admin.css

    r2795262 r2802161  
    3434}
    3535
     36#staffing_engine_chatbot-page .se-checkbox-description {
     37  margin-top: 8px;
     38}
     39
    3640#staffing_engine_chatbot-page .se-alert-message {
    3741  background-color: #fef08a;
  • staffing-engine-chatbot/trunk/src/public/css/se-chatbot.css

    r2785528 r2802161  
    1717 * the rwc iframe. This is particularly a problem with themes like salient
    1818 * that use `!important` on generic elements like `button`.
    19  *
    20  * TODO: We might consider only loading these on demand, or as an option to "resolve
    21  * common theme conflicts" or something since they aren't always necessary.
    2219 */
     20
    2321#staffing-engine-chatbot .rwc-embed-thumb {
     22  background-color: var(--widgetColor) !important;
    2423  border-radius: 50% !important;
    2524  box-shadow: 0 5px 25px 0 rgba(0,0,0,.13) !important;
    2625  transition: transform .4s,opacity .4s,visibility .4s,-webkit-transform .4s !important;
     26  border: none !important;
     27  outline: none !important;
     28  padding: 0 !important;
     29}
     30
     31#staffing-engine-chatbot .rwc-embed-welcome__btn button {
     32  color: #fff !important;
     33  background: var(--widgetColor) !important;
     34  border: 1px solid var(--rwcTheme) !important;
     35  border-color: var(--widgetColor) !important;
     36  border-radius: 8px !important;
     37  outline: none !important;
    2738}
    2839
    2940#staffing-engine-chatbot .rwc-embed-welcome__close {
     41  position: absolute !important;
     42  top: -7px !important;
     43  right: -7px !important;
     44  border: none !important;
    3045  border-radius: 50% !important;
    3146  -webkit-box-shadow: 0 2px 4px 0 rgba(0,0,0,.1) !important;
     
    3651  border-radius: 50% !important;
    3752  transition: background .15s ease !important;
     53  background-color: rgba(0, 0, 0, 0.3) !important;
     54  border: none !important;
     55  outline: none !important;
     56  padding: 0 !important;
     57  color: #fff !important;
    3858}
  • staffing-engine-chatbot/trunk/src/public/js/se-chatbot-admin.js

    r2795262 r2802161  
    55    manageEnabled();
    66    manageInvitation();
     7    manageAutoExpand();
    78  }
    89
     
    4849
    4950    element.addEventListener(event, (event) => callback(event.target[key]));
     51  }
     52
     53  function setFormElementVisibility(element, visible) {
     54    !visible
     55      ? element.classList.add('se-hide-form-input')
     56      : element.classList.remove('se-hide-form-input');
    5057  }
    5158
     
    106113      ];
    107114
    108       if (!shown) {
    109         for (let el of invitationElements) {
    110           el.classList.add('se-hide-form-input');
    111         }
    112         return;
    113       }
    114 
    115       for (let el of invitationElements) {
    116         el.classList.remove('se-hide-form-input');
     115      for (const el of invitationElements) {
     116        setFormElementVisibility(el, shown)
    117117      }
    118118    }
    119119  }
     120
     121  function manageAutoExpand() {
     122    const autoExpandSelect = document.querySelector('#staffing_engine_chatbot-page select[id="auto_expand_enable"]');
     123
     124    listenForEvent(autoExpandSelect, 'change', onChanged, 'value', true);
     125
     126    function onChanged(value) {
     127      const autoExpandDelay = document.querySelector('#staffing_engine_chatbot-page input[id="auto_expand_delay"]').parentElement.parentElement
     128      setFormElementVisibility(autoExpandDelay, value !== 'disable')
     129    }
     130  }
    120131})();
  • staffing-engine-chatbot/trunk/staffing-engine-chatbot.php

    r2795262 r2802161  
    55 * @copyright   (c) 2022 staffing Engine
    66 * @license     GPL-3.0-or-later
    7  * @version     0.3.0
     7 * @version     0.4.0
    88 *
    99 * @wordpress-plugin
     
    1515 * License: GPL v3 or later
    1616 * License URI: https://www.gnu.org/licenses/gpl-3.0.en.html
    17  * Version: 0.3.0
     17 * Version: 0.4.0
    1818 * Requires at least: 5.5
    1919 * Requires PHP: 7.1
     
    4141}
    4242
    43 define( 'SE_CHAT_VERSION', '0.3.0' );
     43define( 'SE_CHAT_VERSION', '0.4.0' );
    4444
    4545define( 'SE_CHAT_MIN_PHP', '7.1.0' );
Note: See TracChangeset for help on using the changeset viewer.