Files
zulip/static/js/analytics/support.js
Anders Kaseorg ea9ca6b7d0 js: Use jQuery as a module.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-03-12 10:08:25 -08:00

25 lines
842 B
JavaScript

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");
});
});