<commit_before>"use strict";

$(document).ready(function () {
  // TOOD: implement swipe gesture for navigation

  $.touch.preventDefault = false;
  //$.touch.triggerMouseEvents = true;

  var navigated = false;

  //$.touch.ready(function () {
  $(document).ready(function () {
    $('header').touchable({
      gesture: function (e, touchHistory) {
        if (navigated) return;
        // simple gesture handler
        if (touchHistory.match({ finger: 0, deltaX: '<-100', time: '1..100' })) {
          console.log('simpleSwipeLeftHandler');
          $.touch.history.empty();
          navigated = true;
        } else if (touchHistory.match({ finger: 0, deltaX: '>100', time: '1..100' })) {
          console.log('simpleSwipeRightHandler');
          $.touch.history.empty();
          navigated = true;
        }
      }
    });
  });


});<commit_msg>navi swipe<commit_after>"use strict";

$(document).ready(function () {
  function Navigation() {
    var navigated = false;

    this.next = function () {
      if(navigated) return;
      navigated = true;
      // TODO: implement this
    }

    this.previous = function () {
      if(navigated) return;
      navigated = true;
      // TODO: implement this
    }
  }

  var navigation = new Navigation();

  $.touch.preventDefault = false;

  $(document).ready(function () {
    $('header').touchable({
      gesture: function (e, touchHistory) {
        if (touchHistory.match({ finger: 0, deltaX: '<-100', time: '1..100' })) {
          navigation.next();
        } else if (touchHistory.match({ finger: 0, deltaX: '>100', time: '1..100' })) {
          navigation.previous();
        }
      }
    });
  });


});
{'fraction_non_alphanumeric': 0.17153067301965455, 'fraction_numerical': 0.019058963668850508, 'mean_word_length': 2.3667334669338675, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '4524680', 'n_tokens_mistral': 536, 'n_tokens_neox': 504, 'n_words': 112}