<commit_before>
/// <reference path="Reference.d.ts"/>

module Orange.Modularity {

    export class RegionManager {
        constructor(public container: Orange.Modularity.Container) { }

        public disposeRegions(root: HTMLElement) {
            var attr = root.getAttribute("data-view");
            if (attr == null || attr == "") {
                if (typeof root.children !== "undefined") {
                    for (var i = 0; i < root.children.length; i++)
                        this.disposeRegions(<HTMLElement>root.children[i]);
                }
            }
            else {
                var view = <Infviz.Controls.Control>root["instance"];
                view.dispose();
            }
        }

        public initializeRegions(root: HTMLElement): void {
            var attr = root.getAttribute("data-view");
            if (attr == null || attr == "") {
                if (typeof root.children !== "undefined") {
                    for (var i = 0; i < root.children.length; i++)
                        this.initializeRegions(<HTMLElement>root.children[i]);
                }
            }
            else {
                var viewType = eval(attr);
                var view = this.container.resolve(viewType);
                if (typeof view.element !== "undefined")
                    view.element = root;

                var idAttr = root.getAttribute("data-view-id");

                if (idAttr != null && attr != "") {
                    if (view.setViewId !== "undefined") {
                        view.setViewId(idAttr);
                    }
                }

                root["instance"] = view;
            }
        }
    }

}<commit_msg>Remove reference to Infviz Toolkit<commit_after>
/// <reference path="Reference.d.ts"/>

module Orange.Modularity {

    export class RegionManager {
        constructor(public container: Orange.Modularity.Container) { }

        public disposeRegions(root: HTMLElement) {
            var attr = root.getAttribute("data-view");
            if (attr == null || attr == "") {
                if (typeof root.children !== "undefined") {
                    for (var i = 0; i < root.children.length; i++)
                        this.disposeRegions(<HTMLElement>root.children[i]);
                }
            }
            else {
                var view = <any>root["instance"];
		if (typeof view.dispose === 'function')
                    view.dispose();
            }
        }

        public initializeRegions(root: HTMLElement): void {
            var attr = root.getAttribute("data-view");
            if (attr == null || attr == "") {
                if (typeof root.children !== "undefined") {
                    for (var i = 0; i < root.children.length; i++)
                        this.initializeRegions(<HTMLElement>root.children[i]);
                }
            }
            else {
                var viewType = eval(attr);
                var view = this.container.resolve(viewType);
                if (typeof view.element !== "undefined")
                    view.element = root;

                var idAttr = root.getAttribute("data-view-id");

                if (idAttr != null && attr != "") {
                    if (view.setViewId !== "undefined") {
                        view.setViewId(idAttr);
                    }
                }

                root["instance"] = view;
            }
        }
    }

}
{'fraction_non_alphanumeric': 0.127076654036724, 'fraction_numerical': 0.0011658408627222385, 'mean_word_length': 1.3204868154158216, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 11, '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': '2722749', 'n_tokens_mistral': 898, 'n_tokens_neox': 845, 'n_words': 182}