facebooker-lite 1.0.67.1 → 1.0.67.2
Sign up to get free protection for your applications and to get access to all the features.
@@ -69,6 +69,41 @@ module Facebooker
|
|
69
69
|
end
|
70
70
|
end
|
71
71
|
|
72
|
+
#
|
73
|
+
# Render an <fb:login-button> element
|
74
|
+
#
|
75
|
+
# ==== Examples
|
76
|
+
#
|
77
|
+
# <%= fb_login_button%>
|
78
|
+
# => <fb:login-button></fb:login-button>
|
79
|
+
#
|
80
|
+
# Specifying a javascript callback
|
81
|
+
#
|
82
|
+
# <%= fb_login_button 'update_something();'%>
|
83
|
+
# => <fb:login-button onlogin='update_something();'></fb:login-button>
|
84
|
+
#
|
85
|
+
# Adding options <em>See:</em> http://wiki.developers.facebook.com/index.php/Fb:login-button
|
86
|
+
#
|
87
|
+
# <%= fb_login_button 'update_something();', :size => :small, :background => :dark%>
|
88
|
+
# => <fb:login-button background='dark' onlogin='update_something();' size='small'></fb:login-button>
|
89
|
+
#
|
90
|
+
# :text option allows you to set the text value of the
|
91
|
+
# button. *A note!* This will only do what you expect it to do
|
92
|
+
# if you set :v => 2 as well.
|
93
|
+
#
|
94
|
+
# <%= fb_login_button 'update_somethign();',
|
95
|
+
# :text => 'Loginto Facebook', :v => 2 %>
|
96
|
+
# => <fb:login-button v='2' onlogin='update_something();'>Login to Facebook</fb:login-button>
|
97
|
+
def fb_login_button(*args)
|
98
|
+
|
99
|
+
callback = args.first
|
100
|
+
options = args[1] || {}
|
101
|
+
options.merge!(:onlogin=>callback) if callback
|
102
|
+
|
103
|
+
text = options.delete(:text)
|
104
|
+
|
105
|
+
content_tag("fb:login-button",text, options)
|
106
|
+
end
|
72
107
|
end
|
73
108
|
end
|
74
109
|
end
|
data/lib/facebooker/version.rb
CHANGED