Add JavaScript accidently removed in 71b93b2c