module OmniAuth module Strategies class Renren module Helper 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
#{renren_connect_button}
HTML end end 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 def omniauth_renren_friends(options = {}) params = { :max_rows => "2", :face_space => "5", :width => "217" }.merge(options) renren_friends(params).html_safe end def omniauth_renren_live_widget(options = {}) params = { :width => "370px", :height => "390px" }.merge(options) renren_live_widget(params).html_safe end def omniauth_renren_like_button(options = {}) params = { :width => "200px", :height => "70px", :url => root_url }.merge(options) renren_like_button(params).html_safe end 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 def omniauth_renren_javascript renren_javascript.html_safe end private def renren_invite(options) <<-HTML HTML end def renren_like_button(options = {}) <<-HTML HTML end def renren_live_widget(options = {}) <<-HTML HTML end def renren_friends(options = {}) <<-HTML HTML end def simple_renren_connect_button(properties) callback_path = "#{OmniAuth.config.path_prefix}/renren/callback" <<-HTML HTML end def renren_connect_button <<-HTML HTML end def renren_javascript <<-HTML HTML end end end end end