Skip to content

Commit

Permalink
version bump to 3.2.1 (fixes #210 & #136)
Browse files Browse the repository at this point in the history
  • Loading branch information
amsul committed Aug 24, 2013
1 parent 9b351fe commit c9f16cf
Show file tree
Hide file tree
Showing 25 changed files with 92 additions and 90 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@

# Changelog

## 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.
- Some other slight improvements.

## 3.2.0

- [#178](https://github.com/amsul/pickadate.js/issues/178): Fix for flicker on iOS while changing months.
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# pickadate v3.2.0 [![pickadate build status](https://travis-ci.org/amsul/pickadate.js.png?branch=gh-pages)](https://travis-ci.org/amsul/pickadate.js)
# pickadate v3.2.1 [![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.

Expand All @@ -11,7 +11,7 @@ The mobile-friendly, responsive, and lightweight jQuery date & time input picker

#### To get it:

[Download v3.2.0](https://github.com/amsul/pickadate.js/archive/3.2.0.zip) or `git clone git://github.com/amsul/pickadate.js.git` or `bower install pickadate`
[Download v3.2.1](https://github.com/amsul/pickadate.js/archive/3.2.1.zip) or `git clone git://github.com/amsul/pickadate.js.git` or `bower install pickadate`



Expand All @@ -36,9 +36,9 @@ There are currently two pickers: **date** and **time**.

File | Contents | Size (min & gzip)
----------------------- | ------------------------ | ----------------------
`picker.js` | __Base *__ | 1.28kb
`picker.date.js` | Date picker | 1.94kb
`picker.time.js` | Time picker | 1.30kb
`picker.js` | __Base *__ | 1.32kb
`picker.date.js` | Date picker | 1.96kb
`picker.time.js` | Time picker | 1.31kb

__*__ The base script is **required** for any of the pickers to function.

Expand All @@ -62,7 +62,7 @@ __*__ One and only one base stylesheet is **required**. [Choose a theme](http://

### Translations

The translations are copied into the `lib/translations` folder. There are currently [31 languages](https://github.com/amsul/pickadate.js/blob/3.2.0/lib/translations) included.
The translations are copied into the `lib/translations` folder. There are currently [32 languages](https://github.com/amsul/pickadate.js/blob/3.2.1/lib/translations) included.



Expand Down
6 changes: 6 additions & 0 deletions _raw/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@

# Changelog

## 3.2.1

- [#210]({%= meta.gitrepo_url %}/issues/210): Wrapped files using UMD patterns.
- [#207]({%= meta.gitrepo_url %}/issues/207): Japanese translations added.
- Some other slight improvements.

## 3.2.0

- [#178]({%= meta.gitrepo_url %}/issues/178): Fix for flicker on iOS while changing months.
Expand Down
8 changes: 4 additions & 4 deletions _raw/api.htm
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,8 @@ <h3 class="heading heading--divide"><span class="heading__text">Close with focus
<h3 class="heading heading--divide"><span class="heading__text">Open without focus<a class="heading__anchor" name="method-open-focus" href="#method-open-focus">&sect;</a></span></h3>

<p>Open the picker without focusing onto the <code class="tag-name">input</code> element by passing <code class="constant">false</code> as the first argument. Opening the picker this way, there’s a couple of things to note:</p>
<p><b>(1)</b> The only way to close it is with a separate custom binding – in this example, on document click.</p>
<p><b>(2)</b> <a href="#method-on">The “opening” events</a> are still triggered – however, using <a href="#method-get">the <code>get</code> method</a> to see if the picker is open will return <code class="constant">false</code>.</p>
<p><b>(1)</b> The only way to close it is with a separate custom binding – in this example, on document click.</p>
<p><b>(2)</b> <a href="#method-on">The “opening” events</a> are still triggered – however, using <a href="#method-get">the <code>get</code> method</a> to see if the picker is open will return <code class="constant">false</code>.</p>
<p>If any of the picker elements is focused/clicked, it resumes normal behavior.</p>

<pre class="pre--demo"><code data-language="javascript">picker.open(false)
Expand Down Expand Up @@ -905,7 +905,7 @@ <h3 class="heading heading--divide"><span class="heading__text">Default Events<a
<div class="section__block section__block--scoped">

<h3 class="heading heading--divide"><span class="heading__text">Scope and Arguments<a class="heading__anchor--bigger" name="method-on-scope-arguments" href="#method-on-scope-arguments">&sect;</a></span></h3>
<p>Within scope of the events’ callbacks, <code class="keyword">this</code> refers to <a href="#picker">the picker object</a> and for most events, no arguments are passed.</p>
<p>Within scope of the events’ callbacks, <code class="keyword">this</code> refers to <a href="#picker">the picker object</a> and for most events, no arguments are passed.</p>
<p>The only exception is the <code class="function">set</code> method, which is passed an argument that provides more context as to what is being “set”.</p>

</div> <!-- .section__block -->
Expand Down Expand Up @@ -993,7 +993,7 @@ <h2 class="heading heading--divide"><span class="heading__text">Object <code>$ro

<h2 class="heading heading--divide"><span class="heading__text">Object <code>_hidden</code><a class="heading__anchor" name="object-hidden" href="#object-hidden">&sect;</a></span></h2>
<p>This is the picker’s relative hidden element, which is <code class="null">undefined</code> if there’s no <code>formatSubmit</code> option.</p>
<p>There should be no reason to use this – it’s mostly for internal use. If you have a valid reason for using this, please mention it in the <a href="{%= meta.gitrepo_url %}/issues">Issues</a>.</p>
<p>There should be no reason to use this – it’s mostly for internal use. If you have a valid reason for using this, please mention it in the <a href="{%= meta.gitrepo_url %}/issues">Issues</a>.</p>

</div> <!-- .section__block -->

Expand Down
2 changes: 1 addition & 1 deletion _raw/base.htm
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="X-UA-Compatible" content="IE=Edge">

<title>{%= pkg.title %}{%= page != 'index' ? ' / ' + page : '' %}</title>
<title>{%= pkg.title %}{%= page != 'index' ? ' / ' + page : '' %}</title>

<link rel="shortcut icon" href="{%= dirs.dest.demos %}/images/favicon.ico">
<link rel="stylesheet" href="{%= dirs.dest.demos %}/styles/main.css">
Expand Down
2 changes: 1 addition & 1 deletion _raw/date.htm
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ <h2 class="heading heading--divide"><span class="heading__text">Formats<a class=

{%= dateDemoField({ id: 'date_demo__formats--a' }).replace( 'type=text', 'name=date_demo__formats type=text' ) %}

<p>When using <a href="#translations">translations</a>, the <code class="tag-name">input</code> element should be given a <code class="attribute">data-value</code> attribute formatted using the <code>formatSubmit</code> the element’s <code class="attribute">value</code> can be left blank. This helps to parse the date into the various languages:</p>
<p>When using <a href="#translations">translations</a>, the <code class="tag-name">input</code> element should be given a <code class="attribute">data-value</code> attribute formatted using the <code>formatSubmit</code> the element’s <code class="attribute">value</code> can be left blank. This helps to parse the date into the various languages:</p>
<pre class="pre--demo"><code data-language="html">&lt;input data-value="2013/04/20"></code></pre>
{%= dateDemoField({ id: 'date_demo__formats--b' }).replace( 'type=text', 'name=date_demo__formats type=text data-value="2013/04/20"') %}

Expand Down
7 changes: 0 additions & 7 deletions _raw/lib/legacy.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,6 @@
* Legacy browser support
*/

// isArray support
if ( !Array.isArray ) {
Array.isArray = function( value ) {
return {}.toString.call( value ) == '[object Array]'
}
}


// Map array support
if ( ![].map ) {
Expand Down
12 changes: 6 additions & 6 deletions _raw/lib/picker.date.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ DatePicker.prototype.create = function( type, value, options ) {

// If it’s an array, convert it into a date and make sure
// that it’s a valid date – otherwise default to today.
else if ( Array.isArray( value ) ) {
else if ( $.isArray( value ) ) {
value = new Date( value[ 0 ], value[ 1 ], value[ 2 ] )
value = Picker._.isDate( value ) ? value : calendar.create().obj
}
Expand Down Expand Up @@ -320,7 +320,7 @@ DatePicker.prototype.validate = function( type, dateObject, options ) {
hasEnabledWeekdays = isInverted && calendar.item.disable.filter( function( value ) {

// If there’s a date, check where it is relative to the target.
if ( Array.isArray( value ) ) {
if ( $.isArray( value ) ) {
var dateTime = calendar.create( value ).pick
if ( dateTime < dateObject.pick ) hasEnabledBeforeTarget = true
else if ( dateTime > dateObject.pick ) hasEnabledAfterTarget = true
Expand Down Expand Up @@ -412,7 +412,7 @@ DatePicker.prototype.disabled = function( dateObject ) {
}

// If it's an array, create the object and match the exact date.
if ( Array.isArray( dateToDisable ) ) {
if ( $.isArray( dateToDisable ) ) {
return dateObject.pick === calendar.create( dateToDisable ).pick
}
}).length
Expand All @@ -434,7 +434,7 @@ DatePicker.prototype.parse = function( type, value, options ) {
var calendar = this,
parsingObject = {}

if ( !value || Picker._.isInteger( value ) || Array.isArray( value ) || Picker._.isDate( value ) || Picker._.isObject( value ) && Picker._.isInteger( value.pick ) ) {
if ( !value || Picker._.isInteger( value ) || $.isArray( value ) || Picker._.isDate( value ) || Picker._.isObject( value ) && Picker._.isInteger( value.pick ) ) {
return value
}

Expand Down Expand Up @@ -632,10 +632,10 @@ DatePicker.prototype.removeDisabled = function( collection, item ) {
* Filter through the disabled collection to find a time unit.
*/
DatePicker.prototype.filterDisabled = function( collection, timeUnit, isRemoving ) {
var timeIsArray = Array.isArray( timeUnit )
var timeIsArray = $.isArray( timeUnit )
return collection.filter( function( disabledTimeUnit ) {
var isMatch = !timeIsArray && timeUnit === disabledTimeUnit ||
timeIsArray && Array.isArray( disabledTimeUnit ) && timeUnit.toString() === disabledTimeUnit.toString()
timeIsArray && $.isArray( disabledTimeUnit ) && timeUnit.toString() === disabledTimeUnit.toString()
return isRemoving ? !isMatch : isMatch
})
} //DatePicker.prototype.filterDisabled
Expand Down
12 changes: 7 additions & 5 deletions _raw/lib/picker.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ function PickerConstructor( ELEMENT, NAME, COMPONENT, OPTIONS ) {
event.stopPropagation()

// If nothing inside is actively focused, re-focus the element.
if ( !P.$root.find( document.activeElement ).length ) {
if ( !$.contains( P.$root[0], document.activeElement ) ) {
ELEMENT.focus()
}

Expand All @@ -154,9 +154,11 @@ function PickerConstructor( ELEMENT, NAME, COMPONENT, OPTIONS ) {


// If there’s a format for the hidden input element, create the element
// using the name of the original input plus suffix. Otherwise set it to null.
// using the name of the original input plus suffix. Otherwise set it to undefined.
// If the element has a value, use either the `data-value` or `value`.
P._hidden = SETTINGS.formatSubmit ? $( '<input type=hidden name=' + ELEMENT.name + ( SETTINGS.hiddenSuffix || '_submit' ) + ( $ELEMENT.data( 'value' ) ? ' value="' + PickerConstructor._.trigger( P.component.formats.toString, P.component, [ SETTINGS.formatSubmit, P.component.item.select ] ) + '"' : '' ) + '>' )[ 0 ] : undefined
if ( SETTINGS.formatSubmit ) {
P._hidden = $( '<input type=hidden name="' + ELEMENT.name + ( SETTINGS.hiddenSuffix || '_submit' ) + '"' + ( $ELEMENT.data( 'value' ) ? ' value="' + PickerConstructor._.trigger( P.component.formats.toString, P.component, [ SETTINGS.formatSubmit, P.component.item.select ] ) + '"' : '' ) + '>' )[ 0 ]
}


// Add the class and bind the events on the element.
Expand Down Expand Up @@ -366,7 +368,7 @@ function PickerConstructor( ELEMENT, NAME, COMPONENT, OPTIONS ) {

// If the target is within the root and “enter” is pressed,
// prevent the default action and trigger a click on the target instead.
else if ( P.$root.find( target ).length && keycode == 13 ) {
else if ( $.contains( P.$root[0], target ) && keycode == 13 ) {
event.preventDefault()
target.click()
}
Expand Down Expand Up @@ -687,7 +689,7 @@ PickerConstructor._ = {
if ( !item ) return ''

// If the item is an array, do a join
item = Array.isArray( item ) ? item.join( '' ) : item
item = $.isArray( item ) ? item.join( '' ) : item

// Check for the class
klass = klass ? ' class="' + klass + '"' : ''
Expand Down
10 changes: 5 additions & 5 deletions _raw/lib/picker.time.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ TimePicker.prototype.create = function( type, value, options ) {
}

// If it's an array, convert it into minutes.
else if ( Array.isArray( value ) ) {
else if ( $.isArray( value ) ) {
value = +value[ 0 ] * MINUTES_IN_HOUR + (+value[ 1 ])
}

Expand Down Expand Up @@ -323,7 +323,7 @@ TimePicker.prototype.disabled = function( timeObject ) {
}

// If it's an array, create the object and match the times.
if ( Array.isArray( timeToDisable ) ) {
if ( $.isArray( timeToDisable ) ) {
return timeObject.pick == clock.create( timeToDisable ).pick
}
}).length
Expand Down Expand Up @@ -377,7 +377,7 @@ TimePicker.prototype.parse = function( type, value, options ) {
clock = this,
parsingObject = {}

if ( !value || Picker._.isInteger( value ) || Array.isArray( value ) || Picker._.isDate( value ) || Picker._.isObject( value ) && Picker._.isInteger( value.pick ) ) {
if ( !value || Picker._.isInteger( value ) || $.isArray( value ) || Picker._.isDate( value ) || Picker._.isObject( value ) && Picker._.isInteger( value.pick ) ) {
return value
}

Expand Down Expand Up @@ -533,10 +533,10 @@ TimePicker.prototype.removeDisabled = function( collection, item ) {
* Filter through the disabled collection to find a time unit.
*/
TimePicker.prototype.filterDisabled = function( collection, timeUnit, isRemoving ) {
var timeIsArray = Array.isArray( timeUnit )
var timeIsArray = $.isArray( timeUnit )
return collection.filter( function( disabledTimeUnit ) {
var isMatch = !timeIsArray && timeUnit === disabledTimeUnit ||
timeIsArray && Array.isArray( disabledTimeUnit ) && timeUnit.toString() === disabledTimeUnit.toString()
timeIsArray && $.isArray( disabledTimeUnit ) && timeUnit.toString() === disabledTimeUnit.toString()
return isRemoving ? !isMatch : isMatch
})
} //TimePicker.prototype.filterDisabled
Expand Down
4 changes: 2 additions & 2 deletions _raw/lib/themes/classic.less
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
// Tilt the picker.
.transform( translateY( -1em ) perspective( 600px ) rotateX( 10deg ) );

// Everything should be smoothly animated – the height should wait till the rest is done.
// Everything should be smoothly animatedthe height should wait till the rest is done.
@transition: all @speed-animate-in ease-out, max-height 0 @speed-animate-in;
.transition( @transition );
}
Expand All @@ -66,7 +66,7 @@
// Straighten the picker.
.transform( translateY( 0 ) perspective( 600px ) rotateX( 0 ) );

// Everything should be smoothly animated – except the height.
// Everything should be smoothly animated – except the height.
@transition: all @speed-animate-in ease-out, max-height 0;
.transition( @transition );

Expand Down
Loading

0 comments on commit c9f16cf

Please sign in to comment.