cwrc/CWRC-Writer — pull request #234 by nigelgbanks (2014-09-12 03:24:11+00:00)
Title: Remove requirement for global jQuery

While integrating the CWRC-Writer with Drupal and other tools like Image Annotation, difficulties arise as each tool uses a different jQuery version. Depending on loading order (which is not explicitly controllable with Requirejs) some plugins and tools will bind to the "wrong" jQuery object.

To prevent problems we should make the CWRC-Writer's use of jQuery [AMD](http://en.wikipedia.org/wiki/Asynchronous_module_definition) compliant.

To do this we have to wrap each required script that has a dependency on jQuery like so:

```javascript
define('module.name', ['jquery'], function(jQuery) {
// original script now makes use of only the jQuery object in scope.
});
```

Unfortunately this results in non being able to use CND version of some files, but it's a small price to pay for compatibility.