mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
42 lines
969 B
JavaScript
42 lines
969 B
JavaScript
import protectedSessionService from './protected_session.js';
|
|
|
|
class NoteDetailProtectedSession {
|
|
/**
|
|
* @param {TabContext} ctx
|
|
*/
|
|
constructor(ctx) {
|
|
this.ctx = ctx;
|
|
this.$component = ctx.$tabContent.find(".protected-session-password-component");
|
|
this.$passwordForm = ctx.$tabContent.find(".protected-session-password-form");
|
|
this.$passwordInput = ctx.$tabContent.find(".protected-session-password");
|
|
|
|
this.$passwordForm.on('submit', () => {
|
|
const password = this.$passwordInput.val();
|
|
this.$passwordInput.val("");
|
|
|
|
protectedSessionService.setupProtectedSession(password);
|
|
|
|
return false;
|
|
});
|
|
}
|
|
|
|
render() {
|
|
this.$component.show();
|
|
}
|
|
|
|
show() {}
|
|
|
|
getContent() {}
|
|
|
|
focus() {}
|
|
|
|
onNoteChange() {}
|
|
|
|
cleanup() {}
|
|
|
|
scrollToTop() {
|
|
this.$component.scrollTop(0);
|
|
}
|
|
}
|
|
|
|
export default NoteDetailProtectedSession; |