Fine tune text widget javascript