mirror of
https://github.com/the-djmaze/snappymail.git
synced 2024-11-10 09:02:45 +08:00
25 lines
708 B
JavaScript
25 lines
708 B
JavaScript
(doc => {
|
|
|
|
addEventListener('rl-view-model.create', event => {
|
|
if ('SettingsSecurity' === event.detail.viewModelTemplateID) {
|
|
const template = doc.getElementById('SettingsSecurity'),
|
|
details = doc.createElement('details'),
|
|
summary = doc.createElement('summary'),
|
|
button = doc.createElement('button');
|
|
summary.textContent = "Have i been pwned?"
|
|
button.dataset.bind = "click:HibpCheck";
|
|
button.textContent = "Check";
|
|
details.append(summary, button);
|
|
template.content.append(details);
|
|
|
|
event.detail.HibpCheck = () => {
|
|
// JsonHibpCheck
|
|
rl.pluginRemoteRequest((iError, oData) => {
|
|
console.dir({iError, oData});
|
|
}, 'HibpCheck');
|
|
|
|
};
|
|
}
|
|
});
|
|
|
|
})(document);
|