Replace jQuery calls with variables from the mw.cx data

Change-Id: I5576d6ec28e2b70327484078758afee402f77447