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/wpamazingsecret/wp-content/themes/porto/js/shortcodes-copy.js
/**
 * Porto Shortcodes Copy JavaScript file
 */

'use strict';
jQuery( document ).ready( function ( $ ) {

    if ( $( 'textarea.wpb-content' ) ) {
        $( 'textarea.wpb-content' ).val( '' );
    }

    if ( $( '.elements-copy-list .copy' ) ) {

        $( '.elements-copy-list' ).on( 'click', '.copy', function ( e ) {
            e.preventDefault();
            var $this = $( this ),
                pb_id = $this.data( 'id' ),
                pb_content,
                initial = {};

            if ( pb_id == 'wpb' ) { // Wpbakery
                var $textarea = $this.parent().find( 'textarea.wpb-content' ),
                    textareaValue;
                if ( $textarea && 0 == $textarea.val().length ) {
                    textareaValue = $textarea.attr( 'placeholder' );
                    $textarea.val( textareaValue );
                }

                $textarea.trigger( 'select' );
                document.execCommand( 'copy' );

            } else if ( pb_id == 'el' ) { // Elementor

                pb_content = $this.data( 'content' );

                if ( window.localStorage.getItem( 'elementor' ) && pb_content ) {
                    initial = JSON.parse( window.localStorage.getItem( 'elementor' ) );
                    initial.clipboard = pb_content;
                    window.localStorage.setItem( 'elementor', JSON.stringify( initial ) );
                } else if ( pb_content ) {
                    initial.__expiration = {};
                    initial.clipboard = pb_content;
                    window.localStorage.setItem( 'elementor', JSON.stringify( initial ) );
                } else {
                    initial.__expiration = {};
                    initial.clipboard = {};
                    window.localStorage.setItem( 'elementor', JSON.stringify( initial ) );
                }

            } else if ( pb_id == 'gu' ) { // Gutenberg
                var $textarea2 = $this.parent().find( 'textarea.gu-content' );
                $textarea2.trigger( 'select' );
                document.execCommand( 'copy' );
            }

            $( '.elements-copy-list .copy' ).each( function ( e ) {
                var $el = $( this );
                if ( $el.hasClass( 'copied' ) || $el.html( 'Copied' ) ) {
                    $el.removeClass( 'copied' );
                    if ( $el.data( 'id' ) == 'wpb' ) {
                        $el.html( '<i class="fas fa-download mr-2"></i>WPBakery' );
                    } else if ( $el.data( 'id' ) == 'el' ) {
                        $el.html( '<i class="fas fa-download mr-2"></i>Elementor' );
                    } else {
                        $el.html( '<i class="fas fa-download mr-2"></i>Gutenberg' );
                    }
                }
            } );

            $this.addClass( 'copied' );
            $this.html( 'Copied' );
        } );

    }

    if ( $( '.elements-copy-list textarea' ) ) {
        $( '.elements-copy-list textarea' ).css( {
            "opacity": "0",
            "width": "0",
            "height": "0"
        } );
    }

} );