<commit_before>(function($) {

	/* List of options for the template */
   	var options = {
            namelecteur :   '#lecteur-audio',       //name of player (id ou class)
		    play      	: 	'#btn-play',        //name of button play (id ou class)
		    pause     	: 	'#btn-pause',       //name of button pause (id ou class)
		    stop 		: 	'#btn-stop',        //name of button stop (id ou class)
		    next   		: 	'#btn-next',          //name of button next (id ou class)
		    back     	: 	'#btn-back',         //name of button back (id ou class)
            pochette    :   '.pochette',     //name of list of pochette (id ou class)
            autoplay    :   false,              // autoplay true or false
	}

    /* template for the player */
    var html= '<div id="controller">\
                    <img id="photo-pochette" src="http://dummyimage.com/75x75/" />\
                    <span id="titre_album"></span>\
                    <span id="song"></span>\
                    <br />\
                    <br />\
                    <div class="progressbar">\
                    </div>\
                    <div id="controller-player">\
                        <div class="cursor-pointer" id="btn-back"></div>\
                        <div class="cursor-pointer" id="btn-play"></div>\
                        <div class="cursor-pointer" id="btn-pause"></div>\
                        <div class="cursor-pointer" id="btn-stop"></div>\
                        <div class="cursor-pointer" id="btn-next"></div>\
                    </div>\
                </div>';

	$.audio = function(el,options) {

	}

	$.audio.options = options;

    $.fn.audio = function(opts) {
    	var current = 0;
    	var maxcurrent = 0;
    	var audio = new Array();
    	var percent;
        this.each( function() {
        	var self = $(this);
            $(options.pochette).hide();
            init();
        });

        playerStop = function()
        {
            inittimeline();
        	$(options.play).show();
        	$(options.pause).hide();
        	document.getElementById(audio[current]).pause();
  			document.getElementById(audio[current]).currentTime=0;
        }
        playerPlay = function()
        {
            inittimeline();
            playerChangeWallet();
        	$(options.play).hide();
        	$(options.pause).show();
        	document.getElementById(audio[current]).play();
            document.getElementById(audio[current]).addEventListener("timeupdate", updateProgress, false);
        }
        updateProgress = function()
        {
            var player=document.getElementById(audio[current]);
            var duration = player.duration; 
            var time     = player.currentTime;
            var fraction = time / duration;
            percent  = Math.ceil(fraction * 100);
            if(percent==100)
            {
                $(options.play).show();
                $(options.pause).hide();
            }
            $( ".progressbar" ).slider({
                    orientation: "horizontal",
                    range: "min",
                    max: 100,
                    value: percent,
            });
        }
        function inittimeline()
        {
            $( ".progressbar" ).slider({
                    orientation: "horizontal",
                    range: "min",
                    max: 100,
                    value: 0,
            });
        }
        playerPause = function()
        {
        	$(options.play).show();
        	$(options.pause).hide();
        	document.getElementById(audio[current]).pause();
        }
        playerGoNext = function()
        {
            document.getElementById(audio[current]).pause();
        	document.getElementById(audio[current]).currentTime=0;
        	current++;
        	if(current>=maxcurrent)
        	{
        		current=0;
        	}
            if(options.autoplay==true)
            {
                $(options.play).hide();
                $(options.pause).show();
                playerPlay();
            }else{
                $(options.play).show();
                $(options.pause).hide();
                playerChangeWallet();
            }<commit_msg>Fonctionnalité slider click pour avancer lecture<commit_after>(function($) {

	/* List of options for the template */
   	var options = {
            namelecteur :   '#lecteur-audio',       //name of player (id ou class)
		    play      	: 	'#btn-play',        //name of button play (id ou class)
		    pause     	: 	'#btn-pause',       //name of button pause (id ou class)
		    stop 		: 	'#btn-stop',        //name of button stop (id ou class)
		    next   		: 	'#btn-next',          //name of button next (id ou class)
		    back     	: 	'#btn-back',         //name of button back (id ou class)
            pochette    :   '.pochette',     //name of list of pochette (id ou class)
            autoplay    :   false,              // autoplay true or false
	}

    /* template for the player */
    var html= '<div id="controller">\
                    <img id="photo-pochette" src="http://dummyimage.com/75x75/" />\
                    <span id="titre_album"></span>\
                    <span id="song"></span>\
                    <br />\
                    <br />\
                    <div class="progressbar">\
                    </div>\
                    <br />\
                    <br />\
                    <div id="controller-player">\
                        <div class="cursor-pointer" id="btn-back"></div>\
                        <div class="cursor-pointer" id="btn-play"></div>\
                        <div class="cursor-pointer" id="btn-pause"></div>\
                        <div class="cursor-pointer" id="btn-stop"></div>\
                        <div class="cursor-pointer" id="btn-next"></div>\
                    </div>\
                </div>';

	$.audio = function(el,options) {

	}

	$.audio.options = options;

    $.fn.audio = function(opts) {
    	var current = 0;
    	var maxcurrent = 0;
    	var audio = new Array();
    	var percent;
        this.each( function() {
        	var self = $(this);
            $(options.pochette).hide();
            init();
        });

        playerStop = function()
        {
            inittimeline();
        	$(options.play).show();
        	$(options.pause).hide();
        	document.getElementById(audio[current]).pause();
  			document.getElementById(audio[current]).currentTime=0;
        }
        playerPlay = function()
        {
            inittimeline();
            playerChangeWallet();
        	$(options.play).hide();
        	$(options.pause).show();
        	document.getElementById(audio[current]).play();
            document.getElementById(audio[current]).addEventListener("timeupdate", updateProgress, false);
        }
        updateProgress = function()
        {
            var player=document.getElementById(audio[current]);
            var duration = player.duration; 
            var time     = player.currentTime;
            var fraction = time / duration;
            percent  = Math.ceil(fraction * 100);
            if(percent==100)
            {
                $(options.play).show();
                $(options.pause).hide();
            }
            $( ".progressbar" ).slider({
                    orientation: "horizontal",
                    range: "min",
                    max: 100,
                    value: percent,
                    stop:function(e,ui) {
                        player.currentTime = ui.value;
                        updateProgress();
                    }
            });
        }
        function inittimeline()
        {
            $( ".progressbar" ).slider({
                    orientation: "horizontal",
                    range: "min",
                    max: 100,
                    value: 0
            });
        }
        playerPause = function()
        {
        	$(options.play).show();
        	$(options.pause).hide();
        	document.getElementById(audio[current]).pause();
        }
        playerGoNext = function()
        {
            document.getElementById(audio[current]).pause();
        	document.getElementById(audio[current]).currentTime=0;
        	current++;
        	if(current>=maxcurrent)
        	{
        		current=0;
        	}
            if(options.autoplay==true)
            {
                $(options.play).hide();
                $(options.pause).show();
                playerPlay();
            }else{
                $(options.play).show();
                $(options.pause).hide();
                playerChangeWallet();
            }
{'fraction_non_alphanumeric': 0.1397238017871649, 'fraction_numerical': 0.005106185447371475, 'mean_word_length': 1.2817050569234842, 'pattern_counts': {'":': 0, '<': 51, '<?xml version=': 0, '>': 53, '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': '6458777', 'n_tokens_mistral': 2335, 'n_tokens_neox': 2198, 'n_words': 453}