<commit_before>{% load thumbnail %}
{% load typogrify_tags %}
{% if segments %}
<div class="carousel-envelope">
<script type="text/javascript">
    function jsGetChildren(aElement) {
        try
        {
            return aElement.childNodes;
        }
        catch(err)
        {
            return aElement.children;
        }
    }
    function jsHideElement(aElement) {
        try
        {
            aElement.style.display = 'none';
        }
        catch(err)
        { }
    }
    function jsShowElement(aElement) {
        try
        {
            aElement.style.display = 'block';
        }
        catch(err)
        { }
    }
    function jsUnfocusElement(aElement) {
        try
        {
            aElement.className = aElement.className.replace(' focus','');
        }
        catch(err)
        { }
    }
    function jsFocusElement(aElement) {
        try
        {
            aElement.className += " focus";
        }
        catch(err)
        { }
    }
</script>
<script type="text/javascript">
    function jsCarouselCountSegments(aSegmentsElement) {      
        try
        {
            return aSegmentsElement.children.length;
        }
        catch(err)
        {
            var max = 0;
            var segments = aSegmentsElement.childNodes;
            for (var i in segments) {
                if ( typeof(segments[i] == "object") && segments[i].nodeName == 'LI') {
                   max++; 
                }
            }
            return max;
        }
    }
    function jsCarouselPickSegment(aCarouselName, aSegmentNumber) {        
        var segments = jsGetChildren( document.getElementById(aCarouselName + '-segments') );
        for (var i in segments) {
            if (typeof(segments[i]) == "object") {
                jsHideElement( segments[i] );
            }
        }
        jsShowElement( document.getElementById(aCarouselName + '-segment' + aSegmentNumber) );
        var btns = jsGetChildren( document.getElementById(aCarouselName + '-btns') );
        for (var i in btns) {
            if (typeof(btns[i]) == "object") {        
                jsUnfocusElement( btns[i] );
            }
        }
        jsFocusElement( document.getElementById(aCarouselName + '-btn' + aSegmentNumber) );
    }
    var jsCarouselRotatorIntervalID = [];    
    function jsCarouselRotator(aCarouselName, aSegment) {
        jsCarouselPickSegment(aCarouselName, aSegment);
    }    
    function jsCarouselRotateStart(aCarouselName, aSegmentNumber) {
        jsCarouselRotateStop(aCarouselName);
        var i = aSegmentNumber;
        var max = jsCarouselCountSegments( document.getElementById(aCarouselName + '-segments') );
        jsCarouselRotatorIntervalID[aCarouselName] = window.setInterval(
          function(){
            jsCarouselRotator(aCarouselName, i);
            i = (i % max)+1;
          }
          , 3500);
    }
    function jsCarouselRotateStop(aCarouselName) {
        window.clearInterval(jsCarouselRotatorIntervalID[aCarouselName]);
        jsCarouselRotatorIntervalID[aCarouselName] = null;
    }
</script>

<div id="carousel{{carousel.pk}}" class="carousel" style="width:{{size.0}}px;">
  <ul id="carousel{{carousel.pk}}-segments" class="carousel-segments" >
        {% for segment in segments %}
    <li id="carousel{{carousel.pk}}-segment{{forloop.counter}}" name="carousel{{carousel.pk}}-segment" class="carousel-segment" {% if forloop.first %} style="display:block;" {% endif %}>
						{% thumbnail segment.image.file size crop upscale subject_location=segment.image.subject_location as image %}{% if image %}<img src="{{ image.url }}" />{% endif %}

    </li>
    {% endfor %}
  </ul>
  
  <ul id="carousel{{carousel.pk}}-btns" class="carousel-btns faded">
              {% for segment in segments %}

    <li id="carousel{{carousel.pk}}-btn{{forloop.counter}}" name="carousel{{carousel.pk}}-btn" class="carousel-btn fadeded {{segment.line_class}} {{segment.label_class}}" style="width:{{segment.label_width}}px;" onmouseover="jsCarouselRotateStop('carousel{{carousel.pk}}');javascript:jsCarouselPickSegment('carousel{{carousel.pk}}',{{forloop.counter}});" onmouseout="jsCarouselRotateStart('carousel{{carousel.pk}}',{{forloop.counter}});">
      <a class = "unfaded" href="{{segment.url}}">
      {{segment.link_title|caps}}
      </a>
    </li>    {% endfor %}

  </ul>
</div>


<commit_msg>carousel knows its height now<commit_after>{% load thumbnail %}
{% load typogrify_tags %}
{% if segments %}
<div class="carousel-envelope">
<script type="text/javascript">
    function jsGetChildren(aElement) {
        try
        {
            return aElement.childNodes;
        }
        catch(err)
        {
            return aElement.children;
        }
    }
    function jsHideElement(aElement) {
        try
        {
            aElement.style.display = 'none';
        }
        catch(err)
        { }
    }
    function jsShowElement(aElement) {
        try
        {
            aElement.style.display = 'block';
        }
        catch(err)
        { }
    }
    function jsUnfocusElement(aElement) {
        try
        {
            aElement.className = aElement.className.replace(' focus','');
        }
        catch(err)
        { }
    }
    function jsFocusElement(aElement) {
        try
        {
            aElement.className += " focus";
        }
        catch(err)
        { }
    }
</script>
<script type="text/javascript">
    function jsCarouselCountSegments(aSegmentsElement) {      
        try
        {
            return aSegmentsElement.children.length;
        }
        catch(err)
        {
            var max = 0;
            var segments = aSegmentsElement.childNodes;
            for (var i in segments) {
                if ( typeof(segments[i] == "object") && segments[i].nodeName == 'LI') {
                   max++; 
                }
            }
            return max;
        }
    }
    function jsCarouselPickSegment(aCarouselName, aSegmentNumber) {        
        var segments = jsGetChildren( document.getElementById(aCarouselName + '-segments') );
        for (var i in segments) {
            if (typeof(segments[i]) == "object") {
                jsHideElement( segments[i] );
            }
        }
        jsShowElement( document.getElementById(aCarouselName + '-segment' + aSegmentNumber) );
        var btns = jsGetChildren( document.getElementById(aCarouselName + '-btns') );
        for (var i in btns) {
            if (typeof(btns[i]) == "object") {        
                jsUnfocusElement( btns[i] );
            }
        }
        jsFocusElement( document.getElementById(aCarouselName + '-btn' + aSegmentNumber) );
    }
    var jsCarouselRotatorIntervalID = [];    
    function jsCarouselRotator(aCarouselName, aSegment) {
        jsCarouselPickSegment(aCarouselName, aSegment);
    }    
    function jsCarouselRotateStart(aCarouselName, aSegmentNumber) {
        jsCarouselRotateStop(aCarouselName);
        var i = aSegmentNumber;
        var max = jsCarouselCountSegments( document.getElementById(aCarouselName + '-segments') );
        jsCarouselRotatorIntervalID[aCarouselName] = window.setInterval(
          function(){
            jsCarouselRotator(aCarouselName, i);
            i = (i % max)+1;
          }
          , 3500);
    }
    function jsCarouselRotateStop(aCarouselName) {
        window.clearInterval(jsCarouselRotatorIntervalID[aCarouselName]);
        jsCarouselRotatorIntervalID[aCarouselName] = null;
    }
</script>

<div id="carousel{{carousel.pk}}" class="carousel" style="width:{{size.0}}px; height:{{size.1}}px;">
  <ul id="carousel{{carousel.pk}}-segments" class="carousel-segments" >
        {% for segment in segments %}
    <li id="carousel{{carousel.pk}}-segment{{forloop.counter}}" name="carousel{{carousel.pk}}-segment" class="carousel-segment" {% if forloop.first %} style="display:block;" {% endif %}>
						{% thumbnail segment.image.file size crop upscale subject_location=segment.image.subject_location as image %}{% if image %}<img src="{{ image.url }}" />{% endif %}

    </li>
    {% endfor %}
  </ul>
  
  <ul id="carousel{{carousel.pk}}-btns" class="carousel-btns faded">
              {% for segment in segments %}

    <li id="carousel{{carousel.pk}}-btn{{forloop.counter}}" name="carousel{{carousel.pk}}-btn" class="carousel-btn fadeded {{segment.line_class}} {{segment.label_class}}" style="width:{{segment.label_width}}px;" onmouseover="jsCarouselRotateStop('carousel{{carousel.pk}}');javascript:jsCarouselPickSegment('carousel{{carousel.pk}}',{{forloop.counter}});" onmouseout="jsCarouselRotateStart('carousel{{carousel.pk}}',{{forloop.counter}});">
      <a class = "unfaded" href="{{segment.url}}">
      {{segment.link_title|caps}}
      </a>
    </li>    {% endfor %}

  </ul>
</div>



{'fraction_non_alphanumeric': 0.13850698784229065, 'fraction_numerical': 0.0017043517782070218, 'mean_word_length': 2.3505900266463646, 'pattern_counts': {'":': 0, '<': 39, '<?xml version=': 0, '>': 39, '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': '3130462', 'n_tokens_mistral': 2703, 'n_tokens_neox': 2597, 'n_words': 427}