<commit_before>$(document).ready(function(){
    $("fieldset.advanced").click(function(event){
        $(this).find("pre").toggle("fast");
    });
});
<commit_msg>trigger an xhr request on paste and get back the sequence type; accordingly disable or enable blast methods (will disable all methods if first protein is pasted and then nucleotide, or vice versa)<commit_after>$(document).ready(function(){
    $("fieldset.advanced").click(function(event){
        $(this).find("pre").toggle("fast");
    });

    //var seq;
    $("#sequence:first").bind("paste", function(event){
        //get the value of the sequence
        var element = $(this);
        setTimeout(function(){
            var seq = element.val();
            var seq_type;
            $.post('/ajax', {sequence: seq}, function(data){
                seq_type = data;
                if (seq_type == "nucleotide"){
                    $("#blastp").attr('disabled', 'disabled');
                    $("#tblastn").attr('disabled', 'disabled');
                }
                else if (seq_type == "protein"){
                    $("#blastn").attr('disabled', 'disabled');
                    $("#tblastx").attr('disabled', 'disabled');
                    $("#blastx").attr('disabled', 'disabled');
                }
            });
        }, 10);
    });
});

{'fraction_non_alphanumeric': 0.18058690744920994, 'fraction_numerical': 0.0015048908954100827, 'mean_word_length': 2.1367924528301887, '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': '7418909', 'n_tokens_mistral': 357, 'n_tokens_neox': 334, 'n_words': 81}