From ccbf04cb676a313b59c2d02e5273b6d1d13ed2c7 Mon Sep 17 00:00:00 2001 From: RainLoop Team Date: Tue, 2 Sep 2014 04:15:31 +0400 Subject: [PATCH] Code refactoring Fixed languages popup Release commit --- build/other/Gruntfile.js | 534 --- dev/Admin.js | 2 - dev/Apps/AbstractApp.js | 10 +- dev/Apps/AdminApp.js | 8 +- dev/Apps/RainLoopApp.js | 40 +- dev/Boot.js | 11 +- dev/Common/Base64.js | 2 +- dev/Common/Consts.js | 3 +- dev/Common/Enums.js | 10 - dev/Common/Events.js | 3 +- dev/Common/Globals.js | 3 +- dev/Common/HtmlEditor.js | 2 +- dev/Common/LinkBuilder.js | 4 +- dev/Common/Plugins.js | 83 +- dev/Common/Selector.js | 3 +- dev/Common/Utils.js | 165 +- dev/External/JSON.js | 2 - dev/External/Jua.js | 2 - dev/External/crossroads.js | 2 - dev/External/hasher.js | 2 - dev/External/ifvisible.js | 2 - dev/External/jquery.js | 2 - dev/External/key.js | 2 - dev/External/ko.js | 3 +- dev/External/moment.js | 2 - dev/External/ssm.js | 2 - dev/External/underscore.js | 2 - dev/External/window.js | 2 - dev/Knoin/Knoin.js | 52 +- dev/Knoin/KnoinAbstractBoot.js | 3 +- dev/Knoin/KnoinAbstractScreen.js | 3 +- dev/Knoin/KnoinAbstractViewModel.js | 30 +- dev/Models/AccountModel.js | 4 +- dev/Models/AttachmentModel.js | 4 +- dev/Models/ComposeAttachmentModel.js | 4 +- dev/Models/ContactModel.js | 2 +- dev/Models/ContactPropertyModel.js | 5 +- dev/Models/ContactTagModel.js | 4 +- dev/Models/EmailModel.js | 32 +- dev/Models/FilterConditionModel.js | 4 +- dev/Models/FilterModel.js | 2 +- dev/Models/FolderModel.js | 1 - dev/Models/IdentityModel.js | 2 +- dev/Models/MessageModel.js | 11 +- dev/Models/OpenPgpKeyModel.js | 3 +- dev/RainLoop.js | 2 - dev/Screens/AboutScreen.js | 4 +- ...tSettings.js => AbstractSettingsScreen.js} | 19 +- dev/Screens/AdminLoginScreen.js | 4 +- dev/Screens/AdminSettingsScreen.js | 2 +- dev/Screens/LoginScreen.js | 4 +- dev/Screens/MailBoxScreen.js | 1 - dev/Screens/SettingsScreen.js | 11 +- dev/Settings/Admin/AdminSettingsAbout.js | 3 +- dev/Settings/Admin/AdminSettingsBranding.js | 3 +- dev/Settings/Admin/AdminSettingsContacts.js | 3 +- dev/Settings/Admin/AdminSettingsDomains.js | 3 +- dev/Settings/Admin/AdminSettingsGeneral.js | 3 +- dev/Settings/Admin/AdminSettingsLicensing.js | 3 +- dev/Settings/Admin/AdminSettingsLogin.js | 3 +- dev/Settings/Admin/AdminSettingsPackages.js | 3 +- dev/Settings/Admin/AdminSettingsPlugins.js | 3 +- dev/Settings/Admin/AdminSettingsSecurity.js | 3 +- dev/Settings/Admin/AdminSettingsSocial.js | 3 +- dev/Settings/App/SettingsAccounts.js | 3 +- dev/Settings/App/SettingsChangePassword.js | 1 - dev/Settings/App/SettingsContacts.js | 3 +- dev/Settings/App/SettingsFilters.js | 4 +- dev/Settings/App/SettingsFolders.js | 1 - dev/Settings/App/SettingsGeneral.js | 5 +- dev/Settings/App/SettingsIdentities.js | 3 +- dev/Settings/App/SettingsIdentity.js | 3 +- dev/Settings/App/SettingsOpenPGP.js | 5 +- dev/Settings/App/SettingsSecurity.js | 1 - dev/Settings/App/SettingsSocial.js | 1 - dev/Settings/App/SettingsThemes.js | 3 +- dev/Storages/AbstractRemoteStorage.js | 2 +- dev/Storages/DataStorage.js | 40 +- dev/Storages/LocalStorage.js | 5 +- dev/Storages/SettingsStorage.js | 3 +- dev/ViewModels/AboutViewModel.js | 9 +- .../AbstractSystemDropDownViewModel.js | 5 +- dev/ViewModels/AdminLoginViewModel.js | 4 +- dev/ViewModels/AdminSettingsMenuViewModel.js | 17 +- dev/ViewModels/AdminSettingsPaneViewModel.js | 11 +- dev/ViewModels/LoginViewModel.js | 10 +- dev/ViewModels/MailBoxFolderListViewModel.js | 5 +- dev/ViewModels/MailBoxMessageListViewModel.js | 12 +- dev/ViewModels/MailBoxMessageViewViewModel.js | 66 +- .../MailBoxSystemDropDownViewModel.js | 8 +- .../Popups/PopupsActivateViewModel.js | 5 +- .../Popups/PopupsAddAccountViewModel.js | 6 +- .../Popups/PopupsAddOpenPgpKeyViewModel.js | 5 +- .../Popups/PopupsAdvancedSearchViewModel.js | 7 +- dev/ViewModels/Popups/PopupsAskViewModel.js | 7 +- .../Popups/PopupsComposeOpenPgpViewModel.js | 6 +- .../Popups/PopupsComposeViewModel.js | 18 +- .../Popups/PopupsContactsViewModel.js | 8 +- .../Popups/PopupsDomainViewModel.js | 6 +- .../Popups/PopupsFilterViewModel.js | 5 +- .../Popups/PopupsFolderClearViewModel.js | 7 +- .../Popups/PopupsFolderCreateViewModel.js | 7 +- .../Popups/PopupsFolderSystemViewModel.js | 7 +- .../Popups/PopupsIdentityViewModel.js | 7 +- .../PopupsKeyboardShortcutsHelpViewModel.js | 4 +- .../Popups/PopupsLanguagesViewModel.js | 19 +- .../Popups/PopupsNewOpenPgpKeyViewModel.js | 4 +- .../Popups/PopupsPluginViewModel.js | 4 +- .../Popups/PopupsTwoFactorTestViewModel.js | 5 +- .../Popups/PopupsViewOpenPgpKeyViewModel.js | 5 +- dev/ViewModels/SettingsMenuViewModel.js | 8 +- dev/ViewModels/SettingsPaneViewModel.js | 5 +- .../SettingsSystemDropDownViewModel.js | 6 +- gulpfile.js | 16 +- package.json | 6 +- plugins/recaptcha/js/recaptcha.js | 67 +- .../templates/Views/App/MailMessageView.html | 16 +- .../templates/Views/App/PopupsCompose.html | 4 +- rainloop/v/0.0.0/static/css/app.css | 18 +- rainloop/v/0.0.0/static/js/admin.js | 3837 ++--------------- rainloop/v/0.0.0/static/js/admin.min.js | 11 +- rainloop/v/0.0.0/static/js/app.js | 962 ++--- rainloop/v/0.0.0/static/js/app.min.js | 21 +- 123 files changed, 1375 insertions(+), 5128 deletions(-) delete mode 100644 build/other/Gruntfile.js rename dev/Screens/{AbstractSettings.js => AbstractSettingsScreen.js} (92%) diff --git a/build/other/Gruntfile.js b/build/other/Gruntfile.js deleted file mode 100644 index 304826fdc..000000000 --- a/build/other/Gruntfile.js +++ /dev/null @@ -1,534 +0,0 @@ - -/** - * @deprecated - */ - -/*jshint node: true */ - -'use strict'; - -module.exports = function (grunt) { - - grunt.initConfig({ - pkg: grunt.file.readJSON('package.json'), - cfg: { - devVersion: "0.0.0", - releasesPath: 'build/dist/releases', - releaseSrcPath: '', - releaseFolder: 'rainloop', - releaseZipFile: 'rainloop.zip' - }, - less: { - development: { - files: { - 'rainloop/v/<%= cfg.devVersion %>/static/css/less.css': 'dev/Styles/@Main.less' - } - } - }, - jshint: { - options: { - jshintrc: '.jshintrc' - }, - files: [ - 'Gruntfile.js', - 'rainloop/v/<%= cfg.devVersion %>/static/js/app.js', - 'rainloop/v/<%= cfg.devVersion %>/static/js/admin.js' - ] - }, - uglify: { - options: { - mangle: true, - compress: true, - preserveComments: 'some' - }, - cookie: { - options: { - banner: '/*! jquery.cookie v1.4.0 (c) 2013 Klaus Hartl | MIT */\n', - preserveComments: 'false' - }, - src: 'vendors/jquery-cookie/jquery.cookie.js', - dest: 'vendors/jquery-cookie/jquery.cookie-1.4.0.min.js' - }, - ifvisible: { - options: { - banner: '/*!ifvisible.js v1.0.0 (c) 2013 Serkan Yersen | MIT */\n', - preserveComments: 'false' - }, - src: 'vendors/ifvisible/src/ifvisible.js', - dest: 'vendors/ifvisible/ifvisible.min.js' - }, - wakeup: { - options: { - banner: '/*! jQuery WakeUp plugin (c) 2013 Paul Okopny | MIT */\n', - preserveComments: 'false' - }, - src: 'vendors/jquery-wakeup/jquery.wakeup.js', - dest: 'vendors/jquery-wakeup/jquery.wakeup.min.js' - }, - mousewheel: { - options: { - banner: '/*! jquery.mousewheel v3.1.4 (c) 2013 Brandon Aaron (http://brandon.aaron.sh) | MIT */\n', - preserveComments: 'false' - }, - src: 'vendors/jquery-mousewheel/jquery.mousewheel.js', - dest: 'vendors/jquery-mousewheel/jquery.mousewheel-3.1.4.min.js' - }, - nano: { - options: { - banner: "/*! nanoScrollerJS v0.7 (c) 2013 James Florentino; modified by RainLoop Team | MIT */\n", - preserveComments: "false" - }, - src: 'vendors/jquery-nanoscroller/jquery.nanoscroller.js', - dest: 'vendors/jquery-nanoscroller/jquery.nanoscroller-0.7.min.js' - }, - inputosaurus: { - options: { - banner: "/*! Inputosaurus Text v0.1.6 (c) 2013 Dan Kielp ; modified by RainLoop Team | MIT */\n", - preserveComments: "false" - }, - src: 'vendors/inputosaurus/inputosaurus.js', - dest: 'vendors/inputosaurus/inputosaurus.min.js' - }, - pace: { - src: 'vendors/simple-pace/simple-pace.js', - dest: 'vendors/simple-pace/simple-pace-1.0.min.js' - }, - rl: { - src: 'vendors/rl/rl.js', - dest: 'vendors/rl/rl-1.0.min.js' - }, - min_app: { - src: 'rainloop/v/<%= cfg.devVersion %>/static/js/app.js', - dest: 'rainloop/v/<%= cfg.devVersion %>/static/js/app.min.js' - }, - min_admin: { - src: 'rainloop/v/<%= cfg.devVersion %>/static/js/admin.js', - dest: 'rainloop/v/<%= cfg.devVersion %>/static/js/admin.min.js' - } - }, - concat: { - js_index: { - nonull: true, - src: [ - "vendors/json2.min.js", - "vendors/simple-pace/simple-pace-1.0.min.js", - "vendors/rl/rl-1.0.min.js" - ], - dest: 'rainloop/v/<%= cfg.devVersion %>/static/js/boot.js' - }, - js_openpgp: { - nonull: true, - src: [ - "vendors/openpgp/openpgp-0.5.1.min.js", - ], - dest: 'rainloop/v/<%= cfg.devVersion %>/static/js/openpgp.min.js' - }, - js_libs: { - nonull: true, - options: { - separator: '\n\n' - }, - src: [ - "vendors/modernizr.js", - "vendors/underscore/underscore-1.5.2.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", - "vendors/jquery-finger/jquery.finger.min.js", - "vendors/jquery-mousewheel/jquery.mousewheel-3.1.4.min.js", - "vendors/jquery-scrollstop/jquery.scrollstop.min.js", - "vendors/jquery-lazyload/jquery.lazyload.min.js", - "vendors/jquery-nanoscroller/jquery.nanoscroller-0.7.min.js", - "vendors/jquery-wakeup/jquery.wakeup.min.js", - "vendors/inputosaurus/inputosaurus.min.js", - "vendors/moment/min/moment.min.js ", - "vendors/routes/signals.min.js", - "vendors/routes/hasher.min.js", - "vendors/routes/crossroads.min.js", - "vendors/knockout/knockout-3.1.0.js", - "vendors/knockout-projections/knockout-projections-1.0.0.min.js", - "vendors/ssm/ssm.min.js", - "vendors/jua/jua.min.js", - "vendors/keymaster/keymaster.js", - "vendors/ifvisible/ifvisible.min.js", - "vendors/jquery-magnific-popup/jquery.magnific-popup.min.js", - "vendors/bootstrap/js/bootstrap.min.js", - "dev/Common/_LibsEnd.js" - ], - dest: 'rainloop/v/<%= cfg.devVersion %>/static/js/libs.js' - }, - js_admin: { - nonull: true, - options: { - stripBanners: true, - banner: '/*! RainLoop Webmail Admin Module (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */\n' + - '(function (window, $, ko, crossroads, hasher, _) {\n', - footer: '\n\n}(window, jQuery, ko, crossroads, hasher, _));' - }, - src: [ - "dev/Common/_Begin.js", - "dev/Common/_BeginA.js", - - "dev/Common/Globals.js", - "dev/Common/Constants.js", - "dev/Common/Enums.js", - "dev/Common/Utils.js", - "dev/Common/Base64.js", - "dev/Common/Knockout.js", - "dev/Common/LinkBuilder.js", - "dev/Common/Plugins.js", - - "dev/Storages/LocalStorages/CookieDriver.js", - "dev/Storages/LocalStorages/LocalStorageDriver.js", - "dev/Storages/LocalStorage.js", - - "dev/Knoin/AbstractBoot.js", - "dev/Knoin/AbstractViewModel.js", - "dev/Knoin/AbstractScreen.js", - "dev/Knoin/Knoin.js", - - "dev/Models/EmailModel.js", - "dev/Models/ContactTagModel.js", - - "dev/ViewModels/PopupsDomainViewModel.js", - "dev/ViewModels/PopupsPluginViewModel.js", - "dev/ViewModels/PopupsActivateViewModel.js", - "dev/ViewModels/PopupsLanguagesViewModel.js", - "dev/ViewModels/PopupsAskViewModel.js", - - "dev/ViewModels/AdminLoginViewModel.js", - - "dev/ViewModels/AdminMenuViewModel.js", - "dev/ViewModels/AdminPaneViewModel.js", - - "dev/Admin/General.js", - "dev/Admin/Login.js", - "dev/Admin/Branding.js", - "dev/Admin/Contacts.js", - "dev/Admin/Domains.js", - "dev/Admin/Security.js", - "dev/Admin/Social.js", - "dev/Admin/Plugins.js", - "dev/Admin/Packages.js", - "dev/Admin/Licensing.js", - "dev/Admin/About.js", - - "dev/Storages/AbstractData.js", - "dev/Storages/AdminData.js", - - "dev/Storages/AbstractAjaxRemote.js", - "dev/Storages/AdminAjaxRemote.js", - - "dev/Storages/AbstractCache.js", - "dev/Storages/AdminCache.js", - - "dev/Screens/AbstractSettings.js", - - "dev/Screens/AdminLogin.js", - "dev/Screens/AdminSettings.js", - - "dev/Boots/AbstractApp.js", - "dev/Boots/AdminApp.js", - - "dev/Common/_End.js", - "dev/Common/_CoreEnd.js" - ], - dest: 'rainloop/v/<%= cfg.devVersion %>/static/js/admin.js' - }, - js_app: { - nonull: true, - options: { - stripBanners: true, - banner: '/*! RainLoop Webmail Main Module (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */\n' + - '(function (window, $, ko, crossroads, hasher, moment, Jua, _, ifvisible, key) {\n', - footer: '\n\n}(window, jQuery, ko, crossroads, hasher, moment, Jua, _, ifvisible, key));' - }, - src: [ - "dev/Common/_Begin.js", - "dev/Common/_BeginW.js", - - "dev/Common/Globals.js", - "dev/Common/Constants.js", - "dev/Common/Enums.js", - "dev/Common/Utils.js", - "dev/Common/Base64.js", - "dev/Common/Knockout.js", - "dev/Common/LinkBuilder.js", - "dev/Common/Plugins.js", - "dev/Common/NewHtmlEditorWrapper.js", - "dev/Common/Selector.js", - - "dev/Storages/LocalStorages/CookieDriver.js", - "dev/Storages/LocalStorages/LocalStorageDriver.js", - "dev/Storages/LocalStorage.js", - - "dev/Knoin/AbstractBoot.js", - "dev/Knoin/AbstractViewModel.js", - "dev/Knoin/AbstractScreen.js", - "dev/Knoin/Knoin.js", - - "dev/Models/EmailModel.js", - "dev/Models/ContactModel.js", - "dev/Models/ContactPropertyModel.js", - "dev/Models/ContactTagModel.js", - "dev/Models/AttachmentModel.js", - "dev/Models/ComposeAttachmentModel.js", - "dev/Models/MessageModel.js", - "dev/Models/FolderModel.js", - "dev/Models/AccountModel.js", - "dev/Models/IdentityModel.js", - "dev/Models/FilterConditionModel.js", - "dev/Models/FilterModel.js", - "dev/Models/OpenPgpKeyModel.js", - - "dev/ViewModels/PopupsFolderClearViewModel.js", - "dev/ViewModels/PopupsFolderCreateViewModel.js", - "dev/ViewModels/PopupsFolderSystemViewModel.js", - "dev/ViewModels/PopupsComposeViewModel.js", - "dev/ViewModels/PopupsContactsViewModel.js", - "dev/ViewModels/PopupsAdvancedSearchViewModel.js", - "dev/ViewModels/PopupsAddAccountViewModel.js", - "dev/ViewModels/PopupsAddOpenPgpKeyViewModel.js", - "dev/ViewModels/PopupsViewOpenPgpKeyViewModel.js", - "dev/ViewModels/PopupsGenerateNewOpenPgpKeyViewModel.js", - "dev/ViewModels/PopupsComposeOpenPgpViewModel.js", - "dev/ViewModels/PopupsIdentityViewModel.js", - "dev/ViewModels/PopupsLanguagesViewModel.js", - "dev/ViewModels/PopupsTwoFactorTestViewModel.js", - "dev/ViewModels/PopupsAskViewModel.js", - "dev/ViewModels/PopupsKeyboardShortcutsHelpViewModel.js", - - "dev/ViewModels/LoginViewModel.js", - - "dev/ViewModels/AbstractSystemDropDownViewModel.js", - "dev/ViewModels/MailBoxSystemDropDownViewModel.js", - "dev/ViewModels/SettingsSystemDropDownViewModel.js", - - "dev/ViewModels/MailBoxFolderListViewModel.js", - "dev/ViewModels/MailBoxMessageListViewModel.js", - "dev/ViewModels/MailBoxMessageViewViewModel.js", - - "dev/ViewModels/SettingsMenuViewModel.js", - "dev/ViewModels/SettingsPaneViewModel.js", - - "dev/Settings/General.js", - "dev/Settings/Contacts.js", - "dev/Settings/Accounts.js", - "dev/Settings/Identity.js", - "dev/Settings/Identities.js", - "dev/Settings/Filters.js", - "dev/Settings/Security.js", - "dev/Settings/Social.js", - "dev/Settings/ChangePassword.js", - "dev/Settings/Folders.js", - "dev/Settings/Themes.js", - "dev/Settings/OpenPGP.js", - - "dev/Storages/AbstractData.js", - "dev/Storages/WebMailData.js", - - "dev/Storages/AbstractAjaxRemote.js", - "dev/Storages/WebMailAjaxRemote.js", - - "dev/Storages/AbstractCache.js", - "dev/Storages/WebMailCache.js", - - "dev/Screens/AbstractSettings.js", - - "dev/Screens/Login.js", - "dev/Screens/MailBox.js", - "dev/Screens/Settings.js", - - "dev/Boots/AbstractApp.js", - "dev/Boots/RainLoopApp.js", - - "dev/Common/_End.js", - "dev/Common/_CoreEnd.js" - ], - dest: 'rainloop/v/<%= cfg.devVersion %>/static/js/app.js' - }, - css: { - nonull: true, - src: [ - "vendors/jquery-ui/css/smoothness/jquery-ui-1.10.3.custom.css", - "vendors/normalize/normalize.css", - "vendors/fontastic/styles.css", - "vendors/jquery-nanoscroller/nanoscroller.css", - "vendors/jquery-magnific-popup/magnific-popup.css", - "vendors/jquery-magnific-popup/magnific-popup-animations.css", - "vendors/simple-pace/styles.css", - "vendors/inputosaurus/inputosaurus.css", - "vendors/flags/flags-fixed.css", - "rainloop/v/<%= cfg.devVersion %>/static/css/less.css" - ], - dest: 'rainloop/v/<%= cfg.devVersion %>/static/css/app.css' - } - }, - - cssmin: { - css: { - src: 'rainloop/v/<%= cfg.devVersion %>/static/css/app.css', - dest: 'rainloop/v/<%= cfg.devVersion %>/static/css/app.min.css' - } - }, - - compress: { - build: { - options: { - archive: '<%= cfg.releasesPath %>/<%= cfg.releaseFolder %>/<%= cfg.releaseZipFile %>', - mode: 'zip' - }, - files: [{ - expand: true, - cwd: '<%= cfg.releasesPath %>/<%= cfg.releaseFolder %>/src/', - src: ['**/*'] - }] - } - }, - - md5: { - build: { - files: { - '<%= cfg.releasesPath %>/<%= cfg.releaseFolder %>/': - '<%= cfg.releasesPath %>/<%= cfg.releaseFolder %>/<%= cfg.releaseZipFile %>' - }, - options: { - keepExtension: true, - keepBasename: true, - after: function () { - grunt.file['delete']([ - grunt.config('cfg.releasesPath'), grunt.config('cfg.releaseFolder'), grunt.config('cfg.releaseZipFile') - ].join("/")); - } - } - } - }, - - watch: { - js: { - options: { - nospawn: true - }, - files: ['dev/**/*.js', 'vendors/**/*.js'], - tasks: ['concat:js_libs', 'concat:js_openpgp', 'concat:js_admin', 'concat:js_app'] - }, - styles: { - options: { - nospawn: true - }, - files: ['dev/Styles/*.less'], - tasks: ['less', 'concat:css'] - } - } - }); - - // dependencies - for (var key in grunt.file.readJSON('package.json').devDependencies) { - if (key.indexOf('grunt-') === 0) { - grunt.loadNpmTasks(key); - } - } - - grunt.registerTask('rainloop', 'RainLoop Webmail build task', function () { - - var - version = grunt.config('pkg.version'), - release = parseInt(grunt.config('pkg.release'), 10), - releasesPath = grunt.config('cfg.releasesPath'), - devVersion = grunt.config('cfg.devVersion'), - versionFull = version + '.' + release, - dist = releasesPath + '/webmail/' + versionFull + '/src/' - ; - - grunt.file.mkdir(dist); - grunt.file.mkdir(dist + 'data'); - grunt.file.mkdir(dist + 'rainloop/v/' + versionFull); - - require('wrench').copyDirSyncRecursive('rainloop/v/' + devVersion, - dist + 'rainloop/v/' + versionFull, {'forceDelete': true}); - - grunt.file.write(dist + 'data/EMPTY', versionFull); - - grunt.file.write(dist + 'index.php', - grunt.file.read('index.php').replace('\'APP_VERSION\', \'0.0.0\'', '\'APP_VERSION\', \'' + versionFull + '\'')); - - grunt.file.copy(dist + 'index.php', dist + 'rainloop/v/' + versionFull + '/index.php.root'); - - grunt.file.delete(dist + 'rainloop/v/' + versionFull + '/static/css/less.css'); - - grunt.config.set('cfg.releaseFolder', 'webmail/' + versionFull); - grunt.config.set('cfg.releaseSrcPath', dist); - grunt.config.set('cfg.releaseZipFile', 'rainloop-' + versionFull + '.zip'); - }); - - grunt.registerTask('rainloop-owncloud', 'RainLoop ownCloud App build task', function () { - - var - content = '', - version = grunt.config('pkg.ownCloudPackageVersion'), - releasesPath = grunt.config('cfg.releasesPath'), - versionFull = version, - dist = releasesPath + '/owncloud/' + versionFull + '/src/' - ; - - grunt.file.mkdir(dist); - grunt.file.mkdir(dist + 'rainloop'); - - require('wrench').copyDirSyncRecursive('build/owncloud/rainloop-app', - dist + 'rainloop', {'forceDelete': true}); - - content = grunt.file.read(dist + 'rainloop/appinfo/info.xml'); - - grunt.file.write(dist + 'rainloop/appinfo/info.xml', - content.replace('0.0.0', '' + versionFull + '')); - - grunt.file.write(dist + 'rainloop/appinfo/version', versionFull); - - grunt.config.set('cfg.releaseFolder', 'owncloud/' + versionFull); - grunt.config.set('cfg.releaseSrcPath', dist); - grunt.config.set('cfg.releaseZipFile', 'rainloop-owncloud-app-' + versionFull + '.zip'); - }); - - grunt.registerTask('release-inc', 'release inc', function () { - - grunt.file.write('package.json', - grunt.file.read('package.json').replace(/"release":\s?"[\d]+",/, '"release": "' + - (1 + parseInt(grunt.config('pkg.release'), 10)) + '",')); - }); - - grunt.registerTask('rainloop-clean', 'RainLoop Webmail clean task', function () { - var releaseSrcPath = grunt.config('cfg.releaseSrcPath'); - if ('' !== releaseSrcPath) - { - require('wrench').rmdirSyncRecursive(releaseSrcPath); - } - }); - - // uglify - grunt.registerTask('rlmin', ['uglify:min_app', 'uglify:min_admin']); - - // uglify (optional) - grunt.registerTask('rl', ['uglify:rl']); - grunt.registerTask('nano', ['uglify:nano']); - grunt.registerTask('pace', ['uglify:pace']); - grunt.registerTask('wakeup', ['uglify:wakeup']); - grunt.registerTask('cookie', ['uglify:cookie']); - grunt.registerTask('mousewheel', ['uglify:mousewheel']); - grunt.registerTask('inputosaurus', ['uglify:inputosaurus']); - grunt.registerTask('ifvisible', ['uglify:ifvisible']); - // --- - - grunt.registerTask('fast', ['less', 'concat']); - grunt.registerTask('default', ['less', 'concat', 'cssmin', 'jshint', 'rlmin']); - grunt.registerTask('build', ['default', 'rainloop', 'compress:build', 'md5:build', 'release-inc', 'rainloop-clean']); - grunt.registerTask('owncloud', ['rainloop-owncloud', 'compress:build', 'md5:build', 'rainloop-clean']); - - // aliases - grunt.registerTask('u', ['uglify']); - grunt.registerTask('h', ['jshint']); - grunt.registerTask('b', ['build']); - grunt.registerTask('f', ['fast']); - grunt.registerTask('w', ['default', 'watch']); - grunt.registerTask('o', ['owncloud']); - grunt.registerTask('own', ['owncloud']); -}; diff --git a/dev/Admin.js b/dev/Admin.js index c93c2d143..55c200bc6 100644 --- a/dev/Admin.js +++ b/dev/Admin.js @@ -1,5 +1,3 @@ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ - (function (require) { 'use strict'; require('App:Boot')(require('App:Admin')); diff --git a/dev/Apps/AbstractApp.js b/dev/Apps/AbstractApp.js index 86015ae85..a79777d8b 100644 --- a/dev/Apps/AbstractApp.js +++ b/dev/Apps/AbstractApp.js @@ -1,13 +1,12 @@ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { 'use strict'; var - $ = require('$'), - _ = require('_'), window = require('window'), + _ = require('_'), + $ = require('$'), Globals = require('Globals'), Utils = require('Utils'), @@ -20,8 +19,8 @@ ; /** - * @param {*} Remote * @constructor + * @param {RemoteStorage|AdminRemoteStorage} Remote * @extends KnoinAbstractBoot */ function AbstractApp(Remote) @@ -123,6 +122,9 @@ return true; }; + /** + * @param {string} sTitle + */ AbstractApp.prototype.setTitle = function (sTitle) { sTitle = ((Utils.isNormal(sTitle) && 0 < sTitle.length) ? sTitle + ' - ' : '') + diff --git a/dev/Apps/AdminApp.js b/dev/Apps/AdminApp.js index 4a06eb81d..b1e6c7db1 100644 --- a/dev/Apps/AdminApp.js +++ b/dev/Apps/AdminApp.js @@ -1,20 +1,17 @@ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { 'use strict'; var - ko = require('ko'), - _ = require('_'), window = require('window'), + _ = require('_'), + ko = require('ko'), Enums = require('Enums'), Utils = require('Utils'), LinkBuilder = require('LinkBuilder'), - kn = require('App:Knoin'), - Settings = require('Storage:Settings'), Data = require('Storage:Admin:Data'), Remote = require('Storage:Admin:Remote'), @@ -22,6 +19,7 @@ AdminSettingsScreen = require('Screen:Admin:Settings'), AdminLoginScreen = require('Screen:Admin:Login'), + kn = require('App:Knoin'), AbstractApp = require('App:Abstract') ; diff --git a/dev/Apps/RainLoopApp.js b/dev/Apps/RainLoopApp.js index d8b3d7c10..ef2802f98 100644 --- a/dev/Apps/RainLoopApp.js +++ b/dev/Apps/RainLoopApp.js @@ -1,4 +1,3 @@ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { @@ -6,8 +5,8 @@ var window = require('window'), - $ = require('$'), _ = require('_'), + $ = require('$'), moment = require('moment'), Enums = require('Enums'), @@ -1296,41 +1295,6 @@ }); }; - /** - * @param {string} sMailToUrl - * @returns {boolean} - */ - RainLoopApp.prototype.mailToHelper = function (sMailToUrl) - { - if (sMailToUrl && 'mailto:' === sMailToUrl.toString().substr(0, 7).toLowerCase()) - { - sMailToUrl = sMailToUrl.toString().substr(7); - - var - oParams = {}, - oEmailModel = null, - sEmail = sMailToUrl.replace(/\?.+$/, ''), - sQueryString = sMailToUrl.replace(/^[^\?]*\?/, '') - ; - - oEmailModel = new EmailModel(); - oEmailModel.parse(window.decodeURIComponent(sEmail)); - - if (oEmailModel && oEmailModel.email) - { - oParams = Utils.simpleQueryParser(sQueryString); - kn.showScreenPopup(require('View:Popup:Compose'), [Enums.ComposeType.Empty, null, [oEmailModel], - Utils.isUnd(oParams.subject) ? null : Utils.pString(oParams.subject), - Utils.isUnd(oParams.body) ? null : Utils.plainToHtml(Utils.pString(oParams.body)) - ]); - } - - return true; - } - - return false; - }; - RainLoopApp.prototype.bootstartLoginScreen = function () { var sCustomLoginLink = Utils.pString(Settings.settingsGet('CustomLoginLink')); @@ -1495,7 +1459,7 @@ if (Settings.settingsGet('MailToEmail')) { - self.mailToHelper(Settings.settingsGet('MailToEmail')); + Utils.mailToHelper(Settings.settingsGet('MailToEmail'), require('View:Popup:Compose')); } }, 500); } diff --git a/dev/Boot.js b/dev/Boot.js index c768f5290..4938bc995 100644 --- a/dev/Boot.js +++ b/dev/Boot.js @@ -1,4 +1,3 @@ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { @@ -30,7 +29,7 @@ Globals.$html.addClass(Globals.bMobileDevice ? 'mobile' : 'no-mobile'); Globals.$win.keydown(Utils.killCtrlAandS).keyup(Utils.killCtrlAandS); - + Globals.$win.unload(function () { Globals.bUnload = true; }); @@ -41,10 +40,10 @@ // export window['rl'] = window['rl'] || {}; - window['rl']['addHook'] = Plugins.addHook; - window['rl']['settingsGet'] = Plugins.mainSettingsGet; - window['rl']['remoteRequest'] = Plugins.remoteRequest; - window['rl']['pluginSettingsGet'] = Plugins.settingsGet; + window['rl']['addHook'] = _.bind(Plugins.addHook, Plugins); + window['rl']['settingsGet'] = _.bind(Plugins.mainSettingsGet, Plugins); + window['rl']['remoteRequest'] = _.bind(Plugins.remoteRequest, Plugins); + window['rl']['pluginSettingsGet'] = _.bind(Plugins.settingsGet, Plugins); window['rl']['createCommand'] = Utils.createCommand; window['rl']['EmailModel'] = EmailModel; diff --git a/dev/Common/Base64.js b/dev/Common/Base64.js index d8eee4e8b..37758e523 100644 --- a/dev/Common/Base64.js +++ b/dev/Common/Base64.js @@ -2,7 +2,7 @@ // http://www.webtoolkit.info/ (function (module) { - + 'use strict'; /*jslint bitwise: true*/ diff --git a/dev/Common/Consts.js b/dev/Common/Consts.js index f7691cf77..57006338d 100644 --- a/dev/Common/Consts.js +++ b/dev/Common/Consts.js @@ -1,4 +1,3 @@ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module) { @@ -126,4 +125,4 @@ module.exports = Consts; -}(module, require)); \ No newline at end of file +}(module)); \ No newline at end of file diff --git a/dev/Common/Enums.js b/dev/Common/Enums.js index 47d0aa1ed..f26c03bb6 100644 --- a/dev/Common/Enums.js +++ b/dev/Common/Enums.js @@ -1,4 +1,3 @@ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module) { @@ -248,15 +247,6 @@ 'Month': 30 }; - /** - * @enum {number} - */ - Enums.EmailType = { - 'Defailt': 0, - 'Facebook': 1, - 'Google': 2 - }; - /** * @enum {number} */ diff --git a/dev/Common/Events.js b/dev/Common/Events.js index a5322dfbf..09ba23f46 100644 --- a/dev/Common/Events.js +++ b/dev/Common/Events.js @@ -1,9 +1,8 @@ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { 'use strict'; - + var _ = require('_'), diff --git a/dev/Common/Globals.js b/dev/Common/Globals.js index f24048b20..d16aa9c7e 100644 --- a/dev/Common/Globals.js +++ b/dev/Common/Globals.js @@ -1,4 +1,3 @@ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { @@ -6,7 +5,9 @@ var Globals = {}, + window = require('window'), + _ = require('_'), $ = require('$'), ko = require('ko'), key = require('key'), diff --git a/dev/Common/HtmlEditor.js b/dev/Common/HtmlEditor.js index c49a0e72c..8c223c149 100644 --- a/dev/Common/HtmlEditor.js +++ b/dev/Common/HtmlEditor.js @@ -1,4 +1,3 @@ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { @@ -7,6 +6,7 @@ var window = require('window'), _ = require('_'), + Globals = require('Globals'), Settings = require('Storage:Settings') ; diff --git a/dev/Common/LinkBuilder.js b/dev/Common/LinkBuilder.js index 1b65def78..d76cd7971 100644 --- a/dev/Common/LinkBuilder.js +++ b/dev/Common/LinkBuilder.js @@ -1,7 +1,6 @@ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { - + 'use strict'; var @@ -133,7 +132,6 @@ LinkBuilder.prototype.avatarLink = function (sEmail) { return this.sServer + '/Raw/0/Avatar/' + window.encodeURIComponent(sEmail) + '/'; - // return '//secure.gravatar.com/avatar/' + Utils.md5(sEmail.toLowerCase()) + '.jpg?s=80&d=mm'; }; /** diff --git a/dev/Common/Plugins.js b/dev/Common/Plugins.js index 74aebdcf4..8c56833d4 100644 --- a/dev/Common/Plugins.js +++ b/dev/Common/Plugins.js @@ -1,56 +1,57 @@ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { 'use strict'; var - Plugins = { - __boot: null, - __remote: null, - __data: null - }, _ = require('_'), - Utils = require('Utils'), - Settings = require('Storage:Settings') + + Utils = require('Utils') ; /** - * @type {Object} + * @constructor */ - Plugins.oViewModelsHooks = {}; - - /** - * @type {Object} - */ - Plugins.oSimpleHooks = {}; - - /** - * @param {string} sName - * @param {Function} ViewModel - */ - Plugins.regViewModelHook = function (sName, ViewModel) + function Plugins() { - if (ViewModel) - { - ViewModel.__hookName = sName; - } - }; + this.__boot = null; + this.__data = null; + this.__remote = null; + + this.oSettings = require('Storage:Settings'); + + this.oViewModelsHooks = {}; + this.oSimpleHooks = {}; + } + + Plugins.prototype.__boot = null; + Plugins.prototype.__data = null; + Plugins.prototype.__remote = null; + + /** + * @type {Object} + */ + Plugins.prototype.oViewModelsHooks = {}; + + /** + * @type {Object} + */ + Plugins.prototype.oSimpleHooks = {}; /** * @param {string} sName * @param {Function} fCallback */ - Plugins.addHook = function (sName, fCallback) + Plugins.prototype.addHook = function (sName, fCallback) { if (Utils.isFunc(fCallback)) { - if (!Utils.isArray(Plugins.oSimpleHooks[sName])) + if (!Utils.isArray(this.oSimpleHooks[sName])) { - Plugins.oSimpleHooks[sName] = []; + this.oSimpleHooks[sName] = []; } - Plugins.oSimpleHooks[sName].push(fCallback); + this.oSimpleHooks[sName].push(fCallback); } }; @@ -58,13 +59,13 @@ * @param {string} sName * @param {Array=} aArguments */ - Plugins.runHook = function (sName, aArguments) + Plugins.prototype.runHook = function (sName, aArguments) { - if (Utils.isArray(Plugins.oSimpleHooks[sName])) + if (Utils.isArray(this.oSimpleHooks[sName])) { aArguments = aArguments || []; - _.each(Plugins.oSimpleHooks[sName], function (fCallback) { + _.each(this.oSimpleHooks[sName], function (fCallback) { fCallback.apply(null, aArguments); }); } @@ -74,9 +75,9 @@ * @param {string} sName * @return {?} */ - Plugins.mainSettingsGet = function (sName) + Plugins.prototype.mainSettingsGet = function (sName) { - return Settings.settingsGet(sName); + return this.oSettings.settingsGet(sName); }; /** @@ -87,11 +88,11 @@ * @param {string=} sGetAdd = '' * @param {Array=} aAbortActions = [] */ - Plugins.remoteRequest = function (fCallback, sAction, oParameters, iTimeout, sGetAdd, aAbortActions) + Plugins.prototype.remoteRequest = function (fCallback, sAction, oParameters, iTimeout, sGetAdd, aAbortActions) { - if (Plugins.__remote) + if (this.__remote) { - Plugins.__remote.defaultRequest(fCallback, sAction, oParameters, iTimeout, sGetAdd, aAbortActions); + this.__remote.defaultRequest(fCallback, sAction, oParameters, iTimeout, sGetAdd, aAbortActions); } }; @@ -100,13 +101,13 @@ * @param {string} sName * @return {?} */ - Plugins.settingsGet = function (sPluginSection, sName) + Plugins.prototype.settingsGet = function (sPluginSection, sName) { - var oPlugin = Settings.settingsGet('Plugins'); + var oPlugin = this.oSettings.settingsGet('Plugins'); oPlugin = oPlugin && !Utils.isUnd(oPlugin[sPluginSection]) ? oPlugin[sPluginSection] : null; return oPlugin ? (Utils.isUnd(oPlugin[sName]) ? null : oPlugin[sName]) : null; }; - module.exports = Plugins; + module.exports = new Plugins(); }(module, require)); \ No newline at end of file diff --git a/dev/Common/Selector.js b/dev/Common/Selector.js index 4bf4c9858..1f1090232 100644 --- a/dev/Common/Selector.js +++ b/dev/Common/Selector.js @@ -1,12 +1,11 @@ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { 'use strict'; var - $ = require('$'), _ = require('_'), + $ = require('$'), ko = require('ko'), key = require('key'), diff --git a/dev/Common/Utils.js b/dev/Common/Utils.js index 188bb7503..71ff414d5 100644 --- a/dev/Common/Utils.js +++ b/dev/Common/Utils.js @@ -1,16 +1,15 @@ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { 'use strict'; - + var Utils = {}, - $ = require('$'), - _ = require('_'), - ko = require('ko'), window = require('window'), + _ = require('_'), + $ = require('$'), + ko = require('ko'), Enums = require('Enums'), Consts = require('Consts'), @@ -123,7 +122,46 @@ }; /** - * @param {string} aValue + * @param {string} sMailToUrl + * @param {Function} PopupComposeVoreModel + * @returns {boolean} + */ + Utils.mailToHelper = function (sMailToUrl, PopupComposeVoreModel) + { + if (sMailToUrl && 'mailto:' === sMailToUrl.toString().substr(0, 7).toLowerCase()) + { + sMailToUrl = sMailToUrl.toString().substr(7); + + var + oParams = {}, + oEmailModel = null, + sEmail = sMailToUrl.replace(/\?.+$/, ''), + sQueryString = sMailToUrl.replace(/^[^\?]*\?/, ''), + EmailModel = require('Model:Email') + ; + + oEmailModel = new EmailModel(); + oEmailModel.parse(window.decodeURIComponent(sEmail)); + + if (oEmailModel && oEmailModel.email) + { + oParams = Utils.simpleQueryParser(sQueryString); + + require('App:Knoin').showScreenPopup(PopupComposeVoreModel, [Enums.ComposeType.Empty, null, [oEmailModel], + Utils.isUnd(oParams.subject) ? null : Utils.pString(oParams.subject), + Utils.isUnd(oParams.body) ? null : Utils.plainToHtml(Utils.pString(oParams.body)) + ]); + } + + return true; + } + + return false; + }; + + /** + * @param {string} sValue + * @param {string} sHash * @param {string} sKey * @param {string} sLongKey * @return {string|boolean} @@ -892,7 +930,7 @@ NotificationClass = Utils.notificationClass(), iResult = Enums.DesktopNotifications.NotSupported ; - + if (NotificationClass && NotificationClass.permission) { switch (NotificationClass.permission.toLowerCase()) @@ -928,7 +966,7 @@ NotificationClass = Utils.notificationClass(), iPermission = oData.desktopNotificationsPermisions() ; - + if (NotificationClass && Enums.DesktopNotifications.Allowed === iPermission) { oData.desktopNotifications(true); @@ -1134,66 +1172,9 @@ }; /** - * @param {Object} oMessageTextBody + * @param {string} sTheme + * @return {string} */ - Utils.initBlockquoteSwitcher = function (oMessageTextBody) - { - if (oMessageTextBody) - { - var $oList = $('blockquote:not(.rl-bq-switcher)', oMessageTextBody).filter(function () { - return 0 === $(this).parent().closest('blockquote', oMessageTextBody).length; - }); - - if ($oList && 0 < $oList.length) - { - $oList.each(function () { - var $self = $(this), iH = $self.height(); - if (0 === iH || 100 < iH) - { - $self.addClass('rl-bq-switcher hidden-bq'); - $('') - .insertBefore($self) - .click(function () { - $self.toggleClass('hidden-bq'); - Utils.windowResize(); - }) - .after('
') - .before('
') - ; - } - }); - } - } - }; - - /** - * @param {Object} oMessageTextBody - */ - Utils.removeBlockquoteSwitcher = function (oMessageTextBody) - { - if (oMessageTextBody) - { - $(oMessageTextBody).find('blockquote.rl-bq-switcher').each(function () { - $(this).removeClass('rl-bq-switcher hidden-bq'); - }); - - $(oMessageTextBody).find('.rlBlockquoteSwitcher').each(function () { - $(this).remove(); - }); - } - }; - - /** - * @param {Object} oMessageTextBody - */ - Utils.toggleMessageBlockquote = function (oMessageTextBody) - { - if (oMessageTextBody) - { - oMessageTextBody.find('.rlBlockquoteSwitcher').click(); - } - }; - Utils.convertThemeName = function (sTheme) { if ('@custom' === sTheme.substr(-7)) @@ -1201,7 +1182,7 @@ sTheme = Utils.trim(sTheme.substring(0, sTheme.length - 7)); } - return Utils.trim(sTheme.replace(/[^a-zA-Z]+/g, ' ').replace(/([A-Z])/g, ' $1').replace(/[\s]+/g, ' ')); + return Utils.trim(sTheme.replace(/[^a-zA-Z0-9]+/g, ' ').replace(/([A-Z])/g, ' $1').replace(/[\s]+/g, ' ')); }; /** @@ -1254,14 +1235,10 @@ return sResult; }; - /* jshint ignore:start */ /** - * @param {string} s + * @param {string} sPlain * @return {string} */ - Utils.md5 = function(s){function L(k,d){return(k<>>(32-d))}function K(G,k){var I,d,F,H,x;F=(G&2147483648);H=(k&2147483648);I=(G&1073741824);d=(k&1073741824);x=(G&1073741823)+(k&1073741823);if(I&d){return(x^2147483648^F^H)}if(I|d){if(x&1073741824){return(x^3221225472^F^H)}else{return(x^1073741824^F^H)}}else{return(x^F^H)}}function r(d,F,k){return(d&F)|((~d)&k)}function q(d,F,k){return(d&k)|(F&(~k))}function p(d,F,k){return(d^F^k)}function n(d,F,k){return(F^(d|(~k)))}function u(G,F,aa,Z,k,H,I){G=K(G,K(K(r(F,aa,Z),k),I));return K(L(G,H),F)}function f(G,F,aa,Z,k,H,I){G=K(G,K(K(q(F,aa,Z),k),I));return K(L(G,H),F)}function D(G,F,aa,Z,k,H,I){G=K(G,K(K(p(F,aa,Z),k),I));return K(L(G,H),F)}function t(G,F,aa,Z,k,H,I){G=K(G,K(K(n(F,aa,Z),k),I));return K(L(G,H),F)}function e(G){var Z;var F=G.length;var x=F+8;var k=(x-(x%64))/64;var I=(k+1)*16;var aa=Array(I-1);var d=0;var H=0;while(H>>29;return aa}function B(x){var k="",F="",G,d;for(d=0;d<=3;d++){G=(x>>>(d*8))&255;F="0"+G.toString(16);k=k+F.substr(F.length-2,2)}return k}function J(k){k=k.replace(/rn/g,"n");var d="";for(var F=0;F127)&&(x<2048)){d+=String.fromCharCode((x>>6)|192);d+=String.fromCharCode((x&63)|128)}else{d+=String.fromCharCode((x>>12)|224);d+=String.fromCharCode(((x>>6)&63)|128);d+=String.fromCharCode((x&63)|128)}}}return d}var C=Array();var P,h,E,v,g,Y,X,W,V;var S=7,Q=12,N=17,M=22;var A=5,z=9,y=14,w=20;var o=4,m=11,l=16,j=23;var U=6,T=10,R=15,O=21;s=J(s);C=e(s);Y=1732584193;X=4023233417;W=2562383102;V=271733878;for(P=0;P ').appendTo('#rl-hidden'); }; - Utils.defautOptionsAfterRender = function (oOption, oItem) + Utils.defautOptionsAfterRender = function (oDomOption, oItem) { - if (oItem && !Utils.isUnd(oItem.disabled) && oOption) + if (oItem && !Utils.isUnd(oItem.disabled) && oDomOption) { - $(oOption) + $(oDomOption) .toggleClass('disabled', oItem.disabled) .prop('disabled', oItem.disabled) ; @@ -1339,10 +1316,18 @@ oWin.document.getElementsByTagName('head')[0].appendChild(oScript); }; + /** + * @param {Function} fCallback + * @param {?} koTrigger + * @param {?} oContext = null + * @param {number=} iTimer = 1000 + * @return {Function} + */ Utils.settingsSaveHelperFunction = function (fCallback, koTrigger, oContext, iTimer) { oContext = oContext || null; iTimer = Utils.isUnd(iTimer) ? 1000 : Utils.pInt(iTimer); + return function (sType, mData, bCached, sRequestAction, oRequestParameters) { koTrigger.call(oContext, mData && mData['Result'] ? Enums.SaveSettingsStep.TrueResult : Enums.SaveSettingsStep.FalseResult); if (fCallback) @@ -1616,6 +1601,11 @@ return sHtml; }; + /** + * @param {string} sUrl + * @param {number} iValue + * @param {Function} fCallback + */ Utils.resizeAndCrop = function (sUrl, iValue, fCallback) { var oTempImg = new window.Image(); @@ -1781,6 +1771,7 @@ Utils.computedPagenatorHelper = function (koCurrentPage, koPageCount) { return function() { + var iPrev = 0, iNext = 0, @@ -1791,8 +1782,8 @@ /** * @param {number} iIndex - * @param {boolean=} bPush - * @param {string=} sCustomName + * @param {boolean=} bPush = true + * @param {string=} sCustomName = '' */ fAdd = function (iIndex, bPush, sCustomName) { @@ -1894,22 +1885,21 @@ Utils.selectElement = function (element) { - /* jshint onevar: false */ + var sel, range; if (window.getSelection) { - var sel = window.getSelection(); + sel = window.getSelection(); sel.removeAllRanges(); - var range = window.document.createRange(); + range = window.document.createRange(); range.selectNodeContents(element); sel.addRange(range); } else if (window.document.selection) { - var textRange = window.document.body.createTextRange(); - textRange.moveToElementText(element); - textRange.select(); + range = window.document.body.createTextRange(); + range.moveToElementText(element); + range.select(); } - /* jshint onevar: true */ }; Utils.detectDropdownVisibility = _.debounce(function () { @@ -1918,13 +1908,16 @@ })); }, 50); + /** + * @param {boolean=} bDelay = false + */ Utils.triggerAutocompleteInputChange = function (bDelay) { var fFunc = function () { $('.checkAutocomplete').trigger('change'); }; - if (bDelay) + if (Utils.isUnd(bDelay) ? false : !!bDelay) { _.delay(fFunc, 100); } diff --git a/dev/External/JSON.js b/dev/External/JSON.js index cc26e6852..4a1798c8d 100644 --- a/dev/External/JSON.js +++ b/dev/External/JSON.js @@ -1,3 +1 @@ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ - module.exports = JSON; \ No newline at end of file diff --git a/dev/External/Jua.js b/dev/External/Jua.js index bed2238ec..3b736d2d6 100644 --- a/dev/External/Jua.js +++ b/dev/External/Jua.js @@ -1,3 +1 @@ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ - module.exports = Jua; \ No newline at end of file diff --git a/dev/External/crossroads.js b/dev/External/crossroads.js index 5c0e8dccc..7c51abb2f 100644 --- a/dev/External/crossroads.js +++ b/dev/External/crossroads.js @@ -1,3 +1 @@ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ - module.exports = crossroads; \ No newline at end of file diff --git a/dev/External/hasher.js b/dev/External/hasher.js index e8f27cd7d..d090af6a8 100644 --- a/dev/External/hasher.js +++ b/dev/External/hasher.js @@ -1,3 +1 @@ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ - module.exports = hasher; \ No newline at end of file diff --git a/dev/External/ifvisible.js b/dev/External/ifvisible.js index e4b26adbe..c65bee98d 100644 --- a/dev/External/ifvisible.js +++ b/dev/External/ifvisible.js @@ -1,3 +1 @@ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ - module.exports = ifvisible; \ No newline at end of file diff --git a/dev/External/jquery.js b/dev/External/jquery.js index 3c252e90d..b27a8d9ec 100644 --- a/dev/External/jquery.js +++ b/dev/External/jquery.js @@ -1,3 +1 @@ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ - module.exports = $; \ No newline at end of file diff --git a/dev/External/key.js b/dev/External/key.js index a40d2cef0..8477df378 100644 --- a/dev/External/key.js +++ b/dev/External/key.js @@ -1,3 +1 @@ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ - module.exports = key; \ No newline at end of file diff --git a/dev/External/ko.js b/dev/External/ko.js index f68cb8b4e..b88740728 100644 --- a/dev/External/ko.js +++ b/dev/External/ko.js @@ -1,9 +1,8 @@ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, ko) { 'use strict'; - + var window = require('window'), _ = require('_'), diff --git a/dev/External/moment.js b/dev/External/moment.js index 8f47fad33..6f58042c2 100644 --- a/dev/External/moment.js +++ b/dev/External/moment.js @@ -1,3 +1 @@ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ - module.exports = moment; \ No newline at end of file diff --git a/dev/External/ssm.js b/dev/External/ssm.js index ddd0add1d..eb6bc0227 100644 --- a/dev/External/ssm.js +++ b/dev/External/ssm.js @@ -1,3 +1 @@ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ - module.exports = ssm; \ No newline at end of file diff --git a/dev/External/underscore.js b/dev/External/underscore.js index e069874fc..e055bcc62 100644 --- a/dev/External/underscore.js +++ b/dev/External/underscore.js @@ -1,3 +1 @@ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ - module.exports = _; \ No newline at end of file diff --git a/dev/External/window.js b/dev/External/window.js index fd67c69bc..1150c0e0f 100644 --- a/dev/External/window.js +++ b/dev/External/window.js @@ -1,3 +1 @@ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ - module.exports = window; \ No newline at end of file diff --git a/dev/Knoin/Knoin.js b/dev/Knoin/Knoin.js index de8302d10..3dcd88082 100644 --- a/dev/Knoin/Knoin.js +++ b/dev/Knoin/Knoin.js @@ -1,21 +1,18 @@ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { - + 'use strict'; var - $ = require('$'), _ = require('_'), + $ = require('$'), ko = require('ko'), hasher = require('hasher'), crossroads = require('crossroads'), Globals = require('Globals'), Plugins = require('Plugins'), - Utils = require('Utils'), - - KnoinAbstractViewModel = require('Knoin:AbstractViewModel') + Utils = require('Utils') ; /** @@ -49,22 +46,23 @@ }; /** - * @param {string} sName + * @param {string|Array} mName * @param {Function} ViewModelClass - * @param {Function=} AbstractViewModel = KnoinAbstractViewModel */ - Knoin.prototype.extendAsViewModel = function (sName, ViewModelClass, AbstractViewModel) + Knoin.prototype.extendAsViewModel = function (mName, ViewModelClass) { if (ViewModelClass) { - if (!AbstractViewModel) + if (Utils.isArray(mName)) { - AbstractViewModel = KnoinAbstractViewModel; + ViewModelClass.__names = mName; + } + else + { + ViewModelClass.__names = [mName]; } - ViewModelClass.__name = sName; - Plugins.regViewModelHook(sName, ViewModelClass); - _.extend(ViewModelClass.prototype, AbstractViewModel.prototype); + ViewModelClass.__name = ViewModelClass.__names[0]; } }; @@ -142,6 +140,7 @@ ViewModelClass.__vm = oViewModel; oViewModel.viewModelName = ViewModelClass.__name; + oViewModel.viewModelNames = ViewModelClass.__names; if (oViewModelPlace && 1 === oViewModelPlace.length) { @@ -175,6 +174,10 @@ Utils.delegateRun(this, 'onHide'); this.restoreKeyScope(); + _.each(this.viewModelNames, function (sName) { + Plugins.runHook('view-model-on-hide', [sName, self]); + }); + Globals.popupVisibilityNames.remove(this.viewModelName); oViewModel.viewModelDom.css('z-index', 2000); @@ -188,7 +191,9 @@ }, oViewModel); } - Plugins.runHook('view-model-pre-build', [ViewModelClass.__name, oViewModel, oViewModelDom]); + _.each(ViewModelClass.__names, function (sName) { + Plugins.runHook('view-model-pre-build', [sName, oViewModel, oViewModelDom]); + }); ko.applyBindingAccessorsToNode(oViewModelDom[0], { 'i18nInit': true, @@ -201,14 +206,16 @@ oViewModel.registerPopupKeyDown(); } - Plugins.runHook('view-model-post-build', [ViewModelClass.__name, oViewModel, oViewModelDom]); + _.each(ViewModelClass.__names, function (sName) { + Plugins.runHook('view-model-post-build', [sName, oViewModel, oViewModelDom]); + }); } else { Utils.log('Cannot find view model position: ' + sPosition); } } - + return ViewModelClass ? ViewModelClass.__vm : null; }; @@ -220,7 +227,6 @@ if (ViewModelClassToHide && ViewModelClassToHide.__vm && ViewModelClassToHide.__dom) { ViewModelClassToHide.__vm.modalVisibility(false); - Plugins.runHook('view-model-on-hide', [ViewModelClassToHide.__name, ViewModelClassToHide.__vm]); } }; @@ -238,7 +244,10 @@ { ViewModelClassToShow.__vm.modalVisibility(true); Utils.delegateRun(ViewModelClassToShow.__vm, 'onShow', aParameters || []); - Plugins.runHook('view-model-on-show', [ViewModelClassToShow.__name, ViewModelClassToShow.__vm, aParameters || []]); + + _.each(ViewModelClassToShow.__names, function (sName) { + Plugins.runHook('view-model-on-show', [sName, ViewModelClassToShow.__vm, aParameters || []]); + }); } } }; @@ -340,10 +349,13 @@ { ViewModelClass.__dom.show(); ViewModelClass.__vm.viewModelVisibility(true); + Utils.delegateRun(ViewModelClass.__vm, 'onShow'); Utils.delegateRun(ViewModelClass.__vm, 'onFocus', [], 200); - Plugins.runHook('view-model-on-show', [ViewModelClass.__name, ViewModelClass.__vm]); + _.each(ViewModelClass.__names, function (sName) { + Plugins.runHook('view-model-on-show', [sName, ViewModelClass.__vm]); + }); } }, self); diff --git a/dev/Knoin/KnoinAbstractBoot.js b/dev/Knoin/KnoinAbstractBoot.js index f2202e256..08a39ff17 100644 --- a/dev/Knoin/KnoinAbstractBoot.js +++ b/dev/Knoin/KnoinAbstractBoot.js @@ -1,7 +1,6 @@ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module) { - + 'use strict'; /** diff --git a/dev/Knoin/KnoinAbstractScreen.js b/dev/Knoin/KnoinAbstractScreen.js index e93c70aa3..060762b07 100644 --- a/dev/Knoin/KnoinAbstractScreen.js +++ b/dev/Knoin/KnoinAbstractScreen.js @@ -1,11 +1,12 @@ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { 'use strict'; var + _ = require('_'), crossroads = require('crossroads'), + Utils = require('Utils') ; diff --git a/dev/Knoin/KnoinAbstractViewModel.js b/dev/Knoin/KnoinAbstractViewModel.js index fbddfb5a3..c2067a132 100644 --- a/dev/Knoin/KnoinAbstractViewModel.js +++ b/dev/Knoin/KnoinAbstractViewModel.js @@ -1,4 +1,3 @@ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { @@ -8,14 +7,14 @@ ko = require('ko'), Enums = require('Enums'), - Globals = require('Globals'), - Utils = require('Utils') + Utils = require('Utils'), + Globals = require('Globals') ; /** + * @constructor * @param {string=} sPosition = '' * @param {string=} sTemplate = '' - * @constructor */ function KnoinAbstractViewModel(sPosition, sTemplate) { @@ -26,13 +25,19 @@ this.sDefaultKeyScope = Enums.KeyState.None; this.sCurrentKeyScope = this.sDefaultKeyScope; - this.viewModelName = ''; this.viewModelVisibility = ko.observable(false); this.modalVisibility = ko.observable(false).extend({'rateLimit': 0}); + this.viewModelName = ''; + this.viewModelNames = []; this.viewModelDom = null; } + /** + * @type {boolean} + */ + KnoinAbstractViewModel.prototype.bDisabeCloseOnEsc = false; + /** * @type {string} */ @@ -43,11 +48,26 @@ */ KnoinAbstractViewModel.prototype.sTemplate = ''; + /** + * @type {string} + */ + KnoinAbstractViewModel.prototype.sDefaultKeyScope = Enums.KeyState.None; + + /** + * @type {string} + */ + KnoinAbstractViewModel.prototype.sCurrentKeyScope = Enums.KeyState.None; + /** * @type {string} */ KnoinAbstractViewModel.prototype.viewModelName = ''; + /** + * @type {Array} + */ + KnoinAbstractViewModel.prototype.viewModelNames = []; + /** * @type {?} */ diff --git a/dev/Models/AccountModel.js b/dev/Models/AccountModel.js index ad5ee9928..d1fb95fc9 100644 --- a/dev/Models/AccountModel.js +++ b/dev/Models/AccountModel.js @@ -1,4 +1,3 @@ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { @@ -6,6 +5,7 @@ var ko = require('ko'), + Utils = require('Utils') ; @@ -18,7 +18,7 @@ function AccountModel(sEmail, bCanBeDelete) { this.email = sEmail; - + this.deleteAccess = ko.observable(false); this.canBeDalete = ko.observable(Utils.isUnd(bCanBeDelete) ? true : !!bCanBeDelete); } diff --git a/dev/Models/AttachmentModel.js b/dev/Models/AttachmentModel.js index ea83111ea..3859c5546 100644 --- a/dev/Models/AttachmentModel.js +++ b/dev/Models/AttachmentModel.js @@ -1,11 +1,11 @@ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { 'use strict'; - + var window = require('window'), + Globals = require('Globals'), Utils = require('Utils'), LinkBuilder = require('LinkBuilder') diff --git a/dev/Models/ComposeAttachmentModel.js b/dev/Models/ComposeAttachmentModel.js index 248455dc6..0365f083c 100644 --- a/dev/Models/ComposeAttachmentModel.js +++ b/dev/Models/ComposeAttachmentModel.js @@ -1,11 +1,11 @@ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { 'use strict'; - + var ko = require('ko'), + Utils = require('Utils') ; diff --git a/dev/Models/ContactModel.js b/dev/Models/ContactModel.js index 0ad64d5e0..660aa7d66 100644 --- a/dev/Models/ContactModel.js +++ b/dev/Models/ContactModel.js @@ -1,4 +1,3 @@ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { @@ -7,6 +6,7 @@ var _ = require('_'), ko = require('ko'), + Enums = require('Enums'), Utils = require('Utils'), LinkBuilder = require('LinkBuilder') diff --git a/dev/Models/ContactPropertyModel.js b/dev/Models/ContactPropertyModel.js index 462f1b866..283704310 100644 --- a/dev/Models/ContactPropertyModel.js +++ b/dev/Models/ContactPropertyModel.js @@ -1,4 +1,3 @@ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { @@ -6,18 +5,18 @@ var ko = require('ko'), + Enums = require('Enums'), Utils = require('Utils') ; /** + * @constructor * @param {number=} iType = Enums.ContactPropertyType.Unknown * @param {string=} sTypeStr = '' * @param {string=} sValue = '' * @param {boolean=} bFocused = false * @param {string=} sPlaceholder = '' - * - * @constructor */ function ContactPropertyModel(iType, sTypeStr, sValue, bFocused, sPlaceholder) { diff --git a/dev/Models/ContactTagModel.js b/dev/Models/ContactTagModel.js index e5276b4e4..94ecc3189 100644 --- a/dev/Models/ContactTagModel.js +++ b/dev/Models/ContactTagModel.js @@ -1,11 +1,11 @@ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { 'use strict'; - + var ko = require('ko'), + Utils = require('Utils') ; diff --git a/dev/Models/EmailModel.js b/dev/Models/EmailModel.js index 98991891f..457012836 100644 --- a/dev/Models/EmailModel.js +++ b/dev/Models/EmailModel.js @@ -1,11 +1,9 @@ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { - + 'use strict'; var - Enums = require('Enums'), Utils = require('Utils') ; @@ -19,7 +17,6 @@ { this.email = sEmail || ''; this.name = sName || ''; - this.privateType = null; this.clearDuplicateName(); } @@ -45,16 +42,10 @@ */ EmailModel.prototype.email = ''; - /** - * @type {(number|null)} - */ - EmailModel.prototype.privateType = null; - EmailModel.prototype.clear = function () { this.email = ''; this.name = ''; - this.privateType = null; }; /** @@ -82,27 +73,6 @@ } }; - /** - * @return {number} - */ - EmailModel.prototype.type = function () - { - if (null === this.privateType) - { - if (this.email && '@facebook.com' === this.email.substr(-13)) - { - this.privateType = Enums.EmailType.Facebook; - } - - if (null === this.privateType) - { - this.privateType = Enums.EmailType.Default; - } - } - - return this.privateType; - }; - /** * @param {string} sQuery * @return {boolean} diff --git a/dev/Models/FilterConditionModel.js b/dev/Models/FilterConditionModel.js index 94adaaae9..8b67f4b7e 100644 --- a/dev/Models/FilterConditionModel.js +++ b/dev/Models/FilterConditionModel.js @@ -1,11 +1,11 @@ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { 'use strict'; - + var ko = require('ko'), + Enums = require('Enums') ; diff --git a/dev/Models/FilterModel.js b/dev/Models/FilterModel.js index baf06d22a..9d236ab01 100644 --- a/dev/Models/FilterModel.js +++ b/dev/Models/FilterModel.js @@ -1,4 +1,3 @@ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { @@ -6,6 +5,7 @@ var ko = require('ko'), + Enums = require('Enums'), Utils = require('Utils'), FilterConditionModel = require('Model:FilterCondition') diff --git a/dev/Models/FolderModel.js b/dev/Models/FolderModel.js index 9349396df..5913aca71 100644 --- a/dev/Models/FolderModel.js +++ b/dev/Models/FolderModel.js @@ -1,4 +1,3 @@ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { diff --git a/dev/Models/IdentityModel.js b/dev/Models/IdentityModel.js index 4887af09d..e248f5f31 100644 --- a/dev/Models/IdentityModel.js +++ b/dev/Models/IdentityModel.js @@ -1,4 +1,3 @@ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { @@ -6,6 +5,7 @@ var ko = require('ko'), + Utils = require('Utils') ; diff --git a/dev/Models/MessageModel.js b/dev/Models/MessageModel.js index c0ab9c0da..e2f121fa8 100644 --- a/dev/Models/MessageModel.js +++ b/dev/Models/MessageModel.js @@ -1,4 +1,3 @@ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { @@ -6,8 +5,8 @@ var window = require('window'), - $ = require('$'), _ = require('_'), + $ = require('$'), ko = require('ko'), moment = require('moment'), @@ -343,6 +342,14 @@ this.lastInCollapsedThreadLoading(false); }; + /** + * @return {string} + */ + MessageModel.prototype.friendlySize = function () + { + return Utils.friendlySize(this.size()); + }; + MessageModel.prototype.computeSenderEmail = function () { var diff --git a/dev/Models/OpenPgpKeyModel.js b/dev/Models/OpenPgpKeyModel.js index 37b81f596..1d5b54919 100644 --- a/dev/Models/OpenPgpKeyModel.js +++ b/dev/Models/OpenPgpKeyModel.js @@ -1,9 +1,8 @@ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { 'use strict'; - + var ko = require('ko') ; diff --git a/dev/RainLoop.js b/dev/RainLoop.js index a093665ee..e8488bc6d 100644 --- a/dev/RainLoop.js +++ b/dev/RainLoop.js @@ -1,5 +1,3 @@ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ - (function (require) { 'use strict'; require('App:Boot')(require('App:RainLoop')); diff --git a/dev/Screens/AboutScreen.js b/dev/Screens/AboutScreen.js index 74708a8b3..3464768c3 100644 --- a/dev/Screens/AboutScreen.js +++ b/dev/Screens/AboutScreen.js @@ -1,11 +1,11 @@ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { - + 'use strict'; var _ = require('_'), + KnoinAbstractScreen = require('Knoin:AbstractScreen') ; diff --git a/dev/Screens/AbstractSettings.js b/dev/Screens/AbstractSettingsScreen.js similarity index 92% rename from dev/Screens/AbstractSettings.js rename to dev/Screens/AbstractSettingsScreen.js index 358858587..4da910aa5 100644 --- a/dev/Screens/AbstractSettings.js +++ b/dev/Screens/AbstractSettingsScreen.js @@ -1,12 +1,11 @@ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { 'use strict'; var - $ = require('$'), _ = require('_'), + $ = require('$'), ko = require('ko'), Globals = require('Globals'), @@ -18,11 +17,11 @@ ; /** - * @param {Array} aViewModels * @constructor + * @param {Array} aViewModels * @extends KnoinAbstractScreen */ - function AbstractSettings(aViewModels) + function AbstractSettingsScreen(aViewModels) { KnoinAbstractScreen.call(this, 'settings', aViewModels); @@ -32,9 +31,9 @@ this.oViewModelPlace = null; } - _.extend(AbstractSettings.prototype, KnoinAbstractScreen.prototype); + _.extend(AbstractSettingsScreen.prototype, KnoinAbstractScreen.prototype); - AbstractSettings.prototype.onRoute = function (sSubName) + AbstractSettingsScreen.prototype.onRoute = function (sSubName) { var self = this, @@ -141,7 +140,7 @@ } }; - AbstractSettings.prototype.onHide = function () + AbstractSettingsScreen.prototype.onHide = function () { if (this.oCurrentSubScreen && this.oCurrentSubScreen.viewModelDom) { @@ -150,7 +149,7 @@ } }; - AbstractSettings.prototype.onBuild = function () + AbstractSettingsScreen.prototype.onBuild = function () { _.each(Globals.aViewModels['settings'], function (SettingsViewModel) { if (SettingsViewModel && SettingsViewModel.__rlSettingsData && @@ -172,7 +171,7 @@ this.oViewModelPlace = $('#rl-content #rl-settings-subscreen'); }; - AbstractSettings.prototype.routes = function () + AbstractSettingsScreen.prototype.routes = function () { var DefaultViewModel = _.find(Globals.aViewModels['settings'], function (SettingsViewModel) { @@ -195,6 +194,6 @@ ]; }; - module.exports = AbstractSettings; + module.exports = AbstractSettingsScreen; }(module, require)); \ No newline at end of file diff --git a/dev/Screens/AdminLoginScreen.js b/dev/Screens/AdminLoginScreen.js index cf4352c51..cabd9502c 100644 --- a/dev/Screens/AdminLoginScreen.js +++ b/dev/Screens/AdminLoginScreen.js @@ -1,11 +1,11 @@ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { 'use strict'; - + var _ = require('_'), + KnoinAbstractScreen = require('Knoin:AbstractScreen') ; diff --git a/dev/Screens/AdminSettingsScreen.js b/dev/Screens/AdminSettingsScreen.js index be39fc377..751220820 100644 --- a/dev/Screens/AdminSettingsScreen.js +++ b/dev/Screens/AdminSettingsScreen.js @@ -1,4 +1,3 @@ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { @@ -6,6 +5,7 @@ var _ = require('_'), + AbstractSettings = require('Screen:AbstractSettings') ; diff --git a/dev/Screens/LoginScreen.js b/dev/Screens/LoginScreen.js index 86cce3362..5a61daea2 100644 --- a/dev/Screens/LoginScreen.js +++ b/dev/Screens/LoginScreen.js @@ -1,11 +1,11 @@ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { - + 'use strict'; var _ = require('_'), + KnoinAbstractScreen = require('Knoin:AbstractScreen') ; diff --git a/dev/Screens/MailBoxScreen.js b/dev/Screens/MailBoxScreen.js index 88852187a..c6391634b 100644 --- a/dev/Screens/MailBoxScreen.js +++ b/dev/Screens/MailBoxScreen.js @@ -1,4 +1,3 @@ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { diff --git a/dev/Screens/SettingsScreen.js b/dev/Screens/SettingsScreen.js index 47d1e37d3..d3c6ddd64 100644 --- a/dev/Screens/SettingsScreen.js +++ b/dev/Screens/SettingsScreen.js @@ -1,4 +1,3 @@ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { @@ -11,16 +10,16 @@ Utils = require('Utils'), Globals = require('Globals'), - AbstractSettings = require('Screen:AbstractSettings') + AbstractSettingsScreen = require('Screen:AbstractSettings') ; /** * @constructor - * @extends AbstractSettings + * @extends AbstractSettingsScreen */ function SettingsScreen() { - AbstractSettings.call(this, [ + AbstractSettingsScreen.call(this, [ require('View:RainLoop:SettingsSystemDropDown'), require('View:RainLoop:SettingsMenu'), require('View:RainLoop:SettingsPane') @@ -33,14 +32,14 @@ }); } - _.extend(SettingsScreen.prototype, AbstractSettings.prototype); + _.extend(SettingsScreen.prototype, AbstractSettingsScreen.prototype); SettingsScreen.prototype.onShow = function () { this.setSettingsTitle(); Globals.keyScope(Enums.KeyState.Settings); }; - + SettingsScreen.prototype.setSettingsTitle = function () { require('App:RainLoop').setTitle(this.sSettingsTitle); diff --git a/dev/Settings/Admin/AdminSettingsAbout.js b/dev/Settings/Admin/AdminSettingsAbout.js index f52161a27..5fb3b61bd 100644 --- a/dev/Settings/Admin/AdminSettingsAbout.js +++ b/dev/Settings/Admin/AdminSettingsAbout.js @@ -1,9 +1,8 @@ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { 'use strict'; - + var ko = require('ko') ; diff --git a/dev/Settings/Admin/AdminSettingsBranding.js b/dev/Settings/Admin/AdminSettingsBranding.js index 7ed73184d..2986c7ed7 100644 --- a/dev/Settings/Admin/AdminSettingsBranding.js +++ b/dev/Settings/Admin/AdminSettingsBranding.js @@ -1,7 +1,6 @@ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { - + 'use strict'; var diff --git a/dev/Settings/Admin/AdminSettingsContacts.js b/dev/Settings/Admin/AdminSettingsContacts.js index 90abdbad4..9c5673108 100644 --- a/dev/Settings/Admin/AdminSettingsContacts.js +++ b/dev/Settings/Admin/AdminSettingsContacts.js @@ -1,7 +1,6 @@ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { - + 'use strict'; var diff --git a/dev/Settings/Admin/AdminSettingsDomains.js b/dev/Settings/Admin/AdminSettingsDomains.js index 4a5857c12..9f0b83bb8 100644 --- a/dev/Settings/Admin/AdminSettingsDomains.js +++ b/dev/Settings/Admin/AdminSettingsDomains.js @@ -1,7 +1,6 @@ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { - + 'use strict'; var diff --git a/dev/Settings/Admin/AdminSettingsGeneral.js b/dev/Settings/Admin/AdminSettingsGeneral.js index c2d60d7c4..6f68d79f4 100644 --- a/dev/Settings/Admin/AdminSettingsGeneral.js +++ b/dev/Settings/Admin/AdminSettingsGeneral.js @@ -1,9 +1,8 @@ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { 'use strict'; - + var _ = require('_'), ko = require('ko'), diff --git a/dev/Settings/Admin/AdminSettingsLicensing.js b/dev/Settings/Admin/AdminSettingsLicensing.js index 376e85df5..3cb89caa4 100644 --- a/dev/Settings/Admin/AdminSettingsLicensing.js +++ b/dev/Settings/Admin/AdminSettingsLicensing.js @@ -1,7 +1,6 @@ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { - + 'use strict'; var diff --git a/dev/Settings/Admin/AdminSettingsLogin.js b/dev/Settings/Admin/AdminSettingsLogin.js index 63bcecd84..45e6545d6 100644 --- a/dev/Settings/Admin/AdminSettingsLogin.js +++ b/dev/Settings/Admin/AdminSettingsLogin.js @@ -1,7 +1,6 @@ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { - + 'use strict'; var diff --git a/dev/Settings/Admin/AdminSettingsPackages.js b/dev/Settings/Admin/AdminSettingsPackages.js index 35ccec7d6..1b066f57b 100644 --- a/dev/Settings/Admin/AdminSettingsPackages.js +++ b/dev/Settings/Admin/AdminSettingsPackages.js @@ -1,7 +1,6 @@ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { - + 'use strict'; var diff --git a/dev/Settings/Admin/AdminSettingsPlugins.js b/dev/Settings/Admin/AdminSettingsPlugins.js index 2a369a3c8..1c00a8507 100644 --- a/dev/Settings/Admin/AdminSettingsPlugins.js +++ b/dev/Settings/Admin/AdminSettingsPlugins.js @@ -1,7 +1,6 @@ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { - + 'use strict'; var diff --git a/dev/Settings/Admin/AdminSettingsSecurity.js b/dev/Settings/Admin/AdminSettingsSecurity.js index 9890bddac..d4af8eb03 100644 --- a/dev/Settings/Admin/AdminSettingsSecurity.js +++ b/dev/Settings/Admin/AdminSettingsSecurity.js @@ -1,9 +1,8 @@ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { 'use strict'; - + var _ = require('_'), ko = require('ko'), diff --git a/dev/Settings/Admin/AdminSettingsSocial.js b/dev/Settings/Admin/AdminSettingsSocial.js index 13a7274df..304a87c70 100644 --- a/dev/Settings/Admin/AdminSettingsSocial.js +++ b/dev/Settings/Admin/AdminSettingsSocial.js @@ -1,7 +1,6 @@ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { - + 'use strict'; var diff --git a/dev/Settings/App/SettingsAccounts.js b/dev/Settings/App/SettingsAccounts.js index 8b2ef1d08..3903814e7 100644 --- a/dev/Settings/App/SettingsAccounts.js +++ b/dev/Settings/App/SettingsAccounts.js @@ -1,7 +1,6 @@ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { - + 'use strict'; var diff --git a/dev/Settings/App/SettingsChangePassword.js b/dev/Settings/App/SettingsChangePassword.js index 625db442f..742657bfc 100644 --- a/dev/Settings/App/SettingsChangePassword.js +++ b/dev/Settings/App/SettingsChangePassword.js @@ -1,4 +1,3 @@ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { diff --git a/dev/Settings/App/SettingsContacts.js b/dev/Settings/App/SettingsContacts.js index aa9db0c42..535682357 100644 --- a/dev/Settings/App/SettingsContacts.js +++ b/dev/Settings/App/SettingsContacts.js @@ -1,9 +1,8 @@ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { 'use strict'; - + var ko = require('ko'), diff --git a/dev/Settings/App/SettingsFilters.js b/dev/Settings/App/SettingsFilters.js index 6c1d40d5f..c8eeed848 100644 --- a/dev/Settings/App/SettingsFilters.js +++ b/dev/Settings/App/SettingsFilters.js @@ -1,11 +1,11 @@ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { - + 'use strict'; var ko = require('ko'), + Utils = require('Utils') ; diff --git a/dev/Settings/App/SettingsFolders.js b/dev/Settings/App/SettingsFolders.js index 7ca23c33d..024d96e88 100644 --- a/dev/Settings/App/SettingsFolders.js +++ b/dev/Settings/App/SettingsFolders.js @@ -1,4 +1,3 @@ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { diff --git a/dev/Settings/App/SettingsGeneral.js b/dev/Settings/App/SettingsGeneral.js index e9e0a8e5e..9aea8ffea 100644 --- a/dev/Settings/App/SettingsGeneral.js +++ b/dev/Settings/App/SettingsGeneral.js @@ -1,13 +1,12 @@ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { 'use strict'; - + var + _ = require('_'), $ = require('$'), ko = require('ko'), - _ = require('_'), Enums = require('Enums'), Consts = require('Consts'), diff --git a/dev/Settings/App/SettingsIdentities.js b/dev/Settings/App/SettingsIdentities.js index fe55ea7ed..8a824d2bd 100644 --- a/dev/Settings/App/SettingsIdentities.js +++ b/dev/Settings/App/SettingsIdentities.js @@ -1,12 +1,11 @@ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { 'use strict'; var - ko = require('ko'), _ = require('_'), + ko = require('ko'), Enums = require('Enums'), Utils = require('Utils'), diff --git a/dev/Settings/App/SettingsIdentity.js b/dev/Settings/App/SettingsIdentity.js index 6cc4ea6d4..47c3f29c2 100644 --- a/dev/Settings/App/SettingsIdentity.js +++ b/dev/Settings/App/SettingsIdentity.js @@ -1,12 +1,11 @@ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { 'use strict'; var - ko = require('ko'), _ = require('_'), + ko = require('ko'), Enums = require('Enums'), Utils = require('Utils'), diff --git a/dev/Settings/App/SettingsOpenPGP.js b/dev/Settings/App/SettingsOpenPGP.js index 6c5b6f199..8d0e85a7a 100644 --- a/dev/Settings/App/SettingsOpenPGP.js +++ b/dev/Settings/App/SettingsOpenPGP.js @@ -1,12 +1,13 @@ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { - + 'use strict'; var ko = require('ko'), + kn = require('App:Knoin'), + Data = require('Storage:RainLoop:Data') ; diff --git a/dev/Settings/App/SettingsSecurity.js b/dev/Settings/App/SettingsSecurity.js index 3a1b0cf45..119050493 100644 --- a/dev/Settings/App/SettingsSecurity.js +++ b/dev/Settings/App/SettingsSecurity.js @@ -1,4 +1,3 @@ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { diff --git a/dev/Settings/App/SettingsSocial.js b/dev/Settings/App/SettingsSocial.js index c4b5fd10b..34ca6018d 100644 --- a/dev/Settings/App/SettingsSocial.js +++ b/dev/Settings/App/SettingsSocial.js @@ -1,4 +1,3 @@ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { diff --git a/dev/Settings/App/SettingsThemes.js b/dev/Settings/App/SettingsThemes.js index c8f76456a..8cb5dc07d 100644 --- a/dev/Settings/App/SettingsThemes.js +++ b/dev/Settings/App/SettingsThemes.js @@ -1,4 +1,3 @@ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { @@ -6,9 +5,9 @@ var window = require('window'), + _ = require('_'), $ = require('$'), ko = require('ko'), - _ = require('_'), Enums = require('Enums'), Utils = require('Utils'), diff --git a/dev/Storages/AbstractRemoteStorage.js b/dev/Storages/AbstractRemoteStorage.js index 820078130..87d6b0662 100644 --- a/dev/Storages/AbstractRemoteStorage.js +++ b/dev/Storages/AbstractRemoteStorage.js @@ -6,8 +6,8 @@ var window = require('window'), - $ = require('$'), _ = require('_'), + $ = require('$'), Consts = require('Consts'), Enums = require('Enums'), diff --git a/dev/Storages/DataStorage.js b/dev/Storages/DataStorage.js index c059244b9..1696c5485 100644 --- a/dev/Storages/DataStorage.js +++ b/dev/Storages/DataStorage.js @@ -6,8 +6,8 @@ var window = require('window'), - $ = require('$'), _ = require('_'), + $ = require('$'), ko = require('ko'), moment = require('moment'), @@ -548,7 +548,7 @@ NotificationClass = Utils.notificationClass(), oNotification = null ; - + if (NotificationClass && self.useDesktopNotifications()) { oNotification = new NotificationClass(sTitle, { @@ -781,6 +781,40 @@ } }; + /** + * @private + * @param {Object} oMessageTextBody + */ + DataStorage.prototype.initBlockquoteSwitcher = function (oMessageTextBody) + { + if (oMessageTextBody) + { + var $oList = $('blockquote:not(.rl-bq-switcher)', oMessageTextBody).filter(function () { + return 0 === $(this).parent().closest('blockquote', oMessageTextBody).length; + }); + + if ($oList && 0 < $oList.length) + { + $oList.each(function () { + var $self = $(this), iH = $self.height(); + if (0 === iH || 100 < iH) + { + $self.addClass('rl-bq-switcher hidden-bq'); + $('') + .insertBefore($self) + .click(function () { + $self.toggleClass('hidden-bq'); + Utils.windowResize(); + }) + .after('
') + .before('
') + ; + } + }); + } + } + }; + DataStorage.prototype.setMessage = function (oData, bCached) { var @@ -920,7 +954,7 @@ if (oBody) { - Utils.initBlockquoteSwitcher(oBody); + this.initBlockquoteSwitcher(oBody); } } diff --git a/dev/Storages/LocalStorage.js b/dev/Storages/LocalStorage.js index 0108909d2..7f04994b3 100644 --- a/dev/Storages/LocalStorage.js +++ b/dev/Storages/LocalStorage.js @@ -10,12 +10,11 @@ function LocalStorage() { var - _ = require('_'), - NextStorageDriver = _.find([ + NextStorageDriver = require('_').find([ require('Storage:LocalStorage:Cookie'), require('Storage:LocalStorage:LocalStorage') ], function (NextStorageDriver) { - return NextStorageDriver.supported(); + return NextStorageDriver && NextStorageDriver.supported(); }) ; diff --git a/dev/Storages/SettingsStorage.js b/dev/Storages/SettingsStorage.js index fbb24dbda..4f224de9b 100644 --- a/dev/Storages/SettingsStorage.js +++ b/dev/Storages/SettingsStorage.js @@ -1,11 +1,12 @@ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { - + 'use strict'; var window = require('window'), + Utils = require('Utils') ; diff --git a/dev/ViewModels/AboutViewModel.js b/dev/ViewModels/AboutViewModel.js index e7ed97562..8d2d57d7d 100644 --- a/dev/ViewModels/AboutViewModel.js +++ b/dev/ViewModels/AboutViewModel.js @@ -1,12 +1,12 @@ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { 'use strict'; - + var + _ = require('_'), ko = require('ko'), - + kn = require('App:Knoin'), Settings = require('Storage:Settings'), @@ -26,7 +26,8 @@ kn.constructorEnd(this); } - kn.extendAsViewModel('AboutViewModel', AboutViewModel); + kn.extendAsViewModel(['View:RainLoop:About', 'AboutViewModel'], AboutViewModel); + _.extend(AboutViewModel.prototype, KnoinAbstractViewModel.prototype); module.exports = AboutViewModel; diff --git a/dev/ViewModels/AbstractSystemDropDownViewModel.js b/dev/ViewModels/AbstractSystemDropDownViewModel.js index 3eeddc120..41a48c352 100644 --- a/dev/ViewModels/AbstractSystemDropDownViewModel.js +++ b/dev/ViewModels/AbstractSystemDropDownViewModel.js @@ -1,13 +1,12 @@ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { - + 'use strict'; var + window = require('window'), _ = require('_'), ko = require('ko'), - window = require('window'), key = require('key'), Enums = require('Enums'), diff --git a/dev/ViewModels/AdminLoginViewModel.js b/dev/ViewModels/AdminLoginViewModel.js index 93dfeaf83..174a72449 100644 --- a/dev/ViewModels/AdminLoginViewModel.js +++ b/dev/ViewModels/AdminLoginViewModel.js @@ -1,4 +1,3 @@ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { @@ -89,7 +88,8 @@ kn.constructorEnd(this); } - kn.extendAsViewModel('AdminLoginViewModel', AdminLoginViewModel); + kn.extendAsViewModel(['View:Admin:Login', 'AdminLoginViewModel'], AdminLoginViewModel); + _.extend(AdminLoginViewModel.prototype, KnoinAbstractViewModel.prototype); AdminLoginViewModel.prototype.onShow = function () { diff --git a/dev/ViewModels/AdminSettingsMenuViewModel.js b/dev/ViewModels/AdminSettingsMenuViewModel.js index 22857b4ba..8a3435d27 100644 --- a/dev/ViewModels/AdminSettingsMenuViewModel.js +++ b/dev/ViewModels/AdminSettingsMenuViewModel.js @@ -1,12 +1,14 @@ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { 'use strict'; - + var - kn = require('App:Knoin'), + _ = require('_'), + Globals = require('Globals'), + + kn = require('App:Knoin'), KnoinAbstractViewModel = require('Knoin:AbstractViewModel') ; @@ -16,7 +18,7 @@ * @constructor * @extends KnoinAbstractViewModel */ - function AdminMenuViewModel(oScreen) + function AdminSettingsMenuViewModel(oScreen) { KnoinAbstractViewModel.call(this, 'Left', 'AdminMenu'); @@ -27,13 +29,14 @@ kn.constructorEnd(this); } - kn.extendAsViewModel('AdminMenuViewModel', AdminMenuViewModel); + kn.extendAsViewModel(['View:Admin:SettingsMenu', 'AdminSettingsMenuViewModel'], AdminSettingsMenuViewModel); + _.extend(AdminSettingsMenuViewModel.prototype, KnoinAbstractViewModel.prototype); - AdminMenuViewModel.prototype.link = function (sRoute) + AdminSettingsMenuViewModel.prototype.link = function (sRoute) { return '#/' + sRoute; }; - module.exports = AdminMenuViewModel; + module.exports = AdminSettingsMenuViewModel; }(module, require)); diff --git a/dev/ViewModels/AdminSettingsPaneViewModel.js b/dev/ViewModels/AdminSettingsPaneViewModel.js index d739b5ced..0c7cbb9fb 100644 --- a/dev/ViewModels/AdminSettingsPaneViewModel.js +++ b/dev/ViewModels/AdminSettingsPaneViewModel.js @@ -1,10 +1,10 @@ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { 'use strict'; var + _ = require('_'), ko = require('ko'), Settings = require('Storage:Settings'), @@ -19,7 +19,7 @@ * @constructor * @extends KnoinAbstractViewModel */ - function AdminPaneViewModel() + function AdminSettingsPaneViewModel() { KnoinAbstractViewModel.call(this, 'Right', 'AdminPane'); @@ -31,15 +31,16 @@ kn.constructorEnd(this); } - kn.extendAsViewModel('AdminPaneViewModel', AdminPaneViewModel); + kn.extendAsViewModel(['View:Admin:SettingsPane', 'AdminSettingsPaneViewModel'], AdminSettingsPaneViewModel); + _.extend(AdminSettingsPaneViewModel.prototype, KnoinAbstractViewModel.prototype); - AdminPaneViewModel.prototype.logoutClick = function () + AdminSettingsPaneViewModel.prototype.logoutClick = function () { Remote.adminLogout(function () { require('App:Admin').loginAndLogoutReload(); }); }; - module.exports = AdminPaneViewModel; + module.exports = AdminSettingsPaneViewModel; }(module, require)); \ No newline at end of file diff --git a/dev/ViewModels/LoginViewModel.js b/dev/ViewModels/LoginViewModel.js index fb98aeded..707481e5f 100644 --- a/dev/ViewModels/LoginViewModel.js +++ b/dev/ViewModels/LoginViewModel.js @@ -1,17 +1,16 @@ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { 'use strict'; - + var window = require('window'), - $ = require('$'), _ = require('_'), + $ = require('$'), ko = require('ko'), - Utils = require('Utils'), Enums = require('Enums'), + Utils = require('Utils'), LinkBuilder = require('LinkBuilder'), Settings = require('Storage:Settings'), @@ -250,7 +249,8 @@ kn.constructorEnd(this); } - kn.extendAsViewModel('LoginViewModel', LoginViewModel); + kn.extendAsViewModel(['View:RainLoop:Login', 'LoginViewModel'], LoginViewModel); + _.extend(LoginViewModel.prototype, KnoinAbstractViewModel.prototype); LoginViewModel.prototype.onShow = function () { diff --git a/dev/ViewModels/MailBoxFolderListViewModel.js b/dev/ViewModels/MailBoxFolderListViewModel.js index 6c1f22cae..8e04428f3 100644 --- a/dev/ViewModels/MailBoxFolderListViewModel.js +++ b/dev/ViewModels/MailBoxFolderListViewModel.js @@ -1,4 +1,3 @@ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { @@ -6,6 +5,7 @@ var window = require('window'), + _ = require('_'), $ = require('$'), ko = require('ko'), key = require('key'), @@ -48,7 +48,8 @@ kn.constructorEnd(this); } - kn.extendAsViewModel('MailBoxFolderListViewModel', MailBoxFolderListViewModel); + kn.extendAsViewModel(['View:RainLoop:MailBoxFolderList', 'MailBoxFolderListViewModel'], MailBoxFolderListViewModel); + _.extend(MailBoxFolderListViewModel.prototype, KnoinAbstractViewModel.prototype); MailBoxFolderListViewModel.prototype.onBuild = function (oDom) { diff --git a/dev/ViewModels/MailBoxMessageListViewModel.js b/dev/ViewModels/MailBoxMessageListViewModel.js index d2026aa91..1c5c318bc 100644 --- a/dev/ViewModels/MailBoxMessageListViewModel.js +++ b/dev/ViewModels/MailBoxMessageListViewModel.js @@ -1,16 +1,15 @@ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { 'use strict'; - + var - $ = require('$'), _ = require('_'), + $ = require('$'), ko = require('ko'), key = require('key'), - ifvisible = require('ifvisible'), Jua = require('Jua'), + ifvisible = require('ifvisible'), Enums = require('Enums'), Consts = require('Consts'), @@ -266,7 +265,8 @@ kn.constructorEnd(this); } - kn.extendAsViewModel('MailBoxMessageListViewModel', MailBoxMessageListViewModel); + kn.extendAsViewModel(['View:RainLoop:MailBoxMessageList', 'MailBoxMessageListViewModel'], MailBoxMessageListViewModel); + _.extend(MailBoxMessageListViewModel.prototype, KnoinAbstractViewModel.prototype); /** * @type {string} @@ -799,7 +799,7 @@ // change focused state key('tab, shift+tab, left, right', Enums.KeyState.MessageList, function (event, handler) { - if (event && handler && 'shift+tab' === handler.shortcut || 'left' === handler.shortcut) + if (event && handler && ('shift+tab' === handler.shortcut || 'left' === handler.shortcut)) { self.folderList.focused(true); } diff --git a/dev/ViewModels/MailBoxMessageViewViewModel.js b/dev/ViewModels/MailBoxMessageViewViewModel.js index 98e595b93..6d70588ef 100644 --- a/dev/ViewModels/MailBoxMessageViewViewModel.js +++ b/dev/ViewModels/MailBoxMessageViewViewModel.js @@ -1,10 +1,10 @@ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { 'use strict'; var + _ = require('_'), $ = require('$'), ko = require('ko'), key = require('key'), @@ -150,6 +150,7 @@ this.viewCc = ko.observable(''); this.viewBcc = ko.observable(''); this.viewDate = ko.observable(''); + this.viewSize = ko.observable(''); this.viewMoment = ko.observable(''); this.viewLineAsCcc = ko.observable(''); this.viewViewLink = ko.observable(''); @@ -188,6 +189,7 @@ this.viewCc(oMessage.ccToLine(false)); this.viewBcc(oMessage.bccToLine(false)); this.viewDate(oMessage.fullFormatDateValue()); + this.viewSize(oMessage.friendlySize()); this.viewMoment(oMessage.momentDate()); this.viewLineAsCcc(oMessage.lineAsCcc()); this.viewViewLink(oMessage.viewLink()); @@ -246,7 +248,8 @@ kn.constructorEnd(this); } - kn.extendAsViewModel('MailBoxMessageViewViewModel', MailBoxMessageViewViewModel); + kn.extendAsViewModel(['View:RainLoop:MailBoxMessageView', 'MailBoxMessageViewViewModel'], MailBoxMessageViewViewModel); + _.extend(MailBoxMessageViewViewModel.prototype, KnoinAbstractViewModel.prototype); MailBoxMessageViewViewModel.prototype.isPgpActionVisible = function () { @@ -290,23 +293,6 @@ return sResult; }; - MailBoxMessageViewViewModel.prototype.scrollToTop = function () - { - var oCont = $('.messageItem.nano .content', this.viewModelDom); - if (oCont && oCont[0]) - { - // oCont.animate({'scrollTop': 0}, 300); - oCont.scrollTop(0); - } - else - { - // $('.messageItem', this.viewModelDom).animate({'scrollTop': 0}, 300); - $('.messageItem', this.viewModelDom).scrollTop(0); - } - - Utils.windowResize(); - }; - MailBoxMessageViewViewModel.prototype.fullScreen = function () { this.fullScreenMode(true); @@ -366,15 +352,9 @@ }); oDom - .on('click', '.messageView .messageItem .messageItemHeader', function () { - if (Globals.useKeyboardShortcuts() && self.message()) - { - self.message.focused(true); - } - }) .on('click', 'a', function (oEvent) { // setup maito protocol - return !(!!oEvent && 3 !== oEvent['which'] && require('App:RainLoop').mailToHelper($(this).attr('href'))); + return !(!!oEvent && 3 !== oEvent['which'] && Utils.mailToHelper($(this).attr('href'), require('View:Popup:Compose'))); }) .on('click', '.attachmentsPlace .attachmentPreview', function (oEvent) { if (oEvent && oEvent.stopPropagation) @@ -400,6 +380,8 @@ this.messageDomFocused(true); } else { this.messageDomFocused(false); + this.scrollMessageToTop(); + this.scrollMessageToLeft(); } }, this); @@ -516,7 +498,7 @@ key('b', [Enums.KeyState.MessageList, Enums.KeyState.MessageView], function () { if (Data.message() && Data.message().body) { - Utils.toggleMessageBlockquote(Data.message().body); + Data.message().body.find('.rlBlockquoteSwitcher').click(); return false; } }); @@ -559,10 +541,26 @@ }); // change focused state - key('tab, shift+tab, left', Enums.KeyState.MessageView, function () { + key('tab, shift+tab, left', Enums.KeyState.MessageView, function (event, handler) { if (!self.fullScreenMode() && self.message() && Enums.Layout.NoPreview !== Data.layout()) { - self.message.focused(false); + if (event && handler && 'left' === handler.shortcut) + { + if (self.oMessageScrollerDom && 0 < self.oMessageScrollerDom.scrollLeft()) + { + return true; + } + + self.message.focused(false); + } + else + { + self.message.focused(false); + } + } + else if (self.message() && Enums.Layout.NoPreview === Data.layout() && event && handler && 'left' === handler.shortcut) + { + return true; } return false; @@ -643,6 +641,16 @@ if (this.oMessageScrollerDom) { this.oMessageScrollerDom.scrollTop(0); + Utils.windowResize(); + } + }; + + MailBoxMessageViewViewModel.prototype.scrollMessageToLeft = function () + { + if (this.oMessageScrollerDom) + { + this.oMessageScrollerDom.scrollLeft(0); + Utils.windowResize(); } }; diff --git a/dev/ViewModels/MailBoxSystemDropDownViewModel.js b/dev/ViewModels/MailBoxSystemDropDownViewModel.js index cdaedba0d..ab3d09de0 100644 --- a/dev/ViewModels/MailBoxSystemDropDownViewModel.js +++ b/dev/ViewModels/MailBoxSystemDropDownViewModel.js @@ -1,10 +1,11 @@ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { - + 'use strict'; var + _ = require('_'), + kn = require('App:Knoin'), AbstractSystemDropDownViewModel = require('View:RainLoop:AbstractSystemDropDown') ; @@ -19,7 +20,8 @@ kn.constructorEnd(this); } - kn.extendAsViewModel('MailBoxSystemDropDownViewModel', MailBoxSystemDropDownViewModel, AbstractSystemDropDownViewModel); + kn.extendAsViewModel(['View:RainLoop:MailBoxSystemDropDown', 'MailBoxSystemDropDownViewModel'], MailBoxSystemDropDownViewModel); + _.extend(MailBoxSystemDropDownViewModel.prototype, AbstractSystemDropDownViewModel.prototype); module.exports = MailBoxSystemDropDownViewModel; diff --git a/dev/ViewModels/Popups/PopupsActivateViewModel.js b/dev/ViewModels/Popups/PopupsActivateViewModel.js index f5c722797..76d24d69c 100644 --- a/dev/ViewModels/Popups/PopupsActivateViewModel.js +++ b/dev/ViewModels/Popups/PopupsActivateViewModel.js @@ -1,10 +1,10 @@ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { 'use strict'; var + _ = require('_'), ko = require('ko'), Enums = require('Enums'), @@ -104,7 +104,8 @@ kn.constructorEnd(this); } - kn.extendAsViewModel('PopupsActivateViewModel', PopupsActivateViewModel); + kn.extendAsViewModel(['View:Popup:Activate', 'PopupsActivateViewModel'], PopupsActivateViewModel); + _.extend(PopupsActivateViewModel.prototype, KnoinAbstractViewModel.prototype); PopupsActivateViewModel.prototype.onShow = function () { diff --git a/dev/ViewModels/Popups/PopupsAddAccountViewModel.js b/dev/ViewModels/Popups/PopupsAddAccountViewModel.js index e2c1f1a07..930ef39e3 100644 --- a/dev/ViewModels/Popups/PopupsAddAccountViewModel.js +++ b/dev/ViewModels/Popups/PopupsAddAccountViewModel.js @@ -1,9 +1,8 @@ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { 'use strict'; - + var _ = require('_'), ko = require('ko'), @@ -87,7 +86,8 @@ kn.constructorEnd(this); } - kn.extendAsViewModel('PopupsAddAccountViewModel', PopupsAddAccountViewModel); + kn.extendAsViewModel(['View:Popup:AddAccount', 'PopupsAddAccountViewModel'], PopupsAddAccountViewModel); + _.extend(PopupsAddAccountViewModel.prototype, KnoinAbstractViewModel.prototype); PopupsAddAccountViewModel.prototype.clearPopup = function () { diff --git a/dev/ViewModels/Popups/PopupsAddOpenPgpKeyViewModel.js b/dev/ViewModels/Popups/PopupsAddOpenPgpKeyViewModel.js index e3828f50a..4f7b87760 100644 --- a/dev/ViewModels/Popups/PopupsAddOpenPgpKeyViewModel.js +++ b/dev/ViewModels/Popups/PopupsAddOpenPgpKeyViewModel.js @@ -1,10 +1,10 @@ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { 'use strict'; var + _ = require('_'), ko = require('ko'), Utils = require('Utils'), @@ -86,7 +86,8 @@ kn.constructorEnd(this); } - kn.extendAsViewModel('PopupsAddOpenPgpKeyViewModel', PopupsAddOpenPgpKeyViewModel); + kn.extendAsViewModel(['View:Popup:AddOpenPgpKey', 'PopupsAddOpenPgpKeyViewModel'], PopupsAddOpenPgpKeyViewModel); + _.extend(PopupsAddOpenPgpKeyViewModel.prototype, KnoinAbstractViewModel.prototype); PopupsAddOpenPgpKeyViewModel.prototype.clearPopup = function () { diff --git a/dev/ViewModels/Popups/PopupsAdvancedSearchViewModel.js b/dev/ViewModels/Popups/PopupsAdvancedSearchViewModel.js index f46c774d3..fcac81fdf 100644 --- a/dev/ViewModels/Popups/PopupsAdvancedSearchViewModel.js +++ b/dev/ViewModels/Popups/PopupsAdvancedSearchViewModel.js @@ -1,10 +1,10 @@ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { 'use strict'; - + var + _ = require('_'), ko = require('ko'), moment = require('moment'), @@ -50,7 +50,8 @@ kn.constructorEnd(this); } - kn.extendAsViewModel('PopupsAdvancedSearchViewModel', PopupsAdvancedSearchViewModel); + kn.extendAsViewModel(['View:Popup:AdvancedSearch', 'PopupsAdvancedSearchViewModel'], PopupsAdvancedSearchViewModel); + _.extend(PopupsAdvancedSearchViewModel.prototype, KnoinAbstractViewModel.prototype); PopupsAdvancedSearchViewModel.prototype.buildSearchStringValue = function (sValue) { diff --git a/dev/ViewModels/Popups/PopupsAskViewModel.js b/dev/ViewModels/Popups/PopupsAskViewModel.js index 9e580b670..1a6134522 100644 --- a/dev/ViewModels/Popups/PopupsAskViewModel.js +++ b/dev/ViewModels/Popups/PopupsAskViewModel.js @@ -1,10 +1,10 @@ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { 'use strict'; - + var + _ = require('_'), ko = require('ko'), key = require('key'), @@ -39,7 +39,8 @@ kn.constructorEnd(this); } - kn.extendAsViewModel('PopupsAskViewModel', PopupsAskViewModel); + kn.extendAsViewModel(['View:Popup:Ask', 'PopupsAskViewModel'], PopupsAskViewModel); + _.extend(PopupsAskViewModel.prototype, KnoinAbstractViewModel.prototype); PopupsAskViewModel.prototype.clearPopup = function () { diff --git a/dev/ViewModels/Popups/PopupsComposeOpenPgpViewModel.js b/dev/ViewModels/Popups/PopupsComposeOpenPgpViewModel.js index e26fc93a8..4b3bdc3aa 100644 --- a/dev/ViewModels/Popups/PopupsComposeOpenPgpViewModel.js +++ b/dev/ViewModels/Popups/PopupsComposeOpenPgpViewModel.js @@ -1,9 +1,8 @@ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { 'use strict'; - + var window = require('window'), _ = require('_'), @@ -159,7 +158,8 @@ kn.constructorEnd(this); } - kn.extendAsViewModel('PopupsComposeOpenPgpViewModel', PopupsComposeOpenPgpViewModel); + kn.extendAsViewModel(['View:Popup:ComposeOpenPgp', 'PopupsComposeOpenPgpViewModel'], PopupsComposeOpenPgpViewModel); + _.extend(PopupsComposeOpenPgpViewModel.prototype, KnoinAbstractViewModel.prototype); PopupsComposeOpenPgpViewModel.prototype.clearPopup = function () { diff --git a/dev/ViewModels/Popups/PopupsComposeViewModel.js b/dev/ViewModels/Popups/PopupsComposeViewModel.js index 1745bc898..f8e8d5c29 100644 --- a/dev/ViewModels/Popups/PopupsComposeViewModel.js +++ b/dev/ViewModels/Popups/PopupsComposeViewModel.js @@ -1,4 +1,3 @@ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { @@ -6,8 +5,8 @@ var window = require('window'), - $ = require('$'), _ = require('_'), + $ = require('$'), ko = require('ko'), moment = require('moment'), JSON = require('JSON'), @@ -17,8 +16,8 @@ Consts = require('Consts'), Utils = require('Utils'), Globals = require('Globals'), - LinkBuilder = require('LinkBuilder'), Events = require('Events'), + LinkBuilder = require('LinkBuilder'), HtmlEditor = require('HtmlEditor'), Settings = require('Storage:Settings'), @@ -404,7 +403,8 @@ kn.constructorEnd(this); } - kn.extendAsViewModel('PopupsComposeViewModel', PopupsComposeViewModel); + kn.extendAsViewModel(['View:Popup:Compose', 'PopupsComposeViewModel'], PopupsComposeViewModel); + _.extend(PopupsComposeViewModel.prototype, KnoinAbstractViewModel.prototype); PopupsComposeViewModel.prototype.emailsSource = function (oData, fResponse) { @@ -794,7 +794,15 @@ aDraftInfo = oMessage.aDraftInfo; oText = $(oMessage.body).clone(); - Utils.removeBlockquoteSwitcher(oText); + if (oText) + { + oText.find('blockquote.rl-bq-switcher').each(function () { + $(this).removeClass('rl-bq-switcher hidden-bq'); + }); + oText.find('.rlBlockquoteSwitcher').each(function () { + $(this).remove(); + }); + } oText.find('[data-html-editor-font-wrapper]').removeAttr('data-html-editor-font-wrapper'); sText = oText.html(); diff --git a/dev/ViewModels/Popups/PopupsContactsViewModel.js b/dev/ViewModels/Popups/PopupsContactsViewModel.js index 71e80428d..415fd0c09 100644 --- a/dev/ViewModels/Popups/PopupsContactsViewModel.js +++ b/dev/ViewModels/Popups/PopupsContactsViewModel.js @@ -1,4 +1,3 @@ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { @@ -6,8 +5,8 @@ var window = require('window'), - $ = require('$'), _ = require('_'), + $ = require('$'), ko = require('ko'), key = require('key'), @@ -15,8 +14,8 @@ Consts = require('Consts'), Globals = require('Globals'), Utils = require('Utils'), - LinkBuilder = require('LinkBuilder'), Selector = require('Selector'), + LinkBuilder = require('LinkBuilder'), Data = require('Storage:RainLoop:Data'), Remote = require('Storage:RainLoop:Remote'), @@ -391,7 +390,8 @@ kn.constructorEnd(this); } - kn.extendAsViewModel('PopupsContactsViewModel', PopupsContactsViewModel); + kn.extendAsViewModel(['View:Popup:Contacts', 'PopupsContactsViewModel'], PopupsContactsViewModel); + _.extend(PopupsContactsViewModel.prototype, KnoinAbstractViewModel.prototype); PopupsContactsViewModel.prototype.contactTagsSource = function (oData, fResponse) { diff --git a/dev/ViewModels/Popups/PopupsDomainViewModel.js b/dev/ViewModels/Popups/PopupsDomainViewModel.js index 1952b307f..89bfae193 100644 --- a/dev/ViewModels/Popups/PopupsDomainViewModel.js +++ b/dev/ViewModels/Popups/PopupsDomainViewModel.js @@ -1,7 +1,6 @@ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { - + 'use strict'; var @@ -200,7 +199,8 @@ kn.constructorEnd(this); } - kn.extendAsViewModel('PopupsDomainViewModel', PopupsDomainViewModel); + kn.extendAsViewModel(['View:Popup:Domain', 'PopupsDomainViewModel'], PopupsDomainViewModel); + _.extend(PopupsDomainViewModel.prototype, KnoinAbstractViewModel.prototype); PopupsDomainViewModel.prototype.onTestConnectionResponse = function (sResult, oData) { diff --git a/dev/ViewModels/Popups/PopupsFilterViewModel.js b/dev/ViewModels/Popups/PopupsFilterViewModel.js index 93385aa18..63921bcd7 100644 --- a/dev/ViewModels/Popups/PopupsFilterViewModel.js +++ b/dev/ViewModels/Popups/PopupsFilterViewModel.js @@ -1,10 +1,10 @@ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { 'use strict'; var + _ = require('_'), ko = require('ko'), Consts = require('Consts'), @@ -33,7 +33,8 @@ kn.constructorEnd(this); } - kn.extendAsViewModel('PopupsFilterViewModel', PopupsFilterViewModel); + kn.extendAsViewModel(['View:Popup:Filter', 'PopupsFilterViewModel'], PopupsFilterViewModel); + _.extend(PopupsFilterViewModel.prototype, KnoinAbstractViewModel.prototype); PopupsFilterViewModel.prototype.clearPopup = function () { diff --git a/dev/ViewModels/Popups/PopupsFolderClearViewModel.js b/dev/ViewModels/Popups/PopupsFolderClearViewModel.js index b46583bb7..94dda63a3 100644 --- a/dev/ViewModels/Popups/PopupsFolderClearViewModel.js +++ b/dev/ViewModels/Popups/PopupsFolderClearViewModel.js @@ -1,10 +1,10 @@ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { 'use strict'; var + _ = require('_'), ko = require('ko'), Enums = require('Enums'), @@ -64,7 +64,7 @@ oFolderToClear.messageCountUnread(0); Cache.setFolderHash(oFolderToClear.fullNameRaw, ''); - + Remote.folderClear(function (sResult, oData) { self.clearingProcess(false); @@ -101,7 +101,8 @@ kn.constructorEnd(this); } - kn.extendAsViewModel('PopupsFolderClearViewModel', PopupsFolderClearViewModel); + kn.extendAsViewModel(['View:Popup:FolderClear', 'PopupsFolderClearViewModel'], PopupsFolderClearViewModel); + _.extend(PopupsFolderClearViewModel.prototype, KnoinAbstractViewModel.prototype); PopupsFolderClearViewModel.prototype.clearPopup = function () { diff --git a/dev/ViewModels/Popups/PopupsFolderCreateViewModel.js b/dev/ViewModels/Popups/PopupsFolderCreateViewModel.js index e6dc0cdb9..41278d32d 100644 --- a/dev/ViewModels/Popups/PopupsFolderCreateViewModel.js +++ b/dev/ViewModels/Popups/PopupsFolderCreateViewModel.js @@ -1,10 +1,10 @@ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { - + 'use strict'; var + _ = require('_'), ko = require('ko'), Enums = require('Enums'), @@ -100,7 +100,8 @@ kn.constructorEnd(this); } - kn.extendAsViewModel('PopupsFolderCreateViewModel', PopupsFolderCreateViewModel); + kn.extendAsViewModel(['View:Popup:FolderCreate', 'PopupsFolderCreateViewModel'], PopupsFolderCreateViewModel); + _.extend(PopupsFolderCreateViewModel.prototype, KnoinAbstractViewModel.prototype); PopupsFolderCreateViewModel.prototype.sNoParentText = ''; diff --git a/dev/ViewModels/Popups/PopupsFolderSystemViewModel.js b/dev/ViewModels/Popups/PopupsFolderSystemViewModel.js index e26754d80..2189386ae 100644 --- a/dev/ViewModels/Popups/PopupsFolderSystemViewModel.js +++ b/dev/ViewModels/Popups/PopupsFolderSystemViewModel.js @@ -1,10 +1,10 @@ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { - + 'use strict'; var + _ = require('_'), ko = require('ko'), Enums = require('Enums'), @@ -94,7 +94,8 @@ kn.constructorEnd(this); } - kn.extendAsViewModel('PopupsFolderSystemViewModel', PopupsFolderSystemViewModel); + kn.extendAsViewModel(['View:Popup:FolderSystem', 'PopupsFolderSystemViewModel'], PopupsFolderSystemViewModel); + _.extend(PopupsFolderSystemViewModel.prototype, KnoinAbstractViewModel.prototype); PopupsFolderSystemViewModel.prototype.sChooseOnText = ''; PopupsFolderSystemViewModel.prototype.sUnuseText = ''; diff --git a/dev/ViewModels/Popups/PopupsIdentityViewModel.js b/dev/ViewModels/Popups/PopupsIdentityViewModel.js index 0b885ab8e..9bf754f4e 100644 --- a/dev/ViewModels/Popups/PopupsIdentityViewModel.js +++ b/dev/ViewModels/Popups/PopupsIdentityViewModel.js @@ -1,19 +1,19 @@ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { 'use strict'; var + _ = require('_'), ko = require('ko'), Enums = require('Enums'), Utils = require('Utils'), - kn = require('App:Knoin'), Remote = require('Storage:RainLoop:Remote'), Data = require('Storage:RainLoop:Data'), + kn = require('App:Knoin'), KnoinAbstractViewModel = require('Knoin:AbstractViewModel') ; @@ -115,7 +115,8 @@ kn.constructorEnd(this); } - kn.extendAsViewModel('PopupsIdentityViewModel', PopupsIdentityViewModel); + kn.extendAsViewModel(['View:Popup:Identity', 'PopupsIdentityViewModel'], PopupsIdentityViewModel); + _.extend(PopupsIdentityViewModel.prototype, KnoinAbstractViewModel.prototype); PopupsIdentityViewModel.prototype.clearPopup = function () { diff --git a/dev/ViewModels/Popups/PopupsKeyboardShortcutsHelpViewModel.js b/dev/ViewModels/Popups/PopupsKeyboardShortcutsHelpViewModel.js index 09a774b06..18d34adb5 100644 --- a/dev/ViewModels/Popups/PopupsKeyboardShortcutsHelpViewModel.js +++ b/dev/ViewModels/Popups/PopupsKeyboardShortcutsHelpViewModel.js @@ -1,4 +1,3 @@ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { @@ -27,7 +26,8 @@ kn.constructorEnd(this); } - kn.extendAsViewModel('PopupsKeyboardShortcutsHelpViewModel', PopupsKeyboardShortcutsHelpViewModel); + kn.extendAsViewModel(['View:Popup:KeyboardShortcutsHelp', 'PopupsKeyboardShortcutsHelpViewModel'], PopupsKeyboardShortcutsHelpViewModel); + _.extend(PopupsKeyboardShortcutsHelpViewModel.prototype, KnoinAbstractViewModel.prototype); PopupsKeyboardShortcutsHelpViewModel.prototype.onBuild = function (oDom) { diff --git a/dev/ViewModels/Popups/PopupsLanguagesViewModel.js b/dev/ViewModels/Popups/PopupsLanguagesViewModel.js index d9f291d25..435757623 100644 --- a/dev/ViewModels/Popups/PopupsLanguagesViewModel.js +++ b/dev/ViewModels/Popups/PopupsLanguagesViewModel.js @@ -1,4 +1,3 @@ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { @@ -9,8 +8,7 @@ ko = require('ko'), Utils = require('Utils'), - - Data = require('Storage:RainLoop:Data'), + Globals = require('Globals'), kn = require('App:Knoin'), KnoinAbstractViewModel = require('Knoin:AbstractViewModel') @@ -24,26 +22,29 @@ { KnoinAbstractViewModel.call(this, 'Popups', 'PopupsLanguages'); + this.Data = Globals.__APP.data(); // TODO + this.exp = ko.observable(false); this.languages = ko.computed(function () { - return _.map(Data.languages(), function (sLanguage) { + return _.map(this.Data.languages(), function (sLanguage) { return { 'key': sLanguage, 'selected': ko.observable(false), 'fullName': Utils.convertLangName(sLanguage) }; }); - }); + }, this); - Data.mainLanguage.subscribe(function () { + this.Data.mainLanguage.subscribe(function () { this.resetMainLanguage(); }, this); kn.constructorEnd(this); } - kn.extendAsViewModel('PopupsLanguagesViewModel', PopupsLanguagesViewModel); + kn.extendAsViewModel(['View:Popup:Languages', 'PopupsLanguagesViewModel'], PopupsLanguagesViewModel); + _.extend(PopupsLanguagesViewModel.prototype, KnoinAbstractViewModel.prototype); PopupsLanguagesViewModel.prototype.languageEnName = function (sLanguage) { @@ -52,7 +53,7 @@ PopupsLanguagesViewModel.prototype.resetMainLanguage = function () { - var sCurrent = Data.mainLanguage(); + var sCurrent = this.Data.mainLanguage(); _.each(this.languages(), function (oItem) { oItem['selected'](oItem['key'] === sCurrent); }); @@ -72,7 +73,7 @@ PopupsLanguagesViewModel.prototype.changeLanguage = function (sLang) { - Data.mainLanguage(sLang); + this.Data.mainLanguage(sLang); this.cancelCommand(); }; diff --git a/dev/ViewModels/Popups/PopupsNewOpenPgpKeyViewModel.js b/dev/ViewModels/Popups/PopupsNewOpenPgpKeyViewModel.js index 5def435f8..9332340d8 100644 --- a/dev/ViewModels/Popups/PopupsNewOpenPgpKeyViewModel.js +++ b/dev/ViewModels/Popups/PopupsNewOpenPgpKeyViewModel.js @@ -1,4 +1,3 @@ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { @@ -89,7 +88,8 @@ kn.constructorEnd(this); } - kn.extendAsViewModel('PopupsNewOpenPgpKeyViewModel', PopupsNewOpenPgpKeyViewModel); + kn.extendAsViewModel(['View:Popup:NewOpenPgpKey', 'PopupsNewOpenPgpKeyViewModel'], PopupsNewOpenPgpKeyViewModel); + _.extend(PopupsNewOpenPgpKeyViewModel.prototype, KnoinAbstractViewModel.prototype); PopupsNewOpenPgpKeyViewModel.prototype.clearPopup = function () { diff --git a/dev/ViewModels/Popups/PopupsPluginViewModel.js b/dev/ViewModels/Popups/PopupsPluginViewModel.js index c89e1ebc1..150ae09b2 100644 --- a/dev/ViewModels/Popups/PopupsPluginViewModel.js +++ b/dev/ViewModels/Popups/PopupsPluginViewModel.js @@ -1,4 +1,3 @@ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { @@ -85,7 +84,8 @@ kn.constructorEnd(this); } - kn.extendAsViewModel('PopupsPluginViewModel', PopupsPluginViewModel); + kn.extendAsViewModel(['View:Popup:Plugin', 'PopupsPluginViewModel'], PopupsPluginViewModel); + _.extend(PopupsPluginViewModel.prototype, KnoinAbstractViewModel.prototype); PopupsPluginViewModel.prototype.onPluginSettingsUpdateResponse = function (sResult, oData) { diff --git a/dev/ViewModels/Popups/PopupsTwoFactorTestViewModel.js b/dev/ViewModels/Popups/PopupsTwoFactorTestViewModel.js index add3de210..3b23f7f73 100644 --- a/dev/ViewModels/Popups/PopupsTwoFactorTestViewModel.js +++ b/dev/ViewModels/Popups/PopupsTwoFactorTestViewModel.js @@ -1,10 +1,10 @@ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { 'use strict'; var + _ = require('_'), ko = require('ko'), Enums = require('Enums'), @@ -50,7 +50,8 @@ kn.constructorEnd(this); } - kn.extendAsViewModel('PopupsTwoFactorTestViewModel', PopupsTwoFactorTestViewModel); + kn.extendAsViewModel(['View:Popup:TwoFactorTest', 'PopupsTwoFactorTestViewModel'], PopupsTwoFactorTestViewModel); + _.extend(PopupsTwoFactorTestViewModel.prototype, KnoinAbstractViewModel.prototype); PopupsTwoFactorTestViewModel.prototype.clearPopup = function () { diff --git a/dev/ViewModels/Popups/PopupsViewOpenPgpKeyViewModel.js b/dev/ViewModels/Popups/PopupsViewOpenPgpKeyViewModel.js index 614329913..3e3079d24 100644 --- a/dev/ViewModels/Popups/PopupsViewOpenPgpKeyViewModel.js +++ b/dev/ViewModels/Popups/PopupsViewOpenPgpKeyViewModel.js @@ -1,10 +1,10 @@ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { 'use strict'; var + _ = require('_'), ko = require('ko'), Utils = require('Utils'), @@ -27,7 +27,8 @@ kn.constructorEnd(this); } - kn.extendAsViewModel('PopupsViewOpenPgpKeyViewModel', PopupsViewOpenPgpKeyViewModel); + kn.extendAsViewModel(['View:Popup:ViewOpenPgpKey', 'PopupsViewOpenPgpKeyViewModel'], PopupsViewOpenPgpKeyViewModel); + _.extend(PopupsViewOpenPgpKeyViewModel.prototype, KnoinAbstractViewModel.prototype); PopupsViewOpenPgpKeyViewModel.prototype.clearPopup = function () { diff --git a/dev/ViewModels/SettingsMenuViewModel.js b/dev/ViewModels/SettingsMenuViewModel.js index d9c0beb90..f756d1cc2 100644 --- a/dev/ViewModels/SettingsMenuViewModel.js +++ b/dev/ViewModels/SettingsMenuViewModel.js @@ -1,12 +1,13 @@ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { 'use strict'; var - LinkBuilder = require('LinkBuilder'), + _ = require('_'), + Globals = require('Globals'), + LinkBuilder = require('LinkBuilder'), kn = require('App:Knoin'), KnoinAbstractViewModel = require('Knoin:AbstractViewModel') @@ -29,7 +30,8 @@ kn.constructorEnd(this); } - kn.extendAsViewModel('SettingsMenuViewModel', SettingsMenuViewModel); + kn.extendAsViewModel(['View:RainLoop:SettingsMenu', 'SettingsMenuViewModel'], SettingsMenuViewModel); + _.extend(SettingsMenuViewModel.prototype, KnoinAbstractViewModel.prototype); SettingsMenuViewModel.prototype.link = function (sRoute) { diff --git a/dev/ViewModels/SettingsPaneViewModel.js b/dev/ViewModels/SettingsPaneViewModel.js index e1fe48480..86ca294e5 100644 --- a/dev/ViewModels/SettingsPaneViewModel.js +++ b/dev/ViewModels/SettingsPaneViewModel.js @@ -1,10 +1,10 @@ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { 'use strict'; var + _ = require('_'), key = require('key'), Enums = require('Enums'), @@ -27,7 +27,8 @@ kn.constructorEnd(this); } - kn.extendAsViewModel('SettingsPaneViewModel', SettingsPaneViewModel); + kn.extendAsViewModel(['View:RainLoop:SettingsPane', 'SettingsPaneViewModel'], SettingsPaneViewModel); + _.extend(SettingsPaneViewModel.prototype, KnoinAbstractViewModel.prototype); SettingsPaneViewModel.prototype.onBuild = function () { diff --git a/dev/ViewModels/SettingsSystemDropDownViewModel.js b/dev/ViewModels/SettingsSystemDropDownViewModel.js index 4b59ba4e8..3a79515c4 100644 --- a/dev/ViewModels/SettingsSystemDropDownViewModel.js +++ b/dev/ViewModels/SettingsSystemDropDownViewModel.js @@ -1,10 +1,11 @@ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { 'use strict'; var + _ = require('_'), + kn = require('App:Knoin'), AbstractSystemDropDownViewModel = require('View:RainLoop:AbstractSystemDropDown') ; @@ -19,7 +20,8 @@ kn.constructorEnd(this); } - kn.extendAsViewModel('SettingsSystemDropDownViewModel', SettingsSystemDropDownViewModel, AbstractSystemDropDownViewModel); + kn.extendAsViewModel(['View:RainLoop:SettingsSystemDropDown', 'SettingsSystemDropDownViewModel'], SettingsSystemDropDownViewModel); + _.extend(SettingsSystemDropDownViewModel.prototype, AbstractSystemDropDownViewModel.prototype); module.exports = SettingsSystemDropDownViewModel; diff --git a/gulpfile.js b/gulpfile.js index 2a314e81f..3547da056 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -240,7 +240,9 @@ gulp.task('js:app', function() { var browserify = require('browserify'), - source = require('vinyl-source-stream') +// exorcist = require('exorcist'), + source = require('vinyl-source-stream'), + buffer = require('vinyl-buffer') ; return browserify({ @@ -250,7 +252,10 @@ gulp.task('js:app', function() { 'debug': false }) .bundle() +// .pipe(exorcist(cfg.paths.staticJS + cfg.paths.js.app.name + '.map')) .pipe(source(cfg.paths.js.app.name)) + .pipe(buffer()) + .pipe(header('/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */\n')) .pipe(gulp.dest(cfg.paths.staticJS)) .on('error', gutil.log); }); @@ -259,7 +264,9 @@ gulp.task('js:admin', function() { var browserify = require('browserify'), - source = require('vinyl-source-stream') +// exorcist = require('exorcist'), + source = require('vinyl-source-stream'), + buffer = require('vinyl-buffer') ; return browserify({ @@ -269,7 +276,10 @@ gulp.task('js:admin', function() { 'debug': false }) .bundle() +// .pipe(exorcist(cfg.paths.staticJS + cfg.paths.js.admin.name + '.map')) .pipe(source(cfg.paths.js.admin.name)) + .pipe(buffer()) + .pipe(header('/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */\n')) .pipe(gulp.dest(cfg.paths.staticJS)) .on('error', gutil.log); }); @@ -279,6 +289,7 @@ gulp.task('js:app:min', ['js:app'], function() { return gulp.src(cfg.paths.staticJS + cfg.paths.js.app.name) .pipe(uglify(cfg.uglify)) .pipe(rename({suffix: '.min'})) + .pipe(header('/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */\n')) .pipe(gulp.dest(cfg.paths.staticJS)) .on('error', gutil.log); }); @@ -287,6 +298,7 @@ gulp.task('js:admin:min', ['js:admin'], function() { return gulp.src(cfg.paths.staticJS + cfg.paths.js.admin.name) .pipe(uglify(cfg.uglify)) .pipe(rename({suffix: '.min'})) + .pipe(header('/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */\n')) .pipe(gulp.dest(cfg.paths.staticJS)) .on('error', gutil.log); }); diff --git a/package.json b/package.json index ab2f551a5..f7a3b7ecd 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "RainLoop", "title": "RainLoop Webmail", "version": "1.6.9", - "release": "161", + "release": "163", "description": "Simple, modern & fast web-based email client", "homepage": "http://rainloop.net", "main": "gulpfile.js", @@ -107,7 +107,7 @@ "Storage:Admin:Remote": "./dev/Storages/AdminRemoteStorage.js", "Storage:Admin:Data": "./dev/Storages/AdminDataStorage.js", - "Screen:AbstractSettings": "./dev/Screens/AbstractSettings.js", + "Screen:AbstractSettings": "./dev/Screens/AbstractSettingsScreen.js", "Screen:RainLoop:Login": "./dev/Screens/LoginScreen.js", "Screen:RainLoop:About": "./dev/Screens/AboutScreen.js", "Screen:RainLoop:MailBox": "./dev/Screens/MailBoxScreen.js", @@ -183,7 +183,9 @@ "jshint-summary": "*", "browserify": "*", + "exorcist": "*", "vinyl-source-stream": "*", + "vinyl-buffer": "*", "gulp": "*", "gulp-util": "*", diff --git a/plugins/recaptcha/js/recaptcha.js b/plugins/recaptcha/js/recaptcha.js index 8ba5ca094..742ee9444 100644 --- a/plugins/recaptcha/js/recaptcha.js +++ b/plugins/recaptcha/js/recaptcha.js @@ -1,10 +1,11 @@ $(function () { - - var + + var + bStarted = false, bShown = false ; - + function ShowRecaptcha() { if (window.Recaptcha) @@ -24,7 +25,7 @@ $(function () { bShown = true; } } - + function StartRecaptcha() { if (!window.Recaptcha) @@ -36,36 +37,40 @@ $(function () { ShowRecaptcha(); } } - - window.rl.addHook('view-model-on-show', function (sName, oViewModel) { - if ('LoginViewModel' === sName && oViewModel && window.rl.pluginSettingsGet('recaptcha', 'show_captcha_on_login')) - { - StartRecaptcha(); - } - }); - - window.rl.addHook('ajax-default-request', function (sAction, oParameters) { - if ('Login' === sAction && oParameters && bShown && window.Recaptcha) - { - oParameters['RecaptchaChallenge'] = window.Recaptcha.get_challenge(); - oParameters['RecaptchaResponse'] = window.Recaptcha.get_response(); - } - }); - window.rl.addHook('ajax-default-response', function (sAction, oData, sType) { - if ('Login' === sAction) - { - if (!oData || 'success' !== sType || !oData['Result']) + if (window.rl) + { + window.rl.addHook('view-model-on-show', function (sName, oViewModel) { + if (!bStarted && ('View:RainLoop:Login' === sName || 'LoginViewModel' === sName) && oViewModel && window.rl.pluginSettingsGet('recaptcha', 'show_captcha_on_login')) { - if (bShown && window.Recaptcha) + bStarted = true; + StartRecaptcha(); + } + }); + + window.rl.addHook('ajax-default-request', function (sAction, oParameters) { + if ('Login' === sAction && oParameters && bShown && window.Recaptcha) + { + oParameters['RecaptchaChallenge'] = window.Recaptcha.get_challenge(); + oParameters['RecaptchaResponse'] = window.Recaptcha.get_response(); + } + }); + + window.rl.addHook('ajax-default-response', function (sAction, oData, sType) { + if ('Login' === sAction) + { + if (!oData || 'success' !== sType || !oData['Result']) { - window.Recaptcha.reload(); - } - else if (oData && oData['Captcha']) - { - StartRecaptcha(); + if (bShown && window.Recaptcha) + { + window.Recaptcha.reload(); + } + else if (oData && oData['Captcha']) + { + StartRecaptcha(); + } } } - } - }); + }); + } }); \ No newline at end of file diff --git a/rainloop/v/0.0.0/app/templates/Views/App/MailMessageView.html b/rainloop/v/0.0.0/app/templates/Views/App/MailMessageView.html index 3e6dd9b82..3c6ae2625 100644 --- a/rainloop/v/0.0.0/app/templates/Views/App/MailMessageView.html +++ b/rainloop/v/0.0.0/app/templates/Views/App/MailMessageView.html @@ -150,7 +150,7 @@
- + @@ -187,10 +187,16 @@
-
- : -   - +
+
+ : +   + +
+
+ +
+
: diff --git a/rainloop/v/0.0.0/app/templates/Views/App/PopupsCompose.html b/rainloop/v/0.0.0/app/templates/Views/App/PopupsCompose.html index 49497f0bb..50e620334 100644 --- a/rainloop/v/0.0.0/app/templates/Views/App/PopupsCompose.html +++ b/rainloop/v/0.0.0/app/templates/Views/App/PopupsCompose.html @@ -122,7 +122,7 @@ -
  • +
  • @@ -150,7 +150,7 @@
  • - +
    diff --git a/rainloop/v/0.0.0/static/css/app.css b/rainloop/v/0.0.0/static/css/app.css index 5fee38042..6bf1bc69f 100644 --- a/rainloop/v/0.0.0/static/css/app.css +++ b/rainloop/v/0.0.0/static/css/app.css @@ -637,7 +637,7 @@ filter: Alpha(Opacity=30); } - + /*! normalize.css 2012-03-11T12:53 UTC - http://github.com/necolas/normalize.css */ /* ============================================================================= @@ -1150,7 +1150,7 @@ table { border-spacing: 0; border-collapse: collapse; } - + @charset "UTF-8"; @font-face { @@ -1522,7 +1522,7 @@ table { .icon-resize-out:before { content: "\e06d"; } - + /** initial setup **/ .nano { /* @@ -1638,7 +1638,7 @@ table { .nano > .pane2.active > .slider2 { background-color: rgba(0, 0, 0, 0.4); } - + /* Magnific Popup CSS */ .mfp-bg { position: fixed; @@ -2094,7 +2094,7 @@ img.mfp-img { padding-top: 0; } - + /* overlay at start */ .mfp-fade.mfp-bg { @@ -2135,7 +2135,7 @@ img.mfp-img { -ms-transform: translateX(50px); transform: translateX(50px); } - + .simple-pace { pointer-events: none; @@ -2210,7 +2210,7 @@ img.mfp-img { transform: translate(-32px, 0); transform: translate(-32px, 0); } -} +} .inputosaurus-container { display: inline-block; margin: 0 5px 0 0; @@ -2275,7 +2275,7 @@ img.mfp-img { .inputosaurus-input-hidden { display: none; } - + .flag-wrapper { display: inline-block; width: 24px; @@ -2401,7 +2401,7 @@ img.mfp-img { .flag.flag-zh-cn, .flag.flag-zh-hk { background-position: -208px -22px; -} +} /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ .clearfix { *zoom: 1; diff --git a/rainloop/v/0.0.0/static/js/admin.js b/rainloop/v/0.0.0/static/js/admin.js index 3d0dec585..35d9e9461 100644 --- a/rainloop/v/0.0.0/static/js/admin.js +++ b/rainloop/v/0.0.0/static/js/admin.js @@ -1,21 +1,19 @@ -(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o') - .insertBefore($self) - .click(function () { - $self.toggleClass('hidden-bq'); - Utils.windowResize(); - }) - .after('
    ') - .before('
    ') - ; - } - }); - } - } - }; - - /** - * @param {Object} oMessageTextBody - */ - Utils.removeBlockquoteSwitcher = function (oMessageTextBody) - { - if (oMessageTextBody) - { - $(oMessageTextBody).find('blockquote.rl-bq-switcher').each(function () { - $(this).removeClass('rl-bq-switcher hidden-bq'); - }); - - $(oMessageTextBody).find('.rlBlockquoteSwitcher').each(function () { - $(this).remove(); - }); - } - }; - - /** - * @param {Object} oMessageTextBody - */ - Utils.toggleMessageBlockquote = function (oMessageTextBody) - { - if (oMessageTextBody) - { - oMessageTextBody.find('.rlBlockquoteSwitcher').click(); - } - }; - Utils.convertThemeName = function (sTheme) { if ('@custom' === sTheme.substr(-7)) @@ -3256,7 +3223,7 @@ sTheme = Utils.trim(sTheme.substring(0, sTheme.length - 7)); } - return Utils.trim(sTheme.replace(/[^a-zA-Z]+/g, ' ').replace(/([A-Z])/g, ' $1').replace(/[\s]+/g, ' ')); + return Utils.trim(sTheme.replace(/[^a-zA-Z0-9]+/g, ' ').replace(/([A-Z])/g, ' $1').replace(/[\s]+/g, ' ')); }; /** @@ -3309,14 +3276,10 @@ return sResult; }; - /* jshint ignore:start */ /** - * @param {string} s + * @param {string} sPlain * @return {string} */ - Utils.md5 = function(s){function L(k,d){return(k<>>(32-d))}function K(G,k){var I,d,F,H,x;F=(G&2147483648);H=(k&2147483648);I=(G&1073741824);d=(k&1073741824);x=(G&1073741823)+(k&1073741823);if(I&d){return(x^2147483648^F^H)}if(I|d){if(x&1073741824){return(x^3221225472^F^H)}else{return(x^1073741824^F^H)}}else{return(x^F^H)}}function r(d,F,k){return(d&F)|((~d)&k)}function q(d,F,k){return(d&k)|(F&(~k))}function p(d,F,k){return(d^F^k)}function n(d,F,k){return(F^(d|(~k)))}function u(G,F,aa,Z,k,H,I){G=K(G,K(K(r(F,aa,Z),k),I));return K(L(G,H),F)}function f(G,F,aa,Z,k,H,I){G=K(G,K(K(q(F,aa,Z),k),I));return K(L(G,H),F)}function D(G,F,aa,Z,k,H,I){G=K(G,K(K(p(F,aa,Z),k),I));return K(L(G,H),F)}function t(G,F,aa,Z,k,H,I){G=K(G,K(K(n(F,aa,Z),k),I));return K(L(G,H),F)}function e(G){var Z;var F=G.length;var x=F+8;var k=(x-(x%64))/64;var I=(k+1)*16;var aa=Array(I-1);var d=0;var H=0;while(H>>29;return aa}function B(x){var k="",F="",G,d;for(d=0;d<=3;d++){G=(x>>>(d*8))&255;F="0"+G.toString(16);k=k+F.substr(F.length-2,2)}return k}function J(k){k=k.replace(/rn/g,"n");var d="";for(var F=0;F127)&&(x<2048)){d+=String.fromCharCode((x>>6)|192);d+=String.fromCharCode((x&63)|128)}else{d+=String.fromCharCode((x>>12)|224);d+=String.fromCharCode(((x>>6)&63)|128);d+=String.fromCharCode((x&63)|128)}}}return d}var C=Array();var P,h,E,v,g,Y,X,W,V;var S=7,Q=12,N=17,M=22;var A=5,z=9,y=14,w=20;var o=4,m=11,l=16,j=23;var U=6,T=10,R=15,O=21;s=J(s);C=e(s);Y=1732584193;X=4023233417;W=2562383102;V=271733878;for(P=0;P ').appendTo('#rl-hidden'); }; - Utils.defautOptionsAfterRender = function (oOption, oItem) + Utils.defautOptionsAfterRender = function (oDomOption, oItem) { - if (oItem && !Utils.isUnd(oItem.disabled) && oOption) + if (oItem && !Utils.isUnd(oItem.disabled) && oDomOption) { - $(oOption) + $(oDomOption) .toggleClass('disabled', oItem.disabled) .prop('disabled', oItem.disabled) ; @@ -3394,10 +3357,18 @@ oWin.document.getElementsByTagName('head')[0].appendChild(oScript); }; + /** + * @param {Function} fCallback + * @param {?} koTrigger + * @param {?} oContext = null + * @param {number=} iTimer = 1000 + * @return {Function} + */ Utils.settingsSaveHelperFunction = function (fCallback, koTrigger, oContext, iTimer) { oContext = oContext || null; iTimer = Utils.isUnd(iTimer) ? 1000 : Utils.pInt(iTimer); + return function (sType, mData, bCached, sRequestAction, oRequestParameters) { koTrigger.call(oContext, mData && mData['Result'] ? Enums.SaveSettingsStep.TrueResult : Enums.SaveSettingsStep.FalseResult); if (fCallback) @@ -3671,6 +3642,11 @@ return sHtml; }; + /** + * @param {string} sUrl + * @param {number} iValue + * @param {Function} fCallback + */ Utils.resizeAndCrop = function (sUrl, iValue, fCallback) { var oTempImg = new window.Image(); @@ -3836,6 +3812,7 @@ Utils.computedPagenatorHelper = function (koCurrentPage, koPageCount) { return function() { + var iPrev = 0, iNext = 0, @@ -3846,8 +3823,8 @@ /** * @param {number} iIndex - * @param {boolean=} bPush - * @param {string=} sCustomName + * @param {boolean=} bPush = true + * @param {string=} sCustomName = '' */ fAdd = function (iIndex, bPush, sCustomName) { @@ -3949,22 +3926,21 @@ Utils.selectElement = function (element) { - /* jshint onevar: false */ + var sel, range; if (window.getSelection) { - var sel = window.getSelection(); + sel = window.getSelection(); sel.removeAllRanges(); - var range = window.document.createRange(); + range = window.document.createRange(); range.selectNodeContents(element); sel.addRange(range); } else if (window.document.selection) { - var textRange = window.document.body.createTextRange(); - textRange.moveToElementText(element); - textRange.select(); + range = window.document.body.createTextRange(); + range.moveToElementText(element); + range.select(); } - /* jshint onevar: true */ }; Utils.detectDropdownVisibility = _.debounce(function () { @@ -3973,13 +3949,16 @@ })); }, 50); + /** + * @param {boolean=} bDelay = false + */ Utils.triggerAutocompleteInputChange = function (bDelay) { var fFunc = function () { $('.checkAutocomplete').trigger('change'); }; - if (bDelay) + if (Utils.isUnd(bDelay) ? false : !!bDelay) { _.delay(fFunc, 100); } @@ -3992,33 +3971,20 @@ module.exports = Utils; }(module, require)); -},{"$":15,"Consts":5,"Enums":6,"Globals":8,"_":20,"ko":17,"window":21}],12:[function(require,module,exports){ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ - -module.exports = JSON; -},{}],13:[function(require,module,exports){ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ - +},{"$":14,"App:Knoin":21,"Consts":5,"Enums":6,"Globals":8,"Model:Email":26,"_":19,"ko":16,"window":20}],12:[function(require,module,exports){ module.exports = crossroads; -},{}],14:[function(require,module,exports){ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ - +},{}],13:[function(require,module,exports){ module.exports = hasher; -},{}],15:[function(require,module,exports){ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ - +},{}],14:[function(require,module,exports){ module.exports = $; -},{}],16:[function(require,module,exports){ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ - +},{}],15:[function(require,module,exports){ module.exports = key; -},{}],17:[function(require,module,exports){ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ +},{}],16:[function(require,module,exports){ (function (module, ko) { 'use strict'; - + var window = require('window'), _ = require('_'), @@ -4920,41 +4886,30 @@ module.exports = key; }(module, ko)); -},{"$":15,"Globals":8,"Model:ContactTag":27,"Model:Email":28,"Utils":11,"_":20,"window":21}],18:[function(require,module,exports){ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ - +},{"$":14,"Globals":8,"Model:ContactTag":25,"Model:Email":26,"Utils":11,"_":19,"window":20}],17:[function(require,module,exports){ module.exports = moment; -},{}],19:[function(require,module,exports){ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ - +},{}],18:[function(require,module,exports){ module.exports = ssm; -},{}],20:[function(require,module,exports){ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ - +},{}],19:[function(require,module,exports){ module.exports = _; -},{}],21:[function(require,module,exports){ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ - +},{}],20:[function(require,module,exports){ module.exports = window; -},{}],22:[function(require,module,exports){ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ +},{}],21:[function(require,module,exports){ (function (module, require) { - + 'use strict'; var - $ = require('$'), _ = require('_'), + $ = require('$'), ko = require('ko'), hasher = require('hasher'), crossroads = require('crossroads'), Globals = require('Globals'), Plugins = require('Plugins'), - Utils = require('Utils'), - - KnoinAbstractViewModel = require('Knoin:AbstractViewModel') + Utils = require('Utils') ; /** @@ -4988,22 +4943,23 @@ module.exports = window; }; /** - * @param {string} sName + * @param {string|Array} mName * @param {Function} ViewModelClass - * @param {Function=} AbstractViewModel = KnoinAbstractViewModel */ - Knoin.prototype.extendAsViewModel = function (sName, ViewModelClass, AbstractViewModel) + Knoin.prototype.extendAsViewModel = function (mName, ViewModelClass) { if (ViewModelClass) { - if (!AbstractViewModel) + if (Utils.isArray(mName)) { - AbstractViewModel = KnoinAbstractViewModel; + ViewModelClass.__names = mName; + } + else + { + ViewModelClass.__names = [mName]; } - ViewModelClass.__name = sName; - Plugins.regViewModelHook(sName, ViewModelClass); - _.extend(ViewModelClass.prototype, AbstractViewModel.prototype); + ViewModelClass.__name = ViewModelClass.__names[0]; } }; @@ -5081,6 +5037,7 @@ module.exports = window; ViewModelClass.__vm = oViewModel; oViewModel.viewModelName = ViewModelClass.__name; + oViewModel.viewModelNames = ViewModelClass.__names; if (oViewModelPlace && 1 === oViewModelPlace.length) { @@ -5114,6 +5071,10 @@ module.exports = window; Utils.delegateRun(this, 'onHide'); this.restoreKeyScope(); + _.each(this.viewModelNames, function (sName) { + Plugins.runHook('view-model-on-hide', [sName, self]); + }); + Globals.popupVisibilityNames.remove(this.viewModelName); oViewModel.viewModelDom.css('z-index', 2000); @@ -5127,7 +5088,9 @@ module.exports = window; }, oViewModel); } - Plugins.runHook('view-model-pre-build', [ViewModelClass.__name, oViewModel, oViewModelDom]); + _.each(ViewModelClass.__names, function (sName) { + Plugins.runHook('view-model-pre-build', [sName, oViewModel, oViewModelDom]); + }); ko.applyBindingAccessorsToNode(oViewModelDom[0], { 'i18nInit': true, @@ -5140,14 +5103,16 @@ module.exports = window; oViewModel.registerPopupKeyDown(); } - Plugins.runHook('view-model-post-build', [ViewModelClass.__name, oViewModel, oViewModelDom]); + _.each(ViewModelClass.__names, function (sName) { + Plugins.runHook('view-model-post-build', [sName, oViewModel, oViewModelDom]); + }); } else { Utils.log('Cannot find view model position: ' + sPosition); } } - + return ViewModelClass ? ViewModelClass.__vm : null; }; @@ -5159,7 +5124,6 @@ module.exports = window; if (ViewModelClassToHide && ViewModelClassToHide.__vm && ViewModelClassToHide.__dom) { ViewModelClassToHide.__vm.modalVisibility(false); - Plugins.runHook('view-model-on-hide', [ViewModelClassToHide.__name, ViewModelClassToHide.__vm]); } }; @@ -5177,7 +5141,10 @@ module.exports = window; { ViewModelClassToShow.__vm.modalVisibility(true); Utils.delegateRun(ViewModelClassToShow.__vm, 'onShow', aParameters || []); - Plugins.runHook('view-model-on-show', [ViewModelClassToShow.__name, ViewModelClassToShow.__vm, aParameters || []]); + + _.each(ViewModelClassToShow.__names, function (sName) { + Plugins.runHook('view-model-on-show', [sName, ViewModelClassToShow.__vm, aParameters || []]); + }); } } }; @@ -5279,10 +5246,13 @@ module.exports = window; { ViewModelClass.__dom.show(); ViewModelClass.__vm.viewModelVisibility(true); + Utils.delegateRun(ViewModelClass.__vm, 'onShow'); Utils.delegateRun(ViewModelClass.__vm, 'onFocus', [], 200); - Plugins.runHook('view-model-on-show', [ViewModelClass.__name, ViewModelClass.__vm]); + _.each(ViewModelClass.__names, function (sName) { + Plugins.runHook('view-model-on-show', [sName, ViewModelClass.__vm]); + }); } }, self); @@ -5386,11 +5356,10 @@ module.exports = window; module.exports = new Knoin(); }(module, require)); -},{"$":15,"Globals":8,"Knoin:AbstractViewModel":25,"Plugins":10,"Utils":11,"_":20,"crossroads":13,"hasher":14,"ko":17}],23:[function(require,module,exports){ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ +},{"$":14,"Globals":8,"Plugins":10,"Utils":11,"_":19,"crossroads":12,"hasher":13,"ko":16}],22:[function(require,module,exports){ (function (module) { - + 'use strict'; /** @@ -5409,15 +5378,16 @@ module.exports = window; module.exports = KnoinAbstractBoot; }(module, require)); -},{}],24:[function(require,module,exports){ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ +},{}],23:[function(require,module,exports){ (function (module, require) { 'use strict'; var + _ = require('_'), crossroads = require('crossroads'), + Utils = require('Utils') ; @@ -5500,8 +5470,7 @@ module.exports = window; module.exports = KnoinAbstractScreen; }(module, require)); -},{"Utils":11,"crossroads":13}],25:[function(require,module,exports){ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ +},{"Utils":11,"_":19,"crossroads":12}],24:[function(require,module,exports){ (function (module, require) { @@ -5511,14 +5480,14 @@ module.exports = window; ko = require('ko'), Enums = require('Enums'), - Globals = require('Globals'), - Utils = require('Utils') + Utils = require('Utils'), + Globals = require('Globals') ; /** + * @constructor * @param {string=} sPosition = '' * @param {string=} sTemplate = '' - * @constructor */ function KnoinAbstractViewModel(sPosition, sTemplate) { @@ -5529,13 +5498,19 @@ module.exports = window; this.sDefaultKeyScope = Enums.KeyState.None; this.sCurrentKeyScope = this.sDefaultKeyScope; - this.viewModelName = ''; this.viewModelVisibility = ko.observable(false); this.modalVisibility = ko.observable(false).extend({'rateLimit': 0}); + this.viewModelName = ''; + this.viewModelNames = []; this.viewModelDom = null; } + /** + * @type {boolean} + */ + KnoinAbstractViewModel.prototype.bDisabeCloseOnEsc = false; + /** * @type {string} */ @@ -5546,11 +5521,26 @@ module.exports = window; */ KnoinAbstractViewModel.prototype.sTemplate = ''; + /** + * @type {string} + */ + KnoinAbstractViewModel.prototype.sDefaultKeyScope = Enums.KeyState.None; + + /** + * @type {string} + */ + KnoinAbstractViewModel.prototype.sCurrentKeyScope = Enums.KeyState.None; + /** * @type {string} */ KnoinAbstractViewModel.prototype.viewModelName = ''; + /** + * @type {Array} + */ + KnoinAbstractViewModel.prototype.viewModelNames = []; + /** * @type {?} */ @@ -5611,268 +5601,15 @@ module.exports = window; module.exports = KnoinAbstractViewModel; }(module, require)); -},{"Enums":6,"Globals":8,"Utils":11,"ko":17}],26:[function(require,module,exports){ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ +},{"Enums":6,"Globals":8,"Utils":11,"ko":16}],25:[function(require,module,exports){ (function (module, require) { 'use strict'; - - var - window = require('window'), - Globals = require('Globals'), - Utils = require('Utils'), - LinkBuilder = require('LinkBuilder') - ; - /** - * @constructor - */ - function AttachmentModel() - { - this.mimeType = ''; - this.fileName = ''; - this.estimatedSize = 0; - this.friendlySize = ''; - this.isInline = false; - this.isLinked = false; - this.cid = ''; - this.cidWithOutTags = ''; - this.contentLocation = ''; - this.download = ''; - this.folder = ''; - this.uid = ''; - this.mimeIndex = ''; - } - - /** - * @static - * @param {AjaxJsonAttachment} oJsonAttachment - * @return {?AttachmentModel} - */ - AttachmentModel.newInstanceFromJson = function (oJsonAttachment) - { - var oAttachmentModel = new AttachmentModel(); - return oAttachmentModel.initByJson(oJsonAttachment) ? oAttachmentModel : null; - }; - - AttachmentModel.prototype.mimeType = ''; - AttachmentModel.prototype.fileName = ''; - AttachmentModel.prototype.estimatedSize = 0; - AttachmentModel.prototype.friendlySize = ''; - AttachmentModel.prototype.isInline = false; - AttachmentModel.prototype.isLinked = false; - AttachmentModel.prototype.cid = ''; - AttachmentModel.prototype.cidWithOutTags = ''; - AttachmentModel.prototype.contentLocation = ''; - AttachmentModel.prototype.download = ''; - AttachmentModel.prototype.folder = ''; - AttachmentModel.prototype.uid = ''; - AttachmentModel.prototype.mimeIndex = ''; - - /** - * @param {AjaxJsonAttachment} oJsonAttachment - */ - AttachmentModel.prototype.initByJson = function (oJsonAttachment) - { - var bResult = false; - if (oJsonAttachment && 'Object/Attachment' === oJsonAttachment['@Object']) - { - this.mimeType = (oJsonAttachment.MimeType || '').toLowerCase(); - this.fileName = oJsonAttachment.FileName; - this.estimatedSize = Utils.pInt(oJsonAttachment.EstimatedSize); - this.isInline = !!oJsonAttachment.IsInline; - this.isLinked = !!oJsonAttachment.IsLinked; - this.cid = oJsonAttachment.CID; - this.contentLocation = oJsonAttachment.ContentLocation; - this.download = oJsonAttachment.Download; - - this.folder = oJsonAttachment.Folder; - this.uid = oJsonAttachment.Uid; - this.mimeIndex = oJsonAttachment.MimeIndex; - - this.friendlySize = Utils.friendlySize(this.estimatedSize); - this.cidWithOutTags = this.cid.replace(/^<+/, '').replace(/>+$/, ''); - - bResult = true; - } - - return bResult; - }; - - /** - * @return {boolean} - */ - AttachmentModel.prototype.isImage = function () - { - return -1 < Utils.inArray(this.mimeType.toLowerCase(), - ['image/png', 'image/jpg', 'image/jpeg', 'image/gif'] - ); - }; - - /** - * @return {boolean} - */ - AttachmentModel.prototype.isText = function () - { - return 'text/' === this.mimeType.substr(0, 5) && - -1 === Utils.inArray(this.mimeType, ['text/html']); - }; - - /** - * @return {boolean} - */ - AttachmentModel.prototype.isPdf = function () - { - return Globals.bAllowPdfPreview && 'application/pdf' === this.mimeType; - }; - - /** - * @return {string} - */ - AttachmentModel.prototype.linkDownload = function () - { - return LinkBuilder.attachmentDownload(this.download); - }; - - /** - * @return {string} - */ - AttachmentModel.prototype.linkPreview = function () - { - return LinkBuilder.attachmentPreview(this.download); - }; - - /** - * @return {string} - */ - AttachmentModel.prototype.linkPreviewAsPlain = function () - { - return LinkBuilder.attachmentPreviewAsPlain(this.download); - }; - - /** - * @return {string} - */ - AttachmentModel.prototype.generateTransferDownloadUrl = function () - { - var sLink = this.linkDownload(); - if ('http' !== sLink.substr(0, 4)) - { - sLink = window.location.protocol + '//' + window.location.host + window.location.pathname + sLink; - } - - return this.mimeType + ':' + this.fileName + ':' + sLink; - }; - - /** - * @param {AttachmentModel} oAttachment - * @param {*} oEvent - * @return {boolean} - */ - AttachmentModel.prototype.eventDragStart = function (oAttachment, oEvent) - { - var oLocalEvent = oEvent.originalEvent || oEvent; - if (oAttachment && oLocalEvent && oLocalEvent.dataTransfer && oLocalEvent.dataTransfer.setData) - { - oLocalEvent.dataTransfer.setData('DownloadURL', this.generateTransferDownloadUrl()); - } - - return true; - }; - - AttachmentModel.prototype.iconClass = function () - { - var - aParts = this.mimeType.toLocaleString().split('/'), - sClass = 'icon-file' - ; - - if (aParts && aParts[1]) - { - if ('image' === aParts[0]) - { - sClass = 'icon-file-image'; - } - else if ('text' === aParts[0]) - { - sClass = 'icon-file-text'; - } - else if ('audio' === aParts[0]) - { - sClass = 'icon-file-music'; - } - else if ('video' === aParts[0]) - { - sClass = 'icon-file-movie'; - } - else if (-1 < Utils.inArray(aParts[1], - ['zip', '7z', 'tar', 'rar', 'gzip', 'bzip', 'bzip2', 'x-zip', 'x-7z', 'x-rar', 'x-tar', 'x-gzip', 'x-bzip', 'x-bzip2', 'x-zip-compressed', 'x-7z-compressed', 'x-rar-compressed'])) - { - sClass = 'icon-file-zip'; - } - // else if (-1 < Utils.inArray(aParts[1], - // ['pdf', 'x-pdf'])) - // { - // sClass = 'icon-file-pdf'; - // } - // else if (-1 < Utils.inArray(aParts[1], [ - // 'exe', 'x-exe', 'x-winexe', 'bat' - // ])) - // { - // sClass = 'icon-console'; - // } - else if (-1 < Utils.inArray(aParts[1], [ - 'rtf', 'msword', 'vnd.msword', 'vnd.openxmlformats-officedocument.wordprocessingml.document', - 'vnd.openxmlformats-officedocument.wordprocessingml.template', - 'vnd.ms-word.document.macroEnabled.12', - 'vnd.ms-word.template.macroEnabled.12' - ])) - { - sClass = 'icon-file-text'; - } - else if (-1 < Utils.inArray(aParts[1], [ - 'excel', 'ms-excel', 'vnd.ms-excel', - 'vnd.openxmlformats-officedocument.spreadsheetml.sheet', - 'vnd.openxmlformats-officedocument.spreadsheetml.template', - 'vnd.ms-excel.sheet.macroEnabled.12', - 'vnd.ms-excel.template.macroEnabled.12', - 'vnd.ms-excel.addin.macroEnabled.12', - 'vnd.ms-excel.sheet.binary.macroEnabled.12' - ])) - { - sClass = 'icon-file-excel'; - } - else if (-1 < Utils.inArray(aParts[1], [ - 'powerpoint', 'ms-powerpoint', 'vnd.ms-powerpoint', - 'vnd.openxmlformats-officedocument.presentationml.presentation', - 'vnd.openxmlformats-officedocument.presentationml.template', - 'vnd.openxmlformats-officedocument.presentationml.slideshow', - 'vnd.ms-powerpoint.addin.macroEnabled.12', - 'vnd.ms-powerpoint.presentation.macroEnabled.12', - 'vnd.ms-powerpoint.template.macroEnabled.12', - 'vnd.ms-powerpoint.slideshow.macroEnabled.12' - ])) - { - sClass = 'icon-file-chart-graph'; - } - } - - return sClass; - }; - - module.exports = AttachmentModel; - -}(module, require)); -},{"Globals":8,"LinkBuilder":9,"Utils":11,"window":21}],27:[function(require,module,exports){ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ - -(function (module, require) { - - 'use strict'; - var ko = require('ko'), + Utils = require('Utils') ; @@ -5923,15 +5660,13 @@ module.exports = window; module.exports = ContactTagModel; }(module, require)); -},{"Utils":11,"ko":17}],28:[function(require,module,exports){ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ +},{"Utils":11,"ko":16}],26:[function(require,module,exports){ (function (module, require) { - + 'use strict'; var - Enums = require('Enums'), Utils = require('Utils') ; @@ -5945,7 +5680,6 @@ module.exports = window; { this.email = sEmail || ''; this.name = sName || ''; - this.privateType = null; this.clearDuplicateName(); } @@ -5971,16 +5705,10 @@ module.exports = window; */ EmailModel.prototype.email = ''; - /** - * @type {(number|null)} - */ - EmailModel.prototype.privateType = null; - EmailModel.prototype.clear = function () { this.email = ''; this.name = ''; - this.privateType = null; }; /** @@ -6008,27 +5736,6 @@ module.exports = window; } }; - /** - * @return {number} - */ - EmailModel.prototype.type = function () - { - if (null === this.privateType) - { - if (this.email && '@facebook.com' === this.email.substr(-13)) - { - this.privateType = Enums.EmailType.Facebook; - } - - if (null === this.privateType) - { - this.privateType = Enums.EmailType.Default; - } - } - - return this.privateType; - }; - /** * @param {string} sQuery * @return {boolean} @@ -6302,1303 +6009,15 @@ module.exports = window; module.exports = EmailModel; }(module, require)); -},{"Enums":6,"Utils":11}],29:[function(require,module,exports){ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ +},{"Utils":11}],27:[function(require,module,exports){ (function (module, require) { 'use strict'; var - window = require('window'), - $ = require('$'), _ = require('_'), - ko = require('ko'), - moment = require('moment'), - - Enums = require('Enums'), - Utils = require('Utils'), - Globals = require('Globals'), - LinkBuilder = require('LinkBuilder'), - - EmailModel = require('Model:Email'), - AttachmentModel = require('Model:Attachment') - ; - - /** - * @constructor - */ - function MessageModel() - { - this.folderFullNameRaw = ''; - this.uid = ''; - this.hash = ''; - this.requestHash = ''; - this.subject = ko.observable(''); - this.subjectPrefix = ko.observable(''); - this.subjectSuffix = ko.observable(''); - this.size = ko.observable(0); - this.dateTimeStampInUTC = ko.observable(0); - this.priority = ko.observable(Enums.MessagePriority.Normal); - - this.proxy = false; - - this.fromEmailString = ko.observable(''); - this.fromClearEmailString = ko.observable(''); - this.toEmailsString = ko.observable(''); - this.toClearEmailsString = ko.observable(''); - - this.senderEmailsString = ko.observable(''); - this.senderClearEmailsString = ko.observable(''); - - this.emails = []; - - this.from = []; - this.to = []; - this.cc = []; - this.bcc = []; - this.replyTo = []; - this.deliveredTo = []; - - this.newForAnimation = ko.observable(false); - - this.deleted = ko.observable(false); - this.unseen = ko.observable(false); - this.flagged = ko.observable(false); - this.answered = ko.observable(false); - this.forwarded = ko.observable(false); - this.isReadReceipt = ko.observable(false); - - this.focused = ko.observable(false); - this.selected = ko.observable(false); - this.checked = ko.observable(false); - this.hasAttachments = ko.observable(false); - this.attachmentsMainType = ko.observable(''); - - this.moment = ko.observable(moment(moment.unix(0))); - - this.attachmentIconClass = ko.computed(function () { - var sClass = ''; - if (this.hasAttachments()) - { - sClass = 'icon-attachment'; - switch (this.attachmentsMainType()) - { - case 'image': - sClass = 'icon-image'; - break; - case 'archive': - sClass = 'icon-file-zip'; - break; - case 'doc': - sClass = 'icon-file-text'; - break; - // case 'pdf': - // sClass = 'icon-file-pdf'; - // break; - } - } - return sClass; - }, this); - - this.fullFormatDateValue = ko.computed(function () { - return MessageModel.calculateFullFromatDateValue(this.dateTimeStampInUTC()); - }, this); - - this.momentDate = Utils.createMomentDate(this); - this.momentShortDate = Utils.createMomentShortDate(this); - - this.dateTimeStampInUTC.subscribe(function (iValue) { - var iNow = moment().unix(); - this.moment(moment.unix(iNow < iValue ? iNow : iValue)); - }, this); - - this.body = null; - this.plainRaw = ''; - this.isHtml = ko.observable(false); - this.hasImages = ko.observable(false); - this.attachments = ko.observableArray([]); - - this.isPgpSigned = ko.observable(false); - this.isPgpEncrypted = ko.observable(false); - this.pgpSignedVerifyStatus = ko.observable(Enums.SignedVerifyStatus.None); - this.pgpSignedVerifyUser = ko.observable(''); - - this.priority = ko.observable(Enums.MessagePriority.Normal); - this.readReceipt = ko.observable(''); - - this.aDraftInfo = []; - this.sMessageId = ''; - this.sInReplyTo = ''; - this.sReferences = ''; - - this.parentUid = ko.observable(0); - this.threads = ko.observableArray([]); - this.threadsLen = ko.observable(0); - this.hasUnseenSubMessage = ko.observable(false); - this.hasFlaggedSubMessage = ko.observable(false); - - this.lastInCollapsedThread = ko.observable(false); - this.lastInCollapsedThreadLoading = ko.observable(false); - - this.threadsLenResult = ko.computed(function () { - var iCount = this.threadsLen(); - return 0 === this.parentUid() && 0 < iCount ? iCount + 1 : ''; - }, this); - } - - /** - * @static - * @param {AjaxJsonMessage} oJsonMessage - * @return {?MessageModel} - */ - MessageModel.newInstanceFromJson = function (oJsonMessage) - { - var oMessageModel = new MessageModel(); - return oMessageModel.initByJson(oJsonMessage) ? oMessageModel : null; - }; - - /** - * @static - * @param {number} iTimeStampInUTC - * @return {string} - */ - MessageModel.calculateFullFromatDateValue = function (iTimeStampInUTC) - { - return 0 < iTimeStampInUTC ? moment.unix(iTimeStampInUTC).format('LLL') : ''; - }; - - /** - * @static - * @param {Array} aEmail - * @param {boolean=} bFriendlyView - * @param {boolean=} bWrapWithLink = false - * @return {string} - */ - MessageModel.emailsToLine = function (aEmail, bFriendlyView, bWrapWithLink) - { - var - aResult = [], - iIndex = 0, - iLen = 0 - ; - - if (Utils.isNonEmptyArray(aEmail)) - { - for (iIndex = 0, iLen = aEmail.length; iIndex < iLen; iIndex++) - { - aResult.push(aEmail[iIndex].toLine(bFriendlyView, bWrapWithLink)); - } - } - - return aResult.join(', '); - }; - - /** - * @static - * @param {Array} aEmail - * @return {string} - */ - MessageModel.emailsToLineClear = function (aEmail) - { - var - aResult = [], - iIndex = 0, - iLen = 0 - ; - - if (Utils.isNonEmptyArray(aEmail)) - { - for (iIndex = 0, iLen = aEmail.length; iIndex < iLen; iIndex++) - { - if (aEmail[iIndex] && aEmail[iIndex].email && '' !== aEmail[iIndex].name) - { - aResult.push(aEmail[iIndex].email); - } - } - } - - return aResult.join(', '); - }; - - /** - * @static - * @param {?Array} aJsonEmails - * @return {Array.} - */ - MessageModel.initEmailsFromJson = function (aJsonEmails) - { - var - iIndex = 0, - iLen = 0, - oEmailModel = null, - aResult = [] - ; - - if (Utils.isNonEmptyArray(aJsonEmails)) - { - for (iIndex = 0, iLen = aJsonEmails.length; iIndex < iLen; iIndex++) - { - oEmailModel = EmailModel.newInstanceFromJson(aJsonEmails[iIndex]); - if (oEmailModel) - { - aResult.push(oEmailModel); - } - } - } - - return aResult; - }; - - /** - * @static - * @param {Array.} aMessageEmails - * @param {Object} oLocalUnic - * @param {Array} aLocalEmails - */ - MessageModel.replyHelper = function (aMessageEmails, oLocalUnic, aLocalEmails) - { - if (aMessageEmails && 0 < aMessageEmails.length) - { - var - iIndex = 0, - iLen = aMessageEmails.length - ; - - for (; iIndex < iLen; iIndex++) - { - if (Utils.isUnd(oLocalUnic[aMessageEmails[iIndex].email])) - { - oLocalUnic[aMessageEmails[iIndex].email] = true; - aLocalEmails.push(aMessageEmails[iIndex]); - } - } - } - }; - - MessageModel.prototype.clear = function () - { - this.folderFullNameRaw = ''; - this.uid = ''; - this.hash = ''; - this.requestHash = ''; - this.subject(''); - this.subjectPrefix(''); - this.subjectSuffix(''); - this.size(0); - this.dateTimeStampInUTC(0); - this.priority(Enums.MessagePriority.Normal); - - this.proxy = false; - - this.fromEmailString(''); - this.fromClearEmailString(''); - this.toEmailsString(''); - this.toClearEmailsString(''); - this.senderEmailsString(''); - this.senderClearEmailsString(''); - - this.emails = []; - - this.from = []; - this.to = []; - this.cc = []; - this.bcc = []; - this.replyTo = []; - this.deliveredTo = []; - - this.newForAnimation(false); - - this.deleted(false); - this.unseen(false); - this.flagged(false); - this.answered(false); - this.forwarded(false); - this.isReadReceipt(false); - - this.selected(false); - this.checked(false); - this.hasAttachments(false); - this.attachmentsMainType(''); - - this.body = null; - this.isHtml(false); - this.hasImages(false); - this.attachments([]); - - this.isPgpSigned(false); - this.isPgpEncrypted(false); - this.pgpSignedVerifyStatus(Enums.SignedVerifyStatus.None); - this.pgpSignedVerifyUser(''); - - this.priority(Enums.MessagePriority.Normal); - this.readReceipt(''); - this.aDraftInfo = []; - this.sMessageId = ''; - this.sInReplyTo = ''; - this.sReferences = ''; - - this.parentUid(0); - this.threads([]); - this.threadsLen(0); - this.hasUnseenSubMessage(false); - this.hasFlaggedSubMessage(false); - - this.lastInCollapsedThread(false); - this.lastInCollapsedThreadLoading(false); - }; - - MessageModel.prototype.computeSenderEmail = function () - { - var - Data = require('Storage:RainLoop:Data'), - sSent = Data.sentFolder(), - sDraft = Data.draftFolder() - ; - - this.senderEmailsString(this.folderFullNameRaw === sSent || this.folderFullNameRaw === sDraft ? - this.toEmailsString() : this.fromEmailString()); - - this.senderClearEmailsString(this.folderFullNameRaw === sSent || this.folderFullNameRaw === sDraft ? - this.toClearEmailsString() : this.fromClearEmailString()); - }; - - /** - * @param {AjaxJsonMessage} oJsonMessage - * @return {boolean} - */ - MessageModel.prototype.initByJson = function (oJsonMessage) - { - var bResult = false; - if (oJsonMessage && 'Object/Message' === oJsonMessage['@Object']) - { - this.folderFullNameRaw = oJsonMessage.Folder; - this.uid = oJsonMessage.Uid; - this.hash = oJsonMessage.Hash; - this.requestHash = oJsonMessage.RequestHash; - - this.proxy = !!oJsonMessage.ExternalProxy; - - this.size(Utils.pInt(oJsonMessage.Size)); - - this.from = MessageModel.initEmailsFromJson(oJsonMessage.From); - this.to = MessageModel.initEmailsFromJson(oJsonMessage.To); - this.cc = MessageModel.initEmailsFromJson(oJsonMessage.Cc); - this.bcc = MessageModel.initEmailsFromJson(oJsonMessage.Bcc); - this.replyTo = MessageModel.initEmailsFromJson(oJsonMessage.ReplyTo); - this.deliveredTo = MessageModel.initEmailsFromJson(oJsonMessage.DeliveredTo); - - this.subject(oJsonMessage.Subject); - if (Utils.isArray(oJsonMessage.SubjectParts)) - { - this.subjectPrefix(oJsonMessage.SubjectParts[0]); - this.subjectSuffix(oJsonMessage.SubjectParts[1]); - } - else - { - this.subjectPrefix(''); - this.subjectSuffix(this.subject()); - } - - this.dateTimeStampInUTC(Utils.pInt(oJsonMessage.DateTimeStampInUTC)); - this.hasAttachments(!!oJsonMessage.HasAttachments); - this.attachmentsMainType(oJsonMessage.AttachmentsMainType); - - this.fromEmailString(MessageModel.emailsToLine(this.from, true)); - this.fromClearEmailString(MessageModel.emailsToLineClear(this.from)); - this.toEmailsString(MessageModel.emailsToLine(this.to, true)); - this.toClearEmailsString(MessageModel.emailsToLineClear(this.to)); - - this.parentUid(Utils.pInt(oJsonMessage.ParentThread)); - this.threads(Utils.isArray(oJsonMessage.Threads) ? oJsonMessage.Threads : []); - this.threadsLen(Utils.pInt(oJsonMessage.ThreadsLen)); - - this.initFlagsByJson(oJsonMessage); - this.computeSenderEmail(); - - bResult = true; - } - - return bResult; - }; - - /** - * @param {AjaxJsonMessage} oJsonMessage - * @return {boolean} - */ - MessageModel.prototype.initUpdateByMessageJson = function (oJsonMessage) - { - var - Data = require('Storage:RainLoop:Data'), - bResult = false, - iPriority = Enums.MessagePriority.Normal - ; - - if (oJsonMessage && 'Object/Message' === oJsonMessage['@Object']) - { - iPriority = Utils.pInt(oJsonMessage.Priority); - this.priority(-1 < Utils.inArray(iPriority, [Enums.MessagePriority.High, Enums.MessagePriority.Low]) ? - iPriority : Enums.MessagePriority.Normal); - - this.aDraftInfo = oJsonMessage.DraftInfo; - - this.sMessageId = oJsonMessage.MessageId; - this.sInReplyTo = oJsonMessage.InReplyTo; - this.sReferences = oJsonMessage.References; - - this.proxy = !!oJsonMessage.ExternalProxy; - - if (Data.capaOpenPGP()) - { - this.isPgpSigned(!!oJsonMessage.PgpSigned); - this.isPgpEncrypted(!!oJsonMessage.PgpEncrypted); - } - - this.hasAttachments(!!oJsonMessage.HasAttachments); - this.attachmentsMainType(oJsonMessage.AttachmentsMainType); - - this.foundedCIDs = Utils.isArray(oJsonMessage.FoundedCIDs) ? oJsonMessage.FoundedCIDs : []; - this.attachments(this.initAttachmentsFromJson(oJsonMessage.Attachments)); - - this.readReceipt(oJsonMessage.ReadReceipt || ''); - - this.computeSenderEmail(); - - bResult = true; - } - - return bResult; - }; - - /** - * @param {(AjaxJsonAttachment|null)} oJsonAttachments - * @return {Array} - */ - MessageModel.prototype.initAttachmentsFromJson = function (oJsonAttachments) - { - var - iIndex = 0, - iLen = 0, - oAttachmentModel = null, - aResult = [] - ; - - if (oJsonAttachments && 'Collection/AttachmentCollection' === oJsonAttachments['@Object'] && - Utils.isNonEmptyArray(oJsonAttachments['@Collection'])) - { - for (iIndex = 0, iLen = oJsonAttachments['@Collection'].length; iIndex < iLen; iIndex++) - { - oAttachmentModel = AttachmentModel.newInstanceFromJson(oJsonAttachments['@Collection'][iIndex]); - if (oAttachmentModel) - { - if ('' !== oAttachmentModel.cidWithOutTags && 0 < this.foundedCIDs.length && - 0 <= Utils.inArray(oAttachmentModel.cidWithOutTags, this.foundedCIDs)) - { - oAttachmentModel.isLinked = true; - } - - aResult.push(oAttachmentModel); - } - } - } - - return aResult; - }; - - /** - * @param {AjaxJsonMessage} oJsonMessage - * @return {boolean} - */ - MessageModel.prototype.initFlagsByJson = function (oJsonMessage) - { - var bResult = false; - - if (oJsonMessage && 'Object/Message' === oJsonMessage['@Object']) - { - this.unseen(!oJsonMessage.IsSeen); - this.flagged(!!oJsonMessage.IsFlagged); - this.answered(!!oJsonMessage.IsAnswered); - this.forwarded(!!oJsonMessage.IsForwarded); - this.isReadReceipt(!!oJsonMessage.IsReadReceipt); - - bResult = true; - } - - return bResult; - }; - - /** - * @param {boolean} bFriendlyView - * @param {boolean=} bWrapWithLink = false - * @return {string} - */ - MessageModel.prototype.fromToLine = function (bFriendlyView, bWrapWithLink) - { - return MessageModel.emailsToLine(this.from, bFriendlyView, bWrapWithLink); - }; - - /** - * @param {boolean} bFriendlyView - * @param {boolean=} bWrapWithLink = false - * @return {string} - */ - MessageModel.prototype.toToLine = function (bFriendlyView, bWrapWithLink) - { - return MessageModel.emailsToLine(this.to, bFriendlyView, bWrapWithLink); - }; - - /** - * @param {boolean} bFriendlyView - * @param {boolean=} bWrapWithLink = false - * @return {string} - */ - MessageModel.prototype.ccToLine = function (bFriendlyView, bWrapWithLink) - { - return MessageModel.emailsToLine(this.cc, bFriendlyView, bWrapWithLink); - }; - - /** - * @param {boolean} bFriendlyView - * @param {boolean=} bWrapWithLink = false - * @return {string} - */ - MessageModel.prototype.bccToLine = function (bFriendlyView, bWrapWithLink) - { - return MessageModel.emailsToLine(this.bcc, bFriendlyView, bWrapWithLink); - }; - - /** - * @return string - */ - MessageModel.prototype.lineAsCcc = function () - { - var aResult = []; - if (this.deleted()) - { - aResult.push('deleted'); - } - if (this.selected()) - { - aResult.push('selected'); - } - if (this.checked()) - { - aResult.push('checked'); - } - if (this.flagged()) - { - aResult.push('flagged'); - } - if (this.unseen()) - { - aResult.push('unseen'); - } - if (this.answered()) - { - aResult.push('answered'); - } - if (this.forwarded()) - { - aResult.push('forwarded'); - } - if (this.focused()) - { - aResult.push('focused'); - } - if (this.hasAttachments()) - { - aResult.push('withAttachments'); - switch (this.attachmentsMainType()) - { - case 'image': - aResult.push('imageOnlyAttachments'); - break; - case 'archive': - aResult.push('archiveOnlyAttachments'); - break; - } - } - if (this.newForAnimation()) - { - aResult.push('new'); - } - if ('' === this.subject()) - { - aResult.push('emptySubject'); - } - if (0 < this.parentUid()) - { - aResult.push('hasParentMessage'); - } - if (0 < this.threadsLen() && 0 === this.parentUid()) - { - aResult.push('hasChildrenMessage'); - } - if (this.hasUnseenSubMessage()) - { - aResult.push('hasUnseenSubMessage'); - } - if (this.hasFlaggedSubMessage()) - { - aResult.push('hasFlaggedSubMessage'); - } - - return aResult.join(' '); - }; - - /** - * @return {boolean} - */ - MessageModel.prototype.hasVisibleAttachments = function () - { - return !!_.find(this.attachments(), function (oAttachment) { - return !oAttachment.isLinked; - }); - }; - - /** - * @param {string} sCid - * @return {*} - */ - MessageModel.prototype.findAttachmentByCid = function (sCid) - { - var - oResult = null, - aAttachments = this.attachments() - ; - - if (Utils.isNonEmptyArray(aAttachments)) - { - sCid = sCid.replace(/^<+/, '').replace(/>+$/, ''); - oResult = _.find(aAttachments, function (oAttachment) { - return sCid === oAttachment.cidWithOutTags; - }); - } - - return oResult || null; - }; - - /** - * @param {string} sContentLocation - * @return {*} - */ - MessageModel.prototype.findAttachmentByContentLocation = function (sContentLocation) - { - var - oResult = null, - aAttachments = this.attachments() - ; - - if (Utils.isNonEmptyArray(aAttachments)) - { - oResult = _.find(aAttachments, function (oAttachment) { - return sContentLocation === oAttachment.contentLocation; - }); - } - - return oResult || null; - }; - - - /** - * @return {string} - */ - MessageModel.prototype.messageId = function () - { - return this.sMessageId; - }; - - /** - * @return {string} - */ - MessageModel.prototype.inReplyTo = function () - { - return this.sInReplyTo; - }; - - /** - * @return {string} - */ - MessageModel.prototype.references = function () - { - return this.sReferences; - }; - - /** - * @return {string} - */ - MessageModel.prototype.fromAsSingleEmail = function () - { - return Utils.isArray(this.from) && this.from[0] ? this.from[0].email : ''; - }; - - /** - * @return {string} - */ - MessageModel.prototype.viewLink = function () - { - return LinkBuilder.messageViewLink(this.requestHash); - }; - - /** - * @return {string} - */ - MessageModel.prototype.downloadLink = function () - { - return LinkBuilder.messageDownloadLink(this.requestHash); - }; - - /** - * @param {Object} oExcludeEmails - * @return {Array} - */ - MessageModel.prototype.replyEmails = function (oExcludeEmails) - { - var - aResult = [], - oUnic = Utils.isUnd(oExcludeEmails) ? {} : oExcludeEmails - ; - - MessageModel.replyHelper(this.replyTo, oUnic, aResult); - if (0 === aResult.length) - { - MessageModel.replyHelper(this.from, oUnic, aResult); - } - - return aResult; - }; - - /** - * @param {Object} oExcludeEmails - * @return {Array.} - */ - MessageModel.prototype.replyAllEmails = function (oExcludeEmails) - { - var - aToResult = [], - aCcResult = [], - oUnic = Utils.isUnd(oExcludeEmails) ? {} : oExcludeEmails - ; - - MessageModel.replyHelper(this.replyTo, oUnic, aToResult); - if (0 === aToResult.length) - { - MessageModel.replyHelper(this.from, oUnic, aToResult); - } - - MessageModel.replyHelper(this.to, oUnic, aToResult); - MessageModel.replyHelper(this.cc, oUnic, aCcResult); - - return [aToResult, aCcResult]; - }; - - /** - * @return {string} - */ - MessageModel.prototype.textBodyToString = function () - { - return this.body ? this.body.html() : ''; - }; - - /** - * @return {string} - */ - MessageModel.prototype.attachmentsToStringLine = function () - { - var aAttachLines = _.map(this.attachments(), function (oItem) { - return oItem.fileName + ' (' + oItem.friendlySize + ')'; - }); - - return aAttachLines && 0 < aAttachLines.length ? aAttachLines.join(', ') : ''; - }; - - /** - * @return {Object} - */ - MessageModel.prototype.getDataForWindowPopup = function () - { - return { - 'popupFrom': this.fromToLine(false), - 'popupTo': this.toToLine(false), - 'popupCc': this.ccToLine(false), - 'popupBcc': this.bccToLine(false), - 'popupSubject': this.subject(), - 'popupDate': this.fullFormatDateValue(), - 'popupAttachments': this.attachmentsToStringLine(), - 'popupBody': this.textBodyToString() - }; - }; - - /** - * @param {boolean=} bPrint = false - */ - MessageModel.prototype.viewPopupMessage = function (bPrint) - { - Utils.windowPopupKnockout(this.getDataForWindowPopup(), 'PopupsWindowSimpleMessage', this.subject(), function (oPopupWin) { - if (oPopupWin && oPopupWin.document && oPopupWin.document.body) - { - $('img.lazy', oPopupWin.document.body).each(function (iIndex, oImg) { - - var - $oImg = $(oImg), - sOrig = $oImg.data('original'), - sSrc = $oImg.attr('src') - ; - - if (0 <= iIndex && sOrig && !sSrc) - { - $oImg.attr('src', sOrig); - } - }); - - if (bPrint) - { - window.setTimeout(function () { - oPopupWin.print(); - }, 100); - } - } - }); - }; - - MessageModel.prototype.printMessage = function () - { - this.viewPopupMessage(true); - }; - - /** - * @returns {string} - */ - MessageModel.prototype.generateUid = function () - { - return this.folderFullNameRaw + '/' + this.uid; - }; - - /** - * @param {MessageModel} oMessage - * @return {MessageModel} - */ - MessageModel.prototype.populateByMessageListItem = function (oMessage) - { - this.folderFullNameRaw = oMessage.folderFullNameRaw; - this.uid = oMessage.uid; - this.hash = oMessage.hash; - this.requestHash = oMessage.requestHash; - this.subject(oMessage.subject()); - this.subjectPrefix(this.subjectPrefix()); - this.subjectSuffix(this.subjectSuffix()); - - this.size(oMessage.size()); - this.dateTimeStampInUTC(oMessage.dateTimeStampInUTC()); - this.priority(oMessage.priority()); - - this.proxy = oMessage.proxy; - - this.fromEmailString(oMessage.fromEmailString()); - this.fromClearEmailString(oMessage.fromClearEmailString()); - this.toEmailsString(oMessage.toEmailsString()); - this.toClearEmailsString(oMessage.toClearEmailsString()); - - this.emails = oMessage.emails; - - this.from = oMessage.from; - this.to = oMessage.to; - this.cc = oMessage.cc; - this.bcc = oMessage.bcc; - this.replyTo = oMessage.replyTo; - this.deliveredTo = oMessage.deliveredTo; - - this.unseen(oMessage.unseen()); - this.flagged(oMessage.flagged()); - this.answered(oMessage.answered()); - this.forwarded(oMessage.forwarded()); - this.isReadReceipt(oMessage.isReadReceipt()); - - this.selected(oMessage.selected()); - this.checked(oMessage.checked()); - this.hasAttachments(oMessage.hasAttachments()); - this.attachmentsMainType(oMessage.attachmentsMainType()); - - this.moment(oMessage.moment()); - - this.body = null; - - this.priority(Enums.MessagePriority.Normal); - this.aDraftInfo = []; - this.sMessageId = ''; - this.sInReplyTo = ''; - this.sReferences = ''; - - this.parentUid(oMessage.parentUid()); - this.threads(oMessage.threads()); - this.threadsLen(oMessage.threadsLen()); - - this.computeSenderEmail(); - - return this; - }; - - MessageModel.prototype.showExternalImages = function (bLazy) - { - if (this.body && this.body.data('rl-has-images')) - { - var sAttr = ''; - bLazy = Utils.isUnd(bLazy) ? false : bLazy; - - this.hasImages(false); - this.body.data('rl-has-images', false); - - sAttr = this.proxy ? 'data-x-additional-src' : 'data-x-src'; - $('[' + sAttr + ']', this.body).each(function () { - if (bLazy && $(this).is('img')) - { - $(this) - .addClass('lazy') - .attr('data-original', $(this).attr(sAttr)) - .removeAttr(sAttr) - ; - } - else - { - $(this).attr('src', $(this).attr(sAttr)).removeAttr(sAttr); - } - }); - - sAttr = this.proxy ? 'data-x-additional-style-url' : 'data-x-style-url'; - $('[' + sAttr + ']', this.body).each(function () { - var sStyle = Utils.trim($(this).attr('style')); - sStyle = '' === sStyle ? '' : (';' === sStyle.substr(-1) ? sStyle + ' ' : sStyle + '; '); - $(this).attr('style', sStyle + $(this).attr(sAttr)).removeAttr(sAttr); - }); - - if (bLazy) - { - $('img.lazy', this.body).addClass('lazy-inited').lazyload({ - 'threshold' : 400, - 'effect' : 'fadeIn', - 'skip_invisible' : false, - 'container': $('.RL-MailMessageView .messageView .messageItem .content')[0] - }); - - Globals.$win.resize(); - } - - Utils.windowResize(500); - } - }; - - MessageModel.prototype.showInternalImages = function (bLazy) - { - if (this.body && !this.body.data('rl-init-internal-images')) - { - this.body.data('rl-init-internal-images', true); - - bLazy = Utils.isUnd(bLazy) ? false : bLazy; - - var self = this; - - $('[data-x-src-cid]', this.body).each(function () { - - var oAttachment = self.findAttachmentByCid($(this).attr('data-x-src-cid')); - if (oAttachment && oAttachment.download) - { - if (bLazy && $(this).is('img')) - { - $(this) - .addClass('lazy') - .attr('data-original', oAttachment.linkPreview()); - } - else - { - $(this).attr('src', oAttachment.linkPreview()); - } - } - }); - - $('[data-x-src-location]', this.body).each(function () { - - var oAttachment = self.findAttachmentByContentLocation($(this).attr('data-x-src-location')); - if (!oAttachment) - { - oAttachment = self.findAttachmentByCid($(this).attr('data-x-src-location')); - } - - if (oAttachment && oAttachment.download) - { - if (bLazy && $(this).is('img')) - { - $(this) - .addClass('lazy') - .attr('data-original', oAttachment.linkPreview()); - } - else - { - $(this).attr('src', oAttachment.linkPreview()); - } - } - }); - - $('[data-x-style-cid]', this.body).each(function () { - - var - sStyle = '', - sName = '', - oAttachment = self.findAttachmentByCid($(this).attr('data-x-style-cid')) - ; - - if (oAttachment && oAttachment.linkPreview) - { - sName = $(this).attr('data-x-style-cid-name'); - if ('' !== sName) - { - sStyle = Utils.trim($(this).attr('style')); - sStyle = '' === sStyle ? '' : (';' === sStyle.substr(-1) ? sStyle + ' ' : sStyle + '; '); - $(this).attr('style', sStyle + sName + ': url(\'' + oAttachment.linkPreview() + '\')'); - } - } - }); - - if (bLazy) - { - (function ($oImg, oContainer) { - _.delay(function () { - $oImg.addClass('lazy-inited').lazyload({ - 'threshold' : 400, - 'effect' : 'fadeIn', - 'skip_invisible' : false, - 'container': oContainer - }); - }, 300); - }($('img.lazy', self.body), $('.RL-MailMessageView .messageView .messageItem .content')[0])); - } - - Utils.windowResize(500); - } - }; - - MessageModel.prototype.storeDataToDom = function () - { - if (this.body) - { - this.body.data('rl-is-html', !!this.isHtml()); - this.body.data('rl-has-images', !!this.hasImages()); - - this.body.data('rl-plain-raw', this.plainRaw); - - var Data = require('Storage:RainLoop:Data'); - if (Data.capaOpenPGP()) - { - this.body.data('rl-plain-pgp-signed', !!this.isPgpSigned()); - this.body.data('rl-plain-pgp-encrypted', !!this.isPgpEncrypted()); - this.body.data('rl-pgp-verify-status', this.pgpSignedVerifyStatus()); - this.body.data('rl-pgp-verify-user', this.pgpSignedVerifyUser()); - } - } - }; - - MessageModel.prototype.storePgpVerifyDataToDom = function () - { - var Data = require('Storage:RainLoop:Data'); - if (this.body && Data.capaOpenPGP()) - { - this.body.data('rl-pgp-verify-status', this.pgpSignedVerifyStatus()); - this.body.data('rl-pgp-verify-user', this.pgpSignedVerifyUser()); - } - }; - - MessageModel.prototype.fetchDataToDom = function () - { - if (this.body) - { - this.isHtml(!!this.body.data('rl-is-html')); - this.hasImages(!!this.body.data('rl-has-images')); - - this.plainRaw = Utils.pString(this.body.data('rl-plain-raw')); - - var Data = require('Storage:RainLoop:Data'); - if (Data.capaOpenPGP()) - { - this.isPgpSigned(!!this.body.data('rl-plain-pgp-signed')); - this.isPgpEncrypted(!!this.body.data('rl-plain-pgp-encrypted')); - this.pgpSignedVerifyStatus(this.body.data('rl-pgp-verify-status')); - this.pgpSignedVerifyUser(this.body.data('rl-pgp-verify-user')); - } - else - { - this.isPgpSigned(false); - this.isPgpEncrypted(false); - this.pgpSignedVerifyStatus(Enums.SignedVerifyStatus.None); - this.pgpSignedVerifyUser(''); - } - } - }; - - MessageModel.prototype.verifyPgpSignedClearMessage = function () - { - if (this.isPgpSigned()) - { - var - aRes = [], - mPgpMessage = null, - Data = require('Storage:RainLoop:Data'), - sFrom = this.from && this.from[0] && this.from[0].email ? this.from[0].email : '', - aPublicKeys = Data.findPublicKeysByEmail(sFrom), - oValidKey = null, - oValidSysKey = null, - sPlain = '' - ; - - this.pgpSignedVerifyStatus(Enums.SignedVerifyStatus.Error); - this.pgpSignedVerifyUser(''); - - try - { - mPgpMessage = window.openpgp.cleartext.readArmored(this.plainRaw); - if (mPgpMessage && mPgpMessage.getText) - { - this.pgpSignedVerifyStatus( - aPublicKeys.length ? Enums.SignedVerifyStatus.Unverified : Enums.SignedVerifyStatus.UnknownPublicKeys); - - aRes = mPgpMessage.verify(aPublicKeys); - if (aRes && 0 < aRes.length) - { - oValidKey = _.find(aRes, function (oItem) { - return oItem && oItem.keyid && oItem.valid; - }); - - if (oValidKey) - { - oValidSysKey = Data.findPublicKeyByHex(oValidKey.keyid.toHex()); - if (oValidSysKey) - { - sPlain = mPgpMessage.getText(); - - this.pgpSignedVerifyStatus(Enums.SignedVerifyStatus.Success); - this.pgpSignedVerifyUser(oValidSysKey.user); - - sPlain = - Globals.$div.empty().append( - $('
    ').text(sPlain)
    -								   ).html()
    -							   ;
    -
    -							   Globals.$div.empty();
    -
    -							   this.replacePlaneTextBody(sPlain);
    -						   }
    -					   }
    -				   }
    -			   }
    -		   }
    -		   catch (oExc) {}
    -
    -		   this.storePgpVerifyDataToDom();
    -	   }
    -	};
    -
    -	MessageModel.prototype.decryptPgpEncryptedMessage = function (sPassword)
    -	{
    -	   if (this.isPgpEncrypted())
    -	   {
    -		   var
    -			   aRes = [],
    -			   mPgpMessage = null,
    -			   mPgpMessageDecrypted = null,
    -			   Data = require('Storage:RainLoop:Data'),
    -			   sFrom = this.from && this.from[0] && this.from[0].email ? this.from[0].email : '',
    -			   aPublicKey = Data.findPublicKeysByEmail(sFrom),
    -			   oPrivateKey = Data.findSelfPrivateKey(sPassword),
    -			   oValidKey = null,
    -			   oValidSysKey = null,
    -			   sPlain = ''
    -		   ;
    -
    -		   this.pgpSignedVerifyStatus(Enums.SignedVerifyStatus.Error);
    -		   this.pgpSignedVerifyUser('');
    -
    -		   if (!oPrivateKey)
    -		   {
    -			   this.pgpSignedVerifyStatus(Enums.SignedVerifyStatus.UnknownPrivateKey);
    -		   }
    -
    -		   try
    -		   {
    -			   mPgpMessage = window.openpgp.message.readArmored(this.plainRaw);
    -			   if (mPgpMessage && oPrivateKey && mPgpMessage.decrypt)
    -			   {
    -				   this.pgpSignedVerifyStatus(Enums.SignedVerifyStatus.Unverified);
    -
    -				   mPgpMessageDecrypted = mPgpMessage.decrypt(oPrivateKey);
    -				   if (mPgpMessageDecrypted)
    -				   {
    -					   aRes = mPgpMessageDecrypted.verify(aPublicKey);
    -					   if (aRes && 0 < aRes.length)
    -					   {
    -						   oValidKey = _.find(aRes, function (oItem) {
    -							   return oItem && oItem.keyid && oItem.valid;
    -						   });
    -
    -						   if (oValidKey)
    -						   {
    -							   oValidSysKey = Data.findPublicKeyByHex(oValidKey.keyid.toHex());
    -							   if (oValidSysKey)
    -							   {
    -								   this.pgpSignedVerifyStatus(Enums.SignedVerifyStatus.Success);
    -								   this.pgpSignedVerifyUser(oValidSysKey.user);
    -							   }
    -						   }
    -					   }
    -
    -					   sPlain = mPgpMessageDecrypted.getText();
    -
    -					   sPlain =
    -						   Globals.$div.empty().append(
    -							   $('
    ').text(sPlain)
    -						   ).html()
    -					   ;
    -
    -					   Globals.$div.empty();
    -
    -					   this.replacePlaneTextBody(sPlain);
    -				   }
    -			   }
    -		   }
    -		   catch (oExc) {}
    -
    -		   this.storePgpVerifyDataToDom();
    -	   }
    -	};
    -
    -	MessageModel.prototype.replacePlaneTextBody = function (sPlain)
    -	{
    -	   if (this.body)
    -	   {
    -		   this.body.html(sPlain).addClass('b-text-part plain');
    -	   }
    -	};
    -
    -	/**
    -	* @return {string}
    -	*/
    -	MessageModel.prototype.flagHash = function ()
    -	{
    -	   return [this.deleted(), this.unseen(), this.flagged(), this.answered(), this.forwarded(),
    -		   this.isReadReceipt()].join('');
    -	};
    -
    -	module.exports = MessageModel;
    -
    -}(module, require));
    -},{"$":15,"Enums":6,"Globals":8,"LinkBuilder":9,"Model:Attachment":26,"Model:Email":28,"Storage:RainLoop:Data":49,"Utils":11,"_":20,"ko":17,"moment":18,"window":21}],30:[function(require,module,exports){
    -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
    -
    -(function (module, require) {
    -
    -	'use strict';
    -
    -	var
     		$ = require('$'),
    -		_ = require('_'),
     		ko = require('ko'),
     
     		Globals = require('Globals'),
    @@ -7610,11 +6029,11 @@ module.exports = window;
     	;
     
     	/**
    -	 * @param {Array} aViewModels
     	 * @constructor
    +	 * @param {Array} aViewModels
     	 * @extends KnoinAbstractScreen
     	 */
    -	function AbstractSettings(aViewModels)
    +	function AbstractSettingsScreen(aViewModels)
     	{
     		KnoinAbstractScreen.call(this, 'settings', aViewModels);
     
    @@ -7624,9 +6043,9 @@ module.exports = window;
     		this.oViewModelPlace = null;
     	}
     
    -	_.extend(AbstractSettings.prototype, KnoinAbstractScreen.prototype);
    +	_.extend(AbstractSettingsScreen.prototype, KnoinAbstractScreen.prototype);
     
    -	AbstractSettings.prototype.onRoute = function (sSubName)
    +	AbstractSettingsScreen.prototype.onRoute = function (sSubName)
     	{
     		var
     			self = this,
    @@ -7733,7 +6152,7 @@ module.exports = window;
     		}
     	};
     
    -	AbstractSettings.prototype.onHide = function ()
    +	AbstractSettingsScreen.prototype.onHide = function ()
     	{
     		if (this.oCurrentSubScreen && this.oCurrentSubScreen.viewModelDom)
     		{
    @@ -7742,7 +6161,7 @@ module.exports = window;
     		}
     	};
     
    -	AbstractSettings.prototype.onBuild = function ()
    +	AbstractSettingsScreen.prototype.onBuild = function ()
     	{
     		_.each(Globals.aViewModels['settings'], function (SettingsViewModel) {
     			if (SettingsViewModel && SettingsViewModel.__rlSettingsData &&
    @@ -7764,7 +6183,7 @@ module.exports = window;
     		this.oViewModelPlace = $('#rl-content #rl-settings-subscreen');
     	};
     
    -	AbstractSettings.prototype.routes = function ()
    +	AbstractSettingsScreen.prototype.routes = function ()
     	{
     		var
     			DefaultViewModel = _.find(Globals.aViewModels['settings'], function (SettingsViewModel) {
    @@ -7787,18 +6206,18 @@ module.exports = window;
     		];
     	};
     
    -	module.exports = AbstractSettings;
    +	module.exports = AbstractSettingsScreen;
     
     }(module, require));
    -},{"$":15,"App:Knoin":22,"Globals":8,"Knoin:AbstractScreen":24,"LinkBuilder":9,"Utils":11,"_":20,"ko":17}],31:[function(require,module,exports){
    -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
    +},{"$":14,"App:Knoin":21,"Globals":8,"Knoin:AbstractScreen":23,"LinkBuilder":9,"Utils":11,"_":19,"ko":16}],28:[function(require,module,exports){
     
     (function (module, require) {
     
     	'use strict';
    -	
    +
     	var
     		_ = require('_'),
    +
     		KnoinAbstractScreen = require('Knoin:AbstractScreen')
     	;
     
    @@ -7823,8 +6242,7 @@ module.exports = window;
     	module.exports = AdminLoginScreen;
     
     }(module, require));
    -},{"App:Admin":3,"Knoin:AbstractScreen":24,"View:Admin:Login":54,"_":20}],32:[function(require,module,exports){
    -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
    +},{"App:Admin":3,"Knoin:AbstractScreen":23,"View:Admin:Login":46,"_":19}],29:[function(require,module,exports){
     
     (function (module, require) {
     
    @@ -7832,6 +6250,7 @@ module.exports = window;
     
     	var
     		_ = require('_'),
    +
     		AbstractSettings = require('Screen:AbstractSettings')
     	;
     
    @@ -7857,13 +6276,12 @@ module.exports = window;
     	module.exports = AdminSettingsScreen;
     
     }(module, require));
    -},{"App:Admin":3,"Screen:AbstractSettings":30,"View:Admin:SettingsMenu":55,"View:Admin:SettingsPane":56,"_":20}],33:[function(require,module,exports){
    -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
    +},{"App:Admin":3,"Screen:AbstractSettings":27,"View:Admin:SettingsMenu":47,"View:Admin:SettingsPane":48,"_":19}],30:[function(require,module,exports){
     
     (function (module, require) {
     
     	'use strict';
    -	
    +
     	var
     		ko = require('ko')
     	;
    @@ -7947,11 +6365,10 @@ module.exports = window;
     	module.exports = AdminSettingsAbout;
     
     }(module, require));
    -},{"App:Admin":3,"Storage:Admin:Data":46,"Storage:Settings":53,"ko":17}],34:[function(require,module,exports){
    -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
    +},{"App:Admin":3,"Storage:Admin:Data":43,"Storage:Settings":45,"ko":16}],31:[function(require,module,exports){
     
     (function (module, require) {
    -	
    +
     	'use strict';
     
     	var
    @@ -8040,11 +6457,10 @@ module.exports = window;
     	module.exports = AdminSettingsBranding;
     
     }(module, require));
    -},{"Enums":6,"Storage:Admin:Remote":47,"Storage:Settings":53,"Utils":11,"_":20,"ko":17}],35:[function(require,module,exports){
    -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
    +},{"Enums":6,"Storage:Admin:Remote":44,"Storage:Settings":45,"Utils":11,"_":19,"ko":16}],32:[function(require,module,exports){
     
     (function (module, require) {
    -	
    +
     	'use strict';
     
     	var
    @@ -8284,11 +6700,10 @@ module.exports = window;
     	module.exports = AdminSettingsContacts;
     
     }(module, require));
    -},{"Enums":6,"Storage:Admin:Remote":47,"Storage:Settings":53,"Utils":11,"_":20,"ko":17}],36:[function(require,module,exports){
    -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
    +},{"Enums":6,"Storage:Admin:Remote":44,"Storage:Settings":45,"Utils":11,"_":19,"ko":16}],33:[function(require,module,exports){
     
     (function (module, require) {
    -	
    +
     	'use strict';
     
     	var
    @@ -8392,13 +6807,12 @@ module.exports = window;
     	module.exports = AdminSettingsDomains;
     
     }(module, require));
    -},{"App:Admin":3,"App:Knoin":22,"Enums":6,"Storage:Admin:Data":46,"Storage:Admin:Remote":47,"View:Popup:Domain":59,"_":20,"ko":17,"window":21}],37:[function(require,module,exports){
    -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
    +},{"App:Admin":3,"App:Knoin":21,"Enums":6,"Storage:Admin:Data":43,"Storage:Admin:Remote":44,"View:Popup:Domain":51,"_":19,"ko":16,"window":20}],34:[function(require,module,exports){
     
     (function (module, require) {
     
     	'use strict';
    -	
    +
     	var
     		_ = require('_'),
     		ko = require('ko'),
    @@ -8539,11 +6953,10 @@ module.exports = window;
     	module.exports = AdminSettingsGeneral;
     
     }(module, require));
    -},{"App:Knoin":22,"Enums":6,"LinkBuilder":9,"Storage:Admin:Data":46,"Storage:Admin:Remote":47,"Storage:Settings":53,"Utils":11,"View:Popup:Languages":60,"_":20,"ko":17}],38:[function(require,module,exports){
    -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
    +},{"App:Knoin":21,"Enums":6,"LinkBuilder":9,"Storage:Admin:Data":43,"Storage:Admin:Remote":44,"Storage:Settings":45,"Utils":11,"View:Popup:Languages":52,"_":19,"ko":16}],35:[function(require,module,exports){
     
     (function (module, require) {
    -	
    +
     	'use strict';
     
     	var
    @@ -8611,11 +7024,10 @@ module.exports = window;
     	module.exports = AdminSettingsLicensing;
     
     }(module, require));
    -},{"App:Admin":3,"App:Knoin":22,"Storage:Admin:Data":46,"Storage:Settings":53,"View:Popup:Activate":57,"ko":17,"moment":18}],39:[function(require,module,exports){
    -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
    +},{"App:Admin":3,"App:Knoin":21,"Storage:Admin:Data":43,"Storage:Settings":45,"View:Popup:Activate":49,"ko":16,"moment":17}],36:[function(require,module,exports){
     
     (function (module, require) {
    -	
    +
     	'use strict';
     
     	var
    @@ -8684,11 +7096,10 @@ module.exports = window;
     	module.exports = AdminSettingsLogin;
     
     }(module, require));
    -},{"Enums":6,"Storage:Admin:Data":46,"Storage:Admin:Remote":47,"Storage:Settings":53,"Utils":11,"_":20,"ko":17}],40:[function(require,module,exports){
    -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
    +},{"Enums":6,"Storage:Admin:Data":43,"Storage:Admin:Remote":44,"Storage:Settings":45,"Utils":11,"_":19,"ko":16}],37:[function(require,module,exports){
     
     (function (module, require) {
    -	
    +
     	'use strict';
     
     	var
    @@ -8799,11 +7210,10 @@ module.exports = window;
     	module.exports = AdminSettingsPackages;
     
     }(module, require));
    -},{"App:Admin":3,"Enums":6,"Storage:Admin:Data":46,"Storage:Admin:Remote":47,"Utils":11,"ko":17,"window":21}],41:[function(require,module,exports){
    -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
    +},{"App:Admin":3,"Enums":6,"Storage:Admin:Data":43,"Storage:Admin:Remote":44,"Utils":11,"ko":16,"window":20}],38:[function(require,module,exports){
     
     (function (module, require) {
    -	
    +
     	'use strict';
     
     	var
    @@ -8914,13 +7324,12 @@ module.exports = window;
     	module.exports = AdminSettingsPlugins;
     
     }(module, require));
    -},{"App:Admin":3,"App:Knoin":22,"Enums":6,"Storage:Admin:Data":46,"Storage:Admin:Remote":47,"Storage:Settings":53,"Utils":11,"View:Popup:Plugin":61,"_":20,"ko":17}],42:[function(require,module,exports){
    -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
    +},{"App:Admin":3,"App:Knoin":21,"Enums":6,"Storage:Admin:Data":43,"Storage:Admin:Remote":44,"Storage:Settings":45,"Utils":11,"View:Popup:Plugin":53,"_":19,"ko":16}],39:[function(require,module,exports){
     
     (function (module, require) {
     
     	'use strict';
    -	
    +
     	var
     		_ = require('_'),
     		ko = require('ko'),
    @@ -9053,11 +7462,10 @@ module.exports = window;
     
     }(module, require));
     
    -},{"Enums":6,"LinkBuilder":9,"Storage:Admin:Data":46,"Storage:Admin:Remote":47,"Storage:Settings":53,"Utils":11,"_":20,"ko":17}],43:[function(require,module,exports){
    -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
    +},{"Enums":6,"LinkBuilder":9,"Storage:Admin:Data":43,"Storage:Admin:Remote":44,"Storage:Settings":45,"Utils":11,"_":19,"ko":16}],40:[function(require,module,exports){
     
     (function (module, require) {
    -	
    +
     	'use strict';
     
     	var
    @@ -9208,7 +7616,7 @@ module.exports = window;
     	module.exports = AdminSettingsSocial;
     
     }(module, require));
    -},{"Enums":6,"Storage:Admin:Data":46,"Storage:Admin:Remote":47,"Utils":11,"_":20,"ko":17}],44:[function(require,module,exports){
    +},{"Enums":6,"Storage:Admin:Data":43,"Storage:Admin:Remote":44,"Utils":11,"_":19,"ko":16}],41:[function(require,module,exports){
     /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
     
     (function (module, require) {
    @@ -9302,7 +7710,7 @@ module.exports = window;
     	module.exports = AbstractData;
     
     }(module, require));
    -},{"Enums":6,"Storage:Settings":53,"Utils":11}],45:[function(require,module,exports){
    +},{"Enums":6,"Storage:Settings":45,"Utils":11}],42:[function(require,module,exports){
     /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
     
     (function (module, require) {
    @@ -9311,8 +7719,8 @@ module.exports = window;
     
     	var
     		window = require('window'),
    -		$ = require('$'),
     		_ = require('_'),
    +		$ = require('$'),
     
     		Consts = require('Consts'),
     		Enums = require('Enums'),
    @@ -9615,7 +8023,7 @@ module.exports = window;
     	module.exports = AbstractRemoteStorage;
     
     }(module, require));
    -},{"$":15,"Consts":5,"Enums":6,"Globals":8,"LinkBuilder":9,"Plugins":10,"Storage:Settings":53,"Utils":11,"_":20,"window":21}],46:[function(require,module,exports){
    +},{"$":14,"Consts":5,"Enums":6,"Globals":8,"LinkBuilder":9,"Plugins":10,"Storage:Settings":45,"Utils":11,"_":19,"window":20}],43:[function(require,module,exports){
     /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
     
     (function (module, require) {
    @@ -9684,7 +8092,7 @@ module.exports = window;
     	module.exports = new AdminDataStorage();
     
     }(module, require));
    -},{"Storage:Abstract:Data":44,"_":20,"ko":17}],47:[function(require,module,exports){
    +},{"Storage:Abstract:Data":41,"_":19,"ko":16}],44:[function(require,module,exports){
     /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
     
     (function (module, require) {
    @@ -9961,357 +8369,7 @@ module.exports = window;
     	module.exports = new AdminRemoteStorage();
     
     }(module, require));
    -},{"Storage:Abstract:Remote":45,"_":20}],48:[function(require,module,exports){
    -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
    -
    -(function (module, require) {
    -
    -	'use strict';
    -
    -	var
    -		_ = require('_'),
    -
    -		Enums = require('Enums'),
    -		Utils = require('Utils'),
    -		LinkBuilder = require('LinkBuilder'),
    -
    -		Settings = require('Storage:Settings')
    -	;
    -
    -	/**
    -	 * @constructor
    -	 */
    -	function CacheStorage()
    -	{
    -		this.oFoldersCache = {};
    -		this.oFoldersNamesCache = {};
    -		this.oFolderHashCache = {};
    -		this.oFolderUidNextCache = {};
    -		this.oMessageListHashCache = {};
    -		this.oMessageFlagsCache = {};
    -		this.oNewMessage = {};
    -		this.oRequestedMessage = {};
    -
    -		this.bCapaGravatar = Settings.capa(Enums.Capa.Gravatar);
    -	}
    -
    -	/**
    -	 * @type {boolean}
    -	 */
    -	CacheStorage.prototype.bCapaGravatar = false;
    -
    -	/**
    -	 * @type {Object}
    -	 */
    -	CacheStorage.prototype.oFoldersCache = {};
    -
    -	/**
    -	 * @type {Object}
    -	 */
    -	CacheStorage.prototype.oFoldersNamesCache = {};
    -
    -	/**
    -	 * @type {Object}
    -	 */
    -	CacheStorage.prototype.oFolderHashCache = {};
    -
    -	/**
    -	 * @type {Object}
    -	 */
    -	CacheStorage.prototype.oFolderUidNextCache = {};
    -
    -	/**
    -	 * @type {Object}
    -	 */
    -	CacheStorage.prototype.oMessageListHashCache = {};
    -
    -	/**
    -	 * @type {Object}
    -	 */
    -	CacheStorage.prototype.oMessageFlagsCache = {};
    -
    -	/**
    -	 * @type {Object}
    -	 */
    -	CacheStorage.prototype.oBodies = {};
    -
    -	/**
    -	 * @type {Object}
    -	 */
    -	CacheStorage.prototype.oNewMessage = {};
    -
    -	/**
    -	 * @type {Object}
    -	 */
    -	CacheStorage.prototype.oRequestedMessage = {};
    -
    -	CacheStorage.prototype.clear = function ()
    -	{
    -		this.oFoldersCache = {};
    -		this.oFoldersNamesCache = {};
    -		this.oFolderHashCache = {};
    -		this.oFolderUidNextCache = {};
    -		this.oMessageListHashCache = {};
    -		this.oMessageFlagsCache = {};
    -		this.oBodies = {};
    -	};
    -
    -
    -	/**
    -	 * @param {string} sEmail
    -	 * @param {Function} fCallback
    -	 * @return {string}
    -	 */
    -	CacheStorage.prototype.getUserPic = function (sEmail, fCallback)
    -	{
    -		sEmail = Utils.trim(sEmail);
    -		fCallback(this.bCapaGravatar && '' !== sEmail ? LinkBuilder.avatarLink(sEmail) : '', sEmail);
    -	};
    -
    -	/**
    -	 * @param {string} sFolderFullNameRaw
    -	 * @param {string} sUid
    -	 * @return {string}
    -	 */
    -	CacheStorage.prototype.getMessageKey = function (sFolderFullNameRaw, sUid)
    -	{
    -		return sFolderFullNameRaw + '#' + sUid;
    -	};
    -
    -	/**
    -	 * @param {string} sFolder
    -	 * @param {string} sUid
    -	 */
    -	CacheStorage.prototype.addRequestedMessage = function (sFolder, sUid)
    -	{
    -		this.oRequestedMessage[this.getMessageKey(sFolder, sUid)] = true;
    -	};
    -
    -	/**
    -	 * @param {string} sFolder
    -	 * @param {string} sUid
    -	 * @return {boolean}
    -	 */
    -	CacheStorage.prototype.hasRequestedMessage = function (sFolder, sUid)
    -	{
    -		return true === this.oRequestedMessage[this.getMessageKey(sFolder, sUid)];
    -	};
    -
    -	/**
    -	 * @param {string} sFolderFullNameRaw
    -	 * @param {string} sUid
    -	 */
    -	CacheStorage.prototype.addNewMessageCache = function (sFolderFullNameRaw, sUid)
    -	{
    -		this.oNewMessage[this.getMessageKey(sFolderFullNameRaw, sUid)] = true;
    -	};
    -
    -	/**
    -	 * @param {string} sFolderFullNameRaw
    -	 * @param {string} sUid
    -	 */
    -	CacheStorage.prototype.hasNewMessageAndRemoveFromCache = function (sFolderFullNameRaw, sUid)
    -	{
    -		if (this.oNewMessage[this.getMessageKey(sFolderFullNameRaw, sUid)])
    -		{
    -			this.oNewMessage[this.getMessageKey(sFolderFullNameRaw, sUid)] = null;
    -			return true;
    -		}
    -
    -		return false;
    -	};
    -
    -	CacheStorage.prototype.clearNewMessageCache = function ()
    -	{
    -		this.oNewMessage = {};
    -	};
    -
    -	/**
    -	 * @param {string} sFolderHash
    -	 * @return {string}
    -	 */
    -	CacheStorage.prototype.getFolderFullNameRaw = function (sFolderHash)
    -	{
    -		return '' !== sFolderHash && this.oFoldersNamesCache[sFolderHash] ? this.oFoldersNamesCache[sFolderHash] : '';
    -	};
    -
    -	/**
    -	 * @param {string} sFolderHash
    -	 * @param {string} sFolderFullNameRaw
    -	 */
    -	CacheStorage.prototype.setFolderFullNameRaw = function (sFolderHash, sFolderFullNameRaw)
    -	{
    -		this.oFoldersNamesCache[sFolderHash] = sFolderFullNameRaw;
    -	};
    -
    -	/**
    -	 * @param {string} sFolderFullNameRaw
    -	 * @return {string}
    -	 */
    -	CacheStorage.prototype.getFolderHash = function (sFolderFullNameRaw)
    -	{
    -		return '' !== sFolderFullNameRaw && this.oFolderHashCache[sFolderFullNameRaw] ? this.oFolderHashCache[sFolderFullNameRaw] : '';
    -	};
    -
    -	/**
    -	 * @param {string} sFolderFullNameRaw
    -	 * @param {string} sFolderHash
    -	 */
    -	CacheStorage.prototype.setFolderHash = function (sFolderFullNameRaw, sFolderHash)
    -	{
    -		this.oFolderHashCache[sFolderFullNameRaw] = sFolderHash;
    -	};
    -
    -	/**
    -	 * @param {string} sFolderFullNameRaw
    -	 * @return {string}
    -	 */
    -	CacheStorage.prototype.getFolderUidNext = function (sFolderFullNameRaw)
    -	{
    -		return '' !== sFolderFullNameRaw && this.oFolderUidNextCache[sFolderFullNameRaw] ? this.oFolderUidNextCache[sFolderFullNameRaw] : '';
    -	};
    -
    -	/**
    -	 * @param {string} sFolderFullNameRaw
    -	 * @param {string} sUidNext
    -	 */
    -	CacheStorage.prototype.setFolderUidNext = function (sFolderFullNameRaw, sUidNext)
    -	{
    -		this.oFolderUidNextCache[sFolderFullNameRaw] = sUidNext;
    -	};
    -
    -	/**
    -	 * @param {string} sFolderFullNameRaw
    -	 * @return {?FolderModel}
    -	 */
    -	CacheStorage.prototype.getFolderFromCacheList = function (sFolderFullNameRaw)
    -	{
    -		return '' !== sFolderFullNameRaw && this.oFoldersCache[sFolderFullNameRaw] ? this.oFoldersCache[sFolderFullNameRaw] : null;
    -	};
    -
    -	/**
    -	 * @param {string} sFolderFullNameRaw
    -	 * @param {?FolderModel} oFolder
    -	 */
    -	CacheStorage.prototype.setFolderToCacheList = function (sFolderFullNameRaw, oFolder)
    -	{
    -		this.oFoldersCache[sFolderFullNameRaw] = oFolder;
    -	};
    -
    -	/**
    -	 * @param {string} sFolderFullNameRaw
    -	 */
    -	CacheStorage.prototype.removeFolderFromCacheList = function (sFolderFullNameRaw)
    -	{
    -		this.setFolderToCacheList(sFolderFullNameRaw, null);
    -	};
    -
    -	/**
    -	 * @param {string} sFolderFullName
    -	 * @param {string} sUid
    -	 * @return {?Array}
    -	 */
    -	CacheStorage.prototype.getMessageFlagsFromCache = function (sFolderFullName, sUid)
    -	{
    -		return this.oMessageFlagsCache[sFolderFullName] && this.oMessageFlagsCache[sFolderFullName][sUid] ?
    -			this.oMessageFlagsCache[sFolderFullName][sUid] : null;
    -	};
    -
    -	/**
    -	 * @param {string} sFolderFullName
    -	 * @param {string} sUid
    -	 * @param {Array} aFlagsCache
    -	 */
    -	CacheStorage.prototype.setMessageFlagsToCache = function (sFolderFullName, sUid, aFlagsCache)
    -	{
    -		if (!this.oMessageFlagsCache[sFolderFullName])
    -		{
    -			this.oMessageFlagsCache[sFolderFullName] = {};
    -		}
    -
    -		this.oMessageFlagsCache[sFolderFullName][sUid] = aFlagsCache;
    -	};
    -
    -	/**
    -	 * @param {string} sFolderFullName
    -	 */
    -	CacheStorage.prototype.clearMessageFlagsFromCacheByFolder = function (sFolderFullName)
    -	{
    -		this.oMessageFlagsCache[sFolderFullName] = {};
    -	};
    -
    -	/**
    -	 * @param {(MessageModel|null)} oMessage
    -	 */
    -	CacheStorage.prototype.initMessageFlagsFromCache = function (oMessage)
    -	{
    -		if (oMessage)
    -		{
    -			var
    -				self = this,
    -				aFlags = this.getMessageFlagsFromCache(oMessage.folderFullNameRaw, oMessage.uid),
    -				mUnseenSubUid = null,
    -				mFlaggedSubUid = null
    -			;
    -
    -			if (aFlags && 0 < aFlags.length)
    -			{
    -				oMessage.unseen(!!aFlags[0]);
    -				oMessage.flagged(!!aFlags[1]);
    -				oMessage.answered(!!aFlags[2]);
    -				oMessage.forwarded(!!aFlags[3]);
    -				oMessage.isReadReceipt(!!aFlags[4]);
    -			}
    -
    -			if (0 < oMessage.threads().length)
    -			{
    -				mUnseenSubUid = _.find(oMessage.threads(), function (iSubUid) {
    -					var aFlags = self.getMessageFlagsFromCache(oMessage.folderFullNameRaw, iSubUid);
    -					return aFlags && 0 < aFlags.length && !!aFlags[0];
    -				});
    -
    -				mFlaggedSubUid = _.find(oMessage.threads(), function (iSubUid) {
    -					var aFlags = self.getMessageFlagsFromCache(oMessage.folderFullNameRaw, iSubUid);
    -					return aFlags && 0 < aFlags.length && !!aFlags[1];
    -				});
    -
    -				oMessage.hasUnseenSubMessage(mUnseenSubUid && 0 < Utils.pInt(mUnseenSubUid));
    -				oMessage.hasFlaggedSubMessage(mFlaggedSubUid && 0 < Utils.pInt(mFlaggedSubUid));
    -			}
    -		}
    -	};
    -
    -	/**
    -	 * @param {(MessageModel|null)} oMessage
    -	 */
    -	CacheStorage.prototype.storeMessageFlagsToCache = function (oMessage)
    -	{
    -		if (oMessage)
    -		{
    -			this.setMessageFlagsToCache(
    -				oMessage.folderFullNameRaw,
    -				oMessage.uid,
    -				[oMessage.unseen(), oMessage.flagged(), oMessage.answered(), oMessage.forwarded(), oMessage.isReadReceipt()]
    -			);
    -		}
    -	};
    -	/**
    -	 * @param {string} sFolder
    -	 * @param {string} sUid
    -	 * @param {Array} aFlags
    -	 */
    -	CacheStorage.prototype.storeMessageFlagsToCacheByFolderAndUid = function (sFolder, sUid, aFlags)
    -	{
    -		if (Utils.isArray(aFlags) && 0 < aFlags.length)
    -		{
    -			this.setMessageFlagsToCache(sFolder, sUid, aFlags);
    -		}
    -	};
    -
    -	module.exports = new CacheStorage();
    -
    -}(module, require));
    -},{"Enums":6,"LinkBuilder":9,"Storage:Settings":53,"Utils":11,"_":20}],49:[function(require,module,exports){
    +},{"Storage:Abstract:Remote":42,"_":19}],45:[function(require,module,exports){
     /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
     
     (function (module, require) {
    @@ -10320,1273 +8378,7 @@ module.exports = window;
     
     	var
     		window = require('window'),
    -		$ = require('$'),
    -		_ = require('_'),
    -		ko = require('ko'),
    -		moment = require('moment'),
    -
    -		Consts = require('Consts'),
    -		Enums = require('Enums'),
    -		Globals = require('Globals'),
    -		Utils = require('Utils'),
    -		LinkBuilder = require('LinkBuilder'),
    -
    -		Settings = require('Storage:Settings'),
    -		Cache = require('Storage:RainLoop:Cache'),
    -
    -		kn = require('App:Knoin'),
    -
    -		MessageModel = require('Model:Message'),
    -
    -		LocalStorage = require('Storage:LocalStorage'),
    -		AbstractData = require('Storage:Abstract:Data')
    -	;
    -
    -	/**
    -	 * @constructor
    -	 * @extends AbstractData
    -	 */
    -	function DataStorage()
    -	{
    -		AbstractData.call(this);
    -
    -		var
    -			fRemoveSystemFolderType = function (observable) {
    -				return function () {
    -					var oFolder = Cache.getFolderFromCacheList(observable());
    -					if (oFolder)
    -					{
    -						oFolder.type(Enums.FolderType.User);
    -					}
    -				};
    -			},
    -			fSetSystemFolderType = function (iType) {
    -				return function (sValue) {
    -					var oFolder = Cache.getFolderFromCacheList(sValue);
    -					if (oFolder)
    -					{
    -						oFolder.type(iType);
    -					}
    -				};
    -			}
    -		;
    -
    -		this.devEmail = '';
    -		this.devPassword = '';
    -
    -		this.accountEmail = ko.observable('');
    -		this.accountIncLogin = ko.observable('');
    -		this.accountOutLogin = ko.observable('');
    -		this.projectHash = ko.observable('');
    -		this.threading = ko.observable(false);
    -
    -		this.lastFoldersHash = '';
    -		this.remoteSuggestions = false;
    -
    -		// system folders
    -		this.sentFolder = ko.observable('');
    -		this.draftFolder = ko.observable('');
    -		this.spamFolder = ko.observable('');
    -		this.trashFolder = ko.observable('');
    -		this.archiveFolder = ko.observable('');
    -
    -		this.sentFolder.subscribe(fRemoveSystemFolderType(this.sentFolder), this, 'beforeChange');
    -		this.draftFolder.subscribe(fRemoveSystemFolderType(this.draftFolder), this, 'beforeChange');
    -		this.spamFolder.subscribe(fRemoveSystemFolderType(this.spamFolder), this, 'beforeChange');
    -		this.trashFolder.subscribe(fRemoveSystemFolderType(this.trashFolder), this, 'beforeChange');
    -		this.archiveFolder.subscribe(fRemoveSystemFolderType(this.archiveFolder), this, 'beforeChange');
    -
    -		this.sentFolder.subscribe(fSetSystemFolderType(Enums.FolderType.SentItems), this);
    -		this.draftFolder.subscribe(fSetSystemFolderType(Enums.FolderType.Draft), this);
    -		this.spamFolder.subscribe(fSetSystemFolderType(Enums.FolderType.Spam), this);
    -		this.trashFolder.subscribe(fSetSystemFolderType(Enums.FolderType.Trash), this);
    -		this.archiveFolder.subscribe(fSetSystemFolderType(Enums.FolderType.Archive), this);
    -
    -		this.draftFolderNotEnabled = ko.computed(function () {
    -			return '' === this.draftFolder() || Consts.Values.UnuseOptionValue === this.draftFolder();
    -		}, this);
    -
    -		// personal
    -		this.displayName = ko.observable('');
    -		this.signature = ko.observable('');
    -		this.signatureToAll = ko.observable(false);
    -		this.replyTo = ko.observable('');
    -
    -		// security
    -		this.enableTwoFactor = ko.observable(false);
    -
    -		// accounts
    -		this.accounts = ko.observableArray([]);
    -		this.accountsLoading = ko.observable(false).extend({'throttle': 100});
    -
    -		// identities
    -		this.defaultIdentityID = ko.observable('');
    -		this.identities = ko.observableArray([]);
    -		this.identitiesLoading = ko.observable(false).extend({'throttle': 100});
    -
    -		// contacts
    -		this.contactTags = ko.observableArray([]);
    -		this.contacts = ko.observableArray([]);
    -		this.contacts.loading = ko.observable(false).extend({'throttle': 200});
    -		this.contacts.importing = ko.observable(false).extend({'throttle': 200});
    -		this.contacts.syncing = ko.observable(false).extend({'throttle': 200});
    -		this.contacts.exportingVcf = ko.observable(false).extend({'throttle': 200});
    -		this.contacts.exportingCsv = ko.observable(false).extend({'throttle': 200});
    -
    -		this.allowContactsSync = ko.observable(false);
    -		this.enableContactsSync = ko.observable(false);
    -		this.contactsSyncUrl = ko.observable('');
    -		this.contactsSyncUser = ko.observable('');
    -		this.contactsSyncPass = ko.observable('');
    -
    -		this.allowContactsSync = ko.observable(!!Settings.settingsGet('ContactsSyncIsAllowed'));
    -		this.enableContactsSync = ko.observable(!!Settings.settingsGet('EnableContactsSync'));
    -		this.contactsSyncUrl = ko.observable(Settings.settingsGet('ContactsSyncUrl'));
    -		this.contactsSyncUser = ko.observable(Settings.settingsGet('ContactsSyncUser'));
    -		this.contactsSyncPass = ko.observable(Settings.settingsGet('ContactsSyncPassword'));
    -
    -		// folders
    -		this.namespace = '';
    -		this.folderList = ko.observableArray([]);
    -		this.folderList.focused = ko.observable(false);
    -
    -		this.foldersListError = ko.observable('');
    -
    -		this.foldersLoading = ko.observable(false);
    -		this.foldersCreating = ko.observable(false);
    -		this.foldersDeleting = ko.observable(false);
    -		this.foldersRenaming = ko.observable(false);
    -
    -		this.foldersChanging = ko.computed(function () {
    -			var
    -				bLoading = this.foldersLoading(),
    -				bCreating = this.foldersCreating(),
    -				bDeleting = this.foldersDeleting(),
    -				bRenaming = this.foldersRenaming()
    -			;
    -			return bLoading || bCreating || bDeleting || bRenaming;
    -		}, this);
    -
    -		this.foldersInboxUnreadCount = ko.observable(0);
    -
    -		this.currentFolder = ko.observable(null).extend({'toggleSubscribe': [null,
    -			function (oPrev) {
    -				if (oPrev)
    -				{
    -					oPrev.selected(false);
    -				}
    -			}, function (oNext) {
    -				if (oNext)
    -				{
    -					oNext.selected(true);
    -				}
    -			}
    -		]});
    -
    -		this.currentFolderFullNameRaw = ko.computed(function () {
    -			return this.currentFolder() ? this.currentFolder().fullNameRaw : '';
    -		}, this);
    -
    -		this.currentFolderFullName = ko.computed(function () {
    -			return this.currentFolder() ? this.currentFolder().fullName : '';
    -		}, this);
    -
    -		this.currentFolderFullNameHash = ko.computed(function () {
    -			return this.currentFolder() ? this.currentFolder().fullNameHash : '';
    -		}, this);
    -
    -		this.currentFolderName = ko.computed(function () {
    -			return this.currentFolder() ? this.currentFolder().name() : '';
    -		}, this);
    -
    -		this.folderListSystemNames = ko.computed(function () {
    -
    -			var
    -				aList = ['INBOX'],
    -				aFolders = this.folderList(),
    -				sSentFolder = this.sentFolder(),
    -				sDraftFolder = this.draftFolder(),
    -				sSpamFolder = this.spamFolder(),
    -				sTrashFolder = this.trashFolder(),
    -				sArchiveFolder = this.archiveFolder()
    -			;
    -
    -			if (Utils.isArray(aFolders) && 0 < aFolders.length)
    -			{
    -				if ('' !== sSentFolder && Consts.Values.UnuseOptionValue !== sSentFolder)
    -				{
    -					aList.push(sSentFolder);
    -				}
    -				if ('' !== sDraftFolder && Consts.Values.UnuseOptionValue !== sDraftFolder)
    -				{
    -					aList.push(sDraftFolder);
    -				}
    -				if ('' !== sSpamFolder && Consts.Values.UnuseOptionValue !== sSpamFolder)
    -				{
    -					aList.push(sSpamFolder);
    -				}
    -				if ('' !== sTrashFolder && Consts.Values.UnuseOptionValue !== sTrashFolder)
    -				{
    -					aList.push(sTrashFolder);
    -				}
    -				if ('' !== sArchiveFolder && Consts.Values.UnuseOptionValue !== sArchiveFolder)
    -				{
    -					aList.push(sArchiveFolder);
    -				}
    -			}
    -
    -			return aList;
    -
    -		}, this);
    -
    -		this.folderListSystem = ko.computed(function () {
    -			return _.compact(_.map(this.folderListSystemNames(), function (sName) {
    -				return Cache.getFolderFromCacheList(sName);
    -			}));
    -		}, this);
    -
    -		this.folderMenuForMove = ko.computed(function () {
    -			return Utils.folderListOptionsBuilder(this.folderListSystem(), this.folderList(), [
    -				this.currentFolderFullNameRaw()
    -			], null, null, null, null, function (oItem) {
    -				return oItem ? oItem.localName() : '';
    -			});
    -		}, this);
    -
    -		// message list
    -		this.staticMessageList = [];
    -
    -		this.messageList = ko.observableArray([]).extend({'rateLimit': 0});
    -
    -		this.messageListCount = ko.observable(0);
    -		this.messageListSearch = ko.observable('');
    -		this.messageListPage = ko.observable(1);
    -
    -		this.messageListThreadFolder = ko.observable('');
    -		this.messageListThreadUids = ko.observableArray([]);
    -
    -		this.messageListThreadFolder.subscribe(function () {
    -			this.messageListThreadUids([]);
    -		}, this);
    -
    -		this.messageListEndFolder = ko.observable('');
    -		this.messageListEndSearch = ko.observable('');
    -		this.messageListEndPage = ko.observable(1);
    -
    -		this.messageListEndHash = ko.computed(function () {
    -			return this.messageListEndFolder() + '|' + this.messageListEndSearch() + '|' + this.messageListEndPage();
    -		}, this);
    -
    -		this.messageListPageCount = ko.computed(function () {
    -			var iPage = window.Math.ceil(this.messageListCount() / this.messagesPerPage());
    -			return 0 >= iPage ? 1 : iPage;
    -		}, this);
    -
    -		this.mainMessageListSearch = ko.computed({
    -			'read': this.messageListSearch,
    -			'write': function (sValue) {
    -				kn.setHash(LinkBuilder.mailBox(
    -					this.currentFolderFullNameHash(), 1, Utils.trim(sValue.toString())
    -				));
    -			},
    -			'owner': this
    -		});
    -
    -		this.messageListError = ko.observable('');
    -
    -		this.messageListLoading = ko.observable(false);
    -		this.messageListIsNotCompleted = ko.observable(false);
    -		this.messageListCompleteLoadingThrottle = ko.observable(false).extend({'throttle': 200});
    -
    -		this.messageListCompleteLoading = ko.computed(function () {
    -			var
    -				bOne = this.messageListLoading(),
    -				bTwo = this.messageListIsNotCompleted()
    -			;
    -			return bOne || bTwo;
    -		}, this);
    -
    -		this.messageListCompleteLoading.subscribe(function (bValue) {
    -			this.messageListCompleteLoadingThrottle(bValue);
    -		}, this);
    -
    -		this.messageList.subscribe(_.debounce(function (aList) {
    -			_.each(aList, function (oItem) {
    -				if (oItem.newForAnimation())
    -				{
    -					oItem.newForAnimation(false);
    -				}
    -			});
    -		}, 500));
    -
    -		// message preview
    -		this.staticMessageList = new MessageModel();
    -		this.message = ko.observable(null);
    -		this.messageLoading = ko.observable(false);
    -		this.messageLoadingThrottle = ko.observable(false).extend({'throttle': 50});
    -
    -		this.message.focused = ko.observable(false);
    -
    -		this.message.subscribe(function (oMessage) {
    -			if (!oMessage)
    -			{
    -				this.message.focused(false);
    -				this.messageFullScreenMode(false);
    -				this.hideMessageBodies();
    -
    -				if (Enums.Layout.NoPreview === this.layout() &&
    -					-1 < window.location.hash.indexOf('message-preview'))
    -				{
    -					if (Globals.__APP)
    -					{
    -						Globals.__APP.historyBack();
    -					}
    -				}
    -			}
    -			else if (Enums.Layout.NoPreview === this.layout())
    -			{
    -				this.message.focused(true);
    -			}
    -		}, this);
    -
    -		this.message.focused.subscribe(function (bValue) {
    -			if (bValue)
    -			{
    -				this.folderList.focused(false);
    -				Globals.keyScope(Enums.KeyState.MessageView);
    -			}
    -			else if (Enums.KeyState.MessageView === Globals.keyScope())
    -			{
    -				if (Enums.Layout.NoPreview === this.layout() && this.message())
    -				{
    -					Globals.keyScope(Enums.KeyState.MessageView);
    -				}
    -				else
    -				{
    -					Globals.keyScope(Enums.KeyState.MessageList);
    -				}
    -			}
    -		}, this);
    -
    -		this.folderList.focused.subscribe(function (bValue) {
    -			if (bValue)
    -			{
    -				Globals.keyScope(Enums.KeyState.FolderList);
    -			}
    -			else if (Enums.KeyState.FolderList === Globals.keyScope())
    -			{
    -				Globals.keyScope(Enums.KeyState.MessageList);
    -			}
    -		});
    -
    -		this.messageLoading.subscribe(function (bValue) {
    -			this.messageLoadingThrottle(bValue);
    -		}, this);
    -
    -		this.messageFullScreenMode = ko.observable(false);
    -
    -		this.messageError = ko.observable('');
    -
    -		this.messagesBodiesDom = ko.observable(null);
    -
    -		this.messagesBodiesDom.subscribe(function (oDom) {
    -			if (oDom && !(oDom instanceof $))
    -			{
    -				this.messagesBodiesDom($(oDom));
    -			}
    -		}, this);
    -
    -		this.messageActiveDom = ko.observable(null);
    -
    -		this.isMessageSelected = ko.computed(function () {
    -			return null !== this.message();
    -		}, this);
    -
    -		this.currentMessage = ko.observable(null);
    -
    -		this.messageListChecked = ko.computed(function () {
    -			return _.filter(this.messageList(), function (oItem) {
    -				return oItem.checked();
    -			});
    -		}, this).extend({'rateLimit': 0});
    -
    -		this.hasCheckedMessages = ko.computed(function () {
    -			return 0 < this.messageListChecked().length;
    -		}, this).extend({'rateLimit': 0});
    -
    -		this.messageListCheckedOrSelected = ko.computed(function () {
    -
    -			var
    -				aChecked = this.messageListChecked(),
    -				oSelectedMessage = this.currentMessage()
    -			;
    -
    -			return _.union(aChecked, oSelectedMessage ? [oSelectedMessage] : []);
    -
    -		}, this);
    -
    -		this.messageListCheckedOrSelectedUidsWithSubMails = ko.computed(function () {
    -			var aList = [];
    -			_.each(this.messageListCheckedOrSelected(), function (oMessage) {
    -				if (oMessage)
    -				{
    -					aList.push(oMessage.uid);
    -					if (0 < oMessage.threadsLen() && 0 === oMessage.parentUid() && oMessage.lastInCollapsedThread())
    -					{
    -						aList = _.union(aList, oMessage.threads());
    -					}
    -				}
    -			});
    -			return aList;
    -		}, this);
    -
    -		// quota
    -		this.userQuota = ko.observable(0);
    -		this.userUsageSize = ko.observable(0);
    -		this.userUsageProc = ko.computed(function () {
    -
    -			var
    -				iQuota = this.userQuota(),
    -				iUsed = this.userUsageSize()
    -			;
    -
    -			return 0 < iQuota ? window.Math.ceil((iUsed / iQuota) * 100) : 0;
    -
    -		}, this);
    -
    -		// other
    -		this.capaOpenPGP = ko.observable(false);
    -		this.openpgpkeys = ko.observableArray([]);
    -		this.openpgpKeyring = null;
    -
    -		this.openpgpkeysPublic = this.openpgpkeys.filter(function (oItem) {
    -			return !!(oItem && !oItem.isPrivate);
    -		});
    -
    -		this.openpgpkeysPrivate = this.openpgpkeys.filter(function (oItem) {
    -			return !!(oItem && oItem.isPrivate);
    -		});
    -
    -		// google
    -		this.googleActions = ko.observable(false);
    -		this.googleLoggined = ko.observable(false);
    -		this.googleUserName = ko.observable('');
    -
    -		// facebook
    -		this.facebookActions = ko.observable(false);
    -		this.facebookLoggined = ko.observable(false);
    -		this.facebookUserName = ko.observable('');
    -
    -		// twitter
    -		this.twitterActions = ko.observable(false);
    -		this.twitterLoggined = ko.observable(false);
    -		this.twitterUserName = ko.observable('');
    -
    -		this.customThemeType = ko.observable(Enums.CustomThemeType.Light);
    -
    -		this.purgeMessageBodyCacheThrottle = _.throttle(this.purgeMessageBodyCache, 1000 * 30);
    -	}
    -
    -	_.extend(DataStorage.prototype, AbstractData.prototype);
    -
    -	DataStorage.prototype.purgeMessageBodyCache = function()
    -	{
    -		var
    -			iCount = 0,
    -			oMessagesBodiesDom = null,
    -			iEnd = Globals.iMessageBodyCacheCount - Consts.Values.MessageBodyCacheLimit
    -		;
    -
    -		if (0 < iEnd)
    -		{
    -			oMessagesBodiesDom = this.messagesBodiesDom();
    -			if (oMessagesBodiesDom)
    -			{
    -				oMessagesBodiesDom.find('.rl-cache-class').each(function () {
    -					var oItem = $(this);
    -					if (iEnd > oItem.data('rl-cache-count'))
    -					{
    -						oItem.addClass('rl-cache-purge');
    -						iCount++;
    -					}
    -				});
    -
    -				if (0 < iCount)
    -				{
    -					_.delay(function () {
    -						oMessagesBodiesDom.find('.rl-cache-purge').remove();
    -					}, 300);
    -				}
    -			}
    -		}
    -	};
    -
    -	DataStorage.prototype.populateDataOnStart = function()
    -	{
    -		AbstractData.prototype.populateDataOnStart.call(this);
    -
    -		this.accountEmail(Settings.settingsGet('Email'));
    -		this.accountIncLogin(Settings.settingsGet('IncLogin'));
    -		this.accountOutLogin(Settings.settingsGet('OutLogin'));
    -		this.projectHash(Settings.settingsGet('ProjectHash'));
    -
    -		this.defaultIdentityID(Settings.settingsGet('DefaultIdentityID'));
    -
    -		this.displayName(Settings.settingsGet('DisplayName'));
    -		this.replyTo(Settings.settingsGet('ReplyTo'));
    -		this.signature(Settings.settingsGet('Signature'));
    -		this.signatureToAll(!!Settings.settingsGet('SignatureToAll'));
    -		this.enableTwoFactor(!!Settings.settingsGet('EnableTwoFactor'));
    -
    -		this.lastFoldersHash = LocalStorage.get(Enums.ClientSideKeyName.FoldersLashHash) || '';
    -
    -		this.remoteSuggestions = !!Settings.settingsGet('RemoteSuggestions');
    -
    -		this.devEmail = Settings.settingsGet('DevEmail');
    -		this.devPassword = Settings.settingsGet('DevPassword');
    -	};
    -
    -	DataStorage.prototype.initUidNextAndNewMessages = function (sFolder, sUidNext, aNewMessages)
    -	{
    -		if ('INBOX' === sFolder && Utils.isNormal(sUidNext) && sUidNext !== '')
    -		{
    -			if (Utils.isArray(aNewMessages) && 0 < aNewMessages.length)
    -			{
    -				var
    -					self = this,
    -					iIndex = 0,
    -					iLen = aNewMessages.length,
    -					fNotificationHelper = function (sImageSrc, sTitle, sText)
    -					{
    -						var
    -							NotificationClass = Utils.notificationClass(),
    -							oNotification = null
    -						;
    -						
    -						if (NotificationClass && self.useDesktopNotifications())
    -						{
    -							oNotification = new NotificationClass(sTitle, {
    -								'body': sText,
    -								'icon': sImageSrc
    -							});
    -
    -							if (oNotification)
    -							{
    -								if (oNotification.show)
    -								{
    -									oNotification.show();
    -								}
    -
    -								window.setTimeout((function (oLocalNotifications) {
    -									return function () {
    -										if (oLocalNotifications.cancel)
    -										{
    -											oLocalNotifications.cancel();
    -										}
    -										else if (oLocalNotifications.close)
    -										{
    -											oLocalNotifications.close();
    -										}
    -									};
    -								}(oNotification)), 7000);
    -							}
    -						}
    -					}
    -				;
    -
    -				_.each(aNewMessages, function (oItem) {
    -					Cache.addNewMessageCache(sFolder, oItem.Uid);
    -				});
    -
    -				if (3 < iLen)
    -				{
    -					fNotificationHelper(
    -						LinkBuilder.notificationMailIcon(),
    -						this.accountEmail(),
    -						Utils.i18n('MESSAGE_LIST/NEW_MESSAGE_NOTIFICATION', {
    -							'COUNT': iLen
    -						})
    -					);
    -				}
    -				else
    -				{
    -					for (; iIndex < iLen; iIndex++)
    -					{
    -						fNotificationHelper(
    -							LinkBuilder.notificationMailIcon(),
    -							MessageModel.emailsToLine(MessageModel.initEmailsFromJson(aNewMessages[iIndex].From), false),
    -							aNewMessages[iIndex].Subject
    -						);
    -					}
    -				}
    -			}
    -
    -			Cache.setFolderUidNext(sFolder, sUidNext);
    -		}
    -	};
    -
    -	DataStorage.prototype.hideMessageBodies = function ()
    -	{
    -		var oMessagesBodiesDom = this.messagesBodiesDom();
    -		if (oMessagesBodiesDom)
    -		{
    -			oMessagesBodiesDom.find('.b-text-part').hide();
    -		}
    -	};
    -
    -	/**
    -	 * @param {boolean=} bBoot = false
    -	 * @returns {Array}
    -	 */
    -	DataStorage.prototype.getNextFolderNames = function (bBoot)
    -	{
    -		bBoot = Utils.isUnd(bBoot) ? false : !!bBoot;
    -
    -		var
    -			aResult = [],
    -			iLimit = 10,
    -			iUtc = moment().unix(),
    -			iTimeout = iUtc - 60 * 5,
    -			aTimeouts = [],
    -			fSearchFunction = function (aList) {
    -				_.each(aList, function (oFolder) {
    -					if (oFolder && 'INBOX' !== oFolder.fullNameRaw &&
    -						oFolder.selectable && oFolder.existen &&
    -						iTimeout > oFolder.interval &&
    -						(!bBoot || oFolder.subScribed()))
    -					{
    -						aTimeouts.push([oFolder.interval, oFolder.fullNameRaw]);
    -					}
    -
    -					if (oFolder && 0 < oFolder.subFolders().length)
    -					{
    -						fSearchFunction(oFolder.subFolders());
    -					}
    -				});
    -			}
    -		;
    -
    -		fSearchFunction(this.folderList());
    -
    -		aTimeouts.sort(function(a, b) {
    -			if (a[0] < b[0])
    -			{
    -				return -1;
    -			}
    -			else if (a[0] > b[0])
    -			{
    -				return 1;
    -			}
    -
    -			return 0;
    -		});
    -
    -		_.find(aTimeouts, function (aItem) {
    -			var oFolder = Cache.getFolderFromCacheList(aItem[1]);
    -			if (oFolder)
    -			{
    -				oFolder.interval = iUtc;
    -				aResult.push(aItem[1]);
    -			}
    -
    -			return iLimit <= aResult.length;
    -		});
    -
    -		return _.uniq(aResult);
    -	};
    -
    -	/**
    -	 * @param {string} sFromFolderFullNameRaw
    -	 * @param {Array} aUidForRemove
    -	 * @param {string=} sToFolderFullNameRaw = ''
    -	 * @param {bCopy=} bCopy = false
    -	 */
    -	DataStorage.prototype.removeMessagesFromList = function (
    -		sFromFolderFullNameRaw, aUidForRemove, sToFolderFullNameRaw, bCopy)
    -	{
    -		sToFolderFullNameRaw = Utils.isNormal(sToFolderFullNameRaw) ? sToFolderFullNameRaw : '';
    -		bCopy = Utils.isUnd(bCopy) ? false : !!bCopy;
    -
    -		aUidForRemove = _.map(aUidForRemove, function (mValue) {
    -			return Utils.pInt(mValue);
    -		});
    -
    -		var
    -			self = this,
    -			iUnseenCount = 0,
    -			aMessageList = this.messageList(),
    -			oFromFolder = Cache.getFolderFromCacheList(sFromFolderFullNameRaw),
    -			oToFolder = '' === sToFolderFullNameRaw ? null : Cache.getFolderFromCacheList(sToFolderFullNameRaw || ''),
    -			sCurrentFolderFullNameRaw = this.currentFolderFullNameRaw(),
    -			oCurrentMessage = this.message(),
    -			aMessages = sCurrentFolderFullNameRaw === sFromFolderFullNameRaw ? _.filter(aMessageList, function (oMessage) {
    -				return oMessage && -1 < Utils.inArray(Utils.pInt(oMessage.uid), aUidForRemove);
    -			}) : []
    -		;
    -
    -		_.each(aMessages, function (oMessage) {
    -			if (oMessage && oMessage.unseen())
    -			{
    -				iUnseenCount++;
    -			}
    -		});
    -
    -		if (oFromFolder && !bCopy)
    -		{
    -			oFromFolder.messageCountAll(0 <= oFromFolder.messageCountAll() - aUidForRemove.length ?
    -				oFromFolder.messageCountAll() - aUidForRemove.length : 0);
    -
    -			if (0 < iUnseenCount)
    -			{
    -				oFromFolder.messageCountUnread(0 <= oFromFolder.messageCountUnread() - iUnseenCount ?
    -					oFromFolder.messageCountUnread() - iUnseenCount : 0);
    -			}
    -		}
    -
    -		if (oToFolder)
    -		{
    -			oToFolder.messageCountAll(oToFolder.messageCountAll() + aUidForRemove.length);
    -			if (0 < iUnseenCount)
    -			{
    -				oToFolder.messageCountUnread(oToFolder.messageCountUnread() + iUnseenCount);
    -			}
    -
    -			oToFolder.actionBlink(true);
    -		}
    -
    -		if (0 < aMessages.length)
    -		{
    -			if (bCopy)
    -			{
    -				_.each(aMessages, function (oMessage) {
    -					oMessage.checked(false);
    -				});
    -			}
    -			else
    -			{
    -				this.messageListIsNotCompleted(true);
    -
    -				_.each(aMessages, function (oMessage) {
    -					if (oCurrentMessage && oCurrentMessage.hash === oMessage.hash)
    -					{
    -						oCurrentMessage = null;
    -						self.message(null);
    -					}
    -
    -					oMessage.deleted(true);
    -				});
    -
    -				_.delay(function () {
    -					_.each(aMessages, function (oMessage) {
    -						self.messageList.remove(oMessage);
    -					});
    -				}, 400);
    -			}
    -		}
    -
    -		if ('' !== sFromFolderFullNameRaw)
    -		{
    -			Cache.setFolderHash(sFromFolderFullNameRaw, '');
    -		}
    -
    -		if ('' !== sToFolderFullNameRaw)
    -		{
    -			Cache.setFolderHash(sToFolderFullNameRaw, '');
    -		}
    -	};
    -
    -	DataStorage.prototype.setMessage = function (oData, bCached)
    -	{
    -		var
    -			bIsHtml = false,
    -			bHasExternals = false,
    -			bHasInternals = false,
    -			oBody = null,
    -			oTextBody = null,
    -			sId = '',
    -			sResultHtml = '',
    -			bPgpSigned = false,
    -			bPgpEncrypted = false,
    -			oMessagesBodiesDom = this.messagesBodiesDom(),
    -			oMessage = this.message()
    -		;
    -
    -		if (oData && oMessage && oData.Result && 'Object/Message' === oData.Result['@Object'] &&
    -			oMessage.folderFullNameRaw === oData.Result.Folder && oMessage.uid === oData.Result.Uid)
    -		{
    -			this.messageError('');
    -
    -			oMessage.initUpdateByMessageJson(oData.Result);
    -			Cache.addRequestedMessage(oMessage.folderFullNameRaw, oMessage.uid);
    -
    -			if (!bCached)
    -			{
    -				oMessage.initFlagsByJson(oData.Result);
    -			}
    -
    -			oMessagesBodiesDom = oMessagesBodiesDom && oMessagesBodiesDom[0] ? oMessagesBodiesDom : null;
    -			if (oMessagesBodiesDom)
    -			{
    -				sId = 'rl-mgs-' + oMessage.hash.replace(/[^a-zA-Z0-9]/g, '');
    -				oTextBody = oMessagesBodiesDom.find('#' + sId);
    -				if (!oTextBody || !oTextBody[0])
    -				{
    -					bHasExternals = !!oData.Result.HasExternals;
    -					bHasInternals = !!oData.Result.HasInternals;
    -
    -					oBody = $('
    ').hide().addClass('rl-cache-class'); - oBody.data('rl-cache-count', ++Globals.iMessageBodyCacheCount); - - if (Utils.isNormal(oData.Result.Html) && '' !== oData.Result.Html) - { - bIsHtml = true; - sResultHtml = oData.Result.Html.toString(); - } - else if (Utils.isNormal(oData.Result.Plain) && '' !== oData.Result.Plain) - { - bIsHtml = false; - sResultHtml = Utils.plainToHtml(oData.Result.Plain.toString(), false); - - if ((oMessage.isPgpSigned() || oMessage.isPgpEncrypted()) && this.capaOpenPGP()) - { - oMessage.plainRaw = Utils.pString(oData.Result.Plain); - - bPgpEncrypted = /---BEGIN PGP MESSAGE---/.test(oMessage.plainRaw); - if (!bPgpEncrypted) - { - bPgpSigned = /-----BEGIN PGP SIGNED MESSAGE-----/.test(oMessage.plainRaw) && - /-----BEGIN PGP SIGNATURE-----/.test(oMessage.plainRaw); - } - - Globals.$div.empty(); - if (bPgpSigned && oMessage.isPgpSigned()) - { - sResultHtml = - Globals.$div.append( - $('
    ').text(oMessage.plainRaw)
    -									).html()
    -								;
    -							}
    -							else if (bPgpEncrypted && oMessage.isPgpEncrypted())
    -							{
    -								sResultHtml =
    -									Globals.$div.append(
    -										$('
    ').text(oMessage.plainRaw)
    -									).html()
    -								;
    -							}
    -
    -							Globals.$div.empty();
    -
    -							oMessage.isPgpSigned(bPgpSigned);
    -							oMessage.isPgpEncrypted(bPgpEncrypted);
    -						}
    -					}
    -					else
    -					{
    -						bIsHtml = false;
    -					}
    -
    -					oBody
    -						.html(Utils.linkify(sResultHtml))
    -						.addClass('b-text-part ' + (bIsHtml ? 'html' : 'plain'))
    -					;
    -
    -					oMessage.isHtml(!!bIsHtml);
    -					oMessage.hasImages(!!bHasExternals);
    -					oMessage.pgpSignedVerifyStatus(Enums.SignedVerifyStatus.None);
    -					oMessage.pgpSignedVerifyUser('');
    -
    -					oMessage.body = oBody;
    -					if (oMessage.body)
    -					{
    -						oMessagesBodiesDom.append(oMessage.body);
    -					}
    -
    -					oMessage.storeDataToDom();
    -
    -					if (bHasInternals)
    -					{
    -						oMessage.showInternalImages(true);
    -					}
    -
    -					if (oMessage.hasImages() && this.showImages())
    -					{
    -						oMessage.showExternalImages(true);
    -					}
    -
    -					this.purgeMessageBodyCacheThrottle();
    -				}
    -				else
    -				{
    -					oMessage.body = oTextBody;
    -					if (oMessage.body)
    -					{
    -						oMessage.body.data('rl-cache-count', ++Globals.iMessageBodyCacheCount);
    -						oMessage.fetchDataToDom();
    -					}
    -				}
    -
    -				this.messageActiveDom(oMessage.body);
    -
    -				this.hideMessageBodies();
    -				oMessage.body.show();
    -
    -				if (oBody)
    -				{
    -					Utils.initBlockquoteSwitcher(oBody);
    -				}
    -			}
    -
    -			Cache.initMessageFlagsFromCache(oMessage);
    -			if (oMessage.unseen())
    -			{
    -				if (Globals.__APP)
    -				{
    -					Globals.__APP.setMessageSeen(oMessage);
    -				}
    -			}
    -
    -			Utils.windowResize();
    -		}
    -	};
    -
    -	/**
    -	 * @param {Array} aList
    -	 * @returns {string}
    -	 */
    -	DataStorage.prototype.calculateMessageListHash = function (aList)
    -	{
    -		return _.map(aList, function (oMessage) {
    -			return '' + oMessage.hash + '_' + oMessage.threadsLen() + '_' + oMessage.flagHash();
    -		}).join('|');
    -	};
    -
    -	DataStorage.prototype.findPublicKeyByHex = function (sHash)
    -	{
    -		return _.find(this.openpgpkeysPublic(), function (oItem) {
    -			return oItem && sHash === oItem.id;
    -		});
    -	};
    -
    -	DataStorage.prototype.findPublicKeysByEmail = function (sEmail)
    -	{
    -		return _.compact(_.map(this.openpgpkeysPublic(), function (oItem) {
    -
    -			var oKey = null;
    -			if (oItem && sEmail === oItem.email)
    -			{
    -				try
    -				{
    -					oKey = window.openpgp.key.readArmored(oItem.armor);
    -					if (oKey && !oKey.err && oKey.keys && oKey.keys[0])
    -					{
    -						return oKey.keys[0];
    -					}
    -				}
    -				catch (e) {}
    -			}
    -
    -			return null;
    -
    -		}));
    -	};
    -
    -	/**
    -	 * @param {string} sEmail
    -	 * @param {string=} sPassword
    -	 * @returns {?}
    -	 */
    -	DataStorage.prototype.findPrivateKeyByEmail = function (sEmail, sPassword)
    -	{
    -		var
    -			oPrivateKey = null,
    -			oKey = _.find(this.openpgpkeysPrivate(), function (oItem) {
    -				return oItem && sEmail === oItem.email;
    -			})
    -		;
    -
    -		if (oKey)
    -		{
    -			try
    -			{
    -				oPrivateKey = window.openpgp.key.readArmored(oKey.armor);
    -				if (oPrivateKey && !oPrivateKey.err && oPrivateKey.keys && oPrivateKey.keys[0])
    -				{
    -					oPrivateKey = oPrivateKey.keys[0];
    -					oPrivateKey.decrypt(Utils.pString(sPassword));
    -				}
    -				else
    -				{
    -					oPrivateKey = null;
    -				}
    -			}
    -			catch (e)
    -			{
    -				oPrivateKey = null;
    -			}
    -		}
    -
    -		return oPrivateKey;
    -	};
    -
    -	/**
    -	 * @param {string=} sPassword
    -	 * @returns {?}
    -	 */
    -	DataStorage.prototype.findSelfPrivateKey = function (sPassword)
    -	{
    -		return this.findPrivateKeyByEmail(this.accountEmail(), sPassword);
    -	};
    -
    -	module.exports = new DataStorage();
    -
    -}(module, require));
    -
    -},{"$":15,"App:Knoin":22,"Consts":5,"Enums":6,"Globals":8,"LinkBuilder":9,"Model:Message":29,"Storage:Abstract:Data":44,"Storage:LocalStorage":50,"Storage:RainLoop:Cache":48,"Storage:Settings":53,"Utils":11,"_":20,"ko":17,"moment":18,"window":21}],50:[function(require,module,exports){
    -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
    -
    -(function (module, require) {
    -
    -	'use strict';
    -
    -	/**
    -	 * @constructor
    -	 */
    -	function LocalStorage()
    -	{
    -		var
    -			_ = require('_'),
    -			NextStorageDriver = _.find([
    -				require('Storage:LocalStorage:Cookie'),
    -				require('Storage:LocalStorage:LocalStorage')
    -			], function (NextStorageDriver) {
    -				return NextStorageDriver.supported();
    -			})
    -		;
    -
    -		this.oDriver = null;
    -
    -		if (NextStorageDriver)
    -		{
    -			this.oDriver = new NextStorageDriver();
    -		}
    -	}
    -
    -	LocalStorage.prototype.oDriver = null;
    -
    -	/**
    -	 * @param {number} iKey
    -	 * @param {*} mData
    -	 * @return {boolean}
    -	 */
    -	LocalStorage.prototype.set = function (iKey, mData)
    -	{
    -		return this.oDriver ? this.oDriver.set('p' + iKey, mData) : false;
    -	};
    -
    -	/**
    -	 * @param {number} iKey
    -	 * @return {*}
    -	 */
    -	LocalStorage.prototype.get = function (iKey)
    -	{
    -		return this.oDriver ? this.oDriver.get('p' + iKey) : null;
    -	};
    -
    -	module.exports = new LocalStorage();
    -
    -}(module, require));
    -},{"Storage:LocalStorage:Cookie":51,"Storage:LocalStorage:LocalStorage":52,"_":20}],51:[function(require,module,exports){
    -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
    -
    -(function (module, require) {
    -
    -	'use strict';
    -
    -	var
    -		$ = require('$'),
    -		JSON = require('JSON'),
    -
    -		Consts = require('Consts'),
    -		Utils = require('Utils')
    -	;
    -
    -	/**
    -	 * @constructor
    -	 */
    -	function CookieDriver()
    -	{
    -
    -	}
    -
    -	CookieDriver.supported = function ()
    -	{
    -		return true;
    -	};
    -
    -	/**
    -	 * @param {string} sKey
    -	 * @param {*} mData
    -	 * @returns {boolean}
    -	 */
    -	CookieDriver.prototype.set = function (sKey, mData)
    -	{
    -		var
    -			mCokieValue = $.cookie(Consts.Values.ClientSideCookieIndexName),
    -			bResult = false,
    -			mResult = null
    -		;
    -
    -		try
    -		{
    -			mResult = null === mCokieValue ? null : JSON.parse(mCokieValue);
    -			if (!mResult)
    -			{
    -				mResult = {};
    -			}
    -
    -			mResult[sKey] = mData;
    -			$.cookie(Consts.Values.ClientSideCookieIndexName, JSON.stringify(mResult), {
    -				'expires': 30
    -			});
    -
    -			bResult = true;
    -		}
    -		catch (oException) {}
    -
    -		return bResult;
    -	};
    -
    -	/**
    -	 * @param {string} sKey
    -	 * @returns {*}
    -	 */
    -	CookieDriver.prototype.get = function (sKey)
    -	{
    -		var
    -			mCokieValue = $.cookie(Consts.Values.ClientSideCookieIndexName),
    -			mResult = null
    -		;
    -
    -		try
    -		{
    -			mResult = null === mCokieValue ? null : JSON.parse(mCokieValue);
    -			if (mResult && !Utils.isUnd(mResult[sKey]))
    -			{
    -				mResult = mResult[sKey];
    -			}
    -			else
    -			{
    -				mResult = null;
    -			}
    -		}
    -		catch (oException) {}
    -
    -		return mResult;
    -	};
    -
    -	module.exports = CookieDriver;
    -
    -}(module, require));
    -},{"$":15,"Consts":5,"JSON":12,"Utils":11}],52:[function(require,module,exports){
    -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
    -
    -(function (module, require) {
    -
    -	'use strict';
    -
    -	var
    -		window = require('window'),
    -		JSON = require('JSON'),
    -
    -		Consts = require('Consts'),
    -		Utils = require('Utils')
    -	;
    -
    -	/**
    -	 * @constructor
    -	 */
    -	function LocalStorageDriver()
    -	{
    -	}
    -
    -	LocalStorageDriver.supported = function ()
    -	{
    -		return !!window.localStorage;
    -	};
    -
    -	/**
    -	 * @param {string} sKey
    -	 * @param {*} mData
    -	 * @returns {boolean}
    -	 */
    -	LocalStorageDriver.prototype.set = function (sKey, mData)
    -	{
    -		var
    -			mCookieValue = window.localStorage[Consts.Values.ClientSideCookieIndexName] || null,
    -			bResult = false,
    -			mResult = null
    -		;
    -
    -		try
    -		{
    -			mResult = null === mCookieValue ? null : JSON.parse(mCookieValue);
    -			if (!mResult)
    -			{
    -				mResult = {};
    -			}
    -
    -			mResult[sKey] = mData;
    -			window.localStorage[Consts.Values.ClientSideCookieIndexName] = JSON.stringify(mResult);
    -
    -			bResult = true;
    -		}
    -		catch (oException) {}
    -
    -		return bResult;
    -	};
    -
    -	/**
    -	 * @param {string} sKey
    -	 * @returns {*}
    -	 */
    -	LocalStorageDriver.prototype.get = function (sKey)
    -	{
    -		var
    -			mCokieValue = window.localStorage[Consts.Values.ClientSideCookieIndexName] || null,
    -			mResult = null
    -		;
    -
    -		try
    -		{
    -			mResult = null === mCokieValue ? null : JSON.parse(mCokieValue);
    -			if (mResult && !Utils.isUnd(mResult[sKey]))
    -			{
    -				mResult = mResult[sKey];
    -			}
    -			else
    -			{
    -				mResult = null;
    -			}
    -		}
    -		catch (oException) {}
    -
    -		return mResult;
    -	};
    -
    -	module.exports = LocalStorageDriver;
    -
    -}(module, require));
    -},{"Consts":5,"JSON":12,"Utils":11,"window":21}],53:[function(require,module,exports){
    -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
    -
    -(function (module, require) {
    -	
    -	'use strict';
    -
    -	var
    -		window = require('window'),
    +		
     		Utils = require('Utils')
     	;
     
    @@ -11633,8 +8425,7 @@ module.exports = window;
     	module.exports = new SettingsStorage();
     
     }(module, require));
    -},{"Utils":11,"window":21}],54:[function(require,module,exports){
    -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
    +},{"Utils":11,"window":20}],46:[function(require,module,exports){
     
     (function (module, require) {
     
    @@ -11725,7 +8516,8 @@ module.exports = window;
     		kn.constructorEnd(this);
     	}
     
    -	kn.extendAsViewModel('AdminLoginViewModel', AdminLoginViewModel);
    +	kn.extendAsViewModel(['View:Admin:Login', 'AdminLoginViewModel'], AdminLoginViewModel);
    +	_.extend(AdminLoginViewModel.prototype, KnoinAbstractViewModel.prototype);
     
     	AdminLoginViewModel.prototype.onShow = function ()
     	{
    @@ -11755,16 +8547,18 @@ module.exports = window;
     	module.exports = AdminLoginViewModel;
     
     }(module, require));
    -},{"App:Admin":3,"App:Knoin":22,"Enums":6,"Knoin:AbstractViewModel":25,"Storage:Admin:Remote":47,"Utils":11,"_":20,"ko":17}],55:[function(require,module,exports){
    -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
    +},{"App:Admin":3,"App:Knoin":21,"Enums":6,"Knoin:AbstractViewModel":24,"Storage:Admin:Remote":44,"Utils":11,"_":19,"ko":16}],47:[function(require,module,exports){
     
     (function (module, require) {
     
     	'use strict';
    -	
    +
     	var
    -		kn = require('App:Knoin'),
    +		_ = require('_'),
    +		
     		Globals = require('Globals'),
    +
    +		kn = require('App:Knoin'),
     		KnoinAbstractViewModel = require('Knoin:AbstractViewModel')
     	;
     
    @@ -11774,7 +8568,7 @@ module.exports = window;
     	 * @constructor
     	 * @extends KnoinAbstractViewModel
     	 */
    -	function AdminMenuViewModel(oScreen)
    +	function AdminSettingsMenuViewModel(oScreen)
     	{
     		KnoinAbstractViewModel.call(this, 'Left', 'AdminMenu');
     
    @@ -11785,25 +8579,26 @@ module.exports = window;
     		kn.constructorEnd(this);
     	}
     
    -	kn.extendAsViewModel('AdminMenuViewModel', AdminMenuViewModel);
    +	kn.extendAsViewModel(['View:Admin:SettingsMenu', 'AdminSettingsMenuViewModel'], AdminSettingsMenuViewModel);
    +	_.extend(AdminSettingsMenuViewModel.prototype, KnoinAbstractViewModel.prototype);
     
    -	AdminMenuViewModel.prototype.link = function (sRoute)
    +	AdminSettingsMenuViewModel.prototype.link = function (sRoute)
     	{
     		return '#/' + sRoute;
     	};
     
    -	module.exports = AdminMenuViewModel;
    +	module.exports = AdminSettingsMenuViewModel;
     
     }(module, require));
     
    -},{"App:Knoin":22,"Globals":8,"Knoin:AbstractViewModel":25}],56:[function(require,module,exports){
    -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
    +},{"App:Knoin":21,"Globals":8,"Knoin:AbstractViewModel":24,"_":19}],48:[function(require,module,exports){
     
     (function (module, require) {
     
     	'use strict';
     
     	var
    +		_ = require('_'),
     		ko = require('ko'),
     
     		Settings = require('Storage:Settings'),
    @@ -11818,7 +8613,7 @@ module.exports = window;
     	 * @constructor
     	 * @extends KnoinAbstractViewModel
     	 */
    -	function AdminPaneViewModel()
    +	function AdminSettingsPaneViewModel()
     	{
     		KnoinAbstractViewModel.call(this, 'Right', 'AdminPane');
     
    @@ -11830,26 +8625,27 @@ module.exports = window;
     		kn.constructorEnd(this);
     	}
     
    -	kn.extendAsViewModel('AdminPaneViewModel', AdminPaneViewModel);
    +	kn.extendAsViewModel(['View:Admin:SettingsPane', 'AdminSettingsPaneViewModel'], AdminSettingsPaneViewModel);
    +	_.extend(AdminSettingsPaneViewModel.prototype, KnoinAbstractViewModel.prototype);
     
    -	AdminPaneViewModel.prototype.logoutClick = function ()
    +	AdminSettingsPaneViewModel.prototype.logoutClick = function ()
     	{
     		Remote.adminLogout(function () {
     			require('App:Admin').loginAndLogoutReload();
     		});
     	};
     
    -	module.exports = AdminPaneViewModel;
    +	module.exports = AdminSettingsPaneViewModel;
     
     }(module, require));
    -},{"App:Admin":3,"App:Knoin":22,"Knoin:AbstractViewModel":25,"Storage:Admin:Data":46,"Storage:Admin:Remote":47,"Storage:Settings":53,"ko":17}],57:[function(require,module,exports){
    -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
    +},{"App:Admin":3,"App:Knoin":21,"Knoin:AbstractViewModel":24,"Storage:Admin:Data":43,"Storage:Admin:Remote":44,"Storage:Settings":45,"_":19,"ko":16}],49:[function(require,module,exports){
     
     (function (module, require) {
     
     	'use strict';
     
     	var
    +		_ = require('_'),
     		ko = require('ko'),
     
     		Enums = require('Enums'),
    @@ -11949,7 +8745,8 @@ module.exports = window;
     		kn.constructorEnd(this);
     	}
     
    -	kn.extendAsViewModel('PopupsActivateViewModel', PopupsActivateViewModel);
    +	kn.extendAsViewModel(['View:Popup:Activate', 'PopupsActivateViewModel'], PopupsActivateViewModel);
    +	_.extend(PopupsActivateViewModel.prototype, KnoinAbstractViewModel.prototype);
     
     	PopupsActivateViewModel.prototype.onShow = function ()
     	{
    @@ -11983,14 +8780,14 @@ module.exports = window;
     	module.exports = PopupsActivateViewModel;
     
     }(module, require));
    -},{"App:Knoin":22,"Enums":6,"Knoin:AbstractViewModel":25,"Storage:Admin:Data":46,"Storage:Admin:Remote":47,"Storage:Settings":53,"Utils":11,"ko":17}],58:[function(require,module,exports){
    -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
    +},{"App:Knoin":21,"Enums":6,"Knoin:AbstractViewModel":24,"Storage:Admin:Data":43,"Storage:Admin:Remote":44,"Storage:Settings":45,"Utils":11,"_":19,"ko":16}],50:[function(require,module,exports){
     
     (function (module, require) {
     
     	'use strict';
    -	
    +
     	var
    +		_ = require('_'),
     		ko = require('ko'),
     		key = require('key'),
     
    @@ -12025,7 +8822,8 @@ module.exports = window;
     		kn.constructorEnd(this);
     	}
     
    -	kn.extendAsViewModel('PopupsAskViewModel', PopupsAskViewModel);
    +	kn.extendAsViewModel(['View:Popup:Ask', 'PopupsAskViewModel'], PopupsAskViewModel);
    +	_.extend(PopupsAskViewModel.prototype, KnoinAbstractViewModel.prototype);
     
     	PopupsAskViewModel.prototype.clearPopup = function ()
     	{
    @@ -12114,11 +8912,10 @@ module.exports = window;
     	module.exports = PopupsAskViewModel;
     
     }(module, require));
    -},{"App:Knoin":22,"Enums":6,"Knoin:AbstractViewModel":25,"Utils":11,"key":16,"ko":17}],59:[function(require,module,exports){
    -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
    +},{"App:Knoin":21,"Enums":6,"Knoin:AbstractViewModel":24,"Utils":11,"_":19,"key":15,"ko":16}],51:[function(require,module,exports){
     
     (function (module, require) {
    -	
    +
     	'use strict';
     
     	var
    @@ -12317,7 +9114,8 @@ module.exports = window;
     		kn.constructorEnd(this);
     	}
     
    -	kn.extendAsViewModel('PopupsDomainViewModel', PopupsDomainViewModel);
    +	kn.extendAsViewModel(['View:Popup:Domain', 'PopupsDomainViewModel'], PopupsDomainViewModel);
    +	_.extend(PopupsDomainViewModel.prototype, KnoinAbstractViewModel.prototype);
     
     	PopupsDomainViewModel.prototype.onTestConnectionResponse = function (sResult, oData)
     	{
    @@ -12433,8 +9231,7 @@ module.exports = window;
     	module.exports = PopupsDomainViewModel;
     
     }(module, require));
    -},{"App:Admin":3,"App:Knoin":22,"Consts":5,"Enums":6,"Knoin:AbstractViewModel":25,"Storage:Admin:Remote":47,"Utils":11,"_":20,"ko":17}],60:[function(require,module,exports){
    -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
    +},{"App:Admin":3,"App:Knoin":21,"Consts":5,"Enums":6,"Knoin:AbstractViewModel":24,"Storage:Admin:Remote":44,"Utils":11,"_":19,"ko":16}],52:[function(require,module,exports){
     
     (function (module, require) {
     
    @@ -12445,8 +9242,7 @@ module.exports = window;
     		ko = require('ko'),
     
     		Utils = require('Utils'),
    -
    -		Data = require('Storage:RainLoop:Data'),
    +		Globals = require('Globals'),
     
     		kn = require('App:Knoin'),
     		KnoinAbstractViewModel = require('Knoin:AbstractViewModel')
    @@ -12460,26 +9256,29 @@ module.exports = window;
     	{
     		KnoinAbstractViewModel.call(this, 'Popups', 'PopupsLanguages');
     
    +		this.Data = Globals.__APP.data(); // TODO
    +
     		this.exp = ko.observable(false);
     
     		this.languages = ko.computed(function () {
    -			return _.map(Data.languages(), function (sLanguage) {
    +			return _.map(this.Data.languages(), function (sLanguage) {
     				return {
     					'key': sLanguage,
     					'selected': ko.observable(false),
     					'fullName': Utils.convertLangName(sLanguage)
     				};
     			});
    -		});
    +		}, this);
     
    -		Data.mainLanguage.subscribe(function () {
    +		this.Data.mainLanguage.subscribe(function () {
     			this.resetMainLanguage();
     		}, this);
     
     		kn.constructorEnd(this);
     	}
     
    -	kn.extendAsViewModel('PopupsLanguagesViewModel', PopupsLanguagesViewModel);
    +	kn.extendAsViewModel(['View:Popup:Languages', 'PopupsLanguagesViewModel'], PopupsLanguagesViewModel);
    +	_.extend(PopupsLanguagesViewModel.prototype, KnoinAbstractViewModel.prototype);
     
     	PopupsLanguagesViewModel.prototype.languageEnName = function (sLanguage)
     	{
    @@ -12488,7 +9287,7 @@ module.exports = window;
     
     	PopupsLanguagesViewModel.prototype.resetMainLanguage = function ()
     	{
    -		var sCurrent = Data.mainLanguage();
    +		var sCurrent = this.Data.mainLanguage();
     		_.each(this.languages(), function (oItem) {
     			oItem['selected'](oItem['key'] === sCurrent);
     		});
    @@ -12508,15 +9307,14 @@ module.exports = window;
     
     	PopupsLanguagesViewModel.prototype.changeLanguage = function (sLang)
     	{
    -		Data.mainLanguage(sLang);
    +		this.Data.mainLanguage(sLang);
     		this.cancelCommand();
     	};
     
     	module.exports = PopupsLanguagesViewModel;
     
     }(module, require));
    -},{"App:Knoin":22,"Knoin:AbstractViewModel":25,"Storage:RainLoop:Data":49,"Utils":11,"_":20,"ko":17}],61:[function(require,module,exports){
    -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
    +},{"App:Knoin":21,"Globals":8,"Knoin:AbstractViewModel":24,"Utils":11,"_":19,"ko":16}],53:[function(require,module,exports){
     
     (function (module, require) {
     
    @@ -12603,7 +9401,8 @@ module.exports = window;
     		kn.constructorEnd(this);
     	}
     
    -	kn.extendAsViewModel('PopupsPluginViewModel', PopupsPluginViewModel);
    +	kn.extendAsViewModel(['View:Popup:Plugin', 'PopupsPluginViewModel'], PopupsPluginViewModel);
    +	_.extend(PopupsPluginViewModel.prototype, KnoinAbstractViewModel.prototype);
     
     	PopupsPluginViewModel.prototype.onPluginSettingsUpdateResponse = function (sResult, oData)
     	{
    @@ -12685,4 +9484,4 @@ module.exports = window;
     	module.exports = PopupsPluginViewModel;
     
     }(module, require));
    -},{"App:Knoin":22,"Enums":6,"Knoin:AbstractViewModel":25,"Storage:Admin:Remote":47,"Utils":11,"View:Popup:Ask":58,"_":20,"key":16,"ko":17}]},{},[1]);
    +},{"App:Knoin":21,"Enums":6,"Knoin:AbstractViewModel":24,"Storage:Admin:Remote":44,"Utils":11,"View:Popup:Ask":50,"_":19,"key":15,"ko":16}]},{},[1]);
    diff --git a/rainloop/v/0.0.0/static/js/admin.min.js b/rainloop/v/0.0.0/static/js/admin.min.js
    index 99567a7fe..f7429fe70 100644
    --- a/rainloop/v/0.0.0/static/js/admin.min.js
    +++ b/rainloop/v/0.0.0/static/js/admin.min.js
    @@ -1,6 +1,5 @@
    -!function e(t,i,s){function n(a,r){if(!i[a]){if(!t[a]){var l="function"==typeof require&&require;if(!r&&l)return l(a,!0);if(o)return o(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var u=i[a]={exports:{}};t[a][0].call(u.exports,function(e){var i=t[a][1][e];return n(i?i:e)},u,u.exports,e,t,i,s)}return i[a].exports}for(var o="function"==typeof require&&require,a=0;a').appendTo("body"),a.$win.on("error",function(t){t&&t.originalEvent&&t.originalEvent.message&&-1===r.inArray(t.originalEvent.message,["Script error.","Uncaught Error: Error calling method on NPObject."])&&e.jsError(r.emptyFunction,t.originalEvent.message,t.originalEvent.filename,t.originalEvent.lineno,o.location&&o.location.toString?o.location.toString():"",a.$html.attr("class"),r.microtime()-a.now)}),a.$doc.on("keydown",function(e){e&&e.ctrlKey&&a.$html.addClass("rl-ctrl-key-pressed")}).on("keyup",function(e){e&&!e.ctrlKey&&a.$html.removeClass("rl-ctrl-key-pressed")})}var s=t("$"),n=t("_"),o=t("window"),a=t("Globals"),r=t("Utils"),l=t("LinkBuilder"),c=t("Events"),u=t("Storage:Settings"),d=t("Knoin:AbstractBoot");n.extend(i.prototype,d.prototype),i.prototype.remote=function(){return null},i.prototype.data=function(){return null},i.prototype.setupSettings=function(){return!0},i.prototype.download=function(e){var t=null,i=null,s=o.navigator.userAgent.toLowerCase();return s&&(s.indexOf("chrome")>-1||s.indexOf("chrome")>-1)&&(i=o.document.createElement("a"),i.href=e,o.document.createEvent&&(t=o.document.createEvent("MouseEvents"),t&&t.initEvent&&i.dispatchEvent))?(t.initEvent("click",!0,!0),i.dispatchEvent(t),!0):(a.bMobileDevice?(o.open(e,"_self"),o.focus()):this.iframe.attr("src",e),!0)},i.prototype.setTitle=function(e){e=(r.isNormal(e)&&0
    "),i.now=(new s.Date).getTime(),i.momentTrigger=o.observable(!0),i.dropdownVisibility=o.observable(!1).extend({rateLimit:0}),i.tooltipTrigger=o.observable(!1).extend({rateLimit:0}),i.langChangeTrigger=o.observable(!0),i.useKeyboardShortcuts=o.observable(!0),i.iAjaxErrorCount=0,i.iTokenErrorCount=0,i.iMessageBodyCacheCount=0,i.bUnload=!1,i.sUserAgent=(s.navigator.userAgent||"").toLowerCase(),i.bIsiOSDevice=-11&&(s=s.replace(/[\/]+$/,""),s+="/p"+t),""!==i&&(s=s.replace(/[\/]+$/,""),s+="/"+encodeURI(i)),s},i.prototype.phpInfo=function(){return this.sServer+"Info"},i.prototype.langLink=function(e){return this.sServer+"/Lang/0/"+encodeURI(e)+"/"+this.sVersion+"/"},i.prototype.exportContactsVcf=function(){return this.sServer+"/Raw/"+this.sSpecSuffix+"/ContactsVcf/"},i.prototype.exportContactsCsv=function(){return this.sServer+"/Raw/"+this.sSpecSuffix+"/ContactsCsv/"},i.prototype.emptyContactPic=function(){return this.sStaticPrefix+"css/images/empty-contact.png"},i.prototype.sound=function(e){return this.sStaticPrefix+"sounds/"+e},i.prototype.themePreviewLink=function(e){var t="rainloop/v/"+this.sVersion+"/";return"@custom"===e.substr(-7)&&(e=n.trim(e.substring(0,e.length-7)),t=""),t+"themes/"+encodeURI(e)+"/images/preview.png"},i.prototype.notificationMailIcon=function(){return this.sStaticPrefix+"css/images/icom-message-notification.png"},i.prototype.openPgpJs=function(){return this.sStaticPrefix+"js/openpgp.min.js"},i.prototype.socialGoogle=function(){return this.sServer+"SocialGoogle"+(""!==this.sSpecSuffix?"/"+this.sSpecSuffix+"/":"")},i.prototype.socialTwitter=function(){return this.sServer+"SocialTwitter"+(""!==this.sSpecSuffix?"/"+this.sSpecSuffix+"/":"")},i.prototype.socialFacebook=function(){return this.sServer+"SocialFacebook"+(""!==this.sSpecSuffix?"/"+this.sSpecSuffix+"/":"")},e.exports=new i}(t,e)},{"Storage:Settings":53,Utils:11,window:21}],10:[function(e,t){!function(e,t){"use strict";var i={__boot:null,__remote:null,__data:null},s=t("_"),n=t("Utils"),o=t("Storage:Settings");i.oViewModelsHooks={},i.oSimpleHooks={},i.regViewModelHook=function(e,t){t&&(t.__hookName=e)},i.addHook=function(e,t){n.isFunc(t)&&(n.isArray(i.oSimpleHooks[e])||(i.oSimpleHooks[e]=[]),i.oSimpleHooks[e].push(t))},i.runHook=function(e,t){n.isArray(i.oSimpleHooks[e])&&(t=t||[],s.each(i.oSimpleHooks[e],function(e){e.apply(null,t)}))},i.mainSettingsGet=function(e){return o.settingsGet(e)},i.remoteRequest=function(e,t,s,n,o,a){i.__remote&&i.__remote.defaultRequest(e,t,s,n,o,a)},i.settingsGet=function(e,t){var i=o.settingsGet("Plugins");return i=i&&!n.isUnd(i[e])?i[e]:null,i?n.isUnd(i[t])?null:i[t]:null},e.exports=i}(t,e)},{"Storage:Settings":53,Utils:11,_:20}],11:[function(e,t){!function(e,t){"use strict";var i={},s=t("$"),n=t("_"),o=t("ko"),a=t("window"),r=t("Enums"),l=t("Consts"),c=t("Globals");i.trim=s.trim,i.inArray=s.inArray,i.isArray=n.isArray,i.isFunc=n.isFunction,i.isUnd=n.isUndefined,i.isNull=n.isNull,i.emptyFunction=function(){},i.isNormal=function(e){return!i.isUnd(e)&&!i.isNull(e)},i.windowResize=n.debounce(function(e){i.isUnd(e)?c.$win.resize():a.setTimeout(function(){c.$win.resize()},e)},50),i.isPosNumeric=function(e,t){return i.isNormal(e)?(i.isUnd(t)?0:!t)?/^[1-9]+[0-9]*$/.test(e.toString()):/^[0-9]*$/.test(e.toString()):!1},i.pInt=function(e,t){var s=i.isNormal(e)&&""!==e?a.parseInt(e,10):t||0;return a.isNaN(s)?t||0:s},i.pString=function(e){return i.isNormal(e)?""+e:""},i.isNonEmptyArray=function(e){return i.isArray(e)&&0n;n++)s=i[n].split("="),t[a.decodeURIComponent(s[0])]=a.decodeURIComponent(s[1]);return t},i.rsaEncode=function(e,t,s,n){if(a.crypto&&a.crypto.getRandomValues&&a.RSAKey&&t&&s&&n){var o=new a.RSAKey;if(o.setPublic(n,s),e=o.encrypt(i.fakeMd5()+":"+e+":"+i.fakeMd5()),!1!==e)return"rsa:"+t+":"+e}return!1},i.rsaEncode.supported=!!(a.crypto&&a.crypto.getRandomValues&&a.RSAKey),i.exportPath=function(e,t,s){for(var n=null,o=e.split("."),r=s||a;o.length&&(n=o.shift());)o.length||i.isUnd(t)?r=r[n]?r[n]:r[n]={}:r[n]=t},i.pImport=function(e,t,i){e[t]=i},i.pExport=function(e,t,s){return i.isUnd(e[t])?s:e[t]},i.encodeHtml=function(e){return i.isNormal(e)?e.toString().replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'"):""},i.splitPlainText=function(e,t){var s="",n="",o=e,a=0,r=0;for(t=i.isUnd(t)?100:t;o.length>t;)n=o.substring(0,t),a=n.lastIndexOf(" "),r=n.lastIndexOf("\n"),-1!==r&&(a=r),-1===a&&(a=t),s+=n.substring(0,a)+"\n",o=o.substring(a+1);return s+o},i.timeOutAction=function(){var e={};return function(t,s,n){i.isUnd(e[t])&&(e[t]=0),a.clearTimeout(e[t]),e[t]=a.setTimeout(s,n)}}(),i.timeOutActionSecond=function(){var e={};return function(t,i,s){e[t]||(e[t]=a.setTimeout(function(){i(),e[t]=0},s))}}(),i.audio=function(){var e=!1;return function(t,i){if(!1===e)if(c.bIsiOSDevice)e=null;else{var s=!1,n=!1,o=a.Audio?new a.Audio:null;o&&o.canPlayType&&o.play?(s=""!==o.canPlayType('audio/mpeg; codecs="mp3"'),s||(n=""!==o.canPlayType('audio/ogg; codecs="vorbis"')),s||n?(e=o,e.preload="none",e.loop=!1,e.autoplay=!1,e.muted=!1,e.src=s?t:i):e=null):e=null}return e}}(),i.hos=function(e,t){return e&&a.Object&&a.Object.hasOwnProperty?a.Object.hasOwnProperty.call(e,t):!1},i.i18n=function(e,t,s){var n="",o=i.isUnd(c.oI18N[e])?i.isUnd(s)?e:s:c.oI18N[e];if(!i.isUnd(t)&&!i.isNull(t))for(n in t)i.hos(t,n)&&(o=o.replace("%"+n+"%",t[n]));return o},i.i18nToNode=function(e){n.defer(function(){s(".i18n",e).each(function(){var e=s(this),t="";t=e.data("i18n-text"),t?e.text(i.i18n(t)):(t=e.data("i18n-html"),t&&e.html(i.i18n(t)),t=e.data("i18n-placeholder"),t&&e.attr("placeholder",i.i18n(t)),t=e.data("i18n-title"),t&&e.attr("title",i.i18n(t)))})})},i.i18nReload=function(){a.rainloopI18N&&(c.oI18N=a.rainloopI18N||{},i.i18nToNode(c.$doc),c.langChangeTrigger(!c.langChangeTrigger())),a.rainloopI18N=null},i.initOnStartOrLangChange=function(e,t,i){e&&e.call(t),i?c.langChangeTrigger.subscribe(function(){e&&e.call(t),i.call(t)}):e&&c.langChangeTrigger.subscribe(e,t)},i.inFocus=function(){return a.document.activeElement?(i.isUnd(a.document.activeElement.__inFocusCache)&&(a.document.activeElement.__inFocusCache=s(a.document.activeElement).is("input,textarea,iframe,.cke_editable")),!!a.document.activeElement.__inFocusCache):!1},i.removeInFocus=function(){if(a.document&&a.document.activeElement&&a.document.activeElement.blur){var e=s(a.document.activeElement);e.is("input,textarea")&&a.document.activeElement.blur()}},i.removeSelection=function(){if(a&&a.getSelection){var e=a.getSelection();e&&e.removeAllRanges&&e.removeAllRanges()}else a.document&&a.document.selection&&a.document.selection.empty&&a.document.selection.empty()},i.replySubjectAdd=function(e,t){e=i.trim(e.toUpperCase()),t=i.trim(t.replace(/[\s]+/g," "));var s=!1,o=[],a="RE"===e,r="FWD"===e,l=!r;return""!==t&&n.each(t.split(":"),function(e){var t=i.trim(e);s||!/^(RE|FWD)$/i.test(t)&&!/^(RE|FWD)[\[\(][\d]+[\]\)]$/i.test(t)?(o.push(e),s=!0):(a||(a=!!/^RE/i.test(t)),r||(r=!!/^FWD/i.test(t)))}),l?a=!1:r=!1,i.trim((l?"Re: ":"Fwd: ")+(a?"Re: ":"")+(r?"Fwd: ":"")+i.trim(o.join(":")))},i.roundNumber=function(e,t){return a.Math.round(e*a.Math.pow(10,t))/a.Math.pow(10,t)},i.friendlySize=function(e){return e=i.pInt(e),e>=1073741824?i.roundNumber(e/1073741824,1)+"GB":e>=1048576?i.roundNumber(e/1048576,1)+"MB":e>=1024?i.roundNumber(e/1024,0)+"KB":e+"B"},i.log=function(e){a.console&&a.console.log&&a.console.log(e)},i.getNotification=function(e,t){return e=i.pInt(e),r.Notification.ClientViewError===e&&t?t:i.isUnd(c.oNotificationI18N[e])?"":c.oNotificationI18N[e]},i.initNotificationLanguage=function(){var e=c.oNotificationI18N||{};e[r.Notification.InvalidToken]=i.i18n("NOTIFICATIONS/INVALID_TOKEN"),e[r.Notification.AuthError]=i.i18n("NOTIFICATIONS/AUTH_ERROR"),e[r.Notification.AccessError]=i.i18n("NOTIFICATIONS/ACCESS_ERROR"),e[r.Notification.ConnectionError]=i.i18n("NOTIFICATIONS/CONNECTION_ERROR"),e[r.Notification.CaptchaError]=i.i18n("NOTIFICATIONS/CAPTCHA_ERROR"),e[r.Notification.SocialFacebookLoginAccessDisable]=i.i18n("NOTIFICATIONS/SOCIAL_FACEBOOK_LOGIN_ACCESS_DISABLE"),e[r.Notification.SocialTwitterLoginAccessDisable]=i.i18n("NOTIFICATIONS/SOCIAL_TWITTER_LOGIN_ACCESS_DISABLE"),e[r.Notification.SocialGoogleLoginAccessDisable]=i.i18n("NOTIFICATIONS/SOCIAL_GOOGLE_LOGIN_ACCESS_DISABLE"),e[r.Notification.DomainNotAllowed]=i.i18n("NOTIFICATIONS/DOMAIN_NOT_ALLOWED"),e[r.Notification.AccountNotAllowed]=i.i18n("NOTIFICATIONS/ACCOUNT_NOT_ALLOWED"),e[r.Notification.AccountTwoFactorAuthRequired]=i.i18n("NOTIFICATIONS/ACCOUNT_TWO_FACTOR_AUTH_REQUIRED"),e[r.Notification.AccountTwoFactorAuthError]=i.i18n("NOTIFICATIONS/ACCOUNT_TWO_FACTOR_AUTH_ERROR"),e[r.Notification.CouldNotSaveNewPassword]=i.i18n("NOTIFICATIONS/COULD_NOT_SAVE_NEW_PASSWORD"),e[r.Notification.CurrentPasswordIncorrect]=i.i18n("NOTIFICATIONS/CURRENT_PASSWORD_INCORRECT"),e[r.Notification.NewPasswordShort]=i.i18n("NOTIFICATIONS/NEW_PASSWORD_SHORT"),e[r.Notification.NewPasswordWeak]=i.i18n("NOTIFICATIONS/NEW_PASSWORD_WEAK"),e[r.Notification.NewPasswordForbidden]=i.i18n("NOTIFICATIONS/NEW_PASSWORD_FORBIDDENT"),e[r.Notification.ContactsSyncError]=i.i18n("NOTIFICATIONS/CONTACTS_SYNC_ERROR"),e[r.Notification.CantGetMessageList]=i.i18n("NOTIFICATIONS/CANT_GET_MESSAGE_LIST"),e[r.Notification.CantGetMessage]=i.i18n("NOTIFICATIONS/CANT_GET_MESSAGE"),e[r.Notification.CantDeleteMessage]=i.i18n("NOTIFICATIONS/CANT_DELETE_MESSAGE"),e[r.Notification.CantMoveMessage]=i.i18n("NOTIFICATIONS/CANT_MOVE_MESSAGE"),e[r.Notification.CantCopyMessage]=i.i18n("NOTIFICATIONS/CANT_MOVE_MESSAGE"),e[r.Notification.CantSaveMessage]=i.i18n("NOTIFICATIONS/CANT_SAVE_MESSAGE"),e[r.Notification.CantSendMessage]=i.i18n("NOTIFICATIONS/CANT_SEND_MESSAGE"),e[r.Notification.InvalidRecipients]=i.i18n("NOTIFICATIONS/INVALID_RECIPIENTS"),e[r.Notification.CantCreateFolder]=i.i18n("NOTIFICATIONS/CANT_CREATE_FOLDER"),e[r.Notification.CantRenameFolder]=i.i18n("NOTIFICATIONS/CANT_RENAME_FOLDER"),e[r.Notification.CantDeleteFolder]=i.i18n("NOTIFICATIONS/CANT_DELETE_FOLDER"),e[r.Notification.CantDeleteNonEmptyFolder]=i.i18n("NOTIFICATIONS/CANT_DELETE_NON_EMPTY_FOLDER"),e[r.Notification.CantSubscribeFolder]=i.i18n("NOTIFICATIONS/CANT_SUBSCRIBE_FOLDER"),e[r.Notification.CantUnsubscribeFolder]=i.i18n("NOTIFICATIONS/CANT_UNSUBSCRIBE_FOLDER"),e[r.Notification.CantSaveSettings]=i.i18n("NOTIFICATIONS/CANT_SAVE_SETTINGS"),e[r.Notification.CantSavePluginSettings]=i.i18n("NOTIFICATIONS/CANT_SAVE_PLUGIN_SETTINGS"),e[r.Notification.DomainAlreadyExists]=i.i18n("NOTIFICATIONS/DOMAIN_ALREADY_EXISTS"),e[r.Notification.CantInstallPackage]=i.i18n("NOTIFICATIONS/CANT_INSTALL_PACKAGE"),e[r.Notification.CantDeletePackage]=i.i18n("NOTIFICATIONS/CANT_DELETE_PACKAGE"),e[r.Notification.InvalidPluginPackage]=i.i18n("NOTIFICATIONS/INVALID_PLUGIN_PACKAGE"),e[r.Notification.UnsupportedPluginPackage]=i.i18n("NOTIFICATIONS/UNSUPPORTED_PLUGIN_PACKAGE"),e[r.Notification.LicensingServerIsUnavailable]=i.i18n("NOTIFICATIONS/LICENSING_SERVER_IS_UNAVAILABLE"),e[r.Notification.LicensingExpired]=i.i18n("NOTIFICATIONS/LICENSING_EXPIRED"),e[r.Notification.LicensingBanned]=i.i18n("NOTIFICATIONS/LICENSING_BANNED"),e[r.Notification.DemoSendMessageError]=i.i18n("NOTIFICATIONS/DEMO_SEND_MESSAGE_ERROR"),e[r.Notification.AccountAlreadyExists]=i.i18n("NOTIFICATIONS/ACCOUNT_ALREADY_EXISTS"),e[r.Notification.MailServerError]=i.i18n("NOTIFICATIONS/MAIL_SERVER_ERROR"),e[r.Notification.InvalidInputArgument]=i.i18n("NOTIFICATIONS/INVALID_INPUT_ARGUMENT"),e[r.Notification.UnknownNotification]=i.i18n("NOTIFICATIONS/UNKNOWN_ERROR"),e[r.Notification.UnknownError]=i.i18n("NOTIFICATIONS/UNKNOWN_ERROR") -},i.getUploadErrorDescByCode=function(e){var t="";switch(i.pInt(e)){case r.UploadErrorCode.FileIsTooBig:t=i.i18n("UPLOAD/ERROR_FILE_IS_TOO_BIG");break;case r.UploadErrorCode.FilePartiallyUploaded:t=i.i18n("UPLOAD/ERROR_FILE_PARTIALLY_UPLOADED");break;case r.UploadErrorCode.FileNoUploaded:t=i.i18n("UPLOAD/ERROR_NO_FILE_UPLOADED");break;case r.UploadErrorCode.MissingTempFolder:t=i.i18n("UPLOAD/ERROR_MISSING_TEMP_FOLDER");break;case r.UploadErrorCode.FileOnSaveingError:t=i.i18n("UPLOAD/ERROR_ON_SAVING_FILE");break;case r.UploadErrorCode.FileType:t=i.i18n("UPLOAD/ERROR_FILE_TYPE");break;default:t=i.i18n("UPLOAD/ERROR_UNKNOWN")}return t},i.delegateRun=function(e,t,s,o){e&&e[t]&&(o=i.pInt(o),0>=o?e[t].apply(e,i.isArray(s)?s:[]):n.delay(function(){e[t].apply(e,i.isArray(s)?s:[])},o))},i.killCtrlAandS=function(e){if(e=e||a.event,e&&e.ctrlKey&&!e.shiftKey&&!e.altKey){var t=e.target||e.srcElement,i=e.keyCode||e.which;if(i===r.EventKeyCode.S)return void e.preventDefault();if(t&&t.tagName&&t.tagName.match(/INPUT|TEXTAREA/i))return;i===r.EventKeyCode.A&&(a.getSelection?a.getSelection().removeAllRanges():a.document.selection&&a.document.selection.clear&&a.document.selection.clear(),e.preventDefault())}},i.createCommand=function(e,t,s){var n=t?function(){return n&&n.canExecute&&n.canExecute()&&t.apply(e,Array.prototype.slice.call(arguments)),!1}:function(){};return n.enabled=o.observable(!0),s=i.isUnd(s)?!0:s,n.canExecute=o.computed(i.isFunc(s)?function(){return n.enabled()&&s.call(e)}:function(){return n.enabled()&&!!s}),n},i.initDataConstructorBySettings=function(e){e.editorDefaultType=o.observable(r.EditorDefaultType.Html),e.showImages=o.observable(!1),e.interfaceAnimation=o.observable(r.InterfaceAnimation.Full),e.contactsAutosave=o.observable(!1),c.sAnimationType=r.InterfaceAnimation.Full,e.capaThemes=o.observable(!1),e.allowLanguagesOnSettings=o.observable(!0),e.allowLanguagesOnLogin=o.observable(!0),e.useLocalProxyForExternalImages=o.observable(!1),e.desktopNotifications=o.observable(!1),e.useThreads=o.observable(!0),e.replySameFolder=o.observable(!0),e.useCheckboxesInList=o.observable(!0),e.layout=o.observable(r.Layout.SidePreview),e.usePreviewPane=o.computed(function(){return r.Layout.NoPreview!==e.layout()}),e.interfaceAnimation.subscribe(function(e){if(c.bMobileDevice||e===r.InterfaceAnimation.None)c.$html.removeClass("rl-anim rl-anim-full").addClass("no-rl-anim"),c.sAnimationType=r.InterfaceAnimation.None;else switch(e){case r.InterfaceAnimation.Full:c.$html.removeClass("no-rl-anim").addClass("rl-anim rl-anim-full"),c.sAnimationType=e;break;case r.InterfaceAnimation.Normal:c.$html.removeClass("no-rl-anim rl-anim-full").addClass("rl-anim"),c.sAnimationType=e}}),e.interfaceAnimation.valueHasMutated(),e.desktopNotificationsPermisions=o.computed(function(){e.desktopNotifications();var t=i.notificationClass(),s=r.DesktopNotifications.NotSupported;if(t&&t.permission)switch(t.permission.toLowerCase()){case"granted":s=r.DesktopNotifications.Allowed;break;case"denied":s=r.DesktopNotifications.Denied;break;case"default":s=r.DesktopNotifications.NotAllowed}else a.webkitNotifications&&a.webkitNotifications.checkPermission&&(s=a.webkitNotifications.checkPermission());return s}),e.useDesktopNotifications=o.computed({read:function(){return e.desktopNotifications()&&r.DesktopNotifications.Allowed===e.desktopNotificationsPermisions()},write:function(t){if(t){var s=i.notificationClass(),n=e.desktopNotificationsPermisions();s&&r.DesktopNotifications.Allowed===n?e.desktopNotifications(!0):s&&r.DesktopNotifications.NotAllowed===n?s.requestPermission(function(){e.desktopNotifications.valueHasMutated(),r.DesktopNotifications.Allowed===e.desktopNotificationsPermisions()?e.desktopNotifications()?e.desktopNotifications.valueHasMutated():e.desktopNotifications(!0):e.desktopNotifications()?e.desktopNotifications(!1):e.desktopNotifications.valueHasMutated()}):e.desktopNotifications(!1)}else e.desktopNotifications(!1)}}),e.language=o.observable(""),e.languages=o.observableArray([]),e.mainLanguage=o.computed({read:e.language,write:function(t){t!==e.language()?-1=t.diff(s,"hours")?n:t.format("L")===s.format("L")?i.i18n("MESSAGE_LIST/TODAY_AT",{TIME:s.format("LT")}):t.clone().subtract("days",1).format("L")===s.format("L")?i.i18n("MESSAGE_LIST/YESTERDAY_AT",{TIME:s.format("LT")}):s.format(t.year()===s.year()?"D MMM.":"LL")},e)},i.initBlockquoteSwitcher=function(e){if(e){var t=s("blockquote:not(.rl-bq-switcher)",e).filter(function(){return 0===s(this).parent().closest("blockquote",e).length});t&&0100)&&(e.addClass("rl-bq-switcher hidden-bq"),s('').insertBefore(e).click(function(){e.toggleClass("hidden-bq"),i.windowResize()}).after("
    ").before("
    "))})}},i.removeBlockquoteSwitcher=function(e){e&&(s(e).find("blockquote.rl-bq-switcher").each(function(){s(this).removeClass("rl-bq-switcher hidden-bq")}),s(e).find(".rlBlockquoteSwitcher").each(function(){s(this).remove()}))},i.toggleMessageBlockquote=function(e){e&&e.find(".rlBlockquoteSwitcher").click()},i.convertThemeName=function(e){return"@custom"===e.substr(-7)&&(e=i.trim(e.substring(0,e.length-7))),i.trim(e.replace(/[^a-zA-Z]+/g," ").replace(/([A-Z])/g," $1").replace(/[\s]+/g," "))},i.quoteName=function(e){return e.replace(/["]/g,'\\"')},i.microtime=function(){return(new Date).getTime()},i.convertLangName=function(e,t){return i.i18n("LANGS_NAMES"+(!0===t?"_EN":"")+"/LANG_"+e.toUpperCase().replace(/[^a-zA-Z0-9]+/g,"_"),null,e)},i.fakeMd5=function(e){var t="",s="0123456789abcdefghijklmnopqrstuvwxyz";for(e=i.isUnd(e)?32:i.pInt(e);t.length>>32-t}function i(e,t){var i,s,n,o,a;return n=2147483648&e,o=2147483648&t,i=1073741824&e,s=1073741824&t,a=(1073741823&e)+(1073741823&t),i&s?2147483648^a^n^o:i|s?1073741824&a?3221225472^a^n^o:1073741824^a^n^o:a^n^o}function s(e,t,i){return e&t|~e&i}function n(e,t,i){return e&i|t&~i}function o(e,t,i){return e^t^i}function a(e,t,i){return t^(e|~i)}function r(e,n,o,a,r,l,c){return e=i(e,i(i(s(n,o,a),r),c)),i(t(e,l),n)}function l(e,s,o,a,r,l,c){return e=i(e,i(i(n(s,o,a),r),c)),i(t(e,l),s)}function c(e,s,n,a,r,l,c){return e=i(e,i(i(o(s,n,a),r),c)),i(t(e,l),s)}function u(e,s,n,o,r,l,c){return e=i(e,i(i(a(s,n,o),r),c)),i(t(e,l),s)}function d(e){for(var t,i=e.length,s=i+8,n=(s-s%64)/64,o=16*(n+1),a=Array(o-1),r=0,l=0;i>l;)t=(l-l%4)/4,r=l%4*8,a[t]=a[t]|e.charCodeAt(l)<>>29,a}function p(e){var t,i,s="",n="";for(i=0;3>=i;i++)t=e>>>8*i&255,n="0"+t.toString(16),s+=n.substr(n.length-2,2);return s}function h(e){e=e.replace(/rn/g,"n");for(var t="",i=0;is?t+=String.fromCharCode(s):s>127&&2048>s?(t+=String.fromCharCode(s>>6|192),t+=String.fromCharCode(63&s|128)):(t+=String.fromCharCode(s>>12|224),t+=String.fromCharCode(s>>6&63|128),t+=String.fromCharCode(63&s|128))}return t}var g,m,f,b,S,v,y,A,C,w=Array(),T=7,E=12,N=17,P=22,L=5,I=9,R=14,k=20,D=4,_=11,F=16,x=23,U=6,M=10,O=15,V=21;for(e=h(e),w=d(e),v=1732584193,y=4023233417,A=2562383102,C=271733878,g=0;g/g,">").replace(/")},i.draggeblePlace=function(){return s('
     
    ').appendTo("#rl-hidden")},i.defautOptionsAfterRender=function(e,t){t&&!i.isUnd(t.disabled)&&e&&s(e).toggleClass("disabled",t.disabled).prop("disabled",t.disabled)},i.windowPopupKnockout=function(e,t,n,r){var l=null,c=a.open(""),u="__OpenerApplyBindingsUid"+i.fakeMd5()+"__",d=s("#"+t);a[u]=function(){if(c&&c.document.body&&d&&d[0]){var t=s(c.document.body);s("#rl-content",t).html(d.html()),s("html",c.document).addClass("external "+s("html").attr("class")),i.i18nToNode(t),e&&s("#rl-content",t)[0]&&o.applyBindings(e,s("#rl-content",t)[0]),a[u]=null,r(c)}},c.document.open(),c.document.write(''+i.encodeHtml(n)+'
    '),c.document.close(),l=c.document.createElement("script"),l.type="text/javascript",l.innerHTML="if(window&&window.opener&&window.opener['"+u+"']){window.opener['"+u+"']();window.opener['"+u+"']=null}",c.document.getElementsByTagName("head")[0].appendChild(l)},i.settingsSaveHelperFunction=function(e,t,s,o){return s=s||null,o=i.isUnd(o)?1e3:i.pInt(o),function(i,a,l,c,u){t.call(s,a&&a.Result?r.SaveSettingsStep.TrueResult:r.SaveSettingsStep.FalseResult),e&&e.call(s,i,a,l,c,u),n.delay(function(){t.call(s,r.SaveSettingsStep.Idle)},o)}},i.settingsSaveHelperSimpleFunction=function(e,t){return i.settingsSaveHelperFunction(null,e,t,1e3)},i.htmlToPlain=function(e){var t=0,i=0,n=0,o=0,a=0,r="",l=function(e){for(var t=100,i="",s="",n=e,o=0,a=0;n.length>t;)s=n.substring(0,t),o=s.lastIndexOf(" "),a=s.lastIndexOf("\n"),-1!==a&&(o=a),-1===o&&(o=t),i+=s.substring(0,o)+"\n",n=n.substring(o+1);return i+n},u=function(e){return e=l(s.trim(e)),e="> "+e.replace(/\n/gm,"\n> "),e.replace(/(^|\n)([> ]+)/gm,function(){return arguments&&2]*>([\s\S\r\n]*)<\/div>/gim,d),e="\n"+s.trim(e)+"\n"),e}return""},p=function(){return arguments&&1"):""},h=function(){return arguments&&1/g,">"):""},g=function(){return arguments&&1]*>([\s\S\r\n]*)<\/pre>/gim,p).replace(/[\s]+/gm," ").replace(/((?:href|data)\s?=\s?)("[^"]+?"|'[^']+?')/gim,h).replace(/]*>/gim,"\n").replace(/<\/h[\d]>/gi,"\n").replace(/<\/p>/gi,"\n\n").replace(/<\/li>/gi,"\n").replace(/<\/td>/gi,"\n").replace(/<\/tr>/gi,"\n").replace(/]*>/gim,"\n_______________________________\n\n").replace(/]*>([\s\S\r\n]*)<\/div>/gim,d).replace(/]*>/gim,"\n__bq__start__\n").replace(/<\/blockquote>/gim,"\n__bq__end__\n").replace(/
    ]*>([\s\S\r\n]*?)<\/a>/gim,g).replace(/<\/div>/gi,"\n").replace(/ /gi," ").replace(/"/gi,'"').replace(/<[^>]*>/gm,""),r=c.$div.html(r).text(),r=r.replace(/\n[ \t]+/gm,"\n").replace(/[\n]{3,}/gm,"\n\n").replace(/>/gi,">").replace(/</gi,"<").replace(/&/gi,"&"),t=0,a=100;a>0&&(a--,i=r.indexOf("__bq__start__",t),i>-1);)n=r.indexOf("__bq__start__",i+5),o=r.indexOf("__bq__end__",i+5),(-1===n||n>o)&&o>i?(r=r.substring(0,i)+u(r.substring(i+13,o))+r.substring(o+11),t=0):t=n>-1&&o>n?n-1:0;return r=r.replace(/__bq__start__/gm,"").replace(/__bq__end__/gm,"")},i.plainToHtml=function(e,t){e=e.toString().replace(/\r/g,"");var s=!1,n=!0,o=!0,a=[],r="",l=0,c=e.split("\n");do{for(n=!1,a=[],l=0;l"===r.substr(0,1),o&&!s?(n=!0,s=!0,a.push("~~~blockquote~~~"),a.push(r.substr(1))):!o&&s?(s=!1,a.push("~~~/blockquote~~~"),a.push(r)):a.push(o&&s?r.substr(1):r);s&&(s=!1,a.push("~~~/blockquote~~~")),c=a}while(n);return e=c.join("\n"),e=e.replace(/&/g,"&").replace(/>/g,">").replace(/").replace(/[\s]*~~~\/blockquote~~~/g,"").replace(/[\-_~]{10,}/g,"
    ").replace(/\n/g,"
    "),t?i.linkify(e):e},a.rainloop_Utils_htmlToPlain=i.htmlToPlain,a.rainloop_Utils_plainToHtml=i.plainToHtml,i.linkify=function(e){return s.fn&&s.fn.linkify&&(e=c.$div.html(e.replace(/&/gi,"amp_amp_12345_amp_amp")).linkify().find(".linkified").removeClass("linkified").end().html().replace(/amp_amp_12345_amp_amp/g,"&")),e},i.resizeAndCrop=function(e,t,i){var s=new a.Image;s.onload=function(){var e=[0,0],s=a.document.createElement("canvas"),n=s.getContext("2d");s.width=t,s.height=t,e=this.width>this.height?[this.width-this.height,0]:[0,this.height-this.width],n.fillStyle="#fff",n.fillRect(0,0,t,t),n.drawImage(this,e[0]/2,e[1]/2,this.width-e[0],this.height-e[1],0,0,t,t),i(s.toDataURL("image/jpeg"))},s.src=e},i.folderListOptionsBuilder=function(e,t,s,n,o,l,c,u,d,p){var h=null,g=!1,m=0,f=0,b="   ",S=[];for(d=i.isNormal(d)?d:0m;m++)S.push({id:n[m][0],name:n[m][1],system:!1,seporator:!1,disabled:!1});for(g=!0,m=0,f=e.length;f>m;m++)h=e[m],(c?c.call(null,h):!0)&&(g&&0m;m++)h=t[m],(h.subScribed()||!h.existen)&&(c?c.call(null,h):!0)&&(r.FolderType.User===h.type()||!d||01||c>0&&l>c){for(l>c?(u(c),s=c,n=c):((3>=l||l>=c-2)&&(o+=2),u(l),s=l,n=l);o>0;)if(s-=1,n+=1,s>0&&(u(s,!1),o--),c>=n)u(n,!0),o--;else if(0>=s)break;3===s?u(2,!1):s>3&&u(a.Math.round((s-1)/2),!1,"..."),c-2===n?u(c-1,!0):c-2>n&&u(a.Math.round((c+n)/2),!0,"..."),s>1&&u(1,!1),c>n&&u(c,!0)}return r}},i.selectElement=function(e){if(a.getSelection){var t=a.getSelection();t.removeAllRanges();var i=a.document.createRange();i.selectNodeContents(e),t.addRange(i)}else if(a.document.selection){var s=a.document.body.createTextRange();s.moveToElementText(e),s.select()}},i.detectDropdownVisibility=n.debounce(function(){c.dropdownVisibility(!!n.find(c.aBootstrapDropdowns,function(e){return e.hasClass("open")}))},50),i.triggerAutocompleteInputChange=function(e){var t=function(){s(".checkAutocomplete").trigger("change")};e?n.delay(t,100):t()},e.exports=i}(t,e)},{$:15,Consts:5,Enums:6,Globals:8,_:20,ko:17,window:21}],12:[function(e,t){t.exports=JSON},{}],13:[function(e,t){t.exports=crossroads},{}],14:[function(e,t){t.exports=hasher},{}],15:[function(e,t){t.exports=$},{}],16:[function(e,t){t.exports=key},{}],17:[function(e,t){!function(t,i){"use strict";var s=e("window"),n=e("_"),o=e("$");i.bindingHandlers.tooltip={init:function(t,s){var n=e("Globals"),a=e("Utils");if(!n.bMobileDevice){var r=o(t),l=r.data("tooltip-class")||"",c=r.data("tooltip-placement")||"top";r.tooltip({delay:{show:500,hide:100},html:!0,container:"body",placement:c,trigger:"hover",title:function(){return r.is(".disabled")||n.dropdownVisibility()?"":''+a.i18n(i.utils.unwrapObservable(s()))+""}}).click(function(){r.tooltip("hide")}),n.tooltipTrigger.subscribe(function(){r.tooltip("hide")})}}},i.bindingHandlers.tooltip2={init:function(t,i){var s=e("Globals"),n=o(t),a=n.data("tooltip-class")||"",r=n.data("tooltip-placement")||"top";n.tooltip({delay:{show:500,hide:100},html:!0,container:"body",placement:r,title:function(){return n.is(".disabled")||s.dropdownVisibility()?"":''+i()()+""}}).click(function(){n.tooltip("hide")}),s.tooltipTrigger.subscribe(function(){n.tooltip("hide")})}},i.bindingHandlers.tooltip3={init:function(t){var i=o(t),n=e("Globals");i.tooltip({container:"body",trigger:"hover manual",title:function(){return i.data("tooltip3-data")||""}}),o(s.document).click(function(){i.tooltip("hide")}),n.tooltipTrigger.subscribe(function(){i.tooltip("hide")})},update:function(e,t){var s=i.utils.unwrapObservable(t());""===s?o(e).data("tooltip3-data","").tooltip("hide"):o(e).data("tooltip3-data",s).tooltip("show")}},i.bindingHandlers.registrateBootstrapDropdown={init:function(t){var i=e("Globals");i.aBootstrapDropdowns.push(o(t))}},i.bindingHandlers.openDropdownTrigger={update:function(t,s){if(i.utils.unwrapObservable(s())){var n=o(t),a=e("Utils");n.hasClass("open")||(n.find(".dropdown-toggle").dropdown("toggle"),a.detectDropdownVisibility()),s()(!1)}}},i.bindingHandlers.dropdownCloser={init:function(e){o(e).closest(".dropdown").on("click",".e-item",function(){o(e).dropdown("toggle")})}},i.bindingHandlers.popover={init:function(e,t){o(e).popover(i.utils.unwrapObservable(t()))}},i.bindingHandlers.csstext={init:function(t,s){var n=e("Utils");t&&t.styleSheet&&!n.isUnd(t.styleSheet.cssText)?t.styleSheet.cssText=i.utils.unwrapObservable(s()):o(t).text(i.utils.unwrapObservable(s()))},update:function(t,s){var n=e("Utils");t&&t.styleSheet&&!n.isUnd(t.styleSheet.cssText)?t.styleSheet.cssText=i.utils.unwrapObservable(s()):o(t).text(i.utils.unwrapObservable(s()))}},i.bindingHandlers.resizecrop={init:function(e){o(e).addClass("resizecrop").resizecrop({width:"100",height:"100",wrapperCSS:{"border-radius":"10px"}})},update:function(e,t){t()(),o(e).resizecrop({width:"100",height:"100"})}},i.bindingHandlers.onEnter={init:function(e,t,i,n){o(e).on("keypress",function(i){i&&13===s.parseInt(i.keyCode,10)&&(o(e).trigger("change"),t().call(n))})}},i.bindingHandlers.onEsc={init:function(e,t,i,n){o(e).on("keypress",function(i){i&&27===s.parseInt(i.keyCode,10)&&(o(e).trigger("change"),t().call(n))})}},i.bindingHandlers.clickOnTrue={update:function(e,t){i.utils.unwrapObservable(t())&&o(e).click()}},i.bindingHandlers.modal={init:function(t,s){var n=e("Globals"),a=e("Utils");o(t).toggleClass("fade",!n.bMobileDevice).modal({keyboard:!1,show:i.utils.unwrapObservable(s())}).on("shown",function(){a.windowResize()}).find(".close").click(function(){s()(!1)})},update:function(e,t){o(e).modal(i.utils.unwrapObservable(t())?"show":"hide")}},i.bindingHandlers.i18nInit={init:function(t){var i=e("Utils");i.i18nToNode(t)}},i.bindingHandlers.i18nUpdate={update:function(t,s){var n=e("Utils");i.utils.unwrapObservable(s()),n.i18nToNode(t)}},i.bindingHandlers.link={update:function(e,t){o(e).attr("href",i.utils.unwrapObservable(t()))}},i.bindingHandlers.title={update:function(e,t){o(e).attr("title",i.utils.unwrapObservable(t()))}},i.bindingHandlers.textF={init:function(e,t){o(e).text(i.utils.unwrapObservable(t()))}},i.bindingHandlers.initDom={init:function(e,t){t()(e)}},i.bindingHandlers.initResizeTrigger={init:function(e,t){var s=i.utils.unwrapObservable(t());o(e).css({height:s[1],"min-height":s[1]})},update:function(t,s){var n=e("Utils"),a=e("Globals"),r=i.utils.unwrapObservable(s()),l=n.pInt(r[1]),c=0,u=o(t).offset().top;u>0&&(u+=n.pInt(r[2]),c=a.$win.height()-u,c>l&&(l=c),o(t).css({height:l,"min-height":l}))}},i.bindingHandlers.appendDom={update:function(e,t){o(e).hide().empty().append(i.utils.unwrapObservable(t())).show()}},i.bindingHandlers.draggable={init:function(t,n,a){var r=e("Globals"),l=e("Utils");if(!r.bMobileDevice){var c=100,u=3,d=a(),p=d&&d.droppableSelector?d.droppableSelector:"",h={distance:20,handle:".dragHandle",cursorAt:{top:22,left:3},refreshPositions:!0,scroll:!0};p&&(h.drag=function(e){o(p).each(function(){var t=null,i=null,n=o(this),a=n.offset(),r=a.top+n.height();s.clearInterval(n.data("timerScroll")),n.data("timerScroll",!1),e.pageX>=a.left&&e.pageX<=a.left+n.width()&&(e.pageY>=r-c&&e.pageY<=r&&(t=function(){n.scrollTop(n.scrollTop()+u),l.windowResize()},n.data("timerScroll",s.setInterval(t,10)),t()),e.pageY>=a.top&&e.pageY<=a.top+c&&(i=function(){n.scrollTop(n.scrollTop()-u),l.windowResize()},n.data("timerScroll",s.setInterval(i,10)),i()))})},h.stop=function(){o(p).each(function(){s.clearInterval(o(this).data("timerScroll")),o(this).data("timerScroll",!1)})}),h.helper=function(e){return n()(e&&e.target?i.dataFor(e.target):null)},o(t).draggable(h).on("mousedown",function(){l.removeInFocus()})}}},i.bindingHandlers.droppable={init:function(t,i,s){var n=e("Globals");if(!n.bMobileDevice){var a=i(),r=s(),l=r&&r.droppableOver?r.droppableOver:null,c=r&&r.droppableOut?r.droppableOut:null,u={tolerance:"pointer",hoverClass:"droppableHover"};a&&(u.drop=function(e,t){a(e,t)},l&&(u.over=function(e,t){l(e,t)}),c&&(u.out=function(e,t){c(e,t)}),o(t).droppable(u))}}},i.bindingHandlers.nano={init:function(t){var i=e("Globals");i.bDisableNanoScroll||o(t).addClass("nano").nanoScroller({iOSNativeScrolling:!1,preventPageScrolling:!0})}},i.bindingHandlers.saveTrigger={init:function(e){var t=o(e);t.data("save-trigger-type",t.is("input[type=text],input[type=email],input[type=password],select,textarea")?"input":"custom"),"custom"===t.data("save-trigger-type")?t.append('  ').addClass("settings-saved-trigger"):t.addClass("settings-saved-trigger-input")},update:function(e,t){var s=i.utils.unwrapObservable(t()),n=o(e);if("custom"===n.data("save-trigger-type"))switch(s.toString()){case"1":n.find(".animated,.error").hide().removeClass("visible").end().find(".success").show().addClass("visible");break;case"0":n.find(".animated,.success").hide().removeClass("visible").end().find(".error").show().addClass("visible");break;case"-2":n.find(".error,.success").hide().removeClass("visible").end().find(".animated").show().addClass("visible");break;default:n.find(".animated").hide().end().find(".error,.success").removeClass("visible")}else switch(s.toString()){case"1":n.addClass("success").removeClass("error");break;case"0":n.addClass("error").removeClass("success");break;case"-2":break;default:n.removeClass("error success")}}},i.bindingHandlers.emailsTags={init:function(t,i,s){var a=e("Utils"),r=e("Model:Email"),l=o(t),c=i(),u=s(),d=u.autoCompleteSource||null,p=function(e){c&&c.focusTrigger&&c.focusTrigger(e)};l.inputosaurus({parseOnBlur:!0,allowDragAndDrop:!0,focusCallback:p,inputDelimiters:[",",";"],autoCompleteSource:d,parseHook:function(e){return n.map(e,function(e){var t=a.trim(e),i=null;return""!==t?(i=new r,i.mailsoParse(t),i.clearDuplicateName(),[i.toLine(!1),i]):[t,null]})},change:n.bind(function(e){l.data("EmailsTagsValue",e.target.value),c(e.target.value)},this)})},update:function(e,t,s){var n=o(e),a=s(),r=a.emailsTagsFilter||null,l=i.utils.unwrapObservable(t());n.data("EmailsTagsValue")!==l&&(n.val(l),n.data("EmailsTagsValue",l),n.inputosaurus("refresh")),r&&i.utils.unwrapObservable(r)&&n.inputosaurus("focus")}},i.bindingHandlers.contactTags={init:function(t,i,s){var a=e("Utils"),r=e("Model:ContactTag"),l=o(t),c=i(),u=s(),d=u.autoCompleteSource||null,p=function(e){c&&c.focusTrigger&&c.focusTrigger(e)};l.inputosaurus({parseOnBlur:!0,allowDragAndDrop:!1,focusCallback:p,inputDelimiters:[",",";"],outputDelimiter:",",autoCompleteSource:d,parseHook:function(e){return n.map(e,function(e){var t=a.trim(e),i=null;return""!==t?(i=new r,i.name(t),[i.toLine(!1),i]):[t,null]})},change:n.bind(function(e){l.data("ContactTagsValue",e.target.value),c(e.target.value)},this)})},update:function(e,t,s){var n=o(e),a=s(),r=a.contactTagsFilter||null,l=i.utils.unwrapObservable(t());n.data("ContactTagsValue")!==l&&(n.val(l),n.data("ContactTagsValue",l),n.inputosaurus("refresh")),r&&i.utils.unwrapObservable(r)&&n.inputosaurus("focus")}},i.bindingHandlers.command={init:function(e,t,s,n){var a=o(e),r=t();if(!r||!r.enabled||!r.canExecute)throw new Error("You are not using command function");a.addClass("command"),i.bindingHandlers[a.is("form")?"submit":"click"].init.apply(n,arguments)},update:function(e,t){var i=!0,s=o(e),n=t();i=n.enabled(),s.toggleClass("command-not-enabled",!i),i&&(i=n.canExecute(),s.toggleClass("command-can-not-be-execute",!i)),s.toggleClass("command-disabled disable disabled",!i).toggleClass("no-disabled",!!i),(s.is("input")||s.is("button"))&&s.prop("disabled",!i)}},i.extenders.trimmer=function(t){var s=e("Utils"),n=i.computed({read:t,write:function(e){t(s.trim(e.toString()))},owner:this});return n(t()),n},i.extenders.posInterer=function(t,s){var n=e("Utils"),o=i.computed({read:t,write:function(e){var i=n.pInt(e.toString(),s);0>=i&&(i=s),i===t()&&""+i!=""+e&&t(i+1),t(i)}});return o(t()),o},i.extenders.reversible=function(e){var t=e();return e.commit=function(){t=e()},e.reverse=function(){e(t)},e.commitedValue=function(){return t},e},i.extenders.toggleSubscribe=function(e,t){return e.subscribe(t[1],t[0],"beforeChange"),e.subscribe(t[2],t[0]),e},i.extenders.falseTimeout=function(t,i){var n=e("Utils");return t.iTimeout=0,t.subscribe(function(e){e&&(s.clearTimeout(t.iTimeout),t.iTimeout=s.setTimeout(function(){t(!1),t.iTimeout=0},n.pInt(i)))}),t},i.observable.fn.validateNone=function(){return this.hasError=i.observable(!1),this},i.observable.fn.validateEmail=function(){var t=e("Utils");return this.hasError=i.observable(!1),this.subscribe(function(e){e=t.trim(e),this.hasError(""!==e&&!/^[^@\s]+@[^@\s]+$/.test(e))},this),this.valueHasMutated(),this},i.observable.fn.validateSimpleEmail=function(){var t=e("Utils");return this.hasError=i.observable(!1),this.subscribe(function(e){e=t.trim(e),this.hasError(""!==e&&!/^.+@.+$/.test(e))},this),this.valueHasMutated(),this},i.observable.fn.validateFunc=function(t){var s=e("Utils");return this.hasFuncError=i.observable(!1),s.isFunc(t)&&(this.subscribe(function(e){this.hasFuncError(!t(e))},this),this.valueHasMutated()),this},t.exports=i}(t,ko)},{$:15,Globals:8,"Model:ContactTag":27,"Model:Email":28,Utils:11,_:20,window:21}],18:[function(e,t){t.exports=moment},{}],19:[function(e,t){t.exports=ssm},{}],20:[function(e,t){t.exports=_},{}],21:[function(e,t){t.exports=window},{}],22:[function(e,t){!function(e,t){"use strict";function i(){this.oScreens={},this.sDefaultScreenName="",this.oCurrentScreen=null}var s=t("$"),n=t("_"),o=t("ko"),a=t("hasher"),r=t("crossroads"),l=t("Globals"),c=t("Plugins"),u=t("Utils"),d=t("Knoin:AbstractViewModel");i.prototype.oScreens={},i.prototype.sDefaultScreenName="",i.prototype.oCurrentScreen=null,i.prototype.hideLoading=function(){s("#rl-loading").hide()},i.prototype.constructorEnd=function(e){u.isFunc(e.__constructor_end)&&e.__constructor_end.call(e)},i.prototype.extendAsViewModel=function(e,t,i){t&&(i||(i=d),t.__name=e,c.regViewModelHook(e,t),n.extend(t.prototype,i.prototype))},i.prototype.addSettingsViewModel=function(e,t,i,s,n){e.__rlSettingsData={Label:i,Template:t,Route:s,IsDefault:!!n},l.aViewModels.settings.push(e)},i.prototype.removeSettingsViewModel=function(e){l.aViewModels["settings-removed"].push(e)},i.prototype.disableSettingsViewModel=function(e){l.aViewModels["settings-disabled"].push(e)},i.prototype.routeOff=function(){a.changed.active=!1},i.prototype.routeOn=function(){a.changed.active=!0},i.prototype.screen=function(e){return""===e||u.isUnd(this.oScreens[e])?null:this.oScreens[e]},i.prototype.buildViewModel=function(e,t){if(e&&!e.__builded){var i=this,a=new e(t),r=a.viewModelPosition(),d=s("#rl-content #rl-"+r.toLowerCase()),p=null;e.__builded=!0,e.__vm=a,a.viewModelName=e.__name,d&&1===d.length?(p=s("
    ").addClass("rl-view-model").addClass("RL-"+a.viewModelTemplate()).hide(),p.appendTo(d),a.viewModelDom=p,e.__dom=p,"Popups"===r&&(a.cancelCommand=a.closeCommand=u.createCommand(a,function(){i.hideScreenPopup(e)}),a.modalVisibility.subscribe(function(e){var t=this; -e?(this.viewModelDom.show(),this.storeAndSetKeyScope(),l.popupVisibilityNames.push(this.viewModelName),a.viewModelDom.css("z-index",3e3+l.popupVisibilityNames().length+10),u.delegateRun(this,"onFocus",[],500)):(u.delegateRun(this,"onHide"),this.restoreKeyScope(),l.popupVisibilityNames.remove(this.viewModelName),a.viewModelDom.css("z-index",2e3),l.tooltipTrigger(!l.tooltipTrigger()),n.delay(function(){t.viewModelDom.hide()},300))},a)),c.runHook("view-model-pre-build",[e.__name,a,p]),o.applyBindingAccessorsToNode(p[0],{i18nInit:!0,template:function(){return{name:a.viewModelTemplate()}}},a),u.delegateRun(a,"onBuild",[p]),a&&"Popups"===r&&a.registerPopupKeyDown(),c.runHook("view-model-post-build",[e.__name,a,p])):u.log("Cannot find view model position: "+r)}return e?e.__vm:null},i.prototype.hideScreenPopup=function(e){e&&e.__vm&&e.__dom&&(e.__vm.modalVisibility(!1),c.runHook("view-model-on-hide",[e.__name,e.__vm]))},i.prototype.showScreenPopup=function(e,t){e&&(this.buildViewModel(e),e.__vm&&e.__dom&&(e.__vm.modalVisibility(!0),u.delegateRun(e.__vm,"onShow",t||[]),c.runHook("view-model-on-show",[e.__name,e.__vm,t||[]])))},i.prototype.isPopupVisible=function(e){return e&&e.__vm?e.__vm.modalVisibility():!1},i.prototype.screenOnRoute=function(e,t){var i=this,s=null,o=null;""===u.pString(e)&&(e=this.sDefaultScreenName),""!==e&&(s=this.screen(e),s||(s=this.screen(this.sDefaultScreenName),s&&(t=e+"/"+t,e=this.sDefaultScreenName)),s&&s.__started&&(s.__builded||(s.__builded=!0,u.isNonEmptyArray(s.viewModels())&&n.each(s.viewModels(),function(e){this.buildViewModel(e,s)},this),u.delegateRun(s,"onBuild")),n.defer(function(){i.oCurrentScreen&&(u.delegateRun(i.oCurrentScreen,"onHide"),u.isNonEmptyArray(i.oCurrentScreen.viewModels())&&n.each(i.oCurrentScreen.viewModels(),function(e){e.__vm&&e.__dom&&"Popups"!==e.__vm.viewModelPosition()&&(e.__dom.hide(),e.__vm.viewModelVisibility(!1),u.delegateRun(e.__vm,"onHide"))})),i.oCurrentScreen=s,i.oCurrentScreen&&(u.delegateRun(i.oCurrentScreen,"onShow"),c.runHook("screen-on-show",[i.oCurrentScreen.screenName(),i.oCurrentScreen]),u.isNonEmptyArray(i.oCurrentScreen.viewModels())&&n.each(i.oCurrentScreen.viewModels(),function(e){e.__vm&&e.__dom&&"Popups"!==e.__vm.viewModelPosition()&&(e.__dom.show(),e.__vm.viewModelVisibility(!0),u.delegateRun(e.__vm,"onShow"),u.delegateRun(e.__vm,"onFocus",[],200),c.runHook("view-model-on-show",[e.__name,e.__vm]))},i)),o=s.__cross?s.__cross():null,o&&o.parse(t)})))},i.prototype.startScreens=function(e){s("#rl-content").css({visibility:"hidden"}),n.each(e,function(e){var t=new e,i=t?t.screenName():"";t&&""!==i&&(""===this.sDefaultScreenName&&(this.sDefaultScreenName=i),this.oScreens[i]=t)},this),n.each(this.oScreens,function(e){e&&!e.__started&&e.__start&&(e.__started=!0,e.__start(),c.runHook("screen-pre-start",[e.screenName(),e]),u.delegateRun(e,"onStart"),c.runHook("screen-post-start",[e.screenName(),e]))},this);var t=r.create();t.addRoute(/^([a-zA-Z0-9\-]*)\/?(.*)$/,n.bind(this.screenOnRoute,this)),a.initialized.add(t.parse,t),a.changed.add(t.parse,t),a.init(),s("#rl-content").css({visibility:"visible"}),n.delay(function(){l.$html.removeClass("rl-started-trigger").addClass("rl-started")},50)},i.prototype.setHash=function(e,t,i){e="#"===e.substr(0,1)?e.substr(1):e,e="/"===e.substr(0,1)?e.substr(1):e,i=u.isUnd(i)?!1:!!i,(u.isUnd(t)?1:!t)?(a.changed.active=!0,a[i?"replaceHash":"setHash"](e),a.setHash(e)):(a.changed.active=!1,a[i?"replaceHash":"setHash"](e),a.changed.active=!0)},e.exports=new i}(t,e)},{$:15,Globals:8,"Knoin:AbstractViewModel":25,Plugins:10,Utils:11,_:20,crossroads:13,hasher:14,ko:17}],23:[function(e,t){!function(e){"use strict";function t(){}t.prototype.bootstart=function(){},e.exports=t}(t,e)},{}],24:[function(e,t){!function(e,t){"use strict";function i(e,t){this.sScreenName=e,this.aViewModels=n.isArray(t)?t:[]}var s=t("crossroads"),n=t("Utils");i.prototype.oCross=null,i.prototype.sScreenName="",i.prototype.aViewModels=[],i.prototype.viewModels=function(){return this.aViewModels},i.prototype.screenName=function(){return this.sScreenName},i.prototype.routes=function(){return null},i.prototype.__cross=function(){return this.oCross},i.prototype.__start=function(){var e=this.routes(),t=null,i=null;n.isNonEmptyArray(e)&&(i=_.bind(this.onRoute||n.emptyFunction,this),t=s.create(),_.each(e,function(e){t.addRoute(e[0],i).rules=e[1]}),this.oCross=t)},e.exports=i}(t,e)},{Utils:11,crossroads:13}],25:[function(e,t){!function(e,t){"use strict";function i(e,t){this.bDisabeCloseOnEsc=!1,this.sPosition=a.pString(e),this.sTemplate=a.pString(t),this.sDefaultKeyScope=n.KeyState.None,this.sCurrentKeyScope=this.sDefaultKeyScope,this.viewModelName="",this.viewModelVisibility=s.observable(!1),this.modalVisibility=s.observable(!1).extend({rateLimit:0}),this.viewModelDom=null}var s=t("ko"),n=t("Enums"),o=t("Globals"),a=t("Utils");i.prototype.sPosition="",i.prototype.sTemplate="",i.prototype.viewModelName="",i.prototype.viewModelDom=null,i.prototype.viewModelTemplate=function(){return this.sTemplate},i.prototype.viewModelPosition=function(){return this.sPosition},i.prototype.cancelCommand=function(){},i.prototype.closeCommand=function(){},i.prototype.storeAndSetKeyScope=function(){this.sCurrentKeyScope=o.keyScope(),o.keyScope(this.sDefaultKeyScope)},i.prototype.restoreKeyScope=function(){o.keyScope(this.sCurrentKeyScope)},i.prototype.registerPopupKeyDown=function(){var e=this;o.$win.on("keydown",function(t){if(t&&e.modalVisibility&&e.modalVisibility()){if(!this.bDisabeCloseOnEsc&&n.EventKeyCode.Esc===t.keyCode)return a.delegateRun(e,"cancelCommand"),!1;if(n.EventKeyCode.Backspace===t.keyCode&&!a.inFocus())return!1}return!0})},e.exports=i}(t,e)},{Enums:6,Globals:8,Utils:11,ko:17}],26:[function(e,t){!function(e,t){"use strict";function i(){this.mimeType="",this.fileName="",this.estimatedSize=0,this.friendlySize="",this.isInline=!1,this.isLinked=!1,this.cid="",this.cidWithOutTags="",this.contentLocation="",this.download="",this.folder="",this.uid="",this.mimeIndex=""}var s=t("window"),n=t("Globals"),o=t("Utils"),a=t("LinkBuilder");i.newInstanceFromJson=function(e){var t=new i;return t.initByJson(e)?t:null},i.prototype.mimeType="",i.prototype.fileName="",i.prototype.estimatedSize=0,i.prototype.friendlySize="",i.prototype.isInline=!1,i.prototype.isLinked=!1,i.prototype.cid="",i.prototype.cidWithOutTags="",i.prototype.contentLocation="",i.prototype.download="",i.prototype.folder="",i.prototype.uid="",i.prototype.mimeIndex="",i.prototype.initByJson=function(e){var t=!1;return e&&"Object/Attachment"===e["@Object"]&&(this.mimeType=(e.MimeType||"").toLowerCase(),this.fileName=e.FileName,this.estimatedSize=o.pInt(e.EstimatedSize),this.isInline=!!e.IsInline,this.isLinked=!!e.IsLinked,this.cid=e.CID,this.contentLocation=e.ContentLocation,this.download=e.Download,this.folder=e.Folder,this.uid=e.Uid,this.mimeIndex=e.MimeIndex,this.friendlySize=o.friendlySize(this.estimatedSize),this.cidWithOutTags=this.cid.replace(/^<+/,"").replace(/>+$/,""),t=!0),t},i.prototype.isImage=function(){return-1,]+)>?,? ?/g,i=t.exec(e);i?(this.name=i[1]||"",this.email=i[2]||"",this.clearDuplicateName()):/^[^@]+@[^@]+$/.test(e)&&(this.name="",this.email=e)},i.prototype.initByJson=function(e){var t=!1;return e&&"Object/Email"===e["@Object"]&&(this.name=n.trim(e.Name),this.email=n.trim(e.Email),t=""!==this.email,this.clearDuplicateName()),t},i.prototype.toLine=function(e,t,i){var s="";return""!==this.email&&(t=n.isUnd(t)?!1:!!t,i=n.isUnd(i)?!1:!!i,e&&""!==this.name?s=t?'
    ")+'" target="_blank" tabindex="-1">'+n.encodeHtml(this.name)+"":i?n.encodeHtml(this.name):this.name:(s=this.email,""!==this.name?t?s=n.encodeHtml('"'+this.name+'" <')+'")+'" target="_blank" tabindex="-1">'+n.encodeHtml(s)+""+n.encodeHtml(">"):(s='"'+this.name+'" <'+s+">",i&&(s=n.encodeHtml(s))):t&&(s=''+n.encodeHtml(this.email)+""))),s},i.prototype.mailsoParse=function(e){if(e=n.trim(e),""===e)return!1;for(var t=function(e,t,i){e+="";var s=e.length;return 0>t&&(t+=s),s="undefined"==typeof i?s:0>i?i+s:i+t,t>=e.length||0>t||t>s?!1:e.slice(t,s)},i=function(e,t,i,s){return 0>i&&(i+=e.length),s=void 0!==s?s:e.length,0>s&&(s=s+e.length-i),e.slice(0,i)+t.substr(0,s)+t.slice(s)+e.slice(i+s)},s="",o="",a="",r=!1,l=!1,c=!1,u=null,d=0,p=0,h=0;h0&&0===s.length&&(s=t(e,0,h)),l=!0,d=h);break;case">":l&&(p=h,o=t(e,d+1,p-d-1),e=i(e,"",d,p-d+1),p=0,h=0,d=0,l=!1);break;case"(":r||l||c||(c=!0,d=h);break;case")":c&&(p=h,a=t(e,d+1,p-d-1),e=i(e,"",d,p-d+1),p=0,h=0,d=0,c=!1);break;case"\\":h++}h++}return 0===o.length&&(u=e.match(/[^@\s]+@\S+/i),u&&u[0]?o=u[0]:s=e),o.length>0&&0===s.length&&0===a.length&&(s=e.replace(o,"")),o=n.trim(o).replace(/^[<]+/,"").replace(/[>]+$/,""),s=n.trim(s).replace(/^["']+/,"").replace(/["']+$/,""),a=n.trim(a).replace(/^[(]+/,"").replace(/[)]+$/,""),s=s.replace(/\\\\(.)/g,"$1"),a=a.replace(/\\\\(.)/g,"$1"),this.name=s,this.email=o,this.clearDuplicateName(),!0},i.prototype.inputoTagLine=function(){return 0t?t:e))},this),this.body=null,this.plainRaw="",this.isHtml=a.observable(!1),this.hasImages=a.observable(!1),this.attachments=a.observableArray([]),this.isPgpSigned=a.observable(!1),this.isPgpEncrypted=a.observable(!1),this.pgpSignedVerifyStatus=a.observable(l.SignedVerifyStatus.None),this.pgpSignedVerifyUser=a.observable(""),this.priority=a.observable(l.MessagePriority.Normal),this.readReceipt=a.observable(""),this.aDraftInfo=[],this.sMessageId="",this.sInReplyTo="",this.sReferences="",this.parentUid=a.observable(0),this.threads=a.observableArray([]),this.threadsLen=a.observable(0),this.hasUnseenSubMessage=a.observable(!1),this.hasFlaggedSubMessage=a.observable(!1),this.lastInCollapsedThread=a.observable(!1),this.lastInCollapsedThreadLoading=a.observable(!1),this.threadsLenResult=a.computed(function(){var e=this.threadsLen();return 0===this.parentUid()&&e>0?e+1:""},this)}var s=t("window"),n=t("$"),o=t("_"),a=t("ko"),r=t("moment"),l=t("Enums"),c=t("Utils"),u=t("Globals"),d=t("LinkBuilder"),p=t("Model:Email"),h=t("Model:Attachment");i.newInstanceFromJson=function(e){var t=new i;return t.initByJson(e)?t:null},i.calculateFullFromatDateValue=function(e){return e>0?r.unix(e).format("LLL"):""},i.emailsToLine=function(e,t,i){var s=[],n=0,o=0;if(c.isNonEmptyArray(e))for(n=0,o=e.length;o>n;n++)s.push(e[n].toLine(t,i));return s.join(", ")},i.emailsToLineClear=function(e){var t=[],i=0,s=0;if(c.isNonEmptyArray(e))for(i=0,s=e.length;s>i;i++)e[i]&&e[i].email&&""!==e[i].name&&t.push(e[i].email);return t.join(", ")},i.initEmailsFromJson=function(e){var t=0,i=0,s=null,n=[];if(c.isNonEmptyArray(e))for(t=0,i=e.length;i>t;t++)s=p.newInstanceFromJson(e[t]),s&&n.push(s);return n},i.replyHelper=function(e,t,i){if(e&&0s;s++)c.isUnd(t[e[s].email])&&(t[e[s].email]=!0,i.push(e[s]))},i.prototype.clear=function(){this.folderFullNameRaw="",this.uid="",this.hash="",this.requestHash="",this.subject(""),this.subjectPrefix(""),this.subjectSuffix(""),this.size(0),this.dateTimeStampInUTC(0),this.priority(l.MessagePriority.Normal),this.proxy=!1,this.fromEmailString(""),this.fromClearEmailString(""),this.toEmailsString(""),this.toClearEmailsString(""),this.senderEmailsString(""),this.senderClearEmailsString(""),this.emails=[],this.from=[],this.to=[],this.cc=[],this.bcc=[],this.replyTo=[],this.deliveredTo=[],this.newForAnimation(!1),this.deleted(!1),this.unseen(!1),this.flagged(!1),this.answered(!1),this.forwarded(!1),this.isReadReceipt(!1),this.selected(!1),this.checked(!1),this.hasAttachments(!1),this.attachmentsMainType(""),this.body=null,this.isHtml(!1),this.hasImages(!1),this.attachments([]),this.isPgpSigned(!1),this.isPgpEncrypted(!1),this.pgpSignedVerifyStatus(l.SignedVerifyStatus.None),this.pgpSignedVerifyUser(""),this.priority(l.MessagePriority.Normal),this.readReceipt(""),this.aDraftInfo=[],this.sMessageId="",this.sInReplyTo="",this.sReferences="",this.parentUid(0),this.threads([]),this.threadsLen(0),this.hasUnseenSubMessage(!1),this.hasFlaggedSubMessage(!1),this.lastInCollapsedThread(!1),this.lastInCollapsedThreadLoading(!1)},i.prototype.computeSenderEmail=function(){var e=t("Storage:RainLoop:Data"),i=e.sentFolder(),s=e.draftFolder();this.senderEmailsString(this.folderFullNameRaw===i||this.folderFullNameRaw===s?this.toEmailsString():this.fromEmailString()),this.senderClearEmailsString(this.folderFullNameRaw===i||this.folderFullNameRaw===s?this.toClearEmailsString():this.fromClearEmailString())},i.prototype.initByJson=function(e){var t=!1;return e&&"Object/Message"===e["@Object"]&&(this.folderFullNameRaw=e.Folder,this.uid=e.Uid,this.hash=e.Hash,this.requestHash=e.RequestHash,this.proxy=!!e.ExternalProxy,this.size(c.pInt(e.Size)),this.from=i.initEmailsFromJson(e.From),this.to=i.initEmailsFromJson(e.To),this.cc=i.initEmailsFromJson(e.Cc),this.bcc=i.initEmailsFromJson(e.Bcc),this.replyTo=i.initEmailsFromJson(e.ReplyTo),this.deliveredTo=i.initEmailsFromJson(e.DeliveredTo),this.subject(e.Subject),c.isArray(e.SubjectParts)?(this.subjectPrefix(e.SubjectParts[0]),this.subjectSuffix(e.SubjectParts[1])):(this.subjectPrefix(""),this.subjectSuffix(this.subject())),this.dateTimeStampInUTC(c.pInt(e.DateTimeStampInUTC)),this.hasAttachments(!!e.HasAttachments),this.attachmentsMainType(e.AttachmentsMainType),this.fromEmailString(i.emailsToLine(this.from,!0)),this.fromClearEmailString(i.emailsToLineClear(this.from)),this.toEmailsString(i.emailsToLine(this.to,!0)),this.toClearEmailsString(i.emailsToLineClear(this.to)),this.parentUid(c.pInt(e.ParentThread)),this.threads(c.isArray(e.Threads)?e.Threads:[]),this.threadsLen(c.pInt(e.ThreadsLen)),this.initFlagsByJson(e),this.computeSenderEmail(),t=!0),t},i.prototype.initUpdateByMessageJson=function(e){var i=t("Storage:RainLoop:Data"),s=!1,n=l.MessagePriority.Normal;return e&&"Object/Message"===e["@Object"]&&(n=c.pInt(e.Priority),this.priority(-1t;t++)s=h.newInstanceFromJson(e["@Collection"][t]),s&&(""!==s.cidWithOutTags&&0+$/,""),t=o.find(i,function(t){return e===t.cidWithOutTags})),t||null},i.prototype.findAttachmentByContentLocation=function(e){var t=null,i=this.attachments();return c.isNonEmptyArray(i)&&(t=o.find(i,function(t){return e===t.contentLocation})),t||null},i.prototype.messageId=function(){return this.sMessageId},i.prototype.inReplyTo=function(){return this.sInReplyTo},i.prototype.references=function(){return this.sReferences},i.prototype.fromAsSingleEmail=function(){return c.isArray(this.from)&&this.from[0]?this.from[0].email:""},i.prototype.viewLink=function(){return d.messageViewLink(this.requestHash)},i.prototype.downloadLink=function(){return d.messageDownloadLink(this.requestHash)},i.prototype.replyEmails=function(e){var t=[],s=c.isUnd(e)?{}:e;return i.replyHelper(this.replyTo,s,t),0===t.length&&i.replyHelper(this.from,s,t),t},i.prototype.replyAllEmails=function(e){var t=[],s=[],n=c.isUnd(e)?{}:e;return i.replyHelper(this.replyTo,n,t),0===t.length&&i.replyHelper(this.from,n,t),i.replyHelper(this.to,n,t),i.replyHelper(this.cc,n,s),[t,s]},i.prototype.textBodyToString=function(){return this.body?this.body.html():""},i.prototype.attachmentsToStringLine=function(){var e=o.map(this.attachments(),function(e){return e.fileName+" ("+e.friendlySize+")"});return e&&0=0&&s&&!o&&i.attr("src",s)}),e&&s.setTimeout(function(){t.print()},100))})},i.prototype.printMessage=function(){this.viewPopupMessage(!0)},i.prototype.generateUid=function(){return this.folderFullNameRaw+"/"+this.uid},i.prototype.populateByMessageListItem=function(e){return this.folderFullNameRaw=e.folderFullNameRaw,this.uid=e.uid,this.hash=e.hash,this.requestHash=e.requestHash,this.subject(e.subject()),this.subjectPrefix(this.subjectPrefix()),this.subjectSuffix(this.subjectSuffix()),this.size(e.size()),this.dateTimeStampInUTC(e.dateTimeStampInUTC()),this.priority(e.priority()),this.proxy=e.proxy,this.fromEmailString(e.fromEmailString()),this.fromClearEmailString(e.fromClearEmailString()),this.toEmailsString(e.toEmailsString()),this.toClearEmailsString(e.toClearEmailsString()),this.emails=e.emails,this.from=e.from,this.to=e.to,this.cc=e.cc,this.bcc=e.bcc,this.replyTo=e.replyTo,this.deliveredTo=e.deliveredTo,this.unseen(e.unseen()),this.flagged(e.flagged()),this.answered(e.answered()),this.forwarded(e.forwarded()),this.isReadReceipt(e.isReadReceipt()),this.selected(e.selected()),this.checked(e.checked()),this.hasAttachments(e.hasAttachments()),this.attachmentsMainType(e.attachmentsMainType()),this.moment(e.moment()),this.body=null,this.priority(l.MessagePriority.Normal),this.aDraftInfo=[],this.sMessageId="",this.sInReplyTo="",this.sReferences="",this.parentUid(e.parentUid()),this.threads(e.threads()),this.threadsLen(e.threadsLen()),this.computeSenderEmail(),this},i.prototype.showExternalImages=function(e){if(this.body&&this.body.data("rl-has-images")){var t="";e=c.isUnd(e)?!1:e,this.hasImages(!1),this.body.data("rl-has-images",!1),t=this.proxy?"data-x-additional-src":"data-x-src",n("["+t+"]",this.body).each(function(){e&&n(this).is("img")?n(this).addClass("lazy").attr("data-original",n(this).attr(t)).removeAttr(t):n(this).attr("src",n(this).attr(t)).removeAttr(t)}),t=this.proxy?"data-x-additional-style-url":"data-x-style-url",n("["+t+"]",this.body).each(function(){var e=c.trim(n(this).attr("style"));e=""===e?"":";"===e.substr(-1)?e+" ":e+"; ",n(this).attr("style",e+n(this).attr(t)).removeAttr(t)}),e&&(n("img.lazy",this.body).addClass("lazy-inited").lazyload({threshold:400,effect:"fadeIn",skip_invisible:!1,container:n(".RL-MailMessageView .messageView .messageItem .content")[0]}),u.$win.resize()),c.windowResize(500)}},i.prototype.showInternalImages=function(e){if(this.body&&!this.body.data("rl-init-internal-images")){this.body.data("rl-init-internal-images",!0),e=c.isUnd(e)?!1:e;var t=this;n("[data-x-src-cid]",this.body).each(function(){var i=t.findAttachmentByCid(n(this).attr("data-x-src-cid"));i&&i.download&&(e&&n(this).is("img")?n(this).addClass("lazy").attr("data-original",i.linkPreview()):n(this).attr("src",i.linkPreview()))}),n("[data-x-src-location]",this.body).each(function(){var i=t.findAttachmentByContentLocation(n(this).attr("data-x-src-location"));i||(i=t.findAttachmentByCid(n(this).attr("data-x-src-location"))),i&&i.download&&(e&&n(this).is("img")?n(this).addClass("lazy").attr("data-original",i.linkPreview()):n(this).attr("src",i.linkPreview()))}),n("[data-x-style-cid]",this.body).each(function(){var e="",i="",s=t.findAttachmentByCid(n(this).attr("data-x-style-cid"));s&&s.linkPreview&&(i=n(this).attr("data-x-style-cid-name"),""!==i&&(e=c.trim(n(this).attr("style")),e=""===e?"":";"===e.substr(-1)?e+" ":e+"; ",n(this).attr("style",e+i+": url('"+s.linkPreview()+"')")))}),e&&!function(e,t){o.delay(function(){e.addClass("lazy-inited").lazyload({threshold:400,effect:"fadeIn",skip_invisible:!1,container:t})},300)}(n("img.lazy",t.body),n(".RL-MailMessageView .messageView .messageItem .content")[0]),c.windowResize(500)}},i.prototype.storeDataToDom=function(){if(this.body){this.body.data("rl-is-html",!!this.isHtml()),this.body.data("rl-has-images",!!this.hasImages()),this.body.data("rl-plain-raw",this.plainRaw);var e=t("Storage:RainLoop:Data");e.capaOpenPGP()&&(this.body.data("rl-plain-pgp-signed",!!this.isPgpSigned()),this.body.data("rl-plain-pgp-encrypted",!!this.isPgpEncrypted()),this.body.data("rl-pgp-verify-status",this.pgpSignedVerifyStatus()),this.body.data("rl-pgp-verify-user",this.pgpSignedVerifyUser()))}},i.prototype.storePgpVerifyDataToDom=function(){var e=t("Storage:RainLoop:Data");this.body&&e.capaOpenPGP()&&(this.body.data("rl-pgp-verify-status",this.pgpSignedVerifyStatus()),this.body.data("rl-pgp-verify-user",this.pgpSignedVerifyUser()))},i.prototype.fetchDataToDom=function(){if(this.body){this.isHtml(!!this.body.data("rl-is-html")),this.hasImages(!!this.body.data("rl-has-images")),this.plainRaw=c.pString(this.body.data("rl-plain-raw"));var e=t("Storage:RainLoop:Data");e.capaOpenPGP()?(this.isPgpSigned(!!this.body.data("rl-plain-pgp-signed")),this.isPgpEncrypted(!!this.body.data("rl-plain-pgp-encrypted")),this.pgpSignedVerifyStatus(this.body.data("rl-pgp-verify-status")),this.pgpSignedVerifyUser(this.body.data("rl-pgp-verify-user"))):(this.isPgpSigned(!1),this.isPgpEncrypted(!1),this.pgpSignedVerifyStatus(l.SignedVerifyStatus.None),this.pgpSignedVerifyUser(""))}},i.prototype.verifyPgpSignedClearMessage=function(){if(this.isPgpSigned()){var e=[],i=null,a=t("Storage:RainLoop:Data"),r=this.from&&this.from[0]&&this.from[0].email?this.from[0].email:"",c=a.findPublicKeysByEmail(r),d=null,p=null,h="";this.pgpSignedVerifyStatus(l.SignedVerifyStatus.Error),this.pgpSignedVerifyUser("");try{i=s.openpgp.cleartext.readArmored(this.plainRaw),i&&i.getText&&(this.pgpSignedVerifyStatus(c.length?l.SignedVerifyStatus.Unverified:l.SignedVerifyStatus.UnknownPublicKeys),e=i.verify(c),e&&0').text(h)).html(),u.$div.empty(),this.replacePlaneTextBody(h)))))}catch(g){}this.storePgpVerifyDataToDom()}},i.prototype.decryptPgpEncryptedMessage=function(e){if(this.isPgpEncrypted()){var i=[],a=null,r=null,c=t("Storage:RainLoop:Data"),d=this.from&&this.from[0]&&this.from[0].email?this.from[0].email:"",p=c.findPublicKeysByEmail(d),h=c.findSelfPrivateKey(e),g=null,m=null,f="";this.pgpSignedVerifyStatus(l.SignedVerifyStatus.Error),this.pgpSignedVerifyUser(""),h||this.pgpSignedVerifyStatus(l.SignedVerifyStatus.UnknownPrivateKey);try{a=s.openpgp.message.readArmored(this.plainRaw),a&&h&&a.decrypt&&(this.pgpSignedVerifyStatus(l.SignedVerifyStatus.Unverified),r=a.decrypt(h),r&&(i=r.verify(p),i&&0').text(f)).html(),u.$div.empty(),this.replacePlaneTextBody(f)))}catch(b){}this.storePgpVerifyDataToDom()}},i.prototype.replacePlaneTextBody=function(e){this.body&&this.body.html(e).addClass("b-text-part plain")},i.prototype.flagHash=function(){return[this.deleted(),this.unseen(),this.flagged(),this.answered(),this.forwarded(),this.isReadReceipt()].join("")},e.exports=i}(t,e)},{$:15,Enums:6,Globals:8,LinkBuilder:9,"Model:Attachment":26,"Model:Email":28,"Storage:RainLoop:Data":49,Utils:11,_:20,ko:17,moment:18,window:21}],30:[function(e,t){!function(e,t){"use strict"; -function i(e){u.call(this,"settings",e),this.menu=o.observableArray([]),this.oCurrentSubScreen=null,this.oViewModelPlace=null}var s=t("$"),n=t("_"),o=t("ko"),a=t("Globals"),r=t("Utils"),l=t("LinkBuilder"),c=t("App:Knoin"),u=t("Knoin:AbstractScreen");n.extend(i.prototype,u.prototype),i.prototype.onRoute=function(e){var t=this,i=null,u=null,d=null,p=null;u=n.find(a.aViewModels.settings,function(t){return t&&t.__rlSettingsData&&e===t.__rlSettingsData.Route}),u&&(n.find(a.aViewModels["settings-removed"],function(e){return e&&e===u})&&(u=null),u&&n.find(a.aViewModels["settings-disabled"],function(e){return e&&e===u})&&(u=null)),u?(u.__builded&&u.__vm?i=u.__vm:(d=this.oViewModelPlace,d&&1===d.length?(i=new u,p=s("
    ").addClass("rl-settings-view-model").hide(),p.appendTo(d),i.viewModelDom=p,i.__rlSettingsData=u.__rlSettingsData,u.__dom=p,u.__builded=!0,u.__vm=i,o.applyBindingAccessorsToNode(p[0],{i18nInit:!0,template:function(){return{name:u.__rlSettingsData.Template}}},i),r.delegateRun(i,"onBuild",[p])):r.log("Cannot find sub settings view model position: SettingsSubScreen")),i&&n.defer(function(){t.oCurrentSubScreen&&(r.delegateRun(t.oCurrentSubScreen,"onHide"),t.oCurrentSubScreen.viewModelDom.hide()),t.oCurrentSubScreen=i,t.oCurrentSubScreen&&(t.oCurrentSubScreen.viewModelDom.show(),r.delegateRun(t.oCurrentSubScreen,"onShow"),r.delegateRun(t.oCurrentSubScreen,"onFocus",[],200),n.each(t.menu(),function(e){e.selected(i&&i.__rlSettingsData&&e.route===i.__rlSettingsData.Route)}),s("#rl-content .b-settings .b-content .content").scrollTop(0)),r.windowResize()})):c.setHash(l.settings(),!1,!0)},i.prototype.onHide=function(){this.oCurrentSubScreen&&this.oCurrentSubScreen.viewModelDom&&(r.delegateRun(this.oCurrentSubScreen,"onHide"),this.oCurrentSubScreen.viewModelDom.hide())},i.prototype.onBuild=function(){n.each(a.aViewModels.settings,function(e){e&&e.__rlSettingsData&&!n.find(a.aViewModels["settings-removed"],function(t){return t&&t===e})&&this.menu.push({route:e.__rlSettingsData.Route,label:e.__rlSettingsData.Label,selected:o.observable(!1),disabled:!!n.find(a.aViewModels["settings-disabled"],function(t){return t&&t===e})})},this),this.oViewModelPlace=s("#rl-content #rl-settings-subscreen")},i.prototype.routes=function(){var e=n.find(a.aViewModels.settings,function(e){return e&&e.__rlSettingsData&&e.__rlSettingsData.IsDefault}),t=e?e.__rlSettingsData.Route:"general",i={subname:/^(.*)$/,normalize_:function(e,i){return i.subname=r.isUnd(i.subname)?t:r.pString(i.subname),[i.subname]}};return[["{subname}/",i],["{subname}",i],["",i]]},e.exports=i}(t,e)},{$:15,"App:Knoin":22,Globals:8,"Knoin:AbstractScreen":24,LinkBuilder:9,Utils:11,_:20,ko:17}],31:[function(e,t){!function(e,t){"use strict";function i(){n.call(this,"login",[t("View:Admin:Login")])}var s=t("_"),n=t("Knoin:AbstractScreen");s.extend(i.prototype,n.prototype),i.prototype.onShow=function(){t("App:Admin").setTitle("")},e.exports=i}(t,e)},{"App:Admin":3,"Knoin:AbstractScreen":24,"View:Admin:Login":54,_:20}],32:[function(e,t){!function(e,t){"use strict";function i(){n.call(this,[t("View:Admin:SettingsMenu"),t("View:Admin:SettingsPane")])}var s=t("_"),n=t("Screen:AbstractSettings");s.extend(i.prototype,n.prototype),i.prototype.onShow=function(){t("App:Admin").setTitle("")},e.exports=i}(t,e)},{"App:Admin":3,"Screen:AbstractSettings":30,"View:Admin:SettingsMenu":55,"View:Admin:SettingsPane":56,_:20}],33:[function(e,t){!function(e,t){"use strict";function i(){var e=t("Storage:Settings"),i=t("Storage:Admin:Data");this.version=s.observable(e.settingsGet("Version")),this.access=s.observable(!!e.settingsGet("CoreAccess")),this.errorDesc=s.observable(""),this.coreReal=i.coreReal,this.coreUpdatable=i.coreUpdatable,this.coreAccess=i.coreAccess,this.coreChecking=i.coreChecking,this.coreUpdating=i.coreUpdating,this.coreRemoteVersion=i.coreRemoteVersion,this.coreRemoteRelease=i.coreRemoteRelease,this.coreVersionCompare=i.coreVersionCompare,this.statusType=s.computed(function(){var e="",t=this.coreVersionCompare(),i=this.coreChecking(),s=this.coreUpdating(),n=this.coreReal();return i?e="checking":s?e="updating":n&&0===t?e="up-to-date":n&&-1===t?e="available":n||(e="error",this.errorDesc("Cannot access the repository at the moment.")),e},this)}var s=t("ko");i.prototype.onBuild=function(){this.access()&&t("App:Admin").reloadCoreData()},i.prototype.updateCoreData=function(){this.coreUpdating()||t("App:Admin").updateCoreData()},e.exports=i}(t,e)},{"App:Admin":3,"Storage:Admin:Data":46,"Storage:Settings":53,ko:17}],34:[function(e,t){!function(e,t){"use strict";function i(){var e=t("Enums"),i=t("Storage:Settings");this.title=n.observable(i.settingsGet("Title")),this.title.trigger=n.observable(e.SaveSettingsStep.Idle),this.loadingDesc=n.observable(i.settingsGet("LoadingDescription")),this.loadingDesc.trigger=n.observable(e.SaveSettingsStep.Idle),this.loginLogo=n.observable(i.settingsGet("LoginLogo")),this.loginLogo.trigger=n.observable(e.SaveSettingsStep.Idle),this.loginDescription=n.observable(i.settingsGet("LoginDescription")),this.loginDescription.trigger=n.observable(e.SaveSettingsStep.Idle),this.loginCss=n.observable(i.settingsGet("LoginCss")),this.loginCss.trigger=n.observable(e.SaveSettingsStep.Idle)}var s=t("_"),n=t("ko"),o=t("Utils");i.prototype.onBuild=function(){var e=this,i=t("Storage:Admin:Remote");s.delay(function(){var t=o.settingsSaveHelperSimpleFunction(e.title.trigger,e),s=o.settingsSaveHelperSimpleFunction(e.loadingDesc.trigger,e),n=o.settingsSaveHelperSimpleFunction(e.loginLogo.trigger,e),a=o.settingsSaveHelperSimpleFunction(e.loginDescription.trigger,e),r=o.settingsSaveHelperSimpleFunction(e.loginCss.trigger,e);e.title.subscribe(function(e){i.saveAdminConfig(t,{Title:o.trim(e)})}),e.loadingDesc.subscribe(function(e){i.saveAdminConfig(s,{LoadingDescription:o.trim(e)})}),e.loginLogo.subscribe(function(e){i.saveAdminConfig(n,{LoginLogo:o.trim(e)})}),e.loginDescription.subscribe(function(e){i.saveAdminConfig(a,{LoginDescription:o.trim(e)})}),e.loginCss.subscribe(function(e){i.saveAdminConfig(r,{LoginCss:o.trim(e)})})},50)},e.exports=i}(t,e)},{Enums:6,"Storage:Admin:Remote":47,"Storage:Settings":53,Utils:11,_:20,ko:17}],35:[function(e,t){!function(e,t){"use strict";function i(){var e=t("Storage:Admin:Remote");this.defautOptionsAfterRender=a.defautOptionsAfterRender,this.enableContacts=n.observable(!!r.settingsGet("ContactsEnable")),this.contactsSharing=n.observable(!!r.settingsGet("ContactsSharing")),this.contactsSync=n.observable(!!r.settingsGet("ContactsSync"));var i=["sqlite","mysql","pgsql"],l=[],c=function(e){switch(e){case"sqlite":e="SQLite";break;case"mysql":e="MySQL";break;case"pgsql":e="PostgreSQL"}return e};r.settingsGet("SQLiteIsSupported")&&l.push("sqlite"),r.settingsGet("MySqlIsSupported")&&l.push("mysql"),r.settingsGet("PostgreSqlIsSupported")&&l.push("pgsql"),this.contactsSupported=0(new s.Date).getTime()-g),f&&l.oRequests[f]&&(l.oRequests[f].__aborted&&(n="abort"),l.oRequests[f]=null),l.defaultResponse(e,f,n,i,o,t)}),f&&0=e?1:e},this),this.mainMessageListSearch=a.computed({read:this.messageListSearch,write:function(e){m.setHash(p.mailBox(this.currentFolderFullNameHash(),1,d.trim(e.toString())))},owner:this}),this.messageListError=a.observable(""),this.messageListLoading=a.observable(!1),this.messageListIsNotCompleted=a.observable(!1),this.messageListCompleteLoadingThrottle=a.observable(!1).extend({throttle:200}),this.messageListCompleteLoading=a.computed(function(){var e=this.messageListLoading(),t=this.messageListIsNotCompleted();return e||t},this),this.messageListCompleteLoading.subscribe(function(e){this.messageListCompleteLoadingThrottle(e)},this),this.messageList.subscribe(o.debounce(function(e){o.each(e,function(e){e.newForAnimation()&&e.newForAnimation(!1)})},500)),this.staticMessageList=new f,this.message=a.observable(null),this.messageLoading=a.observable(!1),this.messageLoadingThrottle=a.observable(!1).extend({throttle:50}),this.message.focused=a.observable(!1),this.message.subscribe(function(e){e?c.Layout.NoPreview===this.layout()&&this.message.focused(!0):(this.message.focused(!1),this.messageFullScreenMode(!1),this.hideMessageBodies(),c.Layout.NoPreview===this.layout()&&-10?s.Math.ceil(t/e*100):0},this),this.capaOpenPGP=a.observable(!1),this.openpgpkeys=a.observableArray([]),this.openpgpKeyring=null,this.openpgpkeysPublic=this.openpgpkeys.filter(function(e){return!(!e||e.isPrivate)}),this.openpgpkeysPrivate=this.openpgpkeys.filter(function(e){return!(!e||!e.isPrivate)}),this.googleActions=a.observable(!1),this.googleLoggined=a.observable(!1),this.googleUserName=a.observable(""),this.facebookActions=a.observable(!1),this.facebookLoggined=a.observable(!1),this.facebookUserName=a.observable(""),this.twitterActions=a.observable(!1),this.twitterLoggined=a.observable(!1),this.twitterUserName=a.observable(""),this.customThemeType=a.observable(c.CustomThemeType.Light),this.purgeMessageBodyCacheThrottle=o.throttle(this.purgeMessageBodyCache,3e4)}var s=t("window"),n=t("$"),o=t("_"),a=t("ko"),r=t("moment"),l=t("Consts"),c=t("Enums"),u=t("Globals"),d=t("Utils"),p=t("LinkBuilder"),h=t("Storage:Settings"),g=t("Storage:RainLoop:Cache"),m=t("App:Knoin"),f=t("Model:Message"),b=t("Storage:LocalStorage"),S=t("Storage:Abstract:Data");o.extend(i.prototype,S.prototype),i.prototype.purgeMessageBodyCache=function(){var e=0,t=null,i=u.iMessageBodyCacheCount-l.Values.MessageBodyCacheLimit;i>0&&(t=this.messagesBodiesDom(),t&&(t.find(".rl-cache-class").each(function(){var t=n(this);i>t.data("rl-cache-count")&&(t.addClass("rl-cache-purge"),e++)}),e>0&&o.delay(function(){t.find(".rl-cache-purge").remove()},300)))},i.prototype.populateDataOnStart=function(){S.prototype.populateDataOnStart.call(this),this.accountEmail(h.settingsGet("Email")),this.accountIncLogin(h.settingsGet("IncLogin")),this.accountOutLogin(h.settingsGet("OutLogin")),this.projectHash(h.settingsGet("ProjectHash")),this.defaultIdentityID(h.settingsGet("DefaultIdentityID")),this.displayName(h.settingsGet("DisplayName")),this.replyTo(h.settingsGet("ReplyTo")),this.signature(h.settingsGet("Signature")),this.signatureToAll(!!h.settingsGet("SignatureToAll")),this.enableTwoFactor(!!h.settingsGet("EnableTwoFactor")),this.lastFoldersHash=b.get(c.ClientSideKeyName.FoldersLashHash)||"",this.remoteSuggestions=!!h.settingsGet("RemoteSuggestions"),this.devEmail=h.settingsGet("DevEmail"),this.devPassword=h.settingsGet("DevPassword")},i.prototype.initUidNextAndNewMessages=function(e,t,i){if("INBOX"===e&&d.isNormal(t)&&""!==t){if(d.isArray(i)&&03)l(p.notificationMailIcon(),this.accountEmail(),d.i18n("MESSAGE_LIST/NEW_MESSAGE_NOTIFICATION",{COUNT:r}));else for(;r>a;a++)l(p.notificationMailIcon(),f.emailsToLine(f.initEmailsFromJson(i[a].From),!1),i[a].Subject)}g.setFolderUidNext(e,t)}},i.prototype.hideMessageBodies=function(){var e=this.messagesBodiesDom();e&&e.find(".b-text-part").hide()},i.prototype.getNextFolderNames=function(e){e=d.isUnd(e)?!1:!!e;var t=[],i=10,s=r().unix(),n=s-300,a=[],l=function(t){o.each(t,function(t){t&&"INBOX"!==t.fullNameRaw&&t.selectable&&t.existen&&n>t.interval&&(!e||t.subScribed())&&a.push([t.interval,t.fullNameRaw]),t&&0t[0]?1:0}),o.find(a,function(e){var n=g.getFolderFromCacheList(e[1]);return n&&(n.interval=s,t.push(e[1])),i<=t.length}),o.uniq(t)},i.prototype.removeMessagesFromList=function(e,t,i,s){i=d.isNormal(i)?i:"",s=d.isUnd(s)?!1:!!s,t=o.map(t,function(e){return d.pInt(e)});var n=this,a=0,r=this.messageList(),l=g.getFolderFromCacheList(e),c=""===i?null:g.getFolderFromCacheList(i||""),u=this.currentFolderFullNameRaw(),p=this.message(),h=u===e?o.filter(r,function(e){return e&&-10&&l.messageCountUnread(0<=l.messageCountUnread()-a?l.messageCountUnread()-a:0)),c&&(c.messageCountAll(c.messageCountAll()+t.length),a>0&&c.messageCountUnread(c.messageCountUnread()+a),c.actionBlink(!0)),0').hide().addClass("rl-cache-class"),a.data("rl-cache-count",++u.iMessageBodyCacheCount),d.isNormal(e.Result.Html)&&""!==e.Result.Html?(i=!0,p=e.Result.Html.toString()):d.isNormal(e.Result.Plain)&&""!==e.Result.Plain?(i=!1,p=d.plainToHtml(e.Result.Plain.toString(),!1),(b.isPgpSigned()||b.isPgpEncrypted())&&this.capaOpenPGP()&&(b.plainRaw=d.pString(e.Result.Plain),m=/---BEGIN PGP MESSAGE---/.test(b.plainRaw),m||(h=/-----BEGIN PGP SIGNED MESSAGE-----/.test(b.plainRaw)&&/-----BEGIN PGP SIGNATURE-----/.test(b.plainRaw)),u.$div.empty(),h&&b.isPgpSigned()?p=u.$div.append(n('
    ').text(b.plainRaw)).html():m&&b.isPgpEncrypted()&&(p=u.$div.append(n('
    ').text(b.plainRaw)).html()),u.$div.empty(),b.isPgpSigned(h),b.isPgpEncrypted(m))):i=!1,a.html(d.linkify(p)).addClass("b-text-part "+(i?"html":"plain")),b.isHtml(!!i),b.hasImages(!!s),b.pgpSignedVerifyStatus(c.SignedVerifyStatus.None),b.pgpSignedVerifyUser(""),b.body=a,b.body&&f.append(b.body),b.storeDataToDom(),o&&b.showInternalImages(!0),b.hasImages()&&this.showImages()&&b.showExternalImages(!0),this.purgeMessageBodyCacheThrottle()),this.messageActiveDom(b.body),this.hideMessageBodies(),b.body.show(),a&&d.initBlockquoteSwitcher(a)),g.initMessageFlagsFromCache(b),b.unseen()&&u.__APP&&u.__APP.setMessageSeen(b),d.windowResize())},i.prototype.calculateMessageListHash=function(e){return o.map(e,function(e){return""+e.hash+"_"+e.threadsLen()+"_"+e.flagHash()}).join("|")},i.prototype.findPublicKeyByHex=function(e){return o.find(this.openpgpkeysPublic(),function(t){return t&&e===t.id})},i.prototype.findPublicKeysByEmail=function(e){return o.compact(o.map(this.openpgpkeysPublic(),function(t){var i=null;if(t&&e===t.email)try{if(i=s.openpgp.key.readArmored(t.armor),i&&!i.err&&i.keys&&i.keys[0])return i.keys[0]}catch(n){}return null}))},i.prototype.findPrivateKeyByEmail=function(e,t){var i=null,n=o.find(this.openpgpkeysPrivate(),function(t){return t&&e===t.email});if(n)try{i=s.openpgp.key.readArmored(n.armor),i&&!i.err&&i.keys&&i.keys[0]?(i=i.keys[0],i.decrypt(d.pString(t))):i=null}catch(a){i=null}return i},i.prototype.findSelfPrivateKey=function(e){return this.findPrivateKeyByEmail(this.accountEmail(),e)},e.exports=new i}(t,e)},{$:15,"App:Knoin":22,Consts:5,Enums:6,Globals:8,LinkBuilder:9,"Model:Message":29,"Storage:Abstract:Data":44,"Storage:LocalStorage":50,"Storage:RainLoop:Cache":48,"Storage:Settings":53,Utils:11,_:20,ko:17,moment:18,window:21}],50:[function(e,t){!function(e,t){"use strict";function i(){var e=t("_"),i=e.find([t("Storage:LocalStorage:Cookie"),t("Storage:LocalStorage:LocalStorage")],function(e){return e.supported()});this.oDriver=null,i&&(this.oDriver=new i)}i.prototype.oDriver=null,i.prototype.set=function(e,t){return this.oDriver?this.oDriver.set("p"+e,t):!1},i.prototype.get=function(e){return this.oDriver?this.oDriver.get("p"+e):null},e.exports=new i}(t,e)},{"Storage:LocalStorage:Cookie":51,"Storage:LocalStorage:LocalStorage":52,_:20}],51:[function(e,t){!function(e,t){"use strict";function i(){}var s=t("$"),n=t("JSON"),o=t("Consts"),a=t("Utils");i.supported=function(){return!0},i.prototype.set=function(e,t){var i=s.cookie(o.Values.ClientSideCookieIndexName),a=!1,r=null;try{r=null===i?null:n.parse(i),r||(r={}),r[e]=t,s.cookie(o.Values.ClientSideCookieIndexName,n.stringify(r),{expires:30}),a=!0}catch(l){}return a},i.prototype.get=function(e){var t=s.cookie(o.Values.ClientSideCookieIndexName),i=null;try{i=null===t?null:n.parse(t),i=i&&!a.isUnd(i[e])?i[e]:null}catch(r){}return i},e.exports=i}(t,e)},{$:15,Consts:5,JSON:12,Utils:11}],52:[function(e,t){!function(e,t){"use strict";function i(){}var s=t("window"),n=t("JSON"),o=t("Consts"),a=t("Utils");i.supported=function(){return!!s.localStorage},i.prototype.set=function(e,t){var i=s.localStorage[o.Values.ClientSideCookieIndexName]||null,a=!1,r=null;try{r=null===i?null:n.parse(i),r||(r={}),r[e]=t,s.localStorage[o.Values.ClientSideCookieIndexName]=n.stringify(r),a=!0}catch(l){}return a},i.prototype.get=function(e){var t=s.localStorage[o.Values.ClientSideCookieIndexName]||null,i=null;try{i=null===t?null:n.parse(t),i=i&&!a.isUnd(i[e])?i[e]:null}catch(r){}return i},e.exports=i}(t,e)},{Consts:5,JSON:12,Utils:11,window:21}],53:[function(e,t){!function(e,t){"use strict";function i(){this.oSettings=s.rainloopAppData||{},this.oSettings=n.isNormal(this.oSettings)?this.oSettings:{}}var s=t("window"),n=t("Utils");i.prototype.oSettings=null,i.prototype.settingsGet=function(e){return n.isUnd(this.oSettings[e])?null:this.oSettings[e]},i.prototype.settingsSet=function(e,t){this.oSettings[e]=t},i.prototype.capa=function(e){var t=this.settingsGet("Capa");return n.isArray(t)&&n.isNormal(e)&&-1').appendTo("body"),a.$win.on("error",function(t){t&&t.originalEvent&&t.originalEvent.message&&-1===r.inArray(t.originalEvent.message,["Script error.","Uncaught Error: Error calling method on NPObject."])&&e.jsError(r.emptyFunction,t.originalEvent.message,t.originalEvent.filename,t.originalEvent.lineno,n.location&&n.location.toString?n.location.toString():"",a.$html.attr("class"),r.microtime()-a.now)}),a.$doc.on("keydown",function(e){e&&e.ctrlKey&&a.$html.addClass("rl-ctrl-key-pressed")}).on("keyup",function(e){e&&!e.ctrlKey&&a.$html.removeClass("rl-ctrl-key-pressed")})}var n=t("window"),o=t("_"),s=t("$"),a=t("Globals"),r=t("Utils"),l=t("LinkBuilder"),c=t("Events"),u=t("Storage:Settings"),p=t("Knoin:AbstractBoot");o.extend(i.prototype,p.prototype),i.prototype.remote=function(){return null},i.prototype.data=function(){return null},i.prototype.setupSettings=function(){return!0},i.prototype.download=function(e){var t=null,i=null,o=n.navigator.userAgent.toLowerCase();return o&&(o.indexOf("chrome")>-1||o.indexOf("chrome")>-1)&&(i=n.document.createElement("a"),i.href=e,n.document.createEvent&&(t=n.document.createEvent("MouseEvents"),t&&t.initEvent&&i.dispatchEvent))?(t.initEvent("click",!0,!0),i.dispatchEvent(t),!0):(a.bMobileDevice?(n.open(e,"_self"),n.focus()):this.iframe.attr("src",e),!0)},i.prototype.setTitle=function(e){e=(r.isNormal(e)&&0"),i.now=(new n.Date).getTime(),i.momentTrigger=a.observable(!0),i.dropdownVisibility=a.observable(!1).extend({rateLimit:0}),i.tooltipTrigger=a.observable(!1).extend({rateLimit:0}),i.langChangeTrigger=a.observable(!0),i.useKeyboardShortcuts=a.observable(!0),i.iAjaxErrorCount=0,i.iTokenErrorCount=0,i.iMessageBodyCacheCount=0,i.bUnload=!1,i.sUserAgent=(n.navigator.userAgent||"").toLowerCase(),i.bIsiOSDevice=-11&&(n=n.replace(/[\/]+$/,""),n+="/p"+t),""!==i&&(n=n.replace(/[\/]+$/,""),n+="/"+encodeURI(i)),n},i.prototype.phpInfo=function(){return this.sServer+"Info"},i.prototype.langLink=function(e){return this.sServer+"/Lang/0/"+encodeURI(e)+"/"+this.sVersion+"/"},i.prototype.exportContactsVcf=function(){return this.sServer+"/Raw/"+this.sSpecSuffix+"/ContactsVcf/"},i.prototype.exportContactsCsv=function(){return this.sServer+"/Raw/"+this.sSpecSuffix+"/ContactsCsv/"},i.prototype.emptyContactPic=function(){return this.sStaticPrefix+"css/images/empty-contact.png"},i.prototype.sound=function(e){return this.sStaticPrefix+"sounds/"+e},i.prototype.themePreviewLink=function(e){var t="rainloop/v/"+this.sVersion+"/";return"@custom"===e.substr(-7)&&(e=o.trim(e.substring(0,e.length-7)),t=""),t+"themes/"+encodeURI(e)+"/images/preview.png"},i.prototype.notificationMailIcon=function(){return this.sStaticPrefix+"css/images/icom-message-notification.png"},i.prototype.openPgpJs=function(){return this.sStaticPrefix+"js/openpgp.min.js"},i.prototype.socialGoogle=function(){return this.sServer+"SocialGoogle"+(""!==this.sSpecSuffix?"/"+this.sSpecSuffix+"/":"")},i.prototype.socialTwitter=function(){return this.sServer+"SocialTwitter"+(""!==this.sSpecSuffix?"/"+this.sSpecSuffix+"/":"")},i.prototype.socialFacebook=function(){return this.sServer+"SocialFacebook"+(""!==this.sSpecSuffix?"/"+this.sSpecSuffix+"/":"")},e.exports=new i}(t,e)},{"Storage:Settings":45,Utils:11,window:20}],10:[function(e,t){!function(e,t){"use strict";function i(){this.__boot=null,this.__data=null,this.__remote=null,this.oSettings=t("Storage:Settings"),this.oViewModelsHooks={},this.oSimpleHooks={}}var n=t("_"),o=t("Utils");i.prototype.__boot=null,i.prototype.__data=null,i.prototype.__remote=null,i.prototype.oViewModelsHooks={},i.prototype.oSimpleHooks={},i.prototype.addHook=function(e,t){o.isFunc(t)&&(o.isArray(this.oSimpleHooks[e])||(this.oSimpleHooks[e]=[]),this.oSimpleHooks[e].push(t))},i.prototype.runHook=function(e,t){o.isArray(this.oSimpleHooks[e])&&(t=t||[],n.each(this.oSimpleHooks[e],function(e){e.apply(null,t)}))},i.prototype.mainSettingsGet=function(e){return this.oSettings.settingsGet(e)},i.prototype.remoteRequest=function(e,t,i,n,o,s){this.__remote&&this.__remote.defaultRequest(e,t,i,n,o,s)},i.prototype.settingsGet=function(e,t){var i=this.oSettings.settingsGet("Plugins");return i=i&&!o.isUnd(i[e])?i[e]:null,i?o.isUnd(i[t])?null:i[t]:null},e.exports=new i}(t,e)},{"Storage:Settings":45,Utils:11,_:19}],11:[function(e,t){!function(e,t){"use strict";var i={},n=t("window"),o=t("_"),s=t("$"),a=t("ko"),r=t("Enums"),l=t("Consts"),c=t("Globals");i.trim=s.trim,i.inArray=s.inArray,i.isArray=o.isArray,i.isFunc=o.isFunction,i.isUnd=o.isUndefined,i.isNull=o.isNull,i.emptyFunction=function(){},i.isNormal=function(e){return!i.isUnd(e)&&!i.isNull(e)},i.windowResize=o.debounce(function(e){i.isUnd(e)?c.$win.resize():n.setTimeout(function(){c.$win.resize()},e)},50),i.isPosNumeric=function(e,t){return i.isNormal(e)?(i.isUnd(t)?0:!t)?/^[1-9]+[0-9]*$/.test(e.toString()):/^[0-9]*$/.test(e.toString()):!1},i.pInt=function(e,t){var o=i.isNormal(e)&&""!==e?n.parseInt(e,10):t||0;return n.isNaN(o)?t||0:o},i.pString=function(e){return i.isNormal(e)?""+e:""},i.isNonEmptyArray=function(e){return i.isArray(e)&&0s;s++)o=i[s].split("="),t[n.decodeURIComponent(o[0])]=n.decodeURIComponent(o[1]);return t},i.mailToHelper=function(e,o){if(e&&"mailto:"===e.toString().substr(0,7).toLowerCase()){e=e.toString().substr(7);var s={},a=null,l=e.replace(/\?.+$/,""),c=e.replace(/^[^\?]*\?/,""),u=t("Model:Email");return a=new u,a.parse(n.decodeURIComponent(l)),a&&a.email&&(s=i.simpleQueryParser(c),t("App:Knoin").showScreenPopup(o,[r.ComposeType.Empty,null,[a],i.isUnd(s.subject)?null:i.pString(s.subject),i.isUnd(s.body)?null:i.plainToHtml(i.pString(s.body))])),!0}return!1},i.rsaEncode=function(e,t,o,s){if(n.crypto&&n.crypto.getRandomValues&&n.RSAKey&&t&&o&&s){var a=new n.RSAKey;if(a.setPublic(s,o),e=a.encrypt(i.fakeMd5()+":"+e+":"+i.fakeMd5()),!1!==e)return"rsa:"+t+":"+e}return!1},i.rsaEncode.supported=!!(n.crypto&&n.crypto.getRandomValues&&n.RSAKey),i.exportPath=function(e,t,o){for(var s=null,a=e.split("."),r=o||n;a.length&&(s=a.shift());)a.length||i.isUnd(t)?r=r[s]?r[s]:r[s]={}:r[s]=t},i.pImport=function(e,t,i){e[t]=i},i.pExport=function(e,t,n){return i.isUnd(e[t])?n:e[t]},i.encodeHtml=function(e){return i.isNormal(e)?e.toString().replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'"):""},i.splitPlainText=function(e,t){var n="",o="",s=e,a=0,r=0;for(t=i.isUnd(t)?100:t;s.length>t;)o=s.substring(0,t),a=o.lastIndexOf(" "),r=o.lastIndexOf("\n"),-1!==r&&(a=r),-1===a&&(a=t),n+=o.substring(0,a)+"\n",s=s.substring(a+1);return n+s},i.timeOutAction=function(){var e={};return function(t,o,s){i.isUnd(e[t])&&(e[t]=0),n.clearTimeout(e[t]),e[t]=n.setTimeout(o,s)}}(),i.timeOutActionSecond=function(){var e={};return function(t,i,o){e[t]||(e[t]=n.setTimeout(function(){i(),e[t]=0},o))}}(),i.audio=function(){var e=!1;return function(t,i){if(!1===e)if(c.bIsiOSDevice)e=null;else{var o=!1,s=!1,a=n.Audio?new n.Audio:null;a&&a.canPlayType&&a.play?(o=""!==a.canPlayType('audio/mpeg; codecs="mp3"'),o||(s=""!==a.canPlayType('audio/ogg; codecs="vorbis"')),o||s?(e=a,e.preload="none",e.loop=!1,e.autoplay=!1,e.muted=!1,e.src=o?t:i):e=null):e=null}return e}}(),i.hos=function(e,t){return e&&n.Object&&n.Object.hasOwnProperty?n.Object.hasOwnProperty.call(e,t):!1},i.i18n=function(e,t,n){var o="",s=i.isUnd(c.oI18N[e])?i.isUnd(n)?e:n:c.oI18N[e];if(!i.isUnd(t)&&!i.isNull(t))for(o in t)i.hos(t,o)&&(s=s.replace("%"+o+"%",t[o]));return s},i.i18nToNode=function(e){o.defer(function(){s(".i18n",e).each(function(){var e=s(this),t="";t=e.data("i18n-text"),t?e.text(i.i18n(t)):(t=e.data("i18n-html"),t&&e.html(i.i18n(t)),t=e.data("i18n-placeholder"),t&&e.attr("placeholder",i.i18n(t)),t=e.data("i18n-title"),t&&e.attr("title",i.i18n(t)))})})},i.i18nReload=function(){n.rainloopI18N&&(c.oI18N=n.rainloopI18N||{},i.i18nToNode(c.$doc),c.langChangeTrigger(!c.langChangeTrigger())),n.rainloopI18N=null},i.initOnStartOrLangChange=function(e,t,i){e&&e.call(t),i?c.langChangeTrigger.subscribe(function(){e&&e.call(t),i.call(t)}):e&&c.langChangeTrigger.subscribe(e,t)},i.inFocus=function(){return n.document.activeElement?(i.isUnd(n.document.activeElement.__inFocusCache)&&(n.document.activeElement.__inFocusCache=s(n.document.activeElement).is("input,textarea,iframe,.cke_editable")),!!n.document.activeElement.__inFocusCache):!1},i.removeInFocus=function(){if(n.document&&n.document.activeElement&&n.document.activeElement.blur){var e=s(n.document.activeElement);e.is("input,textarea")&&n.document.activeElement.blur()}},i.removeSelection=function(){if(n&&n.getSelection){var e=n.getSelection();e&&e.removeAllRanges&&e.removeAllRanges()}else n.document&&n.document.selection&&n.document.selection.empty&&n.document.selection.empty()},i.replySubjectAdd=function(e,t){e=i.trim(e.toUpperCase()),t=i.trim(t.replace(/[\s]+/g," "));var n=!1,s=[],a="RE"===e,r="FWD"===e,l=!r;return""!==t&&o.each(t.split(":"),function(e){var t=i.trim(e);n||!/^(RE|FWD)$/i.test(t)&&!/^(RE|FWD)[\[\(][\d]+[\]\)]$/i.test(t)?(s.push(e),n=!0):(a||(a=!!/^RE/i.test(t)),r||(r=!!/^FWD/i.test(t)))}),l?a=!1:r=!1,i.trim((l?"Re: ":"Fwd: ")+(a?"Re: ":"")+(r?"Fwd: ":"")+i.trim(s.join(":")))},i.roundNumber=function(e,t){return n.Math.round(e*n.Math.pow(10,t))/n.Math.pow(10,t)},i.friendlySize=function(e){return e=i.pInt(e),e>=1073741824?i.roundNumber(e/1073741824,1)+"GB":e>=1048576?i.roundNumber(e/1048576,1)+"MB":e>=1024?i.roundNumber(e/1024,0)+"KB":e+"B"},i.log=function(e){n.console&&n.console.log&&n.console.log(e)},i.getNotification=function(e,t){return e=i.pInt(e),r.Notification.ClientViewError===e&&t?t:i.isUnd(c.oNotificationI18N[e])?"":c.oNotificationI18N[e]},i.initNotificationLanguage=function(){var e=c.oNotificationI18N||{};e[r.Notification.InvalidToken]=i.i18n("NOTIFICATIONS/INVALID_TOKEN"),e[r.Notification.AuthError]=i.i18n("NOTIFICATIONS/AUTH_ERROR"),e[r.Notification.AccessError]=i.i18n("NOTIFICATIONS/ACCESS_ERROR"),e[r.Notification.ConnectionError]=i.i18n("NOTIFICATIONS/CONNECTION_ERROR"),e[r.Notification.CaptchaError]=i.i18n("NOTIFICATIONS/CAPTCHA_ERROR"),e[r.Notification.SocialFacebookLoginAccessDisable]=i.i18n("NOTIFICATIONS/SOCIAL_FACEBOOK_LOGIN_ACCESS_DISABLE"),e[r.Notification.SocialTwitterLoginAccessDisable]=i.i18n("NOTIFICATIONS/SOCIAL_TWITTER_LOGIN_ACCESS_DISABLE"),e[r.Notification.SocialGoogleLoginAccessDisable]=i.i18n("NOTIFICATIONS/SOCIAL_GOOGLE_LOGIN_ACCESS_DISABLE"),e[r.Notification.DomainNotAllowed]=i.i18n("NOTIFICATIONS/DOMAIN_NOT_ALLOWED"),e[r.Notification.AccountNotAllowed]=i.i18n("NOTIFICATIONS/ACCOUNT_NOT_ALLOWED"),e[r.Notification.AccountTwoFactorAuthRequired]=i.i18n("NOTIFICATIONS/ACCOUNT_TWO_FACTOR_AUTH_REQUIRED"),e[r.Notification.AccountTwoFactorAuthError]=i.i18n("NOTIFICATIONS/ACCOUNT_TWO_FACTOR_AUTH_ERROR"),e[r.Notification.CouldNotSaveNewPassword]=i.i18n("NOTIFICATIONS/COULD_NOT_SAVE_NEW_PASSWORD"),e[r.Notification.CurrentPasswordIncorrect]=i.i18n("NOTIFICATIONS/CURRENT_PASSWORD_INCORRECT"),e[r.Notification.NewPasswordShort]=i.i18n("NOTIFICATIONS/NEW_PASSWORD_SHORT"),e[r.Notification.NewPasswordWeak]=i.i18n("NOTIFICATIONS/NEW_PASSWORD_WEAK"),e[r.Notification.NewPasswordForbidden]=i.i18n("NOTIFICATIONS/NEW_PASSWORD_FORBIDDENT"),e[r.Notification.ContactsSyncError]=i.i18n("NOTIFICATIONS/CONTACTS_SYNC_ERROR"),e[r.Notification.CantGetMessageList]=i.i18n("NOTIFICATIONS/CANT_GET_MESSAGE_LIST"),e[r.Notification.CantGetMessage]=i.i18n("NOTIFICATIONS/CANT_GET_MESSAGE"),e[r.Notification.CantDeleteMessage]=i.i18n("NOTIFICATIONS/CANT_DELETE_MESSAGE"),e[r.Notification.CantMoveMessage]=i.i18n("NOTIFICATIONS/CANT_MOVE_MESSAGE"),e[r.Notification.CantCopyMessage]=i.i18n("NOTIFICATIONS/CANT_MOVE_MESSAGE"),e[r.Notification.CantSaveMessage]=i.i18n("NOTIFICATIONS/CANT_SAVE_MESSAGE"),e[r.Notification.CantSendMessage]=i.i18n("NOTIFICATIONS/CANT_SEND_MESSAGE"),e[r.Notification.InvalidRecipients]=i.i18n("NOTIFICATIONS/INVALID_RECIPIENTS"),e[r.Notification.CantCreateFolder]=i.i18n("NOTIFICATIONS/CANT_CREATE_FOLDER"),e[r.Notification.CantRenameFolder]=i.i18n("NOTIFICATIONS/CANT_RENAME_FOLDER"),e[r.Notification.CantDeleteFolder]=i.i18n("NOTIFICATIONS/CANT_DELETE_FOLDER"),e[r.Notification.CantDeleteNonEmptyFolder]=i.i18n("NOTIFICATIONS/CANT_DELETE_NON_EMPTY_FOLDER"),e[r.Notification.CantSubscribeFolder]=i.i18n("NOTIFICATIONS/CANT_SUBSCRIBE_FOLDER"),e[r.Notification.CantUnsubscribeFolder]=i.i18n("NOTIFICATIONS/CANT_UNSUBSCRIBE_FOLDER"),e[r.Notification.CantSaveSettings]=i.i18n("NOTIFICATIONS/CANT_SAVE_SETTINGS"),e[r.Notification.CantSavePluginSettings]=i.i18n("NOTIFICATIONS/CANT_SAVE_PLUGIN_SETTINGS"),e[r.Notification.DomainAlreadyExists]=i.i18n("NOTIFICATIONS/DOMAIN_ALREADY_EXISTS"),e[r.Notification.CantInstallPackage]=i.i18n("NOTIFICATIONS/CANT_INSTALL_PACKAGE"),e[r.Notification.CantDeletePackage]=i.i18n("NOTIFICATIONS/CANT_DELETE_PACKAGE"),e[r.Notification.InvalidPluginPackage]=i.i18n("NOTIFICATIONS/INVALID_PLUGIN_PACKAGE"),e[r.Notification.UnsupportedPluginPackage]=i.i18n("NOTIFICATIONS/UNSUPPORTED_PLUGIN_PACKAGE"),e[r.Notification.LicensingServerIsUnavailable]=i.i18n("NOTIFICATIONS/LICENSING_SERVER_IS_UNAVAILABLE"),e[r.Notification.LicensingExpired]=i.i18n("NOTIFICATIONS/LICENSING_EXPIRED"),e[r.Notification.LicensingBanned]=i.i18n("NOTIFICATIONS/LICENSING_BANNED"),e[r.Notification.DemoSendMessageError]=i.i18n("NOTIFICATIONS/DEMO_SEND_MESSAGE_ERROR"),e[r.Notification.AccountAlreadyExists]=i.i18n("NOTIFICATIONS/ACCOUNT_ALREADY_EXISTS"),e[r.Notification.MailServerError]=i.i18n("NOTIFICATIONS/MAIL_SERVER_ERROR"),e[r.Notification.InvalidInputArgument]=i.i18n("NOTIFICATIONS/INVALID_INPUT_ARGUMENT"),e[r.Notification.UnknownNotification]=i.i18n("NOTIFICATIONS/UNKNOWN_ERROR"),e[r.Notification.UnknownError]=i.i18n("NOTIFICATIONS/UNKNOWN_ERROR")
    +},i.getUploadErrorDescByCode=function(e){var t="";switch(i.pInt(e)){case r.UploadErrorCode.FileIsTooBig:t=i.i18n("UPLOAD/ERROR_FILE_IS_TOO_BIG");break;case r.UploadErrorCode.FilePartiallyUploaded:t=i.i18n("UPLOAD/ERROR_FILE_PARTIALLY_UPLOADED");break;case r.UploadErrorCode.FileNoUploaded:t=i.i18n("UPLOAD/ERROR_NO_FILE_UPLOADED");break;case r.UploadErrorCode.MissingTempFolder:t=i.i18n("UPLOAD/ERROR_MISSING_TEMP_FOLDER");break;case r.UploadErrorCode.FileOnSaveingError:t=i.i18n("UPLOAD/ERROR_ON_SAVING_FILE");break;case r.UploadErrorCode.FileType:t=i.i18n("UPLOAD/ERROR_FILE_TYPE");break;default:t=i.i18n("UPLOAD/ERROR_UNKNOWN")}return t},i.delegateRun=function(e,t,n,s){e&&e[t]&&(s=i.pInt(s),0>=s?e[t].apply(e,i.isArray(n)?n:[]):o.delay(function(){e[t].apply(e,i.isArray(n)?n:[])},s))},i.killCtrlAandS=function(e){if(e=e||n.event,e&&e.ctrlKey&&!e.shiftKey&&!e.altKey){var t=e.target||e.srcElement,i=e.keyCode||e.which;if(i===r.EventKeyCode.S)return void e.preventDefault();if(t&&t.tagName&&t.tagName.match(/INPUT|TEXTAREA/i))return;i===r.EventKeyCode.A&&(n.getSelection?n.getSelection().removeAllRanges():n.document.selection&&n.document.selection.clear&&n.document.selection.clear(),e.preventDefault())}},i.createCommand=function(e,t,n){var o=t?function(){return o&&o.canExecute&&o.canExecute()&&t.apply(e,Array.prototype.slice.call(arguments)),!1}:function(){};return o.enabled=a.observable(!0),n=i.isUnd(n)?!0:n,o.canExecute=a.computed(i.isFunc(n)?function(){return o.enabled()&&n.call(e)}:function(){return o.enabled()&&!!n}),o},i.initDataConstructorBySettings=function(e){e.editorDefaultType=a.observable(r.EditorDefaultType.Html),e.showImages=a.observable(!1),e.interfaceAnimation=a.observable(r.InterfaceAnimation.Full),e.contactsAutosave=a.observable(!1),c.sAnimationType=r.InterfaceAnimation.Full,e.capaThemes=a.observable(!1),e.allowLanguagesOnSettings=a.observable(!0),e.allowLanguagesOnLogin=a.observable(!0),e.useLocalProxyForExternalImages=a.observable(!1),e.desktopNotifications=a.observable(!1),e.useThreads=a.observable(!0),e.replySameFolder=a.observable(!0),e.useCheckboxesInList=a.observable(!0),e.layout=a.observable(r.Layout.SidePreview),e.usePreviewPane=a.computed(function(){return r.Layout.NoPreview!==e.layout()}),e.interfaceAnimation.subscribe(function(e){if(c.bMobileDevice||e===r.InterfaceAnimation.None)c.$html.removeClass("rl-anim rl-anim-full").addClass("no-rl-anim"),c.sAnimationType=r.InterfaceAnimation.None;else switch(e){case r.InterfaceAnimation.Full:c.$html.removeClass("no-rl-anim").addClass("rl-anim rl-anim-full"),c.sAnimationType=e;break;case r.InterfaceAnimation.Normal:c.$html.removeClass("no-rl-anim rl-anim-full").addClass("rl-anim"),c.sAnimationType=e}}),e.interfaceAnimation.valueHasMutated(),e.desktopNotificationsPermisions=a.computed(function(){e.desktopNotifications();var t=i.notificationClass(),o=r.DesktopNotifications.NotSupported;if(t&&t.permission)switch(t.permission.toLowerCase()){case"granted":o=r.DesktopNotifications.Allowed;break;case"denied":o=r.DesktopNotifications.Denied;break;case"default":o=r.DesktopNotifications.NotAllowed}else n.webkitNotifications&&n.webkitNotifications.checkPermission&&(o=n.webkitNotifications.checkPermission());return o}),e.useDesktopNotifications=a.computed({read:function(){return e.desktopNotifications()&&r.DesktopNotifications.Allowed===e.desktopNotificationsPermisions()},write:function(t){if(t){var n=i.notificationClass(),o=e.desktopNotificationsPermisions();n&&r.DesktopNotifications.Allowed===o?e.desktopNotifications(!0):n&&r.DesktopNotifications.NotAllowed===o?n.requestPermission(function(){e.desktopNotifications.valueHasMutated(),r.DesktopNotifications.Allowed===e.desktopNotificationsPermisions()?e.desktopNotifications()?e.desktopNotifications.valueHasMutated():e.desktopNotifications(!0):e.desktopNotifications()?e.desktopNotifications(!1):e.desktopNotifications.valueHasMutated()}):e.desktopNotifications(!1)}else e.desktopNotifications(!1)}}),e.language=a.observable(""),e.languages=a.observableArray([]),e.mainLanguage=a.computed({read:e.language,write:function(t){t!==e.language()?-1=t.diff(n,"hours")?o:t.format("L")===n.format("L")?i.i18n("MESSAGE_LIST/TODAY_AT",{TIME:n.format("LT")}):t.clone().subtract("days",1).format("L")===n.format("L")?i.i18n("MESSAGE_LIST/YESTERDAY_AT",{TIME:n.format("LT")}):n.format(t.year()===n.year()?"D MMM.":"LL")},e)},i.convertThemeName=function(e){return"@custom"===e.substr(-7)&&(e=i.trim(e.substring(0,e.length-7))),i.trim(e.replace(/[^a-zA-Z0-9]+/g," ").replace(/([A-Z])/g," $1").replace(/[\s]+/g," "))},i.quoteName=function(e){return e.replace(/["]/g,'\\"')},i.microtime=function(){return(new Date).getTime()},i.convertLangName=function(e,t){return i.i18n("LANGS_NAMES"+(!0===t?"_EN":"")+"/LANG_"+e.toUpperCase().replace(/[^a-zA-Z0-9]+/g,"_"),null,e)},i.fakeMd5=function(e){var t="",o="0123456789abcdefghijklmnopqrstuvwxyz";for(e=i.isUnd(e)?32:i.pInt(e);t.length/g,">").replace(/")},i.draggeblePlace=function(){return s('
     
    ').appendTo("#rl-hidden")},i.defautOptionsAfterRender=function(e,t){t&&!i.isUnd(t.disabled)&&e&&s(e).toggleClass("disabled",t.disabled).prop("disabled",t.disabled)},i.windowPopupKnockout=function(e,t,o,r){var l=null,c=n.open(""),u="__OpenerApplyBindingsUid"+i.fakeMd5()+"__",p=s("#"+t);n[u]=function(){if(c&&c.document.body&&p&&p[0]){var t=s(c.document.body);s("#rl-content",t).html(p.html()),s("html",c.document).addClass("external "+s("html").attr("class")),i.i18nToNode(t),e&&s("#rl-content",t)[0]&&a.applyBindings(e,s("#rl-content",t)[0]),n[u]=null,r(c)}},c.document.open(),c.document.write(''+i.encodeHtml(o)+'
    '),c.document.close(),l=c.document.createElement("script"),l.type="text/javascript",l.innerHTML="if(window&&window.opener&&window.opener['"+u+"']){window.opener['"+u+"']();window.opener['"+u+"']=null}",c.document.getElementsByTagName("head")[0].appendChild(l)},i.settingsSaveHelperFunction=function(e,t,n,s){return n=n||null,s=i.isUnd(s)?1e3:i.pInt(s),function(i,a,l,c,u){t.call(n,a&&a.Result?r.SaveSettingsStep.TrueResult:r.SaveSettingsStep.FalseResult),e&&e.call(n,i,a,l,c,u),o.delay(function(){t.call(n,r.SaveSettingsStep.Idle)},s)}},i.settingsSaveHelperSimpleFunction=function(e,t){return i.settingsSaveHelperFunction(null,e,t,1e3)},i.htmlToPlain=function(e){var t=0,i=0,n=0,o=0,a=0,r="",l=function(e){for(var t=100,i="",n="",o=e,s=0,a=0;o.length>t;)n=o.substring(0,t),s=n.lastIndexOf(" "),a=n.lastIndexOf("\n"),-1!==a&&(s=a),-1===s&&(s=t),i+=n.substring(0,s)+"\n",o=o.substring(s+1);return i+o},u=function(e){return e=l(s.trim(e)),e="> "+e.replace(/\n/gm,"\n> "),e.replace(/(^|\n)([> ]+)/gm,function(){return arguments&&2]*>([\s\S\r\n]*)<\/div>/gim,p),e="\n"+s.trim(e)+"\n"),e}return""},d=function(){return arguments&&1"):""},g=function(){return arguments&&1/g,">"):""},m=function(){return arguments&&1]*>([\s\S\r\n]*)<\/pre>/gim,d).replace(/[\s]+/gm," ").replace(/((?:href|data)\s?=\s?)("[^"]+?"|'[^']+?')/gim,g).replace(/]*>/gim,"\n").replace(/<\/h[\d]>/gi,"\n").replace(/<\/p>/gi,"\n\n").replace(/<\/li>/gi,"\n").replace(/<\/td>/gi,"\n").replace(/<\/tr>/gi,"\n").replace(/]*>/gim,"\n_______________________________\n\n").replace(/]*>([\s\S\r\n]*)<\/div>/gim,p).replace(/]*>/gim,"\n__bq__start__\n").replace(/<\/blockquote>/gim,"\n__bq__end__\n").replace(/]*>([\s\S\r\n]*?)<\/a>/gim,m).replace(/<\/div>/gi,"\n").replace(/ /gi," ").replace(/"/gi,'"').replace(/<[^>]*>/gm,""),r=c.$div.html(r).text(),r=r.replace(/\n[ \t]+/gm,"\n").replace(/[\n]{3,}/gm,"\n\n").replace(/>/gi,">").replace(/</gi,"<").replace(/&/gi,"&"),t=0,a=100;a>0&&(a--,i=r.indexOf("__bq__start__",t),i>-1);)n=r.indexOf("__bq__start__",i+5),o=r.indexOf("__bq__end__",i+5),(-1===n||n>o)&&o>i?(r=r.substring(0,i)+u(r.substring(i+13,o))+r.substring(o+11),t=0):t=n>-1&&o>n?n-1:0;return r=r.replace(/__bq__start__/gm,"").replace(/__bq__end__/gm,"")},i.plainToHtml=function(e,t){e=e.toString().replace(/\r/g,"");var n=!1,o=!0,s=!0,a=[],r="",l=0,c=e.split("\n");do{for(o=!1,a=[],l=0;l"===r.substr(0,1),s&&!n?(o=!0,n=!0,a.push("~~~blockquote~~~"),a.push(r.substr(1))):!s&&n?(n=!1,a.push("~~~/blockquote~~~"),a.push(r)):a.push(s&&n?r.substr(1):r);n&&(n=!1,a.push("~~~/blockquote~~~")),c=a}while(o);return e=c.join("\n"),e=e.replace(/&/g,"&").replace(/>/g,">").replace(/").replace(/[\s]*~~~\/blockquote~~~/g,"").replace(/[\-_~]{10,}/g,"
    ").replace(/\n/g,"
    "),t?i.linkify(e):e},n.rainloop_Utils_htmlToPlain=i.htmlToPlain,n.rainloop_Utils_plainToHtml=i.plainToHtml,i.linkify=function(e){return s.fn&&s.fn.linkify&&(e=c.$div.html(e.replace(/&/gi,"amp_amp_12345_amp_amp")).linkify().find(".linkified").removeClass("linkified").end().html().replace(/amp_amp_12345_amp_amp/g,"&")),e},i.resizeAndCrop=function(e,t,i){var o=new n.Image;o.onload=function(){var e=[0,0],o=n.document.createElement("canvas"),s=o.getContext("2d");o.width=t,o.height=t,e=this.width>this.height?[this.width-this.height,0]:[0,this.height-this.width],s.fillStyle="#fff",s.fillRect(0,0,t,t),s.drawImage(this,e[0]/2,e[1]/2,this.width-e[0],this.height-e[1],0,0,t,t),i(o.toDataURL("image/jpeg"))},o.src=e},i.folderListOptionsBuilder=function(e,t,o,s,a,l,c,u,p,d){var g=null,m=!1,h=0,f=0,b="   ",S=[];for(p=i.isNormal(p)?p:0h;h++)S.push({id:s[h][0],name:s[h][1],system:!1,seporator:!1,disabled:!1});for(m=!0,h=0,f=e.length;f>h;h++)g=e[h],(c?c.call(null,g):!0)&&(m&&0h;h++)g=t[h],(g.subScribed()||!g.existen)&&(c?c.call(null,g):!0)&&(r.FolderType.User===g.type()||!p||01||c>0&&l>c){for(l>c?(u(c),o=c,s=c):((3>=l||l>=c-2)&&(a+=2),u(l),o=l,s=l);a>0;)if(o-=1,s+=1,o>0&&(u(o,!1),a--),c>=s)u(s,!0),a--;else if(0>=o)break;3===o?u(2,!1):o>3&&u(n.Math.round((o-1)/2),!1,"..."),c-2===s?u(c-1,!0):c-2>s&&u(n.Math.round((c+s)/2),!0,"..."),o>1&&u(1,!1),c>s&&u(c,!0)}return r}},i.selectElement=function(e){var t,i;n.getSelection?(t=n.getSelection(),t.removeAllRanges(),i=n.document.createRange(),i.selectNodeContents(e),t.addRange(i)):n.document.selection&&(i=n.document.body.createTextRange(),i.moveToElementText(e),i.select())},i.detectDropdownVisibility=o.debounce(function(){c.dropdownVisibility(!!o.find(c.aBootstrapDropdowns,function(e){return e.hasClass("open")}))},50),i.triggerAutocompleteInputChange=function(e){var t=function(){s(".checkAutocomplete").trigger("change")};(i.isUnd(e)?1:!e)?t():o.delay(t,100)},e.exports=i}(t,e)},{$:14,"App:Knoin":21,Consts:5,Enums:6,Globals:8,"Model:Email":26,_:19,ko:16,window:20}],12:[function(e,t){t.exports=crossroads},{}],13:[function(e,t){t.exports=hasher},{}],14:[function(e,t){t.exports=$},{}],15:[function(e,t){t.exports=key},{}],16:[function(e,t){!function(t,i){"use strict";var n=e("window"),o=e("_"),s=e("$");i.bindingHandlers.tooltip={init:function(t,n){var o=e("Globals"),a=e("Utils");if(!o.bMobileDevice){var r=s(t),l=r.data("tooltip-class")||"",c=r.data("tooltip-placement")||"top";r.tooltip({delay:{show:500,hide:100},html:!0,container:"body",placement:c,trigger:"hover",title:function(){return r.is(".disabled")||o.dropdownVisibility()?"":''+a.i18n(i.utils.unwrapObservable(n()))+""}}).click(function(){r.tooltip("hide")}),o.tooltipTrigger.subscribe(function(){r.tooltip("hide")})}}},i.bindingHandlers.tooltip2={init:function(t,i){var n=e("Globals"),o=s(t),a=o.data("tooltip-class")||"",r=o.data("tooltip-placement")||"top";o.tooltip({delay:{show:500,hide:100},html:!0,container:"body",placement:r,title:function(){return o.is(".disabled")||n.dropdownVisibility()?"":''+i()()+""}}).click(function(){o.tooltip("hide")}),n.tooltipTrigger.subscribe(function(){o.tooltip("hide")})}},i.bindingHandlers.tooltip3={init:function(t){var i=s(t),o=e("Globals");i.tooltip({container:"body",trigger:"hover manual",title:function(){return i.data("tooltip3-data")||""}}),s(n.document).click(function(){i.tooltip("hide")}),o.tooltipTrigger.subscribe(function(){i.tooltip("hide")})},update:function(e,t){var n=i.utils.unwrapObservable(t());""===n?s(e).data("tooltip3-data","").tooltip("hide"):s(e).data("tooltip3-data",n).tooltip("show")}},i.bindingHandlers.registrateBootstrapDropdown={init:function(t){var i=e("Globals");i.aBootstrapDropdowns.push(s(t))}},i.bindingHandlers.openDropdownTrigger={update:function(t,n){if(i.utils.unwrapObservable(n())){var o=s(t),a=e("Utils");o.hasClass("open")||(o.find(".dropdown-toggle").dropdown("toggle"),a.detectDropdownVisibility()),n()(!1)}}},i.bindingHandlers.dropdownCloser={init:function(e){s(e).closest(".dropdown").on("click",".e-item",function(){s(e).dropdown("toggle")})}},i.bindingHandlers.popover={init:function(e,t){s(e).popover(i.utils.unwrapObservable(t()))}},i.bindingHandlers.csstext={init:function(t,n){var o=e("Utils");t&&t.styleSheet&&!o.isUnd(t.styleSheet.cssText)?t.styleSheet.cssText=i.utils.unwrapObservable(n()):s(t).text(i.utils.unwrapObservable(n()))},update:function(t,n){var o=e("Utils");t&&t.styleSheet&&!o.isUnd(t.styleSheet.cssText)?t.styleSheet.cssText=i.utils.unwrapObservable(n()):s(t).text(i.utils.unwrapObservable(n()))}},i.bindingHandlers.resizecrop={init:function(e){s(e).addClass("resizecrop").resizecrop({width:"100",height:"100",wrapperCSS:{"border-radius":"10px"}})},update:function(e,t){t()(),s(e).resizecrop({width:"100",height:"100"})}},i.bindingHandlers.onEnter={init:function(e,t,i,o){s(e).on("keypress",function(i){i&&13===n.parseInt(i.keyCode,10)&&(s(e).trigger("change"),t().call(o))})}},i.bindingHandlers.onEsc={init:function(e,t,i,o){s(e).on("keypress",function(i){i&&27===n.parseInt(i.keyCode,10)&&(s(e).trigger("change"),t().call(o))})}},i.bindingHandlers.clickOnTrue={update:function(e,t){i.utils.unwrapObservable(t())&&s(e).click()}},i.bindingHandlers.modal={init:function(t,n){var o=e("Globals"),a=e("Utils");s(t).toggleClass("fade",!o.bMobileDevice).modal({keyboard:!1,show:i.utils.unwrapObservable(n())}).on("shown",function(){a.windowResize()}).find(".close").click(function(){n()(!1)})},update:function(e,t){s(e).modal(i.utils.unwrapObservable(t())?"show":"hide")}},i.bindingHandlers.i18nInit={init:function(t){var i=e("Utils");i.i18nToNode(t)}},i.bindingHandlers.i18nUpdate={update:function(t,n){var o=e("Utils");i.utils.unwrapObservable(n()),o.i18nToNode(t)}},i.bindingHandlers.link={update:function(e,t){s(e).attr("href",i.utils.unwrapObservable(t()))}},i.bindingHandlers.title={update:function(e,t){s(e).attr("title",i.utils.unwrapObservable(t()))}},i.bindingHandlers.textF={init:function(e,t){s(e).text(i.utils.unwrapObservable(t()))}},i.bindingHandlers.initDom={init:function(e,t){t()(e)}},i.bindingHandlers.initResizeTrigger={init:function(e,t){var n=i.utils.unwrapObservable(t());s(e).css({height:n[1],"min-height":n[1]})},update:function(t,n){var o=e("Utils"),a=e("Globals"),r=i.utils.unwrapObservable(n()),l=o.pInt(r[1]),c=0,u=s(t).offset().top;u>0&&(u+=o.pInt(r[2]),c=a.$win.height()-u,c>l&&(l=c),s(t).css({height:l,"min-height":l}))}},i.bindingHandlers.appendDom={update:function(e,t){s(e).hide().empty().append(i.utils.unwrapObservable(t())).show()}},i.bindingHandlers.draggable={init:function(t,o,a){var r=e("Globals"),l=e("Utils");if(!r.bMobileDevice){var c=100,u=3,p=a(),d=p&&p.droppableSelector?p.droppableSelector:"",g={distance:20,handle:".dragHandle",cursorAt:{top:22,left:3},refreshPositions:!0,scroll:!0};d&&(g.drag=function(e){s(d).each(function(){var t=null,i=null,o=s(this),a=o.offset(),r=a.top+o.height();n.clearInterval(o.data("timerScroll")),o.data("timerScroll",!1),e.pageX>=a.left&&e.pageX<=a.left+o.width()&&(e.pageY>=r-c&&e.pageY<=r&&(t=function(){o.scrollTop(o.scrollTop()+u),l.windowResize()},o.data("timerScroll",n.setInterval(t,10)),t()),e.pageY>=a.top&&e.pageY<=a.top+c&&(i=function(){o.scrollTop(o.scrollTop()-u),l.windowResize()},o.data("timerScroll",n.setInterval(i,10)),i()))})},g.stop=function(){s(d).each(function(){n.clearInterval(s(this).data("timerScroll")),s(this).data("timerScroll",!1)})}),g.helper=function(e){return o()(e&&e.target?i.dataFor(e.target):null)},s(t).draggable(g).on("mousedown",function(){l.removeInFocus()})}}},i.bindingHandlers.droppable={init:function(t,i,n){var o=e("Globals");if(!o.bMobileDevice){var a=i(),r=n(),l=r&&r.droppableOver?r.droppableOver:null,c=r&&r.droppableOut?r.droppableOut:null,u={tolerance:"pointer",hoverClass:"droppableHover"};a&&(u.drop=function(e,t){a(e,t)},l&&(u.over=function(e,t){l(e,t)}),c&&(u.out=function(e,t){c(e,t)}),s(t).droppable(u))}}},i.bindingHandlers.nano={init:function(t){var i=e("Globals");i.bDisableNanoScroll||s(t).addClass("nano").nanoScroller({iOSNativeScrolling:!1,preventPageScrolling:!0})}},i.bindingHandlers.saveTrigger={init:function(e){var t=s(e);t.data("save-trigger-type",t.is("input[type=text],input[type=email],input[type=password],select,textarea")?"input":"custom"),"custom"===t.data("save-trigger-type")?t.append('  ').addClass("settings-saved-trigger"):t.addClass("settings-saved-trigger-input")},update:function(e,t){var n=i.utils.unwrapObservable(t()),o=s(e);if("custom"===o.data("save-trigger-type"))switch(n.toString()){case"1":o.find(".animated,.error").hide().removeClass("visible").end().find(".success").show().addClass("visible");break;case"0":o.find(".animated,.success").hide().removeClass("visible").end().find(".error").show().addClass("visible");break;case"-2":o.find(".error,.success").hide().removeClass("visible").end().find(".animated").show().addClass("visible");break;default:o.find(".animated").hide().end().find(".error,.success").removeClass("visible")}else switch(n.toString()){case"1":o.addClass("success").removeClass("error");break;case"0":o.addClass("error").removeClass("success");break;case"-2":break;default:o.removeClass("error success")}}},i.bindingHandlers.emailsTags={init:function(t,i,n){var a=e("Utils"),r=e("Model:Email"),l=s(t),c=i(),u=n(),p=u.autoCompleteSource||null,d=function(e){c&&c.focusTrigger&&c.focusTrigger(e)};l.inputosaurus({parseOnBlur:!0,allowDragAndDrop:!0,focusCallback:d,inputDelimiters:[",",";"],autoCompleteSource:p,parseHook:function(e){return o.map(e,function(e){var t=a.trim(e),i=null;return""!==t?(i=new r,i.mailsoParse(t),i.clearDuplicateName(),[i.toLine(!1),i]):[t,null]})},change:o.bind(function(e){l.data("EmailsTagsValue",e.target.value),c(e.target.value)},this)})},update:function(e,t,n){var o=s(e),a=n(),r=a.emailsTagsFilter||null,l=i.utils.unwrapObservable(t());o.data("EmailsTagsValue")!==l&&(o.val(l),o.data("EmailsTagsValue",l),o.inputosaurus("refresh")),r&&i.utils.unwrapObservable(r)&&o.inputosaurus("focus")}},i.bindingHandlers.contactTags={init:function(t,i,n){var a=e("Utils"),r=e("Model:ContactTag"),l=s(t),c=i(),u=n(),p=u.autoCompleteSource||null,d=function(e){c&&c.focusTrigger&&c.focusTrigger(e)};l.inputosaurus({parseOnBlur:!0,allowDragAndDrop:!1,focusCallback:d,inputDelimiters:[",",";"],outputDelimiter:",",autoCompleteSource:p,parseHook:function(e){return o.map(e,function(e){var t=a.trim(e),i=null;return""!==t?(i=new r,i.name(t),[i.toLine(!1),i]):[t,null]})},change:o.bind(function(e){l.data("ContactTagsValue",e.target.value),c(e.target.value)},this)})},update:function(e,t,n){var o=s(e),a=n(),r=a.contactTagsFilter||null,l=i.utils.unwrapObservable(t());o.data("ContactTagsValue")!==l&&(o.val(l),o.data("ContactTagsValue",l),o.inputosaurus("refresh")),r&&i.utils.unwrapObservable(r)&&o.inputosaurus("focus")}},i.bindingHandlers.command={init:function(e,t,n,o){var a=s(e),r=t();if(!r||!r.enabled||!r.canExecute)throw new Error("You are not using command function");a.addClass("command"),i.bindingHandlers[a.is("form")?"submit":"click"].init.apply(o,arguments)},update:function(e,t){var i=!0,n=s(e),o=t();i=o.enabled(),n.toggleClass("command-not-enabled",!i),i&&(i=o.canExecute(),n.toggleClass("command-can-not-be-execute",!i)),n.toggleClass("command-disabled disable disabled",!i).toggleClass("no-disabled",!!i),(n.is("input")||n.is("button"))&&n.prop("disabled",!i)}},i.extenders.trimmer=function(t){var n=e("Utils"),o=i.computed({read:t,write:function(e){t(n.trim(e.toString()))},owner:this});return o(t()),o},i.extenders.posInterer=function(t,n){var o=e("Utils"),s=i.computed({read:t,write:function(e){var i=o.pInt(e.toString(),n);0>=i&&(i=n),i===t()&&""+i!=""+e&&t(i+1),t(i)}});return s(t()),s},i.extenders.reversible=function(e){var t=e();return e.commit=function(){t=e()},e.reverse=function(){e(t)},e.commitedValue=function(){return t},e},i.extenders.toggleSubscribe=function(e,t){return e.subscribe(t[1],t[0],"beforeChange"),e.subscribe(t[2],t[0]),e},i.extenders.falseTimeout=function(t,i){var o=e("Utils");return t.iTimeout=0,t.subscribe(function(e){e&&(n.clearTimeout(t.iTimeout),t.iTimeout=n.setTimeout(function(){t(!1),t.iTimeout=0},o.pInt(i)))}),t},i.observable.fn.validateNone=function(){return this.hasError=i.observable(!1),this},i.observable.fn.validateEmail=function(){var t=e("Utils");return this.hasError=i.observable(!1),this.subscribe(function(e){e=t.trim(e),this.hasError(""!==e&&!/^[^@\s]+@[^@\s]+$/.test(e))},this),this.valueHasMutated(),this},i.observable.fn.validateSimpleEmail=function(){var t=e("Utils");return this.hasError=i.observable(!1),this.subscribe(function(e){e=t.trim(e),this.hasError(""!==e&&!/^.+@.+$/.test(e))},this),this.valueHasMutated(),this},i.observable.fn.validateFunc=function(t){var n=e("Utils");return this.hasFuncError=i.observable(!1),n.isFunc(t)&&(this.subscribe(function(e){this.hasFuncError(!t(e))},this),this.valueHasMutated()),this},t.exports=i}(t,ko)},{$:14,Globals:8,"Model:ContactTag":25,"Model:Email":26,Utils:11,_:19,window:20}],17:[function(e,t){t.exports=moment},{}],18:[function(e,t){t.exports=ssm},{}],19:[function(e,t){t.exports=_},{}],20:[function(e,t){t.exports=window},{}],21:[function(e,t){!function(e,t){"use strict";function i(){this.oScreens={},this.sDefaultScreenName="",this.oCurrentScreen=null}var n=t("_"),o=t("$"),s=t("ko"),a=t("hasher"),r=t("crossroads"),l=t("Globals"),c=t("Plugins"),u=t("Utils");i.prototype.oScreens={},i.prototype.sDefaultScreenName="",i.prototype.oCurrentScreen=null,i.prototype.hideLoading=function(){o("#rl-loading").hide()},i.prototype.constructorEnd=function(e){u.isFunc(e.__constructor_end)&&e.__constructor_end.call(e)},i.prototype.extendAsViewModel=function(e,t){t&&(t.__names=u.isArray(e)?e:[e],t.__name=t.__names[0])},i.prototype.addSettingsViewModel=function(e,t,i,n,o){e.__rlSettingsData={Label:i,Template:t,Route:n,IsDefault:!!o},l.aViewModels.settings.push(e)},i.prototype.removeSettingsViewModel=function(e){l.aViewModels["settings-removed"].push(e)},i.prototype.disableSettingsViewModel=function(e){l.aViewModels["settings-disabled"].push(e)},i.prototype.routeOff=function(){a.changed.active=!1},i.prototype.routeOn=function(){a.changed.active=!0},i.prototype.screen=function(e){return""===e||u.isUnd(this.oScreens[e])?null:this.oScreens[e]},i.prototype.buildViewModel=function(e,t){if(e&&!e.__builded){var i=this,a=new e(t),r=a.viewModelPosition(),p=o("#rl-content #rl-"+r.toLowerCase()),d=null;e.__builded=!0,e.__vm=a,a.viewModelName=e.__name,a.viewModelNames=e.__names,p&&1===p.length?(d=o("
    ").addClass("rl-view-model").addClass("RL-"+a.viewModelTemplate()).hide(),d.appendTo(p),a.viewModelDom=d,e.__dom=d,"Popups"===r&&(a.cancelCommand=a.closeCommand=u.createCommand(a,function(){i.hideScreenPopup(e)}),a.modalVisibility.subscribe(function(e){var t=this;e?(this.viewModelDom.show(),this.storeAndSetKeyScope(),l.popupVisibilityNames.push(this.viewModelName),a.viewModelDom.css("z-index",3e3+l.popupVisibilityNames().length+10),u.delegateRun(this,"onFocus",[],500)):(u.delegateRun(this,"onHide"),this.restoreKeyScope(),n.each(this.viewModelNames,function(e){c.runHook("view-model-on-hide",[e,t])}),l.popupVisibilityNames.remove(this.viewModelName),a.viewModelDom.css("z-index",2e3),l.tooltipTrigger(!l.tooltipTrigger()),n.delay(function(){t.viewModelDom.hide()},300))},a)),n.each(e.__names,function(e){c.runHook("view-model-pre-build",[e,a,d])}),s.applyBindingAccessorsToNode(d[0],{i18nInit:!0,template:function(){return{name:a.viewModelTemplate()}}},a),u.delegateRun(a,"onBuild",[d]),a&&"Popups"===r&&a.registerPopupKeyDown(),n.each(e.__names,function(e){c.runHook("view-model-post-build",[e,a,d])})):u.log("Cannot find view model position: "+r)}return e?e.__vm:null},i.prototype.hideScreenPopup=function(e){e&&e.__vm&&e.__dom&&e.__vm.modalVisibility(!1)},i.prototype.showScreenPopup=function(e,t){e&&(this.buildViewModel(e),e.__vm&&e.__dom&&(e.__vm.modalVisibility(!0),u.delegateRun(e.__vm,"onShow",t||[]),n.each(e.__names,function(i){c.runHook("view-model-on-show",[i,e.__vm,t||[]])})))},i.prototype.isPopupVisible=function(e){return e&&e.__vm?e.__vm.modalVisibility():!1},i.prototype.screenOnRoute=function(e,t){var i=this,o=null,s=null;""===u.pString(e)&&(e=this.sDefaultScreenName),""!==e&&(o=this.screen(e),o||(o=this.screen(this.sDefaultScreenName),o&&(t=e+"/"+t,e=this.sDefaultScreenName)),o&&o.__started&&(o.__builded||(o.__builded=!0,u.isNonEmptyArray(o.viewModels())&&n.each(o.viewModels(),function(e){this.buildViewModel(e,o)},this),u.delegateRun(o,"onBuild")),n.defer(function(){i.oCurrentScreen&&(u.delegateRun(i.oCurrentScreen,"onHide"),u.isNonEmptyArray(i.oCurrentScreen.viewModels())&&n.each(i.oCurrentScreen.viewModels(),function(e){e.__vm&&e.__dom&&"Popups"!==e.__vm.viewModelPosition()&&(e.__dom.hide(),e.__vm.viewModelVisibility(!1),u.delegateRun(e.__vm,"onHide"))})),i.oCurrentScreen=o,i.oCurrentScreen&&(u.delegateRun(i.oCurrentScreen,"onShow"),c.runHook("screen-on-show",[i.oCurrentScreen.screenName(),i.oCurrentScreen]),u.isNonEmptyArray(i.oCurrentScreen.viewModels())&&n.each(i.oCurrentScreen.viewModels(),function(e){e.__vm&&e.__dom&&"Popups"!==e.__vm.viewModelPosition()&&(e.__dom.show(),e.__vm.viewModelVisibility(!0),u.delegateRun(e.__vm,"onShow"),u.delegateRun(e.__vm,"onFocus",[],200),n.each(e.__names,function(t){c.runHook("view-model-on-show",[t,e.__vm])}))},i)),s=o.__cross?o.__cross():null,s&&s.parse(t)})))},i.prototype.startScreens=function(e){o("#rl-content").css({visibility:"hidden"}),n.each(e,function(e){var t=new e,i=t?t.screenName():"";t&&""!==i&&(""===this.sDefaultScreenName&&(this.sDefaultScreenName=i),this.oScreens[i]=t)},this),n.each(this.oScreens,function(e){e&&!e.__started&&e.__start&&(e.__started=!0,e.__start(),c.runHook("screen-pre-start",[e.screenName(),e]),u.delegateRun(e,"onStart"),c.runHook("screen-post-start",[e.screenName(),e]))},this);var t=r.create();t.addRoute(/^([a-zA-Z0-9\-]*)\/?(.*)$/,n.bind(this.screenOnRoute,this)),a.initialized.add(t.parse,t),a.changed.add(t.parse,t),a.init(),o("#rl-content").css({visibility:"visible"}),n.delay(function(){l.$html.removeClass("rl-started-trigger").addClass("rl-started")},50)},i.prototype.setHash=function(e,t,i){e="#"===e.substr(0,1)?e.substr(1):e,e="/"===e.substr(0,1)?e.substr(1):e,i=u.isUnd(i)?!1:!!i,(u.isUnd(t)?1:!t)?(a.changed.active=!0,a[i?"replaceHash":"setHash"](e),a.setHash(e)):(a.changed.active=!1,a[i?"replaceHash":"setHash"](e),a.changed.active=!0)},e.exports=new i}(t,e)},{$:14,Globals:8,Plugins:10,Utils:11,_:19,crossroads:12,hasher:13,ko:16}],22:[function(e,t){!function(e){"use strict";function t(){}t.prototype.bootstart=function(){},e.exports=t}(t,e)},{}],23:[function(e,t){!function(e,t){"use strict";function i(e,t){this.sScreenName=e,this.aViewModels=s.isArray(t)?t:[]}var n=t("_"),o=t("crossroads"),s=t("Utils");i.prototype.oCross=null,i.prototype.sScreenName="",i.prototype.aViewModels=[],i.prototype.viewModels=function(){return this.aViewModels},i.prototype.screenName=function(){return this.sScreenName},i.prototype.routes=function(){return null},i.prototype.__cross=function(){return this.oCross},i.prototype.__start=function(){var e=this.routes(),t=null,i=null;s.isNonEmptyArray(e)&&(i=n.bind(this.onRoute||s.emptyFunction,this),t=o.create(),n.each(e,function(e){t.addRoute(e[0],i).rules=e[1]}),this.oCross=t)},e.exports=i}(t,e)},{Utils:11,_:19,crossroads:12}],24:[function(e,t){!function(e,t){"use strict"; +function i(e,t){this.bDisabeCloseOnEsc=!1,this.sPosition=s.pString(e),this.sTemplate=s.pString(t),this.sDefaultKeyScope=o.KeyState.None,this.sCurrentKeyScope=this.sDefaultKeyScope,this.viewModelVisibility=n.observable(!1),this.modalVisibility=n.observable(!1).extend({rateLimit:0}),this.viewModelName="",this.viewModelNames=[],this.viewModelDom=null}var n=t("ko"),o=t("Enums"),s=t("Utils"),a=t("Globals");i.prototype.bDisabeCloseOnEsc=!1,i.prototype.sPosition="",i.prototype.sTemplate="",i.prototype.sDefaultKeyScope=o.KeyState.None,i.prototype.sCurrentKeyScope=o.KeyState.None,i.prototype.viewModelName="",i.prototype.viewModelNames=[],i.prototype.viewModelDom=null,i.prototype.viewModelTemplate=function(){return this.sTemplate},i.prototype.viewModelPosition=function(){return this.sPosition},i.prototype.cancelCommand=function(){},i.prototype.closeCommand=function(){},i.prototype.storeAndSetKeyScope=function(){this.sCurrentKeyScope=a.keyScope(),a.keyScope(this.sDefaultKeyScope)},i.prototype.restoreKeyScope=function(){a.keyScope(this.sCurrentKeyScope)},i.prototype.registerPopupKeyDown=function(){var e=this;a.$win.on("keydown",function(t){if(t&&e.modalVisibility&&e.modalVisibility()){if(!this.bDisabeCloseOnEsc&&o.EventKeyCode.Esc===t.keyCode)return s.delegateRun(e,"cancelCommand"),!1;if(o.EventKeyCode.Backspace===t.keyCode&&!s.inFocus())return!1}return!0})},e.exports=i}(t,e)},{Enums:6,Globals:8,Utils:11,ko:16}],25:[function(e,t){!function(e,t){"use strict";function i(){this.idContactTag=0,this.name=n.observable(""),this.readOnly=!1}var n=t("ko"),o=t("Utils");i.prototype.parse=function(e){var t=!1;return e&&"Object/Tag"===e["@Object"]&&(this.idContact=o.pInt(e.IdContactTag),this.name(o.pString(e.Name)),this.readOnly=!!e.ReadOnly,t=!0),t},i.prototype.filterHelper=function(e){return-1!==this.name().toLowerCase().indexOf(e.toLowerCase())},i.prototype.toLine=function(e){return(o.isUnd(e)?1:!e)?this.name():o.encodeHtml(this.name())},e.exports=i}(t,e)},{Utils:11,ko:16}],26:[function(e,t){!function(e,t){"use strict";function i(e,t){this.email=e||"",this.name=t||"",this.clearDuplicateName()}var n=t("Utils");i.newInstanceFromJson=function(e){var t=new i;return t.initByJson(e)?t:null},i.prototype.name="",i.prototype.email="",i.prototype.clear=function(){this.email="",this.name=""},i.prototype.validate=function(){return""!==this.name||""!==this.email},i.prototype.hash=function(e){return"#"+(e?"":this.name)+"#"+this.email+"#"},i.prototype.clearDuplicateName=function(){this.name===this.email&&(this.name="")},i.prototype.search=function(e){return-1<(this.name+" "+this.email).toLowerCase().indexOf(e.toLowerCase())},i.prototype.parse=function(e){this.clear(),e=n.trim(e);var t=/(?:"([^"]+)")? ?,]+)>?,? ?/g,i=t.exec(e);i?(this.name=i[1]||"",this.email=i[2]||"",this.clearDuplicateName()):/^[^@]+@[^@]+$/.test(e)&&(this.name="",this.email=e)},i.prototype.initByJson=function(e){var t=!1;return e&&"Object/Email"===e["@Object"]&&(this.name=n.trim(e.Name),this.email=n.trim(e.Email),t=""!==this.email,this.clearDuplicateName()),t},i.prototype.toLine=function(e,t,i){var o="";return""!==this.email&&(t=n.isUnd(t)?!1:!!t,i=n.isUnd(i)?!1:!!i,e&&""!==this.name?o=t?'
    ")+'" target="_blank" tabindex="-1">'+n.encodeHtml(this.name)+"":i?n.encodeHtml(this.name):this.name:(o=this.email,""!==this.name?t?o=n.encodeHtml('"'+this.name+'" <')+'")+'" target="_blank" tabindex="-1">'+n.encodeHtml(o)+""+n.encodeHtml(">"):(o='"'+this.name+'" <'+o+">",i&&(o=n.encodeHtml(o))):t&&(o=''+n.encodeHtml(this.email)+""))),o},i.prototype.mailsoParse=function(e){if(e=n.trim(e),""===e)return!1;for(var t=function(e,t,i){e+="";var n=e.length;return 0>t&&(t+=n),n="undefined"==typeof i?n:0>i?i+n:i+t,t>=e.length||0>t||t>n?!1:e.slice(t,n)},i=function(e,t,i,n){return 0>i&&(i+=e.length),n=void 0!==n?n:e.length,0>n&&(n=n+e.length-i),e.slice(0,i)+t.substr(0,n)+t.slice(n)+e.slice(i+n)},o="",s="",a="",r=!1,l=!1,c=!1,u=null,p=0,d=0,g=0;g0&&0===o.length&&(o=t(e,0,g)),l=!0,p=g);break;case">":l&&(d=g,s=t(e,p+1,d-p-1),e=i(e,"",p,d-p+1),d=0,g=0,p=0,l=!1);break;case"(":r||l||c||(c=!0,p=g);break;case")":c&&(d=g,a=t(e,p+1,d-p-1),e=i(e,"",p,d-p+1),d=0,g=0,p=0,c=!1);break;case"\\":g++}g++}return 0===s.length&&(u=e.match(/[^@\s]+@\S+/i),u&&u[0]?s=u[0]:o=e),s.length>0&&0===o.length&&0===a.length&&(o=e.replace(s,"")),s=n.trim(s).replace(/^[<]+/,"").replace(/[>]+$/,""),o=n.trim(o).replace(/^["']+/,"").replace(/["']+$/,""),a=n.trim(a).replace(/^[(]+/,"").replace(/[)]+$/,""),o=o.replace(/\\\\(.)/g,"$1"),a=a.replace(/\\\\(.)/g,"$1"),this.name=o,this.email=s,this.clearDuplicateName(),!0},i.prototype.inputoTagLine=function(){return 0").addClass("rl-settings-view-model").hide(),d.appendTo(p),i.viewModelDom=d,i.__rlSettingsData=u.__rlSettingsData,u.__dom=d,u.__builded=!0,u.__vm=i,s.applyBindingAccessorsToNode(d[0],{i18nInit:!0,template:function(){return{name:u.__rlSettingsData.Template}}},i),r.delegateRun(i,"onBuild",[d])):r.log("Cannot find sub settings view model position: SettingsSubScreen")),i&&n.defer(function(){t.oCurrentSubScreen&&(r.delegateRun(t.oCurrentSubScreen,"onHide"),t.oCurrentSubScreen.viewModelDom.hide()),t.oCurrentSubScreen=i,t.oCurrentSubScreen&&(t.oCurrentSubScreen.viewModelDom.show(),r.delegateRun(t.oCurrentSubScreen,"onShow"),r.delegateRun(t.oCurrentSubScreen,"onFocus",[],200),n.each(t.menu(),function(e){e.selected(i&&i.__rlSettingsData&&e.route===i.__rlSettingsData.Route)}),o("#rl-content .b-settings .b-content .content").scrollTop(0)),r.windowResize()})):c.setHash(l.settings(),!1,!0)},i.prototype.onHide=function(){this.oCurrentSubScreen&&this.oCurrentSubScreen.viewModelDom&&(r.delegateRun(this.oCurrentSubScreen,"onHide"),this.oCurrentSubScreen.viewModelDom.hide())},i.prototype.onBuild=function(){n.each(a.aViewModels.settings,function(e){e&&e.__rlSettingsData&&!n.find(a.aViewModels["settings-removed"],function(t){return t&&t===e})&&this.menu.push({route:e.__rlSettingsData.Route,label:e.__rlSettingsData.Label,selected:s.observable(!1),disabled:!!n.find(a.aViewModels["settings-disabled"],function(t){return t&&t===e})})},this),this.oViewModelPlace=o("#rl-content #rl-settings-subscreen")},i.prototype.routes=function(){var e=n.find(a.aViewModels.settings,function(e){return e&&e.__rlSettingsData&&e.__rlSettingsData.IsDefault}),t=e?e.__rlSettingsData.Route:"general",i={subname:/^(.*)$/,normalize_:function(e,i){return i.subname=r.isUnd(i.subname)?t:r.pString(i.subname),[i.subname]}};return[["{subname}/",i],["{subname}",i],["",i]]},e.exports=i}(t,e)},{$:14,"App:Knoin":21,Globals:8,"Knoin:AbstractScreen":23,LinkBuilder:9,Utils:11,_:19,ko:16}],28:[function(e,t){!function(e,t){"use strict";function i(){o.call(this,"login",[t("View:Admin:Login")])}var n=t("_"),o=t("Knoin:AbstractScreen");n.extend(i.prototype,o.prototype),i.prototype.onShow=function(){t("App:Admin").setTitle("")},e.exports=i}(t,e)},{"App:Admin":3,"Knoin:AbstractScreen":23,"View:Admin:Login":46,_:19}],29:[function(e,t){!function(e,t){"use strict";function i(){o.call(this,[t("View:Admin:SettingsMenu"),t("View:Admin:SettingsPane")])}var n=t("_"),o=t("Screen:AbstractSettings");n.extend(i.prototype,o.prototype),i.prototype.onShow=function(){t("App:Admin").setTitle("")},e.exports=i}(t,e)},{"App:Admin":3,"Screen:AbstractSettings":27,"View:Admin:SettingsMenu":47,"View:Admin:SettingsPane":48,_:19}],30:[function(e,t){!function(e,t){"use strict";function i(){var e=t("Storage:Settings"),i=t("Storage:Admin:Data");this.version=n.observable(e.settingsGet("Version")),this.access=n.observable(!!e.settingsGet("CoreAccess")),this.errorDesc=n.observable(""),this.coreReal=i.coreReal,this.coreUpdatable=i.coreUpdatable,this.coreAccess=i.coreAccess,this.coreChecking=i.coreChecking,this.coreUpdating=i.coreUpdating,this.coreRemoteVersion=i.coreRemoteVersion,this.coreRemoteRelease=i.coreRemoteRelease,this.coreVersionCompare=i.coreVersionCompare,this.statusType=n.computed(function(){var e="",t=this.coreVersionCompare(),i=this.coreChecking(),n=this.coreUpdating(),o=this.coreReal();return i?e="checking":n?e="updating":o&&0===t?e="up-to-date":o&&-1===t?e="available":o||(e="error",this.errorDesc("Cannot access the repository at the moment.")),e},this)}var n=t("ko");i.prototype.onBuild=function(){this.access()&&t("App:Admin").reloadCoreData()},i.prototype.updateCoreData=function(){this.coreUpdating()||t("App:Admin").updateCoreData()},e.exports=i}(t,e)},{"App:Admin":3,"Storage:Admin:Data":43,"Storage:Settings":45,ko:16}],31:[function(e,t){!function(e,t){"use strict";function i(){var e=t("Enums"),i=t("Storage:Settings");this.title=o.observable(i.settingsGet("Title")),this.title.trigger=o.observable(e.SaveSettingsStep.Idle),this.loadingDesc=o.observable(i.settingsGet("LoadingDescription")),this.loadingDesc.trigger=o.observable(e.SaveSettingsStep.Idle),this.loginLogo=o.observable(i.settingsGet("LoginLogo")),this.loginLogo.trigger=o.observable(e.SaveSettingsStep.Idle),this.loginDescription=o.observable(i.settingsGet("LoginDescription")),this.loginDescription.trigger=o.observable(e.SaveSettingsStep.Idle),this.loginCss=o.observable(i.settingsGet("LoginCss")),this.loginCss.trigger=o.observable(e.SaveSettingsStep.Idle)}var n=t("_"),o=t("ko"),s=t("Utils");i.prototype.onBuild=function(){var e=this,i=t("Storage:Admin:Remote");n.delay(function(){var t=s.settingsSaveHelperSimpleFunction(e.title.trigger,e),n=s.settingsSaveHelperSimpleFunction(e.loadingDesc.trigger,e),o=s.settingsSaveHelperSimpleFunction(e.loginLogo.trigger,e),a=s.settingsSaveHelperSimpleFunction(e.loginDescription.trigger,e),r=s.settingsSaveHelperSimpleFunction(e.loginCss.trigger,e);e.title.subscribe(function(e){i.saveAdminConfig(t,{Title:s.trim(e)})}),e.loadingDesc.subscribe(function(e){i.saveAdminConfig(n,{LoadingDescription:s.trim(e)})}),e.loginLogo.subscribe(function(e){i.saveAdminConfig(o,{LoginLogo:s.trim(e)})}),e.loginDescription.subscribe(function(e){i.saveAdminConfig(a,{LoginDescription:s.trim(e)})}),e.loginCss.subscribe(function(e){i.saveAdminConfig(r,{LoginCss:s.trim(e)})})},50)},e.exports=i}(t,e)},{Enums:6,"Storage:Admin:Remote":44,"Storage:Settings":45,Utils:11,_:19,ko:16}],32:[function(e,t){!function(e,t){"use strict";function i(){var e=t("Storage:Admin:Remote");this.defautOptionsAfterRender=a.defautOptionsAfterRender,this.enableContacts=o.observable(!!r.settingsGet("ContactsEnable")),this.contactsSharing=o.observable(!!r.settingsGet("ContactsSharing")),this.contactsSync=o.observable(!!r.settingsGet("ContactsSync"));var i=["sqlite","mysql","pgsql"],l=[],c=function(e){switch(e){case"sqlite":e="SQLite";break;case"mysql":e="MySQL";break;case"pgsql":e="PostgreSQL"}return e};r.settingsGet("SQLiteIsSupported")&&l.push("sqlite"),r.settingsGet("MySqlIsSupported")&&l.push("mysql"),r.settingsGet("PostgreSqlIsSupported")&&l.push("pgsql"),this.contactsSupported=0(new n.Date).getTime()-m),f&&l.oRequests[f]&&(l.oRequests[f].__aborted&&(o="abort"),l.oRequests[f]=null),l.defaultResponse(e,f,o,i,s,t)}),f&&0') - .insertBefore($self) - .click(function () { - $self.toggleClass('hidden-bq'); - Utils.windowResize(); - }) - .after('
    ') - .before('
    ') - ; - } - }); - } - } - }; - - /** - * @param {Object} oMessageTextBody - */ - Utils.removeBlockquoteSwitcher = function (oMessageTextBody) - { - if (oMessageTextBody) - { - $(oMessageTextBody).find('blockquote.rl-bq-switcher').each(function () { - $(this).removeClass('rl-bq-switcher hidden-bq'); - }); - - $(oMessageTextBody).find('.rlBlockquoteSwitcher').each(function () { - $(this).remove(); - }); - } - }; - - /** - * @param {Object} oMessageTextBody - */ - Utils.toggleMessageBlockquote = function (oMessageTextBody) - { - if (oMessageTextBody) - { - oMessageTextBody.find('.rlBlockquoteSwitcher').click(); - } - }; - Utils.convertThemeName = function (sTheme) { if ('@custom' === sTheme.substr(-7)) @@ -5685,7 +5617,7 @@ sTheme = Utils.trim(sTheme.substring(0, sTheme.length - 7)); } - return Utils.trim(sTheme.replace(/[^a-zA-Z]+/g, ' ').replace(/([A-Z])/g, ' $1').replace(/[\s]+/g, ' ')); + return Utils.trim(sTheme.replace(/[^a-zA-Z0-9]+/g, ' ').replace(/([A-Z])/g, ' $1').replace(/[\s]+/g, ' ')); }; /** @@ -5738,14 +5670,10 @@ return sResult; }; - /* jshint ignore:start */ /** - * @param {string} s + * @param {string} sPlain * @return {string} */ - Utils.md5 = function(s){function L(k,d){return(k<>>(32-d))}function K(G,k){var I,d,F,H,x;F=(G&2147483648);H=(k&2147483648);I=(G&1073741824);d=(k&1073741824);x=(G&1073741823)+(k&1073741823);if(I&d){return(x^2147483648^F^H)}if(I|d){if(x&1073741824){return(x^3221225472^F^H)}else{return(x^1073741824^F^H)}}else{return(x^F^H)}}function r(d,F,k){return(d&F)|((~d)&k)}function q(d,F,k){return(d&k)|(F&(~k))}function p(d,F,k){return(d^F^k)}function n(d,F,k){return(F^(d|(~k)))}function u(G,F,aa,Z,k,H,I){G=K(G,K(K(r(F,aa,Z),k),I));return K(L(G,H),F)}function f(G,F,aa,Z,k,H,I){G=K(G,K(K(q(F,aa,Z),k),I));return K(L(G,H),F)}function D(G,F,aa,Z,k,H,I){G=K(G,K(K(p(F,aa,Z),k),I));return K(L(G,H),F)}function t(G,F,aa,Z,k,H,I){G=K(G,K(K(n(F,aa,Z),k),I));return K(L(G,H),F)}function e(G){var Z;var F=G.length;var x=F+8;var k=(x-(x%64))/64;var I=(k+1)*16;var aa=Array(I-1);var d=0;var H=0;while(H>>29;return aa}function B(x){var k="",F="",G,d;for(d=0;d<=3;d++){G=(x>>>(d*8))&255;F="0"+G.toString(16);k=k+F.substr(F.length-2,2)}return k}function J(k){k=k.replace(/rn/g,"n");var d="";for(var F=0;F127)&&(x<2048)){d+=String.fromCharCode((x>>6)|192);d+=String.fromCharCode((x&63)|128)}else{d+=String.fromCharCode((x>>12)|224);d+=String.fromCharCode(((x>>6)&63)|128);d+=String.fromCharCode((x&63)|128)}}}return d}var C=Array();var P,h,E,v,g,Y,X,W,V;var S=7,Q=12,N=17,M=22;var A=5,z=9,y=14,w=20;var o=4,m=11,l=16,j=23;var U=6,T=10,R=15,O=21;s=J(s);C=e(s);Y=1732584193;X=4023233417;W=2562383102;V=271733878;for(P=0;P ').appendTo('#rl-hidden'); }; - Utils.defautOptionsAfterRender = function (oOption, oItem) + Utils.defautOptionsAfterRender = function (oDomOption, oItem) { - if (oItem && !Utils.isUnd(oItem.disabled) && oOption) + if (oItem && !Utils.isUnd(oItem.disabled) && oDomOption) { - $(oOption) + $(oDomOption) .toggleClass('disabled', oItem.disabled) .prop('disabled', oItem.disabled) ; @@ -5823,10 +5751,18 @@ oWin.document.getElementsByTagName('head')[0].appendChild(oScript); }; + /** + * @param {Function} fCallback + * @param {?} koTrigger + * @param {?} oContext = null + * @param {number=} iTimer = 1000 + * @return {Function} + */ Utils.settingsSaveHelperFunction = function (fCallback, koTrigger, oContext, iTimer) { oContext = oContext || null; iTimer = Utils.isUnd(iTimer) ? 1000 : Utils.pInt(iTimer); + return function (sType, mData, bCached, sRequestAction, oRequestParameters) { koTrigger.call(oContext, mData && mData['Result'] ? Enums.SaveSettingsStep.TrueResult : Enums.SaveSettingsStep.FalseResult); if (fCallback) @@ -6100,6 +6036,11 @@ return sHtml; }; + /** + * @param {string} sUrl + * @param {number} iValue + * @param {Function} fCallback + */ Utils.resizeAndCrop = function (sUrl, iValue, fCallback) { var oTempImg = new window.Image(); @@ -6265,6 +6206,7 @@ Utils.computedPagenatorHelper = function (koCurrentPage, koPageCount) { return function() { + var iPrev = 0, iNext = 0, @@ -6275,8 +6217,8 @@ /** * @param {number} iIndex - * @param {boolean=} bPush - * @param {string=} sCustomName + * @param {boolean=} bPush = true + * @param {string=} sCustomName = '' */ fAdd = function (iIndex, bPush, sCustomName) { @@ -6378,22 +6320,21 @@ Utils.selectElement = function (element) { - /* jshint onevar: false */ + var sel, range; if (window.getSelection) { - var sel = window.getSelection(); + sel = window.getSelection(); sel.removeAllRanges(); - var range = window.document.createRange(); + range = window.document.createRange(); range.selectNodeContents(element); sel.addRange(range); } else if (window.document.selection) { - var textRange = window.document.body.createTextRange(); - textRange.moveToElementText(element); - textRange.select(); + range = window.document.body.createTextRange(); + range.moveToElementText(element); + range.select(); } - /* jshint onevar: true */ }; Utils.detectDropdownVisibility = _.debounce(function () { @@ -6402,13 +6343,16 @@ })); }, 50); + /** + * @param {boolean=} bDelay = false + */ Utils.triggerAutocompleteInputChange = function (bDelay) { var fFunc = function () { $('.checkAutocomplete').trigger('change'); }; - if (bDelay) + if (Utils.isUnd(bDelay) ? false : !!bDelay) { _.delay(fFunc, 100); } @@ -6421,41 +6365,26 @@ module.exports = Utils; }(module, require)); -},{"$":20,"Consts":6,"Enums":7,"Globals":9,"_":25,"ko":22,"window":26}],15:[function(require,module,exports){ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ - +},{"$":20,"App:Knoin":27,"Consts":6,"Enums":7,"Globals":9,"Model:Email":37,"_":25,"ko":22,"window":26}],15:[function(require,module,exports){ module.exports = JSON; },{}],16:[function(require,module,exports){ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ - module.exports = Jua; },{}],17:[function(require,module,exports){ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ - module.exports = crossroads; },{}],18:[function(require,module,exports){ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ - module.exports = hasher; },{}],19:[function(require,module,exports){ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ - module.exports = ifvisible; },{}],20:[function(require,module,exports){ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ - module.exports = $; },{}],21:[function(require,module,exports){ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ - module.exports = key; },{}],22:[function(require,module,exports){ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, ko) { 'use strict'; - + var window = require('window'), _ = require('_'), @@ -7358,40 +7287,29 @@ module.exports = key; }(module, ko)); },{"$":20,"Globals":9,"Model:ContactTag":36,"Model:Email":37,"Utils":14,"_":25,"window":26}],23:[function(require,module,exports){ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ - module.exports = moment; },{}],24:[function(require,module,exports){ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ - module.exports = ssm; },{}],25:[function(require,module,exports){ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ - module.exports = _; },{}],26:[function(require,module,exports){ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ - module.exports = window; },{}],27:[function(require,module,exports){ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { - + 'use strict'; var - $ = require('$'), _ = require('_'), + $ = require('$'), ko = require('ko'), hasher = require('hasher'), crossroads = require('crossroads'), Globals = require('Globals'), Plugins = require('Plugins'), - Utils = require('Utils'), - - KnoinAbstractViewModel = require('Knoin:AbstractViewModel') + Utils = require('Utils') ; /** @@ -7425,22 +7343,23 @@ module.exports = window; }; /** - * @param {string} sName + * @param {string|Array} mName * @param {Function} ViewModelClass - * @param {Function=} AbstractViewModel = KnoinAbstractViewModel */ - Knoin.prototype.extendAsViewModel = function (sName, ViewModelClass, AbstractViewModel) + Knoin.prototype.extendAsViewModel = function (mName, ViewModelClass) { if (ViewModelClass) { - if (!AbstractViewModel) + if (Utils.isArray(mName)) { - AbstractViewModel = KnoinAbstractViewModel; + ViewModelClass.__names = mName; + } + else + { + ViewModelClass.__names = [mName]; } - ViewModelClass.__name = sName; - Plugins.regViewModelHook(sName, ViewModelClass); - _.extend(ViewModelClass.prototype, AbstractViewModel.prototype); + ViewModelClass.__name = ViewModelClass.__names[0]; } }; @@ -7518,6 +7437,7 @@ module.exports = window; ViewModelClass.__vm = oViewModel; oViewModel.viewModelName = ViewModelClass.__name; + oViewModel.viewModelNames = ViewModelClass.__names; if (oViewModelPlace && 1 === oViewModelPlace.length) { @@ -7551,6 +7471,10 @@ module.exports = window; Utils.delegateRun(this, 'onHide'); this.restoreKeyScope(); + _.each(this.viewModelNames, function (sName) { + Plugins.runHook('view-model-on-hide', [sName, self]); + }); + Globals.popupVisibilityNames.remove(this.viewModelName); oViewModel.viewModelDom.css('z-index', 2000); @@ -7564,7 +7488,9 @@ module.exports = window; }, oViewModel); } - Plugins.runHook('view-model-pre-build', [ViewModelClass.__name, oViewModel, oViewModelDom]); + _.each(ViewModelClass.__names, function (sName) { + Plugins.runHook('view-model-pre-build', [sName, oViewModel, oViewModelDom]); + }); ko.applyBindingAccessorsToNode(oViewModelDom[0], { 'i18nInit': true, @@ -7577,14 +7503,16 @@ module.exports = window; oViewModel.registerPopupKeyDown(); } - Plugins.runHook('view-model-post-build', [ViewModelClass.__name, oViewModel, oViewModelDom]); + _.each(ViewModelClass.__names, function (sName) { + Plugins.runHook('view-model-post-build', [sName, oViewModel, oViewModelDom]); + }); } else { Utils.log('Cannot find view model position: ' + sPosition); } } - + return ViewModelClass ? ViewModelClass.__vm : null; }; @@ -7596,7 +7524,6 @@ module.exports = window; if (ViewModelClassToHide && ViewModelClassToHide.__vm && ViewModelClassToHide.__dom) { ViewModelClassToHide.__vm.modalVisibility(false); - Plugins.runHook('view-model-on-hide', [ViewModelClassToHide.__name, ViewModelClassToHide.__vm]); } }; @@ -7614,7 +7541,10 @@ module.exports = window; { ViewModelClassToShow.__vm.modalVisibility(true); Utils.delegateRun(ViewModelClassToShow.__vm, 'onShow', aParameters || []); - Plugins.runHook('view-model-on-show', [ViewModelClassToShow.__name, ViewModelClassToShow.__vm, aParameters || []]); + + _.each(ViewModelClassToShow.__names, function (sName) { + Plugins.runHook('view-model-on-show', [sName, ViewModelClassToShow.__vm, aParameters || []]); + }); } } }; @@ -7716,10 +7646,13 @@ module.exports = window; { ViewModelClass.__dom.show(); ViewModelClass.__vm.viewModelVisibility(true); + Utils.delegateRun(ViewModelClass.__vm, 'onShow'); Utils.delegateRun(ViewModelClass.__vm, 'onFocus', [], 200); - Plugins.runHook('view-model-on-show', [ViewModelClass.__name, ViewModelClass.__vm]); + _.each(ViewModelClass.__names, function (sName) { + Plugins.runHook('view-model-on-show', [sName, ViewModelClass.__vm]); + }); } }, self); @@ -7823,11 +7756,10 @@ module.exports = window; module.exports = new Knoin(); }(module, require)); -},{"$":20,"Globals":9,"Knoin:AbstractViewModel":30,"Plugins":12,"Utils":14,"_":25,"crossroads":17,"hasher":18,"ko":22}],28:[function(require,module,exports){ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ +},{"$":20,"Globals":9,"Plugins":12,"Utils":14,"_":25,"crossroads":17,"hasher":18,"ko":22}],28:[function(require,module,exports){ (function (module) { - + 'use strict'; /** @@ -7847,14 +7779,15 @@ module.exports = window; }(module, require)); },{}],29:[function(require,module,exports){ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { 'use strict'; var + _ = require('_'), crossroads = require('crossroads'), + Utils = require('Utils') ; @@ -7937,8 +7870,7 @@ module.exports = window; module.exports = KnoinAbstractScreen; }(module, require)); -},{"Utils":14,"crossroads":17}],30:[function(require,module,exports){ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ +},{"Utils":14,"_":25,"crossroads":17}],30:[function(require,module,exports){ (function (module, require) { @@ -7948,14 +7880,14 @@ module.exports = window; ko = require('ko'), Enums = require('Enums'), - Globals = require('Globals'), - Utils = require('Utils') + Utils = require('Utils'), + Globals = require('Globals') ; /** + * @constructor * @param {string=} sPosition = '' * @param {string=} sTemplate = '' - * @constructor */ function KnoinAbstractViewModel(sPosition, sTemplate) { @@ -7966,13 +7898,19 @@ module.exports = window; this.sDefaultKeyScope = Enums.KeyState.None; this.sCurrentKeyScope = this.sDefaultKeyScope; - this.viewModelName = ''; this.viewModelVisibility = ko.observable(false); this.modalVisibility = ko.observable(false).extend({'rateLimit': 0}); + this.viewModelName = ''; + this.viewModelNames = []; this.viewModelDom = null; } + /** + * @type {boolean} + */ + KnoinAbstractViewModel.prototype.bDisabeCloseOnEsc = false; + /** * @type {string} */ @@ -7983,11 +7921,26 @@ module.exports = window; */ KnoinAbstractViewModel.prototype.sTemplate = ''; + /** + * @type {string} + */ + KnoinAbstractViewModel.prototype.sDefaultKeyScope = Enums.KeyState.None; + + /** + * @type {string} + */ + KnoinAbstractViewModel.prototype.sCurrentKeyScope = Enums.KeyState.None; + /** * @type {string} */ KnoinAbstractViewModel.prototype.viewModelName = ''; + /** + * @type {Array} + */ + KnoinAbstractViewModel.prototype.viewModelNames = []; + /** * @type {?} */ @@ -8049,7 +8002,6 @@ module.exports = window; }(module, require)); },{"Enums":7,"Globals":9,"Utils":14,"ko":22}],31:[function(require,module,exports){ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { @@ -8057,6 +8009,7 @@ module.exports = window; var ko = require('ko'), + Utils = require('Utils') ; @@ -8069,7 +8022,7 @@ module.exports = window; function AccountModel(sEmail, bCanBeDelete) { this.email = sEmail; - + this.deleteAccess = ko.observable(false); this.canBeDalete = ko.observable(Utils.isUnd(bCanBeDelete) ? true : !!bCanBeDelete); } @@ -8091,14 +8044,14 @@ module.exports = window; }(module, require)); },{"LinkBuilder":11,"Utils":14,"ko":22}],32:[function(require,module,exports){ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { 'use strict'; - + var window = require('window'), + Globals = require('Globals'), Utils = require('Utils'), LinkBuilder = require('LinkBuilder') @@ -8344,14 +8297,14 @@ module.exports = window; }(module, require)); },{"Globals":9,"LinkBuilder":11,"Utils":14,"window":26}],33:[function(require,module,exports){ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { 'use strict'; - + var ko = require('ko'), + Utils = require('Utils') ; @@ -8421,7 +8374,6 @@ module.exports = window; }(module, require)); },{"Utils":14,"ko":22}],34:[function(require,module,exports){ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { @@ -8430,6 +8382,7 @@ module.exports = window; var _ = require('_'), ko = require('ko'), + Enums = require('Enums'), Utils = require('Utils'), LinkBuilder = require('LinkBuilder') @@ -8563,7 +8516,6 @@ module.exports = window; }(module, require)); },{"Enums":7,"LinkBuilder":11,"Utils":14,"_":25,"ko":22}],35:[function(require,module,exports){ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { @@ -8571,18 +8523,18 @@ module.exports = window; var ko = require('ko'), + Enums = require('Enums'), Utils = require('Utils') ; /** + * @constructor * @param {number=} iType = Enums.ContactPropertyType.Unknown * @param {string=} sTypeStr = '' * @param {string=} sValue = '' * @param {boolean=} bFocused = false * @param {string=} sPlaceholder = '' - * - * @constructor */ function ContactPropertyModel(iType, sTypeStr, sValue, bFocused, sPlaceholder) { @@ -8607,14 +8559,14 @@ module.exports = window; }(module, require)); },{"Enums":7,"Utils":14,"ko":22}],36:[function(require,module,exports){ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { 'use strict'; - + var ko = require('ko'), + Utils = require('Utils') ; @@ -8666,14 +8618,12 @@ module.exports = window; }(module, require)); },{"Utils":14,"ko":22}],37:[function(require,module,exports){ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { - + 'use strict'; var - Enums = require('Enums'), Utils = require('Utils') ; @@ -8687,7 +8637,6 @@ module.exports = window; { this.email = sEmail || ''; this.name = sName || ''; - this.privateType = null; this.clearDuplicateName(); } @@ -8713,16 +8662,10 @@ module.exports = window; */ EmailModel.prototype.email = ''; - /** - * @type {(number|null)} - */ - EmailModel.prototype.privateType = null; - EmailModel.prototype.clear = function () { this.email = ''; this.name = ''; - this.privateType = null; }; /** @@ -8750,27 +8693,6 @@ module.exports = window; } }; - /** - * @return {number} - */ - EmailModel.prototype.type = function () - { - if (null === this.privateType) - { - if (this.email && '@facebook.com' === this.email.substr(-13)) - { - this.privateType = Enums.EmailType.Facebook; - } - - if (null === this.privateType) - { - this.privateType = Enums.EmailType.Default; - } - } - - return this.privateType; - }; - /** * @param {string} sQuery * @return {boolean} @@ -9044,15 +8966,15 @@ module.exports = window; module.exports = EmailModel; }(module, require)); -},{"Enums":7,"Utils":14}],38:[function(require,module,exports){ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ +},{"Utils":14}],38:[function(require,module,exports){ (function (module, require) { 'use strict'; - + var ko = require('ko'), + Enums = require('Enums') ; @@ -9108,7 +9030,6 @@ module.exports = window; }(module, require)); },{"Enums":7,"ko":22}],39:[function(require,module,exports){ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { @@ -9116,6 +9037,7 @@ module.exports = window; var ko = require('ko'), + Enums = require('Enums'), Utils = require('Utils'), FilterConditionModel = require('Model:FilterCondition') @@ -9203,7 +9125,6 @@ module.exports = window; }(module, require)); },{"Enums":7,"Model:FilterCondition":38,"Utils":14,"ko":22}],40:[function(require,module,exports){ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { @@ -9558,7 +9479,6 @@ module.exports = window; }(module, require)); },{"Enums":7,"Events":8,"Globals":9,"Utils":14,"_":25,"ko":22}],41:[function(require,module,exports){ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { @@ -9566,6 +9486,7 @@ module.exports = window; var ko = require('ko'), + Utils = require('Utils') ; @@ -9609,7 +9530,6 @@ module.exports = window; }(module, require)); },{"Utils":14,"ko":22}],42:[function(require,module,exports){ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { @@ -9617,8 +9537,8 @@ module.exports = window; var window = require('window'), - $ = require('$'), _ = require('_'), + $ = require('$'), ko = require('ko'), moment = require('moment'), @@ -9954,6 +9874,14 @@ module.exports = window; this.lastInCollapsedThreadLoading(false); }; + /** + * @return {string} + */ + MessageModel.prototype.friendlySize = function () + { + return Utils.friendlySize(this.size()); + }; + MessageModel.prototype.computeSenderEmail = function () { var @@ -10896,12 +10824,11 @@ module.exports = window; }(module, require)); },{"$":20,"Enums":7,"Globals":9,"LinkBuilder":11,"Model:Attachment":32,"Model:Email":37,"Storage:RainLoop:Data":64,"Utils":14,"_":25,"ko":22,"moment":23,"window":26}],43:[function(require,module,exports){ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { 'use strict'; - + var ko = require('ko') ; @@ -10941,14 +10868,14 @@ module.exports = window; }(module, require)); },{"ko":22}],44:[function(require,module,exports){ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { - + 'use strict'; var _ = require('_'), + KnoinAbstractScreen = require('Knoin:AbstractScreen') ; @@ -10974,15 +10901,14 @@ module.exports = window; }(module, require)); },{"App:RainLoop":3,"Knoin:AbstractScreen":29,"View:RainLoop:About":70,"_":25}],45:[function(require,module,exports){ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { 'use strict'; var - $ = require('$'), _ = require('_'), + $ = require('$'), ko = require('ko'), Globals = require('Globals'), @@ -10994,11 +10920,11 @@ module.exports = window; ; /** - * @param {Array} aViewModels * @constructor + * @param {Array} aViewModels * @extends KnoinAbstractScreen */ - function AbstractSettings(aViewModels) + function AbstractSettingsScreen(aViewModels) { KnoinAbstractScreen.call(this, 'settings', aViewModels); @@ -11008,9 +10934,9 @@ module.exports = window; this.oViewModelPlace = null; } - _.extend(AbstractSettings.prototype, KnoinAbstractScreen.prototype); + _.extend(AbstractSettingsScreen.prototype, KnoinAbstractScreen.prototype); - AbstractSettings.prototype.onRoute = function (sSubName) + AbstractSettingsScreen.prototype.onRoute = function (sSubName) { var self = this, @@ -11117,7 +11043,7 @@ module.exports = window; } }; - AbstractSettings.prototype.onHide = function () + AbstractSettingsScreen.prototype.onHide = function () { if (this.oCurrentSubScreen && this.oCurrentSubScreen.viewModelDom) { @@ -11126,7 +11052,7 @@ module.exports = window; } }; - AbstractSettings.prototype.onBuild = function () + AbstractSettingsScreen.prototype.onBuild = function () { _.each(Globals.aViewModels['settings'], function (SettingsViewModel) { if (SettingsViewModel && SettingsViewModel.__rlSettingsData && @@ -11148,7 +11074,7 @@ module.exports = window; this.oViewModelPlace = $('#rl-content #rl-settings-subscreen'); }; - AbstractSettings.prototype.routes = function () + AbstractSettingsScreen.prototype.routes = function () { var DefaultViewModel = _.find(Globals.aViewModels['settings'], function (SettingsViewModel) { @@ -11171,18 +11097,18 @@ module.exports = window; ]; }; - module.exports = AbstractSettings; + module.exports = AbstractSettingsScreen; }(module, require)); },{"$":20,"App:Knoin":27,"Globals":9,"Knoin:AbstractScreen":29,"LinkBuilder":11,"Utils":14,"_":25,"ko":22}],46:[function(require,module,exports){ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { - + 'use strict'; var _ = require('_'), + KnoinAbstractScreen = require('Knoin:AbstractScreen') ; @@ -11208,7 +11134,6 @@ module.exports = window; }(module, require)); },{"App:RainLoop":3,"Knoin:AbstractScreen":29,"View:RainLoop:Login":72,"_":25}],47:[function(require,module,exports){ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { @@ -11406,7 +11331,6 @@ module.exports = window; }(module, require)); },{"App:RainLoop":3,"Enums":7,"Events":8,"Globals":9,"Knoin:AbstractScreen":29,"Storage:RainLoop:Cache":63,"Storage:RainLoop:Data":64,"Storage:RainLoop:Remote":68,"Storage:Settings":69,"Utils":14,"View:RainLoop:MailBoxFolderList":73,"View:RainLoop:MailBoxMessageList":74,"View:RainLoop:MailBoxMessageView":75,"View:RainLoop:MailBoxSystemDropDown":76,"_":25}],48:[function(require,module,exports){ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { @@ -11419,16 +11343,16 @@ module.exports = window; Utils = require('Utils'), Globals = require('Globals'), - AbstractSettings = require('Screen:AbstractSettings') + AbstractSettingsScreen = require('Screen:AbstractSettings') ; /** * @constructor - * @extends AbstractSettings + * @extends AbstractSettingsScreen */ function SettingsScreen() { - AbstractSettings.call(this, [ + AbstractSettingsScreen.call(this, [ require('View:RainLoop:SettingsSystemDropDown'), require('View:RainLoop:SettingsMenu'), require('View:RainLoop:SettingsPane') @@ -11441,14 +11365,14 @@ module.exports = window; }); } - _.extend(SettingsScreen.prototype, AbstractSettings.prototype); + _.extend(SettingsScreen.prototype, AbstractSettingsScreen.prototype); SettingsScreen.prototype.onShow = function () { this.setSettingsTitle(); Globals.keyScope(Enums.KeyState.Settings); }; - + SettingsScreen.prototype.setSettingsTitle = function () { require('App:RainLoop').setTitle(this.sSettingsTitle); @@ -11458,10 +11382,9 @@ module.exports = window; }(module, require)); },{"App:RainLoop":3,"Enums":7,"Globals":9,"Screen:AbstractSettings":45,"Utils":14,"View:RainLoop:SettingsMenu":94,"View:RainLoop:SettingsPane":95,"View:RainLoop:SettingsSystemDropDown":96,"_":25}],49:[function(require,module,exports){ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { - + 'use strict'; var @@ -11559,7 +11482,6 @@ module.exports = window; }(module, require)); },{"App:Knoin":27,"App:RainLoop":3,"Enums":7,"LinkBuilder":11,"Storage:RainLoop:Data":64,"Storage:RainLoop:Remote":68,"Utils":14,"View:Popup:AddAccount":77,"_":25,"ko":22,"window":26}],50:[function(require,module,exports){ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { @@ -11682,12 +11604,11 @@ module.exports = window; }(module, require)); },{"Enums":7,"Storage:RainLoop:Remote":68,"Utils":14,"_":25,"ko":22}],51:[function(require,module,exports){ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { 'use strict'; - + var ko = require('ko'), @@ -11742,14 +11663,14 @@ module.exports = window; }(module, require)); },{"Storage:RainLoop:Data":64,"Storage:RainLoop:Remote":68,"Utils":14,"ko":22}],52:[function(require,module,exports){ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { - + 'use strict'; var ko = require('ko'), + Utils = require('Utils') ; @@ -11785,7 +11706,6 @@ module.exports = window; }(module, require)); },{"App:Knoin":27,"Model:Filter":39,"Utils":14,"View:Popup:Filter":84,"ko":22}],53:[function(require,module,exports){ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { @@ -12001,16 +11921,15 @@ module.exports = window; }(module, require)); },{"App:Knoin":27,"App:RainLoop":3,"Enums":7,"Storage:LocalStorage":65,"Storage:RainLoop:Cache":63,"Storage:RainLoop:Data":64,"Storage:RainLoop:Remote":68,"Storage:Settings":69,"Utils":14,"View:Popup:FolderCreate":86,"View:Popup:FolderSystem":87,"ko":22}],54:[function(require,module,exports){ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { 'use strict'; - + var + _ = require('_'), $ = require('$'), ko = require('ko'), - _ = require('_'), Enums = require('Enums'), Consts = require('Consts'), @@ -12181,15 +12100,14 @@ module.exports = window; }(module, require)); },{"$":20,"App:Knoin":27,"Consts":6,"Enums":7,"Globals":9,"LinkBuilder":11,"Storage:RainLoop:Data":64,"Storage:RainLoop:Remote":68,"Utils":14,"View:Popup:Languages":90,"_":25,"ko":22}],55:[function(require,module,exports){ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { 'use strict'; var - ko = require('ko'), _ = require('_'), + ko = require('ko'), Enums = require('Enums'), Utils = require('Utils'), @@ -12416,15 +12334,14 @@ module.exports = window; }(module, require)); },{"App:Knoin":27,"App:RainLoop":3,"Enums":7,"HtmlEditor":10,"Storage:RainLoop:Data":64,"Storage:RainLoop:Remote":68,"Utils":14,"View:Popup:Identity":88,"_":25,"ko":22}],56:[function(require,module,exports){ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { 'use strict'; var - ko = require('ko'), _ = require('_'), + ko = require('ko'), Enums = require('Enums'), Utils = require('Utils'), @@ -12521,15 +12438,16 @@ module.exports = window; }(module, require)); },{"Enums":7,"HtmlEditor":10,"Storage:RainLoop:Data":64,"Storage:RainLoop:Remote":68,"Utils":14,"_":25,"ko":22}],57:[function(require,module,exports){ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { - + 'use strict'; var ko = require('ko'), + kn = require('App:Knoin'), + Data = require('Storage:RainLoop:Data') ; @@ -12604,7 +12522,6 @@ module.exports = window; }(module, require)); },{"App:Knoin":27,"App:RainLoop":3,"Storage:RainLoop:Data":64,"View:Popup:AddOpenPgpKey":78,"View:Popup:NewOpenPgpKey":91,"View:Popup:ViewOpenPgpKey":93,"ko":22}],58:[function(require,module,exports){ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { @@ -12772,7 +12689,6 @@ module.exports = window; }(module, require)); },{"App:Knoin":27,"Enums":7,"Globals":9,"Storage:RainLoop:Remote":68,"Utils":14,"View:Popup:TwoFactorTest":92,"ko":22}],59:[function(require,module,exports){ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { @@ -12850,7 +12766,6 @@ module.exports = window; }(module, require)); },{"App:RainLoop":3,"Storage:RainLoop:Data":64,"Utils":14}],60:[function(require,module,exports){ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { @@ -12858,9 +12773,9 @@ module.exports = window; var window = require('window'), + _ = require('_'), $ = require('$'), ko = require('ko'), - _ = require('_'), Enums = require('Enums'), Utils = require('Utils'), @@ -13086,8 +13001,8 @@ module.exports = window; var window = require('window'), - $ = require('$'), _ = require('_'), + $ = require('$'), Consts = require('Consts'), Enums = require('Enums'), @@ -13749,8 +13664,8 @@ module.exports = window; var window = require('window'), - $ = require('$'), _ = require('_'), + $ = require('$'), ko = require('ko'), moment = require('moment'), @@ -14291,7 +14206,7 @@ module.exports = window; NotificationClass = Utils.notificationClass(), oNotification = null ; - + if (NotificationClass && self.useDesktopNotifications()) { oNotification = new NotificationClass(sTitle, { @@ -14524,6 +14439,40 @@ module.exports = window; } }; + /** + * @private + * @param {Object} oMessageTextBody + */ + DataStorage.prototype.initBlockquoteSwitcher = function (oMessageTextBody) + { + if (oMessageTextBody) + { + var $oList = $('blockquote:not(.rl-bq-switcher)', oMessageTextBody).filter(function () { + return 0 === $(this).parent().closest('blockquote', oMessageTextBody).length; + }); + + if ($oList && 0 < $oList.length) + { + $oList.each(function () { + var $self = $(this), iH = $self.height(); + if (0 === iH || 100 < iH) + { + $self.addClass('rl-bq-switcher hidden-bq'); + $('') + .insertBefore($self) + .click(function () { + $self.toggleClass('hidden-bq'); + Utils.windowResize(); + }) + .after('
    ') + .before('
    ') + ; + } + }); + } + } + }; + DataStorage.prototype.setMessage = function (oData, bCached) { var @@ -14663,7 +14612,7 @@ module.exports = window; if (oBody) { - Utils.initBlockquoteSwitcher(oBody); + this.initBlockquoteSwitcher(oBody); } } @@ -14785,12 +14734,11 @@ module.exports = window; function LocalStorage() { var - _ = require('_'), - NextStorageDriver = _.find([ + NextStorageDriver = require('_').find([ require('Storage:LocalStorage:Cookie'), require('Storage:LocalStorage:LocalStorage') ], function (NextStorageDriver) { - return NextStorageDriver.supported(); + return NextStorageDriver && NextStorageDriver.supported(); }) ; @@ -15826,11 +15774,12 @@ module.exports = window; /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { - + 'use strict'; var window = require('window'), + Utils = require('Utils') ; @@ -15878,15 +15827,15 @@ module.exports = window; }(module, require)); },{"Utils":14,"window":26}],70:[function(require,module,exports){ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { 'use strict'; - + var + _ = require('_'), ko = require('ko'), - + kn = require('App:Knoin'), Settings = require('Storage:Settings'), @@ -15906,22 +15855,22 @@ module.exports = window; kn.constructorEnd(this); } - kn.extendAsViewModel('AboutViewModel', AboutViewModel); + kn.extendAsViewModel(['View:RainLoop:About', 'AboutViewModel'], AboutViewModel); + _.extend(AboutViewModel.prototype, KnoinAbstractViewModel.prototype); module.exports = AboutViewModel; }(module, require)); -},{"App:Knoin":27,"Knoin:AbstractViewModel":30,"Storage:Settings":69,"ko":22}],71:[function(require,module,exports){ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ +},{"App:Knoin":27,"Knoin:AbstractViewModel":30,"Storage:Settings":69,"_":25,"ko":22}],71:[function(require,module,exports){ (function (module, require) { - + 'use strict'; var + window = require('window'), _ = require('_'), ko = require('ko'), - window = require('window'), key = require('key'), Enums = require('Enums'), @@ -16034,20 +15983,19 @@ module.exports = window; }(module, require)); },{"App:Knoin":27,"App:RainLoop":3,"Enums":7,"Knoin:AbstractViewModel":30,"LinkBuilder":11,"Storage:RainLoop:Data":64,"Storage:RainLoop:Remote":68,"Storage:Settings":69,"Utils":14,"View:Popup:AddAccount":77,"View:Popup:KeyboardShortcutsHelp":89,"_":25,"key":21,"ko":22,"window":26}],72:[function(require,module,exports){ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { 'use strict'; - + var window = require('window'), - $ = require('$'), _ = require('_'), + $ = require('$'), ko = require('ko'), - Utils = require('Utils'), Enums = require('Enums'), + Utils = require('Utils'), LinkBuilder = require('LinkBuilder'), Settings = require('Storage:Settings'), @@ -16286,7 +16234,8 @@ module.exports = window; kn.constructorEnd(this); } - kn.extendAsViewModel('LoginViewModel', LoginViewModel); + kn.extendAsViewModel(['View:RainLoop:Login', 'LoginViewModel'], LoginViewModel); + _.extend(LoginViewModel.prototype, KnoinAbstractViewModel.prototype); LoginViewModel.prototype.onShow = function () { @@ -16405,7 +16354,6 @@ module.exports = window; }(module, require)); },{"$":20,"App:Knoin":27,"App:RainLoop":3,"Enums":7,"Knoin:AbstractViewModel":30,"LinkBuilder":11,"Storage:RainLoop:Data":64,"Storage:RainLoop:Remote":68,"Storage:Settings":69,"Utils":14,"View:Popup:Languages":90,"_":25,"ko":22,"window":26}],73:[function(require,module,exports){ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { @@ -16413,6 +16361,7 @@ module.exports = window; var window = require('window'), + _ = require('_'), $ = require('$'), ko = require('ko'), key = require('key'), @@ -16455,7 +16404,8 @@ module.exports = window; kn.constructorEnd(this); } - kn.extendAsViewModel('MailBoxFolderListViewModel', MailBoxFolderListViewModel); + kn.extendAsViewModel(['View:RainLoop:MailBoxFolderList', 'MailBoxFolderListViewModel'], MailBoxFolderListViewModel); + _.extend(MailBoxFolderListViewModel.prototype, KnoinAbstractViewModel.prototype); MailBoxFolderListViewModel.prototype.onBuild = function (oDom) { @@ -16679,20 +16629,19 @@ module.exports = window; }(module, require)); -},{"$":20,"App:Knoin":27,"App:RainLoop":3,"Enums":7,"Globals":9,"Knoin:AbstractViewModel":30,"LinkBuilder":11,"Storage:RainLoop:Cache":63,"Storage:RainLoop:Data":64,"Storage:Settings":69,"Utils":14,"View:Popup:Compose":82,"View:Popup:Contacts":83,"View:Popup:FolderCreate":86,"key":21,"ko":22,"window":26}],74:[function(require,module,exports){ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ +},{"$":20,"App:Knoin":27,"App:RainLoop":3,"Enums":7,"Globals":9,"Knoin:AbstractViewModel":30,"LinkBuilder":11,"Storage:RainLoop:Cache":63,"Storage:RainLoop:Data":64,"Storage:Settings":69,"Utils":14,"View:Popup:Compose":82,"View:Popup:Contacts":83,"View:Popup:FolderCreate":86,"_":25,"key":21,"ko":22,"window":26}],74:[function(require,module,exports){ (function (module, require) { 'use strict'; - + var - $ = require('$'), _ = require('_'), + $ = require('$'), ko = require('ko'), key = require('key'), - ifvisible = require('ifvisible'), Jua = require('Jua'), + ifvisible = require('ifvisible'), Enums = require('Enums'), Consts = require('Consts'), @@ -16948,7 +16897,8 @@ module.exports = window; kn.constructorEnd(this); } - kn.extendAsViewModel('MailBoxMessageListViewModel', MailBoxMessageListViewModel); + kn.extendAsViewModel(['View:RainLoop:MailBoxMessageList', 'MailBoxMessageListViewModel'], MailBoxMessageListViewModel); + _.extend(MailBoxMessageListViewModel.prototype, KnoinAbstractViewModel.prototype); /** * @type {string} @@ -17481,7 +17431,7 @@ module.exports = window; // change focused state key('tab, shift+tab, left, right', Enums.KeyState.MessageList, function (event, handler) { - if (event && handler && 'shift+tab' === handler.shortcut || 'left' === handler.shortcut) + if (event && handler && ('shift+tab' === handler.shortcut || 'left' === handler.shortcut)) { self.folderList.focused(true); } @@ -17617,13 +17567,13 @@ module.exports = window; }(module, require)); },{"$":20,"App:Knoin":27,"App:RainLoop":3,"Consts":6,"Enums":7,"Events":8,"Globals":9,"Jua":16,"Knoin:AbstractViewModel":30,"LinkBuilder":11,"Selector":13,"Storage:RainLoop:Cache":63,"Storage:RainLoop:Data":64,"Storage:RainLoop:Remote":68,"Storage:Settings":69,"Utils":14,"View:Popup:AdvancedSearch":79,"View:Popup:Compose":82,"View:Popup:FolderClear":85,"_":25,"ifvisible":19,"key":21,"ko":22}],75:[function(require,module,exports){ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { 'use strict'; var + _ = require('_'), $ = require('$'), ko = require('ko'), key = require('key'), @@ -17769,6 +17719,7 @@ module.exports = window; this.viewCc = ko.observable(''); this.viewBcc = ko.observable(''); this.viewDate = ko.observable(''); + this.viewSize = ko.observable(''); this.viewMoment = ko.observable(''); this.viewLineAsCcc = ko.observable(''); this.viewViewLink = ko.observable(''); @@ -17807,6 +17758,7 @@ module.exports = window; this.viewCc(oMessage.ccToLine(false)); this.viewBcc(oMessage.bccToLine(false)); this.viewDate(oMessage.fullFormatDateValue()); + this.viewSize(oMessage.friendlySize()); this.viewMoment(oMessage.momentDate()); this.viewLineAsCcc(oMessage.lineAsCcc()); this.viewViewLink(oMessage.viewLink()); @@ -17865,7 +17817,8 @@ module.exports = window; kn.constructorEnd(this); } - kn.extendAsViewModel('MailBoxMessageViewViewModel', MailBoxMessageViewViewModel); + kn.extendAsViewModel(['View:RainLoop:MailBoxMessageView', 'MailBoxMessageViewViewModel'], MailBoxMessageViewViewModel); + _.extend(MailBoxMessageViewViewModel.prototype, KnoinAbstractViewModel.prototype); MailBoxMessageViewViewModel.prototype.isPgpActionVisible = function () { @@ -17909,23 +17862,6 @@ module.exports = window; return sResult; }; - MailBoxMessageViewViewModel.prototype.scrollToTop = function () - { - var oCont = $('.messageItem.nano .content', this.viewModelDom); - if (oCont && oCont[0]) - { - // oCont.animate({'scrollTop': 0}, 300); - oCont.scrollTop(0); - } - else - { - // $('.messageItem', this.viewModelDom).animate({'scrollTop': 0}, 300); - $('.messageItem', this.viewModelDom).scrollTop(0); - } - - Utils.windowResize(); - }; - MailBoxMessageViewViewModel.prototype.fullScreen = function () { this.fullScreenMode(true); @@ -17985,15 +17921,9 @@ module.exports = window; }); oDom - .on('click', '.messageView .messageItem .messageItemHeader', function () { - if (Globals.useKeyboardShortcuts() && self.message()) - { - self.message.focused(true); - } - }) .on('click', 'a', function (oEvent) { // setup maito protocol - return !(!!oEvent && 3 !== oEvent['which'] && require('App:RainLoop').mailToHelper($(this).attr('href'))); + return !(!!oEvent && 3 !== oEvent['which'] && Utils.mailToHelper($(this).attr('href'), require('View:Popup:Compose'))); }) .on('click', '.attachmentsPlace .attachmentPreview', function (oEvent) { if (oEvent && oEvent.stopPropagation) @@ -18019,6 +17949,8 @@ module.exports = window; this.messageDomFocused(true); } else { this.messageDomFocused(false); + this.scrollMessageToTop(); + this.scrollMessageToLeft(); } }, this); @@ -18135,7 +18067,7 @@ module.exports = window; key('b', [Enums.KeyState.MessageList, Enums.KeyState.MessageView], function () { if (Data.message() && Data.message().body) { - Utils.toggleMessageBlockquote(Data.message().body); + Data.message().body.find('.rlBlockquoteSwitcher').click(); return false; } }); @@ -18178,10 +18110,26 @@ module.exports = window; }); // change focused state - key('tab, shift+tab, left', Enums.KeyState.MessageView, function () { + key('tab, shift+tab, left', Enums.KeyState.MessageView, function (event, handler) { if (!self.fullScreenMode() && self.message() && Enums.Layout.NoPreview !== Data.layout()) { - self.message.focused(false); + if (event && handler && 'left' === handler.shortcut) + { + if (self.oMessageScrollerDom && 0 < self.oMessageScrollerDom.scrollLeft()) + { + return true; + } + + self.message.focused(false); + } + else + { + self.message.focused(false); + } + } + else if (self.message() && Enums.Layout.NoPreview === Data.layout() && event && handler && 'left' === handler.shortcut) + { + return true; } return false; @@ -18262,6 +18210,16 @@ module.exports = window; if (this.oMessageScrollerDom) { this.oMessageScrollerDom.scrollTop(0); + Utils.windowResize(); + } + }; + + MailBoxMessageViewViewModel.prototype.scrollMessageToLeft = function () + { + if (this.oMessageScrollerDom) + { + this.oMessageScrollerDom.scrollLeft(0); + Utils.windowResize(); } }; @@ -18331,14 +18289,15 @@ module.exports = window; module.exports = MailBoxMessageViewViewModel; }(module, require)); -},{"$":20,"App:Knoin":27,"App:RainLoop":3,"Consts":6,"Enums":7,"Events":8,"Globals":9,"Knoin:AbstractViewModel":30,"Storage:RainLoop:Cache":63,"Storage:RainLoop:Data":64,"Storage:RainLoop:Remote":68,"Utils":14,"View:Popup:Compose":82,"key":21,"ko":22}],76:[function(require,module,exports){ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ +},{"$":20,"App:Knoin":27,"App:RainLoop":3,"Consts":6,"Enums":7,"Events":8,"Globals":9,"Knoin:AbstractViewModel":30,"Storage:RainLoop:Cache":63,"Storage:RainLoop:Data":64,"Storage:RainLoop:Remote":68,"Utils":14,"View:Popup:Compose":82,"_":25,"key":21,"ko":22}],76:[function(require,module,exports){ (function (module, require) { - + 'use strict'; var + _ = require('_'), + kn = require('App:Knoin'), AbstractSystemDropDownViewModel = require('View:RainLoop:AbstractSystemDropDown') ; @@ -18353,19 +18312,19 @@ module.exports = window; kn.constructorEnd(this); } - kn.extendAsViewModel('MailBoxSystemDropDownViewModel', MailBoxSystemDropDownViewModel, AbstractSystemDropDownViewModel); + kn.extendAsViewModel(['View:RainLoop:MailBoxSystemDropDown', 'MailBoxSystemDropDownViewModel'], MailBoxSystemDropDownViewModel); + _.extend(MailBoxSystemDropDownViewModel.prototype, AbstractSystemDropDownViewModel.prototype); module.exports = MailBoxSystemDropDownViewModel; }(module, require)); -},{"App:Knoin":27,"View:RainLoop:AbstractSystemDropDown":71}],77:[function(require,module,exports){ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ +},{"App:Knoin":27,"View:RainLoop:AbstractSystemDropDown":71,"_":25}],77:[function(require,module,exports){ (function (module, require) { 'use strict'; - + var _ = require('_'), ko = require('ko'), @@ -18449,7 +18408,8 @@ module.exports = window; kn.constructorEnd(this); } - kn.extendAsViewModel('PopupsAddAccountViewModel', PopupsAddAccountViewModel); + kn.extendAsViewModel(['View:Popup:AddAccount', 'PopupsAddAccountViewModel'], PopupsAddAccountViewModel); + _.extend(PopupsAddAccountViewModel.prototype, KnoinAbstractViewModel.prototype); PopupsAddAccountViewModel.prototype.clearPopup = function () { @@ -18477,13 +18437,13 @@ module.exports = window; }(module, require)); },{"App:Knoin":27,"App:RainLoop":3,"Enums":7,"Knoin:AbstractViewModel":30,"Storage:RainLoop:Remote":68,"Utils":14,"_":25,"ko":22}],78:[function(require,module,exports){ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { 'use strict'; var + _ = require('_'), ko = require('ko'), Utils = require('Utils'), @@ -18565,7 +18525,8 @@ module.exports = window; kn.constructorEnd(this); } - kn.extendAsViewModel('PopupsAddOpenPgpKeyViewModel', PopupsAddOpenPgpKeyViewModel); + kn.extendAsViewModel(['View:Popup:AddOpenPgpKey', 'PopupsAddOpenPgpKeyViewModel'], PopupsAddOpenPgpKeyViewModel); + _.extend(PopupsAddOpenPgpKeyViewModel.prototype, KnoinAbstractViewModel.prototype); PopupsAddOpenPgpKeyViewModel.prototype.clearPopup = function () { @@ -18586,14 +18547,14 @@ module.exports = window; module.exports = PopupsAddOpenPgpKeyViewModel; }(module, require)); -},{"App:Knoin":27,"App:RainLoop":3,"Knoin:AbstractViewModel":30,"Storage:RainLoop:Data":64,"Utils":14,"ko":22}],79:[function(require,module,exports){ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ +},{"App:Knoin":27,"App:RainLoop":3,"Knoin:AbstractViewModel":30,"Storage:RainLoop:Data":64,"Utils":14,"_":25,"ko":22}],79:[function(require,module,exports){ (function (module, require) { 'use strict'; - + var + _ = require('_'), ko = require('ko'), moment = require('moment'), @@ -18639,7 +18600,8 @@ module.exports = window; kn.constructorEnd(this); } - kn.extendAsViewModel('PopupsAdvancedSearchViewModel', PopupsAdvancedSearchViewModel); + kn.extendAsViewModel(['View:Popup:AdvancedSearch', 'PopupsAdvancedSearchViewModel'], PopupsAdvancedSearchViewModel); + _.extend(PopupsAdvancedSearchViewModel.prototype, KnoinAbstractViewModel.prototype); PopupsAdvancedSearchViewModel.prototype.buildSearchStringValue = function (sValue) { @@ -18744,14 +18706,14 @@ module.exports = window; module.exports = PopupsAdvancedSearchViewModel; }(module, require)); -},{"App:Knoin":27,"Knoin:AbstractViewModel":30,"Storage:RainLoop:Data":64,"Utils":14,"ko":22,"moment":23}],80:[function(require,module,exports){ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ +},{"App:Knoin":27,"Knoin:AbstractViewModel":30,"Storage:RainLoop:Data":64,"Utils":14,"_":25,"ko":22,"moment":23}],80:[function(require,module,exports){ (function (module, require) { 'use strict'; - + var + _ = require('_'), ko = require('ko'), key = require('key'), @@ -18786,7 +18748,8 @@ module.exports = window; kn.constructorEnd(this); } - kn.extendAsViewModel('PopupsAskViewModel', PopupsAskViewModel); + kn.extendAsViewModel(['View:Popup:Ask', 'PopupsAskViewModel'], PopupsAskViewModel); + _.extend(PopupsAskViewModel.prototype, KnoinAbstractViewModel.prototype); PopupsAskViewModel.prototype.clearPopup = function () { @@ -18875,13 +18838,12 @@ module.exports = window; module.exports = PopupsAskViewModel; }(module, require)); -},{"App:Knoin":27,"Enums":7,"Knoin:AbstractViewModel":30,"Utils":14,"key":21,"ko":22}],81:[function(require,module,exports){ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ +},{"App:Knoin":27,"Enums":7,"Knoin:AbstractViewModel":30,"Utils":14,"_":25,"key":21,"ko":22}],81:[function(require,module,exports){ (function (module, require) { 'use strict'; - + var window = require('window'), _ = require('_'), @@ -19037,7 +18999,8 @@ module.exports = window; kn.constructorEnd(this); } - kn.extendAsViewModel('PopupsComposeOpenPgpViewModel', PopupsComposeOpenPgpViewModel); + kn.extendAsViewModel(['View:Popup:ComposeOpenPgp', 'PopupsComposeOpenPgpViewModel'], PopupsComposeOpenPgpViewModel); + _.extend(PopupsComposeOpenPgpViewModel.prototype, KnoinAbstractViewModel.prototype); PopupsComposeOpenPgpViewModel.prototype.clearPopup = function () { @@ -19142,7 +19105,6 @@ module.exports = window; }(module, require)); },{"App:Knoin":27,"Enums":7,"Knoin:AbstractViewModel":30,"Model:Email":37,"Storage:RainLoop:Data":64,"Utils":14,"_":25,"key":21,"ko":22,"window":26}],82:[function(require,module,exports){ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { @@ -19150,8 +19112,8 @@ module.exports = window; var window = require('window'), - $ = require('$'), _ = require('_'), + $ = require('$'), ko = require('ko'), moment = require('moment'), JSON = require('JSON'), @@ -19161,8 +19123,8 @@ module.exports = window; Consts = require('Consts'), Utils = require('Utils'), Globals = require('Globals'), - LinkBuilder = require('LinkBuilder'), Events = require('Events'), + LinkBuilder = require('LinkBuilder'), HtmlEditor = require('HtmlEditor'), Settings = require('Storage:Settings'), @@ -19548,7 +19510,8 @@ module.exports = window; kn.constructorEnd(this); } - kn.extendAsViewModel('PopupsComposeViewModel', PopupsComposeViewModel); + kn.extendAsViewModel(['View:Popup:Compose', 'PopupsComposeViewModel'], PopupsComposeViewModel); + _.extend(PopupsComposeViewModel.prototype, KnoinAbstractViewModel.prototype); PopupsComposeViewModel.prototype.emailsSource = function (oData, fResponse) { @@ -19938,7 +19901,15 @@ module.exports = window; aDraftInfo = oMessage.aDraftInfo; oText = $(oMessage.body).clone(); - Utils.removeBlockquoteSwitcher(oText); + if (oText) + { + oText.find('blockquote.rl-bq-switcher').each(function () { + $(this).removeClass('rl-bq-switcher hidden-bq'); + }); + oText.find('.rlBlockquoteSwitcher').each(function () { + $(this).remove(); + }); + } oText.find('[data-html-editor-font-wrapper]').removeAttr('data-html-editor-font-wrapper'); sText = oText.html(); @@ -20925,7 +20896,6 @@ module.exports = window; }(module, require)); },{"$":20,"App:Knoin":27,"App:RainLoop":3,"Consts":6,"Enums":7,"Events":8,"Globals":9,"HtmlEditor":10,"JSON":15,"Jua":16,"Knoin:AbstractViewModel":30,"LinkBuilder":11,"Model:ComposeAttachment":33,"Storage:RainLoop:Cache":63,"Storage:RainLoop:Data":64,"Storage:RainLoop:Remote":68,"Storage:Settings":69,"Utils":14,"View:Popup:Ask":80,"View:Popup:ComposeOpenPgp":81,"View:Popup:FolderSystem":87,"_":25,"ko":22,"moment":23,"window":26}],83:[function(require,module,exports){ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { @@ -20933,8 +20903,8 @@ module.exports = window; var window = require('window'), - $ = require('$'), _ = require('_'), + $ = require('$'), ko = require('ko'), key = require('key'), @@ -20942,8 +20912,8 @@ module.exports = window; Consts = require('Consts'), Globals = require('Globals'), Utils = require('Utils'), - LinkBuilder = require('LinkBuilder'), Selector = require('Selector'), + LinkBuilder = require('LinkBuilder'), Data = require('Storage:RainLoop:Data'), Remote = require('Storage:RainLoop:Remote'), @@ -21318,7 +21288,8 @@ module.exports = window; kn.constructorEnd(this); } - kn.extendAsViewModel('PopupsContactsViewModel', PopupsContactsViewModel); + kn.extendAsViewModel(['View:Popup:Contacts', 'PopupsContactsViewModel'], PopupsContactsViewModel); + _.extend(PopupsContactsViewModel.prototype, KnoinAbstractViewModel.prototype); PopupsContactsViewModel.prototype.contactTagsSource = function (oData, fResponse) { @@ -21707,13 +21678,13 @@ module.exports = window; }(module, require)); },{"$":20,"App:Knoin":27,"App:RainLoop":3,"Consts":6,"Enums":7,"Globals":9,"Knoin:AbstractViewModel":30,"LinkBuilder":11,"Model:Contact":34,"Model:ContactProperty":35,"Model:ContactTag":36,"Model:Email":37,"Selector":13,"Storage:RainLoop:Data":64,"Storage:RainLoop:Remote":68,"Utils":14,"View:Popup:Compose":82,"View:Popup:Contacts":83,"_":25,"key":21,"ko":22,"window":26}],84:[function(require,module,exports){ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { 'use strict'; var + _ = require('_'), ko = require('ko'), Consts = require('Consts'), @@ -21742,7 +21713,8 @@ module.exports = window; kn.constructorEnd(this); } - kn.extendAsViewModel('PopupsFilterViewModel', PopupsFilterViewModel); + kn.extendAsViewModel(['View:Popup:Filter', 'PopupsFilterViewModel'], PopupsFilterViewModel); + _.extend(PopupsFilterViewModel.prototype, KnoinAbstractViewModel.prototype); PopupsFilterViewModel.prototype.clearPopup = function () { @@ -21759,14 +21731,14 @@ module.exports = window; module.exports = PopupsFilterViewModel; }(module, require)); -},{"App:Knoin":27,"Consts":6,"Knoin:AbstractViewModel":30,"Storage:RainLoop:Data":64,"Utils":14,"ko":22}],85:[function(require,module,exports){ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ +},{"App:Knoin":27,"Consts":6,"Knoin:AbstractViewModel":30,"Storage:RainLoop:Data":64,"Utils":14,"_":25,"ko":22}],85:[function(require,module,exports){ (function (module, require) { 'use strict'; var + _ = require('_'), ko = require('ko'), Enums = require('Enums'), @@ -21826,7 +21798,7 @@ module.exports = window; oFolderToClear.messageCountUnread(0); Cache.setFolderHash(oFolderToClear.fullNameRaw, ''); - + Remote.folderClear(function (sResult, oData) { self.clearingProcess(false); @@ -21863,7 +21835,8 @@ module.exports = window; kn.constructorEnd(this); } - kn.extendAsViewModel('PopupsFolderClearViewModel', PopupsFolderClearViewModel); + kn.extendAsViewModel(['View:Popup:FolderClear', 'PopupsFolderClearViewModel'], PopupsFolderClearViewModel); + _.extend(PopupsFolderClearViewModel.prototype, KnoinAbstractViewModel.prototype); PopupsFolderClearViewModel.prototype.clearPopup = function () { @@ -21884,14 +21857,14 @@ module.exports = window; }(module, require)); -},{"App:Knoin":27,"App:RainLoop":3,"Enums":7,"Knoin:AbstractViewModel":30,"Storage:RainLoop:Cache":63,"Storage:RainLoop:Data":64,"Storage:RainLoop:Remote":68,"Utils":14,"ko":22}],86:[function(require,module,exports){ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ +},{"App:Knoin":27,"App:RainLoop":3,"Enums":7,"Knoin:AbstractViewModel":30,"Storage:RainLoop:Cache":63,"Storage:RainLoop:Data":64,"Storage:RainLoop:Remote":68,"Utils":14,"_":25,"ko":22}],86:[function(require,module,exports){ (function (module, require) { - + 'use strict'; var + _ = require('_'), ko = require('ko'), Enums = require('Enums'), @@ -21987,7 +21960,8 @@ module.exports = window; kn.constructorEnd(this); } - kn.extendAsViewModel('PopupsFolderCreateViewModel', PopupsFolderCreateViewModel); + kn.extendAsViewModel(['View:Popup:FolderCreate', 'PopupsFolderCreateViewModel'], PopupsFolderCreateViewModel); + _.extend(PopupsFolderCreateViewModel.prototype, KnoinAbstractViewModel.prototype); PopupsFolderCreateViewModel.prototype.sNoParentText = ''; @@ -22016,14 +21990,14 @@ module.exports = window; module.exports = PopupsFolderCreateViewModel; }(module, require)); -},{"App:Knoin":27,"App:RainLoop":3,"Consts":6,"Enums":7,"Knoin:AbstractViewModel":30,"Storage:RainLoop:Data":64,"Storage:RainLoop:Remote":68,"Utils":14,"ko":22}],87:[function(require,module,exports){ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ +},{"App:Knoin":27,"App:RainLoop":3,"Consts":6,"Enums":7,"Knoin:AbstractViewModel":30,"Storage:RainLoop:Data":64,"Storage:RainLoop:Remote":68,"Utils":14,"_":25,"ko":22}],87:[function(require,module,exports){ (function (module, require) { - + 'use strict'; var + _ = require('_'), ko = require('ko'), Enums = require('Enums'), @@ -22113,7 +22087,8 @@ module.exports = window; kn.constructorEnd(this); } - kn.extendAsViewModel('PopupsFolderSystemViewModel', PopupsFolderSystemViewModel); + kn.extendAsViewModel(['View:Popup:FolderSystem', 'PopupsFolderSystemViewModel'], PopupsFolderSystemViewModel); + _.extend(PopupsFolderSystemViewModel.prototype, KnoinAbstractViewModel.prototype); PopupsFolderSystemViewModel.prototype.sChooseOnText = ''; PopupsFolderSystemViewModel.prototype.sUnuseText = ''; @@ -22152,23 +22127,23 @@ module.exports = window; module.exports = PopupsFolderSystemViewModel; }(module, require)); -},{"App:Knoin":27,"Consts":6,"Enums":7,"Knoin:AbstractViewModel":30,"Storage:RainLoop:Data":64,"Storage:RainLoop:Remote":68,"Storage:Settings":69,"Utils":14,"ko":22}],88:[function(require,module,exports){ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ +},{"App:Knoin":27,"Consts":6,"Enums":7,"Knoin:AbstractViewModel":30,"Storage:RainLoop:Data":64,"Storage:RainLoop:Remote":68,"Storage:Settings":69,"Utils":14,"_":25,"ko":22}],88:[function(require,module,exports){ (function (module, require) { 'use strict'; var + _ = require('_'), ko = require('ko'), Enums = require('Enums'), Utils = require('Utils'), - kn = require('App:Knoin'), Remote = require('Storage:RainLoop:Remote'), Data = require('Storage:RainLoop:Data'), + kn = require('App:Knoin'), KnoinAbstractViewModel = require('Knoin:AbstractViewModel') ; @@ -22270,7 +22245,8 @@ module.exports = window; kn.constructorEnd(this); } - kn.extendAsViewModel('PopupsIdentityViewModel', PopupsIdentityViewModel); + kn.extendAsViewModel(['View:Popup:Identity', 'PopupsIdentityViewModel'], PopupsIdentityViewModel); + _.extend(PopupsIdentityViewModel.prototype, KnoinAbstractViewModel.prototype); PopupsIdentityViewModel.prototype.clearPopup = function () { @@ -22323,8 +22299,7 @@ module.exports = window; module.exports = PopupsIdentityViewModel; }(module, require)); -},{"App:Knoin":27,"App:RainLoop":3,"Enums":7,"Knoin:AbstractViewModel":30,"Storage:RainLoop:Data":64,"Storage:RainLoop:Remote":68,"Utils":14,"ko":22}],89:[function(require,module,exports){ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ +},{"App:Knoin":27,"App:RainLoop":3,"Enums":7,"Knoin:AbstractViewModel":30,"Storage:RainLoop:Data":64,"Storage:RainLoop:Remote":68,"Utils":14,"_":25,"ko":22}],89:[function(require,module,exports){ (function (module, require) { @@ -22353,7 +22328,8 @@ module.exports = window; kn.constructorEnd(this); } - kn.extendAsViewModel('PopupsKeyboardShortcutsHelpViewModel', PopupsKeyboardShortcutsHelpViewModel); + kn.extendAsViewModel(['View:Popup:KeyboardShortcutsHelp', 'PopupsKeyboardShortcutsHelpViewModel'], PopupsKeyboardShortcutsHelpViewModel); + _.extend(PopupsKeyboardShortcutsHelpViewModel.prototype, KnoinAbstractViewModel.prototype); PopupsKeyboardShortcutsHelpViewModel.prototype.onBuild = function (oDom) { @@ -22389,7 +22365,6 @@ module.exports = window; }(module, require)); },{"App:Knoin":27,"Enums":7,"Knoin:AbstractViewModel":30,"_":25,"key":21}],90:[function(require,module,exports){ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { @@ -22400,8 +22375,7 @@ module.exports = window; ko = require('ko'), Utils = require('Utils'), - - Data = require('Storage:RainLoop:Data'), + Globals = require('Globals'), kn = require('App:Knoin'), KnoinAbstractViewModel = require('Knoin:AbstractViewModel') @@ -22415,26 +22389,29 @@ module.exports = window; { KnoinAbstractViewModel.call(this, 'Popups', 'PopupsLanguages'); + this.Data = Globals.__APP.data(); // TODO + this.exp = ko.observable(false); this.languages = ko.computed(function () { - return _.map(Data.languages(), function (sLanguage) { + return _.map(this.Data.languages(), function (sLanguage) { return { 'key': sLanguage, 'selected': ko.observable(false), 'fullName': Utils.convertLangName(sLanguage) }; }); - }); + }, this); - Data.mainLanguage.subscribe(function () { + this.Data.mainLanguage.subscribe(function () { this.resetMainLanguage(); }, this); kn.constructorEnd(this); } - kn.extendAsViewModel('PopupsLanguagesViewModel', PopupsLanguagesViewModel); + kn.extendAsViewModel(['View:Popup:Languages', 'PopupsLanguagesViewModel'], PopupsLanguagesViewModel); + _.extend(PopupsLanguagesViewModel.prototype, KnoinAbstractViewModel.prototype); PopupsLanguagesViewModel.prototype.languageEnName = function (sLanguage) { @@ -22443,7 +22420,7 @@ module.exports = window; PopupsLanguagesViewModel.prototype.resetMainLanguage = function () { - var sCurrent = Data.mainLanguage(); + var sCurrent = this.Data.mainLanguage(); _.each(this.languages(), function (oItem) { oItem['selected'](oItem['key'] === sCurrent); }); @@ -22463,15 +22440,14 @@ module.exports = window; PopupsLanguagesViewModel.prototype.changeLanguage = function (sLang) { - Data.mainLanguage(sLang); + this.Data.mainLanguage(sLang); this.cancelCommand(); }; module.exports = PopupsLanguagesViewModel; }(module, require)); -},{"App:Knoin":27,"Knoin:AbstractViewModel":30,"Storage:RainLoop:Data":64,"Utils":14,"_":25,"ko":22}],91:[function(require,module,exports){ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ +},{"App:Knoin":27,"Globals":9,"Knoin:AbstractViewModel":30,"Utils":14,"_":25,"ko":22}],91:[function(require,module,exports){ (function (module, require) { @@ -22562,7 +22538,8 @@ module.exports = window; kn.constructorEnd(this); } - kn.extendAsViewModel('PopupsNewOpenPgpKeyViewModel', PopupsNewOpenPgpKeyViewModel); + kn.extendAsViewModel(['View:Popup:NewOpenPgpKey', 'PopupsNewOpenPgpKeyViewModel'], PopupsNewOpenPgpKeyViewModel); + _.extend(PopupsNewOpenPgpKeyViewModel.prototype, KnoinAbstractViewModel.prototype); PopupsNewOpenPgpKeyViewModel.prototype.clearPopup = function () { @@ -22588,13 +22565,13 @@ module.exports = window; }(module, require)); },{"App:Knoin":27,"App:RainLoop":3,"Knoin:AbstractViewModel":30,"Storage:RainLoop:Data":64,"Utils":14,"_":25,"ko":22,"window":26}],92:[function(require,module,exports){ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function (module, require) { 'use strict'; var + _ = require('_'), ko = require('ko'), Enums = require('Enums'), @@ -22640,7 +22617,8 @@ module.exports = window; kn.constructorEnd(this); } - kn.extendAsViewModel('PopupsTwoFactorTestViewModel', PopupsTwoFactorTestViewModel); + kn.extendAsViewModel(['View:Popup:TwoFactorTest', 'PopupsTwoFactorTestViewModel'], PopupsTwoFactorTestViewModel); + _.extend(PopupsTwoFactorTestViewModel.prototype, KnoinAbstractViewModel.prototype); PopupsTwoFactorTestViewModel.prototype.clearPopup = function () { @@ -22663,14 +22641,14 @@ module.exports = window; module.exports = PopupsTwoFactorTestViewModel; }(module, require)); -},{"App:Knoin":27,"Enums":7,"Knoin:AbstractViewModel":30,"Storage:RainLoop:Remote":68,"Utils":14,"ko":22}],93:[function(require,module,exports){ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ +},{"App:Knoin":27,"Enums":7,"Knoin:AbstractViewModel":30,"Storage:RainLoop:Remote":68,"Utils":14,"_":25,"ko":22}],93:[function(require,module,exports){ (function (module, require) { 'use strict'; var + _ = require('_'), ko = require('ko'), Utils = require('Utils'), @@ -22693,7 +22671,8 @@ module.exports = window; kn.constructorEnd(this); } - kn.extendAsViewModel('PopupsViewOpenPgpKeyViewModel', PopupsViewOpenPgpKeyViewModel); + kn.extendAsViewModel(['View:Popup:ViewOpenPgpKey', 'PopupsViewOpenPgpKeyViewModel'], PopupsViewOpenPgpKeyViewModel); + _.extend(PopupsViewOpenPgpKeyViewModel.prototype, KnoinAbstractViewModel.prototype); PopupsViewOpenPgpKeyViewModel.prototype.clearPopup = function () { @@ -22722,16 +22701,17 @@ module.exports = window; module.exports = PopupsViewOpenPgpKeyViewModel; }(module, require)); -},{"App:Knoin":27,"Knoin:AbstractViewModel":30,"Utils":14,"ko":22}],94:[function(require,module,exports){ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ +},{"App:Knoin":27,"Knoin:AbstractViewModel":30,"Utils":14,"_":25,"ko":22}],94:[function(require,module,exports){ (function (module, require) { 'use strict'; var - LinkBuilder = require('LinkBuilder'), + _ = require('_'), + Globals = require('Globals'), + LinkBuilder = require('LinkBuilder'), kn = require('App:Knoin'), KnoinAbstractViewModel = require('Knoin:AbstractViewModel') @@ -22754,7 +22734,8 @@ module.exports = window; kn.constructorEnd(this); } - kn.extendAsViewModel('SettingsMenuViewModel', SettingsMenuViewModel); + kn.extendAsViewModel(['View:RainLoop:SettingsMenu', 'SettingsMenuViewModel'], SettingsMenuViewModel); + _.extend(SettingsMenuViewModel.prototype, KnoinAbstractViewModel.prototype); SettingsMenuViewModel.prototype.link = function (sRoute) { @@ -22769,14 +22750,14 @@ module.exports = window; module.exports = SettingsMenuViewModel; }(module, require)); -},{"App:Knoin":27,"Globals":9,"Knoin:AbstractViewModel":30,"LinkBuilder":11}],95:[function(require,module,exports){ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ +},{"App:Knoin":27,"Globals":9,"Knoin:AbstractViewModel":30,"LinkBuilder":11,"_":25}],95:[function(require,module,exports){ (function (module, require) { 'use strict'; var + _ = require('_'), key = require('key'), Enums = require('Enums'), @@ -22799,7 +22780,8 @@ module.exports = window; kn.constructorEnd(this); } - kn.extendAsViewModel('SettingsPaneViewModel', SettingsPaneViewModel); + kn.extendAsViewModel(['View:RainLoop:SettingsPane', 'SettingsPaneViewModel'], SettingsPaneViewModel); + _.extend(SettingsPaneViewModel.prototype, KnoinAbstractViewModel.prototype); SettingsPaneViewModel.prototype.onBuild = function () { @@ -22822,14 +22804,15 @@ module.exports = window; module.exports = SettingsPaneViewModel; }(module, require)); -},{"App:Knoin":27,"Enums":7,"Knoin:AbstractViewModel":30,"LinkBuilder":11,"Storage:RainLoop:Data":64,"key":21}],96:[function(require,module,exports){ -/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ +},{"App:Knoin":27,"Enums":7,"Knoin:AbstractViewModel":30,"LinkBuilder":11,"Storage:RainLoop:Data":64,"_":25,"key":21}],96:[function(require,module,exports){ (function (module, require) { 'use strict'; var + _ = require('_'), + kn = require('App:Knoin'), AbstractSystemDropDownViewModel = require('View:RainLoop:AbstractSystemDropDown') ; @@ -22844,9 +22827,10 @@ module.exports = window; kn.constructorEnd(this); } - kn.extendAsViewModel('SettingsSystemDropDownViewModel', SettingsSystemDropDownViewModel, AbstractSystemDropDownViewModel); + kn.extendAsViewModel(['View:RainLoop:SettingsSystemDropDown', 'SettingsSystemDropDownViewModel'], SettingsSystemDropDownViewModel); + _.extend(SettingsSystemDropDownViewModel.prototype, AbstractSystemDropDownViewModel.prototype); module.exports = SettingsSystemDropDownViewModel; }(module, require)); -},{"App:Knoin":27,"View:RainLoop:AbstractSystemDropDown":71}]},{},[1]); +},{"App:Knoin":27,"View:RainLoop:AbstractSystemDropDown":71,"_":25}]},{},[1]); diff --git a/rainloop/v/0.0.0/static/js/app.min.js b/rainloop/v/0.0.0/static/js/app.min.js index 446f61cc8..a04da40dc 100644 --- a/rainloop/v/0.0.0/static/js/app.min.js +++ b/rainloop/v/0.0.0/static/js/app.min.js @@ -1,10 +1,11 @@ -!function e(t,i,s){function o(a,r){if(!i[a]){if(!t[a]){var l="function"==typeof require&&require;if(!r&&l)return l(a,!0);if(n)return n(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var u=i[a]={exports:{}};t[a][0].call(u.exports,function(e){var i=t[a][1][e];return o(i?i:e)},u,u.exports,e,t,i,s)}return i[a].exports}for(var n="function"==typeof require&&require,a=0;a').appendTo("body"),a.$win.on("error",function(t){t&&t.originalEvent&&t.originalEvent.message&&-1===r.inArray(t.originalEvent.message,["Script error.","Uncaught Error: Error calling method on NPObject."])&&e.jsError(r.emptyFunction,t.originalEvent.message,t.originalEvent.filename,t.originalEvent.lineno,n.location&&n.location.toString?n.location.toString():"",a.$html.attr("class"),r.microtime()-a.now)}),a.$doc.on("keydown",function(e){e&&e.ctrlKey&&a.$html.addClass("rl-ctrl-key-pressed")}).on("keyup",function(e){e&&!e.ctrlKey&&a.$html.removeClass("rl-ctrl-key-pressed")})}var s=t("$"),o=t("_"),n=t("window"),a=t("Globals"),r=t("Utils"),l=t("LinkBuilder"),c=t("Events"),u=t("Storage:Settings"),d=t("Knoin:AbstractBoot");o.extend(i.prototype,d.prototype),i.prototype.remote=function(){return null},i.prototype.data=function(){return null},i.prototype.setupSettings=function(){return!0},i.prototype.download=function(e){var t=null,i=null,s=n.navigator.userAgent.toLowerCase();return s&&(s.indexOf("chrome")>-1||s.indexOf("chrome")>-1)&&(i=n.document.createElement("a"),i.href=e,n.document.createEvent&&(t=n.document.createEvent("MouseEvents"),t&&t.initEvent&&i.dispatchEvent))?(t.initEvent("click",!0,!0),i.dispatchEvent(t),!0):(a.bMobileDevice?(n.open(e,"_self"),n.focus()):this.iframe.attr("src",e),!0)},i.prototype.setTitle=function(e){e=(r.isNormal(e)&&0o;o++)g=e.Result["@Collection"][o],g&&"Object/Message"===g["@Object"]&&(m=h[o],m&&m.initByJson(g)||(m=C.newInstanceFromJson(g)),m&&(S.hasNewMessageAndRemoveFromCache(m.folderFullNameRaw,m.uid)&&5>=y&&(y++,m.newForAnimation(!0)),m.deleted(!1),t?S.initMessageFlagsFromCache(m):S.storeMessageFlagsToCache(m),m.lastInCollapsedThread(i&&-1s;s++)n=t[s],n&&(r=n.FullNameRaw,a=S.getFolderFromCacheList(r),a||(a=w.newInstanceFromJson(n),a&&(S.setFolderToCacheList(r,a),S.setFolderFullNameRaw(a.fullNameHash,r))),a&&(a.collapsed(!i.isFolderExpanded(a.fullNameHash)),n.Extended&&(n.Extended.Hash&&S.setFolderHash(a.fullNameRaw,n.Extended.Hash),d.isNormal(n.Extended.MessageCount)&&a.messageCountAll(n.Extended.MessageCount),d.isNormal(n.Extended.MessageUnseenCount)&&a.messageCountUnread(n.Extended.MessageUnseenCount)),l=n.SubFolders,l&&"Collection/FolderCollection"===l["@Object"]&&l["@Collection"]&&d.isArray(l["@Collection"])&&a.subFolders(this.folderResponseParseRec(e,l["@Collection"])),c.push(a)));return c},i.prototype.setFolders=function(e){var t=[],i=!1,s=function(e){return""===e||c.Values.UnuseOptionValue===e||null!==S.getFolderFromCacheList(e)?e:""};e&&e.Result&&"Collection/FolderCollection"===e.Result["@Object"]&&e.Result["@Collection"]&&d.isArray(e.Result["@Collection"])&&(d.isUnd(e.Result.Namespace)||(b.namespace=e.Result.Namespace),b.threading(!!f.settingsGet("UseImapThread")&&e.Result.IsThreadsSupported&&!0),t=this.folderResponseParseRec(b.namespace,e.Result["@Collection"]),b.folderList(t),e.Result.SystemFolders&&""==""+f.settingsGet("SentFolder")+f.settingsGet("DraftFolder")+f.settingsGet("SpamFolder")+f.settingsGet("TrashFolder")+f.settingsGet("ArchiveFolder")+f.settingsGet("NullFolder")&&(f.settingsSet("SentFolder",e.Result.SystemFolders[2]||null),f.settingsSet("DraftFolder",e.Result.SystemFolders[3]||null),f.settingsSet("SpamFolder",e.Result.SystemFolders[4]||null),f.settingsSet("TrashFolder",e.Result.SystemFolders[5]||null),f.settingsSet("ArchiveFolder",e.Result.SystemFolders[12]||null),i=!0),b.sentFolder(s(f.settingsGet("SentFolder"))),b.draftFolder(s(f.settingsGet("DraftFolder"))),b.spamFolder(s(f.settingsGet("SpamFolder"))),b.trashFolder(s(f.settingsGet("TrashFolder"))),b.archiveFolder(s(f.settingsGet("ArchiveFolder"))),i&&y.saveSystemFolders(d.emptyFunction,{SentFolder:b.sentFolder(),DraftFolder:b.draftFolder(),SpamFolder:b.spamFolder(),TrashFolder:b.trashFolder(),ArchiveFolder:b.archiveFolder(),NullFolder:"NullFolder"}),m.set(r.ClientSideKeyName.FoldersLashHash,e.Result.FoldersHash))},i.prototype.isFolderExpanded=function(e){var t=m.get(r.ClientSideKeyName.ExpandedFolders);return n.isArray(t)&&-1!==n.indexOf(t,e)},i.prototype.setExpandedFolder=function(e,t){var i=m.get(r.ClientSideKeyName.ExpandedFolders);n.isArray(i)||(i=[]),t?(i.push(e),i=n.uniq(i)):i=n.without(i,e),m.set(r.ClientSideKeyName.ExpandedFolders,i)},i.prototype.initLayoutResizer=function(e,t,i){var s=60,n=155,a=o(e),r=o(t),l=m.get(i)||null,c=function(e){e&&(a.css({width:""+e+"px"}),r.css({left:""+e+"px"}))},u=function(e){if(e)a.resizable("disable"),c(s);else{a.resizable("enable");var t=d.pInt(m.get(i))||n;c(t>n?t:n)}},p=function(e,t){t&&t.size&&t.size.width&&(m.set(i,t.size.width),r.css({left:""+t.size.width+"px"}))};null!==l&&c(l>n?l:n),a.resizable({helper:"ui-resizable-helper",minWidth:n,maxWidth:350,handles:"e",stop:p}),h.sub("left-panel.off",function(){u(!0)}),h.sub("left-panel.on",function(){u(!1)})},i.prototype.mailToHelper=function(e){if(e&&"mailto:"===e.toString().substr(0,7).toLowerCase()){e=e.toString().substr(7);var i={},o=null,n=e.replace(/\?.+$/,""),a=e.replace(/^[^\?]*\?/,"");return o=new v,o.parse(s.decodeURIComponent(n)),o&&o.email&&(i=d.simpleQueryParser(a),g.showScreenPopup(t("View:Popup:Compose"),[r.ComposeType.Empty,null,[o],d.isUnd(i.subject)?null:d.pString(i.subject),d.isUnd(i.body)?null:d.plainToHtml(d.pString(i.body))])),!0}return!1},i.prototype.bootstartLoginScreen=function(){var e=d.pString(f.settingsGet("CustomLoginLink"));e?(g.routeOff(),g.setHash(p.root(),!0),g.routeOff(),n.defer(function(){s.location.href=e})):(g.hideLoading(),g.startScreens([t("Screen:RainLoop:Login")]),u.runHook("rl-start-login-screens"),h.pub("rl.bootstart-login-screens"))},i.prototype.bootstart=function(){R.prototype.bootstart.call(this),b.populateDataOnStart();var e=this,i=f.settingsGet("JsHash"),a=d.pInt(f.settingsGet("ContactsSyncInterval")),c=f.settingsGet("AllowGoogleSocial"),m=f.settingsGet("AllowFacebookSocial"),S=f.settingsGet("AllowTwitterSocial");d.initOnStartOrLangChange(function(){o.extend(!0,o.magnificPopup.defaults,{tClose:d.i18n("MAGNIFIC_POPUP/CLOSE"),tLoading:d.i18n("MAGNIFIC_POPUP/LOADING"),gallery:{tPrev:d.i18n("MAGNIFIC_POPUP/GALLERY_PREV"),tNext:d.i18n("MAGNIFIC_POPUP/GALLERY_NEXT"),tCounter:d.i18n("MAGNIFIC_POPUP/GALLERY_COUNTER")},image:{tError:d.i18n("MAGNIFIC_POPUP/IMAGE_ERROR")},ajax:{tError:d.i18n("MAGNIFIC_POPUP/AJAX_ERROR")}})},this),s.SimplePace&&(s.SimplePace.set(70),s.SimplePace.sleep()),l.leftPanelDisabled.subscribe(function(e){h.pub("left-panel."+(e?"off":"on"))}),f.settingsGet("Auth")?(this.setTitle(d.i18n("TITLES/LOADING")),this.folders(n.bind(function(i){g.hideLoading(),i?(s.$LAB&&s.crypto&&s.crypto.getRandomValues&&f.capa(r.Capa.OpenPGP)?s.$LAB.script(s.openpgp?"":p.openPgpJs()).wait(function(){s.openpgp&&(b.openpgpKeyring=new s.openpgp.Keyring,b.capaOpenPGP(!0),h.pub("openpgp.init"),e.reloadOpenPgpKeys())}):b.capaOpenPGP(!1),g.startScreens([t("Screen:RainLoop:MailBox"),t("Screen:RainLoop:Settings"),t("Screen:RainLoop:About")]),(c||m||S)&&e.socialUsers(!0),h.sub("interval.2m",function(){e.folderInformation("INBOX")}),h.sub("interval.2m",function(){var t=b.currentFolderFullNameRaw();"INBOX"!==t&&e.folderInformation(t)}),h.sub("interval.3m",function(){e.folderInformationMultiply()}),h.sub("interval.5m",function(){e.quota()}),h.sub("interval.10m",function(){e.folders()}),a=a>=5?a:20,a=320>=a?a:320,s.setInterval(function(){e.contactsSync()},6e4*a+5e3),n.delay(function(){e.contactsSync()},5e3),n.delay(function(){e.folderInformationMultiply(!0)},500),u.runHook("rl-start-user-screens"),h.pub("rl.bootstart-user-screens"),f.settingsGet("AccountSignMe")&&s.navigator.registerProtocolHandler&&n.delay(function(){try{s.navigator.registerProtocolHandler("mailto",s.location.protocol+"//"+s.location.host+s.location.pathname+"?mailto&to=%s",""+(f.settingsGet("Title")||"RainLoop"))}catch(t){}f.settingsGet("MailToEmail")&&e.mailToHelper(f.settingsGet("MailToEmail"))},500),l.bMobileDevice||n.defer(function(){e.initLayoutResizer("#rl-left","#rl-right",r.ClientSideKeyName.FolderListSize)})):e.bootstartLoginScreen(),s.SimplePace&&s.SimplePace.set(100)},this))):(this.bootstartLoginScreen(),s.SimplePace&&s.SimplePace.set(100)),c&&(s["rl_"+i+"_google_service"]=function(){b.googleActions(!0),e.socialUsers()}),m&&(s["rl_"+i+"_facebook_service"]=function(){b.facebookActions(!0),e.socialUsers()}),S&&(s["rl_"+i+"_twitter_service"]=function(){b.twitterActions(!0),e.socialUsers()}),h.sub("interval.1m",function(){l.momentTrigger(!l.momentTrigger())}),u.runHook("rl-start-screens"),h.pub("rl.bootstart-end")},e.exports=new i}(t,e)},{$:20,"App:Abstract":2,"App:Knoin":27,Consts:6,Enums:7,Events:8,Globals:9,LinkBuilder:11,"Model:Account":31,"Model:Email":37,"Model:Folder":40,"Model:Identity":41,"Model:Message":42,"Model:OpenPgpKey":43,Plugins:12,"Screen:RainLoop:About":44,"Screen:RainLoop:Login":46,"Screen:RainLoop:MailBox":47,"Screen:RainLoop:Settings":48,"Settings:RainLoop:Accounts":49,"Settings:RainLoop:ChangePassword":50,"Settings:RainLoop:Contacts":51,"Settings:RainLoop:Filters":52,"Settings:RainLoop:Folders":53,"Settings:RainLoop:General":54,"Settings:RainLoop:Identities":55,"Settings:RainLoop:Identity":56,"Settings:RainLoop:OpenPGP":57,"Settings:RainLoop:Security":58,"Settings:RainLoop:Social":59,"Settings:RainLoop:Themes":60,"Storage:LocalStorage":65,"Storage:RainLoop:Cache":63,"Storage:RainLoop:Data":64,"Storage:RainLoop:Remote":68,"Storage:Settings":69,Utils:14,"View:Popup:Ask":80,"View:Popup:Compose":82,"View:Popup:FolderSystem":87,_:25,moment:23,window:26}],4:[function(e,t){!function(e,t){"use strict";e.exports=function(e){var i=t("window"),s=t("_"),o=t("$"),n=t("Globals"),a=t("Plugins"),r=t("Utils"),l=t("Enums"),c=t("Model:Email");n.__APP=e,e.setupSettings(),a.__boot=e,a.__remote=e.remote(),a.__data=e.data(),n.$html.addClass(n.bMobileDevice?"mobile":"no-mobile"),n.$win.keydown(r.killCtrlAandS).keyup(r.killCtrlAandS),n.$win.unload(function(){n.bUnload=!0}),n.$html.on("click.dropdown.data-api",function(){r.detectDropdownVisibility()}),i.rl=i.rl||{},i.rl.addHook=a.addHook,i.rl.settingsGet=a.mainSettingsGet,i.rl.remoteRequest=a.remoteRequest,i.rl.pluginSettingsGet=a.settingsGet,i.rl.createCommand=r.createCommand,i.rl.EmailModel=c,i.rl.Enums=l,i.__APP_BOOT=function(t){o(function(){i.rainloopTEMPLATES&&i.rainloopTEMPLATES[0]?(o("#rl-templates").html(i.rainloopTEMPLATES[0]),s.delay(function(){e.bootstart(),n.$html.removeClass("no-js rl-booted-trigger").addClass("rl-booted")},10)):t(!1),i.__APP_BOOT=null})}}}(t,e)},{$:20,Enums:7,Globals:9,"Model:Email":37,Plugins:12,Utils:14,_:25,window:26}],5:[function(e,t){!function(e){"use strict";var t={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",urlsafe_encode:function(e){return t.encode(e).replace(/[+]/g,"-").replace(/[\/]/g,"_").replace(/[=]/g,".")},encode:function(e){var i,s,o,n,a,r,l,c="",u=0;for(e=t._utf8_encode(e);u>2,a=(3&i)<<4|s>>4,r=(15&s)<<2|o>>6,l=63&o,isNaN(s)?r=l=64:isNaN(o)&&(l=64),c=c+this._keyStr.charAt(n)+this._keyStr.charAt(a)+this._keyStr.charAt(r)+this._keyStr.charAt(l);return c},decode:function(e){var i,s,o,n,a,r,l,c="",u=0;for(e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");u>4,s=(15&a)<<4|r>>2,o=(3&r)<<6|l,c+=String.fromCharCode(i),64!==r&&(c+=String.fromCharCode(s)),64!==l&&(c+=String.fromCharCode(o));return t._utf8_decode(c)},_utf8_encode:function(e){e=e.replace(/\r\n/g,"\n");for(var t="",i=0,s=e.length,o=0;s>i;i++)o=e.charCodeAt(i),128>o?t+=String.fromCharCode(o):o>127&&2048>o?(t+=String.fromCharCode(o>>6|192),t+=String.fromCharCode(63&o|128)):(t+=String.fromCharCode(o>>12|224),t+=String.fromCharCode(o>>6&63|128),t+=String.fromCharCode(63&o|128));return t},_utf8_decode:function(e){for(var t="",i=0,s=0,o=0,n=0;is?(t+=String.fromCharCode(s),i++):s>191&&224>s?(o=e.charCodeAt(i+1),t+=String.fromCharCode((31&s)<<6|63&o),i+=2):(o=e.charCodeAt(i+1),n=e.charCodeAt(i+2),t+=String.fromCharCode((15&s)<<12|(63&o)<<6|63&n),i+=3);return t}};e.exports=t}(t,e)},{}],6:[function(e,t){!function(e){"use strict";var t={};t.Values={},t.DataImages={},t.Defaults={},t.Defaults.MessagesPerPage=20,t.Defaults.ContactsPerPage=50,t.Defaults.MessagesPerPageArray=[10,20,30,50,100],t.Defaults.DefaultAjaxTimeout=3e4,t.Defaults.SearchAjaxTimeout=3e5,t.Defaults.SendMessageAjaxTimeout=3e5,t.Defaults.SaveMessageAjaxTimeout=2e5,t.Defaults.ContactsSyncAjaxTimeout=2e5,t.Values.UnuseOptionValue="__UNUSE__",t.Values.ClientSideCookieIndexName="rlcsc",t.Values.ImapDefaulPort=143,t.Values.ImapDefaulSecurePort=993,t.Values.SmtpDefaulPort=25,t.Values.SmtpDefaulSecurePort=465,t.Values.MessageBodyCacheLimit=15,t.Values.AjaxErrorLimit=7,t.Values.TokenErrorLimit=10,t.DataImages.UserDotPic="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQIW2P8DwQACgAD/il4QJ8AAAAASUVORK5CYII=",t.DataImages.TranspPic="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQIW2NkAAIAAAoAAggA9GkAAAAASUVORK5CYII=",e.exports=t}(t,e)},{}],7:[function(e,t){!function(e){"use strict";var t={};t.StorageResultType={Success:"success",Abort:"abort",Error:"error",Unload:"unload"},t.State={Empty:10,Login:20,Auth:30},t.StateType={Webmail:0,Admin:1},t.Capa={Prem:"PREM",TwoFactor:"TWO_FACTOR",OpenPGP:"OPEN_PGP",Prefetch:"PREFETCH",Gravatar:"GRAVATAR",Themes:"THEMES",Filters:"FILTERS",AdditionalAccounts:"ADDITIONAL_ACCOUNTS",AdditionalIdentities:"ADDITIONAL_IDENTITIES"},t.KeyState={All:"all",None:"none",ContactList:"contact-list",MessageList:"message-list",FolderList:"folder-list",MessageView:"message-view",Compose:"compose",Settings:"settings",Menu:"menu",PopupComposeOpenPGP:"compose-open-pgp",PopupKeyboardShortcutsHelp:"popup-keyboard-shortcuts-help",PopupAsk:"popup-ask"},t.FolderType={Inbox:10,SentItems:11,Draft:12,Trash:13,Spam:14,Archive:15,NotSpam:80,User:99},t.LoginSignMeTypeAsString={DefaultOff:"defaultoff",DefaultOn:"defaulton",Unused:"unused"},t.LoginSignMeType={DefaultOff:0,DefaultOn:1,Unused:2},t.ComposeType={Empty:"empty",Reply:"reply",ReplyAll:"replyall",Forward:"forward",ForwardAsAttachment:"forward-as-attachment",Draft:"draft",EditAsNew:"editasnew"},t.UploadErrorCode={Normal:0,FileIsTooBig:1,FilePartiallyUploaded:2,FileNoUploaded:3,MissingTempFolder:4,FileOnSaveingError:5,FileType:98,Unknown:99},t.SetSystemFoldersNotification={None:0,Sent:1,Draft:2,Spam:3,Trash:4,Archive:5},t.ClientSideKeyName={FoldersLashHash:0,MessagesInboxLastHash:1,MailBoxListSize:2,ExpandedFolders:3,FolderListSize:4},t.EventKeyCode={Backspace:8,Tab:9,Enter:13,Esc:27,PageUp:33,PageDown:34,Left:37,Right:39,Up:38,Down:40,End:35,Home:36,Space:32,Insert:45,Delete:46,A:65,S:83},t.MessageSetAction={SetSeen:0,UnsetSeen:1,SetFlag:2,UnsetFlag:3},t.MessageSelectAction={All:0,None:1,Invert:2,Unseen:3,Seen:4,Flagged:5,Unflagged:6},t.DesktopNotifications={Allowed:0,NotAllowed:1,Denied:2,NotSupported:9},t.MessagePriority={Low:5,Normal:3,High:1},t.EditorDefaultType={Html:"Html",Plain:"Plain"},t.CustomThemeType={Light:"Light",Dark:"Dark"},t.ServerSecure={None:0,SSL:1,TLS:2},t.SearchDateType={All:-1,Days3:3,Days7:7,Month:30},t.EmailType={Defailt:0,Facebook:1,Google:2},t.SaveSettingsStep={Animate:-2,Idle:-1,TrueResult:1,FalseResult:0},t.InterfaceAnimation={None:"None",Normal:"Normal",Full:"Full"},t.Layout={NoPreview:0,SidePreview:1,BottomPreview:2},t.FilterConditionField={From:"From",To:"To",Recipient:"Recipient",Subject:"Subject"},t.FilterConditionType={Contains:"Contains",NotContains:"NotContains",EqualTo:"EqualTo",NotEqualTo:"NotEqualTo"},t.FiltersAction={None:"None",Move:"Move",Discard:"Discard",Forward:"Forward"},t.FilterRulesType={And:"And",Or:"Or"},t.SignedVerifyStatus={UnknownPublicKeys:-4,UnknownPrivateKey:-3,Unverified:-2,Error:-1,None:0,Success:1},t.ContactPropertyType={Unknown:0,FullName:10,FirstName:15,LastName:16,MiddleName:16,Nick:18,NamePrefix:20,NameSuffix:21,Email:30,Phone:31,Web:32,Birthday:40,Facebook:90,Skype:91,GitHub:92,Note:110,Custom:250},t.Notification={InvalidToken:101,AuthError:102,AccessError:103,ConnectionError:104,CaptchaError:105,SocialFacebookLoginAccessDisable:106,SocialTwitterLoginAccessDisable:107,SocialGoogleLoginAccessDisable:108,DomainNotAllowed:109,AccountNotAllowed:110,AccountTwoFactorAuthRequired:120,AccountTwoFactorAuthError:121,CouldNotSaveNewPassword:130,CurrentPasswordIncorrect:131,NewPasswordShort:132,NewPasswordWeak:133,NewPasswordForbidden:134,ContactsSyncError:140,CantGetMessageList:201,CantGetMessage:202,CantDeleteMessage:203,CantMoveMessage:204,CantCopyMessage:205,CantSaveMessage:301,CantSendMessage:302,InvalidRecipients:303,CantCreateFolder:400,CantRenameFolder:401,CantDeleteFolder:402,CantSubscribeFolder:403,CantUnsubscribeFolder:404,CantDeleteNonEmptyFolder:405,CantSaveSettings:501,CantSavePluginSettings:502,DomainAlreadyExists:601,CantInstallPackage:701,CantDeletePackage:702,InvalidPluginPackage:703,UnsupportedPluginPackage:704,LicensingServerIsUnavailable:710,LicensingExpired:711,LicensingBanned:712,DemoSendMessageError:750,AccountAlreadyExists:801,MailServerError:901,ClientViewError:902,InvalidInputArgument:903,UnknownNotification:999,UnknownError:999},e.exports=t -}(t,e)},{}],8:[function(e,t){!function(e,t){"use strict";function i(){this.oSubs={}}var s=t("_"),o=t("Utils"),n=t("Plugins");i.prototype.oSubs={},i.prototype.sub=function(e,t,i){return o.isUnd(this.oSubs[e])&&(this.oSubs[e]=[]),this.oSubs[e].push([t,i]),this},i.prototype.pub=function(e,t){return n.runHook("rl-pub",[e,t]),o.isUnd(this.oSubs[e])||s.each(this.oSubs[e],function(e){e[0]&&e[0].apply(e[1]||null,t||[])}),this},e.exports=new i}(t,e)},{Plugins:12,Utils:14,_:25}],9:[function(e,t){!function(e,t){"use strict";var i={},s=t("window"),o=t("$"),n=t("ko"),a=t("key"),r=t("Enums");i.$win=o(s),i.$doc=o(s.document),i.$html=o("html"),i.$div=o("
    "),i.now=(new s.Date).getTime(),i.momentTrigger=n.observable(!0),i.dropdownVisibility=n.observable(!1).extend({rateLimit:0}),i.tooltipTrigger=n.observable(!1).extend({rateLimit:0}),i.langChangeTrigger=n.observable(!0),i.useKeyboardShortcuts=n.observable(!0),i.iAjaxErrorCount=0,i.iTokenErrorCount=0,i.iMessageBodyCacheCount=0,i.bUnload=!1,i.sUserAgent=(s.navigator.userAgent||"").toLowerCase(),i.bIsiOSDevice=-1'+this.editor.getData()+"":this.editor.getData():""},i.prototype.modeToggle=function(e){this.editor&&(e?"plain"===this.editor.mode&&this.editor.setMode("wysiwyg"):"wysiwyg"===this.editor.mode&&this.editor.setMode("plain"),this.resize())},i.prototype.setHtml=function(e,t){this.editor&&(this.modeToggle(!0),this.editor.setData(e),t&&this.focus())},i.prototype.setPlain=function(e,t){if(this.editor){if(this.modeToggle(!1),"plain"===this.editor.mode&&this.editor.plugins.plain&&this.editor.__plain)return this.editor.__plain.setRawData(e);this.editor.setData(e),t&&this.focus()}},i.prototype.init=function(){if(this.$element&&this.$element[0]){var e=this,t=function(){var t=n.oHtmlEditorDefaultConfig,i=a.settingsGet("Language"),o=!!a.settingsGet("AllowHtmlEditorSourceButton");o&&t.toolbarGroups&&!t.toolbarGroups.__SourceInited&&(t.toolbarGroups.__SourceInited=!0,t.toolbarGroups.push({name:"document",groups:["mode","document","doctools"]})),t.enterMode=s.CKEDITOR.ENTER_BR,t.shiftEnterMode=s.CKEDITOR.ENTER_BR,t.language=n.oHtmlEditorLangsMap[i]||"en",s.CKEDITOR.env&&(s.CKEDITOR.env.isCompatible=!0),e.editor=s.CKEDITOR.appendTo(e.$element[0],t),e.editor.on("key",function(e){return e&&e.data&&9===e.data.keyCode?!1:void 0}),e.editor.on("blur",function(){e.blurTrigger()}),e.editor.on("mode",function(){e.blurTrigger(),e.fOnModeChange&&e.fOnModeChange("plain"!==e.editor.mode)}),e.editor.on("focus",function(){e.focusTrigger()}),e.fOnReady&&e.editor.on("instanceReady",function(){e.editor.setKeystroke(s.CKEDITOR.CTRL+65,"selectAll"),e.fOnReady(),e.__resizable=!0,e.resize()})};s.CKEDITOR?t():s.__initEditor=t}},i.prototype.focus=function(){this.editor&&this.editor.focus()},i.prototype.blur=function(){this.editor&&this.editor.focusManager.blur(!0)},i.prototype.resize=function(){if(this.editor&&this.__resizable)try{this.editor.resize(this.$element.width(),this.$element.innerHeight())}catch(e){}},i.prototype.clear=function(e){this.setHtml("",e)},e.exports=i}(t,e)},{Globals:9,"Storage:Settings":69,_:25,window:26}],11:[function(e,t){!function(e,t){"use strict";function i(){var e=t("Storage:Settings");this.sBase="#/",this.sServer="./?",this.sVersion=e.settingsGet("Version"),this.sSpecSuffix=e.settingsGet("AuthAccountHash")||"0",this.sStaticPrefix=e.settingsGet("StaticPrefix")||"rainloop/v/"+this.sVersion+"/static/"}var s=t("window"),o=t("Utils");i.prototype.root=function(){return this.sBase},i.prototype.attachmentDownload=function(e){return this.sServer+"/Raw/"+this.sSpecSuffix+"/Download/"+e},i.prototype.attachmentPreview=function(e){return this.sServer+"/Raw/"+this.sSpecSuffix+"/View/"+e},i.prototype.attachmentPreviewAsPlain=function(e){return this.sServer+"/Raw/"+this.sSpecSuffix+"/ViewAsPlain/"+e},i.prototype.upload=function(){return this.sServer+"/Upload/"+this.sSpecSuffix+"/"},i.prototype.uploadContacts=function(){return this.sServer+"/UploadContacts/"+this.sSpecSuffix+"/"},i.prototype.uploadBackground=function(){return this.sServer+"/UploadBackground/"+this.sSpecSuffix+"/"},i.prototype.append=function(){return this.sServer+"/Append/"+this.sSpecSuffix+"/"},i.prototype.change=function(e){return this.sServer+"/Change/"+this.sSpecSuffix+"/"+s.encodeURIComponent(e)+"/"},i.prototype.ajax=function(e){return this.sServer+"/Ajax/"+this.sSpecSuffix+"/"+e},i.prototype.messageViewLink=function(e){return this.sServer+"/Raw/"+this.sSpecSuffix+"/ViewAsPlain/"+e},i.prototype.messageDownloadLink=function(e){return this.sServer+"/Raw/"+this.sSpecSuffix+"/Download/"+e},i.prototype.avatarLink=function(e){return this.sServer+"/Raw/0/Avatar/"+s.encodeURIComponent(e)+"/"},i.prototype.inbox=function(){return this.sBase+"mailbox/Inbox"},i.prototype.messagePreview=function(){return this.sBase+"mailbox/message-preview"},i.prototype.settings=function(e){var t=this.sBase+"settings";return o.isUnd(e)||""===e||(t+="/"+e),t},i.prototype.about=function(){return this.sBase+"about"},i.prototype.admin=function(e){var t=this.sBase;switch(e){case"AdminDomains":t+="domains";break;case"AdminSecurity":t+="security";break;case"AdminLicensing":t+="licensing"}return t},i.prototype.mailBox=function(e,t,i){t=o.isNormal(t)?o.pInt(t):1,i=o.pString(i);var s=this.sBase+"mailbox/";return""!==e&&(s+=encodeURI(e)),t>1&&(s=s.replace(/[\/]+$/,""),s+="/p"+t),""!==i&&(s=s.replace(/[\/]+$/,""),s+="/"+encodeURI(i)),s},i.prototype.phpInfo=function(){return this.sServer+"Info"},i.prototype.langLink=function(e){return this.sServer+"/Lang/0/"+encodeURI(e)+"/"+this.sVersion+"/"},i.prototype.exportContactsVcf=function(){return this.sServer+"/Raw/"+this.sSpecSuffix+"/ContactsVcf/"},i.prototype.exportContactsCsv=function(){return this.sServer+"/Raw/"+this.sSpecSuffix+"/ContactsCsv/"},i.prototype.emptyContactPic=function(){return this.sStaticPrefix+"css/images/empty-contact.png"},i.prototype.sound=function(e){return this.sStaticPrefix+"sounds/"+e},i.prototype.themePreviewLink=function(e){var t="rainloop/v/"+this.sVersion+"/";return"@custom"===e.substr(-7)&&(e=o.trim(e.substring(0,e.length-7)),t=""),t+"themes/"+encodeURI(e)+"/images/preview.png"},i.prototype.notificationMailIcon=function(){return this.sStaticPrefix+"css/images/icom-message-notification.png"},i.prototype.openPgpJs=function(){return this.sStaticPrefix+"js/openpgp.min.js"},i.prototype.socialGoogle=function(){return this.sServer+"SocialGoogle"+(""!==this.sSpecSuffix?"/"+this.sSpecSuffix+"/":"")},i.prototype.socialTwitter=function(){return this.sServer+"SocialTwitter"+(""!==this.sSpecSuffix?"/"+this.sSpecSuffix+"/":"")},i.prototype.socialFacebook=function(){return this.sServer+"SocialFacebook"+(""!==this.sSpecSuffix?"/"+this.sSpecSuffix+"/":"")},e.exports=new i}(t,e)},{"Storage:Settings":69,Utils:14,window:26}],12:[function(e,t){!function(e,t){"use strict";var i={__boot:null,__remote:null,__data:null},s=t("_"),o=t("Utils"),n=t("Storage:Settings");i.oViewModelsHooks={},i.oSimpleHooks={},i.regViewModelHook=function(e,t){t&&(t.__hookName=e)},i.addHook=function(e,t){o.isFunc(t)&&(o.isArray(i.oSimpleHooks[e])||(i.oSimpleHooks[e]=[]),i.oSimpleHooks[e].push(t))},i.runHook=function(e,t){o.isArray(i.oSimpleHooks[e])&&(t=t||[],s.each(i.oSimpleHooks[e],function(e){e.apply(null,t)}))},i.mainSettingsGet=function(e){return n.settingsGet(e)},i.remoteRequest=function(e,t,s,o,n,a){i.__remote&&i.__remote.defaultRequest(e,t,s,o,n,a)},i.settingsGet=function(e,t){var i=n.settingsGet("Plugins");return i=i&&!o.isUnd(i[e])?i[e]:null,i?o.isUnd(i[t])?null:i[t]:null},e.exports=i}(t,e)},{"Storage:Settings":69,Utils:14,_:25}],13:[function(e,t){!function(e,t){"use strict";function i(e,t,i,s,a,r){this.list=e,this.listChecked=n.computed(function(){return o.filter(this.list(),function(e){return e.checked()})},this).extend({rateLimit:0}),this.isListChecked=n.computed(function(){return 00&&-10)return o.newSelectPosition(i,a.shift),!1}})}},i.prototype.autoSelect=function(e){this.bAutoSelect=!!e},i.prototype.getItemUid=function(e){var t="",i=this.oCallbacks.onItemGetUid||null;return i&&e&&(t=i(e)),t.toString()},i.prototype.newSelectPosition=function(e,t,i){var s=0,n=10,a=!1,l=!1,c=null,u=this.list(),d=u?u.length:0,p=this.focusedItem();if(d>0)if(p){if(p)if(r.EventKeyCode.Down===e||r.EventKeyCode.Up===e||r.EventKeyCode.Insert===e||r.EventKeyCode.Space===e)o.each(u,function(t){if(!l)switch(e){case r.EventKeyCode.Up:p===t?l=!0:c=t;break;case r.EventKeyCode.Down:case r.EventKeyCode.Insert:a?(c=t,l=!0):p===t&&(a=!0)}});else if(r.EventKeyCode.Home===e||r.EventKeyCode.End===e)r.EventKeyCode.Home===e?c=u[0]:r.EventKeyCode.End===e&&(c=u[u.length-1]);else if(r.EventKeyCode.PageDown===e){for(;d>s;s++)if(p===u[s]){s+=n,s=s>d-1?d-1:s,c=u[s];break}}else if(r.EventKeyCode.PageUp===e)for(s=d;s>=0;s--)if(p===u[s]){s-=n,s=0>s?0:s,c=u[s];break}}else r.EventKeyCode.Down===e||r.EventKeyCode.Insert===e||r.EventKeyCode.Space===e||r.EventKeyCode.Home===e||r.EventKeyCode.PageUp===e?c=u[0]:(r.EventKeyCode.Up===e||r.EventKeyCode.End===e||r.EventKeyCode.PageDown===e)&&(c=u[u.length-1]);c?(this.focusedItem(c),p&&(t?(r.EventKeyCode.Up===e||r.EventKeyCode.Down===e)&&p.checked(!p.checked()):(r.EventKeyCode.Insert===e||r.EventKeyCode.Space===e)&&p.checked(!p.checked())),!this.bAutoSelect&&!i||this.isListChecked()||r.EventKeyCode.Space===e||this.selectedItem(c),this.scrollToFocused()):p&&(!t||r.EventKeyCode.Up!==e&&r.EventKeyCode.Down!==e?(r.EventKeyCode.Insert===e||r.EventKeyCode.Space===e)&&p.checked(!p.checked()):p.checked(!p.checked()),this.focusedItem(p))},i.prototype.scrollToFocused=function(){if(!this.oContentVisible||!this.oContentScrollable)return!1;var e=20,t=s(this.sItemFocusedSelector,this.oContentScrollable),i=t.position(),o=this.oContentVisible.height(),n=t.outerHeight();return i&&(i.top<0||i.top+n>o)?(this.oContentScrollable.scrollTop(i.top<0?this.oContentScrollable.scrollTop()+i.top-e:this.oContentScrollable.scrollTop()+i.top-o+n+e),!0):!1},i.prototype.scrollToTop=function(e){return this.oContentVisible&&this.oContentScrollable?(e?this.oContentScrollable.scrollTop(0):this.oContentScrollable.stop().animate({scrollTop:0},200),!0):!1},i.prototype.eventClickFunction=function(e,t){var i=this.getItemUid(e),s=0,o=0,n=null,a="",r=!1,l=!1,c=[],u=!1;if(t&&t.shiftKey&&""!==i&&""!==this.sLastUid&&i!==this.sLastUid)for(c=this.list(),u=e.checked(),s=0,o=c.length;o>s;s++)n=c[s],a=this.getItemUid(n),r=!1,(a===this.sLastUid||a===i)&&(r=!0),r&&(l=!l),(l||r)&&n.checked(u);this.sLastUid=""===i?"":i},i.prototype.actionClick=function(e,t){if(e){var i=!0,s=this.getItemUid(e);t&&(!t.shiftKey||t.ctrlKey||t.altKey?!t.ctrlKey||t.shiftKey||t.altKey||(i=!1,this.focusedItem(e),this.selectedItem()&&e!==this.selectedItem()&&this.selectedItem().checked(!0),e.checked(!e.checked())):(i=!1,""===this.sLastUid&&(this.sLastUid=s),e.checked(!e.checked()),this.eventClickFunction(e,t),this.focusedItem(e))),i&&(this.focusedItem(e),this.selectedItem(e),this.scrollToFocused())}},i.prototype.on=function(e,t){this.oCallbacks[e]=t},e.exports=i}(t,e)},{$:20,Enums:7,Utils:14,_:25,key:21,ko:22}],14:[function(e,t){!function(e,t){"use strict";var i={},s=t("$"),o=t("_"),n=t("ko"),a=t("window"),r=t("Enums"),l=t("Consts"),c=t("Globals");i.trim=s.trim,i.inArray=s.inArray,i.isArray=o.isArray,i.isFunc=o.isFunction,i.isUnd=o.isUndefined,i.isNull=o.isNull,i.emptyFunction=function(){},i.isNormal=function(e){return!i.isUnd(e)&&!i.isNull(e)},i.windowResize=o.debounce(function(e){i.isUnd(e)?c.$win.resize():a.setTimeout(function(){c.$win.resize()},e)},50),i.isPosNumeric=function(e,t){return i.isNormal(e)?(i.isUnd(t)?0:!t)?/^[1-9]+[0-9]*$/.test(e.toString()):/^[0-9]*$/.test(e.toString()):!1},i.pInt=function(e,t){var s=i.isNormal(e)&&""!==e?a.parseInt(e,10):t||0;return a.isNaN(s)?t||0:s},i.pString=function(e){return i.isNormal(e)?""+e:""},i.isNonEmptyArray=function(e){return i.isArray(e)&&0o;o++)s=i[o].split("="),t[a.decodeURIComponent(s[0])]=a.decodeURIComponent(s[1]);return t},i.rsaEncode=function(e,t,s,o){if(a.crypto&&a.crypto.getRandomValues&&a.RSAKey&&t&&s&&o){var n=new a.RSAKey;if(n.setPublic(o,s),e=n.encrypt(i.fakeMd5()+":"+e+":"+i.fakeMd5()),!1!==e)return"rsa:"+t+":"+e}return!1},i.rsaEncode.supported=!!(a.crypto&&a.crypto.getRandomValues&&a.RSAKey),i.exportPath=function(e,t,s){for(var o=null,n=e.split("."),r=s||a;n.length&&(o=n.shift());)n.length||i.isUnd(t)?r=r[o]?r[o]:r[o]={}:r[o]=t},i.pImport=function(e,t,i){e[t]=i},i.pExport=function(e,t,s){return i.isUnd(e[t])?s:e[t]},i.encodeHtml=function(e){return i.isNormal(e)?e.toString().replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'"):""},i.splitPlainText=function(e,t){var s="",o="",n=e,a=0,r=0;for(t=i.isUnd(t)?100:t;n.length>t;)o=n.substring(0,t),a=o.lastIndexOf(" "),r=o.lastIndexOf("\n"),-1!==r&&(a=r),-1===a&&(a=t),s+=o.substring(0,a)+"\n",n=n.substring(a+1);return s+n},i.timeOutAction=function(){var e={};return function(t,s,o){i.isUnd(e[t])&&(e[t]=0),a.clearTimeout(e[t]),e[t]=a.setTimeout(s,o)}}(),i.timeOutActionSecond=function(){var e={};return function(t,i,s){e[t]||(e[t]=a.setTimeout(function(){i(),e[t]=0},s))}}(),i.audio=function(){var e=!1;return function(t,i){if(!1===e)if(c.bIsiOSDevice)e=null;else{var s=!1,o=!1,n=a.Audio?new a.Audio:null;n&&n.canPlayType&&n.play?(s=""!==n.canPlayType('audio/mpeg; codecs="mp3"'),s||(o=""!==n.canPlayType('audio/ogg; codecs="vorbis"')),s||o?(e=n,e.preload="none",e.loop=!1,e.autoplay=!1,e.muted=!1,e.src=s?t:i):e=null):e=null}return e}}(),i.hos=function(e,t){return e&&a.Object&&a.Object.hasOwnProperty?a.Object.hasOwnProperty.call(e,t):!1},i.i18n=function(e,t,s){var o="",n=i.isUnd(c.oI18N[e])?i.isUnd(s)?e:s:c.oI18N[e];if(!i.isUnd(t)&&!i.isNull(t))for(o in t)i.hos(t,o)&&(n=n.replace("%"+o+"%",t[o]));return n},i.i18nToNode=function(e){o.defer(function(){s(".i18n",e).each(function(){var e=s(this),t="";t=e.data("i18n-text"),t?e.text(i.i18n(t)):(t=e.data("i18n-html"),t&&e.html(i.i18n(t)),t=e.data("i18n-placeholder"),t&&e.attr("placeholder",i.i18n(t)),t=e.data("i18n-title"),t&&e.attr("title",i.i18n(t)))})})},i.i18nReload=function(){a.rainloopI18N&&(c.oI18N=a.rainloopI18N||{},i.i18nToNode(c.$doc),c.langChangeTrigger(!c.langChangeTrigger())),a.rainloopI18N=null},i.initOnStartOrLangChange=function(e,t,i){e&&e.call(t),i?c.langChangeTrigger.subscribe(function(){e&&e.call(t),i.call(t)}):e&&c.langChangeTrigger.subscribe(e,t)},i.inFocus=function(){return a.document.activeElement?(i.isUnd(a.document.activeElement.__inFocusCache)&&(a.document.activeElement.__inFocusCache=s(a.document.activeElement).is("input,textarea,iframe,.cke_editable")),!!a.document.activeElement.__inFocusCache):!1},i.removeInFocus=function(){if(a.document&&a.document.activeElement&&a.document.activeElement.blur){var e=s(a.document.activeElement);e.is("input,textarea")&&a.document.activeElement.blur()}},i.removeSelection=function(){if(a&&a.getSelection){var e=a.getSelection();e&&e.removeAllRanges&&e.removeAllRanges()}else a.document&&a.document.selection&&a.document.selection.empty&&a.document.selection.empty()},i.replySubjectAdd=function(e,t){e=i.trim(e.toUpperCase()),t=i.trim(t.replace(/[\s]+/g," "));var s=!1,n=[],a="RE"===e,r="FWD"===e,l=!r;return""!==t&&o.each(t.split(":"),function(e){var t=i.trim(e);s||!/^(RE|FWD)$/i.test(t)&&!/^(RE|FWD)[\[\(][\d]+[\]\)]$/i.test(t)?(n.push(e),s=!0):(a||(a=!!/^RE/i.test(t)),r||(r=!!/^FWD/i.test(t)))}),l?a=!1:r=!1,i.trim((l?"Re: ":"Fwd: ")+(a?"Re: ":"")+(r?"Fwd: ":"")+i.trim(n.join(":")))},i.roundNumber=function(e,t){return a.Math.round(e*a.Math.pow(10,t))/a.Math.pow(10,t)},i.friendlySize=function(e){return e=i.pInt(e),e>=1073741824?i.roundNumber(e/1073741824,1)+"GB":e>=1048576?i.roundNumber(e/1048576,1)+"MB":e>=1024?i.roundNumber(e/1024,0)+"KB":e+"B"},i.log=function(e){a.console&&a.console.log&&a.console.log(e)},i.getNotification=function(e,t){return e=i.pInt(e),r.Notification.ClientViewError===e&&t?t:i.isUnd(c.oNotificationI18N[e])?"":c.oNotificationI18N[e]},i.initNotificationLanguage=function(){var e=c.oNotificationI18N||{};e[r.Notification.InvalidToken]=i.i18n("NOTIFICATIONS/INVALID_TOKEN"),e[r.Notification.AuthError]=i.i18n("NOTIFICATIONS/AUTH_ERROR"),e[r.Notification.AccessError]=i.i18n("NOTIFICATIONS/ACCESS_ERROR"),e[r.Notification.ConnectionError]=i.i18n("NOTIFICATIONS/CONNECTION_ERROR"),e[r.Notification.CaptchaError]=i.i18n("NOTIFICATIONS/CAPTCHA_ERROR"),e[r.Notification.SocialFacebookLoginAccessDisable]=i.i18n("NOTIFICATIONS/SOCIAL_FACEBOOK_LOGIN_ACCESS_DISABLE"),e[r.Notification.SocialTwitterLoginAccessDisable]=i.i18n("NOTIFICATIONS/SOCIAL_TWITTER_LOGIN_ACCESS_DISABLE"),e[r.Notification.SocialGoogleLoginAccessDisable]=i.i18n("NOTIFICATIONS/SOCIAL_GOOGLE_LOGIN_ACCESS_DISABLE"),e[r.Notification.DomainNotAllowed]=i.i18n("NOTIFICATIONS/DOMAIN_NOT_ALLOWED"),e[r.Notification.AccountNotAllowed]=i.i18n("NOTIFICATIONS/ACCOUNT_NOT_ALLOWED"),e[r.Notification.AccountTwoFactorAuthRequired]=i.i18n("NOTIFICATIONS/ACCOUNT_TWO_FACTOR_AUTH_REQUIRED"),e[r.Notification.AccountTwoFactorAuthError]=i.i18n("NOTIFICATIONS/ACCOUNT_TWO_FACTOR_AUTH_ERROR"),e[r.Notification.CouldNotSaveNewPassword]=i.i18n("NOTIFICATIONS/COULD_NOT_SAVE_NEW_PASSWORD"),e[r.Notification.CurrentPasswordIncorrect]=i.i18n("NOTIFICATIONS/CURRENT_PASSWORD_INCORRECT"),e[r.Notification.NewPasswordShort]=i.i18n("NOTIFICATIONS/NEW_PASSWORD_SHORT"),e[r.Notification.NewPasswordWeak]=i.i18n("NOTIFICATIONS/NEW_PASSWORD_WEAK"),e[r.Notification.NewPasswordForbidden]=i.i18n("NOTIFICATIONS/NEW_PASSWORD_FORBIDDENT"),e[r.Notification.ContactsSyncError]=i.i18n("NOTIFICATIONS/CONTACTS_SYNC_ERROR"),e[r.Notification.CantGetMessageList]=i.i18n("NOTIFICATIONS/CANT_GET_MESSAGE_LIST"),e[r.Notification.CantGetMessage]=i.i18n("NOTIFICATIONS/CANT_GET_MESSAGE"),e[r.Notification.CantDeleteMessage]=i.i18n("NOTIFICATIONS/CANT_DELETE_MESSAGE"),e[r.Notification.CantMoveMessage]=i.i18n("NOTIFICATIONS/CANT_MOVE_MESSAGE"),e[r.Notification.CantCopyMessage]=i.i18n("NOTIFICATIONS/CANT_MOVE_MESSAGE"),e[r.Notification.CantSaveMessage]=i.i18n("NOTIFICATIONS/CANT_SAVE_MESSAGE"),e[r.Notification.CantSendMessage]=i.i18n("NOTIFICATIONS/CANT_SEND_MESSAGE"),e[r.Notification.InvalidRecipients]=i.i18n("NOTIFICATIONS/INVALID_RECIPIENTS"),e[r.Notification.CantCreateFolder]=i.i18n("NOTIFICATIONS/CANT_CREATE_FOLDER"),e[r.Notification.CantRenameFolder]=i.i18n("NOTIFICATIONS/CANT_RENAME_FOLDER"),e[r.Notification.CantDeleteFolder]=i.i18n("NOTIFICATIONS/CANT_DELETE_FOLDER"),e[r.Notification.CantDeleteNonEmptyFolder]=i.i18n("NOTIFICATIONS/CANT_DELETE_NON_EMPTY_FOLDER"),e[r.Notification.CantSubscribeFolder]=i.i18n("NOTIFICATIONS/CANT_SUBSCRIBE_FOLDER"),e[r.Notification.CantUnsubscribeFolder]=i.i18n("NOTIFICATIONS/CANT_UNSUBSCRIBE_FOLDER"),e[r.Notification.CantSaveSettings]=i.i18n("NOTIFICATIONS/CANT_SAVE_SETTINGS"),e[r.Notification.CantSavePluginSettings]=i.i18n("NOTIFICATIONS/CANT_SAVE_PLUGIN_SETTINGS"),e[r.Notification.DomainAlreadyExists]=i.i18n("NOTIFICATIONS/DOMAIN_ALREADY_EXISTS"),e[r.Notification.CantInstallPackage]=i.i18n("NOTIFICATIONS/CANT_INSTALL_PACKAGE"),e[r.Notification.CantDeletePackage]=i.i18n("NOTIFICATIONS/CANT_DELETE_PACKAGE"),e[r.Notification.InvalidPluginPackage]=i.i18n("NOTIFICATIONS/INVALID_PLUGIN_PACKAGE"),e[r.Notification.UnsupportedPluginPackage]=i.i18n("NOTIFICATIONS/UNSUPPORTED_PLUGIN_PACKAGE"),e[r.Notification.LicensingServerIsUnavailable]=i.i18n("NOTIFICATIONS/LICENSING_SERVER_IS_UNAVAILABLE"),e[r.Notification.LicensingExpired]=i.i18n("NOTIFICATIONS/LICENSING_EXPIRED"),e[r.Notification.LicensingBanned]=i.i18n("NOTIFICATIONS/LICENSING_BANNED"),e[r.Notification.DemoSendMessageError]=i.i18n("NOTIFICATIONS/DEMO_SEND_MESSAGE_ERROR"),e[r.Notification.AccountAlreadyExists]=i.i18n("NOTIFICATIONS/ACCOUNT_ALREADY_EXISTS"),e[r.Notification.MailServerError]=i.i18n("NOTIFICATIONS/MAIL_SERVER_ERROR"),e[r.Notification.InvalidInputArgument]=i.i18n("NOTIFICATIONS/INVALID_INPUT_ARGUMENT"),e[r.Notification.UnknownNotification]=i.i18n("NOTIFICATIONS/UNKNOWN_ERROR"),e[r.Notification.UnknownError]=i.i18n("NOTIFICATIONS/UNKNOWN_ERROR")},i.getUploadErrorDescByCode=function(e){var t="";switch(i.pInt(e)){case r.UploadErrorCode.FileIsTooBig:t=i.i18n("UPLOAD/ERROR_FILE_IS_TOO_BIG");break;case r.UploadErrorCode.FilePartiallyUploaded:t=i.i18n("UPLOAD/ERROR_FILE_PARTIALLY_UPLOADED");break;case r.UploadErrorCode.FileNoUploaded:t=i.i18n("UPLOAD/ERROR_NO_FILE_UPLOADED");break;case r.UploadErrorCode.MissingTempFolder:t=i.i18n("UPLOAD/ERROR_MISSING_TEMP_FOLDER");break;case r.UploadErrorCode.FileOnSaveingError:t=i.i18n("UPLOAD/ERROR_ON_SAVING_FILE");break;case r.UploadErrorCode.FileType:t=i.i18n("UPLOAD/ERROR_FILE_TYPE");break;default:t=i.i18n("UPLOAD/ERROR_UNKNOWN")}return t},i.delegateRun=function(e,t,s,n){e&&e[t]&&(n=i.pInt(n),0>=n?e[t].apply(e,i.isArray(s)?s:[]):o.delay(function(){e[t].apply(e,i.isArray(s)?s:[])},n))},i.killCtrlAandS=function(e){if(e=e||a.event,e&&e.ctrlKey&&!e.shiftKey&&!e.altKey){var t=e.target||e.srcElement,i=e.keyCode||e.which;if(i===r.EventKeyCode.S)return void e.preventDefault();if(t&&t.tagName&&t.tagName.match(/INPUT|TEXTAREA/i))return;i===r.EventKeyCode.A&&(a.getSelection?a.getSelection().removeAllRanges():a.document.selection&&a.document.selection.clear&&a.document.selection.clear(),e.preventDefault())}},i.createCommand=function(e,t,s){var o=t?function(){return o&&o.canExecute&&o.canExecute()&&t.apply(e,Array.prototype.slice.call(arguments)),!1}:function(){};return o.enabled=n.observable(!0),s=i.isUnd(s)?!0:s,o.canExecute=n.computed(i.isFunc(s)?function(){return o.enabled()&&s.call(e)}:function(){return o.enabled()&&!!s}),o},i.initDataConstructorBySettings=function(e){e.editorDefaultType=n.observable(r.EditorDefaultType.Html),e.showImages=n.observable(!1),e.interfaceAnimation=n.observable(r.InterfaceAnimation.Full),e.contactsAutosave=n.observable(!1),c.sAnimationType=r.InterfaceAnimation.Full,e.capaThemes=n.observable(!1),e.allowLanguagesOnSettings=n.observable(!0),e.allowLanguagesOnLogin=n.observable(!0),e.useLocalProxyForExternalImages=n.observable(!1),e.desktopNotifications=n.observable(!1),e.useThreads=n.observable(!0),e.replySameFolder=n.observable(!0),e.useCheckboxesInList=n.observable(!0),e.layout=n.observable(r.Layout.SidePreview),e.usePreviewPane=n.computed(function(){return r.Layout.NoPreview!==e.layout()}),e.interfaceAnimation.subscribe(function(e){if(c.bMobileDevice||e===r.InterfaceAnimation.None)c.$html.removeClass("rl-anim rl-anim-full").addClass("no-rl-anim"),c.sAnimationType=r.InterfaceAnimation.None;else switch(e){case r.InterfaceAnimation.Full:c.$html.removeClass("no-rl-anim").addClass("rl-anim rl-anim-full"),c.sAnimationType=e;break;case r.InterfaceAnimation.Normal:c.$html.removeClass("no-rl-anim rl-anim-full").addClass("rl-anim"),c.sAnimationType=e}}),e.interfaceAnimation.valueHasMutated(),e.desktopNotificationsPermisions=n.computed(function(){e.desktopNotifications();var t=i.notificationClass(),s=r.DesktopNotifications.NotSupported;if(t&&t.permission)switch(t.permission.toLowerCase()){case"granted":s=r.DesktopNotifications.Allowed;break;case"denied":s=r.DesktopNotifications.Denied;break;case"default":s=r.DesktopNotifications.NotAllowed}else a.webkitNotifications&&a.webkitNotifications.checkPermission&&(s=a.webkitNotifications.checkPermission());return s}),e.useDesktopNotifications=n.computed({read:function(){return e.desktopNotifications()&&r.DesktopNotifications.Allowed===e.desktopNotificationsPermisions()},write:function(t){if(t){var s=i.notificationClass(),o=e.desktopNotificationsPermisions();s&&r.DesktopNotifications.Allowed===o?e.desktopNotifications(!0):s&&r.DesktopNotifications.NotAllowed===o?s.requestPermission(function(){e.desktopNotifications.valueHasMutated(),r.DesktopNotifications.Allowed===e.desktopNotificationsPermisions()?e.desktopNotifications()?e.desktopNotifications.valueHasMutated():e.desktopNotifications(!0):e.desktopNotifications()?e.desktopNotifications(!1):e.desktopNotifications.valueHasMutated()}):e.desktopNotifications(!1)}else e.desktopNotifications(!1)}}),e.language=n.observable(""),e.languages=n.observableArray([]),e.mainLanguage=n.computed({read:e.language,write:function(t){t!==e.language()?-1=t.diff(s,"hours")?o:t.format("L")===s.format("L")?i.i18n("MESSAGE_LIST/TODAY_AT",{TIME:s.format("LT")}):t.clone().subtract("days",1).format("L")===s.format("L")?i.i18n("MESSAGE_LIST/YESTERDAY_AT",{TIME:s.format("LT")}):s.format(t.year()===s.year()?"D MMM.":"LL")},e)},i.initBlockquoteSwitcher=function(e){if(e){var t=s("blockquote:not(.rl-bq-switcher)",e).filter(function(){return 0===s(this).parent().closest("blockquote",e).length});t&&0100)&&(e.addClass("rl-bq-switcher hidden-bq"),s('').insertBefore(e).click(function(){e.toggleClass("hidden-bq"),i.windowResize()}).after("
    ").before("
    "))})}},i.removeBlockquoteSwitcher=function(e){e&&(s(e).find("blockquote.rl-bq-switcher").each(function(){s(this).removeClass("rl-bq-switcher hidden-bq")}),s(e).find(".rlBlockquoteSwitcher").each(function(){s(this).remove()}))},i.toggleMessageBlockquote=function(e){e&&e.find(".rlBlockquoteSwitcher").click()},i.convertThemeName=function(e){return"@custom"===e.substr(-7)&&(e=i.trim(e.substring(0,e.length-7))),i.trim(e.replace(/[^a-zA-Z]+/g," ").replace(/([A-Z])/g," $1").replace(/[\s]+/g," "))},i.quoteName=function(e){return e.replace(/["]/g,'\\"')},i.microtime=function(){return(new Date).getTime()},i.convertLangName=function(e,t){return i.i18n("LANGS_NAMES"+(!0===t?"_EN":"")+"/LANG_"+e.toUpperCase().replace(/[^a-zA-Z0-9]+/g,"_"),null,e)},i.fakeMd5=function(e){var t="",s="0123456789abcdefghijklmnopqrstuvwxyz";for(e=i.isUnd(e)?32:i.pInt(e);t.length>>32-t}function i(e,t){var i,s,o,n,a;return o=2147483648&e,n=2147483648&t,i=1073741824&e,s=1073741824&t,a=(1073741823&e)+(1073741823&t),i&s?2147483648^a^o^n:i|s?1073741824&a?3221225472^a^o^n:1073741824^a^o^n:a^o^n}function s(e,t,i){return e&t|~e&i}function o(e,t,i){return e&i|t&~i}function n(e,t,i){return e^t^i}function a(e,t,i){return t^(e|~i)}function r(e,o,n,a,r,l,c){return e=i(e,i(i(s(o,n,a),r),c)),i(t(e,l),o)}function l(e,s,n,a,r,l,c){return e=i(e,i(i(o(s,n,a),r),c)),i(t(e,l),s)}function c(e,s,o,a,r,l,c){return e=i(e,i(i(n(s,o,a),r),c)),i(t(e,l),s)}function u(e,s,o,n,r,l,c){return e=i(e,i(i(a(s,o,n),r),c)),i(t(e,l),s)}function d(e){for(var t,i=e.length,s=i+8,o=(s-s%64)/64,n=16*(o+1),a=Array(n-1),r=0,l=0;i>l;)t=(l-l%4)/4,r=l%4*8,a[t]=a[t]|e.charCodeAt(l)<>>29,a}function p(e){var t,i,s="",o="";for(i=0;3>=i;i++)t=e>>>8*i&255,o="0"+t.toString(16),s+=o.substr(o.length-2,2);return s}function h(e){e=e.replace(/rn/g,"n");for(var t="",i=0;is?t+=String.fromCharCode(s):s>127&&2048>s?(t+=String.fromCharCode(s>>6|192),t+=String.fromCharCode(63&s|128)):(t+=String.fromCharCode(s>>12|224),t+=String.fromCharCode(s>>6&63|128),t+=String.fromCharCode(63&s|128))}return t}var g,m,f,b,S,y,v,w,C,A=Array(),T=7,F=12,R=17,L=22,E=5,N=9,P=14,I=20,M=4,k=11,D=16,_=23,U=6,O=10,x=15,V=21;for(e=h(e),A=d(e),y=1732584193,v=4023233417,w=2562383102,C=271733878,g=0;g/g,">").replace(/")},i.draggeblePlace=function(){return s('
     
    ').appendTo("#rl-hidden")},i.defautOptionsAfterRender=function(e,t){t&&!i.isUnd(t.disabled)&&e&&s(e).toggleClass("disabled",t.disabled).prop("disabled",t.disabled)},i.windowPopupKnockout=function(e,t,o,r){var l=null,c=a.open(""),u="__OpenerApplyBindingsUid"+i.fakeMd5()+"__",d=s("#"+t);a[u]=function(){if(c&&c.document.body&&d&&d[0]){var t=s(c.document.body);s("#rl-content",t).html(d.html()),s("html",c.document).addClass("external "+s("html").attr("class")),i.i18nToNode(t),e&&s("#rl-content",t)[0]&&n.applyBindings(e,s("#rl-content",t)[0]),a[u]=null,r(c)}},c.document.open(),c.document.write(''+i.encodeHtml(o)+'
    '),c.document.close(),l=c.document.createElement("script"),l.type="text/javascript",l.innerHTML="if(window&&window.opener&&window.opener['"+u+"']){window.opener['"+u+"']();window.opener['"+u+"']=null}",c.document.getElementsByTagName("head")[0].appendChild(l)},i.settingsSaveHelperFunction=function(e,t,s,n){return s=s||null,n=i.isUnd(n)?1e3:i.pInt(n),function(i,a,l,c,u){t.call(s,a&&a.Result?r.SaveSettingsStep.TrueResult:r.SaveSettingsStep.FalseResult),e&&e.call(s,i,a,l,c,u),o.delay(function(){t.call(s,r.SaveSettingsStep.Idle)},n)}},i.settingsSaveHelperSimpleFunction=function(e,t){return i.settingsSaveHelperFunction(null,e,t,1e3)},i.htmlToPlain=function(e){var t=0,i=0,o=0,n=0,a=0,r="",l=function(e){for(var t=100,i="",s="",o=e,n=0,a=0;o.length>t;)s=o.substring(0,t),n=s.lastIndexOf(" "),a=s.lastIndexOf("\n"),-1!==a&&(n=a),-1===n&&(n=t),i+=s.substring(0,n)+"\n",o=o.substring(n+1);return i+o},u=function(e){return e=l(s.trim(e)),e="> "+e.replace(/\n/gm,"\n> "),e.replace(/(^|\n)([> ]+)/gm,function(){return arguments&&2]*>([\s\S\r\n]*)<\/div>/gim,d),e="\n"+s.trim(e)+"\n"),e}return""},p=function(){return arguments&&1"):""},h=function(){return arguments&&1/g,">"):""},g=function(){return arguments&&1]*>([\s\S\r\n]*)<\/pre>/gim,p).replace(/[\s]+/gm," ").replace(/((?:href|data)\s?=\s?)("[^"]+?"|'[^']+?')/gim,h).replace(/]*>/gim,"\n").replace(/<\/h[\d]>/gi,"\n").replace(/<\/p>/gi,"\n\n").replace(/<\/li>/gi,"\n").replace(/<\/td>/gi,"\n").replace(/<\/tr>/gi,"\n").replace(/]*>/gim,"\n_______________________________\n\n").replace(/]*>([\s\S\r\n]*)<\/div>/gim,d).replace(/]*>/gim,"\n__bq__start__\n").replace(/<\/blockquote>/gim,"\n__bq__end__\n").replace(/]*>([\s\S\r\n]*?)<\/a>/gim,g).replace(/<\/div>/gi,"\n").replace(/ /gi," ").replace(/"/gi,'"').replace(/<[^>]*>/gm,""),r=c.$div.html(r).text(),r=r.replace(/\n[ \t]+/gm,"\n").replace(/[\n]{3,}/gm,"\n\n").replace(/>/gi,">").replace(/</gi,"<").replace(/&/gi,"&"),t=0,a=100;a>0&&(a--,i=r.indexOf("__bq__start__",t),i>-1);)o=r.indexOf("__bq__start__",i+5),n=r.indexOf("__bq__end__",i+5),(-1===o||o>n)&&n>i?(r=r.substring(0,i)+u(r.substring(i+13,n))+r.substring(n+11),t=0):t=o>-1&&n>o?o-1:0;return r=r.replace(/__bq__start__/gm,"").replace(/__bq__end__/gm,"")},i.plainToHtml=function(e,t){e=e.toString().replace(/\r/g,"");var s=!1,o=!0,n=!0,a=[],r="",l=0,c=e.split("\n");do{for(o=!1,a=[],l=0;l"===r.substr(0,1),n&&!s?(o=!0,s=!0,a.push("~~~blockquote~~~"),a.push(r.substr(1))):!n&&s?(s=!1,a.push("~~~/blockquote~~~"),a.push(r)):a.push(n&&s?r.substr(1):r);s&&(s=!1,a.push("~~~/blockquote~~~")),c=a}while(o);return e=c.join("\n"),e=e.replace(/&/g,"&").replace(/>/g,">").replace(/").replace(/[\s]*~~~\/blockquote~~~/g,"").replace(/[\-_~]{10,}/g,"
    ").replace(/\n/g,"
    "),t?i.linkify(e):e},a.rainloop_Utils_htmlToPlain=i.htmlToPlain,a.rainloop_Utils_plainToHtml=i.plainToHtml,i.linkify=function(e){return s.fn&&s.fn.linkify&&(e=c.$div.html(e.replace(/&/gi,"amp_amp_12345_amp_amp")).linkify().find(".linkified").removeClass("linkified").end().html().replace(/amp_amp_12345_amp_amp/g,"&")),e},i.resizeAndCrop=function(e,t,i){var s=new a.Image;s.onload=function(){var e=[0,0],s=a.document.createElement("canvas"),o=s.getContext("2d");s.width=t,s.height=t,e=this.width>this.height?[this.width-this.height,0]:[0,this.height-this.width],o.fillStyle="#fff",o.fillRect(0,0,t,t),o.drawImage(this,e[0]/2,e[1]/2,this.width-e[0],this.height-e[1],0,0,t,t),i(s.toDataURL("image/jpeg"))},s.src=e},i.folderListOptionsBuilder=function(e,t,s,o,n,l,c,u,d,p){var h=null,g=!1,m=0,f=0,b="   ",S=[];for(d=i.isNormal(d)?d:0m;m++)S.push({id:o[m][0],name:o[m][1],system:!1,seporator:!1,disabled:!1});for(g=!0,m=0,f=e.length;f>m;m++)h=e[m],(c?c.call(null,h):!0)&&(g&&0m;m++)h=t[m],(h.subScribed()||!h.existen)&&(c?c.call(null,h):!0)&&(r.FolderType.User===h.type()||!d||01||c>0&&l>c){for(l>c?(u(c),s=c,o=c):((3>=l||l>=c-2)&&(n+=2),u(l),s=l,o=l);n>0;)if(s-=1,o+=1,s>0&&(u(s,!1),n--),c>=o)u(o,!0),n--;else if(0>=s)break;3===s?u(2,!1):s>3&&u(a.Math.round((s-1)/2),!1,"..."),c-2===o?u(c-1,!0):c-2>o&&u(a.Math.round((c+o)/2),!0,"..."),s>1&&u(1,!1),c>o&&u(c,!0)}return r}},i.selectElement=function(e){if(a.getSelection){var t=a.getSelection();t.removeAllRanges();var i=a.document.createRange();i.selectNodeContents(e),t.addRange(i)}else if(a.document.selection){var s=a.document.body.createTextRange();s.moveToElementText(e),s.select()}},i.detectDropdownVisibility=o.debounce(function(){c.dropdownVisibility(!!o.find(c.aBootstrapDropdowns,function(e){return e.hasClass("open")}))},50),i.triggerAutocompleteInputChange=function(e){var t=function(){s(".checkAutocomplete").trigger("change")};e?o.delay(t,100):t()},e.exports=i}(t,e)},{$:20,Consts:6,Enums:7,Globals:9,_:25,ko:22,window:26}],15:[function(e,t){t.exports=JSON},{}],16:[function(e,t){t.exports=Jua},{}],17:[function(e,t){t.exports=crossroads},{}],18:[function(e,t){t.exports=hasher},{}],19:[function(e,t){t.exports=ifvisible},{}],20:[function(e,t){t.exports=$},{}],21:[function(e,t){t.exports=key},{}],22:[function(e,t){!function(t,i){"use strict";var s=e("window"),o=e("_"),n=e("$");i.bindingHandlers.tooltip={init:function(t,s){var o=e("Globals"),a=e("Utils");if(!o.bMobileDevice){var r=n(t),l=r.data("tooltip-class")||"",c=r.data("tooltip-placement")||"top";r.tooltip({delay:{show:500,hide:100},html:!0,container:"body",placement:c,trigger:"hover",title:function(){return r.is(".disabled")||o.dropdownVisibility()?"":''+a.i18n(i.utils.unwrapObservable(s()))+""}}).click(function(){r.tooltip("hide")}),o.tooltipTrigger.subscribe(function(){r.tooltip("hide")})}}},i.bindingHandlers.tooltip2={init:function(t,i){var s=e("Globals"),o=n(t),a=o.data("tooltip-class")||"",r=o.data("tooltip-placement")||"top";o.tooltip({delay:{show:500,hide:100},html:!0,container:"body",placement:r,title:function(){return o.is(".disabled")||s.dropdownVisibility()?"":''+i()()+""}}).click(function(){o.tooltip("hide")}),s.tooltipTrigger.subscribe(function(){o.tooltip("hide")})}},i.bindingHandlers.tooltip3={init:function(t){var i=n(t),o=e("Globals");i.tooltip({container:"body",trigger:"hover manual",title:function(){return i.data("tooltip3-data")||""}}),n(s.document).click(function(){i.tooltip("hide")}),o.tooltipTrigger.subscribe(function(){i.tooltip("hide")})},update:function(e,t){var s=i.utils.unwrapObservable(t());""===s?n(e).data("tooltip3-data","").tooltip("hide"):n(e).data("tooltip3-data",s).tooltip("show")}},i.bindingHandlers.registrateBootstrapDropdown={init:function(t){var i=e("Globals");i.aBootstrapDropdowns.push(n(t))}},i.bindingHandlers.openDropdownTrigger={update:function(t,s){if(i.utils.unwrapObservable(s())){var o=n(t),a=e("Utils");o.hasClass("open")||(o.find(".dropdown-toggle").dropdown("toggle"),a.detectDropdownVisibility()),s()(!1)}}},i.bindingHandlers.dropdownCloser={init:function(e){n(e).closest(".dropdown").on("click",".e-item",function(){n(e).dropdown("toggle")})}},i.bindingHandlers.popover={init:function(e,t){n(e).popover(i.utils.unwrapObservable(t()))}},i.bindingHandlers.csstext={init:function(t,s){var o=e("Utils");t&&t.styleSheet&&!o.isUnd(t.styleSheet.cssText)?t.styleSheet.cssText=i.utils.unwrapObservable(s()):n(t).text(i.utils.unwrapObservable(s()))},update:function(t,s){var o=e("Utils");t&&t.styleSheet&&!o.isUnd(t.styleSheet.cssText)?t.styleSheet.cssText=i.utils.unwrapObservable(s()):n(t).text(i.utils.unwrapObservable(s()))}},i.bindingHandlers.resizecrop={init:function(e){n(e).addClass("resizecrop").resizecrop({width:"100",height:"100",wrapperCSS:{"border-radius":"10px"}})},update:function(e,t){t()(),n(e).resizecrop({width:"100",height:"100"})}},i.bindingHandlers.onEnter={init:function(e,t,i,o){n(e).on("keypress",function(i){i&&13===s.parseInt(i.keyCode,10)&&(n(e).trigger("change"),t().call(o))})}},i.bindingHandlers.onEsc={init:function(e,t,i,o){n(e).on("keypress",function(i){i&&27===s.parseInt(i.keyCode,10)&&(n(e).trigger("change"),t().call(o))})}},i.bindingHandlers.clickOnTrue={update:function(e,t){i.utils.unwrapObservable(t())&&n(e).click()}},i.bindingHandlers.modal={init:function(t,s){var o=e("Globals"),a=e("Utils");n(t).toggleClass("fade",!o.bMobileDevice).modal({keyboard:!1,show:i.utils.unwrapObservable(s())}).on("shown",function(){a.windowResize()}).find(".close").click(function(){s()(!1)})},update:function(e,t){n(e).modal(i.utils.unwrapObservable(t())?"show":"hide")}},i.bindingHandlers.i18nInit={init:function(t){var i=e("Utils");i.i18nToNode(t)}},i.bindingHandlers.i18nUpdate={update:function(t,s){var o=e("Utils");i.utils.unwrapObservable(s()),o.i18nToNode(t)}},i.bindingHandlers.link={update:function(e,t){n(e).attr("href",i.utils.unwrapObservable(t()))}},i.bindingHandlers.title={update:function(e,t){n(e).attr("title",i.utils.unwrapObservable(t()))}},i.bindingHandlers.textF={init:function(e,t){n(e).text(i.utils.unwrapObservable(t()))}},i.bindingHandlers.initDom={init:function(e,t){t()(e)}},i.bindingHandlers.initResizeTrigger={init:function(e,t){var s=i.utils.unwrapObservable(t());n(e).css({height:s[1],"min-height":s[1]})},update:function(t,s){var o=e("Utils"),a=e("Globals"),r=i.utils.unwrapObservable(s()),l=o.pInt(r[1]),c=0,u=n(t).offset().top;u>0&&(u+=o.pInt(r[2]),c=a.$win.height()-u,c>l&&(l=c),n(t).css({height:l,"min-height":l}))}},i.bindingHandlers.appendDom={update:function(e,t){n(e).hide().empty().append(i.utils.unwrapObservable(t())).show()}},i.bindingHandlers.draggable={init:function(t,o,a){var r=e("Globals"),l=e("Utils");if(!r.bMobileDevice){var c=100,u=3,d=a(),p=d&&d.droppableSelector?d.droppableSelector:"",h={distance:20,handle:".dragHandle",cursorAt:{top:22,left:3},refreshPositions:!0,scroll:!0};p&&(h.drag=function(e){n(p).each(function(){var t=null,i=null,o=n(this),a=o.offset(),r=a.top+o.height();s.clearInterval(o.data("timerScroll")),o.data("timerScroll",!1),e.pageX>=a.left&&e.pageX<=a.left+o.width()&&(e.pageY>=r-c&&e.pageY<=r&&(t=function(){o.scrollTop(o.scrollTop()+u),l.windowResize()},o.data("timerScroll",s.setInterval(t,10)),t()),e.pageY>=a.top&&e.pageY<=a.top+c&&(i=function(){o.scrollTop(o.scrollTop()-u),l.windowResize()},o.data("timerScroll",s.setInterval(i,10)),i()))})},h.stop=function(){n(p).each(function(){s.clearInterval(n(this).data("timerScroll")),n(this).data("timerScroll",!1)})}),h.helper=function(e){return o()(e&&e.target?i.dataFor(e.target):null)},n(t).draggable(h).on("mousedown",function(){l.removeInFocus()})}}},i.bindingHandlers.droppable={init:function(t,i,s){var o=e("Globals");if(!o.bMobileDevice){var a=i(),r=s(),l=r&&r.droppableOver?r.droppableOver:null,c=r&&r.droppableOut?r.droppableOut:null,u={tolerance:"pointer",hoverClass:"droppableHover"};a&&(u.drop=function(e,t){a(e,t)},l&&(u.over=function(e,t){l(e,t)}),c&&(u.out=function(e,t){c(e,t)}),n(t).droppable(u))}}},i.bindingHandlers.nano={init:function(t){var i=e("Globals");i.bDisableNanoScroll||n(t).addClass("nano").nanoScroller({iOSNativeScrolling:!1,preventPageScrolling:!0})}},i.bindingHandlers.saveTrigger={init:function(e){var t=n(e);t.data("save-trigger-type",t.is("input[type=text],input[type=email],input[type=password],select,textarea")?"input":"custom"),"custom"===t.data("save-trigger-type")?t.append('  ').addClass("settings-saved-trigger"):t.addClass("settings-saved-trigger-input")},update:function(e,t){var s=i.utils.unwrapObservable(t()),o=n(e);if("custom"===o.data("save-trigger-type"))switch(s.toString()){case"1":o.find(".animated,.error").hide().removeClass("visible").end().find(".success").show().addClass("visible");break;case"0":o.find(".animated,.success").hide().removeClass("visible").end().find(".error").show().addClass("visible");break;case"-2":o.find(".error,.success").hide().removeClass("visible").end().find(".animated").show().addClass("visible");break;default:o.find(".animated").hide().end().find(".error,.success").removeClass("visible")}else switch(s.toString()){case"1":o.addClass("success").removeClass("error");break;case"0":o.addClass("error").removeClass("success");break;case"-2":break;default:o.removeClass("error success")}}},i.bindingHandlers.emailsTags={init:function(t,i,s){var a=e("Utils"),r=e("Model:Email"),l=n(t),c=i(),u=s(),d=u.autoCompleteSource||null,p=function(e){c&&c.focusTrigger&&c.focusTrigger(e)};l.inputosaurus({parseOnBlur:!0,allowDragAndDrop:!0,focusCallback:p,inputDelimiters:[",",";"],autoCompleteSource:d,parseHook:function(e){return o.map(e,function(e){var t=a.trim(e),i=null;return""!==t?(i=new r,i.mailsoParse(t),i.clearDuplicateName(),[i.toLine(!1),i]):[t,null]})},change:o.bind(function(e){l.data("EmailsTagsValue",e.target.value),c(e.target.value)},this)})},update:function(e,t,s){var o=n(e),a=s(),r=a.emailsTagsFilter||null,l=i.utils.unwrapObservable(t());o.data("EmailsTagsValue")!==l&&(o.val(l),o.data("EmailsTagsValue",l),o.inputosaurus("refresh")),r&&i.utils.unwrapObservable(r)&&o.inputosaurus("focus")}},i.bindingHandlers.contactTags={init:function(t,i,s){var a=e("Utils"),r=e("Model:ContactTag"),l=n(t),c=i(),u=s(),d=u.autoCompleteSource||null,p=function(e){c&&c.focusTrigger&&c.focusTrigger(e)};l.inputosaurus({parseOnBlur:!0,allowDragAndDrop:!1,focusCallback:p,inputDelimiters:[",",";"],outputDelimiter:",",autoCompleteSource:d,parseHook:function(e){return o.map(e,function(e){var t=a.trim(e),i=null;return""!==t?(i=new r,i.name(t),[i.toLine(!1),i]):[t,null]})},change:o.bind(function(e){l.data("ContactTagsValue",e.target.value),c(e.target.value)},this)})},update:function(e,t,s){var o=n(e),a=s(),r=a.contactTagsFilter||null,l=i.utils.unwrapObservable(t());o.data("ContactTagsValue")!==l&&(o.val(l),o.data("ContactTagsValue",l),o.inputosaurus("refresh")),r&&i.utils.unwrapObservable(r)&&o.inputosaurus("focus")}},i.bindingHandlers.command={init:function(e,t,s,o){var a=n(e),r=t();if(!r||!r.enabled||!r.canExecute)throw new Error("You are not using command function");a.addClass("command"),i.bindingHandlers[a.is("form")?"submit":"click"].init.apply(o,arguments)},update:function(e,t){var i=!0,s=n(e),o=t();i=o.enabled(),s.toggleClass("command-not-enabled",!i),i&&(i=o.canExecute(),s.toggleClass("command-can-not-be-execute",!i)),s.toggleClass("command-disabled disable disabled",!i).toggleClass("no-disabled",!!i),(s.is("input")||s.is("button"))&&s.prop("disabled",!i)}},i.extenders.trimmer=function(t){var s=e("Utils"),o=i.computed({read:t,write:function(e){t(s.trim(e.toString()))},owner:this});return o(t()),o},i.extenders.posInterer=function(t,s){var o=e("Utils"),n=i.computed({read:t,write:function(e){var i=o.pInt(e.toString(),s);0>=i&&(i=s),i===t()&&""+i!=""+e&&t(i+1),t(i)}});return n(t()),n},i.extenders.reversible=function(e){var t=e();return e.commit=function(){t=e()},e.reverse=function(){e(t)},e.commitedValue=function(){return t},e},i.extenders.toggleSubscribe=function(e,t){return e.subscribe(t[1],t[0],"beforeChange"),e.subscribe(t[2],t[0]),e},i.extenders.falseTimeout=function(t,i){var o=e("Utils");return t.iTimeout=0,t.subscribe(function(e){e&&(s.clearTimeout(t.iTimeout),t.iTimeout=s.setTimeout(function(){t(!1),t.iTimeout=0},o.pInt(i)))}),t},i.observable.fn.validateNone=function(){return this.hasError=i.observable(!1),this},i.observable.fn.validateEmail=function(){var t=e("Utils");return this.hasError=i.observable(!1),this.subscribe(function(e){e=t.trim(e),this.hasError(""!==e&&!/^[^@\s]+@[^@\s]+$/.test(e))},this),this.valueHasMutated(),this},i.observable.fn.validateSimpleEmail=function(){var t=e("Utils");return this.hasError=i.observable(!1),this.subscribe(function(e){e=t.trim(e),this.hasError(""!==e&&!/^.+@.+$/.test(e))},this),this.valueHasMutated(),this},i.observable.fn.validateFunc=function(t){var s=e("Utils");return this.hasFuncError=i.observable(!1),s.isFunc(t)&&(this.subscribe(function(e){this.hasFuncError(!t(e))},this),this.valueHasMutated()),this},t.exports=i}(t,ko)},{$:20,Globals:9,"Model:ContactTag":36,"Model:Email":37,Utils:14,_:25,window:26}],23:[function(e,t){t.exports=moment},{}],24:[function(e,t){t.exports=ssm},{}],25:[function(e,t){t.exports=_},{}],26:[function(e,t){t.exports=window},{}],27:[function(e,t){!function(e,t){"use strict";function i(){this.oScreens={},this.sDefaultScreenName="",this.oCurrentScreen=null}var s=t("$"),o=t("_"),n=t("ko"),a=t("hasher"),r=t("crossroads"),l=t("Globals"),c=t("Plugins"),u=t("Utils"),d=t("Knoin:AbstractViewModel");i.prototype.oScreens={},i.prototype.sDefaultScreenName="",i.prototype.oCurrentScreen=null,i.prototype.hideLoading=function(){s("#rl-loading").hide()},i.prototype.constructorEnd=function(e){u.isFunc(e.__constructor_end)&&e.__constructor_end.call(e)},i.prototype.extendAsViewModel=function(e,t,i){t&&(i||(i=d),t.__name=e,c.regViewModelHook(e,t),o.extend(t.prototype,i.prototype))},i.prototype.addSettingsViewModel=function(e,t,i,s,o){e.__rlSettingsData={Label:i,Template:t,Route:s,IsDefault:!!o},l.aViewModels.settings.push(e)},i.prototype.removeSettingsViewModel=function(e){l.aViewModels["settings-removed"].push(e)},i.prototype.disableSettingsViewModel=function(e){l.aViewModels["settings-disabled"].push(e)},i.prototype.routeOff=function(){a.changed.active=!1},i.prototype.routeOn=function(){a.changed.active=!0},i.prototype.screen=function(e){return""===e||u.isUnd(this.oScreens[e])?null:this.oScreens[e]},i.prototype.buildViewModel=function(e,t){if(e&&!e.__builded){var i=this,a=new e(t),r=a.viewModelPosition(),d=s("#rl-content #rl-"+r.toLowerCase()),p=null;e.__builded=!0,e.__vm=a,a.viewModelName=e.__name,d&&1===d.length?(p=s("
    ").addClass("rl-view-model").addClass("RL-"+a.viewModelTemplate()).hide(),p.appendTo(d),a.viewModelDom=p,e.__dom=p,"Popups"===r&&(a.cancelCommand=a.closeCommand=u.createCommand(a,function(){i.hideScreenPopup(e)}),a.modalVisibility.subscribe(function(e){var t=this;e?(this.viewModelDom.show(),this.storeAndSetKeyScope(),l.popupVisibilityNames.push(this.viewModelName),a.viewModelDom.css("z-index",3e3+l.popupVisibilityNames().length+10),u.delegateRun(this,"onFocus",[],500)):(u.delegateRun(this,"onHide"),this.restoreKeyScope(),l.popupVisibilityNames.remove(this.viewModelName),a.viewModelDom.css("z-index",2e3),l.tooltipTrigger(!l.tooltipTrigger()),o.delay(function(){t.viewModelDom.hide()},300))},a)),c.runHook("view-model-pre-build",[e.__name,a,p]),n.applyBindingAccessorsToNode(p[0],{i18nInit:!0,template:function(){return{name:a.viewModelTemplate()}}},a),u.delegateRun(a,"onBuild",[p]),a&&"Popups"===r&&a.registerPopupKeyDown(),c.runHook("view-model-post-build",[e.__name,a,p])):u.log("Cannot find view model position: "+r)}return e?e.__vm:null},i.prototype.hideScreenPopup=function(e){e&&e.__vm&&e.__dom&&(e.__vm.modalVisibility(!1),c.runHook("view-model-on-hide",[e.__name,e.__vm]))},i.prototype.showScreenPopup=function(e,t){e&&(this.buildViewModel(e),e.__vm&&e.__dom&&(e.__vm.modalVisibility(!0),u.delegateRun(e.__vm,"onShow",t||[]),c.runHook("view-model-on-show",[e.__name,e.__vm,t||[]])))},i.prototype.isPopupVisible=function(e){return e&&e.__vm?e.__vm.modalVisibility():!1},i.prototype.screenOnRoute=function(e,t){var i=this,s=null,n=null;""===u.pString(e)&&(e=this.sDefaultScreenName),""!==e&&(s=this.screen(e),s||(s=this.screen(this.sDefaultScreenName),s&&(t=e+"/"+t,e=this.sDefaultScreenName)),s&&s.__started&&(s.__builded||(s.__builded=!0,u.isNonEmptyArray(s.viewModels())&&o.each(s.viewModels(),function(e){this.buildViewModel(e,s)},this),u.delegateRun(s,"onBuild")),o.defer(function(){i.oCurrentScreen&&(u.delegateRun(i.oCurrentScreen,"onHide"),u.isNonEmptyArray(i.oCurrentScreen.viewModels())&&o.each(i.oCurrentScreen.viewModels(),function(e){e.__vm&&e.__dom&&"Popups"!==e.__vm.viewModelPosition()&&(e.__dom.hide(),e.__vm.viewModelVisibility(!1),u.delegateRun(e.__vm,"onHide"))})),i.oCurrentScreen=s,i.oCurrentScreen&&(u.delegateRun(i.oCurrentScreen,"onShow"),c.runHook("screen-on-show",[i.oCurrentScreen.screenName(),i.oCurrentScreen]),u.isNonEmptyArray(i.oCurrentScreen.viewModels())&&o.each(i.oCurrentScreen.viewModels(),function(e){e.__vm&&e.__dom&&"Popups"!==e.__vm.viewModelPosition()&&(e.__dom.show(),e.__vm.viewModelVisibility(!0),u.delegateRun(e.__vm,"onShow"),u.delegateRun(e.__vm,"onFocus",[],200),c.runHook("view-model-on-show",[e.__name,e.__vm]))},i)),n=s.__cross?s.__cross():null,n&&n.parse(t)})))},i.prototype.startScreens=function(e){s("#rl-content").css({visibility:"hidden"}),o.each(e,function(e){var t=new e,i=t?t.screenName():"";t&&""!==i&&(""===this.sDefaultScreenName&&(this.sDefaultScreenName=i),this.oScreens[i]=t)},this),o.each(this.oScreens,function(e){e&&!e.__started&&e.__start&&(e.__started=!0,e.__start(),c.runHook("screen-pre-start",[e.screenName(),e]),u.delegateRun(e,"onStart"),c.runHook("screen-post-start",[e.screenName(),e]))},this);var t=r.create();t.addRoute(/^([a-zA-Z0-9\-]*)\/?(.*)$/,o.bind(this.screenOnRoute,this)),a.initialized.add(t.parse,t),a.changed.add(t.parse,t),a.init(),s("#rl-content").css({visibility:"visible"}),o.delay(function(){l.$html.removeClass("rl-started-trigger").addClass("rl-started")},50)},i.prototype.setHash=function(e,t,i){e="#"===e.substr(0,1)?e.substr(1):e,e="/"===e.substr(0,1)?e.substr(1):e,i=u.isUnd(i)?!1:!!i,(u.isUnd(t)?1:!t)?(a.changed.active=!0,a[i?"replaceHash":"setHash"](e),a.setHash(e)):(a.changed.active=!1,a[i?"replaceHash":"setHash"](e),a.changed.active=!0)},e.exports=new i}(t,e)},{$:20,Globals:9,"Knoin:AbstractViewModel":30,Plugins:12,Utils:14,_:25,crossroads:17,hasher:18,ko:22}],28:[function(e,t){!function(e){"use strict";function t(){}t.prototype.bootstart=function(){},e.exports=t}(t,e)},{}],29:[function(e,t){!function(e,t){"use strict";function i(e,t){this.sScreenName=e,this.aViewModels=o.isArray(t)?t:[]}var s=t("crossroads"),o=t("Utils");i.prototype.oCross=null,i.prototype.sScreenName="",i.prototype.aViewModels=[],i.prototype.viewModels=function(){return this.aViewModels},i.prototype.screenName=function(){return this.sScreenName},i.prototype.routes=function(){return null},i.prototype.__cross=function(){return this.oCross},i.prototype.__start=function(){var e=this.routes(),t=null,i=null;o.isNonEmptyArray(e)&&(i=_.bind(this.onRoute||o.emptyFunction,this),t=s.create(),_.each(e,function(e){t.addRoute(e[0],i).rules=e[1] -}),this.oCross=t)},e.exports=i}(t,e)},{Utils:14,crossroads:17}],30:[function(e,t){!function(e,t){"use strict";function i(e,t){this.bDisabeCloseOnEsc=!1,this.sPosition=a.pString(e),this.sTemplate=a.pString(t),this.sDefaultKeyScope=o.KeyState.None,this.sCurrentKeyScope=this.sDefaultKeyScope,this.viewModelName="",this.viewModelVisibility=s.observable(!1),this.modalVisibility=s.observable(!1).extend({rateLimit:0}),this.viewModelDom=null}var s=t("ko"),o=t("Enums"),n=t("Globals"),a=t("Utils");i.prototype.sPosition="",i.prototype.sTemplate="",i.prototype.viewModelName="",i.prototype.viewModelDom=null,i.prototype.viewModelTemplate=function(){return this.sTemplate},i.prototype.viewModelPosition=function(){return this.sPosition},i.prototype.cancelCommand=function(){},i.prototype.closeCommand=function(){},i.prototype.storeAndSetKeyScope=function(){this.sCurrentKeyScope=n.keyScope(),n.keyScope(this.sDefaultKeyScope)},i.prototype.restoreKeyScope=function(){n.keyScope(this.sCurrentKeyScope)},i.prototype.registerPopupKeyDown=function(){var e=this;n.$win.on("keydown",function(t){if(t&&e.modalVisibility&&e.modalVisibility()){if(!this.bDisabeCloseOnEsc&&o.EventKeyCode.Esc===t.keyCode)return a.delegateRun(e,"cancelCommand"),!1;if(o.EventKeyCode.Backspace===t.keyCode&&!a.inFocus())return!1}return!0})},e.exports=i}(t,e)},{Enums:7,Globals:9,Utils:14,ko:22}],31:[function(e,t){!function(e,t){"use strict";function i(e,t){this.email=e,this.deleteAccess=s.observable(!1),this.canBeDalete=s.observable(o.isUnd(t)?!0:!!t)}var s=t("ko"),o=t("Utils");i.prototype.email="",i.prototype.changeAccountLink=function(){return t("LinkBuilder").change(this.email)},e.exports=i}(t,e)},{LinkBuilder:11,Utils:14,ko:22}],32:[function(e,t){!function(e,t){"use strict";function i(){this.mimeType="",this.fileName="",this.estimatedSize=0,this.friendlySize="",this.isInline=!1,this.isLinked=!1,this.cid="",this.cidWithOutTags="",this.contentLocation="",this.download="",this.folder="",this.uid="",this.mimeIndex=""}var s=t("window"),o=t("Globals"),n=t("Utils"),a=t("LinkBuilder");i.newInstanceFromJson=function(e){var t=new i;return t.initByJson(e)?t:null},i.prototype.mimeType="",i.prototype.fileName="",i.prototype.estimatedSize=0,i.prototype.friendlySize="",i.prototype.isInline=!1,i.prototype.isLinked=!1,i.prototype.cid="",i.prototype.cidWithOutTags="",i.prototype.contentLocation="",i.prototype.download="",i.prototype.folder="",i.prototype.uid="",i.prototype.mimeIndex="",i.prototype.initByJson=function(e){var t=!1;return e&&"Object/Attachment"===e["@Object"]&&(this.mimeType=(e.MimeType||"").toLowerCase(),this.fileName=e.FileName,this.estimatedSize=n.pInt(e.EstimatedSize),this.isInline=!!e.IsInline,this.isLinked=!!e.IsLinked,this.cid=e.CID,this.contentLocation=e.ContentLocation,this.download=e.Download,this.folder=e.Folder,this.uid=e.Uid,this.mimeIndex=e.MimeIndex,this.friendlySize=n.friendlySize(this.estimatedSize),this.cidWithOutTags=this.cid.replace(/^<+/,"").replace(/>+$/,""),t=!0),t},i.prototype.isImage=function(){return-1,]+)>?,? ?/g,i=t.exec(e);i?(this.name=i[1]||"",this.email=i[2]||"",this.clearDuplicateName()):/^[^@]+@[^@]+$/.test(e)&&(this.name="",this.email=e)},i.prototype.initByJson=function(e){var t=!1;return e&&"Object/Email"===e["@Object"]&&(this.name=o.trim(e.Name),this.email=o.trim(e.Email),t=""!==this.email,this.clearDuplicateName()),t},i.prototype.toLine=function(e,t,i){var s="";return""!==this.email&&(t=o.isUnd(t)?!1:!!t,i=o.isUnd(i)?!1:!!i,e&&""!==this.name?s=t?'
    ")+'" target="_blank" tabindex="-1">'+o.encodeHtml(this.name)+"":i?o.encodeHtml(this.name):this.name:(s=this.email,""!==this.name?t?s=o.encodeHtml('"'+this.name+'" <')+'")+'" target="_blank" tabindex="-1">'+o.encodeHtml(s)+""+o.encodeHtml(">"):(s='"'+this.name+'" <'+s+">",i&&(s=o.encodeHtml(s))):t&&(s=''+o.encodeHtml(this.email)+""))),s},i.prototype.mailsoParse=function(e){if(e=o.trim(e),""===e)return!1;for(var t=function(e,t,i){e+="";var s=e.length;return 0>t&&(t+=s),s="undefined"==typeof i?s:0>i?i+s:i+t,t>=e.length||0>t||t>s?!1:e.slice(t,s)},i=function(e,t,i,s){return 0>i&&(i+=e.length),s=void 0!==s?s:e.length,0>s&&(s=s+e.length-i),e.slice(0,i)+t.substr(0,s)+t.slice(s)+e.slice(i+s)},s="",n="",a="",r=!1,l=!1,c=!1,u=null,d=0,p=0,h=0;h0&&0===s.length&&(s=t(e,0,h)),l=!0,d=h);break;case">":l&&(p=h,n=t(e,d+1,p-d-1),e=i(e,"",d,p-d+1),p=0,h=0,d=0,l=!1);break;case"(":r||l||c||(c=!0,d=h);break;case")":c&&(p=h,a=t(e,d+1,p-d-1),e=i(e,"",d,p-d+1),p=0,h=0,d=0,c=!1);break;case"\\":h++}h++}return 0===n.length&&(u=e.match(/[^@\s]+@\S+/i),u&&u[0]?n=u[0]:s=e),n.length>0&&0===s.length&&0===a.length&&(s=e.replace(n,"")),n=o.trim(n).replace(/^[<]+/,"").replace(/[>]+$/,""),s=o.trim(s).replace(/^["']+/,"").replace(/["']+$/,""),a=o.trim(a).replace(/^[(]+/,"").replace(/[)]+$/,""),s=s.replace(/\\\\(.)/g,"$1"),a=a.replace(/\\\\(.)/g,"$1"),this.name=s,this.email=n,this.clearDuplicateName(),!0},i.prototype.inputoTagLine=function(){return 00){if(n.FolderType.Draft===i)return""+e;if(t>0&&n.FolderType.Trash!==i&&n.FolderType.Archive!==i&&n.FolderType.SentItems!==i)return""+t}return""},this),this.canBeDeleted=o.computed(function(){var e=this.isSystemFolder();return!e&&0===this.subFolders().length&&"INBOX"!==this.fullNameRaw},this),this.canBeSubScribed=o.computed(function(){return!this.isSystemFolder()&&this.selectable&&"INBOX"!==this.fullNameRaw},this),this.localName=o.computed(function(){a.langChangeTrigger();var e=this.type(),t=this.name();if(this.isSystemFolder())switch(e){case n.FolderType.Inbox:t=r.i18n("FOLDER_LIST/INBOX_NAME");break;case n.FolderType.SentItems:t=r.i18n("FOLDER_LIST/SENT_NAME");break;case n.FolderType.Draft:t=r.i18n("FOLDER_LIST/DRAFTS_NAME");break;case n.FolderType.Spam:t=r.i18n("FOLDER_LIST/SPAM_NAME");break;case n.FolderType.Trash:t=r.i18n("FOLDER_LIST/TRASH_NAME");break;case n.FolderType.Archive:t=r.i18n("FOLDER_LIST/ARCHIVE_NAME")}return t},this),this.manageFolderSystemName=o.computed(function(){a.langChangeTrigger();var e="",t=this.type(),i=this.name();if(this.isSystemFolder())switch(t){case n.FolderType.Inbox:e="("+r.i18n("FOLDER_LIST/INBOX_NAME")+")";break;case n.FolderType.SentItems:e="("+r.i18n("FOLDER_LIST/SENT_NAME")+")";break;case n.FolderType.Draft:e="("+r.i18n("FOLDER_LIST/DRAFTS_NAME")+")";break;case n.FolderType.Spam:e="("+r.i18n("FOLDER_LIST/SPAM_NAME")+")";break;case n.FolderType.Trash:e="("+r.i18n("FOLDER_LIST/TRASH_NAME")+")";break;case n.FolderType.Archive:e="("+r.i18n("FOLDER_LIST/ARCHIVE_NAME")+")"}return(""!==e&&"("+i+")"===e||"(inbox)"===e.toLowerCase())&&(e=""),e},this),this.collapsed=o.computed({read:function(){return!this.hidden()&&this.collapsedPrivate()},write:function(e){this.collapsedPrivate(e)},owner:this}),this.hasUnreadMessages=o.computed(function(){return 0"},i.prototype.formattedNameForCompose=function(){var e=this.name();return""===e?this.email():e+" ("+this.email()+")"},i.prototype.formattedNameForEmail=function(){var e=this.name();return""===e?this.email():'"'+o.quoteName(e)+'" <'+this.email()+">"},e.exports=i}(t,e)},{Utils:14,ko:22}],42:[function(e,t){!function(e,t){"use strict";function i(){this.folderFullNameRaw="",this.uid="",this.hash="",this.requestHash="",this.subject=a.observable(""),this.subjectPrefix=a.observable(""),this.subjectSuffix=a.observable(""),this.size=a.observable(0),this.dateTimeStampInUTC=a.observable(0),this.priority=a.observable(l.MessagePriority.Normal),this.proxy=!1,this.fromEmailString=a.observable(""),this.fromClearEmailString=a.observable(""),this.toEmailsString=a.observable(""),this.toClearEmailsString=a.observable(""),this.senderEmailsString=a.observable(""),this.senderClearEmailsString=a.observable(""),this.emails=[],this.from=[],this.to=[],this.cc=[],this.bcc=[],this.replyTo=[],this.deliveredTo=[],this.newForAnimation=a.observable(!1),this.deleted=a.observable(!1),this.unseen=a.observable(!1),this.flagged=a.observable(!1),this.answered=a.observable(!1),this.forwarded=a.observable(!1),this.isReadReceipt=a.observable(!1),this.focused=a.observable(!1),this.selected=a.observable(!1),this.checked=a.observable(!1),this.hasAttachments=a.observable(!1),this.attachmentsMainType=a.observable(""),this.moment=a.observable(r(r.unix(0))),this.attachmentIconClass=a.computed(function(){var e="";if(this.hasAttachments())switch(e="icon-attachment",this.attachmentsMainType()){case"image":e="icon-image";break;case"archive":e="icon-file-zip";break;case"doc":e="icon-file-text"}return e},this),this.fullFormatDateValue=a.computed(function(){return i.calculateFullFromatDateValue(this.dateTimeStampInUTC())},this),this.momentDate=c.createMomentDate(this),this.momentShortDate=c.createMomentShortDate(this),this.dateTimeStampInUTC.subscribe(function(e){var t=r().unix();this.moment(r.unix(e>t?t:e))},this),this.body=null,this.plainRaw="",this.isHtml=a.observable(!1),this.hasImages=a.observable(!1),this.attachments=a.observableArray([]),this.isPgpSigned=a.observable(!1),this.isPgpEncrypted=a.observable(!1),this.pgpSignedVerifyStatus=a.observable(l.SignedVerifyStatus.None),this.pgpSignedVerifyUser=a.observable(""),this.priority=a.observable(l.MessagePriority.Normal),this.readReceipt=a.observable(""),this.aDraftInfo=[],this.sMessageId="",this.sInReplyTo="",this.sReferences="",this.parentUid=a.observable(0),this.threads=a.observableArray([]),this.threadsLen=a.observable(0),this.hasUnseenSubMessage=a.observable(!1),this.hasFlaggedSubMessage=a.observable(!1),this.lastInCollapsedThread=a.observable(!1),this.lastInCollapsedThreadLoading=a.observable(!1),this.threadsLenResult=a.computed(function(){var e=this.threadsLen();return 0===this.parentUid()&&e>0?e+1:""},this)}var s=t("window"),o=t("$"),n=t("_"),a=t("ko"),r=t("moment"),l=t("Enums"),c=t("Utils"),u=t("Globals"),d=t("LinkBuilder"),p=t("Model:Email"),h=t("Model:Attachment");i.newInstanceFromJson=function(e){var t=new i;return t.initByJson(e)?t:null},i.calculateFullFromatDateValue=function(e){return e>0?r.unix(e).format("LLL"):""},i.emailsToLine=function(e,t,i){var s=[],o=0,n=0;if(c.isNonEmptyArray(e))for(o=0,n=e.length;n>o;o++)s.push(e[o].toLine(t,i));return s.join(", ")},i.emailsToLineClear=function(e){var t=[],i=0,s=0;if(c.isNonEmptyArray(e))for(i=0,s=e.length;s>i;i++)e[i]&&e[i].email&&""!==e[i].name&&t.push(e[i].email);return t.join(", ")},i.initEmailsFromJson=function(e){var t=0,i=0,s=null,o=[];if(c.isNonEmptyArray(e))for(t=0,i=e.length;i>t;t++)s=p.newInstanceFromJson(e[t]),s&&o.push(s);return o},i.replyHelper=function(e,t,i){if(e&&0s;s++)c.isUnd(t[e[s].email])&&(t[e[s].email]=!0,i.push(e[s]))},i.prototype.clear=function(){this.folderFullNameRaw="",this.uid="",this.hash="",this.requestHash="",this.subject(""),this.subjectPrefix(""),this.subjectSuffix(""),this.size(0),this.dateTimeStampInUTC(0),this.priority(l.MessagePriority.Normal),this.proxy=!1,this.fromEmailString(""),this.fromClearEmailString(""),this.toEmailsString(""),this.toClearEmailsString(""),this.senderEmailsString(""),this.senderClearEmailsString(""),this.emails=[],this.from=[],this.to=[],this.cc=[],this.bcc=[],this.replyTo=[],this.deliveredTo=[],this.newForAnimation(!1),this.deleted(!1),this.unseen(!1),this.flagged(!1),this.answered(!1),this.forwarded(!1),this.isReadReceipt(!1),this.selected(!1),this.checked(!1),this.hasAttachments(!1),this.attachmentsMainType(""),this.body=null,this.isHtml(!1),this.hasImages(!1),this.attachments([]),this.isPgpSigned(!1),this.isPgpEncrypted(!1),this.pgpSignedVerifyStatus(l.SignedVerifyStatus.None),this.pgpSignedVerifyUser(""),this.priority(l.MessagePriority.Normal),this.readReceipt(""),this.aDraftInfo=[],this.sMessageId="",this.sInReplyTo="",this.sReferences="",this.parentUid(0),this.threads([]),this.threadsLen(0),this.hasUnseenSubMessage(!1),this.hasFlaggedSubMessage(!1),this.lastInCollapsedThread(!1),this.lastInCollapsedThreadLoading(!1)},i.prototype.computeSenderEmail=function(){var e=t("Storage:RainLoop:Data"),i=e.sentFolder(),s=e.draftFolder();this.senderEmailsString(this.folderFullNameRaw===i||this.folderFullNameRaw===s?this.toEmailsString():this.fromEmailString()),this.senderClearEmailsString(this.folderFullNameRaw===i||this.folderFullNameRaw===s?this.toClearEmailsString():this.fromClearEmailString())},i.prototype.initByJson=function(e){var t=!1;return e&&"Object/Message"===e["@Object"]&&(this.folderFullNameRaw=e.Folder,this.uid=e.Uid,this.hash=e.Hash,this.requestHash=e.RequestHash,this.proxy=!!e.ExternalProxy,this.size(c.pInt(e.Size)),this.from=i.initEmailsFromJson(e.From),this.to=i.initEmailsFromJson(e.To),this.cc=i.initEmailsFromJson(e.Cc),this.bcc=i.initEmailsFromJson(e.Bcc),this.replyTo=i.initEmailsFromJson(e.ReplyTo),this.deliveredTo=i.initEmailsFromJson(e.DeliveredTo),this.subject(e.Subject),c.isArray(e.SubjectParts)?(this.subjectPrefix(e.SubjectParts[0]),this.subjectSuffix(e.SubjectParts[1])):(this.subjectPrefix(""),this.subjectSuffix(this.subject())),this.dateTimeStampInUTC(c.pInt(e.DateTimeStampInUTC)),this.hasAttachments(!!e.HasAttachments),this.attachmentsMainType(e.AttachmentsMainType),this.fromEmailString(i.emailsToLine(this.from,!0)),this.fromClearEmailString(i.emailsToLineClear(this.from)),this.toEmailsString(i.emailsToLine(this.to,!0)),this.toClearEmailsString(i.emailsToLineClear(this.to)),this.parentUid(c.pInt(e.ParentThread)),this.threads(c.isArray(e.Threads)?e.Threads:[]),this.threadsLen(c.pInt(e.ThreadsLen)),this.initFlagsByJson(e),this.computeSenderEmail(),t=!0),t},i.prototype.initUpdateByMessageJson=function(e){var i=t("Storage:RainLoop:Data"),s=!1,o=l.MessagePriority.Normal;return e&&"Object/Message"===e["@Object"]&&(o=c.pInt(e.Priority),this.priority(-1t;t++)s=h.newInstanceFromJson(e["@Collection"][t]),s&&(""!==s.cidWithOutTags&&0+$/,""),t=n.find(i,function(t){return e===t.cidWithOutTags})),t||null},i.prototype.findAttachmentByContentLocation=function(e){var t=null,i=this.attachments();return c.isNonEmptyArray(i)&&(t=n.find(i,function(t){return e===t.contentLocation})),t||null},i.prototype.messageId=function(){return this.sMessageId},i.prototype.inReplyTo=function(){return this.sInReplyTo},i.prototype.references=function(){return this.sReferences},i.prototype.fromAsSingleEmail=function(){return c.isArray(this.from)&&this.from[0]?this.from[0].email:""},i.prototype.viewLink=function(){return d.messageViewLink(this.requestHash)},i.prototype.downloadLink=function(){return d.messageDownloadLink(this.requestHash)},i.prototype.replyEmails=function(e){var t=[],s=c.isUnd(e)?{}:e;return i.replyHelper(this.replyTo,s,t),0===t.length&&i.replyHelper(this.from,s,t),t},i.prototype.replyAllEmails=function(e){var t=[],s=[],o=c.isUnd(e)?{}:e;return i.replyHelper(this.replyTo,o,t),0===t.length&&i.replyHelper(this.from,o,t),i.replyHelper(this.to,o,t),i.replyHelper(this.cc,o,s),[t,s]},i.prototype.textBodyToString=function(){return this.body?this.body.html():""},i.prototype.attachmentsToStringLine=function(){var e=n.map(this.attachments(),function(e){return e.fileName+" ("+e.friendlySize+")"});return e&&0=0&&s&&!n&&i.attr("src",s)}),e&&s.setTimeout(function(){t.print()},100))})},i.prototype.printMessage=function(){this.viewPopupMessage(!0)},i.prototype.generateUid=function(){return this.folderFullNameRaw+"/"+this.uid},i.prototype.populateByMessageListItem=function(e){return this.folderFullNameRaw=e.folderFullNameRaw,this.uid=e.uid,this.hash=e.hash,this.requestHash=e.requestHash,this.subject(e.subject()),this.subjectPrefix(this.subjectPrefix()),this.subjectSuffix(this.subjectSuffix()),this.size(e.size()),this.dateTimeStampInUTC(e.dateTimeStampInUTC()),this.priority(e.priority()),this.proxy=e.proxy,this.fromEmailString(e.fromEmailString()),this.fromClearEmailString(e.fromClearEmailString()),this.toEmailsString(e.toEmailsString()),this.toClearEmailsString(e.toClearEmailsString()),this.emails=e.emails,this.from=e.from,this.to=e.to,this.cc=e.cc,this.bcc=e.bcc,this.replyTo=e.replyTo,this.deliveredTo=e.deliveredTo,this.unseen(e.unseen()),this.flagged(e.flagged()),this.answered(e.answered()),this.forwarded(e.forwarded()),this.isReadReceipt(e.isReadReceipt()),this.selected(e.selected()),this.checked(e.checked()),this.hasAttachments(e.hasAttachments()),this.attachmentsMainType(e.attachmentsMainType()),this.moment(e.moment()),this.body=null,this.priority(l.MessagePriority.Normal),this.aDraftInfo=[],this.sMessageId="",this.sInReplyTo="",this.sReferences="",this.parentUid(e.parentUid()),this.threads(e.threads()),this.threadsLen(e.threadsLen()),this.computeSenderEmail(),this},i.prototype.showExternalImages=function(e){if(this.body&&this.body.data("rl-has-images")){var t="";e=c.isUnd(e)?!1:e,this.hasImages(!1),this.body.data("rl-has-images",!1),t=this.proxy?"data-x-additional-src":"data-x-src",o("["+t+"]",this.body).each(function(){e&&o(this).is("img")?o(this).addClass("lazy").attr("data-original",o(this).attr(t)).removeAttr(t):o(this).attr("src",o(this).attr(t)).removeAttr(t)}),t=this.proxy?"data-x-additional-style-url":"data-x-style-url",o("["+t+"]",this.body).each(function(){var e=c.trim(o(this).attr("style"));e=""===e?"":";"===e.substr(-1)?e+" ":e+"; ",o(this).attr("style",e+o(this).attr(t)).removeAttr(t)}),e&&(o("img.lazy",this.body).addClass("lazy-inited").lazyload({threshold:400,effect:"fadeIn",skip_invisible:!1,container:o(".RL-MailMessageView .messageView .messageItem .content")[0]}),u.$win.resize()),c.windowResize(500)}},i.prototype.showInternalImages=function(e){if(this.body&&!this.body.data("rl-init-internal-images")){this.body.data("rl-init-internal-images",!0),e=c.isUnd(e)?!1:e;var t=this;o("[data-x-src-cid]",this.body).each(function(){var i=t.findAttachmentByCid(o(this).attr("data-x-src-cid"));i&&i.download&&(e&&o(this).is("img")?o(this).addClass("lazy").attr("data-original",i.linkPreview()):o(this).attr("src",i.linkPreview()))}),o("[data-x-src-location]",this.body).each(function(){var i=t.findAttachmentByContentLocation(o(this).attr("data-x-src-location"));i||(i=t.findAttachmentByCid(o(this).attr("data-x-src-location"))),i&&i.download&&(e&&o(this).is("img")?o(this).addClass("lazy").attr("data-original",i.linkPreview()):o(this).attr("src",i.linkPreview()))}),o("[data-x-style-cid]",this.body).each(function(){var e="",i="",s=t.findAttachmentByCid(o(this).attr("data-x-style-cid"));s&&s.linkPreview&&(i=o(this).attr("data-x-style-cid-name"),""!==i&&(e=c.trim(o(this).attr("style")),e=""===e?"":";"===e.substr(-1)?e+" ":e+"; ",o(this).attr("style",e+i+": url('"+s.linkPreview()+"')")))}),e&&!function(e,t){n.delay(function(){e.addClass("lazy-inited").lazyload({threshold:400,effect:"fadeIn",skip_invisible:!1,container:t})},300)}(o("img.lazy",t.body),o(".RL-MailMessageView .messageView .messageItem .content")[0]),c.windowResize(500)}},i.prototype.storeDataToDom=function(){if(this.body){this.body.data("rl-is-html",!!this.isHtml()),this.body.data("rl-has-images",!!this.hasImages()),this.body.data("rl-plain-raw",this.plainRaw);var e=t("Storage:RainLoop:Data");e.capaOpenPGP()&&(this.body.data("rl-plain-pgp-signed",!!this.isPgpSigned()),this.body.data("rl-plain-pgp-encrypted",!!this.isPgpEncrypted()),this.body.data("rl-pgp-verify-status",this.pgpSignedVerifyStatus()),this.body.data("rl-pgp-verify-user",this.pgpSignedVerifyUser()))}},i.prototype.storePgpVerifyDataToDom=function(){var e=t("Storage:RainLoop:Data");this.body&&e.capaOpenPGP()&&(this.body.data("rl-pgp-verify-status",this.pgpSignedVerifyStatus()),this.body.data("rl-pgp-verify-user",this.pgpSignedVerifyUser()))},i.prototype.fetchDataToDom=function(){if(this.body){this.isHtml(!!this.body.data("rl-is-html")),this.hasImages(!!this.body.data("rl-has-images")),this.plainRaw=c.pString(this.body.data("rl-plain-raw"));var e=t("Storage:RainLoop:Data");e.capaOpenPGP()?(this.isPgpSigned(!!this.body.data("rl-plain-pgp-signed")),this.isPgpEncrypted(!!this.body.data("rl-plain-pgp-encrypted")),this.pgpSignedVerifyStatus(this.body.data("rl-pgp-verify-status")),this.pgpSignedVerifyUser(this.body.data("rl-pgp-verify-user"))):(this.isPgpSigned(!1),this.isPgpEncrypted(!1),this.pgpSignedVerifyStatus(l.SignedVerifyStatus.None),this.pgpSignedVerifyUser(""))}},i.prototype.verifyPgpSignedClearMessage=function(){if(this.isPgpSigned()){var e=[],i=null,a=t("Storage:RainLoop:Data"),r=this.from&&this.from[0]&&this.from[0].email?this.from[0].email:"",c=a.findPublicKeysByEmail(r),d=null,p=null,h="";this.pgpSignedVerifyStatus(l.SignedVerifyStatus.Error),this.pgpSignedVerifyUser("");try{i=s.openpgp.cleartext.readArmored(this.plainRaw),i&&i.getText&&(this.pgpSignedVerifyStatus(c.length?l.SignedVerifyStatus.Unverified:l.SignedVerifyStatus.UnknownPublicKeys),e=i.verify(c),e&&0').text(h)).html(),u.$div.empty(),this.replacePlaneTextBody(h)))))}catch(g){}this.storePgpVerifyDataToDom()}},i.prototype.decryptPgpEncryptedMessage=function(e){if(this.isPgpEncrypted()){var i=[],a=null,r=null,c=t("Storage:RainLoop:Data"),d=this.from&&this.from[0]&&this.from[0].email?this.from[0].email:"",p=c.findPublicKeysByEmail(d),h=c.findSelfPrivateKey(e),g=null,m=null,f="";this.pgpSignedVerifyStatus(l.SignedVerifyStatus.Error),this.pgpSignedVerifyUser(""),h||this.pgpSignedVerifyStatus(l.SignedVerifyStatus.UnknownPrivateKey);try{a=s.openpgp.message.readArmored(this.plainRaw),a&&h&&a.decrypt&&(this.pgpSignedVerifyStatus(l.SignedVerifyStatus.Unverified),r=a.decrypt(h),r&&(i=r.verify(p),i&&0').text(f)).html(),u.$div.empty(),this.replacePlaneTextBody(f)))}catch(b){}this.storePgpVerifyDataToDom()}},i.prototype.replacePlaneTextBody=function(e){this.body&&this.body.html(e).addClass("b-text-part plain")},i.prototype.flagHash=function(){return[this.deleted(),this.unseen(),this.flagged(),this.answered(),this.forwarded(),this.isReadReceipt()].join("")},e.exports=i}(t,e)},{$:20,Enums:7,Globals:9,LinkBuilder:11,"Model:Attachment":32,"Model:Email":37,"Storage:RainLoop:Data":64,Utils:14,_:25,ko:22,moment:23,window:26}],43:[function(e,t){!function(e,t){"use strict";function i(e,t,i,o,n,a,r){this.index=e,this.id=i,this.guid=t,this.user=o,this.email=n,this.armor=r,this.isPrivate=!!a,this.deleteAccess=s.observable(!1)}var s=t("ko");i.prototype.index=0,i.prototype.id="",i.prototype.guid="",i.prototype.user="",i.prototype.email="",i.prototype.armor="",i.prototype.isPrivate=!1,e.exports=i}(t,e)},{ko:22}],44:[function(e,t){!function(e,t){"use strict";function i(){o.call(this,"about",[t("View:RainLoop:About")])}var s=t("_"),o=t("Knoin:AbstractScreen");s.extend(i.prototype,o.prototype),i.prototype.onShow=function(){t("App:RainLoop").setTitle("RainLoop")},e.exports=i}(t,e)},{"App:RainLoop":3,"Knoin:AbstractScreen":29,"View:RainLoop:About":70,_:25}],45:[function(e,t){!function(e,t){"use strict";function i(e){u.call(this,"settings",e),this.menu=n.observableArray([]),this.oCurrentSubScreen=null,this.oViewModelPlace=null}var s=t("$"),o=t("_"),n=t("ko"),a=t("Globals"),r=t("Utils"),l=t("LinkBuilder"),c=t("App:Knoin"),u=t("Knoin:AbstractScreen");o.extend(i.prototype,u.prototype),i.prototype.onRoute=function(e){var t=this,i=null,u=null,d=null,p=null;u=o.find(a.aViewModels.settings,function(t){return t&&t.__rlSettingsData&&e===t.__rlSettingsData.Route}),u&&(o.find(a.aViewModels["settings-removed"],function(e){return e&&e===u})&&(u=null),u&&o.find(a.aViewModels["settings-disabled"],function(e){return e&&e===u})&&(u=null)),u?(u.__builded&&u.__vm?i=u.__vm:(d=this.oViewModelPlace,d&&1===d.length?(i=new u,p=s("
    ").addClass("rl-settings-view-model").hide(),p.appendTo(d),i.viewModelDom=p,i.__rlSettingsData=u.__rlSettingsData,u.__dom=p,u.__builded=!0,u.__vm=i,n.applyBindingAccessorsToNode(p[0],{i18nInit:!0,template:function(){return{name:u.__rlSettingsData.Template}}},i),r.delegateRun(i,"onBuild",[p])):r.log("Cannot find sub settings view model position: SettingsSubScreen")),i&&o.defer(function(){t.oCurrentSubScreen&&(r.delegateRun(t.oCurrentSubScreen,"onHide"),t.oCurrentSubScreen.viewModelDom.hide()),t.oCurrentSubScreen=i,t.oCurrentSubScreen&&(t.oCurrentSubScreen.viewModelDom.show(),r.delegateRun(t.oCurrentSubScreen,"onShow"),r.delegateRun(t.oCurrentSubScreen,"onFocus",[],200),o.each(t.menu(),function(e){e.selected(i&&i.__rlSettingsData&&e.route===i.__rlSettingsData.Route)}),s("#rl-content .b-settings .b-content .content").scrollTop(0)),r.windowResize()})):c.setHash(l.settings(),!1,!0)},i.prototype.onHide=function(){this.oCurrentSubScreen&&this.oCurrentSubScreen.viewModelDom&&(r.delegateRun(this.oCurrentSubScreen,"onHide"),this.oCurrentSubScreen.viewModelDom.hide())},i.prototype.onBuild=function(){o.each(a.aViewModels.settings,function(e){e&&e.__rlSettingsData&&!o.find(a.aViewModels["settings-removed"],function(t){return t&&t===e})&&this.menu.push({route:e.__rlSettingsData.Route,label:e.__rlSettingsData.Label,selected:n.observable(!1),disabled:!!o.find(a.aViewModels["settings-disabled"],function(t){return t&&t===e})})},this),this.oViewModelPlace=s("#rl-content #rl-settings-subscreen")},i.prototype.routes=function(){var e=o.find(a.aViewModels.settings,function(e){return e&&e.__rlSettingsData&&e.__rlSettingsData.IsDefault}),t=e?e.__rlSettingsData.Route:"general",i={subname:/^(.*)$/,normalize_:function(e,i){return i.subname=r.isUnd(i.subname)?t:r.pString(i.subname),[i.subname]}};return[["{subname}/",i],["{subname}",i],["",i]]},e.exports=i}(t,e)},{$:20,"App:Knoin":27,Globals:9,"Knoin:AbstractScreen":29,LinkBuilder:11,Utils:14,_:25,ko:22}],46:[function(e,t){!function(e,t){"use strict";function i(){o.call(this,"login",[t("View:RainLoop:Login")])}var s=t("_"),o=t("Knoin:AbstractScreen");s.extend(i.prototype,o.prototype),i.prototype.onShow=function(){t("App:RainLoop").setTitle("")},e.exports=i}(t,e)},{"App:RainLoop":3,"Knoin:AbstractScreen":29,"View:RainLoop:Login":72,_:25}],47:[function(e,t){!function(e,t){"use strict";function i(){l.call(this,"mailbox",[t("View:RainLoop:MailBoxSystemDropDown"),t("View:RainLoop:MailBoxFolderList"),t("View:RainLoop:MailBoxMessageList"),t("View:RainLoop:MailBoxMessageView")]),this.oLastRoute={}}var s=t("_"),o=t("Enums"),n=t("Globals"),a=t("Utils"),r=t("Events"),l=t("Knoin:AbstractScreen"),c=t("Storage:Settings"),u=t("Storage:RainLoop:Data"),d=t("Storage:RainLoop:Cache"),p=t("Storage:RainLoop:Remote");s.extend(i.prototype,l.prototype),i.prototype.oLastRoute={},i.prototype.setNewTitle=function(){var e=u.accountEmail(),i=u.foldersInboxUnreadCount();t("App:RainLoop").setTitle((""===e?"":(i>0?"("+i+") ":" ")+e+" - ")+a.i18n("TITLES/MAILBOX"))},i.prototype.onShow=function(){this.setNewTitle(),n.keyScope(o.KeyState.MessageList)},i.prototype.onRoute=function(e,i,s,n){if(a.isUnd(n)?1:!n){var r=d.getFolderFullNameRaw(e),l=d.getFolderFromCacheList(r);l&&(u.currentFolder(l).messageListPage(i).messageListSearch(s),o.Layout.NoPreview===u.layout()&&u.message()&&u.message(null),t("App:RainLoop").reloadMessageList())}else o.Layout.NoPreview!==u.layout()||u.message()||t("App:RainLoop").historyBack()},i.prototype.onStart=function(){var e=function(){a.windowResize()};(c.capa(o.Capa.AdditionalAccounts)||c.capa(o.Capa.AdditionalIdentities))&&t("App:RainLoop").accountsAndIdentities(),s.delay(function(){"INBOX"!==u.currentFolderFullNameRaw()&&t("App:RainLoop").folderInformation("INBOX")},1e3),s.delay(function(){t("App:RainLoop").quota()},5e3),s.delay(function(){p.appDelayStart(a.emptyFunction)},35e3),n.$html.toggleClass("rl-no-preview-pane",o.Layout.NoPreview===u.layout()),u.folderList.subscribe(e),u.messageList.subscribe(e),u.message.subscribe(e),u.layout.subscribe(function(e){n.$html.toggleClass("rl-no-preview-pane",o.Layout.NoPreview===e)}),r.sub("mailbox.inbox-unread-count",function(e){u.foldersInboxUnreadCount(e)}),u.foldersInboxUnreadCount.subscribe(function(){this.setNewTitle()},this)},i.prototype.routes=function(){var e=function(){return["Inbox",1,"",!0]},t=function(e,t){return t[0]=a.pString(t[0]),t[1]=a.pInt(t[1]),t[1]=0>=t[1]?1:t[1],t[2]=a.pString(t[2]),""===e&&(t[0]="Inbox",t[1]=1),[decodeURI(t[0]),t[1],decodeURI(t[2]),!1]},i=function(e,t){return t[0]=a.pString(t[0]),t[1]=a.pString(t[1]),""===e&&(t[0]="Inbox"),[decodeURI(t[0]),1,decodeURI(t[1]),!1]};return[[/^([a-zA-Z0-9]+)\/p([1-9][0-9]*)\/(.+)\/?$/,{normalize_:t}],[/^([a-zA-Z0-9]+)\/p([1-9][0-9]*)$/,{normalize_:t}],[/^([a-zA-Z0-9]+)\/(.+)\/?$/,{normalize_:i}],[/^message-preview$/,{normalize_:e}],[/^([^\/]*)$/,{normalize_:t}]]},e.exports=i}(t,e)},{"App:RainLoop":3,Enums:7,Events:8,Globals:9,"Knoin:AbstractScreen":29,"Storage:RainLoop:Cache":63,"Storage:RainLoop:Data":64,"Storage:RainLoop:Remote":68,"Storage:Settings":69,Utils:14,"View:RainLoop:MailBoxFolderList":73,"View:RainLoop:MailBoxMessageList":74,"View:RainLoop:MailBoxMessageView":75,"View:RainLoop:MailBoxSystemDropDown":76,_:25}],48:[function(e,t){!function(e,t){"use strict";function i(){r.call(this,[t("View:RainLoop:SettingsSystemDropDown"),t("View:RainLoop:SettingsMenu"),t("View:RainLoop:SettingsPane")]),n.initOnStartOrLangChange(function(){this.sSettingsTitle=n.i18n("TITLES/SETTINGS")},this,function(){this.setSettingsTitle()})}var s=t("_"),o=t("Enums"),n=t("Utils"),a=t("Globals"),r=t("Screen:AbstractSettings");s.extend(i.prototype,r.prototype),i.prototype.onShow=function(){this.setSettingsTitle(),a.keyScope(o.KeyState.Settings)},i.prototype.setSettingsTitle=function(){t("App:RainLoop").setTitle(this.sSettingsTitle)},e.exports=i}(t,e)},{"App:RainLoop":3,Enums:7,Globals:9,"Screen:AbstractSettings":45,Utils:14,"View:RainLoop:SettingsMenu":94,"View:RainLoop:SettingsPane":95,"View:RainLoop:SettingsSystemDropDown":96,_:25}],49:[function(e,t){!function(e,t){"use strict";function i(){this.accounts=c.accounts,this.processText=n.computed(function(){return c.accountsLoading()?r.i18n("SETTINGS_ACCOUNTS/LOADING_PROCESS"):""},this),this.visibility=n.computed(function(){return""===this.processText()?"hidden":"visible"},this),this.accountForDeletion=n.observable(null).extend({falseTimeout:3e3}).extend({toggleSubscribe:[this,function(e){e&&e.deleteAccess(!1)},function(e){e&&e.deleteAccess(!0)}]})}var s=t("window"),o=t("_"),n=t("ko"),a=t("Enums"),r=t("Utils"),l=t("LinkBuilder"),c=t("Storage:RainLoop:Data"),u=t("Storage:RainLoop:Remote");i.prototype.addNewAccount=function(){t("App:Knoin").showScreenPopup(t("View:Popup:AddAccount"))},i.prototype.deleteAccount=function(e){if(e&&e.deleteAccess()){this.accountForDeletion(null);var i=t("App:Knoin"),n=function(t){return e===t};e&&(this.accounts.remove(n),u.accountDelete(function(e,n){a.StorageResultType.Success===e&&n&&n.Result&&n.Reload?(i.routeOff(),i.setHash(l.root(),!0),i.routeOff(),o.defer(function(){s.location.reload()})):t("App:RainLoop").accountsAndIdentities()},e.email))}},e.exports=i}(t,e)},{"App:Knoin":27,"App:RainLoop":3,Enums:7,LinkBuilder:11,"Storage:RainLoop:Data":64,"Storage:RainLoop:Remote":68,Utils:14,"View:Popup:AddAccount":77,_:25,ko:22,window:26}],50:[function(e,t){!function(e,t){"use strict";function i(){this.changeProcess=o.observable(!1),this.errorDescription=o.observable(""),this.passwordMismatch=o.observable(!1),this.passwordUpdateError=o.observable(!1),this.passwordUpdateSuccess=o.observable(!1),this.currentPassword=o.observable(""),this.currentPassword.error=o.observable(!1),this.newPassword=o.observable(""),this.newPassword2=o.observable(""),this.currentPassword.subscribe(function(){this.passwordUpdateError(!1),this.passwordUpdateSuccess(!1),this.currentPassword.error(!1)},this),this.newPassword.subscribe(function(){this.passwordUpdateError(!1),this.passwordUpdateSuccess(!1),this.passwordMismatch(!1)},this),this.newPassword2.subscribe(function(){this.passwordUpdateError(!1),this.passwordUpdateSuccess(!1),this.passwordMismatch(!1)},this),this.saveNewPasswordCommand=a.createCommand(this,function(){this.newPassword()!==this.newPassword2()?(this.passwordMismatch(!0),this.errorDescription(a.i18n("SETTINGS_CHANGE_PASSWORD/ERROR_PASSWORD_MISMATCH"))):(this.changeProcess(!0),this.passwordUpdateError(!1),this.passwordUpdateSuccess(!1),this.currentPassword.error(!1),this.passwordMismatch(!1),this.errorDescription(""),r.changePassword(this.onChangePasswordResponse,this.currentPassword(),this.newPassword()))},function(){return!this.changeProcess()&&""!==this.currentPassword()&&""!==this.newPassword()&&""!==this.newPassword2()}),this.onChangePasswordResponse=s.bind(this.onChangePasswordResponse,this)}var s=t("_"),o=t("ko"),n=t("Enums"),a=t("Utils"),r=t("Storage:RainLoop:Remote");i.prototype.onHide=function(){this.changeProcess(!1),this.currentPassword(""),this.newPassword(""),this.newPassword2(""),this.errorDescription(""),this.passwordMismatch(!1),this.currentPassword.error(!1)},i.prototype.onChangePasswordResponse=function(e,t){this.changeProcess(!1),this.passwordMismatch(!1),this.errorDescription(""),this.currentPassword.error(!1),n.StorageResultType.Success===e&&t&&t.Result?(this.currentPassword(""),this.newPassword(""),this.newPassword2(""),this.passwordUpdateSuccess(!0),this.currentPassword.error(!1)):(t&&n.Notification.CurrentPasswordIncorrect===t.ErrorCode&&this.currentPassword.error(!0),this.passwordUpdateError(!0),this.errorDescription(a.getNotification(t&&t.ErrorCode?t.ErrorCode:n.Notification.CouldNotSaveNewPassword)))},e.exports=i}(t,e)},{Enums:7,"Storage:RainLoop:Remote":68,Utils:14,_:25,ko:22}],51:[function(e,t){!function(e,t){"use strict";function i(){this.contactsAutosave=a.contactsAutosave,this.allowContactsSync=a.allowContactsSync,this.enableContactsSync=a.enableContactsSync,this.contactsSyncUrl=a.contactsSyncUrl,this.contactsSyncUser=a.contactsSyncUser,this.contactsSyncPass=a.contactsSyncPass,this.saveTrigger=s.computed(function(){return[this.enableContactsSync()?"1":"0",this.contactsSyncUrl(),this.contactsSyncUser(),this.contactsSyncPass()].join("|")},this).extend({throttle:500}),this.saveTrigger.subscribe(function(){n.saveContactsSyncData(null,this.enableContactsSync(),this.contactsSyncUrl(),this.contactsSyncUser(),this.contactsSyncPass())},this)}var s=t("ko"),o=t("Utils"),n=t("Storage:RainLoop:Remote"),a=t("Storage:RainLoop:Data");i.prototype.onBuild=function(){a.contactsAutosave.subscribe(function(e){n.saveSettings(o.emptyFunction,{ContactsAutosave:e?"1":"0"})})},e.exports=i}(t,e)},{"Storage:RainLoop:Data":64,"Storage:RainLoop:Remote":68,Utils:14,ko:22}],52:[function(e,t){!function(e,t){"use strict";function i(){this.filters=s.observableArray([]),this.filters.loading=s.observable(!1),this.filters.subscribe(function(){o.windowResize()})}var s=t("ko"),o=t("Utils");i.prototype.deleteFilter=function(e){this.filters.remove(e)},i.prototype.addFilter=function(){var e=t("Model:Filter");t("App:Knoin").showScreenPopup(t("View:Popup:Filter"),[new e])},e.exports=i}(t,e)},{"App:Knoin":27,"Model:Filter":39,Utils:14,"View:Popup:Filter":84,ko:22}],53:[function(e,t){!function(e,t){"use strict";function i(){this.foldersListError=l.foldersListError,this.folderList=l.folderList,this.processText=s.computed(function(){var e=l.foldersLoading(),t=l.foldersCreating(),i=l.foldersDeleting(),s=l.foldersRenaming();return t?n.i18n("SETTINGS_FOLDERS/CREATING_PROCESS"):i?n.i18n("SETTINGS_FOLDERS/DELETING_PROCESS"):s?n.i18n("SETTINGS_FOLDERS/RENAMING_PROCESS"):e?n.i18n("SETTINGS_FOLDERS/LOADING_PROCESS"):""},this),this.visibility=s.computed(function(){return""===this.processText()?"hidden":"visible"},this),this.folderForDeletion=s.observable(null).extend({falseTimeout:3e3}).extend({toggleSubscribe:[this,function(e){e&&e.deleteAccess(!1)},function(e){e&&e.deleteAccess(!0)}]}),this.folderForEdit=s.observable(null).extend({toggleSubscribe:[this,function(e){e&&e.edited(!1)},function(e){e&&e.canBeEdited()&&e.edited(!0)}]}),this.useImapSubscribe=!!a.settingsGet("UseImapSubscribe")}var s=t("ko"),o=t("Enums"),n=t("Utils"),a=t("Storage:Settings"),r=t("Storage:LocalStorage"),l=t("Storage:RainLoop:Data"),c=t("Storage:RainLoop:Cache"),u=t("Storage:RainLoop:Remote");i.prototype.folderEditOnEnter=function(e){var i=e?n.trim(e.nameForEdit()):"";""!==i&&e.name()!==i&&(r.set(o.ClientSideKeyName.FoldersLashHash,""),l.foldersRenaming(!0),u.folderRename(function(e,i){l.foldersRenaming(!1),o.StorageResultType.Success===e&&i&&i.Result||l.foldersListError(i&&i.ErrorCode?n.getNotification(i.ErrorCode):n.i18n("NOTIFICATIONS/CANT_RENAME_FOLDER")),t("App:RainLoop").folders()},e.fullNameRaw,i),c.removeFolderFromCacheList(e.fullNameRaw),e.name(i)),e.edited(!1)},i.prototype.folderEditOnEsc=function(e){e&&e.edited(!1)},i.prototype.onShow=function(){l.foldersListError("")},i.prototype.createFolder=function(){t("App:Knoin").showScreenPopup(t("View:Popup:FolderCreate"))},i.prototype.systemFolder=function(){t("App:Knoin").showScreenPopup(t("View:Popup:FolderSystem"))},i.prototype.deleteFolder=function(e){if(e&&e.canBeDeleted()&&e.deleteAccess()&&0===e.privateMessageCountAll()){this.folderForDeletion(null);var i=function(t){return e===t?!0:(t.subFolders.remove(i),!1)};e&&(r.set(o.ClientSideKeyName.FoldersLashHash,""),l.folderList.remove(i),l.foldersDeleting(!0),u.folderDelete(function(e,i){l.foldersDeleting(!1),o.StorageResultType.Success===e&&i&&i.Result||l.foldersListError(i&&i.ErrorCode?n.getNotification(i.ErrorCode):n.i18n("NOTIFICATIONS/CANT_DELETE_FOLDER")),t("App:RainLoop").folders()},e.fullNameRaw),c.removeFolderFromCacheList(e.fullNameRaw))}else 0"},i.prototype.addNewIdentity=function(){t("App:Knoin").showScreenPopup(t("View:Popup:Identity"))},i.prototype.editIdentity=function(e){t("App:Knoin").showScreenPopup(t("View:Popup:Identity"),[e])},i.prototype.deleteIdentity=function(e){if(e&&e.deleteAccess()){this.identityForDeletion(null);var i=function(t){return e===t};e&&(this.identities.remove(i),c.identityDelete(function(){t("App:RainLoop").accountsAndIdentities()},e.id))}},i.prototype.onFocus=function(){if(!this.editor&&this.signatureDom()){var e=this,t=l.signature();this.editor=new r(e.signatureDom(),function(){l.signature((e.editor.isHtml()?":HTML:":"")+e.editor.getData())},function(){":HTML:"===t.substr(0,6)?e.editor.setHtml(t.substr(6),!1):e.editor.setPlain(t,!1)})}},i.prototype.onBuild=function(e){var t=this;e.on("click",".identity-item .e-action",function(){var e=s.dataFor(this);e&&t.editIdentity(e)}),o.delay(function(){var e=a.settingsSaveHelperSimpleFunction(t.displayNameTrigger,t),i=a.settingsSaveHelperSimpleFunction(t.replyTrigger,t),s=a.settingsSaveHelperSimpleFunction(t.signatureTrigger,t),o=a.settingsSaveHelperSimpleFunction(t.defaultIdentityIDTrigger,t);l.defaultIdentityID.subscribe(function(e){c.saveSettings(o,{DefaultIdentityID:e})}),l.displayName.subscribe(function(t){c.saveSettings(e,{DisplayName:t})}),l.replyTo.subscribe(function(e){c.saveSettings(i,{ReplyTo:e})}),l.signature.subscribe(function(e){c.saveSettings(s,{Signature:e})}),l.signatureToAll.subscribe(function(e){c.saveSettings(null,{SignatureToAll:e?"1":"0"})})},50)},e.exports=i}(t,e)},{"App:Knoin":27,"App:RainLoop":3,Enums:7,HtmlEditor:10,"Storage:RainLoop:Data":64,"Storage:RainLoop:Remote":68,Utils:14,"View:Popup:Identity":88,_:25,ko:22}],56:[function(e,t){!function(e,t){"use strict";function i(){this.editor=null,this.displayName=l.displayName,this.signature=l.signature,this.signatureToAll=l.signatureToAll,this.replyTo=l.replyTo,this.signatureDom=s.observable(null),this.displayNameTrigger=s.observable(n.SaveSettingsStep.Idle),this.replyTrigger=s.observable(n.SaveSettingsStep.Idle),this.signatureTrigger=s.observable(n.SaveSettingsStep.Idle)}var s=t("ko"),o=t("_"),n=t("Enums"),a=t("Utils"),r=t("HtmlEditor"),l=t("Storage:RainLoop:Data"),c=t("Storage:RainLoop:Remote");i.prototype.onFocus=function(){if(!this.editor&&this.signatureDom()){var e=this,t=l.signature();this.editor=new r(e.signatureDom(),function(){l.signature((e.editor.isHtml()?":HTML:":"")+e.editor.getData())},function(){":HTML:"===t.substr(0,6)?e.editor.setHtml(t.substr(6),!1):e.editor.setPlain(t,!1)})}},i.prototype.onBuild=function(){var e=this;o.delay(function(){var t=a.settingsSaveHelperSimpleFunction(e.displayNameTrigger,e),i=a.settingsSaveHelperSimpleFunction(e.replyTrigger,e),s=a.settingsSaveHelperSimpleFunction(e.signatureTrigger,e);l.displayName.subscribe(function(e){c.saveSettings(t,{DisplayName:e})}),l.replyTo.subscribe(function(e){c.saveSettings(i,{ReplyTo:e})}),l.signature.subscribe(function(e){c.saveSettings(s,{Signature:e})}),l.signatureToAll.subscribe(function(e){c.saveSettings(null,{SignatureToAll:e?"1":"0"})})},50)},e.exports=i}(t,e)},{Enums:7,HtmlEditor:10,"Storage:RainLoop:Data":64,"Storage:RainLoop:Remote":68,Utils:14,_:25,ko:22}],57:[function(e,t){!function(e,t){"use strict";function i(){this.openpgpkeys=n.openpgpkeys,this.openpgpkeysPublic=n.openpgpkeysPublic,this.openpgpkeysPrivate=n.openpgpkeysPrivate,this.openPgpKeyForDeletion=s.observable(null).extend({falseTimeout:3e3}).extend({toggleSubscribe:[this,function(e){e&&e.deleteAccess(!1) -},function(e){e&&e.deleteAccess(!0)}]})}var s=t("ko"),o=t("App:Knoin"),n=t("Storage:RainLoop:Data");i.prototype.addOpenPgpKey=function(){o.showScreenPopup(t("View:Popup:AddOpenPgpKey"))},i.prototype.generateOpenPgpKey=function(){o.showScreenPopup(t("View:Popup:NewOpenPgpKey"))},i.prototype.viewOpenPgpKey=function(e){e&&o.showScreenPopup(t("View:Popup:ViewOpenPgpKey"),[e])},i.prototype.deleteOpenPgpKey=function(e){e&&e.deleteAccess()&&(this.openPgpKeyForDeletion(null),e&&n.openpgpKeyring&&(this.openpgpkeys.remove(function(t){return e===t}),n.openpgpKeyring[e.isPrivate?"privateKeys":"publicKeys"].removeForId(e.guid),n.openpgpKeyring.store(),t("App:RainLoop").reloadOpenPgpKeys()))},e.exports=i}(t,e)},{"App:Knoin":27,"App:RainLoop":3,"Storage:RainLoop:Data":64,"View:Popup:AddOpenPgpKey":78,"View:Popup:NewOpenPgpKey":91,"View:Popup:ViewOpenPgpKey":93,ko:22}],58:[function(e,t){!function(e,t){"use strict";function i(){this.processing=s.observable(!1),this.clearing=s.observable(!1),this.secreting=s.observable(!1),this.viewUser=s.observable(""),this.viewEnable=s.observable(!1),this.viewEnable.subs=!0,this.twoFactorStatus=s.observable(!1),this.viewSecret=s.observable(""),this.viewBackupCodes=s.observable(""),this.viewUrl=s.observable(""),this.bFirst=!0,this.viewTwoFactorStatus=s.computed(function(){return n.langChangeTrigger(),a.i18n(this.twoFactorStatus()?"SETTINGS_SECURITY/TWO_FACTOR_SECRET_CONFIGURED_DESC":"SETTINGS_SECURITY/TWO_FACTOR_SECRET_NOT_CONFIGURED_DESC")},this),this.onResult=_.bind(this.onResult,this),this.onSecretResult=_.bind(this.onSecretResult,this)}var s=t("ko"),o=t("Enums"),n=t("Globals"),a=t("Utils"),r=t("Storage:RainLoop:Remote");i.prototype.showSecret=function(){this.secreting(!0),r.showTwoFactorSecret(this.onSecretResult)},i.prototype.hideSecret=function(){this.viewSecret(""),this.viewBackupCodes(""),this.viewUrl("")},i.prototype.createTwoFactor=function(){this.processing(!0),r.createTwoFactor(this.onResult)},i.prototype.enableTwoFactor=function(){this.processing(!0),r.enableTwoFactor(this.onResult,this.viewEnable())},i.prototype.testTwoFactor=function(){t("App:Knoin").showScreenPopup(t("View:Popup:TwoFactorTest"))},i.prototype.clearTwoFactor=function(){this.viewSecret(""),this.viewBackupCodes(""),this.viewUrl(""),this.clearing(!0),r.clearTwoFactor(this.onResult)},i.prototype.onShow=function(){this.viewSecret(""),this.viewBackupCodes(""),this.viewUrl("")},i.prototype.onResult=function(e,t){if(this.processing(!1),this.clearing(!1),o.StorageResultType.Success===e&&t&&t.Result?(this.viewUser(a.pString(t.Result.User)),this.viewEnable(!!t.Result.Enable),this.twoFactorStatus(!!t.Result.IsSet),this.viewSecret(a.pString(t.Result.Secret)),this.viewBackupCodes(a.pString(t.Result.BackupCodes).replace(/[\s]+/g," ")),this.viewUrl(a.pString(t.Result.Url))):(this.viewUser(""),this.viewEnable(!1),this.twoFactorStatus(!1),this.viewSecret(""),this.viewBackupCodes(""),this.viewUrl("")),this.bFirst){this.bFirst=!1;var i=this;this.viewEnable.subscribe(function(e){this.viewEnable.subs&&r.enableTwoFactor(function(e,t){o.StorageResultType.Success===e&&t&&t.Result||(i.viewEnable.subs=!1,i.viewEnable(!1),i.viewEnable.subs=!0)},e)},this)}},i.prototype.onSecretResult=function(e,t){this.secreting(!1),o.StorageResultType.Success===e&&t&&t.Result?(this.viewSecret(a.pString(t.Result.Secret)),this.viewUrl(a.pString(t.Result.Url))):(this.viewSecret(""),this.viewUrl(""))},i.prototype.onBuild=function(){this.processing(!0),r.getTwoFactor(this.onResult)},e.exports=i}(t,e)},{"App:Knoin":27,Enums:7,Globals:9,"Storage:RainLoop:Remote":68,Utils:14,"View:Popup:TwoFactorTest":92,ko:22}],59:[function(e,t){!function(e,t){"use strict";function i(){var e=t("Utils"),i=t("Storage:RainLoop:Data");this.googleEnable=i.googleEnable,this.googleActions=i.googleActions,this.googleLoggined=i.googleLoggined,this.googleUserName=i.googleUserName,this.facebookEnable=i.facebookEnable,this.facebookActions=i.facebookActions,this.facebookLoggined=i.facebookLoggined,this.facebookUserName=i.facebookUserName,this.twitterEnable=i.twitterEnable,this.twitterActions=i.twitterActions,this.twitterLoggined=i.twitterLoggined,this.twitterUserName=i.twitterUserName,this.connectGoogle=e.createCommand(this,function(){this.googleLoggined()||t("App:RainLoop").googleConnect()},function(){return!this.googleLoggined()&&!this.googleActions()}),this.disconnectGoogle=e.createCommand(this,function(){t("App:RainLoop").googleDisconnect()}),this.connectFacebook=e.createCommand(this,function(){this.facebookLoggined()||t("App:RainLoop").facebookConnect()},function(){return!this.facebookLoggined()&&!this.facebookActions()}),this.disconnectFacebook=e.createCommand(this,function(){t("App:RainLoop").facebookDisconnect()}),this.connectTwitter=e.createCommand(this,function(){this.twitterLoggined()||t("App:RainLoop").twitterConnect()},function(){return!this.twitterLoggined()&&!this.twitterActions()}),this.disconnectTwitter=e.createCommand(this,function(){t("App:RainLoop").twitterDisconnect()})}e.exports=i}(t,e)},{"App:RainLoop":3,"Storage:RainLoop:Data":64,Utils:14}],60:[function(e,t){!function(e,t){"use strict";function i(){var e=this;this.mainTheme=u.mainTheme,this.themesObjects=n.observableArray([]),this.themeTrigger=n.observable(r.SaveSettingsStep.Idle).extend({throttle:100}),this.oLastAjax=null,this.iTimer=0,u.theme.subscribe(function(t){a.each(this.themesObjects(),function(e){e.selected(t===e.name)});var i=o("#rlThemeLink"),n=o("#rlThemeStyle"),c=i.attr("href");c||(c=n.attr("data-href")),c&&(c=c.toString().replace(/\/-\/[^\/]+\/\-\//,"/-/"+t+"/-/"),c=c.toString().replace(/\/Css\/[^\/]+\/User\//,"/Css/0/User/"),"Json/"!==c.substring(c.length-5,c.length)&&(c+="Json/"),s.clearTimeout(e.iTimer),e.themeTrigger(r.SaveSettingsStep.Animate),this.oLastAjax&&this.oLastAjax.abort&&this.oLastAjax.abort(),this.oLastAjax=o.ajax({url:c,dataType:"json"}).done(function(t){t&&l.isArray(t)&&2===t.length&&(!i||!i[0]||n&&n[0]||(n=o(''),i.after(n),i.remove()),n&&n[0]&&(n.attr("data-href",c).attr("data-theme",t[0]),n&&n[0]&&n[0].styleSheet&&!l.isUnd(n[0].styleSheet.cssText)?n[0].styleSheet.cssText=t[1]:n.text(t[1])),e.themeTrigger(r.SaveSettingsStep.TrueResult))}).always(function(){e.iTimer=s.setTimeout(function(){e.themeTrigger(r.SaveSettingsStep.Idle)},1e3),e.oLastAjax=null})),d.saveSettings(null,{Theme:t})},this)}var s=t("window"),o=t("$"),n=t("ko"),a=t("_"),r=t("Enums"),l=t("Utils"),c=t("LinkBuilder"),u=t("Storage:RainLoop:Data"),d=t("Storage:RainLoop:Remote");i.prototype.onBuild=function(){var e=u.theme();this.themesObjects(a.map(u.themes(),function(t){return{name:t,nameDisplay:l.convertThemeName(t),selected:n.observable(t===e),themePreviewSrc:c.themePreviewLink(t)}}))},e.exports=i}(t,e)},{$:20,Enums:7,LinkBuilder:11,"Storage:RainLoop:Data":64,"Storage:RainLoop:Remote":68,Utils:14,_:25,ko:22,window:26}],61:[function(e,t){!function(e,t){"use strict";function i(){o.initDataConstructorBySettings(this)}var s=t("Enums"),o=t("Utils"),n=t("Storage:Settings");i.prototype.populateDataOnStart=function(){var e=o.pInt(n.settingsGet("Layout")),t=n.settingsGet("Languages"),i=n.settingsGet("Themes");o.isArray(t)&&this.languages(t),o.isArray(i)&&this.themes(i),this.mainLanguage(n.settingsGet("Language")),this.mainTheme(n.settingsGet("Theme")),this.capaAdditionalAccounts(n.capa(s.Capa.AdditionalAccounts)),this.capaAdditionalIdentities(n.capa(s.Capa.AdditionalIdentities)),this.capaGravatar(n.capa(s.Capa.Gravatar)),this.determineUserLanguage(!!n.settingsGet("DetermineUserLanguage")),this.determineUserDomain(!!n.settingsGet("DetermineUserDomain")),this.capaThemes(n.capa(s.Capa.Themes)),this.allowLanguagesOnLogin(!!n.settingsGet("AllowLanguagesOnLogin")),this.allowLanguagesOnSettings(!!n.settingsGet("AllowLanguagesOnSettings")),this.useLocalProxyForExternalImages(!!n.settingsGet("UseLocalProxyForExternalImages")),this.editorDefaultType(n.settingsGet("EditorDefaultType")),this.showImages(!!n.settingsGet("ShowImages")),this.contactsAutosave(!!n.settingsGet("ContactsAutosave")),this.interfaceAnimation(n.settingsGet("InterfaceAnimation")),this.mainMessagesPerPage(n.settingsGet("MPP")),this.desktopNotifications(!!n.settingsGet("DesktopNotifications")),this.useThreads(!!n.settingsGet("UseThreads")),this.replySameFolder(!!n.settingsGet("ReplySameFolder")),this.useCheckboxesInList(!!n.settingsGet("UseCheckboxesInList")),this.layout(s.Layout.SidePreview),-1(new s.Date).getTime()-g),f&&l.oRequests[f]&&(l.oRequests[f].__aborted&&(o="abort"),l.oRequests[f]=null),l.defaultResponse(e,f,o,i,n,t)}),f&&0=e?1:e},this),this.mainMessageListSearch=a.computed({read:this.messageListSearch,write:function(e){m.setHash(p.mailBox(this.currentFolderFullNameHash(),1,d.trim(e.toString())))},owner:this}),this.messageListError=a.observable(""),this.messageListLoading=a.observable(!1),this.messageListIsNotCompleted=a.observable(!1),this.messageListCompleteLoadingThrottle=a.observable(!1).extend({throttle:200}),this.messageListCompleteLoading=a.computed(function(){var e=this.messageListLoading(),t=this.messageListIsNotCompleted();return e||t},this),this.messageListCompleteLoading.subscribe(function(e){this.messageListCompleteLoadingThrottle(e)},this),this.messageList.subscribe(n.debounce(function(e){n.each(e,function(e){e.newForAnimation()&&e.newForAnimation(!1)})},500)),this.staticMessageList=new f,this.message=a.observable(null),this.messageLoading=a.observable(!1),this.messageLoadingThrottle=a.observable(!1).extend({throttle:50}),this.message.focused=a.observable(!1),this.message.subscribe(function(e){e?c.Layout.NoPreview===this.layout()&&this.message.focused(!0):(this.message.focused(!1),this.messageFullScreenMode(!1),this.hideMessageBodies(),c.Layout.NoPreview===this.layout()&&-10?s.Math.ceil(t/e*100):0},this),this.capaOpenPGP=a.observable(!1),this.openpgpkeys=a.observableArray([]),this.openpgpKeyring=null,this.openpgpkeysPublic=this.openpgpkeys.filter(function(e){return!(!e||e.isPrivate)}),this.openpgpkeysPrivate=this.openpgpkeys.filter(function(e){return!(!e||!e.isPrivate)}),this.googleActions=a.observable(!1),this.googleLoggined=a.observable(!1),this.googleUserName=a.observable(""),this.facebookActions=a.observable(!1),this.facebookLoggined=a.observable(!1),this.facebookUserName=a.observable(""),this.twitterActions=a.observable(!1),this.twitterLoggined=a.observable(!1),this.twitterUserName=a.observable(""),this.customThemeType=a.observable(c.CustomThemeType.Light),this.purgeMessageBodyCacheThrottle=n.throttle(this.purgeMessageBodyCache,3e4)}var s=t("window"),o=t("$"),n=t("_"),a=t("ko"),r=t("moment"),l=t("Consts"),c=t("Enums"),u=t("Globals"),d=t("Utils"),p=t("LinkBuilder"),h=t("Storage:Settings"),g=t("Storage:RainLoop:Cache"),m=t("App:Knoin"),f=t("Model:Message"),b=t("Storage:LocalStorage"),S=t("Storage:Abstract:Data");n.extend(i.prototype,S.prototype),i.prototype.purgeMessageBodyCache=function(){var e=0,t=null,i=u.iMessageBodyCacheCount-l.Values.MessageBodyCacheLimit;i>0&&(t=this.messagesBodiesDom(),t&&(t.find(".rl-cache-class").each(function(){var t=o(this);i>t.data("rl-cache-count")&&(t.addClass("rl-cache-purge"),e++)}),e>0&&n.delay(function(){t.find(".rl-cache-purge").remove()},300)))},i.prototype.populateDataOnStart=function(){S.prototype.populateDataOnStart.call(this),this.accountEmail(h.settingsGet("Email")),this.accountIncLogin(h.settingsGet("IncLogin")),this.accountOutLogin(h.settingsGet("OutLogin")),this.projectHash(h.settingsGet("ProjectHash")),this.defaultIdentityID(h.settingsGet("DefaultIdentityID")),this.displayName(h.settingsGet("DisplayName")),this.replyTo(h.settingsGet("ReplyTo")),this.signature(h.settingsGet("Signature")),this.signatureToAll(!!h.settingsGet("SignatureToAll")),this.enableTwoFactor(!!h.settingsGet("EnableTwoFactor")),this.lastFoldersHash=b.get(c.ClientSideKeyName.FoldersLashHash)||"",this.remoteSuggestions=!!h.settingsGet("RemoteSuggestions"),this.devEmail=h.settingsGet("DevEmail"),this.devPassword=h.settingsGet("DevPassword")},i.prototype.initUidNextAndNewMessages=function(e,t,i){if("INBOX"===e&&d.isNormal(t)&&""!==t){if(d.isArray(i)&&03)l(p.notificationMailIcon(),this.accountEmail(),d.i18n("MESSAGE_LIST/NEW_MESSAGE_NOTIFICATION",{COUNT:r}));else for(;r>a;a++)l(p.notificationMailIcon(),f.emailsToLine(f.initEmailsFromJson(i[a].From),!1),i[a].Subject)}g.setFolderUidNext(e,t)}},i.prototype.hideMessageBodies=function(){var e=this.messagesBodiesDom();e&&e.find(".b-text-part").hide()},i.prototype.getNextFolderNames=function(e){e=d.isUnd(e)?!1:!!e;var t=[],i=10,s=r().unix(),o=s-300,a=[],l=function(t){n.each(t,function(t){t&&"INBOX"!==t.fullNameRaw&&t.selectable&&t.existen&&o>t.interval&&(!e||t.subScribed())&&a.push([t.interval,t.fullNameRaw]),t&&0t[0]?1:0}),n.find(a,function(e){var o=g.getFolderFromCacheList(e[1]);return o&&(o.interval=s,t.push(e[1])),i<=t.length}),n.uniq(t)},i.prototype.removeMessagesFromList=function(e,t,i,s){i=d.isNormal(i)?i:"",s=d.isUnd(s)?!1:!!s,t=n.map(t,function(e){return d.pInt(e)});var o=this,a=0,r=this.messageList(),l=g.getFolderFromCacheList(e),c=""===i?null:g.getFolderFromCacheList(i||""),u=this.currentFolderFullNameRaw(),p=this.message(),h=u===e?n.filter(r,function(e){return e&&-10&&l.messageCountUnread(0<=l.messageCountUnread()-a?l.messageCountUnread()-a:0)),c&&(c.messageCountAll(c.messageCountAll()+t.length),a>0&&c.messageCountUnread(c.messageCountUnread()+a),c.actionBlink(!0)),0').hide().addClass("rl-cache-class"),a.data("rl-cache-count",++u.iMessageBodyCacheCount),d.isNormal(e.Result.Html)&&""!==e.Result.Html?(i=!0,p=e.Result.Html.toString()):d.isNormal(e.Result.Plain)&&""!==e.Result.Plain?(i=!1,p=d.plainToHtml(e.Result.Plain.toString(),!1),(b.isPgpSigned()||b.isPgpEncrypted())&&this.capaOpenPGP()&&(b.plainRaw=d.pString(e.Result.Plain),m=/---BEGIN PGP MESSAGE---/.test(b.plainRaw),m||(h=/-----BEGIN PGP SIGNED MESSAGE-----/.test(b.plainRaw)&&/-----BEGIN PGP SIGNATURE-----/.test(b.plainRaw)),u.$div.empty(),h&&b.isPgpSigned()?p=u.$div.append(o('
    ').text(b.plainRaw)).html():m&&b.isPgpEncrypted()&&(p=u.$div.append(o('
    ').text(b.plainRaw)).html()),u.$div.empty(),b.isPgpSigned(h),b.isPgpEncrypted(m))):i=!1,a.html(d.linkify(p)).addClass("b-text-part "+(i?"html":"plain")),b.isHtml(!!i),b.hasImages(!!s),b.pgpSignedVerifyStatus(c.SignedVerifyStatus.None),b.pgpSignedVerifyUser(""),b.body=a,b.body&&f.append(b.body),b.storeDataToDom(),n&&b.showInternalImages(!0),b.hasImages()&&this.showImages()&&b.showExternalImages(!0),this.purgeMessageBodyCacheThrottle()),this.messageActiveDom(b.body),this.hideMessageBodies(),b.body.show(),a&&d.initBlockquoteSwitcher(a)),g.initMessageFlagsFromCache(b),b.unseen()&&u.__APP&&u.__APP.setMessageSeen(b),d.windowResize())},i.prototype.calculateMessageListHash=function(e){return n.map(e,function(e){return""+e.hash+"_"+e.threadsLen()+"_"+e.flagHash()}).join("|")},i.prototype.findPublicKeyByHex=function(e){return n.find(this.openpgpkeysPublic(),function(t){return t&&e===t.id})},i.prototype.findPublicKeysByEmail=function(e){return n.compact(n.map(this.openpgpkeysPublic(),function(t){var i=null;if(t&&e===t.email)try{if(i=s.openpgp.key.readArmored(t.armor),i&&!i.err&&i.keys&&i.keys[0])return i.keys[0]}catch(o){}return null}))},i.prototype.findPrivateKeyByEmail=function(e,t){var i=null,o=n.find(this.openpgpkeysPrivate(),function(t){return t&&e===t.email
    -});if(o)try{i=s.openpgp.key.readArmored(o.armor),i&&!i.err&&i.keys&&i.keys[0]?(i=i.keys[0],i.decrypt(d.pString(t))):i=null}catch(a){i=null}return i},i.prototype.findSelfPrivateKey=function(e){return this.findPrivateKeyByEmail(this.accountEmail(),e)},e.exports=new i}(t,e)},{$:20,"App:Knoin":27,Consts:6,Enums:7,Globals:9,LinkBuilder:11,"Model:Message":42,"Storage:Abstract:Data":61,"Storage:LocalStorage":65,"Storage:RainLoop:Cache":63,"Storage:Settings":69,Utils:14,_:25,ko:22,moment:23,window:26}],65:[function(e,t){!function(e,t){"use strict";function i(){var e=t("_"),i=e.find([t("Storage:LocalStorage:Cookie"),t("Storage:LocalStorage:LocalStorage")],function(e){return e.supported()});this.oDriver=null,i&&(this.oDriver=new i)}i.prototype.oDriver=null,i.prototype.set=function(e,t){return this.oDriver?this.oDriver.set("p"+e,t):!1},i.prototype.get=function(e){return this.oDriver?this.oDriver.get("p"+e):null},e.exports=new i}(t,e)},{"Storage:LocalStorage:Cookie":66,"Storage:LocalStorage:LocalStorage":67,_:25}],66:[function(e,t){!function(e,t){"use strict";function i(){}var s=t("$"),o=t("JSON"),n=t("Consts"),a=t("Utils");i.supported=function(){return!0},i.prototype.set=function(e,t){var i=s.cookie(n.Values.ClientSideCookieIndexName),a=!1,r=null;try{r=null===i?null:o.parse(i),r||(r={}),r[e]=t,s.cookie(n.Values.ClientSideCookieIndexName,o.stringify(r),{expires:30}),a=!0}catch(l){}return a},i.prototype.get=function(e){var t=s.cookie(n.Values.ClientSideCookieIndexName),i=null;try{i=null===t?null:o.parse(t),i=i&&!a.isUnd(i[e])?i[e]:null}catch(r){}return i},e.exports=i}(t,e)},{$:20,Consts:6,JSON:15,Utils:14}],67:[function(e,t){!function(e,t){"use strict";function i(){}var s=t("window"),o=t("JSON"),n=t("Consts"),a=t("Utils");i.supported=function(){return!!s.localStorage},i.prototype.set=function(e,t){var i=s.localStorage[n.Values.ClientSideCookieIndexName]||null,a=!1,r=null;try{r=null===i?null:o.parse(i),r||(r={}),r[e]=t,s.localStorage[n.Values.ClientSideCookieIndexName]=o.stringify(r),a=!0}catch(l){}return a},i.prototype.get=function(e){var t=s.localStorage[n.Values.ClientSideCookieIndexName]||null,i=null;try{i=null===t?null:o.parse(t),i=i&&!a.isUnd(i[e])?i[e]:null}catch(r){}return i},e.exports=i}(t,e)},{Consts:6,JSON:15,Utils:14,window:26}],68:[function(e,t){!function(e,t){"use strict";function i(){d.call(this),this.oRequests={}}var s=t("_"),o=t("Utils"),n=t("Consts"),a=t("Globals"),r=t("Base64"),l=t("Storage:Settings"),c=t("Storage:RainLoop:Cache"),u=t("Storage:RainLoop:Data"),d=t("Storage:Abstract:Remote");s.extend(i.prototype,d.prototype),i.prototype.folders=function(e){this.defaultRequest(e,"Folders",{SentFolder:l.settingsGet("SentFolder"),DraftFolder:l.settingsGet("DraftFolder"),SpamFolder:l.settingsGet("SpamFolder"),TrashFolder:l.settingsGet("TrashFolder"),ArchiveFolder:l.settingsGet("ArchiveFolder")},null,"",["Folders"])},i.prototype.login=function(e,t,i,s,o,n,a,r){this.defaultRequest(e,"Login",{Email:t,Login:i,Password:s,Language:n||"",AdditionalCode:a||"",AdditionalCodeSignMe:r?"1":"0",SignMe:o?"1":"0"})},i.prototype.getTwoFactor=function(e){this.defaultRequest(e,"GetTwoFactorInfo")},i.prototype.createTwoFactor=function(e){this.defaultRequest(e,"CreateTwoFactorSecret")},i.prototype.clearTwoFactor=function(e){this.defaultRequest(e,"ClearTwoFactorInfo")},i.prototype.showTwoFactorSecret=function(e){this.defaultRequest(e,"ShowTwoFactorSecret")},i.prototype.testTwoFactor=function(e,t){this.defaultRequest(e,"TestTwoFactorInfo",{Code:t})},i.prototype.enableTwoFactor=function(e,t){this.defaultRequest(e,"EnableTwoFactor",{Enable:t?"1":"0"})},i.prototype.clearTwoFactorInfo=function(e){this.defaultRequest(e,"ClearTwoFactorInfo")},i.prototype.contactsSync=function(e){this.defaultRequest(e,"ContactsSync",null,n.Defaults.ContactsSyncAjaxTimeout)},i.prototype.saveContactsSyncData=function(e,t,i,s,o){this.defaultRequest(e,"SaveContactsSyncData",{Enable:t?"1":"0",Url:i,User:s,Password:o})},i.prototype.accountAdd=function(e,t,i,s){this.defaultRequest(e,"AccountAdd",{Email:t,Login:i,Password:s})},i.prototype.accountDelete=function(e,t){this.defaultRequest(e,"AccountDelete",{EmailToDelete:t})},i.prototype.identityUpdate=function(e,t,i,s,o,n){this.defaultRequest(e,"IdentityUpdate",{Id:t,Email:i,Name:s,ReplyTo:o,Bcc:n})},i.prototype.identityDelete=function(e,t){this.defaultRequest(e,"IdentityDelete",{IdToDelete:t})},i.prototype.accountsAndIdentities=function(e){this.defaultRequest(e,"AccountsAndIdentities")},i.prototype.messageList=function(e,t,i,s,a,l){t=o.pString(t);var d=c.getFolderHash(t);l=o.isUnd(l)?!1:!!l,i=o.isUnd(i)?0:o.pInt(i),s=o.isUnd(i)?20:o.pInt(s),a=o.pString(a),""===d||""!==a&&-1!==a.indexOf("is:")?this.defaultRequest(e,"MessageList",{Folder:t,Offset:i,Limit:s,Search:a,UidNext:"INBOX"===t?c.getFolderUidNext(t):"",UseThreads:u.threading()&&u.useThreads()?"1":"0",ExpandedThreadUid:u.threading()&&t===u.messageListThreadFolder()?u.messageListThreadUids().join(","):""},""===a?n.Defaults.DefaultAjaxTimeout:n.Defaults.SearchAjaxTimeout,"",l?[]:["MessageList"]):this.defaultRequest(e,"MessageList",{},""===a?n.Defaults.DefaultAjaxTimeout:n.Defaults.SearchAjaxTimeout,"MessageList/"+r.urlsafe_encode([t,i,s,a,u.projectHash(),d,"INBOX"===t?c.getFolderUidNext(t):"",u.threading()&&u.useThreads()?"1":"0",u.threading()&&t===u.messageListThreadFolder()?u.messageListThreadUids().join(","):""].join(String.fromCharCode(0))),l?[]:["MessageList"])},i.prototype.messageUploadAttachments=function(e,t){this.defaultRequest(e,"MessageUploadAttachments",{Attachments:t},999e3)},i.prototype.message=function(e,t,i){return t=o.pString(t),i=o.pInt(i),c.getFolderFromCacheList(t)&&i>0?(this.defaultRequest(e,"Message",{},null,"Message/"+r.urlsafe_encode([t,i,u.projectHash(),u.threading()&&u.useThreads()?"1":"0"].join(String.fromCharCode(0))),["Message"]),!0):!1},i.prototype.composeUploadExternals=function(e,t){this.defaultRequest(e,"ComposeUploadExternals",{Externals:t},999e3)},i.prototype.composeUploadDrive=function(e,t,i){this.defaultRequest(e,"ComposeUploadDrive",{AccessToken:i,Url:t},999e3)},i.prototype.folderInformation=function(e,t,i){var n=!0,r=[];o.isArray(i)&&0-1&&r.eq(n).removeClass("focused"),38===a&&n>0?n--:40===a&&ns)?(this.oContentScrollable.scrollTop(i.top<0?this.oContentScrollable.scrollTop()+i.top-e:this.oContentScrollable.scrollTop()+i.top-s+n+e),!0):!1},i.prototype.messagesDrop=function(e,i){if(e&&i&&i.helper){var s=i.helper.data("rl-folder"),o=c.$html.hasClass("rl-ctrl-key-pressed"),n=i.helper.data("rl-uids");r.isNormal(s)&&""!==s&&r.isArray(n)&&t("App:RainLoop").moveMessagesToFolder(s,n,e.fullNameRaw,o)}},i.prototype.composeClick=function(){g.showScreenPopup(t("View:Popup:Compose"))},i.prototype.createFolder=function(){g.showScreenPopup(t("View:Popup:FolderCreate"))},i.prototype.configureFolders=function(){g.setHash(u.settings("folders"))},i.prototype.contactsClick=function(){this.allowContacts&&g.showScreenPopup(t("View:Popup:Contacts"))},e.exports=i}(t,e)},{$:20,"App:Knoin":27,"App:RainLoop":3,Enums:7,Globals:9,"Knoin:AbstractViewModel":30,LinkBuilder:11,"Storage:RainLoop:Cache":63,"Storage:RainLoop:Data":64,"Storage:Settings":69,Utils:14,"View:Popup:Compose":82,"View:Popup:Contacts":83,"View:Popup:FolderCreate":86,key:21,ko:22,window:26}],74:[function(e,t){!function(e,t){"use strict";function i(){w.call(this,"Right","MailMessageList"),this.sLastUid=null,this.bPrefetch=!1,this.emptySubjectValue="",this.hideDangerousActions=!!f.settingsGet("HideDangerousActions"),this.popupVisibility=d.popupVisibility,this.message=S.message,this.messageList=S.messageList,this.folderList=S.folderList,this.currentMessage=S.currentMessage,this.isMessageSelected=S.isMessageSelected,this.messageListSearch=S.messageListSearch,this.messageListError=S.messageListError,this.folderMenuForMove=S.folderMenuForMove,this.useCheckboxesInList=S.useCheckboxesInList,this.mainMessageListSearch=S.mainMessageListSearch,this.messageListEndFolder=S.messageListEndFolder,this.messageListChecked=S.messageListChecked,this.messageListCheckedOrSelected=S.messageListCheckedOrSelected,this.messageListCheckedOrSelectedUidsWithSubMails=S.messageListCheckedOrSelectedUidsWithSubMails,this.messageListCompleteLoadingThrottle=S.messageListCompleteLoadingThrottle,p.initOnStartOrLangChange(function(){this.emptySubjectValue=p.i18n("MESSAGE_LIST/EMPTY_SUBJECT_TEXT")},this),this.userQuota=S.userQuota,this.userUsageSize=S.userUsageSize,this.userUsageProc=S.userUsageProc,this.moveDropdownTrigger=n.observable(!1),this.moreDropdownTrigger=n.observable(!1),this.dragOver=n.observable(!1).extend({throttle:1}),this.dragOverEnter=n.observable(!1).extend({throttle:1}),this.dragOverArea=n.observable(null),this.dragOverBodyArea=n.observable(null),this.messageListItemTemplate=n.computed(function(){return c.Layout.NoPreview!==S.layout()?"MailMessageListItem":"MailMessageListItemNoPreviewPane"}),this.messageListSearchDesc=n.computed(function(){var e=S.messageListEndSearch();return""===e?"":p.i18n("MESSAGE_LIST/SEARCH_RESULT_FOR",{SEARCH:e})}),this.messageListPagenator=n.computed(p.computedPagenatorHelper(S.messageListPage,S.messageListPageCount)),this.checkAll=n.computed({read:function(){return 00&&t>0&&e>t},this),this.hasMessages=n.computed(function(){return 01?" ("+(100>e?e:"99+")+")":""},i.prototype.cancelSearch=function(){this.mainMessageListSearch(""),this.inputMessageListSearchFocus(!1)},i.prototype.moveSelectedMessagesToFolder=function(e,i){return this.canBeMoved()&&t("App:RainLoop").moveMessagesToFolder(S.currentFolderFullNameRaw(),S.messageListCheckedOrSelectedUidsWithSubMails(),e,i),!1},i.prototype.dragAndDronHelper=function(e){e&&e.checked(!0);var t=p.draggeblePlace(),i=S.messageListCheckedOrSelectedUidsWithSubMails();return t.data("rl-folder",S.currentFolderFullNameRaw()),t.data("rl-uids",i),t.find(".text").text(""+i.length),o.defer(function(){var e=S.messageListCheckedOrSelectedUidsWithSubMails();t.data("rl-uids",e),t.find(".text").text(""+e.length)}),t},i.prototype.onMessageResponse=function(e,t,i){S.hideMessageBodies(),S.messageLoading(!1),c.StorageResultType.Success===e&&t&&t.Result?S.setMessage(t,i):c.StorageResultType.Unload===e?(S.message(null),S.messageError("")):c.StorageResultType.Abort!==e&&(S.message(null),S.messageError(p.getNotification(t&&t.ErrorCode?t.ErrorCode:c.Notification.UnknownError)))},i.prototype.populateMessageBody=function(e){e&&(y.message(this.onMessageResponse,e.folderFullNameRaw,e.uid)?S.messageLoading(!0):p.log("Error: Unknown message request: "+e.folderFullNameRaw+" ~ "+e.uid+" [e-101]"))
    -},i.prototype.setAction=function(e,i,s){var n=[],a=null,r=0;if(p.isUnd(s)&&(s=S.messageListChecked()),n=o.map(s,function(e){return e.uid}),""!==e&&00?100>e?e:"99+":""},i.prototype.verifyPgpSignedClearMessage=function(e){e&&e.verifyPgpSignedClearMessage()},i.prototype.decryptPgpEncryptedMessage=function(e){e&&e.decryptPgpEncryptedMessage(this.viewPgpPassword())},i.prototype.readReceipt=function(e){e&&""!==e.readReceipt()&&(h.sendReadReceiptMessage(c.emptyFunction,e.folderFullNameRaw,e.uid,e.readReceipt(),c.i18n("READ_RECEIPT/SUBJECT",{SUBJECT:e.subject()}),c.i18n("READ_RECEIPT/BODY",{"READ-RECEIPT":p.accountEmail()})),e.isReadReceipt(!0),d.storeMessageFlagsToCache(e),t("App:RainLoop").reloadFlagsCurrentMessageListAndMessageFromCache())},e.exports=i}(t,e)},{$:20,"App:Knoin":27,"App:RainLoop":3,Consts:6,Enums:7,Events:8,Globals:9,"Knoin:AbstractViewModel":30,"Storage:RainLoop:Cache":63,"Storage:RainLoop:Data":64,"Storage:RainLoop:Remote":68,Utils:14,"View:Popup:Compose":82,key:21,ko:22}],76:[function(e,t){!function(e,t){"use strict";function i(){o.call(this),s.constructorEnd(this)}var s=t("App:Knoin"),o=t("View:RainLoop:AbstractSystemDropDown");s.extendAsViewModel("MailBoxSystemDropDownViewModel",i,o),e.exports=i}(t,e)},{"App:Knoin":27,"View:RainLoop:AbstractSystemDropDown":71}],77:[function(e,t){!function(e,t){"use strict";function i(){c.call(this,"Popups","PopupsAddAccount"),this.email=o.observable(""),this.password=o.observable(""),this.emailError=o.observable(!1),this.passwordError=o.observable(!1),this.email.subscribe(function(){this.emailError(!1)},this),this.password.subscribe(function(){this.passwordError(!1)},this),this.submitRequest=o.observable(!1),this.submitError=o.observable(""),this.emailFocus=o.observable(!1),this.addAccountCommand=a.createCommand(this,function(){return this.emailError(""===a.trim(this.email())),this.passwordError(""===a.trim(this.password())),this.emailError()||this.passwordError()?!1:(this.submitRequest(!0),r.accountAdd(s.bind(function(e,i){this.submitRequest(!1),n.StorageResultType.Success===e&&i&&"AccountAdd"===i.Action?i.Result?(t("App:RainLoop").accountsAndIdentities(),this.cancelCommand()):i.ErrorCode&&this.submitError(a.getNotification(i.ErrorCode)):this.submitError(a.getNotification(n.Notification.UnknownError))},this),this.email(),"",this.password()),!0)},function(){return!this.submitRequest()}),l.constructorEnd(this)}var s=t("_"),o=t("ko"),n=t("Enums"),a=t("Utils"),r=t("Storage:RainLoop:Remote"),l=t("App:Knoin"),c=t("Knoin:AbstractViewModel");l.extendAsViewModel("PopupsAddAccountViewModel",i),i.prototype.clearPopup=function(){this.email(""),this.password(""),this.emailError(!1),this.passwordError(!1),this.submitRequest(!1),this.submitError("")},i.prototype.onShow=function(){this.clearPopup()},i.prototype.onFocus=function(){this.emailFocus(!0)},e.exports=i}(t,e)},{"App:Knoin":27,"App:RainLoop":3,Enums:7,"Knoin:AbstractViewModel":30,"Storage:RainLoop:Remote":68,Utils:14,_:25,ko:22}],78:[function(e,t){!function(e,t){"use strict";function i(){r.call(this,"Popups","PopupsAddOpenPgpKey"),this.key=s.observable(""),this.key.error=s.observable(!1),this.key.focus=s.observable(!1),this.key.subscribe(function(){this.key.error(!1)},this),this.addOpenPgpKeyCommand=o.createCommand(this,function(){var e=30,i=null,s=o.trim(this.key()),a=/[\-]{3,6}BEGIN[\s]PGP[\s](PRIVATE|PUBLIC)[\s]KEY[\s]BLOCK[\-]{3,6}[\s\S]+?[\-]{3,6}END[\s]PGP[\s](PRIVATE|PUBLIC)[\s]KEY[\s]BLOCK[\-]{3,6}/gi,r=n.openpgpKeyring;if(s=s.replace(/[\r\n]([a-zA-Z0-9]{2,}:[^\r\n]+)[\r\n]+([a-zA-Z0-9\/\\+=]{10,})/g,"\n$1!-!N!-!$2").replace(/[\n\r]+/g,"\n").replace(/!-!N!-!/g,"\n\n"),this.key.error(""===s),!r||this.key.error())return!1;for(;;){if(i=a.exec(s),!i||0>e)break;i[0]&&i[1]&&i[2]&&i[1]===i[2]&&("PRIVATE"===i[1]?r.privateKeys.importKey(i[0]):"PUBLIC"===i[1]&&r.publicKeys.importKey(i[0])),e--}return r.store(),t("App:RainLoop").reloadOpenPgpKeys(),o.delegateRun(this,"cancelCommand"),!0}),a.constructorEnd(this)}var s=t("ko"),o=t("Utils"),n=t("Storage:RainLoop:Data"),a=t("App:Knoin"),r=t("Knoin:AbstractViewModel");a.extendAsViewModel("PopupsAddOpenPgpKeyViewModel",i),i.prototype.clearPopup=function(){this.key(""),this.key.error(!1)},i.prototype.onShow=function(){this.clearPopup()},i.prototype.onFocus=function(){this.key.focus(!0)},e.exports=i}(t,e)},{"App:Knoin":27,"App:RainLoop":3,"Knoin:AbstractViewModel":30,"Storage:RainLoop:Data":64,Utils:14,ko:22}],79:[function(e,t){!function(e,t){"use strict";function i(){l.call(this,"Popups","PopupsAdvancedSearch"),this.fromFocus=s.observable(!1),this.from=s.observable(""),this.to=s.observable(""),this.subject=s.observable(""),this.text=s.observable(""),this.selectedDateValue=s.observable(-1),this.hasAttachment=s.observable(!1),this.starred=s.observable(!1),this.unseen=s.observable(!1),this.searchCommand=n.createCommand(this,function(){var e=this.buildSearchString();""!==e&&a.mainMessageListSearch(e),this.cancelCommand()}),r.constructorEnd(this)}var s=t("ko"),o=t("moment"),n=t("Utils"),a=t("Storage:RainLoop:Data"),r=t("App:Knoin"),l=t("Knoin:AbstractViewModel");r.extendAsViewModel("PopupsAdvancedSearchViewModel",i),i.prototype.buildSearchStringValue=function(e){return-1"},i.prototype.sendMessageResponse=function(e,t){var i=!1,o="";this.sending(!1),u.StorageResultType.Success===e&&t&&t.Result&&(i=!0,this.modalVisibility()&&p.delegateRun(this,"closeCommand")),this.modalVisibility()&&!i&&(t&&u.Notification.CantSaveMessage===t.ErrorCode?(this.sendSuccessButSaveError(!0),s.alert(p.trim(p.i18n("COMPOSE/SAVED_ERROR_ON_SEND")))):(o=p.getNotification(t&&t.ErrorCode?t.ErrorCode:u.Notification.CantSendMessage,t&&t.ErrorMessage?t.ErrorMessage:""),this.sendError(!0),s.alert(o||p.getNotification(u.Notification.CantSendMessage)))),this.reloadDraftFolder()},i.prototype.saveMessageResponse=function(e,t){var i=!1,o=null;this.saving(!1),u.StorageResultType.Success===e&&t&&t.Result&&t.Result.NewFolder&&t.Result.NewUid&&(this.bFromDraft&&(o=S.message(),o&&this.draftFolder()===o.folderFullNameRaw&&this.draftUid()===o.uid&&S.message(null)),this.draftFolder(t.Result.NewFolder),this.draftUid(t.Result.NewUid),this.modalVisibility()&&(this.savedTime(s.Math.round((new s.Date).getTime()/1e3)),this.savedOrSendingText(0"+e;break;default:e=e+"
    "+i}return e},i.prototype.editor=function(e){if(e){var t=this;!this.oEditor&&this.composeEditorArea()?n.delay(function(){t.oEditor=new f(t.composeEditorArea(),null,function(){e(t.oEditor)},function(e){t.isHtml(!!e)})},300):this.oEditor&&e(this.oEditor)}},i.prototype.onShow=function(e,t,i,s,a){C.routeOff();var r=this,l="",c="",d="",h="",g="",m=null,f="",b="",y=[],w={},A=S.accountEmail(),T=S.signature(),F=S.signatureToAll(),R=[],L=null,E=null,N=e||u.ComposeType.Empty,P=function(e,t){for(var i=0,s=e.length,o=[];s>i;i++)o.push(e[i].toLine(!!t));return o.join(", ")};if(t=t||null,t&&p.isNormal(t)&&(E=p.isArray(t)&&1===t.length?t[0]:p.isArray(t)?null:t),null!==A&&(w[A]=!0),this.currentIdentityID(this.findIdentityIdByMessage(N,E)),this.reset(),p.isNonEmptyArray(i)&&this.to(P(i)),""!==N&&E){switch(h=E.fullFormatDateValue(),g=E.subject(),L=E.aDraftInfo,m=o(E.body).clone(),p.removeBlockquoteSwitcher(m),m.find("[data-html-editor-font-wrapper]").removeAttr("data-html-editor-font-wrapper"),f=m.html(),N){case u.ComposeType.Empty:break;case u.ComposeType.Reply:this.to(P(E.replyEmails(w))),this.subject(p.replySubjectAdd("Re",g)),this.prepearMessageAttachments(E,N),this.aDraftInfo=["reply",E.uid,E.folderFullNameRaw],this.sInReplyTo=E.sMessageId,this.sReferences=p.trim(this.sInReplyTo+" "+E.sReferences);break;case u.ComposeType.ReplyAll:y=E.replyAllEmails(w),this.to(P(y[0])),this.cc(P(y[1])),this.subject(p.replySubjectAdd("Re",g)),this.prepearMessageAttachments(E,N),this.aDraftInfo=["reply",E.uid,E.folderFullNameRaw],this.sInReplyTo=E.sMessageId,this.sReferences=p.trim(this.sInReplyTo+" "+E.references());break;case u.ComposeType.Forward:this.subject(p.replySubjectAdd("Fwd",g)),this.prepearMessageAttachments(E,N),this.aDraftInfo=["forward",E.uid,E.folderFullNameRaw],this.sInReplyTo=E.sMessageId,this.sReferences=p.trim(this.sInReplyTo+" "+E.sReferences);break;case u.ComposeType.ForwardAsAttachment:this.subject(p.replySubjectAdd("Fwd",g)),this.prepearMessageAttachments(E,N),this.aDraftInfo=["forward",E.uid,E.folderFullNameRaw],this.sInReplyTo=E.sMessageId,this.sReferences=p.trim(this.sInReplyTo+" "+E.sReferences);break;case u.ComposeType.Draft:this.to(P(E.to)),this.cc(P(E.cc)),this.bcc(P(E.bcc)),this.bFromDraft=!0,this.draftFolder(E.folderFullNameRaw),this.draftUid(E.uid),this.subject(g),this.prepearMessageAttachments(E,N),this.aDraftInfo=p.isNonEmptyArray(L)&&3===L.length?L:null,this.sInReplyTo=E.sInReplyTo,this.sReferences=E.sReferences;break;case u.ComposeType.EditAsNew:this.to(P(E.to)),this.cc(P(E.cc)),this.bcc(P(E.bcc)),this.subject(g),this.prepearMessageAttachments(E,N),this.aDraftInfo=p.isNonEmptyArray(L)&&3===L.length?L:null,this.sInReplyTo=E.sInReplyTo,this.sReferences=E.sReferences}switch(N){case u.ComposeType.Reply:case u.ComposeType.ReplyAll:l=E.fromToLine(!1,!0),b=p.i18n("COMPOSE/REPLY_MESSAGE_TITLE",{DATETIME:h,EMAIL:l}),f="

    "+b+":

    "+f+"

    ";break;case u.ComposeType.Forward:l=E.fromToLine(!1,!0),c=E.toToLine(!1,!0),d=E.ccToLine(!1,!0),f="


    "+p.i18n("COMPOSE/FORWARD_MESSAGE_TOP_TITLE")+"
    "+p.i18n("COMPOSE/FORWARD_MESSAGE_TOP_FROM")+": "+l+"
    "+p.i18n("COMPOSE/FORWARD_MESSAGE_TOP_TO")+": "+c+(0"+p.i18n("COMPOSE/FORWARD_MESSAGE_TOP_CC")+": "+d:"")+"
    "+p.i18n("COMPOSE/FORWARD_MESSAGE_TOP_SENT")+": "+p.encodeHtml(h)+"
    "+p.i18n("COMPOSE/FORWARD_MESSAGE_TOP_SUBJECT")+": "+p.encodeHtml(g)+"

    "+f;break;case u.ComposeType.ForwardAsAttachment:f=""}F&&""!==T&&u.ComposeType.EditAsNew!==N&&u.ComposeType.Draft!==N&&(f=this.convertSignature(T,P(E.from,!0),f,N)),this.editor(function(e){e.setHtml(f,!1),E.isHtml()||e.modeToggle(!1)})}else u.ComposeType.Empty===N?(this.subject(p.isNormal(s)?""+s:""),f=p.isNormal(a)?""+a:"",F&&""!==T&&(f=this.convertSignature(T,"",p.convertPlainTextToHtml(f),N)),this.editor(function(e){e.setHtml(f,!1),u.EditorDefaultType.Html!==S.editorDefaultType()&&e.modeToggle(!1)})):p.isNonEmptyArray(t)&&n.each(t,function(e){r.addMessageAsAttachment(e)});R=this.getAttachmentsDownloadsForUpload(),p.isNonEmptyArray(R)&&v.messageUploadAttachments(function(e,t){if(u.StorageResultType.Success===e&&t&&t.Result){var i=null,s="";if(!r.viewModelVisibility())for(s in t.Result)t.Result.hasOwnProperty(s)&&(i=r.getAttachmentById(t.Result[s]),i&&i.tempName(s))}else r.setMessageAttachmentFailedDowbloadText()},R),this.triggerForResize()},i.prototype.onFocus=function(){""===this.to()?this.to.focusTrigger(!this.to.focusTrigger()):this.oEditor&&this.oEditor.focus(),this.triggerForResize()},i.prototype.editorResize=function(){this.oEditor&&this.oEditor.resize()},i.prototype.tryToClosePopup=function(){var e=this,i=t("View:Popup:Ask");C.isPopupVisible(i)||C.showScreenPopup(i,[p.i18n("POPUPS_ASK/DESC_WANT_CLOSE_THIS_WINDOW"),function(){e.modalVisibility()&&p.delegateRun(e,"closeCommand")}])},i.prototype.onBuild=function(){this.initUploader();var e=this,t=null;key("ctrl+q, command+q",u.KeyState.Compose,function(){return e.identitiesDropdownTrigger(!0),!1}),key("ctrl+s, command+s",u.KeyState.Compose,function(){return e.saveCommand(),!1}),key("ctrl+enter, command+enter",u.KeyState.Compose,function(){return e.sendCommand(),!1}),key("esc",u.KeyState.Compose,function(){return e.modalVisibility()&&e.tryToClosePopup(),!1}),h.$win.on("resize",function(){e.triggerForResize()}),this.dropboxEnabled()&&(t=s.document.createElement("script"),t.type="text/javascript",t.src="https://www.dropbox.com/static/api/1/dropins.js",o(t).attr("id","dropboxjs").attr("data-app-key",b.settingsGet("DropboxApiKey")),s.document.body.appendChild(t)),this.driveEnabled()&&o.getScript("https://apis.google.com/js/api.js",function(){s.gapi&&e.driveVisible(!0)})},i.prototype.driveCallback=function(e,t){if(t&&s.XMLHttpRequest&&s.google&&t[s.google.picker.Response.ACTION]===s.google.picker.Action.PICKED&&t[s.google.picker.Response.DOCUMENTS]&&t[s.google.picker.Response.DOCUMENTS][0]&&t[s.google.picker.Response.DOCUMENTS][0].id){var i=this,o=new s.XMLHttpRequest;o.open("GET","https://www.googleapis.com/drive/v2/files/"+t[s.google.picker.Response.DOCUMENTS][0].id),o.setRequestHeader("Authorization","Bearer "+e),o.addEventListener("load",function(){if(o&&o.responseText){var t=l.parse(o.responseText),s=function(e,t,i){e&&e.exportLinks&&(e.exportLinks[t]?(e.downloadUrl=e.exportLinks[t],e.title=e.title+"."+i,e.mimeType=t):e.exportLinks["application/pdf"]&&(e.downloadUrl=e.exportLinks["application/pdf"],e.title=e.title+".pdf",e.mimeType="application/pdf"))};if(t&&!t.downloadUrl&&t.mimeType&&t.exportLinks)switch(t.mimeType.toString().toLowerCase()){case"application/vnd.google-apps.document":s(t,"application/vnd.openxmlformats-officedocument.wordprocessingml.document","docx");break;case"application/vnd.google-apps.spreadsheet":s(t,"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","xlsx");break;case"application/vnd.google-apps.drawing":s(t,"image/png","png");break;case"application/vnd.google-apps.presentation":s(t,"application/vnd.openxmlformats-officedocument.presentationml.presentation","pptx");break;default:s(t,"application/pdf","pdf")}t&&t.downloadUrl&&i.addDriveAttachment(t,e)}}),o.send()}},i.prototype.driveCreatePiker=function(e){if(s.gapi&&e&&e.access_token){var t=this;s.gapi.load("picker",{callback:function(){if(s.google&&s.google.picker){var i=(new s.google.picker.PickerBuilder).addView((new s.google.picker.DocsView).setIncludeFolders(!0)).setAppId(b.settingsGet("GoogleClientID")).setOAuthToken(e.access_token).setCallback(n.bind(t.driveCallback,t,e.access_token)).enableFeature(s.google.picker.Feature.NAV_HIDDEN).build();i.setVisible(!0)}}})}},i.prototype.driveOpenPopup=function(){if(s.gapi){var e=this;s.gapi.load("auth",{callback:function(){var t=s.gapi.auth.getToken();t?e.driveCreatePiker(t):s.gapi.auth.authorize({client_id:b.settingsGet("GoogleClientID"),scope:"https://www.googleapis.com/auth/drive.readonly",immediate:!0},function(t){if(t&&!t.error){var i=s.gapi.auth.getToken();i&&e.driveCreatePiker(i)}else s.gapi.auth.authorize({client_id:b.settingsGet("GoogleClientID"),scope:"https://www.googleapis.com/auth/drive.readonly",immediate:!1},function(t){if(t&&!t.error){var i=s.gapi.auth.getToken();i&&e.driveCreatePiker(i)}})})}})}},i.prototype.getAttachmentById=function(e){for(var t=this.attachments(),i=0,s=t.length;s>i;i++)if(t[i]&&e===t[i].id)return t[i];return null},i.prototype.initUploader=function(){if(this.composeUploaderButton()){var e={},t=p.pInt(b.settingsGet("AttachmentLimit")),i=new c({action:g.upload(),name:"uploader",queueSize:2,multipleSizeLimit:50,disableFolderDragAndDrop:!1,clickElement:this.composeUploaderButton(),dragAndDropElement:this.composeUploaderDropPlace()});i?(i.on("onDragEnter",n.bind(function(){this.dragAndDropOver(!0)},this)).on("onDragLeave",n.bind(function(){this.dragAndDropOver(!1)},this)).on("onBodyDragEnter",n.bind(function(){this.dragAndDropVisible(!0)},this)).on("onBodyDragLeave",n.bind(function(){this.dragAndDropVisible(!1)},this)).on("onProgress",n.bind(function(t,i,o){var n=null;p.isUnd(e[t])?(n=this.getAttachmentById(t),n&&(e[t]=n)):n=e[t],n&&n.progress(" - "+s.Math.floor(i/o*100)+"%")},this)).on("onSelect",n.bind(function(e,s){this.dragAndDropOver(!1);var o=this,n=p.isUnd(s.FileName)?"":s.FileName.toString(),a=p.isNormal(s.Size)?p.pInt(s.Size):null,r=new w(e,n,a);return r.cancel=function(e){return function(){o.attachments.remove(function(t){return t&&t.id===e}),i&&i.cancel(e)}}(e),this.attachments.push(r),a>0&&t>0&&a>t?(r.error(p.i18n("UPLOAD/ERROR_FILE_IS_TOO_BIG")),!1):!0},this)).on("onStart",n.bind(function(t){var i=null;p.isUnd(e[t])?(i=this.getAttachmentById(t),i&&(e[t]=i)):i=e[t],i&&(i.waiting(!1),i.uploading(!0))},this)).on("onComplete",n.bind(function(t,i,s){var o="",n=null,a=null,r=this.getAttachmentById(t);a=i&&s&&s.Result&&s.Result.Attachment?s.Result.Attachment:null,n=s&&s.Result&&s.Result.ErrorCode?s.Result.ErrorCode:null,null!==n?o=p.getUploadErrorDescByCode(n):a||(o=p.i18n("UPLOAD/ERROR_UNKNOWN")),r&&(""!==o&&00&&o>0&&n>o?(i.uploading(!1),i.error(p.i18n("UPLOAD/ERROR_FILE_IS_TOO_BIG")),!1):(v.composeUploadExternals(function(e,t){var s=!1;i.uploading(!1),u.StorageResultType.Success===e&&t&&t.Result&&t.Result[i.id]&&(s=!0,i.tempName(t.Result[i.id])),s||i.error(p.getUploadErrorDescByCode(u.UploadErrorCode.FileNoUploaded))},[e.link]),!0)},i.prototype.addDriveAttachment=function(e,t){var i=this,s=function(e){return function(){i.attachments.remove(function(t){return t&&t.id===e})}},o=p.pInt(b.settingsGet("AttachmentLimit")),n=null,a=e.fileSize?p.pInt(e.fileSize):0;return n=new w(e.downloadUrl,e.title,a),n.fromMessage=!1,n.cancel=s(e.downloadUrl),n.waiting(!1).uploading(!0),this.attachments.push(n),a>0&&o>0&&a>o?(n.uploading(!1),n.error(p.i18n("UPLOAD/ERROR_FILE_IS_TOO_BIG")),!1):(v.composeUploadDrive(function(e,t){var i=!1;n.uploading(!1),u.StorageResultType.Success===e&&t&&t.Result&&t.Result[n.id]&&(i=!0,n.tempName(t.Result[n.id][0]),n.size(p.pInt(t.Result[n.id][1]))),i||n.error(p.getUploadErrorDescByCode(u.UploadErrorCode.FileNoUploaded))},e.downloadUrl,t),!0)},i.prototype.prepearMessageAttachments=function(e,t){if(e){var i=this,s=p.isNonEmptyArray(e.attachments())?e.attachments():[],o=0,n=s.length,a=null,r=null,l=!1,c=function(e){return function(){i.attachments.remove(function(t){return t&&t.id===e})}};if(u.ComposeType.ForwardAsAttachment===t)this.addMessageAsAttachment(e);else for(;n>o;o++){switch(r=s[o],l=!1,t){case u.ComposeType.Reply:case u.ComposeType.ReplyAll:l=r.isLinked;break;case u.ComposeType.Forward:case u.ComposeType.Draft:case u.ComposeType.EditAsNew:l=!0}l&&(a=new w(r.download,r.fileName,r.estimatedSize,r.isInline,r.isLinked,r.cid,r.contentLocation),a.fromMessage=!0,a.cancel=c(r.download),a.waiting(!1).uploading(!0),this.attachments.push(a))}}},i.prototype.removeLinkedAttachments=function(){this.attachments.remove(function(e){return e&&e.isLinked})},i.prototype.setMessageAttachmentFailedDowbloadText=function(){n.each(this.attachments(),function(e){e&&e.fromMessage&&e.waiting(!1).uploading(!1).error(p.getUploadErrorDescByCode(u.UploadErrorCode.FileNoUploaded))},this)},i.prototype.isEmptyForm=function(e){e=p.isUnd(e)?!0:!!e;var t=e?0===this.attachments().length:0===this.attachmentsInReady().length;return 0===this.to().length&&0===this.cc().length&&0===this.bcc().length&&0===this.subject().length&&t&&(!this.oEditor||""===this.oEditor.getData())},i.prototype.reset=function(){this.to(""),this.cc(""),this.bcc(""),this.replyTo(""),this.subject(""),this.requestReadReceipt(!1),this.aDraftInfo=null,this.sInReplyTo="",this.bFromDraft=!1,this.sReferences="",this.sendError(!1),this.sendSuccessButSaveError(!1),this.savedError(!1),this.savedTime(0),this.savedOrSendingText(""),this.emptyToError(!1),this.attachmentsInProcessError(!1),this.showCcAndBcc(!1),this.attachments([]),this.dragAndDropOver(!1),this.dragAndDropVisible(!1),this.draftFolder(""),this.draftUid(""),this.sending(!1),this.saving(!1),this.oEditor&&this.oEditor.clear(!1)},i.prototype.getAttachmentsDownloadsForUpload=function(){return n.map(n.filter(this.attachments(),function(e){return e&&""===e.tempName()}),function(e){return e.id})},i.prototype.triggerForResize=function(){this.resizer(!this.resizer()),this.editorResizeThrottle()},e.exports=i}(t,e)},{$:20,"App:Knoin":27,"App:RainLoop":3,Consts:6,Enums:7,Events:8,Globals:9,HtmlEditor:10,JSON:15,Jua:16,"Knoin:AbstractViewModel":30,LinkBuilder:11,"Model:ComposeAttachment":33,"Storage:RainLoop:Cache":63,"Storage:RainLoop:Data":64,"Storage:RainLoop:Remote":68,"Storage:Settings":69,Utils:14,"View:Popup:Ask":80,"View:Popup:ComposeOpenPgp":81,"View:Popup:FolderSystem":87,_:25,ko:22,moment:23,window:26}],83:[function(e,t){!function(e,t){"use strict";function i(){w.call(this,"Popups","PopupsContacts");var e=this,i=function(t){t&&0=e?1:e},this),this.contactsPagenator=a.computed(d.computedPagenatorHelper(this.contactsPage,this.contactsPageCount)),this.emptySelection=a.observable(!0),this.viewClearSearch=a.observable(!1),this.viewID=a.observable(""),this.viewReadOnly=a.observable(!1),this.viewProperties=a.observableArray([]),this.viewTags=a.observable(""),this.viewTags.visibility=a.observable(!1),this.viewTags.focusTrigger=a.observable(!1),this.viewTags.focusTrigger.subscribe(function(e){e||""!==this.viewTags()?e&&this.viewTags.visibility(!0):this.viewTags.visibility(!1)},this),this.viewSaveTrigger=a.observable(l.SaveSettingsStep.Idle),this.viewPropertiesNames=this.viewProperties.filter(function(e){return-1=s&&(this.bDropPageAfterDelete=!0),n.delay(function(){n.each(o,function(e){t.remove(e)})},500))},i.prototype.deleteSelectedContacts=function(){00?s:0),d.isNonEmptyArray(i.Result.Tags)&&(a=n.map(i.Result.Tags,function(e){var t=new S;return t.parse(e)?t:null}),a=n.compact(a))),t.contactsCount(s),t.contacts(o),t.contacts.loading(!1),t.contactTags(a),t.viewClearSearch(""!==t.search())},i,c.Defaults.ContactsPerPage,this.search())},i.prototype.onBuild=function(e){this.oContentVisible=o(".b-list-content",e),this.oContentScrollable=o(".content",this.oContentVisible),this.selector.init(this.oContentVisible,this.oContentScrollable,l.KeyState.ContactList);var t=this;r("delete",l.KeyState.ContactList,function(){return t.deleteCommand(),!1}),e.on("click",".e-pagenator .e-page",function(){var e=a.dataFor(this);e&&(t.contactsPage(d.pInt(e.value)),t.reloadContactList())}),this.initUploader()},i.prototype.onShow=function(){v.routeOff(),this.reloadContactList(!0)},i.prototype.onHide=function(){v.routeOn(),this.currentContact(null),this.emptySelection(!0),this.search(""),this.contactsCount(0),this.contacts([])},e.exports=i}(t,e)},{$:20,"App:Knoin":27,"App:RainLoop":3,Consts:6,Enums:7,Globals:9,"Knoin:AbstractViewModel":30,LinkBuilder:11,"Model:Contact":34,"Model:ContactProperty":35,"Model:ContactTag":36,"Model:Email":37,Selector:13,"Storage:RainLoop:Data":64,"Storage:RainLoop:Remote":68,Utils:14,"View:Popup:Compose":82,"View:Popup:Contacts":83,_:25,key:21,ko:22,window:26}],84:[function(e,t){!function(e,t){"use strict";function i(){l.call(this,"Popups","PopupsFilter"),this.filter=s.observable(null),this.selectedFolderValue=s.observable(o.Values.UnuseOptionValue),this.folderSelectList=a.folderMenuForMove,this.defautOptionsAfterRender=n.defautOptionsAfterRender,r.constructorEnd(this)}var s=t("ko"),o=t("Consts"),n=t("Utils"),a=t("Storage:RainLoop:Data"),r=t("App:Knoin"),l=t("Knoin:AbstractViewModel");r.extendAsViewModel("PopupsFilterViewModel",i),i.prototype.clearPopup=function(){},i.prototype.onShow=function(e){this.clearPopup(),this.filter(e)},e.exports=i}(t,e)},{"App:Knoin":27,Consts:6,"Knoin:AbstractViewModel":30,"Storage:RainLoop:Data":64,Utils:14,ko:22}],85:[function(e,t){!function(e,t){"use strict";function i(){u.call(this,"Popups","PopupsFolderClear"),this.selectedFolder=s.observable(null),this.clearingProcess=s.observable(!1),this.clearingError=s.observable(""),this.folderFullNameForClear=s.computed(function(){var e=this.selectedFolder();return e?e.printableFullName():""},this),this.folderNameForClear=s.computed(function(){var e=this.selectedFolder();return e?e.localName():""},this),this.dangerDescHtml=s.computed(function(){return n.i18n("POPUPS_CLEAR_FOLDER/DANGER_DESC_HTML_1",{FOLDER:this.folderNameForClear()})},this),this.clearCommand=n.createCommand(this,function(){var e=this,i=this.selectedFolder();i&&(a.message(null),a.messageList([]),this.clearingProcess(!0),i.messageCountAll(0),i.messageCountUnread(0),r.setFolderHash(i.fullNameRaw,""),l.folderClear(function(i,s){e.clearingProcess(!1),o.StorageResultType.Success===i&&s&&s.Result?(t("App:RainLoop").reloadMessageList(!0),e.cancelCommand()):e.clearingError(s&&s.ErrorCode?n.getNotification(s.ErrorCode):n.getNotification(o.Notification.MailServerError))},i.fullNameRaw))},function(){var e=this.selectedFolder(),t=this.clearingProcess();return!t&&null!==e}),c.constructorEnd(this)}var s=t("ko"),o=t("Enums"),n=t("Utils"),a=t("Storage:RainLoop:Data"),r=t("Storage:RainLoop:Cache"),l=t("Storage:RainLoop:Remote"),c=t("App:Knoin"),u=t("Knoin:AbstractViewModel");c.extendAsViewModel("PopupsFolderClearViewModel",i),i.prototype.clearPopup=function(){this.clearingProcess(!1),this.selectedFolder(null)},i.prototype.onShow=function(e){this.clearPopup(),e&&this.selectedFolder(e)},e.exports=i}(t,e)},{"App:Knoin":27,"App:RainLoop":3,Enums:7,"Knoin:AbstractViewModel":30,"Storage:RainLoop:Cache":63,"Storage:RainLoop:Data":64,"Storage:RainLoop:Remote":68,Utils:14,ko:22}],86:[function(e,t){!function(e,t){"use strict";function i(){u.call(this,"Popups","PopupsFolderCreate"),a.initOnStartOrLangChange(function(){this.sNoParentText=a.i18n("POPUPS_CREATE_FOLDER/SELECT_NO_PARENT")},this),this.folderName=s.observable(""),this.folderName.focused=s.observable(!1),this.selectedParentValue=s.observable(n.Values.UnuseOptionValue),this.parentFolderSelectList=s.computed(function(){var e=[],t=null,i=null,s=r.folderList(),o=function(e){return e?e.isSystemFolder()?e.name()+" "+e.manageFolderSystemName():e.name():""};return e.push(["",this.sNoParentText]),""!==r.namespace&&(t=function(e){return r.namespace!==e.fullNameRaw.substr(0,r.namespace.length)}),a.folderListOptionsBuilder([],s,[],e,null,t,i,o)},this),this.createFolder=a.createCommand(this,function(){var e=this.selectedParentValue();""===e&&1 li"),o=i&&("tab"===i.shortcut||"right"===i.shortcut),n=s.index(s.filter(".active"));return!o&&n>0?n--:o&&n"),this.submitRequest(!0),o.delay(function(){n=s.openpgp.generateKeyPair({userId:i,numBits:a.pInt(e.keyBitLength()),passphrase:a.trim(e.password())}),n&&n.privateKeyArmored&&(l.privateKeys.importKey(n.privateKeyArmored),l.publicKeys.importKey(n.publicKeyArmored),l.store(),t("App:RainLoop").reloadOpenPgpKeys(),a.delegateRun(e,"cancelCommand")),e.submitRequest(!1)},100),!0)}),l.constructorEnd(this)}var s=t("window"),o=t("_"),n=t("ko"),a=t("Utils"),r=t("Storage:RainLoop:Data"),l=t("App:Knoin"),c=t("Knoin:AbstractViewModel");l.extendAsViewModel("PopupsNewOpenPgpKeyViewModel",i),i.prototype.clearPopup=function(){this.name(""),this.password(""),this.email(""),this.email.error(!1),this.keyBitLength(2048)},i.prototype.onShow=function(){this.clearPopup()},i.prototype.onFocus=function(){this.email.focus(!0)},e.exports=i}(t,e)},{"App:Knoin":27,"App:RainLoop":3,"Knoin:AbstractViewModel":30,"Storage:RainLoop:Data":64,Utils:14,_:25,ko:22,window:26}],92:[function(e,t){!function(e,t){"use strict";function i(){l.call(this,"Popups","PopupsTwoFactorTest");var e=this;this.code=s.observable(""),this.code.focused=s.observable(!1),this.code.status=s.observable(null),this.testing=s.observable(!1),this.testCode=n.createCommand(this,function(){this.testing(!0),a.testTwoFactor(function(t,i){e.testing(!1),e.code.status(o.StorageResultType.Success===t&&i&&i.Result?!0:!1)},this.code())},function(){return""!==this.code()&&!this.testing()}),r.constructorEnd(this)}var s=t("ko"),o=t("Enums"),n=t("Utils"),a=t("Storage:RainLoop:Remote"),r=t("App:Knoin"),l=t("Knoin:AbstractViewModel");r.extendAsViewModel("PopupsTwoFactorTestViewModel",i),i.prototype.clearPopup=function(){this.code(""),this.code.focused(!1),this.code.status(null),this.testing(!1)},i.prototype.onShow=function(){this.clearPopup()},i.prototype.onFocus=function(){this.code.focused(!0)},e.exports=i}(t,e)},{"App:Knoin":27,Enums:7,"Knoin:AbstractViewModel":30,"Storage:RainLoop:Remote":68,Utils:14,ko:22}],93:[function(e,t){!function(e,t){"use strict";function i(){a.call(this,"Popups","PopupsViewOpenPgpKey"),this.key=s.observable(""),this.keyDom=s.observable(null),n.constructorEnd(this)}var s=t("ko"),o=t("Utils"),n=t("App:Knoin"),a=t("Knoin:AbstractViewModel");n.extendAsViewModel("PopupsViewOpenPgpKeyViewModel",i),i.prototype.clearPopup=function(){this.key("")},i.prototype.selectKey=function(){var e=this.keyDom();e&&o.selectElement(e)},i.prototype.onShow=function(e){this.clearPopup(),e&&this.key(e.armor)},e.exports=i}(t,e)},{"App:Knoin":27,"Knoin:AbstractViewModel":30,Utils:14,ko:22}],94:[function(e,t){!function(e,t){"use strict";function i(e){a.call(this,"Left","SettingsMenu"),this.leftPanelDisabled=o.leftPanelDisabled,this.menu=e.menu,n.constructorEnd(this)}var s=t("LinkBuilder"),o=t("Globals"),n=t("App:Knoin"),a=t("Knoin:AbstractViewModel");n.extendAsViewModel("SettingsMenuViewModel",i),i.prototype.link=function(e){return s.settings(e)},i.prototype.backToMailBoxClick=function(){n.setHash(s.inbox())},e.exports=i}(t,e)},{"App:Knoin":27,Globals:9,"Knoin:AbstractViewModel":30,LinkBuilder:11}],95:[function(e,t){!function(e,t){"use strict";function i(){l.call(this,"Right","SettingsPane"),r.constructorEnd(this)}var s=t("key"),o=t("Enums"),n=t("LinkBuilder"),a=t("Storage:RainLoop:Data"),r=t("App:Knoin"),l=t("Knoin:AbstractViewModel");r.extendAsViewModel("SettingsPaneViewModel",i),i.prototype.onBuild=function(){var e=this;s("esc",o.KeyState.Settings,function(){e.backToMailBoxClick()})},i.prototype.onShow=function(){a.message(null)},i.prototype.backToMailBoxClick=function(){r.setHash(n.inbox())},e.exports=i}(t,e)},{"App:Knoin":27,Enums:7,"Knoin:AbstractViewModel":30,LinkBuilder:11,"Storage:RainLoop:Data":64,key:21}],96:[function(e,t){!function(e,t){"use strict";function i(){o.call(this),s.constructorEnd(this)}var s=t("App:Knoin"),o=t("View:RainLoop:AbstractSystemDropDown");s.extendAsViewModel("SettingsSystemDropDownViewModel",i,o),e.exports=i}(t,e)},{"App:Knoin":27,"View:RainLoop:AbstractSystemDropDown":71}]},{},[1]); \ No newline at end of file +/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ +!function e(t,i,s){function o(a,r){if(!i[a]){if(!t[a]){var l="function"==typeof require&&require;if(!r&&l)return l(a,!0);if(n)return n(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var u=i[a]={exports:{}};t[a][0].call(u.exports,function(e){var i=t[a][1][e];return o(i?i:e)},u,u.exports,e,t,i,s)}return i[a].exports}for(var n="function"==typeof require&&require,a=0;a').appendTo("body"),a.$win.on("error",function(t){t&&t.originalEvent&&t.originalEvent.message&&-1===r.inArray(t.originalEvent.message,["Script error.","Uncaught Error: Error calling method on NPObject."])&&e.jsError(r.emptyFunction,t.originalEvent.message,t.originalEvent.filename,t.originalEvent.lineno,s.location&&s.location.toString?s.location.toString():"",a.$html.attr("class"),r.microtime()-a.now)}),a.$doc.on("keydown",function(e){e&&e.ctrlKey&&a.$html.addClass("rl-ctrl-key-pressed")}).on("keyup",function(e){e&&!e.ctrlKey&&a.$html.removeClass("rl-ctrl-key-pressed")})}var s=t("window"),o=t("_"),n=t("$"),a=t("Globals"),r=t("Utils"),l=t("LinkBuilder"),c=t("Events"),u=t("Storage:Settings"),d=t("Knoin:AbstractBoot");o.extend(i.prototype,d.prototype),i.prototype.remote=function(){return null},i.prototype.data=function(){return null},i.prototype.setupSettings=function(){return!0},i.prototype.download=function(e){var t=null,i=null,o=s.navigator.userAgent.toLowerCase();return o&&(o.indexOf("chrome")>-1||o.indexOf("chrome")>-1)&&(i=s.document.createElement("a"),i.href=e,s.document.createEvent&&(t=s.document.createEvent("MouseEvents"),t&&t.initEvent&&i.dispatchEvent))?(t.initEvent("click",!0,!0),i.dispatchEvent(t),!0):(a.bMobileDevice?(s.open(e,"_self"),s.focus()):this.iframe.attr("src",e),!0)},i.prototype.setTitle=function(e){e=(r.isNormal(e)&&0o;o++)g=e.Result["@Collection"][o],g&&"Object/Message"===g["@Object"]&&(m=h[o],m&&m.initByJson(g)||(m=C.newInstanceFromJson(g)),m&&(y.hasNewMessageAndRemoveFromCache(m.folderFullNameRaw,m.uid)&&5>=S&&(S++,m.newForAnimation(!0)),m.deleted(!1),t?y.initMessageFlagsFromCache(m):y.storeMessageFlagsToCache(m),m.lastInCollapsedThread(i&&-1s;s++)n=t[s],n&&(r=n.FullNameRaw,a=y.getFolderFromCacheList(r),a||(a=w.newInstanceFromJson(n),a&&(y.setFolderToCacheList(r,a),y.setFolderFullNameRaw(a.fullNameHash,r))),a&&(a.collapsed(!i.isFolderExpanded(a.fullNameHash)),n.Extended&&(n.Extended.Hash&&y.setFolderHash(a.fullNameRaw,n.Extended.Hash),d.isNormal(n.Extended.MessageCount)&&a.messageCountAll(n.Extended.MessageCount),d.isNormal(n.Extended.MessageUnseenCount)&&a.messageCountUnread(n.Extended.MessageUnseenCount)),l=n.SubFolders,l&&"Collection/FolderCollection"===l["@Object"]&&l["@Collection"]&&d.isArray(l["@Collection"])&&a.subFolders(this.folderResponseParseRec(e,l["@Collection"])),c.push(a)));return c},i.prototype.setFolders=function(e){var t=[],i=!1,s=function(e){return""===e||c.Values.UnuseOptionValue===e||null!==y.getFolderFromCacheList(e)?e:""};e&&e.Result&&"Collection/FolderCollection"===e.Result["@Object"]&&e.Result["@Collection"]&&d.isArray(e.Result["@Collection"])&&(d.isUnd(e.Result.Namespace)||(b.namespace=e.Result.Namespace),b.threading(!!f.settingsGet("UseImapThread")&&e.Result.IsThreadsSupported&&!0),t=this.folderResponseParseRec(b.namespace,e.Result["@Collection"]),b.folderList(t),e.Result.SystemFolders&&""==""+f.settingsGet("SentFolder")+f.settingsGet("DraftFolder")+f.settingsGet("SpamFolder")+f.settingsGet("TrashFolder")+f.settingsGet("ArchiveFolder")+f.settingsGet("NullFolder")&&(f.settingsSet("SentFolder",e.Result.SystemFolders[2]||null),f.settingsSet("DraftFolder",e.Result.SystemFolders[3]||null),f.settingsSet("SpamFolder",e.Result.SystemFolders[4]||null),f.settingsSet("TrashFolder",e.Result.SystemFolders[5]||null),f.settingsSet("ArchiveFolder",e.Result.SystemFolders[12]||null),i=!0),b.sentFolder(s(f.settingsGet("SentFolder"))),b.draftFolder(s(f.settingsGet("DraftFolder"))),b.spamFolder(s(f.settingsGet("SpamFolder"))),b.trashFolder(s(f.settingsGet("TrashFolder"))),b.archiveFolder(s(f.settingsGet("ArchiveFolder"))),i&&S.saveSystemFolders(d.emptyFunction,{SentFolder:b.sentFolder(),DraftFolder:b.draftFolder(),SpamFolder:b.spamFolder(),TrashFolder:b.trashFolder(),ArchiveFolder:b.archiveFolder(),NullFolder:"NullFolder"}),m.set(r.ClientSideKeyName.FoldersLashHash,e.Result.FoldersHash))},i.prototype.isFolderExpanded=function(e){var t=m.get(r.ClientSideKeyName.ExpandedFolders);return o.isArray(t)&&-1!==o.indexOf(t,e)},i.prototype.setExpandedFolder=function(e,t){var i=m.get(r.ClientSideKeyName.ExpandedFolders);o.isArray(i)||(i=[]),t?(i.push(e),i=o.uniq(i)):i=o.without(i,e),m.set(r.ClientSideKeyName.ExpandedFolders,i)},i.prototype.initLayoutResizer=function(e,t,i){var s=60,o=155,a=n(e),r=n(t),l=m.get(i)||null,c=function(e){e&&(a.css({width:""+e+"px"}),r.css({left:""+e+"px"}))},u=function(e){if(e)a.resizable("disable"),c(s);else{a.resizable("enable");var t=d.pInt(m.get(i))||o;c(t>o?t:o)}},p=function(e,t){t&&t.size&&t.size.width&&(m.set(i,t.size.width),r.css({left:""+t.size.width+"px"}))};null!==l&&c(l>o?l:o),a.resizable({helper:"ui-resizable-helper",minWidth:o,maxWidth:350,handles:"e",stop:p}),h.sub("left-panel.off",function(){u(!0)}),h.sub("left-panel.on",function(){u(!1)})},i.prototype.bootstartLoginScreen=function(){var e=d.pString(f.settingsGet("CustomLoginLink"));e?(g.routeOff(),g.setHash(p.root(),!0),g.routeOff(),o.defer(function(){s.location.href=e})):(g.hideLoading(),g.startScreens([t("Screen:RainLoop:Login")]),u.runHook("rl-start-login-screens"),h.pub("rl.bootstart-login-screens"))},i.prototype.bootstart=function(){R.prototype.bootstart.call(this),b.populateDataOnStart();var e=this,i=f.settingsGet("JsHash"),a=d.pInt(f.settingsGet("ContactsSyncInterval")),c=f.settingsGet("AllowGoogleSocial"),m=f.settingsGet("AllowFacebookSocial"),y=f.settingsGet("AllowTwitterSocial");d.initOnStartOrLangChange(function(){n.extend(!0,n.magnificPopup.defaults,{tClose:d.i18n("MAGNIFIC_POPUP/CLOSE"),tLoading:d.i18n("MAGNIFIC_POPUP/LOADING"),gallery:{tPrev:d.i18n("MAGNIFIC_POPUP/GALLERY_PREV"),tNext:d.i18n("MAGNIFIC_POPUP/GALLERY_NEXT"),tCounter:d.i18n("MAGNIFIC_POPUP/GALLERY_COUNTER")},image:{tError:d.i18n("MAGNIFIC_POPUP/IMAGE_ERROR")},ajax:{tError:d.i18n("MAGNIFIC_POPUP/AJAX_ERROR")}})},this),s.SimplePace&&(s.SimplePace.set(70),s.SimplePace.sleep()),l.leftPanelDisabled.subscribe(function(e){h.pub("left-panel."+(e?"off":"on"))}),f.settingsGet("Auth")?(this.setTitle(d.i18n("TITLES/LOADING")),this.folders(o.bind(function(i){g.hideLoading(),i?(s.$LAB&&s.crypto&&s.crypto.getRandomValues&&f.capa(r.Capa.OpenPGP)?s.$LAB.script(s.openpgp?"":p.openPgpJs()).wait(function(){s.openpgp&&(b.openpgpKeyring=new s.openpgp.Keyring,b.capaOpenPGP(!0),h.pub("openpgp.init"),e.reloadOpenPgpKeys())}):b.capaOpenPGP(!1),g.startScreens([t("Screen:RainLoop:MailBox"),t("Screen:RainLoop:Settings"),t("Screen:RainLoop:About")]),(c||m||y)&&e.socialUsers(!0),h.sub("interval.2m",function(){e.folderInformation("INBOX")}),h.sub("interval.2m",function(){var t=b.currentFolderFullNameRaw();"INBOX"!==t&&e.folderInformation(t)}),h.sub("interval.3m",function(){e.folderInformationMultiply()}),h.sub("interval.5m",function(){e.quota()}),h.sub("interval.10m",function(){e.folders()}),a=a>=5?a:20,a=320>=a?a:320,s.setInterval(function(){e.contactsSync()},6e4*a+5e3),o.delay(function(){e.contactsSync()},5e3),o.delay(function(){e.folderInformationMultiply(!0)},500),u.runHook("rl-start-user-screens"),h.pub("rl.bootstart-user-screens"),f.settingsGet("AccountSignMe")&&s.navigator.registerProtocolHandler&&o.delay(function(){try{s.navigator.registerProtocolHandler("mailto",s.location.protocol+"//"+s.location.host+s.location.pathname+"?mailto&to=%s",""+(f.settingsGet("Title")||"RainLoop"))}catch(e){}f.settingsGet("MailToEmail")&&d.mailToHelper(f.settingsGet("MailToEmail"),t("View:Popup:Compose"))},500),l.bMobileDevice||o.defer(function(){e.initLayoutResizer("#rl-left","#rl-right",r.ClientSideKeyName.FolderListSize)})):e.bootstartLoginScreen(),s.SimplePace&&s.SimplePace.set(100)},this))):(this.bootstartLoginScreen(),s.SimplePace&&s.SimplePace.set(100)),c&&(s["rl_"+i+"_google_service"]=function(){b.googleActions(!0),e.socialUsers()}),m&&(s["rl_"+i+"_facebook_service"]=function(){b.facebookActions(!0),e.socialUsers()}),y&&(s["rl_"+i+"_twitter_service"]=function(){b.twitterActions(!0),e.socialUsers()}),h.sub("interval.1m",function(){l.momentTrigger(!l.momentTrigger())}),u.runHook("rl-start-screens"),h.pub("rl.bootstart-end")},e.exports=new i}(t,e)},{$:20,"App:Abstract":2,"App:Knoin":27,Consts:6,Enums:7,Events:8,Globals:9,LinkBuilder:11,"Model:Account":31,"Model:Email":37,"Model:Folder":40,"Model:Identity":41,"Model:Message":42,"Model:OpenPgpKey":43,Plugins:12,"Screen:RainLoop:About":44,"Screen:RainLoop:Login":46,"Screen:RainLoop:MailBox":47,"Screen:RainLoop:Settings":48,"Settings:RainLoop:Accounts":49,"Settings:RainLoop:ChangePassword":50,"Settings:RainLoop:Contacts":51,"Settings:RainLoop:Filters":52,"Settings:RainLoop:Folders":53,"Settings:RainLoop:General":54,"Settings:RainLoop:Identities":55,"Settings:RainLoop:Identity":56,"Settings:RainLoop:OpenPGP":57,"Settings:RainLoop:Security":58,"Settings:RainLoop:Social":59,"Settings:RainLoop:Themes":60,"Storage:LocalStorage":65,"Storage:RainLoop:Cache":63,"Storage:RainLoop:Data":64,"Storage:RainLoop:Remote":68,"Storage:Settings":69,Utils:14,"View:Popup:Ask":80,"View:Popup:Compose":82,"View:Popup:FolderSystem":87,_:25,moment:23,window:26}],4:[function(e,t){!function(e,t){"use strict";e.exports=function(e){var i=t("window"),s=t("_"),o=t("$"),n=t("Globals"),a=t("Plugins"),r=t("Utils"),l=t("Enums"),c=t("Model:Email");n.__APP=e,e.setupSettings(),a.__boot=e,a.__remote=e.remote(),a.__data=e.data(),n.$html.addClass(n.bMobileDevice?"mobile":"no-mobile"),n.$win.keydown(r.killCtrlAandS).keyup(r.killCtrlAandS),n.$win.unload(function(){n.bUnload=!0}),n.$html.on("click.dropdown.data-api",function(){r.detectDropdownVisibility()}),i.rl=i.rl||{},i.rl.addHook=s.bind(a.addHook,a),i.rl.settingsGet=s.bind(a.mainSettingsGet,a),i.rl.remoteRequest=s.bind(a.remoteRequest,a),i.rl.pluginSettingsGet=s.bind(a.settingsGet,a),i.rl.createCommand=r.createCommand,i.rl.EmailModel=c,i.rl.Enums=l,i.__APP_BOOT=function(t){o(function(){i.rainloopTEMPLATES&&i.rainloopTEMPLATES[0]?(o("#rl-templates").html(i.rainloopTEMPLATES[0]),s.delay(function(){e.bootstart(),n.$html.removeClass("no-js rl-booted-trigger").addClass("rl-booted")},10)):t(!1),i.__APP_BOOT=null})}}}(t,e)},{$:20,Enums:7,Globals:9,"Model:Email":37,Plugins:12,Utils:14,_:25,window:26}],5:[function(e,t){!function(e){"use strict";var t={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",urlsafe_encode:function(e){return t.encode(e).replace(/[+]/g,"-").replace(/[\/]/g,"_").replace(/[=]/g,".")},encode:function(e){var i,s,o,n,a,r,l,c="",u=0;for(e=t._utf8_encode(e);u>2,a=(3&i)<<4|s>>4,r=(15&s)<<2|o>>6,l=63&o,isNaN(s)?r=l=64:isNaN(o)&&(l=64),c=c+this._keyStr.charAt(n)+this._keyStr.charAt(a)+this._keyStr.charAt(r)+this._keyStr.charAt(l);return c},decode:function(e){var i,s,o,n,a,r,l,c="",u=0;for(e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");u>4,s=(15&a)<<4|r>>2,o=(3&r)<<6|l,c+=String.fromCharCode(i),64!==r&&(c+=String.fromCharCode(s)),64!==l&&(c+=String.fromCharCode(o));return t._utf8_decode(c)},_utf8_encode:function(e){e=e.replace(/\r\n/g,"\n");for(var t="",i=0,s=e.length,o=0;s>i;i++)o=e.charCodeAt(i),128>o?t+=String.fromCharCode(o):o>127&&2048>o?(t+=String.fromCharCode(o>>6|192),t+=String.fromCharCode(63&o|128)):(t+=String.fromCharCode(o>>12|224),t+=String.fromCharCode(o>>6&63|128),t+=String.fromCharCode(63&o|128));return t},_utf8_decode:function(e){for(var t="",i=0,s=0,o=0,n=0;is?(t+=String.fromCharCode(s),i++):s>191&&224>s?(o=e.charCodeAt(i+1),t+=String.fromCharCode((31&s)<<6|63&o),i+=2):(o=e.charCodeAt(i+1),n=e.charCodeAt(i+2),t+=String.fromCharCode((15&s)<<12|(63&o)<<6|63&n),i+=3);return t}};e.exports=t}(t,e)},{}],6:[function(e,t){!function(e){"use strict";var t={};t.Values={},t.DataImages={},t.Defaults={},t.Defaults.MessagesPerPage=20,t.Defaults.ContactsPerPage=50,t.Defaults.MessagesPerPageArray=[10,20,30,50,100],t.Defaults.DefaultAjaxTimeout=3e4,t.Defaults.SearchAjaxTimeout=3e5,t.Defaults.SendMessageAjaxTimeout=3e5,t.Defaults.SaveMessageAjaxTimeout=2e5,t.Defaults.ContactsSyncAjaxTimeout=2e5,t.Values.UnuseOptionValue="__UNUSE__",t.Values.ClientSideCookieIndexName="rlcsc",t.Values.ImapDefaulPort=143,t.Values.ImapDefaulSecurePort=993,t.Values.SmtpDefaulPort=25,t.Values.SmtpDefaulSecurePort=465,t.Values.MessageBodyCacheLimit=15,t.Values.AjaxErrorLimit=7,t.Values.TokenErrorLimit=10,t.DataImages.UserDotPic="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQIW2P8DwQACgAD/il4QJ8AAAAASUVORK5CYII=",t.DataImages.TranspPic="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQIW2NkAAIAAAoAAggA9GkAAAAASUVORK5CYII=",e.exports=t}(t)},{}],7:[function(e,t){!function(e){"use strict";var t={};t.StorageResultType={Success:"success",Abort:"abort",Error:"error",Unload:"unload"},t.State={Empty:10,Login:20,Auth:30},t.StateType={Webmail:0,Admin:1},t.Capa={Prem:"PREM",TwoFactor:"TWO_FACTOR",OpenPGP:"OPEN_PGP",Prefetch:"PREFETCH",Gravatar:"GRAVATAR",Themes:"THEMES",Filters:"FILTERS",AdditionalAccounts:"ADDITIONAL_ACCOUNTS",AdditionalIdentities:"ADDITIONAL_IDENTITIES"},t.KeyState={All:"all",None:"none",ContactList:"contact-list",MessageList:"message-list",FolderList:"folder-list",MessageView:"message-view",Compose:"compose",Settings:"settings",Menu:"menu",PopupComposeOpenPGP:"compose-open-pgp",PopupKeyboardShortcutsHelp:"popup-keyboard-shortcuts-help",PopupAsk:"popup-ask"},t.FolderType={Inbox:10,SentItems:11,Draft:12,Trash:13,Spam:14,Archive:15,NotSpam:80,User:99},t.LoginSignMeTypeAsString={DefaultOff:"defaultoff",DefaultOn:"defaulton",Unused:"unused"},t.LoginSignMeType={DefaultOff:0,DefaultOn:1,Unused:2},t.ComposeType={Empty:"empty",Reply:"reply",ReplyAll:"replyall",Forward:"forward",ForwardAsAttachment:"forward-as-attachment",Draft:"draft",EditAsNew:"editasnew"},t.UploadErrorCode={Normal:0,FileIsTooBig:1,FilePartiallyUploaded:2,FileNoUploaded:3,MissingTempFolder:4,FileOnSaveingError:5,FileType:98,Unknown:99},t.SetSystemFoldersNotification={None:0,Sent:1,Draft:2,Spam:3,Trash:4,Archive:5},t.ClientSideKeyName={FoldersLashHash:0,MessagesInboxLastHash:1,MailBoxListSize:2,ExpandedFolders:3,FolderListSize:4},t.EventKeyCode={Backspace:8,Tab:9,Enter:13,Esc:27,PageUp:33,PageDown:34,Left:37,Right:39,Up:38,Down:40,End:35,Home:36,Space:32,Insert:45,Delete:46,A:65,S:83},t.MessageSetAction={SetSeen:0,UnsetSeen:1,SetFlag:2,UnsetFlag:3},t.MessageSelectAction={All:0,None:1,Invert:2,Unseen:3,Seen:4,Flagged:5,Unflagged:6},t.DesktopNotifications={Allowed:0,NotAllowed:1,Denied:2,NotSupported:9},t.MessagePriority={Low:5,Normal:3,High:1},t.EditorDefaultType={Html:"Html",Plain:"Plain"},t.CustomThemeType={Light:"Light",Dark:"Dark"},t.ServerSecure={None:0,SSL:1,TLS:2},t.SearchDateType={All:-1,Days3:3,Days7:7,Month:30},t.SaveSettingsStep={Animate:-2,Idle:-1,TrueResult:1,FalseResult:0},t.InterfaceAnimation={None:"None",Normal:"Normal",Full:"Full"},t.Layout={NoPreview:0,SidePreview:1,BottomPreview:2},t.FilterConditionField={From:"From",To:"To",Recipient:"Recipient",Subject:"Subject"},t.FilterConditionType={Contains:"Contains",NotContains:"NotContains",EqualTo:"EqualTo",NotEqualTo:"NotEqualTo"},t.FiltersAction={None:"None",Move:"Move",Discard:"Discard",Forward:"Forward"},t.FilterRulesType={And:"And",Or:"Or"},t.SignedVerifyStatus={UnknownPublicKeys:-4,UnknownPrivateKey:-3,Unverified:-2,Error:-1,None:0,Success:1},t.ContactPropertyType={Unknown:0,FullName:10,FirstName:15,LastName:16,MiddleName:16,Nick:18,NamePrefix:20,NameSuffix:21,Email:30,Phone:31,Web:32,Birthday:40,Facebook:90,Skype:91,GitHub:92,Note:110,Custom:250},t.Notification={InvalidToken:101,AuthError:102,AccessError:103,ConnectionError:104,CaptchaError:105,SocialFacebookLoginAccessDisable:106,SocialTwitterLoginAccessDisable:107,SocialGoogleLoginAccessDisable:108,DomainNotAllowed:109,AccountNotAllowed:110,AccountTwoFactorAuthRequired:120,AccountTwoFactorAuthError:121,CouldNotSaveNewPassword:130,CurrentPasswordIncorrect:131,NewPasswordShort:132,NewPasswordWeak:133,NewPasswordForbidden:134,ContactsSyncError:140,CantGetMessageList:201,CantGetMessage:202,CantDeleteMessage:203,CantMoveMessage:204,CantCopyMessage:205,CantSaveMessage:301,CantSendMessage:302,InvalidRecipients:303,CantCreateFolder:400,CantRenameFolder:401,CantDeleteFolder:402,CantSubscribeFolder:403,CantUnsubscribeFolder:404,CantDeleteNonEmptyFolder:405,CantSaveSettings:501,CantSavePluginSettings:502,DomainAlreadyExists:601,CantInstallPackage:701,CantDeletePackage:702,InvalidPluginPackage:703,UnsupportedPluginPackage:704,LicensingServerIsUnavailable:710,LicensingExpired:711,LicensingBanned:712,DemoSendMessageError:750,AccountAlreadyExists:801,MailServerError:901,ClientViewError:902,InvalidInputArgument:903,UnknownNotification:999,UnknownError:999},e.exports=t +}(t,e)},{}],8:[function(e,t){!function(e,t){"use strict";function i(){this.oSubs={}}var s=t("_"),o=t("Utils"),n=t("Plugins");i.prototype.oSubs={},i.prototype.sub=function(e,t,i){return o.isUnd(this.oSubs[e])&&(this.oSubs[e]=[]),this.oSubs[e].push([t,i]),this},i.prototype.pub=function(e,t){return n.runHook("rl-pub",[e,t]),o.isUnd(this.oSubs[e])||s.each(this.oSubs[e],function(e){e[0]&&e[0].apply(e[1]||null,t||[])}),this},e.exports=new i}(t,e)},{Plugins:12,Utils:14,_:25}],9:[function(e,t){!function(e,t){"use strict";var i={},s=t("window"),o=t("_"),n=t("$"),a=t("ko"),r=t("key"),l=t("Enums");i.$win=n(s),i.$doc=n(s.document),i.$html=n("html"),i.$div=n("
    "),i.now=(new s.Date).getTime(),i.momentTrigger=a.observable(!0),i.dropdownVisibility=a.observable(!1).extend({rateLimit:0}),i.tooltipTrigger=a.observable(!1).extend({rateLimit:0}),i.langChangeTrigger=a.observable(!0),i.useKeyboardShortcuts=a.observable(!0),i.iAjaxErrorCount=0,i.iTokenErrorCount=0,i.iMessageBodyCacheCount=0,i.bUnload=!1,i.sUserAgent=(s.navigator.userAgent||"").toLowerCase(),i.bIsiOSDevice=-1'+this.editor.getData()+"":this.editor.getData():""},i.prototype.modeToggle=function(e){this.editor&&(e?"plain"===this.editor.mode&&this.editor.setMode("wysiwyg"):"wysiwyg"===this.editor.mode&&this.editor.setMode("plain"),this.resize())},i.prototype.setHtml=function(e,t){this.editor&&(this.modeToggle(!0),this.editor.setData(e),t&&this.focus())},i.prototype.setPlain=function(e,t){if(this.editor){if(this.modeToggle(!1),"plain"===this.editor.mode&&this.editor.plugins.plain&&this.editor.__plain)return this.editor.__plain.setRawData(e);this.editor.setData(e),t&&this.focus()}},i.prototype.init=function(){if(this.$element&&this.$element[0]){var e=this,t=function(){var t=n.oHtmlEditorDefaultConfig,i=a.settingsGet("Language"),o=!!a.settingsGet("AllowHtmlEditorSourceButton");o&&t.toolbarGroups&&!t.toolbarGroups.__SourceInited&&(t.toolbarGroups.__SourceInited=!0,t.toolbarGroups.push({name:"document",groups:["mode","document","doctools"]})),t.enterMode=s.CKEDITOR.ENTER_BR,t.shiftEnterMode=s.CKEDITOR.ENTER_BR,t.language=n.oHtmlEditorLangsMap[i]||"en",s.CKEDITOR.env&&(s.CKEDITOR.env.isCompatible=!0),e.editor=s.CKEDITOR.appendTo(e.$element[0],t),e.editor.on("key",function(e){return e&&e.data&&9===e.data.keyCode?!1:void 0}),e.editor.on("blur",function(){e.blurTrigger()}),e.editor.on("mode",function(){e.blurTrigger(),e.fOnModeChange&&e.fOnModeChange("plain"!==e.editor.mode)}),e.editor.on("focus",function(){e.focusTrigger()}),e.fOnReady&&e.editor.on("instanceReady",function(){e.editor.setKeystroke(s.CKEDITOR.CTRL+65,"selectAll"),e.fOnReady(),e.__resizable=!0,e.resize()})};s.CKEDITOR?t():s.__initEditor=t}},i.prototype.focus=function(){this.editor&&this.editor.focus()},i.prototype.blur=function(){this.editor&&this.editor.focusManager.blur(!0)},i.prototype.resize=function(){if(this.editor&&this.__resizable)try{this.editor.resize(this.$element.width(),this.$element.innerHeight())}catch(e){}},i.prototype.clear=function(e){this.setHtml("",e)},e.exports=i}(t,e)},{Globals:9,"Storage:Settings":69,_:25,window:26}],11:[function(e,t){!function(e,t){"use strict";function i(){var e=t("Storage:Settings");this.sBase="#/",this.sServer="./?",this.sVersion=e.settingsGet("Version"),this.sSpecSuffix=e.settingsGet("AuthAccountHash")||"0",this.sStaticPrefix=e.settingsGet("StaticPrefix")||"rainloop/v/"+this.sVersion+"/static/"}var s=t("window"),o=t("Utils");i.prototype.root=function(){return this.sBase},i.prototype.attachmentDownload=function(e){return this.sServer+"/Raw/"+this.sSpecSuffix+"/Download/"+e},i.prototype.attachmentPreview=function(e){return this.sServer+"/Raw/"+this.sSpecSuffix+"/View/"+e},i.prototype.attachmentPreviewAsPlain=function(e){return this.sServer+"/Raw/"+this.sSpecSuffix+"/ViewAsPlain/"+e},i.prototype.upload=function(){return this.sServer+"/Upload/"+this.sSpecSuffix+"/"},i.prototype.uploadContacts=function(){return this.sServer+"/UploadContacts/"+this.sSpecSuffix+"/"},i.prototype.uploadBackground=function(){return this.sServer+"/UploadBackground/"+this.sSpecSuffix+"/"},i.prototype.append=function(){return this.sServer+"/Append/"+this.sSpecSuffix+"/"},i.prototype.change=function(e){return this.sServer+"/Change/"+this.sSpecSuffix+"/"+s.encodeURIComponent(e)+"/"},i.prototype.ajax=function(e){return this.sServer+"/Ajax/"+this.sSpecSuffix+"/"+e},i.prototype.messageViewLink=function(e){return this.sServer+"/Raw/"+this.sSpecSuffix+"/ViewAsPlain/"+e},i.prototype.messageDownloadLink=function(e){return this.sServer+"/Raw/"+this.sSpecSuffix+"/Download/"+e},i.prototype.avatarLink=function(e){return this.sServer+"/Raw/0/Avatar/"+s.encodeURIComponent(e)+"/"},i.prototype.inbox=function(){return this.sBase+"mailbox/Inbox"},i.prototype.messagePreview=function(){return this.sBase+"mailbox/message-preview"},i.prototype.settings=function(e){var t=this.sBase+"settings";return o.isUnd(e)||""===e||(t+="/"+e),t},i.prototype.about=function(){return this.sBase+"about"},i.prototype.admin=function(e){var t=this.sBase;switch(e){case"AdminDomains":t+="domains";break;case"AdminSecurity":t+="security";break;case"AdminLicensing":t+="licensing"}return t},i.prototype.mailBox=function(e,t,i){t=o.isNormal(t)?o.pInt(t):1,i=o.pString(i);var s=this.sBase+"mailbox/";return""!==e&&(s+=encodeURI(e)),t>1&&(s=s.replace(/[\/]+$/,""),s+="/p"+t),""!==i&&(s=s.replace(/[\/]+$/,""),s+="/"+encodeURI(i)),s},i.prototype.phpInfo=function(){return this.sServer+"Info"},i.prototype.langLink=function(e){return this.sServer+"/Lang/0/"+encodeURI(e)+"/"+this.sVersion+"/"},i.prototype.exportContactsVcf=function(){return this.sServer+"/Raw/"+this.sSpecSuffix+"/ContactsVcf/"},i.prototype.exportContactsCsv=function(){return this.sServer+"/Raw/"+this.sSpecSuffix+"/ContactsCsv/"},i.prototype.emptyContactPic=function(){return this.sStaticPrefix+"css/images/empty-contact.png"},i.prototype.sound=function(e){return this.sStaticPrefix+"sounds/"+e},i.prototype.themePreviewLink=function(e){var t="rainloop/v/"+this.sVersion+"/";return"@custom"===e.substr(-7)&&(e=o.trim(e.substring(0,e.length-7)),t=""),t+"themes/"+encodeURI(e)+"/images/preview.png"},i.prototype.notificationMailIcon=function(){return this.sStaticPrefix+"css/images/icom-message-notification.png"},i.prototype.openPgpJs=function(){return this.sStaticPrefix+"js/openpgp.min.js"},i.prototype.socialGoogle=function(){return this.sServer+"SocialGoogle"+(""!==this.sSpecSuffix?"/"+this.sSpecSuffix+"/":"")},i.prototype.socialTwitter=function(){return this.sServer+"SocialTwitter"+(""!==this.sSpecSuffix?"/"+this.sSpecSuffix+"/":"")},i.prototype.socialFacebook=function(){return this.sServer+"SocialFacebook"+(""!==this.sSpecSuffix?"/"+this.sSpecSuffix+"/":"")},e.exports=new i}(t,e)},{"Storage:Settings":69,Utils:14,window:26}],12:[function(e,t){!function(e,t){"use strict";function i(){this.__boot=null,this.__data=null,this.__remote=null,this.oSettings=t("Storage:Settings"),this.oViewModelsHooks={},this.oSimpleHooks={}}var s=t("_"),o=t("Utils");i.prototype.__boot=null,i.prototype.__data=null,i.prototype.__remote=null,i.prototype.oViewModelsHooks={},i.prototype.oSimpleHooks={},i.prototype.addHook=function(e,t){o.isFunc(t)&&(o.isArray(this.oSimpleHooks[e])||(this.oSimpleHooks[e]=[]),this.oSimpleHooks[e].push(t))},i.prototype.runHook=function(e,t){o.isArray(this.oSimpleHooks[e])&&(t=t||[],s.each(this.oSimpleHooks[e],function(e){e.apply(null,t)}))},i.prototype.mainSettingsGet=function(e){return this.oSettings.settingsGet(e)},i.prototype.remoteRequest=function(e,t,i,s,o,n){this.__remote&&this.__remote.defaultRequest(e,t,i,s,o,n)},i.prototype.settingsGet=function(e,t){var i=this.oSettings.settingsGet("Plugins");return i=i&&!o.isUnd(i[e])?i[e]:null,i?o.isUnd(i[t])?null:i[t]:null},e.exports=new i}(t,e)},{"Storage:Settings":69,Utils:14,_:25}],13:[function(e,t){!function(e,t){"use strict";function i(e,t,i,o,a,r){this.list=e,this.listChecked=n.computed(function(){return s.filter(this.list(),function(e){return e.checked()})},this).extend({rateLimit:0}),this.isListChecked=n.computed(function(){return 00&&-10)return s.newSelectPosition(i,a.shift),!1}})}},i.prototype.autoSelect=function(e){this.bAutoSelect=!!e},i.prototype.getItemUid=function(e){var t="",i=this.oCallbacks.onItemGetUid||null;return i&&e&&(t=i(e)),t.toString()},i.prototype.newSelectPosition=function(e,t,i){var o=0,n=10,a=!1,l=!1,c=null,u=this.list(),d=u?u.length:0,p=this.focusedItem();if(d>0)if(p){if(p)if(r.EventKeyCode.Down===e||r.EventKeyCode.Up===e||r.EventKeyCode.Insert===e||r.EventKeyCode.Space===e)s.each(u,function(t){if(!l)switch(e){case r.EventKeyCode.Up:p===t?l=!0:c=t;break;case r.EventKeyCode.Down:case r.EventKeyCode.Insert:a?(c=t,l=!0):p===t&&(a=!0)}});else if(r.EventKeyCode.Home===e||r.EventKeyCode.End===e)r.EventKeyCode.Home===e?c=u[0]:r.EventKeyCode.End===e&&(c=u[u.length-1]);else if(r.EventKeyCode.PageDown===e){for(;d>o;o++)if(p===u[o]){o+=n,o=o>d-1?d-1:o,c=u[o];break}}else if(r.EventKeyCode.PageUp===e)for(o=d;o>=0;o--)if(p===u[o]){o-=n,o=0>o?0:o,c=u[o];break}}else r.EventKeyCode.Down===e||r.EventKeyCode.Insert===e||r.EventKeyCode.Space===e||r.EventKeyCode.Home===e||r.EventKeyCode.PageUp===e?c=u[0]:(r.EventKeyCode.Up===e||r.EventKeyCode.End===e||r.EventKeyCode.PageDown===e)&&(c=u[u.length-1]);c?(this.focusedItem(c),p&&(t?(r.EventKeyCode.Up===e||r.EventKeyCode.Down===e)&&p.checked(!p.checked()):(r.EventKeyCode.Insert===e||r.EventKeyCode.Space===e)&&p.checked(!p.checked())),!this.bAutoSelect&&!i||this.isListChecked()||r.EventKeyCode.Space===e||this.selectedItem(c),this.scrollToFocused()):p&&(!t||r.EventKeyCode.Up!==e&&r.EventKeyCode.Down!==e?(r.EventKeyCode.Insert===e||r.EventKeyCode.Space===e)&&p.checked(!p.checked()):p.checked(!p.checked()),this.focusedItem(p))},i.prototype.scrollToFocused=function(){if(!this.oContentVisible||!this.oContentScrollable)return!1;var e=20,t=o(this.sItemFocusedSelector,this.oContentScrollable),i=t.position(),s=this.oContentVisible.height(),n=t.outerHeight();return i&&(i.top<0||i.top+n>s)?(this.oContentScrollable.scrollTop(i.top<0?this.oContentScrollable.scrollTop()+i.top-e:this.oContentScrollable.scrollTop()+i.top-s+n+e),!0):!1},i.prototype.scrollToTop=function(e){return this.oContentVisible&&this.oContentScrollable?(e?this.oContentScrollable.scrollTop(0):this.oContentScrollable.stop().animate({scrollTop:0},200),!0):!1},i.prototype.eventClickFunction=function(e,t){var i=this.getItemUid(e),s=0,o=0,n=null,a="",r=!1,l=!1,c=[],u=!1;if(t&&t.shiftKey&&""!==i&&""!==this.sLastUid&&i!==this.sLastUid)for(c=this.list(),u=e.checked(),s=0,o=c.length;o>s;s++)n=c[s],a=this.getItemUid(n),r=!1,(a===this.sLastUid||a===i)&&(r=!0),r&&(l=!l),(l||r)&&n.checked(u);this.sLastUid=""===i?"":i},i.prototype.actionClick=function(e,t){if(e){var i=!0,s=this.getItemUid(e);t&&(!t.shiftKey||t.ctrlKey||t.altKey?!t.ctrlKey||t.shiftKey||t.altKey||(i=!1,this.focusedItem(e),this.selectedItem()&&e!==this.selectedItem()&&this.selectedItem().checked(!0),e.checked(!e.checked())):(i=!1,""===this.sLastUid&&(this.sLastUid=s),e.checked(!e.checked()),this.eventClickFunction(e,t),this.focusedItem(e))),i&&(this.focusedItem(e),this.selectedItem(e),this.scrollToFocused())}},i.prototype.on=function(e,t){this.oCallbacks[e]=t},e.exports=i}(t,e)},{$:20,Enums:7,Utils:14,_:25,key:21,ko:22}],14:[function(e,t){!function(e,t){"use strict";var i={},s=t("window"),o=t("_"),n=t("$"),a=t("ko"),r=t("Enums"),l=t("Consts"),c=t("Globals");i.trim=n.trim,i.inArray=n.inArray,i.isArray=o.isArray,i.isFunc=o.isFunction,i.isUnd=o.isUndefined,i.isNull=o.isNull,i.emptyFunction=function(){},i.isNormal=function(e){return!i.isUnd(e)&&!i.isNull(e)},i.windowResize=o.debounce(function(e){i.isUnd(e)?c.$win.resize():s.setTimeout(function(){c.$win.resize()},e)},50),i.isPosNumeric=function(e,t){return i.isNormal(e)?(i.isUnd(t)?0:!t)?/^[1-9]+[0-9]*$/.test(e.toString()):/^[0-9]*$/.test(e.toString()):!1},i.pInt=function(e,t){var o=i.isNormal(e)&&""!==e?s.parseInt(e,10):t||0;return s.isNaN(o)?t||0:o},i.pString=function(e){return i.isNormal(e)?""+e:""},i.isNonEmptyArray=function(e){return i.isArray(e)&&0n;n++)o=i[n].split("="),t[s.decodeURIComponent(o[0])]=s.decodeURIComponent(o[1]);return t},i.mailToHelper=function(e,o){if(e&&"mailto:"===e.toString().substr(0,7).toLowerCase()){e=e.toString().substr(7);var n={},a=null,l=e.replace(/\?.+$/,""),c=e.replace(/^[^\?]*\?/,""),u=t("Model:Email");return a=new u,a.parse(s.decodeURIComponent(l)),a&&a.email&&(n=i.simpleQueryParser(c),t("App:Knoin").showScreenPopup(o,[r.ComposeType.Empty,null,[a],i.isUnd(n.subject)?null:i.pString(n.subject),i.isUnd(n.body)?null:i.plainToHtml(i.pString(n.body))])),!0}return!1},i.rsaEncode=function(e,t,o,n){if(s.crypto&&s.crypto.getRandomValues&&s.RSAKey&&t&&o&&n){var a=new s.RSAKey;if(a.setPublic(n,o),e=a.encrypt(i.fakeMd5()+":"+e+":"+i.fakeMd5()),!1!==e)return"rsa:"+t+":"+e}return!1},i.rsaEncode.supported=!!(s.crypto&&s.crypto.getRandomValues&&s.RSAKey),i.exportPath=function(e,t,o){for(var n=null,a=e.split("."),r=o||s;a.length&&(n=a.shift());)a.length||i.isUnd(t)?r=r[n]?r[n]:r[n]={}:r[n]=t},i.pImport=function(e,t,i){e[t]=i},i.pExport=function(e,t,s){return i.isUnd(e[t])?s:e[t]},i.encodeHtml=function(e){return i.isNormal(e)?e.toString().replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'"):""},i.splitPlainText=function(e,t){var s="",o="",n=e,a=0,r=0;for(t=i.isUnd(t)?100:t;n.length>t;)o=n.substring(0,t),a=o.lastIndexOf(" "),r=o.lastIndexOf("\n"),-1!==r&&(a=r),-1===a&&(a=t),s+=o.substring(0,a)+"\n",n=n.substring(a+1);return s+n},i.timeOutAction=function(){var e={};return function(t,o,n){i.isUnd(e[t])&&(e[t]=0),s.clearTimeout(e[t]),e[t]=s.setTimeout(o,n)}}(),i.timeOutActionSecond=function(){var e={};return function(t,i,o){e[t]||(e[t]=s.setTimeout(function(){i(),e[t]=0},o))}}(),i.audio=function(){var e=!1;return function(t,i){if(!1===e)if(c.bIsiOSDevice)e=null;else{var o=!1,n=!1,a=s.Audio?new s.Audio:null;a&&a.canPlayType&&a.play?(o=""!==a.canPlayType('audio/mpeg; codecs="mp3"'),o||(n=""!==a.canPlayType('audio/ogg; codecs="vorbis"')),o||n?(e=a,e.preload="none",e.loop=!1,e.autoplay=!1,e.muted=!1,e.src=o?t:i):e=null):e=null}return e}}(),i.hos=function(e,t){return e&&s.Object&&s.Object.hasOwnProperty?s.Object.hasOwnProperty.call(e,t):!1},i.i18n=function(e,t,s){var o="",n=i.isUnd(c.oI18N[e])?i.isUnd(s)?e:s:c.oI18N[e];if(!i.isUnd(t)&&!i.isNull(t))for(o in t)i.hos(t,o)&&(n=n.replace("%"+o+"%",t[o]));return n},i.i18nToNode=function(e){o.defer(function(){n(".i18n",e).each(function(){var e=n(this),t="";t=e.data("i18n-text"),t?e.text(i.i18n(t)):(t=e.data("i18n-html"),t&&e.html(i.i18n(t)),t=e.data("i18n-placeholder"),t&&e.attr("placeholder",i.i18n(t)),t=e.data("i18n-title"),t&&e.attr("title",i.i18n(t)))})})},i.i18nReload=function(){s.rainloopI18N&&(c.oI18N=s.rainloopI18N||{},i.i18nToNode(c.$doc),c.langChangeTrigger(!c.langChangeTrigger())),s.rainloopI18N=null},i.initOnStartOrLangChange=function(e,t,i){e&&e.call(t),i?c.langChangeTrigger.subscribe(function(){e&&e.call(t),i.call(t)}):e&&c.langChangeTrigger.subscribe(e,t)},i.inFocus=function(){return s.document.activeElement?(i.isUnd(s.document.activeElement.__inFocusCache)&&(s.document.activeElement.__inFocusCache=n(s.document.activeElement).is("input,textarea,iframe,.cke_editable")),!!s.document.activeElement.__inFocusCache):!1},i.removeInFocus=function(){if(s.document&&s.document.activeElement&&s.document.activeElement.blur){var e=n(s.document.activeElement);e.is("input,textarea")&&s.document.activeElement.blur()}},i.removeSelection=function(){if(s&&s.getSelection){var e=s.getSelection();e&&e.removeAllRanges&&e.removeAllRanges()}else s.document&&s.document.selection&&s.document.selection.empty&&s.document.selection.empty()},i.replySubjectAdd=function(e,t){e=i.trim(e.toUpperCase()),t=i.trim(t.replace(/[\s]+/g," "));var s=!1,n=[],a="RE"===e,r="FWD"===e,l=!r;return""!==t&&o.each(t.split(":"),function(e){var t=i.trim(e);s||!/^(RE|FWD)$/i.test(t)&&!/^(RE|FWD)[\[\(][\d]+[\]\)]$/i.test(t)?(n.push(e),s=!0):(a||(a=!!/^RE/i.test(t)),r||(r=!!/^FWD/i.test(t)))}),l?a=!1:r=!1,i.trim((l?"Re: ":"Fwd: ")+(a?"Re: ":"")+(r?"Fwd: ":"")+i.trim(n.join(":")))},i.roundNumber=function(e,t){return s.Math.round(e*s.Math.pow(10,t))/s.Math.pow(10,t)},i.friendlySize=function(e){return e=i.pInt(e),e>=1073741824?i.roundNumber(e/1073741824,1)+"GB":e>=1048576?i.roundNumber(e/1048576,1)+"MB":e>=1024?i.roundNumber(e/1024,0)+"KB":e+"B"},i.log=function(e){s.console&&s.console.log&&s.console.log(e)},i.getNotification=function(e,t){return e=i.pInt(e),r.Notification.ClientViewError===e&&t?t:i.isUnd(c.oNotificationI18N[e])?"":c.oNotificationI18N[e]},i.initNotificationLanguage=function(){var e=c.oNotificationI18N||{};e[r.Notification.InvalidToken]=i.i18n("NOTIFICATIONS/INVALID_TOKEN"),e[r.Notification.AuthError]=i.i18n("NOTIFICATIONS/AUTH_ERROR"),e[r.Notification.AccessError]=i.i18n("NOTIFICATIONS/ACCESS_ERROR"),e[r.Notification.ConnectionError]=i.i18n("NOTIFICATIONS/CONNECTION_ERROR"),e[r.Notification.CaptchaError]=i.i18n("NOTIFICATIONS/CAPTCHA_ERROR"),e[r.Notification.SocialFacebookLoginAccessDisable]=i.i18n("NOTIFICATIONS/SOCIAL_FACEBOOK_LOGIN_ACCESS_DISABLE"),e[r.Notification.SocialTwitterLoginAccessDisable]=i.i18n("NOTIFICATIONS/SOCIAL_TWITTER_LOGIN_ACCESS_DISABLE"),e[r.Notification.SocialGoogleLoginAccessDisable]=i.i18n("NOTIFICATIONS/SOCIAL_GOOGLE_LOGIN_ACCESS_DISABLE"),e[r.Notification.DomainNotAllowed]=i.i18n("NOTIFICATIONS/DOMAIN_NOT_ALLOWED"),e[r.Notification.AccountNotAllowed]=i.i18n("NOTIFICATIONS/ACCOUNT_NOT_ALLOWED"),e[r.Notification.AccountTwoFactorAuthRequired]=i.i18n("NOTIFICATIONS/ACCOUNT_TWO_FACTOR_AUTH_REQUIRED"),e[r.Notification.AccountTwoFactorAuthError]=i.i18n("NOTIFICATIONS/ACCOUNT_TWO_FACTOR_AUTH_ERROR"),e[r.Notification.CouldNotSaveNewPassword]=i.i18n("NOTIFICATIONS/COULD_NOT_SAVE_NEW_PASSWORD"),e[r.Notification.CurrentPasswordIncorrect]=i.i18n("NOTIFICATIONS/CURRENT_PASSWORD_INCORRECT"),e[r.Notification.NewPasswordShort]=i.i18n("NOTIFICATIONS/NEW_PASSWORD_SHORT"),e[r.Notification.NewPasswordWeak]=i.i18n("NOTIFICATIONS/NEW_PASSWORD_WEAK"),e[r.Notification.NewPasswordForbidden]=i.i18n("NOTIFICATIONS/NEW_PASSWORD_FORBIDDENT"),e[r.Notification.ContactsSyncError]=i.i18n("NOTIFICATIONS/CONTACTS_SYNC_ERROR"),e[r.Notification.CantGetMessageList]=i.i18n("NOTIFICATIONS/CANT_GET_MESSAGE_LIST"),e[r.Notification.CantGetMessage]=i.i18n("NOTIFICATIONS/CANT_GET_MESSAGE"),e[r.Notification.CantDeleteMessage]=i.i18n("NOTIFICATIONS/CANT_DELETE_MESSAGE"),e[r.Notification.CantMoveMessage]=i.i18n("NOTIFICATIONS/CANT_MOVE_MESSAGE"),e[r.Notification.CantCopyMessage]=i.i18n("NOTIFICATIONS/CANT_MOVE_MESSAGE"),e[r.Notification.CantSaveMessage]=i.i18n("NOTIFICATIONS/CANT_SAVE_MESSAGE"),e[r.Notification.CantSendMessage]=i.i18n("NOTIFICATIONS/CANT_SEND_MESSAGE"),e[r.Notification.InvalidRecipients]=i.i18n("NOTIFICATIONS/INVALID_RECIPIENTS"),e[r.Notification.CantCreateFolder]=i.i18n("NOTIFICATIONS/CANT_CREATE_FOLDER"),e[r.Notification.CantRenameFolder]=i.i18n("NOTIFICATIONS/CANT_RENAME_FOLDER"),e[r.Notification.CantDeleteFolder]=i.i18n("NOTIFICATIONS/CANT_DELETE_FOLDER"),e[r.Notification.CantDeleteNonEmptyFolder]=i.i18n("NOTIFICATIONS/CANT_DELETE_NON_EMPTY_FOLDER"),e[r.Notification.CantSubscribeFolder]=i.i18n("NOTIFICATIONS/CANT_SUBSCRIBE_FOLDER"),e[r.Notification.CantUnsubscribeFolder]=i.i18n("NOTIFICATIONS/CANT_UNSUBSCRIBE_FOLDER"),e[r.Notification.CantSaveSettings]=i.i18n("NOTIFICATIONS/CANT_SAVE_SETTINGS"),e[r.Notification.CantSavePluginSettings]=i.i18n("NOTIFICATIONS/CANT_SAVE_PLUGIN_SETTINGS"),e[r.Notification.DomainAlreadyExists]=i.i18n("NOTIFICATIONS/DOMAIN_ALREADY_EXISTS"),e[r.Notification.CantInstallPackage]=i.i18n("NOTIFICATIONS/CANT_INSTALL_PACKAGE"),e[r.Notification.CantDeletePackage]=i.i18n("NOTIFICATIONS/CANT_DELETE_PACKAGE"),e[r.Notification.InvalidPluginPackage]=i.i18n("NOTIFICATIONS/INVALID_PLUGIN_PACKAGE"),e[r.Notification.UnsupportedPluginPackage]=i.i18n("NOTIFICATIONS/UNSUPPORTED_PLUGIN_PACKAGE"),e[r.Notification.LicensingServerIsUnavailable]=i.i18n("NOTIFICATIONS/LICENSING_SERVER_IS_UNAVAILABLE"),e[r.Notification.LicensingExpired]=i.i18n("NOTIFICATIONS/LICENSING_EXPIRED"),e[r.Notification.LicensingBanned]=i.i18n("NOTIFICATIONS/LICENSING_BANNED"),e[r.Notification.DemoSendMessageError]=i.i18n("NOTIFICATIONS/DEMO_SEND_MESSAGE_ERROR"),e[r.Notification.AccountAlreadyExists]=i.i18n("NOTIFICATIONS/ACCOUNT_ALREADY_EXISTS"),e[r.Notification.MailServerError]=i.i18n("NOTIFICATIONS/MAIL_SERVER_ERROR"),e[r.Notification.InvalidInputArgument]=i.i18n("NOTIFICATIONS/INVALID_INPUT_ARGUMENT"),e[r.Notification.UnknownNotification]=i.i18n("NOTIFICATIONS/UNKNOWN_ERROR"),e[r.Notification.UnknownError]=i.i18n("NOTIFICATIONS/UNKNOWN_ERROR")},i.getUploadErrorDescByCode=function(e){var t="";switch(i.pInt(e)){case r.UploadErrorCode.FileIsTooBig:t=i.i18n("UPLOAD/ERROR_FILE_IS_TOO_BIG");break;case r.UploadErrorCode.FilePartiallyUploaded:t=i.i18n("UPLOAD/ERROR_FILE_PARTIALLY_UPLOADED");break;case r.UploadErrorCode.FileNoUploaded:t=i.i18n("UPLOAD/ERROR_NO_FILE_UPLOADED");break;case r.UploadErrorCode.MissingTempFolder:t=i.i18n("UPLOAD/ERROR_MISSING_TEMP_FOLDER");break;case r.UploadErrorCode.FileOnSaveingError:t=i.i18n("UPLOAD/ERROR_ON_SAVING_FILE");break;case r.UploadErrorCode.FileType:t=i.i18n("UPLOAD/ERROR_FILE_TYPE");break;default:t=i.i18n("UPLOAD/ERROR_UNKNOWN")}return t},i.delegateRun=function(e,t,s,n){e&&e[t]&&(n=i.pInt(n),0>=n?e[t].apply(e,i.isArray(s)?s:[]):o.delay(function(){e[t].apply(e,i.isArray(s)?s:[])},n))},i.killCtrlAandS=function(e){if(e=e||s.event,e&&e.ctrlKey&&!e.shiftKey&&!e.altKey){var t=e.target||e.srcElement,i=e.keyCode||e.which;if(i===r.EventKeyCode.S)return void e.preventDefault();if(t&&t.tagName&&t.tagName.match(/INPUT|TEXTAREA/i))return;i===r.EventKeyCode.A&&(s.getSelection?s.getSelection().removeAllRanges():s.document.selection&&s.document.selection.clear&&s.document.selection.clear(),e.preventDefault())}},i.createCommand=function(e,t,s){var o=t?function(){return o&&o.canExecute&&o.canExecute()&&t.apply(e,Array.prototype.slice.call(arguments)),!1}:function(){};return o.enabled=a.observable(!0),s=i.isUnd(s)?!0:s,o.canExecute=a.computed(i.isFunc(s)?function(){return o.enabled()&&s.call(e)}:function(){return o.enabled()&&!!s}),o},i.initDataConstructorBySettings=function(e){e.editorDefaultType=a.observable(r.EditorDefaultType.Html),e.showImages=a.observable(!1),e.interfaceAnimation=a.observable(r.InterfaceAnimation.Full),e.contactsAutosave=a.observable(!1),c.sAnimationType=r.InterfaceAnimation.Full,e.capaThemes=a.observable(!1),e.allowLanguagesOnSettings=a.observable(!0),e.allowLanguagesOnLogin=a.observable(!0),e.useLocalProxyForExternalImages=a.observable(!1),e.desktopNotifications=a.observable(!1),e.useThreads=a.observable(!0),e.replySameFolder=a.observable(!0),e.useCheckboxesInList=a.observable(!0),e.layout=a.observable(r.Layout.SidePreview),e.usePreviewPane=a.computed(function(){return r.Layout.NoPreview!==e.layout()}),e.interfaceAnimation.subscribe(function(e){if(c.bMobileDevice||e===r.InterfaceAnimation.None)c.$html.removeClass("rl-anim rl-anim-full").addClass("no-rl-anim"),c.sAnimationType=r.InterfaceAnimation.None;else switch(e){case r.InterfaceAnimation.Full:c.$html.removeClass("no-rl-anim").addClass("rl-anim rl-anim-full"),c.sAnimationType=e;break;case r.InterfaceAnimation.Normal:c.$html.removeClass("no-rl-anim rl-anim-full").addClass("rl-anim"),c.sAnimationType=e}}),e.interfaceAnimation.valueHasMutated(),e.desktopNotificationsPermisions=a.computed(function(){e.desktopNotifications();var t=i.notificationClass(),o=r.DesktopNotifications.NotSupported;if(t&&t.permission)switch(t.permission.toLowerCase()){case"granted":o=r.DesktopNotifications.Allowed;break;case"denied":o=r.DesktopNotifications.Denied;break;case"default":o=r.DesktopNotifications.NotAllowed}else s.webkitNotifications&&s.webkitNotifications.checkPermission&&(o=s.webkitNotifications.checkPermission());return o}),e.useDesktopNotifications=a.computed({read:function(){return e.desktopNotifications()&&r.DesktopNotifications.Allowed===e.desktopNotificationsPermisions()},write:function(t){if(t){var s=i.notificationClass(),o=e.desktopNotificationsPermisions();s&&r.DesktopNotifications.Allowed===o?e.desktopNotifications(!0):s&&r.DesktopNotifications.NotAllowed===o?s.requestPermission(function(){e.desktopNotifications.valueHasMutated(),r.DesktopNotifications.Allowed===e.desktopNotificationsPermisions()?e.desktopNotifications()?e.desktopNotifications.valueHasMutated():e.desktopNotifications(!0):e.desktopNotifications()?e.desktopNotifications(!1):e.desktopNotifications.valueHasMutated() +}):e.desktopNotifications(!1)}else e.desktopNotifications(!1)}}),e.language=a.observable(""),e.languages=a.observableArray([]),e.mainLanguage=a.computed({read:e.language,write:function(t){t!==e.language()?-1=t.diff(s,"hours")?o:t.format("L")===s.format("L")?i.i18n("MESSAGE_LIST/TODAY_AT",{TIME:s.format("LT")}):t.clone().subtract("days",1).format("L")===s.format("L")?i.i18n("MESSAGE_LIST/YESTERDAY_AT",{TIME:s.format("LT")}):s.format(t.year()===s.year()?"D MMM.":"LL")},e)},i.convertThemeName=function(e){return"@custom"===e.substr(-7)&&(e=i.trim(e.substring(0,e.length-7))),i.trim(e.replace(/[^a-zA-Z0-9]+/g," ").replace(/([A-Z])/g," $1").replace(/[\s]+/g," "))},i.quoteName=function(e){return e.replace(/["]/g,'\\"')},i.microtime=function(){return(new Date).getTime()},i.convertLangName=function(e,t){return i.i18n("LANGS_NAMES"+(!0===t?"_EN":"")+"/LANG_"+e.toUpperCase().replace(/[^a-zA-Z0-9]+/g,"_"),null,e)},i.fakeMd5=function(e){var t="",o="0123456789abcdefghijklmnopqrstuvwxyz";for(e=i.isUnd(e)?32:i.pInt(e);t.length/g,">").replace(/")},i.draggeblePlace=function(){return n('
     
    ').appendTo("#rl-hidden")},i.defautOptionsAfterRender=function(e,t){t&&!i.isUnd(t.disabled)&&e&&n(e).toggleClass("disabled",t.disabled).prop("disabled",t.disabled)},i.windowPopupKnockout=function(e,t,o,r){var l=null,c=s.open(""),u="__OpenerApplyBindingsUid"+i.fakeMd5()+"__",d=n("#"+t);s[u]=function(){if(c&&c.document.body&&d&&d[0]){var t=n(c.document.body);n("#rl-content",t).html(d.html()),n("html",c.document).addClass("external "+n("html").attr("class")),i.i18nToNode(t),e&&n("#rl-content",t)[0]&&a.applyBindings(e,n("#rl-content",t)[0]),s[u]=null,r(c)}},c.document.open(),c.document.write(''+i.encodeHtml(o)+'
    '),c.document.close(),l=c.document.createElement("script"),l.type="text/javascript",l.innerHTML="if(window&&window.opener&&window.opener['"+u+"']){window.opener['"+u+"']();window.opener['"+u+"']=null}",c.document.getElementsByTagName("head")[0].appendChild(l)},i.settingsSaveHelperFunction=function(e,t,s,n){return s=s||null,n=i.isUnd(n)?1e3:i.pInt(n),function(i,a,l,c,u){t.call(s,a&&a.Result?r.SaveSettingsStep.TrueResult:r.SaveSettingsStep.FalseResult),e&&e.call(s,i,a,l,c,u),o.delay(function(){t.call(s,r.SaveSettingsStep.Idle)},n)}},i.settingsSaveHelperSimpleFunction=function(e,t){return i.settingsSaveHelperFunction(null,e,t,1e3)},i.htmlToPlain=function(e){var t=0,i=0,s=0,o=0,a=0,r="",l=function(e){for(var t=100,i="",s="",o=e,n=0,a=0;o.length>t;)s=o.substring(0,t),n=s.lastIndexOf(" "),a=s.lastIndexOf("\n"),-1!==a&&(n=a),-1===n&&(n=t),i+=s.substring(0,n)+"\n",o=o.substring(n+1);return i+o},u=function(e){return e=l(n.trim(e)),e="> "+e.replace(/\n/gm,"\n> "),e.replace(/(^|\n)([> ]+)/gm,function(){return arguments&&2]*>([\s\S\r\n]*)<\/div>/gim,d),e="\n"+n.trim(e)+"\n"),e}return""},p=function(){return arguments&&1"):""},h=function(){return arguments&&1/g,">"):""},g=function(){return arguments&&1]*>([\s\S\r\n]*)<\/pre>/gim,p).replace(/[\s]+/gm," ").replace(/((?:href|data)\s?=\s?)("[^"]+?"|'[^']+?')/gim,h).replace(/]*>/gim,"\n").replace(/<\/h[\d]>/gi,"\n").replace(/<\/p>/gi,"\n\n").replace(/<\/li>/gi,"\n").replace(/<\/td>/gi,"\n").replace(/<\/tr>/gi,"\n").replace(/]*>/gim,"\n_______________________________\n\n").replace(/]*>([\s\S\r\n]*)<\/div>/gim,d).replace(/]*>/gim,"\n__bq__start__\n").replace(/<\/blockquote>/gim,"\n__bq__end__\n").replace(/]*>([\s\S\r\n]*?)<\/a>/gim,g).replace(/<\/div>/gi,"\n").replace(/ /gi," ").replace(/"/gi,'"').replace(/<[^>]*>/gm,""),r=c.$div.html(r).text(),r=r.replace(/\n[ \t]+/gm,"\n").replace(/[\n]{3,}/gm,"\n\n").replace(/>/gi,">").replace(/</gi,"<").replace(/&/gi,"&"),t=0,a=100;a>0&&(a--,i=r.indexOf("__bq__start__",t),i>-1);)s=r.indexOf("__bq__start__",i+5),o=r.indexOf("__bq__end__",i+5),(-1===s||s>o)&&o>i?(r=r.substring(0,i)+u(r.substring(i+13,o))+r.substring(o+11),t=0):t=s>-1&&o>s?s-1:0;return r=r.replace(/__bq__start__/gm,"").replace(/__bq__end__/gm,"")},i.plainToHtml=function(e,t){e=e.toString().replace(/\r/g,"");var s=!1,o=!0,n=!0,a=[],r="",l=0,c=e.split("\n");do{for(o=!1,a=[],l=0;l"===r.substr(0,1),n&&!s?(o=!0,s=!0,a.push("~~~blockquote~~~"),a.push(r.substr(1))):!n&&s?(s=!1,a.push("~~~/blockquote~~~"),a.push(r)):a.push(n&&s?r.substr(1):r);s&&(s=!1,a.push("~~~/blockquote~~~")),c=a}while(o);return e=c.join("\n"),e=e.replace(/&/g,"&").replace(/>/g,">").replace(/").replace(/[\s]*~~~\/blockquote~~~/g,"").replace(/[\-_~]{10,}/g,"
    ").replace(/\n/g,"
    "),t?i.linkify(e):e},s.rainloop_Utils_htmlToPlain=i.htmlToPlain,s.rainloop_Utils_plainToHtml=i.plainToHtml,i.linkify=function(e){return n.fn&&n.fn.linkify&&(e=c.$div.html(e.replace(/&/gi,"amp_amp_12345_amp_amp")).linkify().find(".linkified").removeClass("linkified").end().html().replace(/amp_amp_12345_amp_amp/g,"&")),e},i.resizeAndCrop=function(e,t,i){var o=new s.Image;o.onload=function(){var e=[0,0],o=s.document.createElement("canvas"),n=o.getContext("2d");o.width=t,o.height=t,e=this.width>this.height?[this.width-this.height,0]:[0,this.height-this.width],n.fillStyle="#fff",n.fillRect(0,0,t,t),n.drawImage(this,e[0]/2,e[1]/2,this.width-e[0],this.height-e[1],0,0,t,t),i(o.toDataURL("image/jpeg"))},o.src=e},i.folderListOptionsBuilder=function(e,t,o,n,a,l,c,u,d,p){var h=null,g=!1,m=0,f=0,b="   ",y=[];for(d=i.isNormal(d)?d:0m;m++)y.push({id:n[m][0],name:n[m][1],system:!1,seporator:!1,disabled:!1});for(g=!0,m=0,f=e.length;f>m;m++)h=e[m],(c?c.call(null,h):!0)&&(g&&0m;m++)h=t[m],(h.subScribed()||!h.existen)&&(c?c.call(null,h):!0)&&(r.FolderType.User===h.type()||!d||01||c>0&&l>c){for(l>c?(u(c),o=c,n=c):((3>=l||l>=c-2)&&(a+=2),u(l),o=l,n=l);a>0;)if(o-=1,n+=1,o>0&&(u(o,!1),a--),c>=n)u(n,!0),a--;else if(0>=o)break;3===o?u(2,!1):o>3&&u(s.Math.round((o-1)/2),!1,"..."),c-2===n?u(c-1,!0):c-2>n&&u(s.Math.round((c+n)/2),!0,"..."),o>1&&u(1,!1),c>n&&u(c,!0)}return r}},i.selectElement=function(e){var t,i;s.getSelection?(t=s.getSelection(),t.removeAllRanges(),i=s.document.createRange(),i.selectNodeContents(e),t.addRange(i)):s.document.selection&&(i=s.document.body.createTextRange(),i.moveToElementText(e),i.select())},i.detectDropdownVisibility=o.debounce(function(){c.dropdownVisibility(!!o.find(c.aBootstrapDropdowns,function(e){return e.hasClass("open")}))},50),i.triggerAutocompleteInputChange=function(e){var t=function(){n(".checkAutocomplete").trigger("change")};(i.isUnd(e)?1:!e)?t():o.delay(t,100)},e.exports=i}(t,e)},{$:20,"App:Knoin":27,Consts:6,Enums:7,Globals:9,"Model:Email":37,_:25,ko:22,window:26}],15:[function(e,t){t.exports=JSON},{}],16:[function(e,t){t.exports=Jua},{}],17:[function(e,t){t.exports=crossroads},{}],18:[function(e,t){t.exports=hasher},{}],19:[function(e,t){t.exports=ifvisible},{}],20:[function(e,t){t.exports=$},{}],21:[function(e,t){t.exports=key},{}],22:[function(e,t){!function(t,i){"use strict";var s=e("window"),o=e("_"),n=e("$");i.bindingHandlers.tooltip={init:function(t,s){var o=e("Globals"),a=e("Utils");if(!o.bMobileDevice){var r=n(t),l=r.data("tooltip-class")||"",c=r.data("tooltip-placement")||"top";r.tooltip({delay:{show:500,hide:100},html:!0,container:"body",placement:c,trigger:"hover",title:function(){return r.is(".disabled")||o.dropdownVisibility()?"":''+a.i18n(i.utils.unwrapObservable(s()))+""}}).click(function(){r.tooltip("hide")}),o.tooltipTrigger.subscribe(function(){r.tooltip("hide")})}}},i.bindingHandlers.tooltip2={init:function(t,i){var s=e("Globals"),o=n(t),a=o.data("tooltip-class")||"",r=o.data("tooltip-placement")||"top";o.tooltip({delay:{show:500,hide:100},html:!0,container:"body",placement:r,title:function(){return o.is(".disabled")||s.dropdownVisibility()?"":''+i()()+""}}).click(function(){o.tooltip("hide")}),s.tooltipTrigger.subscribe(function(){o.tooltip("hide")})}},i.bindingHandlers.tooltip3={init:function(t){var i=n(t),o=e("Globals");i.tooltip({container:"body",trigger:"hover manual",title:function(){return i.data("tooltip3-data")||""}}),n(s.document).click(function(){i.tooltip("hide")}),o.tooltipTrigger.subscribe(function(){i.tooltip("hide")})},update:function(e,t){var s=i.utils.unwrapObservable(t());""===s?n(e).data("tooltip3-data","").tooltip("hide"):n(e).data("tooltip3-data",s).tooltip("show")}},i.bindingHandlers.registrateBootstrapDropdown={init:function(t){var i=e("Globals");i.aBootstrapDropdowns.push(n(t))}},i.bindingHandlers.openDropdownTrigger={update:function(t,s){if(i.utils.unwrapObservable(s())){var o=n(t),a=e("Utils");o.hasClass("open")||(o.find(".dropdown-toggle").dropdown("toggle"),a.detectDropdownVisibility()),s()(!1)}}},i.bindingHandlers.dropdownCloser={init:function(e){n(e).closest(".dropdown").on("click",".e-item",function(){n(e).dropdown("toggle")})}},i.bindingHandlers.popover={init:function(e,t){n(e).popover(i.utils.unwrapObservable(t()))}},i.bindingHandlers.csstext={init:function(t,s){var o=e("Utils");t&&t.styleSheet&&!o.isUnd(t.styleSheet.cssText)?t.styleSheet.cssText=i.utils.unwrapObservable(s()):n(t).text(i.utils.unwrapObservable(s()))},update:function(t,s){var o=e("Utils");t&&t.styleSheet&&!o.isUnd(t.styleSheet.cssText)?t.styleSheet.cssText=i.utils.unwrapObservable(s()):n(t).text(i.utils.unwrapObservable(s()))}},i.bindingHandlers.resizecrop={init:function(e){n(e).addClass("resizecrop").resizecrop({width:"100",height:"100",wrapperCSS:{"border-radius":"10px"}})},update:function(e,t){t()(),n(e).resizecrop({width:"100",height:"100"})}},i.bindingHandlers.onEnter={init:function(e,t,i,o){n(e).on("keypress",function(i){i&&13===s.parseInt(i.keyCode,10)&&(n(e).trigger("change"),t().call(o))})}},i.bindingHandlers.onEsc={init:function(e,t,i,o){n(e).on("keypress",function(i){i&&27===s.parseInt(i.keyCode,10)&&(n(e).trigger("change"),t().call(o))})}},i.bindingHandlers.clickOnTrue={update:function(e,t){i.utils.unwrapObservable(t())&&n(e).click()}},i.bindingHandlers.modal={init:function(t,s){var o=e("Globals"),a=e("Utils");n(t).toggleClass("fade",!o.bMobileDevice).modal({keyboard:!1,show:i.utils.unwrapObservable(s())}).on("shown",function(){a.windowResize()}).find(".close").click(function(){s()(!1)})},update:function(e,t){n(e).modal(i.utils.unwrapObservable(t())?"show":"hide")}},i.bindingHandlers.i18nInit={init:function(t){var i=e("Utils");i.i18nToNode(t)}},i.bindingHandlers.i18nUpdate={update:function(t,s){var o=e("Utils");i.utils.unwrapObservable(s()),o.i18nToNode(t)}},i.bindingHandlers.link={update:function(e,t){n(e).attr("href",i.utils.unwrapObservable(t()))}},i.bindingHandlers.title={update:function(e,t){n(e).attr("title",i.utils.unwrapObservable(t()))}},i.bindingHandlers.textF={init:function(e,t){n(e).text(i.utils.unwrapObservable(t()))}},i.bindingHandlers.initDom={init:function(e,t){t()(e)}},i.bindingHandlers.initResizeTrigger={init:function(e,t){var s=i.utils.unwrapObservable(t());n(e).css({height:s[1],"min-height":s[1]})},update:function(t,s){var o=e("Utils"),a=e("Globals"),r=i.utils.unwrapObservable(s()),l=o.pInt(r[1]),c=0,u=n(t).offset().top;u>0&&(u+=o.pInt(r[2]),c=a.$win.height()-u,c>l&&(l=c),n(t).css({height:l,"min-height":l}))}},i.bindingHandlers.appendDom={update:function(e,t){n(e).hide().empty().append(i.utils.unwrapObservable(t())).show()}},i.bindingHandlers.draggable={init:function(t,o,a){var r=e("Globals"),l=e("Utils");if(!r.bMobileDevice){var c=100,u=3,d=a(),p=d&&d.droppableSelector?d.droppableSelector:"",h={distance:20,handle:".dragHandle",cursorAt:{top:22,left:3},refreshPositions:!0,scroll:!0};p&&(h.drag=function(e){n(p).each(function(){var t=null,i=null,o=n(this),a=o.offset(),r=a.top+o.height();s.clearInterval(o.data("timerScroll")),o.data("timerScroll",!1),e.pageX>=a.left&&e.pageX<=a.left+o.width()&&(e.pageY>=r-c&&e.pageY<=r&&(t=function(){o.scrollTop(o.scrollTop()+u),l.windowResize()},o.data("timerScroll",s.setInterval(t,10)),t()),e.pageY>=a.top&&e.pageY<=a.top+c&&(i=function(){o.scrollTop(o.scrollTop()-u),l.windowResize()},o.data("timerScroll",s.setInterval(i,10)),i()))})},h.stop=function(){n(p).each(function(){s.clearInterval(n(this).data("timerScroll")),n(this).data("timerScroll",!1)})}),h.helper=function(e){return o()(e&&e.target?i.dataFor(e.target):null)},n(t).draggable(h).on("mousedown",function(){l.removeInFocus()})}}},i.bindingHandlers.droppable={init:function(t,i,s){var o=e("Globals");if(!o.bMobileDevice){var a=i(),r=s(),l=r&&r.droppableOver?r.droppableOver:null,c=r&&r.droppableOut?r.droppableOut:null,u={tolerance:"pointer",hoverClass:"droppableHover"};a&&(u.drop=function(e,t){a(e,t)},l&&(u.over=function(e,t){l(e,t)}),c&&(u.out=function(e,t){c(e,t)}),n(t).droppable(u))}}},i.bindingHandlers.nano={init:function(t){var i=e("Globals");i.bDisableNanoScroll||n(t).addClass("nano").nanoScroller({iOSNativeScrolling:!1,preventPageScrolling:!0})}},i.bindingHandlers.saveTrigger={init:function(e){var t=n(e);t.data("save-trigger-type",t.is("input[type=text],input[type=email],input[type=password],select,textarea")?"input":"custom"),"custom"===t.data("save-trigger-type")?t.append('  ').addClass("settings-saved-trigger"):t.addClass("settings-saved-trigger-input")},update:function(e,t){var s=i.utils.unwrapObservable(t()),o=n(e);if("custom"===o.data("save-trigger-type"))switch(s.toString()){case"1":o.find(".animated,.error").hide().removeClass("visible").end().find(".success").show().addClass("visible");break;case"0":o.find(".animated,.success").hide().removeClass("visible").end().find(".error").show().addClass("visible");break;case"-2":o.find(".error,.success").hide().removeClass("visible").end().find(".animated").show().addClass("visible");break;default:o.find(".animated").hide().end().find(".error,.success").removeClass("visible")}else switch(s.toString()){case"1":o.addClass("success").removeClass("error");break;case"0":o.addClass("error").removeClass("success");break;case"-2":break;default:o.removeClass("error success")}}},i.bindingHandlers.emailsTags={init:function(t,i,s){var a=e("Utils"),r=e("Model:Email"),l=n(t),c=i(),u=s(),d=u.autoCompleteSource||null,p=function(e){c&&c.focusTrigger&&c.focusTrigger(e)};l.inputosaurus({parseOnBlur:!0,allowDragAndDrop:!0,focusCallback:p,inputDelimiters:[",",";"],autoCompleteSource:d,parseHook:function(e){return o.map(e,function(e){var t=a.trim(e),i=null;return""!==t?(i=new r,i.mailsoParse(t),i.clearDuplicateName(),[i.toLine(!1),i]):[t,null]})},change:o.bind(function(e){l.data("EmailsTagsValue",e.target.value),c(e.target.value)},this)})},update:function(e,t,s){var o=n(e),a=s(),r=a.emailsTagsFilter||null,l=i.utils.unwrapObservable(t());o.data("EmailsTagsValue")!==l&&(o.val(l),o.data("EmailsTagsValue",l),o.inputosaurus("refresh")),r&&i.utils.unwrapObservable(r)&&o.inputosaurus("focus")}},i.bindingHandlers.contactTags={init:function(t,i,s){var a=e("Utils"),r=e("Model:ContactTag"),l=n(t),c=i(),u=s(),d=u.autoCompleteSource||null,p=function(e){c&&c.focusTrigger&&c.focusTrigger(e)};l.inputosaurus({parseOnBlur:!0,allowDragAndDrop:!1,focusCallback:p,inputDelimiters:[",",";"],outputDelimiter:",",autoCompleteSource:d,parseHook:function(e){return o.map(e,function(e){var t=a.trim(e),i=null;return""!==t?(i=new r,i.name(t),[i.toLine(!1),i]):[t,null]})},change:o.bind(function(e){l.data("ContactTagsValue",e.target.value),c(e.target.value)},this)})},update:function(e,t,s){var o=n(e),a=s(),r=a.contactTagsFilter||null,l=i.utils.unwrapObservable(t());o.data("ContactTagsValue")!==l&&(o.val(l),o.data("ContactTagsValue",l),o.inputosaurus("refresh")),r&&i.utils.unwrapObservable(r)&&o.inputosaurus("focus")}},i.bindingHandlers.command={init:function(e,t,s,o){var a=n(e),r=t();if(!r||!r.enabled||!r.canExecute)throw new Error("You are not using command function");a.addClass("command"),i.bindingHandlers[a.is("form")?"submit":"click"].init.apply(o,arguments)},update:function(e,t){var i=!0,s=n(e),o=t();i=o.enabled(),s.toggleClass("command-not-enabled",!i),i&&(i=o.canExecute(),s.toggleClass("command-can-not-be-execute",!i)),s.toggleClass("command-disabled disable disabled",!i).toggleClass("no-disabled",!!i),(s.is("input")||s.is("button"))&&s.prop("disabled",!i)}},i.extenders.trimmer=function(t){var s=e("Utils"),o=i.computed({read:t,write:function(e){t(s.trim(e.toString()))},owner:this});return o(t()),o},i.extenders.posInterer=function(t,s){var o=e("Utils"),n=i.computed({read:t,write:function(e){var i=o.pInt(e.toString(),s);0>=i&&(i=s),i===t()&&""+i!=""+e&&t(i+1),t(i)}});return n(t()),n},i.extenders.reversible=function(e){var t=e();return e.commit=function(){t=e()},e.reverse=function(){e(t)},e.commitedValue=function(){return t},e},i.extenders.toggleSubscribe=function(e,t){return e.subscribe(t[1],t[0],"beforeChange"),e.subscribe(t[2],t[0]),e},i.extenders.falseTimeout=function(t,i){var o=e("Utils");return t.iTimeout=0,t.subscribe(function(e){e&&(s.clearTimeout(t.iTimeout),t.iTimeout=s.setTimeout(function(){t(!1),t.iTimeout=0},o.pInt(i)))}),t},i.observable.fn.validateNone=function(){return this.hasError=i.observable(!1),this},i.observable.fn.validateEmail=function(){var t=e("Utils");return this.hasError=i.observable(!1),this.subscribe(function(e){e=t.trim(e),this.hasError(""!==e&&!/^[^@\s]+@[^@\s]+$/.test(e))},this),this.valueHasMutated(),this},i.observable.fn.validateSimpleEmail=function(){var t=e("Utils");return this.hasError=i.observable(!1),this.subscribe(function(e){e=t.trim(e),this.hasError(""!==e&&!/^.+@.+$/.test(e))},this),this.valueHasMutated(),this},i.observable.fn.validateFunc=function(t){var s=e("Utils");return this.hasFuncError=i.observable(!1),s.isFunc(t)&&(this.subscribe(function(e){this.hasFuncError(!t(e))},this),this.valueHasMutated()),this},t.exports=i}(t,ko)},{$:20,Globals:9,"Model:ContactTag":36,"Model:Email":37,Utils:14,_:25,window:26}],23:[function(e,t){t.exports=moment},{}],24:[function(e,t){t.exports=ssm},{}],25:[function(e,t){t.exports=_},{}],26:[function(e,t){t.exports=window},{}],27:[function(e,t){!function(e,t){"use strict";function i(){this.oScreens={},this.sDefaultScreenName="",this.oCurrentScreen=null}var s=t("_"),o=t("$"),n=t("ko"),a=t("hasher"),r=t("crossroads"),l=t("Globals"),c=t("Plugins"),u=t("Utils");i.prototype.oScreens={},i.prototype.sDefaultScreenName="",i.prototype.oCurrentScreen=null,i.prototype.hideLoading=function(){o("#rl-loading").hide()},i.prototype.constructorEnd=function(e){u.isFunc(e.__constructor_end)&&e.__constructor_end.call(e)},i.prototype.extendAsViewModel=function(e,t){t&&(t.__names=u.isArray(e)?e:[e],t.__name=t.__names[0])},i.prototype.addSettingsViewModel=function(e,t,i,s,o){e.__rlSettingsData={Label:i,Template:t,Route:s,IsDefault:!!o},l.aViewModels.settings.push(e)},i.prototype.removeSettingsViewModel=function(e){l.aViewModels["settings-removed"].push(e)},i.prototype.disableSettingsViewModel=function(e){l.aViewModels["settings-disabled"].push(e)},i.prototype.routeOff=function(){a.changed.active=!1},i.prototype.routeOn=function(){a.changed.active=!0},i.prototype.screen=function(e){return""===e||u.isUnd(this.oScreens[e])?null:this.oScreens[e]},i.prototype.buildViewModel=function(e,t){if(e&&!e.__builded){var i=this,a=new e(t),r=a.viewModelPosition(),d=o("#rl-content #rl-"+r.toLowerCase()),p=null;e.__builded=!0,e.__vm=a,a.viewModelName=e.__name,a.viewModelNames=e.__names,d&&1===d.length?(p=o("
    ").addClass("rl-view-model").addClass("RL-"+a.viewModelTemplate()).hide(),p.appendTo(d),a.viewModelDom=p,e.__dom=p,"Popups"===r&&(a.cancelCommand=a.closeCommand=u.createCommand(a,function(){i.hideScreenPopup(e)}),a.modalVisibility.subscribe(function(e){var t=this;e?(this.viewModelDom.show(),this.storeAndSetKeyScope(),l.popupVisibilityNames.push(this.viewModelName),a.viewModelDom.css("z-index",3e3+l.popupVisibilityNames().length+10),u.delegateRun(this,"onFocus",[],500)):(u.delegateRun(this,"onHide"),this.restoreKeyScope(),s.each(this.viewModelNames,function(e){c.runHook("view-model-on-hide",[e,t])}),l.popupVisibilityNames.remove(this.viewModelName),a.viewModelDom.css("z-index",2e3),l.tooltipTrigger(!l.tooltipTrigger()),s.delay(function(){t.viewModelDom.hide()},300))},a)),s.each(e.__names,function(e){c.runHook("view-model-pre-build",[e,a,p])}),n.applyBindingAccessorsToNode(p[0],{i18nInit:!0,template:function(){return{name:a.viewModelTemplate()}}},a),u.delegateRun(a,"onBuild",[p]),a&&"Popups"===r&&a.registerPopupKeyDown(),s.each(e.__names,function(e){c.runHook("view-model-post-build",[e,a,p])})):u.log("Cannot find view model position: "+r)}return e?e.__vm:null},i.prototype.hideScreenPopup=function(e){e&&e.__vm&&e.__dom&&e.__vm.modalVisibility(!1)},i.prototype.showScreenPopup=function(e,t){e&&(this.buildViewModel(e),e.__vm&&e.__dom&&(e.__vm.modalVisibility(!0),u.delegateRun(e.__vm,"onShow",t||[]),s.each(e.__names,function(i){c.runHook("view-model-on-show",[i,e.__vm,t||[]])})))},i.prototype.isPopupVisible=function(e){return e&&e.__vm?e.__vm.modalVisibility():!1},i.prototype.screenOnRoute=function(e,t){var i=this,o=null,n=null;""===u.pString(e)&&(e=this.sDefaultScreenName),""!==e&&(o=this.screen(e),o||(o=this.screen(this.sDefaultScreenName),o&&(t=e+"/"+t,e=this.sDefaultScreenName)),o&&o.__started&&(o.__builded||(o.__builded=!0,u.isNonEmptyArray(o.viewModels())&&s.each(o.viewModels(),function(e){this.buildViewModel(e,o)},this),u.delegateRun(o,"onBuild")),s.defer(function(){i.oCurrentScreen&&(u.delegateRun(i.oCurrentScreen,"onHide"),u.isNonEmptyArray(i.oCurrentScreen.viewModels())&&s.each(i.oCurrentScreen.viewModels(),function(e){e.__vm&&e.__dom&&"Popups"!==e.__vm.viewModelPosition()&&(e.__dom.hide(),e.__vm.viewModelVisibility(!1),u.delegateRun(e.__vm,"onHide"))})),i.oCurrentScreen=o,i.oCurrentScreen&&(u.delegateRun(i.oCurrentScreen,"onShow"),c.runHook("screen-on-show",[i.oCurrentScreen.screenName(),i.oCurrentScreen]),u.isNonEmptyArray(i.oCurrentScreen.viewModels())&&s.each(i.oCurrentScreen.viewModels(),function(e){e.__vm&&e.__dom&&"Popups"!==e.__vm.viewModelPosition()&&(e.__dom.show(),e.__vm.viewModelVisibility(!0),u.delegateRun(e.__vm,"onShow"),u.delegateRun(e.__vm,"onFocus",[],200),s.each(e.__names,function(t){c.runHook("view-model-on-show",[t,e.__vm])}))},i)),n=o.__cross?o.__cross():null,n&&n.parse(t)})))},i.prototype.startScreens=function(e){o("#rl-content").css({visibility:"hidden"}),s.each(e,function(e){var t=new e,i=t?t.screenName():"";t&&""!==i&&(""===this.sDefaultScreenName&&(this.sDefaultScreenName=i),this.oScreens[i]=t)},this),s.each(this.oScreens,function(e){e&&!e.__started&&e.__start&&(e.__started=!0,e.__start(),c.runHook("screen-pre-start",[e.screenName(),e]),u.delegateRun(e,"onStart"),c.runHook("screen-post-start",[e.screenName(),e]))},this);var t=r.create();t.addRoute(/^([a-zA-Z0-9\-]*)\/?(.*)$/,s.bind(this.screenOnRoute,this)),a.initialized.add(t.parse,t),a.changed.add(t.parse,t),a.init(),o("#rl-content").css({visibility:"visible"}),s.delay(function(){l.$html.removeClass("rl-started-trigger").addClass("rl-started")},50)},i.prototype.setHash=function(e,t,i){e="#"===e.substr(0,1)?e.substr(1):e,e="/"===e.substr(0,1)?e.substr(1):e,i=u.isUnd(i)?!1:!!i,(u.isUnd(t)?1:!t)?(a.changed.active=!0,a[i?"replaceHash":"setHash"](e),a.setHash(e)):(a.changed.active=!1,a[i?"replaceHash":"setHash"](e),a.changed.active=!0)},e.exports=new i}(t,e)},{$:20,Globals:9,Plugins:12,Utils:14,_:25,crossroads:17,hasher:18,ko:22}],28:[function(e,t){!function(e){"use strict";function t(){}t.prototype.bootstart=function(){},e.exports=t}(t,e)},{}],29:[function(e,t){!function(e,t){"use strict";function i(e,t){this.sScreenName=e,this.aViewModels=n.isArray(t)?t:[]}var s=t("_"),o=t("crossroads"),n=t("Utils");i.prototype.oCross=null,i.prototype.sScreenName="",i.prototype.aViewModels=[],i.prototype.viewModels=function(){return this.aViewModels},i.prototype.screenName=function(){return this.sScreenName},i.prototype.routes=function(){return null},i.prototype.__cross=function(){return this.oCross},i.prototype.__start=function(){var e=this.routes(),t=null,i=null;n.isNonEmptyArray(e)&&(i=s.bind(this.onRoute||n.emptyFunction,this),t=o.create(),s.each(e,function(e){t.addRoute(e[0],i).rules=e[1]}),this.oCross=t)},e.exports=i}(t,e)},{Utils:14,_:25,crossroads:17}],30:[function(e,t){!function(e,t){"use strict";function i(e,t){this.bDisabeCloseOnEsc=!1,this.sPosition=n.pString(e),this.sTemplate=n.pString(t),this.sDefaultKeyScope=o.KeyState.None,this.sCurrentKeyScope=this.sDefaultKeyScope,this.viewModelVisibility=s.observable(!1),this.modalVisibility=s.observable(!1).extend({rateLimit:0}),this.viewModelName="",this.viewModelNames=[],this.viewModelDom=null}var s=t("ko"),o=t("Enums"),n=t("Utils"),a=t("Globals");i.prototype.bDisabeCloseOnEsc=!1,i.prototype.sPosition="",i.prototype.sTemplate="",i.prototype.sDefaultKeyScope=o.KeyState.None,i.prototype.sCurrentKeyScope=o.KeyState.None,i.prototype.viewModelName="",i.prototype.viewModelNames=[],i.prototype.viewModelDom=null,i.prototype.viewModelTemplate=function(){return this.sTemplate},i.prototype.viewModelPosition=function(){return this.sPosition},i.prototype.cancelCommand=function(){},i.prototype.closeCommand=function(){},i.prototype.storeAndSetKeyScope=function(){this.sCurrentKeyScope=a.keyScope(),a.keyScope(this.sDefaultKeyScope)},i.prototype.restoreKeyScope=function(){a.keyScope(this.sCurrentKeyScope)},i.prototype.registerPopupKeyDown=function(){var e=this;a.$win.on("keydown",function(t){if(t&&e.modalVisibility&&e.modalVisibility()){if(!this.bDisabeCloseOnEsc&&o.EventKeyCode.Esc===t.keyCode)return n.delegateRun(e,"cancelCommand"),!1;if(o.EventKeyCode.Backspace===t.keyCode&&!n.inFocus())return!1}return!0})},e.exports=i}(t,e)},{Enums:7,Globals:9,Utils:14,ko:22}],31:[function(e,t){!function(e,t){"use strict";function i(e,t){this.email=e,this.deleteAccess=s.observable(!1),this.canBeDalete=s.observable(o.isUnd(t)?!0:!!t)}var s=t("ko"),o=t("Utils");i.prototype.email="",i.prototype.changeAccountLink=function(){return t("LinkBuilder").change(this.email)},e.exports=i}(t,e)},{LinkBuilder:11,Utils:14,ko:22}],32:[function(e,t){!function(e,t){"use strict";function i(){this.mimeType="",this.fileName="",this.estimatedSize=0,this.friendlySize="",this.isInline=!1,this.isLinked=!1,this.cid="",this.cidWithOutTags="",this.contentLocation="",this.download="",this.folder="",this.uid="",this.mimeIndex=""}var s=t("window"),o=t("Globals"),n=t("Utils"),a=t("LinkBuilder");i.newInstanceFromJson=function(e){var t=new i;return t.initByJson(e)?t:null},i.prototype.mimeType="",i.prototype.fileName="",i.prototype.estimatedSize=0,i.prototype.friendlySize="",i.prototype.isInline=!1,i.prototype.isLinked=!1,i.prototype.cid="",i.prototype.cidWithOutTags="",i.prototype.contentLocation="",i.prototype.download="",i.prototype.folder="",i.prototype.uid="",i.prototype.mimeIndex="",i.prototype.initByJson=function(e){var t=!1;return e&&"Object/Attachment"===e["@Object"]&&(this.mimeType=(e.MimeType||"").toLowerCase(),this.fileName=e.FileName,this.estimatedSize=n.pInt(e.EstimatedSize),this.isInline=!!e.IsInline,this.isLinked=!!e.IsLinked,this.cid=e.CID,this.contentLocation=e.ContentLocation,this.download=e.Download,this.folder=e.Folder,this.uid=e.Uid,this.mimeIndex=e.MimeIndex,this.friendlySize=n.friendlySize(this.estimatedSize),this.cidWithOutTags=this.cid.replace(/^<+/,"").replace(/>+$/,""),t=!0),t},i.prototype.isImage=function(){return-1,]+)>?,? ?/g,i=t.exec(e);i?(this.name=i[1]||"",this.email=i[2]||"",this.clearDuplicateName()):/^[^@]+@[^@]+$/.test(e)&&(this.name="",this.email=e)},i.prototype.initByJson=function(e){var t=!1;return e&&"Object/Email"===e["@Object"]&&(this.name=s.trim(e.Name),this.email=s.trim(e.Email),t=""!==this.email,this.clearDuplicateName()),t},i.prototype.toLine=function(e,t,i){var o="";return""!==this.email&&(t=s.isUnd(t)?!1:!!t,i=s.isUnd(i)?!1:!!i,e&&""!==this.name?o=t?'
    ")+'" target="_blank" tabindex="-1">'+s.encodeHtml(this.name)+"":i?s.encodeHtml(this.name):this.name:(o=this.email,""!==this.name?t?o=s.encodeHtml('"'+this.name+'" <')+'")+'" target="_blank" tabindex="-1">'+s.encodeHtml(o)+""+s.encodeHtml(">"):(o='"'+this.name+'" <'+o+">",i&&(o=s.encodeHtml(o))):t&&(o=''+s.encodeHtml(this.email)+""))),o},i.prototype.mailsoParse=function(e){if(e=s.trim(e),""===e)return!1;for(var t=function(e,t,i){e+="";var s=e.length;return 0>t&&(t+=s),s="undefined"==typeof i?s:0>i?i+s:i+t,t>=e.length||0>t||t>s?!1:e.slice(t,s)},i=function(e,t,i,s){return 0>i&&(i+=e.length),s=void 0!==s?s:e.length,0>s&&(s=s+e.length-i),e.slice(0,i)+t.substr(0,s)+t.slice(s)+e.slice(i+s)},o="",n="",a="",r=!1,l=!1,c=!1,u=null,d=0,p=0,h=0;h0&&0===o.length&&(o=t(e,0,h)),l=!0,d=h);break;case">":l&&(p=h,n=t(e,d+1,p-d-1),e=i(e,"",d,p-d+1),p=0,h=0,d=0,l=!1);break;case"(":r||l||c||(c=!0,d=h);break;case")":c&&(p=h,a=t(e,d+1,p-d-1),e=i(e,"",d,p-d+1),p=0,h=0,d=0,c=!1);break;case"\\":h++}h++}return 0===n.length&&(u=e.match(/[^@\s]+@\S+/i),u&&u[0]?n=u[0]:o=e),n.length>0&&0===o.length&&0===a.length&&(o=e.replace(n,"")),n=s.trim(n).replace(/^[<]+/,"").replace(/[>]+$/,""),o=s.trim(o).replace(/^["']+/,"").replace(/["']+$/,""),a=s.trim(a).replace(/^[(]+/,"").replace(/[)]+$/,""),o=o.replace(/\\\\(.)/g,"$1"),a=a.replace(/\\\\(.)/g,"$1"),this.name=o,this.email=n,this.clearDuplicateName(),!0},i.prototype.inputoTagLine=function(){return 00){if(n.FolderType.Draft===i)return""+e;if(t>0&&n.FolderType.Trash!==i&&n.FolderType.Archive!==i&&n.FolderType.SentItems!==i)return""+t}return""},this),this.canBeDeleted=o.computed(function(){var e=this.isSystemFolder();return!e&&0===this.subFolders().length&&"INBOX"!==this.fullNameRaw},this),this.canBeSubScribed=o.computed(function(){return!this.isSystemFolder()&&this.selectable&&"INBOX"!==this.fullNameRaw},this),this.localName=o.computed(function(){a.langChangeTrigger();var e=this.type(),t=this.name();if(this.isSystemFolder())switch(e){case n.FolderType.Inbox:t=r.i18n("FOLDER_LIST/INBOX_NAME");break;case n.FolderType.SentItems:t=r.i18n("FOLDER_LIST/SENT_NAME");break;case n.FolderType.Draft:t=r.i18n("FOLDER_LIST/DRAFTS_NAME");break;case n.FolderType.Spam:t=r.i18n("FOLDER_LIST/SPAM_NAME");break;case n.FolderType.Trash:t=r.i18n("FOLDER_LIST/TRASH_NAME");break;case n.FolderType.Archive:t=r.i18n("FOLDER_LIST/ARCHIVE_NAME")}return t},this),this.manageFolderSystemName=o.computed(function(){a.langChangeTrigger();var e="",t=this.type(),i=this.name();if(this.isSystemFolder())switch(t){case n.FolderType.Inbox:e="("+r.i18n("FOLDER_LIST/INBOX_NAME")+")";break;case n.FolderType.SentItems:e="("+r.i18n("FOLDER_LIST/SENT_NAME")+")";break;case n.FolderType.Draft:e="("+r.i18n("FOLDER_LIST/DRAFTS_NAME")+")";break;case n.FolderType.Spam:e="("+r.i18n("FOLDER_LIST/SPAM_NAME")+")";break;case n.FolderType.Trash:e="("+r.i18n("FOLDER_LIST/TRASH_NAME")+")";break;case n.FolderType.Archive:e="("+r.i18n("FOLDER_LIST/ARCHIVE_NAME")+")"}return(""!==e&&"("+i+")"===e||"(inbox)"===e.toLowerCase())&&(e=""),e},this),this.collapsed=o.computed({read:function(){return!this.hidden()&&this.collapsedPrivate()},write:function(e){this.collapsedPrivate(e)},owner:this}),this.hasUnreadMessages=o.computed(function(){return 0"},i.prototype.formattedNameForCompose=function(){var e=this.name();return""===e?this.email():e+" ("+this.email()+")"},i.prototype.formattedNameForEmail=function(){var e=this.name();return""===e?this.email():'"'+o.quoteName(e)+'" <'+this.email()+">"},e.exports=i}(t,e)},{Utils:14,ko:22}],42:[function(e,t){!function(e,t){"use strict";function i(){this.folderFullNameRaw="",this.uid="",this.hash="",this.requestHash="",this.subject=a.observable(""),this.subjectPrefix=a.observable(""),this.subjectSuffix=a.observable(""),this.size=a.observable(0),this.dateTimeStampInUTC=a.observable(0),this.priority=a.observable(l.MessagePriority.Normal),this.proxy=!1,this.fromEmailString=a.observable(""),this.fromClearEmailString=a.observable(""),this.toEmailsString=a.observable(""),this.toClearEmailsString=a.observable(""),this.senderEmailsString=a.observable(""),this.senderClearEmailsString=a.observable(""),this.emails=[],this.from=[],this.to=[],this.cc=[],this.bcc=[],this.replyTo=[],this.deliveredTo=[],this.newForAnimation=a.observable(!1),this.deleted=a.observable(!1),this.unseen=a.observable(!1),this.flagged=a.observable(!1),this.answered=a.observable(!1),this.forwarded=a.observable(!1),this.isReadReceipt=a.observable(!1),this.focused=a.observable(!1),this.selected=a.observable(!1),this.checked=a.observable(!1),this.hasAttachments=a.observable(!1),this.attachmentsMainType=a.observable(""),this.moment=a.observable(r(r.unix(0))),this.attachmentIconClass=a.computed(function(){var e="";if(this.hasAttachments())switch(e="icon-attachment",this.attachmentsMainType()){case"image":e="icon-image";break;case"archive":e="icon-file-zip";break;case"doc":e="icon-file-text"}return e},this),this.fullFormatDateValue=a.computed(function(){return i.calculateFullFromatDateValue(this.dateTimeStampInUTC())},this),this.momentDate=c.createMomentDate(this),this.momentShortDate=c.createMomentShortDate(this),this.dateTimeStampInUTC.subscribe(function(e){var t=r().unix();this.moment(r.unix(e>t?t:e))},this),this.body=null,this.plainRaw="",this.isHtml=a.observable(!1),this.hasImages=a.observable(!1),this.attachments=a.observableArray([]),this.isPgpSigned=a.observable(!1),this.isPgpEncrypted=a.observable(!1),this.pgpSignedVerifyStatus=a.observable(l.SignedVerifyStatus.None),this.pgpSignedVerifyUser=a.observable(""),this.priority=a.observable(l.MessagePriority.Normal),this.readReceipt=a.observable(""),this.aDraftInfo=[],this.sMessageId="",this.sInReplyTo="",this.sReferences="",this.parentUid=a.observable(0),this.threads=a.observableArray([]),this.threadsLen=a.observable(0),this.hasUnseenSubMessage=a.observable(!1),this.hasFlaggedSubMessage=a.observable(!1),this.lastInCollapsedThread=a.observable(!1),this.lastInCollapsedThreadLoading=a.observable(!1),this.threadsLenResult=a.computed(function(){var e=this.threadsLen();return 0===this.parentUid()&&e>0?e+1:""},this)}var s=t("window"),o=t("_"),n=t("$"),a=t("ko"),r=t("moment"),l=t("Enums"),c=t("Utils"),u=t("Globals"),d=t("LinkBuilder"),p=t("Model:Email"),h=t("Model:Attachment");i.newInstanceFromJson=function(e){var t=new i;return t.initByJson(e)?t:null},i.calculateFullFromatDateValue=function(e){return e>0?r.unix(e).format("LLL"):""},i.emailsToLine=function(e,t,i){var s=[],o=0,n=0;if(c.isNonEmptyArray(e))for(o=0,n=e.length;n>o;o++)s.push(e[o].toLine(t,i));return s.join(", ")},i.emailsToLineClear=function(e){var t=[],i=0,s=0;if(c.isNonEmptyArray(e))for(i=0,s=e.length;s>i;i++)e[i]&&e[i].email&&""!==e[i].name&&t.push(e[i].email);return t.join(", ")},i.initEmailsFromJson=function(e){var t=0,i=0,s=null,o=[];if(c.isNonEmptyArray(e))for(t=0,i=e.length;i>t;t++)s=p.newInstanceFromJson(e[t]),s&&o.push(s);return o},i.replyHelper=function(e,t,i){if(e&&0s;s++)c.isUnd(t[e[s].email])&&(t[e[s].email]=!0,i.push(e[s]))},i.prototype.clear=function(){this.folderFullNameRaw="",this.uid="",this.hash="",this.requestHash="",this.subject(""),this.subjectPrefix(""),this.subjectSuffix(""),this.size(0),this.dateTimeStampInUTC(0),this.priority(l.MessagePriority.Normal),this.proxy=!1,this.fromEmailString(""),this.fromClearEmailString(""),this.toEmailsString(""),this.toClearEmailsString(""),this.senderEmailsString(""),this.senderClearEmailsString(""),this.emails=[],this.from=[],this.to=[],this.cc=[],this.bcc=[],this.replyTo=[],this.deliveredTo=[],this.newForAnimation(!1),this.deleted(!1),this.unseen(!1),this.flagged(!1),this.answered(!1),this.forwarded(!1),this.isReadReceipt(!1),this.selected(!1),this.checked(!1),this.hasAttachments(!1),this.attachmentsMainType(""),this.body=null,this.isHtml(!1),this.hasImages(!1),this.attachments([]),this.isPgpSigned(!1),this.isPgpEncrypted(!1),this.pgpSignedVerifyStatus(l.SignedVerifyStatus.None),this.pgpSignedVerifyUser(""),this.priority(l.MessagePriority.Normal),this.readReceipt(""),this.aDraftInfo=[],this.sMessageId="",this.sInReplyTo="",this.sReferences="",this.parentUid(0),this.threads([]),this.threadsLen(0),this.hasUnseenSubMessage(!1),this.hasFlaggedSubMessage(!1),this.lastInCollapsedThread(!1),this.lastInCollapsedThreadLoading(!1)},i.prototype.friendlySize=function(){return c.friendlySize(this.size())},i.prototype.computeSenderEmail=function(){var e=t("Storage:RainLoop:Data"),i=e.sentFolder(),s=e.draftFolder();this.senderEmailsString(this.folderFullNameRaw===i||this.folderFullNameRaw===s?this.toEmailsString():this.fromEmailString()),this.senderClearEmailsString(this.folderFullNameRaw===i||this.folderFullNameRaw===s?this.toClearEmailsString():this.fromClearEmailString())},i.prototype.initByJson=function(e){var t=!1;return e&&"Object/Message"===e["@Object"]&&(this.folderFullNameRaw=e.Folder,this.uid=e.Uid,this.hash=e.Hash,this.requestHash=e.RequestHash,this.proxy=!!e.ExternalProxy,this.size(c.pInt(e.Size)),this.from=i.initEmailsFromJson(e.From),this.to=i.initEmailsFromJson(e.To),this.cc=i.initEmailsFromJson(e.Cc),this.bcc=i.initEmailsFromJson(e.Bcc),this.replyTo=i.initEmailsFromJson(e.ReplyTo),this.deliveredTo=i.initEmailsFromJson(e.DeliveredTo),this.subject(e.Subject),c.isArray(e.SubjectParts)?(this.subjectPrefix(e.SubjectParts[0]),this.subjectSuffix(e.SubjectParts[1])):(this.subjectPrefix(""),this.subjectSuffix(this.subject())),this.dateTimeStampInUTC(c.pInt(e.DateTimeStampInUTC)),this.hasAttachments(!!e.HasAttachments),this.attachmentsMainType(e.AttachmentsMainType),this.fromEmailString(i.emailsToLine(this.from,!0)),this.fromClearEmailString(i.emailsToLineClear(this.from)),this.toEmailsString(i.emailsToLine(this.to,!0)),this.toClearEmailsString(i.emailsToLineClear(this.to)),this.parentUid(c.pInt(e.ParentThread)),this.threads(c.isArray(e.Threads)?e.Threads:[]),this.threadsLen(c.pInt(e.ThreadsLen)),this.initFlagsByJson(e),this.computeSenderEmail(),t=!0),t},i.prototype.initUpdateByMessageJson=function(e){var i=t("Storage:RainLoop:Data"),s=!1,o=l.MessagePriority.Normal;return e&&"Object/Message"===e["@Object"]&&(o=c.pInt(e.Priority),this.priority(-1t;t++)s=h.newInstanceFromJson(e["@Collection"][t]),s&&(""!==s.cidWithOutTags&&0+$/,""),t=o.find(i,function(t){return e===t.cidWithOutTags})),t||null},i.prototype.findAttachmentByContentLocation=function(e){var t=null,i=this.attachments();return c.isNonEmptyArray(i)&&(t=o.find(i,function(t){return e===t.contentLocation})),t||null},i.prototype.messageId=function(){return this.sMessageId},i.prototype.inReplyTo=function(){return this.sInReplyTo},i.prototype.references=function(){return this.sReferences},i.prototype.fromAsSingleEmail=function(){return c.isArray(this.from)&&this.from[0]?this.from[0].email:""},i.prototype.viewLink=function(){return d.messageViewLink(this.requestHash)},i.prototype.downloadLink=function(){return d.messageDownloadLink(this.requestHash)},i.prototype.replyEmails=function(e){var t=[],s=c.isUnd(e)?{}:e;return i.replyHelper(this.replyTo,s,t),0===t.length&&i.replyHelper(this.from,s,t),t},i.prototype.replyAllEmails=function(e){var t=[],s=[],o=c.isUnd(e)?{}:e;return i.replyHelper(this.replyTo,o,t),0===t.length&&i.replyHelper(this.from,o,t),i.replyHelper(this.to,o,t),i.replyHelper(this.cc,o,s),[t,s]},i.prototype.textBodyToString=function(){return this.body?this.body.html():""},i.prototype.attachmentsToStringLine=function(){var e=o.map(this.attachments(),function(e){return e.fileName+" ("+e.friendlySize+")"});return e&&0=0&&s&&!o&&i.attr("src",s)}),e&&s.setTimeout(function(){t.print()},100))})},i.prototype.printMessage=function(){this.viewPopupMessage(!0)},i.prototype.generateUid=function(){return this.folderFullNameRaw+"/"+this.uid},i.prototype.populateByMessageListItem=function(e){return this.folderFullNameRaw=e.folderFullNameRaw,this.uid=e.uid,this.hash=e.hash,this.requestHash=e.requestHash,this.subject(e.subject()),this.subjectPrefix(this.subjectPrefix()),this.subjectSuffix(this.subjectSuffix()),this.size(e.size()),this.dateTimeStampInUTC(e.dateTimeStampInUTC()),this.priority(e.priority()),this.proxy=e.proxy,this.fromEmailString(e.fromEmailString()),this.fromClearEmailString(e.fromClearEmailString()),this.toEmailsString(e.toEmailsString()),this.toClearEmailsString(e.toClearEmailsString()),this.emails=e.emails,this.from=e.from,this.to=e.to,this.cc=e.cc,this.bcc=e.bcc,this.replyTo=e.replyTo,this.deliveredTo=e.deliveredTo,this.unseen(e.unseen()),this.flagged(e.flagged()),this.answered(e.answered()),this.forwarded(e.forwarded()),this.isReadReceipt(e.isReadReceipt()),this.selected(e.selected()),this.checked(e.checked()),this.hasAttachments(e.hasAttachments()),this.attachmentsMainType(e.attachmentsMainType()),this.moment(e.moment()),this.body=null,this.priority(l.MessagePriority.Normal),this.aDraftInfo=[],this.sMessageId="",this.sInReplyTo="",this.sReferences="",this.parentUid(e.parentUid()),this.threads(e.threads()),this.threadsLen(e.threadsLen()),this.computeSenderEmail(),this},i.prototype.showExternalImages=function(e){if(this.body&&this.body.data("rl-has-images")){var t="";e=c.isUnd(e)?!1:e,this.hasImages(!1),this.body.data("rl-has-images",!1),t=this.proxy?"data-x-additional-src":"data-x-src",n("["+t+"]",this.body).each(function(){e&&n(this).is("img")?n(this).addClass("lazy").attr("data-original",n(this).attr(t)).removeAttr(t):n(this).attr("src",n(this).attr(t)).removeAttr(t)}),t=this.proxy?"data-x-additional-style-url":"data-x-style-url",n("["+t+"]",this.body).each(function(){var e=c.trim(n(this).attr("style"));e=""===e?"":";"===e.substr(-1)?e+" ":e+"; ",n(this).attr("style",e+n(this).attr(t)).removeAttr(t)}),e&&(n("img.lazy",this.body).addClass("lazy-inited").lazyload({threshold:400,effect:"fadeIn",skip_invisible:!1,container:n(".RL-MailMessageView .messageView .messageItem .content")[0]}),u.$win.resize()),c.windowResize(500)}},i.prototype.showInternalImages=function(e){if(this.body&&!this.body.data("rl-init-internal-images")){this.body.data("rl-init-internal-images",!0),e=c.isUnd(e)?!1:e;var t=this;n("[data-x-src-cid]",this.body).each(function(){var i=t.findAttachmentByCid(n(this).attr("data-x-src-cid"));i&&i.download&&(e&&n(this).is("img")?n(this).addClass("lazy").attr("data-original",i.linkPreview()):n(this).attr("src",i.linkPreview()))}),n("[data-x-src-location]",this.body).each(function(){var i=t.findAttachmentByContentLocation(n(this).attr("data-x-src-location"));i||(i=t.findAttachmentByCid(n(this).attr("data-x-src-location"))),i&&i.download&&(e&&n(this).is("img")?n(this).addClass("lazy").attr("data-original",i.linkPreview()):n(this).attr("src",i.linkPreview()))}),n("[data-x-style-cid]",this.body).each(function(){var e="",i="",s=t.findAttachmentByCid(n(this).attr("data-x-style-cid"));s&&s.linkPreview&&(i=n(this).attr("data-x-style-cid-name"),""!==i&&(e=c.trim(n(this).attr("style")),e=""===e?"":";"===e.substr(-1)?e+" ":e+"; ",n(this).attr("style",e+i+": url('"+s.linkPreview()+"')")))}),e&&!function(e,t){o.delay(function(){e.addClass("lazy-inited").lazyload({threshold:400,effect:"fadeIn",skip_invisible:!1,container:t})},300)}(n("img.lazy",t.body),n(".RL-MailMessageView .messageView .messageItem .content")[0]),c.windowResize(500)}},i.prototype.storeDataToDom=function(){if(this.body){this.body.data("rl-is-html",!!this.isHtml()),this.body.data("rl-has-images",!!this.hasImages()),this.body.data("rl-plain-raw",this.plainRaw); +var e=t("Storage:RainLoop:Data");e.capaOpenPGP()&&(this.body.data("rl-plain-pgp-signed",!!this.isPgpSigned()),this.body.data("rl-plain-pgp-encrypted",!!this.isPgpEncrypted()),this.body.data("rl-pgp-verify-status",this.pgpSignedVerifyStatus()),this.body.data("rl-pgp-verify-user",this.pgpSignedVerifyUser()))}},i.prototype.storePgpVerifyDataToDom=function(){var e=t("Storage:RainLoop:Data");this.body&&e.capaOpenPGP()&&(this.body.data("rl-pgp-verify-status",this.pgpSignedVerifyStatus()),this.body.data("rl-pgp-verify-user",this.pgpSignedVerifyUser()))},i.prototype.fetchDataToDom=function(){if(this.body){this.isHtml(!!this.body.data("rl-is-html")),this.hasImages(!!this.body.data("rl-has-images")),this.plainRaw=c.pString(this.body.data("rl-plain-raw"));var e=t("Storage:RainLoop:Data");e.capaOpenPGP()?(this.isPgpSigned(!!this.body.data("rl-plain-pgp-signed")),this.isPgpEncrypted(!!this.body.data("rl-plain-pgp-encrypted")),this.pgpSignedVerifyStatus(this.body.data("rl-pgp-verify-status")),this.pgpSignedVerifyUser(this.body.data("rl-pgp-verify-user"))):(this.isPgpSigned(!1),this.isPgpEncrypted(!1),this.pgpSignedVerifyStatus(l.SignedVerifyStatus.None),this.pgpSignedVerifyUser(""))}},i.prototype.verifyPgpSignedClearMessage=function(){if(this.isPgpSigned()){var e=[],i=null,a=t("Storage:RainLoop:Data"),r=this.from&&this.from[0]&&this.from[0].email?this.from[0].email:"",c=a.findPublicKeysByEmail(r),d=null,p=null,h="";this.pgpSignedVerifyStatus(l.SignedVerifyStatus.Error),this.pgpSignedVerifyUser("");try{i=s.openpgp.cleartext.readArmored(this.plainRaw),i&&i.getText&&(this.pgpSignedVerifyStatus(c.length?l.SignedVerifyStatus.Unverified:l.SignedVerifyStatus.UnknownPublicKeys),e=i.verify(c),e&&0').text(h)).html(),u.$div.empty(),this.replacePlaneTextBody(h)))))}catch(g){}this.storePgpVerifyDataToDom()}},i.prototype.decryptPgpEncryptedMessage=function(e){if(this.isPgpEncrypted()){var i=[],a=null,r=null,c=t("Storage:RainLoop:Data"),d=this.from&&this.from[0]&&this.from[0].email?this.from[0].email:"",p=c.findPublicKeysByEmail(d),h=c.findSelfPrivateKey(e),g=null,m=null,f="";this.pgpSignedVerifyStatus(l.SignedVerifyStatus.Error),this.pgpSignedVerifyUser(""),h||this.pgpSignedVerifyStatus(l.SignedVerifyStatus.UnknownPrivateKey);try{a=s.openpgp.message.readArmored(this.plainRaw),a&&h&&a.decrypt&&(this.pgpSignedVerifyStatus(l.SignedVerifyStatus.Unverified),r=a.decrypt(h),r&&(i=r.verify(p),i&&0').text(f)).html(),u.$div.empty(),this.replacePlaneTextBody(f)))}catch(b){}this.storePgpVerifyDataToDom()}},i.prototype.replacePlaneTextBody=function(e){this.body&&this.body.html(e).addClass("b-text-part plain")},i.prototype.flagHash=function(){return[this.deleted(),this.unseen(),this.flagged(),this.answered(),this.forwarded(),this.isReadReceipt()].join("")},e.exports=i}(t,e)},{$:20,Enums:7,Globals:9,LinkBuilder:11,"Model:Attachment":32,"Model:Email":37,"Storage:RainLoop:Data":64,Utils:14,_:25,ko:22,moment:23,window:26}],43:[function(e,t){!function(e,t){"use strict";function i(e,t,i,o,n,a,r){this.index=e,this.id=i,this.guid=t,this.user=o,this.email=n,this.armor=r,this.isPrivate=!!a,this.deleteAccess=s.observable(!1)}var s=t("ko");i.prototype.index=0,i.prototype.id="",i.prototype.guid="",i.prototype.user="",i.prototype.email="",i.prototype.armor="",i.prototype.isPrivate=!1,e.exports=i}(t,e)},{ko:22}],44:[function(e,t){!function(e,t){"use strict";function i(){o.call(this,"about",[t("View:RainLoop:About")])}var s=t("_"),o=t("Knoin:AbstractScreen");s.extend(i.prototype,o.prototype),i.prototype.onShow=function(){t("App:RainLoop").setTitle("RainLoop")},e.exports=i}(t,e)},{"App:RainLoop":3,"Knoin:AbstractScreen":29,"View:RainLoop:About":70,_:25}],45:[function(e,t){!function(e,t){"use strict";function i(e){u.call(this,"settings",e),this.menu=n.observableArray([]),this.oCurrentSubScreen=null,this.oViewModelPlace=null}var s=t("_"),o=t("$"),n=t("ko"),a=t("Globals"),r=t("Utils"),l=t("LinkBuilder"),c=t("App:Knoin"),u=t("Knoin:AbstractScreen");s.extend(i.prototype,u.prototype),i.prototype.onRoute=function(e){var t=this,i=null,u=null,d=null,p=null;u=s.find(a.aViewModels.settings,function(t){return t&&t.__rlSettingsData&&e===t.__rlSettingsData.Route}),u&&(s.find(a.aViewModels["settings-removed"],function(e){return e&&e===u})&&(u=null),u&&s.find(a.aViewModels["settings-disabled"],function(e){return e&&e===u})&&(u=null)),u?(u.__builded&&u.__vm?i=u.__vm:(d=this.oViewModelPlace,d&&1===d.length?(i=new u,p=o("
    ").addClass("rl-settings-view-model").hide(),p.appendTo(d),i.viewModelDom=p,i.__rlSettingsData=u.__rlSettingsData,u.__dom=p,u.__builded=!0,u.__vm=i,n.applyBindingAccessorsToNode(p[0],{i18nInit:!0,template:function(){return{name:u.__rlSettingsData.Template}}},i),r.delegateRun(i,"onBuild",[p])):r.log("Cannot find sub settings view model position: SettingsSubScreen")),i&&s.defer(function(){t.oCurrentSubScreen&&(r.delegateRun(t.oCurrentSubScreen,"onHide"),t.oCurrentSubScreen.viewModelDom.hide()),t.oCurrentSubScreen=i,t.oCurrentSubScreen&&(t.oCurrentSubScreen.viewModelDom.show(),r.delegateRun(t.oCurrentSubScreen,"onShow"),r.delegateRun(t.oCurrentSubScreen,"onFocus",[],200),s.each(t.menu(),function(e){e.selected(i&&i.__rlSettingsData&&e.route===i.__rlSettingsData.Route)}),o("#rl-content .b-settings .b-content .content").scrollTop(0)),r.windowResize()})):c.setHash(l.settings(),!1,!0)},i.prototype.onHide=function(){this.oCurrentSubScreen&&this.oCurrentSubScreen.viewModelDom&&(r.delegateRun(this.oCurrentSubScreen,"onHide"),this.oCurrentSubScreen.viewModelDom.hide())},i.prototype.onBuild=function(){s.each(a.aViewModels.settings,function(e){e&&e.__rlSettingsData&&!s.find(a.aViewModels["settings-removed"],function(t){return t&&t===e})&&this.menu.push({route:e.__rlSettingsData.Route,label:e.__rlSettingsData.Label,selected:n.observable(!1),disabled:!!s.find(a.aViewModels["settings-disabled"],function(t){return t&&t===e})})},this),this.oViewModelPlace=o("#rl-content #rl-settings-subscreen")},i.prototype.routes=function(){var e=s.find(a.aViewModels.settings,function(e){return e&&e.__rlSettingsData&&e.__rlSettingsData.IsDefault}),t=e?e.__rlSettingsData.Route:"general",i={subname:/^(.*)$/,normalize_:function(e,i){return i.subname=r.isUnd(i.subname)?t:r.pString(i.subname),[i.subname]}};return[["{subname}/",i],["{subname}",i],["",i]]},e.exports=i}(t,e)},{$:20,"App:Knoin":27,Globals:9,"Knoin:AbstractScreen":29,LinkBuilder:11,Utils:14,_:25,ko:22}],46:[function(e,t){!function(e,t){"use strict";function i(){o.call(this,"login",[t("View:RainLoop:Login")])}var s=t("_"),o=t("Knoin:AbstractScreen");s.extend(i.prototype,o.prototype),i.prototype.onShow=function(){t("App:RainLoop").setTitle("")},e.exports=i}(t,e)},{"App:RainLoop":3,"Knoin:AbstractScreen":29,"View:RainLoop:Login":72,_:25}],47:[function(e,t){!function(e,t){"use strict";function i(){l.call(this,"mailbox",[t("View:RainLoop:MailBoxSystemDropDown"),t("View:RainLoop:MailBoxFolderList"),t("View:RainLoop:MailBoxMessageList"),t("View:RainLoop:MailBoxMessageView")]),this.oLastRoute={}}var s=t("_"),o=t("Enums"),n=t("Globals"),a=t("Utils"),r=t("Events"),l=t("Knoin:AbstractScreen"),c=t("Storage:Settings"),u=t("Storage:RainLoop:Data"),d=t("Storage:RainLoop:Cache"),p=t("Storage:RainLoop:Remote");s.extend(i.prototype,l.prototype),i.prototype.oLastRoute={},i.prototype.setNewTitle=function(){var e=u.accountEmail(),i=u.foldersInboxUnreadCount();t("App:RainLoop").setTitle((""===e?"":(i>0?"("+i+") ":" ")+e+" - ")+a.i18n("TITLES/MAILBOX"))},i.prototype.onShow=function(){this.setNewTitle(),n.keyScope(o.KeyState.MessageList)},i.prototype.onRoute=function(e,i,s,n){if(a.isUnd(n)?1:!n){var r=d.getFolderFullNameRaw(e),l=d.getFolderFromCacheList(r);l&&(u.currentFolder(l).messageListPage(i).messageListSearch(s),o.Layout.NoPreview===u.layout()&&u.message()&&u.message(null),t("App:RainLoop").reloadMessageList())}else o.Layout.NoPreview!==u.layout()||u.message()||t("App:RainLoop").historyBack()},i.prototype.onStart=function(){var e=function(){a.windowResize()};(c.capa(o.Capa.AdditionalAccounts)||c.capa(o.Capa.AdditionalIdentities))&&t("App:RainLoop").accountsAndIdentities(),s.delay(function(){"INBOX"!==u.currentFolderFullNameRaw()&&t("App:RainLoop").folderInformation("INBOX")},1e3),s.delay(function(){t("App:RainLoop").quota()},5e3),s.delay(function(){p.appDelayStart(a.emptyFunction)},35e3),n.$html.toggleClass("rl-no-preview-pane",o.Layout.NoPreview===u.layout()),u.folderList.subscribe(e),u.messageList.subscribe(e),u.message.subscribe(e),u.layout.subscribe(function(e){n.$html.toggleClass("rl-no-preview-pane",o.Layout.NoPreview===e)}),r.sub("mailbox.inbox-unread-count",function(e){u.foldersInboxUnreadCount(e)}),u.foldersInboxUnreadCount.subscribe(function(){this.setNewTitle()},this)},i.prototype.routes=function(){var e=function(){return["Inbox",1,"",!0]},t=function(e,t){return t[0]=a.pString(t[0]),t[1]=a.pInt(t[1]),t[1]=0>=t[1]?1:t[1],t[2]=a.pString(t[2]),""===e&&(t[0]="Inbox",t[1]=1),[decodeURI(t[0]),t[1],decodeURI(t[2]),!1]},i=function(e,t){return t[0]=a.pString(t[0]),t[1]=a.pString(t[1]),""===e&&(t[0]="Inbox"),[decodeURI(t[0]),1,decodeURI(t[1]),!1]};return[[/^([a-zA-Z0-9]+)\/p([1-9][0-9]*)\/(.+)\/?$/,{normalize_:t}],[/^([a-zA-Z0-9]+)\/p([1-9][0-9]*)$/,{normalize_:t}],[/^([a-zA-Z0-9]+)\/(.+)\/?$/,{normalize_:i}],[/^message-preview$/,{normalize_:e}],[/^([^\/]*)$/,{normalize_:t}]]},e.exports=i}(t,e)},{"App:RainLoop":3,Enums:7,Events:8,Globals:9,"Knoin:AbstractScreen":29,"Storage:RainLoop:Cache":63,"Storage:RainLoop:Data":64,"Storage:RainLoop:Remote":68,"Storage:Settings":69,Utils:14,"View:RainLoop:MailBoxFolderList":73,"View:RainLoop:MailBoxMessageList":74,"View:RainLoop:MailBoxMessageView":75,"View:RainLoop:MailBoxSystemDropDown":76,_:25}],48:[function(e,t){!function(e,t){"use strict";function i(){r.call(this,[t("View:RainLoop:SettingsSystemDropDown"),t("View:RainLoop:SettingsMenu"),t("View:RainLoop:SettingsPane")]),n.initOnStartOrLangChange(function(){this.sSettingsTitle=n.i18n("TITLES/SETTINGS")},this,function(){this.setSettingsTitle()})}var s=t("_"),o=t("Enums"),n=t("Utils"),a=t("Globals"),r=t("Screen:AbstractSettings");s.extend(i.prototype,r.prototype),i.prototype.onShow=function(){this.setSettingsTitle(),a.keyScope(o.KeyState.Settings)},i.prototype.setSettingsTitle=function(){t("App:RainLoop").setTitle(this.sSettingsTitle)},e.exports=i}(t,e)},{"App:RainLoop":3,Enums:7,Globals:9,"Screen:AbstractSettings":45,Utils:14,"View:RainLoop:SettingsMenu":94,"View:RainLoop:SettingsPane":95,"View:RainLoop:SettingsSystemDropDown":96,_:25}],49:[function(e,t){!function(e,t){"use strict";function i(){this.accounts=c.accounts,this.processText=n.computed(function(){return c.accountsLoading()?r.i18n("SETTINGS_ACCOUNTS/LOADING_PROCESS"):""},this),this.visibility=n.computed(function(){return""===this.processText()?"hidden":"visible"},this),this.accountForDeletion=n.observable(null).extend({falseTimeout:3e3}).extend({toggleSubscribe:[this,function(e){e&&e.deleteAccess(!1)},function(e){e&&e.deleteAccess(!0)}]})}var s=t("window"),o=t("_"),n=t("ko"),a=t("Enums"),r=t("Utils"),l=t("LinkBuilder"),c=t("Storage:RainLoop:Data"),u=t("Storage:RainLoop:Remote");i.prototype.addNewAccount=function(){t("App:Knoin").showScreenPopup(t("View:Popup:AddAccount"))},i.prototype.deleteAccount=function(e){if(e&&e.deleteAccess()){this.accountForDeletion(null);var i=t("App:Knoin"),n=function(t){return e===t};e&&(this.accounts.remove(n),u.accountDelete(function(e,n){a.StorageResultType.Success===e&&n&&n.Result&&n.Reload?(i.routeOff(),i.setHash(l.root(),!0),i.routeOff(),o.defer(function(){s.location.reload()})):t("App:RainLoop").accountsAndIdentities()},e.email))}},e.exports=i}(t,e)},{"App:Knoin":27,"App:RainLoop":3,Enums:7,LinkBuilder:11,"Storage:RainLoop:Data":64,"Storage:RainLoop:Remote":68,Utils:14,"View:Popup:AddAccount":77,_:25,ko:22,window:26}],50:[function(e,t){!function(e,t){"use strict";function i(){this.changeProcess=o.observable(!1),this.errorDescription=o.observable(""),this.passwordMismatch=o.observable(!1),this.passwordUpdateError=o.observable(!1),this.passwordUpdateSuccess=o.observable(!1),this.currentPassword=o.observable(""),this.currentPassword.error=o.observable(!1),this.newPassword=o.observable(""),this.newPassword2=o.observable(""),this.currentPassword.subscribe(function(){this.passwordUpdateError(!1),this.passwordUpdateSuccess(!1),this.currentPassword.error(!1)},this),this.newPassword.subscribe(function(){this.passwordUpdateError(!1),this.passwordUpdateSuccess(!1),this.passwordMismatch(!1)},this),this.newPassword2.subscribe(function(){this.passwordUpdateError(!1),this.passwordUpdateSuccess(!1),this.passwordMismatch(!1)},this),this.saveNewPasswordCommand=a.createCommand(this,function(){this.newPassword()!==this.newPassword2()?(this.passwordMismatch(!0),this.errorDescription(a.i18n("SETTINGS_CHANGE_PASSWORD/ERROR_PASSWORD_MISMATCH"))):(this.changeProcess(!0),this.passwordUpdateError(!1),this.passwordUpdateSuccess(!1),this.currentPassword.error(!1),this.passwordMismatch(!1),this.errorDescription(""),r.changePassword(this.onChangePasswordResponse,this.currentPassword(),this.newPassword()))},function(){return!this.changeProcess()&&""!==this.currentPassword()&&""!==this.newPassword()&&""!==this.newPassword2()}),this.onChangePasswordResponse=s.bind(this.onChangePasswordResponse,this)}var s=t("_"),o=t("ko"),n=t("Enums"),a=t("Utils"),r=t("Storage:RainLoop:Remote");i.prototype.onHide=function(){this.changeProcess(!1),this.currentPassword(""),this.newPassword(""),this.newPassword2(""),this.errorDescription(""),this.passwordMismatch(!1),this.currentPassword.error(!1)},i.prototype.onChangePasswordResponse=function(e,t){this.changeProcess(!1),this.passwordMismatch(!1),this.errorDescription(""),this.currentPassword.error(!1),n.StorageResultType.Success===e&&t&&t.Result?(this.currentPassword(""),this.newPassword(""),this.newPassword2(""),this.passwordUpdateSuccess(!0),this.currentPassword.error(!1)):(t&&n.Notification.CurrentPasswordIncorrect===t.ErrorCode&&this.currentPassword.error(!0),this.passwordUpdateError(!0),this.errorDescription(a.getNotification(t&&t.ErrorCode?t.ErrorCode:n.Notification.CouldNotSaveNewPassword)))},e.exports=i}(t,e)},{Enums:7,"Storage:RainLoop:Remote":68,Utils:14,_:25,ko:22}],51:[function(e,t){!function(e,t){"use strict";function i(){this.contactsAutosave=a.contactsAutosave,this.allowContactsSync=a.allowContactsSync,this.enableContactsSync=a.enableContactsSync,this.contactsSyncUrl=a.contactsSyncUrl,this.contactsSyncUser=a.contactsSyncUser,this.contactsSyncPass=a.contactsSyncPass,this.saveTrigger=s.computed(function(){return[this.enableContactsSync()?"1":"0",this.contactsSyncUrl(),this.contactsSyncUser(),this.contactsSyncPass()].join("|")},this).extend({throttle:500}),this.saveTrigger.subscribe(function(){n.saveContactsSyncData(null,this.enableContactsSync(),this.contactsSyncUrl(),this.contactsSyncUser(),this.contactsSyncPass())},this)}var s=t("ko"),o=t("Utils"),n=t("Storage:RainLoop:Remote"),a=t("Storage:RainLoop:Data");i.prototype.onBuild=function(){a.contactsAutosave.subscribe(function(e){n.saveSettings(o.emptyFunction,{ContactsAutosave:e?"1":"0"})})},e.exports=i}(t,e)},{"Storage:RainLoop:Data":64,"Storage:RainLoop:Remote":68,Utils:14,ko:22}],52:[function(e,t){!function(e,t){"use strict";function i(){this.filters=s.observableArray([]),this.filters.loading=s.observable(!1),this.filters.subscribe(function(){o.windowResize()})}var s=t("ko"),o=t("Utils");i.prototype.deleteFilter=function(e){this.filters.remove(e)},i.prototype.addFilter=function(){var e=t("Model:Filter");t("App:Knoin").showScreenPopup(t("View:Popup:Filter"),[new e])},e.exports=i}(t,e)},{"App:Knoin":27,"Model:Filter":39,Utils:14,"View:Popup:Filter":84,ko:22}],53:[function(e,t){!function(e,t){"use strict";function i(){this.foldersListError=l.foldersListError,this.folderList=l.folderList,this.processText=s.computed(function(){var e=l.foldersLoading(),t=l.foldersCreating(),i=l.foldersDeleting(),s=l.foldersRenaming();return t?n.i18n("SETTINGS_FOLDERS/CREATING_PROCESS"):i?n.i18n("SETTINGS_FOLDERS/DELETING_PROCESS"):s?n.i18n("SETTINGS_FOLDERS/RENAMING_PROCESS"):e?n.i18n("SETTINGS_FOLDERS/LOADING_PROCESS"):""},this),this.visibility=s.computed(function(){return""===this.processText()?"hidden":"visible"},this),this.folderForDeletion=s.observable(null).extend({falseTimeout:3e3}).extend({toggleSubscribe:[this,function(e){e&&e.deleteAccess(!1)},function(e){e&&e.deleteAccess(!0)}]}),this.folderForEdit=s.observable(null).extend({toggleSubscribe:[this,function(e){e&&e.edited(!1)},function(e){e&&e.canBeEdited()&&e.edited(!0)}]}),this.useImapSubscribe=!!a.settingsGet("UseImapSubscribe")}var s=t("ko"),o=t("Enums"),n=t("Utils"),a=t("Storage:Settings"),r=t("Storage:LocalStorage"),l=t("Storage:RainLoop:Data"),c=t("Storage:RainLoop:Cache"),u=t("Storage:RainLoop:Remote");i.prototype.folderEditOnEnter=function(e){var i=e?n.trim(e.nameForEdit()):"";""!==i&&e.name()!==i&&(r.set(o.ClientSideKeyName.FoldersLashHash,""),l.foldersRenaming(!0),u.folderRename(function(e,i){l.foldersRenaming(!1),o.StorageResultType.Success===e&&i&&i.Result||l.foldersListError(i&&i.ErrorCode?n.getNotification(i.ErrorCode):n.i18n("NOTIFICATIONS/CANT_RENAME_FOLDER")),t("App:RainLoop").folders()},e.fullNameRaw,i),c.removeFolderFromCacheList(e.fullNameRaw),e.name(i)),e.edited(!1)},i.prototype.folderEditOnEsc=function(e){e&&e.edited(!1)},i.prototype.onShow=function(){l.foldersListError("")},i.prototype.createFolder=function(){t("App:Knoin").showScreenPopup(t("View:Popup:FolderCreate"))},i.prototype.systemFolder=function(){t("App:Knoin").showScreenPopup(t("View:Popup:FolderSystem"))},i.prototype.deleteFolder=function(e){if(e&&e.canBeDeleted()&&e.deleteAccess()&&0===e.privateMessageCountAll()){this.folderForDeletion(null);var i=function(t){return e===t?!0:(t.subFolders.remove(i),!1)};e&&(r.set(o.ClientSideKeyName.FoldersLashHash,""),l.folderList.remove(i),l.foldersDeleting(!0),u.folderDelete(function(e,i){l.foldersDeleting(!1),o.StorageResultType.Success===e&&i&&i.Result||l.foldersListError(i&&i.ErrorCode?n.getNotification(i.ErrorCode):n.i18n("NOTIFICATIONS/CANT_DELETE_FOLDER")),t("App:RainLoop").folders()},e.fullNameRaw),c.removeFolderFromCacheList(e.fullNameRaw))}else 0"},i.prototype.addNewIdentity=function(){t("App:Knoin").showScreenPopup(t("View:Popup:Identity"))},i.prototype.editIdentity=function(e){t("App:Knoin").showScreenPopup(t("View:Popup:Identity"),[e])},i.prototype.deleteIdentity=function(e){if(e&&e.deleteAccess()){this.identityForDeletion(null);var i=function(t){return e===t};e&&(this.identities.remove(i),c.identityDelete(function(){t("App:RainLoop").accountsAndIdentities()},e.id))}},i.prototype.onFocus=function(){if(!this.editor&&this.signatureDom()){var e=this,t=l.signature();this.editor=new r(e.signatureDom(),function(){l.signature((e.editor.isHtml()?":HTML:":"")+e.editor.getData())},function(){":HTML:"===t.substr(0,6)?e.editor.setHtml(t.substr(6),!1):e.editor.setPlain(t,!1)})}},i.prototype.onBuild=function(e){var t=this;e.on("click",".identity-item .e-action",function(){var e=o.dataFor(this);e&&t.editIdentity(e)}),s.delay(function(){var e=a.settingsSaveHelperSimpleFunction(t.displayNameTrigger,t),i=a.settingsSaveHelperSimpleFunction(t.replyTrigger,t),s=a.settingsSaveHelperSimpleFunction(t.signatureTrigger,t),o=a.settingsSaveHelperSimpleFunction(t.defaultIdentityIDTrigger,t);l.defaultIdentityID.subscribe(function(e){c.saveSettings(o,{DefaultIdentityID:e})}),l.displayName.subscribe(function(t){c.saveSettings(e,{DisplayName:t})}),l.replyTo.subscribe(function(e){c.saveSettings(i,{ReplyTo:e})}),l.signature.subscribe(function(e){c.saveSettings(s,{Signature:e})}),l.signatureToAll.subscribe(function(e){c.saveSettings(null,{SignatureToAll:e?"1":"0"})})},50)},e.exports=i}(t,e)},{"App:Knoin":27,"App:RainLoop":3,Enums:7,HtmlEditor:10,"Storage:RainLoop:Data":64,"Storage:RainLoop:Remote":68,Utils:14,"View:Popup:Identity":88,_:25,ko:22}],56:[function(e,t){!function(e,t){"use strict";function i(){this.editor=null,this.displayName=l.displayName,this.signature=l.signature,this.signatureToAll=l.signatureToAll,this.replyTo=l.replyTo,this.signatureDom=o.observable(null),this.displayNameTrigger=o.observable(n.SaveSettingsStep.Idle),this.replyTrigger=o.observable(n.SaveSettingsStep.Idle),this.signatureTrigger=o.observable(n.SaveSettingsStep.Idle)}var s=t("_"),o=t("ko"),n=t("Enums"),a=t("Utils"),r=t("HtmlEditor"),l=t("Storage:RainLoop:Data"),c=t("Storage:RainLoop:Remote");i.prototype.onFocus=function(){if(!this.editor&&this.signatureDom()){var e=this,t=l.signature();this.editor=new r(e.signatureDom(),function(){l.signature((e.editor.isHtml()?":HTML:":"")+e.editor.getData())},function(){":HTML:"===t.substr(0,6)?e.editor.setHtml(t.substr(6),!1):e.editor.setPlain(t,!1)})}},i.prototype.onBuild=function(){var e=this;s.delay(function(){var t=a.settingsSaveHelperSimpleFunction(e.displayNameTrigger,e),i=a.settingsSaveHelperSimpleFunction(e.replyTrigger,e),s=a.settingsSaveHelperSimpleFunction(e.signatureTrigger,e);l.displayName.subscribe(function(e){c.saveSettings(t,{DisplayName:e})}),l.replyTo.subscribe(function(e){c.saveSettings(i,{ReplyTo:e})}),l.signature.subscribe(function(e){c.saveSettings(s,{Signature:e})}),l.signatureToAll.subscribe(function(e){c.saveSettings(null,{SignatureToAll:e?"1":"0"})})},50)},e.exports=i}(t,e)},{Enums:7,HtmlEditor:10,"Storage:RainLoop:Data":64,"Storage:RainLoop:Remote":68,Utils:14,_:25,ko:22}],57:[function(e,t){!function(e,t){"use strict";function i(){this.openpgpkeys=n.openpgpkeys,this.openpgpkeysPublic=n.openpgpkeysPublic,this.openpgpkeysPrivate=n.openpgpkeysPrivate,this.openPgpKeyForDeletion=s.observable(null).extend({falseTimeout:3e3}).extend({toggleSubscribe:[this,function(e){e&&e.deleteAccess(!1)},function(e){e&&e.deleteAccess(!0)}]})}var s=t("ko"),o=t("App:Knoin"),n=t("Storage:RainLoop:Data");i.prototype.addOpenPgpKey=function(){o.showScreenPopup(t("View:Popup:AddOpenPgpKey"))},i.prototype.generateOpenPgpKey=function(){o.showScreenPopup(t("View:Popup:NewOpenPgpKey"))},i.prototype.viewOpenPgpKey=function(e){e&&o.showScreenPopup(t("View:Popup:ViewOpenPgpKey"),[e])},i.prototype.deleteOpenPgpKey=function(e){e&&e.deleteAccess()&&(this.openPgpKeyForDeletion(null),e&&n.openpgpKeyring&&(this.openpgpkeys.remove(function(t){return e===t}),n.openpgpKeyring[e.isPrivate?"privateKeys":"publicKeys"].removeForId(e.guid),n.openpgpKeyring.store(),t("App:RainLoop").reloadOpenPgpKeys()))},e.exports=i}(t,e)},{"App:Knoin":27,"App:RainLoop":3,"Storage:RainLoop:Data":64,"View:Popup:AddOpenPgpKey":78,"View:Popup:NewOpenPgpKey":91,"View:Popup:ViewOpenPgpKey":93,ko:22}],58:[function(e,t){!function(e,t){"use strict";function i(){this.processing=s.observable(!1),this.clearing=s.observable(!1),this.secreting=s.observable(!1),this.viewUser=s.observable(""),this.viewEnable=s.observable(!1),this.viewEnable.subs=!0,this.twoFactorStatus=s.observable(!1),this.viewSecret=s.observable(""),this.viewBackupCodes=s.observable(""),this.viewUrl=s.observable(""),this.bFirst=!0,this.viewTwoFactorStatus=s.computed(function(){return n.langChangeTrigger(),a.i18n(this.twoFactorStatus()?"SETTINGS_SECURITY/TWO_FACTOR_SECRET_CONFIGURED_DESC":"SETTINGS_SECURITY/TWO_FACTOR_SECRET_NOT_CONFIGURED_DESC")},this),this.onResult=_.bind(this.onResult,this),this.onSecretResult=_.bind(this.onSecretResult,this)}var s=t("ko"),o=t("Enums"),n=t("Globals"),a=t("Utils"),r=t("Storage:RainLoop:Remote");i.prototype.showSecret=function(){this.secreting(!0),r.showTwoFactorSecret(this.onSecretResult)},i.prototype.hideSecret=function(){this.viewSecret(""),this.viewBackupCodes(""),this.viewUrl("")},i.prototype.createTwoFactor=function(){this.processing(!0),r.createTwoFactor(this.onResult)},i.prototype.enableTwoFactor=function(){this.processing(!0),r.enableTwoFactor(this.onResult,this.viewEnable())},i.prototype.testTwoFactor=function(){t("App:Knoin").showScreenPopup(t("View:Popup:TwoFactorTest"))},i.prototype.clearTwoFactor=function(){this.viewSecret(""),this.viewBackupCodes(""),this.viewUrl(""),this.clearing(!0),r.clearTwoFactor(this.onResult)},i.prototype.onShow=function(){this.viewSecret(""),this.viewBackupCodes(""),this.viewUrl("")},i.prototype.onResult=function(e,t){if(this.processing(!1),this.clearing(!1),o.StorageResultType.Success===e&&t&&t.Result?(this.viewUser(a.pString(t.Result.User)),this.viewEnable(!!t.Result.Enable),this.twoFactorStatus(!!t.Result.IsSet),this.viewSecret(a.pString(t.Result.Secret)),this.viewBackupCodes(a.pString(t.Result.BackupCodes).replace(/[\s]+/g," ")),this.viewUrl(a.pString(t.Result.Url))):(this.viewUser(""),this.viewEnable(!1),this.twoFactorStatus(!1),this.viewSecret(""),this.viewBackupCodes(""),this.viewUrl("")),this.bFirst){this.bFirst=!1;var i=this;this.viewEnable.subscribe(function(e){this.viewEnable.subs&&r.enableTwoFactor(function(e,t){o.StorageResultType.Success===e&&t&&t.Result||(i.viewEnable.subs=!1,i.viewEnable(!1),i.viewEnable.subs=!0)},e)},this)}},i.prototype.onSecretResult=function(e,t){this.secreting(!1),o.StorageResultType.Success===e&&t&&t.Result?(this.viewSecret(a.pString(t.Result.Secret)),this.viewUrl(a.pString(t.Result.Url))):(this.viewSecret(""),this.viewUrl(""))},i.prototype.onBuild=function(){this.processing(!0),r.getTwoFactor(this.onResult)},e.exports=i}(t,e)},{"App:Knoin":27,Enums:7,Globals:9,"Storage:RainLoop:Remote":68,Utils:14,"View:Popup:TwoFactorTest":92,ko:22}],59:[function(e,t){!function(e,t){"use strict";function i(){var e=t("Utils"),i=t("Storage:RainLoop:Data");this.googleEnable=i.googleEnable,this.googleActions=i.googleActions,this.googleLoggined=i.googleLoggined,this.googleUserName=i.googleUserName,this.facebookEnable=i.facebookEnable,this.facebookActions=i.facebookActions,this.facebookLoggined=i.facebookLoggined,this.facebookUserName=i.facebookUserName,this.twitterEnable=i.twitterEnable,this.twitterActions=i.twitterActions,this.twitterLoggined=i.twitterLoggined,this.twitterUserName=i.twitterUserName,this.connectGoogle=e.createCommand(this,function(){this.googleLoggined()||t("App:RainLoop").googleConnect() +},function(){return!this.googleLoggined()&&!this.googleActions()}),this.disconnectGoogle=e.createCommand(this,function(){t("App:RainLoop").googleDisconnect()}),this.connectFacebook=e.createCommand(this,function(){this.facebookLoggined()||t("App:RainLoop").facebookConnect()},function(){return!this.facebookLoggined()&&!this.facebookActions()}),this.disconnectFacebook=e.createCommand(this,function(){t("App:RainLoop").facebookDisconnect()}),this.connectTwitter=e.createCommand(this,function(){this.twitterLoggined()||t("App:RainLoop").twitterConnect()},function(){return!this.twitterLoggined()&&!this.twitterActions()}),this.disconnectTwitter=e.createCommand(this,function(){t("App:RainLoop").twitterDisconnect()})}e.exports=i}(t,e)},{"App:RainLoop":3,"Storage:RainLoop:Data":64,Utils:14}],60:[function(e,t){!function(e,t){"use strict";function i(){var e=this;this.mainTheme=u.mainTheme,this.themesObjects=a.observableArray([]),this.themeTrigger=a.observable(r.SaveSettingsStep.Idle).extend({throttle:100}),this.oLastAjax=null,this.iTimer=0,u.theme.subscribe(function(t){o.each(this.themesObjects(),function(e){e.selected(t===e.name)});var i=n("#rlThemeLink"),a=n("#rlThemeStyle"),c=i.attr("href");c||(c=a.attr("data-href")),c&&(c=c.toString().replace(/\/-\/[^\/]+\/\-\//,"/-/"+t+"/-/"),c=c.toString().replace(/\/Css\/[^\/]+\/User\//,"/Css/0/User/"),"Json/"!==c.substring(c.length-5,c.length)&&(c+="Json/"),s.clearTimeout(e.iTimer),e.themeTrigger(r.SaveSettingsStep.Animate),this.oLastAjax&&this.oLastAjax.abort&&this.oLastAjax.abort(),this.oLastAjax=n.ajax({url:c,dataType:"json"}).done(function(t){t&&l.isArray(t)&&2===t.length&&(!i||!i[0]||a&&a[0]||(a=n(''),i.after(a),i.remove()),a&&a[0]&&(a.attr("data-href",c).attr("data-theme",t[0]),a&&a[0]&&a[0].styleSheet&&!l.isUnd(a[0].styleSheet.cssText)?a[0].styleSheet.cssText=t[1]:a.text(t[1])),e.themeTrigger(r.SaveSettingsStep.TrueResult))}).always(function(){e.iTimer=s.setTimeout(function(){e.themeTrigger(r.SaveSettingsStep.Idle)},1e3),e.oLastAjax=null})),d.saveSettings(null,{Theme:t})},this)}var s=t("window"),o=t("_"),n=t("$"),a=t("ko"),r=t("Enums"),l=t("Utils"),c=t("LinkBuilder"),u=t("Storage:RainLoop:Data"),d=t("Storage:RainLoop:Remote");i.prototype.onBuild=function(){var e=u.theme();this.themesObjects(o.map(u.themes(),function(t){return{name:t,nameDisplay:l.convertThemeName(t),selected:a.observable(t===e),themePreviewSrc:c.themePreviewLink(t)}}))},e.exports=i}(t,e)},{$:20,Enums:7,LinkBuilder:11,"Storage:RainLoop:Data":64,"Storage:RainLoop:Remote":68,Utils:14,_:25,ko:22,window:26}],61:[function(e,t){!function(e,t){"use strict";function i(){o.initDataConstructorBySettings(this)}var s=t("Enums"),o=t("Utils"),n=t("Storage:Settings");i.prototype.populateDataOnStart=function(){var e=o.pInt(n.settingsGet("Layout")),t=n.settingsGet("Languages"),i=n.settingsGet("Themes");o.isArray(t)&&this.languages(t),o.isArray(i)&&this.themes(i),this.mainLanguage(n.settingsGet("Language")),this.mainTheme(n.settingsGet("Theme")),this.capaAdditionalAccounts(n.capa(s.Capa.AdditionalAccounts)),this.capaAdditionalIdentities(n.capa(s.Capa.AdditionalIdentities)),this.capaGravatar(n.capa(s.Capa.Gravatar)),this.determineUserLanguage(!!n.settingsGet("DetermineUserLanguage")),this.determineUserDomain(!!n.settingsGet("DetermineUserDomain")),this.capaThemes(n.capa(s.Capa.Themes)),this.allowLanguagesOnLogin(!!n.settingsGet("AllowLanguagesOnLogin")),this.allowLanguagesOnSettings(!!n.settingsGet("AllowLanguagesOnSettings")),this.useLocalProxyForExternalImages(!!n.settingsGet("UseLocalProxyForExternalImages")),this.editorDefaultType(n.settingsGet("EditorDefaultType")),this.showImages(!!n.settingsGet("ShowImages")),this.contactsAutosave(!!n.settingsGet("ContactsAutosave")),this.interfaceAnimation(n.settingsGet("InterfaceAnimation")),this.mainMessagesPerPage(n.settingsGet("MPP")),this.desktopNotifications(!!n.settingsGet("DesktopNotifications")),this.useThreads(!!n.settingsGet("UseThreads")),this.replySameFolder(!!n.settingsGet("ReplySameFolder")),this.useCheckboxesInList(!!n.settingsGet("UseCheckboxesInList")),this.layout(s.Layout.SidePreview),-1(new s.Date).getTime()-g),f&&l.oRequests[f]&&(l.oRequests[f].__aborted&&(o="abort"),l.oRequests[f]=null),l.defaultResponse(e,f,o,i,n,t)}),f&&0=e?1:e},this),this.mainMessageListSearch=a.computed({read:this.messageListSearch,write:function(e){m.setHash(p.mailBox(this.currentFolderFullNameHash(),1,d.trim(e.toString())))},owner:this}),this.messageListError=a.observable(""),this.messageListLoading=a.observable(!1),this.messageListIsNotCompleted=a.observable(!1),this.messageListCompleteLoadingThrottle=a.observable(!1).extend({throttle:200}),this.messageListCompleteLoading=a.computed(function(){var e=this.messageListLoading(),t=this.messageListIsNotCompleted();return e||t},this),this.messageListCompleteLoading.subscribe(function(e){this.messageListCompleteLoadingThrottle(e)},this),this.messageList.subscribe(o.debounce(function(e){o.each(e,function(e){e.newForAnimation()&&e.newForAnimation(!1)})},500)),this.staticMessageList=new f,this.message=a.observable(null),this.messageLoading=a.observable(!1),this.messageLoadingThrottle=a.observable(!1).extend({throttle:50}),this.message.focused=a.observable(!1),this.message.subscribe(function(e){e?c.Layout.NoPreview===this.layout()&&this.message.focused(!0):(this.message.focused(!1),this.messageFullScreenMode(!1),this.hideMessageBodies(),c.Layout.NoPreview===this.layout()&&-10?s.Math.ceil(t/e*100):0},this),this.capaOpenPGP=a.observable(!1),this.openpgpkeys=a.observableArray([]),this.openpgpKeyring=null,this.openpgpkeysPublic=this.openpgpkeys.filter(function(e){return!(!e||e.isPrivate)}),this.openpgpkeysPrivate=this.openpgpkeys.filter(function(e){return!(!e||!e.isPrivate)}),this.googleActions=a.observable(!1),this.googleLoggined=a.observable(!1),this.googleUserName=a.observable(""),this.facebookActions=a.observable(!1),this.facebookLoggined=a.observable(!1),this.facebookUserName=a.observable(""),this.twitterActions=a.observable(!1),this.twitterLoggined=a.observable(!1),this.twitterUserName=a.observable(""),this.customThemeType=a.observable(c.CustomThemeType.Light),this.purgeMessageBodyCacheThrottle=o.throttle(this.purgeMessageBodyCache,3e4)}var s=t("window"),o=t("_"),n=t("$"),a=t("ko"),r=t("moment"),l=t("Consts"),c=t("Enums"),u=t("Globals"),d=t("Utils"),p=t("LinkBuilder"),h=t("Storage:Settings"),g=t("Storage:RainLoop:Cache"),m=t("App:Knoin"),f=t("Model:Message"),b=t("Storage:LocalStorage"),y=t("Storage:Abstract:Data");o.extend(i.prototype,y.prototype),i.prototype.purgeMessageBodyCache=function(){var e=0,t=null,i=u.iMessageBodyCacheCount-l.Values.MessageBodyCacheLimit;i>0&&(t=this.messagesBodiesDom(),t&&(t.find(".rl-cache-class").each(function(){var t=n(this);i>t.data("rl-cache-count")&&(t.addClass("rl-cache-purge"),e++)}),e>0&&o.delay(function(){t.find(".rl-cache-purge").remove()},300)))},i.prototype.populateDataOnStart=function(){y.prototype.populateDataOnStart.call(this),this.accountEmail(h.settingsGet("Email")),this.accountIncLogin(h.settingsGet("IncLogin")),this.accountOutLogin(h.settingsGet("OutLogin")),this.projectHash(h.settingsGet("ProjectHash")),this.defaultIdentityID(h.settingsGet("DefaultIdentityID")),this.displayName(h.settingsGet("DisplayName")),this.replyTo(h.settingsGet("ReplyTo")),this.signature(h.settingsGet("Signature")),this.signatureToAll(!!h.settingsGet("SignatureToAll")),this.enableTwoFactor(!!h.settingsGet("EnableTwoFactor")),this.lastFoldersHash=b.get(c.ClientSideKeyName.FoldersLashHash)||"",this.remoteSuggestions=!!h.settingsGet("RemoteSuggestions"),this.devEmail=h.settingsGet("DevEmail"),this.devPassword=h.settingsGet("DevPassword")},i.prototype.initUidNextAndNewMessages=function(e,t,i){if("INBOX"===e&&d.isNormal(t)&&""!==t){if(d.isArray(i)&&03)l(p.notificationMailIcon(),this.accountEmail(),d.i18n("MESSAGE_LIST/NEW_MESSAGE_NOTIFICATION",{COUNT:r}));else for(;r>a;a++)l(p.notificationMailIcon(),f.emailsToLine(f.initEmailsFromJson(i[a].From),!1),i[a].Subject)}g.setFolderUidNext(e,t)}},i.prototype.hideMessageBodies=function(){var e=this.messagesBodiesDom();e&&e.find(".b-text-part").hide()},i.prototype.getNextFolderNames=function(e){e=d.isUnd(e)?!1:!!e;var t=[],i=10,s=r().unix(),n=s-300,a=[],l=function(t){o.each(t,function(t){t&&"INBOX"!==t.fullNameRaw&&t.selectable&&t.existen&&n>t.interval&&(!e||t.subScribed())&&a.push([t.interval,t.fullNameRaw]),t&&0t[0]?1:0}),o.find(a,function(e){var o=g.getFolderFromCacheList(e[1]);return o&&(o.interval=s,t.push(e[1])),i<=t.length}),o.uniq(t)},i.prototype.removeMessagesFromList=function(e,t,i,s){i=d.isNormal(i)?i:"",s=d.isUnd(s)?!1:!!s,t=o.map(t,function(e){return d.pInt(e)});var n=this,a=0,r=this.messageList(),l=g.getFolderFromCacheList(e),c=""===i?null:g.getFolderFromCacheList(i||""),u=this.currentFolderFullNameRaw(),p=this.message(),h=u===e?o.filter(r,function(e){return e&&-10&&l.messageCountUnread(0<=l.messageCountUnread()-a?l.messageCountUnread()-a:0)),c&&(c.messageCountAll(c.messageCountAll()+t.length),a>0&&c.messageCountUnread(c.messageCountUnread()+a),c.actionBlink(!0)),0100)&&(e.addClass("rl-bq-switcher hidden-bq"),n('').insertBefore(e).click(function(){e.toggleClass("hidden-bq"),d.windowResize()}).after("
    ").before("
    "))})}},i.prototype.setMessage=function(e,t){var i=!1,s=!1,o=!1,a=null,r=null,l="",p="",h=!1,m=!1,f=this.messagesBodiesDom(),b=this.message();e&&b&&e.Result&&"Object/Message"===e.Result["@Object"]&&b.folderFullNameRaw===e.Result.Folder&&b.uid===e.Result.Uid&&(this.messageError(""),b.initUpdateByMessageJson(e.Result),g.addRequestedMessage(b.folderFullNameRaw,b.uid),t||b.initFlagsByJson(e.Result),f=f&&f[0]?f:null,f&&(l="rl-mgs-"+b.hash.replace(/[^a-zA-Z0-9]/g,""),r=f.find("#"+l),r&&r[0]?(b.body=r,b.body&&(b.body.data("rl-cache-count",++u.iMessageBodyCacheCount),b.fetchDataToDom())):(s=!!e.Result.HasExternals,o=!!e.Result.HasInternals,a=n('
    ').hide().addClass("rl-cache-class"),a.data("rl-cache-count",++u.iMessageBodyCacheCount),d.isNormal(e.Result.Html)&&""!==e.Result.Html?(i=!0,p=e.Result.Html.toString()):d.isNormal(e.Result.Plain)&&""!==e.Result.Plain?(i=!1,p=d.plainToHtml(e.Result.Plain.toString(),!1),(b.isPgpSigned()||b.isPgpEncrypted())&&this.capaOpenPGP()&&(b.plainRaw=d.pString(e.Result.Plain),m=/---BEGIN PGP MESSAGE---/.test(b.plainRaw),m||(h=/-----BEGIN PGP SIGNED MESSAGE-----/.test(b.plainRaw)&&/-----BEGIN PGP SIGNATURE-----/.test(b.plainRaw)),u.$div.empty(),h&&b.isPgpSigned()?p=u.$div.append(n('
    ').text(b.plainRaw)).html():m&&b.isPgpEncrypted()&&(p=u.$div.append(n('
    ').text(b.plainRaw)).html()),u.$div.empty(),b.isPgpSigned(h),b.isPgpEncrypted(m))):i=!1,a.html(d.linkify(p)).addClass("b-text-part "+(i?"html":"plain")),b.isHtml(!!i),b.hasImages(!!s),b.pgpSignedVerifyStatus(c.SignedVerifyStatus.None),b.pgpSignedVerifyUser(""),b.body=a,b.body&&f.append(b.body),b.storeDataToDom(),o&&b.showInternalImages(!0),b.hasImages()&&this.showImages()&&b.showExternalImages(!0),this.purgeMessageBodyCacheThrottle()),this.messageActiveDom(b.body),this.hideMessageBodies(),b.body.show(),a&&this.initBlockquoteSwitcher(a)),g.initMessageFlagsFromCache(b),b.unseen()&&u.__APP&&u.__APP.setMessageSeen(b),d.windowResize())},i.prototype.calculateMessageListHash=function(e){return o.map(e,function(e){return""+e.hash+"_"+e.threadsLen()+"_"+e.flagHash()}).join("|")},i.prototype.findPublicKeyByHex=function(e){return o.find(this.openpgpkeysPublic(),function(t){return t&&e===t.id})},i.prototype.findPublicKeysByEmail=function(e){return o.compact(o.map(this.openpgpkeysPublic(),function(t){var i=null;if(t&&e===t.email)try{if(i=s.openpgp.key.readArmored(t.armor),i&&!i.err&&i.keys&&i.keys[0])return i.keys[0]}catch(o){}return null}))},i.prototype.findPrivateKeyByEmail=function(e,t){var i=null,n=o.find(this.openpgpkeysPrivate(),function(t){return t&&e===t.email});if(n)try{i=s.openpgp.key.readArmored(n.armor),i&&!i.err&&i.keys&&i.keys[0]?(i=i.keys[0],i.decrypt(d.pString(t))):i=null}catch(a){i=null}return i},i.prototype.findSelfPrivateKey=function(e){return this.findPrivateKeyByEmail(this.accountEmail(),e)},e.exports=new i}(t,e)},{$:20,"App:Knoin":27,Consts:6,Enums:7,Globals:9,LinkBuilder:11,"Model:Message":42,"Storage:Abstract:Data":61,"Storage:LocalStorage":65,"Storage:RainLoop:Cache":63,"Storage:Settings":69,Utils:14,_:25,ko:22,moment:23,window:26}],65:[function(e,t){!function(e,t){"use strict";function i(){var e=t("_").find([t("Storage:LocalStorage:Cookie"),t("Storage:LocalStorage:LocalStorage")],function(e){return e&&e.supported()});this.oDriver=null,e&&(this.oDriver=new e)}i.prototype.oDriver=null,i.prototype.set=function(e,t){return this.oDriver?this.oDriver.set("p"+e,t):!1},i.prototype.get=function(e){return this.oDriver?this.oDriver.get("p"+e):null},e.exports=new i}(t,e)},{"Storage:LocalStorage:Cookie":66,"Storage:LocalStorage:LocalStorage":67,_:25}],66:[function(e,t){!function(e,t){"use strict";function i(){}var s=t("$"),o=t("JSON"),n=t("Consts"),a=t("Utils");i.supported=function(){return!0},i.prototype.set=function(e,t){var i=s.cookie(n.Values.ClientSideCookieIndexName),a=!1,r=null;try{r=null===i?null:o.parse(i),r||(r={}),r[e]=t,s.cookie(n.Values.ClientSideCookieIndexName,o.stringify(r),{expires:30}),a=!0}catch(l){}return a},i.prototype.get=function(e){var t=s.cookie(n.Values.ClientSideCookieIndexName),i=null;try{i=null===t?null:o.parse(t),i=i&&!a.isUnd(i[e])?i[e]:null}catch(r){}return i},e.exports=i}(t,e)},{$:20,Consts:6,JSON:15,Utils:14}],67:[function(e,t){!function(e,t){"use strict";function i(){}var s=t("window"),o=t("JSON"),n=t("Consts"),a=t("Utils");i.supported=function(){return!!s.localStorage},i.prototype.set=function(e,t){var i=s.localStorage[n.Values.ClientSideCookieIndexName]||null,a=!1,r=null;try{r=null===i?null:o.parse(i),r||(r={}),r[e]=t,s.localStorage[n.Values.ClientSideCookieIndexName]=o.stringify(r),a=!0}catch(l){}return a},i.prototype.get=function(e){var t=s.localStorage[n.Values.ClientSideCookieIndexName]||null,i=null;try{i=null===t?null:o.parse(t),i=i&&!a.isUnd(i[e])?i[e]:null}catch(r){}return i},e.exports=i}(t,e)},{Consts:6,JSON:15,Utils:14,window:26}],68:[function(e,t){!function(e,t){"use strict";function i(){d.call(this),this.oRequests={}}var s=t("_"),o=t("Utils"),n=t("Consts"),a=t("Globals"),r=t("Base64"),l=t("Storage:Settings"),c=t("Storage:RainLoop:Cache"),u=t("Storage:RainLoop:Data"),d=t("Storage:Abstract:Remote");s.extend(i.prototype,d.prototype),i.prototype.folders=function(e){this.defaultRequest(e,"Folders",{SentFolder:l.settingsGet("SentFolder"),DraftFolder:l.settingsGet("DraftFolder"),SpamFolder:l.settingsGet("SpamFolder"),TrashFolder:l.settingsGet("TrashFolder"),ArchiveFolder:l.settingsGet("ArchiveFolder")},null,"",["Folders"])},i.prototype.login=function(e,t,i,s,o,n,a,r){this.defaultRequest(e,"Login",{Email:t,Login:i,Password:s,Language:n||"",AdditionalCode:a||"",AdditionalCodeSignMe:r?"1":"0",SignMe:o?"1":"0"})},i.prototype.getTwoFactor=function(e){this.defaultRequest(e,"GetTwoFactorInfo")},i.prototype.createTwoFactor=function(e){this.defaultRequest(e,"CreateTwoFactorSecret")},i.prototype.clearTwoFactor=function(e){this.defaultRequest(e,"ClearTwoFactorInfo")},i.prototype.showTwoFactorSecret=function(e){this.defaultRequest(e,"ShowTwoFactorSecret")},i.prototype.testTwoFactor=function(e,t){this.defaultRequest(e,"TestTwoFactorInfo",{Code:t})},i.prototype.enableTwoFactor=function(e,t){this.defaultRequest(e,"EnableTwoFactor",{Enable:t?"1":"0"})},i.prototype.clearTwoFactorInfo=function(e){this.defaultRequest(e,"ClearTwoFactorInfo")},i.prototype.contactsSync=function(e){this.defaultRequest(e,"ContactsSync",null,n.Defaults.ContactsSyncAjaxTimeout)
    +},i.prototype.saveContactsSyncData=function(e,t,i,s,o){this.defaultRequest(e,"SaveContactsSyncData",{Enable:t?"1":"0",Url:i,User:s,Password:o})},i.prototype.accountAdd=function(e,t,i,s){this.defaultRequest(e,"AccountAdd",{Email:t,Login:i,Password:s})},i.prototype.accountDelete=function(e,t){this.defaultRequest(e,"AccountDelete",{EmailToDelete:t})},i.prototype.identityUpdate=function(e,t,i,s,o,n){this.defaultRequest(e,"IdentityUpdate",{Id:t,Email:i,Name:s,ReplyTo:o,Bcc:n})},i.prototype.identityDelete=function(e,t){this.defaultRequest(e,"IdentityDelete",{IdToDelete:t})},i.prototype.accountsAndIdentities=function(e){this.defaultRequest(e,"AccountsAndIdentities")},i.prototype.messageList=function(e,t,i,s,a,l){t=o.pString(t);var d=c.getFolderHash(t);l=o.isUnd(l)?!1:!!l,i=o.isUnd(i)?0:o.pInt(i),s=o.isUnd(i)?20:o.pInt(s),a=o.pString(a),""===d||""!==a&&-1!==a.indexOf("is:")?this.defaultRequest(e,"MessageList",{Folder:t,Offset:i,Limit:s,Search:a,UidNext:"INBOX"===t?c.getFolderUidNext(t):"",UseThreads:u.threading()&&u.useThreads()?"1":"0",ExpandedThreadUid:u.threading()&&t===u.messageListThreadFolder()?u.messageListThreadUids().join(","):""},""===a?n.Defaults.DefaultAjaxTimeout:n.Defaults.SearchAjaxTimeout,"",l?[]:["MessageList"]):this.defaultRequest(e,"MessageList",{},""===a?n.Defaults.DefaultAjaxTimeout:n.Defaults.SearchAjaxTimeout,"MessageList/"+r.urlsafe_encode([t,i,s,a,u.projectHash(),d,"INBOX"===t?c.getFolderUidNext(t):"",u.threading()&&u.useThreads()?"1":"0",u.threading()&&t===u.messageListThreadFolder()?u.messageListThreadUids().join(","):""].join(String.fromCharCode(0))),l?[]:["MessageList"])},i.prototype.messageUploadAttachments=function(e,t){this.defaultRequest(e,"MessageUploadAttachments",{Attachments:t},999e3)},i.prototype.message=function(e,t,i){return t=o.pString(t),i=o.pInt(i),c.getFolderFromCacheList(t)&&i>0?(this.defaultRequest(e,"Message",{},null,"Message/"+r.urlsafe_encode([t,i,u.projectHash(),u.threading()&&u.useThreads()?"1":"0"].join(String.fromCharCode(0))),["Message"]),!0):!1},i.prototype.composeUploadExternals=function(e,t){this.defaultRequest(e,"ComposeUploadExternals",{Externals:t},999e3)},i.prototype.composeUploadDrive=function(e,t,i){this.defaultRequest(e,"ComposeUploadDrive",{AccessToken:i,Url:t},999e3)},i.prototype.folderInformation=function(e,t,i){var n=!0,r=[];o.isArray(i)&&0-1&&r.eq(o).removeClass("focused"),38===a&&o>0?o--:40===a&&os)?(this.oContentScrollable.scrollTop(i.top<0?this.oContentScrollable.scrollTop()+i.top-e:this.oContentScrollable.scrollTop()+i.top-s+o+e),!0):!1},i.prototype.messagesDrop=function(e,i){if(e&&i&&i.helper){var s=i.helper.data("rl-folder"),o=u.$html.hasClass("rl-ctrl-key-pressed"),n=i.helper.data("rl-uids");l.isNormal(s)&&""!==s&&l.isArray(n)&&t("App:RainLoop").moveMessagesToFolder(s,n,e.fullNameRaw,o)}},i.prototype.composeClick=function(){m.showScreenPopup(t("View:Popup:Compose"))},i.prototype.createFolder=function(){m.showScreenPopup(t("View:Popup:FolderCreate"))},i.prototype.configureFolders=function(){m.setHash(d.settings("folders"))},i.prototype.contactsClick=function(){this.allowContacts&&m.showScreenPopup(t("View:Popup:Contacts"))},e.exports=i}(t,e)},{$:20,"App:Knoin":27,"App:RainLoop":3,Enums:7,Globals:9,"Knoin:AbstractViewModel":30,LinkBuilder:11,"Storage:RainLoop:Cache":63,"Storage:RainLoop:Data":64,"Storage:Settings":69,Utils:14,"View:Popup:Compose":82,"View:Popup:Contacts":83,"View:Popup:FolderCreate":86,_:25,key:21,ko:22,window:26}],74:[function(e,t){!function(e,t){"use strict";function i(){w.call(this,"Right","MailMessageList"),this.sLastUid=null,this.bPrefetch=!1,this.emptySubjectValue="",this.hideDangerousActions=!!f.settingsGet("HideDangerousActions"),this.popupVisibility=d.popupVisibility,this.message=y.message,this.messageList=y.messageList,this.folderList=y.folderList,this.currentMessage=y.currentMessage,this.isMessageSelected=y.isMessageSelected,this.messageListSearch=y.messageListSearch,this.messageListError=y.messageListError,this.folderMenuForMove=y.folderMenuForMove,this.useCheckboxesInList=y.useCheckboxesInList,this.mainMessageListSearch=y.mainMessageListSearch,this.messageListEndFolder=y.messageListEndFolder,this.messageListChecked=y.messageListChecked,this.messageListCheckedOrSelected=y.messageListCheckedOrSelected,this.messageListCheckedOrSelectedUidsWithSubMails=y.messageListCheckedOrSelectedUidsWithSubMails,this.messageListCompleteLoadingThrottle=y.messageListCompleteLoadingThrottle,p.initOnStartOrLangChange(function(){this.emptySubjectValue=p.i18n("MESSAGE_LIST/EMPTY_SUBJECT_TEXT")},this),this.userQuota=y.userQuota,this.userUsageSize=y.userUsageSize,this.userUsageProc=y.userUsageProc,this.moveDropdownTrigger=n.observable(!1),this.moreDropdownTrigger=n.observable(!1),this.dragOver=n.observable(!1).extend({throttle:1}),this.dragOverEnter=n.observable(!1).extend({throttle:1}),this.dragOverArea=n.observable(null),this.dragOverBodyArea=n.observable(null),this.messageListItemTemplate=n.computed(function(){return c.Layout.NoPreview!==y.layout()?"MailMessageListItem":"MailMessageListItemNoPreviewPane"}),this.messageListSearchDesc=n.computed(function(){var e=y.messageListEndSearch();return""===e?"":p.i18n("MESSAGE_LIST/SEARCH_RESULT_FOR",{SEARCH:e})}),this.messageListPagenator=n.computed(p.computedPagenatorHelper(y.messageListPage,y.messageListPageCount)),this.checkAll=n.computed({read:function(){return 00&&t>0&&e>t},this),this.hasMessages=n.computed(function(){return 01?" ("+(100>e?e:"99+")+")":""},i.prototype.cancelSearch=function(){this.mainMessageListSearch(""),this.inputMessageListSearchFocus(!1)},i.prototype.moveSelectedMessagesToFolder=function(e,i){return this.canBeMoved()&&t("App:RainLoop").moveMessagesToFolder(y.currentFolderFullNameRaw(),y.messageListCheckedOrSelectedUidsWithSubMails(),e,i),!1},i.prototype.dragAndDronHelper=function(e){e&&e.checked(!0);var t=p.draggeblePlace(),i=y.messageListCheckedOrSelectedUidsWithSubMails();return t.data("rl-folder",y.currentFolderFullNameRaw()),t.data("rl-uids",i),t.find(".text").text(""+i.length),s.defer(function(){var e=y.messageListCheckedOrSelectedUidsWithSubMails();t.data("rl-uids",e),t.find(".text").text(""+e.length)}),t},i.prototype.onMessageResponse=function(e,t,i){y.hideMessageBodies(),y.messageLoading(!1),c.StorageResultType.Success===e&&t&&t.Result?y.setMessage(t,i):c.StorageResultType.Unload===e?(y.message(null),y.messageError("")):c.StorageResultType.Abort!==e&&(y.message(null),y.messageError(p.getNotification(t&&t.ErrorCode?t.ErrorCode:c.Notification.UnknownError)))},i.prototype.populateMessageBody=function(e){e&&(S.message(this.onMessageResponse,e.folderFullNameRaw,e.uid)?y.messageLoading(!0):p.log("Error: Unknown message request: "+e.folderFullNameRaw+" ~ "+e.uid+" [e-101]"))},i.prototype.setAction=function(e,i,o){var n=[],a=null,r=0;if(p.isUnd(o)&&(o=y.messageListChecked()),n=s.map(o,function(e){return e.uid}),""!==e&&00?100>e?e:"99+":""},i.prototype.verifyPgpSignedClearMessage=function(e){e&&e.verifyPgpSignedClearMessage()},i.prototype.decryptPgpEncryptedMessage=function(e){e&&e.decryptPgpEncryptedMessage(this.viewPgpPassword())},i.prototype.readReceipt=function(e){e&&""!==e.readReceipt()&&(g.sendReadReceiptMessage(u.emptyFunction,e.folderFullNameRaw,e.uid,e.readReceipt(),u.i18n("READ_RECEIPT/SUBJECT",{SUBJECT:e.subject()}),u.i18n("READ_RECEIPT/BODY",{"READ-RECEIPT":h.accountEmail()})),e.isReadReceipt(!0),p.storeMessageFlagsToCache(e),t("App:RainLoop").reloadFlagsCurrentMessageListAndMessageFromCache())},e.exports=i}(t,e)},{$:20,"App:Knoin":27,"App:RainLoop":3,Consts:6,Enums:7,Events:8,Globals:9,"Knoin:AbstractViewModel":30,"Storage:RainLoop:Cache":63,"Storage:RainLoop:Data":64,"Storage:RainLoop:Remote":68,Utils:14,"View:Popup:Compose":82,_:25,key:21,ko:22}],76:[function(e,t){!function(e,t){"use strict";function i(){n.call(this),o.constructorEnd(this)}var s=t("_"),o=t("App:Knoin"),n=t("View:RainLoop:AbstractSystemDropDown");o.extendAsViewModel(["View:RainLoop:MailBoxSystemDropDown","MailBoxSystemDropDownViewModel"],i),s.extend(i.prototype,n.prototype),e.exports=i}(t,e)},{"App:Knoin":27,"View:RainLoop:AbstractSystemDropDown":71,_:25}],77:[function(e,t){!function(e,t){"use strict";function i(){c.call(this,"Popups","PopupsAddAccount"),this.email=o.observable(""),this.password=o.observable(""),this.emailError=o.observable(!1),this.passwordError=o.observable(!1),this.email.subscribe(function(){this.emailError(!1)},this),this.password.subscribe(function(){this.passwordError(!1)},this),this.submitRequest=o.observable(!1),this.submitError=o.observable(""),this.emailFocus=o.observable(!1),this.addAccountCommand=a.createCommand(this,function(){return this.emailError(""===a.trim(this.email())),this.passwordError(""===a.trim(this.password())),this.emailError()||this.passwordError()?!1:(this.submitRequest(!0),r.accountAdd(s.bind(function(e,i){this.submitRequest(!1),n.StorageResultType.Success===e&&i&&"AccountAdd"===i.Action?i.Result?(t("App:RainLoop").accountsAndIdentities(),this.cancelCommand()):i.ErrorCode&&this.submitError(a.getNotification(i.ErrorCode)):this.submitError(a.getNotification(n.Notification.UnknownError))},this),this.email(),"",this.password()),!0)},function(){return!this.submitRequest()}),l.constructorEnd(this)}var s=t("_"),o=t("ko"),n=t("Enums"),a=t("Utils"),r=t("Storage:RainLoop:Remote"),l=t("App:Knoin"),c=t("Knoin:AbstractViewModel");l.extendAsViewModel(["View:Popup:AddAccount","PopupsAddAccountViewModel"],i),s.extend(i.prototype,c.prototype),i.prototype.clearPopup=function(){this.email(""),this.password(""),this.emailError(!1),this.passwordError(!1),this.submitRequest(!1),this.submitError("")},i.prototype.onShow=function(){this.clearPopup()},i.prototype.onFocus=function(){this.emailFocus(!0)},e.exports=i}(t,e)},{"App:Knoin":27,"App:RainLoop":3,Enums:7,"Knoin:AbstractViewModel":30,"Storage:RainLoop:Remote":68,Utils:14,_:25,ko:22}],78:[function(e,t){!function(e,t){"use strict";function i(){l.call(this,"Popups","PopupsAddOpenPgpKey"),this.key=o.observable(""),this.key.error=o.observable(!1),this.key.focus=o.observable(!1),this.key.subscribe(function(){this.key.error(!1)},this),this.addOpenPgpKeyCommand=n.createCommand(this,function(){var e=30,i=null,s=n.trim(this.key()),o=/[\-]{3,6}BEGIN[\s]PGP[\s](PRIVATE|PUBLIC)[\s]KEY[\s]BLOCK[\-]{3,6}[\s\S]+?[\-]{3,6}END[\s]PGP[\s](PRIVATE|PUBLIC)[\s]KEY[\s]BLOCK[\-]{3,6}/gi,r=a.openpgpKeyring;if(s=s.replace(/[\r\n]([a-zA-Z0-9]{2,}:[^\r\n]+)[\r\n]+([a-zA-Z0-9\/\\+=]{10,})/g,"\n$1!-!N!-!$2").replace(/[\n\r]+/g,"\n").replace(/!-!N!-!/g,"\n\n"),this.key.error(""===s),!r||this.key.error())return!1;for(;;){if(i=o.exec(s),!i||0>e)break;i[0]&&i[1]&&i[2]&&i[1]===i[2]&&("PRIVATE"===i[1]?r.privateKeys.importKey(i[0]):"PUBLIC"===i[1]&&r.publicKeys.importKey(i[0])),e--}return r.store(),t("App:RainLoop").reloadOpenPgpKeys(),n.delegateRun(this,"cancelCommand"),!0}),r.constructorEnd(this)}var s=t("_"),o=t("ko"),n=t("Utils"),a=t("Storage:RainLoop:Data"),r=t("App:Knoin"),l=t("Knoin:AbstractViewModel");r.extendAsViewModel(["View:Popup:AddOpenPgpKey","PopupsAddOpenPgpKeyViewModel"],i),s.extend(i.prototype,l.prototype),i.prototype.clearPopup=function(){this.key(""),this.key.error(!1)},i.prototype.onShow=function(){this.clearPopup()},i.prototype.onFocus=function(){this.key.focus(!0)},e.exports=i}(t,e)},{"App:Knoin":27,"App:RainLoop":3,"Knoin:AbstractViewModel":30,"Storage:RainLoop:Data":64,Utils:14,_:25,ko:22}],79:[function(e,t){!function(e,t){"use strict";function i(){c.call(this,"Popups","PopupsAdvancedSearch"),this.fromFocus=o.observable(!1),this.from=o.observable(""),this.to=o.observable(""),this.subject=o.observable(""),this.text=o.observable(""),this.selectedDateValue=o.observable(-1),this.hasAttachment=o.observable(!1),this.starred=o.observable(!1),this.unseen=o.observable(!1),this.searchCommand=a.createCommand(this,function(){var e=this.buildSearchString();""!==e&&r.mainMessageListSearch(e),this.cancelCommand()}),l.constructorEnd(this)}var s=t("_"),o=t("ko"),n=t("moment"),a=t("Utils"),r=t("Storage:RainLoop:Data"),l=t("App:Knoin"),c=t("Knoin:AbstractViewModel");l.extendAsViewModel(["View:Popup:AdvancedSearch","PopupsAdvancedSearchViewModel"],i),s.extend(i.prototype,c.prototype),i.prototype.buildSearchStringValue=function(e){return-1"},i.prototype.sendMessageResponse=function(e,t){var i=!1,o="";this.sending(!1),u.StorageResultType.Success===e&&t&&t.Result&&(i=!0,this.modalVisibility()&&p.delegateRun(this,"closeCommand")),this.modalVisibility()&&!i&&(t&&u.Notification.CantSaveMessage===t.ErrorCode?(this.sendSuccessButSaveError(!0),s.alert(p.trim(p.i18n("COMPOSE/SAVED_ERROR_ON_SEND")))):(o=p.getNotification(t&&t.ErrorCode?t.ErrorCode:u.Notification.CantSendMessage,t&&t.ErrorMessage?t.ErrorMessage:""),this.sendError(!0),s.alert(o||p.getNotification(u.Notification.CantSendMessage)))),this.reloadDraftFolder()},i.prototype.saveMessageResponse=function(e,t){var i=!1,o=null;this.saving(!1),u.StorageResultType.Success===e&&t&&t.Result&&t.Result.NewFolder&&t.Result.NewUid&&(this.bFromDraft&&(o=y.message(),o&&this.draftFolder()===o.folderFullNameRaw&&this.draftUid()===o.uid&&y.message(null)),this.draftFolder(t.Result.NewFolder),this.draftUid(t.Result.NewUid),this.modalVisibility()&&(this.savedTime(s.Math.round((new s.Date).getTime()/1e3)),this.savedOrSendingText(0"+e;break;default:e=e+"
    "+i}return e},i.prototype.editor=function(e){if(e){var t=this;!this.oEditor&&this.composeEditorArea()?o.delay(function(){t.oEditor=new f(t.composeEditorArea(),null,function(){e(t.oEditor)},function(e){t.isHtml(!!e)})},300):this.oEditor&&e(this.oEditor)}},i.prototype.onShow=function(e,t,i,s,a){C.routeOff();var r=this,l="",c="",d="",h="",g="",m=null,f="",b="",S=[],w={},A=y.accountEmail(),F=y.signature(),T=y.signatureToAll(),R=[],L=null,E=null,N=e||u.ComposeType.Empty,P=function(e,t){for(var i=0,s=e.length,o=[];s>i;i++)o.push(e[i].toLine(!!t));return o.join(", ")};if(t=t||null,t&&p.isNormal(t)&&(E=p.isArray(t)&&1===t.length?t[0]:p.isArray(t)?null:t),null!==A&&(w[A]=!0),this.currentIdentityID(this.findIdentityIdByMessage(N,E)),this.reset(),p.isNonEmptyArray(i)&&this.to(P(i)),""!==N&&E){switch(h=E.fullFormatDateValue(),g=E.subject(),L=E.aDraftInfo,m=n(E.body).clone(),m&&(m.find("blockquote.rl-bq-switcher").each(function(){n(this).removeClass("rl-bq-switcher hidden-bq")}),m.find(".rlBlockquoteSwitcher").each(function(){n(this).remove()})),m.find("[data-html-editor-font-wrapper]").removeAttr("data-html-editor-font-wrapper"),f=m.html(),N){case u.ComposeType.Empty:break;case u.ComposeType.Reply:this.to(P(E.replyEmails(w))),this.subject(p.replySubjectAdd("Re",g)),this.prepearMessageAttachments(E,N),this.aDraftInfo=["reply",E.uid,E.folderFullNameRaw],this.sInReplyTo=E.sMessageId,this.sReferences=p.trim(this.sInReplyTo+" "+E.sReferences);break;case u.ComposeType.ReplyAll:S=E.replyAllEmails(w),this.to(P(S[0])),this.cc(P(S[1])),this.subject(p.replySubjectAdd("Re",g)),this.prepearMessageAttachments(E,N),this.aDraftInfo=["reply",E.uid,E.folderFullNameRaw],this.sInReplyTo=E.sMessageId,this.sReferences=p.trim(this.sInReplyTo+" "+E.references());break;case u.ComposeType.Forward:this.subject(p.replySubjectAdd("Fwd",g)),this.prepearMessageAttachments(E,N),this.aDraftInfo=["forward",E.uid,E.folderFullNameRaw],this.sInReplyTo=E.sMessageId,this.sReferences=p.trim(this.sInReplyTo+" "+E.sReferences);break;case u.ComposeType.ForwardAsAttachment:this.subject(p.replySubjectAdd("Fwd",g)),this.prepearMessageAttachments(E,N),this.aDraftInfo=["forward",E.uid,E.folderFullNameRaw],this.sInReplyTo=E.sMessageId,this.sReferences=p.trim(this.sInReplyTo+" "+E.sReferences);break;case u.ComposeType.Draft:this.to(P(E.to)),this.cc(P(E.cc)),this.bcc(P(E.bcc)),this.bFromDraft=!0,this.draftFolder(E.folderFullNameRaw),this.draftUid(E.uid),this.subject(g),this.prepearMessageAttachments(E,N),this.aDraftInfo=p.isNonEmptyArray(L)&&3===L.length?L:null,this.sInReplyTo=E.sInReplyTo,this.sReferences=E.sReferences;break;case u.ComposeType.EditAsNew:this.to(P(E.to)),this.cc(P(E.cc)),this.bcc(P(E.bcc)),this.subject(g),this.prepearMessageAttachments(E,N),this.aDraftInfo=p.isNonEmptyArray(L)&&3===L.length?L:null,this.sInReplyTo=E.sInReplyTo,this.sReferences=E.sReferences}switch(N){case u.ComposeType.Reply:case u.ComposeType.ReplyAll:l=E.fromToLine(!1,!0),b=p.i18n("COMPOSE/REPLY_MESSAGE_TITLE",{DATETIME:h,EMAIL:l}),f="

    "+b+":

    "+f+"

    ";break;case u.ComposeType.Forward:l=E.fromToLine(!1,!0),c=E.toToLine(!1,!0),d=E.ccToLine(!1,!0),f="


    "+p.i18n("COMPOSE/FORWARD_MESSAGE_TOP_TITLE")+"
    "+p.i18n("COMPOSE/FORWARD_MESSAGE_TOP_FROM")+": "+l+"
    "+p.i18n("COMPOSE/FORWARD_MESSAGE_TOP_TO")+": "+c+(0"+p.i18n("COMPOSE/FORWARD_MESSAGE_TOP_CC")+": "+d:"")+"
    "+p.i18n("COMPOSE/FORWARD_MESSAGE_TOP_SENT")+": "+p.encodeHtml(h)+"
    "+p.i18n("COMPOSE/FORWARD_MESSAGE_TOP_SUBJECT")+": "+p.encodeHtml(g)+"

    "+f;break;case u.ComposeType.ForwardAsAttachment:f=""}T&&""!==F&&u.ComposeType.EditAsNew!==N&&u.ComposeType.Draft!==N&&(f=this.convertSignature(F,P(E.from,!0),f,N)),this.editor(function(e){e.setHtml(f,!1),E.isHtml()||e.modeToggle(!1)})}else u.ComposeType.Empty===N?(this.subject(p.isNormal(s)?""+s:""),f=p.isNormal(a)?""+a:"",T&&""!==F&&(f=this.convertSignature(F,"",p.convertPlainTextToHtml(f),N)),this.editor(function(e){e.setHtml(f,!1),u.EditorDefaultType.Html!==y.editorDefaultType()&&e.modeToggle(!1)})):p.isNonEmptyArray(t)&&o.each(t,function(e){r.addMessageAsAttachment(e)});R=this.getAttachmentsDownloadsForUpload(),p.isNonEmptyArray(R)&&v.messageUploadAttachments(function(e,t){if(u.StorageResultType.Success===e&&t&&t.Result){var i=null,s="";if(!r.viewModelVisibility())for(s in t.Result)t.Result.hasOwnProperty(s)&&(i=r.getAttachmentById(t.Result[s]),i&&i.tempName(s))}else r.setMessageAttachmentFailedDowbloadText()},R),this.triggerForResize()},i.prototype.onFocus=function(){""===this.to()?this.to.focusTrigger(!this.to.focusTrigger()):this.oEditor&&this.oEditor.focus(),this.triggerForResize()},i.prototype.editorResize=function(){this.oEditor&&this.oEditor.resize()},i.prototype.tryToClosePopup=function(){var e=this,i=t("View:Popup:Ask");C.isPopupVisible(i)||C.showScreenPopup(i,[p.i18n("POPUPS_ASK/DESC_WANT_CLOSE_THIS_WINDOW"),function(){e.modalVisibility()&&p.delegateRun(e,"closeCommand")}])},i.prototype.onBuild=function(){this.initUploader();var e=this,t=null;key("ctrl+q, command+q",u.KeyState.Compose,function(){return e.identitiesDropdownTrigger(!0),!1}),key("ctrl+s, command+s",u.KeyState.Compose,function(){return e.saveCommand(),!1}),key("ctrl+enter, command+enter",u.KeyState.Compose,function(){return e.sendCommand(),!1}),key("esc",u.KeyState.Compose,function(){return e.modalVisibility()&&e.tryToClosePopup(),!1}),h.$win.on("resize",function(){e.triggerForResize()}),this.dropboxEnabled()&&(t=s.document.createElement("script"),t.type="text/javascript",t.src="https://www.dropbox.com/static/api/1/dropins.js",n(t).attr("id","dropboxjs").attr("data-app-key",b.settingsGet("DropboxApiKey")),s.document.body.appendChild(t)),this.driveEnabled()&&n.getScript("https://apis.google.com/js/api.js",function(){s.gapi&&e.driveVisible(!0)})},i.prototype.driveCallback=function(e,t){if(t&&s.XMLHttpRequest&&s.google&&t[s.google.picker.Response.ACTION]===s.google.picker.Action.PICKED&&t[s.google.picker.Response.DOCUMENTS]&&t[s.google.picker.Response.DOCUMENTS][0]&&t[s.google.picker.Response.DOCUMENTS][0].id){var i=this,o=new s.XMLHttpRequest;o.open("GET","https://www.googleapis.com/drive/v2/files/"+t[s.google.picker.Response.DOCUMENTS][0].id),o.setRequestHeader("Authorization","Bearer "+e),o.addEventListener("load",function(){if(o&&o.responseText){var t=l.parse(o.responseText),s=function(e,t,i){e&&e.exportLinks&&(e.exportLinks[t]?(e.downloadUrl=e.exportLinks[t],e.title=e.title+"."+i,e.mimeType=t):e.exportLinks["application/pdf"]&&(e.downloadUrl=e.exportLinks["application/pdf"],e.title=e.title+".pdf",e.mimeType="application/pdf"))};if(t&&!t.downloadUrl&&t.mimeType&&t.exportLinks)switch(t.mimeType.toString().toLowerCase()){case"application/vnd.google-apps.document":s(t,"application/vnd.openxmlformats-officedocument.wordprocessingml.document","docx");break;case"application/vnd.google-apps.spreadsheet":s(t,"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","xlsx");break;case"application/vnd.google-apps.drawing":s(t,"image/png","png");break;case"application/vnd.google-apps.presentation":s(t,"application/vnd.openxmlformats-officedocument.presentationml.presentation","pptx");break;default:s(t,"application/pdf","pdf")}t&&t.downloadUrl&&i.addDriveAttachment(t,e)}}),o.send()}},i.prototype.driveCreatePiker=function(e){if(s.gapi&&e&&e.access_token){var t=this;s.gapi.load("picker",{callback:function(){if(s.google&&s.google.picker){var i=(new s.google.picker.PickerBuilder).addView((new s.google.picker.DocsView).setIncludeFolders(!0)).setAppId(b.settingsGet("GoogleClientID")).setOAuthToken(e.access_token).setCallback(o.bind(t.driveCallback,t,e.access_token)).enableFeature(s.google.picker.Feature.NAV_HIDDEN).build();i.setVisible(!0)}}})}},i.prototype.driveOpenPopup=function(){if(s.gapi){var e=this;s.gapi.load("auth",{callback:function(){var t=s.gapi.auth.getToken();t?e.driveCreatePiker(t):s.gapi.auth.authorize({client_id:b.settingsGet("GoogleClientID"),scope:"https://www.googleapis.com/auth/drive.readonly",immediate:!0},function(t){if(t&&!t.error){var i=s.gapi.auth.getToken();i&&e.driveCreatePiker(i)}else s.gapi.auth.authorize({client_id:b.settingsGet("GoogleClientID"),scope:"https://www.googleapis.com/auth/drive.readonly",immediate:!1},function(t){if(t&&!t.error){var i=s.gapi.auth.getToken();i&&e.driveCreatePiker(i)}})})}})}},i.prototype.getAttachmentById=function(e){for(var t=this.attachments(),i=0,s=t.length;s>i;i++)if(t[i]&&e===t[i].id)return t[i];return null},i.prototype.initUploader=function(){if(this.composeUploaderButton()){var e={},t=p.pInt(b.settingsGet("AttachmentLimit")),i=new c({action:m.upload(),name:"uploader",queueSize:2,multipleSizeLimit:50,disableFolderDragAndDrop:!1,clickElement:this.composeUploaderButton(),dragAndDropElement:this.composeUploaderDropPlace()});i?(i.on("onDragEnter",o.bind(function(){this.dragAndDropOver(!0)},this)).on("onDragLeave",o.bind(function(){this.dragAndDropOver(!1)},this)).on("onBodyDragEnter",o.bind(function(){this.dragAndDropVisible(!0)},this)).on("onBodyDragLeave",o.bind(function(){this.dragAndDropVisible(!1)},this)).on("onProgress",o.bind(function(t,i,o){var n=null;p.isUnd(e[t])?(n=this.getAttachmentById(t),n&&(e[t]=n)):n=e[t],n&&n.progress(" - "+s.Math.floor(i/o*100)+"%")},this)).on("onSelect",o.bind(function(e,s){this.dragAndDropOver(!1);var o=this,n=p.isUnd(s.FileName)?"":s.FileName.toString(),a=p.isNormal(s.Size)?p.pInt(s.Size):null,r=new w(e,n,a);return r.cancel=function(e){return function(){o.attachments.remove(function(t){return t&&t.id===e}),i&&i.cancel(e)}}(e),this.attachments.push(r),a>0&&t>0&&a>t?(r.error(p.i18n("UPLOAD/ERROR_FILE_IS_TOO_BIG")),!1):!0},this)).on("onStart",o.bind(function(t){var i=null;p.isUnd(e[t])?(i=this.getAttachmentById(t),i&&(e[t]=i)):i=e[t],i&&(i.waiting(!1),i.uploading(!0))},this)).on("onComplete",o.bind(function(t,i,s){var o="",n=null,a=null,r=this.getAttachmentById(t);a=i&&s&&s.Result&&s.Result.Attachment?s.Result.Attachment:null,n=s&&s.Result&&s.Result.ErrorCode?s.Result.ErrorCode:null,null!==n?o=p.getUploadErrorDescByCode(n):a||(o=p.i18n("UPLOAD/ERROR_UNKNOWN")),r&&(""!==o&&00&&o>0&&n>o?(i.uploading(!1),i.error(p.i18n("UPLOAD/ERROR_FILE_IS_TOO_BIG")),!1):(v.composeUploadExternals(function(e,t){var s=!1;i.uploading(!1),u.StorageResultType.Success===e&&t&&t.Result&&t.Result[i.id]&&(s=!0,i.tempName(t.Result[i.id])),s||i.error(p.getUploadErrorDescByCode(u.UploadErrorCode.FileNoUploaded))},[e.link]),!0)},i.prototype.addDriveAttachment=function(e,t){var i=this,s=function(e){return function(){i.attachments.remove(function(t){return t&&t.id===e})}},o=p.pInt(b.settingsGet("AttachmentLimit")),n=null,a=e.fileSize?p.pInt(e.fileSize):0;return n=new w(e.downloadUrl,e.title,a),n.fromMessage=!1,n.cancel=s(e.downloadUrl),n.waiting(!1).uploading(!0),this.attachments.push(n),a>0&&o>0&&a>o?(n.uploading(!1),n.error(p.i18n("UPLOAD/ERROR_FILE_IS_TOO_BIG")),!1):(v.composeUploadDrive(function(e,t){var i=!1;n.uploading(!1),u.StorageResultType.Success===e&&t&&t.Result&&t.Result[n.id]&&(i=!0,n.tempName(t.Result[n.id][0]),n.size(p.pInt(t.Result[n.id][1]))),i||n.error(p.getUploadErrorDescByCode(u.UploadErrorCode.FileNoUploaded))},e.downloadUrl,t),!0)},i.prototype.prepearMessageAttachments=function(e,t){if(e){var i=this,s=p.isNonEmptyArray(e.attachments())?e.attachments():[],o=0,n=s.length,a=null,r=null,l=!1,c=function(e){return function(){i.attachments.remove(function(t){return t&&t.id===e})}};if(u.ComposeType.ForwardAsAttachment===t)this.addMessageAsAttachment(e);else for(;n>o;o++){switch(r=s[o],l=!1,t){case u.ComposeType.Reply:case u.ComposeType.ReplyAll:l=r.isLinked;break;case u.ComposeType.Forward:case u.ComposeType.Draft:case u.ComposeType.EditAsNew:l=!0}l&&(a=new w(r.download,r.fileName,r.estimatedSize,r.isInline,r.isLinked,r.cid,r.contentLocation),a.fromMessage=!0,a.cancel=c(r.download),a.waiting(!1).uploading(!0),this.attachments.push(a))}}},i.prototype.removeLinkedAttachments=function(){this.attachments.remove(function(e){return e&&e.isLinked})},i.prototype.setMessageAttachmentFailedDowbloadText=function(){o.each(this.attachments(),function(e){e&&e.fromMessage&&e.waiting(!1).uploading(!1).error(p.getUploadErrorDescByCode(u.UploadErrorCode.FileNoUploaded))},this)},i.prototype.isEmptyForm=function(e){e=p.isUnd(e)?!0:!!e;var t=e?0===this.attachments().length:0===this.attachmentsInReady().length;return 0===this.to().length&&0===this.cc().length&&0===this.bcc().length&&0===this.subject().length&&t&&(!this.oEditor||""===this.oEditor.getData())},i.prototype.reset=function(){this.to(""),this.cc(""),this.bcc(""),this.replyTo(""),this.subject(""),this.requestReadReceipt(!1),this.aDraftInfo=null,this.sInReplyTo="",this.bFromDraft=!1,this.sReferences="",this.sendError(!1),this.sendSuccessButSaveError(!1),this.savedError(!1),this.savedTime(0),this.savedOrSendingText(""),this.emptyToError(!1),this.attachmentsInProcessError(!1),this.showCcAndBcc(!1),this.attachments([]),this.dragAndDropOver(!1),this.dragAndDropVisible(!1),this.draftFolder(""),this.draftUid(""),this.sending(!1),this.saving(!1),this.oEditor&&this.oEditor.clear(!1)},i.prototype.getAttachmentsDownloadsForUpload=function(){return o.map(o.filter(this.attachments(),function(e){return e&&""===e.tempName()}),function(e){return e.id})},i.prototype.triggerForResize=function(){this.resizer(!this.resizer()),this.editorResizeThrottle()},e.exports=i}(t,e)},{$:20,"App:Knoin":27,"App:RainLoop":3,Consts:6,Enums:7,Events:8,Globals:9,HtmlEditor:10,JSON:15,Jua:16,"Knoin:AbstractViewModel":30,LinkBuilder:11,"Model:ComposeAttachment":33,"Storage:RainLoop:Cache":63,"Storage:RainLoop:Data":64,"Storage:RainLoop:Remote":68,"Storage:Settings":69,Utils:14,"View:Popup:Ask":80,"View:Popup:ComposeOpenPgp":81,"View:Popup:FolderSystem":87,_:25,ko:22,moment:23,window:26}],83:[function(e,t){!function(e,t){"use strict";function i(){w.call(this,"Popups","PopupsContacts");var e=this,i=function(t){t&&0=e?1:e},this),this.contactsPagenator=a.computed(d.computedPagenatorHelper(this.contactsPage,this.contactsPageCount)),this.emptySelection=a.observable(!0),this.viewClearSearch=a.observable(!1),this.viewID=a.observable(""),this.viewReadOnly=a.observable(!1),this.viewProperties=a.observableArray([]),this.viewTags=a.observable(""),this.viewTags.visibility=a.observable(!1),this.viewTags.focusTrigger=a.observable(!1),this.viewTags.focusTrigger.subscribe(function(e){e||""!==this.viewTags()?e&&this.viewTags.visibility(!0):this.viewTags.visibility(!1)},this),this.viewSaveTrigger=a.observable(l.SaveSettingsStep.Idle),this.viewPropertiesNames=this.viewProperties.filter(function(e){return-1=s&&(this.bDropPageAfterDelete=!0),o.delay(function(){o.each(n,function(e){t.remove(e)})},500))},i.prototype.deleteSelectedContacts=function(){00?s:0),d.isNonEmptyArray(i.Result.Tags)&&(a=o.map(i.Result.Tags,function(e){var t=new y;return t.parse(e)?t:null}),a=o.compact(a))),t.contactsCount(s),t.contacts(n),t.contacts.loading(!1),t.contactTags(a),t.viewClearSearch(""!==t.search())},i,c.Defaults.ContactsPerPage,this.search())},i.prototype.onBuild=function(e){this.oContentVisible=n(".b-list-content",e),this.oContentScrollable=n(".content",this.oContentVisible),this.selector.init(this.oContentVisible,this.oContentScrollable,l.KeyState.ContactList);var t=this;r("delete",l.KeyState.ContactList,function(){return t.deleteCommand(),!1}),e.on("click",".e-pagenator .e-page",function(){var e=a.dataFor(this);e&&(t.contactsPage(d.pInt(e.value)),t.reloadContactList())}),this.initUploader()},i.prototype.onShow=function(){v.routeOff(),this.reloadContactList(!0)},i.prototype.onHide=function(){v.routeOn(),this.currentContact(null),this.emptySelection(!0),this.search(""),this.contactsCount(0),this.contacts([])},e.exports=i}(t,e)},{$:20,"App:Knoin":27,"App:RainLoop":3,Consts:6,Enums:7,Globals:9,"Knoin:AbstractViewModel":30,LinkBuilder:11,"Model:Contact":34,"Model:ContactProperty":35,"Model:ContactTag":36,"Model:Email":37,Selector:13,"Storage:RainLoop:Data":64,"Storage:RainLoop:Remote":68,Utils:14,"View:Popup:Compose":82,"View:Popup:Contacts":83,_:25,key:21,ko:22,window:26}],84:[function(e,t){!function(e,t){"use strict";function i(){c.call(this,"Popups","PopupsFilter"),this.filter=o.observable(null),this.selectedFolderValue=o.observable(n.Values.UnuseOptionValue),this.folderSelectList=r.folderMenuForMove,this.defautOptionsAfterRender=a.defautOptionsAfterRender,l.constructorEnd(this)}var s=t("_"),o=t("ko"),n=t("Consts"),a=t("Utils"),r=t("Storage:RainLoop:Data"),l=t("App:Knoin"),c=t("Knoin:AbstractViewModel");l.extendAsViewModel(["View:Popup:Filter","PopupsFilterViewModel"],i),s.extend(i.prototype,c.prototype),i.prototype.clearPopup=function(){},i.prototype.onShow=function(e){this.clearPopup(),this.filter(e)},e.exports=i}(t,e)},{"App:Knoin":27,Consts:6,"Knoin:AbstractViewModel":30,"Storage:RainLoop:Data":64,Utils:14,_:25,ko:22}],85:[function(e,t){!function(e,t){"use strict";function i(){d.call(this,"Popups","PopupsFolderClear"),this.selectedFolder=o.observable(null),this.clearingProcess=o.observable(!1),this.clearingError=o.observable(""),this.folderFullNameForClear=o.computed(function(){var e=this.selectedFolder();return e?e.printableFullName():""},this),this.folderNameForClear=o.computed(function(){var e=this.selectedFolder();return e?e.localName():""},this),this.dangerDescHtml=o.computed(function(){return a.i18n("POPUPS_CLEAR_FOLDER/DANGER_DESC_HTML_1",{FOLDER:this.folderNameForClear()})},this),this.clearCommand=a.createCommand(this,function(){var e=this,i=this.selectedFolder();i&&(r.message(null),r.messageList([]),this.clearingProcess(!0),i.messageCountAll(0),i.messageCountUnread(0),l.setFolderHash(i.fullNameRaw,""),c.folderClear(function(i,s){e.clearingProcess(!1),n.StorageResultType.Success===i&&s&&s.Result?(t("App:RainLoop").reloadMessageList(!0),e.cancelCommand()):e.clearingError(s&&s.ErrorCode?a.getNotification(s.ErrorCode):a.getNotification(n.Notification.MailServerError))},i.fullNameRaw))},function(){var e=this.selectedFolder(),t=this.clearingProcess();return!t&&null!==e}),u.constructorEnd(this)}var s=t("_"),o=t("ko"),n=t("Enums"),a=t("Utils"),r=t("Storage:RainLoop:Data"),l=t("Storage:RainLoop:Cache"),c=t("Storage:RainLoop:Remote"),u=t("App:Knoin"),d=t("Knoin:AbstractViewModel");u.extendAsViewModel(["View:Popup:FolderClear","PopupsFolderClearViewModel"],i),s.extend(i.prototype,d.prototype),i.prototype.clearPopup=function(){this.clearingProcess(!1),this.selectedFolder(null)},i.prototype.onShow=function(e){this.clearPopup(),e&&this.selectedFolder(e)},e.exports=i}(t,e)},{"App:Knoin":27,"App:RainLoop":3,Enums:7,"Knoin:AbstractViewModel":30,"Storage:RainLoop:Cache":63,"Storage:RainLoop:Data":64,"Storage:RainLoop:Remote":68,Utils:14,_:25,ko:22}],86:[function(e,t){!function(e,t){"use strict";function i(){d.call(this,"Popups","PopupsFolderCreate"),r.initOnStartOrLangChange(function(){this.sNoParentText=r.i18n("POPUPS_CREATE_FOLDER/SELECT_NO_PARENT")},this),this.folderName=o.observable(""),this.folderName.focused=o.observable(!1),this.selectedParentValue=o.observable(a.Values.UnuseOptionValue),this.parentFolderSelectList=o.computed(function(){var e=[],t=null,i=null,s=l.folderList(),o=function(e){return e?e.isSystemFolder()?e.name()+" "+e.manageFolderSystemName():e.name():""};return e.push(["",this.sNoParentText]),""!==l.namespace&&(t=function(e){return l.namespace!==e.fullNameRaw.substr(0,l.namespace.length)}),r.folderListOptionsBuilder([],s,[],e,null,t,i,o)},this),this.createFolder=r.createCommand(this,function(){var e=this.selectedParentValue();""===e&&1 li"),o=i&&("tab"===i.shortcut||"right"===i.shortcut),n=s.index(s.filter(".active"));return!o&&n>0?n--:o&&n"),this.submitRequest(!0),o.delay(function(){n=s.openpgp.generateKeyPair({userId:i,numBits:a.pInt(e.keyBitLength()),passphrase:a.trim(e.password())}),n&&n.privateKeyArmored&&(l.privateKeys.importKey(n.privateKeyArmored),l.publicKeys.importKey(n.publicKeyArmored),l.store(),t("App:RainLoop").reloadOpenPgpKeys(),a.delegateRun(e,"cancelCommand")),e.submitRequest(!1)},100),!0)}),l.constructorEnd(this)}var s=t("window"),o=t("_"),n=t("ko"),a=t("Utils"),r=t("Storage:RainLoop:Data"),l=t("App:Knoin"),c=t("Knoin:AbstractViewModel");l.extendAsViewModel(["View:Popup:NewOpenPgpKey","PopupsNewOpenPgpKeyViewModel"],i),o.extend(i.prototype,c.prototype),i.prototype.clearPopup=function(){this.name(""),this.password(""),this.email(""),this.email.error(!1),this.keyBitLength(2048)},i.prototype.onShow=function(){this.clearPopup()},i.prototype.onFocus=function(){this.email.focus(!0)},e.exports=i}(t,e)},{"App:Knoin":27,"App:RainLoop":3,"Knoin:AbstractViewModel":30,"Storage:RainLoop:Data":64,Utils:14,_:25,ko:22,window:26}],92:[function(e,t){!function(e,t){"use strict";function i(){c.call(this,"Popups","PopupsTwoFactorTest");var e=this;this.code=o.observable(""),this.code.focused=o.observable(!1),this.code.status=o.observable(null),this.testing=o.observable(!1),this.testCode=a.createCommand(this,function(){this.testing(!0),r.testTwoFactor(function(t,i){e.testing(!1),e.code.status(n.StorageResultType.Success===t&&i&&i.Result?!0:!1)},this.code())},function(){return""!==this.code()&&!this.testing()}),l.constructorEnd(this)}var s=t("_"),o=t("ko"),n=t("Enums"),a=t("Utils"),r=t("Storage:RainLoop:Remote"),l=t("App:Knoin"),c=t("Knoin:AbstractViewModel");l.extendAsViewModel(["View:Popup:TwoFactorTest","PopupsTwoFactorTestViewModel"],i),s.extend(i.prototype,c.prototype),i.prototype.clearPopup=function(){this.code(""),this.code.focused(!1),this.code.status(null),this.testing(!1)},i.prototype.onShow=function(){this.clearPopup()},i.prototype.onFocus=function(){this.code.focused(!0)},e.exports=i}(t,e)},{"App:Knoin":27,Enums:7,"Knoin:AbstractViewModel":30,"Storage:RainLoop:Remote":68,Utils:14,_:25,ko:22}],93:[function(e,t){!function(e,t){"use strict";function i(){r.call(this,"Popups","PopupsViewOpenPgpKey"),this.key=o.observable(""),this.keyDom=o.observable(null),a.constructorEnd(this)}var s=t("_"),o=t("ko"),n=t("Utils"),a=t("App:Knoin"),r=t("Knoin:AbstractViewModel");a.extendAsViewModel(["View:Popup:ViewOpenPgpKey","PopupsViewOpenPgpKeyViewModel"],i),s.extend(i.prototype,r.prototype),i.prototype.clearPopup=function(){this.key("")},i.prototype.selectKey=function(){var e=this.keyDom();e&&n.selectElement(e)},i.prototype.onShow=function(e){this.clearPopup(),e&&this.key(e.armor)},e.exports=i}(t,e)},{"App:Knoin":27,"Knoin:AbstractViewModel":30,Utils:14,_:25,ko:22}],94:[function(e,t){!function(e,t){"use strict";function i(e){r.call(this,"Left","SettingsMenu"),this.leftPanelDisabled=o.leftPanelDisabled,this.menu=e.menu,a.constructorEnd(this)}var s=t("_"),o=t("Globals"),n=t("LinkBuilder"),a=t("App:Knoin"),r=t("Knoin:AbstractViewModel");a.extendAsViewModel(["View:RainLoop:SettingsMenu","SettingsMenuViewModel"],i),s.extend(i.prototype,r.prototype),i.prototype.link=function(e){return n.settings(e)},i.prototype.backToMailBoxClick=function(){a.setHash(n.inbox())},e.exports=i}(t,e)},{"App:Knoin":27,Globals:9,"Knoin:AbstractViewModel":30,LinkBuilder:11,_:25}],95:[function(e,t){!function(e,t){"use strict";function i(){c.call(this,"Right","SettingsPane"),l.constructorEnd(this)}var s=t("_"),o=t("key"),n=t("Enums"),a=t("LinkBuilder"),r=t("Storage:RainLoop:Data"),l=t("App:Knoin"),c=t("Knoin:AbstractViewModel");l.extendAsViewModel(["View:RainLoop:SettingsPane","SettingsPaneViewModel"],i),s.extend(i.prototype,c.prototype),i.prototype.onBuild=function(){var e=this;o("esc",n.KeyState.Settings,function(){e.backToMailBoxClick()})},i.prototype.onShow=function(){r.message(null)},i.prototype.backToMailBoxClick=function(){l.setHash(a.inbox())},e.exports=i}(t,e)},{"App:Knoin":27,Enums:7,"Knoin:AbstractViewModel":30,LinkBuilder:11,"Storage:RainLoop:Data":64,_:25,key:21}],96:[function(e,t){!function(e,t){"use strict";function i(){n.call(this),o.constructorEnd(this)}var s=t("_"),o=t("App:Knoin"),n=t("View:RainLoop:AbstractSystemDropDown");o.extendAsViewModel(["View:RainLoop:SettingsSystemDropDown","SettingsSystemDropDownViewModel"],i),s.extend(i.prototype,n.prototype),e.exports=i}(t,e)},{"App:Knoin":27,"View:RainLoop:AbstractSystemDropDown":71,_:25}]},{},[1]); \ No newline at end of file