mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-05 02:39:46 +02:00
add maintenance mode plugin
This commit is contained in:
parent
71f3ce6400
commit
b24415021e
50 changed files with 12512 additions and 0 deletions
57
plugin/MaintenanceMode/js/main.js
Normal file
57
plugin/MaintenanceMode/js/main.js
Normal file
|
@ -0,0 +1,57 @@
|
|||
|
||||
(function ($) {
|
||||
"use strict";
|
||||
|
||||
/*==================================================================
|
||||
[ Validate ]*/
|
||||
var input = $('.validate-input .input100');
|
||||
|
||||
$('.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;
|
||||
}
|
||||
}
|
||||
|
||||
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();
|
||||
|
||||
$(thisAlert).addClass('alert-validate');
|
||||
}
|
||||
|
||||
function hideValidate(input) {
|
||||
var thisAlert = $(input).parent();
|
||||
|
||||
$(thisAlert).removeClass('alert-validate');
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
})(jQuery);
|
Loading…
Add table
Add a link
Reference in a new issue