factor out javascript and move to project specific base