<commit_before>(function($){ 
	
	
	    
	$.fn.mdl=function(options, callback){     
        
        
        /*
        | ---------------------------
        | value returned for confirm and prompt
        | ---------------------------
        */
        var retour = false;
        
        
        
        /*
        | ---------------------------
        | Calcul number of items for ids & z-index
        | ---------------------------
        */
        if(	$(".mdl").length	){
        	var n = $(".mdl").length + 1;
        }else{
        	var n = 0;
        }
        
        
        
        
        /*
        | ---------------------------
        | default params
        | ---------------------------
        */
    	var defauts=
        {
		'type': "modal",		//dialog,confirm,prompt,modal
		'fullscreen': "true",		//Largeur de la galerie
		'overlayClick':"false",
		'content':''
         };  
         
         
         
         
 		/*
 		| ---------------------------
 		| //On fusionne nos deux objets ! =D
 		| ---------------------------
 		*/
        
        var parametres=$.extend(defauts, options);
		
		
		/*
		| ---------------------------
		| add overlay if is not
		| ---------------------------
		*/
		var overlay = $('<div id="mdl-overlay"></div>');
		if(!$("#mdl-overlay").length){
			$(overlay).appendTo('body');
		}
		
		
		/*
		| ---------------------------
		| global returned objects
		| ---------------------------
		*/
        return this.each(function(){
			
			//On stocke notre élément dans une variable par commodité
			var element=$(this);
			
			/*
			| ---------------------------
			| //default params
			| ---------------------------
			*/
			var fullscreen = parametres.fullscreen;
			var type = parametres.type;
			var overlayClick = parametres.overlayClick;
			
		/*
			| ---------------------------
			| or by data
			| ---------------------------
			*/
			if(
				element.attr('data-type')
			){
				type = element.data("type");
			}
			
			if(
				element.attr('data-fullscreen')
			){
				fullscreen = element.data("fullscreen");
				
			}
			
			if(
				element.attr('data-overlayClick')
			){
				overlayClick = element.data("overlayClick");
			}
			
			
			/*
			| ---------------------------
			| if modal use the modal exist else create one
			| ---------------------------
			*/
			if(type=="modal"){
			
				var cible = element.data("target");
			
			}else{
				
				/*
				| ---------------------------
				| gestion z-index
				| ---------------------------
				*/
				var zindex = 100000+n;
				
				/*
				| ---------------------------
				| addmodal
				| ---------------------------
				*/
				var mymodal = $('<div class="mdl" id="mdl__'+ n +'" style="z-index:'+ zindex +';"><div class="mdl-container"><div class="mdl-content"></div></div></div>');
				
				$(mymodal).appendTo('body');
				
				/*
				| ---------------------------
				| ok we have our id!
				| ---------------------------
				*/
				var cible = '#mdl__' + n;
			}
			
			
			/*
			| ---------------------------
			| confirm & prompt add buttons and result
			| ---------------------------
			*/
			if(type=="confirm" || type=="prompt"){
				
				/*
				| ---------------------------
				| add content
				| ---------------------------
				*/
				$(cible+" .mdl-content").html(parametres.content);
				
				if(type=="prompt"){
					$(cible+" .mdl-content").append("<input type='text' value='' id='response_mdl_"+ n +"' >");
				}
				
				/*
				| ---------------------------
				| add buttons
				| ---------------------------
				*/
				if(type=="confirm"){
					var btns = $('<ul class="mdl-buttons"><li><a href="#0" data-response="false">No</a></li><li><a href="#0" data-response="true">Yes</a></li></ul>');
					$(btns).appendTo(cible+" .mdl-container");
				}
				
				if(type=="prompt"){
				
					var btns = $('<ul class="mdl-buttons"><li><a href="#0" data-response="false" data-id="'+ n +'">Annuler</a></li><li><a href="#0" data-response="true" data-id="'+ n +'">Valider</a></li></ul>');
					$(btns).appendTo(cible+" .mdl-container");
				}
				
				
				/*
				| ---------------------------
				| medium format
				| ---------------------------
				*/
				$(cible+" .mdl-container").addClass("medium");
				
				/*
				| ---------------------------
				| on click event return response
				| ---------------------------
				*/
				$( "body" ).on( "click",cible + " .mdl-buttons a", function(event) {
					event.preventDefault();
					var response = false;
					
					/*
					| ---------------------------
					| return true or false for confirm
					| ---------------------------<commit_msg>Update mdl.js<commit_after>(function($){ 
	
	
	    
	$.fn.mdl=function(options, callback){     
        
        
        /*
        | ---------------------------
        | value returned for confirm and prompt
        | ---------------------------
        */
        var retour = false;
        
        
        
        /*
        | ---------------------------
        | Calcul number of items for ids & z-index
        | ---------------------------
        */
        if(	$(".mdl").length	){
        	var n = $(".mdl").length + 1;
        }else{
        	var n = 0;
        }
        
        
        
        
        /*
        | ---------------------------
        | default params
        | ---------------------------
        */
    	var defauts=
        {
		'type': "modal",		//dialog,confirm,prompt,modal
		'fullscreen': "true",		//Largeur de la galerie
		'overlayClick':"false",
		'content':''
         };  
         
         
         
         
 		/*
 		| ---------------------------
 		| //On fusionne nos deux objets ! =D
 		| ---------------------------
 		*/
        
        var parametres=$.extend(defauts, options);
		
		
		/*
		| ---------------------------
		| add overlay if is not
		| ---------------------------
		*/
		var overlay = $('<div id="mdl-overlay"></div>');
		if(!$("#mdl-overlay").length){
			$(overlay).appendTo('body');
		}
		
		
		/*
		| ---------------------------
		| global returned objects
		| ---------------------------
		*/
        return this.each(function(){
			
			//On stocke notre élément dans une variable par commodité
			var element=$(this);
			
			/*
			| ---------------------------
			| //default params
			| ---------------------------
			*/
			var fullscreen = parametres.fullscreen;
			var type = parametres.type;
			var overlayClick = parametres.overlayClick;
			
		/*
			| ---------------------------
			| or by data
			| ---------------------------
			*/
			if(
				element.attr('data-type')
			){
				type = element.data("type");
			}
			
			if(
				element.attr('data-fullscreen')
			){
				fullscreen = element.data("fullscreen");
				
			}
			
			if(
				element.attr('data-overlayClick')
			){
				overlayClick = element.data("overlayClick");
			}
			
			
			/*
			| ---------------------------
			| if modal use the modal exist else create one
			| ---------------------------
			*/
			if(type=="modal"){
			
				var cible = element.data("target");
			
			}else{
				
				/*
				| ---------------------------
				| gestion z-index
				| ---------------------------
				*/
				var zindex = 100000+n;
				
				/*
				| ---------------------------
				| addmodal
				| ---------------------------
				*/
				var mymodal = $('<div class="mdl" id="mdl__'+ n +'" style="z-index:'+ zindex +';"><div class="mdl-container"><div class="mdl-content"></div></div></div>');
				
				$(mymodal).appendTo('body');
				
				/*
				| ---------------------------
				| ok we have our id!
				| ---------------------------
				*/
				var cible = '#mdl__' + n;
			}
			
			
			/*
			| ---------------------------
			| confirm & prompt add buttons and result
			| ---------------------------
			*/
			if(type=="confirm" || type=="prompt"){
				
				/*
				| ---------------------------
				| add content
				| ---------------------------
				*/
				$(cible+" .mdl-content").html(parametres.content);
				
				if(type=="prompt"){
					$(cible+" .mdl-content").append("<input type='text' value='' id='response_mdl_"+ n +"' >");
				}
				
				/*
				| ---------------------------
				| add buttons
				| ---------------------------
				*/
				if(type=="confirm"){
					var btns = $('<ul class="mdl-buttons"><li><a href="#0" data-response="false">Non</a></li><li><a href="#0" data-response="true">Oui</a></li></ul>');
					$(btns).appendTo(cible+" .mdl-container");
				}
				
				if(type=="prompt"){
				
					var btns = $('<ul class="mdl-buttons"><li><a href="#0" data-response="false" data-id="'+ n +'">Annuler</a></li><li><a href="#0" data-response="true" data-id="'+ n +'">Valider</a></li></ul>');
					$(btns).appendTo(cible+" .mdl-container");
				}
				
				
				/*
				| ---------------------------
				| medium format
				| ---------------------------
				*/
				$(cible+" .mdl-container").addClass("medium");
				
				/*
				| ---------------------------
				| on click event return response
				| ---------------------------
				*/
				$( "body" ).on( "click",cible + " .mdl-buttons a", function(event) {
					event.preventDefault();
					var response = false;
					
					/*
					| ---------------------------
					| return true or false for confirm
					| ---------------------------
{'fraction_non_alphanumeric': 0.3550123829008291, 'fraction_numerical': 0.0025842575643372457, 'mean_word_length': 0.9289719626168225, 'pattern_counts': {'":': 0, '<': 61, '<?xml version=': 0, '>': 61, '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': '2702504', 'n_tokens_mistral': 3436, 'n_tokens_neox': 2547, 'n_words': 443}