HEX
Server: LiteSpeed
System: Linux premium221.web-hosting.com 4.18.0-553.45.1.lve.el8.x86_64 #1 SMP Wed Mar 26 12:08:09 UTC 2025 x86_64
User: madepabj (2566)
PHP: 8.3.26
Disabled: NONE
Upload Files
File: /home/madepabj/hc-cosmetics.com/wp-content/themes/dbea/framework/sample-data/assets/script.js
(function ($) {
    "use strict";
    $(document).ready(function(){
        function runImport(datatype, percent){
            $.ajax({
                type: 'POST',
                url: ajaxurl,
                data: {
                    'action': 'sampledata',
                    'datatype':  datatype,
                },
                success: function(data, textStatus, XMLHttpRequest){
                    $('.sns-importprocess-width').css({
                        'width' : percent + '%',
                        '-moz-transition' : 'width 1s',
                        '-o-transition' : 'width 1s',
                        '-webkit-transition' : 'width 1s',
                        'transition' : 'width 1s'
                    });
                    $('#sns-importmsg .status').html(' Importing: ' + percent + '%');
                    if ( datatype == 'theme' ){
                        $('#sns-import-tablecontent ul li.theme-cfg i').attr('class', 'fa fa-check');
                        percent = percent + 25;
                        runImport("slider", percent);
                        $('#sns-import-tablecontent ul li.revslider-cfg i').attr('class', 'fa fa-spin fa-circle-notch');
                    }
                    if ( datatype == 'slider' ){
                        $('#sns-import-tablecontent ul li.revslider-cfg i').attr('class', 'fa fa-check');
                        percent = percent + 25;
                        runImport("content", percent);
                        $('#sns-import-tablecontent ul li.all-content i').attr('class', 'fa fa-spin fa-circle-notch');
                    }
                    if ( datatype == 'content' ){
                        $('#sns-import-tablecontent ul li.all-content i').attr('class', 'fa fa-check');
                        percent = percent + 25;
                        runImport("widget", percent);
                        $('#sns-import-tablecontent ul li.widget-cfg i').attr('class', 'fa fa-spin fa-circle-notch');
                    }
                    if ( datatype == 'widget' ){
                        $('#sns-importmsg').html('Import done!');
                        $('#sns-import-tablecontent ul li.widget-cfg i').attr('class', 'fa fa-check');
                    }
                }
            });
        }
        $('#btn_sampledata').on('click', function() {
            var c = confirm("Are you want import demo content?");
            if (c == true) {
                $('.sns-importprocess').show();
                $(this).attr('disabled','true');
                $('#sns-importmsg .status').html('Importing');
                runImport("theme", 25);
            }
        });
    });
})(jQuery);