implement script feature to the widget