Adapt JS to function on videos page and new/edit post page.