Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan503 committed Jul 16, 2019
2 parents 87adff1 + 915a401 commit 4a4b021
Show file tree
Hide file tree
Showing 13 changed files with 36 additions and 46 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ An accessible polyfill for `<input type='time'/>` elements.

Demo available here: https://dan503.github.io/time-input-polyfill/

**Note:** If the recommended version in this documentation is out of sync with the npm version, this is because npm only allows readme edits to be committed through full releases. To prevent needless cache invalidation, I'll only update the recommended version number when there are actual changes to the polyfill code. The current recommended version is `1.0.5`. As long as you are using a version that is equal to or higher than that, you are using the latest version of the polyfill.
**Note:** If the recommended version in this documentation is out of sync with the npm version, this is because npm only allows readme edits to be committed through full releases. To prevent needless cache invalidation, I'll only update the recommended version number when there are actual changes to the polyfill code. The current recommended version is `1.0.6`. As long as you are using a version that is equal to or higher than that, you are using the latest version of the polyfill.

## Fastest and easiest way to implement

Add the following script element to your page:

```html
<script src="https://cdn.jsdelivr.net/npm/[email protected].5"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected].6"></script>
```

Alternatively you can download it via npm and use it through commonJS or an ES6 import statement.
Expand Down Expand Up @@ -47,7 +47,7 @@ You didn't load the actual polyfill onto the page, you loaded a much smaller aut
1. The initialiser checks if the browser supports `input[type="time"]` elements.
2. If it **does**, it skips the rest of the functionality.
3. If it does **not**, it will:
1. load `https://cdn.jsdelivr.net/npm/[email protected].5/dist/time-input-polyfill.min.js` (the actual polyfill).
1. load `https://cdn.jsdelivr.net/npm/[email protected].6/dist/time-input-polyfill.min.js` (the actual polyfill).
2. Collect all existing `input[type="time"]` elements on the page.
3. Loop through each `input[type="time"]` element and apply the polyfill to it.

Expand Down Expand Up @@ -90,7 +90,7 @@ if (!supportsTime) {
First check for `input[type="time"]` support.

```html
<script src="https://cdn.jsdelivr.net/npm/[email protected].5/core/helpers/supportsTime.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected].6/core/helpers/supportsTime.js"></script>
```
```js
if (!supportsTime) {
Expand All @@ -101,8 +101,8 @@ if (!supportsTime) {
Then gather a list of all `input[type="time"]` elements on the page, and loop through them to apply the polyfill.

```html
<script src="https://cdn.jsdelivr.net/npm/[email protected].5/core/helpers/supportsTime.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected].5/dist/time-input-polyfill.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected].6/core/helpers/supportsTime.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected].6/dist/time-input-polyfill.min.js"></script>
```
```js
if (!supportsTime) {
Expand Down
2 changes: 1 addition & 1 deletion auto.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ var loadJS = require('./core/helpers/loadJS');

document.addEventListener("DOMContentLoaded", function() {
if (!supports_time) {
loadJS('https://cdn.jsdelivr.net/npm/[email protected].5/dist/time-input-polyfill.min.js', function(){
loadJS('https://cdn.jsdelivr.net/npm/[email protected].6/dist/time-input-polyfill.min.js', function(){
var $inputs = [].slice.call(document.querySelectorAll('input[type="time"]'));
$inputs.forEach(function($input) {
new TimePolyfill($input);
Expand Down
7 changes: 0 additions & 7 deletions core/helpers/prevent_user_select.js

This file was deleted.

4 changes: 2 additions & 2 deletions dist/time-input-polyfill.auto.min.js

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

2 changes: 1 addition & 1 deletion dist/time-input-polyfill.auto.min.js.map

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

Loading

0 comments on commit 4a4b021

Please sign in to comment.