<commit_before>define(['MessageCenter'], function (mc) {
    function ViewManager() {
        if (ViewManager.prototype._instance) return ViewManager.prototype._instance;
        ViewManager.prototype._instance = this;
        

        this.onViewChange = function (d) {
            var view = d.target;
            if (d && d.handler && typeof d.handler == 'function') {
                d.handler();
            }
            if (App.a) if (App.a.widgets[App.a.activeWidget]) App.a.widgets[App.a.activeWidget].onDeactivate();

            $(d.data.holder).empty();
            var self = this;
            require(["text!../views/" + view + ".html", 'js/ctrls/' + view + '.js'], function (html, js) {
                var $html = $(html);
                $(d.data.holder).append($html);
                //console.log(d.data.holder,$html);
                js.call(self, d.data);
            });
            
        };
        mc.subscribe('viewchange', {
                subscriber: this,
                callback: this.onViewChange
            });


    };
    ViewManager.prototype.toString = function () {
        return 'ViewManager'
    };
    return new ViewManager();
});<commit_msg>current view added. needed for backbutton on android<commit_after>define(['MessageCenter'], function (mc) {
    function ViewManager() {
        if (ViewManager.prototype._instance) return ViewManager.prototype._instance;
        ViewManager.prototype._instance = this;
        this.currentView = "";

        this.onViewChange = function (d) {
            var view = d.target;
            if (d && d.handler && typeof d.handler == 'function') {
                d.handler();
            }
            if (App.a) if (App.a.widgets[App.a.activeWidget]) App.a.widgets[App.a.activeWidget].onDeactivate();

            $(d.data.holder).empty();
            var self = this;
            this.currentView = view;
            require(["text!../views/" + view + ".html", 'js/ctrls/' + view + '.js'], function (html, js) {
                var $html = $(html);
                $(d.data.holder).append($html);
                //console.log(d.data.holder,$html);
                js.call(self, d.data);
            });
            
        };
        mc.subscribe('viewchange', {
                subscriber: this,
                callback: this.onViewChange
            });


    };
    ViewManager.prototype.toString = function () {
        return 'ViewManager'
    };
    return new ViewManager();
});
{'fraction_non_alphanumeric': 0.1504032258064516, 'fraction_numerical': 0.0, 'mean_word_length': 1.6850649350649352, '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': '622029', 'n_tokens_mistral': 693, 'n_tokens_neox': 666, 'n_words': 132}