[PREVIEW] add javascript controls in preview functions