conversie + refactoring javascript insert alarm in coffeescript