Move all the fullscreen events to the JavaScript file.