commit mix - code incomplet
This commit is contained in:
Vendored
+6
File diff suppressed because one or more lines are too long
+89
-73
@@ -1,89 +1,105 @@
|
||||
|
||||
(function ($) {
|
||||
"use strict";
|
||||
("use strict");
|
||||
|
||||
|
||||
/*==================================================================
|
||||
/*==================================================================
|
||||
[ Focus input ]*/
|
||||
$('.input100').each(function(){
|
||||
$(this).on('blur', function(){
|
||||
if($(this).val().trim() != "") {
|
||||
$(this).addClass('has-val');
|
||||
}
|
||||
else {
|
||||
$(this).removeClass('has-val');
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
/*==================================================================
|
||||
$(".input100").each(function () {
|
||||
$(this).on("blur", function () {
|
||||
if ($(this).val().trim() != "") {
|
||||
$(this).addClass("has-val");
|
||||
} else {
|
||||
$(this).removeClass("has-val");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
/*==================================================================
|
||||
[ Validate ]*/
|
||||
var input = $('.validate-input .input100');
|
||||
var input = $(".validate-input .input100");
|
||||
|
||||
$('.validate-form').on('submit',function(){
|
||||
var check = true;
|
||||
$(".validate-form").on("submit", function () {
|
||||
var check = true;
|
||||
|
||||
for(var i=0; i<input.length; i++) {
|
||||
if(validate(input[i]) == false){
|
||||
showValidate(input[i]);
|
||||
check=false;
|
||||
}
|
||||
}
|
||||
for (var i = 0; i < input.length; i++) {
|
||||
if (validate(input[i]) == false) {
|
||||
showValidate(input[i]);
|
||||
check = false;
|
||||
}
|
||||
}
|
||||
|
||||
return check;
|
||||
return check;
|
||||
});
|
||||
|
||||
$(".validate-form .input100").each(function () {
|
||||
$(this).focus(function () {
|
||||
hideValidate(this);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
$('.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 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();
|
||||
function showValidate(input) {
|
||||
var thisAlert = $(input).parent();
|
||||
|
||||
$(thisAlert).addClass('alert-validate');
|
||||
}
|
||||
$(thisAlert).addClass("alert-validate");
|
||||
}
|
||||
|
||||
function hideValidate(input) {
|
||||
var thisAlert = $(input).parent();
|
||||
function hideValidate(input) {
|
||||
var thisAlert = $(input).parent();
|
||||
|
||||
$(thisAlert).removeClass('alert-validate');
|
||||
}
|
||||
|
||||
/*==================================================================
|
||||
$(thisAlert).removeClass("alert-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('zmdi-eye');
|
||||
$(this).find('i').addClass('zmdi-eye-off');
|
||||
showPass = 1;
|
||||
}
|
||||
else {
|
||||
$(this).next('input').attr('type','password');
|
||||
$(this).find('i').addClass('zmdi-eye');
|
||||
$(this).find('i').removeClass('zmdi-eye-off');
|
||||
showPass = 0;
|
||||
}
|
||||
|
||||
});
|
||||
var showPass = 0;
|
||||
$(".btn-show-pass").on("click", function () {
|
||||
if (showPass == 0) {
|
||||
$(this).next("input").attr("type", "text");
|
||||
$(this).find("i").removeClass("zmdi-eye");
|
||||
$(this).find("i").addClass("zmdi-eye-off");
|
||||
showPass = 1;
|
||||
} else {
|
||||
$(this).next("input").attr("type", "password");
|
||||
$(this).find("i").addClass("zmdi-eye");
|
||||
$(this).find("i").removeClass("zmdi-eye-off");
|
||||
showPass = 0;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
})(jQuery);
|
||||
/*==================================================================
|
||||
[ Open Window on link with id="openWindow" ]*/
|
||||
document.addEventListener("click", FromIdNavigateTo, false);
|
||||
function FromIdNavigateTo(event) {
|
||||
if (event.target.matches("#openWindow")) {
|
||||
// console("Open link on open Window");
|
||||
window.open(
|
||||
event.target.href,
|
||||
"_blank",
|
||||
"menubar=no,toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizable=yes,dependent,width=800,height=620,left=0,top=0"
|
||||
);
|
||||
} else {
|
||||
// console("Open link on new tab");
|
||||
open(event.target.href, "_blank");
|
||||
}
|
||||
event.preventDefault();
|
||||
return false;
|
||||
}
|
||||
})(jQuery);
|
||||
|
||||
Reference in New Issue
Block a user