edx/edx-platform — pull request #3829 by aboudreault (2014-05-22 15:05:45+00:00)
Title: Various fixes required to use discussion in an external application (jquery-xblock)

This PR is related to the XBlock Discussion proof of concept. It includes some minor fixes that are require to get a working Discussion xblock in an external application. The changes:

* Added the support of a baseUrl in Discussion.Util. When using discussion through jquery-xblock, we need a way to specify the LMS base url.

* The $.ajax beforeSend hook was in conflict with jquery-xblock, which also use that hook for http header etc. Since the beforeSend hook in Discussion.Util wasn't related to the http request itself, the logic can be done otherwise with the same behavior.

* There were a missing import in a template.

* I've splitted the discussion application style in its own file. That way, it is generated on the LMS and can be grabbed from my discussion xblock to get the exact same styles. Something I have noticed is that the discussion-app.css is relatively big, since it probably contains bourbon etc. This is required to use the discussion module in an external application, but might be considered as *overhead* inside the LMS itself. I would like to get your advice about this. Ideally, the LMS and XBlock should use the exact same style source to ensure we have the same result on both... but we could also let the discussion styles bundled to application-extend2, for those that uses the xmodule.

@jimabramson @antoviaque Although those changes are minor, I'll let you decide whether we include it now or not.