Skip to content
This repository has been archived by the owner on Mar 12, 2020. It is now read-only.

"data-remote" attribute query parameter support #250

Open
wants to merge 32 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
b868bb3
Tiny doc change
1000hz Mar 26, 2014
c312efd
Merge branch 'master' into gh-pages
Mar 31, 2014
dcaf60c
Merge branch 'gh-pages' of github.com:1000hz/bootstrap-validator into…
Jun 19, 2014
b669e73
copying the docs into gh-pages manually until github supports the `so…
Jun 19, 2014
80e8a1b
Fixing relative urls
Jun 19, 2014
3250207
Docs: 0.6.0
Oct 16, 2014
77d94f8
Docs: 0.7.0
Jan 29, 2015
6641749
Docs: 0.7.1
Feb 5, 2015
f0b4830
Docs: 0.7.2
Feb 5, 2015
d3842f8
Docs: 0.7.3
Mar 10, 2015
e1b9345
Docs: 0.8.0
1000hz Mar 20, 2015
2d6c109
Docs: 0.8.0
1000hz Mar 20, 2015
2f6f227
Docs: 0.8.1
1000hz Apr 2, 2015
df0d3f2
Docs: 0.8.1
1000hz Apr 2, 2015
353b048
Docs: 0.9.0
1000hz Jul 20, 2015
2e6b3db
Docs: 0.10.0
1000hz Mar 3, 2016
233dd74
Docs: 0.10.1
1000hz Mar 3, 2016
2a2f0a9
Adjusting FOCUS_OFFSET to account for navbar height
1000hz Mar 3, 2016
0223b89
Docs: 0.10.2
1000hz Apr 11, 2016
f7dc70d
Docs: 0.11.0
1000hz Jul 15, 2016
3d84dd8
Updating /docs/dist to the true v0.11.0 build
1000hz Jul 16, 2016
534bd94
Docs: 0.11.1
1000hz Jul 16, 2016
4d2553b
Docs: 0.11.2
1000hz Jul 16, 2016
ff972e6
Docs: 0.11.3
1000hz Jul 16, 2016
0898ae1
Docs: 0.11.5
1000hz Jul 16, 2016
9bf388f
tryna get that paper
1000hz Jul 19, 2016
aad1a48
Improving clarity of custom validator docs
1000hz Jul 30, 2016
2c6dea7
New version of pygments uses figures instead of divs when highlightin…
1000hz Jul 30, 2016
be52b48
Docs: 0.11.6
1000hz Dec 5, 2016
2f88639
Docs: 0.11.7
1000hz Dec 5, 2016
53abd18
Docs: v0.11.8
1000hz Dec 8, 2016
6ddb98c
Docs: 0.11.9
1000hz Jan 6, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Docs: 0.9.0
  • Loading branch information
1000hz committed Jul 20, 2015
commit 353b04808bf1fa5dfda8595ccf36c4365095a0f7
35 changes: 21 additions & 14 deletions dist/validator.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Validator v0.8.1 for Bootstrap 3, by @1000hz
* Validator v0.9.0 for Bootstrap 3, by @1000hz
* Copyright 2015 Cina Saffary
* Licensed under http://opensource.org/licenses/MIT
*
Expand All @@ -9,7 +9,6 @@
+function ($) {
'use strict';

var inputSelector = ':input:not([type="submit"], button):enabled:visible'
// VALIDATOR CLASS DEFINITION
// ==========================

Expand Down Expand Up @@ -41,6 +40,8 @@
})
}

Validator.INPUT_SELECTOR = ':input:not([type="submit"], button):enabled:visible'

Validator.DEFAULTS = {
delay: 500,
html: false,
Expand All @@ -49,19 +50,23 @@
errors: {
match: 'Does not match',
minlength: 'Not long enough'
},
feedback: {
success: 'glyphicon-ok',
error: 'glyphicon-remove'
}
}

Validator.VALIDATORS = {
native: function ($el) {
'native': function ($el) {
var el = $el[0]
return el.checkValidity ? el.checkValidity() : true
},
match: function ($el) {
'match': function ($el) {
var target = $el.data('match')
return !$el.val() || $el.val() === $(target).val()
},
minlength: function ($el) {
'minlength': function ($el) {
var minlength = $el.data('minlength')
return !$el.val() || $el.val().length >= minlength
}
Expand Down Expand Up @@ -139,7 +144,7 @@
var delay = this.options.delay

this.options.delay = 0
this.$element.find(inputSelector).trigger('input.bs.validator')
this.$element.find(Validator.INPUT_SELECTOR).trigger('input.bs.validator')
this.options.delay = delay

return this
Expand All @@ -165,8 +170,8 @@
$group.addClass('has-error')

$feedback.length
&& $feedback.removeClass('glyphicon-ok')
&& $feedback.addClass('glyphicon-warning-sign')
&& $feedback.removeClass(this.options.feedback.success)
&& $feedback.addClass(this.options.feedback.error)
&& $group.removeClass('has-success')
})
}
Expand All @@ -180,8 +185,8 @@
$group.removeClass('has-error')

$feedback.length
&& $feedback.removeClass('glyphicon-warning-sign')
&& $feedback.addClass('glyphicon-ok')
&& $feedback.removeClass(this.options.feedback.error)
&& $feedback.addClass(this.options.feedback.success)
&& $group.addClass('has-success')
}

Expand All @@ -190,7 +195,7 @@
return !!($(this).data('bs.validator.errors') || []).length
}

return !!this.$element.find(inputSelector).filter(fieldErrors).length
return !!this.$element.find(Validator.INPUT_SELECTOR).filter(fieldErrors).length
}

Validator.prototype.isIncomplete = function () {
Expand All @@ -200,7 +205,7 @@
$.trim(this.value) === ''
}

return !!this.$element.find(inputSelector).filter('[required]').filter(fieldIncomplete).length
return !!this.$element.find(Validator.INPUT_SELECTOR).filter('[required]').filter(fieldIncomplete).length
}

Validator.prototype.onSubmit = function (e) {
Expand All @@ -210,14 +215,16 @@

Validator.prototype.toggleSubmit = function () {
if(!this.options.disable) return

var $btn = $('button[type="submit"], input[type="submit"]')
.filter('[form="' + this.$element.attr('id') + '"]')
.add(this.$element.find('input[type="submit"], button[type="submit"]'))

$btn.toggleClass('disabled', this.isIncomplete() || this.hasErrors())
.css({'pointer-events': 'all', 'cursor': 'pointer'})
}

Validator.prototype.defer = function ($el, callback) {
callback = $.proxy(callback, this)
if (!this.options.delay) return callback()
window.clearTimeout($el.data('bs.validator.timeout'))
$el.data('bs.validator.timeout', window.setTimeout(callback, this.options.delay))
Expand All @@ -229,7 +236,7 @@
.removeData('bs.validator')
.off('.bs.validator')

this.$element.find(inputSelector)
this.$element.find(Validator.INPUT_SELECTOR)
.off('.bs.validator')
.removeData(['bs.validator.errors', 'bs.validator.deferred'])
.each(function () {
Expand Down
4 changes: 2 additions & 2 deletions dist/validator.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading