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.

Comments

Adrian Richardson’s picture

Status: Active » Needs review
StatusFileSize
new537 bytes

Patch attached for review

robert castelo’s picture

Assigned: Unassigned » robert castelo
Status: Needs review » Fixed

Thanks 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

Adrian Richardson’s picture

Version: 7.x-1.6 » 7.x-1.7
Status: Fixed » Needs review
StatusFileSize
new3.82 KB

Sorry 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.

robert castelo’s picture

Status: Needs review » Fixed

Thanks Adrian, that's much better.

Fixed in Safeword 7.x-1.8

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.