|
|
@@ -938,6 +938,28 @@
|
|
|
};
|
|
|
}(window.jQuery));
|
|
|
;(function($) {
|
|
|
+ $.fn.bootstrapValidator.validators.ip = {
|
|
|
+ /**
|
|
|
+ * Return true if the input value is a IP address.
|
|
|
+ * Currently, it only supports IP v4
|
|
|
+ *
|
|
|
+ * @param {BootstrapValidator} validator The validator plugin instance
|
|
|
+ * @param {jQuery} $field Field element
|
|
|
+ * @param {Object} options Can consist of the following keys:
|
|
|
+ * - message: The invalid message
|
|
|
+ * @returns {Boolean}
|
|
|
+ */
|
|
|
+ validate: function(validator, $field, options) {
|
|
|
+ var value = $field.val();
|
|
|
+ if (value == '') {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ return /^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test(value);
|
|
|
+ }
|
|
|
+ };
|
|
|
+}(window.jQuery));
|
|
|
+;(function($) {
|
|
|
$.fn.bootstrapValidator.validators.lessThan = {
|
|
|
/**
|
|
|
* Return true if the input value is less than or equal to given number
|