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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e997e4b727711f3f7d92b83031057177279b0a43
4
- data.tar.gz: 8ceacee309c47761dace76374b0ba6fc4420ad3d
3
+ metadata.gz: e0ba2cabc80d9b08269089f5a54f8d562216e250
4
+ data.tar.gz: b0e93be345ab5ee53a1d07aed873eb91bf578fb3
5
5
  SHA512:
6
- metadata.gz: ef1164269db5b52505477edc7050349823e71acca5b53773b48a81dfd349a2a9dd4801a6b5e67932165cf652225bb8f4752ff3f18b69f47586fa2f16b9a59730
7
- data.tar.gz: f9fca8463aa8fe0a24bd9235e2219e50022c8d456d614d21e44815694f00ed9e64b6d3149883455cc3e55bdea3c2a5ba8566b7a61c7a46a562c3a68e047776cc
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()
@@ -1,3 +1,3 @@
1
1
  module Timepiece
2
- VERSION = "0.1.7"
2
+ VERSION = "0.1.8"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: timepiece
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thom Bruce