Notifications essentially don't work on any mobile web clients,
so don't even show the banner.
This also fixes a traceback where it checks the permission state
with `notifications.permission_state()`, which calls
`Notification.permission`, which will error due to `Notification`
not existing on mobile devices.
Fixes: #7105.
This checks whether the user is already in the state of having
blocked notifications, so that we can *not* show them the banner
to enable notifications, since browsers won't allow the request
to go through again.
Perhaps in a follow up we should create a different banner for
this case that shows how to enable notifications at the browser
level for this site.
This makes them responsive to resizes and fixes a responsive
issue with the floating recipient being too high when the alerts
were more than one line height.
This is a two-step notifications process that will ask a user
to enable notifications and if they click exit give them three
options:
1. Enable notifications.
2. Ask later.
3. Never ask on this computer again.
The first two are self-explanatory (ask later = next session it
asks again). The third is captured and stored in localStorage and
a check is done on page load to see whether or not notifications
should be displayed.
Commit modified heavily by Brock Whittaker <brock@zulipchat.com>.
Fixes#1189.