Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
## 6.0.3 (Latest Release)
## 6.0.4 (Latest Release)

- Updates `step` to allow setting value for date inputs

### 6.0.3

-Updates `min` and `max` validation for the `number` input type to allow min and max to be equal

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ Bootbox **3.3.0** is the *last* release to support Bootstrap 2.2.x.

Much more dependency information can be found [on the Bootbox website](http://bootboxjs.com/getting-started.html#bootbox-dependencies).

## 6.0.3 (Latest Release)
## 6.0.4 (Latest Release)

- Updates `min` and `max` validation for the `number` input type to allow min and max to be equal
- Updates `step` to allow setting value for date inputs

For a full list of releases and changes please see [the changelog](https://github.com/bootboxjs/bootbox/blob/master/CHANGELOG.md).

Expand Down
27 changes: 11 additions & 16 deletions bootbox.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*! @preserve
* bootbox.js
* version: 6.0.3
* version: 6.0.4
* author: Nick Payne <nick@kurai.co.uk>
* license: MIT
* http://bootboxjs.com/
Expand All @@ -22,7 +22,7 @@

let exports = {};

let VERSION = '6.0.3';
let VERSION = '6.0.4';
exports.VERSION = VERSION;

let locales = {
Expand Down Expand Up @@ -93,7 +93,7 @@
relatedTarget: null,
// The size of the modal to generate
size: null,
// A unique indentifier for this modal
// A unique identifier for this modal
id: null
};

Expand Down Expand Up @@ -214,7 +214,7 @@
exports.dialog = function (options) {
if ($.fn.modal === undefined) {
throw new Error(
'"$.fn.modal" is not defined; please double check you have included the Bootstrap JavaScript library. See https://getbootstrap.com/docs/5.1/getting-started/introduction/ for more details.'
'"$.fn.modal" is not defined; please double check you have included the Bootstrap JavaScript library. See https://getbootstrap.com/docs/5.3/getting-started/introduction/ for more details.'
);
}

Expand Down Expand Up @@ -696,17 +696,12 @@
input.prop({ 'required': true });
}

// These input types have extra attributes which affect their input validation.
// Warning: For most browsers, date inputs are buggy in their implementation of 'step', so this attribute will have no effect. Therefore, we don't set the attribute for date inputs.
// @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/date#Setting_maximum_and_minimum_dates
if (options.inputType !== 'date') {
if (options.step) {
if (options.step === 'any' || (!isNaN(options.step) && parseFloat(options.step) > 0)) {
input.attr('step', options.step);
}
else {
throw new Error('"step" must be a valid positive number or the value "any". See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-step for more information.');
}
if (options.step) {
if (options.step === 'any' || (!isNaN(options.step) && parseFloat(options.step) > 0)) {
input.attr('step', options.step);
}
else {
throw new Error('"step" must be a valid positive number or the value "any". See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-step for more information.');
}
}

Expand Down Expand Up @@ -883,7 +878,7 @@

// ...and replace it with one focusing our input, if possible
promptDialog.on('shown.bs.modal', function () {
// Need the closure here since input isn'tcan object otherwise
// Need the closure here since input isn't an object otherwise
input.focus();
});

Expand Down
27 changes: 11 additions & 16 deletions dist/bootbox.all.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*! @preserve
* bootbox.js
* version: 6.0.3
* version: 6.0.4
* author: Nick Payne <nick@kurai.co.uk>
* license: MIT
* http://bootboxjs.com/
Expand All @@ -22,7 +22,7 @@

let exports = {};

let VERSION = '6.0.3';
let VERSION = '6.0.4';
exports.VERSION = VERSION;

let locales = {
Expand Down Expand Up @@ -93,7 +93,7 @@
relatedTarget: null,
// The size of the modal to generate
size: null,
// A unique indentifier for this modal
// A unique identifier for this modal
id: null
};

Expand Down Expand Up @@ -213,7 +213,7 @@
exports.dialog = function(options) {
if ($.fn.modal === undefined) {
throw new Error(
'"$.fn.modal" is not defined; please double check you have included the Bootstrap JavaScript library. See https://getbootstrap.com/docs/5.1/getting-started/introduction/ for more details.'
'"$.fn.modal" is not defined; please double check you have included the Bootstrap JavaScript library. See https://getbootstrap.com/docs/5.3/getting-started/introduction/ for more details.'
);
}

Expand Down Expand Up @@ -702,16 +702,11 @@
});
}

// These input types have extra attributes which affect their input validation.
// Warning: For most browsers, date inputs are buggy in their implementation of 'step', so this attribute will have no effect. Therefore, we don't set the attribute for date inputs.
// @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/date#Setting_maximum_and_minimum_dates
if (options.inputType !== 'date') {
if (options.step) {
if (options.step === 'any' || (!isNaN(options.step) && parseFloat(options.step) > 0)) {
input.attr('step', options.step);
} else {
throw new Error('"step" must be a valid positive number or the value "any". See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-step for more information.');
}
if (options.step) {
if (options.step === 'any' || (!isNaN(options.step) && parseFloat(options.step) > 0)) {
input.attr('step', options.step);
} else {
throw new Error('"step" must be a valid positive number or the value "any". See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-step for more information.');
}
}

Expand Down Expand Up @@ -891,7 +886,7 @@

// ...and replace it with one focusing our input, if possible
promptDialog.on('shown.bs.modal', function() {
// Need the closure here since input isn'tcan object otherwise
// Need the closure here since input isn't an object otherwise
input.focus();
});

Expand Down Expand Up @@ -1209,7 +1204,7 @@

/*! @preserve
* bootbox.locales.js
* version: 6.0.3
* version: 6.0.4
* author: Nick Payne <nick@kurai.co.uk>
* license: MIT
* http://bootboxjs.com/
Expand Down
4 changes: 2 additions & 2 deletions dist/bootbox.all.min.js

Large diffs are not rendered by default.

27 changes: 11 additions & 16 deletions dist/bootbox.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*! @preserve
* bootbox.js
* version: 6.0.3
* version: 6.0.4
* author: Nick Payne <nick@kurai.co.uk>
* license: MIT
* http://bootboxjs.com/
Expand All @@ -22,7 +22,7 @@

let exports = {};

let VERSION = '6.0.3';
let VERSION = '6.0.4';
exports.VERSION = VERSION;

let locales = {
Expand Down Expand Up @@ -93,7 +93,7 @@
relatedTarget: null,
// The size of the modal to generate
size: null,
// A unique indentifier for this modal
// A unique identifier for this modal
id: null
};

Expand Down Expand Up @@ -214,7 +214,7 @@
exports.dialog = function (options) {
if ($.fn.modal === undefined) {
throw new Error(
'"$.fn.modal" is not defined; please double check you have included the Bootstrap JavaScript library. See https://getbootstrap.com/docs/5.1/getting-started/introduction/ for more details.'
'"$.fn.modal" is not defined; please double check you have included the Bootstrap JavaScript library. See https://getbootstrap.com/docs/5.3/getting-started/introduction/ for more details.'
);
}

Expand Down Expand Up @@ -696,17 +696,12 @@
input.prop({ 'required': true });
}

// These input types have extra attributes which affect their input validation.
// Warning: For most browsers, date inputs are buggy in their implementation of 'step', so this attribute will have no effect. Therefore, we don't set the attribute for date inputs.
// @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/date#Setting_maximum_and_minimum_dates
if (options.inputType !== 'date') {
if (options.step) {
if (options.step === 'any' || (!isNaN(options.step) && parseFloat(options.step) > 0)) {
input.attr('step', options.step);
}
else {
throw new Error('"step" must be a valid positive number or the value "any". See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-step for more information.');
}
if (options.step) {
if (options.step === 'any' || (!isNaN(options.step) && parseFloat(options.step) > 0)) {
input.attr('step', options.step);
}
else {
throw new Error('"step" must be a valid positive number or the value "any". See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-step for more information.');
}
}

Expand Down Expand Up @@ -883,7 +878,7 @@

// ...and replace it with one focusing our input, if possible
promptDialog.on('shown.bs.modal', function () {
// Need the closure here since input isn'tcan object otherwise
// Need the closure here since input isn't an object otherwise
input.focus();
});

Expand Down
2 changes: 1 addition & 1 deletion dist/bootbox.locales.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*! @preserve
* bootbox.locales.js
* version: 6.0.3
* version: 6.0.4
* author: Nick Payne <nick@kurai.co.uk>
* license: MIT
* http://bootboxjs.com/
Expand Down
2 changes: 1 addition & 1 deletion dist/bootbox.locales.min.js

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

Loading