<commit_before>import "office-ui-fabric-js/dist/css/fabric.min.css"
import "office-ui-fabric-js/dist/css/fabric.components.min.css"
import "../Content/Office.css";
import "../Content/App.css";
import * as $ from "jquery";
import { appInsights } from "./diag"
import { mhaStrings } from "./Strings";
import { HeaderModel } from "./Headers"
import { Diagnostics } from "./diag"
import { Table } from "./Table"

(function () {
    "use strict";

    let viewModel = null;

    function enableSpinner() {
        $("#response").css("background-image", "url(../Resources/loader.gif)");
        $("#response").css("background-repeat", "no-repeat");
        $("#response").css("background-position", "center");
    }

    function disableSpinner() {
        $("#response").css("background", "none");
    }

    function updateStatus(statusText) {
        $("#status").text(statusText);
        if (viewModel !== null) {
            viewModel.status = statusText;
        }

        Table.recalculateVisibility();
    }

    // Do our best at recognizing RFC 2822 headers:
    // http://tools.ietf.org/html/rfc2822
    function analyze() {
        // Can't do anything without jQuery
        if (!$) return;
        if (appInsights) appInsights.trackEvent({ name: "analyzeHeaders" });
        // @ts-ignore TODO Fix this
        viewModel = HeaderModel($("#inputHeaders").val());
        Table.resetArrows();

        enableSpinner();
        updateStatus(mhaStrings.mhaLoading);

        Table.rebuildTables(viewModel);
        updateStatus("");

        disableSpinner();
    }

    function clear() {
        $("#inputHeaders").val("");

        viewModel = HeaderModel();
        Table.resetArrows();
        Table.rebuildSections(viewModel);
    }

    function copy() {
        mhaStrings.copyToClipboard(viewModel.toString());
    }

    if ($) {
        $(document).ready(function () {
            Diagnostics.set("API used", "standalone");
            viewModel = HeaderModel();
            Table.initializeTableUI(viewModel);
            Table.makeResizablePane("inputHeaders", mhaStrings.mhaPrompt, null);

            // @ts-ignore TODO Fix this
            document.querySelector("#analyzeButton").onclick = analyze;
            // @ts-ignore TODO Fix this
            document.querySelector("#clearButton").onclick = clear;
            // @ts-ignore TODO Fix this
            document.querySelector("#copyButton").onclick = copy;
        });
    }

    return;<commit_msg>remove todo from standalone<commit_after>import "office-ui-fabric-js/dist/css/fabric.min.css"
import "office-ui-fabric-js/dist/css/fabric.components.min.css"
import "../Content/Office.css";
import "../Content/App.css";
import * as $ from "jquery";
import { appInsights } from "./diag"
import { mhaStrings } from "./Strings";
import { HeaderModel } from "./Headers"
import { Diagnostics } from "./diag"
import { Table } from "./Table"

(function () {
    "use strict";

    let viewModel = null;

    function enableSpinner() {
        $("#response").css("background-image", "url(../Resources/loader.gif)");
        $("#response").css("background-repeat", "no-repeat");
        $("#response").css("background-position", "center");
    }

    function disableSpinner() {
        $("#response").css("background", "none");
    }

    function updateStatus(statusText) {
        $("#status").text(statusText);
        if (viewModel !== null) {
            viewModel.status = statusText;
        }

        Table.recalculateVisibility();
    }

    // Do our best at recognizing RFC 2822 headers:
    // http://tools.ietf.org/html/rfc2822
    function analyze() {
        // Can't do anything without jQuery
        if (!$) return;
        if (appInsights) appInsights.trackEvent({ name: "analyzeHeaders" });
        viewModel = HeaderModel($("#inputHeaders").val() as string);
        Table.resetArrows();

        enableSpinner();
        updateStatus(mhaStrings.mhaLoading);

        Table.rebuildTables(viewModel);
        updateStatus("");

        disableSpinner();
    }

    function clear() {
        $("#inputHeaders").val("");

        viewModel = HeaderModel();
        Table.resetArrows();
        Table.rebuildSections(viewModel);
    }

    function copy() {
        mhaStrings.copyToClipboard(viewModel.toString());
    }

    if ($) {
        $(document).ready(function () {
            Diagnostics.set("API used", "standalone");
            viewModel = HeaderModel();
            Table.initializeTableUI(viewModel);
            Table.makeResizablePane("inputHeaders", mhaStrings.mhaPrompt, null);

            (document.querySelector("#analyzeButton") as HTMLButtonElement).onclick = analyze;
            (document.querySelector("#clearButton") as HTMLButtonElement).onclick = clear;
            (document.querySelector("#copyButton") as HTMLButtonElement).onclick = copy;
        });
    }

    return;
{'fraction_non_alphanumeric': 0.1565501737175557, 'fraction_numerical': 0.0032699775189045576, 'mean_word_length': 2.5827232796486093, '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': '7026580', 'n_tokens_mistral': 1378, 'n_tokens_neox': 1339, 'n_words': 262}