2019-05-06 01:48:30 +08:00
|
|
|
import protectedSessionService from './protected_session.js';
|
|
|
|
|
|
|
|
class NoteDetailProtectedSession {
|
2019-05-06 00:24:59 +08:00
|
|
|
/**
|
2019-05-09 01:55:24 +08:00
|
|
|
* @param {TabContext} ctx
|
2019-05-06 00:24:59 +08:00
|
|
|
*/
|
|
|
|
constructor(ctx) {
|
|
|
|
this.ctx = ctx;
|
2019-05-09 01:55:24 +08:00
|
|
|
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");
|
2019-05-06 01:48:30 +08:00
|
|
|
|
|
|
|
this.$passwordForm.submit(() => {
|
|
|
|
const password = this.$passwordInput.val();
|
|
|
|
this.$passwordInput.val("");
|
|
|
|
|
|
|
|
protectedSessionService.setupProtectedSession(password);
|
|
|
|
|
|
|
|
return false;
|
|
|
|
});
|
2019-05-06 00:24:59 +08:00
|
|
|
}
|
|
|
|
|
2019-05-12 18:58:55 +08:00
|
|
|
render() {
|
2019-05-06 00:24:59 +08:00
|
|
|
this.$component.show();
|
|
|
|
}
|
2019-05-06 01:48:30 +08:00
|
|
|
|
|
|
|
getContent() {}
|
|
|
|
|
|
|
|
focus() {}
|
|
|
|
|
|
|
|
onNoteChange() {}
|
|
|
|
|
|
|
|
cleanup() {}
|
|
|
|
|
|
|
|
scrollToTop() {
|
|
|
|
this.$component.scrollTop(0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default NoteDetailProtectedSession;
|