Files
zulip/static/js/analytics/support.js
Vishnu KS 3cf3f99cf9 support: Confirm the string_id before scrubbing the realm.
Adding an extra confirmation in case the string_id entered
in search was wrong in first place.
2020-09-28 15:37:49 -07:00

23 lines
794 B
JavaScript

"use strict";
$(() => {
$("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");
});
});