GRAYBYTE WORDPRESS FILE MANAGER3853

Server IP : 198.54.121.189 / Your IP : 216.73.216.112
System : Linux premium69.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
PHP Version : 7.4.33
Disable Function : NONE
cURL : ON | WGET : ON | Sudo : OFF | Pkexec : OFF
Directory : /home/giriqfky/trustyourlawyer.com/wp-content/plugins/backwpup/assets/js/
Upload Files :
Current_dir [ Writeable ] Document_root [ Writeable ]

Command :


Current File : /home/giriqfky/trustyourlawyer.com/wp-content/plugins/backwpup/assets/js//backup-downloader.js
window.BWU = window.BWU || {};

( function ( $, _, BWU, ajaxurl, tbRemove )
{
    var downloader;
    var decrypter;
    var Downloader;

    if ( !ajaxurl ) {
        // eslint-disable-line
        console.warn( 'Missing ajaxurl value.' );

        return;
    }
    if ( !( 'EventSource' in window ) ) {
        // eslint-disable-line
        console.warn( 'Event Source does not exist in this browser' );

        return;
    }

    function destruct ()
    {
        this.closeEventSource();
        this.cleanUi();
        this.decrypter && this.decrypter.destruct();
    }

    function hideElement ( el )
    {
        if ( !el ) {
            return;
        }

        el.style.display = 'none';
    }

    function showElement ( el )
    {
        if ( !el ) {
            return;
        }

        el.style.display = 'block';
    }

    Downloader = {

        showWaitingMessage: function ()
        {
            showElement( this.waitingUi );
        },

        showProgressUi: function ()
        {
            showElement( this.progressUi );
        },

        showSuccessMsg: function ()
        {
            showElement( this.successUi );
        },

        hideWaitingMessage: function ()
        {
            hideElement( this.waitingUi );
        },

        hideProgressUi: function ()
        {
            hideElement( this.progressUi );
        },

        hideNotice: function ()
        {
            BWU.Functions.removeMessages( this.containerUi );
        },

        hideSuccessMsg: function ()
        {
            hideElement( this.successUi );
        },

        cleanUi: function ()
        {
            this.hideWaitingMessage();
            this.hideProgressUi();
            this.hideNotice();
            this.hideSuccessMsg();
            this.decrypter && this.decrypter.hide();
        },

        done: function ()
        {
            this.showSuccessMsg();
            window.location.href = this.currentTarget.dataset.url;

            setTimeout( tbRemove, 3000 );
        },

        onMessage: function ( message )
        {
            var data;

            try {
                data = JSON.parse( message.data );

                switch ( data.state ) {
                    case BWU.States.DOWNLOADING:
                        this.cleanUi();
                        this.showProgressUi();

                        $( '#progresssteps' )
                            .css( {
                                width: data.download_percent + '%'
                            } )
                            .text( data.download_percent + '%' );
                        break;

                    case BWU.States.DONE:
                        this.done( data.message );
                        break;
                }
            } catch ( exc ) {
                BWU.Functions.printMessageError(
                    exc.message,
                    this.containerUi
                );
                destruct.call( this );
            }
        },

        onError: function ( message )
        {
            var data = JSON.parse( message.data );

            this.closeEventSource();

            switch ( data.message ) {
                case BWU.States.NEED_DECRYPTION_KEY:
                    this.cleanUi();
                    this.decrypter && this.decrypter.needDecryption( data.status );
                    break;
                default:
                    BWU.Functions.printMessageError( data.message, this.containerUi );
                    destruct.call( this );
                    break;
            }

            return this;
        },

        initializeEventSource: function ()
        {
            if ( !_.isUndefined( this.eventSource ) ) {
                return;
            }

            this.eventSource = new EventSource(
                ajaxurl
                + '?action=download_backup_file&destination=' + this.currentTarget.dataset.destination
                + '&jobid=' + this.currentTarget.dataset.jobid
                + '&file=' + this.currentTarget.dataset.file
                + '&local_file=' + this.currentTarget.dataset.localFile
                + '&backwpup_action_nonce=' + this.currentTarget.dataset.nonce
            );

            this.eventSource.onmessage = this.onMessage;
            this.eventSource.addEventListener( 'log', this.onError );
        },

        closeEventSource: function ()
        {
            if ( _.isUndefined( this.eventSource ) ) {
                return;
            }

            this.eventSource.close();
            this.eventSource = undefined;
        },

        startDirectDownload: function ( evt )
        {
            const url = evt.currentTarget.getAttribute('data-href');
            const anchor = document.createElement('a');
            anchor.href = url;
            document.body.appendChild(anchor);
            anchor.click();
            document.body.removeChild(anchor);
        },

        startDownload: function ( evt )
        {
            tb_show( 'Download Backup', evt.currentTarget.getAttribute('data-href'), false );
            evt.preventDefault();
            this.currentTarget = evt.currentTarget;
            this.showWaitingMessage();
            this.initializeEventSource();
        },

        decrypt: function ()
        {
            this.cleanUi();
            this.decrypter && this.decrypter.decrypt( {
                backwpup_action_nonce: this.currentTarget.dataset.nonce,
                encrypted_file_path: this.currentTarget.dataset.localFile
            } );
        },

        construct: function ( decrypter )
        {

            var containerUi = document.querySelector( '#tb_container' );
            if ( !containerUi ) {
                return false;
            }

            _.bindAll(
                this,
                'showWaitingMessage',
                'hideWaitingMessage',
                'showProgressUi',
                'hideSuccessMsg',
                'showSuccessMsg',
                'done',
                'onMessage',
                'onError',
                'initializeEventSource',
                'closeEventSource',
                'startDownload',
                'addListeners',
                'decrypt',
                'hideNotice',
                'cleanUi',
                'init'
            );

            this.containerUi = containerUi;
            this.waitingUi = this.containerUi.querySelector( '#download-file-waiting' );
            this.progressUi = this.containerUi.querySelector( '.progressbar' );
            this.successUi = this.containerUi.querySelector( '#download-file-success' );

            this.currentTarget = undefined;
            this.eventSource = undefined;
            this.decrypter = decrypter;

            return this;
        },

        addListeners: function ()
        {
            _.forEach(document.querySelectorAll( '.js-backwpup-direct-download-backup' ), function ( downloadLink )
            {
                downloadLink.addEventListener( 'click', this.startDirectDownload );
            }.bind( this ) );

            _.forEach( document.querySelectorAll( '.js-backwpup-download-backup' ), function ( downloadLink )
            {
                downloadLink.addEventListener( 'click', this.startDownload );
            }.bind( this ) );

            $( '#submit_decrypt_key' ).on( 'click', this.decrypt );
            $( 'body' ).on( 'thickbox:removed', function ()
            {
                destruct.call( this );
            }.bind( this ) );

            if ( this.decrypter ) {
                $( 'body' ).on( this.decrypter.ACTION_DECRYPTION_SUCCESS, this.done );
            } else {

            }

            return this;
        },

        init: function ()
        {
            this.addListeners();

            return this;
        }
    };

    downloader = Object.create( Downloader );

    if ( !_.isUndefined( BWU.DecrypterFactory ) ) {
        decrypter = BWU.DecrypterFactory(
            ajaxurl,
            document.querySelector( '#decrypt_key' ),
            document.querySelector( '#decryption_key' )
        );
    }

    if ( downloader.construct( decrypter ) ) {
        window.BWU.downloader =  downloader.init();
    }

}( window.jQuery, window._, window.BWU, window.ajaxurl, window.tb_remove ) );

[ Back ]
Name
Size
Last Modified
Owner / Group
Permissions
Options
..
--
July 10 2025 04:32:37
giriqfky / giriqfky
0755
vendor
--
July 10 2025 04:32:37
giriqfky / giriqfky
0755
.htaccess
0.41 KB
July 10 2025 04:32:37
giriqfky / giriqfky
0644
backup-downloader.js
8.136 KB
February 04 2025 14:50:44
giriqfky / giriqfky
0644
backup-downloader.min.js
4.155 KB
February 04 2025 14:50:44
giriqfky / giriqfky
0644
backwpup-admin.js
73.937 KB
May 20 2025 11:41:24
giriqfky / giriqfky
0644
backwpup-admin.min.js
41.965 KB
May 20 2025 11:41:24
giriqfky / giriqfky
0644
backwpup-generate.js
3.304 KB
April 29 2025 17:34:12
giriqfky / giriqfky
0644
backwpup-generate.min.js
2.107 KB
April 29 2025 17:34:12
giriqfky / giriqfky
0644
general.js
1.633 KB
February 04 2025 14:50:44
giriqfky / giriqfky
0644
general.min.js
0.899 KB
February 04 2025 14:50:44
giriqfky / giriqfky
0644
notice.js
1.782 KB
June 27 2024 12:50:44
giriqfky / giriqfky
0644
notice.min.js
1.355 KB
February 04 2025 14:50:44
giriqfky / giriqfky
0644
page_edit_jobtype_dbdump.js
3.351 KB
February 04 2025 14:50:44
giriqfky / giriqfky
0644
page_edit_jobtype_dbdump.min.js
2.25 KB
February 04 2025 14:50:44
giriqfky / giriqfky
0644
page_edit_jobtype_file.js
1.854 KB
February 04 2025 14:50:44
giriqfky / giriqfky
0644
page_edit_jobtype_file.min.js
1.524 KB
February 04 2025 14:50:44
giriqfky / giriqfky
0644
page_edit_tab_cron.js
5.343 KB
February 04 2025 14:50:44
giriqfky / giriqfky
0644
page_edit_tab_cron.min.js
3.153 KB
February 04 2025 14:50:44
giriqfky / giriqfky
0644
page_edit_tab_job.js
11.018 KB
February 04 2025 14:50:44
giriqfky / giriqfky
0644
page_edit_tab_job.min.js
4.275 KB
May 20 2025 11:41:24
giriqfky / giriqfky
0644
page_settings.js
2.496 KB
February 04 2025 14:50:44
giriqfky / giriqfky
0644
page_settings.min.js
1.734 KB
February 04 2025 14:50:44
giriqfky / giriqfky
0644
restore.js
2.308 KB
June 04 2024 11:20:18
giriqfky / giriqfky
0644
restore.min.js
1.121 KB
February 04 2025 14:50:44
giriqfky / giriqfky
0644
settings-encryption.js
13.06 KB
April 07 2025 18:31:08
giriqfky / giriqfky
0644
settings-encryption.min.js
7.722 KB
April 07 2025 18:31:08
giriqfky / giriqfky
0644
sidebar.js
0 KB
May 20 2025 11:41:24
giriqfky / giriqfky
0644
sidebar.min.js
0 KB
May 20 2025 11:41:24
giriqfky / giriqfky
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025
CONTACT ME
Static GIF