README.md in facebook_js-0.0.1 vs README.md in facebook_js-0.0.2

- old
+ new

@@ -1,9 +1,50 @@ # facebook_js -`facebook_js` is just a way for me to not have to deal with integrating [Facebook Javascript SDK][1] again by manually copy-paste all the necessary code. It also adds the require `channel.html` link to the app with proper caching headers. +`facebook_js` is just a way for me to not have to deal with integrating [Facebook Javascript SDK][1] again by manually copy-paste all the necessary code. It also adds the required `channel.html` link to the app with proper caching headers. +From this: + + <div id="fb-root"></div> + <script> + window.fbAsyncInit = function() { + // init the FB JS SDK + FB.init({ + appId : 'YOUR_APP_ID', // App ID from the App Dashboard + channelUrl : '//WWW.YOUR_DOMAIN.COM/channel.html', // Channel File for x-domain communication + status : true, // check the login status upon init? + cookie : true, // set sessions cookies to allow your server to access the session? + xfbml : true // parse XFBML tags on this page? + }); + + // Additional initialization code such as adding Event Listeners goes here + + }; + + // Load the SDK's source Asynchronously + // Note that the debug version is being actively developed and might + // contain some type checks that are overly strict. + // Please report such bugs using the bugs tool. + (function(d, debug){ + var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0]; + if (d.getElementById(id)) {return;} + js = d.createElement('script'); js.id = id; js.async = true; + js.src = "//connect.facebook.net/en_US/all" + (debug ? "/debug" : "") + ".js"; + ref.parentNode.insertBefore(js, ref); + }(document, /*debug*/ false)); + </script> + +To this: + + = facebook_js + +## Turbolinks Support + +To use `facebook_js` with [turbolinks][3], you should insert `facebook_js` within the `<head>` section. + + = facebook_js turbolink: true + ## Installation In your Gemfile, add `gem 'facebook_js'`, then, `bundle install`. ## Configurations @@ -14,11 +55,11 @@ FacebookJs.domain = 'localhost:3000' # the domain to be used to locate your `/channel.html` file (required) FacebookJs.locale = 'en_US' # supported locale (optional) FacebookJs.status = true # check the login status upon init? (optional) FacebookJs.cookie = true # set sessions cookies to allow your server to access the session? (optional) FacebookJs.xfbml = true # parse XFBML tags on this page? (optional) - FacebookJs.debug = false # to start the FB JS script in debug mode (optional) + FacebookJs.debug = !Rails.env.production? # to start the FB JS script in debug mode (optional) Check out the list of available locales on Facebook [here][2]. ## Usage @@ -28,13 +69,14 @@ If you want to have additional initialization code, just do this: = facebook_js do // javascript - function() { alert('Hello, world!'); } + alert('Hello, world!!!'); ##License MIT License. See LICENSE for details. [1]: https://developers.facebook.com/docs/reference/javascript/ -[2]: https://www.facebook.com/translations/FacebookLocales.xml \ No newline at end of file +[2]: https://www.facebook.com/translations/FacebookLocales.xml +[3]: https://github.com/rails/turbolinks/