Convert editor from js to coffee