mirror of
https://github.com/zulip/zulip.git
synced 2025-11-17 12:21:58 +00:00
ts: Convert analytics/support.js to TypeScript.
This commit is contained in:
committed by
Anders Kaseorg
parent
87d6180763
commit
2fa61bcec3
24
web/src/analytics/support.ts
Normal file
24
web/src/analytics/support.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
import $ from "jquery";
|
||||
|
||||
import * as common from "../common";
|
||||
|
||||
$(() => {
|
||||
$("body").on("click", ".scrub-realm-button", function (e) {
|
||||
e.preventDefault();
|
||||
const message =
|
||||
"Confirm the string_id of the realm you want to scrub.\n\n WARNING! This action is irreversible!";
|
||||
const actual_string_id = $(this).data("string-id");
|
||||
// eslint-disable-next-line no-alert
|
||||
const confirmed_string_id = window.prompt(message);
|
||||
if (confirmed_string_id === actual_string_id) {
|
||||
this.form.submit();
|
||||
} else {
|
||||
// eslint-disable-next-line no-alert
|
||||
window.alert("The string_id you entered is not correct. Aborted.");
|
||||
}
|
||||
});
|
||||
|
||||
$("a.copy-button").on("click", function () {
|
||||
common.copy_data_attribute_value($(this), "copytext");
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user