mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +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
|
|
@ -78,9 +78,11 @@ const
|
||||||
if (e.target === vmDom) {
|
if (e.target === vmDom) {
|
||||||
if (vmDom.classList.contains('animate')) {
|
if (vmDom.classList.contains('animate')) {
|
||||||
vm.afterShow?.();
|
vm.afterShow?.();
|
||||||
|
fireEvent('rl-vm-visible', vm);
|
||||||
} else {
|
} else {
|
||||||
vmDom.close();
|
vmDom.close();
|
||||||
vm.afterHide?.();
|
vm.afterHide?.();
|
||||||
|
// fireEvent('rl-vm-hidden', vm);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
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);
|
||||||
|
|
@ -13,6 +13,8 @@ class DemoAccountPlugin extends \RainLoop\Plugins\AbstractPlugin
|
||||||
*/
|
*/
|
||||||
public function Init() : void
|
public function Init() : void
|
||||||
{
|
{
|
||||||
|
$this->addJs('demo.js');
|
||||||
|
|
||||||
$this->addHook('filter.app-data', 'FilterAppData');
|
$this->addHook('filter.app-data', 'FilterAppData');
|
||||||
$this->addHook('filter.action-params', 'FilterActionParams');
|
$this->addHook('filter.action-params', 'FilterActionParams');
|
||||||
$this->addHook('json.before-accountsetup', 'BeforeAccountSetup');
|
$this->addHook('json.before-accountsetup', 'BeforeAccountSetup');
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue