pickadate-rails 1.2.1 → 1.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/pickadate-rails/version.rb +1 -1
- data/vendor/assets/javascripts/pickadate/picker.date.js +1 -1
- data/vendor/assets/javascripts/pickadate/picker.js +43 -44
- data/vendor/assets/javascripts/pickadate/picker.time.js +3 -3
- data/vendor/assets/javascripts/pickadate/translations/ar.js +12 -0
- data/vendor/assets/javascripts/pickadate/translations/ja_JP.js +13 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bffbcae47e5f55e6d32526767fcf693c077792bb
|
4
|
+
data.tar.gz: 85a51f2380b3660d65f9388cde75111ae396ff5a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8908ca9658c8086000236fabcae3d64e5103a919fe0fcc0d8eb39761044d2bc3a4e611d5186e0685427997498ab84c88a877658f90e20ca3f57baddedf0a235b
|
7
|
+
data.tar.gz: 0e541d80e35e9b826a50a0fd824ec3f48db30231455ee89de487e2170f684e90727d0975ba4b4142a745f780a6bd18b1a6d40bba97a03a5cd702eda7a127d576
|
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.
|
3
|
+
## Pickadate Version: 3.2.2
|
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,6 +1,6 @@
|
|
1
1
|
|
2
2
|
/*!
|
3
|
-
* pickadate.js v3.2.
|
3
|
+
* pickadate.js v3.2.2, 2013/09/19
|
4
4
|
* By Amsul, http://amsul.ca
|
5
5
|
* Hosted on http://amsul.github.io/pickadate.js
|
6
6
|
* Licensed under MIT
|
@@ -88,8 +88,8 @@ function PickerConstructor( ELEMENT, NAME, COMPONENT, OPTIONS ) {
|
|
88
88
|
STATE.type = ELEMENT.type
|
89
89
|
|
90
90
|
|
91
|
-
// Confirm focus state,
|
92
|
-
//
|
91
|
+
// Confirm focus state, convert into text input to remove UA stylings,
|
92
|
+
// and set as readonly to prevent keyboard popup.
|
93
93
|
ELEMENT.autofocus = ELEMENT == document.activeElement
|
94
94
|
ELEMENT.type = 'text'
|
95
95
|
ELEMENT.readOnly = true
|
@@ -100,57 +100,56 @@ function PickerConstructor( ELEMENT, NAME, COMPONENT, OPTIONS ) {
|
|
100
100
|
|
101
101
|
|
102
102
|
// Create the picker root with a new wrapped holder and bind the events.
|
103
|
-
P.$root = $( PickerConstructor._.node( 'div', createWrappedComponent(), CLASSES.picker ) ).
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
},
|
111
|
-
|
112
|
-
// If the event is not on the root holder, stop it from bubbling to the doc.
|
113
|
-
mousedown: function( event ) {
|
114
|
-
if ( event.target != P.$root.children()[ 0 ] ) {
|
103
|
+
P.$root = $( PickerConstructor._.node( 'div', createWrappedComponent(), CLASSES.picker ) ).
|
104
|
+
on({
|
105
|
+
|
106
|
+
// When something within the root is focused, stop from bubbling
|
107
|
+
// to the doc and remove the “focused” state from the root.
|
108
|
+
focusin: function( event ) {
|
109
|
+
P.$root.removeClass( CLASSES.focused )
|
115
110
|
event.stopPropagation()
|
116
|
-
}
|
117
|
-
},
|
111
|
+
},
|
118
112
|
|
119
|
-
|
120
|
-
|
113
|
+
// If the click is not on the root holder, stop it from bubbling to the doc.
|
114
|
+
'mousedown click': function( event ) {
|
115
|
+
if ( event.target != P.$root.children()[ 0 ] ) {
|
116
|
+
event.stopPropagation()
|
117
|
+
}
|
118
|
+
}
|
119
|
+
}).
|
121
120
|
|
122
|
-
|
123
|
-
|
124
|
-
targetData = $target.data()
|
121
|
+
// If there’s a click on an actionable element, carry out the actions.
|
122
|
+
on( 'click', '[data-pick], [data-nav], [data-clear]', function() {
|
125
123
|
|
126
|
-
|
127
|
-
|
124
|
+
var $target = $( this ),
|
125
|
+
targetData = $target.data(),
|
126
|
+
targetDisabled = $target.hasClass( CLASSES.navDisabled ) || $target.hasClass( CLASSES.disabled ),
|
128
127
|
|
129
|
-
//
|
130
|
-
|
128
|
+
// * For IE, non-focusable elements can be active elements as well
|
129
|
+
// (http://stackoverflow.com/a/2684561).
|
130
|
+
activeElement = document.activeElement
|
131
|
+
activeElement = activeElement && ( activeElement.type || activeElement.href )
|
131
132
|
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
133
|
+
// If it’s disabled or nothing inside is actively focused, re-focus the element.
|
134
|
+
if ( targetDisabled || !$.contains( P.$root[0], activeElement ) ) {
|
135
|
+
ELEMENT.focus()
|
136
|
+
}
|
136
137
|
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
138
|
+
// If something is superficially changed, update the `highlight` based on the `nav`.
|
139
|
+
if ( targetData.nav && !targetDisabled ) {
|
140
|
+
P.set( 'highlight', P.component.item.highlight, { nav: targetData.nav } )
|
141
|
+
}
|
141
142
|
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
143
|
+
// If something is picked, set `select` then close with focus.
|
144
|
+
else if ( PickerConstructor._.isInteger( targetData.pick ) && !targetDisabled ) {
|
145
|
+
P.set( 'select', targetData.pick ).close( true )
|
146
|
+
}
|
146
147
|
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
}
|
148
|
+
// If a “clear” button is pressed, empty the values and close with focus.
|
149
|
+
else if ( targetData.clear ) {
|
150
|
+
P.clear().close( true )
|
151
151
|
}
|
152
|
-
}
|
153
|
-
}) //P.$root
|
152
|
+
}) //P.$root
|
154
153
|
|
155
154
|
|
156
155
|
// If there’s a format for the hidden input element, create the element
|
@@ -1,6 +1,6 @@
|
|
1
1
|
|
2
2
|
/*!
|
3
|
-
* Time picker for pickadate.js v3.2.
|
3
|
+
* Time picker for pickadate.js v3.2.2
|
4
4
|
* http://amsul.github.io/pickadate.js/time.htm
|
5
5
|
*/
|
6
6
|
|
@@ -437,13 +437,13 @@ TimePicker.prototype.formats = {
|
|
437
437
|
|
438
438
|
// If there's string, then get the digits length.
|
439
439
|
// Otherwise return the selected hour in "military" format as a string.
|
440
|
-
return string ? Picker._.digits( string ) : '' + timeObject.hour
|
440
|
+
return string ? Picker._.digits( string ) : '' + ( timeObject.hour % 24 )
|
441
441
|
},
|
442
442
|
HH: function( string, timeObject ) {
|
443
443
|
|
444
444
|
// If there's string, then get the digits length.
|
445
445
|
// Otherwise return the selected hour in "military" format with a leading zero.
|
446
|
-
return string ? Picker._.digits( string ) : Picker._.lead( timeObject.hour )
|
446
|
+
return string ? Picker._.digits( string ) : Picker._.lead( timeObject.hour % 24 )
|
447
447
|
},
|
448
448
|
i: function( string, timeObject ) {
|
449
449
|
|
@@ -0,0 +1,12 @@
|
|
1
|
+
// Arabic
|
2
|
+
|
3
|
+
$.extend( $.fn.pickadate.defaults, {
|
4
|
+
monthsFull: [ 'يناير', 'فبراير', 'مارس', 'ابريل', 'مايو', 'يونيو', 'يوليو', 'اغسطس', 'سبتمبر', 'اكتوبر', 'نوفمبر', 'ديسمبر' ],
|
5
|
+
monthsShort: [ 'يناير', 'فبراير', 'مارس', 'ابريل', 'مايو', 'يونيو', 'يوليو', 'اغسطس', 'سبتمبر', 'اكتوبر', 'نوفمبر', 'ديسمبر' ],
|
6
|
+
weekdaysFull: [ 'الاحد', 'الاثنين', 'الثلاثاء', 'الاربعاء', 'الخميس', 'الجمعة', 'السبت' ],
|
7
|
+
weekdaysShort: [ 'الاحد', 'الاثنين', 'الثلاثاء', 'الاربعاء', 'الخميس', 'الجمعة', 'السبت' ],
|
8
|
+
today: 'اليوم',
|
9
|
+
clear: 'مسح',
|
10
|
+
format: 'yyyy mmmm dd',
|
11
|
+
formatSubmit: 'yyyy/mm/dd'
|
12
|
+
});
|
@@ -0,0 +1,13 @@
|
|
1
|
+
// Japanese
|
2
|
+
|
3
|
+
jQuery.extend( jQuery.fn.pickadate.defaults, {
|
4
|
+
monthsFull: [ '1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月' ],
|
5
|
+
monthsShort: [ '1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月' ],
|
6
|
+
weekdaysFull: [ '日曜日', '月曜日', '火曜日', '水曜日', '木曜日', '金曜日', '土曜日' ],
|
7
|
+
weekdaysShort: [ '日曜日', '月曜日', '火曜日', '水曜日', '木曜日', '金曜日', '土曜日' ],
|
8
|
+
today: '今日',
|
9
|
+
clear: '消去',
|
10
|
+
firstDay: 1,
|
11
|
+
format: 'yyyy mm dd',
|
12
|
+
formatSubmit: 'yyyy/mm/dd'
|
13
|
+
});
|
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.
|
4
|
+
version: 1.2.2
|
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-09-
|
11
|
+
date: 2013-09-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|
@@ -72,6 +72,7 @@ files:
|
|
72
72
|
- vendor/assets/javascripts/pickadate/picker.js
|
73
73
|
- vendor/assets/javascripts/pickadate/picker.time.js
|
74
74
|
- vendor/assets/javascripts/pickadate/translations/NAMING.md
|
75
|
+
- vendor/assets/javascripts/pickadate/translations/ar.js
|
75
76
|
- vendor/assets/javascripts/pickadate/translations/bg_BG.js
|
76
77
|
- vendor/assets/javascripts/pickadate/translations/bs_BA.js
|
77
78
|
- vendor/assets/javascripts/pickadate/translations/ca_ES.js
|
@@ -89,6 +90,7 @@ files:
|
|
89
90
|
- vendor/assets/javascripts/pickadate/translations/hu_HU.js
|
90
91
|
- vendor/assets/javascripts/pickadate/translations/id_ID.js
|
91
92
|
- vendor/assets/javascripts/pickadate/translations/it_IT.js
|
93
|
+
- vendor/assets/javascripts/pickadate/translations/ja_JP.js
|
92
94
|
- vendor/assets/javascripts/pickadate/translations/ko_KR.js
|
93
95
|
- vendor/assets/javascripts/pickadate/translations/nl_NL.js
|
94
96
|
- vendor/assets/javascripts/pickadate/translations/no_NO.js
|