2024-07-25 17:14:08 +08:00
|
|
|
import { t } from "../../services/i18n.js";
|
2022-06-14 23:32:16 +02:00
|
|
|
import utils from "../../services/utils.js";
|
|
|
|
import BasicWidget from "../basic_widget.js";
|
2025-02-12 08:38:55 +01:00
|
|
|
import { Modal } from "bootstrap";
|
2022-06-14 23:32:16 +02:00
|
|
|
|
2025-04-01 23:24:21 +03:00
|
|
|
const TPL = /*html*/`
|
2022-06-14 23:32:16 +02:00
|
|
|
<div class="password-not-set-dialog modal fade mx-auto" tabindex="-1" role="dialog">
|
|
|
|
<div class="modal-dialog modal-md" role="document">
|
|
|
|
<div class="modal-content">
|
|
|
|
<div class="modal-header">
|
2024-09-03 18:15:10 +02:00
|
|
|
<h5 class="modal-title">${t("password_not_set.title")}</h5>
|
2024-12-16 20:35:51 +01:00
|
|
|
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="${t("password_not_set.close")}"></button>
|
2022-06-14 23:32:16 +02:00
|
|
|
</div>
|
|
|
|
<div class="modal-body">
|
2024-07-25 17:14:08 +08:00
|
|
|
${t("password_not_set.body1")}
|
2025-02-11 19:16:11 +02:00
|
|
|
|
2024-07-25 17:14:08 +08:00
|
|
|
${t("password_not_set.body2")}
|
2022-06-14 23:32:16 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
`;
|
|
|
|
|
|
|
|
export default class PasswordNoteSetDialog extends BasicWidget {
|
2025-02-11 19:16:11 +02:00
|
|
|
|
2025-02-12 08:54:00 +01:00
|
|
|
private modal!: Modal;
|
2025-02-11 19:16:11 +02:00
|
|
|
private $openPasswordOptionsButton!: JQuery<HTMLElement>;
|
|
|
|
|
2022-06-14 23:32:16 +02:00
|
|
|
doRender() {
|
|
|
|
this.$widget = $(TPL);
|
2025-02-12 08:38:55 +01:00
|
|
|
this.modal = Modal.getOrCreateInstance(this.$widget[0]);
|
2022-06-14 23:32:16 +02:00
|
|
|
this.$openPasswordOptionsButton = this.$widget.find(".open-password-options-button");
|
|
|
|
this.$openPasswordOptionsButton.on("click", () => {
|
2024-09-03 18:15:10 +02:00
|
|
|
this.modal.hide();
|
2025-01-09 18:07:02 +02:00
|
|
|
this.triggerCommand("showOptions", { section: "_optionsPassword" });
|
2022-06-14 23:32:16 +02:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
showPasswordNotSetEvent() {
|
|
|
|
utils.openDialog(this.$widget);
|
|
|
|
}
|
|
|
|
}
|