Add JavaScript accidentally removed in 71b93b2c