2021-03-25 22:35:45 +01:00
|
|
|
import $ from "jquery";
|
2020-04-04 01:47:18 +02:00
|
|
|
|
2020-01-15 16:41:56 +01:00
|
|
|
const t1 = performance.now();
|
2021-05-27 20:08:50 +02:00
|
|
|
export const page_params: {
|
|
|
|
language_list: {
|
|
|
|
code: string;
|
|
|
|
locale: string;
|
|
|
|
name: string;
|
|
|
|
percent_translated: number | undefined;
|
|
|
|
}[];
|
2021-06-06 22:13:18 +02:00
|
|
|
development_environment: boolean;
|
2021-07-28 18:55:53 +02:00
|
|
|
is_admin: boolean;
|
|
|
|
is_guest: boolean;
|
|
|
|
is_moderator: boolean;
|
|
|
|
is_spectator: boolean;
|
|
|
|
realm_add_custom_emoji_policy: number;
|
|
|
|
realm_avatar_changes_disabled: boolean;
|
|
|
|
realm_create_stream_policy: number;
|
|
|
|
realm_edit_topic_policy: number;
|
|
|
|
realm_email_address_visibility: number;
|
|
|
|
realm_invite_to_realm_policy: number;
|
|
|
|
realm_invite_to_stream_policy: number;
|
|
|
|
realm_move_messages_between_streams_policy: number;
|
|
|
|
realm_name_changes_disabled: boolean;
|
2021-07-23 19:42:57 +02:00
|
|
|
realm_push_notifications_enabled: boolean;
|
2021-07-28 18:55:53 +02:00
|
|
|
realm_user_group_edit_policy: number;
|
|
|
|
realm_waiting_period_threshold: number;
|
2021-05-27 20:08:50 +02:00
|
|
|
request_language: string;
|
2021-07-28 18:55:53 +02:00
|
|
|
server_avatar_changes_disabled: boolean;
|
|
|
|
server_name_changes_disabled: boolean;
|
2021-05-27 20:08:50 +02:00
|
|
|
translation_data: Record<string, string>;
|
2021-07-28 18:55:53 +02:00
|
|
|
zulip_plan_is_not_limited: boolean;
|
2021-05-27 20:08:50 +02:00
|
|
|
} = $("#page-params").remove().data("params");
|
2020-01-15 16:41:56 +01:00
|
|
|
const t2 = performance.now();
|
2021-06-22 18:58:47 +02:00
|
|
|
export const page_params_parse_time = t2 - t1;
|
2021-03-25 22:35:45 +01:00
|
|
|
if (!page_params) {
|
2019-09-20 06:58:12 +02:00
|
|
|
throw new Error("Missing page-params");
|
|
|
|
}
|