Separate JavaScript code for 'material editor'