visibilityjs 0.6 → 0.6.1
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog +3 -0
- data/README.md +8 -8
- data/lib/assets/javascripts/visibility.core.js +2 -2
- data/lib/assets/javascripts/visibility.js +2 -2
- metadata +2 -2
data/ChangeLog
CHANGED
data/README.md
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
# Visibility.js – a wrapper for the Page Visibility API
|
2
2
|
|
3
3
|
Visibility.js allows you to determine whether your web page is visible to a
|
4
|
-
user, is hidden in background tab or is prerendering. It allows you to use the
|
5
|
-
visibility state in JavaScript logic and improve browser performance by
|
4
|
+
user, is hidden in background tab or is prerendering. It allows you to use the
|
5
|
+
page visibility state in JavaScript logic and improve browser performance by
|
6
6
|
disabling unnecessary timers and AJAX requests, or improve user interface
|
7
7
|
experience (for example, by stopping video playback or slideshow when user
|
8
8
|
switches to another browser tab).
|
@@ -21,10 +21,10 @@ actually supported in the browser as, if it does not, the library will just
|
|
21
21
|
assume that the page is visible all the time, and your logic will still work
|
22
22
|
correctly, albeit less effective in some cases.
|
23
23
|
|
24
|
-
Page Visibility API is natively supported by Google Chrome, Firefox
|
25
|
-
For
|
26
|
-
hack (note that this hack have issue, that document become
|
27
|
-
when browser just lose focus, but still visible for user).
|
24
|
+
Page Visibility API is natively supported by Google Chrome 13, Firefox 10,
|
25
|
+
Opera 12.10 and IE 10. For old browsers you can use `lib/visibility.fallback.js`
|
26
|
+
with focus/blur hack (note that this hack have issue, that document become
|
27
|
+
to be hidden, when browser just lose focus, but still visible for user).
|
28
28
|
|
29
29
|
Sponsored by [Evil Martians].
|
30
30
|
|
@@ -123,7 +123,7 @@ the page:
|
|
123
123
|
|
124
124
|
```js
|
125
125
|
Visibility.onVisible(function () {
|
126
|
-
|
126
|
+
startIntroAnimation();
|
127
127
|
});
|
128
128
|
```
|
129
129
|
|
@@ -296,7 +296,7 @@ For Ruby on Rails you can use gem for Assets Pipeline.
|
|
296
296
|
If you don’t use any assets packaging manager use [CDNJS]. Add to your site:
|
297
297
|
|
298
298
|
```html
|
299
|
-
<script src="//cdnjs.cloudflare.com/ajax/libs/visibility.js/0.6/visibility.min.js"></script>
|
299
|
+
<script src="//cdnjs.cloudflare.com/ajax/libs/visibility.js/0.6.1/visibility.min.js"></script>
|
300
300
|
```
|
301
301
|
|
302
302
|
[CDNJS]: http://cdnjs.com/
|
@@ -38,7 +38,7 @@
|
|
38
38
|
// visible now.
|
39
39
|
//
|
40
40
|
// Visibility.onVisible(function () {
|
41
|
-
//
|
41
|
+
// startIntroAnimation();
|
42
42
|
// });
|
43
43
|
onVisible: function (callback) {
|
44
44
|
if ( !this.isSupported() || !this.hidden() ) {
|
@@ -160,7 +160,7 @@
|
|
160
160
|
_doc: window.document,
|
161
161
|
|
162
162
|
// Vendor prefixes to create event and properties names.
|
163
|
-
_prefixes: ['webkit', 'moz'
|
163
|
+
_prefixes: ['webkit', 'moz'],
|
164
164
|
|
165
165
|
// Vendor prefix cached by `_prefix` function.
|
166
166
|
_chechedPrefix: null,
|
@@ -38,7 +38,7 @@
|
|
38
38
|
// visible now.
|
39
39
|
//
|
40
40
|
// Visibility.onVisible(function () {
|
41
|
-
//
|
41
|
+
// startIntroAnimation();
|
42
42
|
// });
|
43
43
|
onVisible: function (callback) {
|
44
44
|
if ( !this.isSupported() || !this.hidden() ) {
|
@@ -160,7 +160,7 @@
|
|
160
160
|
_doc: window.document,
|
161
161
|
|
162
162
|
// Vendor prefixes to create event and properties names.
|
163
|
-
_prefixes: ['webkit', 'moz'
|
163
|
+
_prefixes: ['webkit', 'moz'],
|
164
164
|
|
165
165
|
// Vendor prefix cached by `_prefix` function.
|
166
166
|
_chechedPrefix: null,
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: visibilityjs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 0.6.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-11-08 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: sprockets
|