Notes/src/public/app/widgets/dialogs/password_not_set.js

39 lines
1.4 KiB
JavaScript
Raw Normal View History

import utils from "../../services/utils.js";
import BasicWidget from "../basic_widget.js";
const TPL = `
<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">
<h5 class="modal-title mr-auto">Password is not set</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close" style="margin-left: 0;">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
Protected notes are encrypted using a user password, but password has not been set yet.
To be able to protect notes, <a class="open-password-options-button" href="javascript:">
click here to open the Options dialog</a> and set your password.
</div>
</div>
</div>
</div>
`;
export default class PasswordNoteSetDialog extends BasicWidget {
doRender() {
this.$widget = $(TPL);
this.$openPasswordOptionsButton = this.$widget.find(".open-password-options-button");
this.$openPasswordOptionsButton.on("click", () => {
2023-01-23 23:37:58 +01:00
this.triggerCommand("showOptions", { section: '_optionsPassword' });
});
}
showPasswordNotSetEvent() {
utils.openDialog(this.$widget);
}
}