visibilityjs 1.2.4 → 1.2.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/ChangeLog.md +21 -5
- data/README.md +9 -0
- data/lib/visibility.core.js +0 -2
- data/lib/visibility.fallback.js +1 -3
- data/lib/visibility.timers.js +1 -3
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 4c53a8cd2dc153ab5f352b958f2f9beacec50eb4c6c2f54d695881f07a32d595
|
4
|
+
data.tar.gz: 969b46b300d97867266d7f177b81ebecc0efa15af20151b81d01bdd3d040c08c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6ee8a80a9f32cb6c24c0918c7d5770427f6f8f834138fcdfcfc5fb8f88c61a02af1e3a9e587d9eb5e74394f9af517750689cd30fcc63b2cff4590f76535229af
|
7
|
+
data.tar.gz: 276148ff13be602f18b6d748937ef982161fdcd73f1f7f613ab6fe1b9bd434e757da07136096c6f4d03fb7dd2b3d727f2e8ac9f2f2220c0b6f78c88f11c01c38
|
data/ChangeLog.md
CHANGED
@@ -1,17 +1,33 @@
|
|
1
|
-
|
1
|
+
# Change Log
|
2
|
+
|
3
|
+
## 1.2.8 “Pioneer 5, solar wind”
|
4
|
+
* Fix TypeScript module declaration by @maciejmrozinski.
|
5
|
+
* Fix headless Chrome support by @runspired.
|
6
|
+
* Reduce project size.
|
7
|
+
|
8
|
+
## 1.2.7 “Discoverer 8, hard”
|
9
|
+
* Fix type definitions by @dpoetzsch.
|
10
|
+
|
11
|
+
## 1.2.6 “Discoverer 7, powerless”
|
12
|
+
* Fix type definitions for TypeScript 2.6 by @marayfirth.
|
13
|
+
|
14
|
+
## 1.2.5 “Explorer 7, solar x-ray”
|
15
|
+
* Add TypeScript definitions by Joel Hernández.
|
16
|
+
|
17
|
+
## 1.2.4 “Luna 3, Dark side of the Moon”
|
2
18
|
* Fix race condition by Mikhail Vazhnov.
|
3
19
|
|
4
|
-
|
20
|
+
## 1.2.3 “Vanguard 3, 300 years”
|
5
21
|
* Fix Rails support by @dimko.
|
6
22
|
|
7
|
-
|
23
|
+
## 1.2.2 “Luna 2, impact”
|
8
24
|
* Fix Sprockets 3 support by Waseem Sadiq.
|
9
25
|
* Add Component support by Mitchel Kelonye.
|
10
26
|
|
11
|
-
|
27
|
+
## 1.2.1 “Discoverer 6, again”
|
12
28
|
* Fix Bower config by Misha Ponizil.
|
13
29
|
|
14
|
-
|
30
|
+
## 1.2.0 “Discoverer 5, spy”
|
15
31
|
* Allow to use in CommonJS.
|
16
32
|
* Release npm package.
|
17
33
|
* Reduce library size to 10 %.
|
data/README.md
CHANGED
@@ -28,6 +28,10 @@ hack has an issue: when browser just lose focus but still visible for user, its
|
|
28
28
|
[prerendering]: http://code.google.com/chrome/whitepapers/prerender.html
|
29
29
|
[natively supported]: http://caniuse.com/pagevisibility
|
30
30
|
|
31
|
+
## Demo
|
32
|
+
|
33
|
+
https://ai.github.io/visibilityjs/
|
34
|
+
|
31
35
|
## Translations
|
32
36
|
|
33
37
|
Документация на русском:
|
@@ -68,6 +72,11 @@ Visibility.every(minute, 5 * minute, function () {
|
|
68
72
|
});
|
69
73
|
```
|
70
74
|
|
75
|
+
When the page becomes visible, if the callback has not been called in longer than
|
76
|
+
the visible interval, it will be called immediately. In the example above, if you
|
77
|
+
hid the page for 9 minutes, `checkForEmail` will get called once while the page is hidden,
|
78
|
+
and immediately when it is made visible.
|
79
|
+
|
71
80
|
`Visibility.every` returns a timer identifier, much like the `setInterval`
|
72
81
|
function. However, it cannot be passed to `clearInterval`, and you should use
|
73
82
|
`Visibility.stop(id)` to stop the timer.
|
data/lib/visibility.core.js
CHANGED
data/lib/visibility.fallback.js
CHANGED
@@ -9,10 +9,8 @@
|
|
9
9
|
// For Firefox 5–9 it will be better to use MozVisibility hack without
|
10
10
|
// this issue. See <https://github.com/private-face/mozvisibility>.
|
11
11
|
;(function (document) {
|
12
|
-
"use strict";
|
13
|
-
|
14
12
|
if ( document.visibilityState || document.webkitVisibilityState ) {
|
15
|
-
|
13
|
+
return;
|
16
14
|
}
|
17
15
|
|
18
16
|
document.hidden = false;
|
data/lib/visibility.timers.js
CHANGED
@@ -1,6 +1,4 @@
|
|
1
1
|
;(function (window) {
|
2
|
-
"use strict";
|
3
|
-
|
4
2
|
var lastTimer = -1;
|
5
3
|
|
6
4
|
var install = function (Visibility) {
|
@@ -157,7 +155,7 @@
|
|
157
155
|
if ( typeof(module) != 'undefined' && module.exports ) {
|
158
156
|
module.exports = install(require('./visibility.core'));
|
159
157
|
} else {
|
160
|
-
install(window.Visibility)
|
158
|
+
install(window.Visibility || require('./visibility.core'))
|
161
159
|
}
|
162
160
|
|
163
161
|
})(window);
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: visibilityjs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrey Sitnik
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-05-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sprockets
|
@@ -65,7 +65,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
65
65
|
version: '0'
|
66
66
|
requirements: []
|
67
67
|
rubyforge_project:
|
68
|
-
rubygems_version: 2.
|
68
|
+
rubygems_version: 2.7.6
|
69
69
|
signing_key:
|
70
70
|
specification_version: 4
|
71
71
|
summary: Wrapper for the Page Visibility API
|