When creating a new page, var sourceTransliterated is undefined in safeword.js when passed to the transliterate function. This error then stops the wysiwyg editor showing up, etc.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | transliterate_js_error-2206603-3.patch | 3.82 KB | Adrian Richardson |
| #1 | transliterate_js_error-2206603-1.patch | 537 bytes | Adrian Richardson |
Comments
Comment #1
Adrian Richardson commentedPatch attached for review
Comment #2
robert castelo commentedThanks Adrian Richardson, I moved the line as per your patch, then while I was at it took some advice from Joates and made the ajax call asynchronous.
Fixed in Safeword 7.x-1.7
Comment #3
Adrian Richardson commentedSorry Robert, your extra patch took out the fix to set an initial value on var sourceTransliterated. I'm attaching a patch which handles the asynchronous calls a bit better. The $source.bind is being called twice for each key press causing a very large number of Ajax requests to be running in parallel as you type. I've wrapped this in a helper function which waits until there has been a 0.3 second pause in typing before making an Ajax call to reduce the number of Ajax requests made.
Comment #4
robert castelo commentedThanks Adrian, that's much better.
Fixed in Safeword 7.x-1.8