# adminify/1.0.7/Inc/Modules/ServerInformation/error-logs.js

Adminify – White Label, Admin Menu Editor, Login Customizer, version 1.0.7. 103 lines.

- Page: https://pluginprobe.com/plugins/adminify/1.0.7/code/Inc/Modules/ServerInformation/error-logs.js
- Raw: https://pluginprobe.com/plugins/adminify/1.0.7/raw/Inc/Modules/ServerInformation/error-logs.js
- Modified: 2021-11-24T08:01:26+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/adminify/1.0.7/code/Inc/Modules/ServerInformation/error-logs.js#L10-L20`.

```javascript
(function ($)
{
    'use strict';

    var WP_Adminify_Error_Logs ={

        // AJAX request: Clear Log Data
        Error_Refresh: function() {

            $('#adminify_error_log_refresh').on('click', function (e) {
                e.preventDefault();

                var tempLabel = $('#adminify_error_log_refresh').html(),
                    jsonObjects = [{ command: 'refresh_error_log' }],
                    jsonData = JSON.stringify(jsonObjects);


                $.ajax({
                    type: 'POST',
                    dataType: 'text',
                    async:false,
                    url: WPAdminify.ajax_url,
                    data: {
                        action: 'jltwp_adminify_error_log_content_refresh',
                        security: WPAdminify.security_nonce,
                        fileData: jsonData,
                    },
                    beforeSend: function () {
                        $('#adminify_error_log_refresh').text(WPAdminify.label_update);
                    },
                    cache: false,
                    success: function (data){
                        var refresh_content = $.parseJSON(data);
                        // Refresh the textarea content
                        $("textarea#adminify_error_log_area").val(refresh_content.file_content);
                        // // Change the button text
                        $('#adminify_error_log_refresh').html( WPAdminify.label_done );

                        // // Set button text to start text
                        setTimeout(function () { $('#adminify_error_log_refresh').html(tempLabel); }, 1500);
                    },
                    error: function (data){
                        $('#adminify_error_log_refresh').html('ERROR');
                    }
                });

            });
        },


        // AJAX request: Clear Log Data
        Error_Clear_Logs: function(){

            $('#adminify_error_log_clear').on('click', function (e) {
                e.preventDefault();

                var tempLabel = $('#adminify_error_log_clear').html(),
                    jsonObjects = [{ command: 'clear_error_log', }],
                    jsonData = JSON.stringify(jsonObjects);

                $.ajax({
                    type: 'POST',
                    dataType: 'text',
                    async:false,
                    url: WPAdminify.ajax_url,
                    data: {
                        action: 'jltwp_adminify_error_log_content_clear',
                        security: WPAdminify.security_nonce,
                        fileData: jsonData,
                    },
                    beforeSend: function () {
                        // Clearing button text
                        $('#adminify_error_log_clear').html(WPAdminify.label_clear);
                    },
                    cache: false,
                    success: function (data) {
                        // Refresh the textarea content
                        $("textarea#adminify_error_log_area").val(data.file_content);

                        // Change the button text
                        $('#adminify_error_log_clear').html(WPAdminify.label_done);

                        // Set button text to start text
                        setTimeout(function () { $('#adminify_error_log_clear').html(tempLabel); }, 1500);
                    },
                    error: function (data) {
                        $('#adminify_error_log_clear').html('ERROR');
                    }
                });

            });
        }
    }

    // Documents Loaded
    $( document ).ready(function() {
        WP_Adminify_Error_Logs.Error_Refresh();
        WP_Adminify_Error_Logs.Error_Clear_Logs();
    });


})(jQuery);

```
