Module: OmniAuth::Strategies::Renren::Helper

Defined in:
lib/omniauth_china/strategies/renren/helper.rb

Instance Method Summary collapse

Instance Method Details

#omniauth_renren_connect_buttonObject



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/omniauth_china/strategies/renren/helper.rb', line 5

def omniauth_renren_connect_button
  callback_path = "#{OmniAuth.config.path_prefix}/renren/callback"
  @renren_connect_form_id = 'omniauth_renren_connect_form'

  if defined?(::ActionView::Helpers::FormTagHelper)

    form_tag(callback_path, :id => @renren_connect_form_id) do
      renren_connect_button.html_safe
    end
  else

    <<-HTML
<form accept-charset="UTF-8" action="#{callback_path}" id="#{@renren_connect_form_id}" method="post">
#{renren_connect_button}
</form>
    HTML
  end
end

#omniauth_renren_friends(options = {}) ⇒ Object



38
39
40
41
42
43
44
45
# File 'lib/omniauth_china/strategies/renren/helper.rb', line 38

def omniauth_renren_friends(options = {})
  params = {
    :max_rows => "2",
    :face_space => "5",
    :width => "217"
  }.merge(options)
  renren_friends(params).html_safe
end

#omniauth_renren_invite(options = {}) ⇒ Object



64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# File 'lib/omniauth_china/strategies/renren/helper.rb', line 64

def omniauth_renren_invite(options = {})
  params = {
    :content => "Join us",
    :url1 => "http://www.renren.com",
    :label1 => "Go",
    :url2 => "http://apps.renren.com/yourapp",
    :label2 => "Accept",
    :action => "/yourapp/youraction",
    :friend_text => "Invite your friends",
    :max => "5",
    :mode => "all",
    :width => "735",
    :height => "450"
  }.merge(options)
  renren_invite(params).html_safe
end

#omniauth_renren_javascriptObject



81
82
83
# File 'lib/omniauth_china/strategies/renren/helper.rb', line 81

def omniauth_renren_javascript
  renren_javascript.html_safe
end

#omniauth_renren_like_button(options = {}) ⇒ Object



55
56
57
58
59
60
61
62
# File 'lib/omniauth_china/strategies/renren/helper.rb', line 55

def omniauth_renren_like_button(options = {})
  params = {
    :width => "200px",
    :height => "70px",
    :url => root_url
  }.merge(options)
  renren_like_button(params).html_safe
end

#omniauth_renren_live_widget(options = {}) ⇒ Object



47
48
49
50
51
52
53
# File 'lib/omniauth_china/strategies/renren/helper.rb', line 47

def omniauth_renren_live_widget(options = {})
  params = {
    :width => "370px",
    :height => "390px"
  }.merge(options)
  renren_live_widget(params).html_safe
end

#omniauth_simple_renren_connect_button(options = {}) ⇒ Object



24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/omniauth_china/strategies/renren/helper.rb', line 24

def omniauth_simple_renren_connect_button(options = {})
  params = {
    :src => "http://pics.wanlibo.com/images_cn/registration/renren.png",
    :title => "renren connect",
    :alt => "renren connect"
  }.merge(options)
  
  p = ""
  params.each do |k, v|
    p += k.to_s + "='" + v + "' "
  end
  simple_renren_connect_button(p).html_safe
end