diff --git a/CHANGELOG.md b/CHANGELOG.md index dd760f55..52b6c3f3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +>>>>> add aria role and labels to the month navigation buttons +>>>>> animations don’t work on firefox for classic theme +>>>>> fix date obj representation from {'...'} to new Date(...) + http://amsul.ca/pickadate.js/api.htm#method-set-select + ## 3.4.0 - ARIA support added. :star2: diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 4ede29c8..4285a3ee 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -35,7 +35,7 @@ A few other things to keep in mind: - Discuss any significant features before endeavoring into developing them. I’d hate to have anyone spend effort on something only for me to not merge it into the main project. - Include the relevant test coverage if any JavaScript files are involved. - Compile the project using `grunt --verbose` to make sure everything passes with a green flag. -- Use the Semantic Versioning guide, as mentioned in the [readme file](/blob/v3.0.0/README.md), in the case that a version bump is due. +- Use the Semantic Versioning guide, as mentioned in the [readme file](https://github.com/amsul/pickadate.js/#README.md), in the case that a version bump is due. #### All pull requests should be submitted to the `dev` branch. diff --git a/Gruntfile.js b/Gruntfile.js index 4d7ced8f..1ff60411 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -19,13 +19,11 @@ module.exports = function( grunt ) { // Load the NPM tasks. - grunt.loadNpmTasks( 'grunt-contrib-concat' ) grunt.loadNpmTasks( 'grunt-contrib-watch' ) grunt.loadNpmTasks( 'grunt-contrib-jshint' ) grunt.loadNpmTasks( 'grunt-contrib-qunit' ) grunt.loadNpmTasks( 'grunt-contrib-copy' ) grunt.loadNpmTasks( 'grunt-contrib-less' ) - grunt.loadNpmTasks( 'grunt-contrib-clean' ) grunt.loadNpmTasks( 'grunt-contrib-cssmin' ) grunt.loadNpmTasks( 'grunt-contrib-uglify' ) @@ -41,42 +39,39 @@ module.exports = function( grunt ) { // Set up the directories. dirs: { tests: 'tests', - src: { - raw: '_raw', - demos: '_raw/demo', - pickers: '_raw/lib', - themes: '_raw/lib/themes', - translations: '_raw/lib/translations' + lib: { + src: 'lib', + min: 'lib/compressed' }, - dest: { - demos: 'demo', - pickers: 'lib', - themes: 'lib/themes', - translations: 'lib/translations' + themes: { + src: 'lib/themes/less', + dest: 'lib/themes/css', + min: 'lib/compressed/themes' + }, + translations: { + src: 'lib/translations', + min: 'lib/compressed/translations' + }, + docs: { + src: '_docs', + dest: '.' + }, + demo: { + images: 'demo/images', + scripts: 'demo/scripts', + styles: { + src: 'demo/styles/less', + dest: 'demo/styles/css' + } }, - min: { - pickers: 'lib/compressed', - themes: 'lib/compressed/themes', - translations: 'lib/compressed/translations' - } - }, - - - // Clean the destination files and directories. - clean: { - demos: [ '<%= dirs.dest.demos %>', '*.htm' ], - pickers: [ '<%= dirs.dest.pickers %>/*.js' ], - themes: [ '<%= dirs.dest.themes %>' ], - translations: [ '<%= dirs.dest.translations %>' ], - pkg: [ '<%= dirs.dest.pickers %>', '<%= pkg.name %>.jquery.json', '*.md' ] }, // Generate static HTML templates. htmlify: { - demos: { + docs: { expand: true, - cwd: '<%= dirs.src.raw %>', + cwd: '<%= dirs.docs.src %>', src: [ '/!(base|hero)*.htm' ], dest: '', base: '/base.htm' @@ -86,18 +81,6 @@ module.exports = function( grunt ) { // Copy over files to destination directions. copy: { - demos: { - expand: true, - cwd: '<%= dirs.src.demos %>', - src: [ 'styles/.css', 'images/*.{png,ico}' ], - dest: '<%= dirs.dest.demos %>' - }, - translations: { - expand: true, - cwd: '<%= dirs.src.translations %>', - src: [ '*' ], - dest: '<%= dirs.dest.translations %>' - }, pkg: { options: { processContent: function( content ) { @@ -107,10 +90,10 @@ module.exports = function( grunt ) { files: [ { '<%= pkg.name %>.jquery.json': 'package.json' }, { 'bower.json': 'package.json' }, - { 'README.md': '<%= dirs.src.raw %>/README.md' }, - { 'LICENSE.md': '<%= dirs.src.raw %>/LICENSE.md' }, - { 'CHANGELOG.md': '<%= dirs.src.raw %>/CHANGELOG.md' }, - { 'CONTRIBUTING.md': '<%= dirs.src.raw %>/CONTRIBUTING.md' } + { 'README.md': '<%= dirs.docs.src %>/README.md' }, + { 'LICENSE.md': '<%= dirs.docs.src %>/LICENSE.md' }, + { 'CHANGELOG.md': '<%= dirs.docs.src %>/CHANGELOG.md' }, + { 'CONTRIBUTING.md': '<%= dirs.docs.src %>/CONTRIBUTING.md' } ] } }, @@ -121,40 +104,21 @@ module.exports = function( grunt ) { options: { style: 'expanded' }, - demos: { + demo: { files: { - '<%= dirs.dest.demos %>/styles/main.css': '<%= dirs.src.demos %>/styles/base.less' + '<%= dirs.demo.styles.dest %>/main.css': '<%= dirs.demo.styles.src %>/base.less' } }, themes: { files: { - '<%= dirs.dest.themes %>/default.css': [ '<%= dirs.src.themes %>/base.less', '<%= dirs.src.themes %>/default.less' ], - '<%= dirs.dest.themes %>/classic.css': [ '<%= dirs.src.themes %>/base.less', '<%= dirs.src.themes %>/classic.less' ], - '<%= dirs.dest.themes %>/default.date.css': [ '<%= dirs.src.themes %>/base.date.less', '<%= dirs.src.themes %>/default.date.less' ], - '<%= dirs.dest.themes %>/default.time.css': [ '<%= dirs.src.themes %>/base.time.less', '<%= dirs.src.themes %>/default.time.less' ], - '<%= dirs.dest.themes %>/classic.date.css': [ '<%= dirs.src.themes %>/base.date.less', '<%= dirs.src.themes %>/classic.date.less' ], - '<%= dirs.dest.themes %>/classic.time.css': [ '<%= dirs.src.themes %>/base.time.less', '<%= dirs.src.themes %>/classic.time.less' ], - '<%= dirs.dest.themes %>/rtl.css': [ '<%= dirs.src.themes %>/rtl.less' ] - } - } - }, - - - // Concatenate the files and add the banner. - concat: { - options: { - process: function( content ) { - return grunt.template.process( content, { delimiters: 'curly' } ) + '<%= dirs.themes.dest %>/default.css': [ '<%= dirs.themes.src %>/base.less', '<%= dirs.themes.src %>/default.less' ], + '<%= dirs.themes.dest %>/classic.css': [ '<%= dirs.themes.src %>/base.less', '<%= dirs.themes.src %>/classic.less' ], + '<%= dirs.themes.dest %>/default.date.css': [ '<%= dirs.themes.src %>/base.date.less', '<%= dirs.themes.src %>/default.date.less' ], + '<%= dirs.themes.dest %>/default.time.css': [ '<%= dirs.themes.src %>/base.time.less', '<%= dirs.themes.src %>/default.time.less' ], + '<%= dirs.themes.dest %>/classic.date.css': [ '<%= dirs.themes.src %>/base.date.less', '<%= dirs.themes.src %>/classic.date.less' ], + '<%= dirs.themes.dest %>/classic.time.css': [ '<%= dirs.themes.src %>/base.time.less', '<%= dirs.themes.src %>/classic.time.less' ], + '<%= dirs.themes.dest %>/rtl.css': [ '<%= dirs.themes.src %>/rtl.less' ] } - }, - demos: { - files: { '<%= dirs.dest.demos %>/scripts/main.js': '<%= dirs.src.demos %>/scripts/*.js' } - }, - pickers: { - expand: true, - cwd: '<%= dirs.src.pickers %>', - src: [ '*.js' ], - dest: '<%= dirs.dest.pickers %>' } }, @@ -165,14 +129,14 @@ module.exports = function( grunt ) { jshintrc: true }, gruntfile: 'Gruntfile.js', - demos: [ '<%= dirs.src.demos %>/scripts/base.js' ], - pickers: [ + demo: [ '<%= dirs.demo.scripts %>/demo.js' ], + lib: [ '<%= dirs.tests %>/units/*.js', - '<%= dirs.dest.pickers %>/**/*.js', + '<%= dirs.lib.src %>/**/*.js', // Ignore the legacy and minified files. - '!<%= dirs.dest.pickers %>/legacy.js', - '!<%= dirs.dest.pickers %>/compressed/**/*.js' + '!<%= dirs.lib.src %>/legacy.js', + '!<%= dirs.lib.src %>/compressed/**/*.js' ] }, @@ -182,62 +146,54 @@ module.exports = function( grunt ) { options: { preserveComments: 'some' }, - pickers: { + lib: { files: [ { expand : true, - cwd : '<%= dirs.dest.pickers %>', + cwd : '<%= dirs.lib.src %>', src : [ '**/*.js', '!compressed/**/*.js' ], - dest : '<%= dirs.dest.pickers %>/compressed' + dest : '<%= dirs.lib.min %>' } ] } }, cssmin: { - pickers: { + lib: { expand: true, - cwd: '<%= dirs.dest.pickers %>', + cwd: '<%= dirs.themes.dest %>', src: [ '**/*.css', '!compressed/**/*.css' ], - dest: '<%= dirs.dest.pickers %>/compressed' + dest: '<%= dirs.themes.min %>' } }, // Unit test the files. qunit: { - pickers: [ '<%= dirs.tests %>/units/all.htm' ] + lib: [ '<%= dirs.tests %>/units/all.htm' ] }, // Watch the project files. watch: { - gruntfile: { - files: [ 'Gruntfile.js' ], - tasks: [ 'jshint:gruntfile', 'default' ] - }, quick: { files: [ - '<%= dirs.src.raw %>/*.htm', - '<%= dirs.src.raw %>/*.md', - '<%= dirs.src.demos %>/styles/*.less', '<%= dirs.src.demos %>/scripts/*.js', - '<%= dirs.src.pickers %>/**/*.js', '<%= dirs.src.pickers %>/themes/*.css', - '<%= dirs.src.themes %>/*.less', - '<%= dirs.src.translations %>/*.js' + '<%= dirs.docs.src %>/*.htm', + '<%= dirs.docs.src %>/*.md', + '<%= dirs.demo.src %>/styles/*.less', + '<%= dirs.themes.src %>/*.less' ], tasks: [ 'quick' ] }, - demos: { + docs: { files: [ - '<%= dirs.src.raw %>/*.htm', - '<%= dirs.src.demos %>/styles/*.less', '<%= dirs.src.demos %>/scripts/*.js' + '<%= dirs.docs.src %>/*.htm', + '<%= dirs.docs.src %>/styles/*.less' ], tasks: [ 'demo' ] }, - pickers: { + lib: { files: [ - '<%= dirs.src.pickers %>/**/*.js', '<%= dirs.src.pickers %>/themes/*.css', - '<%= dirs.src.themes %>/*.less', - '<%= dirs.src.translations %>/*.js' + '<%= dirs.themes.src %>/*.less' ], tasks: [ 'picker' ] } @@ -263,11 +219,11 @@ module.exports = function( grunt ) { // Register the tasks. // * `htmlify` and `copy:pkg` should come after `uglify` because some package files measure `.min` file sizes. - grunt.registerTask( 'default', [ 'clean', 'concat', 'copy:demos', 'copy:translations', 'less', 'jshint', 'qunit', 'uglify', 'cssmin', 'htmlify', 'copy:pkg' ] ) - grunt.registerTask( 'quick', [ 'concat', 'copy:demos', 'copy:translations', 'less', 'uglify', 'cssmin', 'htmlify', 'copy:pkg' ] ) - grunt.registerTask( 'picker', [ 'clean:pickers', 'concat:pickers', 'copy:translations', 'less:themes', 'jshint:pickers', 'qunit:pickers', 'uglify:pickers', 'cssmin:pickers' ] ) - grunt.registerTask( 'demo', [ 'clean:demos', 'concat:demos', 'copy:demos', 'less:demos', 'jshint:demos', 'htmlify:demos' ] ) - grunt.registerTask( 'travis', [ 'jshint:pickers', 'qunit:pickers' ] ) + grunt.registerTask( 'default', [ 'less', 'jshint', 'qunit', 'uglify', 'cssmin', 'htmlify', 'copy:pkg' ] ) + grunt.registerTask( 'quick', [ 'less', 'uglify', 'cssmin', 'htmlify', 'copy:pkg' ] ) + grunt.registerTask( 'picker', [ 'less:themes', 'jshint:lib', 'qunit:lib', 'uglify:lib', 'cssmin:lib' ] ) + grunt.registerTask( 'docs', [ 'copy:docs', 'less:docs', 'jshint:docs', 'htmlify:docs' ] ) + grunt.registerTask( 'travis', [ 'jshint:lib', 'qunit:lib' ] ) diff --git a/README.md b/README.md index cb7b2d19..1d013129 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ The v3 API is significantly different from v2 (all for the greater good!). So if
## Library files -The `lib` folder includes all the compiled files and a `compressed` folder with the minified counter-parts. These files are all generated from the `_raw/lib` folder using [Grunt](#building-with-grunt). +The `` folder includes all the compiled files and a `compressed` folder with the minified counter-parts. These files are all generated from the `_raw/lib` folder using [Grunt](#building-with-grunt). ### Pickers @@ -36,7 +36,7 @@ There are currently two pickers: **date** and **time**. File | Contents | Size (min & gzip) ----------------------- | ------------------------ | ---------------------- -`picker.js` | __Base *__ | 1.58kb +`picker.js` | __Base *__ | 1.52kb `picker.date.js` | Date picker | 2.45kb `picker.time.js` | Time picker | 1.81kb @@ -47,7 +47,7 @@ _To support old browsers, namely IE8, **also include** the `legacy.js` file._ ### Themes -All themes are [generated using LESS](#less-styling) and compiled into the `lib/themes` folder. +All themes are [generated using LESS](#less-styling) and compiled into the `lib/themes/css` folder. File | Contents | Size (min & gzip) ----------------------- | ---------------------------- | ---------------------- @@ -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 [37 languages](https://github.com/amsul/pickadate.js/blob/3.4.0/lib/translations) included. +The translations are copied into the `` folder. There are currently [37 languages](https://github.com/amsul/pickadate.js/blob/3.4.0/lib/translations) included. @@ -88,7 +88,7 @@ Read the Gruntfile to see the build tasks and relative directories of the source ## Styling with LESS -The picker themes are built using [LESS](http://lesscss.org/) with Grunt. To customize the CSS output, read the `_variables.less` file in the `_raw/lib/themes` folder. You can specify: +The picker themes are built using [LESS](http://lesscss.org/) with Grunt. To customize the CSS output, read the `_variables.less` file in the `lib/themes/less` folder. You can specify: - colors for the theme, - sizes for the picker, diff --git a/_raw/CHANGELOG.md b/_docs/CHANGELOG.md similarity index 100% rename from _raw/CHANGELOG.md rename to _docs/CHANGELOG.md diff --git a/_raw/CONTRIBUTING.md b/_docs/CONTRIBUTING.md similarity index 95% rename from _raw/CONTRIBUTING.md rename to _docs/CONTRIBUTING.md index f330e456..e3931fd4 100644 --- a/_raw/CONTRIBUTING.md +++ b/_docs/CONTRIBUTING.md @@ -35,7 +35,7 @@ A few other things to keep in mind: - Discuss any significant features before endeavoring into developing them. I’d hate to have anyone spend effort on something only for me to not merge it into the main project. - Include the relevant test coverage if any JavaScript files are involved. - Compile the project using `grunt --verbose` to make sure everything passes with a green flag. -- Use the Semantic Versioning guide, as mentioned in the [readme file]({%= gitrepo_url %}/blob/v3.0.0/README.md), in the case that a version bump is due. +- Use the Semantic Versioning guide, as mentioned in the [readme file]({%= meta.gitrepo_url %}/#readme), in the case that a version bump is due. #### All pull requests should be submitted to the `dev` branch. diff --git a/_raw/LICENSE.md b/_docs/LICENSE.md similarity index 100% rename from _raw/LICENSE.md rename to _docs/LICENSE.md diff --git a/_raw/README.md b/_docs/README.md similarity index 82% rename from _raw/README.md rename to _docs/README.md index ec7213c8..4c60e83f 100644 --- a/_raw/README.md +++ b/_docs/README.md @@ -3,16 +3,16 @@ {%= pkg.description %} {% - fileSize_js_core = meta.fileSize( grunt.file.read( dirs.min.pickers + '/picker.js') ) - fileSize_js_date = meta.fileSize( grunt.file.read( dirs.min.pickers + '/picker.date.js') ) - fileSize_js_time = meta.fileSize( grunt.file.read( dirs.min.pickers + '/picker.time.js') ) - fileSize_css_default = meta.fileSize( grunt.file.read( dirs.min.themes + '/default.css') ) - fileSize_css_classic = meta.fileSize( grunt.file.read( dirs.min.themes + '/classic.css') ) - fileSize_css_default_date = meta.fileSize( grunt.file.read( dirs.min.themes + '/default.date.css') ) - fileSize_css_default_time = meta.fileSize( grunt.file.read( dirs.min.themes + '/default.time.css') ) - fileSize_css_classic_date = meta.fileSize( grunt.file.read( dirs.min.themes + '/classic.date.css') ) - fileSize_css_classic_time = meta.fileSize( grunt.file.read( dirs.min.themes + '/classic.time.css') ) - fileSize_css_rtl = meta.fileSize( grunt.file.read( dirs.min.themes + '/rtl.css') ) + fileSize_js_core = meta.fileSize( grunt.file.read( dirs.lib.min + '/picker.js') ) + fileSize_js_date = meta.fileSize( grunt.file.read( dirs.lib.min + '/picker.date.js') ) + fileSize_js_time = meta.fileSize( grunt.file.read( dirs.lib.min + '/picker.time.js') ) + fileSize_css_default = meta.fileSize( grunt.file.read( dirs.themes.min + '/default.css') ) + fileSize_css_classic = meta.fileSize( grunt.file.read( dirs.themes.min + '/classic.css') ) + fileSize_css_default_date = meta.fileSize( grunt.file.read( dirs.themes.min + '/default.date.css') ) + fileSize_css_default_time = meta.fileSize( grunt.file.read( dirs.themes.min + '/default.time.css') ) + fileSize_css_classic_date = meta.fileSize( grunt.file.read( dirs.themes.min + '/classic.date.css') ) + fileSize_css_classic_time = meta.fileSize( grunt.file.read( dirs.themes.min + '/classic.time.css') ) + fileSize_css_rtl = meta.fileSize( grunt.file.read( dirs.themes.min + '/rtl.css') ) %} #### To get started, check out the: @@ -39,7 +39,7 @@ The v3 API is significantly different from v2 (all for the greater good!). So if
## Library files -The `{%= dirs.dest.pickers %}` folder includes all the compiled files and a `compressed` folder with the minified counter-parts. These files are all generated from the `_raw/lib` folder using [Grunt](#building-with-grunt). +The `{%= dirs.lib.dest %}` folder includes all the compiled files and a `compressed` folder with the minified counter-parts. These files are all generated from the `_raw/lib` folder using [Grunt](#building-with-grunt). ### Pickers @@ -58,7 +58,7 @@ _To support old browsers, namely IE8, **also include** the `legacy.js` file._ ### Themes -All themes are [generated using LESS](#less-styling) and compiled into the `{%= dirs.dest.themes %}` folder. +All themes are [generated using LESS](#less-styling) and compiled into the `{%= dirs.themes.dest %}` folder. File | Contents | Size (min & gzip) ----------------------- | ---------------------------- | ---------------------- @@ -76,7 +76,7 @@ __**__ For languages with text flowing from right-to-left, also include the `rtl ### Translations -The translations are copied into the `{%= dirs.dest.translations %}` folder. There are currently [{%= grunt.file.expand(dirs.min.translations + '/*.js').length %} languages]({%= pkg.repository.url.replace(/.git$/,'') %}/blob/{%= pkg.version.split('-')[0] %}/lib/translations) included. +The translations are copied into the `{%= dirs.translations.dest %}` folder. There are currently [{%= grunt.file.expand(dirs.translations.min + '/*.js').length %} languages]({%= pkg.repository.url.replace(/.git$/,'') %}/blob/{%= pkg.version.split('-')[0] %}/lib/translations) included. @@ -99,7 +99,7 @@ Read the Gruntfile to see the build tasks and relative directories of the source ## Styling with LESS -The picker themes are built using [LESS](http://lesscss.org/) with Grunt. To customize the CSS output, read the `_variables.less` file in the `{%= dirs.src.themes %}` folder. You can specify: +The picker themes are built using [LESS](http://lesscss.org/) with Grunt. To customize the CSS output, read the `_variables.less` file in the `{%= dirs.themes.src %}` folder. You can specify: - colors for the theme, - sizes for the picker, diff --git a/_raw/api.htm b/_docs/api.htm similarity index 99% rename from _raw/api.htm rename to _docs/api.htm index d94dd9a8..e308274c 100644 --- a/_raw/api.htm +++ b/_docs/api.htm @@ -222,7 +222,7 @@

ClearClear', - value: grunt.template.date('d mmmm, yyyy') + value: '15 February, 2014' }) %}

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

@@ -316,7 +316,7 @@

Get Log the value', - value: grunt.template.date('d mmmm, yyyy'), + value: '15 February, 2014', placeholder: 'Open your console and try me…' }) %} @@ -557,7 +557,7 @@

Set Clear', - value: grunt.template.date('d mmmm, yyyy') + value: '15 February, 2014' }) %}

This is the full form of the clear method.

diff --git a/_raw/base.htm b/_docs/base.htm similarity index 86% rename from _raw/base.htm rename to _docs/base.htm index 9b8cd322..c76f2e55 100644 --- a/_raw/base.htm +++ b/_docs/base.htm @@ -11,11 +11,11 @@ {%= pkg.title %}{%= page != 'index' ? ' / ' + page : '' %} - - - - - + + + + + - {%= page == 'index' ? grunt.file.read( dirs.src.raw + '/hero.htm' ) : '' %} + {%= page == 'index' ? grunt.file.read( dirs.docs.src + '/hero.htm' ) : '' %} @@ -73,11 +73,12 @@

- - - - - + + + + + +