<commit_before>﻿FuzzyOctoTribble.DialogBox = function (spec, my) {
    var that = {};
    var dialog = spec.dialogContent;
    var onComplete = spec.onComplete;
    var displayedText = "";
    my = my || {};

    var $dialogContainer = $(document.createElement('div'));
    $dialogContainer.addClass('dialog-container text-font');
    var $innerDialog = $(document.createElement('div'));
    $dialogContainer.append($innerDialog);
    var $next = $(document.createElement('div'));
    $next.text('>');
    $next.css('position', 'absolute');
    $next.css('bottom', '0px');
    $next.css('right', '10px');
    $next.css('font-size', '30px');
    $next.hide();
    $dialogContainer.append($next);
    $('.game-window').append($dialogContainer);

    var showDialog = function () {
        $innerDialog.empty();
        var writer = dialog.split(' ');
        var showArrow = false;
        for (var i = 0; i < writer.length; i++) {
            var currentText = $innerDialog.text();
            $innerDialog.text(currentText + ' ' + writer[i]);
            if ($innerDialog.innerHeight() > $dialogContainer.height()) {
                $innerDialog.text(currentText);
                writer.splice(0, i);
                showArrow = true;
                dialog = writer.join(' ');
                break;
            }
        }

        displayedText = $innerDialog.text();

        if (showArrow) {
            $next.show();
        }
        else {
            $next.hide();
            dialog = '';
        }

    }

    var nextDialog = function () {
        if (dialog) {
            showDialog();
        }
        else {
            $dialogContainer.remove();
            $(window).unbind('resize', resizeDialog);
            if (that.onComplete) {
                that.onComplete();
            }
            if (onComplete) {
                onComplete();
            }
        }
    }

    resizeDialog = function () {
        if (dialog) {
            dialog = displayedText + ' ' + dialog;
        } else {
            dialog = displayedText;
        }

        nextDialog();
    }

    $(window).bind('resize', resizeDialog);

    that.confirm = function () {
        nextDialog();
    }

    showDialog();

    return that;
}<commit_msg>Added ability to click through dialog<commit_after>﻿FuzzyOctoTribble.DialogBox = function (spec, my) {
    var that = {};
    var dialog = spec.dialogContent;
    var onComplete = spec.onComplete;
    var displayedText = "";
    my = my || {};

    var $dialogContainer = $(document.createElement('div'));
    $dialogContainer.addClass('dialog-container text-font');
    var $innerDialog = $(document.createElement('div'));
    $dialogContainer.append($innerDialog);
    var $next = $(document.createElement('div'));
    $next.text('>');
    $next.css('position', 'absolute');
    $next.css('bottom', '0px');
    $next.css('right', '10px');
    $next.css('font-size', '30px');
    $next.hide();
    $dialogContainer.append($next);
    $('.game-window').append($dialogContainer);

    var showDialog = function () {
        $innerDialog.empty();
        var writer = dialog.split(' ');
        var showArrow = false;
        for (var i = 0; i < writer.length; i++) {
            var currentText = $innerDialog.text();
            $innerDialog.text(currentText + ' ' + writer[i]);
            if ($innerDialog.innerHeight() > $dialogContainer.height()) {
                $innerDialog.text(currentText);
                writer.splice(0, i);
                showArrow = true;
                dialog = writer.join(' ');
                break;
            }
        }

        displayedText = $innerDialog.text();

        if (showArrow) {
            $next.show();
        }
        else {
            $next.hide();
            dialog = '';
        }

    }

    var nextDialog = function () {
        if (dialog) {
            showDialog();
        }
        else {
            $dialogContainer.remove();
            $(window).unbind('resize', resizeDialog);
            if (that.onComplete) {
                that.onComplete();
            }
            if (onComplete) {
                onComplete();
            }
        }
    }

    resizeDialog = function () {
        if (dialog) {
            dialog = displayedText + ' ' + dialog;
        } else {
            dialog = displayedText;
        }

        nextDialog();
    }

    $(window).bind('resize', resizeDialog);

    that.confirm = function () {
        nextDialog();
    }

    $dialogContainer.on('click', function () {
        that.confirm();
    });

    showDialog();

    return that;
}
{'fraction_non_alphanumeric': 0.15428074750108647, 'fraction_numerical': 0.003042155584528466, 'mean_word_length': 1.7779118889559444, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '7140363', 'n_tokens_mistral': 1303, 'n_tokens_neox': 1256, 'n_words': 240}