Extract javascript from view partial