<commit_before>define(["jquery",
        "config",
        "views/signupform",
        "views/signinform",
        "views/forgotpasswordform",
        "views/resetpasswordform",
        "views/errorreport",
        "views/selectdomain",
        "views/ideloader",
        "views/contactform"
        ],

    function($,
        Config,
        SignupForm,
        SigninForm,
        ForgotPasswordForm,
        ResetPasswordForm,
        ErrorReport,
        SelectDomain,
        IDELoader,
        ContactForm){

        function modernize(){
            Modernizr.load({
                // HTML5 placeholder for input elements
                test : Modernizr.input.placeholder,
                nope : Config.placeholderPolyfillUrl,
                complete : function(){
                    if(typeof $.fn.placeholder !== 'undefined'){
                        $('input, textarea').placeholder();
                    }
                }
            });
        }

        return {
            run : function(){
                $(document).ready(function(){

                    modernize();

                    var signupForm = $(".signup-form"),
                        signinForm = $(".login-form"),
                        forgotPasswordForm = $(".forgotpassword-form"),
                        resetPasswordForm = $(".resetpassword-form"),
                        errorContainer = $(".error-container"),
                        domainSelector = $(".select-domain"),
                        loader = $(".loader"),
                        contactForm = $(".contact-form");

                    if(signupForm.length !== 0){
                        (function(){
                            var form = SignupForm.get(signupForm),
                            errorReport = ErrorReport.get(errorContainer);

                            form.on("submitting", function(){
                                errorReport.hide();
                            });

                            form.on("success", function(d){
                                window.location.href = d.url;
                            });

                            form.on("invalid", function(field,message){
                                errorReport.show(message);
                            });
                        }());
                    }

                    if(signinForm.length !== 0){
                        (function(){
                            var form = SigninForm.get(signinForm),
                            errorReport = ErrorReport.get(errorContainer);

                            form.on("submitting", function(){
                                errorReport.hide();
                            });

                            // form.on("success", function(){
                            //     alert("logged in");
                            // });

                            form.on("invalid", function(field,message){
                                errorReport.show(message);
                            });
                        }());
                    }

                    if(forgotPasswordForm.length !== 0){
                        (function(){
                            var form = ForgotPasswordForm.get(forgotPasswordForm),
                            errorReport = ErrorReport.get(errorContainer);

                            form.on("submitting", function(){
                                errorReport.hide();
                            });

                            form.on("invalid", function(field,message){
                                errorReport.show(message);
                            });


                        }());
                    }

                    if(resetPasswordForm.length !== 0){
                        (function(){

                            var form = ResetPasswordForm.get(resetPasswordForm),
                                errorReport = ErrorReport.get(errorContainer);

                            form.on("submitting", function(){
                                errorReport.hide();
                            });

                            form.on("success", function(d){
                                window.location.href = d.url;
                            });

                            form.on("invalid", function(field,message){
                                errorReport.show(message);
                            });

                            form.resolveUserEmail();

                        }());
                    }

                    if(domainSelector.length !== 0){
                        new SelectDomain.get(domainSelector);
                    }

                    if(loader.length !== 0){
                        var ideloader = new IDELoader.IDELoader(),
                            errorReport = ErrorReport.get(errorContainer);

                        ideloader.on("ready",function(d){
                            window.location.href = d.url;
                        });

                        ideloader.on("error",function(message){
                            errorReport.show(message);
                        });
                    }

                    if(contactForm.length !== 0){
                        (function(){
                            var form = ContactForm.get(contactForm),
                                errorReport = ErrorReport.get(errorContainer);

                            form.on("submitting", function(){
                                errorReport.hide();
                            });

                            form.on("invalid", function(field,message){
                                errorReport.show(message);
                            });

                        }());
                    }

                });
            }
        };

    }
);<commit_msg>integrate all new views into the app<commit_after>define(["jquery",
        "config",
        "views/signupform",
        "views/signinform",
        "views/forgotpasswordform",
        "views/resetpasswordform",
        "views/errorreport",
        "views/selectdomain",
        "views/ideloader",
        "views/contactform",
        "views/setprofilepasswordform",
        "views/setprofileuserform",
        "views/inviteorganization",
        "views/errorresponse"
        ],

    function($,
        Config,
        SignupForm,
        SigninForm,
        ForgotPasswordForm,
        ResetPasswordForm,
        ErrorReport,
        SelectDomain,
        IDELoader,
        ContactForm,
        SetProfilePassword,
        SetProfileUser,
        InviteOrganization,
        ErrorResponse){

        function modernize(){
            Modernizr.load({
                // HTML5 placeholder for input elements
                test : Modernizr.input.placeholder,
                nope : Config.placeholderPolyfillUrl,
                complete : function(){
                    if(typeof $.fn.placeholder !== 'undefined'){
                        $('input, textarea').placeholder();
                    }
                }
            });
        }

        return {
            run : function(){
                $(document).ready(function(){

                    modernize();

                    var signupForm = $(".signup-form"),
                        signinForm = $(".login-form"),
                        forgotPasswordForm = $(".forgotpassword-form"),
                        resetPasswordForm = $(".resetpassword-form"),
                        errorContainer = $(".error-container"),
                        domainSelector = $(".select-domain"),
                        loader = $(".loader"),
                        contactForm = $(".contact-form"),
                        setProfilePassword = $(".change-password-form"),
                        setProfileUserForm = $(".cloud-ide-profile"),
                        inviteOrganization = $(".organization"),
                        errorResponse = $(".ErrorIcon");

                    if(signupForm.length !== 0){
                        (function(){
                            var form = SignupForm.get(signupForm),
                            errorReport = ErrorReport.get(errorContainer);

                            form.on("submitting", function(){
                                errorReport.hide();
                            });

                            form.on("success", function(d){
                                window.location.href = d.url;
                            });

                            form.on("invalid", function(field,message){
                                errorReport.show(message);
                            });
                        }());
                    }

                    if(signinForm.length !== 0){
                        (function(){
                            var form = SigninForm.get(signinForm),
                            errorReport = ErrorReport.get(errorContainer);

                            form.on("submitting", function(){
                                errorReport.hide();
                            });

                            // form.on("success", function(){
                            //     alert("logged in");
                            // });

                            form.on("invalid", function(field,message){
                                errorReport.show(message);
                            });
                        }());
                    }

                    if(forgotPasswordForm.length !== 0){
                        (function(){
                            var form = ForgotPasswordForm.get(forgotPasswordForm),
                            errorReport = ErrorReport.get(errorContainer);

                            form.on("submitting", function(){
                                errorReport.hide();
                            });

                            form.on("invalid", function(field,message){
                                errorReport.show(message);
                            });


                        }());
                    }

                    if(resetPasswordForm.length !== 0){
                        (function(){

                            var form = ResetPasswordForm.get(resetPasswordForm),
                                errorReport = ErrorReport.get(errorContainer);

                            form.on("submitting", function(){
                                errorReport.hide();
                            });

                            form.on("success", function(d){
                                window.location.href = d.url;
                            });

                            form.on("invalid", function(field,message){
                                errorReport.show(message);
                            });

                            form.resolveUserEmail();

                        }());
                    }

                    if(domainSelector.length !== 0){
                        new SelectDomain.get(domainSelector);
                    }

                    if(loader.length !== 0){
                        var ideloader = new IDELoader.IDELoader(),
                            errorReport = ErrorReport.get(errorContainer);

                        ideloader.on("ready",function(d){
                            window.location.href = d.url;
                        });

                        ideloader.on("error",function(message){
                            errorReport.show(message);
                        });
                    }

                    if(contactForm.length !== 0){
                        (function(){
                            var form = ContactForm.get(contactForm),
                                errorReport = ErrorReport.get(errorContainer);

                            form.on("submitting", function(){
                                errorReport.hide();
                            });

                            form.on("invalid", function(field,message){
                                errorReport.show(message);
                            });

                        }());
                    }

                    //setProfileUser
                    if(setProfileUserForm.length !== 0){
                        (function(){

                            var form = SetProfileUser.get(setProfileUserForm),
                                errorReport = ErrorReport.get(errorContainer),
                                successReport = SuccessReport.get(errorContainer);
                            form.getUserProfileInfo(function(field,message){
                                errorReport.show(message);
                                });
                            form.on("submitting", function(){
                                errorReport.hide();
                            });

                            form.on("success", function(){
                                successReport.show(form.settings.successUpdatingProfile);

                            });

                            form.on("invalid", function(field,message){
                                errorReport.show(message);

                            });

                        }());
                    }

                    if(setProfilePassword.length !== 0){
                        (function(){

                            var form = SetProfilePassword.get(setProfilePassword),
                                errorReport = ErrorReport.get(errorContainer),
                                successReport = SuccessReport.get(errorContainer);

                            form.on("submitting", function(){
                                errorReport.hide();
                            });

                            form.on("success", function(){
                                successReport.show(form.settings.successChangingPassword);
                                changePasswordForm = document.forms[0];
                                changePasswordForm.elements["change_password"].value = "";
                                changePasswordForm.elements["confirm_password"].value = "";
                            });

                            form.on("invalid", function(field,message){
                                errorReport.show(message);
                            });

                        }());
                    }

                    // success invite organization
                    if(inviteOrganization.length !== 0){
                        var element = InviteOrganization.get(inviteOrganization);
                        element.setOrganization();
                    }

                    // put error to page from response
                    if(errorResponse.length !== 0){
                        var element = ErrorResponse.get(errorResponse);
                        element.setError();
                    }

                });
            }
        };

    }
);
{'fraction_non_alphanumeric': 0.1011251004553978, 'fraction_numerical': 0.0014063755692472542, 'mean_word_length': 0.8515809051456913, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '5171956', 'n_tokens_mistral': 3136, 'n_tokens_neox': 2851, 'n_words': 410}