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;
|
2021-11-19 17:36:00 +01:00
|
|
|
is_owner: boolean;
|
2021-07-28 18:55:53 +02:00
|
|
|
is_spectator: boolean;
|
|
|
|
realm_add_custom_emoji_policy: number;
|
|
|
|
realm_avatar_changes_disabled: boolean;
|
2021-03-27 05:48:37 +01:00
|
|
|
realm_create_private_stream_policy: number;
|
|
|
|
realm_create_public_stream_policy: number;
|
2021-11-19 17:36:00 +01:00
|
|
|
realm_create_web_public_stream_policy: number;
|
2021-06-23 12:53:38 +02:00
|
|
|
realm_delete_own_message_policy: number;
|
2021-07-28 18:55:53 +02:00
|
|
|
realm_edit_topic_policy: number;
|
|
|
|
realm_email_address_visibility: number;
|
2021-11-19 17:36:00 +01:00
|
|
|
realm_enable_spectator_access: boolean;
|
2021-07-28 18:55:53 +02:00
|
|
|
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-11-19 17:36:00 +01:00
|
|
|
server_web_public_streams_enabled: 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");
|
|
|
|
}
|