<commit_before>﻿function panesVisible(visible) {
    initTabMenu(visible);
}

function scrollToEnd() {
    var newScrollTop = beginningOfCurrentTurnScrollPosition - 15;
    if ($("#gameBorder").height() > $(window).height()) {
        $('html, body').animate({ scrollTop: newScrollTop }, 200);
    }
}

function setBackground(col) {
    $("#gameBorder").css("background-color", col);
    $("#txtCommandDiv").css("background-color", col);
    $("body").css("background-color", col);
}

function setPanelHeight() {
}

function setPanelContents(html) {
}

var resizeTimer;

function ui_init() {
    //    resizeUI();
    //    $(window).resize(function () {
    //        clearTimeout(resizeTimer);
    //        resizeTimer = setTimeout(function () {
    //            resizeUI();
    //        }, 100);
    //    });
    //    document.addEventListener("orientationChanged", resizeUI);

    SetMenuFontSize("20px");
    _allowMenuFontSizeChange = false;

    initTabMenu(true);

    $("button.backButton span").html("&lt; Back to game");
    $("button.backButton").click(function () { tabMenu('game'); });
    $("#cmdLook").click(function () { sendCommand("look"); });
    $("#cmdRestart").click(function () { window.location.reload(); });
    $("#cmdUndo").click(function () { sendCommand("undo"); });
    $("#cmdWait").click(function () { sendCommand("wait"); });

    // fix to make compass button icons centred
    $(".compassbutton span").css("left", "1.5em");
}

function initTabMenu(full) {
    var options;

    if (full) {
        options = [
            { title: "Inventory", action: { type: "fn", callback: "tabMenu('inventory');"} },
            { title: "Location", action: { type: "fn", callback: "tabMenu('objects');"} },
            { title: "Exits", action: { type: "fn", callback: "tabMenu('exits');"} },
            { title: "More", action: { type: "fn", callback: "tabMenu('more');"} }
        ];
    }
    else {
        options = [
            { title: "More", action: { type: "fn", callback: "tabMenu('more');"} }
        ];
    }

    $("#tabButton").jjmenu(options);
}

function tabMenu(id) {
    $("div[id^=jjmenu]").remove();
    tabSelected(id);
}

function resizeUI() {
}

function beginWait() {
    _waitMode = true;
    $("#inputBar").fadeOut(400, function () {
        if (_waitMode) {
            $("#endWaitLink").fadeTo(400, 1);<commit_msg>Update jjmenu calls from playermobile.js to use proper callback functions<commit_after>﻿function panesVisible(visible) {
    initTabMenu(visible);
}

function scrollToEnd() {
    var newScrollTop = beginningOfCurrentTurnScrollPosition - 15;
    if ($("#gameBorder").height() > $(window).height()) {
        $('html, body').animate({ scrollTop: newScrollTop }, 200);
    }
}

function setBackground(col) {
    $("#gameBorder").css("background-color", col);
    $("#txtCommandDiv").css("background-color", col);
    $("body").css("background-color", col);
}

function setPanelHeight() {
}

function setPanelContents(html) {
}

var resizeTimer;

function ui_init() {
    //    resizeUI();
    //    $(window).resize(function () {
    //        clearTimeout(resizeTimer);
    //        resizeTimer = setTimeout(function () {
    //            resizeUI();
    //        }, 100);
    //    });
    //    document.addEventListener("orientationChanged", resizeUI);

    SetMenuFontSize("20px");
    _allowMenuFontSizeChange = false;

    initTabMenu(true);

    $("button.backButton span").html("&lt; Back to game");
    $("button.backButton").click(function () { tabMenu('game'); });
    $("#cmdLook").click(function () { sendCommand("look"); });
    $("#cmdRestart").click(function () { window.location.reload(); });
    $("#cmdUndo").click(function () { sendCommand("undo"); });
    $("#cmdWait").click(function () { sendCommand("wait"); });

    // fix to make compass button icons centred
    $(".compassbutton span").css("left", "1.5em");
}

function initTabMenu(full) {
    var options;

    if (full) {
        options = [
            { title: "Inventory", action: { type: "fn", callback: function() { tabMenu('inventory'); } } },
            { title: "Location", action: { type: "fn", callback: function () { tabMenu('objects'); } } },
            { title: "Exits", action: { type: "fn", callback: function() { tabMenu('exits'); } } },
            { title: "More", action: { type: "fn", callback: function() { tabMenu('more'); } } }
        ];
    }
    else {
        options = [
            { title: "More", action: { type: "fn", callback: function () { tabMenu('more'); } } }
        ];
    }

    $("#tabButton").jjmenu(options);
}

function tabMenu(id) {
    $("div[id^=jjmenu]").remove();
    tabSelected(id);
}

function resizeUI() {
}

function beginWait() {
    _waitMode = true;
    $("#inputBar").fadeOut(400, function () {
        if (_waitMode) {
            $("#endWaitLink").fadeTo(400, 1);
{'fraction_non_alphanumeric': 0.20348360655737704, 'fraction_numerical': 0.00778688524590164, 'mean_word_length': 3.0372208436724564, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '5503054', 'n_tokens_mistral': 1521, 'n_tokens_neox': 1478, 'n_words': 277}