diff --git a/js/datepicker.js b/js/datepicker.js index 2701317..3ef3e99 100644 --- a/js/datepicker.js +++ b/js/datepicker.js @@ -1,5 +1,5 @@ /*! - * Accessible Datepicker v2.1.19 + * Accessible Datepicker v2.1.20 * Copyright 2015-2019 Eureka2, Jacques Archimède. * Based on the example of the Open AJAX Alliance Accessibility Tools Task Force : http://www.oaa-accessibility.org/examplep/datepicker1/ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) @@ -330,7 +330,7 @@ if (typeof this.options.inputFormat === 'string') { this.options.inputFormat = [this.options.inputFormat]; } - if (! $.isArray(this.options.datesDisabled)) { + if (! Array.isArray(this.options.datesDisabled)) { this.options.datesDisabled = [this.options.datesDisabled]; } $.each(this.options.datesDisabled, function(i, v) { @@ -454,7 +454,7 @@ }; this.bindHandlers(); - this.$button.click(function(e) { + this.$button.on('click', function(e) { if (!$(this).hasClass('disabled')) { if (self.$calendar.attr('aria-hidden') === 'true') { self.initializeDate(); @@ -467,7 +467,7 @@ e.stopPropagation(); return false; }); - this.$button.keydown(function(e) { + this.$button.on('keydown', function(e) { var ev = e || event; if(ev.keyCode == self.keys.enter || ev.keyCode == self.keys.space) { $(this).trigger('click'); @@ -482,7 +482,7 @@ }); } - Datepicker.VERSION = '2.1.19' + Datepicker.VERSION = '2.1.20' Datepicker.DEFAULTS = { firstDayOfWeek: Date.dp_locales.firstday_of_week, // Determines the first column of the calendar grid @@ -1184,64 +1184,64 @@ var self = this; // bind button handlers - this.$fastprev.click(function(e) { + this.$fastprev.on('click', function(e) { return self.handleFastPrevClick(e); }); - this.$prev.click(function(e) { + this.$prev.on('click', function(e) { return self.handlePrevClick(e); }); - this.$next.click(function(e) { + this.$next.on('click', function(e) { return self.handleNextClick(e); }); - this.$fastnext.click(function(e) { + this.$fastnext.on('click', function(e) { return self.handleFastNextClick(e); }); - this.$monthObj.click(function(e) { + this.$monthObj.on('click', function(e) { return self.handleMonthClick(e); }); - this.$monthObj.keydown(function(e) { + this.$monthObj.on('keydown', function(e) { return self.handleMonthKeyDown(e); }); - this.$fastprev.keydown(function(e) { + this.$fastprev.on('keydown', function(e) { return self.handleFastPrevKeyDown(e); }); - this.$prev.keydown(function(e) { + this.$prev.on('keydown', function(e) { return self.handlePrevKeyDown(e); }); - this.$next.keydown(function(e) { + this.$next.on('keydown', function(e) { return self.handleNextKeyDown(e); }); - this.$fastnext.keydown(function(e) { + this.$fastnext.on('keydown', function(e) { return self.handleFastNextKeyDown(e); }); if (this.options.modal == true) { - this.$close.click(function(e) { + this.$close.on('click', function(e) { return self.handleCloseClick(e); }); - this.$close.keydown(function(e) { + this.$close.on('keydown', function(e) { return self.handleCloseKeyDown(e); }); } // bind grid handlers - this.$grid.keydown(function(e) { + this.$grid.on('keydown', function(e) { return self.handleGridKeyDown(e); }); - this.$grid.keypress(function(e) { + this.$grid.on('keypress', function(e) { return self.handleGridKeyPress(e); }); - this.$grid.focus(function(e) { + this.$grid.on('focus', function(e) { return self.handleGridFocus(e); }); - this.$grid.blur(function(e) { + this.$grid.on('blur', function(e) { return self.handleGridBlur(e); }); - this.$grid.delegate('td', 'click', function(e) { + this.$grid.on('click', 'td', function(e) { return self.handleGridClick(this, e); }); // bind target handlers - this.$target.change(function(e) { + this.$target.on('change', function(e) { var date = self.parseDate($(this).val()); self.updateLinked(date); }); @@ -1436,9 +1436,9 @@ return true; } if (e.shiftKey) { - this.$close.focus(); + this.$close.trigger('focus'); } else { - this.$prev.focus(); + this.$prev.trigger('focus'); } e.stopPropagation(); return false; @@ -1484,12 +1484,12 @@ } if (e.shiftKey) { if (this.gridType == 0) { - this.$fastprev.focus(); + this.$fastprev.trigger('focus'); } else { - this.$close.focus(); + this.$close.trigger('focus'); } } else { - this.$monthObj.focus(); + this.$monthObj.trigger('focus'); } e.stopPropagation(); return false; @@ -1548,9 +1548,9 @@ return true; } if (e.shiftKey) { - this.$prev.focus(); + this.$prev.trigger('focus'); } else { - this.$next.focus(); + this.$next.trigger('focus'); } e.stopPropagation(); return false; @@ -1595,9 +1595,9 @@ this.$monthObj.focus(); } else { if (this.gridType == 0) { - this.$fastnext.focus(); + this.$fastnext.trigger('focus'); } else { - this.$grid.focus(); + this.$grid.trigger('focus'); } } e.stopPropagation(); @@ -1653,9 +1653,9 @@ return true; } if (e.shiftKey) { - this.$next.focus(); + this.$next.trigger('focus'); } else { - this.$grid.focus(); + this.$grid.trigger('focus'); } e.stopPropagation(); return false; @@ -1699,9 +1699,9 @@ this.$grid.focus(); } else { if (this.gridType == 0) { - this.$fastprev.focus(); + this.$fastprev.trigger('focus'); } else { - this.$prev.focus(); + this.$prev.trigger('focus'); } } e.stopPropagation(); @@ -1744,12 +1744,12 @@ if (this.options.modal == true) { if (e.shiftKey) { if (this.gridType == 0) { - this.$fastnext.focus(); + this.$fastnext.trigger('focus'); } else { - this.$next.focus(); + this.$next.trigger('focus'); } } else { - this.$close.focus(); + this.$close.trigger('focus'); } e.stopPropagation() return false; @@ -2421,7 +2421,7 @@ $('.datepicker-calendar').trigger('ab.datepicker.closed', [self.id]); // set focus on the focus target if (!omitSettingFocus) { - this.$target.focus(); + this.$target.trigger('focus'); } } } // end hide() @@ -2995,7 +2995,7 @@ Datepicker.prototype.daysOfWeekDisabled = function(value) { if (value != null) { this.options.daysOfWeekDisabled = []; - if (! $.isArray(value)) { + if (! Array.isArray(value)) { value = [value]; } var self = this; @@ -3032,7 +3032,7 @@ */ Datepicker.prototype.inputFormat = function(value) { if (value != null) { - if (! $.isArray(value)) { + if (! Array.isArray(value)) { value = [value]; } if (this.$target.attr('placeholder') == this.options.inputFormat[0]) { @@ -3074,10 +3074,10 @@ this.$close.html(this.options.closeButtonTitle).attr('title', this.options.closeButtonLabel); this.$calendar.find('.datepicker-bn-close-label').html(this.options.closeButtonLabel); var self = this; - this.$close.click(function(e) { + this.$close.on('click', function(e) { return self.handleCloseClick(e); }); - this.$close.keydown(function(e) { + this.$close.on('keydown', function(e) { return self.handleCloseKeyDown(e); }); } else { @@ -3158,7 +3158,7 @@ */ Datepicker.prototype.datesDisabled = function(dates) { this.options.datesDisabled = []; - if (! $.isArray(dates)) { + if (! Array.isArray(dates)) { dates = [dates]; } var self = this; diff --git a/js/datepicker.min.js b/js/datepicker.min.js index 0468d5b..9886b90 100644 --- a/js/datepicker.min.js +++ b/js/datepicker.min.js @@ -1,5 +1,5 @@ /*! - * Accessible Datepicker v2.1.19 + * Accessible Datepicker v2.1.20 * Copyright 2015-2019 Eureka2, Jacques Archimède. * Based on the example of the Open AJAX Alliance Accessibility Tools Task Force : http://www.oaa-accessibility.org/examplep/datepicker1/ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) @@ -7,4 +7,4 @@ * http://wet-boew.github.io/wet-boew/demos/datepicker/datepicker-fr.html * http://eternicode.github.io/bootstrap-datepicker */ -(function(){"use strict";typeof Date.dp_locales=="undefined"&&(Date.dp_locales={texts:{buttonTitle:"Select date ...",buttonLabel:"Click or press the Enter key or the spacebar to open the calendar",prevButtonLabel:"Go to previous month",prevMonthButtonLabel:"Go to the previous year",prevYearButtonLabel:"Go to the previous twenty years",nextButtonLabel:"Go to next month",nextMonthButtonLabel:"Go to the next year",nextYearButtonLabel:"Go to the next twenty years",changeMonthButtonLabel:"Click or press the Enter key or the spacebar to change the month",changeYearButtonLabel:"Click or press the Enter key or the spacebar to change the year",changeRangeButtonLabel:"Click or press the Enter key or the spacebar to go to the next twenty years",closeButtonTitle:"Close",closeButtonLabel:"Close the calendar",calendarHelp:"- Up Arrow and Down Arrow - goes to the same day of the week in the previous or next week respectively. If the end of the month is reached, continues into the next or previous month as appropriate.\r\n- Left Arrow and Right Arrow - advances one day to the next, also in a continuum. Visually focus is moved from day to day and wraps from row to row in the grid of days.\r\n- Control+Page Up - Moves to the same date in the previous year.\r\n- Control+Page Down - Moves to the same date in the next year.\r\n- Home - Moves to the first day of the current month.\r\n- End - Moves to the last day of the current month.\r\n- Page Up - Moves to the same date in the previous month.\r\n- Page Down - Moves to the same date in the next month.\r\n- Enter or Espace - closes the calendar, and the selected date is shown in the associated text box.\r\n- Escape - closes the calendar without any action."},directionality:"LTR",month_names:["January","February","March","April","May","June","July","August","September","October","November","December"],month_names_abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],month_names_narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],day_names:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],day_names_abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],day_names_short:["Su","Mo","Tu","We","Th","Fr","Sa"],day_names_narrow:["S","M","T","W","T","F","S"],day_periods:{am:"AM",noon:"noon",pm:"PM"},day_periods_abbreviated:{am:"AM",noon:"noon",pm:"PM"},day_periods_narrow:{am:"a",noon:"n",pm:"p"},quarter_names:["1st quarter","2nd quarter","3rd quarter","4th quarter"],quarter_names_abbreviated:["Q1","Q2","Q3","Q4"],quarter_names_narrow:["1","2","3","4"],era_names:["Before Christ","Anno Domini"],era_names_abbreviated:["BC","AD"],era_names_narrow:["B","A"],full_format:"EEEE, MMMM d, y",long_format:"MMMM d, y",medium_format:"MMM d, y",short_format:"M/d/yy",firstday_of_week:0})})(),function(n){if(typeof define=="function"&&define.amd)define(["jquery"],n);else if(typeof exports=="object")n(require("jquery"));else{if(typeof jQuery=="undefined")throw new Error("Datepicker's JavaScript requires jQuery");n(jQuery)}}(function(n,t){"use strict";var u=['','\t<\/span>',"<\/a>"],f=['
','\t
','\t\t
<\/span><\/div>','\t\t
<\/span><\/div>','\t\t
<\/span><\/div>','\t\t
<\/span><\/div>','\t\t
July 2015<\/div>',"\t<\/div>",'\t','\t\t','\t\t\t','\t\t\t\t',"\t\t\t",'\t\t\t\t
Su<\/abbr><\/th>','\t\t\t\tMo<\/abbr><\/th>','\t\t\t\tTu<\/abbr><\/th>','\t\t\t\tWe<\/abbr><\/th>','\t\t\t\tTh<\/abbr><\/th>','\t\t\t\tFr<\/abbr><\/th>','\t\t\t\tSa<\/abbr><\/th>',"\t\t\t<\/tr>","\t\t<\/thead>",'\t\t
Javascript must be enabled<\/td>',"\t\t\t<\/tr>","\t\t<\/tbody>","\t<\/table>",'\t
','\t\t