<commit_before>var spinner = '<img src="picts/ajax-loader.gif"/>';

//function loading(id, msg) {
//  $('#'+id).html('<font class="loading">Loading '+msg+' . . .</font>');
//}

//function counting(){
//  var count = $('#genome_choice').getLength();
//  if (count == 0) {
//      $('#genome_choice').html('<option id=blank value=null>No Organism Selected</option>');
//  }
//  $('#selected_genome_count').html(count);
//}

//function update_basename(basename){
//    pageObj.basename = basename;
//}
//
//function reset_basename(){
//    if (pageObj.basename) pageObj.basename = 0;
//}
//
//function generate_basefile() {
//  $.ajax({
//      data: {
//          fname: 'generate_basefile',
//      },
//      success : function(filename) {
//          update_basename(filename);
//      }
//  });
//}

function query_results(options) {
    options.fname = "get_results";

    return $.ajax({
        type: "GET",
        data: options,
        dataType: "json"
    });
}

function launch(dialog, results, options) {
    var _results = $(results);
    var status_dialog = $(dialog).dialog({
        title: 'Running SynFind ....',
        modal: true,
        autoOpen: true
    });

    options.fname = 'go_synfind';
    // Sends to JEX and blocks until completion
    var submit = $.ajax({
        type: 'POST',
        dataType: 'json',
        data: options,
        success : function(response) {
            status_dialog.unbind().on("dialogclose", function() {
                _results.removeClass('hidden').slideDown();

                // reset dialog
                status_dialog.find(".dialog-error,.dialog-complete").hide();
                status_dialog.find(".dialog-running").show();
                status_dialog.find(".dialog-text").hmtl("");
                status_dialog.find(".dialog-link").html("");
                status_dialog.find(".dialog-log").html("");
            });

            if(response.success) {
                pageObj.runtime = 0;
                pageObj.fetch_error = 0;
                pageObj.error = 0;
                pageObj.engine = "<span class=\"alert\">The job engine has failed.</span><br>Please use the link below to use the previous version of SynMap.";

                var link = "Return to this analysis: <a href="
                + response.link + " onclick=window.open('tiny')"
                + "target = _new>" + response.link + "</a><br>";

                var logfile = $("<a></a>")
                    .attr("href", response.logfile)
                    .html("Logfile");

                status_dialog.find(".dialog-link").html(link);
                status_dialog.find(".dialog-log").html(logfile);

                options.fname = "get_results";

                update_dialog(response.request, dialog, results, formatter, options);
            } else {

                var error = $("<div></div>")<commit_msg>fix typo to remove text from status dialog<commit_after>var spinner = '<img src="picts/ajax-loader.gif"/>';

//function loading(id, msg) {
//  $('#'+id).html('<font class="loading">Loading '+msg+' . . .</font>');
//}

//function counting(){
//  var count = $('#genome_choice').getLength();
//  if (count == 0) {
//      $('#genome_choice').html('<option id=blank value=null>No Organism Selected</option>');
//  }
//  $('#selected_genome_count').html(count);
//}

//function update_basename(basename){
//    pageObj.basename = basename;
//}
//
//function reset_basename(){
//    if (pageObj.basename) pageObj.basename = 0;
//}
//
//function generate_basefile() {
//  $.ajax({
//      data: {
//          fname: 'generate_basefile',
//      },
//      success : function(filename) {
//          update_basename(filename);
//      }
//  });
//}

function query_results(options) {
    options.fname = "get_results";

    return $.ajax({
        type: "GET",
        data: options,
        dataType: "json"
    });
}

function launch(dialog, results, options) {
    var _results = $(results);
    var status_dialog = $(dialog).dialog({
        title: 'Running SynFind ....',
        modal: true,
        autoOpen: true
    });

    options.fname = 'go_synfind';
    // Sends to JEX and blocks until completion
    var submit = $.ajax({
        type: 'POST',
        dataType: 'json',
        data: options,
        success : function(response) {
            status_dialog.unbind().on("dialogclose", function() {
                _results.removeClass('hidden').slideDown();

                // reset dialog
                status_dialog.find(".dialog-error,.dialog-complete").hide();
                status_dialog.find(".dialog-running").show();
                status_dialog.find(".dialog-text").html("");
                status_dialog.find(".dialog-link").html("");
                status_dialog.find(".dialog-log").html("");
            });

            if(response.success) {
                pageObj.runtime = 0;
                pageObj.fetch_error = 0;
                pageObj.error = 0;
                pageObj.engine = "<span class=\"alert\">The job engine has failed.</span><br>Please use the link below to use the previous version of SynMap.";

                var link = "Return to this analysis: <a href="
                + response.link + " onclick=window.open('tiny')"
                + "target = _new>" + response.link + "</a><br>";

                var logfile = $("<a></a>")
                    .attr("href", response.logfile)
                    .html("Logfile");

                status_dialog.find(".dialog-link").html(link);
                status_dialog.find(".dialog-log").html(logfile);

                options.fname = "get_results";

                update_dialog(response.request, dialog, results, formatter, options);
            } else {

                var error = $("<div></div>")
{'fraction_non_alphanumeric': 0.17546288285170444, 'fraction_numerical': 0.0017304031839418584, 'mean_word_length': 1.964102564102564, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 33, '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': '4356671', 'n_tokens_mistral': 1687, 'n_tokens_neox': 1624, 'n_words': 328}