<commit_before>@extends('template')

@section('page-title')
MCM Expo Birmingham
@endsection

@section('head')
<style type="text/css" media="screen">
  body {
    background: #D4D4D4;
  }
</style>
@endsection

@section('javascript')
<script type="text/javascript" src="{{ URL::asset('/assets/js/masonry.min.js') }}"></script>
<script type="text/javascript" src="{{ URL::asset('/assets/js/imagesloaded.min.js') }}"></script>
<script type="text/javascript">
  var container;
  var doingAjax = false;
  var initialLoad = true;
  var ids = [];

  function loadContent()
  {
    if (doingAjax === true)
      return;

    doingAjax = true;

    $.post('{{ URL::to('/load-content') }}', {
      'ids': ids,
    }).success(function(data) {

      $.each(data, function(i, item) {
        var div = $('<div class="col-lg-2 col-md-3 col-sm-3 col-xs-4 photo" data-id="' + item.id + '"><img class="img-responsive" alt="' + item.name + '" src="{{ URL::to('/photos') }}/' + item.filename + '"></div>');

        ids.push(item.id);

        div.imagesLoaded(function() {
          container.append(div).fadeIn(3000);
          container.masonry('appended', div).masonry();
        });

      });

      if (initialLoad === true) {
        setTimeout(function() { doingAjax = false; initialLoad = false; loadContent(); }, 1000);
      } else {
        doingAjax = false;
      }

    }).fail(function() {
      console.log('Error loading more content, maybe there is no more content available to load?');
      doingAjax = false;
    });
  }

  $(document).ready(function() {
    $(document).imagesLoaded(function() {
      container = $('#masonry');

      container.masonry({
        columnWidth: '.photo',
        itemSelector: '.photo'
      });

      if (initialLoad === true && $('#masonry').height() < $(window).height()) {
        loadContent();
      }

      container.masonry('on', 'layoutComplete', function(masonry, items)
      {
        if ((initialLoad === false || doingAjax == false) && $('#masonry').height() < $(window).height()) {
          loadContent();<commit_msg>Load images when scroll is at the bottom of the page<commit_after>@extends('template')

@section('page-title')
MCM Expo Birmingham
@endsection

@section('head')
<style type="text/css" media="screen">
  body {
    background: #D4D4D4;
  }
</style>
@endsection

@section('javascript')
<script type="text/javascript" src="{{ URL::asset('/assets/js/masonry.min.js') }}"></script>
<script type="text/javascript" src="{{ URL::asset('/assets/js/imagesloaded.min.js') }}"></script>
<script type="text/javascript">
  var container;
  var doingAjax = false;
  var initialLoad = true;
  var ids = [];

  function loadContent()
  {
    if (doingAjax === true)
      return;

    doingAjax = true;

    $.post('{{ URL::to('/load-content') }}', {
      'ids': ids,
    }).success(function(data) {

      $.each(data, function(i, item) {
        var div = $('<div class="col-lg-2 col-md-3 col-sm-3 col-xs-4 photo" data-id="' + item.id + '"><img class="img-responsive" alt="' + item.name + '" src="{{ URL::to('/photos') }}/' + item.filename + '"></div>');

        ids.push(item.id);

        div.imagesLoaded(function() {
          container.append(div).fadeIn(3000);
          container.masonry('appended', div).masonry();
        });

      });

      if (initialLoad === true) {
        setTimeout(function() { doingAjax = false; initialLoad = false; loadContent(); }, 1000);
      } else {
        doingAjax = false;
      }

    }).fail(function() {
      console.log('Error loading more content, maybe there is no more content available to load?');
      doingAjax = false;
    });
  }

  $(document).ready(function() {
    $(document).imagesLoaded(function() {
      container = $('#masonry');

      container.masonry({
        columnWidth: '.photo',
        itemSelector: '.photo'
      });

      if (initialLoad === true && $('#masonry').height() < $(window).height()) {
        loadContent();
      }

      container.masonry('on', 'layoutComplete', function(masonry, items)
      {
        if ((initialLoad === false && $('#masonry').height() < $(window).height()) || ($(window).scrollTop() + $(window).height()) == $(document).height()) {
          loadContent();
{'fraction_non_alphanumeric': 0.20283353010625738, 'fraction_numerical': 0.0070838252656434475, 'mean_word_length': 3.0189753320683113, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 23, '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': '4520689', 'n_tokens_mistral': 1356, 'n_tokens_neox': 1304, 'n_words': 276}