<commit_before>﻿var _allowMenuFontSizeChange = true;
var _showGrid = false;
var _outputSections = new Array();
var numCommands = 0;
var thisCommand = 0;
var commandsList = new Array();
var inventoryVerbs = null;
var placesObjectsVerbs = null;
var verbButtonCount = 9;
var beginningOfCurrentTurnScrollPosition = 0;

$(function () {
    $("#txtCommand").bind("inview", function (event, visible) {
        // allows spacebar to scroll browser when txtCommand is not visible
        if (visible == true) {
            $("#txtCommand").focus();
        } else {
            $("#txtCommand").blur();
        }
    });

    $("body").keydown(function (e) {
        if (_waitMode) {
            endWait();
        }
    });

    $("button").button();
    $("#gamePanesRunning").multiOpenAccordion({ active: [0, 1, 2, 3] });
    showStatusVisible(false);

    $("#cmdSave").click(function () {
        saveGame();
        afterSave();
    });

    $("#lstInventory").selectable({
        selected: function (event, ui) {
            $(ui.selected).siblings().removeClass("ui-selected");
            updateVerbButtons($(ui.selected), inventoryVerbs, "cmdInventory");
        }
    });

    $("#lstPlacesObjects").selectable({
        selected: function (event, ui) {
            $(ui.selected).siblings().removeClass("ui-selected");
            updateVerbButtons($(ui.selected), placesObjectsVerbs, "cmdPlacesObjects");
        }
    });

    $("#cmdCompassNW").button({
        icons: { primary: "ui-icon-arrowthick-1-nw" }
    });
    $("#cmdCompassN").button({
        icons: { primary: "ui-icon-arrowthick-1-n" }
    });
    $("#cmdCompassNE").button({
        icons: { primary: "ui-icon-arrowthick-1-ne" }
    });
    $("#cmdCompassW").button({
        icons: { primary: "ui-icon-arrowthick-1-w" }
    });
    $("#cmdCompassE").button({
        icons: { primary: "ui-icon-arrowthick-1-e" }
    });
    $("#cmdCompassSW").button({
        icons: { primary: "ui-icon-arrowthick-1-sw" }
    });
    $("#cmdCompassS").button({
        icons: { primary: "ui-icon-arrowthick-1-s" }
    });
    $("#cmdCompassSE").button({
        icons: { primary: "ui-icon-arrowthick-1-se" }
    });
    $("#cmdCompassU").button({
        icons: { primary: "ui-icon-triangle-1-n" }
    });
    $("#cmdCompassD").button({
        icons: { primary: "ui-icon-triangle-1-s" }
    });
    // fix to make compass button icons centred
    $(".compassbutton span").css("left", "0.8em");

    $("#txtCommand").bind('webkitspeechchange', function () {
        sendCommand($("#txtCommand").val());
        $("#txtCommand").val("");
    });
    
    $(document).on("click", "a", function (e) {
        var href = $(this).attr("href");
        if (href) {
            goUrl(href);
        }
        e.preventDefault();
    });

    $(document).on("click", ".elementmenu", function (event) {
        if (!$(this).hasClass("disabled")) {
            event.preventDefault();
            event.stopPropagation();
            $(this).jjmenu_popup();
            $(this).blur();
            return false;
        }
    });
    
    $(document).on("click", ".exitlink", function () {
        if (!$(this).hasClass("disabled")) {
            sendCommand($(this).data("command"));
        }
    });

    ui_init();
    updateStatusVisibility();

    $("#txtCommand").focus();
});

function loadHtml(html) {
    $("#divOutput").html(html);
}<commit_msg>#1289 Remove context menu from Player<commit_after>﻿var _allowMenuFontSizeChange = true;
var _showGrid = false;
var _outputSections = new Array();
var numCommands = 0;
var thisCommand = 0;
var commandsList = new Array();
var inventoryVerbs = null;
var placesObjectsVerbs = null;
var verbButtonCount = 9;
var beginningOfCurrentTurnScrollPosition = 0;

$(function () {
    $("#txtCommand").bind("inview", function (event, visible) {
        // allows spacebar to scroll browser when txtCommand is not visible
        if (visible == true) {
            $("#txtCommand").focus();
        } else {
            $("#txtCommand").blur();
        }
    });

    $("body").keydown(function (e) {
        if (_waitMode) {
            endWait();
        }
    });

    $("button").button();
    $("#gamePanesRunning").multiOpenAccordion({ active: [0, 1, 2, 3] });
    showStatusVisible(false);

    $("#cmdSave").click(function () {
        saveGame();
        afterSave();
    });

    $("#lstInventory").selectable({
        selected: function (event, ui) {
            $(ui.selected).siblings().removeClass("ui-selected");
            updateVerbButtons($(ui.selected), inventoryVerbs, "cmdInventory");
        }
    });

    $("#lstPlacesObjects").selectable({
        selected: function (event, ui) {
            $(ui.selected).siblings().removeClass("ui-selected");
            updateVerbButtons($(ui.selected), placesObjectsVerbs, "cmdPlacesObjects");
        }
    });

    $("#cmdCompassNW").button({
        icons: { primary: "ui-icon-arrowthick-1-nw" }
    });
    $("#cmdCompassN").button({
        icons: { primary: "ui-icon-arrowthick-1-n" }
    });
    $("#cmdCompassNE").button({
        icons: { primary: "ui-icon-arrowthick-1-ne" }
    });
    $("#cmdCompassW").button({
        icons: { primary: "ui-icon-arrowthick-1-w" }
    });
    $("#cmdCompassE").button({
        icons: { primary: "ui-icon-arrowthick-1-e" }
    });
    $("#cmdCompassSW").button({
        icons: { primary: "ui-icon-arrowthick-1-sw" }
    });
    $("#cmdCompassS").button({
        icons: { primary: "ui-icon-arrowthick-1-s" }
    });
    $("#cmdCompassSE").button({
        icons: { primary: "ui-icon-arrowthick-1-se" }
    });
    $("#cmdCompassU").button({
        icons: { primary: "ui-icon-triangle-1-n" }
    });
    $("#cmdCompassD").button({
        icons: { primary: "ui-icon-triangle-1-s" }
    });
    // fix to make compass button icons centred
    $(".compassbutton span").css("left", "0.8em");

    $("#txtCommand").bind('webkitspeechchange', function () {
        sendCommand($("#txtCommand").val());
        $("#txtCommand").val("");
    });
    
    $(document).on("click", "a", function (e) {
        var href = $(this).attr("href");
        if (href) {
            goUrl(href);
        }
        e.preventDefault();
    });

    $(document).on("click", ".elementmenu", function (event) {
        if (!$(this).hasClass("disabled")) {
            event.preventDefault();
            event.stopPropagation();
            $(this).jjmenu_popup();
            $(this).blur();
            return false;
        }
    });
    
    $(document).on("click", ".exitlink", function () {
        if (!$(this).hasClass("disabled")) {
            sendCommand($(this).data("command"));
        }
    });

    ui_init();
    updateStatusVisibility();

    var overrideContextMenuClick = function(e) {
        if (!e) e = window.event;
        if ((e.type && e.type == "contextmenu") || (e.button && e.button == 2) || (e.which && e.which == 3)) {
            return false;
        }
        return true;
    };
    if (document.layers) document.captureEvents(Event.MOUSEDOWN);
    document.onmousedown = overrideContextMenuClick;
    document.oncontextmenu = overrideContextMenuClick;

    $("#txtCommand").focus();
});

function loadHtml(html) {
    $("#divOutput").html(html);
}
{'fraction_non_alphanumeric': 0.19675065399972463, 'fraction_numerical': 0.006333471017485887, 'mean_word_length': 2.45083135391924, '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': '6486567', 'n_tokens_mistral': 2248, 'n_tokens_neox': 2237, 'n_words': 385}