mmangino / facebooker2

A simple facebook connect library for ruby
MIT License
311 stars 93 forks source link

JS SDK initialization fix for IE #43

Closed pomartel closed 13 years ago

pomartel commented 13 years ago

The JS SDK initialization does not work properly with IE. See this issue for details.

I made 3 changes to the way the JS SDK is initialized :

  1. Mimic the way the JS SDK is initialized in the Facebook documentation.
  2. Fixed bug with the channelUrl option. The option hash was defaulting keys to true and that caused a bug with the channelUrl when this property was intented to be nil.
  3. Added a locale option to change the language of the JS SDK.
mmangino commented 13 years ago

There is a problem with this:

cookie = opts[:cookie] || true

You can never make it false. The old version used a default of true on nil to get around this case, but that fails with channel url. You might be able to do something similar, but please add test cases to catch this problem

pomartel commented 13 years ago

You're right! It's friday afternoon and I'm being sloppy trying to avoid testing! :-)

I think I fixed it and added a test file. There's just one test method at bottom I cannot get to work properly. It has to do with the way the result string is concatenated to the output buffer when a proc is passed. I tried to access the output buffer but I haven't had any luck.

pomartel commented 13 years ago

Hi Mike, did you have time to look at the updated pull request? Anything missing?