{"size": 1666, "ext": "js", "max_stars_repo_path": "web/Ressources/assets/js/passwordstrengh.js", "max_stars_repo_name": "jwphantom/safecolis", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "web/Ressources/assets/js/passwordstrengh.js", "max_issues_repo_name": "jwphantom/safecolis", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "web/Ressources/assets/js/passwordstrengh.js", "max_forks_repo_name": "jwphantom/safecolis", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 34.7083333333, "max_line_length": 127, "alphanum_fraction": 0.4051620648}
$(document).ready(function () {
    //disable the submit button
    $("#submit_button").attr("disabled", true);
    return true;    

    });

    var myApp = angular.module("myapp", []);
    myApp.controller("PasswordController", function($scope) {

        var strongRegex = new RegExp("^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[!@#\$%\^&\*])(?=.{8,})");
        var mediumRegex = new RegExp("^(((?=.*[a-z])(?=.*[A-Z]))|((?=.*[a-z])(?=.*[0-9]))|((?=.*[A-Z])(?=.*[0-9])))(?=.{6,})");

        $scope.passwordStrength = {
            
        };

        $scope.analyze = function(value) {
            if(strongRegex.test(value)) 
            {
                $scope.passwordStrength["border-color"] = "green";
                $(document).ready(function () {
                    //disable the submit button
                    $("#submit_button").attr("disabled", false);
                    return true;    
            
                    });
                
            } else if(mediumRegex.test(value)) {
                $scope.passwordStrength["border-color"] = "orange";
                $(document).ready(function () {
                    //disable the submit button
                    $("#submit_button").attr("disabled", true);
                    return true;    
            
                    });
            } else {
                $scope.passwordStrength["border-color"] = "red";
                $(document).ready(function () {
                    //disable the submit button
                    $("#submit_button").attr("disabled", true);
                    return true;    
            
                    });
            }
        };

    });