<commit_before>define([
	'jquery',
	'components/slider/DeckSlider', 
	'components/InlineEditor', 
	'components/FlipMode',
	'models/API', 
	'models/Analytics', 
	'models/Deck', 
	'views/CardForm', 
	'utils/utils',
    'swiper'
], function(
	$, 
	DeckSlider, 
	InlineEditor, 
	FlipMode,
	API,
	Analytics,
	Deck, 
	CardForm, 
	utils,
    Swiper
) {

function initModule() {
	Analytics.run();

	var deck_slider = new DeckSlider($(".slider").first());
	var card_counter = {
		el: $("#counter"),
		slider: deck_slider,
		update: function() {
			var current = this.slider.getCurrentCardIndex();
			var total = this.slider.getNumItems();
			this.el.html(current + " / " + total);
		}
	};
	var $cardDetail = $("#singleCardHolder");

	card_counter.update = $.proxy(card_counter.update, card_counter);

	deck_slider.bind("beforeslide", function(slider, data){
		var $controls = $cardDetail.find(".controls[data-card-id]");
		var $card = $cardDetail.find(".card[data-card-id]");

		$controls.removeClass("card-active").hide();
		//$card.removeClass('card-active').hide();

		deck_slider._slideDirection = (data.toIndex >= data.fromIndex ? "right" : "left");
		deck_slider._slideCurrent = (data.toIndex == data.fromIndex);
	});

    deck_slider.bind("slide", function(slider, data) {
		var card_id = data.card_id;
		var $controls = $cardDetail.find(".controls[data-card-id="+card_id+"]");
		var $card = $cardDetail.find(".card[data-card-id="+card_id+"]");
		var playAudio = MODULE.makeAudioPlayer($card);
		var mode = $card.data("mode");

		var slideOpts = {
			direction: deck_slider._slideDirection,
			complete: playAudio
		};

        // send tracking
		Analytics.trackCard(card_id, mode);

		// show the card controls
		$controls.addClass('card-active');
		$controls.show();

		// show the card
		$card.addClass('card-active');


        if(deck_slider._slideCurrent) {
			$card.show();
			playAudio();
		}

    });

    /* Swiper */
    var mySwiper = new Swiper ('.swiper-container', {
        // Optional parameters
        direction: 'horizontal',
        nextButton: '.swiper-btn-next',
        prevButton: '.swiper-btn-prev',
        keyboardControl: true,
        loop: false,
        onSlideChangeStart: function(swiper){
            deck_slider.selectCard($(swiper.slides[swiper.activeIndex]).data('card-id'));
        	card_counter.update();

        }
    });
    $('.card-image').click(function(event){
        mySwiper.slideTo(deck_slider.getIndexOfCard($(event.currentTarget).data('card-id')));
    });
    $('#first_card').click(function(event){
        mySwiper.slideTo(0);
    });
    $('#last_card').click(function(event){
        mySwiper.slideTo(mySwiper.slides.length - 1);
    });
    var shuffleSwiper = function(card_ids){
        var slides = mySwiper.slides;
        mySwiper.removeAllSlides();
        for(var i = 0; i < card_ids.length; i++){
            for(var j = 0; j < slides.length; j++){
                card_id = $(slides[j]).data('card-id');
                if(card_ids[i] == card_id){
                    mySwiper.appendSlide(slides[j]);
                    break;
                }
            }
        }
    };
    deck_slider.onSlide(function(){
        console.log("onSlide");

    });
    /* End Swiper */

	deck_slider.bind("load", function(slider, card_ids) {
		MODULE.loadCardMedia(card_ids);
	});

	deck_slider.bind("slide", card_counter.update);
	deck_slider.goToCurrent();
	card_counter.update();

	$('#review_mode').click(function(){
	    location.href=this.href+'?card_id='+deck_slider.getCurrentCardId();
	    return false;
	});
	$('#quiz_mode').click(function(){
	    location.href=this.href+'&card_id='+deck_slider.getCurrentCardId();
	    return false;
	});

	$('#addCard').click(function(){
	    $('#cardFormContainer').toggle();
	    $('#singleCardHolder').toggle();<commit_msg>removing unused code<commit_after>define([
	'jquery',
	'components/slider/DeckSlider', 
	'components/InlineEditor', 
	'components/FlipMode',
	'models/API', 
	'models/Analytics', 
	'models/Deck', 
	'views/CardForm', 
	'utils/utils',
    'swiper'
], function(
	$, 
	DeckSlider, 
	InlineEditor, 
	FlipMode,
	API,
	Analytics,
	Deck, 
	CardForm, 
	utils,
    Swiper
) {

function initModule() {
	Analytics.run();

	var deck_slider = new DeckSlider($(".slider").first());
	var card_counter = {
		el: $("#counter"),
		slider: deck_slider,
		update: function() {
			var current = this.slider.getCurrentCardIndex();
			var total = this.slider.getNumItems();
			this.el.html(current + " / " + total);
		}
	};
	var $cardDetail = $("#singleCardHolder");

	card_counter.update = $.proxy(card_counter.update, card_counter);

	deck_slider.bind("beforeslide", function(slider, data){
		var $controls = $cardDetail.find(".controls[data-card-id]");
		var $card = $cardDetail.find(".card[data-card-id]");

		$controls.removeClass("card-active").hide();
		//$card.removeClass('card-active').hide();

		deck_slider._slideDirection = (data.toIndex >= data.fromIndex ? "right" : "left");
		deck_slider._slideCurrent = (data.toIndex == data.fromIndex);
	});

    deck_slider.bind("slide", function(slider, data) {
		var card_id = data.card_id;
		var $controls = $cardDetail.find(".controls[data-card-id="+card_id+"]");
		var $card = $cardDetail.find(".card[data-card-id="+card_id+"]");
		var playAudio = MODULE.makeAudioPlayer($card);
		var mode = $card.data("mode");

		var slideOpts = {
			direction: deck_slider._slideDirection,
			complete: playAudio
		};

        // send tracking
		Analytics.trackCard(card_id, mode);

		// show the card controls
		$controls.addClass('card-active');
		$controls.show();

		// show the card
		$card.addClass('card-active');


        if(deck_slider._slideCurrent) {
			$card.show();
			playAudio();
		}

    });

    /* Swiper */
    var mySwiper = new Swiper ('.swiper-container', {
        // Optional parameters
        direction: 'horizontal',
        nextButton: '.swiper-btn-next',
        prevButton: '.swiper-btn-prev',
        keyboardControl: true,
        loop: false,
        onSlideChangeStart: function(swiper){
            deck_slider.selectCard($(swiper.slides[swiper.activeIndex]).data('card-id'));
        	card_counter.update();

        }
    });
    $('.card-image').click(function(event){
        mySwiper.slideTo(deck_slider.getIndexOfCard($(event.currentTarget).data('card-id')));
    });
    $('#first_card').click(function(event){
        mySwiper.slideTo(0);
    });
    $('#last_card').click(function(event){
        mySwiper.slideTo(mySwiper.slides.length - 1);
    });
    var shuffleSwiper = function(card_ids){
        var slides = mySwiper.slides;
        mySwiper.removeAllSlides();
        for(var i = 0; i < card_ids.length; i++){
            for(var j = 0; j < slides.length; j++){
                card_id = $(slides[j]).data('card-id');
                if(card_ids[i] == card_id){
                    mySwiper.appendSlide(slides[j]);
                    break;
                }
            }
        }
    };
    /* End Swiper */

	deck_slider.bind("load", function(slider, card_ids) {
		MODULE.loadCardMedia(card_ids);
	});

	deck_slider.bind("slide", card_counter.update);
	deck_slider.goToCurrent();
	card_counter.update();

	$('#review_mode').click(function(){
	    location.href=this.href+'?card_id='+deck_slider.getCurrentCardId();
	    return false;
	});
	$('#quiz_mode').click(function(){
	    location.href=this.href+'&card_id='+deck_slider.getCurrentCardId();
	    return false;
	});

	$('#addCard').click(function(){
	    $('#cardFormContainer').toggle();
	    $('#singleCardHolder').toggle();
{'fraction_non_alphanumeric': 0.17769575533878196, 'fraction_numerical': 0.0010545742156604272, 'mean_word_length': 3.2079866888519133, 'pattern_counts': {'":': 0, '<': 7, '<?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': '3214851', 'n_tokens_mistral': 2648, 'n_tokens_neox': 2512, 'n_words': 373}