mirror of
https://github.com/Mibew/mibew.git
synced 2025-01-31 05:20:30 +03:00
Use third-party library to validate email at client side
This commit is contained in:
parent
833d2a9096
commit
4332d9c205
23
src/mibew/js/libs/validator.min.js
vendored
Normal file
23
src/mibew/js/libs/validator.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
@ -16,7 +16,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
(function(Mibew, $, _, vex){
|
||||
(function(Mibew, $, _, vex, validator){
|
||||
|
||||
/**
|
||||
* @namespace Holds utility functions
|
||||
@ -69,7 +69,7 @@
|
||||
* @returns {Boolean} true if address is valid and false otherwise
|
||||
*/
|
||||
Mibew.Utils.checkEmail = function(email) {
|
||||
return /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(email);
|
||||
return validator.isEmail(email);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -174,4 +174,4 @@
|
||||
});
|
||||
}
|
||||
|
||||
})(Mibew, jQuery, _, vex);
|
||||
})(Mibew, jQuery, _, vex, validator);
|
@ -265,6 +265,7 @@ abstract class AbstractController implements
|
||||
'js/libs/backbone.marionette.min.js',
|
||||
'js/libs/handlebars.min.js',
|
||||
'js/libs/vex.combined.min.js',
|
||||
'js/libs/validator.min.js',
|
||||
// Client side templates
|
||||
$this->getStyle()->getFilesPath() . '/templates_compiled/client_side/templates.js',
|
||||
// Default client side application files
|
||||
|
Loading…
Reference in New Issue
Block a user