timepiece 0.1.7 → 0.1.8
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 +4 -4
- data/README.rdoc +10 -0
- data/app/assets/javascripts/timepiece.js +5 -0
- data/lib/timepiece/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e0ba2cabc80d9b08269089f5a54f8d562216e250
|
4
|
+
data.tar.gz: b0e93be345ab5ee53a1d07aed873eb91bf578fb3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 957fa253958318c4329e1446b93f2fd4f38e1ae5dff12ac808b935252a4685dab1e108068d6d784e453975bc051e41b7081e0edc1a99dacf28719bd8015875d8
|
7
|
+
data.tar.gz: 2f4f20eb1b235dec6796734f6ca8f23f30f9291d4f3d02c92b9ba0fc90af53c0c00dde7bf0c4646b8590aa741c433ea5771e13126128729ad21d3f59c42ee756
|
data/README.rdoc
CHANGED
@@ -14,6 +14,8 @@ Timepiece is a Rails plugin providing a simple digital clock, accurate to your s
|
|
14
14
|
|
15
15
|
//= require timepiece
|
16
16
|
|
17
|
+
Note: If you're using Turbolinks with your Rails project, you should also install jquery-turbolinks to ensure functionality is maintained between page loads.
|
18
|
+
|
17
19
|
== Usage
|
18
20
|
|
19
21
|
* Add a functional clock to your views
|
@@ -53,3 +55,11 @@ You can apply your own styles to any part of the Timepiece clock. For instance,
|
|
53
55
|
* Add punctuation to am/pm abbreviation
|
54
56
|
|
55
57
|
<%= timepiece('London', type: '12', abbr_sep: '.') %>
|
58
|
+
|
59
|
+
== Timer
|
60
|
+
|
61
|
+
It is now also possible to make use of a basic timer. To start a count from `Time.now`, simply include `timer` in your Rails projects.
|
62
|
+
|
63
|
+
* The helper also takes a time object as a parameter, for example:
|
64
|
+
|
65
|
+
<%= timer(User.first.created_at) %>
|
@@ -147,8 +147,13 @@ $(document).ready(function(){
|
|
147
147
|
})
|
148
148
|
$(document).on('page:load', function(){
|
149
149
|
clearInterval(clock);
|
150
|
+
reset_time();
|
150
151
|
clearInterval(timer);
|
151
152
|
// Quickfix for Turbolinks. We should revisit this.
|
153
|
+
// Note we also need jquery-turbolinks to be installed (should at least make users aware of this)
|
154
|
+
// And currently navigation via browser history buttons will break our clocks. FIXME:
|
155
|
+
// quick solution - 'onhashchange' . Why we're not using it: Covers more events than we need to refresh for - AJAX cost too high.
|
156
|
+
// We're going to need something a little more custom.
|
152
157
|
})
|
153
158
|
$(window).focus(function(){
|
154
159
|
reset_time()
|
data/lib/timepiece/version.rb
CHANGED