mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-08 00:47:04 +03:00
Added JavaScript rl-vm-visible event so that demo extension can prefill passphrase
This commit is contained in:
parent
7a1652972d
commit
f8d358a4f3
3 changed files with 30 additions and 0 deletions
26
plugins/demo-account/demo.js
Normal file
26
plugins/demo-account/demo.js
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
(rl => {
|
||||
if (rl) {
|
||||
/*
|
||||
addEventListener('rl-view-model', e => {
|
||||
const view = e.detail;
|
||||
if (view && 'Login' === view.viewModelTemplateID) {
|
||||
view.email(rl.settings.get('DemoEmail'));
|
||||
view.password('DemoPassword');
|
||||
}
|
||||
});
|
||||
*/
|
||||
addEventListener('rl-vm-visible', e => {
|
||||
const view = e.detail;
|
||||
/* Not working
|
||||
if (view && 'PopupsCompose' === view.viewModelTemplateID) {
|
||||
view.to(rl.settings.get('DemoEmail'));
|
||||
// view.to(view.from());
|
||||
}
|
||||
*/
|
||||
if (view && 'PopupsAsk' === view.viewModelTemplateID) {
|
||||
view.passphrase('demo');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
})(window.rl);
|
||||
Loading…
Add table
Add a link
Reference in a new issue