<commit_before>package priori.assets;

import priori.event.PriEvent;
import js.jquery.JQuery;

class AssetComponent extends Asset {


    private var _content:String;

    private var _isLoading:Bool = false;
    private var _isLoaded:Bool = false;



    public function new(id:String, url:String) {
        super(id, url);
    }

    override public function load() {
        if (_isLoaded == false && _isLoading == false) {

            this._isLoading = true;

            JQuery.ajax({

                method : "GET",

                url : this.url,

                async : true,
                cache : true,
                dataType : "font",

                error : function(e):Void {
                    this._isLoading = false;
                    this._isLoaded = false;

                    this.dispatchEvent(new PriEvent(PriEvent.ERROR));
                },

                success : function(data):Void {
                    this._content = data;

                    this._isLoading = false;
                    this._isLoaded = true;

                    //trace(this._content);

                    this.dispatchEvent(new PriEvent(PriEvent.COMPLETE));
                }

            });
        } else if (_isLoaded) {
            this.dispatchEvent(new PriEvent(PriEvent.COMPLETE));
        }
    }

    override public function getElement():JQuery {
        if (_isLoaded == false) {
            throw "Asset not loaded";
        }

        var result:JQuery = new JQuery(this._content);

        return result;
    }

}<commit_msg>get loaded content from AssetComponent<commit_after>package priori.assets;

import priori.event.PriEvent;
import js.jquery.JQuery;

class AssetComponent extends Asset {


    private var _content:String;

    private var _isLoading:Bool = false;
    private var _isLoaded:Bool = false;



    public function new(id:String, url:String) {
        super(id, url);
    }

    override public function load() {
        if (_isLoaded == false && _isLoading == false) {

            this._isLoading = true;

            JQuery.ajax({

                method : "GET",

                url : this.url,

                async : true,
                cache : true,

                error : function(e):Void {
                    this._isLoading = false;
                    this._isLoaded = false;

                    this.dispatchEvent(new PriEvent(PriEvent.ERROR));
                },

                success : function(data):Void {
                    this._content = data;

                    this._isLoading = false;
                    this._isLoaded = true;

                    //trace(this._content);

                    this.dispatchEvent(new PriEvent(PriEvent.COMPLETE));
                }

            });
        } else if (_isLoaded) {
            this.dispatchEvent(new PriEvent(PriEvent.COMPLETE));
        }
    }

    public function getContent():String {
        if (_isLoaded == false) throw "Asset not loaded";
        return this._content;
    }

    override public function getElement():JQuery {
        if (_isLoaded == false) {
            throw "Asset not loaded";
        }

        var result:JQuery = new JQuery(this._content);

        return result;
    }

}
{'fraction_non_alphanumeric': 0.09564949089787103, 'fraction_numerical': 0.0, 'mean_word_length': 1.4804896710022952, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2990947', 'n_tokens_mistral': 889, 'n_tokens_neox': 808, 'n_words': 194}