timepiece 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.rdoc +0 -2
- data/app/assets/javascripts/timepiece.js +7 -0
- data/app/helpers/timepiece_helper.rb +2 -7
- 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: 0ca9f94a35c0ae355e6f8ad7f12ca5c6a88d90fd
|
4
|
+
data.tar.gz: dad6b9ec23757434e6867f20d32a44d45d110403
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8aa986e4724d935119c8382ac45c93ae5324c517cd21ad0ab97e0177c214faa78ee1f316df3a69ce83cab03f247b7a10fd46b3d74cbb82dab804d2acc268037c
|
7
|
+
data.tar.gz: 3678591c6d6af7f2c24050282041f1ccdda34c53788c347e6049461c726006c8f8a8612861ea5dffbaf7291c90f293bb194822a842ad2d00027e40277b6f2e54
|
data/README.rdoc
CHANGED
@@ -27,5 +27,3 @@ Timepiece is a Rails plugin providing a simple digital clock, accurate to your s
|
|
27
27
|
* By default, Timepiece shows a 24 hour digital clock. You can show a 12 hour clock by specifying it explicitly.
|
28
28
|
|
29
29
|
<%= timepiece('London', '12') %>
|
30
|
-
|
31
|
-
* Timepiece will automatically generate a digital clock and keep it updated.
|
@@ -57,6 +57,13 @@ function show_time(){
|
|
57
57
|
$('.timepiece-minutes', $(e)).html(( minutes[i] < 10 ? "0" : "" ) + minutes[i]);
|
58
58
|
$('.timepiece-seconds', $(e)).html(( seconds[i] < 10 ? "0" : "" ) + seconds[i]);
|
59
59
|
$('.timepiece-abbr', $(e)).html(abbr);
|
60
|
+
if(abbr == 'am'){
|
61
|
+
$('.timepiece-abbr', $(e)).removeClass('timepiece-abbr-pm');
|
62
|
+
$('.timepiece-abbr', $(e)).addClass('timepiece-abbr-am');
|
63
|
+
} else {
|
64
|
+
$('.timepiece-abbr', $(e)).removeClass('timepiece-abbr-am');
|
65
|
+
$('.timepiece-abbr', $(e)).addClass('timepiece-abbr-pm');
|
66
|
+
}
|
60
67
|
}else{
|
61
68
|
$('.timepiece-hours', $(e)).html(( hours[i] < 10 ? "0" : "" ) + hours[i]);
|
62
69
|
$('.timepiece-minutes', $(e)).html(( minutes[i] < 10 ? "0" : "" ) + minutes[i]);
|
@@ -24,13 +24,8 @@ module TimepieceHelper
|
|
24
24
|
"<span class='timepiece-separator tp-separator-2'>:</span>"\
|
25
25
|
"<span class='timepiece-seconds'>#{seconds}</span>"
|
26
26
|
if type == '12'
|
27
|
-
time = time + "<span class='timepiece-abbr'>#{var}</span>"
|
27
|
+
time = time + "<span class='timepiece-abbr timepiece-abbr-#{var}'>#{var}</span>"
|
28
28
|
end
|
29
29
|
content_tag(:span, time.html_safe, class: 'timepiece', 'data-timezone' => location, 'data-tptype' => type)
|
30
30
|
end
|
31
|
-
end
|
32
|
-
|
33
|
-
|
34
|
-
# Note: add class to timepiece-abbr: timepiece-abbr-#{var} . Working this on the JS side shouldn't be too difficult just...
|
35
|
-
# element.addClass('timepiece-abbr-' + var) right? Except, you have to remove old and add new, toggle or something-something.
|
36
|
-
# Therein lies the difficulty.
|
31
|
+
end
|
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.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thom Bruce
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-09-
|
11
|
+
date: 2014-09-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jquery-rails
|