<commit_before>/**
 * Created by MrIsaacs on 28.05.2016.
 */

var Manic = new function () {
    var self = this;
    this.version = "2.0";
    this.scriptPromise;
    this.testScripts = {
        framework: {
            url: ["mootools", "mootools-more"],
            fn: () => {}
        }
    };
    this.testScripts2 = {
        framework: {
            url: "mootools",
            fn: () => {}
        },
        markdown: {
            url: ["showdown", "moodown"],
            fn: () => {}
        }
    };
    this.scripts = {
        framework: {
            url: ["mootools", "mootools-more"],
            fn: () => {
                console.log('loaded MooTools');
            }
        },
        markdown: {
            url: ["showdown", "moodown"],
            fn: () => {
                console.log('loaded Markdown');
            }
        },
        router: {
            url: "navigo",
            fn: () => {
                var i = document.getElementsByTagName('a').length;
                for (var j = 0; j < i; j++){
                    document.getElementsByTagName('a')[j].addEventListener('click', event => {
                        event.preventDefault();
                    });
                }
                console.log('loaded Navigo');

                return new Navigo('/manic', true).on({
                    'changelog/list': () => {
                        self.getJSON('changelog').then(response => {
                            console.log(response);
                        });

                        console.log('changlog-list');
                    },
                    'changelog/:id': params => {
                        jsonRequest.options.url = './data/changelog.json';
                        jsonRequest.setHeader('M-Request-Type', 'Info');
                        jsonRequest.setHeader('M-Request-ID', params.id);
                        // console.log(jsonRequest);
                        jsonRequest.get();
                        console.log('article-');
                    },
                    'credits': () => {
                        self.getJSON('changelog').then(response => {
                            console.log(response);
                        });
                        console.log('credits');
                    },
                    '/': () => {
                        self.getJSON('home').then(response => {
                            console.log(response);
                        });

                        console.log('home');
                    }
                }).navigate(window.location.hash);
            }
        }
    };

    this.initialize = () => {
        console.log('Manic Version ' + this.getVersion());
        document.onreadystatechange = () => {
            if (document.readyState === 'complete') {
                var i = document.getElementsByTagName('a').length;
                for (let j = 0; j < i; j++){
                    document.getElementsByTagName('a')[j].addEventListener('click',event => {
                        event.preventDefault();
                    });
                }

                self.getScriptCollection();
            }
        }
    };<commit_msg>fix(router): navigate correctly on first pageload<commit_after>/**
 * Created by MrIsaacs on 28.05.2016.
 */

var Manic = new function () {
    var self = this;
    this.version = "2.0";
    this.scripts = {
        framework: {
            url: ["mootools", "mootools-more"],
            fn: () => {
                console.log('loaded MooTools');
            }
        },
        markdown: {
            url: ["showdown", "moodown"],
            fn: () => {
                console.log('loaded Markdown');
            }
        },
        router: {
            url: "navigo",
            fn: () => {
                var i = document.getElementsByTagName('a').length;
                for (var j = 0; j < i; j++){
                    document.getElementsByTagName('a')[j].addEventListener('click', event => {
                        event.preventDefault();
                    });
                }
                console.log('loaded Navigo');

                return new Navigo('/manic', true).on({
                    'changelog/list': () => {
                        self.getJSON('changelog').then(response => {
                            console.log(response);
                        });

                        console.log('changlog-list');
                    },
                    'changelog/:id': params => {
                        jsonRequest.options.url = './data/changelog.json';
                        jsonRequest.setHeader('M-Request-Type', 'Info');
                        jsonRequest.setHeader('M-Request-ID', params.id);
                        // console.log(jsonRequest);
                        jsonRequest.get();
                        console.log('article-');
                    },
                    'credits': () => {
                        self.getJSON('changelog').then(response => {
                            console.log(response);
                        });
                        console.log('credits');
                    },
                    '/': () => {
                        self.getJSON('home').then(response => {
                            console.log(response);
                        });

                        console.log('home');
                    }
                }).navigate(
                    window.location.hash.length
                        ?window.location.hash
                        :(window.location.href[window.location.href.length-1]==="#"
                            ?''
                            :'/manic/#'
                        )
                );
            }
        }
    };

    this.initialize = () => {
        console.log('Manic Version ' + this.getVersion());
        document.onreadystatechange = () => {
            if (document.readyState === 'complete') {
                var i = document.getElementsByTagName('a').length;
                for (let j = 0; j < i; j++){
                    document.getElementsByTagName('a')[j].addEventListener('click',event => {
                        event.preventDefault();
                    });
                }

                self.getScriptCollection();
            }
        }
    };
{'fraction_non_alphanumeric': 0.1417733522996681, 'fraction_numerical': 0.004109372530425162, 'mean_word_length': 0.9861895794099184, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 34, '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': '1719456', 'n_tokens_mistral': 1605, 'n_tokens_neox': 1488, 'n_words': 220}