mirror of
https://github.com/the-djmaze/snappymail.git
synced 2024-11-15 20:24:51 +08:00
24 lines
867 B
JavaScript
24 lines
867 B
JavaScript
|
|
||
|
(rl => {
|
||
|
|
||
|
rl && addEventListener('rl-view-model', e => {
|
||
|
if (e.detail && 'Login' === e.detail.viewModelTemplateID) {
|
||
|
const container = e.detail.viewModelDom.querySelector('#plugin-Login-BottomControlGroup'),
|
||
|
placeholder = 'LOGIN/LABEL_VERIFICATION_CODE';
|
||
|
if (container) {
|
||
|
container.append(Element.fromHTML('<div class="controls">'
|
||
|
+ '<div class="input-append">'
|
||
|
+ '<input name="totp_code" type="text" class="input-block-level inputIcon"'
|
||
|
+ ' pattern="[0-9]*" inputmode="numeric"'
|
||
|
+ ' autocomplete="off" autocorrect="off" autocapitalize="none" spellcheck="false"'
|
||
|
+ ' data-bind="textInput: totp, disable: submitRequest" data-i18n="[placeholder]'+placeholder
|
||
|
+ '" placeholder="'+rl.i18n(placeholder)+'">'
|
||
|
+ '<i class="add-on fontastic">🔑</i>'
|
||
|
+ '</div>'
|
||
|
+ '</div>'));
|
||
|
}
|
||
|
}
|
||
|
});
|
||
|
|
||
|
})(window.rl);
|