bedit porting to jquery