plataforma_social 0.0.8 → 0.0.9

Sign up to get free protection for your applications and to get access to all the features.
@@ -41,7 +41,7 @@ module PlataformaSocial
41
41
 
42
42
  def plataforma_social_user_data
43
43
  if params[:signed_request]
44
- data = Request.post("#{PlataformaSocial.domains('login')}/register", { :signed_request => params[:signed_request] })
44
+ data = Request.post("#{PlataformaSocial.domains('login')}/register", { :signed_request => params[:signed_request], :social_ref => params[:social_ref] })
45
45
  { :reference => data['id'] }
46
46
  end
47
47
  end
@@ -24,40 +24,44 @@ module PlataformaSocial
24
24
 
25
25
  %Q{
26
26
  <script type="text/javascript" charset="utf-8">
27
- $(function(){
28
- $(document).ajaxSend(function(elm, xhr, s){
29
- var method = s.type;
30
- var defaultParams = #{default_params.to_json};
31
- var params = {};
32
- var query = '';
27
+ if($ && jQuery){
28
+ $(function(){
29
+ $(document).ajaxSend(function(elm, xhr, s){
30
+ var method = s.type;
31
+ var defaultParams = #{default_params.to_json};
32
+ var params = {};
33
+ var query = [];
33
34
 
34
- var data = method == "POST" ? s.data : s.url.split('?')[1];
35
+ var data = method == "POST" ? s.data : s.url.split('?')[1];
35
36
 
36
- if(data){
37
- var splittedData = data.split('&');
38
- for(var i in splittedData){
39
- var param = splittedData[i].split('=');
37
+ if(data){
38
+ var splittedData = data.split('&');
39
+ for(var i in splittedData){
40
+ var param = splittedData[i].split('=');
40
41
 
41
- params[param[0]] = param[1];
42
- } // for
43
- } // if
42
+ params[param[0]] = param[1];
43
+ } // for
44
+ } // if
44
45
 
45
- for(var i in defaultParams){
46
- if(!params[i]) params[i] = defaultParams[i];
47
- }
46
+ for(var i in defaultParams){
47
+ if(!params[i]) params[i] = defaultParams[i];
48
+ }
48
49
 
49
- for(var i in params){
50
- query += decodeURIComponent(i) + '=' + decodeURIComponent(params[i]) + '&'
51
- }
50
+ for(var i in params){
51
+ query.push(decodeURIComponent(i) + '=' + decodeURIComponent(params[i]));
52
+ }
53
+
54
+ query = query.join('&');
52
55
 
53
- if(method == "POST"){
54
- s.data = query;
55
- }
56
- else {
57
- s.url = s.url.split('?')[0] + '?' + query;
58
- }
59
- });
60
- });
56
+ if(method == "POST"){
57
+ s.data = query;
58
+ }
59
+ else {
60
+ s.url = s.url.split('?')[0] + '?' + query;
61
+ }
62
+ });
63
+ });
64
+ }
61
65
  </script>
62
66
  }.html_safe
63
67
  end
@@ -1,3 +1,3 @@
1
1
  module PlataformaSocial
2
- VERSION = "0.0.8"
2
+ VERSION = "0.0.9"
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: plataforma_social
3
3
  version: !ruby/object:Gem::Version
4
- hash: 15
4
+ hash: 13
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 8
10
- version: 0.0.8
9
+ - 9
10
+ version: 0.0.9
11
11
  platform: ruby
12
12
  authors:
13
13
  - Marcos Nogueira
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2013-03-18 00:00:00 Z
18
+ date: 2013-04-18 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: capistrano