fabrik42/facebook-user.js — pull request #3 by dorongutman (2012-09-18 09:17:23+00:00)
Title: more isolated testing, and the option of passing a callback to FB.login

The test of the generated graph api url, was using the actual location.href for the non-secure test.
Since we don't want to test the browser, only the login of the tested method, I've set the protocol to be 'http:' for the non-secure test (the as being made for the secure test).
This also enables running the tests without a web server - just loading the file in a browser (via the file:// protocol).

Also, I've added the option to pass a callback to FB.login method (via the user.login method), so it will be possible to handle the specific case of a user the logs in to the system for the first time.

I've chose to allow passing a callback, but I know it could have been done via events. If the events is a preferred way, I'll do it with events.