<commit_before>(function($) {

var TEXTAREA_MIN_PADDING_BOTTOM = 30;
var currentTextArea = undefined; /* used for timecode pasting */

$(document).ready(function() {
    function resetTimelines () {
        /* Connect videos to timed sections */
        $("video").each(function(){
            var url = $(this).attr('src') || $("[src]:first", this).attr('src');
            $(this).timeline({
                show: function (elt) {
                    $(elt).closest('section.section1').find('div.wrapper').autoscrollable("scrollto", elt);
                    $(elt).addClass("active");
                },
                hide: function (elt) {
                    $(elt).removeClass("active");
                },
                start: function (elt) { return $(elt).attr('data-start') },
                end: function (elt) { return $(elt).attr('data-end') }
            }).timeline("add", 'section.section1[about="' + url + '"] *[data-start]', {debug:true});
        });

        // Make timecodes clickable (jump to time in matching videos)
        $('span[property="aa:start"],span[property="aa:end"]').click(function () {
            var t = $.timecode_tosecs_attr($(this).attr("content"));
            var video = $('video source[src="' + $(this).parents('section.section1').attr('about')  + '"]').parent('video')[0];
            video.currentTime = t;
            video.play();
        });

    }

    /* Activate level-1 sections as (editable) playlists */
    $('section.section1').aaplaylist();
    // $("section.section1 > div.wrapper").autoscrollable();
    $("section.section1").autoscrollable();

    resetTimelines();

    $("section textarea").live("focus", function () {
        console.log("textarea focus", this);
        currentTextArea = this;
        // ENSURE TEXTAREA HEIGHT IS OK HACK
        var textareaheight = $this.height();
        var sectionheight = $this.closest(".section1").height();
        console.log("hh", sectionheight, textareaheight);
        if (textareaheight + TEXTAREA_MIN_PADDING_BOTTOM > sectionheight) {
            $this.css("height", (sectionheight - TEXTAREA_MIN_PADDING_BOTTOM)+"px");<commit_msg>resize textarea hack fixed<commit_after>(function($) {

var TEXTAREA_MIN_PADDING_BOTTOM = 30;
var currentTextArea = undefined; /* used for timecode pasting */

$(document).ready(function() {
    function resetTimelines () {
        /* Connect videos to timed sections */
        $("video").each(function(){
            var url = $(this).attr('src') || $("[src]:first", this).attr('src');
            $(this).timeline({
                show: function (elt) {
                    $(elt).closest('section.section1').find('div.wrapper').autoscrollable("scrollto", elt);
                    $(elt).addClass("active");
                },
                hide: function (elt) {
                    $(elt).removeClass("active");
                },
                start: function (elt) { return $(elt).attr('data-start') },
                end: function (elt) { return $(elt).attr('data-end') }
            }).timeline("add", 'section.section1[about="' + url + '"] *[data-start]', {debug:true});
        });

        // Make timecodes clickable (jump to time in matching videos)
        $('span[property="aa:start"],span[property="aa:end"]').click(function () {
            var t = $.timecode_tosecs_attr($(this).attr("content"));
            var video = $('video source[src="' + $(this).parents('section.section1').attr('about')  + '"]').parent('video')[0];
            video.currentTime = t;
            video.play();
        });

    }

    /* Activate level-1 sections as (editable) playlists */
    $('section.section1').aaplaylist();
    // $("section.section1 > div.wrapper").autoscrollable();
    $("section.section1").autoscrollable();

    resetTimelines();

    $("section textarea").live("focus", function () {
        // console.log("textarea focus", this);
        currentTextArea = this;
        // ENSURE TEXTAREA HEIGHT IS OK HACK
        var $this = $(this);
        var textareaheight = $this.height();
        var sectionheight = $this.closest(".section1").height();
        if (textareaheight + TEXTAREA_MIN_PADDING_BOTTOM > sectionheight) {
            $this.css("height", (sectionheight - TEXTAREA_MIN_PADDING_BOTTOM)+"px");
{'fraction_non_alphanumeric': 0.18084362619436029, 'fraction_numerical': 0.005127010020974132, 'mean_word_length': 2.4753036437246965, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '1988717', 'n_tokens_mistral': 1258, 'n_tokens_neox': 1211, 'n_words': 230}