<commit_before>requirejs.config({
    baseUrl: 'test',
    paths: {
        pvcf: '../../lib/pvcf',
        when: '../test/vendor/when/when',
        node: '../test/vendor/when/node',
        callbacks: '../test/vendor/when/callbacks'
    }
});

requirejs(['pvcf'], function run(pvcf) {
    var definitions = pvcf.definitions;
    var ViewDefinition = definitions.ViewDefinition;
    var TabManager = pvcf.TabManager;

    // ### View list. ###

    // # Events #

    var addEvent = new ViewDefinition('test/templates/addEvent.html', ['test/modules/addEvent.js'], true);


    // # Tab manager #

    var tabManager = new TabManager();
    var startTab = tabManager.openTab();

    startTab.openView(addEvent).done(function () {
        tabManager.closeTab(startTab);
    });

    tabManager.getContainerElement().appendChild(startTab.getContainerElement());

    document.body.appendChild(tabManager.getContainerElement());
});<commit_msg>Extend initialize layer by pattern manager.<commit_after>requirejs.config({
    baseUrl: 'test',
    paths: {
        pvcf: '../../lib/pvcf',
        when: '../test/vendor/when/when',
        node: '../test/vendor/when/node',
        callbacks: '../test/vendor/when/callbacks'
    }
});

requirejs(['pvcf'], function run(pvcf) {
    var definitions = pvcf.definitions;

    var ViewDefinition = definitions.ViewDefinition;
    var PatternDefinition = definitions.PatternDefinition;

    var PatternManager = pvcf.PatternManager;
    var TabManager = pvcf.TabManager;

    // ### View list ###

    // # Events #

    var addEvent = new ViewDefinition('test/templates/addEvent.html', ['test/modules/addEvent.js'], true);
    var showEvent = new ViewDefinition('test/templates/showEvent.html', ['test/modules/showEvent.js'], true);


    // # Pattern manager #

    var patternManager = new PatternManager();

    // ### Pattern list ###

    patternManager.addPattern(new PatternDefinition('event/add', addEvent));
    patternManager.addPattern(new PatternDefinition('event/show/:id', showEvent));


    // # Tab manager #

    var tabManager = new TabManager();
    document.body.appendChild(tabManager.getContainerElement());


    function main() {
        console.log('Appliaction started!');
    }


    // window.onload actions:
    var startTab = tabManager.openTab();

    startTab.openView(addEvent).done(function () {
        tabManager.closeTab(startTab);
    });

    tabManager.getContainerElement().appendChild(startTab.getContainerElement());

    main();


    // window.hashchange actions:
    window.addEventListener('hashchange', main);
});
{'fraction_non_alphanumeric': 0.1535205848403232, 'fraction_numerical': 0.0, 'mean_word_length': 3.1467304625199364, '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': '1826478', 'n_tokens_mistral': 765, 'n_tokens_neox': 733, 'n_words': 134}