Sindbad~EG File Manager

Current Path : /var/www/html/wordpress_alg24news/wp-content/themes/newsbt-mobile/js/
Upload File :
Current File : /var/www/html/wordpress_alg24news/wp-content/themes/newsbt-mobile/js/login.js

(function ($) {
    "use strict";


    /*==================================================================
    [ Validate ]*/
    var input = $('.validate-input .input100');

    $('.login-submit, .register-submit, .forget-submit').on('click',function(){
        var check = true;

        for(var i=0; i<input.length; i++) {
            if(validate(input[i]) == false){
                showValidate(input[i]);
                check=false;
            }
        }

        return check;
    });


    $('.validate-form .input100').each(function(){
        $(this).focus(function(){
           hideValidate(this);
        });
    });

    function validate (input) {
        if($(input).attr('type') == 'email' || $(input).attr('name') == 'email') {
            if($(input).val().trim().match(/^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{1,5}|[0-9]{1,3})(\]?)$/) == null) {
                return false;
            }
        }
        else {
            if($(input).val().trim() == ''){
                return false;
            }
        }
    }

    function showValidate(input) {
        var thisAlert = $(input).parent();
		var thisAlert2 = $(input).parent().parent();

        $(thisAlert).addClass('alert-validate');
		$(thisAlert2).addClass('error-validate');
    }

    function hideValidate(input) {
        var thisAlert = $(input).parent();
		var thisAlert2 = $(input).parent().parent();

        $(thisAlert).removeClass('alert-validate');
		$(thisAlert2).removeClass('error-validate');
    }
    
    /*==================================================================
    [ Show pass ]*/
    var showPass = 0;
    $('.btn-show-pass').on('click', function(){
        if(showPass == 0) {
            $(this).next('input').attr('type','text');
            $(this).find('i').removeClass('fa-eye');
            $(this).find('i').addClass('fa-eye-slash');
            showPass = 1;
        }
        else {
            $(this).next('input').attr('type','password');
            $(this).find('i').removeClass('fa-eye-slash');
            $(this).find('i').addClass('fa-eye');
            showPass = 0;
        }
        
    });
    


})(jQuery);

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists