timepiece 0.1.12 → 0.1.13

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: 4011a52353edd24eb8f23f78304aec8dd6d07b93
4
- data.tar.gz: a5df48bc631f9b27564bdd0a9d603f95880db673
3
+ metadata.gz: ff5251b8b6973a70f024d871dc54fce5bf0aed45
4
+ data.tar.gz: 289fb35868381acec7933c2d8245336f0ed3eb35
5
5
  SHA512:
6
- metadata.gz: ca13f3397694238ec9a55e32caf22299c8e60b1c57f8196515cbe94779b43bafd9f7f507e9006e497714bb344af0eb35d36c2caf8854ef6b9de0c9842253c689
7
- data.tar.gz: a8d991df7a968ab69141b51d283e2b81a3b5f45fecfeb31e59a128e0ee63e5371ff0555eed3fa006ec78b40813be78496525b15977520de370b0f74c136e4036
6
+ metadata.gz: 36859e08b891ab87139500eefa4f2a3012180d753cf5557c501b374aeddf7cdd462b712e1c21460ea1bcf9859b604c9176e0587a476f21e1332cb7737f2e95b1
7
+ data.tar.gz: ed9a736eea145fdcbea072c6f5bc51acf1252a771dda514f03f3e52507a1aac38d1766524ba4a7693a3a6b20a739afeb3985c7e793df3c15f64171c7d42bc190
@@ -195,6 +195,22 @@ function reset_time(){
195
195
  get_time()
196
196
  }
197
197
 
198
+ function reset_timer(){
199
+ get_timer_days = []
200
+ get_timer_hours = []
201
+ get_timer_minutes = []
202
+ get_timer_seconds = []
203
+ set_timer()
204
+ }
205
+
206
+ function reset_countdown(){
207
+ get_countdown_days = []
208
+ get_countdown_hours = []
209
+ get_countdown_minutes = []
210
+ get_countdown_seconds = []
211
+ set_countdown()
212
+ }
213
+
198
214
  $(document).ready(function(){
199
215
  // Might want to reformat to move if-statement : should also be performed before 'reset_time' so as not to make a blank AJAX request.
200
216
  if ($(".timepiece").length > 0){
@@ -211,10 +227,18 @@ $(document).ready(function(){
211
227
  }
212
228
  })
213
229
  $(document).on('page:load', function(){
214
- clearInterval(clock);
215
- reset_time();
216
- clearInterval(timer);
217
- clearInterval(countdown);
230
+ if ($(".timepiece").length > 0){
231
+ clearInterval(clock);
232
+ reset_time();
233
+ }
234
+ if ($(".timepiece-timer").length > 0){
235
+ clearInterval(timer);
236
+ reset_timer();
237
+ }
238
+ if ($(".timepiece-countdown").length > 0){
239
+ clearInterval(countdown);
240
+ reset_countdown();
241
+ }
218
242
  // Quickfix for Turbolinks. We should revisit this.
219
243
  // Note we also need jquery-turbolinks to be installed (should at least make users aware of this)
220
244
  // And currently navigation via browser history buttons will break our clocks. FIXME:
@@ -1,3 +1,3 @@
1
1
  module Timepiece
2
- VERSION = "0.1.12"
2
+ VERSION = "0.1.13"
3
3
  end
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.12
4
+ version: 0.1.13
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-03-18 00:00:00.000000000 Z
11
+ date: 2015-04-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jquery-rails