|
@@ -1905,6 +1905,42 @@
|
|
|
};
|
|
};
|
|
|
}(window.jQuery));
|
|
}(window.jQuery));
|
|
|
;(function($) {
|
|
;(function($) {
|
|
|
|
|
+ $.fn.bootstrapValidator.validators.uuid = {
|
|
|
|
|
+ html5Attributes: {
|
|
|
|
|
+ message: 'message',
|
|
|
|
|
+ version: 'version'
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Return true if and only if the input value is a valid UUID string
|
|
|
|
|
+ *
|
|
|
|
|
+ * @see http://en.wikipedia.org/wiki/Universally_unique_identifier
|
|
|
|
|
+ * @param {BootstrapValidator} validator The validator plugin instance
|
|
|
|
|
+ * @param {jQuery} $field Field element
|
|
|
|
|
+ * @param {Object} options Consist of key:
|
|
|
|
|
+ * - message: The invalid message
|
|
|
|
|
+ * - version: Can be 3, 4, 5, null
|
|
|
|
|
+ * @returns {Boolean}
|
|
|
|
|
+ */
|
|
|
|
|
+ validate: function(validator, $field, options) {
|
|
|
|
|
+ var value = $field.val();
|
|
|
|
|
+ if (value == '') {
|
|
|
|
|
+ return true;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // See the format at http://en.wikipedia.org/wiki/Universally_unique_identifier#Variants_and_versions
|
|
|
|
|
+ var patterns = {
|
|
|
|
|
+ '3': /^[0-9A-F]{8}-[0-9A-F]{4}-3[0-9A-F]{3}-[0-9A-F]{4}-[0-9A-F]{12}$/i,
|
|
|
|
|
+ '4': /^[0-9A-F]{8}-[0-9A-F]{4}-4[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i,
|
|
|
|
|
+ '5': /^[0-9A-F]{8}-[0-9A-F]{4}-5[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i,
|
|
|
|
|
+ all: /^[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}$/i
|
|
|
|
|
+ },
|
|
|
|
|
+ version = options.version ? (options.version + '') : 'all';
|
|
|
|
|
+ return (null == patterns[version]) ? true : patterns[version].test(value);
|
|
|
|
|
+ }
|
|
|
|
|
+ };
|
|
|
|
|
+}(window.jQuery));
|
|
|
|
|
+;(function($) {
|
|
|
$.fn.bootstrapValidator.validators.zipCode = {
|
|
$.fn.bootstrapValidator.validators.zipCode = {
|
|
|
html5Attributes: {
|
|
html5Attributes: {
|
|
|
message: 'message',
|
|
message: 'message',
|