Your Popups code
Seems to have been damaged by something (apparently in one of the scripts you import, as there was no change to your .js file at the time the $-substitution stopped working). Compare the Edit summary of this revert you did, compared to the Edit summary of the next one you did. Cheers.