HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux WebLive 5.15.0-79-generic #86-Ubuntu SMP Mon Jul 10 16:07:21 UTC 2023 x86_64
User: ubuntu (1000)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/html/wptuneprotect/wp-content/plugins/wpgetapi/assets/js/wpgetapi-admin.js
window.WpGetApi = window.WpGetApi || {};

(function (window, document, $, wpgetapi, undefined) {

    'use strict';

    /**
     * Start the JS.
     */
    wpgetapi.onReady = function () {

        var $page = wpgetapi.page();

        wpgetapi.functionsHelp();
        
        $page
            .on( 'change keyup', '.field-id input', wpgetapi.functionsHelp )
            .on( 'cmb2_remove_row cmb2_add_row cmb2_shift_row', wpgetapi.functionsHelp );

    }

    /**
     * Adds the endpoint into the functions help section.
     */
    wpgetapi.functionsHelp = function ( e ) {
        
        // change, keyup, add_row etc 
        if( e && e.type.length > 0 ) {

            var $this = $( this );
            var $group = $this.parents( '.cmb-repeatable-grouping' );

            // if we are adding a group, clear it
            if( e.type == 'cmb2_add_row' ) {
                $group = $( '.cmb-repeatable-grouping' ).last();
                $group.find( '.functions .endpoint_id' ).html( '' );
            }

            if( $group.length > 0 )
                $group.find( '.functions .endpoint_id' ).html( $this.val() );

        } else {

            $('.cmb-repeatable-grouping').each(function( index, value ) {
                
                var $group = $( this );
                var endpoint_value = $group.find( '.field-id input' ).val();
                $group.find( '.functions .endpoint_id' ).html( endpoint_value );

            });

        }

    }

	/**
     * Gets jQuery object containing all . Caches the result.
     *
     * @since  1.0.0
     *
     * @return {Object} jQuery object containing all.
     */
    wpgetapi.page = function() {
        if ( wpgetapi.$page ) {
            return wpgetapi.$page;
        }
        wpgetapi.$page = $('.wpgetapi');
        return wpgetapi.$page;
    };

    $( wpgetapi.onReady );

}(window, document, jQuery, window.WpGetApi));