WIP: integrating JavaScript functionality