<commit_before>var app = angular.module("myApp",[]);

app.controller("register", function($scope, $http) {

    $scope.formData = {};
    
    var sec = 0;

    setInterval(function(){ sec++; return sec;}, 1000);


    $scope.create = function () {
        
            var userInfos = this.formData;
            var transform = function(data){
                return $.param(data);
            }
                
            if(sec > 5){
                $http.post(url + '/api/users/create', userInfos, {
                    headers: { 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'},
                    transformRequest: transform
                }).success(function(responseData) {
    
                    if(responseData.errors != ""){
                        $('.notif').html("");
                        for(var error in responseData.errors){
                            $('.notif').append(responseData.errors[error]+'<br/>').addClass('red');
                        }
                    }
                        
                    if(responseData.success == true){
                        document.location.href = responseData.redirect;
                    }
    
                });
            }else{
                $('.notif').html('Wait for minimum 5 secondes before sending de form').addClass('red');
            }
    };
});


app.controller("packCreate", function($scope, $http) {

    $http.get(url + '/api/events?limit=6').
        success(function(data, status, headers, config) {
            if(typeof data === 'object'){
                $scope.data = data;
                $('.spinner').hide();
                return;
            }else{
                return;
            }
        })
        .error(function(data, status, headers, config) {
          // log error
        });
        

        
    $scope.formData = {};
        
    $scope.create = function () {
        
        var packsInfo = this.formData;
        var transform = function(data){
            return $.param(data);
        }
        
        $http.post(url + '/packs/temporary', packsInfo, {
            headers: { 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'},
            transformRequest: transform
        }).success(function(responseData) {
            
            if(responseData.errors != ""){
                $('.notif').html("");
                for(var error in responseData.errors){
                    $('.notif').append(responseData.errors[error]+'<br/>').addClass('red');
                }
            }                     
        });
        
        packs/temporary

        if($('#item3 a').html() == "My account"){
    

            
            $('#popup-loading').fadeIn(300,function(){
                messages = ["creating pack", "uploading images","setting options","managing moneypot","redirecting to your pack"];
                time = 0;
                messages.forEach(function(entry) {
                    console.log(entry);
                    time += 1000;
                    setTimeout(function(){
                        $('p#loading-messages').fadeOut(100,function(){
                            $('p#loading-messages').html(entry+"...").fadeIn(100);
                        })
                    }, time) ;
                });   
            });
            setTimeout(function () {
               window.location.href = url + "/packs/show/" +packSlugs;
            }, 7000);
            
            token = $('#inputToken').attr('value');
            packsInfo['token'] = token;
                            
            $http.post(url + '/packs/store', packsInfo, {
                headers: { 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'},
                transformRequest: transform
            }).success(function(responseData) {
                console.log(responseData);
                eventId = responseData.events_id;
                packSlugs = responseData.packs_slug;
                console.log(packSlugs);
                
                
                uploader.settings.url = url + "/api/events/image/" + eventId;
                
                console.log(uploader);
                uploader.start();

                
                if(responseData.errors != ""){
                    $('.notif').html("");
                    for(var error in responseData.errors){
                        $('.notif').append(responseData.errors[error]+'<br/>').addClass('red');
                    }
                }                     
            });
        }else{
            $('#popup').show();
        }
    };
        
    $scope.fillform = function (e) {
        
        var id = $(e.target).data('id');
        
        $http.get(url + '/api/events/get/' + id).
            success(function(data, status, headers, config) {
                if (typeof data === 'object') {
                    console.log(id);
                    $scope.formData.events_id = data.event.events_id;
                    $scope.formData.events_address = data.event.events_address;
                    $scope.formData.events_name = data.event.events_name;
                    $scope.formData.events_description = data.event.events_description;
                    var datestart = (data.event.events_starttime).substring(0,16);
                    $scope.formData.events_starttime = datestart.replace(" ", "T");
                    var dateend = (data.event.events_endtime).substring(0,16);
                    $scope.formData.events_endtime = dateend.replace(" ", "T");          
                    $scope.formData.events_name = data.event.events_name;
                    $('#formu_event #first_part input:not([type="number"]), #formu_event #first_part textarea').prop('disabled', true);
                    $('#formu_event #first_part input:not([type="number"]), #formu_event #first_part textarea').css('background', '#dddddd');  

                    return;
                } else {
                    return;
                }
            })<commit_msg>delete images upload on fillform<commit_after>var app = angular.module("myApp",[]);

app.controller("register", function($scope, $http) {

    $scope.formData = {};
    
    var sec = 0;

    setInterval(function(){ sec++; return sec;}, 1000);


    $scope.create = function () {
        
            var userInfos = this.formData;
            var transform = function(data){
                return $.param(data);
            }
                
            if(sec > 5){
                $http.post(url + '/api/users/create', userInfos, {
                    headers: { 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'},
                    transformRequest: transform
                }).success(function(responseData) {
    
                    if(responseData.errors != ""){
                        $('.notif').html("");
                        for(var error in responseData.errors){
                            $('.notif').append(responseData.errors[error]+'<br/>').addClass('red');
                        }
                    }
                        
                    if(responseData.success == true){
                        document.location.href = responseData.redirect;
                    }
    
                });
            }else{
                $('.notif').html('Wait for minimum 5 secondes before sending de form').addClass('red');
            }
    };
});


app.controller("packCreate", function($scope, $http) {

    $http.get(url + '/api/events?limit=6').
        success(function(data, status, headers, config) {
            if(typeof data === 'object'){
                $scope.data = data;
                $('.spinner').hide();
                return;
            }else{
                return;
            }
        })
        .error(function(data, status, headers, config) {
          // log error
        });
        

        
    $scope.formData = {};
        
    $scope.create = function () {
        
        var packsInfo = this.formData;
        var transform = function(data){
            return $.param(data);
        }
        
        $http.post(url + '/packs/temporary', packsInfo, {
            headers: { 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'},
            transformRequest: transform
        }).success(function(responseData) {
            
            if(responseData.errors != ""){
                $('.notif').html("");
                for(var error in responseData.errors){
                    $('.notif').append(responseData.errors[error]+'<br/>').addClass('red');
                }
            }                     
        });
        
        if($('#item3 a').html() == "My account"){
            
            $('#popup-loading').fadeIn(300,function(){
                messages = ["creating pack", "uploading images","setting options","managing moneypot","redirecting to your pack"];
                time = 0;
                messages.forEach(function(entry) {
                    console.log(entry);
                    time += 1000;
                    setTimeout(function(){
                        $('p#loading-messages').fadeOut(100,function(){
                            $('p#loading-messages').html(entry+"...").fadeIn(100);
                        })
                    }, time) ;
                });   
            });
            setTimeout(function () {
               window.location.href = url + "/packs/show/" +packSlugs;
            }, 7000);
            
            token = $('#inputToken').attr('value');
            packsInfo['token'] = token;
                            
            $http.post(url + '/packs/store', packsInfo, {
                headers: { 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'},
                transformRequest: transform
            }).success(function(responseData) {
                console.log(responseData);
                eventId = responseData.events_id;
                packSlugs = responseData.packs_slug;
                console.log(packSlugs);
                
                
                uploader.settings.url = url + "/api/events/image/" + eventId;
                
                console.log(uploader);
                uploader.start();

                
                if(responseData.errors != ""){
                    $('.notif').html("");
                    for(var error in responseData.errors){
                        $('.notif').append(responseData.errors[error]+'<br/>').addClass('red');
                    }
                }                     
            });
        }else{
            $('#popup').show();
        }
    };
        
    $scope.fillform = function (e) {
        
        var id = $(e.target).data('id');
        
        $http.get(url + '/api/events/get/' + id).
            success(function(data, status, headers, config) {
                if (typeof data === 'object') {
                    console.log(id);
                    $scope.formData.events_id = data.event.events_id;
                    $scope.formData.events_address = data.event.events_address;
                    $scope.formData.events_name = data.event.events_name;
                    $scope.formData.events_description = data.event.events_description;
                    var datestart = (data.event.events_starttime).substring(0,16);
                    $scope.formData.events_starttime = datestart.replace(" ", "T");
                    var dateend = (data.event.events_endtime).substring(0,16);
                    $scope.formData.events_endtime = dateend.replace(" ", "T");          
                    $scope.formData.events_name = data.event.events_name;
                    $('#formu_event #first_part input:not([type="number"]), #formu_event #first_part textarea').prop('disabled', true);
                    $('#formu_event #first_part input:not([type="number"]), #formu_event #first_part textarea').css('background', '#dddddd');
                    $('#uploader').hide();  

                    return;
                } else {
                    return;
                }
            })
{'fraction_non_alphanumeric': 0.14179902888651139, 'fraction_numerical': 0.0059254382355361694, 'mean_word_length': 1.3032600454890069, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 6, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3823242', 'n_tokens_mistral': 3198, 'n_tokens_neox': 2991, 'n_words': 472}