﻿var viewModel = null;
var LogError = null;

// This function is run when the app is ready to start interacting with the host application.
// It ensures the DOM is ready before updating the span elements with values from the current message.
$(document).ready(function () {
    LogError = window.parent.LogError;
    $(window).resize(onResize);
    viewModel = new HeaderModel();
    initializeTableUI();
    updateStatus(ImportedStrings.mha_loading);
    window.parent.SetRenderItemEvent(renderItemEvent);
});

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 hideStatus() {
    disableSpinner();
}

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

    recalculateVisibility();
}

// TODO: Somehow summary rows are not visible after this.
// Our visibility bindings need work
function renderItemEvent(headers) {
    updateStatus(ImportedStrings.mha_foundHeaders);
    $("#originalHeaders").text(headers);
    parseHeadersToTables(headers);
    hideStatus();
    recalculateVisibility();
}

function showError(error, message) {
    LogError(error, message);
    updateStatus(message);
    disableSpinner();
    rebuildSections();
}
@@ -1056,103 +1056,8 @@
 %0A%7D%0A%0A
-// TODO: Somehow summary rows are not visible after this.%0A// Our visibility bindings need work%0A
 func

Remove dead comment