galetahub/ckeditor — pull request #433 by Musaffa (2014-04-04 20:30:13+00:00)
Title: fix for 'CKEDITOR undefined' problem

Fixes #17 #105 #200 #214 #228 #230 #239 #368 #415.

Many users include javascript files at the bottom of the application layout as advised by many Javascript Gurus. So in the script file generated by cktext_area:
```html

```
`CKEDITOR` remains undefined thus replace function is never called. It works only when javascript include tag is added before the cktext_area form field.

This fix generates the script file like this:
```html

```

Now, so long as `CKEDITOR` is undefined, the self invoking function keeps calling itself at a fixed time interval. Once the ckeditor's javascript file gets loaded and `CKEDITOR` gets defined, the function calls the replace function and exits the cycle. Now the config options set in the form field work.