rewrite js editor