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)