fbauth 1.2.2.3 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,23 @@
1
1
  - if auto_resize
2
2
  :javascript
3
- FB.init({appId: '#{FacebookConfig['app_id']}', status: true, cookie: true, xfbml: true, channelUrl: '#{channel_url}'});
4
- FB.Canvas.setAutoResize();
3
+ window.fbAsyncInit = function() {
4
+ FB.init({appId: '#{FacebookConfig['app_id']}', status: true, cookie: true, xfbml: true, channelUrl: '#{channel_url}'});
5
+ FB.Canvas.setAutoResize();
6
+ if (typeof window.fbAuthInit == 'function') {
7
+ window.fbAuthInit();
8
+ }
9
+ };
5
10
  - else
6
11
  :javascript
7
- FB.init({appId: '#{FacebookConfig['app_id']}', status: true, cookie: true, xfbml: true});
12
+ window.fbAsyncInit = function() {
13
+ FB.init({appId: '#{FacebookConfig['app_id']}', status: true, cookie: true, xfbml: true});
14
+ if (typeof window.fbAuthInit == 'function') {
15
+ window.fbAuthInit();
16
+ }
17
+ };
18
+ :javascript
19
+ (function() {
20
+ var e = document.createElement('script'); e.async = true;
21
+ e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js';
22
+ document.getElementById('fb-root').appendChild(e);
23
+ }());
@@ -1,9 +1,9 @@
1
1
  :javascript
2
- $(document).ready(function() {
2
+ window.fbAuthInit = function() {
3
3
  fbauth_hide_panels();
4
4
  FB.getLoginStatus(function(response) { fbauth_update_page(response); });
5
5
  FB.Event.subscribe('auth.statusChange', function(response) { fbauth_update_page(response); });
6
- });
6
+ };
7
7
  function fbauth_hide_panels() {
8
8
  $('#{login_el}').hide();
9
9
  $('#{add_el}').hide();
@@ -15,3 +15,15 @@ require 'fbauth/config.rb'
15
15
  require 'fbauth/http.rb'
16
16
  require 'fbauth/graph.rb'
17
17
  require 'fbauth/query.rb'
18
+
19
+ class Engine < Rails::Engine
20
+ engine_name :fbauth
21
+
22
+ initializer "add helpers" do |app|
23
+ ActionView::Base.send :include, FbauthHelper
24
+ end
25
+
26
+ initializer "static assets" do |app|
27
+ app.middleware.use ::ActionDispatch::Static, "#{root}/public"
28
+ end
29
+ end
@@ -6,11 +6,11 @@ class FacebookConfig
6
6
  private
7
7
 
8
8
  def self.get_environment
9
- read_yaml[ENV["RAILS_ENV"]]
9
+ read_yaml[Rails.env]
10
10
  end
11
11
 
12
12
  def self.read_yaml
13
- file = File.join(::RAILS_ROOT, 'config', 'facebook.yml')
13
+ file = File.join(Rails.root, 'config', 'facebook.yml')
14
14
  YAML.parse(ERB.new(IO.read(file)).result)
15
15
  end
16
16
 
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fbauth
3
3
  version: !ruby/object:Gem::Version
4
- hash: 65
4
+ hash: 15
5
5
  prerelease:
6
6
  segments:
7
- - 1
8
7
  - 2
9
- - 2
10
- - 3
11
- version: 1.2.2.3
8
+ - 0
9
+ - 0
10
+ version: 2.0.0
12
11
  platform: ruby
13
12
  authors:
14
13
  - Three Wise Men Inc.
@@ -16,7 +15,7 @@ autorequire:
16
15
  bindir: bin
17
16
  cert_chain: []
18
17
 
19
- date: 2011-03-29 00:00:00 -04:00
18
+ date: 2011-04-09 00:00:00 -04:00
20
19
  default_executable:
21
20
  dependencies: []
22
21