Bugfix; Javascript in javascript

Fixes a bug where the text entered inside a javascript string contained `'` or `"`. The bug occured in the event manager when trying to modify events containing `'` or `"`.