<commit_before>$(document).ready(renderFileBrowser());

function getContentsAsUl(pathname, f) {
    var loc = window.location;
    var url = loc.protocol+ '//'+ loc.host + pathname;
    $.getJSON(url, { a: "list" }, function(data) {
        var lis = [];
        if (data.parent) {
            var handler = "replaceContents('"+ data.parent+ "');";
            lis.push('<li class="backLink"><a href="#" onclick="'+handler+'">..</a></li>');
        }
        $.each(data.files, function(i, file) {
            if (file.container) {
                var handler = "replaceContents('"+file.href+"');";
                lis.push('<li class="folder"><a href="#" onClick="'+ handler +'">'+ file.name+'</a></li>');
            } else {
                lis.push('<li class="page"><a href="'+ file.href +'?a=edit">'+ file.name+'</a></li>');
            }
        });
        $("#containerPath").html(data.containerPath)
        var el = $('<ul/>', {
            html: lis.join('\n')
        });
        f(el);
    });
}

function replaceContents(pathname) {
    getContentsAsUl(pathname, function(el) {
        var ndiv = $('<div/>', {
            id: "filesTree",
            html: el
        });
        $("#filesTree").replaceWith(ndiv);
    });
}

function renderFileBrowser() {
    getContentsAsUl(window.location.pathname, function(el) {
        el.appendTo("#filesTree");
    });
}
<commit_msg>adds missing semicolon in js file<commit_after>$(document).ready(renderFileBrowser());

function getContentsAsUl(pathname, f) {
    var loc = window.location;
    var url = loc.protocol+ '//'+ loc.host + pathname;
    $.getJSON(url, { a: "list" }, function(data) {
        var lis = [];
        if (data.parent) {
            var handler = "replaceContents('"+ data.parent+ "');";
            lis.push('<li class="backLink"><a href="#" onclick="'+handler+'">..</a></li>');
        }
        $.each(data.files, function(i, file) {
            if (file.container) {
                var handler = "replaceContents('"+file.href+"');";
                lis.push('<li class="folder"><a href="#" onClick="'+ handler +'">'+ file.name+'</a></li>');
            } else {
                lis.push('<li class="page"><a href="'+ file.href +'?a=edit">'+ file.name+'</a></li>');
            }
        });
        $("#containerPath").html(data.containerPath);
        var el = $('<ul/>', {
            html: lis.join('\n')
        });
        f(el);
    });
}

function replaceContents(pathname) {
    getContentsAsUl(pathname, function(el) {
        var ndiv = $('<div/>', {
            id: "filesTree",
            html: el
        });
        $("#filesTree").replaceWith(ndiv);
    });
}

function renderFileBrowser() {
    getContentsAsUl(window.location.pathname, function(el) {
        el.appendTo("#filesTree");
    });
}

{'fraction_non_alphanumeric': 0.2129860863360685, 'fraction_numerical': 0.0, 'mean_word_length': 2.230414746543779, 'pattern_counts': {'":': 0, '<': 31, '<?xml version=': 0, '>': 31, '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': '19494', 'n_tokens_mistral': 881, 'n_tokens_neox': 864, 'n_words': 151}