<commit_before>/* ========================================================================
 * DOM-based Routing
 * Based on http://goo.gl/EUTi53 by <NAME>
 *
 * Only fires on body classes that match. If a body class contains a dash,
 * replace the dash with an underscore when adding it to the object below.
 *
 * .noConflict()
 * The routing is enclosed within an anonymous function so that you can
 * always reference jQuery with $, even when in .noConflict() mode.
 * ======================================================================== */

(function($) {

  // Use this variable to set up the common and page specific functions. If you
  // rename this variable, you will also need to rename the namespace below.
  var Sage = {
    // All pages
    'common': {
      init: function() {
        // JavaScript to be fired on all pages
        window.twttr = (function(d, s, id) {
          var js, fjs = d.getElementsByTagName(s)[0],
            t = window.twttr || {};
          if (d.getElementById(id)) {return t;}
          js = d.createElement(s);
          js.id = id;
          js.src = "https://platform.twitter.com/widgets.js";
          js.async = true;
          fjs.parentNode.insertBefore(js, fjs);

          t._e = [];
          t.ready = function(f) {
            t._e.push(f);
          };

          return t;
        }(document, "script", "twitter-wjs"));

        window.fbAsyncInit = function() {
          FB.init({
            appId            : '199633970568255',
            autoLogAppEvents : true,
            xfbml            : true,
            version          : 'v2.9'
          });
          FB.AppEvents.logPageView();
        };

        (function(d, s, id){
           var js, fjs = d.getElementsByTagName(s)[0];
           if (d.getElementById(id)) {return;}
           js = d.createElement(s); js.id = id;
           js.src = "//connect.facebook.net/en_US/sdk.js";
           js.async = true;
           fjs.parentNode.insertBefore(js, fjs);
         }(document, 'script', 'facebook-jssdk'));

        $('.share-fb').click(function() {
          event.preventDefault();
          FB.ui({
           method: 'share',
           display: 'popup',
           href: $(this).attr('href'),
           }, function(response){
             console.dir(response);
           });
        });

        $('.share-tb').click(function() {
          event.preventDefault();
          makepopup($(this));
        });

        var $stickyElement = $('.travel__navigation');
        var sticky;

        if ($stickyElement.length) {
          sticky = new Waypoint.Sticky({
            element: $stickyElement[0],
            wrapper: '<div class="sticky-wrapper waypoint" />'
          });
          $('button.destroy-sticky').on('click', function() {
            sticky.destroy();
          });
        }

        var $mapStickyElement = $('.travel__detail__map__map-wrapper');
        var mapSticky;

        if ($mapStickyElement.length) {
          mapSticky = new Waypoint.Sticky({
            stuckClass: 'map-stuck',
            element: $mapStickyElement[0],
            wrapper: '<div class="sticky-wrapper waypoint" />',
            offset: 48
          });
          $('button.destroy-sticky').on('click', function() {
            sticky.destroy();
          });
        }

        $('.link_search-form_opener > a').click(function(e) {
          e.preventDefault();
          $('.search-form').slideToggle('slow');
          e.stopPropagation();
        });

        //automatic slick gallery creation
        $('[id^=gallery-]').slick({
          dots: true,
          infinite: true,
          slidesToShow: 4,
          slidesToScroll: 4,
          responsive: [
            {
              breakpoint: 480,
              settings: {
                arrows: false,
                dots: false,
                slidesToShow: 1,
                slidesToScroll: 1,
              }
            },
            {
              breakpoint: 768,
              settings: {
                arrows: false,
                dots: true,
                slidesToShow: 3,
                slidesToScroll: 3,
              }
            }
          ]
        });

        var slideout = new Slideout({
          'panel': document.getElementById('panel'),
          'menu': document.getElementById('slideout-menu'),
          'padding': window.innerWidth,
          'tolerance': 7,
          'easing': 'cubic-bezier(.32,2,.55,.27)'
        });

        if($('#mobile-travel-navigate').length) {
          var travel_slideout = new Slideout({
            'panel': document.getElementById('panel'),
            'menu': document.getElementById('mobile-travel-navigate'),
            'padding': window.innerWidth,
            'side': 'right',
            'tolerance': 7,
            'easing': 'cubic-bezier(.32,2,.55,.27)'
          });

          slideout.on('beforeopen', function() {
            $('#mobile-travel-navigate').addClass('slideout-open--left');
            travel_slideout.disableTouch();
          } );
          slideout.on('close', function() {
            $('#mobile-travel-navigate').removeClass('slideout-open--left');
            travel_slideout.enableTouch();
          } );

          travel_slideout.on('beforeopen', function() {
            $('#slideout-menu').addClass('slideout-open--right');
            slideout.disableTouch();
          } );
          travel_slideout.on('close', function() {
            $('#slideout-menu').removeClass('slideout-open--right');
            slideout.enableTouch();
          } );

          $('.travel__navigation__button--browse').click( function() {
            travel_slideout.open();
          } );

          $('.travel__slideout-menu-close').click( function() {
            travel_slideout.close();
          } );

          $(window).bind('orientationchange', function(evt) {
            if( travel_slideout.isOpen() ) {
              travel_slideout.close();
              $('html, body').animate( {scrollTop:0}, 'slow' );
            }<commit_msg>turned off swipe controls for menus.<commit_after>/* ========================================================================
 * DOM-based Routing
 * Based on http://goo.gl/EUTi53 by <NAME>
 *
 * Only fires on body classes that match. If a body class contains a dash,
 * replace the dash with an underscore when adding it to the object below.
 *
 * .noConflict()
 * The routing is enclosed within an anonymous function so that you can
 * always reference jQuery with $, even when in .noConflict() mode.
 * ======================================================================== */

(function($) {

  // Use this variable to set up the common and page specific functions. If you
  // rename this variable, you will also need to rename the namespace below.
  var Sage = {
    // All pages
    'common': {
      init: function() {
        // JavaScript to be fired on all pages
        window.twttr = (function(d, s, id) {
          var js, fjs = d.getElementsByTagName(s)[0],
            t = window.twttr || {};
          if (d.getElementById(id)) {return t;}
          js = d.createElement(s);
          js.id = id;
          js.src = "https://platform.twitter.com/widgets.js";
          js.async = true;
          fjs.parentNode.insertBefore(js, fjs);

          t._e = [];
          t.ready = function(f) {
            t._e.push(f);
          };

          return t;
        }(document, "script", "twitter-wjs"));

        window.fbAsyncInit = function() {
          FB.init({
            appId            : '199633970568255',
            autoLogAppEvents : true,
            xfbml            : true,
            version          : 'v2.9'
          });
          FB.AppEvents.logPageView();
        };

        (function(d, s, id){
           var js, fjs = d.getElementsByTagName(s)[0];
           if (d.getElementById(id)) {return;}
           js = d.createElement(s); js.id = id;
           js.src = "//connect.facebook.net/en_US/sdk.js";
           js.async = true;
           fjs.parentNode.insertBefore(js, fjs);
         }(document, 'script', 'facebook-jssdk'));

        $('.share-fb').click(function() {
          event.preventDefault();
          FB.ui({
           method: 'share',
           display: 'popup',
           href: $(this).attr('href'),
           }, function(response){
             console.dir(response);
           });
        });

        $('.share-tb').click(function() {
          event.preventDefault();
          makepopup($(this));
        });

        var $stickyElement = $('.travel__navigation');
        var sticky;

        if ($stickyElement.length) {
          sticky = new Waypoint.Sticky({
            element: $stickyElement[0],
            wrapper: '<div class="sticky-wrapper waypoint" />'
          });
          $('button.destroy-sticky').on('click', function() {
            sticky.destroy();
          });
        }

        var $mapStickyElement = $('.travel__detail__map__map-wrapper');
        var mapSticky;

        if ($mapStickyElement.length) {
          mapSticky = new Waypoint.Sticky({
            stuckClass: 'map-stuck',
            element: $mapStickyElement[0],
            wrapper: '<div class="sticky-wrapper waypoint" />',
            offset: 48
          });
          $('button.destroy-sticky').on('click', function() {
            sticky.destroy();
          });
        }

        $('.link_search-form_opener > a').click(function(e) {
          e.preventDefault();
          $('.search-form').slideToggle('slow');
          e.stopPropagation();
        });

        //automatic slick gallery creation
        $('[id^=gallery-]').slick({
          dots: true,
          infinite: true,
          slidesToShow: 4,
          slidesToScroll: 4,
          responsive: [
            {
              breakpoint: 480,
              settings: {
                arrows: false,
                dots: false,
                slidesToShow: 1,
                slidesToScroll: 1,
              }
            },
            {
              breakpoint: 768,
              settings: {
                arrows: false,
                dots: true,
                slidesToShow: 3,
                slidesToScroll: 3,
              }
            }
          ]
        });

        var slideout = new Slideout({
          'panel': document.getElementById('panel'),
          'menu': document.getElementById('slideout-menu'),
          'padding': window.innerWidth,
          'tolerance': 7,
          'easing': 'cubic-bezier(.32,2,.55,.27)',
          'touch': false
        });

        if($('#mobile-travel-navigate').length) {
          var travel_slideout = new Slideout({
            'panel': document.getElementById('panel'),
            'menu': document.getElementById('mobile-travel-navigate'),
            'padding': window.innerWidth,
            'side': 'right',
            'tolerance': 7,
            'easing': 'cubic-bezier(.32,2,.55,.27)',
            'touch': false
          });

          slideout.on('beforeopen', function() {
            $('#mobile-travel-navigate').addClass('slideout-open--left');
            // travel_slideout.disableTouch();
          } );
          slideout.on('close', function() {
            $('#mobile-travel-navigate').removeClass('slideout-open--left');
            // travel_slideout.enableTouch();
          } );

          travel_slideout.on('beforeopen', function() {
            $('#slideout-menu').addClass('slideout-open--right');
            // slideout.disableTouch();
          } );
          travel_slideout.on('close', function() {
            $('#slideout-menu').removeClass('slideout-open--right');
            // slideout.enableTouch();
          } );

          $('.travel__navigation__button--browse').click( function() {
            travel_slideout.open();
          } );

          $('.travel__slideout-menu-close').click( function() {
            travel_slideout.close();
          } );

          $(window).bind('orientationchange', function(evt) {
            if( travel_slideout.isOpen() ) {
              travel_slideout.close();
              $('html, body').animate( {scrollTop:0}, 'slow' );
            }
{'fraction_non_alphanumeric': 0.16763956260790924, 'fraction_numerical': 0.008879388308805393, 'mean_word_length': 1.6587978142076503, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 11, 'https://': 2, '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': '3519963', 'n_tokens_mistral': 3439, 'n_tokens_neox': 3251, 'n_words': 659}