<commit_before>/**
 * Created by koroandr on 13.10.13.
 */
define([
    "lib/radio"
],
function (radio) {


    function init() {
        var anchor = location.hash;
        var route = anchor.split("_");
        switch (route[0]) {
            case "#member":
                radio("show-member").broadcast(route[1]);
                break;
            case "#lecture":
                radio("show-lecture").broadcast(route[1]);
                break;
            case "#about":
                radio("show-about").broadcast();
                break;
            default:
//                location.href = "";
                radio("show-about").broadcast();
        }
    }

    radio("member-selected").subscribe(function(member_id){
        history.pushState(null, null, "#member_" + member_id);
        radio("show-member").broadcast(member_id);
    });

    radio("lecture-selected").subscribe(function(lecture_id) {
        history.pushState(null, null, "#lecture" + lecture_id);
        radio("show-lecture").broadcast(lecture_id);
    });

    radio("about-selected").subscribe(function() {
        history.pushState(null, null, "#about");
        radio("show-about").broadcast();
    });


    return {
        init: init
    };
});<commit_msg>Фикс роутера, чтобы корректно отображалась история<commit_after>/**
 * Created by koroandr on 13.10.13.
 */
define([
    "lib/radio"
],
function (radio) {


    function init() {
        var anchor = location.hash;
        var route = anchor.split("_");
        switch (route[0]) {
            case "#member":
                radio("show-member").broadcast(route[1]);
                break;
            case "#lecture":
                radio("show-lecture").broadcast(route[1]);
                break;
            case "#about":
                radio("show-about").broadcast();
                break;
            default:
//                location.href = "";
                radio("show-about").broadcast();
        }
    }

    radio("member-selected").subscribe(function(member_id){
        history.pushState(null, null, "#member_" + member_id);
        radio("show-member").broadcast(member_id);
    });

    radio("lecture-selected").subscribe(function(lecture_id) {
        history.pushState(null, null, "#lecture" + lecture_id);
        radio("show-lecture").broadcast(lecture_id);
    });

    radio("about-selected").subscribe(function() {
        history.pushState(null, null, "#about");
        radio("show-about").broadcast();
    });

    window.addEventListener('popstate', function(event) {
        init();
    });

    return {
        init: init
    };
});
{'fraction_non_alphanumeric': 0.16330414921964218, 'fraction_numerical': 0.006851922344880091, 'mean_word_length': 1.9795918367346939, 'pattern_counts': {'":': 6, '<': 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': '2676848', 'n_tokens_mistral': 776, 'n_tokens_neox': 745, 'n_words': 118}