<commit_before>var myrules = {
    // TAP Matrix triggers for more test file details
    'a.testfile_details_trigger' : function(el) {
        // get the id of the target div
        var matches = el.id.match(/^for_(.*)$/);
        var target = matches[1];
        // get the id of the indicator image
        matches = el.className.match(/(^|\s)show_(\S*)($|\s)/);
        var indicator = matches[2];

        el.onclick = function() {
console.log('clicking');
            if( Element.visible(target) ) {
console.log('  is ivisible');
                Effect.BlindUp(target, { duration: .5 });
            } else {
console.log('  not visibile');
                $(indicator).style.visibility = 'visible';
console.log('  making ajax request for target: ' + target);
                Smolder.Ajax.update({
                    url        : el.href,
                    target     : target,
                    indicator  : 'none',
                    onComplete : function() {
console.log('    in onComplete');
                        window.setTimeout(function() { $(indicator).style.visibility = 'hidden'}, 200);
console.log('    BlindDown');
                        Effect.BlindDown(
                            target,
                            // reapply any dynamic bits
                            { 
                                afterFinish : function() { 
console.log('      in afterFinish()');
                                    Behaviour.apply(target); 
                                },
                                duration    : .5
                            }
                        );
                    }
                });
            }
console.log('returning false');
            return false;
        };
    },
    'div.diag': function(el) {
        Smolder.setup_tooltip(el, el);
    },
    'td.tooltip_trigger' : function(el) {
        var diag = document.getElementsByClassName('tooltip', el)[0];
        Smolder.setup_tooltip(el, diag);
    },
    'a.show_all' : function(el) {
        Event.observe(el, 'click', function() {
            // an anonymous function that we use as a callback after each
            // panel is opened so that it opens the next one
            var show_details = function(index) {
                var el = $('testfile_details_' + index);
                // apply the behaviours if we're the last one
                if( ! el ) {
                    Behaviour.apply();
                    return;
                } 

                // we only need to fetch it if we're not already visible
                if( Element.visible(el) ) {
                    show_details(++index);
                } else {
                    matches = el.id.match(/^testfile_details_(\d+)$/);
                    var index = matches[1];
                    var indicator = $('indicator_' + index);
                    var div = $('testfile_details_' + index);
                    indicator.style.visibility = 'visible';
                    
                    Smolder.Ajax.update({
                        url        : $('for_testfile_details_' + index).href,
                        target     : div,
                        indicator  : 'none',
                        onComplete : function() {
                            Element.show(div);
                            indicator.style.visibility = 'hidden';
                            show_details(++index);
                        }
                    });
                }
            };
            show_details(0);
        });
    }
};

Behaviour.register(myrules);

<commit_msg>remove debugging<commit_after>var myrules = {
    // TAP Matrix triggers for more test file details
    'a.testfile_details_trigger' : function(el) {
        // get the id of the target div
        var matches = el.id.match(/^for_(.*)$/);
        var target = matches[1];
        // get the id of the indicator image
        matches = el.className.match(/(^|\s)show_(\S*)($|\s)/);
        var indicator = matches[2];

        el.onclick = function() {
            if( Element.visible(target) ) {
                Effect.BlindUp(target, { duration: .5 });
            } else {
                $(indicator).style.visibility = 'visible';
                Smolder.Ajax.update({
                    url        : el.href,
                    target     : target,
                    indicator  : 'none',
                    onComplete : function() {
                        window.setTimeout(function() { $(indicator).style.visibility = 'hidden'}, 200);
                        Effect.BlindDown(
                            target,
                            // reapply any dynamic bits
                            { 
                                afterFinish : function() { 
                                    Behaviour.apply(target); 
                                },
                                duration    : .5
                            }
                        );
                    }
                });
            }
            return false;
        };
    },
    'div.diag': function(el) {
        Smolder.setup_tooltip(el, el);
    },
    'td.tooltip_trigger' : function(el) {
        var diag = document.getElementsByClassName('tooltip', el)[0];
        Smolder.setup_tooltip(el, diag);
    },
    'a.show_all' : function(el) {
        Event.observe(el, 'click', function() {
            // an anonymous function that we use as a callback after each
            // panel is opened so that it opens the next one
            var show_details = function(index) {
                var el = $('testfile_details_' + index);
                // apply the behaviours if we're the last one
                if( ! el ) {
                    Behaviour.apply();
                    return;
                } 

                // we only need to fetch it if we're not already visible
                if( Element.visible(el) ) {
                    show_details(++index);
                } else {
                    matches = el.id.match(/^testfile_details_(\d+)$/);
                    var index = matches[1];
                    var indicator = $('indicator_' + index);
                    var div = $('testfile_details_' + index);
                    indicator.style.visibility = 'visible';
                    
                    Smolder.Ajax.update({
                        url        : $('for_testfile_details_' + index).href,
                        target     : div,
                        indicator  : 'none',
                        onComplete : function() {
                            Element.show(div);
                            indicator.style.visibility = 'hidden';
                            show_details(++index);
                        }
                    });
                }
            };
            show_details(0);
        });
    }
};

Behaviour.register(myrules);


{'fraction_non_alphanumeric': 0.11072362685265912, 'fraction_numerical': 0.002906131938390003, 'mean_word_length': 1.0607784431137726, '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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5689124', 'n_tokens_mistral': 1743, 'n_tokens_neox': 1615, 'n_words': 377}