Ported period editor to jQuery