jquery-facebook 0.1.0 → 0.2.0
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 +7 -0
- data/README.md +9 -0
- data/jquery-facebook.gemspec +1 -1
- data/lib/jquery-facebook/version.rb +1 -1
- data/vendor/assets/javascripts/jquery.facebook.js +17 -7
- metadata +8 -10
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: da942a84bac667051521b911d80017f6bebbfa8a
|
4
|
+
data.tar.gz: 717f2db88090490b221c6a06553d13ba3b1c55cd
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: edd69736ff857ea59e484d94ce77ba6a22b0b5319666760db0094abd6b200f4c0db0cb585417fd6789141cbcf155613c3c5288197815ca7f6f6096d1371e104d
|
7
|
+
data.tar.gz: 7668d5eea8994ef38effaa8d2ac4137ad1c9758d4a477a3ceb0924ceb1025e144b14dd58096029f3be060782749498797d5bbbc7002900f43e809eb2b16ca5b9
|
data/README.md
CHANGED
@@ -54,6 +54,15 @@ triggered.
|
|
54
54
|
alert('Done!');
|
55
55
|
});
|
56
56
|
|
57
|
+
Another way is to pass callback to the `$.facebookLoaded` function which will set
|
58
|
+
the facebook:init event handler if facebook isn't loaded yet and fire the
|
59
|
+
callback right away if it it.
|
60
|
+
|
61
|
+
$.facebookLoaded(function () {
|
62
|
+
alert('Done!');
|
63
|
+
});
|
64
|
+
|
65
|
+
|
57
66
|
## Contributing
|
58
67
|
|
59
68
|
1. Fork it
|
data/jquery-facebook.gemspec
CHANGED
@@ -6,7 +6,7 @@ Gem::Specification.new do |gem|
|
|
6
6
|
gem.email = ["antonrogov@me.com"]
|
7
7
|
gem.summary = "Facebook JavaScript SDK loader"
|
8
8
|
gem.description = "Facebook JavaScript SDK unobtrusive loader for jQuery and Rails"
|
9
|
-
gem.homepage = "http://github.com/
|
9
|
+
gem.homepage = "http://github.com/antonrogov/jquery-facebook"
|
10
10
|
|
11
11
|
gem.files = `git ls-files`.split($\)
|
12
12
|
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
@@ -1,3 +1,5 @@
|
|
1
|
+
window.facebookLoaded = false;
|
2
|
+
|
1
3
|
$.facebookInit = function (options) {
|
2
4
|
var defaults = { status: true,
|
3
5
|
cookie: true,
|
@@ -10,16 +12,24 @@ $.facebookInit = function (options) {
|
|
10
12
|
|
11
13
|
window.fbAsyncInit = function () {
|
12
14
|
FB.init($.extend(defaults, options));
|
15
|
+
window.facebookLoaded = true;
|
13
16
|
$(document).trigger('facebook:init');
|
14
17
|
};
|
15
18
|
|
16
|
-
if (!$(
|
19
|
+
if (!$("div#fb-root").length) {
|
17
20
|
$('body').append('<div id="fb-root"></div>');
|
18
21
|
}
|
19
22
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
23
|
+
var e = document.createElement('script');
|
24
|
+
e.async = true;
|
25
|
+
e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js';
|
26
|
+
document.getElementById('fb-root').appendChild(e);
|
27
|
+
}
|
28
|
+
|
29
|
+
$.facebookLoaded = function (callback) {
|
30
|
+
if (window.facebookLoaded) {
|
31
|
+
callback();
|
32
|
+
} else {
|
33
|
+
$(document).on('facebook:init', callback);
|
34
|
+
}
|
35
|
+
}
|
metadata
CHANGED
@@ -1,15 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jquery-facebook
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
5
|
-
prerelease:
|
4
|
+
version: 0.2.0
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Anton Rogov
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2014-12-08 00:00:00.000000000 Z
|
13
12
|
dependencies: []
|
14
13
|
description: Facebook JavaScript SDK unobtrusive loader for jQuery and Rails
|
15
14
|
email:
|
@@ -29,28 +28,27 @@ files:
|
|
29
28
|
- lib/jquery-facebook/engine.rb
|
30
29
|
- lib/jquery-facebook/version.rb
|
31
30
|
- vendor/assets/javascripts/jquery.facebook.js
|
32
|
-
homepage: http://github.com/
|
31
|
+
homepage: http://github.com/antonrogov/jquery-facebook
|
33
32
|
licenses: []
|
33
|
+
metadata: {}
|
34
34
|
post_install_message:
|
35
35
|
rdoc_options: []
|
36
36
|
require_paths:
|
37
37
|
- lib
|
38
38
|
required_ruby_version: !ruby/object:Gem::Requirement
|
39
|
-
none: false
|
40
39
|
requirements:
|
41
|
-
- -
|
40
|
+
- - '>='
|
42
41
|
- !ruby/object:Gem::Version
|
43
42
|
version: '0'
|
44
43
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
45
|
-
none: false
|
46
44
|
requirements:
|
47
|
-
- -
|
45
|
+
- - '>='
|
48
46
|
- !ruby/object:Gem::Version
|
49
47
|
version: '0'
|
50
48
|
requirements: []
|
51
49
|
rubyforge_project:
|
52
|
-
rubygems_version:
|
50
|
+
rubygems_version: 2.4.2
|
53
51
|
signing_key:
|
54
|
-
specification_version:
|
52
|
+
specification_version: 4
|
55
53
|
summary: Facebook JavaScript SDK loader
|
56
54
|
test_files: []
|