<commit_before>module OmniAuth
  module Strategies
    class Renren
      module Helper
        def omniauth_renren_connect_button
          callback_path = '/auth/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

        private
        def renren_connect_button
          <<-HTML
<xn:login-button autologoutlink="true" onlogin="document.getElementById('#{@renren_connect_form_id}').submit();"></xn:login-button>
<script src="http://static.connect.renren.com/js/v1.0/FeatureLoader.jsp" type="text/javascript"></script>
<script type="text/javascript">
  //<![CDATA[
  XN_RequireFeatures(['EXNML'], function(){ XN.Main.init('#{Renren.api_key}', '/xd_receiver.html'); });<commit_msg>Fixed renren callback path when integrate with devise<commit_after>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
<form accept-charset="UTF-8" action="#{callback_path}" id="#{@renren_connect_form_id}" method="post">
#{renren_connect_button}
</form>
            HTML
          end
        end

        private
        def renren_connect_button
          <<-HTML
<xn:login-button autologoutlink="true" onlogin="document.getElementById('#{@renren_connect_form_id}').submit();"></xn:login-button>
<script src="http://static.connect.renren.com/js/v1.0/FeatureLoader.jsp" type="text/javascript"></script>
<script type="text/javascript">
  //<![CDATA[
  XN_RequireFeatures(['EXNML'], function(){ XN.Main.init('#{Renren.api_key}', '/xd_receiver.html'); });
{'fraction_non_alphanumeric': 0.1365010799136069, 'fraction_numerical': 0.002591792656587473, 'mean_word_length': 3.345215759849906, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '365917', 'n_tokens_mistral': 727, 'n_tokens_neox': 719, 'n_words': 109}