2021-03-11 05:43:45 +01:00
|
|
|
import $ from "jquery";
|
|
|
|
|
2021-02-28 00:35:35 +01:00
|
|
|
import * as common from "../common";
|
|
|
|
|
2020-07-02 01:45:54 +02:00
|
|
|
$(() => {
|
2019-04-19 18:17:41 +02:00
|
|
|
$("body").on("click", ".scrub-realm-button", function (e) {
|
|
|
|
e.preventDefault();
|
2020-07-15 00:34:28 +02:00
|
|
|
const message =
|
2020-08-13 19:02:01 +02:00
|
|
|
"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");
|
2020-07-15 00:33:36 +02:00
|
|
|
// eslint-disable-next-line no-alert
|
2020-08-13 19:02:01 +02:00
|
|
|
const confirmed_string_id = window.prompt(message);
|
|
|
|
if (confirmed_string_id === actual_string_id) {
|
2019-04-19 18:17:41 +02:00
|
|
|
this.form.submit();
|
2020-08-13 19:02:01 +02:00
|
|
|
} else {
|
|
|
|
// eslint-disable-next-line no-alert
|
|
|
|
window.alert("The string_id you entered is not correct. Aborted.");
|
2019-04-19 18:17:41 +02:00
|
|
|
}
|
|
|
|
});
|
2019-06-12 16:09:24 +02:00
|
|
|
|
2020-07-20 21:26:58 +02:00
|
|
|
$("a.copy-button").on("click", function () {
|
2019-09-18 15:04:36 +02:00
|
|
|
common.copy_data_attribute_value($(this), "copytext");
|
2019-06-12 16:09:24 +02:00
|
|
|
});
|
2019-04-19 18:17:41 +02:00
|
|
|
});
|