<commit_before>(function () {

    var Titlebar = function (w) {
        var self = this;
        this.window = w;
        this.elements = {
            titlecap: w.root.getElementsByClassName("window-titlecap")[0],
            titlename: w.root.getElementsByClassName("window-titlename")[0],
            windowControls: {
                minimize: w.root.getElementsByClassName("window-control-minimize")[0],
                maximize: w.root.getElementsByClassName("window-control-maximize")[0],
                restore: w.root.getElementsByClassName("window-control-restore")[0]
            }
        };

        this.elements.titlename.innerHTML = "WebGL Inspector";

        this.elements.titlecap.onclick = function () {
            w.captureFrame();
        };

        this.elements.windowControls.minimize.onclick = function () {
            w.minimize();
        };
        this.elements.windowControls.maximize.onclick = function () {
            w.maximize();
        };
        this.elements.windowControls.restore.onclick = function () {
            w.restore();
        };
    };

    var Toolbar = function (w) {
        var self = this;
        this.window = w;
        this.elements = {
            toolbar: w.root.getElementsByClassName("window-toolbar")[0]
        };
    };

    var Statusbar = function (w) {
        var self = this;
        this.window = w;
        this.elements = {};
    };

    var Window = function (context, root, stateHUD, outputHUD) {
        this.context = context;
        this.root = root;

        this.stateHUD = stateHUD;
        this.outputHUD = outputHUD;

        this.elements = {
            titlebar: this.root.getElementsByClassName("window-titlebar")[0],
            toolbar: this.root.getElementsByClassName("window-toolbar")[0],
            middle: this.root.getElementsByClassName("window-middle")[0],
            bottom: this.root.getElementsByClassName("window-bottom")[0]
        };

        this.titlebar = new Titlebar(this);
        this.toolbar = new Toolbar(this);
        this.frameListing = new gli.ui.FrameListing(this);
        this.traceView = new gli.ui.TraceView(this);
        this.statusbar = new Statusbar(this);
    };

    Window.prototype.minimize = function () {
        this.elements.toolbar.style.display = "none";
        this.elements.middle.style.display = "none";
        this.elements.bottom.style.display = "none";
    };
    Window.prototype.maximize = function () {
        // TODO: proper maximize behavior
        this.restore();
    };
    Window.prototype.restore = function () {
        this.elements.toolbar.style.display = "";
        this.elements.middle.style.display = "";
        this.elements.bottom.style.display = "";
    };

    Window.prototype.captureFrame = function () {
        var self = this;
        this.context.capture(function (context, stream) {
            var frame = stream.frames[stream.frames.length - 1];
            self.frameListing.addFrame(frame);
            self.frameListing.selectFrame(frame);
        });
    };

    gli.ui = gli.ui || {};
    gli.ui.Window = Window;

    gli.ui.initialize = function (context, windowEl, stateHUDEl, outputHUDEl) {
        var stateHUD = new gli.ui.StateHUD(context, stateHUDEl);
        var outputHUD = new gli.ui.OutputHUD(context, outputHUDEl);
        var window = new gli.ui.Window(context, windowEl, stateHUD, outputHUD);
    };
})();<commit_msg>store of ui objects<commit_after>(function () {

    var Titlebar = function (w) {
        var self = this;
        this.window = w;
        this.elements = {
            titlecap: w.root.getElementsByClassName("window-titlecap")[0],
            titlename: w.root.getElementsByClassName("window-titlename")[0],
            windowControls: {
                minimize: w.root.getElementsByClassName("window-control-minimize")[0],
                maximize: w.root.getElementsByClassName("window-control-maximize")[0],
                restore: w.root.getElementsByClassName("window-control-restore")[0]
            }
        };

        this.elements.titlename.innerHTML = "WebGL Inspector";

        this.elements.titlecap.onclick = function () {
            w.captureFrame();
        };

        this.elements.windowControls.minimize.onclick = function () {
            w.minimize();
        };
        this.elements.windowControls.maximize.onclick = function () {
            w.maximize();
        };
        this.elements.windowControls.restore.onclick = function () {
            w.restore();
        };
    };

    var Toolbar = function (w) {
        var self = this;
        this.window = w;
        this.elements = {
            toolbar: w.root.getElementsByClassName("window-toolbar")[0]
        };
    };

    var Statusbar = function (w) {
        var self = this;
        this.window = w;
        this.elements = {};
    };

    var Window = function (context, root, stateHUD, outputHUD) {
        this.context = context;
        this.root = root;

        this.stateHUD = stateHUD;
        this.outputHUD = outputHUD;

        this.elements = {
            titlebar: this.root.getElementsByClassName("window-titlebar")[0],
            toolbar: this.root.getElementsByClassName("window-toolbar")[0],
            middle: this.root.getElementsByClassName("window-middle")[0],
            bottom: this.root.getElementsByClassName("window-bottom")[0]
        };

        this.titlebar = new Titlebar(this);
        this.toolbar = new Toolbar(this);
        this.frameListing = new gli.ui.FrameListing(this);
        this.traceView = new gli.ui.TraceView(this);
        this.statusbar = new Statusbar(this);
    };

    Window.prototype.minimize = function () {
        this.elements.toolbar.style.display = "none";
        this.elements.middle.style.display = "none";
        this.elements.bottom.style.display = "none";
    };
    Window.prototype.maximize = function () {
        // TODO: proper maximize behavior
        this.restore();
    };
    Window.prototype.restore = function () {
        this.elements.toolbar.style.display = "";
        this.elements.middle.style.display = "";
        this.elements.bottom.style.display = "";
    };

    Window.prototype.captureFrame = function () {
        var self = this;
        this.context.capture(function (context, stream) {
            var frame = stream.frames[stream.frames.length - 1];
            self.frameListing.addFrame(frame);
            self.frameListing.selectFrame(frame);
        });
    };

    gli.ui = gli.ui || {};
    gli.ui.Window = Window;

    gli.ui.initialize = function (context, windowEl, stateHUDEl, outputHUDEl) {
        gli.ui.stateHUD = new gli.ui.StateHUD(context, stateHUDEl);
        gli.ui.outputHUD = new gli.ui.OutputHUD(context, outputHUDEl);
        gli.ui.window = new gli.ui.Window(context, windowEl, gli.ui.stateHUD, gli.ui.outputHUD);
    };
})();
{'fraction_non_alphanumeric': 0.13323636363636363, 'fraction_numerical': 0.0032, 'mean_word_length': 2.152682255845942, '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': '1827257', 'n_tokens_mistral': 2031, 'n_tokens_neox': 1983, 'n_words': 318}