diff --git a/dev/Knoin/AbstractViews.js b/dev/Knoin/AbstractViews.js index ba3afa71b..c724fd5e9 100644 --- a/dev/Knoin/AbstractViews.js +++ b/dev/Knoin/AbstractViews.js @@ -62,7 +62,7 @@ export class AbstractViewPopup extends AbstractView this.modalVisible = ko.observable(false).extend({ rateLimit: 0 }); shortcuts.add('escape,close', '', name, () => { if (this.modalVisible() && false !== this.onClose()) { - this.closeCommand(); + this.close(); return false; } return true; @@ -80,7 +80,7 @@ export class AbstractViewPopup extends AbstractView onHide() {} // Happens before animation transitionend afterHide() {} // Happens after animation transitionend - closeCommand() {} + close() {} */ } diff --git a/dev/Knoin/Knoin.js b/dev/Knoin/Knoin.js index 2d47888c0..e47b71f96 100644 --- a/dev/Knoin/Knoin.js +++ b/dev/Knoin/Knoin.js @@ -30,7 +30,9 @@ const buildViewModel = (ViewModelClass, vmScreen) => { if (ViewModelClass && !ViewModelClass.__builded) { let vmDom = null; - const vm = new ViewModelClass(vmScreen), + const + vm = new ViewModelClass(vmScreen), + id = vm.viewModelTemplateID, position = vm.viewType || '', dialog = ViewType.Popup === position, vmPlace = position ? doc.getElementById('rl-' + position.toLowerCase()) : null; @@ -39,16 +41,16 @@ const ViewModelClass.__vm = vm; if (vmPlace) { - vmDom = dialog - ? Element.fromHTML('') - : Element.fromHTML(''); + vmDom = Element.fromHTML(dialog + ? '' + : ''); vmPlace.append(vmDom); vm.viewModelDom = vmDom; ViewModelClass.__dom = vmDom; if (ViewType.Popup === position) { - vm.closeCommand = () => hideScreenPopup(ViewModelClass); + vm.close = () => hideScreenPopup(ViewModelClass); // Firefox / Safari HTMLDialogElement not defined if (!vmDom.showModal) { @@ -110,7 +112,7 @@ const vmDom, { i18nInit: true, - template: () => ({ name: vm.viewModelTemplateID }) + template: () => ({ name: id }) }, vm ); @@ -172,7 +174,7 @@ const // Close all popups for (let vm of visiblePopups) { - false === vm.onClose() || vm.closeCommand(); + false === vm.onClose() || vm.close(); } if (screenName) { diff --git a/dev/View/Popup/Account.js b/dev/View/Popup/Account.js index 2b25c2aeb..71e8ab12e 100644 --- a/dev/View/Popup/Account.js +++ b/dev/View/Popup/Account.js @@ -41,7 +41,7 @@ export class AccountPopupView extends AbstractViewPopup { this.submitErrorAdditional((data && data.ErrorMessageAdditional) || ''); } else { rl.app.accountsAndIdentities(); - this.closeCommand(); + this.close(); } }, { Email: email, diff --git a/dev/View/Popup/AdvancedSearch.js b/dev/View/Popup/AdvancedSearch.js index 2b5d46e2f..b06ba0544 100644 --- a/dev/View/Popup/AdvancedSearch.js +++ b/dev/View/Popup/AdvancedSearch.js @@ -57,7 +57,7 @@ export class AdvancedSearchPopupView extends AbstractViewPopup { MessagelistUserStore.mainSearch(search); } - this.closeCommand(); + this.close(); } parseSearchStringValue(search) { diff --git a/dev/View/Popup/Ask.js b/dev/View/Popup/Ask.js index 80a79417c..ae1f8388e 100644 --- a/dev/View/Popup/Ask.js +++ b/dev/View/Popup/Ask.js @@ -22,13 +22,13 @@ export class AskPopupView extends AbstractViewPopup { } yesClick() { - this.closeCommand(); + this.close(); isFunction(this.fYesAction) && this.fYesAction(); } noClick() { - this.closeCommand(); + this.close(); isFunction(this.fNoAction) && this.fNoAction(); } diff --git a/dev/View/Popup/Compose.js b/dev/View/Popup/Compose.js index 30f530dd4..40deeb578 100644 --- a/dev/View/Popup/Compose.js +++ b/dev/View/Popup/Compose.js @@ -544,7 +544,7 @@ export class ComposePopupView extends AbstractViewPopup { || getNotification(Notification.CantSendMessage)); } } else { - this.closeCommand(); + this.close(); } setFolderHash(this.draftsFolder(), ''); setFolderHash(sSentFolder, ''); @@ -633,7 +633,7 @@ export class ComposePopupView extends AbstractViewPopup { aUidForRemove = [this.draftUid()]; messagesDeleteHelper(sFromFolderFullName, aUidForRemove); MessagelistUserStore.removeMessagesFromList(sFromFolderFullName, aUidForRemove); - this.closeCommand(); + this.close(); } ]); } @@ -1183,11 +1183,11 @@ export class ComposePopupView extends AbstractViewPopup { tryToClosePopup() { if (AskPopupView.hidden()) { if (this.bSkipNextHide || (this.isEmptyForm() && !this.draftUid())) { - this.closeCommand(); + this.close(); } else { showScreenPopup(AskPopupView, [ i18n('POPUPS_ASK/DESC_WANT_CLOSE_THIS_WINDOW'), - () => this.closeCommand() + () => this.close() ]); } } diff --git a/dev/View/Popup/Contacts.js b/dev/View/Popup/Contacts.js index c6b2f8f01..75855b6d5 100644 --- a/dev/View/Popup/Contacts.js +++ b/dev/View/Popup/Contacts.js @@ -136,7 +136,7 @@ export class ContactsPopupView extends AbstractViewPopup { }); decorateKoCommands(this, { -// closeCommand: self => !self.watchDirty(), +// close: self => !self.watchDirty(), deleteCommand: self => 0 < self.contactsCheckedOrSelected().length, newMessageCommand: self => 0 < self.contactsCheckedOrSelected().length, saveCommand: self => !self.viewSaving() && !self.viewReadOnly() @@ -182,7 +182,7 @@ export class ContactsPopupView extends AbstractViewPopup { if (arrayLength(aE)) { this.bBackToCompose = false; - this.closeCommand(); + this.close(); switch (this.sLastComposeFocusedField) { case 'cc': @@ -500,7 +500,7 @@ export class ContactsPopupView extends AbstractViewPopup { if (this.watchDirty() && AskPopupView.hidden()) { showScreenPopup(AskPopupView, [ i18n('POPUPS_ASK/DESC_WANT_CLOSE_THIS_WINDOW'), - () => this.closeCommand() + () => this.close() ]); return false; } diff --git a/dev/View/Popup/Domain.js b/dev/View/Popup/Domain.js index f203a4072..dbe07bc03 100644 --- a/dev/View/Popup/Domain.js +++ b/dev/View/Popup/Domain.js @@ -220,7 +220,7 @@ export class DomainPopupView extends AbstractViewPopup { this.savingError(getNotification(iError)); } else { DomainAdminStore.fetch(); - this.closeCommand(); + this.close(); } } diff --git a/dev/View/Popup/DomainAlias.js b/dev/View/Popup/DomainAlias.js index 7c13fc719..f6952d3a3 100644 --- a/dev/View/Popup/DomainAlias.js +++ b/dev/View/Popup/DomainAlias.js @@ -42,7 +42,7 @@ export class DomainAliasPopupView extends AbstractViewPopup { this.savingError(getNotification(iError)); } else { DomainAdminStore.fetch(); - this.closeCommand(); + this.close(); } }, { Name: this.name(), diff --git a/dev/View/Popup/Filter.js b/dev/View/Popup/Filter.js index 5b73bca9a..e77639987 100644 --- a/dev/View/Popup/Filter.js +++ b/dev/View/Popup/Filter.js @@ -51,7 +51,7 @@ export class FilterPopupView extends AbstractViewPopup { if (this.filter().verify()) { this.fTrueCallback(); - this.closeCommand(); + this.close(); } } diff --git a/dev/View/Popup/FolderClear.js b/dev/View/Popup/FolderClear.js index cdd6af4cf..388b0a0d6 100644 --- a/dev/View/Popup/FolderClear.js +++ b/dev/View/Popup/FolderClear.js @@ -54,7 +54,7 @@ export class FolderClearPopupView extends AbstractViewPopup { this.clearingError(getNotification(iError)); } else { MessagelistUserStore.reload(true); - this.closeCommand(); + this.close(); } }, { Folder: folderToClear.fullName diff --git a/dev/View/Popup/FolderCreate.js b/dev/View/Popup/FolderCreate.js index 324e59166..a7da49fbd 100644 --- a/dev/View/Popup/FolderCreate.js +++ b/dev/View/Popup/FolderCreate.js @@ -75,7 +75,7 @@ export class FolderCreatePopupView extends AbstractViewPopup { } ); - this.closeCommand(); + this.close(); } } diff --git a/dev/View/Popup/Identity.js b/dev/View/Popup/Identity.js index d10e3bb4b..dcdbde8bc 100644 --- a/dev/View/Popup/Identity.js +++ b/dev/View/Popup/Identity.js @@ -97,7 +97,7 @@ export class IdentityPopupView extends AbstractViewPopup { this.submitError(getNotification(iError)); } else { rl.app.accountsAndIdentities(); - this.closeCommand(); + this.close(); } }, { Id: this.id, diff --git a/dev/View/Popup/Languages.js b/dev/View/Popup/Languages.js index 0d9ff3f7c..483203d5c 100644 --- a/dev/View/Popup/Languages.js +++ b/dev/View/Popup/Languages.js @@ -52,6 +52,6 @@ export class LanguagesPopupView extends AbstractViewPopup { changeLanguage(lang) { this.fLang && this.fLang(lang); - this.closeCommand(); + this.close(); } } diff --git a/dev/View/Popup/OpenPgpGenerate.js b/dev/View/Popup/OpenPgpGenerate.js index 3845b8b33..227730202 100644 --- a/dev/View/Popup/OpenPgpGenerate.js +++ b/dev/View/Popup/OpenPgpGenerate.js @@ -70,7 +70,7 @@ export class OpenPgpGeneratePopupView extends AbstractViewPopup { if (keyPair) { const fn = () => { this.submitRequest(false); - this.closeCommand(); + this.close(); }; OpenPGPUserStore.storeKeyPair(keyPair); diff --git a/dev/View/Popup/OpenPgpImport.js b/dev/View/Popup/OpenPgpImport.js index 8d92f8081..e9fb4d195 100644 --- a/dev/View/Popup/OpenPgpImport.js +++ b/dev/View/Popup/OpenPgpImport.js @@ -63,7 +63,7 @@ export class OpenPgpImportPopupView extends AbstractViewPopup { return; } - this.closeCommand(); + this.close(); } onShow() { diff --git a/dev/View/Popup/Plugin.js b/dev/View/Popup/Plugin.js index 43ae30d02..ef4550ff1 100644 --- a/dev/View/Popup/Plugin.js +++ b/dev/View/Popup/Plugin.js @@ -61,7 +61,7 @@ export class PluginPopupView extends AbstractViewPopup { Remote.request('AdminPluginSettingsUpdate', iError => iError ? this.saveError(getNotification(iError)) - : this.closeCommand(), + : this.close(), oConfig); } @@ -99,7 +99,7 @@ export class PluginPopupView extends AbstractViewPopup { if (AskPopupView.hidden()) { showScreenPopup(AskPopupView, [ i18n('POPUPS_ASK/DESC_WANT_CLOSE_THIS_WINDOW'), - () => this.closeCommand() + () => this.close() ]); } return false; diff --git a/plugins/README.md b/plugins/README.md index 77dc6f107..a8e78ba73 100644 --- a/plugins/README.md +++ b/plugins/README.md @@ -28,7 +28,7 @@ class PluginPopupView extends rl.pluginPopupView afterShow() {} // Happens when user hits Escape or Close key - // return false to prevent closing, use closeCommand() manually + // return false to prevent closing, use close() manually onClose() {} // Happens before animation transitionend onHide() {} diff --git a/plugins/two-factor-auth/index.php b/plugins/two-factor-auth/index.php index 810d3fe02..15590ceb3 100644 --- a/plugins/two-factor-auth/index.php +++ b/plugins/two-factor-auth/index.php @@ -7,9 +7,9 @@ class TwoFactorAuthPlugin extends \RainLoop\Plugins\AbstractPlugin { const NAME = 'Two Factor Authentication', - VERSION = '2.13', + VERSION = '2.13.2', RELEASE = '2022-02-28', - REQUIRED = '2.13.0', + REQUIRED = '2.13.2', CATEGORY = 'Login', DESCRIPTION = 'Provides support for TOTP 2FA'; diff --git a/plugins/two-factor-auth/templates/PopupsTwoFactorAuthTest.html b/plugins/two-factor-auth/templates/PopupsTwoFactorAuthTest.html index 01b3389d0..556a324ef 100644 --- a/plugins/two-factor-auth/templates/PopupsTwoFactorAuthTest.html +++ b/plugins/two-factor-auth/templates/PopupsTwoFactorAuthTest.html @@ -1,5 +1,5 @@
- × + ×