From 4487eb04be5d3ddb573f71e25e3fbb818652f0a8 Mon Sep 17 00:00:00 2001 From: Amsul Date: Fri, 31 Jan 2014 20:45:30 -0500 Subject: [PATCH] package files updated --- .jshintrc | 8 ++ CHANGELOG.md | 16 +++- Gruntfile.js | 14 ++-- LICENSE.md | 2 +- README.md | 16 ++-- _raw/CHANGELOG.md | 108 ++++++++++++++----------- _raw/base.htm | 2 +- _raw/demo/scripts/base.js | 3 +- api.htm | 8 +- bower.json | 24 +++--- date.htm | 8 +- demo/scripts/main.js | 3 +- demo/styles/main.css | 18 +---- index.htm | 4 +- lib/compressed/picker.date.js | 4 +- lib/compressed/picker.js | 4 +- lib/compressed/picker.time.js | 4 +- lib/compressed/themes/classic.date.css | 2 +- lib/compressed/themes/classic.time.css | 2 +- lib/compressed/themes/default.css | 2 +- lib/compressed/themes/default.date.css | 2 +- lib/compressed/themes/default.time.css | 2 +- lib/picker.date.js | 2 +- lib/picker.js | 2 +- lib/picker.time.js | 2 +- lib/themes/classic.date.css | 1 - lib/themes/default.date.css | 1 - package.json | 24 +++--- pickadate.jquery.json | 24 +++--- tests/dev/date.htm | 64 +++------------ tests/dev/time.htm | 50 +++--------- time.htm | 2 +- 32 files changed, 184 insertions(+), 244 deletions(-) create mode 100644 .jshintrc diff --git a/.jshintrc b/.jshintrc new file mode 100644 index 00000000..d536e7e0 --- /dev/null +++ b/.jshintrc @@ -0,0 +1,8 @@ +{ + "debug": true, + "devel": true, + "browser": true, + "asi": true, + "unused": true, + "eqnull": true +} \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index a3745d82..8bd4d03f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,15 @@ # Changelog +## 3.4.0 + +- ARIA support added. +- [#128](https://github.com/amsul/pickadate.js/issues/128): Date parser recognizes a string value and uses month index as 1. +- [#316](https://github.com/amsul/pickadate.js/issues/316): Date and time parser fall back to default format if none is specified. +- [#326](https://github.com/amsul/pickadate.js/issues/326): Fixed `set('disable', true)` crashing with `max: true` in options. +- [#329](https://github.com/amsul/pickadate.js/issues/329): Fixed time picker not parsing midnight correcly. +- Improved time picker setting a time relative to “now”. + + ## 3.3.2 - [#283](https://github.com/amsul/pickadate.js/issues/283): Adjusted font size for narrow screens. @@ -16,11 +26,11 @@ - [#249](https://github.com/amsul/pickadate.js/issues/249) & [#120](https://github.com/amsul/pickadate.js/issues/120): Fixed jQuery Mobile and MagnificPopup click issues. - [#247](https://github.com/amsul/pickadate.js/issues/247): Fixed setting min limit on time picker. - [#278](https://github.com/amsul/pickadate.js/issues/278) & [#285](https://github.com/amsul/pickadate.js/issues/285): Fixed Firefox and IE bug for finding `activeElement`. -- [#279](https://github.com/amsul/pickadate.js/issues/279): Added option to `set` things with [muted callbacks](http://amsul.ca/pickadate.js/api.htm#muted-callbacks). +- [#279](https://github.com/amsul/pickadate.js/issues/279): Added option to `set` things with [muted callbacks](http://amsul.github.io/pickadate.js/pickadate.js/api.htm#muted-callbacks). - Fixed French translations capitalization. - Fixed time picker scrolling. -- Added setting a [time using a native JavaScript date objects](http://amsul.ca/api.htm#method-set-select-time). -- Added option to keep an [editable `input`](http://amsul.ca/date.htm#editable) element. +- Added setting a [time using a native JavaScript date objects](http://amsul.github.io/pickadate.js/api.htm#method-set-select-time). +- Added option to keep an [editable `input`](http://amsul.github.io/pickadate.js/date.htm#editable) element. ## 3.3.0 diff --git a/Gruntfile.js b/Gruntfile.js index bc1a427d..4d7ced8f 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -4,10 +4,7 @@ */ /*jshint - asi: true - */ -/*global - module: true + node: true */ @@ -164,6 +161,9 @@ module.exports = function( grunt ) { // Lint the files. jshint: { + options: { + jshintrc: true + }, gruntfile: 'Gruntfile.js', demos: [ '<%= dirs.src.demos %>/scripts/base.js' ], pickers: [ @@ -275,13 +275,13 @@ module.exports = function( grunt ) { grunt.registerMultiTask( 'htmlify', 'Recursively build static HTML files', function() { var task = this, - options = task.options(), + // options = task.options(), // Process the base file using the source file content. processFile = function( fileSource ) { - var processedContent = '', - fileNameMatch = fileSource.match( /([\w-]+)(\.htm)$/ ) + var processedContent = ''/*, + fileNameMatch = fileSource.match( /([\w-]+)(\.htm)$/ )*/ // Recursively process the base template using the file source content. grunt.verbose.writeln( 'Processing ' + fileSource ) diff --git a/LICENSE.md b/LICENSE.md index f64cf43e..39260919 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,4 +1,4 @@ -Copyright 2013 Amsul, http://amsul.ca +Copyright 2014 Amsul, http://amsul.ca Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: diff --git a/README.md b/README.md index f6621b90..6c5afc7b 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# pickadate v3.3.2 [![pickadate build status](https://travis-ci.org/amsul/pickadate.js.png?branch=gh-pages)](https://travis-ci.org/amsul/pickadate.js) +# pickadate v3.4.0 [![pickadate build status](https://travis-ci.org/amsul/pickadate.js.png?branch=gh-pages)](https://travis-ci.org/amsul/pickadate.js) The mobile-friendly, responsive, and lightweight jQuery date & time input picker. @@ -11,7 +11,7 @@ The mobile-friendly, responsive, and lightweight jQuery date & time input picker #### To get it: -[Download v3.3.2](https://github.com/amsul/pickadate.js/archive/3.3.2.zip) or `git clone git://github.com/amsul/pickadate.js.git` or `bower install pickadate` +[Download v3.4.0](https://github.com/amsul/pickadate.js/archive/3.4.0.zip) or `git clone git://github.com/amsul/pickadate.js.git` or `bower install pickadate` @@ -36,9 +36,9 @@ There are currently two pickers: **date** and **time**. File | Contents | Size (min & gzip) ----------------------- | ------------------------ | ---------------------- -`picker.js` | __Base *__ | 1.37kb -`picker.date.js` | Date picker | 2.14kb -`picker.time.js` | Time picker | 1.50kb +`picker.js` | __Base *__ | 1.54kb +`picker.date.js` | Date picker | 2.17kb +`picker.time.js` | Time picker | 1.58kb __*__ The base script is **required** for any of the pickers to function. @@ -51,7 +51,7 @@ All themes are [generated using LESS](#less-styling) and compiled into the `lib/ File | Contents | Size (min & gzip) ----------------------- | ---------------------------- | ---------------------- -`default.css` | __Base default *__ | 0.51kb +`default.css` | __Base default *__ | 0.47kb `default.date.css` | Default date picker | 0.71kb `default.time.css` | Default time picker | 0.35kb `classic.css` | __Base classic *__ | 0.37kb @@ -65,7 +65,7 @@ __**__ For languages with text flowing from right-to-left, also include the `rtl ### Translations -The translations are copied into the `lib/translations` folder. There are currently [34 languages](https://github.com/amsul/pickadate.js/blob/3.3.2/lib/translations) included. +The translations are copied into the `lib/translations` folder. There are currently [34 languages](https://github.com/amsul/pickadate.js/blob/3.4.0/lib/translations) included. @@ -139,6 +139,6 @@ Before contributing any code to the project, please take a look at the [Contribu --- -© 2013 [Amsul](http://twitter.com/amsul_) +© 2014 [Amsul](http://twitter.com/amsul_) Licensed under [MIT](http://amsul.ca/MIT) \ No newline at end of file diff --git a/_raw/CHANGELOG.md b/_raw/CHANGELOG.md index a3745d82..ed0def0d 100644 --- a/_raw/CHANGELOG.md +++ b/_raw/CHANGELOG.md @@ -1,40 +1,50 @@ # Changelog +## 3.4.0 + +- ARIA support added. +- [#128]({%= pkg.bugs %}/128): Date parser recognizes a string value and uses month index as 1. +- [#316]({%= pkg.bugs %}/316): Date and time parser fall back to default format if none is specified. +- [#326]({%= pkg.bugs %}/326): Fixed `set('disable', true)` crashing with `max: true` in options. +- [#329]({%= pkg.bugs %}/329): Fixed time picker not parsing midnight correcly. +- Improved time picker setting a time relative to “now”. + + ## 3.3.2 -- [#283](https://github.com/amsul/pickadate.js/issues/283): Adjusted font size for narrow screens. -- [#285](https://github.com/amsul/pickadate.js/issues/285): Fixed `select` menu click on Firefox. -- [#294](https://github.com/amsul/pickadate.js/issues/294): Fixed issue with `stop` method called within `onClose`. -- [#303](https://github.com/amsul/pickadate.js/issues/303): Fixed issue with `value` not being parsed when `formatSubmit` is used. +- [#283]({%= pkg.bugs %}/283): Adjusted font size for narrow screens. +- [#285]({%= pkg.bugs %}/285): Fixed `select` menu click on Firefox. +- [#294]({%= pkg.bugs %}/294): Fixed issue with `stop` method called within `onClose`. +- [#303]({%= pkg.bugs %}/303): Fixed issue with `value` not being parsed when `formatSubmit` is used. ## 3.3.1 -- [#260](https://github.com/amsul/pickadate.js/issues/260): Fixed border from preventing picker from opening. -- [#248](https://github.com/amsul/pickadate.js/issues/248): Added option to enable dates/times disabled within a range. -- [#255](https://github.com/amsul/pickadate.js/issues/255): Added traditional Chinese. -- [#249](https://github.com/amsul/pickadate.js/issues/249) & [#120](https://github.com/amsul/pickadate.js/issues/120): Fixed jQuery Mobile and MagnificPopup click issues. -- [#247](https://github.com/amsul/pickadate.js/issues/247): Fixed setting min limit on time picker. -- [#278](https://github.com/amsul/pickadate.js/issues/278) & [#285](https://github.com/amsul/pickadate.js/issues/285): Fixed Firefox and IE bug for finding `activeElement`. -- [#279](https://github.com/amsul/pickadate.js/issues/279): Added option to `set` things with [muted callbacks](http://amsul.ca/pickadate.js/api.htm#muted-callbacks). +- [#260]({%= pkg.bugs %}/260): Fixed border from preventing picker from opening. +- [#248]({%= pkg.bugs %}/248): Added option to enable dates/times disabled within a range. +- [#255]({%= pkg.bugs %}/255): Added traditional Chinese. +- [#249]({%= pkg.bugs %}/249) & [#120]({%= pkg.bugs %}/120): Fixed jQuery Mobile and MagnificPopup click issues. +- [#247]({%= pkg.bugs %}/247): Fixed setting min limit on time picker. +- [#278]({%= pkg.bugs %}/278) & [#285]({%= pkg.bugs %}/285): Fixed Firefox and IE bug for finding `activeElement`. +- [#279]({%= pkg.bugs %}/279): Added option to `set` things with [muted callbacks]({%= pkg.homepage %}/pickadate.js/api.htm#muted-callbacks). - Fixed French translations capitalization. - Fixed time picker scrolling. -- Added setting a [time using a native JavaScript date objects](http://amsul.ca/api.htm#method-set-select-time). -- Added option to keep an [editable `input`](http://amsul.ca/date.htm#editable) element. +- Added setting a [time using a native JavaScript date objects]({%= pkg.homepage %}/api.htm#method-set-select-time). +- Added option to keep an [editable `input`]({%= pkg.homepage %}/date.htm#editable) element. ## 3.3.0 -- [#238](https://github.com/amsul/pickadate.js/issues/238): Improved disabled dates validation. -- [#236](https://github.com/amsul/pickadate.js/issues/236): Fixed transparency issue in IE8 on XP. -- [#159](https://github.com/amsul/pickadate.js/issues/159): Added functionality to reset disabled dates/times. -- [#232](https://github.com/amsul/pickadate.js/issues/232): Dropdown styling tweaked. -- [#197](https://github.com/amsul/pickadate.js/issues/197): Fixed issue with forms not submitting on Firefox. -- [#230](https://github.com/amsul/pickadate.js/issues/230): Fixed issue with selected time scrolling into view. -- [#208](https://github.com/amsul/pickadate.js/issues/208) & [#209](https://github.com/amsul/pickadate.js/issues/209): Added `hiddenPrefix` option for hidden input element’s name attribute. -- [#130](https://github.com/amsul/pickadate.js/issues/130): Fixed issue with passing focus to an element with custom jQuery builds. -- [#246](https://github.com/amsul/pickadate.js/issues/246) & [#242](https://github.com/amsul/pickadate.js/issues/242): Resolved jQuery conflict. -- [#247](https://github.com/amsul/pickadate.js/issues/247): Fixed issue with time picker intervals and the min selectable time. +- [#238]({%= pkg.bugs %}/238): Improved disabled dates validation. +- [#236]({%= pkg.bugs %}/236): Fixed transparency issue in IE8 on XP. +- [#159]({%= pkg.bugs %}/159): Added functionality to reset disabled dates/times. +- [#232]({%= pkg.bugs %}/232): Dropdown styling tweaked. +- [#197]({%= pkg.bugs %}/197): Fixed issue with forms not submitting on Firefox. +- [#230]({%= pkg.bugs %}/230): Fixed issue with selected time scrolling into view. +- [#208]({%= pkg.bugs %}/208) & [#209]({%= pkg.bugs %}/209): Added `hiddenPrefix` option for hidden input element’s name attribute. +- [#130]({%= pkg.bugs %}/130): Fixed issue with passing focus to an element with custom jQuery builds. +- [#246]({%= pkg.bugs %}/246) & [#242]({%= pkg.bugs %}/242): Resolved jQuery conflict. +- [#247]({%= pkg.bugs %}/247): Fixed issue with time picker intervals and the min selectable time. - Added option to disabled/enable dates using JavaScript Date objects. - Tweaked functionality in enabling/disabling dates and times. - Improved support for RTL languages and keyboard navigation. @@ -43,21 +53,21 @@ ## 3.2.2 -- [#216](https://github.com/amsul/pickadate.js/issues/216): Added generic Arabic translations. -- [#210](https://github.com/amsul/pickadate.js/issues/210): Fixed jQuery conflict in picker extension files. -- [#223](https://github.com/amsul/pickadate.js/issues/223): Time picker “disabled” attribute fix. +- [#216]({%= pkg.bugs %}/216): Added generic Arabic translations. +- [#210]({%= pkg.bugs %}/210): Fixed jQuery conflict in picker extension files. +- [#223]({%= pkg.bugs %}/223): Time picker “disabled” attribute fix. - Fixed issue with IE losing key bindings when clicked within picker. - Improved delegated click handling on picker elements. ## 3.2.1 -- [#210](https://github.com/amsul/pickadate.js/issues/210): Wrapped files using UMD patterns. -- [#207](https://github.com/amsul/pickadate.js/issues/207): Japanese translations added. +- [#210]({%= pkg.bugs %}/210): Wrapped files using UMD patterns. +- [#207]({%= pkg.bugs %}/207): Japanese translations added. - Some other slight improvements. ## 3.2.0 -- [#178](https://github.com/amsul/pickadate.js/issues/178): Fix for flicker on iOS while changing months. +- [#178]({%= pkg.bugs %}/178): Fix for flicker on iOS while changing months. - Added `render(true)` option to render full picker or just the “face” ([read more](http://amsul.github.io/pickadate.js/api.htm#method-render)). ## 3.1.4 @@ -72,54 +82,54 @@ ## 3.1.2 -- [#168](https://github.com/amsul/pickadate.js/issues/168): Fixed month navigation with disabled dates. +- [#168]({%= pkg.bugs %}/168): Fixed month navigation with disabled dates. ## 3.1.1 -- [#161](https://github.com/amsul/pickadate.js/issues/161): Corrected “no-drop” cursor on input element for certain browsers. -- [#158](https://github.com/amsul/pickadate.js/issues/158): Fixed CSS for disabled dates with unfocused input. -- [#155](https://github.com/amsul/pickadate.js/issues/155): Corrected unescaped translations. +- [#161]({%= pkg.bugs %}/161): Corrected “no-drop” cursor on input element for certain browsers. +- [#158]({%= pkg.bugs %}/158): Fixed CSS for disabled dates with unfocused input. +- [#155]({%= pkg.bugs %}/155): Corrected unescaped translations. ## 3.1.0 -- [#140](https://github.com/amsul/pickadate.js/issues/140): Fix for freezing with unexpected date format. -- [#154](https://github.com/amsul/pickadate.js/issues/154): Fix for “mm” and “m” formats opening with incorrect month. +- [#140]({%= pkg.bugs %}/140): Fix for freezing with unexpected date format. +- [#154]({%= pkg.bugs %}/154): Fix for “mm” and “m” formats opening with incorrect month. - Border styling adjusted for disabled times. ## v3.0.5 -- [#145](https://github.com/amsul/pickadate.js/issues/145): Fix for `getFirstWordLength` not being defined. -- [#137](https://github.com/amsul/pickadate.js/issues/137): Corrected Norwegian translation. +- [#145]({%= pkg.bugs %}/145): Fix for `getFirstWordLength` not being defined. +- [#137]({%= pkg.bugs %}/137): Corrected Norwegian translation. ## v3.0.4 -- [#132](https://github.com/amsul/pickadate.js/issues/132): Fix for using `firstDay` with month starting on Sunday. +- [#132]({%= pkg.bugs %}/132): Fix for using `firstDay` with month starting on Sunday. - Improved disabled dates validation. ## v3.0.3 -- [#126](https://github.com/amsul/pickadate.js/issues/126): Fix for all dates disabled. -- [#127](https://github.com/amsul/pickadate.js/issues/127): Fix for jQuery no conflict. -- [#129](https://github.com/amsul/pickadate.js/issues/129): Fix for month nav wrapping around same year. +- [#126]({%= pkg.bugs %}/126): Fix for all dates disabled. +- [#127]({%= pkg.bugs %}/127): Fix for jQuery no conflict. +- [#129]({%= pkg.bugs %}/129): Fix for month nav wrapping around same year. ## v3.0.2 -- [#124](https://github.com/amsul/pickadate.js/issues/124): Fixed bug with navigating past year. +- [#124]({%= pkg.bugs %}/124): Fixed bug with navigating past year. ## v3.0.1 -- [#123](https://github.com/amsul/pickadate.js/issues/123): Removed `hiddenSuffix` extra quote character. +- [#123]({%= pkg.bugs %}/123): Removed `hiddenSuffix` extra quote character. - Fixed issue with month navigation on the 31st date. ## v3.0.0 With this major release, the entire API has been rethought to allow the picker to be much more configurable and extensible. These are the most notable updates: -- [#20](https://github.com/amsul/pickadate.js/issues/20): Introduced a new [time picker](http://amsul.github.io/pickadate.js/time.htm). -- [#112](https://github.com/amsul/pickadate.js/issues/112): Firefox select month/year fix. -- [#84](https://github.com/amsul/pickadate.js/issues/84): Scrollbar not hidden to avoid page shift. -- [#89](https://github.com/amsul/pickadate.js/issues/89): Better event handling on clicks/focuses/keydowns within the holder. -- [#98](https://github.com/amsul/pickadate.js/issues/98): Destroy picker data from element. +- [#20]({%= pkg.bugs %}/20): Introduced a new [time picker](http://amsul.github.io/pickadate.js/time.htm). +- [#112]({%= pkg.bugs %}/112): Firefox select month/year fix. +- [#84]({%= pkg.bugs %}/84): Scrollbar not hidden to avoid page shift. +- [#89]({%= pkg.bugs %}/89): Better event handling on clicks/focuses/keydowns within the holder. +- [#98]({%= pkg.bugs %}/98): Destroy picker data from element. - Added Grunt.js build system. - Added QUnit test suite. - Added Travis integration. @@ -131,7 +141,7 @@ With this major release, the entire API has been rethought to allow the picker t To enable all this goodness, some **backward-incompatible changes** have been introduced. These are the main ones: -- [#85](https://github.com/amsul/pickadate.js/issues/85): Months have __zero-as-index__: +- [#85]({%= pkg.bugs %}/85): Months have __zero-as-index__: Just as in JavaScript’s native Date object, the `month` used to create dates is now based on zero as the first index. Meaning: diff --git a/_raw/base.htm b/_raw/base.htm index a78a227e..9723e222 100644 --- a/_raw/base.htm +++ b/_raw/base.htm @@ -68,7 +68,7 @@

- + diff --git a/_raw/demo/scripts/base.js b/_raw/demo/scripts/base.js index 78fda096..556aa5ed 100644 --- a/_raw/demo/scripts/base.js +++ b/_raw/demo/scripts/base.js @@ -3,7 +3,8 @@ debug: true, devel: true, browser: true, - asi: true + asi: true, + unused: false */ diff --git a/api.htm b/api.htm index 8c9f18d5..61dc03b2 100644 --- a/api.htm +++ b/api.htm @@ -252,7 +252,7 @@

Clearpicker.clear() -
+

This is a shorthand that uses the set method behind the scenes.

@@ -342,7 +342,7 @@

Get picker.get() // Short for `picker.get('value')`. -
+
@@ -542,7 +542,7 @@

Set picker.set('clear') -
+

This is the full form of the clear method.

@@ -1108,7 +1108,7 @@

- + diff --git a/bower.json b/bower.json index 5bc4b74e..d409739f 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "pickadate", - "version": "3.3.2", + "version": "3.4.0", "title": "pickadate.js", "description": "The mobile-friendly, responsive, and lightweight jQuery date & time input picker.", "author": { @@ -38,18 +38,18 @@ "jquery": ">=1.7" }, "devDependencies": { - "grunt": "~0.4.1", - "phantomjs": "1.9.0-2", - "zlib-browserify": "0.0.1", + "grunt": "~0.4.2", + "phantomjs": "~1.9.7-1", + "zlib-browserify": "0.0.3", "grunt-contrib-concat": "~0.3.0", - "grunt-contrib-watch": "~0.3.1", - "grunt-contrib-jshint": "~0.4.3", - "grunt-contrib-qunit": "~0.2.0", - "grunt-contrib-copy": "~0.4.1", - "grunt-contrib-less": "~0.5.1", - "grunt-contrib-clean": "~0.4.1", - "grunt-contrib-cssmin": "~0.6.0", - "grunt-contrib-uglify": "~0.2.0" + "grunt-contrib-watch": "~0.5.3", + "grunt-contrib-jshint": "~0.8.0", + "grunt-contrib-qunit": "~0.4.0", + "grunt-contrib-copy": "~0.5.0", + "grunt-contrib-less": "~0.9.0", + "grunt-contrib-clean": "~0.5.0", + "grunt-contrib-cssmin": "~0.7.0", + "grunt-contrib-uglify": "~0.3.2" }, "scripts": { "test": "grunt travis --verbose" diff --git a/date.htm b/date.htm index d254e7a3..0cd1132b 100644 --- a/date.htm +++ b/date.htm @@ -71,8 +71,8 @@

The basic setup requires targetting an
-

Along with v3, the v2 options and API have effectively been deprecated. Read up on the full changelog here.

-

One of the most critical changes is that the “month” used to create dates, just as in JavaScript’s native Date object, now has zero-as-index.

+

Along with v3, the v2 options and API have effectively been deprecated. Read up on the full changelog here.

+

One of the most critical changes is that the “month” used to create dates, just as in JavaScript’s native Date object, now has zero-as-index.

@@ -241,7 +241,7 @@

Buttons

Translations§

-

The picker can be extended to add support for internationalization. There are translations available for 34 languages which you can include in one of two ways:

+

The picker can be extended to add support for internationalization. There are translations available for 34 languages which you can include in one of two ways:

// Extend the default picker options for all instances.
 $.extend($.fn.pickadate.defaults, {
@@ -650,7 +650,7 @@ 

- + diff --git a/demo/scripts/main.js b/demo/scripts/main.js index c7e95ad0..3a146611 100644 --- a/demo/scripts/main.js +++ b/demo/scripts/main.js @@ -3,7 +3,8 @@ debug: true, devel: true, browser: true, - asi: true + asi: true, + unused: false */ diff --git a/demo/styles/main.css b/demo/styles/main.css index c5da2eb3..6fae2239 100644 --- a/demo/styles/main.css +++ b/demo/styles/main.css @@ -131,17 +131,14 @@ audio:not([controls]) { html { background: #fff; /* 1 */ - color: #000; /* 2 */ - font-family: sans-serif; /* 3 */ - -ms-text-size-adjust: 100%; + /* 4 */ -webkit-text-size-adjust: 100%; /* 4 */ - } /** * Remove default margin. @@ -296,10 +293,8 @@ fieldset { legend { border: 0; /* 1 */ - padding: 0; /* 2 */ - } /** * 1. Correct font family not being inherited in all browsers. @@ -312,13 +307,10 @@ select, textarea { font-family: inherit; /* 1 */ - font-size: 100%; /* 2 */ - margin: 0; /* 3 */ - } /** * Address Firefox 4+ setting `line-height` on `input` using `!important` in @@ -351,10 +343,8 @@ input[type="reset"], input[type="submit"] { -webkit-appearance: button; /* 2 */ - cursor: pointer; /* 3 */ - } /** * Re-set default cursor for disabled elements. @@ -371,10 +361,8 @@ input[type="checkbox"], input[type="radio"] { box-sizing: border-box; /* 1 */ - padding: 0; /* 2 */ - } /** * 1. Address `appearance` set to `searchfield` in Safari 5 and Chrome. @@ -384,11 +372,9 @@ input[type="radio"] { input[type="search"] { -webkit-appearance: textfield; /* 1 */ - -moz-box-sizing: content-box; -webkit-box-sizing: content-box; /* 2 */ - box-sizing: content-box; } /** @@ -414,10 +400,8 @@ input::-moz-focus-inner { textarea { overflow: auto; /* 1 */ - vertical-align: top; /* 2 */ - } /* ========================================================================== Tables diff --git a/index.htm b/index.htm index 39c48b8b..3d20247e 100644 --- a/index.htm +++ b/index.htm @@ -52,7 +52,7 @@

pickadate.js

The mobile-friendly, responsive, and lightweight
jQuery date & time input picker.

-

Download pickadate.js v3.3.2

+

Download pickadate.js v3.4.0

@@ -132,7 +132,7 @@

- + diff --git a/lib/compressed/picker.date.js b/lib/compressed/picker.date.js index 89c82087..742a1498 100644 --- a/lib/compressed/picker.date.js +++ b/lib/compressed/picker.date.js @@ -1,5 +1,5 @@ /*! - * Date picker for pickadate.js v3.3.2 + * Date picker for pickadate.js v3.4.0 * http://amsul.github.io/pickadate.js/date.htm */ -!function(a){"function"==typeof define&&define.amd?define(["picker","jquery"],a):a(Picker,jQuery)}(function(a,b){function c(a,b){var c=this,d=a.$node[0].value,e=a.$node.data("value"),f=e||d,g=e?b.formatSubmit:b.format,h=function(){return"rtl"===getComputedStyle(a.$root[0]).direction};c.settings=b,c.queue={min:"measure create",max:"measure create",now:"now create",select:"parse create validate",highlight:"navigate create validate",view:"create validate viewset",disable:"flipItem",enable:"flipItem"},c.item={},c.item.disable=(b.disable||[]).slice(0),c.item.enable=-function(a){return a[0]===!0?a.shift():-1}(c.item.disable),c.set("min",b.min).set("max",b.max).set("now").set("select",f||c.item.now,{format:g,data:function(a){return f&&(a.indexOf("mm")>-1||a.indexOf("m")>-1)}(c.formats.toArray(g))}),c.key={40:7,38:-7,39:function(){return h()?-1:1},37:function(){return h()?1:-1},go:function(a){c.set("highlight",[c.item.highlight.year,c.item.highlight.month,c.item.highlight.date+a],{interval:a}),this.render()}},a.on("render",function(){a.$root.find("."+b.klass.selectMonth).on("change",function(){a.set("highlight",[a.get("view").year,this.value,a.get("highlight").date]),a.$root.find("."+b.klass.selectMonth).trigger("focus")}),a.$root.find("."+b.klass.selectYear).on("change",function(){a.set("highlight",[this.value,a.get("view").month,a.get("highlight").date]),a.$root.find("."+b.klass.selectYear).trigger("focus")})}).on("open",function(){a.$root.find("button, select").attr("disabled",!1)}).on("close",function(){a.$root.find("button, select").attr("disabled",!0)})}var d=7,e=6;c.prototype.set=function(a,b,c){var d=this;return d.item["enable"==a?"disable":"flip"==a?"enable":a]=d.queue[a].split(" ").map(function(e){return b=d[e](a,b,c)}).pop(),"select"==a?d.set("highlight",d.item.select,c):"highlight"==a?d.set("view",d.item.highlight,c):("flip"==a||"min"==a||"max"==a||"disable"==a||"enable"==a)&&d.item.select&&d.item.highlight&&d.set("select",d.item.select,c).set("highlight",d.item.highlight,c),d},c.prototype.get=function(a){return this.item[a]},c.prototype.create=function(c,d,e){var f,g=this;return d=void 0===d?c:d,d==-1/0||1/0==d?f=d:b.isPlainObject(d)&&a._.isInteger(d.pick)?d=d.obj:b.isArray(d)?(d=new Date(d[0],d[1],d[2]),d=a._.isDate(d)?d:g.create().obj):d=a._.isInteger(d)||a._.isDate(d)?g.normalize(new Date(d),e):g.now(c,d,e),{year:f||d.getFullYear(),month:f||d.getMonth(),date:f||d.getDate(),day:f||d.getDay(),obj:f||d,pick:f||d.getTime()}},c.prototype.now=function(a,b,c){return b=new Date,c&&c.rel&&b.setDate(b.getDate()+c.rel),this.normalize(b,c)},c.prototype.navigate=function(c,d,e){if(b.isPlainObject(d)){for(var f=new Date(d.year,d.month+(e&&e.nav?e.nav:0),1),g=f.getFullYear(),h=f.getMonth(),i=d.date;a._.isDate(f)&&new Date(g,h,i).getMonth()!==h;)i-=1;d=[g,h,i]}return d},c.prototype.normalize=function(a){return a.setHours(0,0,0,0),a},c.prototype.measure=function(b,c){var d=this;return c?a._.isInteger(c)&&(c=d.now(b,c,{rel:c})):c="min"==b?-1/0:1/0,c},c.prototype.viewset=function(a,b){return this.create([b.year,b.month,1])},c.prototype.validate=function(c,d,e){var f,g,h,i,j=this,k=d,l=e&&e.interval?e.interval:1,m=-1===j.item.enable,n=j.item.min,o=j.item.max,p=m&&j.item.disable.filter(function(c){if(b.isArray(c)){var e=j.create(c).pick;ed.pick&&(g=!0)}return a._.isInteger(c)}).length;if(!e.nav&&(!m&&j.disabled(d)||m&&j.disabled(d)&&(p||f||g)||d.pick<=n.pick||d.pick>=o.pick))for(m&&!p&&(!g&&l>0||!f&&0>l)&&(l*=-1);j.disabled(d)&&(Math.abs(l)>1&&(d.monthk.month)&&(d=k,l=Math.abs(l)/l),d.pick<=n.pick?(h=!0,l=1):d.pick>=o.pick&&(i=!0,l=-1),!h||!i);)d=j.create([d.year,d.month,d.date+l]);return d},c.prototype.disabled=function(c){var d=this,e=d.item.disable.filter(function(e){return a._.isInteger(e)?c.day===(d.settings.firstDay?e:e-1)%7:b.isArray(e)||a._.isDate(e)?c.pick===d.create(e).pick:void 0});return e=e.length&&!e.filter(function(a){return b.isArray(a)&&"inverted"==a[3]}).length,-1===d.item.enable?!e:e||c.pickd.item.max.pick},c.prototype.parse=function(c,d,e){var f=this,g={};if(!d||a._.isInteger(d)||b.isArray(d)||a._.isDate(d)||b.isPlainObject(d)&&a._.isInteger(d.pick))return d;if(!e||!e.format)throw"Need a formatting option to parse this..";return f.formats.toArray(e.format).map(function(b){var c=f.formats[b],e=c?a._.trigger(c,f,[d,g]):b.replace(/^!/,"").length;c&&(g[b]=d.substr(0,e)),d=d.substr(e)}),[g.yyyy||g.yy,+(g.mm||g.m)-(e.data?1:0),g.dd||g.d]},c.prototype.formats=function(){function b(a,b,c){var d=a.match(/\w+/)[0];return c.mm||c.m||(c.m=b.indexOf(d)),d.length}function c(a){return a.match(/\w+/)[0].length}return{d:function(b,c){return b?a._.digits(b):c.date},dd:function(b,c){return b?2:a._.lead(c.date)},ddd:function(a,b){return a?c(a):this.settings.weekdaysShort[b.day]},dddd:function(a,b){return a?c(a):this.settings.weekdaysFull[b.day]},m:function(b,c){return b?a._.digits(b):c.month+1},mm:function(b,c){return b?2:a._.lead(c.month+1)},mmm:function(a,c){var d=this.settings.monthsShort;return a?b(a,d,c):d[c.month]},mmmm:function(a,c){var d=this.settings.monthsFull;return a?b(a,d,c):d[c.month]},yy:function(a,b){return a?2:(""+b.year).slice(2)},yyyy:function(a,b){return a?4:b.year},toArray:function(a){return a.split(/(d{1,4}|m{1,4}|y{4}|yy|!.)/g)},toString:function(b,c){var d=this;return d.formats.toArray(b).map(function(b){return a._.trigger(d.formats[b],d,[0,c])||b.replace(/^!/,"")}).join("")}}}(),c.prototype.flipItem=function(a,c){var d=this,e=d.item.disable,f=-1===d.item.enable;return"flip"==c?d.item.enable=f?1:-1:"enable"==a&&c===!0||"disable"==a&&c===!1?(d.item.enable=1,e=[]):"enable"==a&&c===!1||"disable"==a&&c===!0?(d.item.enable=-1,e=[]):b.isArray(c)&&(f&&"enable"==a||!f&&"disable"==a?e=d.addDisabled(e,c):f||"enable"!=a?f&&"disable"==a&&(e=d.removeDisabled(e,c)):e=d.addEnabled(e,c)),e},c.prototype.addEnabled=function(c,d){var e=this;return d.map(function(d){e.filterDisabled(c,d,1).length&&(c=e.removeDisabled(c,[d]),b.isArray(d)&&c.filter(function(b){return a._.isInteger(b)&&e.create(d).day===b-1}).length&&(d=d.slice(0),d.push("inverted"),c.push(d)))}),c},c.prototype.addDisabled=function(a,c){var d=this;return c.map(function(c){d.filterDisabled(a,c).length?b.isArray(c)&&d.filterDisabled(a,c,1).length&&(a=d.removeDisabled(a,[c])):a.push(c)}),a},c.prototype.removeDisabled=function(a,b){var c=this;return b.map(function(b){a=c.filterDisabled(a,b,1)}),a},c.prototype.filterDisabled=function(c,d,e){var f=this,g=b.isArray(d)||a._.isDate(d),h=g&&f.create(d).pick;return c.filter(function(c){var i=g&&(b.isArray(c)||a._.isDate(c))?h===f.create(c).pick:d===c;return e?!i:i})},c.prototype.nodes=function(b){var c=this,f=c.settings,g=c.item.now,h=c.item.select,i=c.item.highlight,j=c.item.view,k=c.item.disable,l=c.item.min,m=c.item.max,n=function(b){return f.firstDay&&b.push(b.shift()),a._.node("thead",a._.group({min:0,max:d-1,i:1,node:"th",item:function(a){return[b[a],f.klass.weekdays]}}))}((f.showWeekdaysFull?f.weekdaysFull:f.weekdaysShort).slice(0)),o=function(b){return a._.node("div"," ",f.klass["nav"+(b?"Next":"Prev")]+(b&&j.year>=m.year&&j.month>=m.month||!b&&j.year<=l.year&&j.month<=l.month?" "+f.klass.navDisabled:""),"data-nav="+(b||-1))},p=function(c){return f.selectMonths?a._.node("select",a._.group({min:0,max:11,i:1,node:"option",item:function(a){return[c[a],0,"value="+a+(j.month==a?" selected":"")+(j.year==l.year&&am.month?" disabled":"")]}}),f.klass.selectMonth,b?"":"disabled"):a._.node("div",c[j.month],f.klass.month)},q=function(){var c=j.year,d=f.selectYears===!0?5:~~(f.selectYears/2);if(d){var e=l.year,g=m.year,h=c-d,i=c+d;if(e>h&&(i+=e-h,h=e),i>g){var k=h-e,n=i-g;h-=k>n?n:k,i=g}return a._.node("select",a._.group({min:h,max:i,i:1,node:"option",item:function(a){return[a,0,"value="+a+(c==a?" selected":"")]}}),f.klass.selectYear,b?"":"disabled")}return a._.node("div",c,f.klass.year)};return a._.node("div",o()+o(1)+p(f.showMonthsShort?f.monthsShort:f.monthsFull)+q(),f.klass.header)+a._.node("table",n+a._.node("tbody",a._.group({min:0,max:e-1,i:1,node:"tr",item:function(b){var e=f.firstDay&&0===c.create([j.year,j.month,1]).day?-7:0;return[a._.group({min:d*b-j.day+e+1,max:function(){return this.min+d-1},i:1,node:"td",item:function(b){return b=c.create([j.year,j.month,b+(f.firstDay?1:0)]),[a._.node("div",b.date,function(a){return a.push(j.month==b.month?f.klass.infocus:f.klass.outfocus),g.pick==b.pick&&a.push(f.klass.now),h&&h.pick==b.pick&&a.push(f.klass.selected),i&&i.pick==b.pick&&a.push(f.klass.highlighted),(k&&c.disabled(b)||b.pickm.pick)&&a.push(f.klass.disabled),a.join(" ")}([f.klass.day]),"data-pick="+b.pick)]}})]}})),f.klass.table)+a._.node("div",a._.node("button",f.today,f.klass.buttonToday,"type=button data-pick="+g.pick+(b?"":" disabled"))+a._.node("button",f.clear,f.klass.buttonClear,"type=button data-clear=1"+(b?"":" disabled")),f.klass.footer)},c.defaults=function(a){return{monthsFull:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],weekdaysFull:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],weekdaysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],today:"Today",clear:"Clear",format:"d mmmm, yyyy",klass:{table:a+"table",header:a+"header",navPrev:a+"nav--prev",navNext:a+"nav--next",navDisabled:a+"nav--disabled",month:a+"month",year:a+"year",selectMonth:a+"select--month",selectYear:a+"select--year",weekdays:a+"weekday",day:a+"day",disabled:a+"day--disabled",selected:a+"day--selected",highlighted:a+"day--highlighted",now:a+"day--today",infocus:a+"day--infocus",outfocus:a+"day--outfocus",footer:a+"footer",buttonClear:a+"button--clear",buttonToday:a+"button--today"}}}(a.klasses().picker+"__"),a.extend("pickadate",c)}); \ No newline at end of file +!function(a){"function"==typeof define&&define.amd?define(["picker","jquery"],a):a(Picker,jQuery)}(function(a,b){function c(a,b){var c=this,d=a.$node[0].value,e=a.$node.data("value"),f=e||d,g=e?b.formatSubmit:b.format,h=function(){return"rtl"===getComputedStyle(a.$root[0]).direction};c.settings=b,c.$node=a.$node,c.queue={min:"measure create",max:"measure create",now:"now create",select:"parse create validate",highlight:"navigate create validate",view:"create validate viewset",disable:"flipItem",enable:"flipItem"},c.item={},c.item.disable=(b.disable||[]).slice(0),c.item.enable=-function(a){return a[0]===!0?a.shift():-1}(c.item.disable),c.set("min",b.min).set("max",b.max).set("now").set("select",f||c.item.now,{format:g,fromValue:!!d}),c.key={40:7,38:-7,39:function(){return h()?-1:1},37:function(){return h()?1:-1},go:function(a){c.set("highlight",[c.item.highlight.year,c.item.highlight.month,c.item.highlight.date+a],{interval:a}),this.render()}},a.on("render",function(){a.$root.find("."+b.klass.selectMonth).on("change",function(){a.set("highlight",[a.get("view").year,this.value,a.get("highlight").date]),a.$root.find("."+b.klass.selectMonth).trigger("focus")}),a.$root.find("."+b.klass.selectYear).on("change",function(){a.set("highlight",[this.value,a.get("view").month,a.get("highlight").date]),a.$root.find("."+b.klass.selectYear).trigger("focus")})}).on("open",function(){a.$root.find("button, select").attr("disabled",!1)}).on("close",function(){a.$root.find("button, select").attr("disabled",!0)})}var d=7,e=6;c.prototype.set=function(a,b,c){var d=this;return d.item["enable"==a?"disable":"flip"==a?"enable":a]=d.queue[a].split(" ").map(function(e){return b=d[e](a,b,c)}).pop(),"select"==a?d.set("highlight",d.item.select,c):"highlight"==a?d.set("view",d.item.highlight,c):("flip"==a||"min"==a||"max"==a||"disable"==a||"enable"==a)&&d.item.select&&d.item.highlight&&d.set("select",d.item.select,c).set("highlight",d.item.highlight,c),d},c.prototype.get=function(a){return this.item[a]},c.prototype.create=function(c,d,e){var f,g=this;return d=void 0===d?c:d,d==-1/0||1/0==d?f=d:b.isPlainObject(d)&&a._.isInteger(d.pick)?d=d.obj:b.isArray(d)?(d=new Date(d[0],d[1],d[2]),d=a._.isDate(d)?d:g.create().obj):d=a._.isInteger(d)||a._.isDate(d)?g.normalize(new Date(d),e):g.now(c,d,e),{year:f||d.getFullYear(),month:f||d.getMonth(),date:f||d.getDate(),day:f||d.getDay(),obj:f||d,pick:f||d.getTime()}},c.prototype.now=function(a,b,c){return b=new Date,c&&c.rel&&b.setDate(b.getDate()+c.rel),this.normalize(b,c)},c.prototype.navigate=function(c,d,e){if(b.isPlainObject(d)){for(var f=new Date(d.year,d.month+(e&&e.nav?e.nav:0),1),g=f.getFullYear(),h=f.getMonth(),i=d.date;a._.isDate(f)&&new Date(g,h,i).getMonth()!==h;)i-=1;d=[g,h,i]}return d},c.prototype.normalize=function(a){return a.setHours(0,0,0,0),a},c.prototype.measure=function(b,c){var d=this;return c?a._.isInteger(c)&&(c=d.now(b,c,{rel:c})):c="min"==b?-1/0:1/0,c},c.prototype.viewset=function(a,b){return this.create([b.year,b.month,1])},c.prototype.validate=function(c,d,e){var f,g,h,i,j=this,k=d,l=e&&e.interval?e.interval:1,m=-1===j.item.enable,n=j.item.min,o=j.item.max,p=m&&j.item.disable.filter(function(c){if(b.isArray(c)){var e=j.create(c).pick;ed.pick&&(g=!0)}return a._.isInteger(c)}).length;if(!e.nav&&(!m&&j.disabled(d)||m&&j.disabled(d)&&(p||f||g)||!m&&(d.pick<=n.pick||d.pick>=o.pick)))for(m&&!p&&(!g&&l>0||!f&&0>l)&&(l*=-1);j.disabled(d)&&(Math.abs(l)>1&&(d.monthk.month)&&(d=k,l=Math.abs(l)/l),d.pick<=n.pick?(h=!0,l=1):d.pick>=o.pick&&(i=!0,l=-1),!h||!i);)d=j.create([d.year,d.month,d.date+l]);return d},c.prototype.disabled=function(c){var d=this,e=d.item.disable.filter(function(e){return a._.isInteger(e)?c.day===(d.settings.firstDay?e:e-1)%7:b.isArray(e)||a._.isDate(e)?c.pick===d.create(e).pick:void 0});return e=e.length&&!e.filter(function(a){return b.isArray(a)&&"inverted"==a[3]}).length,-1===d.item.enable?!e:e||c.pickd.item.max.pick},c.prototype.parse=function(c,d,e){var f,g=this,h={};return!d||a._.isInteger(d)||b.isArray(d)||a._.isDate(d)||b.isPlainObject(d)&&a._.isInteger(d.pick)?d:(e&&e.format||(e=e||{},e.format=g.settings.format),f="string"!=typeof d||e.fromValue?0:1,g.formats.toArray(e.format).map(function(b){var c=g.formats[b],e=c?a._.trigger(c,g,[d,h]):b.replace(/^!/,"").length;c&&(h[b]=d.substr(0,e)),d=d.substr(e)}),[h.yyyy||h.yy,+(h.mm||h.m)-f,h.dd||h.d])},c.prototype.formats=function(){function b(a,b,c){var d=a.match(/\w+/)[0];return c.mm||c.m||(c.m=b.indexOf(d)),d.length}function c(a){return a.match(/\w+/)[0].length}return{d:function(b,c){return b?a._.digits(b):c.date},dd:function(b,c){return b?2:a._.lead(c.date)},ddd:function(a,b){return a?c(a):this.settings.weekdaysShort[b.day]},dddd:function(a,b){return a?c(a):this.settings.weekdaysFull[b.day]},m:function(b,c){return b?a._.digits(b):c.month+1},mm:function(b,c){return b?2:a._.lead(c.month+1)},mmm:function(a,c){var d=this.settings.monthsShort;return a?b(a,d,c):d[c.month]},mmmm:function(a,c){var d=this.settings.monthsFull;return a?b(a,d,c):d[c.month]},yy:function(a,b){return a?2:(""+b.year).slice(2)},yyyy:function(a,b){return a?4:b.year},toArray:function(a){return a.split(/(d{1,4}|m{1,4}|y{4}|yy|!.)/g)},toString:function(b,c){var d=this;return d.formats.toArray(b).map(function(b){return a._.trigger(d.formats[b],d,[0,c])||b.replace(/^!/,"")}).join("")}}}(),c.prototype.flipItem=function(a,c){var d=this,e=d.item.disable,f=-1===d.item.enable;return"flip"==c?d.item.enable=f?1:-1:"enable"==a&&c===!0||"disable"==a&&c===!1?(d.item.enable=1,e=[]):"enable"==a&&c===!1||"disable"==a&&c===!0?(d.item.enable=-1,e=[]):b.isArray(c)&&(f&&"enable"==a||!f&&"disable"==a?e=d.addDisabled(e,c):f||"enable"!=a?f&&"disable"==a&&(e=d.removeDisabled(e,c)):e=d.addEnabled(e,c)),e},c.prototype.addEnabled=function(c,d){var e=this;return d.map(function(d){e.filterDisabled(c,d,1).length&&(c=e.removeDisabled(c,[d]),b.isArray(d)&&c.filter(function(b){return a._.isInteger(b)&&e.create(d).day===b-1}).length&&(d=d.slice(0),d.push("inverted"),c.push(d)))}),c},c.prototype.addDisabled=function(a,c){var d=this;return c.map(function(c){d.filterDisabled(a,c).length?b.isArray(c)&&d.filterDisabled(a,c,1).length&&(a=d.removeDisabled(a,[c])):a.push(c)}),a},c.prototype.removeDisabled=function(a,b){var c=this;return b.map(function(b){a=c.filterDisabled(a,b,1)}),a},c.prototype.filterDisabled=function(c,d,e){var f=this,g=b.isArray(d)||a._.isDate(d),h=g&&f.create(d).pick;return c.filter(function(c){var i=g&&(b.isArray(c)||a._.isDate(c))?h===f.create(c).pick:d===c;return e?!i:i})},c.prototype.nodes=function(b){var c=this,f=c.settings,g=c.item.now,h=c.item.select,i=c.item.highlight,j=c.item.view,k=c.item.disable,l=c.item.min,m=c.item.max,n=function(b){return f.firstDay&&b.push(b.shift()),a._.node("thead",a._.node("tr",a._.group({min:0,max:d-1,i:1,node:"th",item:function(a){return[b[a],f.klass.weekdays]}})))}((f.showWeekdaysFull?f.weekdaysFull:f.weekdaysShort).slice(0)),o=function(b){return a._.node("div"," ",f.klass["nav"+(b?"Next":"Prev")]+(b&&j.year>=m.year&&j.month>=m.month||!b&&j.year<=l.year&&j.month<=l.month?" "+f.klass.navDisabled:""),"data-nav="+(b||-1))},p=function(c){return f.selectMonths?a._.node("select",a._.group({min:0,max:11,i:1,node:"option",item:function(a){return[c[a],0,"value="+a+(j.month==a?" selected":"")+(j.year==l.year&&am.month?" disabled":"")]}}),f.klass.selectMonth,b?"":"disabled"):a._.node("div",c[j.month],f.klass.month)},q=function(){var c=j.year,d=f.selectYears===!0?5:~~(f.selectYears/2);if(d){var e=l.year,g=m.year,h=c-d,i=c+d;if(e>h&&(i+=e-h,h=e),i>g){var k=h-e,n=i-g;h-=k>n?n:k,i=g}return a._.node("select",a._.group({min:h,max:i,i:1,node:"option",item:function(a){return[a,0,"value="+a+(c==a?" selected":"")]}}),f.klass.selectYear,b?"":"disabled")}return a._.node("div",c,f.klass.year)};return a._.node("div",o()+o(1)+p(f.showMonthsShort?f.monthsShort:f.monthsFull)+q(),f.klass.header)+a._.node("table",n+a._.node("tbody",a._.group({min:0,max:e-1,i:1,node:"tr",item:function(b){var e=f.firstDay&&0===c.create([j.year,j.month,1]).day?-7:0;return[a._.group({min:d*b-j.day+e+1,max:function(){return this.min+d-1},i:1,node:"td",item:function(b){b=c.create([j.year,j.month,b+(f.firstDay?1:0)]);var d=h&&h.pick==b.pick,e=i&&i.pick==b.pick,n=k&&c.disabled(b)||b.pickm.pick;return[a._.node("div",b.date,function(a){return a.push(j.month==b.month?f.klass.infocus:f.klass.outfocus),g.pick==b.pick&&a.push(f.klass.now),d&&a.push(f.klass.selected),e&&a.push(f.klass.highlighted),n&&a.push(f.klass.disabled),a.join(" ")}([f.klass.day]),"data-pick="+b.pick+" "+a._.ariaAttr({role:"button",controls:c.$node[0].id,checked:d&&c.$node.val()===a._.trigger(c.formats.toString,c,[f.format,b])?!0:null,activedescendant:e?!0:null,disabled:n?!0:null}))]}})]}})),f.klass.table)+a._.node("div",a._.node("button",f.today,f.klass.buttonToday,"type=button data-pick="+g.pick+(b?"":" disabled"))+a._.node("button",f.clear,f.klass.buttonClear,"type=button data-clear=1"+(b?"":" disabled")),f.klass.footer)},c.defaults=function(a){return{monthsFull:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],weekdaysFull:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],weekdaysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],today:"Today",clear:"Clear",format:"d mmmm, yyyy",klass:{table:a+"table",header:a+"header",navPrev:a+"nav--prev",navNext:a+"nav--next",navDisabled:a+"nav--disabled",month:a+"month",year:a+"year",selectMonth:a+"select--month",selectYear:a+"select--year",weekdays:a+"weekday",day:a+"day",disabled:a+"day--disabled",selected:a+"day--selected",highlighted:a+"day--highlighted",now:a+"day--today",infocus:a+"day--infocus",outfocus:a+"day--outfocus",footer:a+"footer",buttonClear:a+"button--clear",buttonToday:a+"button--today"}}}(a.klasses().picker+"__"),a.extend("pickadate",c)}); \ No newline at end of file diff --git a/lib/compressed/picker.js b/lib/compressed/picker.js index 9873e166..3f96ad6b 100644 --- a/lib/compressed/picker.js +++ b/lib/compressed/picker.js @@ -1,7 +1,7 @@ /*! - * pickadate.js v3.3.2, 2013/12/28 + * pickadate.js v3.4.0, 2014/01/31 * By Amsul, http://amsul.ca * Hosted on http://amsul.github.io/pickadate.js * Licensed under MIT */ -!function(a){"function"==typeof define&&define.amd?define("picker",["jquery"],a):this.Picker=a(jQuery)}(function(a){function b(d,e,f,g){function h(){return b._.node("div",b._.node("div",b._.node("div",b._.node("div",o.component.nodes(j.open),l.box),l.wrap),l.frame),l.holder)}function i(a){a.stopPropagation(),"focus"==a.type&&o.$root.addClass(l.focused),o.open()}if(!d)return b;var j={id:Math.abs(~~(1e9*Math.random()))},k=f?a.extend(!0,{},f.defaults,g):g||{},l=a.extend({},b.klasses(),k.klass),m=a(d),n=function(){return this.start()},o=n.prototype={constructor:n,$node:m,start:function(){return j&&j.start?o:(j.methods={},j.start=!0,j.open=!1,j.type=d.type,d.autofocus=d==document.activeElement,d.type="text",d.readOnly=!k.editable,o.component=new f(o,k),o.$root=a(b._.node("div",h(),l.picker)).on({focusin:function(a){o.$root.removeClass(l.focused),a.stopPropagation()},"mousedown click":function(b){var c=b.target;c!=o.$root.children()[0]&&(b.stopPropagation(),"mousedown"!=b.type||a(c).is(":input")||"OPTION"==c.nodeName||(b.preventDefault(),d.focus()))}}).on("click","[data-pick], [data-nav], [data-clear]",function(){var c=a(this),e=c.data(),f=c.hasClass(l.navDisabled)||c.hasClass(l.disabled),g=document.activeElement;g=g&&(g.type||g.href),(f||g&&!a.contains(o.$root[0],g))&&d.focus(),e.nav&&!f?o.set("highlight",o.component.item.highlight,{nav:e.nav}):b._.isInteger(e.pick)&&!f?o.set("select",e.pick).close(!0):e.clear&&o.clear().close(!0)}),k.formatSubmit&&(o._hidden=a('")[0]),m.data(e,o).addClass(l.input).val(m.data("value")?b._.trigger(o.component.formats.toString,o.component,[k.format,o.component.item.select]):d.value).after(o._hidden).on("focus.P"+j.id+" click.P"+j.id,i).on("change.P"+j.id,function(){o._hidden&&(o._hidden.value=d.value?b._.trigger(o.component.formats.toString,o.component,[k.formatSubmit,o.component.item.select]):"")}),k.editable||m.on("keydown.P"+j.id,function(a){var b=a.keyCode,c=/^(8|46)$/.test(b);return 27==b?(o.close(),!1):((32==b||c||!j.open&&o.component.key[b])&&(a.preventDefault(),a.stopPropagation(),c?o.clear().close():o.open()),void 0)}),k.container?a(k.container).append(o.$root):m.after(o.$root),o.on({start:o.component.onStart,render:o.component.onRender,stop:o.component.onStop,open:o.component.onOpen,close:o.component.onClose,set:o.component.onSet}).on({start:k.onStart,render:k.onRender,stop:k.onStop,open:k.onOpen,close:k.onClose,set:k.onSet}),d.autofocus&&o.open(),o.trigger("start").trigger("render"))},render:function(a){return a?o.$root.html(h()):o.$root.find("."+l.box).html(o.component.nodes(j.open)),o.trigger("render")},stop:function(){return j.start?(o.close(),o._hidden&&o._hidden.parentNode.removeChild(o._hidden),o.$root.remove(),m.removeClass(l.input).removeData(e),setTimeout(function(){m.off(".P"+j.id)},0),d.type=j.type,d.readOnly=!1,o.trigger("stop"),j.methods={},j.start=!1,o):o},open:function(e){return j.open?o:(m.addClass(l.active),o.$root.addClass(l.opened),e!==!1&&(j.open=!0,m.trigger("focus"),c.on("click.P"+j.id+" focusin.P"+j.id,function(a){var b=a.target;b!=d&&b!=document&&o.close(b===o.$root.children()[0])}).on("keydown.P"+j.id,function(c){var e=c.keyCode,f=o.component.key[e],g=c.target;27==e?o.close(!0):g!=d||!f&&13!=e?a.contains(o.$root[0],g)&&13==e&&(c.preventDefault(),g.click()):(c.preventDefault(),f?b._.trigger(o.component.key.go,o,[b._.trigger(f)]):o.$root.find("."+l.highlighted).hasClass(l.disabled)||o.set("select",o.component.item.highlight).close())})),o.trigger("open"))},close:function(a){return a&&(m.off("focus.P"+j.id).trigger("focus"),setTimeout(function(){m.on("focus.P"+j.id,i)},0)),m.removeClass(l.active),o.$root.removeClass(l.opened+" "+l.focused),j.open?(j.open=!1,c.off(".P"+j.id),o.trigger("close")):o},clear:function(){return o.set("clear")},set:function(c,d,e){var f,g,h=a.isPlainObject(c),i=h?c:{};if(e=h&&a.isPlainObject(d)?d:e||{},c){h||(i[c]=d);for(f in i)g=i[f],o.component.item[f]&&o.component.set(f,g,e),("select"==f||"clear"==f)&&m.val("clear"==f?"":b._.trigger(o.component.formats.toString,o.component,[k.format,o.component.get(f)])).trigger("change");o.render()}return e.muted?o:o.trigger("set",i)},get:function(a,c){return a=a||"value",null!=j[a]?j[a]:"value"==a?d.value:o.component.item[a]?"string"==typeof c?b._.trigger(o.component.formats.toString,o.component,[c,o.component.get(a)]):o.component.get(a):void 0},on:function(b,c){var d,e,f=a.isPlainObject(b),g=f?b:{};if(b){f||(g[b]=c);for(d in g)e=g[d],j.methods[d]=j.methods[d]||[],j.methods[d].push(e)}return o},trigger:function(a,c){var d=j.methods[a];return d&&d.map(function(a){b._.trigger(a,o,[c])}),o}};return new n}var c=a(document);return b.klasses=function(a){return a=a||"picker",{picker:a,opened:a+"--opened",focused:a+"--focused",input:a+"__input",active:a+"__input--active",holder:a+"__holder",frame:a+"__frame",wrap:a+"__wrap",box:a+"__box"}},b._={group:function(a){for(var c,d="",e=b._.trigger(a.min,a);e<=b._.trigger(a.max,a,[e]);e+=a.i)c=b._.trigger(a.item,a,[e]),d+=b._.node(a.node,c[0],c[1],c[2]);return d},node:function(b,c,d,e){return c?(c=a.isArray(c)?c.join(""):c,d=d?' class="'+d+'"':"",e=e?" "+e:"","<"+b+d+e+">"+c+""):""},lead:function(a){return(10>a?"0":"")+a},trigger:function(a,b,c){return"function"==typeof a?a.apply(b,c||[]):a},digits:function(a){return/\d/.test(a[1])?2:1},isDate:function(a){return{}.toString.call(a).indexOf("Date")>-1&&this.isInteger(a.getDate())},isInteger:function(a){return{}.toString.call(a).indexOf("Number")>-1&&a%1===0}},b.extend=function(c,d){a.fn[c]=function(e,f){var g=this.data(c);return"picker"==e?g:g&&"string"==typeof e?(b._.trigger(g[e],g,[f]),this):this.each(function(){var f=a(this);f.data(c)||new b(this,c,d,e)})},a.fn[c].defaults=d.defaults},b}); \ No newline at end of file +!function(a){"function"==typeof define&&define.amd?define("picker",["jquery"],a):this.Picker=a(jQuery)}(function(a){function b(d,e,g,h){function i(){return b._.node("div",b._.node("div",b._.node("div",b._.node("div",s.component.nodes(n.open),p.box),p.wrap),p.frame),p.holder)}function j(){q.data(e,s).addClass(p.input).val(q.data("value")?s.get("select",o.format):d.value).on("focus."+n.id+" click."+n.id,m),o.editable||q.on("keydown."+n.id,function(a){var b=a.keyCode,c=/^(8|46)$/.test(b);return 27==b?(s.close(),!1):void((32==b||c||!n.open&&s.component.key[b])&&(a.preventDefault(),a.stopPropagation(),c?s.clear().close():s.open()))}),c(d,{haspopup:!0,expanded:!1,readonly:!1,owns:d.id+"_root"+(s._hidden?" "+s._hidden.id:"")})}function k(){s.$root.on({focusin:function(a){s.$root.removeClass(p.focused),c(s.$root[0],"selected",!1),a.stopPropagation()},"mousedown click":function(b){var c=b.target;c!=s.$root.children()[0]&&(b.stopPropagation(),"mousedown"!=b.type||a(c).is(":input")||"OPTION"==c.nodeName||(b.preventDefault(),d.focus()))}}).on("click","[data-pick], [data-nav], [data-clear]",function(){var c=a(this),e=c.data(),f=c.hasClass(p.navDisabled)||c.hasClass(p.disabled),g=document.activeElement;g=g&&(g.type||g.href),(f||g&&!a.contains(s.$root[0],g))&&d.focus(),e.nav&&!f?s.set("highlight",s.component.item.highlight,{nav:e.nav}):b._.isInteger(e.pick)&&!f?s.set("select",e.pick).close(!0):e.clear&&s.clear().close(!0)}),c(s.$root[0],"hidden",!0)}function l(){var b=["string"==typeof o.hiddenPrefix?o.hiddenPrefix:"","string"==typeof o.hiddenSuffix?o.hiddenSuffix:"_submit"];s._hidden=a('")[0],q.on("change."+n.id,function(){s._hidden.value=d.value?s.get("select",o.formatSubmit):""}).after(s._hidden)}function m(a){a.stopPropagation(),"focus"==a.type&&(s.$root.addClass(p.focused),c(s.$root[0],"selected",!0)),s.open()}if(!d)return b;var n={id:"P"+Math.abs(~~(Math.random()*new Date))},o=g?a.extend(!0,{},g.defaults,h):h||{},p=a.extend({},b.klasses(),o.klass),q=a(d),r=function(){return this.start()},s=r.prototype={constructor:r,$node:q,start:function(){return n&&n.start?s:(n.methods={},n.start=!0,n.open=!1,n.type=d.type,d.autofocus=d==document.activeElement,d.type="text",d.readOnly=!o.editable,d.id=d.id||n.id,s.component=new g(s,o),s.$root=a(b._.node("div",i(),p.picker,'id="'+d.id+'_root"')),k(),o.formatSubmit&&l(),j(),o.container?a(o.container).append(s.$root):q.after(s.$root),s.on({start:s.component.onStart,render:s.component.onRender,stop:s.component.onStop,open:s.component.onOpen,close:s.component.onClose,set:s.component.onSet}).on({start:o.onStart,render:o.onRender,stop:o.onStop,open:o.onOpen,close:o.onClose,set:o.onSet}),d.autofocus&&s.open(),s.trigger("start").trigger("render"))},render:function(a){return a?s.$root.html(i()):s.$root.find("."+p.box).html(s.component.nodes(n.open)),s.trigger("render")},stop:function(){return n.start?(s.close(),s._hidden&&s._hidden.parentNode.removeChild(s._hidden),s.$root.remove(),q.removeClass(p.input).removeData(e),setTimeout(function(){q.off("."+n.id)},0),d.type=n.type,d.readOnly=!1,s.trigger("stop"),n.methods={},n.start=!1,s):s},open:function(e){return n.open?s:(q.addClass(p.active),c(d,"expanded",!0),s.$root.addClass(p.opened),c(s.$root[0],"hidden",!1),e!==!1&&(n.open=!0,q.trigger("focus"),f.on("click."+n.id+" focusin."+n.id,function(a){var b=a.target;b!=d&&b!=document&&s.close(b===s.$root.children()[0])}).on("keydown."+n.id,function(c){var e=c.keyCode,f=s.component.key[e],g=c.target;27==e?s.close(!0):g!=d||!f&&13!=e?a.contains(s.$root[0],g)&&13==e&&(c.preventDefault(),g.click()):(c.preventDefault(),f?b._.trigger(s.component.key.go,s,[b._.trigger(f)]):s.$root.find("."+p.highlighted).hasClass(p.disabled)||s.set("select",s.component.item.highlight).close())})),s.trigger("open"))},close:function(a){return a&&(q.off("focus."+n.id).trigger("focus"),setTimeout(function(){q.on("focus."+n.id,m)},0)),q.removeClass(p.active),c(d,"expanded",!1),s.$root.removeClass(p.opened+" "+p.focused),c(s.$root[0],"hidden",!0),c(s.$root[0],"selected",!1),n.open?(n.open=!1,f.off("."+n.id),s.trigger("close")):s},clear:function(){return s.set("clear")},set:function(b,c,d){var e,f,g=a.isPlainObject(b),h=g?b:{};if(d=g&&a.isPlainObject(c)?c:d||{},b){g||(h[b]=c);for(e in h)f=h[e],s.component.item[e]&&s.component.set(e,f,d),("select"==e||"clear"==e)&&q.val("clear"==e?"":s.get(e,o.format)).trigger("change");s.render()}return d.muted?s:s.trigger("set",h)},get:function(a,c){return a=a||"value",null!=n[a]?n[a]:"value"==a?d.value:s.component.item[a]?"string"==typeof c?b._.trigger(s.component.formats.toString,s.component,[c,s.component.get(a)]):s.component.get(a):void 0},on:function(b,c){var d,e,f=a.isPlainObject(b),g=f?b:{};if(b){f||(g[b]=c);for(d in g)e=g[d],n.methods[d]=n.methods[d]||[],n.methods[d].push(e)}return s},trigger:function(a,c){var d=n.methods[a];return d&&d.map(function(a){b._.trigger(a,s,[c])}),s}};return new r}function c(b,c,e){if(a.isPlainObject(c))for(var f in c)d(b,f,c[f]);else d(b,c,e)}function d(a,b,c){a.setAttribute(("role"==b?"":"aria-")+b,c)}function e(b,c){a.isPlainObject(b)||(b={attribute:c}),c="";for(var d in b){var e=("role"==d?"":"aria-")+d,f=b[d];c+=null==f?"":e+'="'+b[d]+'"'}return c}var f=a(document);return b.klasses=function(a){return a=a||"picker",{picker:a,opened:a+"--opened",focused:a+"--focused",input:a+"__input",active:a+"__input--active",holder:a+"__holder",frame:a+"__frame",wrap:a+"__wrap",box:a+"__box"}},b._={group:function(a){for(var c,d="",e=b._.trigger(a.min,a);e<=b._.trigger(a.max,a,[e]);e+=a.i)c=b._.trigger(a.item,a,[e]),d+=b._.node(a.node,c[0],c[1],c[2]);return d},node:function(b,c,d,e){return c?(c=a.isArray(c)?c.join(""):c,d=d?' class="'+d+'"':"",e=e?" "+e:"","<"+b+d+e+">"+c+""):""},lead:function(a){return(10>a?"0":"")+a},trigger:function(a,b,c){return"function"==typeof a?a.apply(b,c||[]):a},digits:function(a){return/\d/.test(a[1])?2:1},isDate:function(a){return{}.toString.call(a).indexOf("Date")>-1&&this.isInteger(a.getDate())},isInteger:function(a){return{}.toString.call(a).indexOf("Number")>-1&&a%1===0},ariaAttr:e},b.extend=function(c,d){a.fn[c]=function(e,f){var g=this.data(c);return"picker"==e?g:g&&"string"==typeof e?(b._.trigger(g[e],g,[f]),this):this.each(function(){var f=a(this);f.data(c)||new b(this,c,d,e)})},a.fn[c].defaults=d.defaults},b}); \ No newline at end of file diff --git a/lib/compressed/picker.time.js b/lib/compressed/picker.time.js index 5bd0d72d..b96960e0 100644 --- a/lib/compressed/picker.time.js +++ b/lib/compressed/picker.time.js @@ -1,5 +1,5 @@ /*! - * Time picker for pickadate.js v3.3.2 + * Time picker for pickadate.js v3.4.0 * http://amsul.github.io/pickadate.js/time.htm */ -!function(a){"function"==typeof define&&define.amd?define(["picker","jquery"],a):a(Picker,jQuery)}(function(a,b){function c(a,b){var c=this,d=a.$node.data("value");c.settings=b,c.queue={interval:"i",min:"measure create",max:"measure create",now:"now create",select:"parse create validate",highlight:"create validate",view:"create validate",disable:"flipItem",enable:"flipItem"},c.item={},c.item.interval=b.interval||30,c.item.disable=(b.disable||[]).slice(0),c.item.enable=-function(a){return a[0]===!0?a.shift():-1}(c.item.disable),c.set("min",b.min).set("max",b.max).set("now").set("select",d||a.$node[0].value||c.item.min,{format:d?b.formatSubmit:b.format}),c.key={40:1,38:-1,39:1,37:-1,go:function(a){c.set("highlight",c.item.highlight.pick+a*c.item.interval,{interval:a*c.item.interval}),this.render()}},a.on("render",function(){var c=a.$root.children(),d=c.find("."+b.klass.viewset);d.length&&(c[0].scrollTop=~~d.position().top-2*d[0].clientHeight)}).on("open",function(){a.$root.find("button").attr("disable",!1)}).on("close",function(){a.$root.find("button").attr("disable",!0)})}var d=24,e=60,f=12,g=d*e;c.prototype.set=function(a,b,c){var d=this;return d.item["enable"==a?"disable":"flip"==a?"enable":a]=d.queue[a].split(" ").map(function(e){return b=d[e](a,b,c)}).pop(),"select"==a?d.set("highlight",d.item.select,c):"highlight"==a?d.set("view",d.item.highlight,c):"interval"==a?d.set("min",d.item.min,c).set("max",d.item.max,c):("flip"==a||"min"==a||"max"==a||"disable"==a||"enable"==a)&&d.item.select&&d.item.highlight&&("min"==a&&d.set("max",d.item.max,c),d.set("select",d.item.select,c).set("highlight",d.item.highlight,c)),d},c.prototype.get=function(a){return this.item[a]},c.prototype.create=function(c,f,h){var i=this;return f=void 0===f?c:f,a._.isDate(f)&&(f=[f.getHours(),f.getMinutes()]),b.isPlainObject(f)&&a._.isInteger(f.pick)?f=f.pick:b.isArray(f)?f=+f[0]*e+ +f[1]:a._.isInteger(f)||(f=i.now(c,f,h)),"max"==c&&fc&&0===f?2:1:c=1,c*this.item.interval+f},c.prototype.normalize=function(a,b){var c=this.item.interval,d="min"==a?0:(b-this.item.min.pick)%c;return b-(d+(0>b?c:0))},c.prototype.measure=function(c,f,g){var h=this;return f?f===!0||a._.isInteger(f)?f=h.now(c,f,g):b.isPlainObject(f)&&a._.isInteger(f.pick)&&(f=h.normalize(c,f.pick,g)):f="min"==c?[0,0]:[d-1,e-1],f},c.prototype.validate=function(a,b,c){var d=this,e=c&&c.interval?c.interval:d.item.interval;return d.disabled(b)&&(b=d.shift(b,e)),b=d.scope(b),d.disabled(b)&&(b=d.shift(b,-1*e)),b},c.prototype.disabled=function(c){var d=this,e=d.item.disable.filter(function(e){return a._.isInteger(e)?c.hour==e:b.isArray(e)||a._.isDate(e)?c.pick==d.create(e).pick:void 0});return e=e.length&&!e.filter(function(a){return b.isArray(a)&&"inverted"==a[2]}).length,-1===d.item.enable?!e:e||c.pickd.item.max.pick},c.prototype.shift=function(a,b){var c=this,d=c.item.min.pick,e=c.item.max.pick;for(b=b||c.item.interval;c.disabled(a)&&(a=c.create(a.pick+=b),!(a.pick<=d||a.pick>=e)););return a},c.prototype.scope=function(a){var b=this.item.min.pick,c=this.item.max.pick;return this.create(a.pick>c?c:a.pickb.time%g?"a.m.":"p.m."},A:function(a,b){return a?2:g/2>b.time%g?"AM":"PM"},toArray:function(a){return a.split(/(h{1,2}|H{1,2}|i|a|A|!.)/g)},toString:function(b,c){var d=this;return d.formats.toArray(b).map(function(b){return a._.trigger(d.formats[b],d,[0,c])||b.replace(/^!/,"")}).join("")}},c.prototype.flipItem=function(a,c){var d=this,e=d.item.disable,f=-1===d.item.enable;return"flip"==c?d.item.enable=f?1:-1:"enable"==a&&c===!0||"disable"==a&&c===!1?(d.item.enable=1,e=[]):"enable"==a&&c===!1||"disable"==a&&c===!0?(d.item.enable=-1,e=[]):b.isArray(c)&&(f&&"enable"==a||!f&&"disable"==a?e=d.addDisabled(e,c):f||"enable"!=a?f&&"disable"==a&&(e=d.removeDisabled(e,c)):e=d.addEnabled(e,c)),e},c.prototype.addEnabled=function(c,d){var e=this;return d.map(function(d){e.filterDisabled(c,d,1).length&&(c=e.removeDisabled(c,[d]),b.isArray(d)&&c.filter(function(b){return a._.isInteger(b)&&e.create(d).hour===b}).length&&(d=d.slice(0),d.push("inverted"),c.push(d)))}),c},c.prototype.addDisabled=function(a,c){var d=this;return c.map(function(c){d.filterDisabled(a,c).length?b.isArray(c)&&d.filterDisabled(a,c,1).length&&(a=d.removeDisabled(a,[c])):a.push(c)}),a},c.prototype.removeDisabled=function(a,b){var c=this;return b.map(function(b){a=c.filterDisabled(a,b,1)}),a},c.prototype.filterDisabled=function(a,c,d){var e=b.isArray(c);return a.filter(function(a){var f=!e&&c===a||e&&b.isArray(a)&&c.toString()===a.toString();return d?!f:f})},c.prototype.i=function(b,c){return a._.isInteger(c)&&c>0?c:this.item.interval},c.prototype.nodes=function(b){var c=this,d=c.settings,e=c.item.select,f=c.item.highlight,g=c.item.view,h=c.item.disable;return a._.node("ul",a._.group({min:c.item.min.pick,max:c.item.max.pick,i:c.item.interval,node:"li",item:function(b){return b=c.create(b),[a._.trigger(c.formats.toString,c,[a._.trigger(d.formatLabel,c,[b])||d.format,b]),function(a,i){return e&&e.pick==i&&a.push(d.klass.selected),f&&f.pick==i&&a.push(d.klass.highlighted),g&&g.pick==i&&a.push(d.klass.viewset),h&&c.disabled(b)&&a.push(d.klass.disabled),a.join(" ")}([d.klass.listItem],b.pick),"data-pick="+b.pick]}})+a._.node("li",a._.node("button",d.clear,d.klass.buttonClear,"type=button data-clear=1"+(b?"":" disable"))),d.klass.list)},c.defaults=function(a){return{clear:"Clear",format:"h:i A",interval:30,klass:{picker:a+" "+a+"--time",holder:a+"__holder",list:a+"__list",listItem:a+"__list-item",disabled:a+"__list-item--disabled",selected:a+"__list-item--selected",highlighted:a+"__list-item--highlighted",viewset:a+"__list-item--viewset",now:a+"__list-item--now",buttonClear:a+"__button--clear"}}}(a.klasses().picker),a.extend("pickatime",c)}); \ No newline at end of file +!function(a){"function"==typeof define&&define.amd?define(["picker","jquery"],a):a(Picker,jQuery)}(function(a,b){function c(a,b){var c=this,d=a.$node[0].value,e=a.$node.data("value"),f=e||d,g=e?b.formatSubmit:b.format;c.settings=b,c.$node=a.$node,c.queue={interval:"i",min:"measure create",max:"measure create",now:"now create",select:"parse create validate",highlight:"create validate",view:"create validate",disable:"flipItem",enable:"flipItem"},c.item={},c.item.interval=b.interval||30,c.item.disable=(b.disable||[]).slice(0),c.item.enable=-function(a){return a[0]===!0?a.shift():-1}(c.item.disable),c.set("min",b.min).set("max",b.max).set("now").set("select",f||c.item.min,{format:g}),c.key={40:1,38:-1,39:1,37:-1,go:function(a){c.set("highlight",c.item.highlight.pick+a*c.item.interval,{interval:a*c.item.interval}),this.render()}},a.on("render",function(){var c=a.$root.children(),d=c.find("."+b.klass.viewset);d.length&&(c[0].scrollTop=~~d.position().top-2*d[0].clientHeight)}).on("open",function(){a.$root.find("button").attr("disable",!1)}).on("close",function(){a.$root.find("button").attr("disable",!0)})}var d=24,e=60,f=12,g=d*e;c.prototype.set=function(a,b,c){var d=this;return d.item["enable"==a?"disable":"flip"==a?"enable":a]=d.queue[a].split(" ").map(function(e){return b=d[e](a,b,c)}).pop(),"select"==a?d.set("highlight",d.item.select,c):"highlight"==a?d.set("view",d.item.highlight,c):"interval"==a?d.set("min",d.item.min,c).set("max",d.item.max,c):("flip"==a||"min"==a||"max"==a||"disable"==a||"enable"==a)&&d.item.select&&d.item.highlight&&("min"==a&&d.set("max",d.item.max,c),d.set("select",d.item.select,c).set("highlight",d.item.highlight,c)),d},c.prototype.get=function(a){return this.item[a]},c.prototype.create=function(c,f,h){var i=this;return f=void 0===f?c:f,a._.isDate(f)&&(f=[f.getHours(),f.getMinutes()]),b.isPlainObject(f)&&a._.isInteger(f.pick)?f=f.pick:b.isArray(f)?f=+f[0]*e+ +f[1]:a._.isInteger(f)||(f=i.now(c,f,h)),"max"==c&&fc&&0>g&&"max"!=b?c+1:c)),g},c.prototype.normalize=function(a,b){var c=this.item.interval,d="min"==a?0:(b-this.item.min.pick)%c;return b-(d+(0>b?c:0))},c.prototype.measure=function(c,f,g){var h=this;return f?f===!0||a._.isInteger(f)?f=h.now(c,f,g):b.isPlainObject(f)&&a._.isInteger(f.pick)&&(f=h.normalize(c,f.pick,g)):f="min"==c?[0,0]:[d-1,e-1],f},c.prototype.validate=function(a,b,c){var d=this,e=c&&c.interval?c.interval:d.item.interval;return d.disabled(b)&&(b=d.shift(b,e)),b=d.scope(b),d.disabled(b)&&(b=d.shift(b,-1*e)),b},c.prototype.disabled=function(c){var d=this,e=d.item.disable.filter(function(e){return a._.isInteger(e)?c.hour==e:b.isArray(e)||a._.isDate(e)?c.pick==d.create(e).pick:void 0});return e=e.length&&!e.filter(function(a){return b.isArray(a)&&"inverted"==a[2]}).length,-1===d.item.enable?!e:e||c.pickd.item.max.pick},c.prototype.shift=function(a,b){var c=this,d=c.item.min.pick,e=c.item.max.pick;for(b=b||c.item.interval;c.disabled(a)&&(a=c.create(a.pick+=b),!(a.pick<=d||a.pick>=e)););return a},c.prototype.scope=function(a){var b=this.item.min.pick,c=this.item.max.pick;return this.create(a.pick>c?c:a.pickb.time%g?"a.m.":"p.m."},A:function(a,b){return a?2:g/2>b.time%g?"AM":"PM"},toArray:function(a){return a.split(/(h{1,2}|H{1,2}|i|a|A|!.)/g)},toString:function(b,c){var d=this;return d.formats.toArray(b).map(function(b){return a._.trigger(d.formats[b],d,[0,c])||b.replace(/^!/,"")}).join("")}},c.prototype.flipItem=function(a,c){var d=this,e=d.item.disable,f=-1===d.item.enable;return"flip"==c?d.item.enable=f?1:-1:"enable"==a&&c===!0||"disable"==a&&c===!1?(d.item.enable=1,e=[]):"enable"==a&&c===!1||"disable"==a&&c===!0?(d.item.enable=-1,e=[]):b.isArray(c)&&(f&&"enable"==a||!f&&"disable"==a?e=d.addDisabled(e,c):f||"enable"!=a?f&&"disable"==a&&(e=d.removeDisabled(e,c)):e=d.addEnabled(e,c)),e},c.prototype.addEnabled=function(c,d){var e=this;return d.map(function(d){e.filterDisabled(c,d,1).length&&(c=e.removeDisabled(c,[d]),b.isArray(d)&&c.filter(function(b){return a._.isInteger(b)&&e.create(d).hour===b}).length&&(d=d.slice(0),d.push("inverted"),c.push(d)))}),c},c.prototype.addDisabled=function(a,c){var d=this;return c.map(function(c){d.filterDisabled(a,c).length?b.isArray(c)&&d.filterDisabled(a,c,1).length&&(a=d.removeDisabled(a,[c])):a.push(c)}),a},c.prototype.removeDisabled=function(a,b){var c=this;return b.map(function(b){a=c.filterDisabled(a,b,1)}),a},c.prototype.filterDisabled=function(a,c,d){var e=b.isArray(c);return a.filter(function(a){var f=!e&&c===a||e&&b.isArray(a)&&c.toString()===a.toString();return d?!f:f})},c.prototype.i=function(b,c){return a._.isInteger(c)&&c>0?c:this.item.interval},c.prototype.nodes=function(b){var c=this,d=c.settings,e=c.item.select,f=c.item.highlight,g=c.item.view,h=c.item.disable;return a._.node("ul",a._.group({min:c.item.min.pick,max:c.item.max.pick,i:c.item.interval,node:"li",item:function(b){b=c.create(b);var i=b.pick,j=e&&e.pick==i,k=f&&f.pick==i,l=h&&c.disabled(b);return[a._.trigger(c.formats.toString,c,[a._.trigger(d.formatLabel,c,[b])||d.format,b]),function(a){return j&&a.push(d.klass.selected),k&&a.push(d.klass.highlighted),g&&g.pick==i&&a.push(d.klass.viewset),l&&a.push(d.klass.disabled),a.join(" ")}([d.klass.listItem]),"data-pick="+b.pick+" "+a._.ariaAttr({role:"button",controls:c.$node[0].id,checked:j&&c.$node.val()===a._.trigger(c.formats.toString,c,[d.format,b])?!0:null,activedescendant:k?!0:null,disabled:l?!0:null})]}})+a._.node("li",a._.node("button",d.clear,d.klass.buttonClear,"type=button data-clear=1"+(b?"":" disable"))),d.klass.list)},c.defaults=function(a){return{clear:"Clear",format:"h:i A",interval:30,klass:{picker:a+" "+a+"--time",holder:a+"__holder",list:a+"__list",listItem:a+"__list-item",disabled:a+"__list-item--disabled",selected:a+"__list-item--selected",highlighted:a+"__list-item--highlighted",viewset:a+"__list-item--viewset",now:a+"__list-item--now",buttonClear:a+"__button--clear"}}}(a.klasses().picker),a.extend("pickatime",c)}); \ No newline at end of file diff --git a/lib/compressed/themes/classic.date.css b/lib/compressed/themes/classic.date.css index 84bda75a..3bcea212 100644 --- a/lib/compressed/themes/classic.date.css +++ b/lib/compressed/themes/classic.date.css @@ -1 +1 @@ -.picker__box{padding:0 1em}.picker__header{text-align:center;position:relative;margin-top:.75em}.picker__month,.picker__year{font-weight:500;display:inline-block;margin-left:.25em;margin-right:.25em}.picker__year{color:#999;font-size:.8em;font-style:italic}.picker__select--month,.picker__select--year{border:1px solid #b7b7b7;height:2.5em;padding:.5em .25em;margin-left:.25em;margin-right:.25em;font-size:.6em}@media (min-width:24.5em){.picker__select--month,.picker__select--year{font-size:.8em;margin-top:-.5em}}.picker__select--month{width:35%}.picker__select--year{width:22.5%}.picker__select--month:focus,.picker__select--year:focus{border-color:#0089ec}.picker__nav--prev,.picker__nav--next{position:absolute;padding:.5em 1.25em;width:1em;height:1em;top:-.25em}@media (min-width:24.5em){.picker__nav--prev,.picker__nav--next{top:-.33em}}.picker__nav--prev{left:-1em;padding-right:1.25em}@media (min-width:24.5em){.picker__nav--prev{padding-right:1.5em}}.picker__nav--next{right:-1em;padding-left:1.25em}@media (min-width:24.5em){.picker__nav--next{padding-left:1.5em}}.picker__nav--prev:before,.picker__nav--next:before{content:" ";border-top:.5em solid transparent;border-bottom:.5em solid transparent;border-right:.75em solid #000;width:0;height:0;display:block;margin:0 auto}.picker__nav--next:before{border-right:0;border-left:.75em solid #000}.picker__nav--prev:hover,.picker__nav--next:hover{cursor:pointer;color:#000;background:#b1dcfb}.picker__nav--disabled,.picker__nav--disabled:hover,.picker__nav--disabled:before,.picker__nav--disabled:before:hover{cursor:default;background:0 0;border-right-color:#f5f5f5;border-left-color:#f5f5f5}.picker__table{text-align:center;border-collapse:collapse;border-spacing:0;table-layout:fixed;font-size:inherit;width:100%;margin-top:.75em;margin-bottom:.5em}@media (min-height:33.875em){.picker__table{margin-bottom:.75em}}.picker__table td{margin:0;padding:0}.picker__weekday{width:14.285714286%;font-size:.75em;padding-bottom:.25em;color:#999;font-weight:500}@media (min-height:33.875em){.picker__weekday{padding-bottom:.5em}}.picker__day{padding:.3125em 0;font-weight:200;border:1px solid transparent}.picker__day--today{color:#0089ec;position:relative}.picker__day--today:before{content:" ";position:absolute;top:2px;right:2px;width:0;height:0;border-top:.5em solid #0059bc;border-left:.5em solid transparent}.picker__day--selected,.picker__day--selected:hover{border-color:#0089ec}.picker__day--highlighted{background:#b1dcfb}.picker__day--disabled:before{border-top-color:#aaa}.picker__day--outfocus{color:#ddd}.picker__day--infocus:hover,.picker__day--outfocus:hover{cursor:pointer;color:#000;background:#b1dcfb}.picker__day--highlighted:hover,.picker--focused .picker__day--highlighted{background:#0089ec;color:#fff}.picker__day--disabled,.picker__day--disabled:hover{background:#f5f5f5;border-color:#f5f5f5;color:#ddd;cursor:default}.picker__day--highlighted.picker__day--disabled,.picker__day--highlighted.picker__day--disabled:hover{background:#bbb}.picker__footer{text-align:center}.picker__button--today,.picker__button--clear{border:1px solid #fff;background:#fff;font-size:.8em;padding:.66em 0;font-weight:700;width:50%;display:inline-block;vertical-align:bottom}.picker__button--today:hover,.picker__button--clear:hover{cursor:pointer;color:#000;background:#b1dcfb;border-bottom-color:#b1dcfb}.picker__button--today:focus,.picker__button--clear:focus{background:#b1dcfb;border-color:#0089ec;outline:0}.picker__button--today:before,.picker__button--clear:before{position:relative;display:inline-block;height:0}.picker__button--today:before{content:" ";margin-right:.45em;top:-.05em;width:0;border-top:.66em solid #0059bc;border-left:.66em solid transparent}.picker__button--clear:before{content:"\D7";margin-right:.35em;top:-.1em;color:#e20;vertical-align:top;font-size:1.1em} \ No newline at end of file +.picker__box{padding:0 1em}.picker__header{text-align:center;position:relative;margin-top:.75em}.picker__month,.picker__year{font-weight:500;display:inline-block;margin-left:.25em;margin-right:.25em}.picker__year{color:#999;font-size:.8em;font-style:italic}.picker__select--month,.picker__select--year{border:1px solid #b7b7b7;height:2.5em;padding:.5em .25em;margin-left:.25em;margin-right:.25em;font-size:.6em}@media (min-width:24.5em){.picker__select--month,.picker__select--year{font-size:.8em;margin-top:-.5em}}.picker__select--month{width:35%}.picker__select--year{width:22.5%}.picker__select--month:focus,.picker__select--year:focus{border-color:#0089ec}.picker__nav--next,.picker__nav--prev{position:absolute;padding:.5em 1.25em;width:1em;height:1em;top:-.25em}@media (min-width:24.5em){.picker__nav--next,.picker__nav--prev{top:-.33em}}.picker__nav--prev{left:-1em;padding-right:1.25em}@media (min-width:24.5em){.picker__nav--prev{padding-right:1.5em}}.picker__nav--next{right:-1em;padding-left:1.25em}@media (min-width:24.5em){.picker__nav--next{padding-left:1.5em}}.picker__nav--next:before,.picker__nav--prev:before{content:" ";border-top:.5em solid transparent;border-bottom:.5em solid transparent;border-right:.75em solid #000;width:0;height:0;display:block;margin:0 auto}.picker__nav--next:before{border-right:0;border-left:.75em solid #000}.picker__nav--next:hover,.picker__nav--prev:hover{cursor:pointer;color:#000;background:#b1dcfb}.picker__nav--disabled,.picker__nav--disabled:before,.picker__nav--disabled:before:hover,.picker__nav--disabled:hover{cursor:default;background:0 0;border-right-color:#f5f5f5;border-left-color:#f5f5f5}.picker__table{text-align:center;border-collapse:collapse;border-spacing:0;table-layout:fixed;font-size:inherit;width:100%;margin-top:.75em;margin-bottom:.5em}@media (min-height:33.875em){.picker__table{margin-bottom:.75em}}.picker__table td{margin:0;padding:0}.picker__weekday{width:14.285714286%;font-size:.75em;padding-bottom:.25em;color:#999;font-weight:500}@media (min-height:33.875em){.picker__weekday{padding-bottom:.5em}}.picker__day{padding:.3125em 0;font-weight:200;border:1px solid transparent}.picker__day--today{color:#0089ec;position:relative}.picker__day--today:before{content:" ";position:absolute;top:2px;right:2px;width:0;height:0;border-top:.5em solid #0059bc;border-left:.5em solid transparent}.picker__day--selected,.picker__day--selected:hover{border-color:#0089ec}.picker__day--highlighted{background:#b1dcfb}.picker__day--disabled:before{border-top-color:#aaa}.picker__day--outfocus{color:#ddd}.picker__day--infocus:hover,.picker__day--outfocus:hover{cursor:pointer;color:#000;background:#b1dcfb}.picker--focused .picker__day--highlighted,.picker__day--highlighted:hover{background:#0089ec;color:#fff}.picker__day--disabled,.picker__day--disabled:hover{background:#f5f5f5;border-color:#f5f5f5;color:#ddd;cursor:default}.picker__day--highlighted.picker__day--disabled,.picker__day--highlighted.picker__day--disabled:hover{background:#bbb}.picker__footer{text-align:center}.picker__button--clear,.picker__button--today{border:1px solid #fff;background:#fff;font-size:.8em;padding:.66em 0;font-weight:700;width:50%;display:inline-block;vertical-align:bottom}.picker__button--clear:hover,.picker__button--today:hover{cursor:pointer;color:#000;background:#b1dcfb;border-bottom-color:#b1dcfb}.picker__button--clear:focus,.picker__button--today:focus{background:#b1dcfb;border-color:#0089ec;outline:0}.picker__button--clear:before,.picker__button--today:before{position:relative;display:inline-block;height:0}.picker__button--today:before{content:" ";margin-right:.45em;top:-.05em;width:0;border-top:.66em solid #0059bc;border-left:.66em solid transparent}.picker__button--clear:before{content:"\D7";margin-right:.35em;top:-.1em;color:#e20;vertical-align:top;font-size:1.1em} \ No newline at end of file diff --git a/lib/compressed/themes/classic.time.css b/lib/compressed/themes/classic.time.css index 6ea61837..4e217867 100644 --- a/lib/compressed/themes/classic.time.css +++ b/lib/compressed/themes/classic.time.css @@ -1 +1 @@ -.picker__list{list-style:none;padding:.75em 0 4.2em;margin:0}.picker__list-item{border-bottom:1px solid #ddd;border-top:1px solid #ddd;margin-bottom:-1px;position:relative;background:#fff;padding:.75em 1.25em}@media (min-height:46.75em){.picker__list-item{padding:.5em 1em}}.picker__list-item:hover{cursor:pointer;color:#000;background:#b1dcfb;border-color:#0089ec;z-index:10}.picker__list-item--selected,.picker__list-item--selected:hover{border-color:#0089ec;z-index:10}.picker__list-item--highlighted{background:#b1dcfb}.picker__list-item--highlighted:hover,.picker--focused .picker__list-item--highlighted{background:#0089ec;color:#fff}.picker__list-item--disabled,.picker__list-item--disabled:hover,.picker--focused .picker__list-item--disabled{background:#f5f5f5;border-color:#f5f5f5;color:#ddd;cursor:default;border-color:#ddd;z-index:auto}.picker--time .picker__button--clear{display:block;width:80%;margin:1em auto 0;padding:1em 1.25em;background:0 0;border:0;font-weight:500;font-size:.67em;text-align:center;text-transform:uppercase;color:#666}.picker--time .picker__button--clear:hover,.picker--time .picker__button--clear:focus{color:#000;background:#b1dcfb;background:#e20;border-color:#e20;cursor:pointer;color:#fff;outline:0}.picker--time .picker__button--clear:before{top:-.25em;color:#666;font-size:1.25em;font-weight:700}.picker--time .picker__button--clear:hover:before,.picker--time .picker__button--clear:focus:before{color:#fff}.picker--time{min-width:256px;max-width:320px}.picker--time .picker__holder{background:#f2f2f2}@media (min-height:40.125em){.picker--time .picker__holder{font-size:.875em}}.picker--time .picker__box{padding:0;position:relative} \ No newline at end of file +.picker__list{list-style:none;padding:.75em 0 4.2em;margin:0}.picker__list-item{border-bottom:1px solid #ddd;border-top:1px solid #ddd;margin-bottom:-1px;position:relative;background:#fff;padding:.75em 1.25em}@media (min-height:46.75em){.picker__list-item{padding:.5em 1em}}.picker__list-item:hover{cursor:pointer;color:#000;background:#b1dcfb;border-color:#0089ec;z-index:10}.picker__list-item--selected,.picker__list-item--selected:hover{border-color:#0089ec;z-index:10}.picker__list-item--highlighted{background:#b1dcfb}.picker--focused .picker__list-item--highlighted,.picker__list-item--highlighted:hover{background:#0089ec;color:#fff}.picker--focused .picker__list-item--disabled,.picker__list-item--disabled,.picker__list-item--disabled:hover{background:#f5f5f5;color:#ddd;cursor:default;border-color:#ddd;z-index:auto}.picker--time .picker__button--clear{display:block;width:80%;margin:1em auto 0;padding:1em 1.25em;background:0 0;border:0;font-weight:500;font-size:.67em;text-align:center;text-transform:uppercase;color:#666}.picker--time .picker__button--clear:focus,.picker--time .picker__button--clear:hover{background:#b1dcfb;background:#e20;border-color:#e20;cursor:pointer;color:#fff;outline:0}.picker--time .picker__button--clear:before{top:-.25em;color:#666;font-size:1.25em;font-weight:700}.picker--time .picker__button--clear:focus:before,.picker--time .picker__button--clear:hover:before{color:#fff}.picker--time{min-width:256px;max-width:320px}.picker--time .picker__holder{background:#f2f2f2}@media (min-height:40.125em){.picker--time .picker__holder{font-size:.875em}}.picker--time .picker__box{padding:0;position:relative} \ No newline at end of file diff --git a/lib/compressed/themes/default.css b/lib/compressed/themes/default.css index 894a4afb..2dd16bb3 100644 --- a/lib/compressed/themes/default.css +++ b/lib/compressed/themes/default.css @@ -1,4 +1,4 @@ .picker{font-size:16px;text-align:left;line-height:1.2;color:#000;position:absolute;z-index:10000;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.picker__input{cursor:default}.picker__input.picker__input--active{border-color:#0089ec}.picker__holder{width:100%;overflow-y:auto;-webkit-overflow-scrolling:touch}/*! * Default mobile-first, responsive styling for pickadate.js * Demo: http://amsul.github.io/pickadate.js - */.picker__holder,.picker__frame{bottom:0;left:0;right:0;top:100%}.picker__holder{position:fixed;-webkit-transition:background .15s ease-out,top 0s .15s;-moz-transition:background .15s ease-out,top 0s .15s;transition:background .15s ease-out,top 0s .15s}.picker__frame{position:absolute;margin:0 auto;min-width:256px;max-width:666px;width:100%;-ms-filter:"alpha(Opacity=0)";filter:alpha(opacity=0);-moz-opacity:0;opacity:0;-webkit-transition:all .15s ease-out;-moz-transition:all .15s ease-out;transition:all .15s ease-out}@media (min-height:33.875em){.picker__frame{overflow:visible;top:auto;bottom:-100%;max-height:80%}}@media (min-height:40.125em){.picker__frame{margin-bottom:7.5%}}.picker__wrap{display:table;width:100%;height:100%}@media (min-height:33.875em){.picker__wrap{display:block}}.picker__box{background:#fff;display:table-cell;vertical-align:middle}@media (min-height:26.5em){.picker__box{font-size:1.25em}}@media (min-height:33.875em){.picker__box{display:block;font-size:1.33em;border:1px solid #777;border-top-color:#898989;border-bottom-width:0;-webkit-border-radius:5px 5px 0 0;-moz-border-radius:5px 5px 0 0;border-radius:5px 5px 0 0;-webkit-box-shadow:0 12px 36px 16px rgba(0,0,0,.24);-moz-box-shadow:0 12px 36px 16px rgba(0,0,0,.24);box-shadow:0 12px 36px 16px rgba(0,0,0,.24)}}@media (min-height:40.125em){.picker__box{font-size:1.5em;border-bottom-width:1px;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px}}.picker--opened .picker__holder{top:0;background:transparent;-ms-filter:"progid:DXImageTransform.Microsoft.gradient(startColorstr=#1E000000,endColorstr=#1E000000)";zoom:1;background:rgba(0,0,0,.32);-webkit-transition:background .15s ease-out;-moz-transition:background .15s ease-out;transition:background .15s ease-out}.picker--opened .picker__frame{top:0;-ms-filter:"alpha(Opacity=100)";filter:alpha(opacity=100);-moz-opacity:1;opacity:1}@media (min-height:33.875em){.picker--opened .picker__frame{top:auto;bottom:0}} \ No newline at end of file + */.picker__frame,.picker__holder{bottom:0;left:0;right:0;top:100%}.picker__holder{position:fixed;-webkit-transition:background .15s ease-out,top 0s .15s;-moz-transition:background .15s ease-out,top 0s .15s;transition:background .15s ease-out,top 0s .15s}.picker__frame{position:absolute;margin:0 auto;min-width:256px;max-width:666px;width:100%;-ms-filter:"alpha(Opacity=0)";filter:alpha(opacity=0);-moz-opacity:0;opacity:0;-webkit-transition:all .15s ease-out;-moz-transition:all .15s ease-out;transition:all .15s ease-out}@media (min-height:33.875em){.picker__frame{overflow:visible;top:auto;bottom:-100%;max-height:80%}}@media (min-height:40.125em){.picker__frame{margin-bottom:7.5%}}.picker__wrap{display:table;width:100%;height:100%}@media (min-height:33.875em){.picker__wrap{display:block}}.picker__box{background:#fff;display:table-cell;vertical-align:middle}@media (min-height:26.5em){.picker__box{font-size:1.25em}}@media (min-height:33.875em){.picker__box{display:block;font-size:1.33em;border:1px solid #777;border-top-color:#898989;border-bottom-width:0;-webkit-border-radius:5px 5px 0 0;-moz-border-radius:5px 5px 0 0;border-radius:5px 5px 0 0;-webkit-box-shadow:0 12px 36px 16px rgba(0,0,0,.24);-moz-box-shadow:0 12px 36px 16px rgba(0,0,0,.24);box-shadow:0 12px 36px 16px rgba(0,0,0,.24)}}@media (min-height:40.125em){.picker__box{font-size:1.5em;border-bottom-width:1px;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px}}.picker--opened .picker__holder{top:0;zoom:1;background:rgba(0,0,0,.32);-webkit-transition:background .15s ease-out;-moz-transition:background .15s ease-out;transition:background .15s ease-out}.picker--opened .picker__frame{top:0;-ms-filter:"alpha(Opacity=100)";filter:alpha(opacity=100);-moz-opacity:1;opacity:1}@media (min-height:33.875em){.picker--opened .picker__frame{top:auto;bottom:0}} \ No newline at end of file diff --git a/lib/compressed/themes/default.date.css b/lib/compressed/themes/default.date.css index 84bda75a..3bcea212 100644 --- a/lib/compressed/themes/default.date.css +++ b/lib/compressed/themes/default.date.css @@ -1 +1 @@ -.picker__box{padding:0 1em}.picker__header{text-align:center;position:relative;margin-top:.75em}.picker__month,.picker__year{font-weight:500;display:inline-block;margin-left:.25em;margin-right:.25em}.picker__year{color:#999;font-size:.8em;font-style:italic}.picker__select--month,.picker__select--year{border:1px solid #b7b7b7;height:2.5em;padding:.5em .25em;margin-left:.25em;margin-right:.25em;font-size:.6em}@media (min-width:24.5em){.picker__select--month,.picker__select--year{font-size:.8em;margin-top:-.5em}}.picker__select--month{width:35%}.picker__select--year{width:22.5%}.picker__select--month:focus,.picker__select--year:focus{border-color:#0089ec}.picker__nav--prev,.picker__nav--next{position:absolute;padding:.5em 1.25em;width:1em;height:1em;top:-.25em}@media (min-width:24.5em){.picker__nav--prev,.picker__nav--next{top:-.33em}}.picker__nav--prev{left:-1em;padding-right:1.25em}@media (min-width:24.5em){.picker__nav--prev{padding-right:1.5em}}.picker__nav--next{right:-1em;padding-left:1.25em}@media (min-width:24.5em){.picker__nav--next{padding-left:1.5em}}.picker__nav--prev:before,.picker__nav--next:before{content:" ";border-top:.5em solid transparent;border-bottom:.5em solid transparent;border-right:.75em solid #000;width:0;height:0;display:block;margin:0 auto}.picker__nav--next:before{border-right:0;border-left:.75em solid #000}.picker__nav--prev:hover,.picker__nav--next:hover{cursor:pointer;color:#000;background:#b1dcfb}.picker__nav--disabled,.picker__nav--disabled:hover,.picker__nav--disabled:before,.picker__nav--disabled:before:hover{cursor:default;background:0 0;border-right-color:#f5f5f5;border-left-color:#f5f5f5}.picker__table{text-align:center;border-collapse:collapse;border-spacing:0;table-layout:fixed;font-size:inherit;width:100%;margin-top:.75em;margin-bottom:.5em}@media (min-height:33.875em){.picker__table{margin-bottom:.75em}}.picker__table td{margin:0;padding:0}.picker__weekday{width:14.285714286%;font-size:.75em;padding-bottom:.25em;color:#999;font-weight:500}@media (min-height:33.875em){.picker__weekday{padding-bottom:.5em}}.picker__day{padding:.3125em 0;font-weight:200;border:1px solid transparent}.picker__day--today{color:#0089ec;position:relative}.picker__day--today:before{content:" ";position:absolute;top:2px;right:2px;width:0;height:0;border-top:.5em solid #0059bc;border-left:.5em solid transparent}.picker__day--selected,.picker__day--selected:hover{border-color:#0089ec}.picker__day--highlighted{background:#b1dcfb}.picker__day--disabled:before{border-top-color:#aaa}.picker__day--outfocus{color:#ddd}.picker__day--infocus:hover,.picker__day--outfocus:hover{cursor:pointer;color:#000;background:#b1dcfb}.picker__day--highlighted:hover,.picker--focused .picker__day--highlighted{background:#0089ec;color:#fff}.picker__day--disabled,.picker__day--disabled:hover{background:#f5f5f5;border-color:#f5f5f5;color:#ddd;cursor:default}.picker__day--highlighted.picker__day--disabled,.picker__day--highlighted.picker__day--disabled:hover{background:#bbb}.picker__footer{text-align:center}.picker__button--today,.picker__button--clear{border:1px solid #fff;background:#fff;font-size:.8em;padding:.66em 0;font-weight:700;width:50%;display:inline-block;vertical-align:bottom}.picker__button--today:hover,.picker__button--clear:hover{cursor:pointer;color:#000;background:#b1dcfb;border-bottom-color:#b1dcfb}.picker__button--today:focus,.picker__button--clear:focus{background:#b1dcfb;border-color:#0089ec;outline:0}.picker__button--today:before,.picker__button--clear:before{position:relative;display:inline-block;height:0}.picker__button--today:before{content:" ";margin-right:.45em;top:-.05em;width:0;border-top:.66em solid #0059bc;border-left:.66em solid transparent}.picker__button--clear:before{content:"\D7";margin-right:.35em;top:-.1em;color:#e20;vertical-align:top;font-size:1.1em} \ No newline at end of file +.picker__box{padding:0 1em}.picker__header{text-align:center;position:relative;margin-top:.75em}.picker__month,.picker__year{font-weight:500;display:inline-block;margin-left:.25em;margin-right:.25em}.picker__year{color:#999;font-size:.8em;font-style:italic}.picker__select--month,.picker__select--year{border:1px solid #b7b7b7;height:2.5em;padding:.5em .25em;margin-left:.25em;margin-right:.25em;font-size:.6em}@media (min-width:24.5em){.picker__select--month,.picker__select--year{font-size:.8em;margin-top:-.5em}}.picker__select--month{width:35%}.picker__select--year{width:22.5%}.picker__select--month:focus,.picker__select--year:focus{border-color:#0089ec}.picker__nav--next,.picker__nav--prev{position:absolute;padding:.5em 1.25em;width:1em;height:1em;top:-.25em}@media (min-width:24.5em){.picker__nav--next,.picker__nav--prev{top:-.33em}}.picker__nav--prev{left:-1em;padding-right:1.25em}@media (min-width:24.5em){.picker__nav--prev{padding-right:1.5em}}.picker__nav--next{right:-1em;padding-left:1.25em}@media (min-width:24.5em){.picker__nav--next{padding-left:1.5em}}.picker__nav--next:before,.picker__nav--prev:before{content:" ";border-top:.5em solid transparent;border-bottom:.5em solid transparent;border-right:.75em solid #000;width:0;height:0;display:block;margin:0 auto}.picker__nav--next:before{border-right:0;border-left:.75em solid #000}.picker__nav--next:hover,.picker__nav--prev:hover{cursor:pointer;color:#000;background:#b1dcfb}.picker__nav--disabled,.picker__nav--disabled:before,.picker__nav--disabled:before:hover,.picker__nav--disabled:hover{cursor:default;background:0 0;border-right-color:#f5f5f5;border-left-color:#f5f5f5}.picker__table{text-align:center;border-collapse:collapse;border-spacing:0;table-layout:fixed;font-size:inherit;width:100%;margin-top:.75em;margin-bottom:.5em}@media (min-height:33.875em){.picker__table{margin-bottom:.75em}}.picker__table td{margin:0;padding:0}.picker__weekday{width:14.285714286%;font-size:.75em;padding-bottom:.25em;color:#999;font-weight:500}@media (min-height:33.875em){.picker__weekday{padding-bottom:.5em}}.picker__day{padding:.3125em 0;font-weight:200;border:1px solid transparent}.picker__day--today{color:#0089ec;position:relative}.picker__day--today:before{content:" ";position:absolute;top:2px;right:2px;width:0;height:0;border-top:.5em solid #0059bc;border-left:.5em solid transparent}.picker__day--selected,.picker__day--selected:hover{border-color:#0089ec}.picker__day--highlighted{background:#b1dcfb}.picker__day--disabled:before{border-top-color:#aaa}.picker__day--outfocus{color:#ddd}.picker__day--infocus:hover,.picker__day--outfocus:hover{cursor:pointer;color:#000;background:#b1dcfb}.picker--focused .picker__day--highlighted,.picker__day--highlighted:hover{background:#0089ec;color:#fff}.picker__day--disabled,.picker__day--disabled:hover{background:#f5f5f5;border-color:#f5f5f5;color:#ddd;cursor:default}.picker__day--highlighted.picker__day--disabled,.picker__day--highlighted.picker__day--disabled:hover{background:#bbb}.picker__footer{text-align:center}.picker__button--clear,.picker__button--today{border:1px solid #fff;background:#fff;font-size:.8em;padding:.66em 0;font-weight:700;width:50%;display:inline-block;vertical-align:bottom}.picker__button--clear:hover,.picker__button--today:hover{cursor:pointer;color:#000;background:#b1dcfb;border-bottom-color:#b1dcfb}.picker__button--clear:focus,.picker__button--today:focus{background:#b1dcfb;border-color:#0089ec;outline:0}.picker__button--clear:before,.picker__button--today:before{position:relative;display:inline-block;height:0}.picker__button--today:before{content:" ";margin-right:.45em;top:-.05em;width:0;border-top:.66em solid #0059bc;border-left:.66em solid transparent}.picker__button--clear:before{content:"\D7";margin-right:.35em;top:-.1em;color:#e20;vertical-align:top;font-size:1.1em} \ No newline at end of file diff --git a/lib/compressed/themes/default.time.css b/lib/compressed/themes/default.time.css index 40da7639..0009357a 100644 --- a/lib/compressed/themes/default.time.css +++ b/lib/compressed/themes/default.time.css @@ -1 +1 @@ -.picker__list{list-style:none;padding:.75em 0 4.2em;margin:0}.picker__list-item{border-bottom:1px solid #ddd;border-top:1px solid #ddd;margin-bottom:-1px;position:relative;background:#fff;padding:.75em 1.25em}@media (min-height:46.75em){.picker__list-item{padding:.5em 1em}}.picker__list-item:hover{cursor:pointer;color:#000;background:#b1dcfb;border-color:#0089ec;z-index:10}.picker__list-item--selected,.picker__list-item--selected:hover{border-color:#0089ec;z-index:10}.picker__list-item--highlighted{background:#b1dcfb}.picker__list-item--highlighted:hover,.picker--focused .picker__list-item--highlighted{background:#0089ec;color:#fff}.picker__list-item--disabled,.picker__list-item--disabled:hover,.picker--focused .picker__list-item--disabled{background:#f5f5f5;border-color:#f5f5f5;color:#ddd;cursor:default;border-color:#ddd;z-index:auto}.picker--time .picker__button--clear{display:block;width:80%;margin:1em auto 0;padding:1em 1.25em;background:0 0;border:0;font-weight:500;font-size:.67em;text-align:center;text-transform:uppercase;color:#666}.picker--time .picker__button--clear:hover,.picker--time .picker__button--clear:focus{color:#000;background:#b1dcfb;background:#e20;border-color:#e20;cursor:pointer;color:#fff;outline:0}.picker--time .picker__button--clear:before{top:-.25em;color:#666;font-size:1.25em;font-weight:700}.picker--time .picker__button--clear:hover:before,.picker--time .picker__button--clear:focus:before{color:#fff}.picker--time .picker__frame{min-width:256px;max-width:320px}.picker--time .picker__box{font-size:1em;background:#f2f2f2;padding:0}@media (min-height:40.125em){.picker--time .picker__box{margin-bottom:5em}} \ No newline at end of file +.picker__list{list-style:none;padding:.75em 0 4.2em;margin:0}.picker__list-item{border-bottom:1px solid #ddd;border-top:1px solid #ddd;margin-bottom:-1px;position:relative;background:#fff;padding:.75em 1.25em}@media (min-height:46.75em){.picker__list-item{padding:.5em 1em}}.picker__list-item:hover{cursor:pointer;color:#000;background:#b1dcfb;border-color:#0089ec;z-index:10}.picker__list-item--selected,.picker__list-item--selected:hover{border-color:#0089ec;z-index:10}.picker__list-item--highlighted{background:#b1dcfb}.picker--focused .picker__list-item--highlighted,.picker__list-item--highlighted:hover{background:#0089ec;color:#fff}.picker--focused .picker__list-item--disabled,.picker__list-item--disabled,.picker__list-item--disabled:hover{background:#f5f5f5;color:#ddd;cursor:default;border-color:#ddd;z-index:auto}.picker--time .picker__button--clear{display:block;width:80%;margin:1em auto 0;padding:1em 1.25em;background:0 0;border:0;font-weight:500;font-size:.67em;text-align:center;text-transform:uppercase;color:#666}.picker--time .picker__button--clear:focus,.picker--time .picker__button--clear:hover{background:#b1dcfb;background:#e20;border-color:#e20;cursor:pointer;color:#fff;outline:0}.picker--time .picker__button--clear:before{top:-.25em;color:#666;font-size:1.25em;font-weight:700}.picker--time .picker__button--clear:focus:before,.picker--time .picker__button--clear:hover:before{color:#fff}.picker--time .picker__frame{min-width:256px;max-width:320px}.picker--time .picker__box{font-size:1em;background:#f2f2f2;padding:0}@media (min-height:40.125em){.picker--time .picker__box{margin-bottom:5em}} \ No newline at end of file diff --git a/lib/picker.date.js b/lib/picker.date.js index 91c47bcf..55da91f9 100644 --- a/lib/picker.date.js +++ b/lib/picker.date.js @@ -1,6 +1,6 @@ /*! - * Date picker for pickadate.js v3.3.2 + * Date picker for pickadate.js v3.4.0 * http://amsul.github.io/pickadate.js/date.htm */ diff --git a/lib/picker.js b/lib/picker.js index 7819ce09..02cab413 100644 --- a/lib/picker.js +++ b/lib/picker.js @@ -1,6 +1,6 @@ /*! - * pickadate.js v3.3.2, 2014/01/31 + * pickadate.js v3.4.0, 2014/01/31 * By Amsul, http://amsul.ca * Hosted on http://amsul.github.io/pickadate.js * Licensed under MIT diff --git a/lib/picker.time.js b/lib/picker.time.js index 5858abe5..2b540f3d 100644 --- a/lib/picker.time.js +++ b/lib/picker.time.js @@ -1,6 +1,6 @@ /*! - * Time picker for pickadate.js v3.3.2 + * Time picker for pickadate.js v3.4.0 * http://amsul.github.io/pickadate.js/time.htm */ diff --git a/lib/themes/classic.date.css b/lib/themes/classic.date.css index 78aa320f..dc595309 100644 --- a/lib/themes/classic.date.css +++ b/lib/themes/classic.date.css @@ -156,7 +156,6 @@ color: #999999; font-weight: 500; /* Increase the spacing a tad */ - } @media (min-height: 33.875em) { .picker__weekday { diff --git a/lib/themes/default.date.css b/lib/themes/default.date.css index 00b53a08..cde8390c 100644 --- a/lib/themes/default.date.css +++ b/lib/themes/default.date.css @@ -156,7 +156,6 @@ color: #999999; font-weight: 500; /* Increase the spacing a tad */ - } @media (min-height: 33.875em) { .picker__weekday { diff --git a/package.json b/package.json index 5bc4b74e..d409739f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pickadate", - "version": "3.3.2", + "version": "3.4.0", "title": "pickadate.js", "description": "The mobile-friendly, responsive, and lightweight jQuery date & time input picker.", "author": { @@ -38,18 +38,18 @@ "jquery": ">=1.7" }, "devDependencies": { - "grunt": "~0.4.1", - "phantomjs": "1.9.0-2", - "zlib-browserify": "0.0.1", + "grunt": "~0.4.2", + "phantomjs": "~1.9.7-1", + "zlib-browserify": "0.0.3", "grunt-contrib-concat": "~0.3.0", - "grunt-contrib-watch": "~0.3.1", - "grunt-contrib-jshint": "~0.4.3", - "grunt-contrib-qunit": "~0.2.0", - "grunt-contrib-copy": "~0.4.1", - "grunt-contrib-less": "~0.5.1", - "grunt-contrib-clean": "~0.4.1", - "grunt-contrib-cssmin": "~0.6.0", - "grunt-contrib-uglify": "~0.2.0" + "grunt-contrib-watch": "~0.5.3", + "grunt-contrib-jshint": "~0.8.0", + "grunt-contrib-qunit": "~0.4.0", + "grunt-contrib-copy": "~0.5.0", + "grunt-contrib-less": "~0.9.0", + "grunt-contrib-clean": "~0.5.0", + "grunt-contrib-cssmin": "~0.7.0", + "grunt-contrib-uglify": "~0.3.2" }, "scripts": { "test": "grunt travis --verbose" diff --git a/pickadate.jquery.json b/pickadate.jquery.json index 5bc4b74e..d409739f 100644 --- a/pickadate.jquery.json +++ b/pickadate.jquery.json @@ -1,6 +1,6 @@ { "name": "pickadate", - "version": "3.3.2", + "version": "3.4.0", "title": "pickadate.js", "description": "The mobile-friendly, responsive, and lightweight jQuery date & time input picker.", "author": { @@ -38,18 +38,18 @@ "jquery": ">=1.7" }, "devDependencies": { - "grunt": "~0.4.1", - "phantomjs": "1.9.0-2", - "zlib-browserify": "0.0.1", + "grunt": "~0.4.2", + "phantomjs": "~1.9.7-1", + "zlib-browserify": "0.0.3", "grunt-contrib-concat": "~0.3.0", - "grunt-contrib-watch": "~0.3.1", - "grunt-contrib-jshint": "~0.4.3", - "grunt-contrib-qunit": "~0.2.0", - "grunt-contrib-copy": "~0.4.1", - "grunt-contrib-less": "~0.5.1", - "grunt-contrib-clean": "~0.4.1", - "grunt-contrib-cssmin": "~0.6.0", - "grunt-contrib-uglify": "~0.2.0" + "grunt-contrib-watch": "~0.5.3", + "grunt-contrib-jshint": "~0.8.0", + "grunt-contrib-qunit": "~0.4.0", + "grunt-contrib-copy": "~0.5.0", + "grunt-contrib-less": "~0.9.0", + "grunt-contrib-clean": "~0.5.0", + "grunt-contrib-cssmin": "~0.7.0", + "grunt-contrib-uglify": "~0.3.2" }, "scripts": { "test": "grunt travis --verbose" diff --git a/tests/dev/date.htm b/tests/dev/date.htm index a4a84f1b..df7dfe88 100644 --- a/tests/dev/date.htm +++ b/tests/dev/date.htm @@ -32,12 +32,6 @@
-














- -
- -
-

@@ -46,37 +40,17 @@

class="datepicker" name="date" type="date" - valuee="21 July, 2013" + autofocus> +




+
- -
- - - - - - - -
- -
- -
- -














-














-














- -
-
@@ -87,35 +61,17 @@

diff --git a/tests/dev/time.htm b/tests/dev/time.htm index 87426011..a049c41c 100644 --- a/tests/dev/time.htm +++ b/tests/dev/time.htm @@ -32,29 +32,21 @@
-














- -
- -
-

- -




- + +
-
- -
- -














-














-














-
@@ -66,31 +58,11 @@

diff --git a/time.htm b/time.htm index 09f6f5cb..e3001440 100644 --- a/time.htm +++ b/time.htm @@ -507,7 +507,7 @@

- +