Generate bootstrap modal and progress bar with javascript