docs: Add missing space to compound verbs “back up”, “log in”, etc.
Noun: backup, login, logout, lookup, setup.
Verb: back up, log in, log out, look up, set up.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-02-07 20:41:10 +01:00
|
|
|
// Module for displaying the modal asking spectators to log in when
|
2022-02-08 00:13:33 +01:00
|
|
|
// attempting to do things that are not possible as a spectator (like
|
2020-10-05 16:09:25 +02:00
|
|
|
// add an emoji reaction, star a message, etc.). While in many cases,
|
|
|
|
// we will prefer to hide menu options that don't make sense for
|
|
|
|
// spectators, this modal is useful for everything that doesn't make
|
|
|
|
// sense to remove from a design perspective.
|
|
|
|
|
|
|
|
import $ from "jquery";
|
|
|
|
|
|
|
|
import render_login_to_access_modal from "../templates/login_to_access.hbs";
|
|
|
|
|
2021-11-28 08:37:15 +01:00
|
|
|
import * as browser_history from "./browser_history";
|
2021-06-23 15:21:25 +02:00
|
|
|
import * as hash_util from "./hash_util";
|
2021-11-28 08:37:15 +01:00
|
|
|
import * as overlays from "./overlays";
|
2020-10-05 16:09:25 +02:00
|
|
|
|
2021-09-07 04:09:12 +02:00
|
|
|
export function login_to_access() {
|
2020-10-05 16:09:25 +02:00
|
|
|
// Hide all overlays, popover and go back to the previous hash if the
|
|
|
|
// hash has changed.
|
2022-04-27 08:56:19 +02:00
|
|
|
const login_link = hash_util.build_login_link();
|
2020-10-05 16:09:25 +02:00
|
|
|
|
2021-11-28 08:37:15 +01:00
|
|
|
$("body").append(
|
2020-10-05 16:09:25 +02:00
|
|
|
render_login_to_access_modal({
|
|
|
|
signup_link: "/register",
|
|
|
|
login_link,
|
|
|
|
}),
|
|
|
|
);
|
2021-11-28 08:37:15 +01:00
|
|
|
|
|
|
|
overlays.open_modal("login_to_access_modal", {
|
|
|
|
autoremove: true,
|
|
|
|
micromodal: true,
|
|
|
|
on_hide: () => {
|
|
|
|
browser_history.return_to_web_public_hash();
|
|
|
|
},
|
|
|
|
});
|
2020-10-05 16:09:25 +02:00
|
|
|
}
|