From 36329110e559c960950d3d7e08e25f69908414d5 Mon Sep 17 00:00:00 2001 From: RainLoop Team Date: Tue, 26 Aug 2014 19:24:47 +0400 Subject: [PATCH] Code refactoring --- dev/{_AdminBoot.js => Admin.js} | 2 +- dev/{Boots => Apps}/AbstractApp.js | 0 dev/{Boots => Apps}/AdminApp.js | 22 +- dev/{Boots => Apps}/RainLoopApp.js | 24 +- dev/{Boots => }/Boot.js | 37 +- dev/Common/Globals.js | 2 +- dev/Common/Utils.js | 1 - dev/{_RainLoopBoot.js => RainLoop.js} | 2 +- dev/Screens/AbstractSettings.js | 1 - dev/Screens/AdminLoginScreen.js | 4 +- dev/Screens/AdminSettingsScreen.js | 4 +- dev/Screens/LoginScreen.js | 4 +- dev/Screens/MailBoxScreen.js | 18 +- dev/Screens/SettingsScreen.js | 8 +- .../Admin/AdminSettingsAbout.js | 8 +- .../Admin/AdminSettingsBranding.js | 4 +- .../Admin/AdminSettingsContacts.js | 6 +- .../Admin/AdminSettingsDomains.js | 10 +- .../Admin/AdminSettingsGeneral.js | 8 +- .../Admin/AdminSettingsLicensing.js | 10 +- .../Admin/AdminSettingsLogin.js | 6 +- .../Admin/AdminSettingsPackages.js | 8 +- .../Admin/AdminSettingsPlugins.js | 12 +- .../Admin/AdminSettingsSecurity.js | 8 +- .../Admin/AdminSettingsSocial.js | 4 +- dev/Settings/{ => App}/SettingsAccounts.js | 10 +- .../{ => App}/SettingsChangePassword.js | 2 +- dev/Settings/{ => App}/SettingsContacts.js | 4 +- dev/Settings/{ => App}/SettingsFilters.js | 4 +- dev/Settings/{ => App}/SettingsFolders.js | 22 +- dev/Settings/{ => App}/SettingsGeneral.js | 7 +- dev/Settings/{ => App}/SettingsIdentities.js | 11 +- dev/Settings/{ => App}/SettingsIdentity.js | 5 +- dev/Settings/{ => App}/SettingsOpenPGP.js | 12 +- dev/Settings/{ => App}/SettingsSecurity.js | 4 +- dev/Settings/{ => App}/SettingsSocial.js | 16 +- dev/Settings/{ => App}/SettingsThemes.js | 5 +- dev/Storages/AbstractAjaxRemoteStorage.js | 8 +- dev/Storages/WebMailAjaxRemoteStorage.js | 4 +- dev/Storages/WebMailDataStorage.js | 8 +- .../AbstractSystemDropDownViewModel.js | 4 +- dev/ViewModels/AdminLoginViewModel.js | 4 +- dev/ViewModels/AdminPaneViewModel.js | 4 +- dev/ViewModels/LoginViewModel.js | 8 +- dev/ViewModels/MailBoxFolderListViewModel.js | 14 +- dev/ViewModels/MailBoxMessageListViewModel.js | 35 +- dev/ViewModels/MailBoxMessageViewViewModel.js | 22 +- .../Popups/PopupsAddAccountViewModel.js | 4 +- .../Popups/PopupsAddOpenPgpKeyViewModel.js | 4 +- .../Popups/PopupsComposeViewModel.js | 16 +- .../Popups/PopupsContactsViewModel.js | 16 +- .../Popups/PopupsDomainViewModel.js | 4 +- .../Popups/PopupsFolderClearViewModel.js | 8 +- .../Popups/PopupsFolderCreateViewModel.js | 4 +- .../PopupsGenerateNewOpenPgpKeyViewModel.js | 4 +- .../Popups/PopupsIdentityViewModel.js | 4 +- gulpfile.js | 6 +- package.json | 5 +- .../app/libraries/MailSo/Imap/ImapClient.php | 56 +- .../app/libraries/MailSo/Net/NetClient.php | 13 +- rainloop/v/0.0.0/app/templates/Index.html | 10 +- rainloop/v/0.0.0/static/css/app.css | 18 +- rainloop/v/0.0.0/static/js/admin.js | 2927 +++++++++-------- rainloop/v/0.0.0/static/js/admin.min.js | 12 +- rainloop/v/0.0.0/static/js/app.js | 546 +-- rainloop/v/0.0.0/static/js/app.min.js | 16 +- rainloop/v/0.0.0/static/js/boot.js | 2 +- rainloop/v/0.0.0/static/js/libs.js | 64 +- vendors/rl/rl-1.1.min.js | 2 +- vendors/rl/rl.js | 10 +- .../underscore-min.js} | 0 .../underscore/{ => 1.5.2}/underscore-min.map | 0 vendors/underscore/{ => 1.5.2}/underscore.js | 0 vendors/underscore/1.6.0/underscore-min.js | 5 + vendors/underscore/1.6.0/underscore-min.map | 1 + vendors/underscore/1.6.0/underscore.js | 1343 ++++++++ vendors/underscore/CONTRIBUTING.md | 9 - vendors/underscore/README.md | 22 - vendors/underscore/bower.json | 6 - vendors/underscore/component.json | 10 - vendors/underscore/package.json | 25 - 81 files changed, 3474 insertions(+), 2124 deletions(-) rename dev/{_AdminBoot.js => Admin.js} (69%) rename dev/{Boots => Apps}/AbstractApp.js (100%) rename dev/{Boots => Apps}/AdminApp.js (88%) rename dev/{Boots => Apps}/RainLoopApp.js (97%) rename dev/{Boots => }/Boot.js (72%) rename dev/{_RainLoopBoot.js => RainLoop.js} (68%) rename dev/{ => Settings}/Admin/AdminSettingsAbout.js (88%) rename dev/{ => Settings}/Admin/AdminSettingsBranding.js (95%) rename dev/{ => Settings}/Admin/AdminSettingsContacts.js (97%) rename dev/{ => Settings}/Admin/AdminSettingsDomains.js (88%) rename dev/{ => Settings}/Admin/AdminSettingsGeneral.js (93%) rename dev/{ => Settings}/Admin/AdminSettingsLicensing.js (81%) rename dev/{ => Settings}/Admin/AdminSettingsLogin.js (89%) rename dev/{ => Settings}/Admin/AdminSettingsPackages.js (91%) rename dev/{ => Settings}/Admin/AdminSettingsPlugins.js (87%) rename dev/{ => Settings}/Admin/AdminSettingsSecurity.js (93%) rename dev/{ => Settings}/Admin/AdminSettingsSocial.js (97%) rename dev/Settings/{ => App}/SettingsAccounts.js (86%) rename dev/Settings/{ => App}/SettingsChangePassword.js (98%) rename dev/Settings/{ => App}/SettingsContacts.js (91%) rename dev/Settings/{ => App}/SettingsFilters.js (83%) rename dev/Settings/{ => App}/SettingsFolders.js (88%) rename dev/Settings/{ => App}/SettingsGeneral.js (95%) rename dev/Settings/{ => App}/SettingsIdentities.js (94%) rename dev/Settings/{ => App}/SettingsIdentity.js (93%) rename dev/Settings/{ => App}/SettingsOpenPGP.js (79%) rename dev/Settings/{ => App}/SettingsSecurity.js (95%) rename dev/Settings/{ => App}/SettingsSocial.js (85%) rename dev/Settings/{ => App}/SettingsThemes.js (95%) rename vendors/underscore/{underscore-1.5.2.min.js => 1.5.2/underscore-min.js} (100%) rename vendors/underscore/{ => 1.5.2}/underscore-min.map (100%) rename vendors/underscore/{ => 1.5.2}/underscore.js (100%) create mode 100644 vendors/underscore/1.6.0/underscore-min.js create mode 100644 vendors/underscore/1.6.0/underscore-min.map create mode 100644 vendors/underscore/1.6.0/underscore.js delete mode 100644 vendors/underscore/CONTRIBUTING.md delete mode 100644 vendors/underscore/README.md delete mode 100644 vendors/underscore/bower.json delete mode 100644 vendors/underscore/component.json delete mode 100644 vendors/underscore/package.json diff --git a/dev/_AdminBoot.js b/dev/Admin.js similarity index 69% rename from dev/_AdminBoot.js rename to dev/Admin.js index 19524c3c7..b377e12d3 100644 --- a/dev/_AdminBoot.js +++ b/dev/Admin.js @@ -2,5 +2,5 @@ (function (require) { 'use strict'; - require('Boot')(require('./Boots/AdminApp.js')); + require('./Boot.js')(require('./Apps/AdminApp.js')); }(require)); \ No newline at end of file diff --git a/dev/Boots/AbstractApp.js b/dev/Apps/AbstractApp.js similarity index 100% rename from dev/Boots/AbstractApp.js rename to dev/Apps/AbstractApp.js diff --git a/dev/Boots/AdminApp.js b/dev/Apps/AdminApp.js similarity index 88% rename from dev/Boots/AdminApp.js rename to dev/Apps/AdminApp.js index 8fa53846b..ba7712006 100644 --- a/dev/Boots/AdminApp.js +++ b/dev/Apps/AdminApp.js @@ -48,40 +48,40 @@ AdminApp.prototype.setupSettings = function () { - kn.addSettingsViewModel(require('../Admin/AdminSettingsGeneral.js'), + kn.addSettingsViewModel(require('../Settings/Admin/AdminSettingsGeneral.js'), 'AdminSettingsGeneral', 'General', 'general', true); - kn.addSettingsViewModel(require('../Admin/AdminSettingsLogin.js'), + kn.addSettingsViewModel(require('../Settings/Admin/AdminSettingsLogin.js'), 'AdminSettingsLogin', 'Login', 'login'); if (AppSettings.capa(Enums.Capa.Prem)) { - kn.addSettingsViewModel(require('../Admin/AdminSettingsBranding.js'), + kn.addSettingsViewModel(require('../Settings/Admin/AdminSettingsBranding.js'), 'AdminSettingsBranding', 'Branding', 'branding'); } - kn.addSettingsViewModel(require('../Admin/AdminSettingsContacts.js'), + kn.addSettingsViewModel(require('../Settings/Admin/AdminSettingsContacts.js'), 'AdminSettingsContacts', 'Contacts', 'contacts'); - kn.addSettingsViewModel(require('../Admin/AdminSettingsDomains.js'), + kn.addSettingsViewModel(require('../Settings/Admin/AdminSettingsDomains.js'), 'AdminSettingsDomains', 'Domains', 'domains'); - kn.addSettingsViewModel(require('../Admin/AdminSettingsSecurity.js'), + kn.addSettingsViewModel(require('../Settings/Admin/AdminSettingsSecurity.js'), 'AdminSettingsSecurity', 'Security', 'security'); - kn.addSettingsViewModel(require('../Admin/AdminSettingsSocial.js'), + kn.addSettingsViewModel(require('../Settings/Admin/AdminSettingsSocial.js'), 'AdminSettingsSocial', 'Social', 'social'); - kn.addSettingsViewModel(require('../Admin/AdminSettingsPlugins.js'), + kn.addSettingsViewModel(require('../Settings/Admin/AdminSettingsPlugins.js'), 'AdminSettingsPlugins', 'Plugins', 'plugins'); - kn.addSettingsViewModel(require('../Admin/AdminSettingsPackages.js'), + kn.addSettingsViewModel(require('../Settings/Admin/AdminSettingsPackages.js'), 'AdminSettingsPackages', 'Packages', 'packages'); - kn.addSettingsViewModel(require('../Admin/AdminSettingsLicensing.js'), + kn.addSettingsViewModel(require('../Settings/Admin/AdminSettingsLicensing.js'), 'AdminSettingsLicensing', 'Licensing', 'licensing'); - kn.addSettingsViewModel(require('../Admin/AdminSettingsAbout.js'), + kn.addSettingsViewModel(require('../Settings/Admin/AdminSettingsAbout.js'), 'AdminSettingsAbout', 'About', 'about'); return true; diff --git a/dev/Boots/RainLoopApp.js b/dev/Apps/RainLoopApp.js similarity index 97% rename from dev/Boots/RainLoopApp.js rename to dev/Apps/RainLoopApp.js index e6e6dab5f..4dc4de086 100644 --- a/dev/Boots/RainLoopApp.js +++ b/dev/Apps/RainLoopApp.js @@ -125,41 +125,41 @@ RainLoopApp.prototype.setupSettings = function () { - kn.addSettingsViewModel(require('../Settings/SettingsGeneral.js'), + kn.addSettingsViewModel(require('../Settings/App/SettingsGeneral.js'), 'SettingsGeneral', 'SETTINGS_LABELS/LABEL_GENERAL_NAME', 'general', true); if (AppSettings.settingsGet('ContactsIsAllowed')) { - kn.addSettingsViewModel(require('../Settings/SettingsContacts.js'), + kn.addSettingsViewModel(require('../Settings/App/SettingsContacts.js'), 'SettingsContacts', 'SETTINGS_LABELS/LABEL_CONTACTS_NAME', 'contacts'); } if (AppSettings.capa(Enums.Capa.AdditionalAccounts)) { - kn.addSettingsViewModel(require('../Settings/SettingsAccounts.js'), + kn.addSettingsViewModel(require('../Settings/App/SettingsAccounts.js'), 'SettingsAccounts', 'SETTINGS_LABELS/LABEL_ACCOUNTS_NAME', 'accounts'); } if (AppSettings.capa(Enums.Capa.AdditionalIdentities)) { - kn.addSettingsViewModel(require('../Settings/SettingsIdentities.js'), + kn.addSettingsViewModel(require('../Settings/App/SettingsIdentities.js'), 'SettingsIdentities', 'SETTINGS_LABELS/LABEL_IDENTITIES_NAME', 'identities'); } else { - kn.addSettingsViewModel(require('../Settings/SettingsIdentity.js'), + kn.addSettingsViewModel(require('../Settings/App/SettingsIdentity.js'), 'SettingsIdentity', 'SETTINGS_LABELS/LABEL_IDENTITY_NAME', 'identity'); } if (AppSettings.capa(Enums.Capa.Filters)) { - kn.addSettingsViewModel(require('../Settings/SettingsFilters.js'), + kn.addSettingsViewModel(require('../Settings/App/SettingsFilters.js'), 'SettingsFilters', 'SETTINGS_LABELS/LABEL_FILTERS_NAME', 'filters'); } if (AppSettings.capa(Enums.Capa.TwoFactor)) { - kn.addSettingsViewModel(require('../Settings/SettingsSecurity.js'), + kn.addSettingsViewModel(require('../Settings/App/SettingsSecurity.js'), 'SettingsSecurity', 'SETTINGS_LABELS/LABEL_SECURITY_NAME', 'security'); } @@ -167,28 +167,28 @@ AppSettings.settingsGet('AllowFacebookSocial') || AppSettings.settingsGet('AllowTwitterSocial')) { - kn.addSettingsViewModel(require('../Settings/SettingsSocial.js'), + kn.addSettingsViewModel(require('../Settings/App/SettingsSocial.js'), 'SettingsSocial', 'SETTINGS_LABELS/LABEL_SOCIAL_NAME', 'social'); } if (AppSettings.settingsGet('ChangePasswordIsAllowed')) { - kn.addSettingsViewModel(require('../Settings/SettingsChangePassword.js'), + kn.addSettingsViewModel(require('../Settings/App/SettingsChangePassword.js'), 'SettingsChangePassword', 'SETTINGS_LABELS/LABEL_CHANGE_PASSWORD_NAME', 'change-password'); } - kn.addSettingsViewModel(require('../Settings/SettingsFolders.js'), + kn.addSettingsViewModel(require('../Settings/App/SettingsFolders.js'), 'SettingsFolders', 'SETTINGS_LABELS/LABEL_FOLDERS_NAME', 'folders'); if (AppSettings.capa(Enums.Capa.Themes)) { - kn.addSettingsViewModel(require('../Settings/SettingsThemes.js'), + kn.addSettingsViewModel(require('../Settings/App/SettingsThemes.js'), 'SettingsThemes', 'SETTINGS_LABELS/LABEL_THEMES_NAME', 'themes'); } if (AppSettings.capa(Enums.Capa.OpenPGP)) { - kn.addSettingsViewModel(require('../Settings/SettingsOpenPGP.js'), + kn.addSettingsViewModel(require('../Settings/App/SettingsOpenPGP.js'), 'SettingsOpenPGP', 'SETTINGS_LABELS/LABEL_OPEN_PGP_NAME', 'openpgp'); } diff --git a/dev/Boots/Boot.js b/dev/Boot.js similarity index 72% rename from dev/Boots/Boot.js rename to dev/Boot.js index 08535fdea..c63318315 100644 --- a/dev/Boots/Boot.js +++ b/dev/Boot.js @@ -4,21 +4,24 @@ 'use strict'; - var - window = require('window'), - _ = require('_'), - $ = require('$'), - $window = require('$window'), - $html = require('$html'), - - Globals = require('Globals'), - Plugins = require('Plugins'), - Utils = require('Utils') - ; - module.exports = function (App) { - Globals.__RL = App; + var + window = require('window'), + _ = require('_'), + $ = require('$'), + $window = require('$window'), + $html = require('$html'), + + Globals = require('Globals'), + Plugins = require('Plugins'), + Utils = require('Utils'), + Enums = require('Enums'), + + EmailModel = require('./Models/EmailModel.js') + ; + + Globals.__APP = App; App.setupSettings(); @@ -45,10 +48,10 @@ window['rl']['pluginSettingsGet'] = Plugins.settingsGet; window['rl']['createCommand'] = Utils.createCommand; - window['rl']['EmailModel'] = require('../Models/EmailModel.js'); - window['rl']['Enums'] = require('Enums'); + window['rl']['EmailModel'] = EmailModel; + window['rl']['Enums'] = Enums; - window['__RLBOOT'] = function (fCall) { + window['__APP_BOOT'] = function (fCall) { // boot $(function () { @@ -69,7 +72,7 @@ fCall(false); } - window['__RLBOOT'] = null; + window['__APP_BOOT'] = null; }); }; diff --git a/dev/Common/Globals.js b/dev/Common/Globals.js index 0748aa248..2f315c2ed 100644 --- a/dev/Common/Globals.js +++ b/dev/Common/Globals.js @@ -112,7 +112,7 @@ /** * @type {*} */ - Globals.__RL = null; + Globals.__APP = null; /** * @type {Object} diff --git a/dev/Common/Utils.js b/dev/Common/Utils.js index 7f467be04..fd950667d 100644 --- a/dev/Common/Utils.js +++ b/dev/Common/Utils.js @@ -1364,7 +1364,6 @@ }; /* jshint ignore:start */ - /** * @param {string} s * @return {string} diff --git a/dev/_RainLoopBoot.js b/dev/RainLoop.js similarity index 68% rename from dev/_RainLoopBoot.js rename to dev/RainLoop.js index 1d55ba08a..190c724ee 100644 --- a/dev/_RainLoopBoot.js +++ b/dev/RainLoop.js @@ -2,5 +2,5 @@ (function (require) { 'use strict'; - require('Boot')(require('./Boots/RainLoopApp.js')); + require('./Boot.js')(require('./Apps/RainLoopApp.js')); }(require)); \ No newline at end of file diff --git a/dev/Screens/AbstractSettings.js b/dev/Screens/AbstractSettings.js index 50a6439c3..632b26380 100644 --- a/dev/Screens/AbstractSettings.js +++ b/dev/Screens/AbstractSettings.js @@ -77,7 +77,6 @@ oViewModelPlace = this.oViewModelPlace; if (oViewModelPlace && 1 === oViewModelPlace.length) { - RoutedSettingsViewModel = /** @type {?Function} */ RoutedSettingsViewModel; oSettingsScreen = new RoutedSettingsViewModel(); oViewModelDom = $('
').addClass('rl-settings-view-model').hide(); diff --git a/dev/Screens/AdminLoginScreen.js b/dev/Screens/AdminLoginScreen.js index 1697b26e2..c2fff0517 100644 --- a/dev/Screens/AdminLoginScreen.js +++ b/dev/Screens/AdminLoginScreen.js @@ -23,8 +23,8 @@ AdminLoginScreen.prototype.onShow = function () { - var RL = require('../Boots/AdminApp.js'); - RL.setTitle(''); + var App = require('../Apps/AdminApp.js'); + App.setTitle(''); }; module.exports = AdminLoginScreen; diff --git a/dev/Screens/AdminSettingsScreen.js b/dev/Screens/AdminSettingsScreen.js index 746cba520..1c9ea9ad3 100644 --- a/dev/Screens/AdminSettingsScreen.js +++ b/dev/Screens/AdminSettingsScreen.js @@ -30,8 +30,8 @@ AdminSettingsScreen.prototype.onShow = function () { - var RL = require('../Boots/AdminApp.js'); - RL.setTitle(''); + var App = require('../Apps/AdminApp.js'); + App.setTitle(''); }; module.exports = AdminSettingsScreen; diff --git a/dev/Screens/LoginScreen.js b/dev/Screens/LoginScreen.js index eff7ac788..64eeec8ad 100644 --- a/dev/Screens/LoginScreen.js +++ b/dev/Screens/LoginScreen.js @@ -23,8 +23,8 @@ LoginScreen.prototype.onShow = function () { - var RL = require('../Boots/RainLoopApp.js'); - RL.setTitle(''); + var App = require('../Apps/RainLoopApp.js'); + App.setTitle(''); }; module.exports = LoginScreen; diff --git a/dev/Screens/MailBoxScreen.js b/dev/Screens/MailBoxScreen.js index 343135eb6..132cb0555 100644 --- a/dev/Screens/MailBoxScreen.js +++ b/dev/Screens/MailBoxScreen.js @@ -54,12 +54,12 @@ MailBoxScreen.prototype.setNewTitle = function () { var - RL = require('../Boots/RainLoopApp.js'), + App = require('../Apps/RainLoopApp.js'), sEmail = Data.accountEmail(), nFoldersInboxUnreadCount = Data.foldersInboxUnreadCount() ; - RL.setTitle(('' === sEmail ? '' : + App.setTitle(('' === sEmail ? '' : (0 < nFoldersInboxUnreadCount ? '(' + nFoldersInboxUnreadCount + ') ' : ' ') + sEmail + ' - ') + Utils.i18n('TITLES/MAILBOX')); }; @@ -77,12 +77,12 @@ */ MailBoxScreen.prototype.onRoute = function (sFolderHash, iPage, sSearch, bPreview) { - var RL = require('../Boots/RainLoopApp.js'); + var App = require('../Apps/RainLoopApp.js'); if (Utils.isUnd(bPreview) ? false : !!bPreview) { if (Enums.Layout.NoPreview === Data.layout() && !Data.message()) { - RL.historyBack(); + App.historyBack(); } } else @@ -105,7 +105,7 @@ Data.message(null); } - RL.reloadMessageList(); + App.reloadMessageList(); } } }; @@ -113,7 +113,7 @@ MailBoxScreen.prototype.onStart = function () { var - RL = require('../Boots/RainLoopApp.js'), + App = require('../Apps/RainLoopApp.js'), fResizeFunction = function () { Utils.windowResize(); } @@ -121,18 +121,18 @@ if (AppSettings.capa(Enums.Capa.AdditionalAccounts) || AppSettings.capa(Enums.Capa.AdditionalIdentities)) { - RL.accountsAndIdentities(); + App.accountsAndIdentities(); } _.delay(function () { if ('INBOX' !== Data.currentFolderFullNameRaw()) { - RL.folderInformation('INBOX'); + App.folderInformation('INBOX'); } }, 1000); _.delay(function () { - RL.quota(); + App.quota(); }, 5000); _.delay(function () { diff --git a/dev/Screens/SettingsScreen.js b/dev/Screens/SettingsScreen.js index 90a9484ef..11a3052c7 100644 --- a/dev/Screens/SettingsScreen.js +++ b/dev/Screens/SettingsScreen.js @@ -21,7 +21,7 @@ function SettingsScreen() { var - RL = require('../Boots/RainLoopApp.js'), + App = require('../Apps/RainLoopApp.js'), SettingsSystemDropDownViewModel = require('../ViewModels/SettingsSystemDropDownViewModel.js'), SettingsMenuViewModel = require('../ViewModels/SettingsMenuViewModel.js'), @@ -37,7 +37,7 @@ Utils.initOnStartOrLangChange(function () { this.sSettingsTitle = Utils.i18n('TITLES/SETTINGS'); }, this, function () { - RL.setTitle(this.sSettingsTitle); + App.setTitle(this.sSettingsTitle); }); } @@ -45,9 +45,9 @@ SettingsScreen.prototype.onShow = function () { - var RL = require('../Boots/RainLoopApp.js'); + var App = require('../Apps/RainLoopApp.js'); - RL.setTitle(this.sSettingsTitle); + App.setTitle(this.sSettingsTitle); Globals.keyScope(Enums.KeyState.Settings); }; diff --git a/dev/Admin/AdminSettingsAbout.js b/dev/Settings/Admin/AdminSettingsAbout.js similarity index 88% rename from dev/Admin/AdminSettingsAbout.js rename to dev/Settings/Admin/AdminSettingsAbout.js index 370763b7a..6c70ab9fd 100644 --- a/dev/Admin/AdminSettingsAbout.js +++ b/dev/Settings/Admin/AdminSettingsAbout.js @@ -14,8 +14,8 @@ function AdminSettingsAbout() { var - AppSettings = require('../Storages/AppSettings.js'), - Data = require('../Storages/AdminDataStorage.js') + AppSettings = require('../../Storages/AppSettings.js'), + Data = require('../../Storages/AdminDataStorage.js') ; this.version = ko.observable(AppSettings.settingsGet('Version')); @@ -72,7 +72,7 @@ { if (this.access()) { - require('../Boots/AdminApp.js').reloadCoreData(); + require('../../Apps/AdminApp.js').reloadCoreData(); } }; @@ -80,7 +80,7 @@ { if (!this.coreUpdating()) { - require('../Boots/AdminApp.js').updateCoreData(); + require('../../Apps/AdminApp.js').updateCoreData(); } }; diff --git a/dev/Admin/AdminSettingsBranding.js b/dev/Settings/Admin/AdminSettingsBranding.js similarity index 95% rename from dev/Admin/AdminSettingsBranding.js rename to dev/Settings/Admin/AdminSettingsBranding.js index 3c4e87b8d..2d5c712d8 100644 --- a/dev/Admin/AdminSettingsBranding.js +++ b/dev/Settings/Admin/AdminSettingsBranding.js @@ -18,7 +18,7 @@ { var Enums = require('Enums'), - AppSettings = require('../Storages/AppSettings.js') + AppSettings = require('../../Storages/AppSettings.js') ; this.title = ko.observable(AppSettings.settingsGet('Title')); @@ -41,7 +41,7 @@ { var self = this, - Remote = require('../Storages/AdminAjaxRemoteStorage.js') + Remote = require('../../Storages/AdminAjaxRemoteStorage.js') ; _.delay(function () { diff --git a/dev/Admin/AdminSettingsContacts.js b/dev/Settings/Admin/AdminSettingsContacts.js similarity index 97% rename from dev/Admin/AdminSettingsContacts.js rename to dev/Settings/Admin/AdminSettingsContacts.js index d9810efc6..d0dc7ccdd 100644 --- a/dev/Admin/AdminSettingsContacts.js +++ b/dev/Settings/Admin/AdminSettingsContacts.js @@ -11,7 +11,7 @@ Enums = require('Enums'), Utils = require('Utils'), - AppSettings = require('../Storages/AppSettings.js') + AppSettings = require('../../Storages/AppSettings.js') ; /** @@ -20,7 +20,7 @@ function AdminSettingsContacts() { var - Remote = require('../Storages/AdminAjaxRemoteStorage.js') + Remote = require('../../Storages/AdminAjaxRemoteStorage.js') ; this.defautOptionsAfterRender = Utils.defautOptionsAfterRender; @@ -179,7 +179,7 @@ { var self = this, - Remote = require('../Storages/AdminAjaxRemoteStorage.js') + Remote = require('../../Storages/AdminAjaxRemoteStorage.js') ; _.delay(function () { diff --git a/dev/Admin/AdminSettingsDomains.js b/dev/Settings/Admin/AdminSettingsDomains.js similarity index 88% rename from dev/Admin/AdminSettingsDomains.js rename to dev/Settings/Admin/AdminSettingsDomains.js index aea2a2f6d..b56662584 100644 --- a/dev/Admin/AdminSettingsDomains.js +++ b/dev/Settings/Admin/AdminSettingsDomains.js @@ -11,10 +11,10 @@ Enums = require('Enums'), - PopupsDomainViewModel = require('../ViewModels/Popups/PopupsDomainViewModel.js'), + PopupsDomainViewModel = require('../../ViewModels/Popups/PopupsDomainViewModel.js'), - Data = require('../Storages/AdminDataStorage.js'), - Remote = require('../Storages/AdminAjaxRemoteStorage.js') + Data = require('../../Storages/AdminDataStorage.js'), + Remote = require('../../Storages/AdminAjaxRemoteStorage.js') ; /** @@ -86,7 +86,7 @@ }) ; - require('../Boots/AdminApp.js').reloadDomainList(); + require('../../Apps/AdminApp.js').reloadDomainList(); }; AdminSettingsDomains.prototype.onDomainLoadRequest = function (sResult, oData) @@ -99,7 +99,7 @@ AdminSettingsDomains.prototype.onDomainListChangeRequest = function () { - require('../Boots/AdminApp.js').reloadDomainList(); + require('../../Apps/AdminApp.js').reloadDomainList(); }; module.exports = AdminSettingsDomains; diff --git a/dev/Admin/AdminSettingsGeneral.js b/dev/Settings/Admin/AdminSettingsGeneral.js similarity index 93% rename from dev/Admin/AdminSettingsGeneral.js rename to dev/Settings/Admin/AdminSettingsGeneral.js index 6a6aa6f12..3b99a07ae 100644 --- a/dev/Admin/AdminSettingsGeneral.js +++ b/dev/Settings/Admin/AdminSettingsGeneral.js @@ -12,10 +12,10 @@ Utils = require('Utils'), LinkBuilder = require('LinkBuilder'), - AppSettings = require('../Storages/AppSettings.js'), - Data = require('../Storages/AdminDataStorage.js'), + AppSettings = require('../../Storages/AppSettings.js'), + Data = require('../../Storages/AdminDataStorage.js'), - PopupsLanguagesViewModel = require('../ViewModels/Popups/PopupsLanguagesViewModel.js') + PopupsLanguagesViewModel = require('../../ViewModels/Popups/PopupsLanguagesViewModel.js') ; /** @@ -68,7 +68,7 @@ { var self = this, - Remote = require('../Storages/AdminAjaxRemoteStorage.js') + Remote = require('../../Storages/AdminAjaxRemoteStorage.js') ; _.delay(function () { diff --git a/dev/Admin/AdminSettingsLicensing.js b/dev/Settings/Admin/AdminSettingsLicensing.js similarity index 81% rename from dev/Admin/AdminSettingsLicensing.js rename to dev/Settings/Admin/AdminSettingsLicensing.js index 8656b9041..f063d684e 100644 --- a/dev/Admin/AdminSettingsLicensing.js +++ b/dev/Settings/Admin/AdminSettingsLicensing.js @@ -8,10 +8,10 @@ ko = require('ko'), moment = require('moment'), - AppSettings = require('../Storages/AppSettings.js'), - Data = require('../Storages/AdminDataStorage.js'), + AppSettings = require('../../Storages/AppSettings.js'), + Data = require('../../Storages/AdminDataStorage.js'), - PopupsActivateViewModel = require('../ViewModels/Popups/PopupsActivateViewModel.js') + PopupsActivateViewModel = require('../../ViewModels/Popups/PopupsActivateViewModel.js') ; /** @@ -32,7 +32,7 @@ this.licenseTrigger.subscribe(function () { if (this.subscriptionEnabled()) { - require('../Boots/AdminApp.js').reloadLicensing(true); + require('../../Apps/AdminApp.js').reloadLicensing(true); } }, this); } @@ -41,7 +41,7 @@ { if (this.subscriptionEnabled()) { - require('../Boots/AdminApp.js').reloadLicensing(false); + require('../../Apps/AdminApp.js').reloadLicensing(false); } }; diff --git a/dev/Admin/AdminSettingsLogin.js b/dev/Settings/Admin/AdminSettingsLogin.js similarity index 89% rename from dev/Admin/AdminSettingsLogin.js rename to dev/Settings/Admin/AdminSettingsLogin.js index 5cc74fc53..019064bdf 100644 --- a/dev/Admin/AdminSettingsLogin.js +++ b/dev/Settings/Admin/AdminSettingsLogin.js @@ -11,8 +11,8 @@ Enums = require('Enums'), Utils = require('Utils'), - AppSettings = require('../Storages/AppSettings.js'), - Data = require('../Storages/AdminDataStorage.js') + AppSettings = require('../../Storages/AppSettings.js'), + Data = require('../../Storages/AdminDataStorage.js') ; /** @@ -33,7 +33,7 @@ { var self = this, - Remote = require('../Storages/AdminAjaxRemoteStorage.js') + Remote = require('../../Storages/AdminAjaxRemoteStorage.js') ; _.delay(function () { diff --git a/dev/Admin/AdminSettingsPackages.js b/dev/Settings/Admin/AdminSettingsPackages.js similarity index 91% rename from dev/Admin/AdminSettingsPackages.js rename to dev/Settings/Admin/AdminSettingsPackages.js index 052c2d7ad..48ce84935 100644 --- a/dev/Admin/AdminSettingsPackages.js +++ b/dev/Settings/Admin/AdminSettingsPackages.js @@ -11,8 +11,8 @@ Enums = require('Enums'), Utils = require('Utils'), - Data = require('../Storages/AdminDataStorage.js'), - Remote = require('../Storages/AdminAjaxRemoteStorage.js') + Data = require('../../Storages/AdminDataStorage.js'), + Remote = require('../../Storages/AdminAjaxRemoteStorage.js') ; /** @@ -51,7 +51,7 @@ AdminSettingsPackages.prototype.onBuild = function () { - require('../Boots/AdminApp.js').reloadPackagesList(); + require('../../Apps/AdminApp.js').reloadPackagesList(); }; AdminSettingsPackages.prototype.requestHelper = function (oPackage, bInstall) @@ -86,7 +86,7 @@ } else { - require('../Boots/AdminApp.js').reloadPackagesList(); + require('../../Apps/AdminApp.js').reloadPackagesList(); } }; }; diff --git a/dev/Admin/AdminSettingsPlugins.js b/dev/Settings/Admin/AdminSettingsPlugins.js similarity index 87% rename from dev/Admin/AdminSettingsPlugins.js rename to dev/Settings/Admin/AdminSettingsPlugins.js index e6f120dc8..7d41daa0e 100644 --- a/dev/Admin/AdminSettingsPlugins.js +++ b/dev/Settings/Admin/AdminSettingsPlugins.js @@ -11,11 +11,11 @@ Enums = require('Enums'), Utils = require('Utils'), - AppSettings = require('../Storages/AppSettings.js'), - Data = require('../Storages/AdminDataStorage.js'), - Remote = require('../Storages/AdminAjaxRemoteStorage.js'), + AppSettings = require('../../Storages/AppSettings.js'), + Data = require('../../Storages/AdminDataStorage.js'), + Remote = require('../../Storages/AdminAjaxRemoteStorage.js'), - PopupsPluginViewModel = require('../ViewModels/Popups/PopupsPluginViewModel.js') + PopupsPluginViewModel = require('../../ViewModels/Popups/PopupsPluginViewModel.js') ; /** @@ -80,7 +80,7 @@ AdminSettingsPlugins.prototype.onShow = function () { this.pluginsError(''); - require('../Boots/AdminApp.js').reloadPluginList(); + require('../../Apps/AdminApp.js').reloadPluginList(); }; AdminSettingsPlugins.prototype.onPluginLoadRequest = function (sResult, oData) @@ -108,7 +108,7 @@ } } - require('../Boots/AdminApp.js').reloadPluginList(); + require('../../Apps/AdminApp.js').reloadPluginList(); }; module.exports = AdminSettingsPlugins; diff --git a/dev/Admin/AdminSettingsSecurity.js b/dev/Settings/Admin/AdminSettingsSecurity.js similarity index 93% rename from dev/Admin/AdminSettingsSecurity.js rename to dev/Settings/Admin/AdminSettingsSecurity.js index 14e82e9b8..afa4b9399 100644 --- a/dev/Admin/AdminSettingsSecurity.js +++ b/dev/Settings/Admin/AdminSettingsSecurity.js @@ -12,9 +12,9 @@ Utils = require('Utils'), LinkBuilder = require('LinkBuilder'), - AppSettings = require('../Storages/AppSettings.js'), - Data = require('../Storages/AdminDataStorage.js'), - Remote = require('../Storages/AdminAjaxRemoteStorage.js') + AppSettings = require('../../Storages/AppSettings.js'), + Data = require('../../Storages/AdminDataStorage.js'), + Remote = require('../../Storages/AdminAjaxRemoteStorage.js') ; /** @@ -95,7 +95,7 @@ AdminSettingsSecurity.prototype.onBuild = function () { var - Remote = require('../Storages/AdminAjaxRemoteStorage.js') + Remote = require('../../Storages/AdminAjaxRemoteStorage.js') ; this.capaOpenPGP.subscribe(function (bValue) { diff --git a/dev/Admin/AdminSettingsSocial.js b/dev/Settings/Admin/AdminSettingsSocial.js similarity index 97% rename from dev/Admin/AdminSettingsSocial.js rename to dev/Settings/Admin/AdminSettingsSocial.js index f0084e739..1daa62642 100644 --- a/dev/Admin/AdminSettingsSocial.js +++ b/dev/Settings/Admin/AdminSettingsSocial.js @@ -17,7 +17,7 @@ */ function AdminSettingsSocial() { - var Data = require('../Storages/AdminDataStorage.js'); + var Data = require('../../Storages/AdminDataStorage.js'); this.googleEnable = Data.googleEnable; this.googleClientID = Data.googleClientID; @@ -49,7 +49,7 @@ { var self = this, - Remote = require('../Storages/AdminAjaxRemoteStorage.js') + Remote = require('../../Storages/AdminAjaxRemoteStorage.js') ; _.delay(function () { diff --git a/dev/Settings/SettingsAccounts.js b/dev/Settings/App/SettingsAccounts.js similarity index 86% rename from dev/Settings/SettingsAccounts.js rename to dev/Settings/App/SettingsAccounts.js index 6b30d1441..85feaa6c7 100644 --- a/dev/Settings/SettingsAccounts.js +++ b/dev/Settings/App/SettingsAccounts.js @@ -13,11 +13,11 @@ Utils = require('Utils'), LinkBuilder = require('LinkBuilder'), - Data = require('../Storages/WebMailDataStorage.js'), - Remote = require('../Storages/WebMailAjaxRemoteStorage.js'), + Data = require('../../Storages/WebMailDataStorage.js'), + Remote = require('../../Storages/WebMailAjaxRemoteStorage.js'), kn = require('kn'), - PopupsAddAccountViewModel = require('../ViewModels/Popups/PopupsAddAccountViewModel.js') + PopupsAddAccountViewModel = require('../../ViewModels/Popups/PopupsAddAccountViewModel.js') ; /** @@ -65,7 +65,7 @@ this.accountForDeletion(null); var - RL = require('../Boots/RainLoopApp.js'), + App = require('../../Apps/RainLoopApp.js'), fRemoveAccount = function (oAccount) { return oAccountToRemove === oAccount; } @@ -90,7 +90,7 @@ } else { - RL.accountsAndIdentities(); + App.accountsAndIdentities(); } }, oAccountToRemove.email); diff --git a/dev/Settings/SettingsChangePassword.js b/dev/Settings/App/SettingsChangePassword.js similarity index 98% rename from dev/Settings/SettingsChangePassword.js rename to dev/Settings/App/SettingsChangePassword.js index e3695a07c..1ed0a191c 100644 --- a/dev/Settings/SettingsChangePassword.js +++ b/dev/Settings/App/SettingsChangePassword.js @@ -11,7 +11,7 @@ Enums = require('Enums'), Utils = require('Utils'), - Remote = require('../Storages/WebMailAjaxRemoteStorage.js') + Remote = require('../../Storages/WebMailAjaxRemoteStorage.js') ; /** diff --git a/dev/Settings/SettingsContacts.js b/dev/Settings/App/SettingsContacts.js similarity index 91% rename from dev/Settings/SettingsContacts.js rename to dev/Settings/App/SettingsContacts.js index d8613e749..11f9c0161 100644 --- a/dev/Settings/SettingsContacts.js +++ b/dev/Settings/App/SettingsContacts.js @@ -9,8 +9,8 @@ Utils = require('Utils'), - Remote = require('../Storages/WebMailAjaxRemoteStorage.js'), - Data = require('../Storages/WebMailDataStorage.js') + Remote = require('../../Storages/WebMailAjaxRemoteStorage.js'), + Data = require('../../Storages/WebMailDataStorage.js') ; /** diff --git a/dev/Settings/SettingsFilters.js b/dev/Settings/App/SettingsFilters.js similarity index 83% rename from dev/Settings/SettingsFilters.js rename to dev/Settings/App/SettingsFilters.js index 71a20b989..1c484ae80 100644 --- a/dev/Settings/SettingsFilters.js +++ b/dev/Settings/App/SettingsFilters.js @@ -31,8 +31,8 @@ { var kn = require('kn'), - FilterModel = require('../Models/FilterModel.js'), - PopupsFilterViewModel = require('../ViewModels/Popups/PopupsFilterViewModel.js') + FilterModel = require('../../Models/FilterModel.js'), + PopupsFilterViewModel = require('../../ViewModels/Popups/PopupsFilterViewModel.js') ; kn.showScreenPopup(PopupsFilterViewModel, [new FilterModel()]); diff --git a/dev/Settings/SettingsFolders.js b/dev/Settings/App/SettingsFolders.js similarity index 88% rename from dev/Settings/SettingsFolders.js rename to dev/Settings/App/SettingsFolders.js index f95a1c34e..928499cc2 100644 --- a/dev/Settings/SettingsFolders.js +++ b/dev/Settings/App/SettingsFolders.js @@ -12,14 +12,14 @@ kn = require('kn'), - AppSettings = require('../Storages/AppSettings.js'), - LocalStorage = require('../Storages/LocalStorage.js'), - Data = require('../Storages/WebMailDataStorage.js'), - Cache = require('../Storages/WebMailCacheStorage.js'), - Remote = require('../Storages/WebMailAjaxRemoteStorage.js'), + AppSettings = require('../../Storages/AppSettings.js'), + LocalStorage = require('../../Storages/LocalStorage.js'), + Data = require('../../Storages/WebMailDataStorage.js'), + Cache = require('../../Storages/WebMailCacheStorage.js'), + Remote = require('../../Storages/WebMailAjaxRemoteStorage.js'), - PopupsFolderCreateViewModel = require('../ViewModels/Popups/PopupsFolderCreateViewModel.js'), - PopupsFolderSystemViewModel = require('../ViewModels/Popups/PopupsFolderSystemViewModel.js') + PopupsFolderCreateViewModel = require('../../ViewModels/Popups/PopupsFolderCreateViewModel.js'), + PopupsFolderSystemViewModel = require('../../ViewModels/Popups/PopupsFolderSystemViewModel.js') ; /** @@ -98,7 +98,7 @@ SettingsFolders.prototype.folderEditOnEnter = function (oFolder) { var - RL = require('../Boots/RainLoopApp.js'), + App = require('../../Apps/RainLoopApp.js'), sEditName = oFolder ? Utils.trim(oFolder.nameForEdit()) : '' ; @@ -116,7 +116,7 @@ oData && oData.ErrorCode ? Utils.getNotification(oData.ErrorCode) : Utils.i18n('NOTIFICATIONS/CANT_RENAME_FOLDER')); } - RL.folders(); + App.folders(); }, oFolder.fullNameRaw, sEditName); @@ -159,7 +159,7 @@ this.folderForDeletion(null); var - RL = require('../Boots/RainLoopApp.js'), + App = require('../../Apps/RainLoopApp.js'), fRemoveFolder = function (oFolder) { if (oFolderToRemove === oFolder) @@ -188,7 +188,7 @@ oData && oData.ErrorCode ? Utils.getNotification(oData.ErrorCode) : Utils.i18n('NOTIFICATIONS/CANT_DELETE_FOLDER')); } - RL.folders(); + App.folders(); }, oFolderToRemove.fullNameRaw); diff --git a/dev/Settings/SettingsGeneral.js b/dev/Settings/App/SettingsGeneral.js similarity index 95% rename from dev/Settings/SettingsGeneral.js rename to dev/Settings/App/SettingsGeneral.js index 0b28359af..e00c4a818 100644 --- a/dev/Settings/SettingsGeneral.js +++ b/dev/Settings/App/SettingsGeneral.js @@ -7,6 +7,7 @@ var $ = require('$'), ko = require('ko'), + _ = require('_'), Enums = require('Enums'), Consts = require('Consts'), @@ -14,11 +15,11 @@ Utils = require('Utils'), LinkBuilder = require('LinkBuilder'), - Data = require('../Storages/WebMailDataStorage.js'), - Remote = require('../Storages/WebMailAjaxRemoteStorage.js'), + Data = require('../../Storages/WebMailDataStorage.js'), + Remote = require('../../Storages/WebMailAjaxRemoteStorage.js'), kn = require('kn'), - PopupsLanguagesViewModel = require('../ViewModels/Popups/PopupsLanguagesViewModel.js') + PopupsLanguagesViewModel = require('../../ViewModels/Popups/PopupsLanguagesViewModel.js') ; /** diff --git a/dev/Settings/SettingsIdentities.js b/dev/Settings/App/SettingsIdentities.js similarity index 94% rename from dev/Settings/SettingsIdentities.js rename to dev/Settings/App/SettingsIdentities.js index 9fef5aea7..e286e0d01 100644 --- a/dev/Settings/SettingsIdentities.js +++ b/dev/Settings/App/SettingsIdentities.js @@ -6,16 +6,17 @@ var ko = require('ko'), + _ = require('_'), Enums = require('Enums'), Utils = require('Utils'), NewHtmlEditorWrapper = require('NewHtmlEditorWrapper'), - Data = require('../Storages/WebMailDataStorage.js'), - Remote = require('../Storages/WebMailAjaxRemoteStorage.js'), + Data = require('../../Storages/WebMailDataStorage.js'), + Remote = require('../../Storages/WebMailAjaxRemoteStorage.js'), kn = require('kn'), - PopupsIdentityViewModel = require('../ViewModels/Popups/PopupsIdentityViewModel.js') + PopupsIdentityViewModel = require('../../ViewModels/Popups/PopupsIdentityViewModel.js') ; /** @@ -133,7 +134,7 @@ this.identityForDeletion(null); var - RL = require('../Boots/RainLoopApp.js'), + App = require('../../Apps/RainLoopApp.js'), fRemoveFolder = function (oIdentity) { return oIdentityToRemove === oIdentity; } @@ -144,7 +145,7 @@ this.identities.remove(fRemoveFolder); Remote.identityDelete(function () { - RL.accountsAndIdentities(); + App.accountsAndIdentities(); }, oIdentityToRemove.id); } } diff --git a/dev/Settings/SettingsIdentity.js b/dev/Settings/App/SettingsIdentity.js similarity index 93% rename from dev/Settings/SettingsIdentity.js rename to dev/Settings/App/SettingsIdentity.js index d982b7740..6dfa87c12 100644 --- a/dev/Settings/SettingsIdentity.js +++ b/dev/Settings/App/SettingsIdentity.js @@ -6,13 +6,14 @@ var ko = require('ko'), + _ = require('_'), Enums = require('Enums'), Utils = require('Utils'), NewHtmlEditorWrapper = require('NewHtmlEditorWrapper'), - Data = require('../Storages/WebMailDataStorage.js'), - Remote = require('../Storages/WebMailAjaxRemoteStorage.js') + Data = require('../../Storages/WebMailDataStorage.js'), + Remote = require('../../Storages/WebMailAjaxRemoteStorage.js') ; /** diff --git a/dev/Settings/SettingsOpenPGP.js b/dev/Settings/App/SettingsOpenPGP.js similarity index 79% rename from dev/Settings/SettingsOpenPGP.js rename to dev/Settings/App/SettingsOpenPGP.js index df70315e6..e26b26ad3 100644 --- a/dev/Settings/SettingsOpenPGP.js +++ b/dev/Settings/App/SettingsOpenPGP.js @@ -9,11 +9,11 @@ kn = require('kn'), - Data = require('../Storages/WebMailDataStorage.js'), + Data = require('../../Storages/WebMailDataStorage.js'), - PopupsAddOpenPgpKeyViewModel = require('../ViewModels/Popups/PopupsAddOpenPgpKeyViewModel.js'), - PopupsGenerateNewOpenPgpKeyViewModel = require('../ViewModels/Popups/PopupsGenerateNewOpenPgpKeyViewModel.js'), - PopupsViewOpenPgpKeyViewModel = require('../ViewModels/Popups/PopupsViewOpenPgpKeyViewModel.js') + PopupsAddOpenPgpKeyViewModel = require('../../ViewModels/Popups/PopupsAddOpenPgpKeyViewModel.js'), + PopupsGenerateNewOpenPgpKeyViewModel = require('../../ViewModels/Popups/PopupsGenerateNewOpenPgpKeyViewModel.js'), + PopupsViewOpenPgpKeyViewModel = require('../../ViewModels/Popups/PopupsViewOpenPgpKeyViewModel.js') ; /** @@ -78,8 +78,8 @@ Data.openpgpKeyring.store(); - var RL = require('../Boots/RainLoopApp.js'); - RL.reloadOpenPgpKeys(); + var App = require('../../Apps/RainLoopApp.js'); + App.reloadOpenPgpKeys(); } } }; diff --git a/dev/Settings/SettingsSecurity.js b/dev/Settings/App/SettingsSecurity.js similarity index 95% rename from dev/Settings/SettingsSecurity.js rename to dev/Settings/App/SettingsSecurity.js index 82adfdf53..2cfaa6440 100644 --- a/dev/Settings/SettingsSecurity.js +++ b/dev/Settings/App/SettingsSecurity.js @@ -11,10 +11,10 @@ Globals = require('Globals'), Utils = require('Utils'), - Remote = require('../Storages/WebMailAjaxRemoteStorage.js'), + Remote = require('../../Storages/WebMailAjaxRemoteStorage.js'), kn = require('kn'), - PopupsTwoFactorTestViewModel = require('../ViewModels/Popups/PopupsTwoFactorTestViewModel.js') + PopupsTwoFactorTestViewModel = require('../../ViewModels/Popups/PopupsTwoFactorTestViewModel.js') ; /** diff --git a/dev/Settings/SettingsSocial.js b/dev/Settings/App/SettingsSocial.js similarity index 85% rename from dev/Settings/SettingsSocial.js rename to dev/Settings/App/SettingsSocial.js index 3ba14f4f2..bb5d4cc3a 100644 --- a/dev/Settings/SettingsSocial.js +++ b/dev/Settings/App/SettingsSocial.js @@ -11,8 +11,8 @@ { var Utils = require('Utils'), - RL = require('../Boots/RainLoopApp.js'), - Data = require('../Storages/WebMailDataStorage.js') + App = require('../../Apps/RainLoopApp.js'), + Data = require('../../Storages/WebMailDataStorage.js') ; this.googleEnable = Data.googleEnable; @@ -36,40 +36,40 @@ this.connectGoogle = Utils.createCommand(this, function () { if (!this.googleLoggined()) { - RL.googleConnect(); + App.googleConnect(); } }, function () { return !this.googleLoggined() && !this.googleActions(); }); this.disconnectGoogle = Utils.createCommand(this, function () { - RL.googleDisconnect(); + App.googleDisconnect(); }); this.connectFacebook = Utils.createCommand(this, function () { if (!this.facebookLoggined()) { - RL.facebookConnect(); + App.facebookConnect(); } }, function () { return !this.facebookLoggined() && !this.facebookActions(); }); this.disconnectFacebook = Utils.createCommand(this, function () { - RL.facebookDisconnect(); + App.facebookDisconnect(); }); this.connectTwitter = Utils.createCommand(this, function () { if (!this.twitterLoggined()) { - RL.twitterConnect(); + App.twitterConnect(); } }, function () { return !this.twitterLoggined() && !this.twitterActions(); }); this.disconnectTwitter = Utils.createCommand(this, function () { - RL.twitterDisconnect(); + App.twitterDisconnect(); }); } diff --git a/dev/Settings/SettingsThemes.js b/dev/Settings/App/SettingsThemes.js similarity index 95% rename from dev/Settings/SettingsThemes.js rename to dev/Settings/App/SettingsThemes.js index d55d5dd07..1c5e8f1ec 100644 --- a/dev/Settings/SettingsThemes.js +++ b/dev/Settings/App/SettingsThemes.js @@ -8,13 +8,14 @@ window = require('window'), $ = require('$'), ko = require('ko'), + _ = require('_'), Enums = require('Enums'), Utils = require('Utils'), LinkBuilder = require('LinkBuilder'), - Data = require('../Storages/WebMailDataStorage.js'), - Remote = require('../Storages/WebMailAjaxRemoteStorage.js') + Data = require('../../Storages/WebMailDataStorage.js'), + Remote = require('../../Storages/WebMailAjaxRemoteStorage.js') ; /** diff --git a/dev/Storages/AbstractAjaxRemoteStorage.js b/dev/Storages/AbstractAjaxRemoteStorage.js index a5ebe6d04..80c29b1d3 100644 --- a/dev/Storages/AbstractAjaxRemoteStorage.js +++ b/dev/Storages/AbstractAjaxRemoteStorage.js @@ -63,9 +63,9 @@ if (Consts.Values.TokenErrorLimit < Globals.iTokenErrorCount) { - if (Globals.__RL) + if (Globals.__APP) { - Globals.__RL.loginAndLogoutReload(true); + Globals.__APP.loginAndLogoutReload(true); } } @@ -76,9 +76,9 @@ window.__rlah_clear(); } - if (Globals.__RL) + if (Globals.__APP) { - Globals.__RL.loginAndLogoutReload(true); + Globals.__APP.loginAndLogoutReload(true); } } } diff --git a/dev/Storages/WebMailAjaxRemoteStorage.js b/dev/Storages/WebMailAjaxRemoteStorage.js index 29b8e0cde..0e8885741 100644 --- a/dev/Storages/WebMailAjaxRemoteStorage.js +++ b/dev/Storages/WebMailAjaxRemoteStorage.js @@ -381,9 +381,9 @@ } else if (Data.useThreads()) { - if (Globals.__RL) + if (Globals.__APP) { - Globals.__RL.reloadFlagsCurrentMessageListAndMessageFromCache(); + Globals.__APP.reloadFlagsCurrentMessageListAndMessageFromCache(); } } }; diff --git a/dev/Storages/WebMailDataStorage.js b/dev/Storages/WebMailDataStorage.js index b0caaf166..3339eb3a9 100644 --- a/dev/Storages/WebMailDataStorage.js +++ b/dev/Storages/WebMailDataStorage.js @@ -325,9 +325,9 @@ if (Enums.Layout.NoPreview === this.layout() && -1 < window.location.hash.indexOf('message-preview')) { - if (Globals.__RL) + if (Globals.__APP) { - Globals.__RL.historyBack(); + Globals.__APP.historyBack(); } } } @@ -925,9 +925,9 @@ Cache.initMessageFlagsFromCache(oMessage); if (oMessage.unseen()) { - if (Globals.__RL) + if (Globals.__APP) { - Globals.__RL.setMessageSeen(oMessage); + Globals.__APP.setMessageSeen(oMessage); } } diff --git a/dev/ViewModels/AbstractSystemDropDownViewModel.js b/dev/ViewModels/AbstractSystemDropDownViewModel.js index a10f55054..bd0580200 100644 --- a/dev/ViewModels/AbstractSystemDropDownViewModel.js +++ b/dev/ViewModels/AbstractSystemDropDownViewModel.js @@ -89,14 +89,14 @@ AbstractSystemDropDownViewModel.prototype.logoutClick = function () { - var RL = require('../Boots/RainLoopApp.js'); + var App = require('../Apps/RainLoopApp.js'); Remote.logout(function () { if (window.__rlah_clear) { window.__rlah_clear(); } - RL.loginAndLogoutReload(true, AppSettings.settingsGet('ParentEmail') && 0 < AppSettings.settingsGet('ParentEmail').length); + App.loginAndLogoutReload(true, AppSettings.settingsGet('ParentEmail') && 0 < AppSettings.settingsGet('ParentEmail').length); }); }; diff --git a/dev/ViewModels/AdminLoginViewModel.js b/dev/ViewModels/AdminLoginViewModel.js index 72765011b..bfacec131 100644 --- a/dev/ViewModels/AdminLoginViewModel.js +++ b/dev/ViewModels/AdminLoginViewModel.js @@ -64,8 +64,8 @@ { if (oData.Result) { - var RL = require('../Boots/AdminApp.js'); - RL.loginAndLogoutReload(); + var App = require('../Apps/AdminApp.js'); + App.loginAndLogoutReload(); } else if (oData.ErrorCode) { diff --git a/dev/ViewModels/AdminPaneViewModel.js b/dev/ViewModels/AdminPaneViewModel.js index 46f796ebf..5fa1c8ac3 100644 --- a/dev/ViewModels/AdminPaneViewModel.js +++ b/dev/ViewModels/AdminPaneViewModel.js @@ -36,8 +36,8 @@ AdminPaneViewModel.prototype.logoutClick = function () { Remote.adminLogout(function () { - var RL = require('../Boots/AdminApp.js'); - RL.loginAndLogoutReload(); + var App = require('../Apps/AdminApp.js'); + App.loginAndLogoutReload(); }); }; diff --git a/dev/ViewModels/LoginViewModel.js b/dev/ViewModels/LoginViewModel.js index cb5a1f2cf..344918933 100644 --- a/dev/ViewModels/LoginViewModel.js +++ b/dev/ViewModels/LoginViewModel.js @@ -133,8 +133,8 @@ } else { - var RL = require('../Boots/RainLoopApp.js'); - RL.loginAndLogoutReload(); + var App = require('../Apps/RainLoopApp.js'); + App.loginAndLogoutReload(); } } else if (oData.ErrorCode) @@ -294,8 +294,8 @@ { self.submitRequest(true); - var RL = require('../Boots/RainLoopApp.js'); - RL.loginAndLogoutReload(); + var App = require('../Apps/RainLoopApp.js'); + App.loginAndLogoutReload(); } else { diff --git a/dev/ViewModels/MailBoxFolderListViewModel.js b/dev/ViewModels/MailBoxFolderListViewModel.js index e4b274cf8..9d2ee3ba7 100644 --- a/dev/ViewModels/MailBoxFolderListViewModel.js +++ b/dev/ViewModels/MailBoxFolderListViewModel.js @@ -62,7 +62,7 @@ var self = this, - RL = require('../Boots/RainLoopApp.js') + App = require('../Apps/RainLoopApp.js') ; oDom @@ -76,7 +76,7 @@ if (oFolder && oEvent) { bCollapsed = oFolder.collapsed(); - RL.setExpandedFolder(oFolder.fullNameHash, bCollapsed); + App.setExpandedFolder(oFolder.fullNameHash, bCollapsed); oFolder.collapsed(!bCollapsed); oEvent.preventDefault(); @@ -159,7 +159,7 @@ if (oFolder) { bCollapsed = oFolder.collapsed(); - RL.setExpandedFolder(oFolder.fullNameHash, bCollapsed); + App.setExpandedFolder(oFolder.fullNameHash, bCollapsed); oFolder.collapsed(!bCollapsed); } } @@ -186,10 +186,10 @@ window.clearTimeout(this.iDropOverTimer); if (oFolder && oFolder.collapsed()) { - var RL = require('../Boots/RainLoopApp.js'); + var App = require('../Apps/RainLoopApp.js'); this.iDropOverTimer = window.setTimeout(function () { oFolder.collapsed(false); - RL.setExpandedFolder(oFolder.fullNameHash, true); + App.setExpandedFolder(oFolder.fullNameHash, true); Utils.windowResize(); }, 500); } @@ -242,7 +242,7 @@ if (oToFolder && oUi && oUi.helper) { var - RL = require('../Boots/RainLoopApp.js'), + App = require('../Apps/RainLoopApp.js'), sFromFolderFullNameRaw = oUi.helper.data('rl-folder'), bCopy = $html.hasClass('rl-ctrl-key-pressed'), aUids = oUi.helper.data('rl-uids') @@ -250,7 +250,7 @@ if (Utils.isNormal(sFromFolderFullNameRaw) && '' !== sFromFolderFullNameRaw && Utils.isArray(aUids)) { - RL.moveMessagesToFolder(sFromFolderFullNameRaw, aUids, oToFolder.fullNameRaw, bCopy); + App.moveMessagesToFolder(sFromFolderFullNameRaw, aUids, oToFolder.fullNameRaw, bCopy); } } }; diff --git a/dev/ViewModels/MailBoxMessageListViewModel.js b/dev/ViewModels/MailBoxMessageListViewModel.js index ee9f4833d..e16e8908a 100644 --- a/dev/ViewModels/MailBoxMessageListViewModel.js +++ b/dev/ViewModels/MailBoxMessageListViewModel.js @@ -39,7 +39,7 @@ */ function MailBoxMessageListViewModel() { - var RL = require('../Boots/RainLoopApp.js'); + var App = require('../Apps/RainLoopApp.js'); KnoinAbstractViewModel.call(this, 'Right', 'MailMessageList'); @@ -183,31 +183,31 @@ }, this.canBeMoved); this.deleteWithoutMoveCommand = Utils.createCommand(this, function () { - RL.deleteMessagesFromFolder(Enums.FolderType.Trash, + App.deleteMessagesFromFolder(Enums.FolderType.Trash, Data.currentFolderFullNameRaw(), Data.messageListCheckedOrSelectedUidsWithSubMails(), false); }, this.canBeMoved); this.deleteCommand = Utils.createCommand(this, function () { - RL.deleteMessagesFromFolder(Enums.FolderType.Trash, + App.deleteMessagesFromFolder(Enums.FolderType.Trash, Data.currentFolderFullNameRaw(), Data.messageListCheckedOrSelectedUidsWithSubMails(), true); }, this.canBeMoved); this.archiveCommand = Utils.createCommand(this, function () { - RL.deleteMessagesFromFolder(Enums.FolderType.Archive, + App.deleteMessagesFromFolder(Enums.FolderType.Archive, Data.currentFolderFullNameRaw(), Data.messageListCheckedOrSelectedUidsWithSubMails(), true); }, this.canBeMoved); this.spamCommand = Utils.createCommand(this, function () { - RL.deleteMessagesFromFolder(Enums.FolderType.Spam, + App.deleteMessagesFromFolder(Enums.FolderType.Spam, Data.currentFolderFullNameRaw(), Data.messageListCheckedOrSelectedUidsWithSubMails(), true); }, this.canBeMoved); this.notSpamCommand = Utils.createCommand(this, function () { - RL.deleteMessagesFromFolder(Enums.FolderType.NotSpam, + App.deleteMessagesFromFolder(Enums.FolderType.NotSpam, Data.currentFolderFullNameRaw(), Data.messageListCheckedOrSelectedUidsWithSubMails(), true); }, this.canBeMoved); @@ -217,7 +217,7 @@ this.reloadCommand = Utils.createCommand(this, function () { if (!Data.messageListCompleteLoadingThrottle()) { - RL.reloadMessageList(false, true); + App.reloadMessageList(false, true); } }); @@ -307,8 +307,8 @@ { if (this.canBeMoved()) { - var RL = require('../Boots/RainLoopApp.js'); - RL.moveMessagesToFolder( + var App = require('../Apps/RainLoopApp.js'); + App.moveMessagesToFolder( Data.currentFolderFullNameRaw(), Data.messageListCheckedOrSelectedUidsWithSubMails(), sToFolderFullNameRaw, bCopy); } @@ -396,7 +396,7 @@ aUids = [], oFolder = null, iAlreadyUnread = 0, - RL = require('../Boots/RainLoopApp.js') + App = require('../Apps/RainLoopApp.js') ; if (Utils.isUnd(aMessages)) @@ -464,7 +464,7 @@ break; } - RL.reloadFlagsCurrentMessageListAndMessageFromCache(); + App.reloadFlagsCurrentMessageListAndMessageFromCache(); } }; @@ -477,7 +477,7 @@ var oFolder = null, aMessages = Data.messageList(), - RL = require('../Boots/RainLoopApp.js') + App = require('../Apps/RainLoopApp.js') ; if ('' !== sFolderFullNameRaw) @@ -516,7 +516,7 @@ break; } - RL.reloadFlagsCurrentMessageListAndMessageFromCache(); + App.reloadFlagsCurrentMessageListAndMessageFromCache(); } } }; @@ -631,7 +631,7 @@ { var self = this, - RL = require('../Boots/RainLoopApp.js') + App = require('../Apps/RainLoopApp.js') ; this.oContentVisible = $('.b-content', oDom); @@ -663,7 +663,7 @@ oMessage.lastInCollapsedThreadLoading(true); oMessage.lastInCollapsedThread(!oMessage.lastInCollapsedThread()); - RL.reloadMessageList(); + App.reloadMessageList(); } return false; @@ -894,8 +894,7 @@ } var - RL = require('../Boots/RainLoopApp.js'), - oJua = new Jua({ + oJua = new Jua({ 'action': LinkBuilder.append(), 'name': 'AppendFile', 'queueSize': 1, @@ -934,7 +933,7 @@ return false; }, this)) .on('onComplete', _.bind(function () { - RL.reloadMessageList(true, true); + require('../Apps/RainLoopApp.js').reloadMessageList(true, true); }, this)) ; diff --git a/dev/ViewModels/MailBoxMessageViewViewModel.js b/dev/ViewModels/MailBoxMessageViewViewModel.js index 06d7ac372..bfdb3e54a 100644 --- a/dev/ViewModels/MailBoxMessageViewViewModel.js +++ b/dev/ViewModels/MailBoxMessageViewViewModel.js @@ -37,7 +37,7 @@ var self = this, sLastEmail = '', - RL = require('../Boots/RainLoopApp.js'), + App = require('../Apps/RainLoopApp.js'), createCommandHelper = function (sType) { return Utils.createCommand(self, function () { this.replyOrforward(sType); @@ -102,7 +102,7 @@ this.deleteCommand = Utils.createCommand(this, function () { if (this.message()) { - RL.deleteMessagesFromFolder(Enums.FolderType.Trash, + App.deleteMessagesFromFolder(Enums.FolderType.Trash, this.message().folderFullNameRaw, [this.message().uid], true); } @@ -111,7 +111,7 @@ this.deleteWithoutMoveCommand = Utils.createCommand(this, function () { if (this.message()) { - RL.deleteMessagesFromFolder(Enums.FolderType.Trash, + App.deleteMessagesFromFolder(Enums.FolderType.Trash, Data.currentFolderFullNameRaw(), [this.message().uid], false); } @@ -120,7 +120,7 @@ this.archiveCommand = Utils.createCommand(this, function () { if (this.message()) { - RL.deleteMessagesFromFolder(Enums.FolderType.Archive, + App.deleteMessagesFromFolder(Enums.FolderType.Archive, this.message().folderFullNameRaw, [this.message().uid], true); } @@ -129,7 +129,7 @@ this.spamCommand = Utils.createCommand(this, function () { if (this.message()) { - RL.deleteMessagesFromFolder(Enums.FolderType.Spam, + App.deleteMessagesFromFolder(Enums.FolderType.Spam, this.message().folderFullNameRaw, [this.message().uid], true); } @@ -138,7 +138,7 @@ this.notSpamCommand = Utils.createCommand(this, function () { if (this.message()) { - RL.deleteMessagesFromFolder(Enums.FolderType.NotSpam, + App.deleteMessagesFromFolder(Enums.FolderType.NotSpam, this.message().folderFullNameRaw, [this.message().uid], true); } @@ -343,7 +343,7 @@ { var self = this, - RL = require('../Boots/RainLoopApp.js') + App = require('../Apps/RainLoopApp.js') ; this.fullScreenMode.subscribe(function (bValue) { @@ -382,7 +382,7 @@ }) .on('click', 'a', function (oEvent) { // setup maito protocol - return !(!!oEvent && 3 !== oEvent['which'] && RL.mailToHelper($(this).attr('href'))); + return !(!!oEvent && 3 !== oEvent['which'] && App.mailToHelper($(this).attr('href'))); }) .on('click', '.attachmentsPlace .attachmentPreview', function (oEvent) { if (oEvent && oEvent.stopPropagation) @@ -398,7 +398,7 @@ if (oAttachment && oAttachment.download) { - RL.download(oAttachment.linkDownload()); + App.download(oAttachment.linkDownload()); } }) ; @@ -713,8 +713,8 @@ Cache.storeMessageFlagsToCache(oMessage); - var RL = require('../Boots/RainLoopApp.js'); - RL.reloadFlagsCurrentMessageListAndMessageFromCache(); + var App = require('../Apps/RainLoopApp.js'); + App.reloadFlagsCurrentMessageListAndMessageFromCache(); } }; diff --git a/dev/ViewModels/Popups/PopupsAddAccountViewModel.js b/dev/ViewModels/Popups/PopupsAddAccountViewModel.js index 7710b0a48..8bea2d7b1 100644 --- a/dev/ViewModels/Popups/PopupsAddAccountViewModel.js +++ b/dev/ViewModels/Popups/PopupsAddAccountViewModel.js @@ -25,7 +25,7 @@ { KnoinAbstractViewModel.call(this, 'Popups', 'PopupsAddAccount'); - var RL = require('../../Boots/RainLoopApp.js'); + var App = require('../../Apps/RainLoopApp.js'); this.email = ko.observable(''); this.password = ko.observable(''); @@ -65,7 +65,7 @@ { if (oData.Result) { - RL.accountsAndIdentities(); + App.accountsAndIdentities(); this.cancelCommand(); } else if (oData.ErrorCode) diff --git a/dev/ViewModels/Popups/PopupsAddOpenPgpKeyViewModel.js b/dev/ViewModels/Popups/PopupsAddOpenPgpKeyViewModel.js index 153f8a526..2c98cb348 100644 --- a/dev/ViewModels/Popups/PopupsAddOpenPgpKeyViewModel.js +++ b/dev/ViewModels/Popups/PopupsAddOpenPgpKeyViewModel.js @@ -23,7 +23,7 @@ { KnoinAbstractViewModel.call(this, 'Popups', 'PopupsAddOpenPgpKey'); - var RL = require('../../Boots/RainLoopApp.js'); + var App = require('../../Apps/RainLoopApp.js'); this.key = ko.observable(''); this.key.error = ko.observable(false); @@ -79,7 +79,7 @@ oOpenpgpKeyring.store(); - RL.reloadOpenPgpKeys(); + App.reloadOpenPgpKeys(); Utils.delegateRun(this, 'cancelCommand'); return true; diff --git a/dev/ViewModels/Popups/PopupsComposeViewModel.js b/dev/ViewModels/Popups/PopupsComposeViewModel.js index 8361c1bb4..4255cedf6 100644 --- a/dev/ViewModels/Popups/PopupsComposeViewModel.js +++ b/dev/ViewModels/Popups/PopupsComposeViewModel.js @@ -45,7 +45,7 @@ { KnoinAbstractViewModel.call(this, 'Popups', 'PopupsCompose'); - var RL = require('../../Boots/RainLoopApp.js'); + var App = require('../../Apps/RainLoopApp.js'); this.oEditor = null; this.aDraftInfo = null; @@ -219,7 +219,7 @@ this.deleteCommand = Utils.createCommand(this, function () { - RL.deleteMessagesFromFolderWithoutCheck(this.draftFolder(), [this.draftUid()]); + App.deleteMessagesFromFolderWithoutCheck(this.draftFolder(), [this.draftUid()]); kn.hideScreenPopup(PopupsComposeViewModel); }, function () { @@ -278,7 +278,7 @@ } Cache.setMessageFlagsToCache(this.aDraftInfo[2], this.aDraftInfo[1], aFlagsCache); - RL.reloadFlagsCurrentMessageListAndMessageFromCache(); + App.reloadFlagsCurrentMessageListAndMessageFromCache(); Cache.setFolderHash(this.aDraftInfo[2], ''); } } @@ -415,8 +415,8 @@ PopupsComposeViewModel.prototype.emailsSource = function (oData, fResponse) { - var RL = require('../../Boots/RainLoopApp.js'); - RL.getAutocomplete(oData.term, function (aData) { + var App = require('../../Apps/RainLoopApp.js'); + App.getAutocomplete(oData.term, function (aData) { fResponse(_.map(aData, function (oEmailItem) { return oEmailItem.toLine(false); })); @@ -446,7 +446,7 @@ PopupsComposeViewModel.prototype.reloadDraftFolder = function () { var - RL = require('../../Boots/RainLoopApp.js'), + App = require('../../Apps/RainLoopApp.js'), sDraftFolder = Data.draftFolder() ; @@ -455,11 +455,11 @@ Cache.setFolderHash(sDraftFolder, ''); if (Data.currentFolderFullNameRaw() === sDraftFolder) { - RL.reloadMessageList(true); + App.reloadMessageList(true); } else { - RL.folderInformation(sDraftFolder); + App.folderInformation(sDraftFolder); } } }; diff --git a/dev/ViewModels/Popups/PopupsContactsViewModel.js b/dev/ViewModels/Popups/PopupsContactsViewModel.js index 3c750b777..926b49f71 100644 --- a/dev/ViewModels/Popups/PopupsContactsViewModel.js +++ b/dev/ViewModels/Popups/PopupsContactsViewModel.js @@ -353,10 +353,10 @@ var self = this, - RL = require('../../Boots/RainLoopApp.js') + App = require('../../Apps/RainLoopApp.js') ; - RL.contactsSync(function (sResult, oData) { + App.contactsSync(function (sResult, oData) { if (Enums.StorageResultType.Success !== sResult || !oData || !oData.Result) { window.alert(Utils.getNotification( @@ -401,8 +401,8 @@ PopupsContactsViewModel.prototype.contactTagsSource = function (oData, fResponse) { - var RL = require('../../Boots/RainLoopApp.js'); - RL.getContactTagsAutocomplete(oData.term, function (aData) { + var App = require('../../Apps/RainLoopApp.js'); + App.getContactTagsAutocomplete(oData.term, function (aData) { fResponse(_.map(aData, function (oTagItem) { return oTagItem.toLine(false); })); @@ -487,14 +487,14 @@ PopupsContactsViewModel.prototype.exportVcf = function () { - var RL = require('../../Boots/RainLoopApp.js'); - RL.download(LinkBuilder.exportContactsVcf()); + var App = require('../../Apps/RainLoopApp.js'); + App.download(LinkBuilder.exportContactsVcf()); }; PopupsContactsViewModel.prototype.exportCsv = function () { - var RL = require('../../Boots/RainLoopApp.js'); - RL.download(LinkBuilder.exportContactsCsv()); + var App = require('../../Apps/RainLoopApp.js'); + App.download(LinkBuilder.exportContactsCsv()); }; PopupsContactsViewModel.prototype.initUploader = function () diff --git a/dev/ViewModels/Popups/PopupsDomainViewModel.js b/dev/ViewModels/Popups/PopupsDomainViewModel.js index af651a893..0610cd6d4 100644 --- a/dev/ViewModels/Popups/PopupsDomainViewModel.js +++ b/dev/ViewModels/Popups/PopupsDomainViewModel.js @@ -235,8 +235,8 @@ { if (oData.Result) { - var RL = require('../../Boots/AdminApp.js'); - RL.reloadDomainList(); + var App = require('../../Apps/AdminApp.js'); + App.reloadDomainList(); this.closeCommand(); } diff --git a/dev/ViewModels/Popups/PopupsFolderClearViewModel.js b/dev/ViewModels/Popups/PopupsFolderClearViewModel.js index d1ab901da..48b3e8ddd 100644 --- a/dev/ViewModels/Popups/PopupsFolderClearViewModel.js +++ b/dev/ViewModels/Popups/PopupsFolderClearViewModel.js @@ -26,7 +26,7 @@ { KnoinAbstractViewModel.call(this, 'Popups', 'PopupsFolderClear'); - var RL = require('../../Boots/RainLoopApp.js'); + var App = require('../../Apps/RainLoopApp.js'); this.selectedFolder = ko.observable(null); this.clearingProcess = ko.observable(false); @@ -62,13 +62,17 @@ this.clearingProcess(true); + oFolderToClear.messageCountAll(0); + oFolderToClear.messageCountUnread(0); + Cache.setFolderHash(oFolderToClear.fullNameRaw, ''); + Remote.folderClear(function (sResult, oData) { self.clearingProcess(false); if (Enums.StorageResultType.Success === sResult && oData && oData.Result) { - RL.reloadMessageList(true); + App.reloadMessageList(true); self.cancelCommand(); } else diff --git a/dev/ViewModels/Popups/PopupsFolderCreateViewModel.js b/dev/ViewModels/Popups/PopupsFolderCreateViewModel.js index d817ee0fc..5154b6816 100644 --- a/dev/ViewModels/Popups/PopupsFolderCreateViewModel.js +++ b/dev/ViewModels/Popups/PopupsFolderCreateViewModel.js @@ -65,7 +65,7 @@ this.createFolder = Utils.createCommand(this, function () { var - RL = require('../../Boots/RainLoopApp.js'), + App = require('../../Apps/RainLoopApp.js'), sParentFolderName = this.selectedParentValue() ; @@ -80,7 +80,7 @@ Data.foldersCreating(false); if (Enums.StorageResultType.Success === sResult && oData && oData.Result) { - RL.folders(); + App.folders(); } else { diff --git a/dev/ViewModels/Popups/PopupsGenerateNewOpenPgpKeyViewModel.js b/dev/ViewModels/Popups/PopupsGenerateNewOpenPgpKeyViewModel.js index 1e3eaa960..be47b68e6 100644 --- a/dev/ViewModels/Popups/PopupsGenerateNewOpenPgpKeyViewModel.js +++ b/dev/ViewModels/Popups/PopupsGenerateNewOpenPgpKeyViewModel.js @@ -25,7 +25,7 @@ { KnoinAbstractViewModel.call(this, 'Popups', 'PopupsGenerateNewOpenPgpKey'); - var RL = require('../../Boots/RainLoopApp.js'); + var App = require('../../Apps/RainLoopApp.js'); this.email = ko.observable(''); this.email.focus = ko.observable(''); @@ -78,7 +78,7 @@ oOpenpgpKeyring.publicKeys.importKey(mKeyPair.publicKeyArmored); oOpenpgpKeyring.store(); - RL.reloadOpenPgpKeys(); + App.reloadOpenPgpKeys(); Utils.delegateRun(self, 'cancelCommand'); } diff --git a/dev/ViewModels/Popups/PopupsIdentityViewModel.js b/dev/ViewModels/Popups/PopupsIdentityViewModel.js index 4c3483f1a..c0bdba438 100644 --- a/dev/ViewModels/Popups/PopupsIdentityViewModel.js +++ b/dev/ViewModels/Popups/PopupsIdentityViewModel.js @@ -25,7 +25,7 @@ { KnoinAbstractViewModel.call(this, 'Popups', 'PopupsIdentity'); - var RL = require('../../Boots/RainLoopApp.js'); + var App = require('../../Apps/RainLoopApp.js'); this.id = ''; this.edit = ko.observable(false); @@ -85,7 +85,7 @@ { if (oData.Result) { - RL.accountsAndIdentities(); + App.accountsAndIdentities(); this.cancelCommand(); } else if (oData.ErrorCode) diff --git a/gulpfile.js b/gulpfile.js index 6f337ca4a..26a568fc1 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -141,7 +141,7 @@ cfg.paths.js = { name: 'libs.js', src: [ 'vendors/modernizr.js', - 'vendors/underscore/underscore-1.5.2.min.js', + 'vendors/underscore/1.6.0/underscore-min.js', 'vendors/jquery/jquery-1.11.1.min.js', 'vendors/jquery-ui/js/jquery-ui-1.10.3.custom.min.js', 'vendors/jquery-cookie/jquery.cookie-1.4.0.min.js', @@ -234,10 +234,10 @@ gulp.task('js:libs', function() { gulp.task('js:app', function() { return browserify({ 'basedir': './dev/', + 'entries': './RainLoop.js', 'detectGlobals': false, 'debug': false }) - .add('./_RainLoopBoot.js') .bundle() .pipe(source(cfg.paths.js.app.name)) .pipe(gulp.dest(cfg.paths.staticJS)) @@ -247,10 +247,10 @@ gulp.task('js:app', function() { gulp.task('js:admin', function() { return browserify({ 'basedir': './dev/', + 'entries': './Admin.js', 'detectGlobals': false, 'debug': false }) - .add('./_AdminBoot.js') .bundle() .pipe(source(cfg.paths.js.admin.name)) .pipe(gulp.dest(cfg.paths.staticJS)) diff --git a/package.json b/package.json index 7c21c8dfd..99128e19c 100644 --- a/package.json +++ b/package.json @@ -61,7 +61,7 @@ "$html": "./dev/External/$html.js", "$doc": "./dev/External/$doc.js", "$div": "./dev/External/$div.js", - + "Base64": "./dev/Common/Base64.js", "Consts": "./dev/Common/Consts.js", "Globals": "./dev/Common/Globals.js", @@ -77,8 +77,7 @@ "KnoinAbstractBoot": "./dev/Knoin/KnoinAbstractBoot.js", "KnoinAbstractScreen": "./dev/Knoin/KnoinAbstractScreen.js", "KnoinAbstractViewModel": "./dev/Knoin/KnoinAbstractViewModel.js", - "kn": "./dev/Knoin/Knoin.js", - "Boot": "./dev/Boots/Boot.js" + "kn": "./dev/Knoin/Knoin.js" }, "devDependencies": { diff --git a/rainloop/v/0.0.0/app/libraries/MailSo/Imap/ImapClient.php b/rainloop/v/0.0.0/app/libraries/MailSo/Imap/ImapClient.php index 2dcbec294..b86d98ce5 100644 --- a/rainloop/v/0.0.0/app/libraries/MailSo/Imap/ImapClient.php +++ b/rainloop/v/0.0.0/app/libraries/MailSo/Imap/ImapClient.php @@ -195,15 +195,63 @@ class ImapClient extends \MailSo\Net\NetClient try { - if ($bUseAuthPlainIfSupported && $this->IsSupported('AUTH=PLAIN')) + // TODO + if (false && $this->IsSupported('AUTH=CRAM-MD5')) { + $this->SendRequest('AUTHENTICATE', array('CRAM-MD5')); + + $aResponse = $this->parseResponseWithValidation(); + if ($aResponse && \is_array($aResponse) && 0 < \count($aResponse) && + \MailSo\Imap\Enumerations\ResponseType::CONTINUATION === $aResponse[\count($aResponse) - 1]->ResponseType) + { + $oContinuationResponse = null; + foreach ($aResponse as $oResponse) + { + if ($oResponse && \MailSo\Imap\Enumerations\ResponseType::CONTINUATION === $oResponse->ResponseType) + { + $oContinuationResponse = $oResponse; + } + } + + if ($oContinuationResponse) + { + $sToken = \base64_encode("\0".$sLogin."\0".$sPassword); + if ($this->oLogger) + { + $this->oLogger->AddSecret($sToken); + } + + $this->Logger()->WriteDump($aResponse); + + $this->sendRaw($sToken, true, '*******'); + $this->parseResponseWithValidation(); + } + else + { + // TODO + } + } + } + else if ($bUseAuthPlainIfSupported && $this->IsSupported('AUTH=PLAIN')) + { + $sToken = \base64_encode("\0".$sLogin."\0".$sPassword); if ($this->oLogger) { - $this->oLogger->AddSecret(\base64_encode("\0".$sLogin."\0".$sPassword)); + $this->oLogger->AddSecret($sToken); } - $this->SendRequestWithCheck('AUTHENTICATE', - array('PLAIN', \base64_encode("\0".$sLogin."\0".$sPassword))); + if ($this->IsSupported('AUTH=SASL-IR') && false) + { + $this->SendRequestWithCheck('AUTHENTICATE', array('PLAIN', $sToken)); + } + else + { + $this->SendRequest('AUTHENTICATE', array('PLAIN')); + $this->parseResponseWithValidation(); + + $this->sendRaw($sToken, true, '*******'); + $this->parseResponseWithValidation(); + } } else { diff --git a/rainloop/v/0.0.0/app/libraries/MailSo/Net/NetClient.php b/rainloop/v/0.0.0/app/libraries/MailSo/Net/NetClient.php index bcb67ff7e..5d87fc681 100644 --- a/rainloop/v/0.0.0/app/libraries/MailSo/Net/NetClient.php +++ b/rainloop/v/0.0.0/app/libraries/MailSo/Net/NetClient.php @@ -423,8 +423,17 @@ abstract class NetClient $iReadedLen = \strlen($this->sResponseBuffer); if (null === $mReadLen || $bForceLogin) { - $this->writeLogWithCrlf('< '.$this->sResponseBuffer, //.' ['.$iReadedLen.']', - \MailSo\Log\Enumerations\Type::INFO); + $iLimit = 5000; // 5kb + if ($iLimit < $iReadedLen) + { + $this->writeLogWithCrlf('[cutted:'.$iReadedLen.'b] < '.\substr($this->sResponseBuffer.'...', 0, $iLimit), + \MailSo\Log\Enumerations\Type::INFO); + } + else + { + $this->writeLogWithCrlf('< '.$this->sResponseBuffer, //.' ['.$iReadedLen.']', + \MailSo\Log\Enumerations\Type::INFO); + } } else { diff --git a/rainloop/v/0.0.0/app/templates/Index.html b/rainloop/v/0.0.0/app/templates/Index.html index 37c911c14..cb5187b58 100644 --- a/rainloop/v/0.0.0/app/templates/Index.html +++ b/rainloop/v/0.0.0/app/templates/Index.html @@ -12,8 +12,8 @@ @@ -26,11 +26,11 @@ @@ -45,7 +45,7 @@