plataforma_social 0.0.25 → 0.0.26

Sign up to get free protection for your applications and to get access to all the features.
@@ -29,7 +29,7 @@ module PlataformaSocial
29
29
  end
30
30
  end
31
31
  end
32
-
32
+
33
33
  render :text => %|<script type="text/javascript">window.top.location.href="#{@oauth.url_for_oauth_code(:permissions => PlataformaSocial.configuration.facebook_scope)}";</script>| if redirect
34
34
  end
35
35
 
@@ -94,28 +94,30 @@ module PlataformaSocial
94
94
  params.present? && params[:controller].present? && params[:controller].index(PlataformaSocial.admin_controller_name) == 0
95
95
  end
96
96
 
97
- def link_to_facebook *args, &block
98
- if block_given?
99
- href = capture(&block)
100
-
101
- args.unshift(href)
102
-
103
- link_to_facebook *args
97
+ def link_to *args, &block
98
+ args[2] ||= {}
99
+
100
+ if args[2][:normal] === true
101
+ super
104
102
  else
105
- args[2] ||= {}
106
-
107
- server_domain = request.env['HTTP_HOST']
108
- url = 'apps.facebook.com/' + PlataformaSocial.facebook_app_namespace
109
-
110
- if args[1].include? server_domain
111
- args[1].gsub! server_domain, url
112
- else
113
- args[1] = request.protocol + url + args[1]
103
+ unless block_given?
104
+ if from_facebook? && !from_admin?
105
+ server_domain = request.env['HTTP_HOST']
106
+ url = 'apps.facebook.com/' + PlataformaSocial.facebook_app_namespace
107
+
108
+ if args[1].include? server_domain
109
+ args[1].gsub! server_domain, url
110
+ else
111
+ args[1] = request.protocol + url + args[1]
112
+ end
113
+
114
+ args[2][:target] = '_top'
115
+ else
116
+ super
117
+ end
114
118
  end
115
-
116
- args[2][:target] = '_top'
117
119
 
118
- return link_to *args
120
+ super
119
121
  end
120
122
  end
121
123
  end
@@ -1,3 +1,3 @@
1
1
  module PlataformaSocial
2
- VERSION = "0.0.25"
2
+ VERSION = "0.0.26"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: plataforma_social
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.25
4
+ version: 0.0.26
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: