JavaScript side of my widget.