Potty mouths in Barnsley, South Yorkshire, are to be fined on the spot, according to this BBC piece. A potty mouth is someone who swears or uses bad language excessively. The 'potty' in the expression comes from 'potty' meaning child's toilet. This is a 20th-century word, although it derives from the much older 'pot'. The OED says that 'potty mouth' was originally US slang and was coined in the 1960s.
The adjective potty meaning 'eccentric' or 'dotty' is originally British English. It, too, derives from the noun 'pot'. Jonathon Green in his Dictionary of Slang says it's from pot meaning 'tankard', hence there is possibly a link to drunken-like behaviour.
The caption to the picture on the BBC page, and a notice in that picture, have the expression 'effing and effing'. To eff is to use the F-word, but it's more common to say 'to eff and blind' rather than just 'to eff'. The verb 'eff' was coined in the 1940s, but the adjective 'effing' is twenty years older. Blind as a verb has been used in vulgar curses since the 19th century. The still-common 'blimey' is a contraction of 'blind me'.