pickadate-rails 1.2.0 → 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 969120f5da187e11ef470d80b7a6816e82a1af65
4
- data.tar.gz: e03111de8da4fea0e6f78fcfdd7a16d274c18f7f
3
+ metadata.gz: bfd62c0da55be755d6918e53a01882ca4a187b94
4
+ data.tar.gz: ad7434f646c6eca928c68791ba8da736a6fa6e3a
5
5
  SHA512:
6
- metadata.gz: 9ebe246c73e7f423c6c9169a1600c4f2c87c7c6beb01a63e82da8c70f95c98196cb756309d1a3f41ecfe6ea1b0f2524e3efd70d04de265f47ebd28e28831ed33
7
- data.tar.gz: 94b2c0e01d6c0e2de45ecde922fbc68e7747cf9213b740859d301fb4f92f7c05e6202b8ebc088d3d3d662642067cd38433b48dc8afb6886e440e440792b10b53
6
+ metadata.gz: 55de4bcee0dcb7c605cf1d6da70225ad484033429ad574f61114961e622a80468f5a57129f22e98bd2ad5072bd96f3b5eab150901731571659ecd21866e948e6
7
+ data.tar.gz: 73d57d2112863d375ebae50cec07e3dcbc7dc1055af31f728d6b85ca68a3c2e6f8883df433b108d3ccb95b4c782bca1acd8fbcb36394e4c0398d5e7e791f009d
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Pickadate-Rails [![Gem Version](https://badge.fury.io/rb/pickadate-rails.png)](http://badge.fury.io/rb/pickadate-rails)
2
2
 
3
- ## Pickadate Version: 3.2.0
3
+ ## Pickadate Version: 3.2.1
4
4
 
5
5
  Easily add [pickadate.js](https://github.com/amsul/pickadate.js) to your Rails 3.1+ application using the asset pipeline.
6
6
 
@@ -1,3 +1,3 @@
1
1
  module PickadateRails
2
- VERSION = "1.2.0"
2
+ VERSION = "1.2.1"
3
3
  end
@@ -1,6 +1,6 @@
1
1
 
2
2
  /*!
3
- * Date picker for pickadate.js v3.2.0
3
+ * Date picker for pickadate.js v3.2.1
4
4
  * http://amsul.github.io/pickadate.js/date.htm
5
5
  */
6
6
 
@@ -13,9 +13,16 @@
13
13
  boss: true
14
14
  */
15
15
 
16
+ (function ( factory ) {
16
17
 
17
- // Create a new scope.
18
- (function() {
18
+ // Register as an anonymous module.
19
+ if ( typeof define === 'function' && define.amd )
20
+ define( ['picker'], factory )
21
+
22
+ // Or using browser globals.
23
+ else factory( Picker )
24
+
25
+ }(function( Picker ) {
19
26
 
20
27
 
21
28
  /**
@@ -181,7 +188,7 @@ DatePicker.prototype.create = function( type, value, options ) {
181
188
 
182
189
  // If it’s an array, convert it into a date and make sure
183
190
  // that it’s a valid date – otherwise default to today.
184
- else if ( Array.isArray( value ) ) {
191
+ else if ( $.isArray( value ) ) {
185
192
  value = new Date( value[ 0 ], value[ 1 ], value[ 2 ] )
186
193
  value = Picker._.isDate( value ) ? value : calendar.create().obj
187
194
  }
@@ -313,7 +320,7 @@ DatePicker.prototype.validate = function( type, dateObject, options ) {
313
320
  hasEnabledWeekdays = isInverted && calendar.item.disable.filter( function( value ) {
314
321
 
315
322
  // If there’s a date, check where it is relative to the target.
316
- if ( Array.isArray( value ) ) {
323
+ if ( $.isArray( value ) ) {
317
324
  var dateTime = calendar.create( value ).pick
318
325
  if ( dateTime < dateObject.pick ) hasEnabledBeforeTarget = true
319
326
  else if ( dateTime > dateObject.pick ) hasEnabledAfterTarget = true
@@ -405,7 +412,7 @@ DatePicker.prototype.disabled = function( dateObject ) {
405
412
  }
406
413
 
407
414
  // If it's an array, create the object and match the exact date.
408
- if ( Array.isArray( dateToDisable ) ) {
415
+ if ( $.isArray( dateToDisable ) ) {
409
416
  return dateObject.pick === calendar.create( dateToDisable ).pick
410
417
  }
411
418
  }).length
@@ -427,7 +434,7 @@ DatePicker.prototype.parse = function( type, value, options ) {
427
434
  var calendar = this,
428
435
  parsingObject = {}
429
436
 
430
- if ( !value || Picker._.isInteger( value ) || Array.isArray( value ) || Picker._.isDate( value ) || Picker._.isObject( value ) && Picker._.isInteger( value.pick ) ) {
437
+ if ( !value || Picker._.isInteger( value ) || $.isArray( value ) || Picker._.isDate( value ) || Picker._.isObject( value ) && Picker._.isInteger( value.pick ) ) {
431
438
  return value
432
439
  }
433
440
 
@@ -625,10 +632,10 @@ DatePicker.prototype.removeDisabled = function( collection, item ) {
625
632
  * Filter through the disabled collection to find a time unit.
626
633
  */
627
634
  DatePicker.prototype.filterDisabled = function( collection, timeUnit, isRemoving ) {
628
- var timeIsArray = Array.isArray( timeUnit )
635
+ var timeIsArray = $.isArray( timeUnit )
629
636
  return collection.filter( function( disabledTimeUnit ) {
630
637
  var isMatch = !timeIsArray && timeUnit === disabledTimeUnit ||
631
- timeIsArray && Array.isArray( disabledTimeUnit ) && timeUnit.toString() === disabledTimeUnit.toString()
638
+ timeIsArray && $.isArray( disabledTimeUnit ) && timeUnit.toString() === disabledTimeUnit.toString()
632
639
  return isRemoving ? !isMatch : isMatch
633
640
  })
634
641
  } //DatePicker.prototype.filterDisabled
@@ -950,8 +957,7 @@ DatePicker.defaults = (function( prefix ) {
950
957
  Picker.extend( 'pickadate', DatePicker )
951
958
 
952
959
 
953
- // Close the scope.
954
- })();
960
+ }));
955
961
 
956
962
 
957
963
 
@@ -1,6 +1,6 @@
1
1
 
2
2
  /*!
3
- * pickadate.js v3.2.0, 2013/08/15
3
+ * pickadate.js v3.2.1, 2013/08/24
4
4
  * By Amsul, http://amsul.ca
5
5
  * Hosted on http://amsul.github.io/pickadate.js
6
6
  * Licensed under MIT
@@ -16,9 +16,18 @@
16
16
  eqnull: true
17
17
  */
18
18
 
19
+ (function ( factory ) {
19
20
 
20
- // Create a global scope.
21
- window.Picker = (function( $, $document, undefined ) {
21
+ // Register as an anonymous module.
22
+ if ( typeof define === 'function' && define.amd )
23
+ define( 'picker', ['jquery'], factory )
24
+
25
+ // Or using browser globals.
26
+ else this.Picker = factory( jQuery )
27
+
28
+ }(function( $ ) {
29
+
30
+ var $document = $( document )
22
31
 
23
32
 
24
33
  /**
@@ -121,7 +130,7 @@ function PickerConstructor( ELEMENT, NAME, COMPONENT, OPTIONS ) {
121
130
  event.stopPropagation()
122
131
 
123
132
  // If nothing inside is actively focused, re-focus the element.
124
- if ( !P.$root.find( document.activeElement ).length ) {
133
+ if ( !$.contains( P.$root[0], document.activeElement ) ) {
125
134
  ELEMENT.focus()
126
135
  }
127
136
 
@@ -145,9 +154,11 @@ function PickerConstructor( ELEMENT, NAME, COMPONENT, OPTIONS ) {
145
154
 
146
155
 
147
156
  // If there’s a format for the hidden input element, create the element
148
- // using the name of the original input plus suffix. Otherwise set it to null.
157
+ // using the name of the original input plus suffix. Otherwise set it to undefined.
149
158
  // If the element has a value, use either the `data-value` or `value`.
150
- 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
159
+ if ( SETTINGS.formatSubmit ) {
160
+ 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 ]
161
+ }
151
162
 
152
163
 
153
164
  // Add the class and bind the events on the element.
@@ -357,7 +368,7 @@ function PickerConstructor( ELEMENT, NAME, COMPONENT, OPTIONS ) {
357
368
 
358
369
  // If the target is within the root and “enter” is pressed,
359
370
  // prevent the default action and trigger a click on the target instead.
360
- else if ( P.$root.find( target ).length && keycode == 13 ) {
371
+ else if ( $.contains( P.$root[0], target ) && keycode == 13 ) {
361
372
  event.preventDefault()
362
373
  target.click()
363
374
  }
@@ -678,7 +689,7 @@ PickerConstructor._ = {
678
689
  if ( !item ) return ''
679
690
 
680
691
  // If the item is an array, do a join
681
- item = Array.isArray( item ) ? item.join( '' ) : item
692
+ item = $.isArray( item ) ? item.join( '' ) : item
682
693
 
683
694
  // Check for the class
684
695
  klass = klass ? ' class="' + klass + '"' : ''
@@ -780,12 +791,11 @@ PickerConstructor.extend = function( name, Component ) {
780
791
 
781
792
 
782
793
 
783
- // Return the picker constructor.
794
+ // Expose the picker constructor.
784
795
  return PickerConstructor
785
796
 
786
797
 
787
- // Close the global scope.
788
- })( jQuery, jQuery( document ) );
798
+ }));
789
799
 
790
800
 
791
801
 
@@ -1,6 +1,6 @@
1
1
 
2
2
  /*!
3
- * Time picker for pickadate.js v3.2.0
3
+ * Time picker for pickadate.js v3.2.1
4
4
  * http://amsul.github.io/pickadate.js/time.htm
5
5
  */
6
6
 
@@ -13,9 +13,16 @@
13
13
  boss: true
14
14
  */
15
15
 
16
+ (function ( factory ) {
16
17
 
17
- // Create a new scope.
18
- (function() {
18
+ // Register as an anonymous module.
19
+ if ( typeof define === 'function' && define.amd )
20
+ define( ['picker'], factory )
21
+
22
+ // Or using browser globals.
23
+ else factory( Picker )
24
+
25
+ }(function( Picker ) {
19
26
 
20
27
 
21
28
  /**
@@ -175,7 +182,7 @@ TimePicker.prototype.create = function( type, value, options ) {
175
182
  }
176
183
 
177
184
  // If it's an array, convert it into minutes.
178
- else if ( Array.isArray( value ) ) {
185
+ else if ( $.isArray( value ) ) {
179
186
  value = +value[ 0 ] * MINUTES_IN_HOUR + (+value[ 1 ])
180
187
  }
181
188
 
@@ -316,7 +323,7 @@ TimePicker.prototype.disabled = function( timeObject ) {
316
323
  }
317
324
 
318
325
  // If it's an array, create the object and match the times.
319
- if ( Array.isArray( timeToDisable ) ) {
326
+ if ( $.isArray( timeToDisable ) ) {
320
327
  return timeObject.pick == clock.create( timeToDisable ).pick
321
328
  }
322
329
  }).length
@@ -370,7 +377,7 @@ TimePicker.prototype.parse = function( type, value, options ) {
370
377
  clock = this,
371
378
  parsingObject = {}
372
379
 
373
- if ( !value || Picker._.isInteger( value ) || Array.isArray( value ) || Picker._.isDate( value ) || Picker._.isObject( value ) && Picker._.isInteger( value.pick ) ) {
380
+ if ( !value || Picker._.isInteger( value ) || $.isArray( value ) || Picker._.isDate( value ) || Picker._.isObject( value ) && Picker._.isInteger( value.pick ) ) {
374
381
  return value
375
382
  }
376
383
 
@@ -526,10 +533,10 @@ TimePicker.prototype.removeDisabled = function( collection, item ) {
526
533
  * Filter through the disabled collection to find a time unit.
527
534
  */
528
535
  TimePicker.prototype.filterDisabled = function( collection, timeUnit, isRemoving ) {
529
- var timeIsArray = Array.isArray( timeUnit )
536
+ var timeIsArray = $.isArray( timeUnit )
530
537
  return collection.filter( function( disabledTimeUnit ) {
531
538
  var isMatch = !timeIsArray && timeUnit === disabledTimeUnit ||
532
- timeIsArray && Array.isArray( disabledTimeUnit ) && timeUnit.toString() === disabledTimeUnit.toString()
539
+ timeIsArray && $.isArray( disabledTimeUnit ) && timeUnit.toString() === disabledTimeUnit.toString()
533
540
  return isRemoving ? !isMatch : isMatch
534
541
  })
535
542
  } //TimePicker.prototype.filterDisabled
@@ -644,8 +651,7 @@ TimePicker.defaults = (function( prefix ) {
644
651
  Picker.extend( 'pickatime', TimePicker )
645
652
 
646
653
 
647
- // Close the scope.
648
- })();
654
+ }));
649
655
 
650
656
 
651
657
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pickadate-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeff Fraser
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-08-22 00:00:00.000000000 Z
11
+ date: 2013-09-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties