mumuki-laboratory 7.4.1 → 7.4.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b6e6b25c694e8a00a86fcf06f05f35ab974c9602230eba187884aa16bfdb7168
4
- data.tar.gz: 2648860bd2387704e371d55cb08696dd82b419ee87fbf2df395017aadf7aeccc
3
+ metadata.gz: 1295fcc4775aeabfe0b1efb0d4f6d98395a46cd9decd3f52c1ccf7bc495d32a1
4
+ data.tar.gz: 648f9f2f5041225e95ed8a0ab71845e3d62017da827ada28ded779fae53c8f10
5
5
  SHA512:
6
- metadata.gz: 371db2b5ab6ac40992b65373f2f06a269f022bd6c269c1da24ce26cb1f9c1b7b23049b9994403189d66ea6cf5d56160b2ac452679728c1ace52c295bbb64d4d3
7
- data.tar.gz: 07bdd0405cb1903d7eaf5508d963ef8fa89ed57ad30bfc8023b831c1146d7060a60cf95b1b1cc13a1518e71119cfa76df4ea4f9666c4cb3eb86e41821d7dd5d1
6
+ metadata.gz: dc48be9b23270f06847d7d7c1199e9f16d5a1bd37ff7c04990d9bf62bfe2635e34ffbf843381e6b6fa1537c992cf09812555f49d1bb26811c53a5215ede12b47
7
+ data.tar.gz: de9e92c566eb31509061c5d4325a1849de664cb7c3b1e9bb4cf02f12e592d828fc7d089e5653a8c3d03f3ef76734aec7b9d81edad6859ab7137461f8c279399b
@@ -0,0 +1,17 @@
1
+ var mumuki = mumuki || {};
2
+
3
+ (function (mumuki) {
4
+ // When using Turbolinks, intervals loaded inside <body> aren't destroyed on page changes
5
+ // Use this function instead if you want the behaviour of a regular setInterval
6
+ mumuki.setInterval = function (intervalFunction, milliseconds) {
7
+ const interval = setInterval.apply(this, [intervalFunction, milliseconds]);
8
+
9
+ // Using one to avoid calling clearInterval on every page chance.
10
+ $(document).one('turbolinks:before-cache turbolinks:before-render', function () {
11
+ clearInterval(interval);
12
+ });
13
+
14
+ return interval;
15
+ }.bind(this);
16
+
17
+ }(mumuki));
@@ -313,7 +313,7 @@ mumuki.load(function () {
313
313
  });
314
314
 
315
315
  if (paragraphCount > 1) {
316
- nextSpeechBlinking = setInterval(() => $nextSpeech.fadeTo('slow', 0.1).fadeTo('slow', 1.0), 1000);
316
+ nextSpeechBlinking = mumuki.setInterval(() => $nextSpeech.fadeTo('slow', 0.1).fadeTo('slow', 1.0), 1000);
317
317
  }
318
318
 
319
319
  $nextSpeech.click(showNextParagraph);
@@ -45,7 +45,7 @@ mumuki.load(function () {
45
45
  });
46
46
  },
47
47
  setMessagesInterval: function () {
48
- setInterval(Chat.getMessages, 60000);
48
+ mumuki.setInterval(Chat.getMessages, 60000);
49
49
  },
50
50
  submitMessagesForm: function (url, readUrl, errorUrl) {
51
51
  var $container = $('.mu-view-messages');
@@ -8,7 +8,7 @@ var mumuki = mumuki || {};
8
8
  var duration = moment.duration(diffTime, 'milliseconds');
9
9
  var intervalDuration = 1000;
10
10
 
11
- var interval = setInterval(function () {
11
+ var interval = mumuki.setInterval(function () {
12
12
  duration = moment.utc(duration - intervalDuration);
13
13
  if(duration.valueOf() <= 0) {
14
14
  clearInterval(interval);
@@ -1,5 +1,5 @@
1
1
  module Mumuki
2
2
  module Laboratory
3
- VERSION = '7.4.1'
3
+ VERSION = '7.4.2'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mumuki-laboratory
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.4.1
4
+ version: 7.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Franco Bulgarelli
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-04-03 00:00:00.000000000 Z
11
+ date: 2020-04-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -332,6 +332,7 @@ files:
332
332
  - app/assets/javascripts/mumuki_laboratory/application/discussions.js
333
333
  - app/assets/javascripts/mumuki_laboratory/application/free-form.js
334
334
  - app/assets/javascripts/mumuki_laboratory/application/inputs.js
335
+ - app/assets/javascripts/mumuki_laboratory/application/interval.js
335
336
  - app/assets/javascripts/mumuki_laboratory/application/kids.js
336
337
  - app/assets/javascripts/mumuki_laboratory/application/load-analytics.js
337
338
  - app/assets/javascripts/mumuki_laboratory/application/load-error-svg.js