HEX
Server: Apache
System: Linux vps-cdc32557.vps.ovh.ca 5.15.0-156-generic #166-Ubuntu SMP Sat Aug 9 00:02:46 UTC 2025 x86_64
User: hanode (1017)
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: /home/hanode/public_html/wp-content/plugins/sitepress-multilingual-cms/res/js/wpml-progressbar.js
/* global icl_ajxloaderimg */

var ProgressBar = Backbone.View.extend({
    dom: false,
    overall_count: 0,
    done_count: 0,
    ajax_loader_img: false,
    progress_label_value: false,
    progress_label: false,
    actionText : '',
    initialize: function () {
        var self = this;
        self.ajax_loader_img = jQuery(icl_ajxloaderimg);
        self.dom = jQuery('<div class="progressbar"><div class="progress-label"><span class="value"></span></div></div>');
        self.progress_label = self.dom.find(".progress-label");
        self.progress_label_value = self.dom.find(".value");

        return self;
    },
    start: function () {
        var self = this;
        self.ajax_loader_img.appendTo(self.progress_label);
        self.getDomElement().progressbar({value: false, max: 100});
        self.getDomElement().fadeIn();
		self.progress_label_value.text('');

        return self;
    },
    change: function (change) {
        var self = this;
        self.done_count += change;
        var value = Math.min(Math.round(self.done_count / self.overall_count * 100), 100);
        self.progress_label_value.text(self.actionText + " " + value + "%");
        self.getDomElement().progressbar('value', value);
    },
    complete: function (text, callback) {
        var self = this;
        self.ajax_loader_img.remove();
        self.progress_label_value.text(text);
        if (typeof callback === 'function') {
            callback(self);
        }
    },
    getRemainingCount: function () {
        var self = this;

        return self.overall_count - self.done_count;
    },
    getDomElement: function () {
        var self = this;

        return self.dom;
    },
    stop: function () {
        var self = this;
        self.getDomElement().hide();

        return self;
    }
});