(imported from commit 72fef9dd3cb58ff15e74709b0470033a7f8796b4)
(imported from commit c4d7f658f361a759a38951349e027ac3e279fe9b)
Add javascript to handle the button clicks and update the status based on the subscribe and unsubscribe events from the server. (imported from commit 6b9c0b40d9084e3d8b64bed701ebc786bef6d432)