<commit_before>/**
 * The Slide view.
 */
define([
  'jquery',
  'backbone',
  'underscore',
  'mps',
  'enquire',
  'handlebars',
], function($,Backbone, _,mps, enquire, Handlebars) {

  'use strict';

  // SLIDER
  var SlideView = Backbone.View.extend({

    el: '#main-slider',

    events: {
      'click #get-started' : 'getStarted',
      'click #go-to-apps' : 'goToApps',
      'click .gotomap' : 'gotoMap',
      'click .ribbon' : 'startSurvey'
    },

    initialize: function() {
      //Init
      this.$getStarted = $('#get-started');

      //Inits
      this.slickSlider();
    },

    slickSlider: function() {
      //INIT
      $('.main-slider-viewport').slick({
        infinite: true,
        speed: 500,
        autoplay: true,
        autoplaySpeed: 5000,
        slide: 'li',
        fade: true,
        cssEase: 'linear',
        dots: true,
        pauseOnHover: false,
        arrows: false,

        responsive: [
          {
            breakpoint: 850,
            speed: 250,
            settings: {
              fade: false,
              cssEase: 'ease-out'
            }
          }
        ]
      });

    },

    getStarted: function(e){
      e.stopPropagation();
      $(e.currentTarget).toggleClass('active');
    },

    startSurvey: function() {
      ga('send', 'event', 'Home', 'Click', 'Survey link in slider');
      var win = window.open('https://www.surveymonkey.com/s/GFWeval', '_blank');
      win.focus();
    },

    /**
     * Closes submenu tooltip
     * Check the click target is not the dialog itself.
     *
     * @param  {Object} e Event
     */
    _onHtmlClick: function(e) {
      if (!$(e.target).hasClass('submenu-tooltip') && this.$getStarted.hasClass('active')) {
        this.$getStarted.removeClass('active');
      }
    },


    goToApps: function(e){
      e.preventDefault();
      var posY = $($(e.currentTarget).attr('href')).offset().top;
      $('html,body').animate({scrollTop: posY},500);
    },

    gotoMap: function(e) {
      e.preventDefault();
      e.stopPropagation();

      var $target = $(e.target);

      if (!$(e.target).hasClass('gotomap')) {
        $target = $(e.target).parent();
      }

      if ($target.data('dialog')) {
        var dialog = JSON.stringify(
        {
          "display": true,
          "type" : $target.data('dialog')
        });

        sessionStorage.setItem('DIALOG', dialog);
      }
      ga('send', 'event', 'Get Started', 'Click', $target.data('ga'));
      window.setTimeout(function(){location.assign($target.attr('href'));20});
    }

  });

  return SlideView;

});
<commit_msg>Home: slider autoplay speed<commit_after>/**
 * The Slide view.
 */
define([
  'jquery',
  'backbone',
  'underscore',
  'mps',
  'enquire',
  'handlebars',
], function($,Backbone, _,mps, enquire, Handlebars) {

  'use strict';

  // SLIDER
  var SlideView = Backbone.View.extend({

    el: '#main-slider',

    events: {
      'click #get-started' : 'getStarted',
      'click #go-to-apps' : 'goToApps',
      'click .gotomap' : 'gotoMap',
      'click .ribbon' : 'startSurvey'
    },

    initialize: function() {
      //Init
      this.$getStarted = $('#get-started');

      //Inits
      this.slickSlider();
    },

    slickSlider: function() {
      //INIT
      $('.main-slider-viewport').slick({
        infinite: true,
        speed: 500,
        autoplay: true,
        autoplaySpeed: 6500,
        slide: 'li',
        fade: true,
        cssEase: 'linear',
        dots: true,
        pauseOnHover: false,
        arrows: false,

        responsive: [
          {
            breakpoint: 850,
            speed: 250,
            settings: {
              fade: false,
              cssEase: 'ease-out'
            }
          }
        ]
      });

    },

    getStarted: function(e){
      e.stopPropagation();
      $(e.currentTarget).toggleClass('active');
    },

    startSurvey: function() {
      ga('send', 'event', 'Home', 'Click', 'Survey link in slider');
      var win = window.open('https://www.surveymonkey.com/s/GFWeval', '_blank');
      win.focus();
    },

    /**
     * Closes submenu tooltip
     * Check the click target is not the dialog itself.
     *
     * @param  {Object} e Event
     */
    _onHtmlClick: function(e) {
      if (!$(e.target).hasClass('submenu-tooltip') && this.$getStarted.hasClass('active')) {
        this.$getStarted.removeClass('active');
      }
    },


    goToApps: function(e){
      e.preventDefault();
      var posY = $($(e.currentTarget).attr('href')).offset().top;
      $('html,body').animate({scrollTop: posY},500);
    },

    gotoMap: function(e) {
      e.preventDefault();
      e.stopPropagation();

      var $target = $(e.target);

      if (!$(e.target).hasClass('gotomap')) {
        $target = $(e.target).parent();
      }

      if ($target.data('dialog')) {
        var dialog = JSON.stringify(
        {
          "display": true,
          "type" : $target.data('dialog')
        });

        sessionStorage.setItem('DIALOG', dialog);
      }
      ga('send', 'event', 'Get Started', 'Click', $target.data('ga'));
      window.setTimeout(function(){location.assign($target.attr('href'));20});
    }

  });

  return SlideView;

});

{'fraction_non_alphanumeric': 0.1775611620795107, 'fraction_numerical': 0.006880733944954129, 'mean_word_length': 2.0178777393310265, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, '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': '2267632', 'n_tokens_mistral': 1768, 'n_tokens_neox': 1691, 'n_words': 317}