timepiece 0.2.10 → 0.2.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/timepiece.js +6 -6
- data/app/helpers/timepiece_helper.rb +6 -6
- data/lib/timepiece/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ac6efdf331bb0b17f63ab0cac25a119b81d4d777
|
4
|
+
data.tar.gz: b65569f6c75839a15386af593e8b3ffa97bb6243
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 109bb9fb982545a19088753d7853d4d190cf23c6efcbe88406ffa230e3912a5a9f64457aa62ac63c61ba03fcb7defd20404066394347d33c02ea36a60e51195b
|
7
|
+
data.tar.gz: 14a2dbdca298612e79a27d13fc4f8ded53c38fd22daa6ab483a1c5101a74db96516bda8afe30792ee41419ccde23c75aab8bbb231cabac41b1f24e228cb82102
|
@@ -207,19 +207,19 @@
|
|
207
207
|
} else {
|
208
208
|
$('.tp-descriptor-days', $(e)).html(' days ');
|
209
209
|
}
|
210
|
-
$('.timepiece-hours', $(e)).html(timer_hours[i]);
|
210
|
+
$('.timepiece-hours', $(e)).html(( timer_hours[i] < 10 ? "0" : "" ) + timer_hours[i]);
|
211
211
|
if (timer_hours[i] == 1){
|
212
212
|
$('.tp-descriptor-hours', $(e)).html(' hour ');
|
213
213
|
} else {
|
214
214
|
$('.tp-descriptor-hours', $(e)).html(' hours ');
|
215
215
|
}
|
216
|
-
$('.timepiece-minutes', $(e)).html(timer_minutes[i]);
|
216
|
+
$('.timepiece-minutes', $(e)).html(( timer_minutes[i] < 10 ? "0" : "" ) + timer_minutes[i]);
|
217
217
|
if (timer_minutes[i] == 1){
|
218
218
|
$('.tp-descriptor-minutes', $(e)).html(' minute ');
|
219
219
|
} else {
|
220
220
|
$('.tp-descriptor-minutes', $(e)).html(' minutes ');
|
221
221
|
}
|
222
|
-
$('.timepiece-seconds', $(e)).html(timer_seconds[i]);
|
222
|
+
$('.timepiece-seconds', $(e)).html(( timer_seconds[i] < 10 ? "0" : "" ) + timer_seconds[i]);
|
223
223
|
if (timer_seconds[i] == 1){
|
224
224
|
$('.tp-descriptor-seconds', $(e)).html(' second ');
|
225
225
|
} else {
|
@@ -284,19 +284,19 @@
|
|
284
284
|
} else {
|
285
285
|
$('.tp-descriptor-days', $(e)).html(' days ');
|
286
286
|
}
|
287
|
-
$('.timepiece-hours', $(e)).html(countdown_hours[i]);
|
287
|
+
$('.timepiece-hours', $(e)).html(( countdown_hours[i] < 10 ? "0" : "" ) + countdown_hours[i]);
|
288
288
|
if (countdown_hours[i] == 1){
|
289
289
|
$('.tp-descriptor-hours', $(e)).html(' hour ');
|
290
290
|
} else {
|
291
291
|
$('.tp-descriptor-hours', $(e)).html(' hours ');
|
292
292
|
}
|
293
|
-
$('.timepiece-minutes', $(e)).html(countdown_minutes[i]);
|
293
|
+
$('.timepiece-minutes', $(e)).html(( countdown_minutes[i] < 10 ? "0" : "" ) + countdown_minutes[i]);
|
294
294
|
if (countdown_minutes[i] == 1){
|
295
295
|
$('.tp-descriptor-minutes', $(e)).html(' minute ');
|
296
296
|
} else {
|
297
297
|
$('.tp-descriptor-minutes', $(e)).html(' minutes ');
|
298
298
|
}
|
299
|
-
$('.timepiece-seconds', $(e)).html(countdown_seconds[i]);
|
299
|
+
$('.timepiece-seconds', $(e)).html(( countdown_seconds[i] < 10 ? "0" : "" ) + countdown_seconds[i]);
|
300
300
|
if (countdown_seconds[i] == 1){
|
301
301
|
$('.tp-descriptor-seconds', $(e)).html(' second ');
|
302
302
|
} else {
|
@@ -81,11 +81,11 @@ module TimepieceHelper
|
|
81
81
|
|
82
82
|
time = "<span class='timepiece-days'>#{days.to_s}</span>"\
|
83
83
|
"<span class='timepiece-separator tp-separator-days-hours'>:</span>"\
|
84
|
-
"<span class='timepiece-hours'>#{hours
|
84
|
+
"<span class='timepiece-hours'>#{"%02d" % hours}</span>"\
|
85
85
|
"<span class='timepiece-separator tp-separator-hours-minutes'>:</span>"\
|
86
|
-
"<span class='timepiece-minutes'>#{minutes
|
86
|
+
"<span class='timepiece-minutes'>#{"%02d" % minutes}</span>"\
|
87
87
|
"<span class='timepiece-separator tp-separator-minutes-seconds'>:</span>"\
|
88
|
-
"<span class='timepiece-seconds'>#{seconds
|
88
|
+
"<span class='timepiece-seconds'>#{"%02d" % seconds}</span>"
|
89
89
|
# "<span class='timepiece-seconds'>#{seconds.to_s.rjust(2, '0')}</span>" # Note: rjust; it might be useful.
|
90
90
|
|
91
91
|
content_tag(:span, time.html_safe, class: 'timepiece-timer', 'data-days' => days, 'data-hours' => hours, 'data-minutes' => minutes, 'data-seconds' => seconds, 'id' => (id unless id.blank?))
|
@@ -133,11 +133,11 @@ module TimepieceHelper
|
|
133
133
|
|
134
134
|
time = "<span class='timepiece-days'>#{days.to_s}</span>"\
|
135
135
|
"<span class='timepiece-separator tp-separator-days-hours'>:</span>"\
|
136
|
-
"<span class='timepiece-hours'>#{hours
|
136
|
+
"<span class='timepiece-hours'>#{"%02d" % hours}</span>"\
|
137
137
|
"<span class='timepiece-separator tp-separator-hours-minutes'>:</span>"\
|
138
|
-
"<span class='timepiece-minutes'>#{minutes
|
138
|
+
"<span class='timepiece-minutes'>#{"%02d" % minutes}</span>"\
|
139
139
|
"<span class='timepiece-separator tp-separator-minutes-seconds'>:</span>"\
|
140
|
-
"<span class='timepiece-seconds'>#{seconds
|
140
|
+
"<span class='timepiece-seconds'>#{"%02d" % seconds}</span>"
|
141
141
|
# "<span class='timepiece-seconds'>#{seconds.to_s.rjust(2, '0')}</span>" # Note: rjust; it might be useful.
|
142
142
|
|
143
143
|
content_tag(:span, time.html_safe, class: 'timepiece-countdown', 'data-days' => days, 'data-hours' => hours, 'data-minutes' => minutes, 'data-seconds' => seconds, 'id' => (id unless id.blank?))
|
data/lib/timepiece/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: timepiece
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thom Bruce
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-05-
|
11
|
+
date: 2015-05-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jquery-rails
|