{"size": 1318, "ext": "js", "max_stars_repo_path": "js/components/loader.js", "max_stars_repo_name": "AlphaGo88/Zero-UI", "max_stars_repo_stars_event_min_datetime": "2018-01-24T03:48:31.000Z", "max_stars_repo_stars_event_max_datetime": "2019-09-12T02:26:31.000Z", "max_issues_repo_path": "js/components/loader.js", "max_issues_repo_name": "AlphaGo88/Zero-UI", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "js/components/loader.js", "max_forks_repo_name": "AlphaGo88/Zero-UI", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 4, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 25.8431372549, "max_line_length": 78, "alphanum_fraction": 0.4848254932}
/*
    Loader
*/


! function($) {
    'use strict';

    $.fn.load = function(opt) {
    	var $this = $(this);

    	if ($this.find('.z-loading-mask').length) {
    		console.warn('Do not load repeatedly on the same div!');
    		return;
    	}

        var icon = opt && opt.icon || '<i class="fa fa-spinner fa-spin"></i>';
    	var msg = opt && opt.msg || '';
    	var darkClass = opt && opt.color === 'dark' ? ' dark' : '';
    	var _html = '<div class="z-loading-mask' + darkClass + '">'
    	+ '<div class="z-loading-content">'
    	+ icon
    	+ '<span class="z-loading-text">' + msg + '</span>'
    	+ '</div></div>';

    	if ($this.css('position') === 'static') {
    		$this.css('position', 'relative');
    	}
    	$(_html).appendTo($(this));
    }

	$.fn.unLoad = function() {
		$(this).find('.z-loading-mask').remove();
	}

    Z.load = function(opt) {
        var icon = opt && opt.icon || '<i class="fa fa-spinner fa-spin"></i>';
        var msg = opt && opt.msg || '';
        var _html = '<div class="z-g-loading-wrapper">'
        + '<div class="z-g-loading">'
        + icon
        + '<span class="z-loading-text">' + msg + '</span>'
        + '</div></div>';

        $(_html).appendTo($('body'));
    }

    Z.unLoad = function(opt) {
        $('.z-g-loading-wrapper').remove();
    }
}(jQuery);