fgraph 0.5.1 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- data/History +3 -0
- data/VERSION.yml +2 -2
- data/lib/fgraph/rails/fgraph_tag_helper.rb +15 -6
- metadata +9 -9
data/History
CHANGED
data/VERSION.yml
CHANGED
@@ -11,22 +11,31 @@ module FGraph
|
|
11
11
|
# * <tt>app_id</tt> - overrride Fgraph.config['app_id'] value.
|
12
12
|
# * <tt>async</tt> - asynchronous javascript include & initialization.
|
13
13
|
# for other Facebook JS initialization codes please wrap under:
|
14
|
-
#
|
14
|
+
# * <tt>status</tt> - default: false, will check login status, and auto-login user if they are connected
|
15
|
+
# * <tt>cookie</tt> - default: true, auto set cookies
|
16
|
+
# * <tt>xfbml</tt> - default: true, auto parse xfbml tags
|
17
|
+
#
|
18
|
+
# If async is set to true, the callback function is window.afterFbAsyncInit, e.g.
|
15
19
|
# window.afterFbAsyncInit = function() {
|
16
20
|
# ....
|
17
21
|
# }
|
18
22
|
#
|
19
23
|
def fgraph_javascript_init_tag(options={})
|
20
|
-
options = { :app_id => FGraph.config['app_id']
|
24
|
+
options = { :app_id => FGraph.config['app_id'],
|
25
|
+
:status => true,
|
26
|
+
:cookie => true,
|
27
|
+
:xfbml => true
|
28
|
+
}.merge(options || {})
|
29
|
+
|
30
|
+
fb_init = "FB.init({appId: '#{options[:app_id]}', status: #{options[:status]}, cookie: #{options[:cookie]}, xfbml: #{options[:xfbml]}});"
|
21
31
|
|
22
32
|
if options[:async]
|
23
33
|
%{
|
24
34
|
<div id="fb-root"></div>
|
25
35
|
<script>
|
26
36
|
window.fbAsyncInit = function() {
|
27
|
-
|
28
|
-
|
29
|
-
|
37
|
+
#{fb_init}
|
38
|
+
|
30
39
|
if (window.afterFbAsyncInit) {
|
31
40
|
window.afterFbAsyncInit();
|
32
41
|
}
|
@@ -44,7 +53,7 @@ module FGraph
|
|
44
53
|
tag << %{
|
45
54
|
<div id="fb-root"></div>
|
46
55
|
<script>
|
47
|
-
|
56
|
+
#{fb_init}
|
48
57
|
</script>
|
49
58
|
}
|
50
59
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fgraph
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 7
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
-
|
10
|
-
version: 0.
|
8
|
+
- 6
|
9
|
+
- 0
|
10
|
+
version: 0.6.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Herryanto Siatono
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date:
|
18
|
+
date: 2011-02-25 00:00:00 +08:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -116,8 +116,8 @@ homepage: http://github.com/jugend/fgraph
|
|
116
116
|
licenses: []
|
117
117
|
|
118
118
|
post_install_message:
|
119
|
-
rdoc_options:
|
120
|
-
|
119
|
+
rdoc_options: []
|
120
|
+
|
121
121
|
require_paths:
|
122
122
|
- lib
|
123
123
|
required_ruby_version: !ruby/object:Gem::Requirement
|
@@ -146,8 +146,8 @@ signing_key:
|
|
146
146
|
specification_version: 3
|
147
147
|
summary: Ruby Facebook Graph API
|
148
148
|
test_files:
|
149
|
+
- examples/get_access_token.rb
|
150
|
+
- examples/publish_feed.rb
|
149
151
|
- test/fgraph/client_test.rb
|
150
152
|
- test/fgraph_test.rb
|
151
153
|
- test/test_helper.rb
|
152
|
-
- examples/get_access_token.rb
|
153
|
-
- examples/publish_feed.rb
|